From 901a85880c6d380dbf013fd375f8b30b4c3460e6 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 10 Dec 2016 19:51:25 -0500 Subject: [PATCH] Update STU3 definitions and being in STU2.1 defs too --- .../main/java/example/ExtensionsDstu3.java | 4 +- .../main/java/example/FhirContextIntro.java | 2 +- .../java/ca/uhn/fhir/context/FhirContext.java | 7 + .../ca/uhn/fhir/context/FhirVersionEnum.java | 2 +- .../fhir/exceptions/DefinitionException.java | 0 .../hl7/fhir/exceptions/FHIRException.java | 0 .../hl7/fhir/exceptions/FHIRFormatError.java | 0 .../NoTerminologyServiceException.java | 0 .../fhir/exceptions/PathEngineException.java | 0 .../TerminologyServiceException.java | 0 .../hl7/fhir/exceptions/UcumException.java | 0 .../java/org/hl7/fhir/utilities/CSFile.java | 0 .../CommaSeparatedStringBuilder.java | 0 .../org/hl7/fhir/utilities/FileNotifier.java | 0 .../org/hl7/fhir/utilities/MyURIResolver.java | 0 .../java/org/hl7/fhir/utilities/Table.java | 0 .../java/org/hl7/fhir/utilities/TextFile.java | 0 .../hl7/fhir/utilities/TextStreamWriter.java | 0 .../org/hl7/fhir/utilities/Utilities.java | 0 .../hl7/fhir/utilities/ZipURIResolver.java | 0 .../xhtml/HierarchicalTableGenerator.java | 65 +- .../hl7/fhir/utilities/xhtml/NodeType.java | 0 .../fhir/utilities/xhtml/XhtmlComposer.java | 0 .../fhir/utilities/xhtml/XhtmlDocument.java | 0 .../hl7/fhir/utilities/xhtml/XhtmlNode.java | 0 .../hl7/fhir/utilities/xhtml/XhtmlParser.java | 1092 + .../hl7/fhir/utilities/xml/IXMLWriter.java | 0 .../fhir/utilities/xml/SchematronWriter.java | 0 .../hl7/fhir/utilities/xml/XMLNamespace.java | 0 .../org/hl7/fhir/utilities/xml/XMLUtil.java | 0 .../org/hl7/fhir/utilities/xml/XMLWriter.java | 0 .../fhir/utilities/xml/XMLWriterState.java | 3 - .../utilities/xml/XMLWriterStateStack.java | 0 .../fhir/narrative/datatype/HumanNameDt.html | 21 +- .../client/GenericJaxRsClientDstu3Test.java | 44 +- .../JaxRsPatientRestProviderDstu3.java | 4 +- .../JaxRsPatientProviderDstu3Test.java | 8 +- .../dao/dstu3/SearchParamExtractorDstu3.java | 47 +- .../FhirResourceDaoDstu3ContainedTest.java | 4 +- .../FhirResourceDaoDstu3InterceptorTest.java | 14 +- .../FhirResourceDaoDstu3SearchFtTest.java | 14 +- .../FhirResourceDaoDstu3SearchNoFtTest.java | 90 +- .../FhirResourceDaoDstu3SubscriptionTest.java | 6 +- .../FhirResourceDaoDstu3TerminologyTest.java | 75 +- .../dao/dstu3/FhirResourceDaoDstu3Test.java | 128 +- .../dstu3/FhirResourceDaoDstu3UpdateTest.java | 40 +- .../FhirResourceDaoDstu3ValidateTest.java | 8 +- .../jpa/dao/dstu3/FhirSearchDaoDstu3Test.java | 8 +- .../jpa/dao/dstu3/FhirSystemDaoDstu3Test.java | 46 +- ...nInterceptorResourceProviderDstu3Test.java | 12 +- .../dstu3/BaseResourceProviderDstu3Test.java | 2 +- .../dstu3/ResourceProviderDstu3Test.java | 152 +- ...roviderQuestionnaireResponseDstu3Test.java | 4 +- .../StaleSearchDeletingSvcDstu3Test.java | 2 +- .../dstu3/SubscriptionsDstu3Test.java | 6 +- .../dstu3/SystemProviderDstu3Test.java | 16 +- .../fhir/jpa/term/TerminologySvcImplTest.java | 22 +- .../java/ca/uhn/fhirtest/UhnFhirTestApp.java | 2 +- hapi-fhir-structures-dstu2.1/.classpath | 30 + hapi-fhir-structures-dstu2.1/.gitignore | 1 + hapi-fhir-structures-dstu2.1/.project | 29 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../.settings/org.eclipse.m2e.core.prefs | 4 + ....eclipse.wst.common.project.facet.core.xml | 4 + hapi-fhir-structures-dstu2.1/pom.xml | 227 + .../dstu2016may/hapi/ctx/FhirDstu2_1.java | 152 + .../rest/server/Dstu2_1BundleFactory.java | 449 + .../server/ServerConformanceProvider.java | 661 + .../rest/server/ServerProfileProvider.java | 90 + .../hl7/fhir/dstu2016may/model/Account.java | 1058 + .../dstu2016may/model/ActionDefinition.java | 2254 ++ .../hl7/fhir/dstu2016may/model/Address.java | 1035 + .../org/hl7/fhir/dstu2016may/model/Age.java | 88 + .../dstu2016may/model/AllergyIntolerance.java | 2653 +++ .../fhir/dstu2016may/model/Annotation.java | 349 + .../fhir/dstu2016may/model/Appointment.java | 2143 ++ .../model/AppointmentResponse.java | 858 + .../fhir/dstu2016may/model/Attachment.java | 688 + .../fhir/dstu2016may/model/AuditEvent.java | 3682 ++++ .../dstu2016may/model/BackboneElement.java | 195 + .../org/hl7/fhir/dstu2016may/model/Base.java | 609 + .../dstu2016may/model/Base64BinaryType.java | 76 + .../fhir/dstu2016may/model/BaseBinary.java | 26 + .../dstu2016may/model/BaseDateTimeType.java | 743 + .../fhir/dstu2016may/model/BaseExtension.java | 17 + .../fhir/dstu2016may/model/BaseNarrative.java | 50 + .../fhir/dstu2016may/model/BaseReference.java | 65 + .../fhir/dstu2016may/model/BaseResource.java | 33 + .../org/hl7/fhir/dstu2016may/model/Basic.java | 596 + .../hl7/fhir/dstu2016may/model/Binary.java | 301 + .../hl7/fhir/dstu2016may/model/BodySite.java | 592 + .../fhir/dstu2016may/model/BooleanType.java | 102 + .../hl7/fhir/dstu2016may/model/Bundle.java | 2789 +++ .../hl7/fhir/dstu2016may/model/CarePlan.java | 3767 ++++ .../hl7/fhir/dstu2016may/model/CareTeam.java | 1030 + .../org/hl7/fhir/dstu2016may/model/Claim.java | 8270 +++++++ .../fhir/dstu2016may/model/ClaimResponse.java | 6116 ++++++ .../dstu2016may/model/ClinicalImpression.java | 2399 ++ .../fhir/dstu2016may/model/CodeSystem.java | 4082 ++++ .../hl7/fhir/dstu2016may/model/CodeType.java | 76 + .../dstu2016may/model/CodeableConcept.java | 271 + .../hl7/fhir/dstu2016may/model/Coding.java | 491 + .../fhir/dstu2016may/model/Communication.java | 1597 ++ .../model/CommunicationRequest.java | 1736 ++ .../fhir/dstu2016may/model/Comparison.java | 110 + .../model/CompartmentDefinition.java | 1741 ++ .../fhir/dstu2016may/model/Composition.java | 2742 +++ .../fhir/dstu2016may/model/ConceptMap.java | 3031 +++ .../hl7/fhir/dstu2016may/model/Condition.java | 2132 ++ .../fhir/dstu2016may/model/Configuration.java | 106 + .../fhir/dstu2016may/model/Conformance.java | 8989 ++++++++ .../hl7/fhir/dstu2016may/model/Constants.java | 40 + .../fhir/dstu2016may/model/ContactPoint.java | 724 + .../hl7/fhir/dstu2016may/model/Contract.java | 4811 ++++ .../org/hl7/fhir/dstu2016may/model/Count.java | 88 + .../hl7/fhir/dstu2016may/model/Coverage.java | 1537 ++ .../fhir/dstu2016may/model/DataElement.java | 2046 ++ .../dstu2016may/model/DataRequirement.java | 1153 + .../fhir/dstu2016may/model/DateTimeType.java | 196 + .../hl7/fhir/dstu2016may/model/DateType.java | 171 + .../fhir/dstu2016may/model/DecimalType.java | 177 + .../model/DecisionSupportRule.java | 595 + .../model/DecisionSupportServiceModule.java | 500 + .../fhir/dstu2016may/model/DetectedIssue.java | 1308 ++ .../hl7/fhir/dstu2016may/model/Device.java | 1497 ++ .../dstu2016may/model/DeviceComponent.java | 1288 ++ .../fhir/dstu2016may/model/DeviceMetric.java | 1791 ++ .../dstu2016may/model/DeviceUseRequest.java | 1475 ++ .../dstu2016may/model/DeviceUseStatement.java | 845 + .../dstu2016may/model/DiagnosticOrder.java | 2497 +++ .../dstu2016may/model/DiagnosticReport.java | 2056 ++ .../hl7/fhir/dstu2016may/model/Distance.java | 88 + .../dstu2016may/model/DocumentManifest.java | 1587 ++ .../dstu2016may/model/DocumentReference.java | 2991 +++ .../dstu2016may/model/DomainResource.java | 390 + .../hl7/fhir/dstu2016may/model/Duration.java | 88 + .../hl7/fhir/dstu2016may/model/Element.java | 298 + .../dstu2016may/model/ElementDefinition.java | 5451 +++++ .../dstu2016may/model/EligibilityRequest.java | 1353 ++ .../model/EligibilityResponse.java | 2163 ++ .../hl7/fhir/dstu2016may/model/Encounter.java | 3850 ++++ .../dstu2016may/model/EnrollmentRequest.java | 841 + .../dstu2016may/model/EnrollmentResponse.java | 807 + .../fhir/dstu2016may/model/EnumFactory.java | 62 + .../fhir/dstu2016may/model/Enumeration.java | 134 + .../fhir/dstu2016may/model/Enumerations.java | 10084 +++++++++ .../fhir/dstu2016may/model/EpisodeOfCare.java | 1500 ++ .../dstu2016may/model/ExpansionProfile.java | 3625 ++++ .../model/ExplanationOfBenefit.java | 11620 ++++++++++ .../dstu2016may/model/ExpressionNode.java | 631 + .../hl7/fhir/dstu2016may/model/Extension.java | 394 + .../dstu2016may/model/ExtensionHelper.java | 148 + .../hl7/fhir/dstu2016may/model/Factory.java | 251 + .../model/FamilyMemberHistory.java | 1589 ++ .../org/hl7/fhir/dstu2016may/model/Flag.java | 841 + .../org/hl7/fhir/dstu2016may/model/Goal.java | 1532 ++ .../org/hl7/fhir/dstu2016may/model/Group.java | 1681 ++ .../dstu2016may/model/GuidanceResponse.java | 2288 ++ .../dstu2016may/model/HealthcareService.java | 2578 +++ .../hl7/fhir/dstu2016may/model/HumanName.java | 954 + .../hl7/fhir/dstu2016may/model/IdType.java | 764 + .../fhir/dstu2016may/model/Identifier.java | 623 + .../dstu2016may/model/ImagingExcerpt.java | 3230 +++ .../model/ImagingObjectSelection.java | 1984 ++ .../fhir/dstu2016may/model/ImagingStudy.java | 2866 +++ .../fhir/dstu2016may/model/Immunization.java | 2910 +++ .../model/ImmunizationRecommendation.java | 1710 ++ .../model/ImplementationGuide.java | 3830 ++++ .../fhir/dstu2016may/model/InstantType.java | 223 + .../fhir/dstu2016may/model/IntegerType.java | 110 + .../hl7/fhir/dstu2016may/model/Library.java | 2090 ++ .../hl7/fhir/dstu2016may/model/Linkage.java | 660 + .../fhir/dstu2016may/model/ListResource.java | 1761 ++ .../hl7/fhir/dstu2016may/model/Location.java | 1702 ++ .../fhir/dstu2016may/model/MarkdownType.java | 76 + .../hl7/fhir/dstu2016may/model/Measure.java | 3240 +++ .../fhir/dstu2016may/model/MeasureReport.java | 3001 +++ .../org/hl7/fhir/dstu2016may/model/Media.java | 1160 + .../fhir/dstu2016may/model/Medication.java | 1696 ++ .../model/MedicationAdministration.java | 1911 ++ .../dstu2016may/model/MedicationDispense.java | 2561 +++ .../dstu2016may/model/MedicationOrder.java | 2744 +++ .../model/MedicationStatement.java | 1935 ++ .../fhir/dstu2016may/model/MessageHeader.java | 2236 ++ .../org/hl7/fhir/dstu2016may/model/Meta.java | 533 + .../dstu2016may/model/ModuleDefinition.java | 3382 +++ .../dstu2016may/model/ModuleMetadata.java | 3227 +++ .../org/hl7/fhir/dstu2016may/model/Money.java | 88 + .../fhir/dstu2016may/model/NamingSystem.java | 2065 ++ .../hl7/fhir/dstu2016may/model/Narrative.java | 363 + .../dstu2016may/model/NutritionOrder.java | 3390 +++ .../fhir/dstu2016may/model/Observation.java | 3523 +++ .../hl7/fhir/dstu2016may/model/OidType.java | 75 + .../model/OperationDefinition.java | 3169 +++ .../dstu2016may/model/OperationOutcome.java | 1344 ++ .../org/hl7/fhir/dstu2016may/model/Order.java | 1051 + .../fhir/dstu2016may/model/OrderResponse.java | 970 + .../hl7/fhir/dstu2016may/model/OrderSet.java | 461 + .../fhir/dstu2016may/model/Organization.java | 1179 + .../model/ParameterDefinition.java | 618 + .../fhir/dstu2016may/model/Parameters.java | 638 + .../hl7/fhir/dstu2016may/model/Patient.java | 3013 +++ .../fhir/dstu2016may/model/PaymentNotice.java | 1100 + .../model/PaymentReconciliation.java | 2056 ++ .../hl7/fhir/dstu2016may/model/Period.java | 301 + .../hl7/fhir/dstu2016may/model/Person.java | 1541 ++ .../dstu2016may/model/PositiveIntType.java | 97 + .../fhir/dstu2016may/model/Practitioner.java | 2212 ++ .../dstu2016may/model/PractitionerRole.java | 1800 ++ .../fhir/dstu2016may/model/PrimitiveType.java | 160 + .../hl7/fhir/dstu2016may/model/Procedure.java | 2220 ++ .../dstu2016may/model/ProcedureRequest.java | 1569 ++ .../dstu2016may/model/ProcessRequest.java | 1600 ++ .../dstu2016may/model/ProcessResponse.java | 1339 ++ .../hl7/fhir/dstu2016may/model/Property.java | 140 + .../hl7/fhir/dstu2016may/model/Protocol.java | 3927 ++++ .../fhir/dstu2016may/model/Provenance.java | 2053 ++ .../hl7/fhir/dstu2016may/model/Quantity.java | 672 + .../fhir/dstu2016may/model/Questionnaire.java | 3473 +++ .../model/QuestionnaireResponse.java | 1854 ++ .../org/hl7/fhir/dstu2016may/model/Range.java | 226 + .../org/hl7/fhir/dstu2016may/model/Ratio.java | 227 + .../hl7/fhir/dstu2016may/model/Reference.java | 321 + .../dstu2016may/model/ReferralRequest.java | 1759 ++ .../fhir/dstu2016may/model/RelatedPerson.java | 1055 + .../hl7/fhir/dstu2016may/model/Resource.java | 382 + .../dstu2016may/model/ResourceFactory.java | 631 + .../fhir/dstu2016may/model/ResourceType.java | 587 + .../dstu2016may/model/RiskAssessment.java | 1429 ++ .../fhir/dstu2016may/model/SampledData.java | 668 + .../hl7/fhir/dstu2016may/model/Schedule.java | 653 + .../dstu2016may/model/SearchParameter.java | 1824 ++ .../hl7/fhir/dstu2016may/model/Sequence.java | 3999 ++++ .../hl7/fhir/dstu2016may/model/SidType.java | 38 + .../hl7/fhir/dstu2016may/model/Signature.java | 485 + .../dstu2016may/model/SimpleQuantity.java | 88 + .../org/hl7/fhir/dstu2016may/model/Slot.java | 1061 + .../hl7/fhir/dstu2016may/model/Specimen.java | 2280 ++ .../fhir/dstu2016may/model/StringType.java | 95 + .../model/StructureDefinition.java | 3495 +++ .../fhir/dstu2016may/model/StructureMap.java | 5599 +++++ .../fhir/dstu2016may/model/Subscription.java | 1420 ++ .../hl7/fhir/dstu2016may/model/Substance.java | 1125 + .../dstu2016may/model/SupplyDelivery.java | 1044 + .../fhir/dstu2016may/model/SupplyRequest.java | 1229 ++ .../org/hl7/fhir/dstu2016may/model/Task.java | 2474 +++ .../model/TemporalPrecisionEnum.java | 62 + .../fhir/dstu2016may/model/TestScript.java | 10956 ++++++++++ .../hl7/fhir/dstu2016may/model/TimeType.java | 76 + .../hl7/fhir/dstu2016may/model/Timing.java | 1811 ++ .../dstu2016may/model/TriggerDefinition.java | 595 + .../org/hl7/fhir/dstu2016may/model/Type.java | 47 + .../dstu2016may/model/UnsignedIntType.java | 98 + .../hl7/fhir/dstu2016may/model/UriType.java | 163 + .../hl7/fhir/dstu2016may/model/UuidType.java | 70 + .../hl7/fhir/dstu2016may/model/ValueSet.java | 4674 ++++ .../dstu2016may/model/VisionPrescription.java | 2152 ++ .../src/main/resources/.keep | 0 .../dstu2016may/model/fhirversion.properties | 165 + .../ca/uhn/fhir/model/IdTypeDstu21Test.java | 240 + .../ca/uhn/fhir/model/ModelDstu21Test.java | 129 + .../model/ModelSerializationDstu21Test.java | 89 + .../fhir/parser/CustomDiagnosticReport.java | 14 + .../ca/uhn/fhir/parser/CustomObservation.java | 14 + .../fhir/parser/CustomResource364Dstu21.java | 97 + .../uhn/fhir/parser/CustomTypeDstu21Test.java | 607 + .../EmptyElementWithExtensionDstu3Test.java | 84 + .../ca/uhn/fhir/parser/ErrorHandlerTest.java | 96 + .../ca/uhn/fhir/parser/FooMessageHeader.java | 47 + .../FooMessageHeaderWithExplicitField.java | 58 + .../uhn/fhir/parser/JsonParserDstu21Test.java | 1896 ++ ...hOneDeclaredEnumerationExtensionDstu3.java | 68 + .../PatientWithCustomCompositeExtension.java | 82 + .../PatientWithExtendedContactDstu3.java | 62 + .../fhir/parser/ReportObservationDstu3.java | 112 + .../uhn/fhir/parser/RoundTripDstu3Test.java | 120 + .../uhn/fhir/parser/XmlParserDstu3Test.java | 2734 +++ .../client/ClientWithCustomTypeDstu3Test.java | 115 + .../rest/client/GenericClientDstu3Test.java | 2104 ++ .../rest/client/MyPatientWithExtensions.java | 92 + .../client/NonGenericClientDstu3Test.java | 194 + .../rest/client/OperationClientDstu3Test.java | 195 + .../rest/client/PatchClientDstu3Test.java | 139 + .../rest/client/RestfulClientFactoryTest.java | 76 + .../rest/client/SearchClientDstu3Test.java | 246 + .../rest/server/CreateBinaryDstu3Test.java | 172 + .../uhn/fhir/rest/server/CreateDstu3Test.java | 279 + .../rest/server/CustomTypeServerDstu3.java | 180 + .../server/DateRangeParamSearchDstu3Test.java | 233 + .../server/DeleteConditionalDstu3Test.java | 133 + .../rest/server/FormatParameterDstu3Test.java | 256 + .../rest/server/InterceptorDstu3Test.java | 177 + .../server/MetadataConformanceDstu3Test.java | 190 + .../rest/server/OperationServerDstu3Test.java | 784 + ...onServerWithSearchParamTypesDstu3Test.java | 505 + .../uhn/fhir/rest/server/PatchDstu3Test.java | 191 + .../uhn/fhir/rest/server/ReadDstu3Test.java | 122 + .../server/SearchCountParamDstu3Test.java | 183 + .../uhn/fhir/rest/server/SearchDstu3Test.java | 140 + .../rest/server/SearchHasParamDstu3Test.java | 122 + .../fhir/rest/server/SearchPostDstu3Test.java | 264 + .../fhir/rest/server/SearchSortDstu3Test.java | 133 + .../SearchWithGenericListDstu3Test.java | 120 + .../server/SearchWithIncludesDstu3Test.java | 134 + ...rchWithServerAddressStrategyDstu3Test.java | 171 + .../rest/server/ServerExceptionDstu3Test.java | 138 + .../rest/server/ServerMimetypeDstu21Test.java | 410 + .../server/ServerUsingOldTypesDstu3Test.java | 115 + .../UnclassifiedServerExceptionDstu3Test.java | 109 + .../uhn/fhir/rest/server/UpdateDstu3Test.java | 194 + .../fhir/rest/server/ValidateDstu3Test.java | 321 + .../src/test/resources/.keep | 0 .../src/test/resources/logback-test.xml | 30 + .../dstu3/conformance/ProfileUtilities.java | 332 +- .../fhir/dstu3/elementmodel/JsonParser.java | 66 +- .../fhir/dstu3/elementmodel/XmlParser.java | 19 +- .../hl7/fhir/dstu3/formats/XmlParserBase.java | 5 +- .../hapi/fluentpath/FluentPathDstu3.java | 6 +- .../ServerCapabilityStatementProvider.java | 29 +- .../org/hl7/fhir/dstu3/model/Account.java | 353 +- .../fhir/dstu3/model/ActivityDefinition.java | 91 +- .../org/hl7/fhir/dstu3/model/Address.java | 4 +- .../java/org/hl7/fhir/dstu3/model/Age.java | 2 +- .../fhir/dstu3/model/AllergyIntolerance.java | 776 +- .../org/hl7/fhir/dstu3/model/Annotation.java | 2 +- .../org/hl7/fhir/dstu3/model/Appointment.java | 2 +- .../fhir/dstu3/model/AppointmentResponse.java | 2 +- .../org/hl7/fhir/dstu3/model/Attachment.java | 16 +- .../org/hl7/fhir/dstu3/model/AuditEvent.java | 82 +- .../hl7/fhir/dstu3/model/BackboneElement.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Basic.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Binary.java | 76 +- .../org/hl7/fhir/dstu3/model/BodySite.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Bundle.java | 117 +- .../fhir/dstu3/model/CapabilityStatement.java | 726 +- .../org/hl7/fhir/dstu3/model/CarePlan.java | 9 +- .../org/hl7/fhir/dstu3/model/CareTeam.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Claim.java | 3722 ++-- .../hl7/fhir/dstu3/model/ClaimResponse.java | 1139 +- .../fhir/dstu3/model/ClinicalImpression.java | 20 +- .../org/hl7/fhir/dstu3/model/CodeSystem.java | 72 +- .../hl7/fhir/dstu3/model/CodeableConcept.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Coding.java | 2 +- .../hl7/fhir/dstu3/model/Communication.java | 2 +- .../dstu3/model/CommunicationRequest.java | 2 +- .../dstu3/model/CompartmentDefinition.java | 2 +- .../org/hl7/fhir/dstu3/model/Composition.java | 2 +- .../org/hl7/fhir/dstu3/model/ConceptMap.java | 22 +- .../org/hl7/fhir/dstu3/model/Condition.java | 191 +- .../org/hl7/fhir/dstu3/model/Consent.java | 2 +- .../org/hl7/fhir/dstu3/model/Constants.java | 8 +- .../hl7/fhir/dstu3/model/ContactDetail.java | 2 +- .../hl7/fhir/dstu3/model/ContactPoint.java | 26 +- .../org/hl7/fhir/dstu3/model/Contract.java | 253 +- .../org/hl7/fhir/dstu3/model/Contributor.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Count.java | 2 +- .../org/hl7/fhir/dstu3/model/Coverage.java | 2320 +- .../org/hl7/fhir/dstu3/model/DataElement.java | 2 +- .../hl7/fhir/dstu3/model/DataRequirement.java | 96 +- .../hl7/fhir/dstu3/model/DetectedIssue.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Device.java | 12 +- .../hl7/fhir/dstu3/model/DeviceComponent.java | 2 +- .../hl7/fhir/dstu3/model/DeviceMetric.java | 2 +- .../fhir/dstu3/model/DeviceUseRequest.java | 66 +- .../fhir/dstu3/model/DeviceUseStatement.java | 62 +- .../fhir/dstu3/model/DiagnosticReport.java | 19 +- .../fhir/dstu3/model/DiagnosticRequest.java | 880 +- .../org/hl7/fhir/dstu3/model/Distance.java | 2 +- .../fhir/dstu3/model/DocumentManifest.java | 2 +- .../fhir/dstu3/model/DocumentReference.java | 4 +- .../hl7/fhir/dstu3/model/DomainResource.java | 2 +- .../fhir/dstu3/model/DosageInstruction.java | 61 +- .../org/hl7/fhir/dstu3/model/Duration.java | 2 +- .../org/hl7/fhir/dstu3/model/Element.java | 12 +- .../fhir/dstu3/model/ElementDefinition.java | 546 +- .../fhir/dstu3/model/EligibilityRequest.java | 675 +- .../fhir/dstu3/model/EligibilityResponse.java | 1508 +- .../org/hl7/fhir/dstu3/model/Encounter.java | 28 +- .../org/hl7/fhir/dstu3/model/Endpoint.java | 2 +- .../fhir/dstu3/model/EnrollmentRequest.java | 563 +- .../fhir/dstu3/model/EnrollmentResponse.java | 581 +- .../hl7/fhir/dstu3/model/Enumerations.java | 162 +- .../hl7/fhir/dstu3/model/EpisodeOfCare.java | 2 +- .../fhir/dstu3/model/ExpansionProfile.java | 16 +- .../dstu3/model/ExplanationOfBenefit.java | 4691 ++-- .../org/hl7/fhir/dstu3/model/Extension.java | 2 +- .../fhir/dstu3/model/FamilyMemberHistory.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Flag.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Goal.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Group.java | 4 +- .../fhir/dstu3/model/GuidanceResponse.java | 75 +- .../fhir/dstu3/model/HealthcareService.java | 137 +- .../org/hl7/fhir/dstu3/model/HumanName.java | 106 +- .../org/hl7/fhir/dstu3/model/Identifier.java | 2 +- .../hl7/fhir/dstu3/model/ImagingManifest.java | 2 +- .../hl7/fhir/dstu3/model/ImagingStudy.java | 2 +- .../hl7/fhir/dstu3/model/Immunization.java | 172 +- .../model/ImmunizationRecommendation.java | 2 +- .../fhir/dstu3/model/ImplementationGuide.java | 16 +- .../org/hl7/fhir/dstu3/model/Library.java | 77 +- .../org/hl7/fhir/dstu3/model/Linkage.java | 2 +- .../hl7/fhir/dstu3/model/ListResource.java | 2 +- .../org/hl7/fhir/dstu3/model/Location.java | 28 +- .../org/hl7/fhir/dstu3/model/Measure.java | 302 +- .../hl7/fhir/dstu3/model/MeasureReport.java | 48 +- .../java/org/hl7/fhir/dstu3/model/Media.java | 2 +- .../org/hl7/fhir/dstu3/model/Medication.java | 2 +- .../dstu3/model/MedicationAdministration.java | 156 +- .../fhir/dstu3/model/MedicationDispense.java | 2 +- .../fhir/dstu3/model/MedicationRequest.java | 122 +- .../fhir/dstu3/model/MedicationStatement.java | 240 +- .../fhir/dstu3/model/MessageDefinition.java | 2581 +++ .../hl7/fhir/dstu3/model/MessageHeader.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Meta.java | 16 +- .../fhir/dstu3/model/MetadataResource.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Money.java | 2 +- .../hl7/fhir/dstu3/model/NamingSystem.java | 2 +- .../org/hl7/fhir/dstu3/model/Narrative.java | 2 +- .../fhir/dstu3/model/NutritionRequest.java | 2 +- .../org/hl7/fhir/dstu3/model/Observation.java | 164 +- .../fhir/dstu3/model/OperationDefinition.java | 2 +- .../fhir/dstu3/model/OperationOutcome.java | 2 +- .../hl7/fhir/dstu3/model/Organization.java | 188 +- .../fhir/dstu3/model/ParameterDefinition.java | 2 +- .../org/hl7/fhir/dstu3/model/Parameters.java | 2 +- .../org/hl7/fhir/dstu3/model/Patient.java | 2 +- .../hl7/fhir/dstu3/model/PaymentNotice.java | 557 +- .../dstu3/model/PaymentReconciliation.java | 666 +- .../java/org/hl7/fhir/dstu3/model/Period.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Person.java | 2 +- .../hl7/fhir/dstu3/model/PlanDefinition.java | 467 +- .../hl7/fhir/dstu3/model/Practitioner.java | 28 +- .../fhir/dstu3/model/PractitionerRole.java | 28 +- .../org/hl7/fhir/dstu3/model/Procedure.java | 2 +- .../fhir/dstu3/model/ProcedureRequest.java | 2 +- .../hl7/fhir/dstu3/model/ProcessRequest.java | 303 +- .../hl7/fhir/dstu3/model/ProcessResponse.java | 791 +- .../org/hl7/fhir/dstu3/model/Provenance.java | 782 +- .../org/hl7/fhir/dstu3/model/Quantity.java | 2 +- .../hl7/fhir/dstu3/model/Questionnaire.java | 235 +- .../dstu3/model/QuestionnaireResponse.java | 146 +- .../java/org/hl7/fhir/dstu3/model/Range.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Ratio.java | 2 +- .../org/hl7/fhir/dstu3/model/Reference.java | 2 +- .../hl7/fhir/dstu3/model/ReferralRequest.java | 2 +- .../hl7/fhir/dstu3/model/RelatedArtifact.java | 2 +- .../hl7/fhir/dstu3/model/RelatedPerson.java | 2 +- .../hl7/fhir/dstu3/model/RequestGroup.java | 685 +- .../hl7/fhir/dstu3/model/ResearchStudy.java | 2408 ++ .../hl7/fhir/dstu3/model/ResearchSubject.java | 922 + .../org/hl7/fhir/dstu3/model/Resource.java | 2 +- .../hl7/fhir/dstu3/model/ResourceFactory.java | 14 +- .../hl7/fhir/dstu3/model/ResourceType.java | 17 +- .../hl7/fhir/dstu3/model/RiskAssessment.java | 2 +- .../org/hl7/fhir/dstu3/model/SampledData.java | 2 +- .../org/hl7/fhir/dstu3/model/Schedule.java | 2 +- .../hl7/fhir/dstu3/model/SearchParameter.java | 1195 +- .../org/hl7/fhir/dstu3/model/Sequence.java | 1136 +- .../fhir/dstu3/model/ServiceDefinition.java | 2 +- .../org/hl7/fhir/dstu3/model/Signature.java | 2 +- .../hl7/fhir/dstu3/model/SimpleQuantity.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Slot.java | 2 +- .../org/hl7/fhir/dstu3/model/Specimen.java | 2 +- .../fhir/dstu3/model/StructureDefinition.java | 30 +- .../hl7/fhir/dstu3/model/StructureMap.java | 218 +- .../hl7/fhir/dstu3/model/Subscription.java | 2 +- .../org/hl7/fhir/dstu3/model/Substance.java | 2 +- .../hl7/fhir/dstu3/model/SupplyDelivery.java | 2 +- .../hl7/fhir/dstu3/model/SupplyRequest.java | 2 +- .../java/org/hl7/fhir/dstu3/model/Task.java | 2051 +- .../org/hl7/fhir/dstu3/model/TestReport.java | 2 +- .../org/hl7/fhir/dstu3/model/TestScript.java | 30 +- .../java/org/hl7/fhir/dstu3/model/Timing.java | 419 +- .../fhir/dstu3/model/TriggerDefinition.java | 2 +- .../hl7/fhir/dstu3/model/UsageContext.java | 2 +- .../org/hl7/fhir/dstu3/model/ValueSet.java | 223 +- .../fhir/dstu3/model/VisionPrescription.java | 747 +- .../model/codesystems/AbstractTypes.java | 2 +- .../codesystems/AbstractTypesEnumFactory.java | 2 +- .../model/codesystems/AccountStatus.java | 2 +- .../codesystems/AccountStatusEnumFactory.java | 2 +- .../ActionCardinalityBehavior.java | 2 +- .../ActionCardinalityBehaviorEnumFactory.java | 2 +- .../codesystems/ActionConditionKind.java | 96 + .../ActionConditionKindEnumFactory.java | 66 + .../codesystems/ActionGroupingBehavior.java | 2 +- .../ActionGroupingBehaviorEnumFactory.java | 2 +- .../codesystems/ActionParticipantType.java | 2 +- .../ActionParticipantTypeEnumFactory.java | 2 +- .../codesystems/ActionPrecheckBehavior.java | 2 +- .../ActionPrecheckBehaviorEnumFactory.java | 2 +- .../codesystems/ActionRelationshipType.java | 2 +- .../ActionRelationshipTypeEnumFactory.java | 2 +- .../codesystems/ActionRequiredBehavior.java | 2 +- .../ActionRequiredBehaviorEnumFactory.java | 2 +- .../codesystems/ActionSelectionBehavior.java | 2 +- .../ActionSelectionBehaviorEnumFactory.java | 2 +- .../dstu3/model/codesystems/ActionType.java | 2 +- .../codesystems/ActionTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/Actionlist.java | 2 +- .../codesystems/ActionlistEnumFactory.java | 2 +- .../ActivityDefinitionCategory.java | 2 +- ...ActivityDefinitionCategoryEnumFactory.java | 2 +- .../codesystems/Additionalmaterials.java | 2 +- .../AdditionalmaterialsEnumFactory.java | 2 +- .../dstu3/model/codesystems/AddressType.java | 2 +- .../codesystems/AddressTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/AddressUse.java | 2 +- .../codesystems/AddressUseEnumFactory.java | 2 +- .../dstu3/model/codesystems/Adjudication.java | 2 +- .../codesystems/AdjudicationEnumFactory.java | 2 +- .../model/codesystems/AdjudicationError.java | 2 +- .../AdjudicationErrorEnumFactory.java | 2 +- .../model/codesystems/AdjudicationReason.java | 2 +- .../AdjudicationReasonEnumFactory.java | 2 +- .../codesystems/AdministrativeGender.java | 2 +- .../AdministrativeGenderEnumFactory.java | 2 +- .../AllergIntolSubstanceExpRisk.java | 2 +- ...llergIntolSubstanceExpRiskEnumFactory.java | 2 +- .../codesystems/AllergyClinicalStatus.java | 96 + .../AllergyClinicalStatusEnumFactory.java | 66 + .../AllergyIntoleranceCategory.java | 2 +- ...AllergyIntoleranceCategoryEnumFactory.java | 2 +- .../AllergyIntoleranceCriticality.java | 2 +- ...ergyIntoleranceCriticalityEnumFactory.java | 2 +- .../codesystems/AllergyIntoleranceStatus.java | 2 +- .../AllergyIntoleranceStatusEnumFactory.java | 2 +- .../codesystems/AllergyIntoleranceType.java | 2 +- .../AllergyIntoleranceTypeEnumFactory.java | 2 +- .../AllergyVerificationStatus.java | 105 + .../AllergyVerificationStatusEnumFactory.java | 70 + .../model/codesystems/AnimalGenderstatus.java | 2 +- .../AnimalGenderstatusEnumFactory.java | 2 +- .../model/codesystems/AnimalSpecies.java | 2 +- .../codesystems/AnimalSpeciesEnumFactory.java | 2 +- .../model/codesystems/AnzscoOccupations.java | 2 +- .../AnzscoOccupationsEnumFactory.java | 2 +- .../model/codesystems/Appointmentstatus.java | 2 +- .../AppointmentstatusEnumFactory.java | 2 +- .../codesystems/AssertDirectionCodes.java | 2 +- .../AssertDirectionCodesEnumFactory.java | 2 +- .../codesystems/AssertOperatorCodes.java | 2 +- .../AssertOperatorCodesEnumFactory.java | 2 +- .../codesystems/AssertResponseCodeTypes.java | 2 +- .../AssertResponseCodeTypesEnumFactory.java | 2 +- .../model/codesystems/AuditEventAction.java | 2 +- .../AuditEventActionEnumFactory.java | 2 +- .../model/codesystems/AuditEventOutcome.java | 2 +- .../AuditEventOutcomeEnumFactory.java | 2 +- .../model/codesystems/AuditEventType.java | 2 +- .../AuditEventTypeEnumFactory.java | 2 +- .../model/codesystems/AuditSourceType.java | 2 +- .../AuditSourceTypeEnumFactory.java | 2 +- .../model/codesystems/BasicResourceType.java | 2 +- .../BasicResourceTypeEnumFactory.java | 2 +- .../model/codesystems/BenefitCategory.java | 2 +- .../BenefitCategoryEnumFactory.java | 2 +- .../model/codesystems/BenefitNetwork.java | 2 +- .../BenefitNetworkEnumFactory.java | 2 +- .../model/codesystems/BenefitSubcategory.java | 2 +- .../BenefitSubcategoryEnumFactory.java | 2 +- .../dstu3/model/codesystems/BenefitTerm.java | 2 +- .../codesystems/BenefitTermEnumFactory.java | 2 +- .../dstu3/model/codesystems/BenefitType.java | 2 +- .../codesystems/BenefitTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/BenefitUnit.java | 2 +- .../codesystems/BenefitUnitEnumFactory.java | 2 +- .../model/codesystems/BindingStrength.java | 2 +- .../BindingStrengthEnumFactory.java | 2 +- .../dstu3/model/codesystems/BundleType.java | 6 +- .../codesystems/BundleTypeEnumFactory.java | 2 +- .../codesystems/CapabilityStatementKind.java | 2 +- .../CapabilityStatementKindEnumFactory.java | 2 +- .../codesystems/CarePlanActivityCategory.java | 2 +- .../CarePlanActivityCategoryEnumFactory.java | 2 +- .../codesystems/CarePlanActivityStatus.java | 2 +- .../CarePlanActivityStatusEnumFactory.java | 2 +- .../codesystems/CarePlanRelationship.java | 2 +- .../CarePlanRelationshipEnumFactory.java | 2 +- .../model/codesystems/CarePlanStatus.java | 2 +- .../CarePlanStatusEnumFactory.java | 2 +- .../codesystems/ChoiceListOrientation.java | 2 +- .../ChoiceListOrientationEnumFactory.java | 2 +- .../model/codesystems/ChromosomeHuman.java | 146 +- .../ChromosomeHumanEnumFactory.java | 2 +- .../model/codesystems/ClaimCareteamrole.java | 2 +- .../ClaimCareteamroleEnumFactory.java | 2 +- .../model/codesystems/ClaimException.java | 2 +- .../ClaimExceptionEnumFactory.java | 2 +- .../codesystems/ClaimInformationcategory.java | 34 +- .../ClaimInformationcategoryEnumFactory.java | 18 +- .../model/codesystems/ClaimModifiers.java | 2 +- .../ClaimModifiersEnumFactory.java | 2 +- .../dstu3/model/codesystems/ClaimStatus.java | 2 +- .../codesystems/ClaimStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/ClaimSubtype.java | 2 +- .../codesystems/ClaimSubtypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/ClaimType.java | 2 +- .../codesystems/ClaimTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/ClaimUse.java | 2 +- .../codesystems/ClaimUseEnumFactory.java | 2 +- .../codesystems/ClaimresponseStatus.java | 2 +- .../ClaimresponseStatusEnumFactory.java | 2 +- .../codesystems/ClassificationOrContext.java | 2 +- .../ClassificationOrContextEnumFactory.java | 2 +- .../codesystems/ClinicalImpressionStatus.java | 2 +- .../ClinicalImpressionStatusEnumFactory.java | 2 +- .../codesystems/CodesystemContentMode.java | 2 +- .../CodesystemContentModeEnumFactory.java | 2 +- .../CodesystemHierarchyMeaning.java | 16 +- ...CodesystemHierarchyMeaningEnumFactory.java | 10 +- .../dstu3/model/codesystems/CommonTags.java | 2 +- .../codesystems/CommonTagsEnumFactory.java | 2 +- .../CommunicationRequestStatus.java | 2 +- ...CommunicationRequestStatusEnumFactory.java | 2 +- .../codesystems/CommunicationStatus.java | 2 +- .../CommunicationStatusEnumFactory.java | 2 +- .../model/codesystems/CompartmentType.java | 2 +- .../CompartmentTypeEnumFactory.java | 2 +- .../codesystems/CompositeMeasureScoring.java | 105 + .../CompositeMeasureScoringEnumFactory.java | 70 + .../CompositionAttestationMode.java | 2 +- ...CompositionAttestationModeEnumFactory.java | 2 +- .../model/codesystems/CompositionStatus.java | 2 +- .../CompositionStatusEnumFactory.java | 2 +- .../codesystems/ConceptMapEquivalence.java | 2 +- .../ConceptMapEquivalenceEnumFactory.java | 2 +- .../model/codesystems/ConceptProperties.java | 2 +- .../ConceptPropertiesEnumFactory.java | 2 +- .../codesystems/ConceptPropertyType.java | 2 +- .../ConceptPropertyTypeEnumFactory.java | 2 +- .../model/codesystems/ConditionCategory.java | 2 +- .../ConditionCategoryEnumFactory.java | 2 +- .../model/codesystems/ConditionClinical.java | 33 +- .../ConditionClinicalEnumFactory.java | 14 +- .../model/codesystems/ConditionState.java | 2 +- .../ConditionStateEnumFactory.java | 2 +- .../model/codesystems/ConditionVerStatus.java | 2 +- .../ConditionVerStatusEnumFactory.java | 2 +- .../codesystems/ConditionalDeleteStatus.java | 2 +- .../ConditionalDeleteStatusEnumFactory.java | 2 +- .../codesystems/ConditionalReadStatus.java | 2 +- .../ConditionalReadStatusEnumFactory.java | 2 +- .../codesystems/ConformanceExpectation.java | 2 +- .../ConformanceExpectationEnumFactory.java | 2 +- .../model/codesystems/ConsentAction.java | 2 +- .../codesystems/ConsentActionEnumFactory.java | 2 +- .../model/codesystems/ConsentCategory.java | 2 +- .../ConsentCategoryEnumFactory.java | 2 +- .../model/codesystems/ConsentDataMeaning.java | 2 +- .../ConsentDataMeaningEnumFactory.java | 2 +- .../model/codesystems/ConsentExceptType.java | 2 +- .../ConsentExceptTypeEnumFactory.java | 2 +- .../model/codesystems/ConsentStatus.java | 2 +- .../codesystems/ConsentStatusEnumFactory.java | 2 +- .../model/codesystems/ConstraintSeverity.java | 2 +- .../ConstraintSeverityEnumFactory.java | 2 +- .../model/codesystems/ContactPointSystem.java | 17 +- .../ContactPointSystemEnumFactory.java | 6 +- .../model/codesystems/ContactPointUse.java | 2 +- .../ContactPointUseEnumFactory.java | 2 +- .../model/codesystems/ContactentityType.java | 2 +- .../ContactentityTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/ContentType.java | 2 +- .../codesystems/ContentTypeEnumFactory.java | 2 +- .../model/codesystems/ContractAction.java | 14 +- .../ContractActionEnumFactory.java | 2 +- .../model/codesystems/ContractActorrole.java | 10 +- .../ContractActorroleEnumFactory.java | 2 +- .../model/codesystems/ContractSignerType.java | 98 +- .../ContractSignerTypeEnumFactory.java | 2 +- .../model/codesystems/ContractSubtype.java | 22 +- .../ContractSubtypeEnumFactory.java | 10 +- .../codesystems/ContractTermSubtype.java | 26 +- .../ContractTermSubtypeEnumFactory.java | 14 +- .../model/codesystems/ContractTermType.java | 18 +- .../ContractTermTypeEnumFactory.java | 10 +- .../dstu3/model/codesystems/ContractType.java | 41 +- .../codesystems/ContractTypeEnumFactory.java | 14 +- .../model/codesystems/ContributorType.java | 2 +- .../ContributorTypeEnumFactory.java | 2 +- .../model/codesystems/CopyNumberEvent.java | 2 +- .../CopyNumberEventEnumFactory.java | 2 +- .../model/codesystems/CoverageException.java | 2 +- .../CoverageExceptionEnumFactory.java | 2 +- .../model/codesystems/CoverageLevel.java | 2 +- .../codesystems/CoverageLevelEnumFactory.java | 2 +- .../model/codesystems/CoverageSelfpay.java | 78 + .../CoverageSelfpayEnumFactory.java | 58 + .../model/codesystems/CoverageStatus.java | 2 +- .../CoverageStatusEnumFactory.java | 2 +- .../codesystems/CqifEvidenceQuality.java | 2 +- .../CqifEvidenceQualityEnumFactory.java | 2 +- .../CqifRecommendationStrength.java | 2 +- ...CqifRecommendationStrengthEnumFactory.java | 2 +- .../model/codesystems/CqifTriggerType.java | 2 +- .../CqifTriggerTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/DWebType.java | 2 +- .../codesystems/DWebTypeEnumFactory.java | 2 +- .../model/codesystems/DataAbsentReason.java | 2 +- .../DataAbsentReasonEnumFactory.java | 2 +- .../dstu3/model/codesystems/DataTypes.java | 2 +- .../codesystems/DataTypesEnumFactory.java | 2 +- .../codesystems/DataelementStringency.java | 2 +- .../DataelementStringencyEnumFactory.java | 2 +- .../dstu3/model/codesystems/DaysOfWeek.java | 2 +- .../codesystems/DaysOfWeekEnumFactory.java | 2 +- .../model/codesystems/DefinitionStatus.java | 25 +- .../DefinitionStatusEnumFactory.java | 6 +- .../codesystems/DetectedissueSeverity.java | 2 +- .../DetectedissueSeverityEnumFactory.java | 2 +- .../dstu3/model/codesystems/DeviceAction.java | 2 +- .../codesystems/DeviceActionEnumFactory.java | 2 +- .../dstu3/model/codesystems/Devicestatus.java | 2 +- .../codesystems/DevicestatusEnumFactory.java | 2 +- .../codesystems/DiagnosticReportStatus.java | 2 +- .../DiagnosticReportStatusEnumFactory.java | 2 +- .../codesystems/DigitalMediaSubtype.java | 2 +- .../DigitalMediaSubtypeEnumFactory.java | 2 +- .../model/codesystems/DigitalMediaType.java | 2 +- .../DigitalMediaTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/DocumentMode.java | 2 +- .../codesystems/DocumentModeEnumFactory.java | 2 +- .../codesystems/DocumentReferenceStatus.java | 2 +- .../DocumentReferenceStatusEnumFactory.java | 2 +- .../codesystems/DocumentRelationshipType.java | 2 +- .../DocumentRelationshipTypeEnumFactory.java | 2 +- .../codesystems/EligibilityrequestStatus.java | 2 +- .../EligibilityrequestStatusEnumFactory.java | 2 +- .../EligibilityresponseStatus.java | 2 +- .../EligibilityresponseStatusEnumFactory.java | 2 +- .../codesystems/EncounterAdmitSource.java | 2 +- .../EncounterAdmitSourceEnumFactory.java | 2 +- .../model/codesystems/EncounterDiet.java | 2 +- .../codesystems/EncounterDietEnumFactory.java | 2 +- .../EncounterDischargeDisposition.java | 2 +- ...ounterDischargeDispositionEnumFactory.java | 2 +- .../codesystems/EncounterLocationStatus.java | 2 +- .../EncounterLocationStatusEnumFactory.java | 2 +- .../codesystems/EncounterParticipantType.java | 2 +- .../EncounterParticipantTypeEnumFactory.java | 2 +- .../EncounterSpecialArrangements.java | 2 +- ...counterSpecialArrangementsEnumFactory.java | 2 +- .../model/codesystems/EncounterStatus.java | 2 +- .../EncounterStatusEnumFactory.java | 2 +- .../model/codesystems/EncounterType.java | 2 +- .../codesystems/EncounterTypeEnumFactory.java | 2 +- .../codesystems/EndpointConnectionType.java | 11 +- .../EndpointConnectionTypeEnumFactory.java | 6 +- .../model/codesystems/EndpointStatus.java | 2 +- .../EndpointStatusEnumFactory.java | 2 +- .../codesystems/EnrollmentrequestStatus.java | 2 +- .../EnrollmentrequestStatusEnumFactory.java | 2 +- .../codesystems/EnrollmentresponseStatus.java | 2 +- .../EnrollmentresponseStatusEnumFactory.java | 2 +- .../model/codesystems/EntformulaAdditive.java | 2 +- .../EntformulaAdditiveEnumFactory.java | 2 +- .../codesystems/EpisodeOfCareStatus.java | 2 +- .../EpisodeOfCareStatusEnumFactory.java | 2 +- .../codesystems/EventCapabilityMode.java | 2 +- .../EventCapabilityModeEnumFactory.java | 2 +- .../dstu3/model/codesystems/EventStatus.java | 11 +- .../codesystems/EventStatusEnumFactory.java | 6 +- .../dstu3/model/codesystems/EventTiming.java | 105 + .../codesystems/EventTimingEnumFactory.java | 70 + .../codesystems/ExDiagnosisrelatedgroup.java | 2 +- .../ExDiagnosisrelatedgroupEnumFactory.java | 2 +- .../model/codesystems/ExDiagnosistype.java | 2 +- .../ExDiagnosistypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/ExOnsettype.java | 2 +- .../codesystems/ExOnsettypeEnumFactory.java | 2 +- .../codesystems/ExPayeeResourceType.java | 2 +- .../ExPayeeResourceTypeEnumFactory.java | 2 +- .../model/codesystems/ExPaymenttype.java | 2 +- .../codesystems/ExPaymenttypeEnumFactory.java | 2 +- .../model/codesystems/ExProgramCode.java | 2 +- .../codesystems/ExProgramCodeEnumFactory.java | 2 +- .../model/codesystems/ExRevenueCenter.java | 2 +- .../ExRevenueCenterEnumFactory.java | 2 +- .../ExplanationofbenefitStatus.java | 2 +- ...ExplanationofbenefitStatusEnumFactory.java | 2 +- .../model/codesystems/ExtensionContext.java | 2 +- .../ExtensionContextEnumFactory.java | 2 +- .../model/codesystems/FilterOperator.java | 20 +- .../FilterOperatorEnumFactory.java | 10 +- .../dstu3/model/codesystems/FlagCategory.java | 2 +- .../codesystems/FlagCategoryEnumFactory.java | 2 +- .../dstu3/model/codesystems/FlagPriority.java | 2 +- .../codesystems/FlagPriorityEnumFactory.java | 2 +- .../dstu3/model/codesystems/FlagStatus.java | 2 +- .../codesystems/FlagStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/FmConditions.java | 2 +- .../codesystems/FmConditionsEnumFactory.java | 2 +- .../dstu3/model/codesystems/FmItemtype.java | 2 +- .../codesystems/FmItemtypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/FmStatus.java | 105 + .../codesystems/FmStatusEnumFactory.java | 70 + .../fhir/dstu3/model/codesystems/Forms.java | 14 +- .../model/codesystems/FormsEnumFactory.java | 2 +- .../dstu3/model/codesystems/Fundsreserve.java | 20 +- .../codesystems/FundsreserveEnumFactory.java | 2 +- .../codesystems/GoalAcceptanceStatus.java | 2 +- .../GoalAcceptanceStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/GoalCategory.java | 2 +- .../codesystems/GoalCategoryEnumFactory.java | 2 +- .../dstu3/model/codesystems/GoalPriority.java | 2 +- .../codesystems/GoalPriorityEnumFactory.java | 2 +- .../codesystems/GoalRelationshipType.java | 2 +- .../GoalRelationshipTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/GoalStatus.java | 2 +- .../codesystems/GoalStatusEnumFactory.java | 2 +- .../model/codesystems/GoalStatusReason.java | 2 +- .../GoalStatusReasonEnumFactory.java | 2 +- .../dstu3/model/codesystems/GroupType.java | 2 +- .../codesystems/GroupTypeEnumFactory.java | 2 +- .../codesystems/GuidanceResponseStatus.java | 2 +- .../GuidanceResponseStatusEnumFactory.java | 2 +- .../codesystems/GuideDependencyType.java | 2 +- .../GuideDependencyTypeEnumFactory.java | 2 +- .../model/codesystems/GuidePageKind.java | 2 +- .../codesystems/GuidePageKindEnumFactory.java | 2 +- .../model/codesystems/HistoryStatus.java | 2 +- .../codesystems/HistoryStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/Hl7WorkGroup.java | 276 + .../codesystems/Hl7WorkGroupEnumFactory.java | 146 + .../dstu3/model/codesystems/HttpVerb.java | 2 +- .../codesystems/HttpVerbEnumFactory.java | 2 +- .../model/codesystems/Icd10Procedures.java | 2 +- .../Icd10ProceduresEnumFactory.java | 2 +- .../model/codesystems/IdentifierType.java | 2 +- .../IdentifierTypeEnumFactory.java | 2 +- .../model/codesystems/IdentifierUse.java | 2 +- .../codesystems/IdentifierUseEnumFactory.java | 2 +- .../codesystems/IdentityAssuranceLevel.java | 2 +- .../IdentityAssuranceLevelEnumFactory.java | 2 +- ...munizationRecommendationDateCriterion.java | 2 +- ...ecommendationDateCriterionEnumFactory.java | 2 +- .../ImmunizationRecommendationStatus.java | 2 +- ...zationRecommendationStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/Intervention.java | 2 +- .../codesystems/InterventionEnumFactory.java | 2 +- .../model/codesystems/IssueSeverity.java | 2 +- .../codesystems/IssueSeverityEnumFactory.java | 2 +- .../dstu3/model/codesystems/IssueType.java | 2 +- .../codesystems/IssueTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/ItemType.java | 2 +- .../codesystems/ItemTypeEnumFactory.java | 2 +- .../codesystems/LOINC480020Answerlist.java | 2 +- .../LOINC480020AnswerlistEnumFactory.java | 2 +- .../codesystems/LOINC480194Answerlist.java | 2 +- .../LOINC480194AnswerlistEnumFactory.java | 2 +- .../codesystems/LOINC530345Answerlist.java | 2 +- .../LOINC530345AnswerlistEnumFactory.java | 2 +- .../dstu3/model/codesystems/LibraryType.java | 2 +- .../codesystems/LibraryTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/LinkType.java | 2 +- .../codesystems/LinkTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/LinkageType.java | 2 +- .../codesystems/LinkageTypeEnumFactory.java | 2 +- .../model/codesystems/ListEmptyReason.java | 2 +- .../ListEmptyReasonEnumFactory.java | 2 +- .../model/codesystems/ListExampleCodes.java | 2 +- .../ListExampleCodesEnumFactory.java | 2 +- .../dstu3/model/codesystems/ListItemFlag.java | 2 +- .../codesystems/ListItemFlagEnumFactory.java | 2 +- .../dstu3/model/codesystems/ListMode.java | 2 +- .../codesystems/ListModeEnumFactory.java | 2 +- .../dstu3/model/codesystems/ListOrder.java | 2 +- .../codesystems/ListOrderEnumFactory.java | 2 +- .../dstu3/model/codesystems/ListStatus.java | 2 +- .../codesystems/ListStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/LocationMode.java | 2 +- .../codesystems/LocationModeEnumFactory.java | 2 +- .../codesystems/LocationPhysicalType.java | 6 +- .../LocationPhysicalTypeEnumFactory.java | 2 +- .../model/codesystems/LocationStatus.java | 2 +- .../LocationStatusEnumFactory.java | 2 +- .../model/codesystems/MapContextType.java | 2 +- .../MapContextTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/MapInputMode.java | 2 +- .../codesystems/MapInputModeEnumFactory.java | 2 +- .../dstu3/model/codesystems/MapListMode.java | 2 +- .../codesystems/MapListModeEnumFactory.java | 2 +- .../dstu3/model/codesystems/MapModelMode.java | 2 +- .../codesystems/MapModelModeEnumFactory.java | 2 +- .../dstu3/model/codesystems/MapTransform.java | 2 +- .../codesystems/MapTransformEnumFactory.java | 2 +- .../model/codesystems/MaritalStatus.java | 2 +- .../codesystems/MaritalStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/MatchGrade.java | 2 +- .../codesystems/MatchGradeEnumFactory.java | 2 +- .../model/codesystems/MeasureDataUsage.java | 2 +- .../MeasureDataUsageEnumFactory.java | 2 +- .../model/codesystems/MeasurePopulation.java | 2 +- .../MeasurePopulationEnumFactory.java | 2 +- .../codesystems/MeasureReportStatus.java | 2 +- .../MeasureReportStatusEnumFactory.java | 2 +- .../model/codesystems/MeasureReportType.java | 2 +- .../MeasureReportTypeEnumFactory.java | 2 +- .../model/codesystems/MeasureScoring.java | 2 +- .../MeasureScoringEnumFactory.java | 2 +- .../dstu3/model/codesystems/MeasureType.java | 37 +- .../codesystems/MeasureTypeEnumFactory.java | 14 +- .../codesystems/MeasurementPrinciple.java | 2 +- .../MeasurementPrincipleEnumFactory.java | 2 +- .../codesystems/MedicationAdminStatus.java | 2 +- .../MedicationAdminStatusEnumFactory.java | 2 +- .../codesystems/MedicationDispenseStatus.java | 2 +- .../MedicationDispenseStatusEnumFactory.java | 2 +- .../MedicationRequestCategory.java | 2 +- .../MedicationRequestCategoryEnumFactory.java | 2 +- .../codesystems/MedicationRequestStatus.java | 2 +- .../MedicationRequestStatusEnumFactory.java | 2 +- .../MedicationStatementCategory.java | 2 +- ...edicationStatementCategoryEnumFactory.java | 2 +- .../MedicationStatementNottaken.java | 2 +- ...edicationStatementNottakenEnumFactory.java | 2 +- .../MedicationStatementStatus.java | 2 +- .../MedicationStatementStatusEnumFactory.java | 2 +- .../model/codesystems/MessageEvents.java | 6 +- .../codesystems/MessageEventsEnumFactory.java | 2 +- .../codesystems/MessageReasonEncounter.java | 2 +- .../MessageReasonEncounterEnumFactory.java | 2 +- .../MessageSignificanceCategory.java | 2 +- ...essageSignificanceCategoryEnumFactory.java | 2 +- .../model/codesystems/MessageTransport.java | 2 +- .../MessageTransportEnumFactory.java | 2 +- .../codesystems/MetricCalibrationState.java | 2 +- .../MetricCalibrationStateEnumFactory.java | 2 +- .../codesystems/MetricCalibrationType.java | 2 +- .../MetricCalibrationTypeEnumFactory.java | 2 +- .../model/codesystems/MetricCategory.java | 2 +- .../MetricCategoryEnumFactory.java | 2 +- .../dstu3/model/codesystems/MetricColor.java | 2 +- .../codesystems/MetricColorEnumFactory.java | 2 +- .../codesystems/MetricOperationalStatus.java | 2 +- .../MetricOperationalStatusEnumFactory.java | 2 +- .../model/codesystems/MissingToothReason.java | 2 +- .../MissingToothReasonEnumFactory.java | 2 +- .../model/codesystems/NameAssemblyOrder.java | 105 + .../NameAssemblyOrderEnumFactory.java | 70 + .../fhir/dstu3/model/codesystems/NameUse.java | 8 +- .../model/codesystems/NameUseEnumFactory.java | 2 +- .../NamingsystemIdentifierType.java | 2 +- ...NamingsystemIdentifierTypeEnumFactory.java | 2 +- .../model/codesystems/NamingsystemType.java | 2 +- .../NamingsystemTypeEnumFactory.java | 2 +- .../model/codesystems/NarrativeStatus.java | 2 +- .../NarrativeStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/NetworkType.java | 2 +- .../codesystems/NetworkTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/NoteType.java | 2 +- .../codesystems/NoteTypeEnumFactory.java | 2 +- .../codesystems/NutritionRequestStatus.java | 2 +- .../NutritionRequestStatusEnumFactory.java | 2 +- .../model/codesystems/ObjectLifecycle.java | 2 +- .../ObjectLifecycleEnumFactory.java | 2 +- .../dstu3/model/codesystems/ObjectRole.java | 2 +- .../codesystems/ObjectRoleEnumFactory.java | 2 +- .../dstu3/model/codesystems/ObjectType.java | 2 +- .../codesystems/ObjectTypeEnumFactory.java | 2 +- .../codesystems/ObservationCategory.java | 2 +- .../ObservationCategoryEnumFactory.java | 2 +- .../codesystems/ObservationParamcode.java | 2 +- .../ObservationParamcodeEnumFactory.java | 2 +- .../ObservationRelationshiptypes.java | 2 +- ...servationRelationshiptypesEnumFactory.java | 2 +- .../codesystems/ObservationStatistics.java | 231 + .../ObservationStatisticsEnumFactory.java | 126 + .../model/codesystems/ObservationStatus.java | 2 +- .../ObservationStatusEnumFactory.java | 2 +- .../model/codesystems/OccurrenceCodes.java | 2 +- .../OccurrenceCodesEnumFactory.java | 2 +- .../codesystems/OccurrenceSpanCodes.java | 2 +- .../OccurrenceSpanCodesEnumFactory.java | 2 +- .../model/codesystems/OperationKind.java | 2 +- .../codesystems/OperationKindEnumFactory.java | 2 +- .../model/codesystems/OperationOutcome.java | 2 +- .../OperationOutcomeEnumFactory.java | 2 +- .../codesystems/OperationParameterUse.java | 2 +- .../OperationParameterUseEnumFactory.java | 2 +- .../OralProsthodonticMaterial.java | 2 +- .../OralProsthodonticMaterialEnumFactory.java | 2 +- .../model/codesystems/OrganizationType.java | 2 +- .../OrganizationTypeEnumFactory.java | 2 +- .../codesystems/Participantrequired.java | 2 +- .../ParticipantrequiredEnumFactory.java | 2 +- .../codesystems/Participationstatus.java | 2 +- .../ParticipationstatusEnumFactory.java | 2 +- .../model/codesystems/PatientMpiMatch.java | 2 +- .../PatientMpiMatchEnumFactory.java | 2 +- .../dstu3/model/codesystems/Payeetype.java | 2 +- .../codesystems/PayeetypeEnumFactory.java | 2 +- .../codesystems/PaymentAdjustmentReason.java | 2 +- .../PaymentAdjustmentReasonEnumFactory.java | 2 +- .../model/codesystems/PaymentStatus.java | 14 +- .../codesystems/PaymentStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/PaymentType.java | 20 +- .../codesystems/PaymentTypeEnumFactory.java | 2 +- .../codesystems/PaymentnoticeStatus.java | 2 +- .../PaymentnoticeStatusEnumFactory.java | 2 +- .../PaymentreconciliationStatus.java | 2 +- ...aymentreconciliationStatusEnumFactory.java | 2 +- .../model/codesystems/PlanDefinitionType.java | 2 +- .../PlanDefinitionTypeEnumFactory.java | 2 +- .../codesystems/PolicyholderRelationship.java | 2 +- .../PolicyholderRelationshipEnumFactory.java | 2 +- .../model/codesystems/PractitionerRole.java | 2 +- .../PractitionerRoleEnumFactory.java | 2 +- .../codesystems/PractitionerSpecialty.java | 2 +- .../PractitionerSpecialtyEnumFactory.java | 2 +- .../ProcedureProgressStatusCodes.java | 2 +- ...ocedureProgressStatusCodesEnumFactory.java | 2 +- .../ProcedureRelationshipType.java | 2 +- .../ProcedureRelationshipTypeEnumFactory.java | 2 +- .../codesystems/ProcedureRequestPriority.java | 2 +- .../ProcedureRequestPriorityEnumFactory.java | 2 +- .../codesystems/ProcedureRequestStatus.java | 2 +- .../ProcedureRequestStatusEnumFactory.java | 2 +- .../model/codesystems/ProcedureStatus.java | 2 +- .../ProcedureStatusEnumFactory.java | 2 +- .../model/codesystems/ProcessOutcome.java | 20 +- .../ProcessOutcomeEnumFactory.java | 2 +- .../model/codesystems/ProcessPriority.java | 2 +- .../ProcessPriorityEnumFactory.java | 2 +- .../codesystems/ProcessrequestStatus.java | 2 +- .../ProcessrequestStatusEnumFactory.java | 2 +- .../codesystems/ProcessresponseStatus.java | 2 +- .../ProcessresponseStatusEnumFactory.java | 2 +- .../codesystems/PropertyRepresentation.java | 2 +- .../PropertyRepresentationEnumFactory.java | 2 +- .../codesystems/ProvenanceAgentRole.java | 2 +- .../ProvenanceAgentRoleEnumFactory.java | 2 +- .../codesystems/ProvenanceAgentType.java | 2 +- .../ProvenanceAgentTypeEnumFactory.java | 2 +- .../codesystems/ProvenanceEntityRole.java | 2 +- .../ProvenanceEntityRoleEnumFactory.java | 2 +- .../codesystems/ProviderQualification.java | 2 +- .../ProviderQualificationEnumFactory.java | 2 +- .../model/codesystems/PublicationStatus.java | 2 +- .../PublicationStatusEnumFactory.java | 2 +- .../dstu3/model/codesystems/QualityType.java | 96 + .../codesystems/QualityTypeEnumFactory.java | 66 + .../model/codesystems/QuantityComparator.java | 2 +- .../QuantityComparatorEnumFactory.java | 2 +- .../model/codesystems/QuestionMaxOccurs.java | 2 +- .../QuestionMaxOccursEnumFactory.java | 2 +- .../QuestionnaireAnswersStatus.java | 2 +- ...QuestionnaireAnswersStatusEnumFactory.java | 2 +- .../QuestionnaireDisplayCategory.java | 2 +- ...estionnaireDisplayCategoryEnumFactory.java | 2 +- .../codesystems/QuestionnaireItemControl.java | 2 +- .../QuestionnaireItemControlEnumFactory.java | 2 +- .../codesystems/QuestionnaireStatus.java | 2 +- .../QuestionnaireStatusEnumFactory.java | 2 +- .../codesystems/QuestionnaireUsageMode.java | 2 +- .../QuestionnaireUsageModeEnumFactory.java | 2 +- .../codesystems/ReactionEventCertainty.java | 2 +- .../ReactionEventCertaintyEnumFactory.java | 2 +- .../codesystems/ReactionEventSeverity.java | 2 +- .../ReactionEventSeverityEnumFactory.java | 2 +- .../ReasonMedicationGivenCodes.java | 2 +- ...ReasonMedicationGivenCodesEnumFactory.java | 2 +- .../ReasonMedicationNotGivenCodes.java | 2 +- ...sonMedicationNotGivenCodesEnumFactory.java | 2 +- .../codesystems/ReferenceHandlingPolicy.java | 2 +- .../ReferenceHandlingPolicyEnumFactory.java | 2 +- .../codesystems/ReferenceVersionRules.java | 2 +- .../ReferenceVersionRulesEnumFactory.java | 2 +- .../codesystems/ReferencerangeMeaning.java | 2 +- .../ReferencerangeMeaningEnumFactory.java | 2 +- .../model/codesystems/Referralcategory.java | 2 +- .../ReferralcategoryEnumFactory.java | 2 +- .../model/codesystems/Referralstatus.java | 2 +- .../ReferralstatusEnumFactory.java | 2 +- .../codesystems/RelatedArtifactType.java | 2 +- .../RelatedArtifactTypeEnumFactory.java | 2 +- .../codesystems/RelatedClaimRelationship.java | 2 +- .../RelatedClaimRelationshipEnumFactory.java | 2 +- .../dstu3/model/codesystems/Relationship.java | 2 +- .../codesystems/RelationshipEnumFactory.java | 2 +- .../model/codesystems/RemittanceOutcome.java | 2 +- .../RemittanceOutcomeEnumFactory.java | 2 +- .../codesystems/ReportParticipantType.java | 2 +- .../ReportParticipantTypeEnumFactory.java | 2 +- .../model/codesystems/ReportResultCodes.java | 2 +- .../ReportResultCodesEnumFactory.java | 2 +- .../model/codesystems/ReportStatusCodes.java | 2 +- .../ReportStatusCodesEnumFactory.java | 2 +- .../model/codesystems/RepositoryType.java | 114 + .../RepositoryTypeEnumFactory.java | 74 + .../model/codesystems/RequestIntent.java | 143 + .../codesystems/RequestIntentEnumFactory.java | 86 + .../model/codesystems/RequestPriority.java | 2 +- .../RequestPriorityEnumFactory.java | 2 +- .../dstu3/model/codesystems/RequestStage.java | 2 +- .../codesystems/RequestStageEnumFactory.java | 2 +- .../model/codesystems/RequestStatus.java | 45 +- .../codesystems/RequestStatusEnumFactory.java | 14 +- .../codesystems/ResearchStudyStatus.java | 123 + .../ResearchStudyStatusEnumFactory.java | 78 + .../codesystems/ResearchSubjectStatus.java | 123 + .../ResearchSubjectStatusEnumFactory.java | 78 + .../codesystems/ResourceAggregationMode.java | 2 +- .../ResourceAggregationModeEnumFactory.java | 2 +- .../codesystems/ResourceSlicingRules.java | 2 +- .../ResourceSlicingRulesEnumFactory.java | 2 +- .../model/codesystems/ResourceTypeLink.java | 2 +- .../ResourceTypeLinkEnumFactory.java | 2 +- .../model/codesystems/ResourceTypes.java | 33 +- .../codesystems/ResourceTypesEnumFactory.java | 14 +- .../codesystems/ResourceValidationMode.java | 2 +- .../ResourceValidationModeEnumFactory.java | 2 +- .../dstu3/model/codesystems/ResponseCode.java | 2 +- .../codesystems/ResponseCodeEnumFactory.java | 2 +- .../codesystems/RestfulCapabilityMode.java | 2 +- .../RestfulCapabilityModeEnumFactory.java | 2 +- .../model/codesystems/RestfulInteraction.java | 15 +- .../RestfulInteractionEnumFactory.java | 6 +- .../codesystems/RestfulSecurityService.java | 2 +- .../RestfulSecurityServiceEnumFactory.java | 2 +- .../model/codesystems/RiskProbability.java | 2 +- .../RiskProbabilityEnumFactory.java | 2 +- .../fhir/dstu3/model/codesystems/Ruleset.java | 2 +- .../model/codesystems/RulesetEnumFactory.java | 2 +- .../model/codesystems/SearchComparator.java | 150 + .../SearchComparatorEnumFactory.java | 90 + .../model/codesystems/SearchEntryMode.java | 2 +- .../SearchEntryModeEnumFactory.java | 2 +- .../model/codesystems/SearchModifierCode.java | 2 +- .../SearchModifierCodeEnumFactory.java | 2 +- .../model/codesystems/SearchParamType.java | 2 +- .../SearchParamTypeEnumFactory.java | 2 +- .../model/codesystems/SearchXpathUsage.java | 2 +- .../SearchXpathUsageEnumFactory.java | 2 +- .../dstu3/model/codesystems/SequenceType.java | 2 +- .../codesystems/SequenceTypeEnumFactory.java | 2 +- .../model/codesystems/ServiceCategory.java | 2 +- .../ServiceCategoryEnumFactory.java | 2 +- .../model/codesystems/ServiceModifiers.java | 2 +- .../ServiceModifiersEnumFactory.java | 2 +- .../model/codesystems/ServicePharmacy.java | 2 +- .../ServicePharmacyEnumFactory.java | 2 +- .../dstu3/model/codesystems/ServicePlace.java | 2 +- .../codesystems/ServicePlaceEnumFactory.java | 2 +- .../model/codesystems/ServiceProduct.java | 2 +- .../ServiceProductEnumFactory.java | 2 +- .../ServiceProvisionConditions.java | 2 +- ...ServiceProvisionConditionsEnumFactory.java | 2 +- .../codesystems/ServiceReferralMethod.java | 2 +- .../ServiceReferralMethodEnumFactory.java | 2 +- .../dstu3/model/codesystems/ServiceType.java | 2 +- .../codesystems/ServiceTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/ServiceUscls.java | 2 +- .../codesystems/ServiceUsclsEnumFactory.java | 2 +- .../model/codesystems/SignatureType.java | 2 +- .../codesystems/SignatureTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/Slotstatus.java | 2 +- .../codesystems/SlotstatusEnumFactory.java | 2 +- .../model/codesystems/SpecialValues.java | 2 +- .../codesystems/SpecialValuesEnumFactory.java | 2 +- .../model/codesystems/SpecimenStatus.java | 2 +- .../SpecimenStatusEnumFactory.java | 2 +- .../codesystems/StructureDefinitionKind.java | 2 +- .../StructureDefinitionKindEnumFactory.java | 2 +- .../codesystems/SubscriptionChannelType.java | 2 +- .../SubscriptionChannelTypeEnumFactory.java | 2 +- .../model/codesystems/SubscriptionStatus.java | 2 +- .../SubscriptionStatusEnumFactory.java | 2 +- .../model/codesystems/SubscriptionTag.java | 2 +- .../SubscriptionTagEnumFactory.java | 2 +- .../model/codesystems/SubstanceCategory.java | 2 +- .../SubstanceCategoryEnumFactory.java | 2 +- .../codesystems/SupplydeliveryStatus.java | 2 +- .../SupplydeliveryStatusEnumFactory.java | 2 +- .../model/codesystems/SupplydeliveryType.java | 2 +- .../SupplydeliveryTypeEnumFactory.java | 2 +- .../model/codesystems/SupplyrequestKind.java | 2 +- .../SupplyrequestKindEnumFactory.java | 2 +- .../codesystems/SupplyrequestReason.java | 2 +- .../SupplyrequestReasonEnumFactory.java | 2 +- .../codesystems/SupplyrequestStatus.java | 2 +- .../SupplyrequestStatusEnumFactory.java | 2 +- .../fhir/dstu3/model/codesystems/Surface.java | 2 +- .../model/codesystems/SurfaceEnumFactory.java | 2 +- .../SystemVersionProcessingMode.java | 2 +- ...ystemVersionProcessingModeEnumFactory.java | 2 +- .../model/codesystems/TaskPerformerType.java | 2 +- .../TaskPerformerTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/TaskPriority.java | 2 +- .../codesystems/TaskPriorityEnumFactory.java | 2 +- .../dstu3/model/codesystems/TaskStage.java | 2 +- .../codesystems/TaskStageEnumFactory.java | 2 +- .../dstu3/model/codesystems/TaskStatus.java | 24 +- .../codesystems/TaskStatusEnumFactory.java | 10 +- .../fhir/dstu3/model/codesystems/Teeth.java | 2 +- .../model/codesystems/TeethEnumFactory.java | 2 +- .../codesystems/TestscriptOperationCodes.java | 6 +- .../TestscriptOperationCodesEnumFactory.java | 2 +- .../TestscriptProfileDestinationTypes.java | 2 +- ...iptProfileDestinationTypesEnumFactory.java | 2 +- .../TestscriptProfileOriginTypes.java | 2 +- ...stscriptProfileOriginTypesEnumFactory.java | 2 +- .../fhir/dstu3/model/codesystems/Tooth.java | 2 +- .../model/codesystems/ToothEnumFactory.java | 2 +- .../model/codesystems/TransactionMode.java | 2 +- .../TransactionModeEnumFactory.java | 2 +- .../model/codesystems/TypeDerivationRule.java | 2 +- .../TypeDerivationRuleEnumFactory.java | 2 +- .../hl7/fhir/dstu3/model/codesystems/Udi.java | 2 +- .../model/codesystems/UdiEnumFactory.java | 2 +- .../model/codesystems/UnknownContentCode.java | 2 +- .../UnknownContentCodeEnumFactory.java | 2 +- .../model/codesystems/UsageContextType.java | 2 +- .../UsageContextTypeEnumFactory.java | 2 +- .../V3AcknowledgementCondition.java | 2 +- ...V3AcknowledgementConditionEnumFactory.java | 2 +- .../V3AcknowledgementDetailCode.java | 2 +- ...3AcknowledgementDetailCodeEnumFactory.java | 2 +- .../V3AcknowledgementDetailType.java | 2 +- ...3AcknowledgementDetailTypeEnumFactory.java | 2 +- .../codesystems/V3AcknowledgementType.java | 2 +- .../V3AcknowledgementTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3ActClass.java | 2 +- .../codesystems/V3ActClassEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3ActCode.java | 56 +- .../codesystems/V3ActCodeEnumFactory.java | 26 +- .../codesystems/V3ActExposureLevelCode.java | 2 +- .../V3ActExposureLevelCodeEnumFactory.java | 2 +- .../V3ActInvoiceElementModifier.java | 2 +- ...3ActInvoiceElementModifierEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3ActMood.java | 2 +- .../codesystems/V3ActMoodEnumFactory.java | 2 +- .../model/codesystems/V3ActPriority.java | 2 +- .../codesystems/V3ActPriorityEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3ActReason.java | 2 +- .../codesystems/V3ActReasonEnumFactory.java | 2 +- .../V3ActRelationshipCheckpoint.java | 2 +- ...3ActRelationshipCheckpointEnumFactory.java | 2 +- .../codesystems/V3ActRelationshipJoin.java | 2 +- .../V3ActRelationshipJoinEnumFactory.java | 2 +- .../codesystems/V3ActRelationshipSplit.java | 2 +- .../V3ActRelationshipSplitEnumFactory.java | 2 +- .../codesystems/V3ActRelationshipSubset.java | 2 +- .../V3ActRelationshipSubsetEnumFactory.java | 2 +- .../codesystems/V3ActRelationshipType.java | 2 +- .../V3ActRelationshipTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3ActSite.java | 2 +- .../codesystems/V3ActSiteEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3ActStatus.java | 2 +- .../codesystems/V3ActStatusEnumFactory.java | 2 +- .../model/codesystems/V3ActUSPrivacyLaw.java | 2 +- .../V3ActUSPrivacyLawEnumFactory.java | 2 +- .../model/codesystems/V3ActUncertainty.java | 2 +- .../V3ActUncertaintyEnumFactory.java | 2 +- .../model/codesystems/V3AddressPartType.java | 2 +- .../V3AddressPartTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3AddressUse.java | 2 +- .../codesystems/V3AddressUseEnumFactory.java | 2 +- .../codesystems/V3AdministrativeGender.java | 2 +- .../V3AdministrativeGenderEnumFactory.java | 2 +- ...V3AmericanIndianAlaskaNativeLanguages.java | 2 +- ...ndianAlaskaNativeLanguagesEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3Calendar.java | 2 +- .../model/codesystems/V3CalendarCycle.java | 2 +- .../V3CalendarCycleEnumFactory.java | 2 +- .../codesystems/V3CalendarEnumFactory.java | 2 +- .../model/codesystems/V3CalendarType.java | 2 +- .../V3CalendarTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3Charset.java | 2 +- .../codesystems/V3CharsetEnumFactory.java | 2 +- .../model/codesystems/V3CodingRationale.java | 2 +- .../V3CodingRationaleEnumFactory.java | 2 +- .../V3CommunicationFunctionType.java | 2 +- ...3CommunicationFunctionTypeEnumFactory.java | 2 +- .../codesystems/V3CompressionAlgorithm.java | 2 +- .../V3CompressionAlgorithmEnumFactory.java | 2 +- .../model/codesystems/V3Confidentiality.java | 2 +- .../V3ConfidentialityEnumFactory.java | 2 +- .../model/codesystems/V3ContainerCap.java | 2 +- .../V3ContainerCapEnumFactory.java | 2 +- .../codesystems/V3ContainerSeparator.java | 2 +- .../V3ContainerSeparatorEnumFactory.java | 2 +- .../codesystems/V3ContentProcessingMode.java | 2 +- .../V3ContentProcessingModeEnumFactory.java | 2 +- .../model/codesystems/V3ContextControl.java | 2 +- .../V3ContextControlEnumFactory.java | 2 +- .../model/codesystems/V3DataOperation.java | 2 +- .../V3DataOperationEnumFactory.java | 2 +- .../model/codesystems/V3DeviceAlertLevel.java | 2 +- .../V3DeviceAlertLevelEnumFactory.java | 2 +- .../codesystems/V3DocumentCompletion.java | 2 +- .../V3DocumentCompletionEnumFactory.java | 2 +- .../model/codesystems/V3DocumentStorage.java | 2 +- .../V3DocumentStorageEnumFactory.java | 2 +- .../model/codesystems/V3EducationLevel.java | 2 +- .../V3EducationLevelEnumFactory.java | 2 +- .../model/codesystems/V3EmployeeJobClass.java | 2 +- .../V3EmployeeJobClassEnumFactory.java | 2 +- .../V3EncounterAdmissionSource.java | 2 +- ...V3EncounterAdmissionSourceEnumFactory.java | 2 +- .../V3EncounterSpecialCourtesy.java | 2 +- ...V3EncounterSpecialCourtesyEnumFactory.java | 2 +- .../model/codesystems/V3EntityClass.java | 2 +- .../codesystems/V3EntityClassEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3EntityCode.java | 2 +- .../codesystems/V3EntityCodeEnumFactory.java | 2 +- .../model/codesystems/V3EntityDeterminer.java | 2 +- .../V3EntityDeterminerEnumFactory.java | 2 +- .../model/codesystems/V3EntityHandling.java | 2 +- .../V3EntityHandlingEnumFactory.java | 2 +- .../V3EntityNamePartQualifier.java | 2 +- .../V3EntityNamePartQualifierEnumFactory.java | 2 +- .../V3EntityNamePartQualifierR2.java | 2 +- ...3EntityNamePartQualifierR2EnumFactory.java | 2 +- .../codesystems/V3EntityNamePartType.java | 2 +- .../V3EntityNamePartTypeEnumFactory.java | 2 +- .../codesystems/V3EntityNamePartTypeR2.java | 2 +- .../V3EntityNamePartTypeR2EnumFactory.java | 2 +- .../model/codesystems/V3EntityNameUse.java | 2 +- .../V3EntityNameUseEnumFactory.java | 2 +- .../model/codesystems/V3EntityNameUseR2.java | 2 +- .../V3EntityNameUseR2EnumFactory.java | 2 +- .../dstu3/model/codesystems/V3EntityRisk.java | 2 +- .../codesystems/V3EntityRiskEnumFactory.java | 2 +- .../model/codesystems/V3EntityStatus.java | 2 +- .../V3EntityStatusEnumFactory.java | 2 +- .../codesystems/V3EquipmentAlertLevel.java | 2 +- .../V3EquipmentAlertLevelEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3Ethnicity.java | 2 +- .../codesystems/V3EthnicityEnumFactory.java | 2 +- .../model/codesystems/V3ExposureMode.java | 2 +- .../V3ExposureModeEnumFactory.java | 2 +- .../model/codesystems/V3GTSAbbreviation.java | 2 +- .../V3GTSAbbreviationEnumFactory.java | 2 +- .../model/codesystems/V3GenderStatus.java | 2 +- .../V3GenderStatusEnumFactory.java | 2 +- .../model/codesystems/V3HL7UpdateMode.java | 2 +- .../V3HL7UpdateModeEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3Hl7Realm.java | 2 +- .../codesystems/V3Hl7RealmEnumFactory.java | 2 +- .../model/codesystems/V3Hl7V3Conformance.java | 2 +- .../V3Hl7V3ConformanceEnumFactory.java | 2 +- .../model/codesystems/V3HtmlLinkType.java | 2 +- .../V3HtmlLinkTypeEnumFactory.java | 2 +- .../codesystems/V3IdentifierReliability.java | 2 +- .../V3IdentifierReliabilityEnumFactory.java | 2 +- .../model/codesystems/V3IdentifierScope.java | 2 +- .../V3IdentifierScopeEnumFactory.java | 2 +- .../V3IntegrityCheckAlgorithm.java | 2 +- .../V3IntegrityCheckAlgorithmEnumFactory.java | 2 +- .../codesystems/V3LanguageAbilityMode.java | 2 +- .../V3LanguageAbilityModeEnumFactory.java | 2 +- .../V3LanguageAbilityProficiency.java | 2 +- ...LanguageAbilityProficiencyEnumFactory.java | 2 +- .../codesystems/V3LivingArrangement.java | 2 +- .../V3LivingArrangementEnumFactory.java | 2 +- .../codesystems/V3LocalMarkupIgnore.java | 2 +- .../V3LocalMarkupIgnoreEnumFactory.java | 2 +- .../V3LocalRemoteControlState.java | 2 +- .../V3LocalRemoteControlStateEnumFactory.java | 2 +- .../V3ManagedParticipationStatus.java | 2 +- ...ManagedParticipationStatusEnumFactory.java | 2 +- .../model/codesystems/V3MapRelationship.java | 2 +- .../V3MapRelationshipEnumFactory.java | 2 +- .../model/codesystems/V3MaritalStatus.java | 2 +- .../V3MaritalStatusEnumFactory.java | 2 +- .../codesystems/V3MessageWaitingPriority.java | 2 +- .../V3MessageWaitingPriorityEnumFactory.java | 2 +- .../model/codesystems/V3ModifyIndicator.java | 2 +- .../V3ModifyIndicatorEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3NullFlavor.java | 2 +- .../codesystems/V3NullFlavorEnumFactory.java | 2 +- .../V3ObservationInterpretation.java | 47 +- ...3ObservationInterpretationEnumFactory.java | 10 +- .../codesystems/V3ObservationMethod.java | 2 +- .../V3ObservationMethodEnumFactory.java | 2 +- .../model/codesystems/V3ObservationValue.java | 55 +- .../V3ObservationValueEnumFactory.java | 22 +- .../codesystems/V3OrderableDrugForm.java | 2 +- .../V3OrderableDrugFormEnumFactory.java | 2 +- .../codesystems/V3ParticipationFunction.java | 2 +- .../V3ParticipationFunctionEnumFactory.java | 2 +- .../codesystems/V3ParticipationMode.java | 2 +- .../V3ParticipationModeEnumFactory.java | 2 +- .../codesystems/V3ParticipationSignature.java | 2 +- .../V3ParticipationSignatureEnumFactory.java | 2 +- .../codesystems/V3ParticipationType.java | 2 +- .../V3ParticipationTypeEnumFactory.java | 2 +- .../codesystems/V3PatientImportance.java | 2 +- .../V3PatientImportanceEnumFactory.java | 2 +- .../model/codesystems/V3PaymentTerms.java | 2 +- .../V3PaymentTermsEnumFactory.java | 2 +- .../codesystems/V3PersonDisabilityType.java | 2 +- .../V3PersonDisabilityTypeEnumFactory.java | 2 +- .../V3ProbabilityDistributionType.java | 2 +- ...robabilityDistributionTypeEnumFactory.java | 2 +- .../model/codesystems/V3ProcessingID.java | 2 +- .../V3ProcessingIDEnumFactory.java | 2 +- .../model/codesystems/V3ProcessingMode.java | 2 +- .../V3ProcessingModeEnumFactory.java | 2 +- .../codesystems/V3QueryParameterValue.java | 2 +- .../V3QueryParameterValueEnumFactory.java | 2 +- .../model/codesystems/V3QueryPriority.java | 2 +- .../V3QueryPriorityEnumFactory.java | 2 +- .../codesystems/V3QueryRequestLimit.java | 2 +- .../V3QueryRequestLimitEnumFactory.java | 2 +- .../model/codesystems/V3QueryResponse.java | 2 +- .../V3QueryResponseEnumFactory.java | 2 +- .../model/codesystems/V3QueryStatusCode.java | 2 +- .../V3QueryStatusCodeEnumFactory.java | 2 +- .../fhir/dstu3/model/codesystems/V3Race.java | 2 +- .../model/codesystems/V3RaceEnumFactory.java | 2 +- .../codesystems/V3RelationalOperator.java | 2 +- .../V3RelationalOperatorEnumFactory.java | 2 +- .../V3RelationshipConjunction.java | 2 +- .../V3RelationshipConjunctionEnumFactory.java | 2 +- .../codesystems/V3ReligiousAffiliation.java | 2 +- .../V3ReligiousAffiliationEnumFactory.java | 2 +- .../model/codesystems/V3ResponseLevel.java | 2 +- .../V3ResponseLevelEnumFactory.java | 2 +- .../model/codesystems/V3ResponseModality.java | 2 +- .../V3ResponseModalityEnumFactory.java | 2 +- .../model/codesystems/V3ResponseMode.java | 2 +- .../V3ResponseModeEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3RoleClass.java | 2 +- .../codesystems/V3RoleClassEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3RoleCode.java | 2 +- .../codesystems/V3RoleCodeEnumFactory.java | 2 +- .../model/codesystems/V3RoleLinkStatus.java | 2 +- .../V3RoleLinkStatusEnumFactory.java | 2 +- .../model/codesystems/V3RoleLinkType.java | 2 +- .../V3RoleLinkTypeEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3RoleStatus.java | 2 +- .../codesystems/V3RoleStatusEnumFactory.java | 2 +- .../codesystems/V3RouteOfAdministration.java | 2 +- .../V3RouteOfAdministrationEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3Sequencing.java | 2 +- .../codesystems/V3SequencingEnumFactory.java | 2 +- .../model/codesystems/V3SetOperator.java | 2 +- .../codesystems/V3SetOperatorEnumFactory.java | 2 +- .../model/codesystems/V3SpecimenType.java | 2 +- .../V3SpecimenTypeEnumFactory.java | 2 +- .../V3SubstanceAdminSubstitution.java | 2 +- ...SubstanceAdminSubstitutionEnumFactory.java | 2 +- .../codesystems/V3SubstitutionCondition.java | 2 +- .../V3SubstitutionConditionEnumFactory.java | 2 +- .../V3TableCellHorizontalAlign.java | 2 +- ...V3TableCellHorizontalAlignEnumFactory.java | 2 +- .../model/codesystems/V3TableCellScope.java | 2 +- .../V3TableCellScopeEnumFactory.java | 2 +- .../codesystems/V3TableCellVerticalAlign.java | 2 +- .../V3TableCellVerticalAlignEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3TableFrame.java | 2 +- .../codesystems/V3TableFrameEnumFactory.java | 2 +- .../dstu3/model/codesystems/V3TableRules.java | 2 +- .../codesystems/V3TableRulesEnumFactory.java | 2 +- .../model/codesystems/V3TargetAwareness.java | 2 +- .../V3TargetAwarenessEnumFactory.java | 2 +- .../V3TelecommunicationCapabilities.java | 2 +- ...ecommunicationCapabilitiesEnumFactory.java | 2 +- .../model/codesystems/V3TimingEvent.java | 2 +- .../codesystems/V3TimingEventEnumFactory.java | 2 +- .../V3TransmissionRelationshipTypeCode.java | 2 +- ...issionRelationshipTypeCodeEnumFactory.java | 2 +- .../model/codesystems/V3TribalEntityUS.java | 2 +- .../V3TribalEntityUSEnumFactory.java | 2 +- .../codesystems/V3VaccineManufacturer.java | 2 +- .../V3VaccineManufacturerEnumFactory.java | 2 +- .../VaccinationProtocolDoseStatus.java | 2 +- ...cinationProtocolDoseStatusEnumFactory.java | 2 +- .../VaccinationProtocolDoseStatusReason.java | 2 +- ...onProtocolDoseStatusReasonEnumFactory.java | 2 +- .../dstu3/model/codesystems/ValueCodes.java | 2 +- .../codesystems/ValueCodesEnumFactory.java | 2 +- .../dstu3/model/codesystems/VariantState.java | 2 +- .../codesystems/VariantStateEnumFactory.java | 2 +- .../model/codesystems/VersioningPolicy.java | 2 +- .../VersioningPolicyEnumFactory.java | 2 +- .../model/codesystems/VisionBaseCodes.java | 2 +- .../VisionBaseCodesEnumFactory.java | 2 +- .../model/codesystems/VisionEyeCodes.java | 2 +- .../VisionEyeCodesEnumFactory.java | 2 +- .../model/codesystems/VisionProduct.java | 2 +- .../codesystems/VisionProductEnumFactory.java | 2 +- .../dstu3/model/codesystems/VisionStatus.java | 2 +- .../codesystems/VisionStatusEnumFactory.java | 2 +- .../codesystems/XdsRelationshipType.java | 2 +- .../XdsRelationshipTypeEnumFactory.java | 2 +- .../terminologies/CodeSystemUtilities.java | 43 +- .../terminologies/ValueSetExpanderSimple.java | 46 +- ...entPathEngine.java => FHIRPathEngine.java} | 8 +- .../fhir/dstu3/utils/NarrativeGenerator.java | 9 + .../dstu3/utils/StructureMapUtilities.java | 28 +- .../utils/formats/JsonTrackingParser.java | 498 + .../utils/formats/XmlLocationAnnotator.java | 102 + .../dstu3/utils/formats/XmlLocationData.java | 49 + .../dstu3/validation/InstanceValidator.java | 180 +- .../dstu3/validation/ValidationEngine.java | 16 + .../hl7/fhir/utilities/xhtml/XhtmlParser.java | 1114 - .../fhir/dstu3/model/fhirversion.properties | 3 + .../uhn/fhir/fluentpath/FluentPathTest.java | 20 +- .../ca/uhn/fhir/model/ModelDstu3Test.java | 22 +- .../model/ModelSerializationDstu3Test.java | 4 +- ...tThymeleafNarrativeGeneratorDstu3Test.java | 2 +- .../uhn/fhir/parser/CustomTypeDstu3Test.java | 4 +- .../uhn/fhir/parser/JsonParserDstu3Test.java | 96 +- .../uhn/fhir/parser/XmlParserDstu3Test.java | 90 +- .../client/ClientWithCustomTypeDstu3Test.java | 4 +- .../rest/client/GenericClientDstu3Test.java | 18 +- .../client/NonGenericClientDstu3Test.java | 2 +- .../uhn/fhir/rest/server/CreateDstu3Test.java | 2 +- .../rest/server/OperationServerDstu3Test.java | 2 +- .../server/SearchCountParamDstu3Test.java | 4 +- .../uhn/fhir/rest/server/SearchDstu3Test.java | 2 +- .../rest/server/SearchHasParamDstu3Test.java | 2 +- .../fhir/rest/server/SearchPostDstu3Test.java | 2 +- .../fhir/rest/server/SearchSortDstu3Test.java | 2 +- .../SearchWithGenericListDstu3Test.java | 2 +- ...rchWithServerAddressStrategyDstu3Test.java | 16 +- .../rest/server/ServerMimetypeDstu3Test.java | 16 +- ...pprtedHttpMethodsInterceptorDstu3Test.java | 2 +- .../interceptor/CorsInterceptorDstu3Test.java | 4 +- .../ca/uhn/fhir/util/FhirTerserDstu3Test.java | 6 +- .../FhirInstanceValidatorDstu3Test.java | 36 +- ...rCapabilityStatementProviderDstu3Test.java | 8 +- .../ResourceValidatorDstu3Test.java | 8 +- .../model/BaseDateTimeTypeDstu3Test.java | 10 +- .../fhir/dstu3/utils/FhirPathEngineTest.java | 4 +- .../json-edge-case-modified-335.json | 31 +- .../questionnaire_jon_z_20160506.xml | 50 +- .../src/test/resources/sample-document.xml | 4 + .../model/dstu3/profile/profiles-others.xml | 4545 +--- .../dstu3/profile/profiles-resources.xml | 18080 ++++++++++------ .../model/dstu3/profile/profiles-types.xml | 914 +- .../instance/model/dstu3/schema/account.sch | 15 +- .../model/dstu3/schema/activitydefinition.sch | 16 +- .../model/dstu3/schema/allergyintolerance.sch | 26 +- .../model/dstu3/schema/appointment.sch | 3 +- .../dstu3/schema/appointmentresponse.sch | 3 +- .../model/dstu3/schema/auditevent.sch | 3 +- .../instance/model/dstu3/schema/basic.sch | 3 +- .../instance/model/dstu3/schema/binary.sch | 9 + .../instance/model/dstu3/schema/bodysite.sch | 3 +- .../instance/model/dstu3/schema/bundle.sch | 8 +- .../dstu3/schema/capabilitystatement.sch | 8 +- .../instance/model/dstu3/schema/careplan.sch | 5 +- .../instance/model/dstu3/schema/careteam.sch | 3 +- .../instance/model/dstu3/schema/claim.sch | 108 +- .../model/dstu3/schema/claimresponse.sch | 48 +- .../model/dstu3/schema/clinicalimpression.sch | 3 +- .../model/dstu3/schema/codesystem.sch | 3 +- .../model/dstu3/schema/communication.sch | 3 +- .../dstu3/schema/communicationrequest.sch | 3 +- .../dstu3/schema/compartmentdefinition.sch | 3 +- .../model/dstu3/schema/composition.sch | 6 +- .../model/dstu3/schema/conceptmap.sch | 3 +- .../instance/model/dstu3/schema/condition.sch | 5 +- .../instance/model/dstu3/schema/consent.sch | 3 +- .../instance/model/dstu3/schema/contract.sch | 3 +- .../instance/model/dstu3/schema/coverage.sch | 38 +- .../model/dstu3/schema/dataelement.sch | 5 +- .../model/dstu3/schema/detectedissue.sch | 3 +- .../instance/model/dstu3/schema/device.sch | 3 +- .../model/dstu3/schema/devicecomponent.sch | 3 +- .../model/dstu3/schema/devicemetric.sch | 5 +- .../model/dstu3/schema/deviceuserequest.sch | 5 +- .../model/dstu3/schema/deviceusestatement.sch | 14 +- .../schema/diagnosticreport-genetics.sch | 44 + .../model/dstu3/schema/diagnosticreport.sch | 3 +- .../schema/diagnosticrequest-genetics.sch | 28 + .../model/dstu3/schema/diagnosticrequest.sch | 14 +- .../model/dstu3/schema/documentmanifest.sch | 3 +- .../model/dstu3/schema/documentreference.sch | 3 +- .../dstu3/schema/elementdefinition-de.sch | 8 +- .../model/dstu3/schema/eligibilityrequest.sch | 39 +- .../dstu3/schema/eligibilityresponse.sch | 58 +- .../instance/model/dstu3/schema/encounter.sch | 3 +- .../instance/model/dstu3/schema/endpoint.sch | 3 +- .../model/dstu3/schema/enrollmentrequest.sch | 59 +- .../model/dstu3/schema/enrollmentresponse.sch | 59 +- .../model/dstu3/schema/episodeofcare.sch | 3 +- .../model/dstu3/schema/expansionprofile.sch | 3 +- .../dstu3/schema/explanationofbenefit.sch | 135 +- .../schema/familymemberhistory-genetic.sch | 4 +- .../dstu3/schema/familymemberhistory.sch | 5 +- .../model/dstu3/schema/fhir-invariants.sch | 1790 +- .../model/dstu3/schema/fhir-single.xsd | 3675 ++-- .../fhir/instance/model/dstu3/schema/flag.sch | 3 +- .../fhir/instance/model/dstu3/schema/goal.sch | 3 +- .../instance/model/dstu3/schema/group.sch | 3 +- .../model/dstu3/schema/guidanceresponse.sch | 18 +- .../model/dstu3/schema/healthcareservice.sch | 12 +- .../model/dstu3/schema/imagingmanifest.sch | 3 +- .../model/dstu3/schema/imagingstudy.sch | 3 +- .../model/dstu3/schema/immunization.sch | 3 +- .../schema/immunizationrecommendation.sch | 3 +- .../dstu3/schema/implementationguide.sch | 3 +- .../instance/model/dstu3/schema/library.sch | 12 +- .../instance/model/dstu3/schema/linkage.sch | 3 +- .../fhir/instance/model/dstu3/schema/list.sch | 3 +- .../instance/model/dstu3/schema/location.sch | 3 +- .../instance/model/dstu3/schema/measure.sch | 3 +- .../model/dstu3/schema/measurereport.sch | 3 +- .../instance/model/dstu3/schema/media.sch | 3 +- .../model/dstu3/schema/medication.sch | 3 +- .../dstu3/schema/medicationadministration.sch | 14 +- .../model/dstu3/schema/medicationdispense.sch | 14 +- .../model/dstu3/schema/medicationrequest.sch | 20 +- .../dstu3/schema/medicationstatement.sch | 20 +- .../model/dstu3/schema/messagedefinition.sch | 104 + .../model/dstu3/schema/messageheader.sch | 3 +- .../model/dstu3/schema/namingsystem.sch | 3 +- .../model/dstu3/schema/nutritionrequest.sch | 9 +- .../dstu3/schema/observation-genetics.sch | 90 + .../model/dstu3/schema/observation.sch | 3 +- .../dstu3/schema/operationdefinition.sch | 3 +- .../model/dstu3/schema/operationoutcome.sch | 3 +- .../model/dstu3/schema/organization.sch | 3 +- .../instance/model/dstu3/schema/patient.sch | 3 +- .../model/dstu3/schema/paymentnotice.sch | 39 +- .../dstu3/schema/paymentreconciliation.sch | 21 +- .../instance/model/dstu3/schema/person.sch | 3 +- .../model/dstu3/schema/plandefinition.sch | 46 +- .../model/dstu3/schema/practitioner.sch | 3 +- .../model/dstu3/schema/practitionerrole.sch | 3 +- .../instance/model/dstu3/schema/procedure.sch | 3 +- .../model/dstu3/schema/procedurerequest.sch | 5 +- .../model/dstu3/schema/processrequest.sch | 3 +- .../model/dstu3/schema/processresponse.sch | 30 +- .../model/dstu3/schema/provenance.sch | 25 +- .../model/dstu3/schema/questionnaire.sch | 4 +- .../dstu3/schema/questionnaireresponse.sch | 6 +- .../model/dstu3/schema/referralrequest.sch | 3 +- .../model/dstu3/schema/relatedperson.sch | 3 +- .../model/dstu3/schema/requestgroup.sch | 34 +- .../model/dstu3/schema/researchstudy.sch | 128 + .../model/dstu3/schema/researchsubject.sch | 74 + .../model/dstu3/schema/riskassessment.sch | 3 +- .../instance/model/dstu3/schema/schedule.sch | 3 +- .../model/dstu3/schema/searchparameter.sch | 10 +- .../instance/model/dstu3/schema/sequence.sch | 18 +- .../model/dstu3/schema/servicedefinition.sch | 23 +- .../model/dstu3/schema/shareablevalueset.sch | 2 +- .../fhir/instance/model/dstu3/schema/slot.sch | 3 +- .../instance/model/dstu3/schema/specimen.sch | 3 +- .../dstu3/schema/structuredefinition.sch | 12 +- .../model/dstu3/schema/structuremap.sch | 3 +- .../model/dstu3/schema/subscription.sch | 3 +- .../instance/model/dstu3/schema/substance.sch | 3 +- .../model/dstu3/schema/supplydelivery.sch | 3 +- .../model/dstu3/schema/supplyrequest.sch | 5 +- .../fhir/instance/model/dstu3/schema/task.sch | 67 +- .../model/dstu3/schema/testreport.sch | 3 +- .../model/dstu3/schema/testscript.sch | 3 +- .../instance/model/dstu3/schema/valueset.sch | 3 +- .../model/dstu3/schema/visionprescription.sch | 21 +- .../model/dstu3/valueset/v2-tables.xml | 2145 +- .../model/dstu3/valueset/v3-codesystems.xml | 3074 +-- .../model/dstu3/valueset/valuesets.xml | 11102 +++++----- hapi-tinder-plugin/.classpath | 1 + .../VersionPropertyFileGeneratorMojo.java | 3 + .../res/dstu3/account-spreadsheet.xml | 12753 +++++------ .../dstu3/activitydefinition-spreadsheet.xml | 74 +- .../dstu3/allergyintolerance-spreadsheet.xml | 11410 +++++----- .../res/dstu3/appointment-spreadsheet.xml | 2 +- .../res/dstu3/auditevent-spreadsheet.xml | 477 +- .../res/dstu3/binary-spreadsheet.xml | 167 +- .../res/dstu3/bundle-spreadsheet.xml | 275 +- .../dstu3/capabilitystatement-spreadsheet.xml | 14166 ++++++------ .../res/dstu3/careplan-spreadsheet.xml | 33 +- .../resources/res/dstu3/claim-spreadsheet.xml | 13131 +++++------ .../res/dstu3/claimresponse-spreadsheet.xml | 5751 ++--- .../dstu3/clinicalimpression-spreadsheet.xml | 24 +- .../res/dstu3/codesystem-spreadsheet.xml | 53 +- .../communicationrequest-spreadsheet.xml | 14 +- .../res/dstu3/conceptmap-spreadsheet.xml | 251 +- .../res/dstu3/condition-spreadsheet.xml | 277 +- .../res/dstu3/contract-spreadsheet.xml | 90 +- .../res/dstu3/coverage-spreadsheet.xml | 8314 +++---- .../res/dstu3/definition-spreadsheet.xml | 5536 ++--- .../res/dstu3/device-spreadsheet.xml | 831 +- .../res/dstu3/devicecomponent-spreadsheet.xml | 20 +- .../dstu3/deviceusestatement-spreadsheet.xml | 116 +- .../dstu3/diagnosticreport-spreadsheet.xml | 54 +- .../dstu3/diagnosticrequest-spreadsheet.xml | 252 +- .../dstu3/documentreference-spreadsheet.xml | 28 +- .../dstu3/eligibilityrequest-spreadsheet.xml | 420 +- .../dstu3/eligibilityresponse-spreadsheet.xml | 5685 ++--- .../res/dstu3/encounter-spreadsheet.xml | 25 +- .../res/dstu3/endpoint-spreadsheet.xml | 19 +- .../dstu3/enrollmentrequest-spreadsheet.xml | 86 +- .../dstu3/enrollmentresponse-spreadsheet.xml | 77 +- .../resources/res/dstu3/event-spreadsheet.xml | 619 +- .../dstu3/expansionprofile-spreadsheet.xml | 25 +- .../explanationofbenefit-spreadsheet.xml | 4022 ++-- .../dstu3/familymemberhistory-spreadsheet.xml | 178 +- .../resources/res/dstu3/group-spreadsheet.xml | 19 +- .../dstu3/guidanceresponse-spreadsheet.xml | 4672 ++-- .../dstu3/healthcareservice-spreadsheet.xml | 1087 +- .../res/dstu3/immunization-spreadsheet.xml | 147 +- .../res/dstu3/library-spreadsheet.xml | 9 +- .../resources/res/dstu3/list-spreadsheet.xml | 9912 ++++----- .../res/dstu3/location-spreadsheet.xml | 788 +- .../res/dstu3/measure-spreadsheet.xml | 761 +- .../res/dstu3/measurereport-spreadsheet.xml | 103 +- .../medicationadministration-spreadsheet.xml | 40 +- .../dstu3/medicationrequest-spreadsheet.xml | 72 +- .../dstu3/medicationstatement-spreadsheet.xml | 852 +- .../dstu3/messagedefinition-spreadsheet.xml | 8263 +++++++ .../res/dstu3/observation-spreadsheet.xml | 3150 +-- .../dstu3/operationdefinition-spreadsheet.xml | 2 +- .../res/dstu3/organization-spreadsheet.xml | 21 +- .../res/dstu3/paymentnotice-spreadsheet.xml | 424 +- .../paymentreconciliation-spreadsheet.xml | 5438 ++--- .../res/dstu3/plandefinition-spreadsheet.xml | 769 +- .../res/dstu3/practitioner-spreadsheet.xml | 404 +- .../dstu3/practitionerrole-spreadsheet.xml | 196 +- .../res/dstu3/processrequest-spreadsheet.xml | 182 +- .../res/dstu3/processresponse-spreadsheet.xml | 5598 ++--- .../res/dstu3/provenance-spreadsheet.xml | 385 +- .../res/dstu3/questionnaire-spreadsheet.xml | 335 +- .../questionnaireresponse-spreadsheet.xml | 119 +- .../res/dstu3/request-spreadsheet.xml | 2144 +- .../res/dstu3/requestgroup-spreadsheet.xml | 589 +- .../res/dstu3/researchstudy-spreadsheet.xml | 7687 +++++++ .../res/dstu3/researchsubject-spreadsheet.xml | 7310 +++++++ .../res/dstu3/searchparameter-spreadsheet.xml | 2060 +- .../res/dstu3/sequence-spreadsheet.xml | 11062 +++++----- .../dstu3/servicedefinition-spreadsheet.xml | 63 +- .../dstu3/structuredefinition-spreadsheet.xml | 193 +- .../res/dstu3/structuremap-spreadsheet.xml | 228 +- .../resources/res/dstu3/task-spreadsheet.xml | 3280 ++- .../res/dstu3/testscript-spreadsheet.xml | 14 +- .../res/dstu3/valueset-spreadsheet.xml | 382 +- .../dstu3/visionprescription-spreadsheet.xml | 8576 ++++---- pom.xml | 1 + sync_ri3.fish | 15 +- 1739 files changed, 489772 insertions(+), 108848 deletions(-) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/exceptions/DefinitionException.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/exceptions/FHIRException.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/exceptions/FHIRFormatError.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/exceptions/NoTerminologyServiceException.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/exceptions/PathEngineException.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/exceptions/TerminologyServiceException.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/exceptions/UcumException.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/CSFile.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/FileNotifier.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/Table.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/TextFile.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/TextStreamWriter.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/Utilities.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java (83%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlDocument.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java (100%) create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xml/IXMLWriter.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xml/SchematronWriter.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xml/XMLNamespace.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java (100%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterState.java (95%) rename {hapi-fhir-structures-dstu3 => hapi-fhir-base}/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterStateStack.java (100%) create mode 100644 hapi-fhir-structures-dstu2.1/.classpath create mode 100644 hapi-fhir-structures-dstu2.1/.gitignore create mode 100644 hapi-fhir-structures-dstu2.1/.project create mode 100644 hapi-fhir-structures-dstu2.1/.settings/org.eclipse.core.resources.prefs create mode 100644 hapi-fhir-structures-dstu2.1/.settings/org.eclipse.jdt.core.prefs create mode 100644 hapi-fhir-structures-dstu2.1/.settings/org.eclipse.m2e.core.prefs create mode 100644 hapi-fhir-structures-dstu2.1/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 hapi-fhir-structures-dstu2.1/pom.xml create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/ctx/FhirDstu2_1.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/Dstu2_1BundleFactory.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/ServerConformanceProvider.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/ServerProfileProvider.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Account.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ActionDefinition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Address.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Age.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AllergyIntolerance.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Annotation.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Appointment.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AppointmentResponse.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Attachment.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AuditEvent.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BackboneElement.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Base.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Base64BinaryType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseBinary.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseDateTimeType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseExtension.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseNarrative.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseReference.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseResource.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Basic.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Binary.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BodySite.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BooleanType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Bundle.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CarePlan.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CareTeam.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Claim.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ClaimResponse.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ClinicalImpression.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeSystem.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeableConcept.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Coding.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Communication.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CommunicationRequest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Comparison.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CompartmentDefinition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Composition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ConceptMap.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Condition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Configuration.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Conformance.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Constants.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ContactPoint.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Contract.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Count.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Coverage.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DataElement.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DataRequirement.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DateTimeType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DateType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecimalType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecisionSupportRule.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecisionSupportServiceModule.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DetectedIssue.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Device.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceComponent.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceMetric.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceUseRequest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceUseStatement.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DiagnosticOrder.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DiagnosticReport.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Distance.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DocumentManifest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DocumentReference.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DomainResource.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Duration.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Element.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ElementDefinition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EligibilityRequest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EligibilityResponse.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Encounter.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnrollmentRequest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnrollmentResponse.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnumFactory.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Enumeration.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Enumerations.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EpisodeOfCare.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExpansionProfile.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExplanationOfBenefit.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExpressionNode.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Extension.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExtensionHelper.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Factory.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/FamilyMemberHistory.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Flag.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Goal.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Group.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/GuidanceResponse.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/HealthcareService.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/HumanName.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/IdType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Identifier.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingExcerpt.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingObjectSelection.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingStudy.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Immunization.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImmunizationRecommendation.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImplementationGuide.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/InstantType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/IntegerType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Library.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Linkage.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ListResource.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Location.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MarkdownType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Measure.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MeasureReport.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Media.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Medication.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationAdministration.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationDispense.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationOrder.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationStatement.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MessageHeader.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Meta.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ModuleDefinition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ModuleMetadata.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Money.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/NamingSystem.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Narrative.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/NutritionOrder.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Observation.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OidType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OperationDefinition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OperationOutcome.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Order.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OrderResponse.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OrderSet.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Organization.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ParameterDefinition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Parameters.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Patient.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PaymentNotice.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PaymentReconciliation.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Period.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Person.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PositiveIntType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Practitioner.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PractitionerRole.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PrimitiveType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Procedure.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcedureRequest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcessRequest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcessResponse.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Property.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Protocol.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Provenance.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Quantity.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Questionnaire.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/QuestionnaireResponse.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Range.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Ratio.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Reference.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ReferralRequest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/RelatedPerson.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Resource.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ResourceFactory.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ResourceType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/RiskAssessment.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SampledData.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Schedule.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SearchParameter.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Sequence.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SidType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Signature.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SimpleQuantity.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Slot.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Specimen.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StringType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StructureDefinition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StructureMap.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Subscription.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Substance.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SupplyDelivery.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SupplyRequest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Task.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TemporalPrecisionEnum.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TestScript.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TimeType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Timing.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TriggerDefinition.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Type.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UnsignedIntType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UriType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UuidType.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ValueSet.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/VisionPrescription.java create mode 100644 hapi-fhir-structures-dstu2.1/src/main/resources/.keep create mode 100644 hapi-fhir-structures-dstu2.1/src/main/resources/org/hl7/fhir/dstu2016may/model/fhirversion.properties create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/IdTypeDstu21Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/ModelDstu21Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu21Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomDiagnosticReport.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomObservation.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomResource364Dstu21.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu21Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/EmptyElementWithExtensionDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/ErrorHandlerTest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/FooMessageHeader.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/FooMessageHeaderWithExplicitField.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/JsonParserDstu21Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/MyPatientWithOneDeclaredEnumerationExtensionDstu3.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/PatientWithCustomCompositeExtension.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/PatientWithExtendedContactDstu3.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/ReportObservationDstu3.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/RoundTripDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/XmlParserDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/MyPatientWithExtensions.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/NonGenericClientDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/OperationClientDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/PatchClientDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/RestfulClientFactoryTest.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/SearchClientDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CreateBinaryDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CreateDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CustomTypeServerDstu3.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/DateRangeParamSearchDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/FormatParameterDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/InterceptorDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/MetadataConformanceDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/OperationServerDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/OperationServerWithSearchParamTypesDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/PatchDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ReadDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchCountParamDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchHasParamDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchPostDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchSortDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithGenericListDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithIncludesDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithServerAddressStrategyDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerExceptionDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerMimetypeDstu21Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerUsingOldTypesDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/UnclassifiedServerExceptionDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/UpdateDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ValidateDstu3Test.java create mode 100644 hapi-fhir-structures-dstu2.1/src/test/resources/.keep create mode 100644 hapi-fhir-structures-dstu2.1/src/test/resources/logback-test.xml create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MessageDefinition.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResearchStudy.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResearchSubject.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionConditionKind.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionConditionKindEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyClinicalStatus.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyClinicalStatusEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyVerificationStatus.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyVerificationStatusEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositeMeasureScoring.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositeMeasureScoringEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageSelfpay.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageSelfpayEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/EventTiming.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/EventTimingEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmStatus.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmStatusEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroup.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroupEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameAssemblyOrder.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameAssemblyOrderEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatistics.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatisticsEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QualityType.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QualityTypeEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RepositoryType.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RepositoryTypeEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestIntent.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestIntentEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchStudyStatus.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchStudyStatusEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchSubjectStatus.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchSubjectStatusEnumFactory.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchComparator.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchComparatorEnumFactory.java rename hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/{FluentPathEngine.java => FHIRPathEngine.java} (97%) create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/NarrativeGenerator.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/JsonTrackingParser.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/XmlLocationAnnotator.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/XmlLocationData.java create mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/validation/ValidationEngine.java delete mode 100644 hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java create mode 100644 hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticreport-genetics.sch create mode 100644 hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticrequest-genetics.sch create mode 100644 hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/messagedefinition.sch create mode 100644 hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/observation-genetics.sch create mode 100644 hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/researchstudy.sch create mode 100644 hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/researchsubject.sch create mode 100644 hapi-tinder-plugin/src/main/resources/res/dstu3/messagedefinition-spreadsheet.xml create mode 100644 hapi-tinder-plugin/src/main/resources/res/dstu3/researchstudy-spreadsheet.xml create mode 100644 hapi-tinder-plugin/src/main/resources/res/dstu3/researchsubject-spreadsheet.xml diff --git a/examples/src/main/java/example/ExtensionsDstu3.java b/examples/src/main/java/example/ExtensionsDstu3.java index 0898df47ae7..6fefbe5339e 100644 --- a/examples/src/main/java/example/ExtensionsDstu3.java +++ b/examples/src/main/java/example/ExtensionsDstu3.java @@ -25,7 +25,7 @@ IGenericClient client = FhirContext.forDstu3().newRestfulGenericClient("http://f //START SNIPPET: customTypeClientSimple // Create an example patient MyPatient custPatient = new MyPatient(); -custPatient.addName().addFamily("Smith").addGiven("John"); +custPatient.addName().setFamily("Smith").addGiven("John"); custPatient.setPetName(new StringType("Rover")); // populate the extension // Create the resource like normal @@ -115,7 +115,7 @@ patient.addExtension(ext); // Continuing the example from above, we will add a name to the patient, and then // add an extension to part of that name HumanName name = patient.addName(); -name.addFamily("Shmoe"); +name.setFamily("Shmoe"); // Add a new "given name", which is of type String StringType given = name.addGivenElement(); diff --git a/examples/src/main/java/example/FhirContextIntro.java b/examples/src/main/java/example/FhirContextIntro.java index dc4fe8a9e11..90fca3c98ef 100644 --- a/examples/src/main/java/example/FhirContextIntro.java +++ b/examples/src/main/java/example/FhirContextIntro.java @@ -31,7 +31,7 @@ FhirContext ctx = FhirContext.forDstu3(); // Working with RI structures is similar to how it works with the HAPI structures org.hl7.fhir.dstu3.model.Patient patient = new org.hl7.fhir.dstu3.model.Patient(); -patient.addName().addGiven("John").addFamily("Smith"); +patient.addName().addGiven("John").setFamily("Smith"); patient.getBirthDateElement().setValueAsString("1998-02-22"); // Parsing and encoding works the same way too diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java index e7baadbca6a..831bb841d51 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java @@ -885,4 +885,11 @@ public class FhirContext { return retVal; } + /** + * Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU2 DSTU2} (2016 May DSTU3 Snapshot) + */ + public static FhirContext forDstu2_1() { + return new FhirContext(FhirVersionEnum.DSTU2_1); + } + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirVersionEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirVersionEnum.java index d9874647898..74d7fd54e1f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirVersionEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirVersionEnum.java @@ -40,7 +40,7 @@ public enum FhirVersionEnum { DSTU2_HL7ORG("org.hl7.fhir.instance.FhirDstu2Hl7Org", DSTU2, true), - DSTU2_1("NONE", null, true), + DSTU2_1("org.hl7.fhir.dstu2016may.hapi.ctx.FhirDstu2_1", null, true), DSTU3("org.hl7.fhir.dstu3.hapi.ctx.FhirDstu3", null, true); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/DefinitionException.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/DefinitionException.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/DefinitionException.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/DefinitionException.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/FHIRException.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/FHIRException.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/FHIRException.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/FHIRException.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/FHIRFormatError.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/FHIRFormatError.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/FHIRFormatError.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/FHIRFormatError.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/NoTerminologyServiceException.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/NoTerminologyServiceException.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/NoTerminologyServiceException.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/NoTerminologyServiceException.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/PathEngineException.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/PathEngineException.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/PathEngineException.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/PathEngineException.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/TerminologyServiceException.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/TerminologyServiceException.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/TerminologyServiceException.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/TerminologyServiceException.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/UcumException.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/UcumException.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/exceptions/UcumException.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/exceptions/UcumException.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/CSFile.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/CSFile.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/CSFile.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/CSFile.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/FileNotifier.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/FileNotifier.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/FileNotifier.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/FileNotifier.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/Table.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Table.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/Table.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Table.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/TextFile.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/TextFile.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/TextFile.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/TextFile.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/TextStreamWriter.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/TextStreamWriter.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/TextStreamWriter.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/TextStreamWriter.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/Utilities.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Utilities.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/Utilities.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Utilities.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java similarity index 83% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java index b8c8c99a7b8..2bd4de592e8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java @@ -159,6 +159,28 @@ public class HierarchicalTableGenerator { pieces.add(piece); return this; } + private List htmlToParagraphPieces(String html) { + List myPieces = new ArrayList(); + String[] paragraphs = html.replace("

", "").split("<\\/p>|
"); + for (int i=0;i htmlFormattingToPieces(String html) { + List myPieces = new ArrayList(); + //Todo: At least handle bold and italics and turn them into formatted spans. (Will need to handle nesting though) + myPieces.add(new Piece(null, html, null)); + + return myPieces; + } public void addStyle(String style) { for (Piece p : pieces) p.addStyle(style); @@ -284,6 +306,10 @@ public class HierarchicalTableGenerator { private boolean inLineGraphics; + public HierarchicalTableGenerator() { + super(); + } + public HierarchicalTableGenerator(String dest, boolean inlineGraphics) { super(); this.dest = dest; @@ -306,15 +332,25 @@ public class HierarchicalTableGenerator { return model; } - public XhtmlNode generate(TableModel model, String imagePath) throws IOException, FHIRException { + public TableModel initGridTable(String prefix) { + TableModel model = new TableModel(); + + model.getTitles().add(new Title(null, model.getDocoRef(), "Name", "The name of the element (Slice name in brackets). Mouse-over provides definition", null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), "Card.", "Minimum and Maximum # of times the the element can appear in the instance. Super-scripts indicate additional constraints on appearance", null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), "Type", "Reference to the type of the element", null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), "Constraints and Usage", "Fixed values, length limits, vocabulary bindings and other usage notes", null, 0)); + return model; + } + + public XhtmlNode generate(TableModel model, String imagePath, int border) throws IOException, FHIRException { checkModel(model); - XhtmlNode table = new XhtmlNode(NodeType.Element, "table").setAttribute("border", "0").setAttribute("cellspacing", "0").setAttribute("cellpadding", "0"); - table.setAttribute("style", "border: 0px; font-size: 11px; font-family: verdana; vertical-align: top;"); + XhtmlNode table = new XhtmlNode(NodeType.Element, "table").setAttribute("border", Integer.toString(border)).setAttribute("cellspacing", "0").setAttribute("cellpadding", "0"); + table.setAttribute("style", "border: " + border + "px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;"); XhtmlNode tr = table.addTag("tr"); - tr.setAttribute("style", "border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;"); + tr.setAttribute("style", "border: " + Integer.toString(1 + border) + "px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;"); XhtmlNode tc = null; for (Title t : model.getTitles()) { - tc = renderCell(tr, t, "th", null, null, null, false, null, "white", imagePath); + tc = renderCell(tr, t, "th", null, null, null, false, null, "white", imagePath, border); if (t.width != 0) tc.setAttribute("style", "width: "+Integer.toString(t.width)+"px"); } @@ -322,7 +358,7 @@ public class HierarchicalTableGenerator { tc.addTag("span").setAttribute("style", "float: right").addTag("a").setAttribute("title", "Legend for this format").setAttribute("href", model.getDocoRef()).addTag("img").setAttribute("alt", "doco").setAttribute("style", "background-color: inherit").setAttribute("src", model.getDocoImg()); for (Row r : model.getRows()) { - renderRow(table, r, 0, new ArrayList(), imagePath); + renderRow(table, r, 0, new ArrayList(), imagePath, border); } if (model.getDocoRef() != null) { tr = table.addTag("tr"); @@ -339,15 +375,15 @@ public class HierarchicalTableGenerator { } - private void renderRow(XhtmlNode table, Row r, int indent, List indents, String imagePath) throws IOException { + private void renderRow(XhtmlNode table, Row r, int indent, List indents, String imagePath, int border) throws IOException { XhtmlNode tr = table.addTag("tr"); String color = "white"; if (r.getColor() != null) color = r.getColor(); - tr.setAttribute("style", "border: 0px; padding:0px; vertical-align: top; background-color: "+color+";"); + tr.setAttribute("style", "border: " + border + "px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: "+color+";"); boolean first = true; for (Cell t : r.getCells()) { - renderCell(tr, t, "td", first ? r.getIcon() : null, first ? r.getHint() : null, first ? indents : null, !r.getSubRows().isEmpty(), first ? r.getAnchor() : null, color, imagePath); + renderCell(tr, t, "td", first ? r.getIcon() : null, first ? r.getHint() : null, first ? indents : null, !r.getSubRows().isEmpty(), first ? r.getAnchor() : null, color, imagePath, border); first = false; } table.addText("\r\n"); @@ -360,17 +396,17 @@ public class HierarchicalTableGenerator { ind.add(true); else ind.add(false); - renderRow(table, c, indent+1, ind, imagePath); + renderRow(table, c, indent+1, ind, imagePath, border); } } - private XhtmlNode renderCell(XhtmlNode tr, Cell c, String name, String icon, String hint, List indents, boolean hasChildren, String anchor, String color, String imagePath) throws IOException { + private XhtmlNode renderCell(XhtmlNode tr, Cell c, String name, String icon, String hint, List indents, boolean hasChildren, String anchor, String color, String imagePath, int border) throws IOException { XhtmlNode tc = tr.addTag(name); tc.setAttribute("class", "hierarchy"); if (indents != null) { tc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_spacer.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", "."); - tc.setAttribute("style", "vertical-align: top; text-align : left; background-color: "+color+"; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url("+imagePath+checkExists(indents, hasChildren)+")"); + tc.setAttribute("style", "vertical-align: top; text-align : left; background-color: "+color+"; border: "+ border +"px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url("+imagePath+checkExists(indents, hasChildren)+")"); for (int i = 0; i < indents.size()-1; i++) { if (indents.get(i)) tc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_blank.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", "."); @@ -384,7 +420,7 @@ public class HierarchicalTableGenerator { tc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_vjoin.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", "."); } else - tc.setAttribute("style", "vertical-align: top; text-align : left; background-color: "+color+"; padding:0px 4px 0px 4px"); + tc.setAttribute("style", "vertical-align: top; text-align : left; background-color: "+color+"; border: "+ border +"px #F0F0F0 solid; padding:0px 4px 0px 4px"); if (!Utilities.noString(icon)) { XhtmlNode img = tc.addTag("img").setAttribute("src", srcFor(imagePath, icon)).setAttribute("class", "hierarchy").setAttribute("style", "background-color: "+color+"; background-color: inherit").setAttribute("alt", "."); if (hint != null) @@ -406,6 +442,7 @@ public class HierarchicalTableGenerator { if (!Utilities.noString(p.getHint())) a.setAttribute("title", p.getHint()); a.addText(p.getText()); + addStyle(a, p); } else { if (!Utilities.noString(p.getHint())) { XhtmlNode s = addStyle(tc.addTag("span"), p); @@ -442,7 +479,7 @@ public class HierarchicalTableGenerator { b.append("data: image/png;base64,"); byte[] bytes; File file = new File(Utilities.path(dest, filename)); - if (!file.exists()) // because sometime this is called real early before the files exist. it will be uilt again later because of this + if (!file.exists()) // because sometime this is called real early before the files exist. it will be built again later because of this bytes = new byte[0]; else bytes = FileUtils.readFileToByteArray(file); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlDocument.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlDocument.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlDocument.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlDocument.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java new file mode 100644 index 00000000000..f540417721b --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java @@ -0,0 +1,1092 @@ +/* + * 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. + * + */ +package org.hl7.fhir.utilities.xhtml; + +import java.io.*; +import java.util.*; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.Attribute; +import javax.xml.stream.events.Characters; +import javax.xml.stream.events.Comment; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.exceptions.FHIRFormatError; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +public class XhtmlParser { + public static final String XHTML_NS = "http://www.w3.org/1999/xhtml"; + + private Set attributes = new HashSet(); + + private String cache = ""; + + private int col = 0; + private Set elements = new HashSet(); + + private char lastChar; + + private String lastText = ""; + + private int line = 1; + + private boolean mustBeWellFormed = true; + private ParserSecurityPolicy policy; + private Reader rdr; + + private boolean trimWhitespace; + + private XhtmlNode unwindPoint; + + private boolean validatorMode; + + public XhtmlParser() { + super(); + policy = ParserSecurityPolicy.Accept; // for general parsing + + // set up sets + elements.add("p"); + elements.add("br"); + elements.add("div"); + elements.add("h1"); + elements.add("h2"); + elements.add("h3"); + elements.add("h4"); + elements.add("h5"); + elements.add("h6"); + elements.add("a"); + elements.add("span"); + elements.add("b"); + elements.add("em"); + elements.add("i"); + elements.add("strong"); + elements.add("small"); + elements.add("big"); + elements.add("tt"); + elements.add("small"); + elements.add("dfn"); + elements.add("q"); + elements.add("var"); + elements.add("abbr"); + elements.add("acronym"); + elements.add("cite"); + elements.add("blockquote"); + elements.add("hr"); + elements.add("address"); + elements.add("bdo"); + elements.add("kbd"); + elements.add("q"); + elements.add("sub"); + elements.add("sup"); + elements.add("ul"); + elements.add("ol"); + elements.add("li"); + elements.add("dl"); + elements.add("dt"); + elements.add("dd"); + elements.add("pre"); + elements.add("table"); + elements.add("caption"); + elements.add("colgroup"); + elements.add("col"); + elements.add("thead"); + elements.add("tr"); + elements.add("tfoot"); + elements.add("tbody"); + elements.add("th"); + elements.add("td"); + elements.add("code"); + elements.add("samp"); + elements.add("img"); + elements.add("map"); + elements.add("area"); + + attributes.add("title"); + attributes.add("style"); + attributes.add("class"); + attributes.add("id"); + attributes.add("lang"); + attributes.add("xml:lang"); + attributes.add("dir"); + attributes.add("accesskey"); + attributes.add("tabindex"); + // tables: + attributes.add("span"); + attributes.add("width"); + attributes.add("align"); + attributes.add("valign"); + attributes.add("char"); + attributes.add("charoff"); + attributes.add("abbr"); + attributes.add("axis"); + attributes.add("headers"); + attributes.add("scope"); + attributes.add("rowspan"); + attributes.add("colspan"); + + attributes.add("a.href"); + attributes.add("a.name"); + attributes.add("img.src"); + attributes.add("img.border"); + attributes.add("div.xmlns"); + attributes.add("blockquote.cite"); + attributes.add("q.cite"); + attributes.add("a.charset"); + attributes.add("a.type"); + attributes.add("a.name"); + attributes.add("a.href"); + attributes.add("a.hreflang"); + attributes.add("a.rel"); + attributes.add("a.rev"); + attributes.add("a.shape"); + attributes.add("a.coords"); + attributes.add("img.src"); + attributes.add("img.alt"); + attributes.add("img.longdesc"); + attributes.add("img.height"); + attributes.add("img.width"); + attributes.add("img.usemap"); + attributes.add("img.ismap"); + attributes.add("map.name"); + attributes.add("area.shape"); + attributes.add("area.coords"); + attributes.add("area.href"); + attributes.add("area.nohref"); + attributes.add("area.alt"); + attributes.add("table.summary"); + attributes.add("table.width"); + attributes.add("table.border"); + attributes.add("table.frame"); + attributes.add("table.rules"); + attributes.add("table.cellspacing"); + attributes.add("table.cellpadding"); + } + + private void addTextNode(XhtmlNode node, StringBuilder s) { + String t = isTrimWhitespace() ? s.toString().trim() : s.toString(); + if (t.length() > 0) { + lastText = t; + // System.out.println(t); + node.addText(t); + s.setLength(0); + } + } + + private boolean attributeIsOk(String elem, String attr, String value) throws FHIRFormatError { + if (validatorMode) + return true; + boolean ok = attributes.contains(attr) || attributes.contains(elem + "." + attr); + if (ok) + return true; + else + switch (policy) { + case Accept: + return true; + case Drop: + return false; + case Reject: + throw new FHIRFormatError("Illegal HTML attribute " + elem + "." + attr); + } + + if ((elem + "." + attr).equals("img.src") && !(value.startsWith("#") || value.startsWith("http:") || value.startsWith("https:"))) { + switch (policy) { + case Accept: + return true; + case Drop: + return false; + case Reject: + throw new FHIRFormatError("Illegal Image Reference " + value); + } + } + return false; + } + + private NSMap checkNamespaces(QName n, XhtmlNode node, NSMap nsm, boolean root) { + // what we do here is strip out any stated namespace attributes, putting them in the namesapce map + // then we figure out what the namespace of this element is, and state it explicitly if it's not the default + + // but we don't bother with any of this if we're not validating + if (!validatorMode) + return null; + NSMap result = new NSMap(nsm); + List nsattrs = new ArrayList(); + for (String an : node.getAttributes().keySet()) { + if (an.equals("xmlns")) { + result.def(node.getAttribute(an)); + nsattrs.add(an); + } + if (an.startsWith("xmlns:")) { + result.ns(an.substring(6), node.getAttribute(an)); + nsattrs.add(an); + } + } + for (String s : nsattrs) + node.getAttributes().remove(s); + if (n.hasNs()) { + String nns = result.get(n.getNs()); + if (!nns.equals(result.def())) { + node.getAttributes().put("xmlns", nns); + result.def(nns); + } + } else if (root && result.hasDef()) { + node.getAttributes().put("xmlns", result.def()); + } + return result; + } + + private String checkNS(XhtmlNode res, Element node, String defaultNS) { + if (!validatorMode) + return null; + String ns = node.getNamespaceURI(); + if (ns == null) + return null; + if (!ns.equals(defaultNS)) { + res.getAttributes().put("xmlns", ns); + return ns; + } + return defaultNS; + } + + private String descLoc() { + return " at line " + Integer.toString(line) + " column " + Integer.toString(col); + } + + private boolean elementIsOk(String name) throws FHIRFormatError { + if (validatorMode) + return true; + boolean ok = elements.contains(name); + if (ok) + return true; + else + switch (policy) { + case Accept: + return true; + case Drop: + return false; + case Reject: + throw new FHIRFormatError("Illegal HTML element " + name); + } + return false; + } + + public ParserSecurityPolicy getPolicy() { + return policy; + } + + private boolean isInteger(String s, int base) { + try { + Integer.parseInt(s, base); + return true; + } catch (Exception e) { + return false; + } + } + + public boolean isMustBeWellFormed() { + return mustBeWellFormed; + } + + private boolean isNameChar(char ch) { + return Character.isLetterOrDigit(ch) || ch == '_' || ch == '-' || ch == ':'; + } + + public boolean isTrimWhitespace() { + return trimWhitespace; + } + + public boolean isValidatorMode() { + return validatorMode; + } + + public XhtmlDocument parse(InputStream input, String entryName) throws FHIRFormatError, IOException { + rdr = new InputStreamReader(input, "UTF-8"); + return parse(entryName); + } + + private XhtmlDocument parse(String entryName) throws FHIRFormatError, IOException { + XhtmlDocument result = new XhtmlDocument(); + skipWhiteSpaceAndComments(result); + if (peekChar() != '<') + throw new FHIRFormatError("Unable to Parse HTML - does not start with tag. Found " + peekChar() + descLoc()); + readChar(); + QName n = new QName(readName().toLowerCase()); + if ((entryName != null) && !n.getName().equals(entryName)) + throw new FHIRFormatError("Unable to Parse HTML - starts with '" + n + "' not '" + entryName + "'" + descLoc()); + XhtmlNode root = result.addTag(n.getName()); + parseAttributes(root); + NSMap nsm = checkNamespaces(n, root, null, true); + if (readChar() == '/') { + if (peekChar() != '>') + throw new FHIRFormatError("unexpected non-end of element " + n + " " + descLoc()); + readChar(); + } else { + unwindPoint = null; + List p = new ArrayList(); + parseElementInner(root, p, nsm); + } + return result; + } + public XhtmlDocument parse(String source, String entryName) throws FHIRFormatError, IOException { + rdr = new StringReader(source); + return parse(entryName); + } + private void parseAttributes(XhtmlNode node) throws FHIRFormatError, IOException { + while (Character.isWhitespace(peekChar())) + readChar(); + while (peekChar() != '>' && peekChar() != '/' && peekChar() != '\0') { + String name = readName(); + if (name.length() == 0) { + throw new FHIRFormatError("Unable to read attribute on <" + node.getName() + ">" + descLoc()); + } + while (Character.isWhitespace(peekChar())) + readChar(); + + if (isNameChar(peekChar()) || peekChar() == '>' || peekChar() == '/') + node.getAttributes().put(name, null); + else if (peekChar() != '=') { + throw new FHIRFormatError("Unable to read attribute '" + name + "' value on <" + node.getName() + ">" + descLoc()); + } else { + readChar(); + while (Character.isWhitespace(peekChar())) + readChar(); + if (peekChar() == '"' || peekChar() == '\'') + node.getAttributes().put(name, parseAttributeValue(readChar())); + else + node.getAttributes().put(name, parseAttributeValue('\0')); + } + while (Character.isWhitespace(peekChar())) + readChar(); + } + } + private String parseAttributeValue(char term) throws IOException, FHIRFormatError { + StringBuilder b = new StringBuilder(); + while (peekChar() != '\0' && peekChar() != '>' && (term != '\0' || peekChar() != '/') && peekChar() != term) { + if (peekChar() == '&') { + parseLiteral(b); + } else + b.append(readChar()); + } + if (peekChar() == term) + readChar(); + return b.toString(); + } + private void parseElement(XhtmlNode parent, List parents, NSMap nsm) throws IOException, FHIRFormatError { + QName name = new QName(readName()); + XhtmlNode node = parent.addTag(name.getName()); + List newParents = new ArrayList(); + newParents.addAll(parents); + newParents.add(parent); + parseAttributes(node); + nsm = checkNamespaces(name, node, nsm, false); + if (readChar() == '/') { + if (peekChar() != '>') + throw new FHIRFormatError("unexpected non-end of element " + name + " " + descLoc()); + readChar(); + } else { + parseElementInner(node, newParents, nsm); + } + } + private void parseElementInner(XhtmlNode node, List parents, NSMap nsm) throws FHIRFormatError, IOException { + StringBuilder s = new StringBuilder(); + while (peekChar() != '\0' && !parents.contains(unwindPoint) && !(node == unwindPoint)) { + if (peekChar() == '<') { + addTextNode(node, s); + readChar(); + if (peekChar() == '!') { + String sc = readToCommentEnd(); + if (sc.startsWith("DOCTYPE")) + throw new FHIRFormatError("Malformed XHTML: Found a DocType declaration, and these are not allowed (XXE security vulnerability protection)"); + node.addComment(sc); + } else if (peekChar() == '?') + node.addComment(readToTagEnd()); + else if (peekChar() == '/') { + readChar(); + QName n = new QName(readToTagEnd()); + if (node.getName().equals(n.getName())) + return; + else { + if (mustBeWellFormed) + throw new FHIRFormatError("Malformed XHTML: Found \"\" expecting \"\"" + descLoc()); + for (int i = parents.size() - 1; i >= 0; i--) { + if (parents.get(i).getName().equals(n)) + unwindPoint = parents.get(i); + } + if (unwindPoint != null) { + for (int i = parents.size(); i > 0; i--) { + if (i < parents.size() && parents.get(i) == unwindPoint) + return; + if (i == parents.size()) { + parents.get(i - 1).getChildNodes().addAll(node.getChildNodes()); + node.getChildNodes().clear(); + } else { + parents.get(i - 1).getChildNodes().addAll(parents.get(i).getChildNodes()); + parents.get(i).getChildNodes().clear(); + } + } + } + } + } else if (Character.isLetterOrDigit(peekChar())) { + parseElement(node, parents, nsm); + } else + throw new FHIRFormatError("Unable to Parse HTML - node '" + node.getName() + "' has unexpected content '" + peekChar() + "' (last text = '" + lastText + "'" + descLoc()); + } else if (peekChar() == '&') { + parseLiteral(s); + } else + s.append(readChar()); + } + addTextNode(node, s); + } + private XhtmlNode parseFragment() throws IOException, FHIRException { + skipWhiteSpace(); + if (peekChar() != '<') + throw new FHIRException("Unable to Parse HTML - does not start with tag. Found " + peekChar() + descLoc()); + readChar(); + if (peekChar() == '?') { + readToTagEnd(); + skipWhiteSpace(); + if (peekChar() != '<') + throw new FHIRException("Unable to Parse HTML - does not start with tag after processing instruction. Found " + peekChar() + descLoc()); + readChar(); + } + String n = readName().toLowerCase(); + readToTagEnd(); + XhtmlNode result = new XhtmlNode(NodeType.Element); + + int colonIndex = n.indexOf(':'); + if (colonIndex != -1) { + n = n.substring(colonIndex + 1); + } + + result.setName(n); + unwindPoint = null; + List p = new ArrayList(); + parseElementInner(result, p, null); + + return result; + } + + public XhtmlNode parseFragment(InputStream input) throws IOException, FHIRException { + rdr = new InputStreamReader(input); + return parseFragment(); + } + + public XhtmlNode parseFragment(String source) throws IOException, FHIRException { + rdr = new StringReader(source); + return parseFragment(); + } + + public XhtmlNode parseHtmlNode(Element node) throws FHIRFormatError { + return parseHtmlNode(node, null); + } + + public XhtmlNode parseHtmlNode(Element node, String defaultNS) throws FHIRFormatError { + XhtmlNode res = parseNode(node, defaultNS); + if (res.getNsDecl() == null) + res.getAttributes().put("xmlns", XHTML_NS); + return res; + } + + public XhtmlNode parseHtmlNode(XMLEventReader xpp) throws IOException, FHIRFormatError, XMLStreamException { + XhtmlNode res = parseNode(xpp); + if (res.getNsDecl() == null) + res.getAttributes().put("xmlns", XHTML_NS); + return res; + + } + + private void parseLiteral(StringBuilder s) throws IOException, FHIRFormatError { + // UInt16 w; + readChar(); + String c = readUntil(';'); + if (c.equals("apos")) + s.append('\''); + else if (c.equals("quot")) + s.append('"'); + else if (c.equals("nbsp")) + s.append(XhtmlNode.NBSP); + else if (c.equals("amp")) + s.append('&'); + else if (c.equals("gt")) + s.append('>'); + else if (c.equals("lt")) + s.append('<'); + else if (c.equals("copy")) + s.append((char) 169); + else if (c.equals("reg")) + s.append((char) 174); + else if (c.equals("sect")) + s.append((char) 0xA7); + else if (c.charAt(0) == '#') { + if (isInteger(c.substring(1), 10)) + s.append((char) Integer.parseInt(c.substring(1))); + else if (isInteger(c.substring(1), 16)) + s.append((char) Integer.parseInt(c.substring(1), 16)); + } else if (c.equals("fnof")) + s.append((char) 402); // latin small f with hook = function = florin, U+0192 ISOtech --> + else if (c.equals("Alpha")) + s.append((char) 913); // greek capital letter alpha, U+0391 + else if (c.equals("Beta")) + s.append((char) 914); // greek capital letter beta, U+0392 + else if (c.equals("Gamma")) + s.append((char) 915); // greek capital letter gamma, U+0393 ISOgrk3 + else if (c.equals("Delta")) + s.append((char) 916); // greek capital letter delta, U+0394 ISOgrk3 + else if (c.equals("Epsilon")) + s.append((char) 917); // greek capital letter epsilon, U+0395 + else if (c.equals("Zeta")) + s.append((char) 918); // greek capital letter zeta, U+0396 + else if (c.equals("Eta")) + s.append((char) 919); // greek capital letter eta, U+0397 + else if (c.equals("Theta")) + s.append((char) 920); // greek capital letter theta, U+0398 ISOgrk3 + else if (c.equals("Iota")) + s.append((char) 921); // greek capital letter iota, U+0399 + else if (c.equals("Kappa")) + s.append((char) 922); // greek capital letter kappa, U+039A + else if (c.equals("Lambda")) + s.append((char) 923); // greek capital letter lambda, U+039B ISOgrk3 + else if (c.equals("Mu")) + s.append((char) 924); // greek capital letter mu, U+039C + else if (c.equals("Nu")) + s.append((char) 925); // greek capital letter nu, U+039D + else if (c.equals("Xi")) + s.append((char) 926); // greek capital letter xi, U+039E ISOgrk3 + else if (c.equals("Omicron")) + s.append((char) 927); // greek capital letter omicron, U+039F + else if (c.equals("Pi")) + s.append((char) 928); // greek capital letter pi, U+03A0 ISOgrk3 + else if (c.equals("Rho")) + s.append((char) 929); // greek capital letter rho, U+03A1 + else if (c.equals("Sigma")) + s.append((char) 931); // greek capital letter sigma, U+03A3 ISOgrk3 + else if (c.equals("Tau")) + s.append((char) 932); // greek capital letter tau, U+03A4 + else if (c.equals("Upsilon")) + s.append((char) 933); // greek capital letter upsilon, U+03A5 ISOgrk3 + else if (c.equals("Phi")) + s.append((char) 934); // greek capital letter phi, U+03A6 ISOgrk3 + else if (c.equals("Chi")) + s.append((char) 935); // greek capital letter chi, U+03A7 + else if (c.equals("Psi")) + s.append((char) 936); // greek capital letter psi, U+03A8 ISOgrk3 + else if (c.equals("Omega")) + s.append((char) 937); // greek capital letter omega, U+03A9 ISOgrk3 + else if (c.equals("alpha")) + s.append((char) 945); // greek small letter alpha, U+03B1 ISOgrk3 + else if (c.equals("beta")) + s.append((char) 946); // greek small letter beta, U+03B2 ISOgrk3 + else if (c.equals("gamma")) + s.append((char) 947); // greek small letter gamma, U+03B3 ISOgrk3 + else if (c.equals("delta")) + s.append((char) 948); // greek small letter delta, U+03B4 ISOgrk3 + else if (c.equals("epsilon")) + s.append((char) 949); // greek small letter epsilon, U+03B5 ISOgrk3 + else if (c.equals("zeta")) + s.append((char) 950); // greek small letter zeta, U+03B6 ISOgrk3 + else if (c.equals("eta")) + s.append((char) 951); // greek small letter eta, U+03B7 ISOgrk3 + else if (c.equals("theta")) + s.append((char) 952); // greek small letter theta, U+03B8 ISOgrk3 + else if (c.equals("iota")) + s.append((char) 953); // greek small letter iota, U+03B9 ISOgrk3 + else if (c.equals("kappa")) + s.append((char) 954); // greek small letter kappa, U+03BA ISOgrk3 + else if (c.equals("lambda")) + s.append((char) 955); // greek small letter lambda, U+03BB ISOgrk3 + else if (c.equals("mu")) + s.append((char) 956); // greek small letter mu, U+03BC ISOgrk3 + else if (c.equals("nu")) + s.append((char) 957); // greek small letter nu, U+03BD ISOgrk3 + else if (c.equals("xi")) + s.append((char) 958); // greek small letter xi, U+03BE ISOgrk3 + else if (c.equals("omicron")) + s.append((char) 959); // greek small letter omicron, U+03BF NEW + else if (c.equals("pi")) + s.append((char) 960); // greek small letter pi, U+03C0 ISOgrk3 + else if (c.equals("rho")) + s.append((char) 961); // greek small letter rho, U+03C1 ISOgrk3 + else if (c.equals("sigmaf")) + s.append((char) 962); // greek small letter final sigma, U+03C2 ISOgrk3 + else if (c.equals("sigma")) + s.append((char) 963); // greek small letter sigma, U+03C3 ISOgrk3 + else if (c.equals("tau")) + s.append((char) 964); // greek small letter tau, U+03C4 ISOgrk3 + else if (c.equals("upsilon")) + s.append((char) 965); // greek small letter upsilon, U+03C5 ISOgrk3 + else if (c.equals("phi")) + s.append((char) 966); // greek small letter phi, U+03C6 ISOgrk3 + else if (c.equals("chi")) + s.append((char) 967); // greek small letter chi, U+03C7 ISOgrk3 + else if (c.equals("psi")) + s.append((char) 968); // greek small letter psi, U+03C8 ISOgrk3 + else if (c.equals("omega")) + s.append((char) 969); // greek small letter omega, U+03C9 ISOgrk3 + else if (c.equals("thetasym")) + s.append((char) 977); // greek small letter theta symbol, U+03D1 NEW + else if (c.equals("upsih")) + s.append((char) 978); // greek upsilon with hook symbol, U+03D2 NEW + else if (c.equals("piv")) + s.append((char) 982); // greek pi symbol, U+03D6 ISOgrk3 + else if (c.equals("bull")) + s.append((char) 8226); // bullet = black small circle, U+2022 ISOpub + else if (c.equals("hellip")) + s.append((char) 8230); // horizontal ellipsis = three dot leader, U+2026 ISOpub + else if (c.equals("prime")) + s.append((char) 8242); // prime = minutes = feet, U+2032 ISOtech + else if (c.equals("Prime")) + s.append((char) 8243); // double prime = seconds = inches, U+2033 ISOtech + else if (c.equals("oline")) + s.append((char) 8254); // overline = spacing overscore, U+203E NEW + else if (c.equals("frasl")) + s.append((char) 8260); // fraction slash, U+2044 NEW + else if (c.equals("weierp")) + s.append((char) 8472); // script capital P = power set = Weierstrass p, U+2118 ISOamso + else if (c.equals("image")) + s.append((char) 8465); // blackletter capital I = imaginary part, U+2111 ISOamso + else if (c.equals("real")) + s.append((char) 8476); // blackletter capital R = real part symbol, U+211C ISOamso + else if (c.equals("trade")) + s.append((char) 8482); // trade mark sign, U+2122 ISOnum + else if (c.equals("alefsym")) + s.append((char) 8501); // alef symbol = first transfinite cardinal, U+2135 NEW + else if (c.equals("larr")) + s.append((char) 8592); // leftwards arrow, U+2190 ISOnum + else if (c.equals("uarr")) + s.append((char) 8593); // upwards arrow, U+2191 ISOnum + else if (c.equals("rarr")) + s.append((char) 8594); // rightwards arrow, U+2192 ISOnum + else if (c.equals("darr")) + s.append((char) 8595); // downwards arrow, U+2193 ISOnum + else if (c.equals("harr")) + s.append((char) 8596); // left right arrow, U+2194 ISOamsa + else if (c.equals("crarr")) + s.append((char) 8629); // downwards arrow with corner leftwards = carriage return, U+21B5 NEW + else if (c.equals("lArr")) + s.append((char) 8656); // leftwards double arrow, U+21D0 ISOtech + else if (c.equals("uArr")) + s.append((char) 8657); // upwards double arrow, U+21D1 ISOamsa + else if (c.equals("rArr")) + s.append((char) 8658); // rightwards double arrow, U+21D2 ISOtech + else if (c.equals("dArr")) + s.append((char) 8659); // downwards double arrow, U+21D3 ISOamsa + else if (c.equals("hArr")) + s.append((char) 8660); // left right double arrow, U+21D4 ISOamsa + else if (c.equals("forall")) + s.append((char) 8704); // for all, U+2200 ISOtech + else if (c.equals("part")) + s.append((char) 8706); // partial differential, U+2202 ISOtech + else if (c.equals("exist")) + s.append((char) 8707); // there exists, U+2203 ISOtech + else if (c.equals("empty")) + s.append((char) 8709); // empty set = null set = diameter, U+2205 ISOamso + else if (c.equals("nabla")) + s.append((char) 8711); // nabla = backward difference, U+2207 ISOtech + else if (c.equals("isin")) + s.append((char) 8712); // element of, U+2208 ISOtech + else if (c.equals("notin")) + s.append((char) 8713); // not an element of, U+2209 ISOtech + else if (c.equals("ni")) + s.append((char) 8715); // contains as member, U+220B ISOtech + else if (c.equals("prod")) + s.append((char) 8719); // n-ary product = product sign, U+220F ISOamsb + else if (c.equals("sum")) + s.append((char) 8721); // n-ary sumation, U+2211 ISOamsb + else if (c.equals("minus")) + s.append((char) 8722); // minus sign, U+2212 ISOtech + else if (c.equals("lowast")) + s.append((char) 8727); // asterisk operator, U+2217 ISOtech + else if (c.equals("radic")) + s.append((char) 8730); // square root = radical sign, U+221A ISOtech + else if (c.equals("prop")) + s.append((char) 8733); // proportional to, U+221D ISOtech + else if (c.equals("infin")) + s.append((char) 8734); // infinity, U+221E ISOtech --> + else if (c.equals("ang")) + s.append((char) 8736); // angle, U+2220 ISOamso + else if (c.equals("and")) + s.append((char) 8743); // logical and = wedge, U+2227 ISOtech + else if (c.equals("or")) + s.append((char) 8744); // logical or = vee, U+2228 ISOtech + else if (c.equals("cap")) + s.append((char) 8745); // intersection = cap, U+2229 ISOtech + else if (c.equals("cup")) + s.append((char) 8746); // union = cup, U+222A ISOtech + else if (c.equals("int")) + s.append((char) 8747); // integral, U+222B ISOtech + else if (c.equals("there4")) + s.append((char) 8756); // therefore, U+2234 ISOtech + else if (c.equals("sim")) + s.append((char) 8764); // tilde operator = varies with = similar t U+223C ISOtech + else if (c.equals("cong")) + s.append((char) 8773); // approximately equal to, U+2245 ISOtec + else if (c.equals("asymp")) + s.append((char) 8776); // almost equal to = asymptotic to, U+2248 ISOamsr + else if (c.equals("ne")) + s.append((char) 8800); // not equal to, U+2260 ISOtech + else if (c.equals("equiv")) + s.append((char) 8801); // identical to, U+2261 ISOtech + else if (c.equals("le")) + s.append((char) 8804); // less-than or equal to, U+2264 ISOtech + else if (c.equals("ge")) + s.append((char) 8805); // greater-than or equal to, U+2265 ISOtech + else if (c.equals("sub")) + s.append((char) 8834); // subset of, U+2282 ISOtech + else if (c.equals("sup")) + s.append((char) 8835); // superset of, U+2283 ISOtech + else if (c.equals("nsub")) + s.append((char) 8836); // not a subset of, U+2284 ISOamsn + else if (c.equals("sube")) + s.append((char) 8838); // subset of or equal to, U+2286 ISOtech + else if (c.equals("supe")) + s.append((char) 8839); // superset of or equal to, U+2287 ISOtech + else if (c.equals("oplus")) + s.append((char) 8853); // circled plus = direct sum, U+2295 ISOamsb + else if (c.equals("otimes")) + s.append((char) 8855); // circled times = vector product, U+2297 ISOamsb --> + else if (c.equals("perp")) + s.append((char) 8869); // up tack = orthogonal to = perpendicular, U+22A5 ISOtech + else if (c.equals("sdot")) + s.append((char) 8901); // dot operator, U+22C5 ISOamsb + else if (c.equals("lceil")) + s.append((char) 8968); // left ceiling = apl upstile, U+2308 ISOamsc + else if (c.equals("rceil")) + s.append((char) 8969); // right ceiling, U+2309 ISOamsc + else if (c.equals("lfloor")) + s.append((char) 8970); // left floor = apl downstile, U+230A ISOamsc + else if (c.equals("rfloor")) + s.append((char) 8971); // right floor, U+230B ISOamsc + else if (c.equals("lang")) + s.append((char) 9001); // left-pointing angle bracket = bra, U+2329 ISOtech + else if (c.equals("rang")) + s.append((char) 9002); // right-pointing angle bracket = ket, U+232A ISOtech + else if (c.equals("loz")) + s.append((char) 9674); // lozenge, U+25CA ISOpub + else if (c.equals("spades")) + s.append((char) 9824); // black spade suit, U+2660 ISOpub + else if (c.equals("clubs")) + s.append((char) 9827); // black club suit = shamrock, U+2663 ISOpub + else if (c.equals("hearts")) + s.append((char) 9829); // black heart suit = valentine, U+2665 ISOpub + else if (c.equals("diams")) + s.append((char) 9830); // black diamond suit, U+2666 ISOpub -- + else + throw new FHIRFormatError("unable to parse character reference '" + c + "'' (last text = '" + lastText + "'" + descLoc()); + } + + private XhtmlNode parseNode(Element node, String defaultNS) throws FHIRFormatError { + XhtmlNode res = new XhtmlNode(NodeType.Element); + res.setName(node.getLocalName()); + defaultNS = checkNS(res, node, defaultNS); + for (int i = 0; i < node.getAttributes().getLength(); i++) { + Attr attr = (Attr) node.getAttributes().item(i); + if (attributeIsOk(res.getName(), attr.getName(), attr.getValue()) && !attr.getLocalName().startsWith("xmlns")) + res.getAttributes().put(attr.getName(), attr.getValue()); + } + Node child = node.getFirstChild(); + while (child != null) { + if (child.getNodeType() == Node.TEXT_NODE) { + res.addText(child.getTextContent()); + } else if (child.getNodeType() == Node.COMMENT_NODE) { + res.addComment(child.getTextContent()); + } else if (child.getNodeType() == Node.ELEMENT_NODE) { + if (elementIsOk(child.getLocalName())) + res.getChildNodes().add(parseNode((Element) child, defaultNS)); + } else + throw new FHIRFormatError("Unhandled XHTML feature: " + Integer.toString(child.getNodeType()) + descLoc()); + child = child.getNextSibling(); + } + return res; + } + + private XhtmlNode parseNode(XMLEventReader xpp) throws IOException, FHIRFormatError, XMLStreamException { + XhtmlNode res = new XhtmlNode(NodeType.Element); + + if (!xpp.hasNext()) { + return res; + } + + StartElement firstEvent = (StartElement) xpp.nextEvent(); + res.setName(firstEvent.getSchemaType().getLocalPart()); + + for (Iterator attrIter = firstEvent.getAttributes(); attrIter.hasNext(); ) { + Attribute nextAttr = (Attribute) attrIter.next(); + if (attributeIsOk(firstEvent.getName().getLocalPart(), nextAttr.getName().getLocalPart(), nextAttr.getValue())) + res.getAttributes().put(nextAttr.getName().getLocalPart(), nextAttr.getValue()); + } + + while (xpp.hasNext()) { + XMLEvent nextEvent = xpp.nextEvent(); + int eventType = nextEvent.getEventType(); + if (eventType != XMLEvent.END_ELEMENT) { + break; + } + if (eventType == XMLEvent.CHARACTERS) { + res.addText(((Characters)xpp).getData()); + } else if (eventType == XMLEvent.COMMENT) { + res.addComment(((Comment)xpp).getText()); + } else if (eventType == XMLEvent.START_ELEMENT) { + StartElement nextStart = (StartElement)nextEvent; + if (elementIsOk(nextStart.getName().getLocalPart())) { + res.getChildNodes().add(parseNode(xpp)); + } + } else { + throw new FHIRFormatError("Unhandled XHTML feature: " + Integer.toString(eventType) + descLoc()); + } + } + xpp.next(); + return res; + } + + private char peekChar() throws IOException { + if (cache.length() > 0) + return cache.charAt(0); + else if (!rdr.ready()) + return '\0'; + else { + char c = (char) rdr.read(); + if (c == (char) -1) { + cache = ""; + return '\0'; + } + cache = Character.toString(c); + return c; + } + } + + private void pushChar(char ch) { + cache = Character.toString(ch) + cache; + } + + private char readChar() throws IOException { + char c; + if (cache.length() > 0) { + c = cache.charAt(0); + cache = cache.length() == 1 ? "" : cache.substring(1); + } else if (!rdr.ready()) + c = '\0'; + else + c = (char) rdr.read(); + if (c == '\r' || c == '\n') { + if (c == '\r' || lastChar != '\r') { + line++; + col = 0; + } + lastChar = c; + } + col++; + return c; + } + + private String readName() throws IOException { + StringBuilder s = new StringBuilder(); + while (isNameChar(peekChar())) + s.append(readChar()); + return s.toString(); + } + + private String readToCommentEnd() throws IOException, FHIRFormatError { + if (peekChar() == '!') + readChar(); + StringBuilder s = new StringBuilder(); + + boolean simple = true; + if (peekChar() == '-') { + readChar(); + simple = peekChar() != '-'; + if (simple) + s.append('-'); + else + readChar(); + } + + boolean done = false; + while (!done) { + char c = peekChar(); + if (c == '-') { + readChar(); + if (peekChar() == '-') { + readChar(); + if (peekChar() == '>') { + done = true; + } else + s.append("--"); + } else + s.append('-'); + } else if (simple && peekChar() == '>') { + done = true; + } else if (c != '\0') + s.append(readChar()); + else if (mustBeWellFormed) + throw new FHIRFormatError("Unexpected termination of html source" + descLoc()); + } + if (peekChar() != '\0') { + readChar(); + skipWhiteSpace(); + } + return s.toString(); + } + + private String readToTagEnd() throws IOException, FHIRFormatError { + StringBuilder s = new StringBuilder(); + while (peekChar() != '>' && peekChar() != '\0') + s.append(readChar()); + if (peekChar() != '\0') { + readChar(); + skipWhiteSpace(); + } else if (mustBeWellFormed) + throw new FHIRFormatError("Unexpected termination of html source" + descLoc()); + return s.toString(); + } + + private String readUntil(char ch) throws IOException { + StringBuilder s = new StringBuilder(); + while (peekChar() != 0 && peekChar() != ch) + s.append(readChar()); + readChar(); + return s.toString(); + } + + public void setMustBeWellFormed(boolean mustBeWellFormed) { + this.mustBeWellFormed = mustBeWellFormed; + } + + public void setPolicy(ParserSecurityPolicy policy) { + this.policy = policy; + } + + public void setTrimWhitespace(boolean trimWhitespace) { + this.trimWhitespace = trimWhitespace; + } + + public XhtmlParser setValidatorMode(boolean validatorMode) { + this.validatorMode = validatorMode; + return this; + } + + private void skipWhiteSpace() throws IOException { + if (trimWhitespace) + while (Character.isWhitespace(peekChar()) || (peekChar() == 0xfeff)) + readChar(); + } + + private void skipWhiteSpaceAndComments(XhtmlNode focus) throws IOException, FHIRFormatError { + while (Character.isWhitespace(peekChar()) || (peekChar() == 0xfeff)) + readChar(); + if (peekChar() == '<') { + char ch = readChar(); + if (peekChar() == '!') { + readChar(); + if (peekChar() == '-') { + readChar(); + if (peekChar() == '-') { + readChar(); + if (peekChar() == ' ') + readChar(); + focus.addComment(readToCommentEnd()); + } else + throw new FHIRFormatError("unrecognised element type nslist = new HashMap(); + + public NSMap(NSMap nsm) { + if (nsm != null) + nslist.putAll(nsm.nslist); + } + + public String def() { + return nslist.get(""); + } + + public void def(String ns) { + nslist.put("", ns); + } + + public String get(String abbrev) { + return nslist.containsKey(abbrev) ? nslist.get(abbrev) : "http://error/undefined-namespace"; + } + + public boolean hasDef() { + return nslist.containsKey(""); + } + + public void ns(String abbrev, String ns) { + nslist.put(abbrev, ns); + } + } + + public enum ParserSecurityPolicy { + Accept, Drop, Reject + } + + public class QName { + private String name; + private String ns; + + public QName(String src) { + if (src.contains(":")) { + ns = src.substring(0, src.indexOf(":")); + name = src.substring(src.indexOf(":") + 1); + } else { + ns = null; + name = src; + } + } + + public String getName() { + return name; + } + + public String getNs() { + return ns; + } + + public boolean hasNs() { + return ns != null; + } + + } + +} diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/IXMLWriter.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/IXMLWriter.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/IXMLWriter.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/IXMLWriter.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/SchematronWriter.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/SchematronWriter.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/SchematronWriter.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/SchematronWriter.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLNamespace.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLNamespace.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLNamespace.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLNamespace.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterState.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterState.java similarity index 95% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterState.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterState.java index 2d8d94e89f6..ccf4c4c0497 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterState.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterState.java @@ -115,9 +115,6 @@ public class XMLWriterState { return children; } - /** - * @param children the children to set - */ public void seeChild() { this.children = true; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterStateStack.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterStateStack.java similarity index 100% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterStateStack.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xml/XMLWriterStateStack.java diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/datatype/HumanNameDt.html b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/datatype/HumanNameDt.html index db7a14f5ed1..a41432183a2 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/datatype/HumanNameDt.html +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/datatype/HumanNameDt.html @@ -1,4 +1,23 @@ Dr John -SMITH + + + + SMITH + + + SMITH + + + SMITH + + + SMITH + + + SMITH + + + + Jr diff --git a/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/client/GenericJaxRsClientDstu3Test.java b/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/client/GenericJaxRsClientDstu3Test.java index 0cae577bc82..a60bdb3d28b 100644 --- a/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/client/GenericJaxRsClientDstu3Test.java +++ b/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/client/GenericJaxRsClientDstu3Test.java @@ -161,7 +161,7 @@ public class GenericJaxRsClientDstu3Test { conf.setCopyright("COPY"); final Patient patient = new Patient(); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); ourResponseContentType = Constants.CT_FHIR_XML + "; charset=UTF-8"; ourResponseBodies = new String[] { p.encodeResourceToString(conf), p.encodeResourceToString(conf), p.encodeResourceToString(patient) }; @@ -170,7 +170,7 @@ public class GenericJaxRsClientDstu3Test { IGenericClient client = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort + "/fhir"); Patient resp = client.read(Patient.class, new IdType("123").getValue()); - assertEquals("FAMILY", resp.getName().get(0).getFamily().get(0).getValue()); + assertEquals("FAMILY", resp.getName().get(0).getFamily()); assertEquals("http://localhost:" + ourPort + "/fhir/metadata", ourRequestUriAll.get(0)); assertEquals("http://localhost:" + ourPort + "/fhir/metadata", ourRequestUriAll.get(1)); assertEquals(1, ourRequestHeadersAll.get(0).get("Accept").size()); @@ -192,7 +192,7 @@ public class GenericJaxRsClientDstu3Test { conf.setCopyright("COPY"); final Patient patient = new Patient(); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); ourResponseContentType = Constants.CT_FHIR_XML + "; charset=UTF-8"; ourResponseBodies = new String[] { p.encodeResourceToString(conf), p.encodeResourceToString(conf), p.encodeResourceToString(patient) }; @@ -202,7 +202,7 @@ public class GenericJaxRsClientDstu3Test { client.setEncoding(EncodingEnum.JSON); Patient resp = client.read(Patient.class, new IdType("123").getValue()); - assertEquals("FAMILY", resp.getName().get(0).getFamily().get(0).getValue()); + assertEquals("FAMILY", resp.getName().get(0).getFamily()); assertEquals("http://localhost:" + ourPort + "/fhir/metadata?_format=json", ourRequestUriAll.get(0)); assertEquals("http://localhost:" + ourPort + "/fhir/metadata?_format=json", ourRequestUriAll.get(1)); assertEquals(1, ourRequestHeadersAll.get(0).get("Accept").size()); @@ -264,7 +264,7 @@ public class GenericJaxRsClientDstu3Test { Patient p = new Patient(); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); client.create().resource(p).execute(); @@ -300,7 +300,7 @@ public class GenericJaxRsClientDstu3Test { Patient p = new Patient(); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); client.create().resource(p).conditionalByUrl("Patient?name=foo").execute(); assertEquals(1, ourRequestHeaders.get(Constants.HEADER_CONTENT_TYPE).size()); @@ -341,7 +341,7 @@ public class GenericJaxRsClientDstu3Test { Patient p = new Patient(); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); client.create(p); @@ -364,7 +364,7 @@ public class GenericJaxRsClientDstu3Test { Patient p = new Patient(); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); client.create().resource(p).prefer(PreferReturnEnum.MINIMAL).execute(); assertEquals(1, ourRequestHeaders.get(Constants.HEADER_PREFER).size()); @@ -394,7 +394,7 @@ public class GenericJaxRsClientDstu3Test { p = new Patient(); p.setId(new IdType("1")); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); MethodOutcome output = client.create().resource(p).execute(); assertNotNull(output.getResource()); @@ -1260,7 +1260,7 @@ public class GenericJaxRsClientDstu3Test { public void testReadByUri() throws Exception { Patient patient = new Patient(); - patient.addName().addFamily("FAM"); + patient.addName().setFamily("FAM"); final String respString = ourCtx.newXmlParser().encodeResourceToString(patient); ourResponseContentType = Constants.CT_FHIR_XML + "; charset=UTF-8"; @@ -1273,14 +1273,14 @@ public class GenericJaxRsClientDstu3Test { response = (Patient) client.read(new UriDt("http://localhost:" + ourPort + "/fhir/Patient/123")); assertEquals("http://localhost:" + ourPort + "/fhir/Patient/123", ourRequestUri); - assertEquals("FAM", response.getName().get(0).getFamily().get(0).getValue()); + assertEquals("FAM", response.getName().get(0).getFamily()); } @Test public void testReadFluentByUri() throws Exception { Patient patient = new Patient(); - patient.addName().addFamily("FAM"); + patient.addName().setFamily("FAM"); final String respString = ourCtx.newXmlParser().encodeResourceToString(patient); ourResponseContentType = Constants.CT_FHIR_XML + "; charset=UTF-8"; @@ -1292,7 +1292,7 @@ public class GenericJaxRsClientDstu3Test { response = (Patient) client.read().resource(Patient.class).withUrl(new IdType("http://localhost:" + ourPort + "/AAA/Patient/123")).execute(); assertEquals("http://localhost:" + ourPort + "/AAA/Patient/123", ourRequestUri); - assertEquals("FAM", response.getName().get(0).getFamily().get(0).getValue()); + assertEquals("FAM", response.getName().get(0).getFamily()); } @Test @@ -1779,11 +1779,11 @@ public class GenericJaxRsClientDstu3Test { List input = new ArrayList(); Patient p1 = new Patient(); // No ID - p1.addName().addFamily("PATIENT1"); + p1.addName().setFamily("PATIENT1"); input.add(p1); Patient p2 = new Patient(); // Yes ID - p2.addName().addFamily("PATIENT2"); + p2.addName().setFamily("PATIENT2"); p2.setId("Patient/2"); input.add(p2); @@ -1818,7 +1818,7 @@ public class GenericJaxRsClientDstu3Test { org.hl7.fhir.dstu3.model.Bundle req = new org.hl7.fhir.dstu3.model.Bundle(); Patient patient = new Patient(); - patient.addName().addFamily("PAT_FAMILY"); + patient.addName().setFamily("PAT_FAMILY"); req.addEntry().setResource(patient); Observation observation = new Observation(); observation.getCode().setText("OBS_TEXT"); @@ -1878,11 +1878,11 @@ public class GenericJaxRsClientDstu3Test { org.hl7.fhir.dstu3.model.Bundle input = new org.hl7.fhir.dstu3.model.Bundle(); Patient p1 = new Patient(); // No ID - p1.addName().addFamily("PATIENT1"); + p1.addName().setFamily("PATIENT1"); input.addEntry().setResource(p1); Patient p2 = new Patient(); // Yes ID - p2.addName().addFamily("PATIENT2"); + p2.addName().setFamily("PATIENT2"); p2.setId("Patient/2"); input.addEntry().setResource(p2); @@ -1911,7 +1911,7 @@ public class GenericJaxRsClientDstu3Test { Patient p = new Patient(); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); client.update().resource(p).conditionalByUrl("Patient?name=foo").execute(); assertEquals(1, ourRequestHeaders.get(Constants.HEADER_CONTENT_TYPE).size()); @@ -1966,7 +1966,7 @@ public class GenericJaxRsClientDstu3Test { Patient p = new Patient(); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); client.update(new IdType("Patient/123").getValue(), p); assertEquals(1, ourRequestHeaders.get(Constants.HEADER_CONTENT_TYPE).size()); @@ -1997,7 +1997,7 @@ public class GenericJaxRsClientDstu3Test { Patient p = new Patient(); p.setId(new IdType("1")); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); client.update().resource(p).prefer(PreferReturnEnum.MINIMAL).execute(); assertEquals(1, ourRequestHeaders.get(Constants.HEADER_PREFER).size()); @@ -2027,7 +2027,7 @@ public class GenericJaxRsClientDstu3Test { p = new Patient(); p.setId(new IdType("1")); - p.addName().addFamily("FOOFAMILY"); + p.addName().setFamily("FOOFAMILY"); MethodOutcome output = client.update().resource(p).execute(); assertNotNull(output.getResource()); diff --git a/hapi-fhir-jaxrsserver-example/src/main/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientRestProviderDstu3.java b/hapi-fhir-jaxrsserver-example/src/main/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientRestProviderDstu3.java index a625becd8ad..0daf91c551d 100644 --- a/hapi-fhir-jaxrsserver-example/src/main/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientRestProviderDstu3.java +++ b/hapi-fhir-jaxrsserver-example/src/main/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientRestProviderDstu3.java @@ -200,7 +200,7 @@ public class JaxRsPatientRestProviderDstu3 extends AbstractJaxRsResourceProvider for (final List patientIterator : patients.values()) { Patient single = null; for (Patient patient : patientIterator) { - if (name == null || patient.getName().get(0).getFamily().get(0).getValueNotNull().equals(name.getValueNotNull())) { + if (name == null || patient.getName().get(0).getFamilyElement().getValueNotNull().equals(name.getValueNotNull())) { single = patient; } } @@ -251,7 +251,7 @@ public class JaxRsPatientRestProviderDstu3 extends AbstractJaxRsResourceProvider private static List createPatient(final String name) { final Patient patient = new Patient(); - patient.getName().add(new HumanName().addFamily(name)); + patient.getName().add(new HumanName().setFamily(name)); return createPatient(patient); } diff --git a/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderDstu3Test.java b/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderDstu3Test.java index af33ae07fce..72c5cb279f9 100644 --- a/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderDstu3Test.java +++ b/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderDstu3Test.java @@ -168,7 +168,7 @@ public class JaxRsPatientProviderDstu3Test { public void testCreatePatient() { final Patient existing = new Patient(); existing.setId((IdType) null); - existing.getName().add(new HumanName().addFamily("Created Patient 54")); + existing.getName().add(new HumanName().setFamily("Created Patient 54")); client.setEncoding(EncodingEnum.JSON); final MethodOutcome results = client.create().resource(existing).prefer(PreferReturnEnum.REPRESENTATION).execute(); System.out.println(results.getId()); @@ -184,7 +184,7 @@ public class JaxRsPatientProviderDstu3Test { public void testConditionalCreate() { final Patient existing = new Patient(); existing.setId((IdType) null); - existing.getName().add(new HumanName().addFamily("Created Patient 54")); + existing.getName().add(new HumanName().setFamily("Created Patient 54")); client.setEncoding(EncodingEnum.XML); final MethodOutcome results = client.create().resource(existing).prefer(PreferReturnEnum.REPRESENTATION).execute(); System.out.println(results.getId()); @@ -218,7 +218,7 @@ public class JaxRsPatientProviderDstu3Test { @Test public void testDeletePatient() { final Patient existing = new Patient(); - existing.getName().add(new HumanName().addFamily("Created Patient XYZ")); + existing.getName().add(new HumanName().setFamily("Created Patient XYZ")); final MethodOutcome results = client.create().resource(existing).prefer(PreferReturnEnum.REPRESENTATION).execute(); System.out.println(results.getId()); final Patient patient = (Patient) results.getResource(); @@ -239,7 +239,7 @@ public class JaxRsPatientProviderDstu3Test { Bundle bundle = new Bundle(); BundleEntryComponent entry = bundle.addEntry(); final Patient existing = new Patient(); - existing.getName().get(0).addFamily("Created with bundle"); + existing.getName().get(0).setFamily("Created with bundle"); entry.setResource(existing); // FIXME ? diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/SearchParamExtractorDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/SearchParamExtractorDstu3.java index 9598276faa4..02e128d6d9b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/SearchParamExtractorDstu3.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/SearchParamExtractorDstu3.java @@ -23,7 +23,13 @@ import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; import java.math.BigDecimal; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; import javax.measure.unit.NonSI; import javax.measure.unit.Unit; @@ -32,12 +38,31 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.hl7.fhir.dstu3.context.IWorkerContext; import org.hl7.fhir.dstu3.hapi.validation.IValidationSupport; -import org.hl7.fhir.dstu3.model.*; +import org.hl7.fhir.dstu3.model.Address; +import org.hl7.fhir.dstu3.model.Base; +import org.hl7.fhir.dstu3.model.BaseDateTimeType; +import org.hl7.fhir.dstu3.model.CodeSystem; +import org.hl7.fhir.dstu3.model.CodeableConcept; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestSecurityComponent; +import org.hl7.fhir.dstu3.model.ContactPoint; +import org.hl7.fhir.dstu3.model.DateTimeType; +import org.hl7.fhir.dstu3.model.Duration; import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.HumanName; +import org.hl7.fhir.dstu3.model.Identifier; +import org.hl7.fhir.dstu3.model.IntegerType; import org.hl7.fhir.dstu3.model.Location.LocationPositionComponent; import org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent; -import org.hl7.fhir.dstu3.utils.FluentPathEngine; +import org.hl7.fhir.dstu3.model.Period; +import org.hl7.fhir.dstu3.model.Quantity; +import org.hl7.fhir.dstu3.model.Questionnaire; +import org.hl7.fhir.dstu3.model.Range; +import org.hl7.fhir.dstu3.model.SimpleQuantity; +import org.hl7.fhir.dstu3.model.StringType; +import org.hl7.fhir.dstu3.model.Timing; +import org.hl7.fhir.dstu3.model.UriType; +import org.hl7.fhir.dstu3.utils.FHIRPathEngine; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -54,7 +79,15 @@ import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao; import ca.uhn.fhir.jpa.dao.BaseSearchParamExtractor; import ca.uhn.fhir.jpa.dao.ISearchParamExtractor; import ca.uhn.fhir.jpa.dao.PathAndRef; -import ca.uhn.fhir.jpa.entity.*; +import ca.uhn.fhir.jpa.entity.BaseResourceIndexedSearchParam; +import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamCoords; +import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate; +import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber; +import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamQuantity; +import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString; +import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken; +import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamUri; +import ca.uhn.fhir.jpa.entity.ResourceTable; import ca.uhn.fhir.rest.method.RestSearchParameterTypeEnum; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; @@ -390,7 +423,9 @@ public class SearchParamExtractorDstu3 extends BaseSearchParamExtractor implemen if (nextObject instanceof HumanName) { ArrayList allNames = new ArrayList(); HumanName nextHumanName = (HumanName) nextObject; - allNames.addAll(nextHumanName.getFamily()); + if (isNotBlank(nextHumanName.getFamily())) { + allNames.add(nextHumanName.getFamilyElement()); + } allNames.addAll(nextHumanName.getGiven()); for (StringType nextName : allNames) { addSearchTerm(theEntity, retVal, resourceName, nextName.getValue()); @@ -676,7 +711,7 @@ public class SearchParamExtractorDstu3 extends BaseSearchParamExtractor implemen @Override protected List extractValues(String thePaths, IBaseResource theResource) { IWorkerContext worker = new org.hl7.fhir.dstu3.hapi.validation.HapiWorkerContext(getContext(), myValidationSupport); - FluentPathEngine fp = new FluentPathEngine(worker); + FHIRPathEngine fp = new FHIRPathEngine(worker); List values = new ArrayList(); try { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ContainedTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ContainedTest.java index f20f8934b16..ce164bf8e04 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ContainedTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ContainedTest.java @@ -34,7 +34,7 @@ public class FhirResourceDaoDstu3ContainedTest extends BaseJpaDstu3Test { public void testIndexContained() { Patient p = new Patient(); p.setId("#some_patient"); - p.addName().addFamily("MYFAMILY").addGiven("MYGIVEN"); + p.addName().setFamily("MYFAMILY").addGiven("MYGIVEN"); Observation o1 = new Observation(); o1.getCode().setText("Some Observation"); @@ -47,7 +47,7 @@ public class FhirResourceDaoDstu3ContainedTest extends BaseJpaDstu3Test { IIdType oid2 = myObservationDao.create(o2, mySrd).getId().toUnqualifiedVersionless(); Patient p2 = new Patient(); - p2.addName().addFamily("MYFAMILY").addGiven("MYGIVEN"); + p2.addName().setFamily("MYFAMILY").addGiven("MYGIVEN"); IIdType pid2 = myPatientDao.create(p2, mySrd).getId().toUnqualifiedVersionless(); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(o2)); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3InterceptorTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3InterceptorTest.java index ba3ff65bc39..af0721caa8e 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3InterceptorTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3InterceptorTest.java @@ -57,7 +57,7 @@ public class FhirResourceDaoDstu3InterceptorTest extends BaseJpaDstu3Test { @Test public void testJpaCreate() { Patient p = new Patient(); - p.addName().addFamily("PATIENT"); + p.addName().setFamily("PATIENT"); Long id = myPatientDao.create(p, mySrd).getId().getIdPartAsLong(); ArgumentCaptor detailsCapt; @@ -77,7 +77,7 @@ public class FhirResourceDaoDstu3InterceptorTest extends BaseJpaDstu3Test { * Not do a conditional create */ p = new Patient(); - p.addName().addFamily("PATIENT1"); + p.addName().setFamily("PATIENT1"); Long id2 = myPatientDao.create(p, "Patient?family=PATIENT", mySrd).getId().getIdPartAsLong(); assertEquals(id, id2); @@ -91,7 +91,7 @@ public class FhirResourceDaoDstu3InterceptorTest extends BaseJpaDstu3Test { @Test public void testJpaDelete() { Patient p = new Patient(); - p.addName().addFamily("PATIENT"); + p.addName().setFamily("PATIENT"); Long id = myPatientDao.create(p, mySrd).getId().getIdPartAsLong(); myPatientDao.delete(new IdType("Patient", id), mySrd); @@ -111,12 +111,12 @@ public class FhirResourceDaoDstu3InterceptorTest extends BaseJpaDstu3Test { @Test public void testJpaUpdate() { Patient p = new Patient(); - p.addName().addFamily("PATIENT"); + p.addName().setFamily("PATIENT"); Long id = myPatientDao.create(p, mySrd).getId().getIdPartAsLong(); p = new Patient(); p.setId(new IdType(id)); - p.addName().addFamily("PATIENT1"); + p.addName().setFamily("PATIENT1"); Long id2 = myPatientDao.update(p, mySrd).getId().getIdPartAsLong(); assertEquals(id, id2); @@ -135,7 +135,7 @@ public class FhirResourceDaoDstu3InterceptorTest extends BaseJpaDstu3Test { p = new Patient(); p.setId(new IdType(id)); - p.addName().addFamily("PATIENT2"); + p.addName().setFamily("PATIENT2"); id2 = myPatientDao.update(p, "Patient?family=PATIENT1", mySrd).getId().getIdPartAsLong(); assertEquals(id, id2); @@ -150,7 +150,7 @@ public class FhirResourceDaoDstu3InterceptorTest extends BaseJpaDstu3Test { */ p = new Patient(); - p.addName().addFamily("PATIENT3"); + p.addName().setFamily("PATIENT3"); id2 = myPatientDao.update(p, "Patient?family=ZZZ", mySrd).getId().getIdPartAsLong(); assertNotEquals(id, id2); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchFtTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchFtTest.java index 45a6a69df7d..f4bc0768bfe 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchFtTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchFtTest.java @@ -146,7 +146,7 @@ public class FhirResourceDaoDstu3SearchFtTest extends BaseJpaDstu3Test { @Test public void testSuggestIgnoresBase64Content() { Patient patient = new Patient(); - patient.addName().addFamily("testSuggest"); + patient.addName().setFamily("testSuggest"); IIdType ptId = myPatientDao.create(patient, mockSrd()).getId().toUnqualifiedVersionless(); Media med = new Media(); @@ -186,7 +186,7 @@ public class FhirResourceDaoDstu3SearchFtTest extends BaseJpaDstu3Test { @Test public void testSuggest() { Patient patient = new Patient(); - patient.addName().addFamily("testSuggest"); + patient.addName().setFamily("testSuggest"); IIdType ptId = myPatientDao.create(patient, mockSrd()).getId().toUnqualifiedVersionless(); Observation obs = new Observation(); @@ -209,7 +209,7 @@ public class FhirResourceDaoDstu3SearchFtTest extends BaseJpaDstu3Test { * These shouldn't match since they're for another patient */ patient = new Patient(); - patient.addName().addFamily("testSuggest2"); + patient.addName().setFamily("testSuggest2"); IIdType ptId2 = myPatientDao.create(patient, mockSrd()).getId().toUnqualifiedVersionless(); Observation obs2 = new Observation(); @@ -301,11 +301,11 @@ public class FhirResourceDaoDstu3SearchFtTest extends BaseJpaDstu3Test { @Test public void testEverythingInstanceWithContentFilter() { Patient pt1 = new Patient(); - pt1.addName().addFamily("Everything").addGiven("Arthur"); + pt1.addName().setFamily("Everything").addGiven("Arthur"); IIdType ptId1 = myPatientDao.create(pt1, mockSrd()).getId().toUnqualifiedVersionless(); Patient pt2 = new Patient(); - pt2.addName().addFamily("Everything").addGiven("Arthur"); + pt2.addName().setFamily("Everything").addGiven("Arthur"); IIdType ptId2 = myPatientDao.create(pt2, mockSrd()).getId().toUnqualifiedVersionless(); Device dev1 = new Device(); @@ -394,11 +394,11 @@ public class FhirResourceDaoDstu3SearchFtTest extends BaseJpaDstu3Test { @Test public void testEverythingTypeWithContentFilter() { Patient pt1 = new Patient(); - pt1.addName().addFamily("Everything").addGiven("Arthur"); + pt1.addName().setFamily("Everything").addGiven("Arthur"); IIdType ptId1 = myPatientDao.create(pt1, mockSrd()).getId().toUnqualifiedVersionless(); Patient pt2 = new Patient(); - pt2.addName().addFamily("Everything").addGiven("Arthur"); + pt2.addName().setFamily("Everything").addGiven("Arthur"); IIdType ptId2 = myPatientDao.create(pt2, mockSrd()).getId().toUnqualifiedVersionless(); Device dev1 = new Device(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java index 3bd36c5975b..43a5c30aeed 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java @@ -75,7 +75,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { @Override public IIdType doInTransaction(TransactionStatus theStatus) { org.hl7.fhir.dstu3.model.Patient p = new org.hl7.fhir.dstu3.model.Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType pid = myPatientDao.create(p).getId().toUnqualifiedVersionless(); org.hl7.fhir.dstu3.model.Condition c = new org.hl7.fhir.dstu3.model.Condition(); @@ -291,11 +291,11 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { public void testIndexNoDuplicatesReference() { Practitioner pract =new Practitioner(); pract.setId("Practitioner/somepract"); - pract.addName().addFamily("SOME PRACT"); + pract.addName().setFamily("SOME PRACT"); myPractitionerDao.update(pract, mySrd); Practitioner pract2 =new Practitioner(); pract2.setId("Practitioner/somepract2"); - pract2.addName().addFamily("SOME PRACT2"); + pract2.addName().setFamily("SOME PRACT2"); myPractitionerDao.update(pract2, mySrd); DiagnosticRequest res = new DiagnosticRequest(); @@ -384,13 +384,13 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); myPatientDao.create(patient, mySrd); } { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("Tester").addGiven("John"); + patient.addName().setFamily("Tester").addGiven("John"); myPatientDao.create(patient, mySrd); } @@ -406,13 +406,13 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); pid0 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } { @@ -788,7 +788,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.setId("TEST"); patient.setLanguageElement(new CodeType("TEST")); - patient.addName().addFamily("TEST"); + patient.addName().setFamily("TEST"); patient.addIdentifier().setSystem("TEST").setValue("TEST"); myPatientDao.update(patient, mySrd); } @@ -841,7 +841,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.getLanguageElement().setValue("en_CA"); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("testSearchLanguageParam").addGiven("Joe"); + patient.addName().setFamily("testSearchLanguageParam").addGiven("Joe"); id1 = myPatientDao.create(patient, mySrd).getId(); } IIdType id2; @@ -849,7 +849,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.getLanguageElement().setValue("en_US"); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("testSearchLanguageParam").addGiven("John"); + patient.addName().setFamily("testSearchLanguageParam").addGiven("John"); id2 = myPatientDao.create(patient, mySrd).getId(); } { @@ -881,7 +881,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.getLanguageElement().setValue("en_CA"); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("testSearchLanguageParam").addGiven("Joe"); + patient.addName().setFamily("testSearchLanguageParam").addGiven("Joe"); id1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -892,7 +892,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.getLanguageElement().setValue("en_US"); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("testSearchLanguageParam").addGiven("John"); + patient.addName().setFamily("testSearchLanguageParam").addGiven("John"); id2 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } { @@ -976,14 +976,14 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily(methodName).addGiven("Joe"); + patient.addName().setFamily(methodName).addGiven("Joe"); id1a = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } IIdType id1b; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily(methodName + "XXXX").addGiven("Joe"); + patient.addName().setFamily(methodName + "XXXX").addGiven("Joe"); id1b = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -995,7 +995,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily(methodName).addGiven("John"); + patient.addName().setFamily(methodName).addGiven("John"); id2 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -1102,13 +1102,13 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("testSearchNameParam01Fam").addGiven("testSearchNameParam01Giv"); + patient.addName().setFamily("testSearchNameParam01Fam").addGiven("testSearchNameParam01Giv"); id1 = myPatientDao.create(patient, mySrd).getId(); } { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("testSearchNameParam02Fam").addGiven("testSearchNameParam02Giv"); + patient.addName().setFamily("testSearchNameParam02Fam").addGiven("testSearchNameParam02Giv"); myPatientDao.create(patient, mySrd); } @@ -1188,7 +1188,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { IIdType id; { Patient patient = new Patient(); - patient.addName().addFamily(name); + patient.addName().setFamily(name); id = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -1216,14 +1216,14 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { IIdType id1; { Practitioner patient = new Practitioner(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); patient.addTelecom().setSystem(ContactPointSystem.PHONE).setValue("123"); id1 = myPractitionerDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } IIdType id2; { Practitioner patient = new Practitioner(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); patient.addTelecom().setSystem(ContactPointSystem.EMAIL).setValue("abc"); id2 = myPractitionerDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -1362,8 +1362,8 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { @Test public void testSearchResourceLinkWithChainWithMultipleTypes() throws Exception { Patient patient = new Patient(); - patient.addName().addFamily("testSearchResourceLinkWithChainWithMultipleTypes01"); - patient.addName().addFamily("testSearchResourceLinkWithChainWithMultipleTypesXX"); + patient.addName().setFamily("testSearchResourceLinkWithChainWithMultipleTypes01"); + patient.addName().setFamily("testSearchResourceLinkWithChainWithMultipleTypesXX"); IIdType patientId01 = myPatientDao.create(patient, mySrd).getId(); Location loc01 = new Location(); @@ -1467,7 +1467,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_testSearchStringParam").addGiven("Joe"); + patient.addName().setFamily("Tester_testSearchStringParam").addGiven("Joe"); pid1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } Date between = new Date(); @@ -1475,7 +1475,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("Tester_testSearchStringParam").addGiven("John"); + patient.addName().setFamily("Tester_testSearchStringParam").addGiven("John"); pid2 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } Thread.sleep(10); @@ -1519,14 +1519,14 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { IIdType pid2; { Patient patient = new Patient(); - patient.addName().addFamily("EXPIRE"); + patient.addName().setFamily("EXPIRE"); pid1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } Date between = new Date(); Thread.sleep(10); { Patient patient = new Patient(); - patient.addName().addFamily("EXPIRE"); + patient.addName().setFamily("EXPIRE"); pid2 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } Thread.sleep(10); @@ -1551,13 +1551,13 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { IIdType pid2; { Patient patient = new Patient(); - patient.addName().addFamily("EXPIRE"); + patient.addName().setFamily("EXPIRE"); pid1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } Thread.sleep(10); { Patient patient = new Patient(); - patient.addName().addFamily("EXPIRE"); + patient.addName().setFamily("EXPIRE"); pid2 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } Thread.sleep(10); @@ -1587,7 +1587,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily(value); + patient.addName().setFamily(value); longId = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } { @@ -1638,13 +1638,13 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { public void testSearchTokenParam() { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testSearchTokenParam001"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam1"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam1"); patient.addCommunication().getLanguage().setText("testSearchTokenParamComText").addCoding().setCode("testSearchTokenParamCode").setSystem("testSearchTokenParamSystem").setDisplay("testSearchTokenParamDisplay"); myPatientDao.create(patient, mySrd); patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testSearchTokenParam002"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam2"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam2"); myPatientDao.create(patient, mySrd); { @@ -1711,18 +1711,18 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { public void testSearchTokenParamNoValue() { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testSearchTokenParam001"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam1"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam1"); patient.addCommunication().getLanguage().setText("testSearchTokenParamComText").addCoding().setCode("testSearchTokenParamCode").setSystem("testSearchTokenParamSystem").setDisplay("testSearchTokenParamDisplay"); myPatientDao.create(patient, mySrd); patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testSearchTokenParam002"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam2"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam2"); myPatientDao.create(patient, mySrd); patient = new Patient(); patient.addIdentifier().setSystem("urn:system2").setValue("testSearchTokenParam002"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam2"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam2"); myPatientDao.create(patient, mySrd); { @@ -1829,14 +1829,14 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_" + methodName + "_P1").addGiven("Joe"); + patient.addName().setFamily("Tester_" + methodName + "_P1").addGiven("Joe"); patient.getManagingOrganization().setReferenceElement(orgId); myPatientDao.create(patient, mySrd); } { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("Tester_" + methodName + "_P2").addGiven("John"); + patient.addName().setFamily("Tester_" + methodName + "_P2").addGiven("John"); myPatientDao.create(patient, mySrd); } @@ -1946,7 +1946,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_" + methodName + "_P1").addGiven("Joe"); + patient.addName().setFamily("Tester_" + methodName + "_P1").addGiven("Joe"); patient.getManagingOrganization().setReferenceElement(orgId); patientId = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -1988,7 +1988,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_" + methodName + "_P1").addGiven("Joe"); + patient.addName().setFamily("Tester_" + methodName + "_P1").addGiven("Joe"); patient.getManagingOrganization().setReferenceElement(orgId); patientId = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -2030,7 +2030,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_" + methodName + "_P1").addGiven("Joe"); + patient.addName().setFamily("Tester_" + methodName + "_P1").addGiven("Joe"); patient.getManagingOrganization().setReferenceElement(orgId); patientId = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -2071,7 +2071,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_" + methodName + "_P1").addGiven("Joe"); + patient.addName().setFamily("Tester_" + methodName + "_P1").addGiven("Joe"); patient.getManagingOrganization().setReferenceElement(orgId); patientId = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -2099,14 +2099,14 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_testSearchWithIncludesThatHaveTextId_P1").addGiven("Joe"); + patient.addName().setFamily("Tester_testSearchWithIncludesThatHaveTextId_P1").addGiven("Joe"); patient.getManagingOrganization().setReferenceElement(orgId); myPatientDao.create(patient, mySrd); } { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("Tester_testSearchWithIncludesThatHaveTextId_P2").addGiven("John"); + patient.addName().setFamily("Tester_testSearchWithIncludesThatHaveTextId_P2").addGiven("John"); myPatientDao.create(patient, mySrd); } @@ -2139,7 +2139,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("Tester_testSearchStringParam").addGiven("John"); + patient.addName().setFamily("Tester_testSearchStringParam").addGiven("John"); patient.setBirthDateElement(new DateType("2011-01-01")); patient.getManagingOrganization().setReferenceElement(orgId); notMissing = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); @@ -2214,7 +2214,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("Tester_testSearchStringParam").addGiven("John"); + patient.addName().setFamily("Tester_testSearchStringParam").addGiven("John"); patient.setBirthDateElement(new DateType("2011-01-01")); patient.getManagingOrganization().setReferenceElement(orgId); notMissing = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); @@ -2254,7 +2254,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("Tester_testSearchStringParam").addGiven("John"); + patient.addName().setFamily("Tester_testSearchStringParam").addGiven("John"); patient.setBirthDateElement(new DateType("2011-01-01")); patient.getManagingOrganization().setReferenceElement(orgId); notMissing = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SubscriptionTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SubscriptionTest.java index 2174d3d2581..205edf9c17c 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SubscriptionTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SubscriptionTest.java @@ -222,7 +222,7 @@ public class FhirResourceDaoDstu3SubscriptionTest extends BaseJpaDstu3Test { String methodName = "testDeleteSubscriptionWithFlaggedResources"; Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType pId = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); Subscription subs; @@ -310,7 +310,7 @@ public class FhirResourceDaoDstu3SubscriptionTest extends BaseJpaDstu3Test { String methodName = "testSubscriptionResourcesAppear"; Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType pId = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); Observation obs = new Observation(); @@ -418,7 +418,7 @@ public class FhirResourceDaoDstu3SubscriptionTest extends BaseJpaDstu3Test { String methodName = "testSubscriptionResourcesAppear2"; Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType pId = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); Observation obs = new Observation(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3TerminologyTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3TerminologyTest.java index 20f8b1008e5..0fa7c375d2c 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3TerminologyTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3TerminologyTest.java @@ -12,13 +12,13 @@ import java.util.List; import java.util.Set; import org.hl7.fhir.dstu3.model.AllergyIntolerance; -import org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceStatus; +import org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory; +import org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus; import org.hl7.fhir.dstu3.model.AuditEvent; import org.hl7.fhir.dstu3.model.CodeSystem; import org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode; import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent; import org.hl7.fhir.dstu3.model.Observation; -import org.hl7.fhir.dstu3.model.Observation.ObservationStatus; import org.hl7.fhir.dstu3.model.ValueSet; import org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent; import org.hl7.fhir.dstu3.model.ValueSet.FilterOperator; @@ -575,30 +575,30 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test { @Test public void testSearchCodeInBuiltInValueSet() { AllergyIntolerance ai1 = new AllergyIntolerance(); - ai1.setStatus(AllergyIntoleranceStatus.ACTIVE); + ai1.setClinicalStatus(AllergyIntoleranceClinicalStatus.ACTIVE); String id1 = myAllergyIntoleranceDao.create(ai1, mySrd).getId().toUnqualifiedVersionless().getValue(); AllergyIntolerance ai2 = new AllergyIntolerance(); - ai2.setStatus(AllergyIntoleranceStatus.ACTIVECONFIRMED); + ai2.setClinicalStatus(AllergyIntoleranceClinicalStatus.RESOLVED); String id2 = myAllergyIntoleranceDao.create(ai2, mySrd).getId().toUnqualifiedVersionless().getValue(); AllergyIntolerance ai3 = new AllergyIntolerance(); - ai3.setStatus(AllergyIntoleranceStatus.INACTIVE); + ai3.setClinicalStatus(AllergyIntoleranceClinicalStatus.INACTIVE); String id3 = myAllergyIntoleranceDao.create(ai3, mySrd).getId().toUnqualifiedVersionless().getValue(); SearchParameterMap params; params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/allergy-intolerance-status").setModifier(TokenParamModifier.IN)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/allergy-clinical-status").setModifier(TokenParamModifier.IN)); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id1, id2, id3)); // No codes in this one params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality").setModifier(TokenParamModifier.IN)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality").setModifier(TokenParamModifier.IN)); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), empty()); // Invalid VS params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/FOO").setModifier(TokenParamModifier.IN)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/FOO").setModifier(TokenParamModifier.IN)); try { myAllergyIntoleranceDao.search(params); } catch (InvalidRequestException e) { @@ -615,30 +615,30 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test { @Ignore public void testSearchCodeNotInBuiltInValueSet() { AllergyIntolerance ai1 = new AllergyIntolerance(); - ai1.setStatus(AllergyIntoleranceStatus.ACTIVE); + ai1.setClinicalStatus(AllergyIntoleranceClinicalStatus.ACTIVE); String id1 = myAllergyIntoleranceDao.create(ai1, mySrd).getId().toUnqualifiedVersionless().getValue(); AllergyIntolerance ai2 = new AllergyIntolerance(); - ai2.setStatus(AllergyIntoleranceStatus.ACTIVECONFIRMED); + ai2.setClinicalStatus(AllergyIntoleranceClinicalStatus.RESOLVED); String id2 = myAllergyIntoleranceDao.create(ai2, mySrd).getId().toUnqualifiedVersionless().getValue(); AllergyIntolerance ai3 = new AllergyIntolerance(); - ai3.setStatus(AllergyIntoleranceStatus.INACTIVE); + ai3.setClinicalStatus(AllergyIntoleranceClinicalStatus.INACTIVE); String id3 = myAllergyIntoleranceDao.create(ai3, mySrd).getId().toUnqualifiedVersionless().getValue(); SearchParameterMap params; params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/allergy-intolerance-status").setModifier(TokenParamModifier.NOT_IN)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/allergy-intolerance-status").setModifier(TokenParamModifier.NOT_IN)); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), empty()); // No codes in this one params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality").setModifier(TokenParamModifier.NOT_IN)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality").setModifier(TokenParamModifier.NOT_IN)); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id1, id2, id3)); // Invalid VS params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/FOO").setModifier(TokenParamModifier.NOT_IN)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, "http://hl7.org/fhir/ValueSet/FOO").setModifier(TokenParamModifier.NOT_IN)); try { myAllergyIntoleranceDao.search(params); } catch (InvalidRequestException e) { @@ -650,46 +650,42 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test { @Test public void testSearchCodeBelowBuiltInCodesystem() { AllergyIntolerance ai1 = new AllergyIntolerance(); - ai1.setStatus(AllergyIntoleranceStatus.ACTIVE); + ai1.setClinicalStatus(AllergyIntoleranceClinicalStatus.ACTIVE); String id1 = myAllergyIntoleranceDao.create(ai1, mySrd).getId().toUnqualifiedVersionless().getValue(); AllergyIntolerance ai2 = new AllergyIntolerance(); - ai2.setStatus(AllergyIntoleranceStatus.ACTIVECONFIRMED); + ai2.setClinicalStatus(AllergyIntoleranceClinicalStatus.RESOLVED); String id2 = myAllergyIntoleranceDao.create(ai2, mySrd).getId().toUnqualifiedVersionless().getValue(); AllergyIntolerance ai3 = new AllergyIntolerance(); - ai3.setStatus(AllergyIntoleranceStatus.INACTIVE); + ai3.setClinicalStatus(AllergyIntoleranceClinicalStatus.INACTIVE); String id3 = myAllergyIntoleranceDao.create(ai3, mySrd).getId().toUnqualifiedVersionless().getValue(); SearchParameterMap params; params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam("http://hl7.org/fhir/allergy-intolerance-status", AllergyIntoleranceStatus.ACTIVE.toCode())); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam("http://hl7.org/fhir/allergy-clinical-status", AllergyIntoleranceClinicalStatus.ACTIVE.toCode())); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id1)); params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam("http://hl7.org/fhir/allergy-intolerance-status", AllergyIntoleranceStatus.ACTIVE.toCode()).setModifier(TokenParamModifier.BELOW)); - assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id1, id2)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam("http://hl7.org/fhir/allergy-clinical-status", AllergyIntoleranceClinicalStatus.ACTIVE.toCode()).setModifier(TokenParamModifier.BELOW)); + assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id1)); params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam("http://hl7.org/fhir/allergy-intolerance-status", AllergyIntoleranceStatus.ACTIVECONFIRMED.toCode()).setModifier(TokenParamModifier.BELOW)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam("http://hl7.org/fhir/allergy-clinical-status", AllergyIntoleranceClinicalStatus.RESOLVED.toCode()).setModifier(TokenParamModifier.BELOW)); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id2)); params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam("http://hl7.org/fhir/allergy-intolerance-status", AllergyIntoleranceStatus.ACTIVECONFIRMED.toCode())); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam("http://hl7.org/fhir/allergy-clinical-status", AllergyIntoleranceClinicalStatus.RESOLVED.toCode())); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id2)); - params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam("http://hl7.org/fhir/allergy-intolerance-status", AllergyIntoleranceStatus.ENTEREDINERROR.toCode())); - assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), empty()); - // Unknown code params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam("http://hl7.org/fhir/allergy-intolerance-status", "fooooo")); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam("http://hl7.org/fhir/allergy-clinical-status", "fooooo")); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), empty()); // Unknown system params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam("http://hl7.org/fhir/allergy-intolerance-status222222", "fooooo")); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam("http://hl7.org/fhir/allergy-clinical-status222222", "fooooo")); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), empty()); } @@ -697,36 +693,43 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test { @Test public void testSearchCodeBelowBuiltInCodesystemUnqualified() { AllergyIntolerance ai1 = new AllergyIntolerance(); - ai1.setStatus(AllergyIntoleranceStatus.ACTIVE); + ai1.setClinicalStatus(AllergyIntoleranceClinicalStatus.ACTIVE); + ai1.addCategoryElement().setValue(AllergyIntoleranceCategory.MEDICATION); String id1 = myAllergyIntoleranceDao.create(ai1, mySrd).getId().toUnqualifiedVersionless().getValue(); AllergyIntolerance ai2 = new AllergyIntolerance(); - ai2.setStatus(AllergyIntoleranceStatus.ACTIVECONFIRMED); + ai2.setClinicalStatus(AllergyIntoleranceClinicalStatus.RESOLVED); + ai2.addCategoryElement().setValue(AllergyIntoleranceCategory.BIOLOGIC); String id2 = myAllergyIntoleranceDao.create(ai2, mySrd).getId().toUnqualifiedVersionless().getValue(); AllergyIntolerance ai3 = new AllergyIntolerance(); - ai3.setStatus(AllergyIntoleranceStatus.INACTIVE); + ai3.setClinicalStatus(AllergyIntoleranceClinicalStatus.INACTIVE); + ai3.addCategoryElement().setValue(AllergyIntoleranceCategory.FOOD); String id3 = myAllergyIntoleranceDao.create(ai3, mySrd).getId().toUnqualifiedVersionless().getValue(); SearchParameterMap params; params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, AllergyIntoleranceStatus.ACTIVE.toCode())); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, AllergyIntoleranceClinicalStatus.ACTIVE.toCode())); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id1)); params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, AllergyIntoleranceStatus.ACTIVE.toCode()).setModifier(TokenParamModifier.BELOW)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, AllergyIntoleranceClinicalStatus.ACTIVE.toCode()).setModifier(TokenParamModifier.BELOW)); + assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id1)); + + params = new SearchParameterMap(); + params.add(AllergyIntolerance.SP_CATEGORY, new TokenParam(null, AllergyIntoleranceCategory.MEDICATION.toCode()).setModifier(TokenParamModifier.BELOW)); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id1, id2)); params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, AllergyIntoleranceStatus.ACTIVECONFIRMED.toCode()).setModifier(TokenParamModifier.BELOW)); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, AllergyIntoleranceClinicalStatus.RESOLVED.toCode()).setModifier(TokenParamModifier.BELOW)); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id2)); params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, AllergyIntoleranceStatus.ACTIVECONFIRMED.toCode())); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, AllergyIntoleranceClinicalStatus.RESOLVED.toCode())); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), containsInAnyOrder(id2)); params = new SearchParameterMap(); - params.add(AllergyIntolerance.SP_STATUS, new TokenParam(null, AllergyIntoleranceStatus.ENTEREDINERROR.toCode())); + params.add(AllergyIntolerance.SP_CLINICAL_STATUS, new TokenParam(null, "FOO")); assertThat(toUnqualifiedVersionlessIdValues(myAllergyIntoleranceDao.search(params)), empty()); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3Test.java index 58b0565a2da..5256df8c029 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3Test.java @@ -551,7 +551,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { Patient pat = new Patient(); pat.setId(idName); - pat.addName().addFamily("FAM"); + pat.addName().setFamily("FAM"); IIdType patId = myPatientDao.update(pat, mySrd).getId(); assertEquals("Patient/" + idName, patId.toUnqualifiedVersionless().getValue()); @@ -632,7 +632,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { public void testCreateSummaryFails() { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testCreateTextIdFails"); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.getMeta().addTag().setSystem(Constants.TAG_SUBSETTED_SYSTEM).setCode(Constants.TAG_SUBSETTED_CODE); @@ -648,7 +648,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { public void testCreateTextIdDoesntFail() { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testCreateTextIdFails"); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/ABC"); String id = myPatientDao.create(p, mySrd).getId().getIdPart(); assertNotEquals("ABC", id); @@ -676,7 +676,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); results = myPatientDao.create(p, "Patient?identifier=urn%3Asystem%7C" + methodName, mySrd); assertEquals(id.getIdPart(), results.getId().getIdPart()); assertFalse(results.getCreated().booleanValue()); @@ -687,7 +687,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); results = myPatientDao.create(p, mySrd); assertNotEquals(id.getIdPart(), results.getId().getIdPart()); assertTrue(results.getCreated().booleanValue()); @@ -696,7 +696,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); try { myPatientDao.create(p, "Patient?identifier=urn%3Asystem%7C" + methodName, mySrd); fail(); @@ -718,7 +718,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); results = myPatientDao.create(p, "Patient?_id=" + id.toVersionless().getValue(), mySrd); assertEquals(id.getIdPart(), results.getId().getIdPart()); assertEquals(id.getVersionIdPart(), results.getId().getVersionIdPart()); @@ -794,7 +794,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { @Test public void testCreateWithInvalidReferenceFailsGracefully() { Patient patient = new Patient(); - patient.addName().addFamily("testSearchResourceLinkWithChainWithMultipleTypes01"); + patient.addName().setFamily("testSearchResourceLinkWithChainWithMultipleTypes01"); patient.setManagingOrganization(new Reference("Organization/99999999")); try { myPatientDao.create(patient, mySrd); @@ -808,7 +808,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { @Test public void testCreateWithInvalidReferenceNoId() { Patient p = new Patient(); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.getManagingOrganization().setReference("Organization/"); try { @@ -822,7 +822,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { @Test public void testCreateWithReferenceBadType() { Patient p = new Patient(); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.getManagingOrganization().setReference("Blah/123"); try { @@ -836,7 +836,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { @Test public void testCreateWithReferenceNoType() { Patient p = new Patient(); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.getManagingOrganization().setReference("123"); try { @@ -855,7 +855,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { IFhirResourceDao dao = myNamingSystemDao; Patient resource = new Patient(); - resource.addName().addFamily("My Name"); + resource.addName().setFamily("My Name"); try { dao.create(resource, mySrd); fail(); @@ -1010,7 +1010,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { IIdType orgId = myOrganizationDao.create(org, mySrd).getId().toUnqualifiedVersionless(); Patient patient = new Patient(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); patient.getManagingOrganization().setReferenceElement(orgId); IIdType patId = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); @@ -1055,13 +1055,13 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_testDeleteResource").addGiven("Joe"); + patient.addName().setFamily("Tester_testDeleteResource").addGiven("Joe"); id1 = myPatientDao.create(patient, mySrd).getId(); } { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily("Tester_testDeleteResource").addGiven("John"); + patient.addName().setFamily("Tester_testDeleteResource").addGiven("John"); id2 = myPatientDao.create(patient, mySrd).getId(); } { @@ -1112,7 +1112,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { public void testDeleteThenUndelete() { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_testDeleteThenUndelete").addGiven("Joe"); + patient.addName().setFamily("Tester_testDeleteThenUndelete").addGiven("Joe"); IIdType id = myPatientDao.create(patient, mySrd).getId(); assertThat(id.getValue(), Matchers.endsWith("/_history/1")); @@ -1131,7 +1131,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester_testDeleteThenUndelete").addGiven("Joe"); + patient.addName().setFamily("Tester_testDeleteThenUndelete").addGiven("Joe"); patient.setId(id.toUnqualifiedVersionless()); IIdType id2 = myPatientDao.update(patient, mySrd).getId(); @@ -1411,11 +1411,11 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testHistoryByForcedId"); - patient.addName().addFamily("Tester").addGiven("testHistoryByForcedId"); + patient.addName().setFamily("Tester").addGiven("testHistoryByForcedId"); patient.setId("Patient/testHistoryByForcedId"); idv1 = myPatientDao.update(patient, mySrd).getId(); - patient.addName().addFamily("Tester").addGiven("testHistoryByForcedIdName2"); + patient.addName().setFamily("Tester").addGiven("testHistoryByForcedIdName2"); patient.setId(patient.getIdElement().toUnqualifiedVersionless()); idv2 = myPatientDao.update(patient, mySrd).getId(); } @@ -1433,7 +1433,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { String methodName = "testHistoryOverMultiplePages"; Patient patient = new Patient(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); IIdType id = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); Date middleDate = null; @@ -1447,7 +1447,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { Thread.sleep(fullSize); } patient.setId(id); - patient.getName().get(0).getFamily().get(0).setValue(methodName + "_i"); + patient.getName().get(0).getFamilyElement().setValue(methodName + "_i"); myPatientDao.update(patient, mySrd); } @@ -1581,14 +1581,14 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { @Test public void testHistoryReflectsMetaOperations() throws Exception { Patient inPatient = new Patient(); - inPatient.addName().addFamily("version1"); + inPatient.addName().setFamily("version1"); inPatient.getMeta().addProfile("http://example.com/1"); IIdType id = myPatientDao.create(inPatient, mySrd).getId().toUnqualifiedVersionless(); IBundleProvider history = myPatientDao.history((Date)null, null, mySrd); assertEquals(1, history.size()); Patient outPatient = (Patient) history.getResources(0, 1).get(0); - assertEquals("version1", inPatient.getName().get(0).getFamilyAsSingleString()); + assertEquals("version1", inPatient.getName().get(0).getFamily()); List profiles = toStringList(outPatient.getMeta().getProfile()); assertThat(profiles, contains("http://example.com/1")); @@ -1602,7 +1602,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { history = myPatientDao.history((Date)null, null, mySrd); assertEquals(1, history.size()); outPatient = (Patient) history.getResources(0, 1).get(0); - assertEquals("version1", inPatient.getName().get(0).getFamilyAsSingleString()); + assertEquals("version1", inPatient.getName().get(0).getFamily()); profiles = toStringList(outPatient.getMeta().getProfile()); assertThat(profiles, containsInAnyOrder("http://example.com/1", "http://example.com/2")); @@ -1612,19 +1612,19 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { inPatient.setId(id); inPatient.getMeta().addProfile("http://example.com/3"); - inPatient.getName().get(0).addFamily("version2"); + inPatient.getName().get(0).setFamily("version2"); myPatientDao.update(inPatient, mySrd); history = myPatientDao.history((Date)null, null, mySrd); assertEquals(2, history.size()); outPatient = (Patient) history.getResources(0, 2).get(0); - assertEquals("version1 version2", outPatient.getName().get(0).getFamilyAsSingleString()); + assertEquals("version2", outPatient.getName().get(0).getFamily()); profiles = toStringList(outPatient.getMeta().getProfile()); ourLog.info(profiles.toString()); assertThat(profiles, containsInAnyOrder("http://example.com/1", "http://example.com/2", "http://example.com/3")); outPatient = (Patient) history.getResources(0, 2).get(1); - assertEquals("version1", outPatient.getName().get(0).getFamilyAsSingleString()); + assertEquals("version1", outPatient.getName().get(0).getFamily()); profiles = toStringList(outPatient.getMeta().getProfile()); assertThat(profiles, containsInAnyOrder("http://example.com/1", "http://example.com/2")); } @@ -1634,7 +1634,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { String methodName = "testHistoryWithDeletedResource"; Patient patient = new Patient(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); IIdType id = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); myPatientDao.delete(id, mySrd); @@ -1667,7 +1667,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { String methodName = "testHistoryWithFromAndTo"; Patient patient = new Patient(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); IIdType id = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); List preDates = Lists.newArrayList(); @@ -1677,7 +1677,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { preDates.add(new Date()); Thread.sleep(100); patient.setId(id); - patient.getName().get(0).getFamily().get(0).setValue(methodName + "_i"); + patient.getName().get(0).getFamilyElement().setValue(methodName + "_i"); ids.add(myPatientDao.update(patient, mySrd).getId().toUnqualified().getValue()); } @@ -1700,7 +1700,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { Thread.sleep(10); Patient inPatient = new Patient(); - inPatient.addName().addFamily("version1"); + inPatient.addName().setFamily("version1"); inPatient.getMeta().addProfile("http://example.com/1"); myPatientDao.create(inPatient, mySrd).getId().toUnqualifiedVersionless(); @@ -1712,7 +1712,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { IBundleProvider history = myPatientDao.history((Date)null, null, mySrd); assertEquals(1, history.size()); Patient outPatient = (Patient) history.getResources(0, 1).get(0); - assertEquals("version1", inPatient.getName().get(0).getFamilyAsSingleString()); + assertEquals("version1", inPatient.getName().get(0).getFamily()); List profiles = toStringList(outPatient.getMeta().getProfile()); assertThat(profiles, contains("http://example.com/1")); @@ -1721,7 +1721,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { history = myPatientDao.history(before, null, mySrd); assertEquals(1, history.size()); outPatient = (Patient) history.getResources(0, 1).get(0); - assertEquals("version1", inPatient.getName().get(0).getFamilyAsSingleString()); + assertEquals("version1", inPatient.getName().get(0).getFamily()); profiles = toStringList(outPatient.getMeta().getProfile()); assertThat(profiles, contains("http://example.com/1")); @@ -1746,7 +1746,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { public void testIdParam() { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); MethodOutcome outcome = myPatientDao.create(patient, mySrd); assertNotNull(outcome.getId()); @@ -1783,7 +1783,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { List ret = toList(myPatientDao.search(paramMap)); assertEquals(1, ret.size()); Patient p = ret.get(0); - assertEquals("Tester", p.getName().get(0).getFamilyAsSingleString()); + assertEquals("Tester", p.getName().get(0).getFamily()); } { SearchParameterMap paramMap = new SearchParameterMap(); @@ -1792,7 +1792,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { List ret = toList(myPatientDao.search(paramMap)); assertEquals(1, ret.size()); Patient p = ret.get(0); - assertEquals("Tester", p.getName().get(0).getFamilyAsSingleString()); + assertEquals("Tester", p.getName().get(0).getFamily()); } { SearchParameterMap paramMap = new SearchParameterMap(); @@ -1801,7 +1801,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { List ret = toList(myPatientDao.search(paramMap)); assertEquals(1, ret.size()); Patient p = ret.get(0); - assertEquals("Tester", p.getName().get(0).getFamilyAsSingleString()); + assertEquals("Tester", p.getName().get(0).getFamily()); } { SearchParameterMap paramMap = new SearchParameterMap(); @@ -1863,7 +1863,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { */ Patient pt = myPatientDao.read(id, mySrd); - pt.addName().addFamily("anotherName"); + pt.addName().setFamily("anotherName"); myPatientDao.update(pt, mySrd); /* @@ -2172,7 +2172,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001testPersistSearchParams"); patient.getGenderElement().setValue(AdministrativeGender.MALE); - patient.addName().addFamily("Tester").addGiven("JoetestPersistSearchParams"); + patient.addName().setFamily("Tester").addGiven("JoetestPersistSearchParams"); MethodOutcome outcome = myPatientDao.create(patient, mySrd); assertNotNull(outcome.getId()); @@ -2337,7 +2337,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { String methodName = "testReadWithDeletedResource"; Patient patient = new Patient(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); IIdType id = myPatientDao.create(patient, mySrd).getId().toVersionless(); myPatientDao.delete(id, mySrd); @@ -2374,7 +2374,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); id1 = myPatientDao.create(patient, mySrd).getId(); Meta metaAdd = new Meta(); @@ -2386,7 +2386,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); patient.getMeta().addTag("http://foo", "Cat", "Kittens"); patient.getMeta().addSecurity().setSystem("seclabel:sys:2").setCode("seclabel:code:2").setDisplay("seclabel:dis:2"); @@ -2479,7 +2479,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); patient.getMeta().addTag(null, "Dog", "Puppies"); patient.getMeta().addSecurity().setSystem("seclabel:sys:1").setCode("seclabel:code:1").setDisplay("seclabel:dis:1"); @@ -2491,7 +2491,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); patient.getMeta().addTag("http://foo", "Cat", "Kittens"); patient.getMeta().addSecurity().setSystem("seclabel:sys:2").setCode("seclabel:code:2").setDisplay("seclabel:dis:2"); @@ -2576,7 +2576,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { IIdType orgId = myOrganizationDao.create(org, mySrd).getId(); Patient pat = new Patient(); - pat.addName().addFamily("X" + methodName + "X"); + pat.addName().setFamily("X" + methodName + "X"); pat.getManagingOrganization().setReferenceElement(orgId.toUnqualifiedVersionless()); myPatientDao.create(pat, mySrd); @@ -2614,20 +2614,20 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { public void testSortByDate() { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testtestSortByDate"); - p.addName().addFamily("testSortF1").addGiven("testSortG1"); + p.addName().setFamily("testSortF1").addGiven("testSortG1"); p.setBirthDateElement(new DateType("2001-01-01")); IIdType id1 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); // Create out of order p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testtestSortByDate"); - p.addName().addFamily("testSortF2").addGiven("testSortG2"); + p.addName().setFamily("testSortF2").addGiven("testSortG2"); p.setBirthDateElement(new DateType("2001-01-03")); IIdType id3 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testtestSortByDate"); - p.addName().addFamily("testSortF3").addGiven("testSortG3"); + p.addName().setFamily("testSortF3").addGiven("testSortG3"); p.setBirthDateElement(new DateType("2001-01-02")); IIdType id2 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); @@ -2718,22 +2718,22 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system1").setValue(methodName); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType id1 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system2").setValue(methodName); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType id2 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system3").setValue(methodName); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType id3 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system4").setValue(methodName); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType id4 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); SearchParameterMap pm; @@ -2845,19 +2845,19 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("testSortF1").addGiven("testSortG1"); + p.addName().setFamily("testSortF1").addGiven("testSortG1"); p.getManagingOrganization().setReferenceElement(oid1); IIdType id1 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("testSortF2").addGiven("testSortG2"); + p.addName().setFamily("testSortF2").addGiven("testSortG2"); p.getManagingOrganization().setReferenceElement(oid2); IIdType id2 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("testSortF3").addGiven("testSortG3"); + p.addName().setFamily("testSortF3").addGiven("testSortG3"); p.getManagingOrganization().setReferenceElement(oid1); IIdType id3 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); @@ -2899,18 +2899,18 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { Patient p = new Patient(); String string = "testSortByString01"; p.addIdentifier().setSystem("urn:system").setValue(string); - p.addName().addFamily("testSortF1").addGiven("testSortG1"); + p.addName().setFamily("testSortF1").addGiven("testSortG1"); IIdType id1 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); // Create out of order p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(string); - p.addName().addFamily("testSortF3").addGiven("testSortG3"); + p.addName().setFamily("testSortF3").addGiven("testSortG3"); IIdType id3 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(string); - p.addName().addFamily("testSortF2").addGiven("testSortG2"); + p.addName().setFamily("testSortF2").addGiven("testSortG2"); IIdType id2 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); @@ -2952,22 +2952,22 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(string); - p.addName().addFamily("Fam1").addGiven("Giv1"); + p.addName().setFamily("Fam1").addGiven("Giv1"); myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(string); - p.addName().addFamily("Fam2").addGiven("Giv1"); + p.addName().setFamily("Fam2").addGiven("Giv1"); myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(string); - p.addName().addFamily("Fam2").addGiven("Giv2"); + p.addName().setFamily("Fam2").addGiven("Giv2"); myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(string); - p.addName().addFamily("Fam1").addGiven("Giv2"); + p.addName().setFamily("Fam1").addGiven("Giv2"); myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); SearchParameterMap pm; @@ -3120,7 +3120,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { assertTrue(o1id.hasVersionIdPart()); Patient p1 = new Patient(); - p1.addName().addFamily("AAAA"); + p1.addName().setFamily("AAAA"); p1.getManagingOrganization().setReferenceElement(o1id); IIdType p1id = myPatientDao.create(p1, mySrd).getId(); @@ -3180,7 +3180,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test { public void testTagsAndProfilesAndSecurityLabelsWithCreateAndReadAndSearch() { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testTagsWithCreateAndReadAndSearch"); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); List tagList = new ArrayList(); tagList.add(new Coding().setSystem(null).setCode("Dog").setDisplay("Puppies")); // Add this twice diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3UpdateTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3UpdateTest.java index 447bf7c0f85..fe7cdf4dadf 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3UpdateTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3UpdateTest.java @@ -62,7 +62,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { public void testUpdateAndGetHistoryResource() throws InterruptedException { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); MethodOutcome outcome = myPatientDao.create(patient, mySrd); assertNotNull(outcome.getId()); @@ -139,7 +139,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); myPatientDao.update(p, "Patient?identifier=urn%3Asystem%7C" + methodName, mySrd); @@ -213,7 +213,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); String matchUrl = "Patient?_lastUpdated=gt" + start.getValueAsString(); @@ -251,7 +251,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); myPatientDao.update(p, "Patient?_lastUpdated=gt" + start.getValueAsString(), mySrd); @@ -271,7 +271,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { Patient p = new Patient(); String methodName = "testUpdateCreatesTextualIdIfItDoesntAlreadyExist"; p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); IIdType id = myPatientDao.update(p, mySrd).getId(); @@ -286,7 +286,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { String methodName = "testUpdateFailsForUnknownIdWithNumberThenText"; Patient p = new Patient(); p.setId("0" + methodName); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); myPatientDao.update(p, mySrd); } @@ -301,7 +301,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { IIdType p1id; { Patient p1 = new Patient(); - p1.addName().addFamily(methodName); + p1.addName().setFamily(methodName); p1.getMeta().addTag("tag_scheme1", "tag_term1",null); p1.getMeta().addSecurity("sec_scheme1", "sec_term1",null); @@ -312,7 +312,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { { Patient p1 = new Patient(); p1.setId(p1id); - p1.addName().addFamily(methodName); + p1.addName().setFamily(methodName); p1.getMeta().addTag("tag_scheme2", "tag_term2", null); p1.getMeta().addSecurity("sec_scheme2", "sec_term2", null); @@ -344,12 +344,12 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { public void testUpdateMaintainsSearchParams() throws InterruptedException { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateMaintainsSearchParamsDstu2AAA"); - p1.addName().addFamily("Tester").addGiven("testUpdateMaintainsSearchParamsDstu2AAA"); + p1.addName().setFamily("Tester").addGiven("testUpdateMaintainsSearchParamsDstu2AAA"); IIdType p1id = myPatientDao.create(p1, mySrd).getId(); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testUpdateMaintainsSearchParamsDstu2BBB"); - p2.addName().addFamily("Tester").addGiven("testUpdateMaintainsSearchParamsDstu2BBB"); + p2.addName().setFamily("Tester").addGiven("testUpdateMaintainsSearchParamsDstu2BBB"); myPatientDao.create(p2, mySrd).getId(); Set ids = myPatientDao.searchForIds(Patient.SP_GIVEN, new StringParam("testUpdateMaintainsSearchParamsDstu2AAA")); @@ -380,7 +380,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { public void testUpdateRejectsInvalidTypes() throws InterruptedException { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); - p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); + p1.addName().setFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); IIdType p1id = myPatientDao.create(p1, mySrd).getId(); Organization p2 = new Organization(); @@ -410,7 +410,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue(methodName); - p1.addName().addFamily("Tester").addGiven(methodName); + p1.addName().setFamily("Tester").addGiven(methodName); IIdType p1id = myPatientDao.create(p1, mySrd).getId(); IIdType p1id2 = myPatientDao.update(p1, mySrd).getId(); @@ -428,7 +428,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { IIdType id; { Patient patient = new Patient(); - patient.addName().addFamily(name); + patient.addName().setFamily(name); List tl = new ArrayList(); tl.add(new IdType("http://foo/bar")); @@ -455,7 +455,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { IIdType id; { Patient patient = new Patient(); - patient.addName().addFamily(name); + patient.addName().setFamily(name); List tl = new ArrayList(); tl.add(new IdType("http://foo/bar")); @@ -476,7 +476,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { { Patient patient = new Patient(); patient.setId(id); - patient.addName().addFamily(name); + patient.addName().setFamily(name); List tl = new ArrayList(); tl.add(new IdType("http://foo/baz")); @@ -500,7 +500,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { public void testUpdateUnknownNumericIdFails() { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testCreateNumericIdFails"); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/9999999999999999"); try { myPatientDao.update(p, mySrd); @@ -514,7 +514,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { public void testUpdateWithInvalidIdFails() { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testCreateNumericIdFails"); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/123:456"); try { myPatientDao.update(p, mySrd); @@ -528,7 +528,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { public void testUpdateWithNumericIdFails() { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testCreateNumericIdFails"); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/123"); try { myPatientDao.update(p, mySrd); @@ -542,7 +542,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { public void testUpdateWithNumericThenTextIdSucceeds() { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testCreateNumericIdFails"); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/123abc"); IIdType id = myPatientDao.update(p, mySrd).getId(); assertEquals("123abc", id.getIdPart()); @@ -550,7 +550,7 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test { p = myPatientDao.read(id.toUnqualifiedVersionless(), mySrd); assertEquals("Patient/123abc", p.getIdElement().toUnqualifiedVersionless().getValue()); - assertEquals("Hello", p.getName().get(0).getFamily().get(0).getValue()); + assertEquals("Hello", p.getName().get(0).getFamily()); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ValidateTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ValidateTest.java index 3aef93ad900..7673c4a24a0 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ValidateTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3ValidateTest.java @@ -181,7 +181,7 @@ public class FhirResourceDaoDstu3ValidateTest extends BaseJpaDstu3Test { Patient pat = new Patient(); pat.setId("Patient/123"); - pat.addName().addFamily(methodName); + pat.addName().setFamily(methodName); try { myPatientDao.validate(pat, null, null, null, ValidationModeEnum.CREATE, null, mySrd); @@ -201,7 +201,7 @@ public class FhirResourceDaoDstu3ValidateTest extends BaseJpaDstu3Test { Patient pat = new Patient(); pat.setId("Patient/123"); - pat.addName().addFamily(methodName); + pat.addName().setFamily(methodName); myPatientDao.validate(pat, null, null, null, ValidationModeEnum.UPDATE, null, mySrd); pat.setId(""); @@ -224,7 +224,7 @@ public class FhirResourceDaoDstu3ValidateTest extends BaseJpaDstu3Test { Patient pat = new Patient(); pat.setId("Patient/123"); - pat.addName().addFamily(methodName); + pat.addName().setFamily(methodName); myPatientDao.validate(pat, null, null, null, ValidationModeEnum.UPDATE, null, mySrd); pat.setId(""); @@ -247,7 +247,7 @@ public class FhirResourceDaoDstu3ValidateTest extends BaseJpaDstu3Test { IIdType orgId = myOrganizationDao.create(org, mySrd).getId().toUnqualifiedVersionless(); Patient pat = new Patient(); - pat.addName().addFamily(methodName); + pat.addName().setFamily(methodName); pat.getManagingOrganization().setReference(orgId.getValue()); IIdType patId = myPatientDao.create(pat, mySrd).getId().toUnqualifiedVersionless(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSearchDaoDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSearchDaoDstu3Test.java index 56945f2d651..18c3a85c609 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSearchDaoDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSearchDaoDstu3Test.java @@ -39,8 +39,8 @@ public class FhirSearchDaoDstu3Test extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); patient.addName().addGiven("testSearchStringParamWithNonNormalized_h\u00F6ra"); - patient.addName().addFamily("AAAS"); - patient.addName().addFamily("CCC"); + patient.addName().addGiven("AAAS"); + patient.addName().addGiven("CCC"); id1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless().getIdPartAsLong(); } Long id2; @@ -48,8 +48,8 @@ public class FhirSearchDaoDstu3Test extends BaseJpaDstu3Test { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); patient.addName().addGiven("testSearchStringParamWithNonNormalized_HORA"); - patient.addName().addFamily("AAAB"); - patient.addName().addFamily("CCC"); + patient.addName().addGiven("AAAB"); + patient.addName().addGiven("CCC"); id2 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless().getIdPartAsLong(); } Long id3; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3Test.java index 50e9a737af3..1c2a2aaa388 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3Test.java @@ -168,7 +168,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { @Test public void testReindexing() { Patient p = new Patient(); - p.addName().addFamily("family"); + p.addName().setFamily("family"); final IIdType id = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); ValueSet vs = new ValueSet(); @@ -250,7 +250,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); patient.getMeta().addTag(null, "Dog", "Puppies"); patient.getMeta().getSecurity().add(new Coding().setSystem("seclabel:sys:1").setCode("seclabel:code:1").setDisplay("seclabel:dis:1")); @@ -261,7 +261,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); patient.getMeta().addTag("http://foo", "Cat", "Kittens"); patient.getMeta().getSecurity().add(new Coding().setSystem("seclabel:sys:2").setCode("seclabel:code:2").setDisplay("seclabel:dis:2")); @@ -320,7 +320,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { request.setType(BundleType.BATCH); Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.POST); request.addEntry().getRequest().setMethod(HTTPVerb.GET).setUrl("Patient/THIS_ID_DOESNT_EXIST"); @@ -525,7 +525,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.POST).setIfNoneExist("Patient?identifier=urn%3Asystem%7C" + methodName); @@ -571,7 +571,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { Bundle request = new Bundle(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.POST).setIfNoneExist("Patient?identifier=urn%3Asystem%7C" + methodName); @@ -595,7 +595,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.POST).setIfNoneExist("Patient?identifier=urn%3Asystem%7C" + methodName); @@ -636,7 +636,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.POST); @@ -775,7 +775,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.getManagingOrganization().setReference("Organization/9999999999999999"); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.POST); @@ -794,7 +794,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.getManagingOrganization().setReference("Organization/" + methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.POST); @@ -1070,7 +1070,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); Bundle request = new Bundle(); @@ -1295,7 +1295,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { Patient pat = new Patient(); pat.addIdentifier().setValue(methodName); - pat.addName().addFamily(methodName + pass); + pat.addName().setFamily(methodName + pass); req.addEntry().setResource(pat).setFullUrl(patientPlaceholderId.getValue()).getRequest().setMethod(HTTPVerb.POST).setUrl("Patient"); req.addEntry().getRequest().setMethod(HTTPVerb.DELETE).setUrl("Patient?identifier=" + methodName); @@ -1326,7 +1326,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { Bundle respGetBundle = (Bundle) resp.getEntry().get(0).getResource(); assertEquals(1, respGetBundle.getEntry().size()); - assertEquals("testTransactionOrdering" + pass, ((Patient)respGetBundle.getEntry().get(0).getResource()).getName().get(0).getFamily().get(0).getValue()); + assertEquals("testTransactionOrdering" + pass, ((Patient)respGetBundle.getEntry().get(0).getResource()).getName().get(0).getFamily()); assertThat(respGetBundle.getLink("self").getUrl(), endsWith("/Patient?identifier=testTransactionOrdering")); } @@ -1342,7 +1342,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Family Name"); + p.addName().setFamily("Family Name"); p.setId("Patient/" + methodName); IIdType idv2 = myPatientDao.update(p, mySrd).getId(); ourLog.info("Updated patient, got id: {}", idv2); @@ -1412,7 +1412,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Family Name"); + p.addName().setFamily("Family Name"); p.setId("Patient/" + methodName); IIdType idv2 = myPatientDao.update(p, mySrd).getId(); ourLog.info("Updated patient, got id: {}", idv2); @@ -1457,7 +1457,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Family Name"); + p.addName().setFamily("Family Name"); p.setId("Patient/" + methodName); IIdType idv2 = myPatientDao.update(p, mySrd).getId(); ourLog.info("Updated patient, got id: {}", idv2); @@ -1520,7 +1520,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.PUT).setUrl("Patient?identifier=urn%3Asystem%7C" + methodName); @@ -1566,7 +1566,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.PUT).setUrl("Patient?identifier=urn%3Asystem%7C" + methodName); @@ -1589,12 +1589,12 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { Bundle request = new Bundle(); Patient p = new Patient(); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); IIdType id = myPatientDao.create(p, mySrd).getId(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId(methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.PUT).setUrl("Patient?identifier=urn%3Asystem%7C" + methodName); @@ -1634,7 +1634,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("Hello"); + p.addName().setFamily("Hello"); p.setId("Patient/" + methodName); request.addEntry().setResource(p).getRequest().setMethod(HTTPVerb.PUT).setUrl("Patient/" + id.getIdPart()); @@ -1778,14 +1778,14 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest { @Test public void testTransactionWithNullReference() { Patient p = new Patient(); - p.addName().addFamily("family"); + p.addName().setFamily("family"); final IIdType id = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); Bundle inputBundle = new Bundle(); //@formatter:off Patient app0 = new Patient(); - app0.addName().addFamily("NEW PATIENT"); + app0.addName().setFamily("NEW PATIENT"); String placeholderId0 = IdDt.newRandomUuid().getValue(); inputBundle .addEntry() diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/AuthorizationInterceptorResourceProviderDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/AuthorizationInterceptorResourceProviderDstu3Test.java index 1800a56defc..6b44b384562 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/AuthorizationInterceptorResourceProviderDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/AuthorizationInterceptorResourceProviderDstu3Test.java @@ -61,7 +61,7 @@ public class AuthorizationInterceptorResourceProviderDstu3Test extends BaseResou Patient patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); - patient.addName().addFamily("Tester").addGiven("Raghad"); + patient.addName().setFamily("Tester").addGiven("Raghad"); final MethodOutcome output1 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) { @@ -79,14 +79,14 @@ public class AuthorizationInterceptorResourceProviderDstu3Test extends BaseResou patient = new Patient(); patient.setId(output1.getId().toUnqualifiedVersionless()); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); - patient.addName().addFamily("Tester").addGiven("Raghad"); + patient.addName().setFamily("Tester").addGiven("Raghad"); MethodOutcome output2 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); assertEquals(output1.getId().getIdPart(), output2.getId().getIdPart()); patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); - patient.addName().addFamily("Tester").addGiven("Raghad"); + patient.addName().setFamily("Tester").addGiven("Raghad"); try { ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|101").execute(); fail(); @@ -97,7 +97,7 @@ public class AuthorizationInterceptorResourceProviderDstu3Test extends BaseResou patient = new Patient(); patient.setId("999"); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); - patient.addName().addFamily("Tester").addGiven("Raghad"); + patient.addName().setFamily("Tester").addGiven("Raghad"); try { ourClient.update().resource(patient).execute(); fail(); @@ -112,7 +112,7 @@ public class AuthorizationInterceptorResourceProviderDstu3Test extends BaseResou String methodName = "testDeleteResourceConditional"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPost post = new HttpPost(ourServerBase + "/Patient"); @@ -129,7 +129,7 @@ public class AuthorizationInterceptorResourceProviderDstu3Test extends BaseResou } pt = new Patient(); - pt.addName().addFamily("FOOFOOFOO"); + pt.addName().setFamily("FOOFOOFOO"); resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); post = new HttpPost(ourServerBase + "/Patient"); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/BaseResourceProviderDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/BaseResourceProviderDstu3Test.java index c857ca21f28..39dcb8e65f9 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/BaseResourceProviderDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/BaseResourceProviderDstu3Test.java @@ -152,7 +152,7 @@ public abstract class BaseResourceProviderDstu3Test extends BaseJpaDstu3Test { List names = new ArrayList(); for (BundleEntryComponent next : resp.getEntry()) { Patient nextPt = (Patient) next.getResource(); - String nextStr = nextPt.getName().size() > 0 ? nextPt.getName().get(0).getGivenAsSingleString() + " " + nextPt.getName().get(0).getFamilyAsSingleString() : ""; + String nextStr = nextPt.getName().size() > 0 ? nextPt.getName().get(0).getGivenAsSingleString() + " " + nextPt.getName().get(0).getFamily() : ""; if (isNotBlank(nextStr)) { names.add(nextStr); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java index 93024629c4a..689390b2987 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java @@ -407,13 +407,13 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { public void testCreateConditional() { Patient patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); - patient.addName().addFamily("Tester").addGiven("Raghad"); + patient.addName().setFamily("Tester").addGiven("Raghad"); MethodOutcome output1 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); - patient.addName().addFamily("Tester").addGiven("Raghad"); + patient.addName().setFamily("Tester").addGiven("Raghad"); MethodOutcome output2 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); @@ -463,7 +463,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testCreateResourceConditional"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPost post = new HttpPost(ourServerBase + "/Patient"); @@ -584,7 +584,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testCreateWithForcedId"; Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); p.setId(methodName); IIdType optId = ourClient.update().resource(p).execute().getId(); @@ -635,12 +635,12 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("FAM1"); + p.addName().setFamily("FAM1"); IIdType id1 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addFamily("FAM2"); + p.addName().setFamily("FAM2"); IIdType id2 = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); try { @@ -728,7 +728,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { @Test public void testDeleteNormal() throws IOException { Patient p = new Patient(); - p.addName().addFamily("FAM"); + p.addName().setFamily("FAM"); IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); ourClient.read().resource(Patient.class).withId(id).execute(); @@ -748,7 +748,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testDeleteResourceConditional1"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPost post = new HttpPost(ourServerBase + "/Patient"); @@ -791,7 +791,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testDeleteResourceConditional2"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); pt.addIdentifier().setSystem("http://ghh.org/patient").setValue(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); @@ -938,7 +938,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { IIdType orgId1 = ourClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); p.getManagingOrganization().setReferenceElement(orgId1); IIdType patientId = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); @@ -1002,7 +1002,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { IIdType orgId1 = ourClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); p.getManagingOrganization().setReferenceElement(orgId1); IIdType patientId = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); @@ -1050,11 +1050,11 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { @Test public void testEverythingInstanceWithContentFilter() { Patient pt1 = new Patient(); - pt1.addName().addFamily("Everything").addGiven("Arthur"); + pt1.addName().setFamily("Everything").addGiven("Arthur"); IIdType ptId1 = myPatientDao.create(pt1, mySrd).getId().toUnqualifiedVersionless(); Patient pt2 = new Patient(); - pt2.addName().addFamily("Everything").addGiven("Arthur"); + pt2.addName().setFamily("Everything").addGiven("Arthur"); IIdType ptId2 = myPatientDao.create(pt2, mySrd).getId().toUnqualifiedVersionless(); Device dev1 = new Device(); @@ -1270,7 +1270,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { IIdType orgId1 = ourClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); p.getManagingOrganization().setReferenceElement(orgId1); IIdType patientId = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); @@ -1312,11 +1312,11 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { IIdType o2Id = ourClient.create().resource(o2).execute().getId().toUnqualifiedVersionless(); Patient p1 = new Patient(); - p1.addName().addFamily(methodName + "1"); + p1.addName().setFamily(methodName + "1"); p1.getManagingOrganization().setReferenceElement(o1Id); IIdType p1Id = ourClient.create().resource(p1).execute().getId().toUnqualifiedVersionless(); Patient p2 = new Patient(); - p2.addName().addFamily(methodName + "2"); + p2.addName().setFamily(methodName + "2"); p2.getManagingOrganization().setReferenceElement(o2Id); IIdType p2Id = ourClient.create().resource(p2).execute().getId().toUnqualifiedVersionless(); @@ -1354,7 +1354,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Thread.sleep(10); Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); p.getManagingOrganization().setReferenceElement(oId); IIdType pId = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); @@ -1559,7 +1559,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testMetaOperations"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); ourClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); HttpGet get = new HttpGet(ourServerBase + "/$get-resource-counts"); @@ -1581,13 +1581,13 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); pid0 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily("Tester").addGiven("Joe"); + patient.addName().setFamily("Tester").addGiven("Joe"); myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } { @@ -1632,7 +1632,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testHistoryWithFromAndTo"; Patient patient = new Patient(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); IIdType id = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); List preDates = Lists.newArrayList(); @@ -1642,7 +1642,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { preDates.add(new Date()); Thread.sleep(100); patient.setId(id); - patient.getName().get(0).getFamily().get(0).setValue(methodName + "_i"); + patient.getName().get(0).getFamilyElement().setValue(methodName + "_i"); ids.add(myPatientDao.update(patient, mySrd).getId().toUnqualified().getValue()); } @@ -1675,7 +1675,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testHistoryWithDeletedResource"; Patient patient = new Patient(); - patient.addName().addFamily(methodName); + patient.addName().setFamily(methodName); IIdType id = ourClient.create().resource(patient).execute().getId().toVersionless(); ourClient.delete().resourceById(id).execute(); patient.setId(id); @@ -1708,7 +1708,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient pt = new Patient(); pt.setId("Patient/AAA/_history/4"); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt); ourLog.info("Input: {}", resource); @@ -1750,7 +1750,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient pt = new Patient(); pt.setId("Patient/AAA/_history/4"); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt); ourLog.info("Input: {}", resource); @@ -1857,7 +1857,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testMetaOperations"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); IIdType id = ourClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); Meta meta = ourClient.meta().get(Meta.class).fromResource(id).execute(); @@ -1878,7 +1878,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { @Test public void testMetaOperationWithNoMetaParameter() throws Exception { Patient p = new Patient(); - p.addName().addFamily("testMetaAddInvalid"); + p.addName().setFamily("testMetaAddInvalid"); IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); //@formatter:off @@ -1927,7 +1927,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient patient = new Patient(); patient.setActive(true); patient.addIdentifier().setSystem("urn:system").setValue("0"); - patient.addName().addFamily(methodName).addGiven("Joe"); + patient.addName().setFamily(methodName).addGiven("Joe"); pid1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -1957,7 +1957,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient patient = new Patient(); patient.setActive(true); patient.addIdentifier().setSystem("urn:system").setValue("0"); - patient.addName().addFamily(methodName).addGiven("Joe"); + patient.addName().setFamily(methodName).addGiven("Joe"); pid1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -1988,7 +1988,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient patient = new Patient(); patient.setActive(true); patient.addIdentifier().setSystem("urn:system").setValue("0"); - patient.addName().addFamily(methodName).addGiven("Joe"); + patient.addName().setFamily(methodName).addGiven("Joe"); pid1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -2019,7 +2019,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient patient = new Patient(); patient.setActive(true); patient.addIdentifier().setSystem("urn:system").setValue("0"); - patient.addName().addFamily(methodName).addGiven("Joe"); + patient.addName().setFamily(methodName).addGiven("Joe"); pid1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -2190,7 +2190,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { public void testSearchByExtendedChars() throws Exception { for (int i = 0; i < 10; i++) { Patient p = new Patient(); - p.addName().addFamily("Jernelöv"); + p.addName().setFamily("Jernelöv"); p.addIdentifier().setValue("ID" + i); myPatientDao.create(p, mySrd); } @@ -2209,7 +2209,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { assertEquals("http://localhost:" + ourPort + "/fhir/context/Patient?_count=5&_pretty=true&name=Jernel%C3%B6v", b.getLink("self").getUrl()); Patient p = (Patient) b.getEntry().get(0).getResource(); - assertEquals("Jernelöv", p.getName().get(0).getFamily().get(0).getValue()); + assertEquals("Jernelöv", p.getName().get(0).getFamily()); } finally { IOUtils.closeQuietly(resp.getEntity().getContent()); @@ -2221,12 +2221,12 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { public void testSearchByIdentifier() { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier01"); - p1.addName().addFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01"); + p1.addName().setFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01"); IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId(); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier02"); - p2.addName().addFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven02"); + p2.addName().setFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven02"); ourClient.create().resource(p2).execute().getId(); //@formatter:off @@ -2307,13 +2307,13 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByReferenceIds01"); - p1.addName().addFamily("testSearchByReferenceIdsFamily01").addGiven("testSearchByReferenceIdsGiven01"); + p1.addName().setFamily("testSearchByReferenceIdsFamily01").addGiven("testSearchByReferenceIdsGiven01"); p1.setManagingOrganization(new Reference(o1id.toUnqualifiedVersionless())); IIdType p1Id = ourClient.create().resource(p1).execute().getId(); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testSearchByReferenceIds02"); - p2.addName().addFamily("testSearchByReferenceIdsFamily02").addGiven("testSearchByReferenceIdsGiven02"); + p2.addName().setFamily("testSearchByReferenceIdsFamily02").addGiven("testSearchByReferenceIdsGiven02"); p2.setManagingOrganization(new Reference(o2id.toUnqualifiedVersionless())); IIdType p2Id = ourClient.create().resource(p2).execute().getId(); @@ -2342,7 +2342,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); - p1.addName().addFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01"); + p1.addName().setFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01"); p1.setManagingOrganization(new Reference(o1id.toUnqualifiedVersionless())); IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId(); @@ -2378,14 +2378,14 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); - patient.addName().addFamily(methodName).addGiven("Joe"); + patient.addName().setFamily(methodName).addGiven("Joe"); id1a = (IdType) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } IIdType id1b; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily(methodName + "XXXX").addGiven("Joe"); + patient.addName().setFamily(methodName + "XXXX").addGiven("Joe"); id1b = (IdType) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } @@ -2397,7 +2397,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); - patient.addName().addFamily(methodName).addGiven("John"); + patient.addName().setFamily(methodName).addGiven("John"); id2 = (IdType) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } @@ -2498,14 +2498,14 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("0"); - patient.addName().addFamily(methodName).addGiven("Joe"); + patient.addName().setFamily(methodName).addGiven("Joe"); pid1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } for (int i = 1; i <= 20; i++) { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(Integer.toString(i)); - patient.addName().addFamily(methodName).addGiven("Joe"); + patient.addName().setFamily(methodName).addGiven("Joe"); myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); } @@ -2572,7 +2572,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { public void testSearchThenTagThenSearch() { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system2").setValue("testSearchTokenParam002"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam2"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam2"); ourClient.create().resource(patient).execute(); //@formatter:off @@ -2610,19 +2610,19 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { public void testSearchTokenParamNoValue() { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testSearchTokenParam001"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam1"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam1"); patient.addCommunication().getLanguage().setText("testSearchTokenParamComText").addCoding().setCode("testSearchTokenParamCode").setSystem("testSearchTokenParamSystem") .setDisplay("testSearchTokenParamDisplay"); myPatientDao.create(patient, mySrd); patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testSearchTokenParam002"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam2"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam2"); myPatientDao.create(patient, mySrd); patient = new Patient(); patient.addIdentifier().setSystem("urn:system2").setValue("testSearchTokenParam002"); - patient.addName().addFamily("Tester").addGiven("testSearchTokenParam2"); + patient.addName().setFamily("Tester").addGiven("testSearchTokenParam2"); myPatientDao.create(patient, mySrd); //@formatter:off @@ -2809,7 +2809,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { public void testSearchWithMixedParams() throws Exception { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("0"); - patient.addName().addFamily("testSearchWithMixedParams").addGiven("Joe"); + patient.addName().setFamily("testSearchWithMixedParams").addGiven("Joe"); myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); HttpPost httpPost = new HttpPost(ourServerBase + "/Patient/_search?_format=application/xml"); @@ -2859,82 +2859,82 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Daniel").addFamily("Adams"); + p.addName().addGiven("Daniel").setFamily("Adams"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Aaron").addFamily("Alexis"); + p.addName().addGiven("Aaron").setFamily("Alexis"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Carol").addFamily("Allen"); + p.addName().addGiven("Carol").setFamily("Allen"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Ruth").addFamily("Black"); + p.addName().addGiven("Ruth").setFamily("Black"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Brian").addFamily("Brooks"); + p.addName().addGiven("Brian").setFamily("Brooks"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Susan").addFamily("Clark"); + p.addName().addGiven("Susan").setFamily("Clark"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Amy").addFamily("Clark"); + p.addName().addGiven("Amy").setFamily("Clark"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Anthony").addFamily("Coleman"); + p.addName().addGiven("Anthony").setFamily("Coleman"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Steven").addFamily("Coleman"); + p.addName().addGiven("Steven").setFamily("Coleman"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Lisa").addFamily("Coleman"); + p.addName().addGiven("Lisa").setFamily("Coleman"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Ruth").addFamily("Cook"); + p.addName().addGiven("Ruth").setFamily("Cook"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Betty").addFamily("Davis"); + p.addName().addGiven("Betty").setFamily("Davis"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Joshua").addFamily("Diaz"); + p.addName().addGiven("Joshua").setFamily("Diaz"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Brian").addFamily("Gracia"); + p.addName().addGiven("Brian").setFamily("Gracia"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Stephan").addFamily("Graham"); + p.addName().addGiven("Stephan").setFamily("Graham"); ourClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - p.addName().addGiven("Sarah").addFamily("Graham"); + p.addName().addGiven("Sarah").setFamily("Graham"); ourClient.create().resource(p).execute(); //@formatter:off @@ -3020,7 +3020,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { public void testTryToCreateResourceWithReferenceThatDoesntExist() { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testTryToCreateResourceWithReferenceThatDoesntExist01"); - p1.addName().addFamily("testTryToCreateResourceWithReferenceThatDoesntExistFamily01").addGiven("testTryToCreateResourceWithReferenceThatDoesntExistGiven01"); + p1.addName().setFamily("testTryToCreateResourceWithReferenceThatDoesntExistFamily01").addGiven("testTryToCreateResourceWithReferenceThatDoesntExistGiven01"); p1.setManagingOrganization(new Reference("Organization/99999999999")); try { @@ -3037,7 +3037,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testUpdateInvalidReference"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPut post = new HttpPut(ourServerBase + "/Patient"); @@ -3060,7 +3060,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient pt = new Patient(); pt.setId("2"); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPut post = new HttpPut(ourServerBase + "/Patient"); @@ -3086,7 +3086,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testUpdateNoIdInBody"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPut post = new HttpPut(ourServerBase + "/Patient/FOO"); @@ -3108,7 +3108,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); - p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); + p1.addName().setFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); IdType p1id = (IdType) ourClient.create().resource(p1).execute().getId(); // Try to update with the wrong ID in the resource body @@ -3167,7 +3167,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); - p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); + p1.addName().setFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); IdType p1id = (IdType) ourClient.create().resource(p1).execute().getId(); Organization p2 = new Organization(); @@ -3194,7 +3194,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testUpdateResourceConditional"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPost post = new HttpPost(ourServerBase + "/Patient?name=" + methodName); @@ -3245,7 +3245,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { response.close(); } - pt.addName().addFamily("FOO"); + pt.addName().setFamily("FOO"); resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPut put = new HttpPut(ourServerBase + "/Patient?identifier=" + ("http://general-hospital.co.uk/Identifiers|09832345234543876876".replace("|", UrlUtil.escape("|")))); put.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); @@ -3271,7 +3271,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testUpdateResourceWithPrefer"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPost post = new HttpPost(ourServerBase + "/Patient"); @@ -3347,10 +3347,10 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testUpdateWithETag"; Patient pt = new Patient(); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); IIdType id = ourClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); - pt.addName().addFamily("FAM2"); + pt.addName().setFamily("FAM2"); pt.setId(id.toUnqualifiedVersionless()); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); @@ -3389,7 +3389,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { Patient pt = new Patient(); pt.setId("333"); - pt.addName().addFamily(methodName); + pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); HttpPut post = new HttpPut(ourServerBase + "/Patient/A2"); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderQuestionnaireResponseDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderQuestionnaireResponseDstu3Test.java index 9d29126d2f6..b62fdd2b2a3 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderQuestionnaireResponseDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderQuestionnaireResponseDstu3Test.java @@ -68,7 +68,7 @@ public class ResourceProviderQuestionnaireResponseDstu3Test extends BaseResource @Test public void testCreateWithLocalReference() { Patient pt1 = new Patient(); - pt1.addName().addFamily("Everything").addGiven("Arthur"); + pt1.addName().setFamily("Everything").addGiven("Arthur"); IIdType ptId1 = myPatientDao.create(pt1, mySrd).getId().toUnqualifiedVersionless(); Questionnaire q1 = new Questionnaire(); @@ -91,7 +91,7 @@ public class ResourceProviderQuestionnaireResponseDstu3Test extends BaseResource @Test public void testCreateWithAbsoluteReference() { Patient pt1 = new Patient(); - pt1.addName().addFamily("Everything").addGiven("Arthur"); + pt1.addName().setFamily("Everything").addGiven("Arthur"); IIdType ptId1 = myPatientDao.create(pt1, mySrd).getId().toUnqualifiedVersionless(); Questionnaire q1 = new Questionnaire(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/StaleSearchDeletingSvcDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/StaleSearchDeletingSvcDstu3Test.java index 32d18c7649b..05196ad1ce6 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/StaleSearchDeletingSvcDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/StaleSearchDeletingSvcDstu3Test.java @@ -43,7 +43,7 @@ public class StaleSearchDeletingSvcDstu3Test extends BaseResourceProviderDstu3Te for (int i = 0; i < 20; i++) { Patient pt1 = new Patient(); - pt1.addName().addFamily("Everything").addGiven("Arthur"); + pt1.addName().setFamily("Everything").addGiven("Arthur"); myPatientDao.create(pt1, mySrd).getId().toUnqualifiedVersionless(); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SubscriptionsDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SubscriptionsDstu3Test.java index 4b96b49002e..a8ff0d1da63 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SubscriptionsDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SubscriptionsDstu3Test.java @@ -168,7 +168,7 @@ public class SubscriptionsDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testSubscriptionDynamic"; Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType pId = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); String criteria = "Observation?subject=Patient/" + pId.getIdPart(); @@ -233,7 +233,7 @@ public class SubscriptionsDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testSubscriptionDynamic"; Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType pId = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); String criteria = "Observation?subject=Patient/" + pId.getIdPart() + "&_format=xml"; @@ -298,7 +298,7 @@ public class SubscriptionsDstu3Test extends BaseResourceProviderDstu3Test { String methodName = "testSubscriptionResourcesAppear"; Patient p = new Patient(); - p.addName().addFamily(methodName); + p.addName().setFamily(methodName); IIdType pId = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); Subscription subs = new Subscription(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SystemProviderDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SystemProviderDstu3Test.java index 3ad6f6b286e..0113780710d 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SystemProviderDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SystemProviderDstu3Test.java @@ -85,7 +85,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test { myDaoConfig.setAllowInlineMatchUrlReferences(true); Patient p = new Patient(); - p.addName().addFamily("van de Heuvelcx85ioqWJbI").addGiven("Pietercx85ioqWJbI"); + p.addName().setFamily("van de Heuvelcx85ioqWJbI").addGiven("Pietercx85ioqWJbI"); myPatientDao.create(p, mySrd); Organization o = new Organization(); @@ -144,7 +144,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test { myDaoConfig.setAllowInlineMatchUrlReferences(true); Patient p = new Patient(); - p.addName().addFamily("van de Heuvelcx85ioqWJbI").addGiven("Pietercx85ioqWJbI"); + p.addName().setFamily("van de Heuvelcx85ioqWJbI").addGiven("Pietercx85ioqWJbI"); IIdType id = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); ourClient.read().resource(Patient.class).withId(id); @@ -304,7 +304,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test { for (int i = 0; i < 11; i++) { Patient p = new Patient(); - p.addName().addFamily("Name" + i); + p.addName().setFamily("Name" + i); ourClient.create().resource(p).execute(); } @@ -333,7 +333,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test { for (int i = 0; i < 11; i++) { Patient p = new Patient(); - p.addName().addFamily("Name" + i); + p.addName().setFamily("Name" + i); ourClient.create().resource(p).execute(); } @@ -385,7 +385,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test { public void testSuggestKeywords() throws Exception { Patient patient = new Patient(); - patient.addName().addFamily("testSuggest"); + patient.addName().setFamily("testSuggest"); IIdType ptId = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); Observation obs = new Observation(); @@ -421,7 +421,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test { @Test public void testSuggestKeywordsInvalid() throws Exception { Patient patient = new Patient(); - patient.addName().addFamily("testSuggest"); + patient.addName().setFamily("testSuggest"); IIdType ptId = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); Observation obs = new Observation(); @@ -591,7 +591,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test { public void testTransactionSearch() throws Exception { for (int i = 0; i < 20; i++) { Patient p = new Patient(); - p.addName().addFamily("PATIENT_" + i); + p.addName().setFamily("PATIENT_" + i); myPatientDao.create(p, mySrd); } @@ -615,7 +615,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test { public void testTransactionCount() throws Exception { for (int i = 0; i < 20; i++) { Patient p = new Patient(); - p.addName().addFamily("PATIENT_" + i); + p.addName().setFamily("PATIENT_" + i); myPatientDao.create(p, mySrd); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplTest.java index 740f763399b..1ad8c0b2818 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplTest.java @@ -107,21 +107,21 @@ public class TerminologySvcImplTest extends BaseJpaDstu3Test { List concepts; Set codes; - concepts = myTermSvc.findCodesBelow("http://hl7.org/fhir/allergy-intolerance-status", "active"); + concepts = myTermSvc.findCodesBelow("http://hl7.org/fhir/allergy-clinical-status", "inactive"); codes = toCodes(concepts); - assertThat(codes, containsInAnyOrder("active", "active-confirmed")); + assertThat(codes, containsInAnyOrder("inactive", "resolved")); - concepts = myTermSvc.findCodesBelow("http://hl7.org/fhir/allergy-intolerance-status", "active-confirmed"); + concepts = myTermSvc.findCodesBelow("http://hl7.org/fhir/allergy-clinical-status", "resolved"); codes = toCodes(concepts); - assertThat(codes, containsInAnyOrder("active-confirmed")); + assertThat(codes, containsInAnyOrder("resolved")); // Unknown code - concepts = myTermSvc.findCodesBelow("http://hl7.org/fhir/allergy-intolerance-status", "FOO"); + concepts = myTermSvc.findCodesBelow("http://hl7.org/fhir/allergy-clinical-status", "FOO"); codes = toCodes(concepts); assertThat(codes, empty()); // Unknown system - concepts = myTermSvc.findCodesBelow("http://hl7.org/fhir/allergy-intolerance-status2222", "FOO"); + concepts = myTermSvc.findCodesBelow("http://hl7.org/fhir/allergy-clinical-status2222", "active"); codes = toCodes(concepts); assertThat(codes, empty()); } @@ -131,21 +131,21 @@ public class TerminologySvcImplTest extends BaseJpaDstu3Test { List concepts; Set codes; - concepts = myTermSvc.findCodesAbove("http://hl7.org/fhir/allergy-intolerance-status", "active"); + concepts = myTermSvc.findCodesAbove("http://hl7.org/fhir/allergy-clinical-status", "active"); codes = toCodes(concepts); assertThat(codes, containsInAnyOrder("active")); - concepts = myTermSvc.findCodesAbove("http://hl7.org/fhir/allergy-intolerance-status", "active-confirmed"); + concepts = myTermSvc.findCodesAbove("http://hl7.org/fhir/allergy-clinical-status", "resolved"); codes = toCodes(concepts); - assertThat(codes, containsInAnyOrder("active", "active-confirmed")); + assertThat(codes, containsInAnyOrder("inactive", "resolved")); // Unknown code - concepts = myTermSvc.findCodesAbove("http://hl7.org/fhir/allergy-intolerance-status", "FOO"); + concepts = myTermSvc.findCodesAbove("http://hl7.org/fhir/allergy-clinical-status", "FOO"); codes = toCodes(concepts); assertThat(codes, empty()); // Unknown system - concepts = myTermSvc.findCodesAbove("http://hl7.org/fhir/allergy-intolerance-status2222", "FOO"); + concepts = myTermSvc.findCodesAbove("http://hl7.org/fhir/allergy-clinical-status2222", "active"); codes = toCodes(concepts); assertThat(codes, empty()); } diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/java/ca/uhn/fhirtest/UhnFhirTestApp.java b/hapi-fhir-jpaserver-uhnfhirtest/src/test/java/ca/uhn/fhirtest/UhnFhirTestApp.java index e36e1dd2a03..d412915a8d8 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/src/test/java/ca/uhn/fhirtest/UhnFhirTestApp.java +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/java/ca/uhn/fhirtest/UhnFhirTestApp.java @@ -75,7 +75,7 @@ public class UhnFhirTestApp { Patient p1 = new Patient(); p1.getMeta().addTag("http://hl7.org/fhir/tag", "urn:happytag", "This is a happy resource"); p1.addIdentifier().setSystem("foo:bar").setValue("12345"); - p1.addName().addFamily("Smith").addGiven("John"); + p1.addName().setFamily("Smith").addGiven("John"); p1.getManagingOrganization().setReferenceElement(orgId.toUnqualifiedVersionless()); Subscription subs = new Subscription(); diff --git a/hapi-fhir-structures-dstu2.1/.classpath b/hapi-fhir-structures-dstu2.1/.classpath new file mode 100644 index 00000000000..e55bfdf665c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/.classpath @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-structures-dstu2.1/.gitignore b/hapi-fhir-structures-dstu2.1/.gitignore new file mode 100644 index 00000000000..84c048a73cc --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/hapi-fhir-structures-dstu2.1/.project b/hapi-fhir-structures-dstu2.1/.project new file mode 100644 index 00000000000..702936ef90f --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/.project @@ -0,0 +1,29 @@ + + + hapi-fhir-structures-dstu2.1 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + + diff --git a/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.m2e.core.prefs b/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.wst.common.project.facet.core.xml b/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000000..f4ef8aa0a5c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hapi-fhir-structures-dstu2.1/pom.xml b/hapi-fhir-structures-dstu2.1/pom.xml new file mode 100644 index 00000000000..e3e5a1708de --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/pom.xml @@ -0,0 +1,227 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-deployable-pom + 2.2-SNAPSHOT + ../hapi-deployable-pom/pom.xml + + + hapi-fhir-structures-dstu2.1 + jar + + HAPI FHIR Structures - DSTU2.1 (2016May) + + + + ca.uhn.hapi.fhir + hapi-fhir-base + 2.2-SNAPSHOT + + + + + + + javax.servlet + servlet-api + 2.5 + provided + + + + commons-codec + commons-codec + + + + xpp3 + xpp3_min + 1.1.4c + + + + + + + xmlunit + xmlunit + test + + + org.eclipse.jetty + jetty-servlets + test + + + org.eclipse.jetty + jetty-servlet + test + + + org.eclipse.jetty + jetty-server + test + + + org.eclipse.jetty + jetty-util + test + + + org.eclipse.jetty + jetty-webapp + test + + + org.eclipse.jetty + jetty-http + test + + + ch.qos.logback + logback-classic + true + test + + + org.thymeleaf + thymeleaf + test + + + com.phloc + phloc-schematron + test + + + com.phloc + phloc-commons + test + + + + + + net.sf.json-lib + json-lib + jdk15 + test + + + commons-logging + commons-logging + + + + + net.sf.json-lib + json-lib + jdk15-sources + test + + + directory-naming + naming-java + test + + + commons-logging + commons-logging + + + + + com.google.guava + guava + test + + + + org.springframework + spring-web + test + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + public + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + ${basedir}/target/classes + ${basedir}/../hapi-fhir-base/target/classes + + + ${basedir}/src/main/java + ${basedir}/../hapi-fhir-base/src/main/java + + true + + + + default-prepare-agent + + prepare-agent + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${argLine} -Dfile.encoding=UTF-8 -Xmx712m + + + + org.codehaus.mojo + license-maven-plugin + + + true + + + + org.apache.maven.plugins + maven-compiler-plugin + + true + + + + + + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/ctx/FhirDstu2_1.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/ctx/FhirDstu2_1.java new file mode 100644 index 00000000000..b351586e2aa --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/ctx/FhirDstu2_1.java @@ -0,0 +1,152 @@ +package org.hl7.fhir.dstu2016may.hapi.ctx; + +/* + * #%L + * HAPI FHIR Structures - DSTU2 (FHIR v1.0.0) + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.io.InputStream; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.dstu2016may.hapi.rest.server.Dstu2_1BundleFactory; +import org.hl7.fhir.dstu2016may.hapi.rest.server.ServerConformanceProvider; +import org.hl7.fhir.dstu2016may.hapi.rest.server.ServerProfileProvider; +import org.hl7.fhir.dstu2016may.model.Coding; +import org.hl7.fhir.dstu2016may.model.Constants; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Reference; +import org.hl7.fhir.dstu2016may.model.Resource; +import org.hl7.fhir.dstu2016may.model.StructureDefinition; +import org.hl7.fhir.instance.model.api.IBaseCoding; +import org.hl7.fhir.instance.model.api.IBaseReference; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; + +import ca.uhn.fhir.context.ConfigurationException; +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.context.support.IContextValidationSupport; +import ca.uhn.fhir.fluentpath.IFluentPath; +import ca.uhn.fhir.model.api.IFhirVersion; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.server.IResourceProvider; +import ca.uhn.fhir.rest.server.IVersionSpecificBundleFactory; +import ca.uhn.fhir.rest.server.RestfulServer; + +public class FhirDstu2_1 implements IFhirVersion { + + private String myId; + + @Override + public IFluentPath createFluentPathExecutor(FhirContext theFhirContext) { + throw new UnsupportedOperationException("FluentPath is not supported in DSTU2 contexts"); + } + + @Override + public ServerConformanceProvider createServerConformanceProvider(RestfulServer theServer) { + return new ServerConformanceProvider(theServer); + } + + @Override + public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { + return new ServerProfileProvider(theRestfulServer); + } + + @Override + public IContextValidationSupport createValidationSupport() { + throw new UnsupportedOperationException("Validation is not supported in DSTU2.1 contexts"); + } + + @Override + public IBaseResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase) { + StructureDefinition retVal = new StructureDefinition(); + + RuntimeResourceDefinition def = theRuntimeResourceDefinition; + + myId = def.getId(); + if (StringUtils.isBlank(myId)) { + myId = theRuntimeResourceDefinition.getName().toLowerCase(); + } + + retVal.setId(new IdDt(myId)); + return retVal; + } + + @SuppressWarnings("rawtypes") + @Override + public Class getContainedType() { + return List.class; + } + + @Override + public InputStream getFhirVersionPropertiesFile() { + InputStream str = FhirDstu2_1.class.getResourceAsStream("/org/hl7/fhir/dstu2016may/model/fhirversion.properties"); + if (str == null) { + str = FhirDstu2_1.class.getResourceAsStream("/org/hl7/fhir/dstu2016may/model/fhirversion.properties"); + } + if (str == null) { + throw new ConfigurationException("Can not find model property file on classpath: " + "/ca/uhn/fhir/model/dstu2016may/fhirversion.properties"); + } + return str; + } + + @Override + public IPrimitiveType getLastUpdated(IBaseResource theResource) { + return ((Resource) theResource).getMeta().getLastUpdatedElement(); + } + + @Override + public String getPathToSchemaDefinitions() { + return "/org/hl7/fhir/instance/model/dstu3/schema"; + } + + @Override + public Class getResourceReferenceType() { + return Reference.class; + } + + @Override + public FhirVersionEnum getVersion() { + return FhirVersionEnum.DSTU2_1; + } + + @Override + public String getVersionString() { + return Constants.VERSION; + } + + @Override + public IVersionSpecificBundleFactory newBundleFactory(FhirContext theContext) { + return new Dstu2_1BundleFactory(theContext); + } + + @Override + public IBaseCoding newCodingDt() { + return new Coding(); + } + + @Override + public IIdType newIdType() { + return new IdType(); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/Dstu2_1BundleFactory.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/Dstu2_1BundleFactory.java new file mode 100644 index 00000000000..4d62006fce5 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/Dstu2_1BundleFactory.java @@ -0,0 +1,449 @@ +package org.hl7.fhir.dstu2016may.hapi.rest.server; + +/* + * #%L + * HAPI FHIR Structures - DSTU2 (FHIR v1.0.0) + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +import static org.apache.commons.lang3.StringUtils.isNotBlank; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import org.apache.commons.lang3.Validate; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent; +import org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb; +import org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode; +import org.hl7.fhir.dstu2016may.model.DomainResource; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Resource; +import org.hl7.fhir.instance.model.api.IAnyResource; +import org.hl7.fhir.instance.model.api.IBaseReference; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.Include; +import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import ca.uhn.fhir.model.valueset.BundleTypeEnum; +import ca.uhn.fhir.rest.server.BundleInclusionRule; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.rest.server.EncodingEnum; +import ca.uhn.fhir.rest.server.IBundleProvider; +import ca.uhn.fhir.rest.server.IPagingProvider; +import ca.uhn.fhir.rest.server.IRestfulServer; +import ca.uhn.fhir.rest.server.IVersionSpecificBundleFactory; +import ca.uhn.fhir.rest.server.RestfulServerUtils; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.util.ResourceReferenceInfo; + +public class Dstu2_1BundleFactory implements IVersionSpecificBundleFactory { + + private Bundle myBundle; + private FhirContext myContext; + private String myBase; + + public Dstu2_1BundleFactory(FhirContext theContext) { + myContext = theContext; + } + + private void addResourcesForSearch(List theResult) { + List includedResources = new ArrayList(); + Set addedResourceIds = new HashSet(); + + for (IBaseResource next : theResult) { + if (next.getIdElement().isEmpty() == false) { + addedResourceIds.add(next.getIdElement()); + } + } + + for (IBaseResource nextBaseRes : theResult) { + Resource next = (Resource) nextBaseRes; + Set containedIds = new HashSet(); + if (next instanceof DomainResource) { + for (Resource nextContained : ((DomainResource)next).getContained()) { + if (nextContained.getIdElement().isEmpty() == false) { + containedIds.add(nextContained.getIdElement().getValue()); + } + } + } + + List references = myContext.newTerser().getAllPopulatedChildElementsOfType(next, IBaseReference.class); + do { + List addedResourcesThisPass = new ArrayList(); + + for (IBaseReference nextRef : references) { + IAnyResource nextRes = (IAnyResource) nextRef.getResource(); + if (nextRes != null) { + if (nextRes.getIdElement().hasIdPart()) { + if (containedIds.contains(nextRes.getIdElement().getValue())) { + // Don't add contained IDs as top level resources + continue; + } + + IIdType id = nextRes.getIdElement(); + if (id.hasResourceType() == false) { + String resName = myContext.getResourceDefinition(nextRes).getName(); + id = id.withResourceType(resName); + } + + if (!addedResourceIds.contains(id)) { + addedResourceIds.add(id); + addedResourcesThisPass.add(nextRes); + } + + } + } + } + + // Linked resources may themselves have linked resources + references = new ArrayList(); + for (IAnyResource iResource : addedResourcesThisPass) { + List newReferences = myContext.newTerser().getAllPopulatedChildElementsOfType(iResource, IBaseReference.class); + references.addAll(newReferences); + } + + includedResources.addAll(addedResourcesThisPass); + + } while (references.isEmpty() == false); + + BundleEntryComponent entry = myBundle.addEntry().setResource(next); + if (next.getIdElement().hasBaseUrl()) { + entry.setFullUrl(next.getId()); + } + + String httpVerb = ResourceMetadataKeyEnum.ENTRY_TRANSACTION_METHOD.get(next); + if (httpVerb != null) { + entry.getRequest().getMethodElement().setValueAsString(httpVerb); + entry.getRequest().getUrlElement().setValue(next.getId()); + } + } + + /* + * Actually add the resources to the bundle + */ + for (IBaseResource next : includedResources) { + BundleEntryComponent entry = myBundle.addEntry(); + entry.setResource((Resource) next).getSearch().setMode(SearchEntryMode.INCLUDE); + if (next.getIdElement().hasBaseUrl()) { + entry.setFullUrl(next.getIdElement().getValue()); + } + } + } + + @Override + public void addResourcesToBundle(List theResult, BundleTypeEnum theBundleType, String theServerBase, BundleInclusionRule theBundleInclusionRule, Set theIncludes) { + if (myBundle == null) { + myBundle = new Bundle(); + } + + List includedResources = new ArrayList(); + Set addedResourceIds = new HashSet(); + + for (IBaseResource next : theResult) { + if (next.getIdElement().isEmpty() == false) { + addedResourceIds.add(next.getIdElement()); + } + } + + for (IBaseResource next : theResult) { + + Set containedIds = new HashSet(); + + if (next instanceof DomainResource) { + for (Resource nextContained : ((DomainResource)next).getContained()) { + if (isNotBlank(nextContained.getId())) { + containedIds.add(nextContained.getId()); + } + } + } + + List references = myContext.newTerser().getAllResourceReferences(next); + do { + List addedResourcesThisPass = new ArrayList(); + + for (ResourceReferenceInfo nextRefInfo : references) { + if (!theBundleInclusionRule.shouldIncludeReferencedResource(nextRefInfo, theIncludes)) { + continue; + } + + IAnyResource nextRes = (IAnyResource) nextRefInfo.getResourceReference().getResource(); + if (nextRes != null) { + if (nextRes.getIdElement().hasIdPart()) { + if (containedIds.contains(nextRes.getIdElement().getValue())) { + // Don't add contained IDs as top level resources + continue; + } + + IIdType id = nextRes.getIdElement(); + if (id.hasResourceType() == false) { + String resName = myContext.getResourceDefinition(nextRes).getName(); + id = id.withResourceType(resName); + } + + if (!addedResourceIds.contains(id)) { + addedResourceIds.add(id); + addedResourcesThisPass.add(nextRes); + } + + } + } + } + + includedResources.addAll(addedResourcesThisPass); + + // Linked resources may themselves have linked resources + references = new ArrayList(); + for (IAnyResource iResource : addedResourcesThisPass) { + List newReferences = myContext.newTerser().getAllResourceReferences(iResource); + references.addAll(newReferences); + } + } while (references.isEmpty() == false); + + BundleEntryComponent entry = myBundle.addEntry().setResource((Resource) next); + Resource nextAsResource = (Resource)next; + IIdType id = populateBundleEntryFullUrl(next, entry); + String httpVerb = ResourceMetadataKeyEnum.ENTRY_TRANSACTION_METHOD.get(nextAsResource); + if (httpVerb != null) { + entry.getRequest().getMethodElement().setValueAsString(httpVerb); + if (id != null) { + entry.getRequest().setUrl(id.getValue()); + } + } + + String searchMode = ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.get(nextAsResource); + if (searchMode != null) { + entry.getSearch().getModeElement().setValueAsString(searchMode); + } + } + + /* + * Actually add the resources to the bundle + */ + for (IAnyResource next : includedResources) { + BundleEntryComponent entry = myBundle.addEntry(); + entry.setResource((Resource) next).getSearch().setMode(SearchEntryMode.INCLUDE); + populateBundleEntryFullUrl(next, entry); + } + + } + + private IIdType populateBundleEntryFullUrl(IBaseResource next, BundleEntryComponent entry) { + IIdType idElement = null; + if (next.getIdElement().hasBaseUrl()) { + idElement = next.getIdElement(); + entry.setFullUrl(idElement.toVersionless().getValue()); + } else { + if (isNotBlank(myBase) && next.getIdElement().hasIdPart()) { + idElement = next.getIdElement(); + idElement = idElement.withServerBase(myBase, myContext.getResourceDefinition(next).getName()); + entry.setFullUrl(idElement.toVersionless().getValue()); + } + } + return idElement; + } + + @Override + public void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType theLastUpdated) { + + myBase = theServerBase; + + if (myBundle.getIdElement().isEmpty()) { + myBundle.setId(UUID.randomUUID().toString()); + } + + if (myBundle.getMeta().getLastUpdated() == null && theLastUpdated != null) { + myBundle.getMeta().getLastUpdatedElement().setValueAsString(theLastUpdated.getValueAsString()); + } + + if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theCompleteUrl)) { + myBundle.addLink().setRelation("self").setUrl(theCompleteUrl); + } + + if (myBundle.getTypeElement().isEmpty() && theBundleType != null) { + myBundle.getTypeElement().setValueAsString(theBundleType.getCode()); + } + + if (myBundle.getTotalElement().isEmpty() && theTotalResults != null) { + myBundle.getTotalElement().setValue(theTotalResults); + } + } + + @Override + public ca.uhn.fhir.model.api.Bundle getDstu1Bundle() { + return null; + } + + @Override + public IBaseResource getResourceBundle() { + return myBundle; + } + + private boolean hasLink(String theLinkType, Bundle theBundle) { + for (BundleLinkComponent next : theBundle.getLink()) { + if (theLinkType.equals(next.getRelation())) { + return true; + } + } + return false; + } + + @Override + public void initializeBundleFromBundleProvider(IRestfulServer theServer, IBundleProvider theResult, EncodingEnum theResponseEncoding, String theServerBase, String theCompleteUrl, + boolean thePrettyPrint, int theOffset, Integer theLimit, String theSearchId, BundleTypeEnum theBundleType, Set theIncludes) { + myBase = theServerBase; + + int numToReturn; + String searchId = null; + List resourceList; + if (theServer.getPagingProvider() == null) { + numToReturn = theResult.size(); + if (numToReturn > 0) { + resourceList = theResult.getResources(0, numToReturn); + } else { + resourceList = Collections.emptyList(); + } + RestfulServerUtils.validateResourceListNotNull(resourceList); + + } else { + IPagingProvider pagingProvider = theServer.getPagingProvider(); + if (theLimit == null) { + numToReturn = pagingProvider.getDefaultPageSize(); + } else { + numToReturn = Math.min(pagingProvider.getMaximumPageSize(), theLimit); + } + + numToReturn = Math.min(numToReturn, theResult.size() - theOffset); + if (numToReturn > 0) { + resourceList = theResult.getResources(theOffset, numToReturn + theOffset); + } else { + resourceList = Collections.emptyList(); + } + RestfulServerUtils.validateResourceListNotNull(resourceList); + + if (theSearchId != null) { + searchId = theSearchId; + } else { + if (theResult.size() > numToReturn) { + searchId = pagingProvider.storeResultList(theResult); + Validate.notNull(searchId, "Paging provider returned null searchId"); + } + } + } + + for (IBaseResource next : resourceList) { + if (next.getIdElement() == null || next.getIdElement().isEmpty()) { + if (!(next instanceof BaseOperationOutcome)) { + throw new InternalErrorException("Server method returned resource of type[" + next.getClass().getSimpleName() + "] with no ID specified (IResource#setId(IdDt) must be called)"); + } + } + } + + addResourcesToBundle(new ArrayList(resourceList), theBundleType, theServerBase, theServer.getBundleInclusionRule(), theIncludes); + addRootPropertiesToBundle(null, theServerBase, theCompleteUrl, theResult.size(), theBundleType, theResult.getPublished()); + + if (theServer.getPagingProvider() != null) { + int limit; + limit = theLimit != null ? theLimit : theServer.getPagingProvider().getDefaultPageSize(); + limit = Math.min(limit, theServer.getPagingProvider().getMaximumPageSize()); + + if (searchId != null) { + if (theOffset + numToReturn < theResult.size()) { + myBundle.addLink().setRelation(Constants.LINK_NEXT) + .setUrl(RestfulServerUtils.createPagingLink(theIncludes, theServerBase, searchId, theOffset + numToReturn, numToReturn, theResponseEncoding, thePrettyPrint, theBundleType)); + } + if (theOffset > 0) { + int start = Math.max(0, theOffset - limit); + myBundle.addLink().setRelation(Constants.LINK_PREVIOUS) + .setUrl(RestfulServerUtils.createPagingLink(theIncludes, theServerBase, searchId, start, limit, theResponseEncoding, thePrettyPrint, theBundleType)); + } + } + } + } + + @Override + public void initializeBundleFromResourceList(String theAuthor, List theResources, String theServerBase, String theCompleteUrl, int theTotalResults, + BundleTypeEnum theBundleType) { + myBundle = new Bundle(); + + myBundle.setId(UUID.randomUUID().toString()); + + myBundle.getMeta().setLastUpdated(new Date()); + + myBundle.addLink().setRelation(Constants.LINK_FHIR_BASE).setUrl(theServerBase); + myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theCompleteUrl); + myBundle.getTypeElement().setValueAsString(theBundleType.getCode()); + + if (theBundleType.equals(BundleTypeEnum.TRANSACTION)) { + for (IBaseResource nextBaseRes : theResources) { + Resource next = (Resource) nextBaseRes; + BundleEntryComponent nextEntry = myBundle.addEntry(); + + nextEntry.setResource(next); + if (next.getIdElement().isEmpty()) { + nextEntry.getRequest().setMethod(HTTPVerb.POST); + } else { + nextEntry.getRequest().setMethod(HTTPVerb.PUT); + if (next.getIdElement().isAbsolute()) { + nextEntry.getRequest().setUrl(next.getId()); + } else { + String resourceType = myContext.getResourceDefinition(next).getName(); + nextEntry.getRequest().setUrl(new IdType(theServerBase, resourceType, next.getIdElement().getIdPart(), next.getIdElement().getVersionIdPart()).getValue()); + } + } + } + } else { + addResourcesForSearch(theResources); + } + + myBundle.getTotalElement().setValue(theTotalResults); + } + + @Override + public void initializeWithBundleResource(IBaseResource theBundle) { + myBundle = (Bundle) theBundle; + } + + @Override + public List toListOfResources() { + ArrayList retVal = new ArrayList(); + for (BundleEntryComponent next : myBundle.getEntry()) { + if (next.getResource() != null) { + retVal.add(next.getResource()); + } else if (next.getResponse().getLocationElement().isEmpty() == false) { + IdType id = new IdType(next.getResponse().getLocation()); + String resourceType = id.getResourceType(); + if (isNotBlank(resourceType)) { + IAnyResource res = (IAnyResource) myContext.getResourceDefinition(resourceType).newInstance(); + res.setId(id); + retVal.add(res); + } + } + } + return retVal; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/ServerConformanceProvider.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/ServerConformanceProvider.java new file mode 100644 index 00000000000..f84a22cede4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/ServerConformanceProvider.java @@ -0,0 +1,661 @@ +package org.hl7.fhir.dstu2016may.hapi.rest.server; + +import static org.apache.commons.lang3.StringUtils.isBlank; +/* + * #%L + * HAPI FHIR Structures - DSTU2 (FHIR v1.0.0) + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +import static org.apache.commons.lang3.StringUtils.isNotBlank; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus; +import org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent; +import org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent; +import org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent; +import org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind; +import org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent; +import org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode; +import org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction; +import org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction; +import org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode; +import org.hl7.fhir.dstu2016may.model.DateTimeType; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ResourceType; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationDefinition; +import org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent; +import org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind; +import org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse; +import org.hl7.fhir.dstu2016may.model.Reference; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseResource; + +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.context.RuntimeSearchParam; +import ca.uhn.fhir.parser.DataFormatException; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Initialize; +import ca.uhn.fhir.rest.annotation.Metadata; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.method.BaseMethodBinding; +import ca.uhn.fhir.rest.method.DynamicSearchMethodBinding; +import ca.uhn.fhir.rest.method.IParameter; +import ca.uhn.fhir.rest.method.OperationMethodBinding; +import ca.uhn.fhir.rest.method.OperationMethodBinding.ReturnType; +import ca.uhn.fhir.rest.method.OperationParameter; +import ca.uhn.fhir.rest.method.RestSearchParameterTypeEnum; +import ca.uhn.fhir.rest.method.SearchMethodBinding; +import ca.uhn.fhir.rest.method.SearchParameter; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.rest.server.IServerConformanceProvider; +import ca.uhn.fhir.rest.server.ResourceBinding; +import ca.uhn.fhir.rest.server.RestfulServer; +import ca.uhn.fhir.rest.server.RestulfulServerConfiguration; +import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; + +/** + * Server FHIR Provider which serves the conformance statement for a RESTful server implementation + * + *

+ * Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is always returned unless {@link #setCache(boolean)} is called with a value of + * false. This means that if you are adding anything to the returned conformance instance on each call you should call setCache(false) in your provider constructor. + *

+ */ +public class ServerConformanceProvider implements IServerConformanceProvider { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ServerConformanceProvider.class); + private boolean myCache = true; + private volatile Conformance myConformance; + private IdentityHashMap myOperationBindingToName; + private HashMap> myOperationNameToBindings; + private String myPublisher = "Not provided"; + private RestulfulServerConfiguration myServerConfiguration; + + /* + * Add a no-arg constructor and seetter so that the ServerConfirmanceProvider can be Spring-wired with the RestfulService avoiding the potential reference cycle that would happen. + */ + public ServerConformanceProvider() { + super(); + } + + public ServerConformanceProvider(RestfulServer theRestfulServer) { + this.myServerConfiguration = theRestfulServer.createConfiguration(); + } + + public ServerConformanceProvider(RestulfulServerConfiguration theServerConfiguration) { + this.myServerConfiguration = theServerConfiguration; + } + + private void checkBindingForSystemOps(ConformanceRestComponent rest, Set systemOps, BaseMethodBinding nextMethodBinding) { + if (nextMethodBinding.getRestOperationType() != null) { + String sysOpCode = nextMethodBinding.getRestOperationType().getCode(); + if (sysOpCode != null) { + SystemRestfulInteraction sysOp; + try { + sysOp = SystemRestfulInteraction.fromCode(sysOpCode); + } catch (FHIRException e) { + return; + } + if (sysOp == null) { + return; + } + if (systemOps.contains(sysOp) == false) { + systemOps.add(sysOp); + rest.addInteraction().setCode(sysOp); + } + } + } + } + + private Map>> collectMethodBindings() { + Map>> resourceToMethods = new TreeMap>>(); + for (ResourceBinding next : myServerConfiguration.getResourceBindings()) { + String resourceName = next.getResourceName(); + for (BaseMethodBinding nextMethodBinding : next.getMethodBindings()) { + if (resourceToMethods.containsKey(resourceName) == false) { + resourceToMethods.put(resourceName, new ArrayList>()); + } + resourceToMethods.get(resourceName).add(nextMethodBinding); + } + } + for (BaseMethodBinding nextMethodBinding : myServerConfiguration.getServerBindings()) { + String resourceName = ""; + if (resourceToMethods.containsKey(resourceName) == false) { + resourceToMethods.put(resourceName, new ArrayList>()); + } + resourceToMethods.get(resourceName).add(nextMethodBinding); + } + return resourceToMethods; + } + + private DateTimeType conformanceDate() { + String buildDate = myServerConfiguration.getConformanceDate(); + if (buildDate != null) { + try { + return new DateTimeType(buildDate); + } catch (DataFormatException e) { + // fall through + } + } + return DateTimeType.now(); + } + + private String createOperationName(OperationMethodBinding theMethodBinding) { + StringBuilder retVal = new StringBuilder(); + if (theMethodBinding.getResourceName() != null) { + retVal.append(theMethodBinding.getResourceName()); + } + + retVal.append('-'); + if (theMethodBinding.isCanOperateAtInstanceLevel()) { + retVal.append('i'); + } + if (theMethodBinding.isCanOperateAtServerLevel()) { + retVal.append('s'); + } + retVal.append('-'); + + // Exclude the leading $ + retVal.append(theMethodBinding.getName(), 1, theMethodBinding.getName().length()); + + return retVal.toString(); + } + + /** + * Gets the value of the "publisher" that will be placed in the generated conformance statement. As this is a mandatory element, the value should not be null (although this is not enforced). The + * value defaults to "Not provided" but may be set to null, which will cause this element to be omitted. + */ + public String getPublisher() { + return myPublisher; + } + + @Override + @Metadata + public Conformance getServerConformance(HttpServletRequest theRequest) { + if (myConformance != null && myCache) { + return myConformance; + } + + Conformance retVal = new Conformance(); + + retVal.setPublisher(myPublisher); + retVal.setDateElement(conformanceDate()); + retVal.setFhirVersion(FhirVersionEnum.DSTU2_1.getVersionImplementation().getVersionString()); + retVal.setAcceptUnknown(UnknownContentCode.EXTENSIONS); // TODO: make this configurable - this is a fairly big + // effort since the parser + // needs to be modified to actually allow it + + retVal.getImplementation().setDescription(myServerConfiguration.getImplementationDescription()); + retVal.setKind(ConformanceStatementKind.INSTANCE); + retVal.getSoftware().setName(myServerConfiguration.getServerName()); + retVal.getSoftware().setVersion(myServerConfiguration.getServerVersion()); + retVal.addFormat(Constants.CT_FHIR_XML_NEW); + retVal.addFormat(Constants.CT_FHIR_JSON_NEW); + retVal.setStatus(ConformanceResourceStatus.ACTIVE); + + ConformanceRestComponent rest = retVal.addRest(); + rest.setMode(RestfulConformanceMode.SERVER); + + Set systemOps = new HashSet(); + Set operationNames = new HashSet(); + + Map>> resourceToMethods = collectMethodBindings(); + for (Entry>> nextEntry : resourceToMethods.entrySet()) { + + if (nextEntry.getKey().isEmpty() == false) { + Set resourceOps = new HashSet(); + ConformanceRestResourceComponent resource = rest.addResource(); + String resourceName = nextEntry.getKey(); + RuntimeResourceDefinition def = myServerConfiguration.getFhirContext().getResourceDefinition(resourceName); + resource.getTypeElement().setValue(def.getName()); + ServletContext servletContext = (ServletContext) (theRequest == null ? null : theRequest.getAttribute(RestfulServer.SERVLET_CONTEXT_ATTRIBUTE)); + String serverBase = myServerConfiguration.getServerAddressStrategy().determineServerBase(servletContext, theRequest); + resource.getProfile().setReference((def.getResourceProfile(serverBase))); + + TreeSet includes = new TreeSet(); + + // Map nameToSearchParam = new HashMap(); + for (BaseMethodBinding nextMethodBinding : nextEntry.getValue()) { + if (nextMethodBinding.getRestOperationType() != null) { + String resOpCode = nextMethodBinding.getRestOperationType().getCode(); + if (resOpCode != null) { + TypeRestfulInteraction resOp; + try { + resOp = TypeRestfulInteraction.fromCode(resOpCode); + } catch (Exception e) { + resOp = null; + } + if (resOp != null) { + if (resourceOps.contains(resOp) == false) { + resourceOps.add(resOp); + resource.addInteraction().setCode(resOp); + } + if ("vread".equals(resOpCode)) { + // vread implies read + resOp = TypeRestfulInteraction.READ; + if (resourceOps.contains(resOp) == false) { + resourceOps.add(resOp); + resource.addInteraction().setCode(resOp); + } + } + + if (nextMethodBinding.isSupportsConditional()) { + switch (resOp) { + case CREATE: + resource.setConditionalCreate(true); + break; + case DELETE: + if (nextMethodBinding.isSupportsConditionalMultiple()) { + resource.setConditionalDelete(ConditionalDeleteStatus.MULTIPLE); + } else { + resource.setConditionalDelete(ConditionalDeleteStatus.SINGLE); + } + break; + case UPDATE: + resource.setConditionalUpdate(true); + break; + default: + break; + } + } + } + } + } + + checkBindingForSystemOps(rest, systemOps, nextMethodBinding); + + if (nextMethodBinding instanceof SearchMethodBinding) { + handleSearchMethodBinding(rest, resource, resourceName, def, includes, (SearchMethodBinding) nextMethodBinding); + } else if (nextMethodBinding instanceof DynamicSearchMethodBinding) { + handleDynamicSearchMethodBinding(resource, def, includes, (DynamicSearchMethodBinding) nextMethodBinding); + } else if (nextMethodBinding instanceof OperationMethodBinding) { + OperationMethodBinding methodBinding = (OperationMethodBinding) nextMethodBinding; + String opName = myOperationBindingToName.get(methodBinding); + if (operationNames.add(opName)) { + // Only add each operation (by name) once + rest.addOperation().setName(methodBinding.getName().substring(1)).setDefinition(new Reference("OperationDefinition/" + opName)); + } + } + + Collections.sort(resource.getInteraction(), new Comparator() { + @Override + public int compare(ResourceInteractionComponent theO1, ResourceInteractionComponent theO2) { + TypeRestfulInteraction o1 = theO1.getCode(); + TypeRestfulInteraction o2 = theO2.getCode(); + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return 1; + } + if (o2 == null) { + return -1; + } + return o1.ordinal() - o2.ordinal(); + } + }); + + } + + for (String nextInclude : includes) { + resource.addSearchInclude(nextInclude); + } + } else { + for (BaseMethodBinding nextMethodBinding : nextEntry.getValue()) { + checkBindingForSystemOps(rest, systemOps, nextMethodBinding); + if (nextMethodBinding instanceof OperationMethodBinding) { + OperationMethodBinding methodBinding = (OperationMethodBinding) nextMethodBinding; + String opName = myOperationBindingToName.get(methodBinding); + if (operationNames.add(opName)) { + ourLog.debug("Found bound operation: {}", opName); + rest.addOperation().setName(methodBinding.getName().substring(1)).setDefinition(new Reference("OperationDefinition/" + opName)); + } + } + } + } + } + + myConformance = retVal; + return retVal; + } + + private void handleDynamicSearchMethodBinding(ConformanceRestResourceComponent resource, RuntimeResourceDefinition def, TreeSet includes, DynamicSearchMethodBinding searchMethodBinding) { + includes.addAll(searchMethodBinding.getIncludes()); + + List searchParameters = new ArrayList(); + searchParameters.addAll(searchMethodBinding.getSearchParams()); + sortRuntimeSearchParameters(searchParameters); + + if (!searchParameters.isEmpty()) { + + for (RuntimeSearchParam nextParameter : searchParameters) { + + String nextParamName = nextParameter.getName(); + + // String chain = null; + String nextParamUnchainedName = nextParamName; + if (nextParamName.contains(".")) { + // chain = nextParamName.substring(nextParamName.indexOf('.') + 1); + nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.')); + } + + String nextParamDescription = nextParameter.getDescription(); + + /* + * If the parameter has no description, default to the one from the resource + */ + if (StringUtils.isBlank(nextParamDescription)) { + RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName); + if (paramDef != null) { + nextParamDescription = paramDef.getDescription(); + } + } + + ConformanceRestResourceSearchParamComponent param = resource.addSearchParam(); + + param.setName(nextParamName); + // if (StringUtils.isNotBlank(chain)) { + // param.addChain(chain); + // } + param.setDocumentation(nextParamDescription); + // param.setType(nextParameter.getParamType()); + } + } + } + + private void handleSearchMethodBinding(ConformanceRestComponent rest, ConformanceRestResourceComponent resource, String resourceName, RuntimeResourceDefinition def, TreeSet includes, + SearchMethodBinding searchMethodBinding) { + includes.addAll(searchMethodBinding.getIncludes()); + + List params = searchMethodBinding.getParameters(); + List searchParameters = new ArrayList(); + for (IParameter nextParameter : params) { + if ((nextParameter instanceof SearchParameter)) { + searchParameters.add((SearchParameter) nextParameter); + } + } + sortSearchParameters(searchParameters); + if (!searchParameters.isEmpty()) { + // boolean allOptional = searchParameters.get(0).isRequired() == false; + // + // OperationDefinition query = null; + // if (!allOptional) { + // RestOperation operation = rest.addOperation(); + // query = new OperationDefinition(); + // operation.setDefinition(new ResourceReferenceDt(query)); + // query.getDescriptionElement().setValue(searchMethodBinding.getDescription()); + // query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName)); + // for (String nextInclude : searchMethodBinding.getIncludes()) { + // query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude)); + // } + // } + + for (SearchParameter nextParameter : searchParameters) { + + String nextParamName = nextParameter.getName(); + + String chain = null; + String nextParamUnchainedName = nextParamName; + if (nextParamName.contains(".")) { + chain = nextParamName.substring(nextParamName.indexOf('.') + 1); + nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.')); + } + + String nextParamDescription = nextParameter.getDescription(); + + /* + * If the parameter has no description, default to the one from the resource + */ + if (StringUtils.isBlank(nextParamDescription)) { + RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName); + if (paramDef != null) { + nextParamDescription = paramDef.getDescription(); + } + } + + ConformanceRestResourceSearchParamComponent param = resource.addSearchParam(); + param.setName(nextParamUnchainedName); + if (StringUtils.isNotBlank(chain)) { + param.addChain(chain); + } + + if (nextParameter.getParamType() == RestSearchParameterTypeEnum.REFERENCE) { + for (String nextWhitelist : new TreeSet(nextParameter.getQualifierWhitelist())) { + if (nextWhitelist.startsWith(".")) { + param.addChain(nextWhitelist.substring(1)); + } + } + } + + param.setDocumentation(nextParamDescription); + if (nextParameter.getParamType() != null) { + param.getTypeElement().setValueAsString(nextParameter.getParamType().getCode()); + } + for (Class nextTarget : nextParameter.getDeclaredTypes()) { + RuntimeResourceDefinition targetDef = myServerConfiguration.getFhirContext().getResourceDefinition(nextTarget); + if (targetDef != null) { + ResourceType code; + try { + code = ResourceType.fromCode(targetDef.getName()); + } catch (FHIRException e) { + code = null; + } + if (code != null) { + param.addTarget(targetDef.getName()); + } + } + } + } + } + } + + @Initialize + public void initializeOperations() { + myOperationBindingToName = new IdentityHashMap(); + myOperationNameToBindings = new HashMap>(); + + Map>> resourceToMethods = collectMethodBindings(); + for (Entry>> nextEntry : resourceToMethods.entrySet()) { + List> nextMethodBindings = nextEntry.getValue(); + for (BaseMethodBinding nextMethodBinding : nextMethodBindings) { + if (nextMethodBinding instanceof OperationMethodBinding) { + OperationMethodBinding methodBinding = (OperationMethodBinding) nextMethodBinding; + if (myOperationBindingToName.containsKey(methodBinding)) { + continue; + } + + String name = createOperationName(methodBinding); + ourLog.debug("Detected operation: {}", name); + + myOperationBindingToName.put(methodBinding, name); + if (myOperationNameToBindings.containsKey(name) == false) { + myOperationNameToBindings.put(name, new ArrayList()); + } + myOperationNameToBindings.get(name).add(methodBinding); + } + } + } + } + + @Read(type = OperationDefinition.class) + public OperationDefinition readOperationDefinition(@IdParam IdType theId) { + if (theId == null || theId.hasIdPart() == false) { + throw new ResourceNotFoundException(theId); + } + List sharedDescriptions = myOperationNameToBindings.get(theId.getIdPart()); + if (sharedDescriptions == null || sharedDescriptions.isEmpty()) { + throw new ResourceNotFoundException(theId); + } + + OperationDefinition op = new OperationDefinition(); + op.setStatus(ConformanceResourceStatus.ACTIVE); + op.setKind(OperationKind.OPERATION); + op.setIdempotent(true); + op.setInstance(false); + op.setSystem(false); + + Set inParams = new HashSet(); + Set outParams = new HashSet(); + + for (OperationMethodBinding sharedDescription : sharedDescriptions) { + if (isNotBlank(sharedDescription.getDescription())) { + op.setDescription(sharedDescription.getDescription()); + } + if (sharedDescription.isCanOperateAtInstanceLevel()) { + op.setInstance(true); + } + if (sharedDescription.isCanOperateAtServerLevel()) { + op.setSystem(true); + } + if (!sharedDescription.isIdempotent()) { + op.setIdempotent(sharedDescription.isIdempotent()); + } + op.setCode(sharedDescription.getName().substring(1)); + if (sharedDescription.isCanOperateAtInstanceLevel()) { + op.setInstance(sharedDescription.isCanOperateAtInstanceLevel()); + } + if (sharedDescription.isCanOperateAtServerLevel()) { + op.setSystem(sharedDescription.isCanOperateAtServerLevel()); + } + if (isNotBlank(sharedDescription.getResourceName())) { + op.addType(sharedDescription.getResourceName()); + } + + for (IParameter nextParamUntyped : sharedDescription.getParameters()) { + if (nextParamUntyped instanceof OperationParameter) { + OperationParameter nextParam = (OperationParameter) nextParamUntyped; + OperationDefinitionParameterComponent param = op.addParameter(); + if (!inParams.add(nextParam.getName())) { + continue; + } + param.setUse(OperationParameterUse.IN); + if (nextParam.getParamType() != null) { + param.setType(nextParam.getParamType()); + } + if (nextParam.getSearchParamType() != null) { + param.getSearchTypeElement().setValueAsString(nextParam.getSearchParamType()); + } + param.setMin(nextParam.getMin()); + param.setMax(nextParam.getMax() == -1 ? "*" : Integer.toString(nextParam.getMax())); + param.setName(nextParam.getName()); + } + } + + for (ReturnType nextParam : sharedDescription.getReturnParams()) { + if (!outParams.add(nextParam.getName())) { + continue; + } + OperationDefinitionParameterComponent param = op.addParameter(); + param.setUse(OperationParameterUse.OUT); + if (nextParam.getType() != null) { + param.setType(nextParam.getType()); + } + param.setMin(nextParam.getMin()); + param.setMax(nextParam.getMax() == -1 ? "*" : Integer.toString(nextParam.getMax())); + param.setName(nextParam.getName()); + } + } + + if (isBlank(op.getName())) { + if (isNotBlank(op.getDescription())) { + op.setName(op.getDescription()); + } else { + op.setName(op.getCode()); + } + } + + if (op.hasSystem() == false) { + op.setSystem(false); + } + if (op.hasInstance() == false) { + op.setInstance(false); + } + + return op; + } + + /** + * Sets the cache property (default is true). If set to true, the same response will be returned for each invocation. + *

+ * See the class documentation for an important note if you are extending this class + *

+ */ + public void setCache(boolean theCache) { + myCache = theCache; + } + + /** + * Sets the value of the "publisher" that will be placed in the generated conformance statement. As this is a mandatory element, the value should not be null (although this is not enforced). The + * value defaults to "Not provided" but may be set to null, which will cause this element to be omitted. + */ + public void setPublisher(String thePublisher) { + myPublisher = thePublisher; + } + + @Override + public void setRestfulServer(RestfulServer theRestfulServer) { + myServerConfiguration = theRestfulServer.createConfiguration(); + } + + RestulfulServerConfiguration getServerConfiguration() { + return myServerConfiguration; + } + + private void sortRuntimeSearchParameters(List searchParameters) { + Collections.sort(searchParameters, new Comparator() { + @Override + public int compare(RuntimeSearchParam theO1, RuntimeSearchParam theO2) { + return theO1.getName().compareTo(theO2.getName()); + } + }); + } + + private void sortSearchParameters(List searchParameters) { + Collections.sort(searchParameters, new Comparator() { + @Override + public int compare(SearchParameter theO1, SearchParameter theO2) { + if (theO1.isRequired() == theO2.isRequired()) { + return theO1.getName().compareTo(theO2.getName()); + } + if (theO1.isRequired()) { + return -1; + } + return 1; + } + }); + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/ServerProfileProvider.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/ServerProfileProvider.java new file mode 100644 index 00000000000..6fa08650fb4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/ServerProfileProvider.java @@ -0,0 +1,90 @@ +package org.hl7.fhir.dstu2016may.hapi.rest.server; + +/* + * #%L + * HAPI FHIR Structures - DSTU2 (FHIR v1.0.0) + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.StructureDefinition; +import org.hl7.fhir.instance.model.api.IBaseResource; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.server.IResourceProvider; +import ca.uhn.fhir.rest.server.RestfulServer; + +public class ServerProfileProvider implements IResourceProvider { + + private final FhirContext myContext; + private final RestfulServer myRestfulServer; + + public ServerProfileProvider(RestfulServer theServer) { + myContext = theServer.getFhirContext(); + myRestfulServer = theServer; + } + + @Override + public Class getResourceType() { + return StructureDefinition.class; + } + + @Read() + public StructureDefinition getProfileById(HttpServletRequest theRequest, @IdParam IdType theId) { + RuntimeResourceDefinition retVal = myContext.getResourceDefinitionById(theId.getIdPart()); + if (retVal==null) { + return null; + } + String serverBase = getServerBase(theRequest); + return (StructureDefinition) retVal.toProfile(serverBase); + } + + @Search() + public List getAllProfiles(HttpServletRequest theRequest) { + final String serverBase = getServerBase(theRequest); + List defs = new ArrayList(myContext.getResourceDefinitionsWithExplicitId()); + Collections.sort(defs, new Comparator() { + @Override + public int compare(RuntimeResourceDefinition theO1, RuntimeResourceDefinition theO2) { + int cmp = theO1.getName().compareTo(theO2.getName()); + if (cmp==0) { + cmp=theO1.getResourceProfile(serverBase).compareTo(theO2.getResourceProfile(serverBase)); + } + return cmp; + }}); + ArrayList retVal = new ArrayList(); + for (RuntimeResourceDefinition next : defs) { + retVal.add((StructureDefinition) next.toProfile(serverBase)); + } + return retVal; + } + + private String getServerBase(HttpServletRequest theHttpRequest) { + return myRestfulServer.getServerBaseForRequest(theHttpRequest); + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Account.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Account.java new file mode 100644 index 00000000000..89c176048ff --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Account.java @@ -0,0 +1,1058 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc. + */ +@ResourceDef(name="Account", profile="http://hl7.org/fhir/Profile/Account") +public class Account extends DomainResource { + + public enum AccountStatus { + /** + * This account is active and may be used. + */ + ACTIVE, + /** + * This account is inactive and should not be used to track financial information. + */ + INACTIVE, + /** + * added to help the parsers + */ + NULL; + public static AccountStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("inactive".equals(codeString)) + return INACTIVE; + throw new FHIRException("Unknown AccountStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return "http://hl7.org/fhir/account-status"; + case INACTIVE: return "http://hl7.org/fhir/account-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "This account is active and may be used."; + case INACTIVE: return "This account is inactive and should not be used to track financial information."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case INACTIVE: return "Inactive"; + default: return "?"; + } + } + } + + public static class AccountStatusEnumFactory implements EnumFactory { + public AccountStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return AccountStatus.ACTIVE; + if ("inactive".equals(codeString)) + return AccountStatus.INACTIVE; + throw new IllegalArgumentException("Unknown AccountStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return new Enumeration(this, AccountStatus.ACTIVE); + if ("inactive".equals(codeString)) + return new Enumeration(this, AccountStatus.INACTIVE); + throw new FHIRException("Unknown AccountStatus code '"+codeString+"'"); + } + public String toCode(AccountStatus code) { + if (code == AccountStatus.ACTIVE) + return "active"; + if (code == AccountStatus.INACTIVE) + return "inactive"; + return "?"; + } + public String toSystem(AccountStatus code) { + return code.getSystem(); + } + } + + /** + * Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Account number", formalDefinition="Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number)." ) + protected List identifier; + + /** + * Name used for the account when displaying it to humans in reports, etc. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human-readable label", formalDefinition="Name used for the account when displaying it to humans in reports, etc." ) + protected StringType name; + + /** + * Categorizes the account for reporting and searching purposes. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="E.g. patient, expense, depreciation", formalDefinition="Categorizes the account for reporting and searching purposes." ) + protected CodeableConcept type; + + /** + * Indicates whether the account is presently used/useable or not. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | inactive", formalDefinition="Indicates whether the account is presently used/useable or not." ) + protected Enumeration status; + + /** + * Indicates the period of time over which the account is allowed. + */ + @Child(name = "activePeriod", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Valid from..to", formalDefinition="Indicates the period of time over which the account is allowed." ) + protected Period activePeriod; + + /** + * Identifies the currency to which transactions must be converted when crediting or debiting the account. + */ + @Child(name = "currency", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Base currency in which balance is tracked", formalDefinition="Identifies the currency to which transactions must be converted when crediting or debiting the account." ) + protected Coding currency; + + /** + * Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative. + */ + @Child(name = "balance", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How much is in account?", formalDefinition="Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative." ) + protected Money balance; + + /** + * Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc. + */ + @Child(name = "coveragePeriod", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Transaction window", formalDefinition="Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc." ) + protected Period coveragePeriod; + + /** + * Identifies the patient, device, practitioner, location or other object the account is associated with. + */ + @Child(name = "subject", type = {Patient.class, Device.class, Practitioner.class, Location.class, HealthcareService.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="What is account tied to?", formalDefinition="Identifies the patient, device, practitioner, location or other object the account is associated with." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Identifies the patient, device, practitioner, location or other object the account is associated with.) + */ + protected Resource subjectTarget; + + /** + * Indicates the organization, department, etc. with responsibility for the account. + */ + @Child(name = "owner", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who is responsible?", formalDefinition="Indicates the organization, department, etc. with responsibility for the account." ) + protected Reference owner; + + /** + * The actual object that is the target of the reference (Indicates the organization, department, etc. with responsibility for the account.) + */ + protected Organization ownerTarget; + + /** + * Provides additional information about what the account tracks and how it is used. + */ + @Child(name = "description", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Explanation of purpose/use", formalDefinition="Provides additional information about what the account tracks and how it is used." ) + protected StringType description; + + private static final long serialVersionUID = -1926153194L; + + /** + * Constructor + */ + public Account() { + super(); + } + + /** + * @return {@link #identifier} (Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card 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} (Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card 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; + } + + // syntactic sugar + public Account addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #name} (Name used for the account when displaying it to humans in reports, etc.). 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 Account.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Name used for the account when displaying it to humans in reports, etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Account setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name used for the account when displaying it to humans in reports, etc. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name used for the account when displaying it to humans in reports, etc. + */ + public Account setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Categorizes the account for reporting and searching purposes.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Account.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Categorizes the account for reporting and searching purposes.) + */ + public Account setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #status} (Indicates whether the account is presently used/useable or not.). 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 Account.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new AccountStatusEnumFactory()); // bb + 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 account is presently used/useable or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Account setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the account is presently used/useable or not. + */ + public AccountStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the account is presently used/useable or not. + */ + public Account setStatus(AccountStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new AccountStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #activePeriod} (Indicates the period of time over which the account is allowed.) + */ + public Period getActivePeriod() { + if (this.activePeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Account.activePeriod"); + else if (Configuration.doAutoCreate()) + this.activePeriod = new Period(); // cc + return this.activePeriod; + } + + public boolean hasActivePeriod() { + return this.activePeriod != null && !this.activePeriod.isEmpty(); + } + + /** + * @param value {@link #activePeriod} (Indicates the period of time over which the account is allowed.) + */ + public Account setActivePeriod(Period value) { + this.activePeriod = value; + return this; + } + + /** + * @return {@link #currency} (Identifies the currency to which transactions must be converted when crediting or debiting the account.) + */ + public Coding getCurrency() { + if (this.currency == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Account.currency"); + else if (Configuration.doAutoCreate()) + this.currency = new Coding(); // cc + return this.currency; + } + + public boolean hasCurrency() { + return this.currency != null && !this.currency.isEmpty(); + } + + /** + * @param value {@link #currency} (Identifies the currency to which transactions must be converted when crediting or debiting the account.) + */ + public Account setCurrency(Coding value) { + this.currency = value; + return this; + } + + /** + * @return {@link #balance} (Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative.) + */ + public Money getBalance() { + if (this.balance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Account.balance"); + else if (Configuration.doAutoCreate()) + this.balance = new Money(); // cc + return this.balance; + } + + public boolean hasBalance() { + return this.balance != null && !this.balance.isEmpty(); + } + + /** + * @param value {@link #balance} (Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative.) + */ + public Account setBalance(Money value) { + this.balance = value; + return this; + } + + /** + * @return {@link #coveragePeriod} (Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc.) + */ + public Period getCoveragePeriod() { + if (this.coveragePeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Account.coveragePeriod"); + else if (Configuration.doAutoCreate()) + this.coveragePeriod = new Period(); // cc + return this.coveragePeriod; + } + + public boolean hasCoveragePeriod() { + return this.coveragePeriod != null && !this.coveragePeriod.isEmpty(); + } + + /** + * @param value {@link #coveragePeriod} (Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc.) + */ + public Account setCoveragePeriod(Period value) { + this.coveragePeriod = value; + return this; + } + + /** + * @return {@link #subject} (Identifies the patient, device, practitioner, location or other object the account is associated with.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Account.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Identifies the patient, device, practitioner, location or other object the account is associated with.) + */ + public Account 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. (Identifies the patient, device, practitioner, location or other object the account is associated with.) + */ + public Resource getSubjectTarget() { + 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. (Identifies the patient, device, practitioner, location or other object the account is associated with.) + */ + public Account setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #owner} (Indicates the organization, department, etc. with responsibility for the account.) + */ + public Reference getOwner() { + if (this.owner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Account.owner"); + else if (Configuration.doAutoCreate()) + this.owner = new Reference(); // cc + return this.owner; + } + + public boolean hasOwner() { + return this.owner != null && !this.owner.isEmpty(); + } + + /** + * @param value {@link #owner} (Indicates the organization, department, etc. with responsibility for the account.) + */ + public Account setOwner(Reference value) { + this.owner = value; + return this; + } + + /** + * @return {@link #owner} 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. (Indicates the organization, department, etc. with responsibility for the account.) + */ + public Organization getOwnerTarget() { + if (this.ownerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Account.owner"); + else if (Configuration.doAutoCreate()) + this.ownerTarget = new Organization(); // aa + return this.ownerTarget; + } + + /** + * @param value {@link #owner} 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. (Indicates the organization, department, etc. with responsibility for the account.) + */ + public Account setOwnerTarget(Organization value) { + this.ownerTarget = value; + return this; + } + + /** + * @return {@link #description} (Provides additional information about what the account tracks and how it is used.). 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 Account.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Provides additional information about what the account tracks and how it is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Account setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Provides additional information about what the account tracks and how it is used. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Provides additional information about what the account tracks and how it is used. + */ + public Account 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "string", "Name used for the account when displaying it to humans in reports, etc.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("type", "CodeableConcept", "Categorizes the account for reporting and searching purposes.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("status", "code", "Indicates whether the account is presently used/useable or not.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("activePeriod", "Period", "Indicates the period of time over which the account is allowed.", 0, java.lang.Integer.MAX_VALUE, activePeriod)); + childrenList.add(new Property("currency", "Coding", "Identifies the currency to which transactions must be converted when crediting or debiting the account.", 0, java.lang.Integer.MAX_VALUE, currency)); + childrenList.add(new Property("balance", "Money", "Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative.", 0, java.lang.Integer.MAX_VALUE, balance)); + childrenList.add(new Property("coveragePeriod", "Period", "Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc.", 0, java.lang.Integer.MAX_VALUE, coveragePeriod)); + childrenList.add(new Property("subject", "Reference(Patient|Device|Practitioner|Location|HealthcareService|Organization)", "Identifies the patient, device, practitioner, location or other object the account is associated with.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("owner", "Reference(Organization)", "Indicates the organization, department, etc. with responsibility for the account.", 0, java.lang.Integer.MAX_VALUE, owner)); + childrenList.add(new Property("description", "string", "Provides additional information about what the account tracks and how it is used.", 0, java.lang.Integer.MAX_VALUE, description)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1325532263: /*activePeriod*/ return this.activePeriod == null ? new Base[0] : new Base[] {this.activePeriod}; // Period + case 575402001: /*currency*/ return this.currency == null ? new Base[0] : new Base[] {this.currency}; // Coding + case -339185956: /*balance*/ return this.balance == null ? new Base[0] : new Base[] {this.balance}; // Money + case 1024117193: /*coveragePeriod*/ return this.coveragePeriod == null ? new Base[0] : new Base[] {this.coveragePeriod}; // Period + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -892481550: // status + this.status = new AccountStatusEnumFactory().fromType(value); // Enumeration + break; + case 1325532263: // activePeriod + this.activePeriod = castToPeriod(value); // Period + break; + case 575402001: // currency + this.currency = castToCoding(value); // Coding + break; + case -339185956: // balance + this.balance = castToMoney(value); // Money + break; + case 1024117193: // coveragePeriod + this.coveragePeriod = castToPeriod(value); // Period + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 106164915: // owner + this.owner = castToReference(value); // Reference + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("status")) + this.status = new AccountStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("activePeriod")) + this.activePeriod = castToPeriod(value); // Period + else if (name.equals("currency")) + this.currency = castToCoding(value); // Coding + else if (name.equals("balance")) + this.balance = castToMoney(value); // Money + else if (name.equals("coveragePeriod")) + this.coveragePeriod = castToPeriod(value); // Period + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("owner")) + this.owner = castToReference(value); // Reference + else if (name.equals("description")) + this.description = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 3575610: return getType(); // CodeableConcept + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1325532263: return getActivePeriod(); // Period + case 575402001: return getCurrency(); // Coding + case -339185956: return getBalance(); // Money + case 1024117193: return getCoveragePeriod(); // Period + case -1867885268: return getSubject(); // Reference + case 106164915: return getOwner(); // Reference + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Account.name"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Account.status"); + } + else if (name.equals("activePeriod")) { + this.activePeriod = new Period(); + return this.activePeriod; + } + else if (name.equals("currency")) { + this.currency = new Coding(); + return this.currency; + } + else if (name.equals("balance")) { + this.balance = new Money(); + return this.balance; + } + else if (name.equals("coveragePeriod")) { + this.coveragePeriod = new Period(); + return this.coveragePeriod; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("owner")) { + this.owner = new Reference(); + return this.owner; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Account.description"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Account"; + + } + + public Account copy() { + Account dst = new Account(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.type = type == null ? null : type.copy(); + dst.status = status == null ? null : status.copy(); + dst.activePeriod = activePeriod == null ? null : activePeriod.copy(); + dst.currency = currency == null ? null : currency.copy(); + dst.balance = balance == null ? null : balance.copy(); + dst.coveragePeriod = coveragePeriod == null ? null : coveragePeriod.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.owner = owner == null ? null : owner.copy(); + dst.description = description == null ? null : description.copy(); + return dst; + } + + protected Account typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Account)) + return false; + Account o = (Account) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true) + && compareDeep(status, o.status, true) && compareDeep(activePeriod, o.activePeriod, true) && compareDeep(currency, o.currency, true) + && compareDeep(balance, o.balance, true) && compareDeep(coveragePeriod, o.coveragePeriod, true) + && compareDeep(subject, o.subject, true) && compareDeep(owner, o.owner, true) && compareDeep(description, o.description, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Account)) + return false; + Account o = (Account) other; + return compareValues(name, o.name, true) && compareValues(status, o.status, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (type == null || type.isEmpty()) && (status == null || status.isEmpty()) && (activePeriod == null || activePeriod.isEmpty()) + && (currency == null || currency.isEmpty()) && (balance == null || balance.isEmpty()) && (coveragePeriod == null || coveragePeriod.isEmpty()) + && (subject == null || subject.isEmpty()) && (owner == null || owner.isEmpty()) && (description == null || description.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Account; + } + + /** + * Search parameter: balance + *

+ * Description: How much is in account?
+ * Type: quantity
+ * Path: Account.balance
+ *

+ */ + @SearchParamDefinition(name="balance", path="Account.balance", description="How much is in account?", type="quantity" ) + public static final String SP_BALANCE = "balance"; + /** + * Fluent Client search parameter constant for balance + *

+ * Description: How much is in account?
+ * Type: quantity
+ * Path: Account.balance
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.QuantityClientParam BALANCE = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_BALANCE); + + /** + * Search parameter: patient + *

+ * Description: What is account tied to?
+ * Type: reference
+ * Path: Account.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Account.subject", description="What is account tied to?", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: What is account tied to?
+ * Type: reference
+ * Path: Account.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Account:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Account:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: active | inactive
+ * Type: token
+ * Path: Account.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Account.status", description="active | inactive", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: active | inactive
+ * Type: token
+ * Path: Account.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: What is account tied to?
+ * Type: reference
+ * Path: Account.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Account.subject", description="What is account tied to?", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: What is account tied to?
+ * Type: reference
+ * Path: Account.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Account:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Account:subject").toLocked(); + + /** + * Search parameter: name + *

+ * Description: Human-readable label
+ * Type: string
+ * Path: Account.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Account.name", description="Human-readable label", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Human-readable label
+ * Type: string
+ * Path: Account.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: owner + *

+ * Description: Who is responsible?
+ * Type: reference
+ * Path: Account.owner
+ *

+ */ + @SearchParamDefinition(name="owner", path="Account.owner", description="Who is responsible?", type="reference" ) + public static final String SP_OWNER = "owner"; + /** + * Fluent Client search parameter constant for owner + *

+ * Description: Who is responsible?
+ * Type: reference
+ * Path: Account.owner
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Account:owner". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNER = new ca.uhn.fhir.model.api.Include("Account:owner").toLocked(); + + /** + * Search parameter: period + *

+ * Description: Transaction window
+ * Type: date
+ * Path: Account.coveragePeriod
+ *

+ */ + @SearchParamDefinition(name="period", path="Account.coveragePeriod", description="Transaction window", type="date" ) + public static final String SP_PERIOD = "period"; + /** + * Fluent Client search parameter constant for period + *

+ * Description: Transaction window
+ * Type: date
+ * Path: Account.coveragePeriod
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); + + /** + * Search parameter: type + *

+ * Description: E.g. patient, expense, depreciation
+ * Type: token
+ * Path: Account.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Account.type", description="E.g. patient, expense, depreciation", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: E.g. patient, expense, depreciation
+ * Type: token
+ * Path: Account.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: Account number
+ * Type: token
+ * Path: Account.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Account.identifier", description="Account number", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Account number
+ * Type: token
+ * Path: Account.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ActionDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ActionDefinition.java new file mode 100644 index 00000000000..cc235196326 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ActionDefinition.java @@ -0,0 +1,2254 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library. + */ +@DatatypeDef(name="ActionDefinition") +public class ActionDefinition extends Type implements ICompositeType { + + public enum ActionRelationshipType { + /** + * The action must be performed before the related action + */ + BEFORE, + /** + * The action must be performed after the related action + */ + AFTER, + /** + * added to help the parsers + */ + NULL; + public static ActionRelationshipType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("before".equals(codeString)) + return BEFORE; + if ("after".equals(codeString)) + return AFTER; + throw new FHIRException("Unknown ActionRelationshipType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case BEFORE: return "before"; + case AFTER: return "after"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case BEFORE: return "http://hl7.org/fhir/action-relationship-type"; + case AFTER: return "http://hl7.org/fhir/action-relationship-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case BEFORE: return "The action must be performed before the related action"; + case AFTER: return "The action must be performed after the related action"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case BEFORE: return "Before"; + case AFTER: return "After"; + default: return "?"; + } + } + } + + public static class ActionRelationshipTypeEnumFactory implements EnumFactory { + public ActionRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("before".equals(codeString)) + return ActionRelationshipType.BEFORE; + if ("after".equals(codeString)) + return ActionRelationshipType.AFTER; + throw new IllegalArgumentException("Unknown ActionRelationshipType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("before".equals(codeString)) + return new Enumeration(this, ActionRelationshipType.BEFORE); + if ("after".equals(codeString)) + return new Enumeration(this, ActionRelationshipType.AFTER); + throw new FHIRException("Unknown ActionRelationshipType code '"+codeString+"'"); + } + public String toCode(ActionRelationshipType code) { + if (code == ActionRelationshipType.BEFORE) + return "before"; + if (code == ActionRelationshipType.AFTER) + return "after"; + return "?"; + } + public String toSystem(ActionRelationshipType code) { + return code.getSystem(); + } + } + + public enum ActionRelationshipAnchor { + /** + * The action relationship is anchored to the start of the related action + */ + START, + /** + * The action relationship is anchored to the end of the related action + */ + END, + /** + * added to help the parsers + */ + NULL; + public static ActionRelationshipAnchor fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("start".equals(codeString)) + return START; + if ("end".equals(codeString)) + return END; + throw new FHIRException("Unknown ActionRelationshipAnchor code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case START: return "start"; + case END: return "end"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case START: return "http://hl7.org/fhir/action-relationship-anchor"; + case END: return "http://hl7.org/fhir/action-relationship-anchor"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case START: return "The action relationship is anchored to the start of the related action"; + case END: return "The action relationship is anchored to the end of the related action"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case START: return "Start"; + case END: return "End"; + default: return "?"; + } + } + } + + public static class ActionRelationshipAnchorEnumFactory implements EnumFactory { + public ActionRelationshipAnchor fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("start".equals(codeString)) + return ActionRelationshipAnchor.START; + if ("end".equals(codeString)) + return ActionRelationshipAnchor.END; + throw new IllegalArgumentException("Unknown ActionRelationshipAnchor code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("start".equals(codeString)) + return new Enumeration(this, ActionRelationshipAnchor.START); + if ("end".equals(codeString)) + return new Enumeration(this, ActionRelationshipAnchor.END); + throw new FHIRException("Unknown ActionRelationshipAnchor code '"+codeString+"'"); + } + public String toCode(ActionRelationshipAnchor code) { + if (code == ActionRelationshipAnchor.START) + return "start"; + if (code == ActionRelationshipAnchor.END) + return "end"; + return "?"; + } + public String toSystem(ActionRelationshipAnchor code) { + return code.getSystem(); + } + } + + public enum ParticipantType { + /** + * The participant is the patient under evaluation + */ + PATIENT, + /** + * The participant is a practitioner involved in the patient's care + */ + PRACTITIONER, + /** + * The participant is a person related to the patient + */ + RELATEDPERSON, + /** + * added to help the parsers + */ + NULL; + public static ParticipantType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("patient".equals(codeString)) + return PATIENT; + if ("practitioner".equals(codeString)) + return PRACTITIONER; + if ("related-person".equals(codeString)) + return RELATEDPERSON; + throw new FHIRException("Unknown ParticipantType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PATIENT: return "patient"; + case PRACTITIONER: return "practitioner"; + case RELATEDPERSON: return "related-person"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PATIENT: return "http://hl7.org/fhir/action-participant-type"; + case PRACTITIONER: return "http://hl7.org/fhir/action-participant-type"; + case RELATEDPERSON: return "http://hl7.org/fhir/action-participant-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PATIENT: return "The participant is the patient under evaluation"; + case PRACTITIONER: return "The participant is a practitioner involved in the patient's care"; + case RELATEDPERSON: return "The participant is a person related to the patient"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PATIENT: return "Patient"; + case PRACTITIONER: return "Practitioner"; + case RELATEDPERSON: return "Related Person"; + default: return "?"; + } + } + } + + public static class ParticipantTypeEnumFactory implements EnumFactory { + public ParticipantType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("patient".equals(codeString)) + return ParticipantType.PATIENT; + if ("practitioner".equals(codeString)) + return ParticipantType.PRACTITIONER; + if ("related-person".equals(codeString)) + return ParticipantType.RELATEDPERSON; + throw new IllegalArgumentException("Unknown ParticipantType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("patient".equals(codeString)) + return new Enumeration(this, ParticipantType.PATIENT); + if ("practitioner".equals(codeString)) + return new Enumeration(this, ParticipantType.PRACTITIONER); + if ("related-person".equals(codeString)) + return new Enumeration(this, ParticipantType.RELATEDPERSON); + throw new FHIRException("Unknown ParticipantType code '"+codeString+"'"); + } + public String toCode(ParticipantType code) { + if (code == ParticipantType.PATIENT) + return "patient"; + if (code == ParticipantType.PRACTITIONER) + return "practitioner"; + if (code == ParticipantType.RELATEDPERSON) + return "related-person"; + return "?"; + } + public String toSystem(ParticipantType code) { + return code.getSystem(); + } + } + + public enum ActionType { + /** + * The action is to create a new resource + */ + CREATE, + /** + * The action is to update an existing resource + */ + UPDATE, + /** + * The action is to remove an existing resource + */ + REMOVE, + /** + * The action is to fire a specific event + */ + FIREEVENT, + /** + * added to help the parsers + */ + NULL; + public static ActionType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("create".equals(codeString)) + return CREATE; + if ("update".equals(codeString)) + return UPDATE; + if ("remove".equals(codeString)) + return REMOVE; + if ("fire-event".equals(codeString)) + return FIREEVENT; + throw new FHIRException("Unknown ActionType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CREATE: return "create"; + case UPDATE: return "update"; + case REMOVE: return "remove"; + case FIREEVENT: return "fire-event"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CREATE: return "http://hl7.org/fhir/action-type"; + case UPDATE: return "http://hl7.org/fhir/action-type"; + case REMOVE: return "http://hl7.org/fhir/action-type"; + case FIREEVENT: return "http://hl7.org/fhir/action-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CREATE: return "The action is to create a new resource"; + case UPDATE: return "The action is to update an existing resource"; + case REMOVE: return "The action is to remove an existing resource"; + case FIREEVENT: return "The action is to fire a specific event"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CREATE: return "Create"; + case UPDATE: return "Update"; + case REMOVE: return "Remove"; + case FIREEVENT: return "Fire Event"; + default: return "?"; + } + } + } + + public static class ActionTypeEnumFactory implements EnumFactory { + public ActionType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("create".equals(codeString)) + return ActionType.CREATE; + if ("update".equals(codeString)) + return ActionType.UPDATE; + if ("remove".equals(codeString)) + return ActionType.REMOVE; + if ("fire-event".equals(codeString)) + return ActionType.FIREEVENT; + throw new IllegalArgumentException("Unknown ActionType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("create".equals(codeString)) + return new Enumeration(this, ActionType.CREATE); + if ("update".equals(codeString)) + return new Enumeration(this, ActionType.UPDATE); + if ("remove".equals(codeString)) + return new Enumeration(this, ActionType.REMOVE); + if ("fire-event".equals(codeString)) + return new Enumeration(this, ActionType.FIREEVENT); + throw new FHIRException("Unknown ActionType code '"+codeString+"'"); + } + public String toCode(ActionType code) { + if (code == ActionType.CREATE) + return "create"; + if (code == ActionType.UPDATE) + return "update"; + if (code == ActionType.REMOVE) + return "remove"; + if (code == ActionType.FIREEVENT) + return "fire-event"; + return "?"; + } + public String toSystem(ActionType code) { + return code.getSystem(); + } + } + + @Block() + public static class ActionDefinitionRelatedActionComponent extends Element implements IBaseDatatypeElement { + /** + * The unique identifier of the related action. + */ + @Child(name = "actionIdentifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier of the related action", formalDefinition="The unique identifier of the related action." ) + protected Identifier actionIdentifier; + + /** + * The relationship of this action to the related action. + */ + @Child(name = "relationship", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="before | after", formalDefinition="The relationship of this action to the related action." ) + protected Enumeration relationship; + + /** + * A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. + */ + @Child(name = "offset", type = {Duration.class, Range.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time offset for the relationship", formalDefinition="A duration or range of durations to apply to the relationship. For example, 30-60 minutes before." ) + protected Type offset; + + /** + * An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. + */ + @Child(name = "anchor", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="start | end", formalDefinition="An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action." ) + protected Enumeration anchor; + + private static final long serialVersionUID = 451097227L; + + /** + * Constructor + */ + public ActionDefinitionRelatedActionComponent() { + super(); + } + + /** + * Constructor + */ + public ActionDefinitionRelatedActionComponent(Identifier actionIdentifier, Enumeration relationship) { + super(); + this.actionIdentifier = actionIdentifier; + this.relationship = relationship; + } + + /** + * @return {@link #actionIdentifier} (The unique identifier of the related action.) + */ + public Identifier getActionIdentifier() { + if (this.actionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinitionRelatedActionComponent.actionIdentifier"); + else if (Configuration.doAutoCreate()) + this.actionIdentifier = new Identifier(); // cc + return this.actionIdentifier; + } + + public boolean hasActionIdentifier() { + return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); + } + + /** + * @param value {@link #actionIdentifier} (The unique identifier of the related action.) + */ + public ActionDefinitionRelatedActionComponent setActionIdentifier(Identifier value) { + this.actionIdentifier = value; + return this; + } + + /** + * @return {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value + */ + public Enumeration getRelationshipElement() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinitionRelatedActionComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Enumeration(new ActionRelationshipTypeEnumFactory()); // bb + return this.relationship; + } + + public boolean hasRelationshipElement() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value + */ + public ActionDefinitionRelatedActionComponent setRelationshipElement(Enumeration value) { + this.relationship = value; + return this; + } + + /** + * @return The relationship of this action to the related action. + */ + public ActionRelationshipType getRelationship() { + return this.relationship == null ? null : this.relationship.getValue(); + } + + /** + * @param value The relationship of this action to the related action. + */ + public ActionDefinitionRelatedActionComponent setRelationship(ActionRelationshipType value) { + if (this.relationship == null) + this.relationship = new Enumeration(new ActionRelationshipTypeEnumFactory()); + this.relationship.setValue(value); + return this; + } + + /** + * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) + */ + public Type getOffset() { + return this.offset; + } + + /** + * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) + */ + public Duration getOffsetDuration() throws FHIRException { + if (!(this.offset instanceof Duration)) + throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.offset.getClass().getName()+" was encountered"); + return (Duration) this.offset; + } + + public boolean hasOffsetDuration() { + return this.offset instanceof Duration; + } + + /** + * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) + */ + public Range getOffsetRange() throws FHIRException { + if (!(this.offset instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.offset.getClass().getName()+" was encountered"); + return (Range) this.offset; + } + + public boolean hasOffsetRange() { + return this.offset instanceof Range; + } + + public boolean hasOffset() { + return this.offset != null && !this.offset.isEmpty(); + } + + /** + * @param value {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) + */ + public ActionDefinitionRelatedActionComponent setOffset(Type value) { + this.offset = value; + return this; + } + + /** + * @return {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value + */ + public Enumeration getAnchorElement() { + if (this.anchor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinitionRelatedActionComponent.anchor"); + else if (Configuration.doAutoCreate()) + this.anchor = new Enumeration(new ActionRelationshipAnchorEnumFactory()); // bb + return this.anchor; + } + + public boolean hasAnchorElement() { + return this.anchor != null && !this.anchor.isEmpty(); + } + + public boolean hasAnchor() { + return this.anchor != null && !this.anchor.isEmpty(); + } + + /** + * @param value {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value + */ + public ActionDefinitionRelatedActionComponent setAnchorElement(Enumeration value) { + this.anchor = value; + return this; + } + + /** + * @return An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. + */ + public ActionRelationshipAnchor getAnchor() { + return this.anchor == null ? null : this.anchor.getValue(); + } + + /** + * @param value An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. + */ + public ActionDefinitionRelatedActionComponent setAnchor(ActionRelationshipAnchor value) { + if (value == null) + this.anchor = null; + else { + if (this.anchor == null) + this.anchor = new Enumeration(new ActionRelationshipAnchorEnumFactory()); + this.anchor.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("actionIdentifier", "Identifier", "The unique identifier of the related action.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); + childrenList.add(new Property("relationship", "code", "The relationship of this action to the related action.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("offset[x]", "Duration|Range", "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, java.lang.Integer.MAX_VALUE, offset)); + childrenList.add(new Property("anchor", "code", "An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action.", 0, java.lang.Integer.MAX_VALUE, anchor)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Enumeration + case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // Type + case -1413299531: /*anchor*/ return this.anchor == null ? new Base[0] : new Base[] {this.anchor}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -889046145: // actionIdentifier + this.actionIdentifier = castToIdentifier(value); // Identifier + break; + case -261851592: // relationship + this.relationship = new ActionRelationshipTypeEnumFactory().fromType(value); // Enumeration + break; + case -1019779949: // offset + this.offset = (Type) value; // Type + break; + case -1413299531: // anchor + this.anchor = new ActionRelationshipAnchorEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("actionIdentifier")) + this.actionIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("relationship")) + this.relationship = new ActionRelationshipTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("offset[x]")) + this.offset = (Type) value; // Type + else if (name.equals("anchor")) + this.anchor = new ActionRelationshipAnchorEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -889046145: return getActionIdentifier(); // Identifier + case -261851592: throw new FHIRException("Cannot make property relationship as it is not a complex type"); // Enumeration + case -1960684787: return getOffset(); // Type + case -1413299531: throw new FHIRException("Cannot make property anchor as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("actionIdentifier")) { + this.actionIdentifier = new Identifier(); + return this.actionIdentifier; + } + else if (name.equals("relationship")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.relationship"); + } + else if (name.equals("offsetDuration")) { + this.offset = new Duration(); + return this.offset; + } + else if (name.equals("offsetRange")) { + this.offset = new Range(); + return this.offset; + } + else if (name.equals("anchor")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.anchor"); + } + else + return super.addChild(name); + } + + public ActionDefinitionRelatedActionComponent copy() { + ActionDefinitionRelatedActionComponent dst = new ActionDefinitionRelatedActionComponent(); + copyValues(dst); + dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.offset = offset == null ? null : offset.copy(); + dst.anchor = anchor == null ? null : anchor.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ActionDefinitionRelatedActionComponent)) + return false; + ActionDefinitionRelatedActionComponent o = (ActionDefinitionRelatedActionComponent) other; + return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(relationship, o.relationship, true) + && compareDeep(offset, o.offset, true) && compareDeep(anchor, o.anchor, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ActionDefinitionRelatedActionComponent)) + return false; + ActionDefinitionRelatedActionComponent o = (ActionDefinitionRelatedActionComponent) other; + return compareValues(relationship, o.relationship, true) && compareValues(anchor, o.anchor, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (relationship == null || relationship.isEmpty()) + && (offset == null || offset.isEmpty()) && (anchor == null || anchor.isEmpty()); + } + + public String fhirType() { + return "ActionDefinition.relatedAction"; + + } + + } + + @Block() + public static class ActionDefinitionBehaviorComponent extends Element implements IBaseDatatypeElement { + /** + * The type of the behavior to be described, such as grouping, visual, or selection behaviors. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The type of behavior (grouping, precheck, selection, cardinality, etc)", formalDefinition="The type of the behavior to be described, such as grouping, visual, or selection behaviors." ) + protected Coding type; + + /** + * The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset. + */ + @Child(name = "value", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specific behavior (e.g. required, at-most-one, single, etc)", formalDefinition="The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset." ) + protected Coding value; + + private static final long serialVersionUID = -1054119695L; + + /** + * Constructor + */ + public ActionDefinitionBehaviorComponent() { + super(); + } + + /** + * Constructor + */ + public ActionDefinitionBehaviorComponent(Coding type, Coding value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinitionBehaviorComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) + */ + public ActionDefinitionBehaviorComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) + */ + public Coding getValue() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinitionBehaviorComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new Coding(); // cc + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) + */ + public ActionDefinitionBehaviorComponent setValue(Coding value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "The type of the behavior to be described, such as grouping, visual, or selection behaviors.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value", "Coding", "The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 111972721: // value + this.value = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("value")) + this.value = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 111972721: return getValue(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("value")) { + this.value = new Coding(); + return this.value; + } + else + return super.addChild(name); + } + + public ActionDefinitionBehaviorComponent copy() { + ActionDefinitionBehaviorComponent dst = new ActionDefinitionBehaviorComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ActionDefinitionBehaviorComponent)) + return false; + ActionDefinitionBehaviorComponent o = (ActionDefinitionBehaviorComponent) other; + return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ActionDefinitionBehaviorComponent)) + return false; + ActionDefinitionBehaviorComponent o = (ActionDefinitionBehaviorComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "ActionDefinition.behavior"; + + } + + } + + @Block() + public static class ActionDefinitionCustomizationComponent extends Element implements IBaseDatatypeElement { + /** + * The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. + */ + @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The path to the element to be set dynamically", formalDefinition="The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression." ) + protected StringType path; + + /** + * An expression specifying the value of the customized element. + */ + @Child(name = "expression", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="An expression that provides the dynamic value for the customization", formalDefinition="An expression specifying the value of the customized element." ) + protected StringType expression; + + private static final long serialVersionUID = -252690483L; + + /** + * Constructor + */ + public ActionDefinitionCustomizationComponent() { + super(); + } + + /** + * Constructor + */ + public ActionDefinitionCustomizationComponent(StringType path, StringType expression) { + super(); + this.path = path; + this.expression = expression; + } + + /** + * @return {@link #path} (The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinitionCustomizationComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public ActionDefinitionCustomizationComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. + */ + public ActionDefinitionCustomizationComponent setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #expression} (An expression specifying the value of the customized element.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public StringType getExpressionElement() { + if (this.expression == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinitionCustomizationComponent.expression"); + else if (Configuration.doAutoCreate()) + this.expression = new StringType(); // bb + return this.expression; + } + + public boolean hasExpressionElement() { + return this.expression != null && !this.expression.isEmpty(); + } + + public boolean hasExpression() { + return this.expression != null && !this.expression.isEmpty(); + } + + /** + * @param value {@link #expression} (An expression specifying the value of the customized element.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public ActionDefinitionCustomizationComponent setExpressionElement(StringType value) { + this.expression = value; + return this; + } + + /** + * @return An expression specifying the value of the customized element. + */ + public String getExpression() { + return this.expression == null ? null : this.expression.getValue(); + } + + /** + * @param value An expression specifying the value of the customized element. + */ + public ActionDefinitionCustomizationComponent setExpression(String value) { + if (this.expression == null) + this.expression = new StringType(); + this.expression.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("expression", "string", "An expression specifying the value of the customized element.", 0, java.lang.Integer.MAX_VALUE, expression)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3433509: // path + this.path = castToString(value); // StringType + break; + case -1795452264: // expression + this.expression = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("expression")) + this.expression = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.path"); + } + else if (name.equals("expression")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.expression"); + } + else + return super.addChild(name); + } + + public ActionDefinitionCustomizationComponent copy() { + ActionDefinitionCustomizationComponent dst = new ActionDefinitionCustomizationComponent(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + dst.expression = expression == null ? null : expression.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ActionDefinitionCustomizationComponent)) + return false; + ActionDefinitionCustomizationComponent o = (ActionDefinitionCustomizationComponent) other; + return compareDeep(path, o.path, true) && compareDeep(expression, o.expression, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ActionDefinitionCustomizationComponent)) + return false; + ActionDefinitionCustomizationComponent o = (ActionDefinitionCustomizationComponent) other; + return compareValues(path, o.path, true) && compareValues(expression, o.expression, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (expression == null || expression.isEmpty()) + ; + } + + public String fhirType() { + return "ActionDefinition.customization"; + + } + + } + + /** + * A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique. + */ + @Child(name = "actionIdentifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique." ) + protected Identifier actionIdentifier; + + /** + * A user-visible label for the action. + */ + @Child(name = "label", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="User-visible label for the action (e.g. 1. or A.)", formalDefinition="A user-visible label for the action." ) + protected StringType label; + + /** + * The title of the action displayed to a user. + */ + @Child(name = "title", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="User-visible title", formalDefinition="The title of the action displayed to a user." ) + protected StringType title; + + /** + * A short description of the action used to provide a summary to display to the user. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Short description of the action", formalDefinition="A short description of the action used to provide a summary to display to the user." ) + protected StringType description; + + /** + * A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. + */ + @Child(name = "textEquivalent", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Static text equivalent of the action, used if the dynamic aspects cannot be interpreted by the receiving system", formalDefinition="A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically." ) + protected StringType textEquivalent; + + /** + * The concept represented by this action or its sub-actions. + */ + @Child(name = "concept", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The meaning of the action or its sub-actions", formalDefinition="The concept represented by this action or its sub-actions." ) + protected List concept; + + /** + * The evidence grade and the sources of evidence for this action. + */ + @Child(name = "supportingEvidence", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Evidence that supports taking the action", formalDefinition="The evidence grade and the sources of evidence for this action." ) + protected List supportingEvidence; + + /** + * Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. + */ + @Child(name = "documentation", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Supporting documentation for the intended performer of the action", formalDefinition="Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources." ) + protected List documentation; + + /** + * A relationship to another action such as "before" or "30-60 minutes after start of". + */ + @Child(name = "relatedAction", type = {}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." ) + protected ActionDefinitionRelatedActionComponent relatedAction; + + /** + * The type of participant in the action. + */ + @Child(name = "participantType", type = {CodeType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="patient | practitioner | related-person", formalDefinition="The type of participant in the action." ) + protected List> participantType; + + /** + * The type of action to perform (create, update, remove). + */ + @Child(name = "type", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." ) + protected Enumeration type; + + /** + * A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment. + */ + @Child(name = "behavior", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Defines behaviors such as selection and grouping", formalDefinition="A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment." ) + protected List behavior; + + /** + * The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition). + */ + @Child(name = "resource", type = {}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Static portion of the action definition", formalDefinition="The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition)." ) + protected Reference resource; + + /** + * The actual object that is the target of the reference (The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) + */ + protected Resource resourceTarget; + + /** + * Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. + */ + @Child(name = "customization", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Dynamic aspects of the definition", formalDefinition="Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result." ) + protected List customization; + + /** + * Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition. + */ + @Child(name = "action", type = {ActionDefinition.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A sub-action", formalDefinition="Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition." ) + protected List action; + + private static final long serialVersionUID = -1659761573L; + + /** + * Constructor + */ + public ActionDefinition() { + super(); + } + + /** + * @return {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) + */ + public Identifier getActionIdentifier() { + if (this.actionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinition.actionIdentifier"); + else if (Configuration.doAutoCreate()) + this.actionIdentifier = new Identifier(); // cc + return this.actionIdentifier; + } + + public boolean hasActionIdentifier() { + return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); + } + + /** + * @param value {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) + */ + public ActionDefinition setActionIdentifier(Identifier value) { + this.actionIdentifier = value; + return this; + } + + /** + * @return {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public StringType getLabelElement() { + if (this.label == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinition.label"); + else if (Configuration.doAutoCreate()) + this.label = new StringType(); // bb + return this.label; + } + + public boolean hasLabelElement() { + return this.label != null && !this.label.isEmpty(); + } + + public boolean hasLabel() { + return this.label != null && !this.label.isEmpty(); + } + + /** + * @param value {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public ActionDefinition setLabelElement(StringType value) { + this.label = value; + return this; + } + + /** + * @return A user-visible label for the action. + */ + public String getLabel() { + return this.label == null ? null : this.label.getValue(); + } + + /** + * @param value A user-visible label for the action. + */ + public ActionDefinition setLabel(String value) { + if (Utilities.noString(value)) + this.label = null; + else { + if (this.label == null) + this.label = new StringType(); + this.label.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinition.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public ActionDefinition setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The title of the action displayed to a user. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The title of the action displayed to a user. + */ + public ActionDefinition setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A short description of the action used to provide a summary to display to the user.). 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 ActionDefinition.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 short description of the action used to provide a summary to display to the user.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ActionDefinition setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A short description of the action used to provide a summary to display to the user. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A short description of the action used to provide a summary to display to the user. + */ + public ActionDefinition 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 #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value + */ + public StringType getTextEquivalentElement() { + if (this.textEquivalent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinition.textEquivalent"); + else if (Configuration.doAutoCreate()) + this.textEquivalent = new StringType(); // bb + return this.textEquivalent; + } + + public boolean hasTextEquivalentElement() { + return this.textEquivalent != null && !this.textEquivalent.isEmpty(); + } + + public boolean hasTextEquivalent() { + return this.textEquivalent != null && !this.textEquivalent.isEmpty(); + } + + /** + * @param value {@link #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value + */ + public ActionDefinition setTextEquivalentElement(StringType value) { + this.textEquivalent = value; + return this; + } + + /** + * @return A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. + */ + public String getTextEquivalent() { + return this.textEquivalent == null ? null : this.textEquivalent.getValue(); + } + + /** + * @param value A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. + */ + public ActionDefinition setTextEquivalent(String value) { + if (Utilities.noString(value)) + this.textEquivalent = null; + else { + if (this.textEquivalent == null) + this.textEquivalent = new StringType(); + this.textEquivalent.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (The concept represented by this action or its sub-actions.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (CodeableConcept item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (The concept represented by this action or its sub-actions.) + */ + // syntactic sugar + public CodeableConcept addConcept() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public ActionDefinition addConcept(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + /** + * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) + */ + public List getSupportingEvidence() { + if (this.supportingEvidence == null) + this.supportingEvidence = new ArrayList(); + return this.supportingEvidence; + } + + public boolean hasSupportingEvidence() { + if (this.supportingEvidence == null) + return false; + for (Attachment item : this.supportingEvidence) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) + */ + // syntactic sugar + public Attachment addSupportingEvidence() { //3 + Attachment t = new Attachment(); + if (this.supportingEvidence == null) + this.supportingEvidence = new ArrayList(); + this.supportingEvidence.add(t); + return t; + } + + // syntactic sugar + public ActionDefinition addSupportingEvidence(Attachment t) { //3 + if (t == null) + return this; + if (this.supportingEvidence == null) + this.supportingEvidence = new ArrayList(); + this.supportingEvidence.add(t); + return this; + } + + /** + * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) + */ + public List getDocumentation() { + if (this.documentation == null) + this.documentation = new ArrayList(); + return this.documentation; + } + + public boolean hasDocumentation() { + if (this.documentation == null) + return false; + for (Attachment item : this.documentation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) + */ + // syntactic sugar + public Attachment addDocumentation() { //3 + Attachment t = new Attachment(); + if (this.documentation == null) + this.documentation = new ArrayList(); + this.documentation.add(t); + return t; + } + + // syntactic sugar + public ActionDefinition addDocumentation(Attachment t) { //3 + if (t == null) + return this; + if (this.documentation == null) + this.documentation = new ArrayList(); + this.documentation.add(t); + return this; + } + + /** + * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) + */ + public ActionDefinitionRelatedActionComponent getRelatedAction() { + if (this.relatedAction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinition.relatedAction"); + else if (Configuration.doAutoCreate()) + this.relatedAction = new ActionDefinitionRelatedActionComponent(); // cc + return this.relatedAction; + } + + public boolean hasRelatedAction() { + return this.relatedAction != null && !this.relatedAction.isEmpty(); + } + + /** + * @param value {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) + */ + public ActionDefinition setRelatedAction(ActionDefinitionRelatedActionComponent value) { + this.relatedAction = value; + return this; + } + + /** + * @return {@link #participantType} (The type of participant in the action.) + */ + public List> getParticipantType() { + if (this.participantType == null) + this.participantType = new ArrayList>(); + return this.participantType; + } + + public boolean hasParticipantType() { + if (this.participantType == null) + return false; + for (Enumeration item : this.participantType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participantType} (The type of participant in the action.) + */ + // syntactic sugar + public Enumeration addParticipantTypeElement() {//2 + Enumeration t = new Enumeration(new ParticipantTypeEnumFactory()); + if (this.participantType == null) + this.participantType = new ArrayList>(); + this.participantType.add(t); + return t; + } + + /** + * @param value {@link #participantType} (The type of participant in the action.) + */ + public ActionDefinition addParticipantType(ParticipantType value) { //1 + Enumeration t = new Enumeration(new ParticipantTypeEnumFactory()); + t.setValue(value); + if (this.participantType == null) + this.participantType = new ArrayList>(); + this.participantType.add(t); + return this; + } + + /** + * @param value {@link #participantType} (The type of participant in the action.) + */ + public boolean hasParticipantType(ParticipantType value) { + if (this.participantType == null) + return false; + for (Enumeration v : this.participantType) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #type} (The type of action to perform (create, update, remove).). 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 ActionDefinition.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ActionTypeEnumFactory()); // bb + 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 of action to perform (create, update, remove).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ActionDefinition setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of action to perform (create, update, remove). + */ + public ActionType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of action to perform (create, update, remove). + */ + public ActionDefinition setType(ActionType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new ActionTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) + */ + public List getBehavior() { + if (this.behavior == null) + this.behavior = new ArrayList(); + return this.behavior; + } + + public boolean hasBehavior() { + if (this.behavior == null) + return false; + for (ActionDefinitionBehaviorComponent item : this.behavior) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) + */ + // syntactic sugar + public ActionDefinitionBehaviorComponent addBehavior() { //3 + ActionDefinitionBehaviorComponent t = new ActionDefinitionBehaviorComponent(); + if (this.behavior == null) + this.behavior = new ArrayList(); + this.behavior.add(t); + return t; + } + + // syntactic sugar + public ActionDefinition addBehavior(ActionDefinitionBehaviorComponent t) { //3 + if (t == null) + return this; + if (this.behavior == null) + this.behavior = new ArrayList(); + this.behavior.add(t); + return this; + } + + /** + * @return {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) + */ + public Reference getResource() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ActionDefinition.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new Reference(); // cc + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) + */ + public ActionDefinition setResource(Reference value) { + this.resource = value; + return this; + } + + /** + * @return {@link #resource} 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 that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) + */ + public Resource getResourceTarget() { + return this.resourceTarget; + } + + /** + * @param value {@link #resource} 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 that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) + */ + public ActionDefinition setResourceTarget(Resource value) { + this.resourceTarget = value; + return this; + } + + /** + * @return {@link #customization} (Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.) + */ + public List getCustomization() { + if (this.customization == null) + this.customization = new ArrayList(); + return this.customization; + } + + public boolean hasCustomization() { + if (this.customization == null) + return false; + for (ActionDefinitionCustomizationComponent item : this.customization) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #customization} (Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.) + */ + // syntactic sugar + public ActionDefinitionCustomizationComponent addCustomization() { //3 + ActionDefinitionCustomizationComponent t = new ActionDefinitionCustomizationComponent(); + if (this.customization == null) + this.customization = new ArrayList(); + this.customization.add(t); + return t; + } + + // syntactic sugar + public ActionDefinition addCustomization(ActionDefinitionCustomizationComponent t) { //3 + if (t == null) + return this; + if (this.customization == null) + this.customization = new ArrayList(); + this.customization.add(t); + return this; + } + + /** + * @return {@link #action} (Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (ActionDefinition item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.) + */ + // syntactic sugar + public ActionDefinition addAction() { //3 + ActionDefinition t = new ActionDefinition(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public ActionDefinition addAction(ActionDefinition t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("actionIdentifier", "Identifier", "A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); + childrenList.add(new Property("label", "string", "A user-visible label for the action.", 0, java.lang.Integer.MAX_VALUE, label)); + childrenList.add(new Property("title", "string", "The title of the action displayed to a user.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("description", "string", "A short description of the action used to provide a summary to display to the user.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("textEquivalent", "string", "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.", 0, java.lang.Integer.MAX_VALUE, textEquivalent)); + childrenList.add(new Property("concept", "CodeableConcept", "The concept represented by this action or its sub-actions.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("supportingEvidence", "Attachment", "The evidence grade and the sources of evidence for this action.", 0, java.lang.Integer.MAX_VALUE, supportingEvidence)); + childrenList.add(new Property("documentation", "Attachment", "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("relatedAction", "", "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0, java.lang.Integer.MAX_VALUE, relatedAction)); + childrenList.add(new Property("participantType", "code", "The type of participant in the action.", 0, java.lang.Integer.MAX_VALUE, participantType)); + childrenList.add(new Property("type", "code", "The type of action to perform (create, update, remove).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("behavior", "", "A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.", 0, java.lang.Integer.MAX_VALUE, behavior)); + childrenList.add(new Property("resource", "Reference(Any)", "The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("customization", "", "Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.", 0, java.lang.Integer.MAX_VALUE, customization)); + childrenList.add(new Property("action", "ActionDefinition", "Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier + case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -900391049: /*textEquivalent*/ return this.textEquivalent == null ? new Base[0] : new Base[] {this.textEquivalent}; // StringType + case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // CodeableConcept + case -1735429846: /*supportingEvidence*/ return this.supportingEvidence == null ? new Base[0] : this.supportingEvidence.toArray(new Base[this.supportingEvidence.size()]); // Attachment + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // Attachment + case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : new Base[] {this.relatedAction}; // ActionDefinitionRelatedActionComponent + case 841294093: /*participantType*/ return this.participantType == null ? new Base[0] : this.participantType.toArray(new Base[this.participantType.size()]); // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 1510912594: /*behavior*/ return this.behavior == null ? new Base[0] : this.behavior.toArray(new Base[this.behavior.size()]); // ActionDefinitionBehaviorComponent + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference + case 1637263315: /*customization*/ return this.customization == null ? new Base[0] : this.customization.toArray(new Base[this.customization.size()]); // ActionDefinitionCustomizationComponent + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // ActionDefinition + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -889046145: // actionIdentifier + this.actionIdentifier = castToIdentifier(value); // Identifier + break; + case 102727412: // label + this.label = castToString(value); // StringType + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -900391049: // textEquivalent + this.textEquivalent = castToString(value); // StringType + break; + case 951024232: // concept + this.getConcept().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1735429846: // supportingEvidence + this.getSupportingEvidence().add(castToAttachment(value)); // Attachment + break; + case 1587405498: // documentation + this.getDocumentation().add(castToAttachment(value)); // Attachment + break; + case -384107967: // relatedAction + this.relatedAction = (ActionDefinitionRelatedActionComponent) value; // ActionDefinitionRelatedActionComponent + break; + case 841294093: // participantType + this.getParticipantType().add(new ParticipantTypeEnumFactory().fromType(value)); // Enumeration + break; + case 3575610: // type + this.type = new ActionTypeEnumFactory().fromType(value); // Enumeration + break; + case 1510912594: // behavior + this.getBehavior().add((ActionDefinitionBehaviorComponent) value); // ActionDefinitionBehaviorComponent + break; + case -341064690: // resource + this.resource = castToReference(value); // Reference + break; + case 1637263315: // customization + this.getCustomization().add((ActionDefinitionCustomizationComponent) value); // ActionDefinitionCustomizationComponent + break; + case -1422950858: // action + this.getAction().add(castToActionDefinition(value)); // ActionDefinition + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("actionIdentifier")) + this.actionIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("label")) + this.label = castToString(value); // StringType + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("textEquivalent")) + this.textEquivalent = castToString(value); // StringType + else if (name.equals("concept")) + this.getConcept().add(castToCodeableConcept(value)); + else if (name.equals("supportingEvidence")) + this.getSupportingEvidence().add(castToAttachment(value)); + else if (name.equals("documentation")) + this.getDocumentation().add(castToAttachment(value)); + else if (name.equals("relatedAction")) + this.relatedAction = (ActionDefinitionRelatedActionComponent) value; // ActionDefinitionRelatedActionComponent + else if (name.equals("participantType")) + this.getParticipantType().add(new ParticipantTypeEnumFactory().fromType(value)); + else if (name.equals("type")) + this.type = new ActionTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("behavior")) + this.getBehavior().add((ActionDefinitionBehaviorComponent) value); + else if (name.equals("resource")) + this.resource = castToReference(value); // Reference + else if (name.equals("customization")) + this.getCustomization().add((ActionDefinitionCustomizationComponent) value); + else if (name.equals("action")) + this.getAction().add(castToActionDefinition(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -889046145: return getActionIdentifier(); // Identifier + case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -900391049: throw new FHIRException("Cannot make property textEquivalent as it is not a complex type"); // StringType + case 951024232: return addConcept(); // CodeableConcept + case -1735429846: return addSupportingEvidence(); // Attachment + case 1587405498: return addDocumentation(); // Attachment + case -384107967: return getRelatedAction(); // ActionDefinitionRelatedActionComponent + case 841294093: throw new FHIRException("Cannot make property participantType as it is not a complex type"); // Enumeration + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 1510912594: return addBehavior(); // ActionDefinitionBehaviorComponent + case -341064690: return getResource(); // Reference + case 1637263315: return addCustomization(); // ActionDefinitionCustomizationComponent + case -1422950858: return addAction(); // ActionDefinition + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("actionIdentifier")) { + this.actionIdentifier = new Identifier(); + return this.actionIdentifier; + } + else if (name.equals("label")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.label"); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.title"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.description"); + } + else if (name.equals("textEquivalent")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.textEquivalent"); + } + else if (name.equals("concept")) { + return addConcept(); + } + else if (name.equals("supportingEvidence")) { + return addSupportingEvidence(); + } + else if (name.equals("documentation")) { + return addDocumentation(); + } + else if (name.equals("relatedAction")) { + this.relatedAction = new ActionDefinitionRelatedActionComponent(); + return this.relatedAction; + } + else if (name.equals("participantType")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.participantType"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.type"); + } + else if (name.equals("behavior")) { + return addBehavior(); + } + else if (name.equals("resource")) { + this.resource = new Reference(); + return this.resource; + } + else if (name.equals("customization")) { + return addCustomization(); + } + else if (name.equals("action")) { + return addAction(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ActionDefinition"; + + } + + public ActionDefinition copy() { + ActionDefinition dst = new ActionDefinition(); + copyValues(dst); + dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); + dst.label = label == null ? null : label.copy(); + dst.title = title == null ? null : title.copy(); + dst.description = description == null ? null : description.copy(); + dst.textEquivalent = textEquivalent == null ? null : textEquivalent.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (CodeableConcept i : concept) + dst.concept.add(i.copy()); + }; + if (supportingEvidence != null) { + dst.supportingEvidence = new ArrayList(); + for (Attachment i : supportingEvidence) + dst.supportingEvidence.add(i.copy()); + }; + if (documentation != null) { + dst.documentation = new ArrayList(); + for (Attachment i : documentation) + dst.documentation.add(i.copy()); + }; + dst.relatedAction = relatedAction == null ? null : relatedAction.copy(); + if (participantType != null) { + dst.participantType = new ArrayList>(); + for (Enumeration i : participantType) + dst.participantType.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (behavior != null) { + dst.behavior = new ArrayList(); + for (ActionDefinitionBehaviorComponent i : behavior) + dst.behavior.add(i.copy()); + }; + dst.resource = resource == null ? null : resource.copy(); + if (customization != null) { + dst.customization = new ArrayList(); + for (ActionDefinitionCustomizationComponent i : customization) + dst.customization.add(i.copy()); + }; + if (action != null) { + dst.action = new ArrayList(); + for (ActionDefinition i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + protected ActionDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ActionDefinition)) + return false; + ActionDefinition o = (ActionDefinition) other; + return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(label, o.label, true) + && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) && compareDeep(textEquivalent, o.textEquivalent, true) + && compareDeep(concept, o.concept, true) && compareDeep(supportingEvidence, o.supportingEvidence, true) + && compareDeep(documentation, o.documentation, true) && compareDeep(relatedAction, o.relatedAction, true) + && compareDeep(participantType, o.participantType, true) && compareDeep(type, o.type, true) && compareDeep(behavior, o.behavior, true) + && compareDeep(resource, o.resource, true) && compareDeep(customization, o.customization, true) + && compareDeep(action, o.action, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ActionDefinition)) + return false; + ActionDefinition o = (ActionDefinition) other; + return compareValues(label, o.label, true) && compareValues(title, o.title, true) && compareValues(description, o.description, true) + && compareValues(textEquivalent, o.textEquivalent, true) && compareValues(participantType, o.participantType, true) + && compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (label == null || label.isEmpty()) + && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (textEquivalent == null || textEquivalent.isEmpty()) + && (concept == null || concept.isEmpty()) && (supportingEvidence == null || supportingEvidence.isEmpty()) + && (documentation == null || documentation.isEmpty()) && (relatedAction == null || relatedAction.isEmpty()) + && (participantType == null || participantType.isEmpty()) && (type == null || type.isEmpty()) + && (behavior == null || behavior.isEmpty()) && (resource == null || resource.isEmpty()) && (customization == null || customization.isEmpty()) + && (action == null || action.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Address.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Address.java new file mode 100644 index 00000000000..a611fd7a37c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Address.java @@ -0,0 +1,1035 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. + */ +@DatatypeDef(name="Address") +public class Address extends Type implements ICompositeType { + + public enum AddressUse { + /** + * A communication address at a home. + */ + HOME, + /** + * An office address. First choice for business related contacts during business hours. + */ + WORK, + /** + * A temporary address. The period can provide more detailed information. + */ + TEMP, + /** + * This address is no longer in use (or was never correct, but retained for records). + */ + OLD, + /** + * added to help the parsers + */ + NULL; + public static AddressUse fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return HOME; + if ("work".equals(codeString)) + return WORK; + if ("temp".equals(codeString)) + return TEMP; + if ("old".equals(codeString)) + return OLD; + throw new FHIRException("Unknown AddressUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HOME: return "home"; + case WORK: return "work"; + case TEMP: return "temp"; + case OLD: return "old"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HOME: return "http://hl7.org/fhir/address-use"; + case WORK: return "http://hl7.org/fhir/address-use"; + case TEMP: return "http://hl7.org/fhir/address-use"; + case OLD: return "http://hl7.org/fhir/address-use"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HOME: return "A communication address at a home."; + case WORK: return "An office address. First choice for business related contacts during business hours."; + case TEMP: return "A temporary address. The period can provide more detailed information."; + case OLD: return "This address is no longer in use (or was never correct, but retained for records)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HOME: return "Home"; + case WORK: return "Work"; + case TEMP: return "Temporary"; + case OLD: return "Old / Incorrect"; + default: return "?"; + } + } + } + + 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; + if ("home".equals(codeString)) + return AddressUse.HOME; + if ("work".equals(codeString)) + return AddressUse.WORK; + if ("temp".equals(codeString)) + return AddressUse.TEMP; + if ("old".equals(codeString)) + return AddressUse.OLD; + throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return new Enumeration(this, AddressUse.HOME); + if ("work".equals(codeString)) + return new Enumeration(this, AddressUse.WORK); + if ("temp".equals(codeString)) + return new Enumeration(this, AddressUse.TEMP); + if ("old".equals(codeString)) + return new Enumeration(this, AddressUse.OLD); + throw new FHIRException("Unknown AddressUse code '"+codeString+"'"); + } + public String toCode(AddressUse code) { + if (code == AddressUse.HOME) + return "home"; + if (code == AddressUse.WORK) + return "work"; + if (code == AddressUse.TEMP) + return "temp"; + if (code == AddressUse.OLD) + return "old"; + return "?"; + } + public String toSystem(AddressUse code) { + return code.getSystem(); + } + } + + public enum AddressType { + /** + * Mailing addresses - PO Boxes and care-of addresses. + */ + POSTAL, + /** + * A physical address that can be visited. + */ + PHYSICAL, + /** + * An address that is both physical and postal. + */ + BOTH, + /** + * added to help the parsers + */ + NULL; + public static AddressType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("postal".equals(codeString)) + return POSTAL; + if ("physical".equals(codeString)) + return PHYSICAL; + if ("both".equals(codeString)) + return BOTH; + throw new FHIRException("Unknown AddressType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case POSTAL: return "postal"; + case PHYSICAL: return "physical"; + case BOTH: return "both"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case POSTAL: return "http://hl7.org/fhir/address-type"; + case PHYSICAL: return "http://hl7.org/fhir/address-type"; + case BOTH: return "http://hl7.org/fhir/address-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case POSTAL: return "Mailing addresses - PO Boxes and care-of addresses."; + case PHYSICAL: return "A physical address that can be visited."; + case BOTH: return "An address that is both physical and postal."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case POSTAL: return "Postal"; + case PHYSICAL: return "Physical"; + case BOTH: return "Postal & Physical"; + default: return "?"; + } + } + } + + public static class AddressTypeEnumFactory implements EnumFactory { + public AddressType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("postal".equals(codeString)) + return AddressType.POSTAL; + if ("physical".equals(codeString)) + return AddressType.PHYSICAL; + if ("both".equals(codeString)) + return AddressType.BOTH; + throw new IllegalArgumentException("Unknown AddressType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("postal".equals(codeString)) + return new Enumeration(this, AddressType.POSTAL); + if ("physical".equals(codeString)) + return new Enumeration(this, AddressType.PHYSICAL); + if ("both".equals(codeString)) + return new Enumeration(this, AddressType.BOTH); + throw new FHIRException("Unknown AddressType code '"+codeString+"'"); + } + public String toCode(AddressType code) { + if (code == AddressType.POSTAL) + return "postal"; + if (code == AddressType.PHYSICAL) + return "physical"; + if (code == AddressType.BOTH) + return "both"; + return "?"; + } + public String toSystem(AddressType code) { + return code.getSystem(); + } + } + + /** + * The purpose of this address. + */ + @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="home | work | temp | old - purpose of this address", formalDefinition="The purpose of this address." ) + protected Enumeration use; + + /** + * Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="postal | physical | both", formalDefinition="Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both." ) + protected Enumeration type; + + /** + * A full text representation of the address. + */ + @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Text representation of the address", formalDefinition="A full text representation of the address." ) + protected StringType text; + + /** + * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information. + */ + @Child(name = "line", type = {StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Street name, number, direction & P.O. Box etc.", formalDefinition="This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information." ) + protected List line; + + /** + * The name of the city, town, village or other community or delivery center. + */ + @Child(name = "city", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of city, town etc.", formalDefinition="The name of the city, town, village or other community or delivery center." ) + protected StringType city; + + /** + * The name of the administrative area (county). + */ + @Child(name = "district", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="District name (aka county)", formalDefinition="The name of the administrative area (county)." ) + protected StringType district; + + /** + * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + @Child(name = "state", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Sub-unit of country (abbreviations ok)", formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." ) + protected StringType state; + + /** + * A postal code designating a region defined by the postal service. + */ + @Child(name = "postalCode", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Postal code for area", formalDefinition="A postal code designating a region defined by the postal service." ) + protected StringType postalCode; + + /** + * Country - a nation as commonly understood or generally accepted. + */ + @Child(name = "country", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." ) + protected StringType country; + + /** + * Time period when address was/is in use. + */ + @Child(name = "period", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time period when address was/is in use", formalDefinition="Time period when address was/is in use." ) + protected Period period; + + private static final long serialVersionUID = 561490318L; + + /** + * Constructor + */ + public Address() { + super(); + } + + /** + * @return {@link #use} (The purpose of this address.). 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 Address.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new AddressUseEnumFactory()); // bb + 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} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Address setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return The purpose of this address. + */ + public AddressUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value The purpose of this address. + */ + public Address setUse(AddressUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new AddressUseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.). 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 Address.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new AddressTypeEnumFactory()); // bb + 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} (Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Address setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. + */ + public AddressType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. + */ + public Address setType(AddressType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new AddressTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public Address setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A full text representation of the address. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value A full text representation of the address. + */ + public Address setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #line} (This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.) + */ + public List getLine() { + if (this.line == null) + this.line = new ArrayList(); + return this.line; + } + + public boolean hasLine() { + if (this.line == null) + return false; + for (StringType item : this.line) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #line} (This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.) + */ + // syntactic sugar + public StringType addLineElement() {//2 + StringType t = new StringType(); + if (this.line == null) + this.line = new ArrayList(); + this.line.add(t); + return t; + } + + /** + * @param value {@link #line} (This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.) + */ + public Address addLine(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.line == null) + this.line = new ArrayList(); + this.line.add(t); + return this; + } + + /** + * @param value {@link #line} (This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.) + */ + public boolean hasLine(String value) { + if (this.line == null) + return false; + for (StringType v : this.line) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value + */ + public StringType getCityElement() { + if (this.city == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.city"); + else if (Configuration.doAutoCreate()) + this.city = new StringType(); // bb + return this.city; + } + + public boolean hasCityElement() { + return this.city != null && !this.city.isEmpty(); + } + + public boolean hasCity() { + return this.city != null && !this.city.isEmpty(); + } + + /** + * @param value {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value + */ + public Address setCityElement(StringType value) { + this.city = value; + return this; + } + + /** + * @return The name of the city, town, village or other community or delivery center. + */ + public String getCity() { + return this.city == null ? null : this.city.getValue(); + } + + /** + * @param value The name of the city, town, village or other community or delivery center. + */ + public Address setCity(String value) { + if (Utilities.noString(value)) + this.city = null; + else { + if (this.city == null) + this.city = new StringType(); + this.city.setValue(value); + } + return this; + } + + /** + * @return {@link #district} (The name of the administrative area (county).). This is the underlying object with id, value and extensions. The accessor "getDistrict" gives direct access to the value + */ + public StringType getDistrictElement() { + if (this.district == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.district"); + else if (Configuration.doAutoCreate()) + this.district = new StringType(); // bb + return this.district; + } + + public boolean hasDistrictElement() { + return this.district != null && !this.district.isEmpty(); + } + + public boolean hasDistrict() { + return this.district != null && !this.district.isEmpty(); + } + + /** + * @param value {@link #district} (The name of the administrative area (county).). This is the underlying object with id, value and extensions. The accessor "getDistrict" gives direct access to the value + */ + public Address setDistrictElement(StringType value) { + this.district = value; + return this; + } + + /** + * @return The name of the administrative area (county). + */ + public String getDistrict() { + return this.district == null ? null : this.district.getValue(); + } + + /** + * @param value The name of the administrative area (county). + */ + public Address setDistrict(String value) { + if (Utilities.noString(value)) + this.district = null; + else { + if (this.district == null) + this.district = new StringType(); + this.district.setValue(value); + } + return this; + } + + /** + * @return {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public StringType getStateElement() { + if (this.state == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.state"); + else if (Configuration.doAutoCreate()) + this.state = new StringType(); // bb + 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} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public Address setStateElement(StringType value) { + this.state = value; + return this; + } + + /** + * @return Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + public String getState() { + return this.state == null ? null : this.state.getValue(); + } + + /** + * @param value Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + public Address setState(String value) { + if (Utilities.noString(value)) + this.state = null; + else { + if (this.state == null) + this.state = new StringType(); + this.state.setValue(value); + } + return this; + } + + /** + * @return {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value + */ + public StringType getPostalCodeElement() { + if (this.postalCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.postalCode"); + else if (Configuration.doAutoCreate()) + this.postalCode = new StringType(); // bb + return this.postalCode; + } + + public boolean hasPostalCodeElement() { + return this.postalCode != null && !this.postalCode.isEmpty(); + } + + public boolean hasPostalCode() { + return this.postalCode != null && !this.postalCode.isEmpty(); + } + + /** + * @param value {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value + */ + public Address setPostalCodeElement(StringType value) { + this.postalCode = value; + return this; + } + + /** + * @return A postal code designating a region defined by the postal service. + */ + public String getPostalCode() { + return this.postalCode == null ? null : this.postalCode.getValue(); + } + + /** + * @param value A postal code designating a region defined by the postal service. + */ + public Address setPostalCode(String value) { + if (Utilities.noString(value)) + this.postalCode = null; + else { + if (this.postalCode == null) + this.postalCode = new StringType(); + this.postalCode.setValue(value); + } + return this; + } + + /** + * @return {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public StringType getCountryElement() { + if (this.country == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.country"); + else if (Configuration.doAutoCreate()) + this.country = new StringType(); // bb + return this.country; + } + + public boolean hasCountryElement() { + return this.country != null && !this.country.isEmpty(); + } + + public boolean hasCountry() { + return this.country != null && !this.country.isEmpty(); + } + + /** + * @param value {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public Address setCountryElement(StringType value) { + this.country = value; + return this; + } + + /** + * @return Country - a nation as commonly understood or generally accepted. + */ + public String getCountry() { + return this.country == null ? null : this.country.getValue(); + } + + /** + * @param value Country - a nation as commonly understood or generally accepted. + */ + public Address setCountry(String value) { + if (Utilities.noString(value)) + this.country = null; + else { + if (this.country == null) + this.country = new StringType(); + this.country.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period when address was/is in use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period when address was/is in use.) + */ + public Address setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "The purpose of this address.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("type", "code", "Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "A full text representation of the address.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("line", "string", "This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.", 0, java.lang.Integer.MAX_VALUE, line)); + childrenList.add(new Property("city", "string", "The name of the city, town, village or other community or delivery center.", 0, java.lang.Integer.MAX_VALUE, city)); + childrenList.add(new Property("district", "string", "The name of the administrative area (county).", 0, java.lang.Integer.MAX_VALUE, district)); + childrenList.add(new Property("state", "string", "Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).", 0, java.lang.Integer.MAX_VALUE, state)); + childrenList.add(new Property("postalCode", "string", "A postal code designating a region defined by the postal service.", 0, java.lang.Integer.MAX_VALUE, postalCode)); + childrenList.add(new Property("country", "string", "Country - a nation as commonly understood or generally accepted.", 0, java.lang.Integer.MAX_VALUE, country)); + childrenList.add(new Property("period", "Period", "Time period when address was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + case 3321844: /*line*/ return this.line == null ? new Base[0] : this.line.toArray(new Base[this.line.size()]); // StringType + case 3053931: /*city*/ return this.city == null ? new Base[0] : new Base[] {this.city}; // StringType + case 288961422: /*district*/ return this.district == null ? new Base[0] : new Base[] {this.district}; // StringType + case 109757585: /*state*/ return this.state == null ? new Base[0] : new Base[] {this.state}; // StringType + case 2011152728: /*postalCode*/ return this.postalCode == null ? new Base[0] : new Base[] {this.postalCode}; // StringType + case 957831062: /*country*/ return this.country == null ? new Base[0] : new Base[] {this.country}; // StringType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116103: // use + this.use = new AddressUseEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = new AddressTypeEnumFactory().fromType(value); // Enumeration + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + case 3321844: // line + this.getLine().add(castToString(value)); // StringType + break; + case 3053931: // city + this.city = castToString(value); // StringType + break; + case 288961422: // district + this.district = castToString(value); // StringType + break; + case 109757585: // state + this.state = castToString(value); // StringType + break; + case 2011152728: // postalCode + this.postalCode = castToString(value); // StringType + break; + case 957831062: // country + this.country = castToString(value); // StringType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("use")) + this.use = new AddressUseEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = new AddressTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("line")) + this.getLine().add(castToString(value)); + else if (name.equals("city")) + this.city = castToString(value); // StringType + else if (name.equals("district")) + this.district = castToString(value); // StringType + else if (name.equals("state")) + this.state = castToString(value); // StringType + else if (name.equals("postalCode")) + this.postalCode = castToString(value); // StringType + else if (name.equals("country")) + this.country = castToString(value); // StringType + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case 3321844: throw new FHIRException("Cannot make property line as it is not a complex type"); // StringType + case 3053931: throw new FHIRException("Cannot make property city as it is not a complex type"); // StringType + case 288961422: throw new FHIRException("Cannot make property district as it is not a complex type"); // StringType + case 109757585: throw new FHIRException("Cannot make property state as it is not a complex type"); // StringType + case 2011152728: throw new FHIRException("Cannot make property postalCode as it is not a complex type"); // StringType + case 957831062: throw new FHIRException("Cannot make property country as it is not a complex type"); // StringType + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.use"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.type"); + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.text"); + } + else if (name.equals("line")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.line"); + } + else if (name.equals("city")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.city"); + } + else if (name.equals("district")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.district"); + } + else if (name.equals("state")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.state"); + } + else if (name.equals("postalCode")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.postalCode"); + } + else if (name.equals("country")) { + throw new FHIRException("Cannot call addChild on a primitive type Address.country"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Address"; + + } + + public Address copy() { + Address dst = new Address(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + if (line != null) { + dst.line = new ArrayList(); + for (StringType i : line) + dst.line.add(i.copy()); + }; + dst.city = city == null ? null : city.copy(); + dst.district = district == null ? null : district.copy(); + dst.state = state == null ? null : state.copy(); + dst.postalCode = postalCode == null ? null : postalCode.copy(); + dst.country = country == null ? null : country.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected Address typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Address)) + return false; + Address o = (Address) other; + return compareDeep(use, o.use, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true) + && compareDeep(line, o.line, true) && compareDeep(city, o.city, true) && compareDeep(district, o.district, true) + && compareDeep(state, o.state, true) && compareDeep(postalCode, o.postalCode, true) && compareDeep(country, o.country, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Address)) + return false; + Address o = (Address) other; + return compareValues(use, o.use, true) && compareValues(type, o.type, true) && compareValues(text, o.text, true) + && compareValues(line, o.line, true) && compareValues(city, o.city, true) && compareValues(district, o.district, true) + && compareValues(state, o.state, true) && compareValues(postalCode, o.postalCode, true) && compareValues(country, o.country, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (use == null || use.isEmpty()) && (type == null || type.isEmpty()) + && (text == null || text.isEmpty()) && (line == null || line.isEmpty()) && (city == null || city.isEmpty()) + && (district == null || district.isEmpty()) && (state == null || state.isEmpty()) && (postalCode == null || postalCode.isEmpty()) + && (country == null || country.isEmpty()) && (period == null || period.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Age.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Age.java new file mode 100644 index 00000000000..daa51239c46 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Age.java @@ -0,0 +1,88 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Age", profileOf=Quantity.class) +public class Age extends Quantity { + + private static final long serialVersionUID = 1069574054L; + + public Age copy() { + Age dst = new Age(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Age typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Age)) + return false; + Age o = (Age) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Age)) + return false; + Age o = (Age) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AllergyIntolerance.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AllergyIntolerance.java new file mode 100644 index 00000000000..9d2ea13b801 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AllergyIntolerance.java @@ -0,0 +1,2653 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + */ +@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance") +public class AllergyIntolerance extends DomainResource { + + public enum AllergyIntoleranceStatus { + /** + * An active record of a reaction to the identified Substance. + */ + ACTIVE, + /** + * A low level of certainty about the propensity for a reaction to the identified Substance. + */ + UNCONFIRMED, + /** + * A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge. + */ + CONFIRMED, + /** + * An inactive record of a reaction to the identified Substance. + */ + INACTIVE, + /** + * A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved. + */ + RESOLVED, + /** + * A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. + */ + REFUTED, + /** + * The statement was entered in error and is not valid. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("unconfirmed".equals(codeString)) + return UNCONFIRMED; + if ("confirmed".equals(codeString)) + return CONFIRMED; + if ("inactive".equals(codeString)) + return INACTIVE; + if ("resolved".equals(codeString)) + return RESOLVED; + if ("refuted".equals(codeString)) + return REFUTED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case UNCONFIRMED: return "unconfirmed"; + case CONFIRMED: return "confirmed"; + case INACTIVE: return "inactive"; + case RESOLVED: return "resolved"; + case REFUTED: return "refuted"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return "http://hl7.org/fhir/allergy-intolerance-status"; + case UNCONFIRMED: return "http://hl7.org/fhir/allergy-intolerance-status"; + case CONFIRMED: return "http://hl7.org/fhir/allergy-intolerance-status"; + case INACTIVE: return "http://hl7.org/fhir/allergy-intolerance-status"; + case RESOLVED: return "http://hl7.org/fhir/allergy-intolerance-status"; + case REFUTED: return "http://hl7.org/fhir/allergy-intolerance-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/allergy-intolerance-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "An active record of a reaction to the identified Substance."; + case UNCONFIRMED: return "A low level of certainty about the propensity for a reaction to the identified Substance."; + case CONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge."; + case INACTIVE: return "An inactive record of a reaction to the identified Substance."; + case RESOLVED: return "A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved."; + case REFUTED: return "A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted."; + case ENTEREDINERROR: return "The statement was entered in error and is not valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case UNCONFIRMED: return "Unconfirmed"; + case CONFIRMED: return "Confirmed"; + case INACTIVE: return "Inactive"; + case RESOLVED: return "Resolved"; + case REFUTED: return "Refuted"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + 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; + if ("active".equals(codeString)) + return AllergyIntoleranceStatus.ACTIVE; + if ("unconfirmed".equals(codeString)) + return AllergyIntoleranceStatus.UNCONFIRMED; + if ("confirmed".equals(codeString)) + return AllergyIntoleranceStatus.CONFIRMED; + if ("inactive".equals(codeString)) + return AllergyIntoleranceStatus.INACTIVE; + if ("resolved".equals(codeString)) + return AllergyIntoleranceStatus.RESOLVED; + if ("refuted".equals(codeString)) + return AllergyIntoleranceStatus.REFUTED; + if ("entered-in-error".equals(codeString)) + return AllergyIntoleranceStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceStatus.ACTIVE); + if ("unconfirmed".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceStatus.UNCONFIRMED); + if ("confirmed".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceStatus.CONFIRMED); + if ("inactive".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceStatus.INACTIVE); + if ("resolved".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceStatus.RESOLVED); + if ("refuted".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceStatus.REFUTED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceStatus.ENTEREDINERROR); + throw new FHIRException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceStatus code) { + if (code == AllergyIntoleranceStatus.ACTIVE) + return "active"; + if (code == AllergyIntoleranceStatus.UNCONFIRMED) + return "unconfirmed"; + if (code == AllergyIntoleranceStatus.CONFIRMED) + return "confirmed"; + if (code == AllergyIntoleranceStatus.INACTIVE) + return "inactive"; + if (code == AllergyIntoleranceStatus.RESOLVED) + return "resolved"; + if (code == AllergyIntoleranceStatus.REFUTED) + return "refuted"; + if (code == AllergyIntoleranceStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(AllergyIntoleranceStatus code) { + return code.getSystem(); + } + } + + public enum AllergyIntoleranceType { + /** + * A propensity for hypersensitivity reaction(s) to a substance. These reactions are most typically type I hypersensitivity, plus other "allergy-like" reactions, including pseudoallergy. + */ + ALLERGY, + /** + * A propensity for adverse reactions to a substance that is not judged to be allergic or "allergy-like". These reactions are typically (but not necessarily) non-immune. They are to some degree idiosyncratic and/or individually specific (i.e. are not a reaction that is expected to occur with most or all patients given similar circumstances). + */ + INTOLERANCE, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("allergy".equals(codeString)) + return ALLERGY; + if ("intolerance".equals(codeString)) + return INTOLERANCE; + throw new FHIRException("Unknown AllergyIntoleranceType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ALLERGY: return "allergy"; + case INTOLERANCE: return "intolerance"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ALLERGY: return "http://hl7.org/fhir/allergy-intolerance-type"; + case INTOLERANCE: return "http://hl7.org/fhir/allergy-intolerance-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ALLERGY: return "A propensity for hypersensitivity reaction(s) to a substance. These reactions are most typically type I hypersensitivity, plus other \"allergy-like\" reactions, including pseudoallergy."; + case INTOLERANCE: return "A propensity for adverse reactions to a substance that is not judged to be allergic or \"allergy-like\". These reactions are typically (but not necessarily) non-immune. They are to some degree idiosyncratic and/or individually specific (i.e. are not a reaction that is expected to occur with most or all patients given similar circumstances)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ALLERGY: return "Allergy"; + case INTOLERANCE: return "Intolerance"; + default: return "?"; + } + } + } + + 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; + if ("allergy".equals(codeString)) + return AllergyIntoleranceType.ALLERGY; + if ("intolerance".equals(codeString)) + return AllergyIntoleranceType.INTOLERANCE; + throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("allergy".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceType.ALLERGY); + if ("intolerance".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceType.INTOLERANCE); + throw new FHIRException("Unknown AllergyIntoleranceType code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceType code) { + if (code == AllergyIntoleranceType.ALLERGY) + return "allergy"; + if (code == AllergyIntoleranceType.INTOLERANCE) + return "intolerance"; + return "?"; + } + public String toSystem(AllergyIntoleranceType code) { + return code.getSystem(); + } + } + + public enum AllergyIntoleranceCategory { + /** + * Any substance consumed to provide nutritional support for the body. + */ + FOOD, + /** + * Substances administered to achieve a physiological effect. + */ + MEDICATION, + /** + * Substances that are encountered in the environment. + */ + ENVIRONMENT, + /** + * Other substances that are not covered by any other category. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceCategory fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("food".equals(codeString)) + return FOOD; + if ("medication".equals(codeString)) + return MEDICATION; + if ("environment".equals(codeString)) + return ENVIRONMENT; + if ("other".equals(codeString)) + return OTHER; + throw new FHIRException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case FOOD: return "food"; + case MEDICATION: return "medication"; + case ENVIRONMENT: return "environment"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case FOOD: return "http://hl7.org/fhir/allergy-intolerance-category"; + case MEDICATION: return "http://hl7.org/fhir/allergy-intolerance-category"; + case ENVIRONMENT: return "http://hl7.org/fhir/allergy-intolerance-category"; + case OTHER: return "http://hl7.org/fhir/allergy-intolerance-category"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case FOOD: return "Any substance consumed to provide nutritional support for the body."; + case MEDICATION: return "Substances administered to achieve a physiological effect."; + case ENVIRONMENT: return "Substances that are encountered in the environment."; + case OTHER: return "Other substances that are not covered by any other category."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case FOOD: return "Food"; + case MEDICATION: return "Medication"; + case ENVIRONMENT: return "Environment"; + case OTHER: return "Other"; + default: return "?"; + } + } + } + + 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; + if ("food".equals(codeString)) + return AllergyIntoleranceCategory.FOOD; + if ("medication".equals(codeString)) + return AllergyIntoleranceCategory.MEDICATION; + if ("environment".equals(codeString)) + return AllergyIntoleranceCategory.ENVIRONMENT; + if ("other".equals(codeString)) + return AllergyIntoleranceCategory.OTHER; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("food".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCategory.FOOD); + if ("medication".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCategory.MEDICATION); + if ("environment".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCategory.ENVIRONMENT); + if ("other".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCategory.OTHER); + throw new FHIRException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceCategory code) { + if (code == AllergyIntoleranceCategory.FOOD) + return "food"; + if (code == AllergyIntoleranceCategory.MEDICATION) + return "medication"; + if (code == AllergyIntoleranceCategory.ENVIRONMENT) + return "environment"; + if (code == AllergyIntoleranceCategory.OTHER) + return "other"; + return "?"; + } + public String toSystem(AllergyIntoleranceCategory code) { + return code.getSystem(); + } + } + + public enum AllergyIntoleranceCriticality { + /** + * Worst case result of a future exposure is not assessed to be life-threatening or having high potential for organ system failure. + */ + LOW, + /** + * Worst case result of a future exposure is assessed to be life-threatening or having high potential for organ system failure. + */ + HIGH, + /** + * Unable to assess the worst case result of a future exposure. + */ + UNABLETOASSESS, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceCriticality fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("low".equals(codeString)) + return LOW; + if ("high".equals(codeString)) + return HIGH; + if ("unable-to-assess".equals(codeString)) + return UNABLETOASSESS; + throw new FHIRException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case LOW: return "low"; + case HIGH: return "high"; + case UNABLETOASSESS: return "unable-to-assess"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LOW: return "http://hl7.org/fhir/allergy-intolerance-criticality"; + case HIGH: return "http://hl7.org/fhir/allergy-intolerance-criticality"; + case UNABLETOASSESS: return "http://hl7.org/fhir/allergy-intolerance-criticality"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LOW: return "Worst case result of a future exposure is not assessed to be life-threatening or having high potential for organ system failure."; + case HIGH: return "Worst case result of a future exposure is assessed to be life-threatening or having high potential for organ system failure."; + case UNABLETOASSESS: return "Unable to assess the worst case result of a future exposure."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LOW: return "Low Risk"; + case HIGH: return "High Risk"; + case UNABLETOASSESS: return "Unable to Assess Risk"; + default: return "?"; + } + } + } + + 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; + if ("low".equals(codeString)) + return AllergyIntoleranceCriticality.LOW; + if ("high".equals(codeString)) + return AllergyIntoleranceCriticality.HIGH; + if ("unable-to-assess".equals(codeString)) + return AllergyIntoleranceCriticality.UNABLETOASSESS; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("low".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCriticality.LOW); + if ("high".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCriticality.HIGH); + if ("unable-to-assess".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCriticality.UNABLETOASSESS); + throw new FHIRException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceCriticality code) { + if (code == AllergyIntoleranceCriticality.LOW) + return "low"; + if (code == AllergyIntoleranceCriticality.HIGH) + return "high"; + if (code == AllergyIntoleranceCriticality.UNABLETOASSESS) + return "unable-to-assess"; + return "?"; + } + public String toSystem(AllergyIntoleranceCriticality code) { + return code.getSystem(); + } + } + + public enum AllergyIntoleranceCertainty { + /** + * There is a low level of clinical certainty that the reaction was caused by the identified Substance. + */ + UNLIKELY, + /** + * There is a high level of clinical certainty that the reaction was caused by the identified Substance. + */ + LIKELY, + /** + * There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge. + */ + CONFIRMED, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceCertainty fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("unlikely".equals(codeString)) + return UNLIKELY; + if ("likely".equals(codeString)) + return LIKELY; + if ("confirmed".equals(codeString)) + return CONFIRMED; + throw new FHIRException("Unknown AllergyIntoleranceCertainty code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case UNLIKELY: return "unlikely"; + case LIKELY: return "likely"; + case CONFIRMED: return "confirmed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNLIKELY: return "http://hl7.org/fhir/reaction-event-certainty"; + case LIKELY: return "http://hl7.org/fhir/reaction-event-certainty"; + case CONFIRMED: return "http://hl7.org/fhir/reaction-event-certainty"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNLIKELY: return "There is a low level of clinical certainty that the reaction was caused by the identified Substance."; + case LIKELY: return "There is a high level of clinical certainty that the reaction was caused by the identified Substance."; + case CONFIRMED: return "There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNLIKELY: return "Unlikely"; + case LIKELY: return "Likely"; + case CONFIRMED: return "Confirmed"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceCertaintyEnumFactory implements EnumFactory { + public AllergyIntoleranceCertainty fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unlikely".equals(codeString)) + return AllergyIntoleranceCertainty.UNLIKELY; + if ("likely".equals(codeString)) + return AllergyIntoleranceCertainty.LIKELY; + if ("confirmed".equals(codeString)) + return AllergyIntoleranceCertainty.CONFIRMED; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCertainty code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("unlikely".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCertainty.UNLIKELY); + if ("likely".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCertainty.LIKELY); + if ("confirmed".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceCertainty.CONFIRMED); + throw new FHIRException("Unknown AllergyIntoleranceCertainty code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceCertainty code) { + if (code == AllergyIntoleranceCertainty.UNLIKELY) + return "unlikely"; + if (code == AllergyIntoleranceCertainty.LIKELY) + return "likely"; + if (code == AllergyIntoleranceCertainty.CONFIRMED) + return "confirmed"; + return "?"; + } + public String toSystem(AllergyIntoleranceCertainty code) { + return code.getSystem(); + } + } + + public enum AllergyIntoleranceSeverity { + /** + * Causes mild physiological effects. + */ + MILD, + /** + * Causes moderate physiological effects. + */ + MODERATE, + /** + * Causes severe physiological effects. + */ + SEVERE, + /** + * added to help the parsers + */ + NULL; + public static AllergyIntoleranceSeverity fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("mild".equals(codeString)) + return MILD; + if ("moderate".equals(codeString)) + return MODERATE; + if ("severe".equals(codeString)) + return SEVERE; + throw new FHIRException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MILD: return "mild"; + case MODERATE: return "moderate"; + case SEVERE: return "severe"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MILD: return "http://hl7.org/fhir/reaction-event-severity"; + case MODERATE: return "http://hl7.org/fhir/reaction-event-severity"; + case SEVERE: return "http://hl7.org/fhir/reaction-event-severity"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MILD: return "Causes mild physiological effects."; + case MODERATE: return "Causes moderate physiological effects."; + case SEVERE: return "Causes severe physiological effects."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MILD: return "Mild"; + case MODERATE: return "Moderate"; + case SEVERE: return "Severe"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceSeverityEnumFactory implements EnumFactory { + public AllergyIntoleranceSeverity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("mild".equals(codeString)) + return AllergyIntoleranceSeverity.MILD; + if ("moderate".equals(codeString)) + return AllergyIntoleranceSeverity.MODERATE; + if ("severe".equals(codeString)) + return AllergyIntoleranceSeverity.SEVERE; + throw new IllegalArgumentException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("mild".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceSeverity.MILD); + if ("moderate".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceSeverity.MODERATE); + if ("severe".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceSeverity.SEVERE); + throw new FHIRException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceSeverity code) { + if (code == AllergyIntoleranceSeverity.MILD) + return "mild"; + if (code == AllergyIntoleranceSeverity.MODERATE) + return "moderate"; + if (code == AllergyIntoleranceSeverity.SEVERE) + return "severe"; + return "?"; + } + public String toSystem(AllergyIntoleranceSeverity code) { + return code.getSystem(); + } + } + + @Block() + public static class AllergyIntoleranceReactionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance. + */ + @Child(name = "substance", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specific substance considered to be responsible for event", formalDefinition="Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance." ) + protected CodeableConcept substance; + + /** + * Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event. + */ + @Child(name = "certainty", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="unlikely | likely | confirmed - clinical certainty about the specific substance", formalDefinition="Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event." ) + protected Enumeration certainty; + + /** + * Clinical symptoms and/or signs that are observed or associated with the adverse reaction event. + */ + @Child(name = "manifestation", type = {CodeableConcept.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Clinical symptoms/signs associated with the Event", formalDefinition="Clinical symptoms and/or signs that are observed or associated with the adverse reaction event." ) + protected List manifestation; + + /** + * Text description about the reaction as a whole, including details of the manifestation if required. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Description of the event as a whole", formalDefinition="Text description about the reaction as a whole, including details of the manifestation if required." ) + protected StringType description; + + /** + * Record of the date and/or time of the onset of the Reaction. + */ + @Child(name = "onset", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Reaction." ) + protected DateTimeType onset; + + /** + * Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + @Child(name = "severity", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="mild | moderate | severe (of event as a whole)", formalDefinition="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." ) + protected Enumeration severity; + + /** + * Identification of the route by which the subject was exposed to the substance. + */ + @Child(name = "exposureRoute", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How the subject was exposed to the substance", formalDefinition="Identification of the route by which the subject was exposed to the substance." ) + protected CodeableConcept exposureRoute; + + /** + * Additional text about the adverse reaction event not captured in other fields. + */ + @Child(name = "note", type = {Annotation.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Text about event not captured in other fields", formalDefinition="Additional text about the adverse reaction event not captured in other fields." ) + protected List note; + + private static final long serialVersionUID = -31700461L; + + /** + * Constructor + */ + public AllergyIntoleranceReactionComponent() { + super(); + } + + /** + * @return {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) + */ + public CodeableConcept getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new CodeableConcept(); // cc + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) + */ + public AllergyIntoleranceReactionComponent setSubstance(CodeableConcept value) { + this.substance = value; + return this; + } + + /** + * @return {@link #certainty} (Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value + */ + public Enumeration getCertaintyElement() { + if (this.certainty == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.certainty"); + else if (Configuration.doAutoCreate()) + this.certainty = new Enumeration(new AllergyIntoleranceCertaintyEnumFactory()); // bb + return this.certainty; + } + + public boolean hasCertaintyElement() { + return this.certainty != null && !this.certainty.isEmpty(); + } + + public boolean hasCertainty() { + return this.certainty != null && !this.certainty.isEmpty(); + } + + /** + * @param value {@link #certainty} (Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value + */ + public AllergyIntoleranceReactionComponent setCertaintyElement(Enumeration value) { + this.certainty = value; + return this; + } + + /** + * @return Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event. + */ + public AllergyIntoleranceCertainty getCertainty() { + return this.certainty == null ? null : this.certainty.getValue(); + } + + /** + * @param value Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event. + */ + public AllergyIntoleranceReactionComponent setCertainty(AllergyIntoleranceCertainty value) { + if (value == null) + this.certainty = null; + else { + if (this.certainty == null) + this.certainty = new Enumeration(new AllergyIntoleranceCertaintyEnumFactory()); + this.certainty.setValue(value); + } + return this; + } + + /** + * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.) + */ + public List getManifestation() { + if (this.manifestation == null) + this.manifestation = new ArrayList(); + return this.manifestation; + } + + public boolean hasManifestation() { + if (this.manifestation == null) + return false; + for (CodeableConcept item : this.manifestation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.) + */ + // syntactic sugar + public CodeableConcept addManifestation() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.manifestation == null) + this.manifestation = new ArrayList(); + this.manifestation.add(t); + return t; + } + + // syntactic sugar + public AllergyIntoleranceReactionComponent addManifestation(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.manifestation == null) + this.manifestation = new ArrayList(); + this.manifestation.add(t); + return this; + } + + /** + * @return {@link #description} (Text description about the reaction as a whole, including details of the manifestation if required.). 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 AllergyIntoleranceReactionComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Text description about the reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public AllergyIntoleranceReactionComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text description about the reaction as a whole, including details of the manifestation if required. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text description about the reaction as a whole, including details of the manifestation if required. + */ + public AllergyIntoleranceReactionComponent 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 #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + */ + public DateTimeType getOnsetElement() { + if (this.onset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.onset"); + else if (Configuration.doAutoCreate()) + this.onset = new DateTimeType(); // bb + return this.onset; + } + + public boolean hasOnsetElement() { + return this.onset != null && !this.onset.isEmpty(); + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + */ + public AllergyIntoleranceReactionComponent setOnsetElement(DateTimeType value) { + this.onset = value; + return this; + } + + /** + * @return Record of the date and/or time of the onset of the Reaction. + */ + 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 AllergyIntoleranceReactionComponent setOnset(Date value) { + if (value == null) + this.onset = null; + else { + if (this.onset == null) + this.onset = new DateTimeType(); + this.onset.setValue(value); + } + return this; + } + + /** + * @return {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(new AllergyIntoleranceSeverityEnumFactory()); // bb + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public AllergyIntoleranceReactionComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + public AllergyIntoleranceSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + public AllergyIntoleranceReactionComponent setSeverity(AllergyIntoleranceSeverity value) { + if (value == null) + this.severity = null; + else { + if (this.severity == null) + this.severity = new Enumeration(new AllergyIntoleranceSeverityEnumFactory()); + this.severity.setValue(value); + } + return this; + } + + /** + * @return {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) + */ + public CodeableConcept getExposureRoute() { + if (this.exposureRoute == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.exposureRoute"); + else if (Configuration.doAutoCreate()) + this.exposureRoute = new CodeableConcept(); // cc + return this.exposureRoute; + } + + public boolean hasExposureRoute() { + return this.exposureRoute != null && !this.exposureRoute.isEmpty(); + } + + /** + * @param value {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) + */ + public AllergyIntoleranceReactionComponent setExposureRoute(CodeableConcept value) { + this.exposureRoute = value; + return this; + } + + /** + * @return {@link #note} (Additional text about the adverse reaction event not captured in other fields.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Additional text about the adverse reaction event not captured in other fields.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public AllergyIntoleranceReactionComponent addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("substance", "CodeableConcept", "Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.", 0, java.lang.Integer.MAX_VALUE, substance)); + childrenList.add(new Property("certainty", "code", "Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event.", 0, java.lang.Integer.MAX_VALUE, certainty)); + childrenList.add(new Property("manifestation", "CodeableConcept", "Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.", 0, java.lang.Integer.MAX_VALUE, manifestation)); + childrenList.add(new Property("description", "string", "Text description about the reaction as a whole, including details of the manifestation if required.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Reaction.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("severity", "code", "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("exposureRoute", "CodeableConcept", "Identification of the route by which the subject was exposed to the substance.", 0, java.lang.Integer.MAX_VALUE, exposureRoute)); + childrenList.add(new Property("note", "Annotation", "Additional text about the adverse reaction event not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // CodeableConcept + case -1404142937: /*certainty*/ return this.certainty == null ? new Base[0] : new Base[] {this.certainty}; // Enumeration + case 1115984422: /*manifestation*/ return this.manifestation == null ? new Base[0] : this.manifestation.toArray(new Base[this.manifestation.size()]); // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // DateTimeType + case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration + case 421286274: /*exposureRoute*/ return this.exposureRoute == null ? new Base[0] : new Base[] {this.exposureRoute}; // CodeableConcept + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 530040176: // substance + this.substance = castToCodeableConcept(value); // CodeableConcept + break; + case -1404142937: // certainty + this.certainty = new AllergyIntoleranceCertaintyEnumFactory().fromType(value); // Enumeration + break; + case 1115984422: // manifestation + this.getManifestation().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 105901603: // onset + this.onset = castToDateTime(value); // DateTimeType + break; + case 1478300413: // severity + this.severity = new AllergyIntoleranceSeverityEnumFactory().fromType(value); // Enumeration + break; + case 421286274: // exposureRoute + this.exposureRoute = castToCodeableConcept(value); // CodeableConcept + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("substance")) + this.substance = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("certainty")) + this.certainty = new AllergyIntoleranceCertaintyEnumFactory().fromType(value); // Enumeration + else if (name.equals("manifestation")) + this.getManifestation().add(castToCodeableConcept(value)); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("onset")) + this.onset = castToDateTime(value); // DateTimeType + else if (name.equals("severity")) + this.severity = new AllergyIntoleranceSeverityEnumFactory().fromType(value); // Enumeration + else if (name.equals("exposureRoute")) + this.exposureRoute = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 530040176: return getSubstance(); // CodeableConcept + case -1404142937: throw new FHIRException("Cannot make property certainty as it is not a complex type"); // Enumeration + case 1115984422: return addManifestation(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 105901603: throw new FHIRException("Cannot make property onset as it is not a complex type"); // DateTimeType + case 1478300413: throw new FHIRException("Cannot make property severity as it is not a complex type"); // Enumeration + case 421286274: return getExposureRoute(); // CodeableConcept + case 3387378: return addNote(); // Annotation + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("substance")) { + this.substance = new CodeableConcept(); + return this.substance; + } + else if (name.equals("certainty")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.certainty"); + } + else if (name.equals("manifestation")) { + return addManifestation(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.description"); + } + else if (name.equals("onset")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.onset"); + } + else if (name.equals("severity")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.severity"); + } + else if (name.equals("exposureRoute")) { + this.exposureRoute = new CodeableConcept(); + return this.exposureRoute; + } + else if (name.equals("note")) { + return addNote(); + } + else + return super.addChild(name); + } + + public AllergyIntoleranceReactionComponent copy() { + AllergyIntoleranceReactionComponent dst = new AllergyIntoleranceReactionComponent(); + copyValues(dst); + dst.substance = substance == null ? null : substance.copy(); + dst.certainty = certainty == null ? null : certainty.copy(); + if (manifestation != null) { + dst.manifestation = new ArrayList(); + for (CodeableConcept i : manifestation) + dst.manifestation.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.exposureRoute = exposureRoute == null ? null : exposureRoute.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AllergyIntoleranceReactionComponent)) + return false; + AllergyIntoleranceReactionComponent o = (AllergyIntoleranceReactionComponent) other; + return compareDeep(substance, o.substance, true) && compareDeep(certainty, o.certainty, true) && compareDeep(manifestation, o.manifestation, true) + && compareDeep(description, o.description, true) && compareDeep(onset, o.onset, true) && compareDeep(severity, o.severity, true) + && compareDeep(exposureRoute, o.exposureRoute, true) && compareDeep(note, o.note, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AllergyIntoleranceReactionComponent)) + return false; + AllergyIntoleranceReactionComponent o = (AllergyIntoleranceReactionComponent) other; + return compareValues(certainty, o.certainty, true) && compareValues(description, o.description, true) + && compareValues(onset, o.onset, true) && compareValues(severity, o.severity, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (substance == null || substance.isEmpty()) && (certainty == null || certainty.isEmpty()) + && (manifestation == null || manifestation.isEmpty()) && (description == null || description.isEmpty()) + && (onset == null || onset.isEmpty()) && (severity == null || severity.isEmpty()) && (exposureRoute == null || exposureRoute.isEmpty()) + && (note == null || note.isEmpty()); + } + + public String fhirType() { + return "AllergyIntolerance.reaction"; + + } + + } + + /** + * This records identifiers associated with this allergy/intolerance concern 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=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External ids for this item", formalDefinition="This records identifiers associated with this allergy/intolerance concern 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; + + /** + * Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance." ) + protected Enumeration status; + + /** + * Identification of the underlying physiological mechanism for the reaction risk. + */ + @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="allergy | intolerance - Underlying mechanism (if known)", formalDefinition="Identification of the underlying physiological mechanism for the reaction risk." ) + protected Enumeration type; + + /** + * Category of the identified Substance. + */ + @Child(name = "category", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="food | medication | environment | other - Category of Substance", formalDefinition="Category of the identified Substance." ) + protected Enumeration category; + + /** + * Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + */ + @Child(name = "criticality", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="low | high | unable-to-assess", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." ) + protected Enumeration criticality; + + /** + * Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk. + */ + @Child(name = "substance", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Substance, (or class) considered to be responsible for risk", formalDefinition="Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk." ) + protected CodeableConcept substance; + + /** + * The patient who has the allergy or intolerance. + */ + @Child(name = "patient", type = {Patient.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who the sensitivity is for", formalDefinition="The patient who has the allergy or intolerance." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient who has the allergy or intolerance.) + */ + protected Patient patientTarget; + + /** + * Date when the sensitivity was recorded. + */ + @Child(name = "recordedDate", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When recorded", formalDefinition="Date when the sensitivity was recorded." ) + protected DateTimeType recordedDate; + + /** + * Individual who recorded the record and takes responsibility for its content. + */ + @Child(name = "recorder", type = {Practitioner.class, Patient.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who recorded the sensitivity", formalDefinition="Individual who recorded the record and takes responsibility for its content." ) + protected Reference recorder; + + /** + * The actual object that is the target of the reference (Individual who recorded the record and takes responsibility for its content.) + */ + protected Resource recorderTarget; + + /** + * The source of the information about the allergy that is recorded. + */ + @Child(name = "reporter", type = {Patient.class, RelatedPerson.class, Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Source of the information about the allergy", formalDefinition="The source of the information about the allergy that is recorded." ) + protected Reference reporter; + + /** + * The actual object that is the target of the reference (The source of the information about the allergy that is recorded.) + */ + protected Resource reporterTarget; + + /** + * Record of the date and/or time of the onset of the Allergy or Intolerance. + */ + @Child(name = "onset", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Allergy or Intolerance." ) + protected DateTimeType onset; + + /** + * Represents the date and/or time of the last known occurrence of a reaction event. + */ + @Child(name = "lastOccurence", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date(/time) of last known occurrence of a reaction", formalDefinition="Represents the date and/or time of the last known occurrence of a reaction event." ) + protected DateTimeType lastOccurence; + + /** + * Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. + */ + @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional text not captured in other fields", formalDefinition="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." ) + protected List note; + + /** + * Details about each adverse reaction event linked to exposure to the identified Substance. + */ + @Child(name = "reaction", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Details about each adverse reaction event linked to exposure to the identified Substance." ) + protected List reaction; + + private static final long serialVersionUID = 278089117L; + + /** + * Constructor + */ + public AllergyIntolerance() { + super(); + } + + /** + * Constructor + */ + public AllergyIntolerance(CodeableConcept substance, Reference patient) { + super(); + this.substance = substance; + this.patient = patient; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern 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} (This records identifiers associated with this allergy/intolerance concern 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; + } + + // syntactic sugar + public AllergyIntolerance addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). 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 AllergyIntolerance.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); // bb + 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} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public AllergyIntolerance setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + public AllergyIntoleranceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + public AllergyIntolerance setStatus(AllergyIntoleranceStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Identification of the underlying physiological mechanism for the reaction risk.). 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 AllergyIntolerance.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new AllergyIntoleranceTypeEnumFactory()); // bb + 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} (Identification of the underlying physiological mechanism for the reaction risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public AllergyIntolerance setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identification of the underlying physiological mechanism for the reaction risk. + */ + public AllergyIntoleranceType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identification of the underlying physiological mechanism for the reaction risk. + */ + public AllergyIntolerance setType(AllergyIntoleranceType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new AllergyIntoleranceTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #category} (Category of the identified Substance.). 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 AllergyIntolerance.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new AllergyIntoleranceCategoryEnumFactory()); // bb + 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} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public AllergyIntolerance setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return Category of the identified Substance. + */ + public AllergyIntoleranceCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value Category of the identified Substance. + */ + public AllergyIntolerance setCategory(AllergyIntoleranceCategory value) { + if (value == null) + this.category = null; + else { + if (this.category == null) + this.category = new Enumeration(new AllergyIntoleranceCategoryEnumFactory()); + this.category.setValue(value); + } + return this; + } + + /** + * @return {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value + */ + public Enumeration getCriticalityElement() { + if (this.criticality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.criticality"); + else if (Configuration.doAutoCreate()) + this.criticality = new Enumeration(new AllergyIntoleranceCriticalityEnumFactory()); // bb + return this.criticality; + } + + public boolean hasCriticalityElement() { + return this.criticality != null && !this.criticality.isEmpty(); + } + + public boolean hasCriticality() { + return this.criticality != null && !this.criticality.isEmpty(); + } + + /** + * @param value {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value + */ + public AllergyIntolerance setCriticalityElement(Enumeration value) { + this.criticality = value; + return this; + } + + /** + * @return Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + */ + public AllergyIntoleranceCriticality getCriticality() { + return this.criticality == null ? null : this.criticality.getValue(); + } + + /** + * @param value Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + */ + public AllergyIntolerance setCriticality(AllergyIntoleranceCriticality value) { + if (value == null) + this.criticality = null; + else { + if (this.criticality == null) + this.criticality = new Enumeration(new AllergyIntoleranceCriticalityEnumFactory()); + this.criticality.setValue(value); + } + return this; + } + + /** + * @return {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk.) + */ + public CodeableConcept getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new CodeableConcept(); // cc + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk.) + */ + public AllergyIntolerance setSubstance(CodeableConcept value) { + this.substance = value; + return this; + } + + /** + * @return {@link #patient} (The patient who has the allergy or intolerance.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient who has the allergy or intolerance.) + */ + public AllergyIntolerance 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 who has the allergy or intolerance.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 who has the allergy or intolerance.) + */ + public AllergyIntolerance setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value + */ + public DateTimeType getRecordedDateElement() { + if (this.recordedDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.recordedDate"); + else if (Configuration.doAutoCreate()) + this.recordedDate = new DateTimeType(); // bb + return this.recordedDate; + } + + public boolean hasRecordedDateElement() { + return this.recordedDate != null && !this.recordedDate.isEmpty(); + } + + public boolean hasRecordedDate() { + return this.recordedDate != null && !this.recordedDate.isEmpty(); + } + + /** + * @param value {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value + */ + public AllergyIntolerance setRecordedDateElement(DateTimeType value) { + this.recordedDate = value; + return this; + } + + /** + * @return Date when the sensitivity was recorded. + */ + public Date getRecordedDate() { + return this.recordedDate == null ? null : this.recordedDate.getValue(); + } + + /** + * @param value Date when the sensitivity was recorded. + */ + public AllergyIntolerance setRecordedDate(Date value) { + if (value == null) + this.recordedDate = null; + else { + if (this.recordedDate == null) + this.recordedDate = new DateTimeType(); + this.recordedDate.setValue(value); + } + return this; + } + + /** + * @return {@link #recorder} (Individual who recorded the record and takes responsibility for its content.) + */ + public Reference getRecorder() { + if (this.recorder == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.recorder"); + else if (Configuration.doAutoCreate()) + this.recorder = new Reference(); // cc + return this.recorder; + } + + public boolean hasRecorder() { + return this.recorder != null && !this.recorder.isEmpty(); + } + + /** + * @param value {@link #recorder} (Individual who recorded the record and takes responsibility for its content.) + */ + public AllergyIntolerance setRecorder(Reference value) { + this.recorder = value; + return this; + } + + /** + * @return {@link #recorder} 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. (Individual who recorded the record and takes responsibility for its content.) + */ + public Resource getRecorderTarget() { + return this.recorderTarget; + } + + /** + * @param value {@link #recorder} 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. (Individual who recorded the record and takes responsibility for its content.) + */ + public AllergyIntolerance setRecorderTarget(Resource value) { + this.recorderTarget = value; + return this; + } + + /** + * @return {@link #reporter} (The source of the information about the allergy that is recorded.) + */ + public Reference getReporter() { + if (this.reporter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.reporter"); + else if (Configuration.doAutoCreate()) + this.reporter = new Reference(); // cc + return this.reporter; + } + + public boolean hasReporter() { + return this.reporter != null && !this.reporter.isEmpty(); + } + + /** + * @param value {@link #reporter} (The source of the information about the allergy that is recorded.) + */ + public AllergyIntolerance setReporter(Reference value) { + this.reporter = value; + return this; + } + + /** + * @return {@link #reporter} 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 source of the information about the allergy that is recorded.) + */ + public Resource getReporterTarget() { + return this.reporterTarget; + } + + /** + * @param value {@link #reporter} 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 source of the information about the allergy that is recorded.) + */ + public AllergyIntolerance setReporterTarget(Resource value) { + this.reporterTarget = value; + return this; + } + + /** + * @return {@link #onset} (Record of the date and/or time of the onset of the Allergy or Intolerance.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + */ + public DateTimeType getOnsetElement() { + if (this.onset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.onset"); + else if (Configuration.doAutoCreate()) + this.onset = new DateTimeType(); // bb + return this.onset; + } + + public boolean hasOnsetElement() { + return this.onset != null && !this.onset.isEmpty(); + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Record of the date and/or time of the onset of the Allergy or Intolerance.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + */ + public AllergyIntolerance setOnsetElement(DateTimeType value) { + this.onset = value; + return this; + } + + /** + * @return Record of the date and/or time of the onset of the Allergy or Intolerance. + */ + 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 Allergy or Intolerance. + */ + public AllergyIntolerance setOnset(Date value) { + if (value == null) + this.onset = null; + else { + if (this.onset == null) + this.onset = new DateTimeType(); + this.onset.setValue(value); + } + return this; + } + + /** + * @return {@link #lastOccurence} (Represents the date and/or time of the last known occurrence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value + */ + public DateTimeType getLastOccurenceElement() { + if (this.lastOccurence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.lastOccurence"); + else if (Configuration.doAutoCreate()) + this.lastOccurence = new DateTimeType(); // bb + return this.lastOccurence; + } + + public boolean hasLastOccurenceElement() { + return this.lastOccurence != null && !this.lastOccurence.isEmpty(); + } + + public boolean hasLastOccurence() { + return this.lastOccurence != null && !this.lastOccurence.isEmpty(); + } + + /** + * @param value {@link #lastOccurence} (Represents the date and/or time of the last known occurrence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value + */ + public AllergyIntolerance setLastOccurenceElement(DateTimeType value) { + this.lastOccurence = value; + return this; + } + + /** + * @return Represents the date and/or time of the last known occurrence of a reaction event. + */ + public Date getLastOccurence() { + return this.lastOccurence == null ? null : this.lastOccurence.getValue(); + } + + /** + * @param value Represents the date and/or time of the last known occurrence of a reaction event. + */ + public AllergyIntolerance setLastOccurence(Date value) { + if (value == null) + this.lastOccurence = null; + else { + if (this.lastOccurence == null) + this.lastOccurence = new DateTimeType(); + this.lastOccurence.setValue(value); + } + return this; + } + + /** + * @return {@link #note} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public AllergyIntolerance addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #reaction} (Details about each adverse reaction event linked to exposure to the identified Substance.) + */ + public List getReaction() { + if (this.reaction == null) + this.reaction = new ArrayList(); + return this.reaction; + } + + public boolean hasReaction() { + if (this.reaction == null) + return false; + for (AllergyIntoleranceReactionComponent item : this.reaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reaction} (Details about each adverse reaction event linked to exposure to the identified Substance.) + */ + // syntactic sugar + public AllergyIntoleranceReactionComponent addReaction() { //3 + AllergyIntoleranceReactionComponent t = new AllergyIntoleranceReactionComponent(); + if (this.reaction == null) + this.reaction = new ArrayList(); + this.reaction.add(t); + return t; + } + + // syntactic sugar + public AllergyIntolerance addReaction(AllergyIntoleranceReactionComponent t) { //3 + if (t == null) + return this; + if (this.reaction == null) + this.reaction = new ArrayList(); + this.reaction.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this allergy/intolerance concern 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("status", "code", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "code", "Identification of the underlying physiological mechanism for the reaction risk.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("category", "code", "Category of the identified Substance.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, criticality)); + childrenList.add(new Property("substance", "CodeableConcept", "Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk.", 0, java.lang.Integer.MAX_VALUE, substance)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("recordedDate", "dateTime", "Date when the sensitivity was recorded.", 0, java.lang.Integer.MAX_VALUE, recordedDate)); + childrenList.add(new Property("recorder", "Reference(Practitioner|Patient)", "Individual who recorded the record and takes responsibility for its content.", 0, java.lang.Integer.MAX_VALUE, recorder)); + childrenList.add(new Property("reporter", "Reference(Patient|RelatedPerson|Practitioner)", "The source of the information about the allergy that is recorded.", 0, java.lang.Integer.MAX_VALUE, reporter)); + childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Allergy or Intolerance.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("lastOccurence", "dateTime", "Represents the date and/or time of the last known occurrence of a reaction event.", 0, java.lang.Integer.MAX_VALUE, lastOccurence)); + childrenList.add(new Property("note", "Annotation", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("reaction", "", "Details about each adverse reaction event linked to exposure to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, reaction)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration + case -1608054609: /*criticality*/ return this.criticality == null ? new Base[0] : new Base[] {this.criticality}; // Enumeration + case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // CodeableConcept + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1952893826: /*recordedDate*/ return this.recordedDate == null ? new Base[0] : new Base[] {this.recordedDate}; // DateTimeType + case -799233858: /*recorder*/ return this.recorder == null ? new Base[0] : new Base[] {this.recorder}; // Reference + case -427039519: /*reporter*/ return this.reporter == null ? new Base[0] : new Base[] {this.reporter}; // Reference + case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // DateTimeType + case 1307739841: /*lastOccurence*/ return this.lastOccurence == null ? new Base[0] : new Base[] {this.lastOccurence}; // DateTimeType + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case -867509719: /*reaction*/ return this.reaction == null ? new Base[0] : this.reaction.toArray(new Base[this.reaction.size()]); // AllergyIntoleranceReactionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new AllergyIntoleranceStatusEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = new AllergyIntoleranceTypeEnumFactory().fromType(value); // Enumeration + break; + case 50511102: // category + this.category = new AllergyIntoleranceCategoryEnumFactory().fromType(value); // Enumeration + break; + case -1608054609: // criticality + this.criticality = new AllergyIntoleranceCriticalityEnumFactory().fromType(value); // Enumeration + break; + case 530040176: // substance + this.substance = castToCodeableConcept(value); // CodeableConcept + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1952893826: // recordedDate + this.recordedDate = castToDateTime(value); // DateTimeType + break; + case -799233858: // recorder + this.recorder = castToReference(value); // Reference + break; + case -427039519: // reporter + this.reporter = castToReference(value); // Reference + break; + case 105901603: // onset + this.onset = castToDateTime(value); // DateTimeType + break; + case 1307739841: // lastOccurence + this.lastOccurence = castToDateTime(value); // DateTimeType + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case -867509719: // reaction + this.getReaction().add((AllergyIntoleranceReactionComponent) value); // AllergyIntoleranceReactionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new AllergyIntoleranceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = new AllergyIntoleranceTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("category")) + this.category = new AllergyIntoleranceCategoryEnumFactory().fromType(value); // Enumeration + else if (name.equals("criticality")) + this.criticality = new AllergyIntoleranceCriticalityEnumFactory().fromType(value); // Enumeration + else if (name.equals("substance")) + this.substance = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("recordedDate")) + this.recordedDate = castToDateTime(value); // DateTimeType + else if (name.equals("recorder")) + this.recorder = castToReference(value); // Reference + else if (name.equals("reporter")) + this.reporter = castToReference(value); // Reference + else if (name.equals("onset")) + this.onset = castToDateTime(value); // DateTimeType + else if (name.equals("lastOccurence")) + this.lastOccurence = castToDateTime(value); // DateTimeType + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("reaction")) + this.getReaction().add((AllergyIntoleranceReactionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration + case -1608054609: throw new FHIRException("Cannot make property criticality as it is not a complex type"); // Enumeration + case 530040176: return getSubstance(); // CodeableConcept + case -791418107: return getPatient(); // Reference + case -1952893826: throw new FHIRException("Cannot make property recordedDate as it is not a complex type"); // DateTimeType + case -799233858: return getRecorder(); // Reference + case -427039519: return getReporter(); // Reference + case 105901603: throw new FHIRException("Cannot make property onset as it is not a complex type"); // DateTimeType + case 1307739841: throw new FHIRException("Cannot make property lastOccurence as it is not a complex type"); // DateTimeType + case 3387378: return addNote(); // Annotation + case -867509719: return addReaction(); // AllergyIntoleranceReactionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.status"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.type"); + } + else if (name.equals("category")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.category"); + } + else if (name.equals("criticality")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.criticality"); + } + else if (name.equals("substance")) { + this.substance = new CodeableConcept(); + return this.substance; + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("recordedDate")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.recordedDate"); + } + else if (name.equals("recorder")) { + this.recorder = new Reference(); + return this.recorder; + } + else if (name.equals("reporter")) { + this.reporter = new Reference(); + return this.reporter; + } + else if (name.equals("onset")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.onset"); + } + else if (name.equals("lastOccurence")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.lastOccurence"); + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("reaction")) { + return addReaction(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "AllergyIntolerance"; + + } + + public AllergyIntolerance copy() { + AllergyIntolerance dst = new AllergyIntolerance(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.category = category == null ? null : category.copy(); + dst.criticality = criticality == null ? null : criticality.copy(); + dst.substance = substance == null ? null : substance.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.recordedDate = recordedDate == null ? null : recordedDate.copy(); + dst.recorder = recorder == null ? null : recorder.copy(); + dst.reporter = reporter == null ? null : reporter.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.lastOccurence = lastOccurence == null ? null : lastOccurence.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + if (reaction != null) { + dst.reaction = new ArrayList(); + for (AllergyIntoleranceReactionComponent i : reaction) + dst.reaction.add(i.copy()); + }; + return dst; + } + + protected AllergyIntolerance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AllergyIntolerance)) + return false; + AllergyIntolerance o = (AllergyIntolerance) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) + && compareDeep(category, o.category, true) && compareDeep(criticality, o.criticality, true) && compareDeep(substance, o.substance, true) + && compareDeep(patient, o.patient, true) && compareDeep(recordedDate, o.recordedDate, true) && compareDeep(recorder, o.recorder, true) + && compareDeep(reporter, o.reporter, true) && compareDeep(onset, o.onset, true) && compareDeep(lastOccurence, o.lastOccurence, true) + && compareDeep(note, o.note, true) && compareDeep(reaction, o.reaction, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AllergyIntolerance)) + return false; + AllergyIntolerance o = (AllergyIntolerance) other; + return compareValues(status, o.status, true) && compareValues(type, o.type, true) && compareValues(category, o.category, true) + && compareValues(criticality, o.criticality, true) && compareValues(recordedDate, o.recordedDate, true) + && compareValues(onset, o.onset, true) && compareValues(lastOccurence, o.lastOccurence, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (type == null || type.isEmpty()) && (category == null || category.isEmpty()) && (criticality == null || criticality.isEmpty()) + && (substance == null || substance.isEmpty()) && (patient == null || patient.isEmpty()) && (recordedDate == null || recordedDate.isEmpty()) + && (recorder == null || recorder.isEmpty()) && (reporter == null || reporter.isEmpty()) && (onset == null || onset.isEmpty()) + && (lastOccurence == null || lastOccurence.isEmpty()) && (note == null || note.isEmpty()) + && (reaction == null || reaction.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.AllergyIntolerance; + } + + /** + * Search parameter: status + *

+ * Description: active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error
+ * Type: token
+ * Path: AllergyIntolerance.status
+ *

+ */ + @SearchParamDefinition(name="status", path="AllergyIntolerance.status", description="active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error
+ * Type: token
+ * Path: AllergyIntolerance.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: onset + *

+ * Description: Date(/time) when manifestations showed
+ * Type: date
+ * Path: AllergyIntolerance.reaction.onset
+ *

+ */ + @SearchParamDefinition(name="onset", path="AllergyIntolerance.reaction.onset", description="Date(/time) when manifestations showed", type="date" ) + public static final String SP_ONSET = "onset"; + /** + * Fluent Client search parameter constant for onset + *

+ * Description: Date(/time) when manifestations showed
+ * Type: date
+ * Path: AllergyIntolerance.reaction.onset
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam ONSET = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ONSET); + + /** + * Search parameter: last-date + *

+ * Description: Date(/time) of last known occurrence of a reaction
+ * Type: date
+ * Path: AllergyIntolerance.lastOccurence
+ *

+ */ + @SearchParamDefinition(name="last-date", path="AllergyIntolerance.lastOccurence", description="Date(/time) of last known occurrence of a reaction", type="date" ) + public static final String SP_LAST_DATE = "last-date"; + /** + * Fluent Client search parameter constant for last-date + *

+ * Description: Date(/time) of last known occurrence of a reaction
+ * Type: date
+ * Path: AllergyIntolerance.lastOccurence
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam LAST_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_LAST_DATE); + + /** + * Search parameter: severity + *

+ * Description: mild | moderate | severe (of event as a whole)
+ * Type: token
+ * Path: AllergyIntolerance.reaction.severity
+ *

+ */ + @SearchParamDefinition(name="severity", path="AllergyIntolerance.reaction.severity", description="mild | moderate | severe (of event as a whole)", type="token" ) + public static final String SP_SEVERITY = "severity"; + /** + * Fluent Client search parameter constant for severity + *

+ * Description: mild | moderate | severe (of event as a whole)
+ * Type: token
+ * Path: AllergyIntolerance.reaction.severity
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SEVERITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SEVERITY); + + /** + * Search parameter: type + *

+ * Description: allergy | intolerance - Underlying mechanism (if known)
+ * Type: token
+ * Path: AllergyIntolerance.type
+ *

+ */ + @SearchParamDefinition(name="type", path="AllergyIntolerance.type", description="allergy | intolerance - Underlying mechanism (if known)", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: allergy | intolerance - Underlying mechanism (if known)
+ * Type: token
+ * Path: AllergyIntolerance.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: date + *

+ * Description: When recorded
+ * Type: date
+ * Path: AllergyIntolerance.recordedDate
+ *

+ */ + @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate", description="When recorded", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When recorded
+ * Type: date
+ * Path: AllergyIntolerance.recordedDate
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: reporter + *

+ * Description: Source of the information about the allergy
+ * Type: reference
+ * Path: AllergyIntolerance.reporter
+ *

+ */ + @SearchParamDefinition(name="reporter", path="AllergyIntolerance.reporter", description="Source of the information about the allergy", type="reference" ) + public static final String SP_REPORTER = "reporter"; + /** + * Fluent Client search parameter constant for reporter + *

+ * Description: Source of the information about the allergy
+ * Type: reference
+ * Path: AllergyIntolerance.reporter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPORTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPORTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AllergyIntolerance:reporter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REPORTER = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:reporter").toLocked(); + + /** + * Search parameter: substance + *

+ * Description: Substance, (or class) considered to be responsible for risk
+ * Type: token
+ * Path: AllergyIntolerance.substance, AllergyIntolerance.reaction.substance
+ *

+ */ + @SearchParamDefinition(name="substance", path="AllergyIntolerance.substance | AllergyIntolerance.reaction.substance", description="Substance, (or class) considered to be responsible for risk", type="token" ) + public static final String SP_SUBSTANCE = "substance"; + /** + * Fluent Client search parameter constant for substance + *

+ * Description: Substance, (or class) considered to be responsible for risk
+ * Type: token
+ * Path: AllergyIntolerance.substance, AllergyIntolerance.reaction.substance
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBSTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBSTANCE); + + /** + * Search parameter: criticality + *

+ * Description: low | high | unable-to-assess
+ * Type: token
+ * Path: AllergyIntolerance.criticality
+ *

+ */ + @SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high | unable-to-assess", type="token" ) + public static final String SP_CRITICALITY = "criticality"; + /** + * Fluent Client search parameter constant for criticality + *

+ * Description: low | high | unable-to-assess
+ * Type: token
+ * Path: AllergyIntolerance.criticality
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CRITICALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CRITICALITY); + + /** + * Search parameter: category + *

+ * Description: food | medication | environment | other - Category of Substance
+ * Type: token
+ * Path: AllergyIntolerance.category
+ *

+ */ + @SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | environment | other - Category of Substance", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: food | medication | environment | other - Category of Substance
+ * Type: token
+ * Path: AllergyIntolerance.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: patient + *

+ * Description: Who the sensitivity is for
+ * Type: reference
+ * Path: AllergyIntolerance.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient", description="Who the sensitivity is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who the sensitivity is for
+ * Type: reference
+ * Path: AllergyIntolerance.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AllergyIntolerance:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:patient").toLocked(); + + /** + * Search parameter: recorder + *

+ * Description: Who recorded the sensitivity
+ * Type: reference
+ * Path: AllergyIntolerance.recorder
+ *

+ */ + @SearchParamDefinition(name="recorder", path="AllergyIntolerance.recorder", description="Who recorded the sensitivity", type="reference" ) + public static final String SP_RECORDER = "recorder"; + /** + * Fluent Client search parameter constant for recorder + *

+ * Description: Who recorded the sensitivity
+ * Type: reference
+ * Path: AllergyIntolerance.recorder
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECORDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECORDER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AllergyIntolerance:recorder". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RECORDER = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:recorder").toLocked(); + + /** + * Search parameter: route + *

+ * Description: How the subject was exposed to the substance
+ * Type: token
+ * Path: AllergyIntolerance.reaction.exposureRoute
+ *

+ */ + @SearchParamDefinition(name="route", path="AllergyIntolerance.reaction.exposureRoute", description="How the subject was exposed to the substance", type="token" ) + public static final String SP_ROUTE = "route"; + /** + * Fluent Client search parameter constant for route + *

+ * Description: How the subject was exposed to the substance
+ * Type: token
+ * Path: AllergyIntolerance.reaction.exposureRoute
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROUTE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROUTE); + + /** + * Search parameter: identifier + *

+ * Description: External ids for this item
+ * Type: token
+ * Path: AllergyIntolerance.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier", description="External ids for this item", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: External ids for this item
+ * Type: token
+ * Path: AllergyIntolerance.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: manifestation + *

+ * Description: Clinical symptoms/signs associated with the Event
+ * Type: token
+ * Path: AllergyIntolerance.reaction.manifestation
+ *

+ */ + @SearchParamDefinition(name="manifestation", path="AllergyIntolerance.reaction.manifestation", description="Clinical symptoms/signs associated with the Event", type="token" ) + public static final String SP_MANIFESTATION = "manifestation"; + /** + * Fluent Client search parameter constant for manifestation + *

+ * Description: Clinical symptoms/signs associated with the Event
+ * Type: token
+ * Path: AllergyIntolerance.reaction.manifestation
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam MANIFESTATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MANIFESTATION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Annotation.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Annotation.java new file mode 100644 index 00000000000..bfe8ab60d24 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Annotation.java @@ -0,0 +1,349 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A text note which also contains information about who made the statement and when. + */ +@DatatypeDef(name="Annotation") +public class Annotation extends Type implements ICompositeType { + + /** + * The individual responsible for making the annotation. + */ + @Child(name = "author", type = {Practitioner.class, Patient.class, RelatedPerson.class, StringType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Individual responsible for the annotation", formalDefinition="The individual responsible for making the annotation." ) + protected Type author; + + /** + * Indicates when this particular annotation was made. + */ + @Child(name = "time", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the annotation was made", formalDefinition="Indicates when this particular annotation was made." ) + protected DateTimeType time; + + /** + * The text of the annotation. + */ + @Child(name = "text", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The annotation - text content", formalDefinition="The text of the annotation." ) + protected StringType text; + + private static final long serialVersionUID = -575590381L; + + /** + * Constructor + */ + public Annotation() { + super(); + } + + /** + * Constructor + */ + public Annotation(StringType text) { + super(); + this.text = text; + } + + /** + * @return {@link #author} (The individual responsible for making the annotation.) + */ + public Type getAuthor() { + return this.author; + } + + /** + * @return {@link #author} (The individual responsible for making the annotation.) + */ + public Reference getAuthorReference() throws FHIRException { + if (!(this.author instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.author.getClass().getName()+" was encountered"); + return (Reference) this.author; + } + + public boolean hasAuthorReference() { + return this.author instanceof Reference; + } + + /** + * @return {@link #author} (The individual responsible for making the annotation.) + */ + public StringType getAuthorStringType() throws FHIRException { + if (!(this.author instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.author.getClass().getName()+" was encountered"); + return (StringType) this.author; + } + + public boolean hasAuthorStringType() { + return this.author instanceof StringType; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (The individual responsible for making the annotation.) + */ + public Annotation setAuthor(Type value) { + this.author = value; + return this; + } + + /** + * @return {@link #time} (Indicates when this particular annotation was made.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DateTimeType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Annotation.time"); + else if (Configuration.doAutoCreate()) + this.time = new DateTimeType(); // bb + 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} (Indicates when this particular annotation was made.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public Annotation setTimeElement(DateTimeType value) { + this.time = value; + return this; + } + + /** + * @return Indicates when this particular annotation was made. + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value Indicates when this particular annotation was made. + */ + public Annotation setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new DateTimeType(); + this.time.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (The text of the annotation.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Annotation.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The text of the annotation.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public Annotation setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The text of the annotation. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The text of the annotation. + */ + public Annotation setText(String value) { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("author[x]", "Reference(Practitioner|Patient|RelatedPerson)|string", "The individual responsible for making the annotation.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("time", "dateTime", "Indicates when this particular annotation was made.", 0, java.lang.Integer.MAX_VALUE, time)); + childrenList.add(new Property("text", "string", "The text of the annotation.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Type + case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1406328437: // author + this.author = (Type) value; // Type + break; + case 3560141: // time + this.time = castToDateTime(value); // DateTimeType + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("author[x]")) + this.author = (Type) value; // Type + else if (name.equals("time")) + this.time = castToDateTime(value); // DateTimeType + else if (name.equals("text")) + this.text = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1475597077: return getAuthor(); // Type + case 3560141: throw new FHIRException("Cannot make property time as it is not a complex type"); // DateTimeType + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("authorReference")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("authorString")) { + this.author = new StringType(); + return this.author; + } + else if (name.equals("time")) { + throw new FHIRException("Cannot call addChild on a primitive type Annotation.time"); + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type Annotation.text"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Annotation"; + + } + + public Annotation copy() { + Annotation dst = new Annotation(); + copyValues(dst); + dst.author = author == null ? null : author.copy(); + dst.time = time == null ? null : time.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + protected Annotation typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Annotation)) + return false; + Annotation o = (Annotation) other; + return compareDeep(author, o.author, true) && compareDeep(time, o.time, true) && compareDeep(text, o.text, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Annotation)) + return false; + Annotation o = (Annotation) other; + return compareValues(time, o.time, true) && compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (author == null || author.isEmpty()) && (time == null || time.isEmpty()) + && (text == null || text.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Appointment.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Appointment.java new file mode 100644 index 00000000000..21000c92c80 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Appointment.java @@ -0,0 +1,2143 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). + */ +@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/Profile/Appointment") +public class Appointment extends DomainResource { + + public enum AppointmentStatus { + /** + * None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time may not be set yet. + */ + PROPOSED, + /** + * Some or all of the participant(s) have not finalized their acceptance of the appointment request. + */ + PENDING, + /** + * All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified. + */ + BOOKED, + /** + * Some of the patients have arrived. + */ + ARRIVED, + /** + * This appointment has completed and may have resulted in an encounter. + */ + FULFILLED, + /** + * The appointment has been cancelled. + */ + CANCELLED, + /** + * Some or all of the participant(s) have not/did not appear for the appointment (usually the patient). + */ + NOSHOW, + /** + * added to help the parsers + */ + NULL; + public static AppointmentStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("pending".equals(codeString)) + return PENDING; + if ("booked".equals(codeString)) + return BOOKED; + if ("arrived".equals(codeString)) + return ARRIVED; + if ("fulfilled".equals(codeString)) + return FULFILLED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("noshow".equals(codeString)) + return NOSHOW; + throw new FHIRException("Unknown AppointmentStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case PENDING: return "pending"; + case BOOKED: return "booked"; + case ARRIVED: return "arrived"; + case FULFILLED: return "fulfilled"; + case CANCELLED: return "cancelled"; + case NOSHOW: return "noshow"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return "http://hl7.org/fhir/appointmentstatus"; + case PENDING: return "http://hl7.org/fhir/appointmentstatus"; + case BOOKED: return "http://hl7.org/fhir/appointmentstatus"; + case ARRIVED: return "http://hl7.org/fhir/appointmentstatus"; + case FULFILLED: return "http://hl7.org/fhir/appointmentstatus"; + case CANCELLED: return "http://hl7.org/fhir/appointmentstatus"; + case NOSHOW: return "http://hl7.org/fhir/appointmentstatus"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time may not be set yet."; + case PENDING: return "Some or all of the participant(s) have not finalized their acceptance of the appointment request."; + case BOOKED: return "All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified."; + case ARRIVED: return "Some of the patients have arrived."; + case FULFILLED: return "This appointment has completed and may have resulted in an encounter."; + case CANCELLED: return "The appointment has been cancelled."; + case NOSHOW: return "Some or all of the participant(s) have not/did not appear for the appointment (usually the patient)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case PENDING: return "Pending"; + case BOOKED: return "Booked"; + case ARRIVED: return "Arrived"; + case FULFILLED: return "Fulfilled"; + case CANCELLED: return "Cancelled"; + case NOSHOW: return "No Show"; + default: return "?"; + } + } + } + + public static class AppointmentStatusEnumFactory implements EnumFactory { + public AppointmentStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return AppointmentStatus.PROPOSED; + if ("pending".equals(codeString)) + return AppointmentStatus.PENDING; + if ("booked".equals(codeString)) + return AppointmentStatus.BOOKED; + if ("arrived".equals(codeString)) + return AppointmentStatus.ARRIVED; + if ("fulfilled".equals(codeString)) + return AppointmentStatus.FULFILLED; + if ("cancelled".equals(codeString)) + return AppointmentStatus.CANCELLED; + if ("noshow".equals(codeString)) + return AppointmentStatus.NOSHOW; + throw new IllegalArgumentException("Unknown AppointmentStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return new Enumeration(this, AppointmentStatus.PROPOSED); + if ("pending".equals(codeString)) + return new Enumeration(this, AppointmentStatus.PENDING); + if ("booked".equals(codeString)) + return new Enumeration(this, AppointmentStatus.BOOKED); + if ("arrived".equals(codeString)) + return new Enumeration(this, AppointmentStatus.ARRIVED); + if ("fulfilled".equals(codeString)) + return new Enumeration(this, AppointmentStatus.FULFILLED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, AppointmentStatus.CANCELLED); + if ("noshow".equals(codeString)) + return new Enumeration(this, AppointmentStatus.NOSHOW); + throw new FHIRException("Unknown AppointmentStatus code '"+codeString+"'"); + } + public String toCode(AppointmentStatus code) { + if (code == AppointmentStatus.PROPOSED) + return "proposed"; + if (code == AppointmentStatus.PENDING) + return "pending"; + if (code == AppointmentStatus.BOOKED) + return "booked"; + if (code == AppointmentStatus.ARRIVED) + return "arrived"; + if (code == AppointmentStatus.FULFILLED) + return "fulfilled"; + if (code == AppointmentStatus.CANCELLED) + return "cancelled"; + if (code == AppointmentStatus.NOSHOW) + return "noshow"; + return "?"; + } + public String toSystem(AppointmentStatus code) { + return code.getSystem(); + } + } + + public enum ParticipantRequired { + /** + * The participant is required to attend the appointment. + */ + REQUIRED, + /** + * The participant may optionally attend the appointment. + */ + OPTIONAL, + /** + * The participant is excluded from the appointment, and may not be informed of the appointment taking place. (Appointment is about them, not for them - such as 2 doctors discussing results about a patient's test). + */ + INFORMATIONONLY, + /** + * added to help the parsers + */ + NULL; + public static ParticipantRequired fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return REQUIRED; + if ("optional".equals(codeString)) + return OPTIONAL; + if ("information-only".equals(codeString)) + return INFORMATIONONLY; + throw new FHIRException("Unknown ParticipantRequired code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUIRED: return "required"; + case OPTIONAL: return "optional"; + case INFORMATIONONLY: return "information-only"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUIRED: return "http://hl7.org/fhir/participantrequired"; + case OPTIONAL: return "http://hl7.org/fhir/participantrequired"; + case INFORMATIONONLY: return "http://hl7.org/fhir/participantrequired"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUIRED: return "The participant is required to attend the appointment."; + case OPTIONAL: return "The participant may optionally attend the appointment."; + case INFORMATIONONLY: return "The participant is excluded from the appointment, and may not be informed of the appointment taking place. (Appointment is about them, not for them - such as 2 doctors discussing results about a patient's test)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUIRED: return "Required"; + case OPTIONAL: return "Optional"; + case INFORMATIONONLY: return "Information Only"; + default: return "?"; + } + } + } + + 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; + if ("required".equals(codeString)) + return ParticipantRequired.REQUIRED; + if ("optional".equals(codeString)) + return ParticipantRequired.OPTIONAL; + if ("information-only".equals(codeString)) + return ParticipantRequired.INFORMATIONONLY; + throw new IllegalArgumentException("Unknown ParticipantRequired code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return new Enumeration(this, ParticipantRequired.REQUIRED); + if ("optional".equals(codeString)) + return new Enumeration(this, ParticipantRequired.OPTIONAL); + if ("information-only".equals(codeString)) + return new Enumeration(this, ParticipantRequired.INFORMATIONONLY); + throw new FHIRException("Unknown ParticipantRequired code '"+codeString+"'"); + } + public String toCode(ParticipantRequired code) { + if (code == ParticipantRequired.REQUIRED) + return "required"; + if (code == ParticipantRequired.OPTIONAL) + return "optional"; + if (code == ParticipantRequired.INFORMATIONONLY) + return "information-only"; + return "?"; + } + public String toSystem(ParticipantRequired code) { + return code.getSystem(); + } + } + + public enum ParticipationStatus { + /** + * The participant has accepted the appointment. + */ + ACCEPTED, + /** + * The participant has declined the appointment and will not participate in the appointment. + */ + DECLINED, + /** + * The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur. + */ + TENTATIVE, + /** + * The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses. + */ + NEEDSACTION, + /** + * added to help the parsers + */ + NULL; + public static ParticipationStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("declined".equals(codeString)) + return DECLINED; + if ("tentative".equals(codeString)) + return TENTATIVE; + if ("needs-action".equals(codeString)) + return NEEDSACTION; + throw new FHIRException("Unknown ParticipationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACCEPTED: return "accepted"; + case DECLINED: return "declined"; + case TENTATIVE: return "tentative"; + case NEEDSACTION: return "needs-action"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACCEPTED: return "http://hl7.org/fhir/participationstatus"; + case DECLINED: return "http://hl7.org/fhir/participationstatus"; + case TENTATIVE: return "http://hl7.org/fhir/participationstatus"; + case NEEDSACTION: return "http://hl7.org/fhir/participationstatus"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACCEPTED: return "The participant has accepted the appointment."; + case DECLINED: return "The participant has declined the appointment and will not participate in the appointment."; + case TENTATIVE: return "The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur."; + case NEEDSACTION: return "The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACCEPTED: return "Accepted"; + case DECLINED: return "Declined"; + case TENTATIVE: return "Tentative"; + case NEEDSACTION: return "Needs Action"; + default: return "?"; + } + } + } + + 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; + if ("accepted".equals(codeString)) + return ParticipationStatus.ACCEPTED; + if ("declined".equals(codeString)) + return ParticipationStatus.DECLINED; + if ("tentative".equals(codeString)) + return ParticipationStatus.TENTATIVE; + if ("needs-action".equals(codeString)) + return ParticipationStatus.NEEDSACTION; + throw new IllegalArgumentException("Unknown ParticipationStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("accepted".equals(codeString)) + return new Enumeration(this, ParticipationStatus.ACCEPTED); + if ("declined".equals(codeString)) + return new Enumeration(this, ParticipationStatus.DECLINED); + if ("tentative".equals(codeString)) + return new Enumeration(this, ParticipationStatus.TENTATIVE); + if ("needs-action".equals(codeString)) + return new Enumeration(this, ParticipationStatus.NEEDSACTION); + throw new FHIRException("Unknown ParticipationStatus code '"+codeString+"'"); + } + public String toCode(ParticipationStatus code) { + if (code == ParticipationStatus.ACCEPTED) + return "accepted"; + if (code == ParticipationStatus.DECLINED) + return "declined"; + if (code == ParticipationStatus.TENTATIVE) + return "tentative"; + if (code == ParticipationStatus.NEEDSACTION) + return "needs-action"; + return "?"; + } + public String toSystem(ParticipationStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class AppointmentParticipantComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Role of participant in the appointment. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) + protected List type; + + /** + * A Person, Location/HealthcareService or Device that is participating in the appointment. + */ + @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Person, Location/HealthcareService or Device", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + protected Resource actorTarget; + + /** + * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + @Child(name = "required", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="required | optional | information-only", formalDefinition="Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present." ) + protected Enumeration required; + + /** + * Participation status of the Patient. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="accepted | declined | tentative | needs-action", formalDefinition="Participation status of the Patient." ) + protected Enumeration status; + + private static final long serialVersionUID = -1620552507L; + + /** + * Constructor + */ + public AppointmentParticipantComponent() { + super(); + } + + /** + * Constructor + */ + public AppointmentParticipantComponent(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #type} (Role of participant in the appointment.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + 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 {@link #type} (Role of participant in the appointment.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public AppointmentParticipantComponent addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentParticipantComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public AppointmentParticipantComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public AppointmentParticipantComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public Enumeration getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentParticipantComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new Enumeration(new ParticipantRequiredEnumFactory()); // bb + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public AppointmentParticipantComponent setRequiredElement(Enumeration value) { + this.required = value; + return this; + } + + /** + * @return Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + public ParticipantRequired getRequired() { + return this.required == null ? null : this.required.getValue(); + } + + /** + * @param value Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + public AppointmentParticipantComponent setRequired(ParticipantRequired value) { + if (value == null) + this.required = null; + else { + if (this.required == null) + this.required = new Enumeration(new ParticipantRequiredEnumFactory()); + this.required.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (Participation status of the Patient.). 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 AppointmentParticipantComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ParticipationStatusEnumFactory()); // bb + 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} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public AppointmentParticipantComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Participation status of the Patient. + */ + public ParticipationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Participation status of the Patient. + */ + public AppointmentParticipantComponent setStatus(ParticipationStatus value) { + if (this.status == null) + this.status = new Enumeration(new ParticipationStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("required", "code", "Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("status", "code", "Participation status of the Patient.", 0, java.lang.Integer.MAX_VALUE, status)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept + case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference + case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // Enumeration + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.getType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 92645877: // actor + this.actor = castToReference(value); // Reference + break; + case -393139297: // required + this.required = new ParticipantRequiredEnumFactory().fromType(value); // Enumeration + break; + case -892481550: // status + this.status = new ParticipationStatusEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.getType().add(castToCodeableConcept(value)); + else if (name.equals("actor")) + this.actor = castToReference(value); // Reference + else if (name.equals("required")) + this.required = new ParticipantRequiredEnumFactory().fromType(value); // Enumeration + else if (name.equals("status")) + this.status = new ParticipationStatusEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return addType(); // CodeableConcept + case 92645877: return getActor(); // Reference + case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // Enumeration + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + return addType(); + } + else if (name.equals("actor")) { + this.actor = new Reference(); + return this.actor; + } + else if (name.equals("required")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.required"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.status"); + } + else + return super.addChild(name); + } + + public AppointmentParticipantComponent copy() { + AppointmentParticipantComponent dst = new AppointmentParticipantComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.actor = actor == null ? null : actor.copy(); + dst.required = required == null ? null : required.copy(); + dst.status = status == null ? null : status.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AppointmentParticipantComponent)) + return false; + AppointmentParticipantComponent o = (AppointmentParticipantComponent) other; + return compareDeep(type, o.type, true) && compareDeep(actor, o.actor, true) && compareDeep(required, o.required, true) + && compareDeep(status, o.status, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AppointmentParticipantComponent)) + return false; + AppointmentParticipantComponent o = (AppointmentParticipantComponent) other; + return compareValues(required, o.required, true) && compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (actor == null || actor.isEmpty()) + && (required == null || required.isEmpty()) && (status == null || status.isEmpty()); + } + + public String fhirType() { + return "Appointment.participant"; + + } + + } + + /** + * This records identifiers associated with this appointment concern 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=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment concern 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 overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposed | pending | booked | arrived | fulfilled | cancelled | noshow", formalDefinition="The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status." ) + protected Enumeration status; + + /** + * A broad categorisation of the service that is to be performed during this appointment. + */ + @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A broad categorisation of the service that is to be performed during this appointment", formalDefinition="A broad categorisation of the service that is to be performed during this appointment." ) + protected CodeableConcept serviceCategory; + + /** + * The specific service that is to be performed during this appointment. + */ + @Child(name = "serviceType", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The specific service that is to be performed during this appointment", formalDefinition="The specific service that is to be performed during this appointment." ) + protected List serviceType; + + /** + * The specialty of a practitioner that would be required to perform the service requested in this appointment. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment", formalDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment." ) + protected List specialty; + + /** + * The style of appointment or patient that has been booked in the slot (not service type). + */ + @Child(name = "appointmentType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The style of appointment or patient that has been booked in the slot (not service type)", formalDefinition="The style of appointment or patient that has been booked in the slot (not service type)." ) + protected CodeableConcept appointmentType; + + /** + * The reason that this appointment is being scheduled. This is more clinical than administrative. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason this appointment is scheduled", formalDefinition="The reason that this appointment is being scheduled. This is more clinical than administrative." ) + protected CodeableConcept reason; + + /** + * The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). + */ + @Child(name = "priority", type = {UnsignedIntType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Used to make informed decisions if needing to re-prioritize", formalDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority)." ) + protected UnsignedIntType priority; + + /** + * The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Shown on a subject line in a meeting request, or appointment list", formalDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field." ) + protected StringType description; + + /** + * Date/Time that the appointment is to take place. + */ + @Child(name = "start", type = {InstantType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." ) + protected InstantType start; + + /** + * Date/Time that the appointment is to conclude. + */ + @Child(name = "end", type = {InstantType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." ) + protected InstantType end; + + /** + * Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request). + */ + @Child(name = "minutesDuration", type = {PositiveIntType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Can be less than start/end (e.g. estimate)", formalDefinition="Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request)." ) + protected PositiveIntType minutesDuration; + + /** + * The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot. + */ + @Child(name = "slot", type = {Slot.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="If provided, then no schedule and start/end values MUST match slot", formalDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot." ) + protected List slot; + /** + * The actual objects that are the target of the reference (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + protected List slotTarget; + + + /** + * The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment. + */ + @Child(name = "created", type = {DateTimeType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The date that this appointment was initially created", formalDefinition="The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment." ) + protected DateTimeType created; + + /** + * Additional comments about the appointment. + */ + @Child(name = "comment", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Additional comments", formalDefinition="Additional comments about the appointment." ) + protected StringType comment; + + /** + * List of participants involved in the appointment. + */ + @Child(name = "participant", type = {}, order=15, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Participants involved in appointment", formalDefinition="List of participants involved in the appointment." ) + protected List participant; + + private static final long serialVersionUID = 552749730L; + + /** + * Constructor + */ + public Appointment() { + super(); + } + + /** + * Constructor + */ + public Appointment(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this appointment concern 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} (This records identifiers associated with this appointment concern 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; + } + + // syntactic sugar + public Appointment addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). 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 Appointment.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new AppointmentStatusEnumFactory()); // bb + 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 overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Appointment setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + public AppointmentStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + public Appointment setStatus(AppointmentStatus value) { + if (this.status == null) + this.status = new Enumeration(new AppointmentStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) + */ + public CodeableConcept getServiceCategory() { + if (this.serviceCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.serviceCategory"); + else if (Configuration.doAutoCreate()) + this.serviceCategory = new CodeableConcept(); // cc + return this.serviceCategory; + } + + public boolean hasServiceCategory() { + return this.serviceCategory != null && !this.serviceCategory.isEmpty(); + } + + /** + * @param value {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) + */ + public Appointment setServiceCategory(CodeableConcept value) { + this.serviceCategory = value; + return this; + } + + /** + * @return {@link #serviceType} (The specific service that is to be performed during this appointment.) + */ + public List getServiceType() { + if (this.serviceType == null) + this.serviceType = new ArrayList(); + return this.serviceType; + } + + public boolean hasServiceType() { + if (this.serviceType == null) + return false; + for (CodeableConcept item : this.serviceType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceType} (The specific service that is to be performed during this appointment.) + */ + // syntactic sugar + public CodeableConcept addServiceType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return t; + } + + // syntactic sugar + public Appointment addServiceType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return this; + } + + /** + * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + // syntactic sugar + public Appointment addSpecialty(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return this; + } + + /** + * @return {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).) + */ + public CodeableConcept getAppointmentType() { + if (this.appointmentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.appointmentType"); + else if (Configuration.doAutoCreate()) + this.appointmentType = new CodeableConcept(); // cc + return this.appointmentType; + } + + public boolean hasAppointmentType() { + return this.appointmentType != null && !this.appointmentType.isEmpty(); + } + + /** + * @param value {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).) + */ + public Appointment setAppointmentType(CodeableConcept value) { + this.appointmentType = value; + return this; + } + + /** + * @return {@link #reason} (The reason that this appointment is being scheduled. This is more clinical than administrative.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (The reason that this appointment is being scheduled. This is more clinical than administrative.) + */ + public Appointment setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public UnsignedIntType getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new UnsignedIntType(); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Appointment setPriorityElement(UnsignedIntType value) { + this.priority = value; + return this; + } + + /** + * @return The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). + */ + public int getPriority() { + return this.priority == null || this.priority.isEmpty() ? 0 : this.priority.getValue(); + } + + /** + * @param value The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). + */ + public Appointment setPriority(int value) { + if (this.priority == null) + this.priority = new UnsignedIntType(); + this.priority.setValue(value); + return this; + } + + /** + * @return {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). 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 Appointment.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Appointment setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + public Appointment 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 #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Appointment setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return Date/Time that the appointment is to take place. + */ + 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(Date value) { + if (value == null) + this.start = null; + else { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + } + return this; + } + + /** + * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Appointment setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return Date/Time that the appointment is to conclude. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value Date/Time that the appointment is to conclude. + */ + public Appointment setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + } + return this; + } + + /** + * @return {@link #minutesDuration} (Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).). This is the underlying object with id, value and extensions. The accessor "getMinutesDuration" gives direct access to the value + */ + public PositiveIntType getMinutesDurationElement() { + if (this.minutesDuration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.minutesDuration"); + else if (Configuration.doAutoCreate()) + this.minutesDuration = new PositiveIntType(); // bb + return this.minutesDuration; + } + + public boolean hasMinutesDurationElement() { + return this.minutesDuration != null && !this.minutesDuration.isEmpty(); + } + + public boolean hasMinutesDuration() { + return this.minutesDuration != null && !this.minutesDuration.isEmpty(); + } + + /** + * @param value {@link #minutesDuration} (Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).). This is the underlying object with id, value and extensions. The accessor "getMinutesDuration" gives direct access to the value + */ + public Appointment setMinutesDurationElement(PositiveIntType value) { + this.minutesDuration = value; + return this; + } + + /** + * @return Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request). + */ + public int getMinutesDuration() { + return this.minutesDuration == null || this.minutesDuration.isEmpty() ? 0 : this.minutesDuration.getValue(); + } + + /** + * @param value Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request). + */ + public Appointment setMinutesDuration(int value) { + if (this.minutesDuration == null) + this.minutesDuration = new PositiveIntType(); + this.minutesDuration.setValue(value); + return this; + } + + /** + * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public List getSlot() { + if (this.slot == null) + this.slot = new ArrayList(); + return this.slot; + } + + public boolean hasSlot() { + if (this.slot == null) + return false; + for (Reference item : this.slot) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + // syntactic sugar + public Reference addSlot() { //3 + Reference t = new Reference(); + if (this.slot == null) + this.slot = new ArrayList(); + this.slot.add(t); + return t; + } + + // syntactic sugar + public Appointment addSlot(Reference t) { //3 + if (t == null) + return this; + if (this.slot == null) + this.slot = new ArrayList(); + this.slot.add(t); + return this; + } + + /** + * @return {@link #slot} (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 slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public List getSlotTarget() { + if (this.slotTarget == null) + this.slotTarget = new ArrayList(); + return this.slotTarget; + } + + // syntactic sugar + /** + * @return {@link #slot} (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 slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public Slot addSlotTarget() { + Slot r = new Slot(); + if (this.slotTarget == null) + this.slotTarget = new ArrayList(); + this.slotTarget.add(r); + return r; + } + + /** + * @return {@link #created} (The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.). 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 Appointment.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public Appointment setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment. + */ + public Appointment 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 #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Appointment setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional comments about the appointment. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional comments about the appointment. + */ + public Appointment setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #participant} (List of participants involved in the appointment.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (AppointmentParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (List of participants involved in the appointment.) + */ + // syntactic sugar + public AppointmentParticipantComponent addParticipant() { //3 + AppointmentParticipantComponent t = new AppointmentParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public Appointment addParticipant(AppointmentParticipantComponent t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern 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("status", "code", "The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("serviceCategory", "CodeableConcept", "A broad categorisation of the service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); + childrenList.add(new Property("serviceType", "CodeableConcept", "The specific service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceType)); + childrenList.add(new Property("specialty", "CodeableConcept", "The specialty of a practitioner that would be required to perform the service requested in this appointment.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("appointmentType", "CodeableConcept", "The style of appointment or patient that has been booked in the slot (not service type).", 0, java.lang.Integer.MAX_VALUE, appointmentType)); + childrenList.add(new Property("reason", "CodeableConcept", "The reason that this appointment is being scheduled. This is more clinical than administrative.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("priority", "unsignedInt", "The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("description", "string", "The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("minutesDuration", "positiveInt", "Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).", 0, java.lang.Integer.MAX_VALUE, minutesDuration)); + childrenList.add(new Property("slot", "Reference(Slot)", "The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.", 0, java.lang.Integer.MAX_VALUE, slot)); + childrenList.add(new Property("created", "dateTime", "The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("participant", "", "List of participants involved in the appointment.", 0, java.lang.Integer.MAX_VALUE, participant)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept + case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept + case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept + case -1596426375: /*appointmentType*/ return this.appointmentType == null ? new Base[0] : new Base[] {this.appointmentType}; // CodeableConcept + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // UnsignedIntType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // InstantType + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType + case -413630573: /*minutesDuration*/ return this.minutesDuration == null ? new Base[0] : new Base[] {this.minutesDuration}; // PositiveIntType + case 3533310: /*slot*/ return this.slot == null ? new Base[0] : this.slot.toArray(new Base[this.slot.size()]); // Reference + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // AppointmentParticipantComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new AppointmentStatusEnumFactory().fromType(value); // Enumeration + break; + case 1281188563: // serviceCategory + this.serviceCategory = castToCodeableConcept(value); // CodeableConcept + break; + case -1928370289: // serviceType + this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1694759682: // specialty + this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1596426375: // appointmentType + this.appointmentType = castToCodeableConcept(value); // CodeableConcept + break; + case -934964668: // reason + this.reason = castToCodeableConcept(value); // CodeableConcept + break; + case -1165461084: // priority + this.priority = castToUnsignedInt(value); // UnsignedIntType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 109757538: // start + this.start = castToInstant(value); // InstantType + break; + case 100571: // end + this.end = castToInstant(value); // InstantType + break; + case -413630573: // minutesDuration + this.minutesDuration = castToPositiveInt(value); // PositiveIntType + break; + case 3533310: // slot + this.getSlot().add(castToReference(value)); // Reference + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + case 767422259: // participant + this.getParticipant().add((AppointmentParticipantComponent) value); // AppointmentParticipantComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new AppointmentStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("serviceCategory")) + this.serviceCategory = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("serviceType")) + this.getServiceType().add(castToCodeableConcept(value)); + else if (name.equals("specialty")) + this.getSpecialty().add(castToCodeableConcept(value)); + else if (name.equals("appointmentType")) + this.appointmentType = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("reason")) + this.reason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("priority")) + this.priority = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("start")) + this.start = castToInstant(value); // InstantType + else if (name.equals("end")) + this.end = castToInstant(value); // InstantType + else if (name.equals("minutesDuration")) + this.minutesDuration = castToPositiveInt(value); // PositiveIntType + else if (name.equals("slot")) + this.getSlot().add(castToReference(value)); + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else if (name.equals("participant")) + this.getParticipant().add((AppointmentParticipantComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1281188563: return getServiceCategory(); // CodeableConcept + case -1928370289: return addServiceType(); // CodeableConcept + case -1694759682: return addSpecialty(); // CodeableConcept + case -1596426375: return getAppointmentType(); // CodeableConcept + case -934964668: return getReason(); // CodeableConcept + case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // UnsignedIntType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // InstantType + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType + case -413630573: throw new FHIRException("Cannot make property minutesDuration as it is not a complex type"); // PositiveIntType + case 3533310: return addSlot(); // Reference + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + case 767422259: return addParticipant(); // AppointmentParticipantComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.status"); + } + else if (name.equals("serviceCategory")) { + this.serviceCategory = new CodeableConcept(); + return this.serviceCategory; + } + else if (name.equals("serviceType")) { + return addServiceType(); + } + else if (name.equals("specialty")) { + return addSpecialty(); + } + else if (name.equals("appointmentType")) { + this.appointmentType = new CodeableConcept(); + return this.appointmentType; + } + else if (name.equals("reason")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else if (name.equals("priority")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.priority"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.description"); + } + else if (name.equals("start")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.start"); + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.end"); + } + else if (name.equals("minutesDuration")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.minutesDuration"); + } + else if (name.equals("slot")) { + return addSlot(); + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.created"); + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type Appointment.comment"); + } + else if (name.equals("participant")) { + return addParticipant(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Appointment"; + + } + + public Appointment copy() { + Appointment dst = new Appointment(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); + if (serviceType != null) { + dst.serviceType = new ArrayList(); + for (CodeableConcept i : serviceType) + dst.serviceType.add(i.copy()); + }; + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + dst.appointmentType = appointmentType == null ? null : appointmentType.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.description = description == null ? null : description.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + dst.minutesDuration = minutesDuration == null ? null : minutesDuration.copy(); + if (slot != null) { + dst.slot = new ArrayList(); + for (Reference i : slot) + dst.slot.add(i.copy()); + }; + dst.created = created == null ? null : created.copy(); + dst.comment = comment == null ? null : comment.copy(); + if (participant != null) { + dst.participant = new ArrayList(); + for (AppointmentParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + return dst; + } + + protected Appointment typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Appointment)) + return false; + Appointment o = (Appointment) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(serviceCategory, o.serviceCategory, true) + && compareDeep(serviceType, o.serviceType, true) && compareDeep(specialty, o.specialty, true) && compareDeep(appointmentType, o.appointmentType, true) + && compareDeep(reason, o.reason, true) && compareDeep(priority, o.priority, true) && compareDeep(description, o.description, true) + && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(minutesDuration, o.minutesDuration, true) + && compareDeep(slot, o.slot, true) && compareDeep(created, o.created, true) && compareDeep(comment, o.comment, true) + && compareDeep(participant, o.participant, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Appointment)) + return false; + Appointment o = (Appointment) other; + return compareValues(status, o.status, true) && compareValues(priority, o.priority, true) && compareValues(description, o.description, true) + && compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(minutesDuration, o.minutesDuration, true) + && compareValues(created, o.created, true) && compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (serviceCategory == null || serviceCategory.isEmpty()) && (serviceType == null || serviceType.isEmpty()) + && (specialty == null || specialty.isEmpty()) && (appointmentType == null || appointmentType.isEmpty()) + && (reason == null || reason.isEmpty()) && (priority == null || priority.isEmpty()) && (description == null || description.isEmpty()) + && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (minutesDuration == null || minutesDuration.isEmpty()) + && (slot == null || slot.isEmpty()) && (created == null || created.isEmpty()) && (comment == null || comment.isEmpty()) + && (participant == null || participant.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Appointment; + } + + /** + * Search parameter: patient + *

+ * Description: One of the individuals of the appointment is this patient
+ * Type: reference
+ * Path: Appointment.participant.actor
+ *

+ */ + @SearchParamDefinition(name="patient", path="Appointment.participant.actor", description="One of the individuals of the appointment is this patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: One of the individuals of the appointment is this patient
+ * Type: reference
+ * Path: Appointment.participant.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Appointment:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Appointment:patient").toLocked(); + + /** + * Search parameter: service-type + *

+ * Description: The specific service that is to be performed during this appointment
+ * Type: token
+ * Path: Appointment.serviceType
+ *

+ */ + @SearchParamDefinition(name="service-type", path="Appointment.serviceType", description="The specific service that is to be performed during this appointment", type="token" ) + public static final String SP_SERVICE_TYPE = "service-type"; + /** + * Fluent Client search parameter constant for service-type + *

+ * Description: The specific service that is to be performed during this appointment
+ * Type: token
+ * Path: Appointment.serviceType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICE_TYPE); + + /** + * Search parameter: practitioner + *

+ * Description: One of the individuals of the appointment is this practitioner
+ * Type: reference
+ * Path: Appointment.participant.actor
+ *

+ */ + @SearchParamDefinition(name="practitioner", path="Appointment.participant.actor", description="One of the individuals of the appointment is this practitioner", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + /** + * Fluent Client search parameter constant for practitioner + *

+ * Description: One of the individuals of the appointment is this practitioner
+ * Type: reference
+ * Path: Appointment.participant.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Appointment:practitioner". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Appointment:practitioner").toLocked(); + + /** + * Search parameter: location + *

+ * Description: This location is listed in the participants of the appointment
+ * Type: reference
+ * Path: Appointment.participant.actor
+ *

+ */ + @SearchParamDefinition(name="location", path="Appointment.participant.actor", description="This location is listed in the participants of the appointment", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: This location is listed in the participants of the appointment
+ * Type: reference
+ * Path: Appointment.participant.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Appointment:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Appointment:location").toLocked(); + + /** + * Search parameter: status + *

+ * Description: The overall status of the appointment
+ * Type: token
+ * Path: Appointment.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Appointment.status", description="The overall status of the appointment", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The overall status of the appointment
+ * Type: token
+ * Path: Appointment.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: appointment-type + *

+ * Description: The style of appointment or patient that has been booked in the slot (not service type)
+ * Type: token
+ * Path: Appointment.appointmentType
+ *

+ */ + @SearchParamDefinition(name="appointment-type", path="Appointment.appointmentType", description="The style of appointment or patient that has been booked in the slot (not service type)", type="token" ) + public static final String SP_APPOINTMENT_TYPE = "appointment-type"; + /** + * Fluent Client search parameter constant for appointment-type + *

+ * Description: The style of appointment or patient that has been booked in the slot (not service type)
+ * Type: token
+ * Path: Appointment.appointmentType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam APPOINTMENT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_APPOINTMENT_TYPE); + + /** + * Search parameter: part-status + *

+ * Description: The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.
+ * Type: token
+ * Path: Appointment.participant.status
+ *

+ */ + @SearchParamDefinition(name="part-status", path="Appointment.participant.status", description="The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.", type="token" ) + public static final String SP_PART_STATUS = "part-status"; + /** + * Fluent Client search parameter constant for part-status + *

+ * Description: The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.
+ * Type: token
+ * Path: Appointment.participant.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PART_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PART_STATUS); + + /** + * Search parameter: actor + *

+ * Description: Any one of the individuals participating in the appointment
+ * Type: reference
+ * Path: Appointment.participant.actor
+ *

+ */ + @SearchParamDefinition(name="actor", path="Appointment.participant.actor", description="Any one of the individuals participating in the appointment", type="reference" ) + public static final String SP_ACTOR = "actor"; + /** + * Fluent Client search parameter constant for actor + *

+ * Description: Any one of the individuals participating in the appointment
+ * Type: reference
+ * Path: Appointment.participant.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Appointment:actor". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("Appointment:actor").toLocked(); + + /** + * Search parameter: date + *

+ * Description: Appointment date/time.
+ * Type: date
+ * Path: Appointment.start
+ *

+ */ + @SearchParamDefinition(name="date", path="Appointment.start", description="Appointment date/time.", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Appointment date/time.
+ * Type: date
+ * Path: Appointment.start
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: An Identifier of the Appointment
+ * Type: token
+ * Path: Appointment.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Appointment.identifier", description="An Identifier of the Appointment", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: An Identifier of the Appointment
+ * Type: token
+ * Path: Appointment.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AppointmentResponse.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AppointmentResponse.java new file mode 100644 index 00000000000..ca23c36a88a --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AppointmentResponse.java @@ -0,0 +1,858 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. + */ +@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse") +public class AppointmentResponse extends DomainResource { + + /** + * This records identifiers associated with this appointment response concern 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. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment response concern 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." ) + protected List identifier; + + /** + * Appointment that this response is replying to. + */ + @Child(name = "appointment", type = {Appointment.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Appointment this response relates to", formalDefinition="Appointment that this response is replying to." ) + protected Reference appointment; + + /** + * The actual object that is the target of the reference (Appointment that this response is replying to.) + */ + protected Appointment appointmentTarget; + + /** + * Date/Time that the appointment is to take place, or requested new start time. + */ + @Child(name = "start", type = {InstantType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Time from appointment, or requested new start time", formalDefinition="Date/Time that the appointment is to take place, or requested new start time." ) + protected InstantType start; + + /** + * This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. + */ + @Child(name = "end", type = {InstantType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Time from appointment, or requested new end time", formalDefinition="This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time." ) + protected InstantType end; + + /** + * Role of participant in the appointment. + */ + @Child(name = "participantType", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) + protected List participantType; + + /** + * A Person, Location/HealthcareService or Device that is participating in the appointment. + */ + @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Person, Location/HealthcareService or Device", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + protected Resource actorTarget; + + /** + * Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. + */ + @Child(name = "participantStatus", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty." ) + protected CodeType participantStatus; + + /** + * Additional comments about the appointment. + */ + @Child(name = "comment", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Additional comments", formalDefinition="Additional comments about the appointment." ) + protected StringType comment; + + private static final long serialVersionUID = -1645343660L; + + /** + * Constructor + */ + public AppointmentResponse() { + super(); + } + + /** + * Constructor + */ + public AppointmentResponse(Reference appointment, CodeType participantStatus) { + super(); + this.appointment = appointment; + this.participantStatus = participantStatus; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this appointment response concern 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.) + */ + 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 appointment response concern 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.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public AppointmentResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #appointment} (Appointment that this response is replying to.) + */ + public Reference getAppointment() { + if (this.appointment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.appointment"); + else if (Configuration.doAutoCreate()) + this.appointment = new Reference(); // cc + return this.appointment; + } + + public boolean hasAppointment() { + return this.appointment != null && !this.appointment.isEmpty(); + } + + /** + * @param value {@link #appointment} (Appointment that this response is replying to.) + */ + public AppointmentResponse setAppointment(Reference value) { + this.appointment = value; + return this; + } + + /** + * @return {@link #appointment} 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. (Appointment that this response is replying to.) + */ + public Appointment getAppointmentTarget() { + if (this.appointmentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.appointment"); + else if (Configuration.doAutoCreate()) + this.appointmentTarget = new Appointment(); // aa + return this.appointmentTarget; + } + + /** + * @param value {@link #appointment} 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. (Appointment that this response is replying to.) + */ + public AppointmentResponse setAppointmentTarget(Appointment value) { + this.appointmentTarget = value; + return this; + } + + /** + * @return {@link #start} (Date/Time that the appointment is to take place, or requested new start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Date/Time that the appointment is to take place, or requested new start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public AppointmentResponse setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return Date/Time that the appointment is to take place, or requested new start time. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value Date/Time that the appointment is to take place, or requested new start time. + */ + public AppointmentResponse setStart(Date value) { + if (value == null) + this.start = null; + else { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + } + return this; + } + + /** + * @return {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public AppointmentResponse setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. + */ + public AppointmentResponse setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + } + return this; + } + + /** + * @return {@link #participantType} (Role of participant in the appointment.) + */ + public List getParticipantType() { + if (this.participantType == null) + this.participantType = new ArrayList(); + return this.participantType; + } + + public boolean hasParticipantType() { + if (this.participantType == null) + return false; + for (CodeableConcept item : this.participantType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participantType} (Role of participant in the appointment.) + */ + // syntactic sugar + public CodeableConcept addParticipantType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.participantType == null) + this.participantType = new ArrayList(); + this.participantType.add(t); + return t; + } + + // syntactic sugar + public AppointmentResponse addParticipantType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.participantType == null) + this.participantType = new ArrayList(); + this.participantType.add(t); + return this; + } + + /** + * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public AppointmentResponse setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 Person, Location/HealthcareService or Device that is participating in the appointment.) + */ + public AppointmentResponse setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #participantStatus} (Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value + */ + public CodeType getParticipantStatusElement() { + if (this.participantStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.participantStatus"); + else if (Configuration.doAutoCreate()) + this.participantStatus = new CodeType(); // bb + return this.participantStatus; + } + + public boolean hasParticipantStatusElement() { + return this.participantStatus != null && !this.participantStatus.isEmpty(); + } + + public boolean hasParticipantStatus() { + return this.participantStatus != null && !this.participantStatus.isEmpty(); + } + + /** + * @param value {@link #participantStatus} (Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value + */ + public AppointmentResponse setParticipantStatusElement(CodeType value) { + this.participantStatus = value; + return this; + } + + /** + * @return Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. + */ + public String getParticipantStatus() { + return this.participantStatus == null ? null : this.participantStatus.getValue(); + } + + /** + * @param value Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. + */ + public AppointmentResponse setParticipantStatus(String value) { + if (this.participantStatus == null) + this.participantStatus = new CodeType(); + this.participantStatus.setValue(value); + return this; + } + + /** + * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public AppointmentResponse setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional comments about the appointment. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional comments about the appointment. + */ + public AppointmentResponse setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment response concern 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.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("appointment", "Reference(Appointment)", "Appointment that this response is replying to.", 0, java.lang.Integer.MAX_VALUE, appointment)); + childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place, or requested new start time.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("participantType", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, participantType)); + childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("participantStatus", "code", "Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.", 0, java.lang.Integer.MAX_VALUE, participantStatus)); + childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1474995297: /*appointment*/ return this.appointment == null ? new Base[0] : new Base[] {this.appointment}; // Reference + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // InstantType + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType + case 841294093: /*participantType*/ return this.participantType == null ? new Base[0] : this.participantType.toArray(new Base[this.participantType.size()]); // CodeableConcept + case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference + case 996096261: /*participantStatus*/ return this.participantStatus == null ? new Base[0] : new Base[] {this.participantStatus}; // CodeType + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1474995297: // appointment + this.appointment = castToReference(value); // Reference + break; + case 109757538: // start + this.start = castToInstant(value); // InstantType + break; + case 100571: // end + this.end = castToInstant(value); // InstantType + break; + case 841294093: // participantType + this.getParticipantType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 92645877: // actor + this.actor = castToReference(value); // Reference + break; + case 996096261: // participantStatus + this.participantStatus = castToCode(value); // CodeType + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("appointment")) + this.appointment = castToReference(value); // Reference + else if (name.equals("start")) + this.start = castToInstant(value); // InstantType + else if (name.equals("end")) + this.end = castToInstant(value); // InstantType + else if (name.equals("participantType")) + this.getParticipantType().add(castToCodeableConcept(value)); + else if (name.equals("actor")) + this.actor = castToReference(value); // Reference + else if (name.equals("participantStatus")) + this.participantStatus = castToCode(value); // CodeType + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1474995297: return getAppointment(); // Reference + case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // InstantType + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType + case 841294093: return addParticipantType(); // CodeableConcept + case 92645877: return getActor(); // Reference + case 996096261: throw new FHIRException("Cannot make property participantStatus as it is not a complex type"); // CodeType + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("appointment")) { + this.appointment = new Reference(); + return this.appointment; + } + else if (name.equals("start")) { + throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.start"); + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.end"); + } + else if (name.equals("participantType")) { + return addParticipantType(); + } + else if (name.equals("actor")) { + this.actor = new Reference(); + return this.actor; + } + else if (name.equals("participantStatus")) { + throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.participantStatus"); + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.comment"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "AppointmentResponse"; + + } + + public AppointmentResponse copy() { + AppointmentResponse dst = new AppointmentResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.appointment = appointment == null ? null : appointment.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + if (participantType != null) { + dst.participantType = new ArrayList(); + for (CodeableConcept i : participantType) + dst.participantType.add(i.copy()); + }; + dst.actor = actor == null ? null : actor.copy(); + dst.participantStatus = participantStatus == null ? null : participantStatus.copy(); + dst.comment = comment == null ? null : comment.copy(); + return dst; + } + + protected AppointmentResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AppointmentResponse)) + return false; + AppointmentResponse o = (AppointmentResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(appointment, o.appointment, true) + && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(participantType, o.participantType, true) + && compareDeep(actor, o.actor, true) && compareDeep(participantStatus, o.participantStatus, true) + && compareDeep(comment, o.comment, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AppointmentResponse)) + return false; + AppointmentResponse o = (AppointmentResponse) other; + return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(participantStatus, o.participantStatus, true) + && compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (appointment == null || appointment.isEmpty()) + && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (participantType == null || participantType.isEmpty()) + && (actor == null || actor.isEmpty()) && (participantStatus == null || participantStatus.isEmpty()) + && (comment == null || comment.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.AppointmentResponse; + } + + /** + * Search parameter: patient + *

+ * Description: This Response is for this Patient
+ * Type: reference
+ * Path: AppointmentResponse.actor
+ *

+ */ + @SearchParamDefinition(name="patient", path="AppointmentResponse.actor", description="This Response is for this Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: This Response is for this Patient
+ * Type: reference
+ * Path: AppointmentResponse.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AppointmentResponse:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AppointmentResponse:patient").toLocked(); + + /** + * Search parameter: practitioner + *

+ * Description: This Response is for this Practitioner
+ * Type: reference
+ * Path: AppointmentResponse.actor
+ *

+ */ + @SearchParamDefinition(name="practitioner", path="AppointmentResponse.actor", description="This Response is for this Practitioner", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + /** + * Fluent Client search parameter constant for practitioner + *

+ * Description: This Response is for this Practitioner
+ * Type: reference
+ * Path: AppointmentResponse.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AppointmentResponse:practitioner". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("AppointmentResponse:practitioner").toLocked(); + + /** + * Search parameter: location + *

+ * Description: This Response is for this Location
+ * Type: reference
+ * Path: AppointmentResponse.actor
+ *

+ */ + @SearchParamDefinition(name="location", path="AppointmentResponse.actor", description="This Response is for this Location", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: This Response is for this Location
+ * Type: reference
+ * Path: AppointmentResponse.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AppointmentResponse:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("AppointmentResponse:location").toLocked(); + + /** + * Search parameter: part-status + *

+ * Description: The participants acceptance status for this appointment
+ * Type: token
+ * Path: AppointmentResponse.participantStatus
+ *

+ */ + @SearchParamDefinition(name="part-status", path="AppointmentResponse.participantStatus", description="The participants acceptance status for this appointment", type="token" ) + public static final String SP_PART_STATUS = "part-status"; + /** + * Fluent Client search parameter constant for part-status + *

+ * Description: The participants acceptance status for this appointment
+ * Type: token
+ * Path: AppointmentResponse.participantStatus
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PART_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PART_STATUS); + + /** + * Search parameter: actor + *

+ * Description: The Person, Location/HealthcareService or Device that this appointment response replies for
+ * Type: reference
+ * Path: AppointmentResponse.actor
+ *

+ */ + @SearchParamDefinition(name="actor", path="AppointmentResponse.actor", description="The Person, Location/HealthcareService or Device that this appointment response replies for", type="reference" ) + public static final String SP_ACTOR = "actor"; + /** + * Fluent Client search parameter constant for actor + *

+ * Description: The Person, Location/HealthcareService or Device that this appointment response replies for
+ * Type: reference
+ * Path: AppointmentResponse.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AppointmentResponse:actor". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("AppointmentResponse:actor").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: An Identifier in this appointment response
+ * Type: token
+ * Path: AppointmentResponse.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="AppointmentResponse.identifier", description="An Identifier in this appointment response", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: An Identifier in this appointment response
+ * Type: token
+ * Path: AppointmentResponse.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: appointment + *

+ * Description: The appointment that the response is attached to
+ * Type: reference
+ * Path: AppointmentResponse.appointment
+ *

+ */ + @SearchParamDefinition(name="appointment", path="AppointmentResponse.appointment", description="The appointment that the response is attached to", type="reference" ) + public static final String SP_APPOINTMENT = "appointment"; + /** + * Fluent Client search parameter constant for appointment + *

+ * Description: The appointment that the response is attached to
+ * Type: reference
+ * Path: AppointmentResponse.appointment
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam APPOINTMENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_APPOINTMENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AppointmentResponse:appointment". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_APPOINTMENT = new ca.uhn.fhir.model.api.Include("AppointmentResponse:appointment").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Attachment.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Attachment.java new file mode 100644 index 00000000000..4158482e5dd --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Attachment.java @@ -0,0 +1,688 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * For referring to data content defined in other formats. + */ +@DatatypeDef(name="Attachment") +public class Attachment extends Type implements ICompositeType { + + /** + * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + @Child(name = "contentType", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) + protected CodeType contentType; + + /** + * The human language of the content. The value can be any valid value according to BCP 47. + */ + @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." ) + protected CodeType language; + + /** + * The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + @Child(name = "data", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." ) + protected Base64BinaryType data; + + /** + * An alternative location where the data can be accessed. + */ + @Child(name = "url", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Uri where the data can be found", formalDefinition="An alternative location where the data can be accessed." ) + protected UriType url; + + /** + * The number of bytes of data that make up this attachment. + */ + @Child(name = "size", type = {UnsignedIntType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) + protected UnsignedIntType size; + + /** + * The calculated hash of the data using SHA-1. Represented using base64. + */ + @Child(name = "hash", type = {Base64BinaryType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Hash of the data (sha-1, base64ed)", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." ) + protected Base64BinaryType hash; + + /** + * A label or set of text to display in place of the data. + */ + @Child(name = "title", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) + protected StringType title; + + /** + * The date that the attachment was first created. + */ + @Child(name = "creation", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date attachment was first created", formalDefinition="The date that the attachment was first created." ) + protected DateTimeType creation; + + private static final long serialVersionUID = 581007080L; + + /** + * Constructor + */ + public Attachment() { + super(); + } + + /** + * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public CodeType getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new CodeType(); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Attachment setContentTypeElement(CodeType value) { + this.contentType = value; + return this; + } + + /** + * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + public String getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + public Attachment setContentType(String value) { + if (Utilities.noString(value)) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new CodeType(); + this.contentType.setValue(value); + } + return this; + } + + /** + * @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public Attachment setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The human language of the content. The value can be any valid value according to BCP 47. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The human language of the content. The value can be any valid value according to BCP 47. + */ + public Attachment setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public Base64BinaryType getDataElement() { + if (this.data == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.data"); + else if (Configuration.doAutoCreate()) + this.data = new Base64BinaryType(); // bb + return this.data; + } + + public boolean hasDataElement() { + return this.data != null && !this.data.isEmpty(); + } + + public boolean hasData() { + return this.data != null && !this.data.isEmpty(); + } + + /** + * @param value {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public Attachment setDataElement(Base64BinaryType value) { + this.data = value; + return this; + } + + /** + * @return The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + public byte[] getData() { + return this.data == null ? null : this.data.getValue(); + } + + /** + * @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + public Attachment setData(byte[] value) { + if (value == null) + this.data = null; + else { + if (this.data == null) + this.data = new Base64BinaryType(); + this.data.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Attachment setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An alternative location where the data can be accessed. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An alternative location where the data can be accessed. + */ + public Attachment setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public UnsignedIntType getSizeElement() { + if (this.size == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.size"); + else if (Configuration.doAutoCreate()) + this.size = new UnsignedIntType(); // bb + return this.size; + } + + public boolean hasSizeElement() { + return this.size != null && !this.size.isEmpty(); + } + + public boolean hasSize() { + return this.size != null && !this.size.isEmpty(); + } + + /** + * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public Attachment setSizeElement(UnsignedIntType value) { + this.size = value; + return this; + } + + /** + * @return The number of bytes of data that make up this attachment. + */ + public int getSize() { + return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); + } + + /** + * @param value The number of bytes of data that make up this attachment. + */ + public Attachment setSize(int value) { + if (this.size == null) + this.size = new UnsignedIntType(); + this.size.setValue(value); + return this; + } + + /** + * @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value + */ + public Base64BinaryType getHashElement() { + if (this.hash == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.hash"); + else if (Configuration.doAutoCreate()) + this.hash = new Base64BinaryType(); // bb + return this.hash; + } + + public boolean hasHashElement() { + return this.hash != null && !this.hash.isEmpty(); + } + + public boolean hasHash() { + return this.hash != null && !this.hash.isEmpty(); + } + + /** + * @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value + */ + public Attachment setHashElement(Base64BinaryType value) { + this.hash = value; + return this; + } + + /** + * @return The calculated hash of the data using SHA-1. Represented using base64. + */ + public byte[] getHash() { + return this.hash == null ? null : this.hash.getValue(); + } + + /** + * @param value The calculated hash of the data using SHA-1. Represented using base64. + */ + public Attachment setHash(byte[] value) { + if (value == null) + this.hash = null; + else { + if (this.hash == null) + this.hash = new Base64BinaryType(); + this.hash.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public Attachment setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A label or set of text to display in place of the data. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A label or set of text to display in place of the data. + */ + public Attachment setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value + */ + public DateTimeType getCreationElement() { + if (this.creation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.creation"); + else if (Configuration.doAutoCreate()) + this.creation = new DateTimeType(); // bb + return this.creation; + } + + public boolean hasCreationElement() { + return this.creation != null && !this.creation.isEmpty(); + } + + public boolean hasCreation() { + return this.creation != null && !this.creation.isEmpty(); + } + + /** + * @param value {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value + */ + public Attachment setCreationElement(DateTimeType value) { + this.creation = value; + return this; + } + + /** + * @return The date that the attachment was first created. + */ + public Date getCreation() { + return this.creation == null ? null : this.creation.getValue(); + } + + /** + * @param value The date that the attachment was first created. + */ + public Attachment setCreation(Date value) { + if (value == null) + this.creation = null; + else { + if (this.creation == null) + this.creation = new DateTimeType(); + this.creation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data)); + childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); + childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash)); + childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("creation", "dateTime", "The date that the attachment was first created.", 0, java.lang.Integer.MAX_VALUE, creation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType + case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // Base64BinaryType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 3530753: /*size*/ return this.size == null ? new Base[0] : new Base[] {this.size}; // UnsignedIntType + case 3195150: /*hash*/ return this.hash == null ? new Base[0] : new Base[] {this.hash}; // Base64BinaryType + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case 1820421855: /*creation*/ return this.creation == null ? new Base[0] : new Base[] {this.creation}; // DateTimeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -389131437: // contentType + this.contentType = castToCode(value); // CodeType + break; + case -1613589672: // language + this.language = castToCode(value); // CodeType + break; + case 3076010: // data + this.data = castToBase64Binary(value); // Base64BinaryType + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 3530753: // size + this.size = castToUnsignedInt(value); // UnsignedIntType + break; + case 3195150: // hash + this.hash = castToBase64Binary(value); // Base64BinaryType + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case 1820421855: // creation + this.creation = castToDateTime(value); // DateTimeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("contentType")) + this.contentType = castToCode(value); // CodeType + else if (name.equals("language")) + this.language = castToCode(value); // CodeType + else if (name.equals("data")) + this.data = castToBase64Binary(value); // Base64BinaryType + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("size")) + this.size = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("hash")) + this.hash = castToBase64Binary(value); // Base64BinaryType + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("creation")) + this.creation = castToDateTime(value); // DateTimeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType + case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType + case 3076010: throw new FHIRException("Cannot make property data as it is not a complex type"); // Base64BinaryType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 3530753: throw new FHIRException("Cannot make property size as it is not a complex type"); // UnsignedIntType + case 3195150: throw new FHIRException("Cannot make property hash as it is not a complex type"); // Base64BinaryType + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case 1820421855: throw new FHIRException("Cannot make property creation as it is not a complex type"); // DateTimeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("contentType")) { + throw new FHIRException("Cannot call addChild on a primitive type Attachment.contentType"); + } + else if (name.equals("language")) { + throw new FHIRException("Cannot call addChild on a primitive type Attachment.language"); + } + else if (name.equals("data")) { + throw new FHIRException("Cannot call addChild on a primitive type Attachment.data"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Attachment.url"); + } + else if (name.equals("size")) { + throw new FHIRException("Cannot call addChild on a primitive type Attachment.size"); + } + else if (name.equals("hash")) { + throw new FHIRException("Cannot call addChild on a primitive type Attachment.hash"); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type Attachment.title"); + } + else if (name.equals("creation")) { + throw new FHIRException("Cannot call addChild on a primitive type Attachment.creation"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Attachment"; + + } + + public Attachment copy() { + Attachment dst = new Attachment(); + copyValues(dst); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.language = language == null ? null : language.copy(); + dst.data = data == null ? null : data.copy(); + dst.url = url == null ? null : url.copy(); + dst.size = size == null ? null : size.copy(); + dst.hash = hash == null ? null : hash.copy(); + dst.title = title == null ? null : title.copy(); + dst.creation = creation == null ? null : creation.copy(); + return dst; + } + + protected Attachment typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Attachment)) + return false; + Attachment o = (Attachment) other; + return compareDeep(contentType, o.contentType, true) && compareDeep(language, o.language, true) + && compareDeep(data, o.data, true) && compareDeep(url, o.url, true) && compareDeep(size, o.size, true) + && compareDeep(hash, o.hash, true) && compareDeep(title, o.title, true) && compareDeep(creation, o.creation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Attachment)) + return false; + Attachment o = (Attachment) other; + return compareValues(contentType, o.contentType, true) && compareValues(language, o.language, true) + && compareValues(data, o.data, true) && compareValues(url, o.url, true) && compareValues(size, o.size, true) + && compareValues(hash, o.hash, true) && compareValues(title, o.title, true) && compareValues(creation, o.creation, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (language == null || language.isEmpty()) + && (data == null || data.isEmpty()) && (url == null || url.isEmpty()) && (size == null || size.isEmpty()) + && (hash == null || hash.isEmpty()) && (title == null || title.isEmpty()) && (creation == null || creation.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AuditEvent.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AuditEvent.java new file mode 100644 index 00000000000..af9112b5e20 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/AuditEvent.java @@ -0,0 +1,3682 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + */ +@ResourceDef(name="AuditEvent", profile="http://hl7.org/fhir/Profile/AuditEvent") +public class AuditEvent extends DomainResource { + + public enum AuditEventAction { + /** + * Create a new database object, such as placing an order. + */ + C, + /** + * Display or print data, such as a doctor census. + */ + R, + /** + * Update data, such as revise patient information. + */ + U, + /** + * Delete items, such as a doctor master file record. + */ + D, + /** + * Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation. + */ + E, + /** + * added to help the parsers + */ + NULL; + public static AuditEventAction fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("C".equals(codeString)) + return C; + if ("R".equals(codeString)) + return R; + if ("U".equals(codeString)) + return U; + if ("D".equals(codeString)) + return D; + if ("E".equals(codeString)) + return E; + throw new FHIRException("Unknown AuditEventAction code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case C: return "C"; + case R: return "R"; + case U: return "U"; + case D: return "D"; + case E: return "E"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case C: return "http://hl7.org/fhir/audit-event-action"; + case R: return "http://hl7.org/fhir/audit-event-action"; + case U: return "http://hl7.org/fhir/audit-event-action"; + case D: return "http://hl7.org/fhir/audit-event-action"; + case E: return "http://hl7.org/fhir/audit-event-action"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case C: return "Create a new database object, such as placing an order."; + case R: return "Display or print data, such as a doctor census."; + case U: return "Update data, such as revise patient information."; + case D: return "Delete items, such as a doctor master file record."; + case E: return "Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case C: return "Create"; + case R: return "Read/View/Print"; + case U: return "Update"; + case D: return "Delete"; + case E: return "Execute"; + default: return "?"; + } + } + } + + public static class AuditEventActionEnumFactory implements EnumFactory { + public AuditEventAction fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("C".equals(codeString)) + return AuditEventAction.C; + if ("R".equals(codeString)) + return AuditEventAction.R; + if ("U".equals(codeString)) + return AuditEventAction.U; + if ("D".equals(codeString)) + return AuditEventAction.D; + if ("E".equals(codeString)) + return AuditEventAction.E; + throw new IllegalArgumentException("Unknown AuditEventAction code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("C".equals(codeString)) + return new Enumeration(this, AuditEventAction.C); + if ("R".equals(codeString)) + return new Enumeration(this, AuditEventAction.R); + if ("U".equals(codeString)) + return new Enumeration(this, AuditEventAction.U); + if ("D".equals(codeString)) + return new Enumeration(this, AuditEventAction.D); + if ("E".equals(codeString)) + return new Enumeration(this, AuditEventAction.E); + throw new FHIRException("Unknown AuditEventAction code '"+codeString+"'"); + } + public String toCode(AuditEventAction code) { + if (code == AuditEventAction.C) + return "C"; + if (code == AuditEventAction.R) + return "R"; + if (code == AuditEventAction.U) + return "U"; + if (code == AuditEventAction.D) + return "D"; + if (code == AuditEventAction.E) + return "E"; + return "?"; + } + public String toSystem(AuditEventAction code) { + return code.getSystem(); + } + } + + public enum AuditEventOutcome { + /** + * The operation completed successfully (whether with warnings or not). + */ + _0, + /** + * The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response). + */ + _4, + /** + * The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response). + */ + _8, + /** + * An error of such magnitude occurred that the system is no longer available for use (i.e. the system died). + */ + _12, + /** + * added to help the parsers + */ + NULL; + public static AuditEventOutcome fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("0".equals(codeString)) + return _0; + if ("4".equals(codeString)) + return _4; + if ("8".equals(codeString)) + return _8; + if ("12".equals(codeString)) + return _12; + throw new FHIRException("Unknown AuditEventOutcome code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case _0: return "0"; + case _4: return "4"; + case _8: return "8"; + case _12: return "12"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _0: return "http://hl7.org/fhir/audit-event-outcome"; + case _4: return "http://hl7.org/fhir/audit-event-outcome"; + case _8: return "http://hl7.org/fhir/audit-event-outcome"; + case _12: return "http://hl7.org/fhir/audit-event-outcome"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _0: return "The operation completed successfully (whether with warnings or not)."; + case _4: return "The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response)."; + case _8: return "The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response)."; + case _12: return "An error of such magnitude occurred that the system is no longer available for use (i.e. the system died)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _0: return "Success"; + case _4: return "Minor failure"; + case _8: return "Serious failure"; + case _12: return "Major failure"; + default: return "?"; + } + } + } + + public static class AuditEventOutcomeEnumFactory implements EnumFactory { + public AuditEventOutcome fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("0".equals(codeString)) + return AuditEventOutcome._0; + if ("4".equals(codeString)) + return AuditEventOutcome._4; + if ("8".equals(codeString)) + return AuditEventOutcome._8; + if ("12".equals(codeString)) + return AuditEventOutcome._12; + throw new IllegalArgumentException("Unknown AuditEventOutcome code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("0".equals(codeString)) + return new Enumeration(this, AuditEventOutcome._0); + if ("4".equals(codeString)) + return new Enumeration(this, AuditEventOutcome._4); + if ("8".equals(codeString)) + return new Enumeration(this, AuditEventOutcome._8); + if ("12".equals(codeString)) + return new Enumeration(this, AuditEventOutcome._12); + throw new FHIRException("Unknown AuditEventOutcome code '"+codeString+"'"); + } + public String toCode(AuditEventOutcome code) { + if (code == AuditEventOutcome._0) + return "0"; + if (code == AuditEventOutcome._4) + return "4"; + if (code == AuditEventOutcome._8) + return "8"; + if (code == AuditEventOutcome._12) + return "12"; + return "?"; + } + public String toSystem(AuditEventOutcome code) { + return code.getSystem(); + } + } + + public enum AuditEventParticipantNetworkType { + /** + * The machine name, including DNS name. + */ + _1, + /** + * The assigned Internet Protocol (IP) address. + */ + _2, + /** + * The assigned telephone number. + */ + _3, + /** + * The assigned email address. + */ + _4, + /** + * URI (User directory, HTTP-PUT, ftp, etc.). + */ + _5, + /** + * added to help the parsers + */ + NULL; + public static AuditEventParticipantNetworkType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + if ("5".equals(codeString)) + return _5; + throw new FHIRException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return "http://hl7.org/fhir/network-type"; + case _2: return "http://hl7.org/fhir/network-type"; + case _3: return "http://hl7.org/fhir/network-type"; + case _4: return "http://hl7.org/fhir/network-type"; + case _5: return "http://hl7.org/fhir/network-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "The machine name, including DNS name."; + case _2: return "The assigned Internet Protocol (IP) address."; + case _3: return "The assigned telephone number."; + case _4: return "The assigned email address."; + case _5: return "URI (User directory, HTTP-PUT, ftp, etc.)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return "Machine Name"; + case _2: return "IP Address"; + case _3: return "Telephone Number"; + case _4: return "Email address"; + case _5: return "URI"; + default: return "?"; + } + } + } + + public static class AuditEventParticipantNetworkTypeEnumFactory implements EnumFactory { + public AuditEventParticipantNetworkType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return AuditEventParticipantNetworkType._1; + if ("2".equals(codeString)) + return AuditEventParticipantNetworkType._2; + if ("3".equals(codeString)) + return AuditEventParticipantNetworkType._3; + if ("4".equals(codeString)) + return AuditEventParticipantNetworkType._4; + if ("5".equals(codeString)) + return AuditEventParticipantNetworkType._5; + throw new IllegalArgumentException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return new Enumeration(this, AuditEventParticipantNetworkType._1); + if ("2".equals(codeString)) + return new Enumeration(this, AuditEventParticipantNetworkType._2); + if ("3".equals(codeString)) + return new Enumeration(this, AuditEventParticipantNetworkType._3); + if ("4".equals(codeString)) + return new Enumeration(this, AuditEventParticipantNetworkType._4); + if ("5".equals(codeString)) + return new Enumeration(this, AuditEventParticipantNetworkType._5); + throw new FHIRException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'"); + } + public String toCode(AuditEventParticipantNetworkType code) { + if (code == AuditEventParticipantNetworkType._1) + return "1"; + if (code == AuditEventParticipantNetworkType._2) + return "2"; + if (code == AuditEventParticipantNetworkType._3) + return "3"; + if (code == AuditEventParticipantNetworkType._4) + return "4"; + if (code == AuditEventParticipantNetworkType._5) + return "5"; + return "?"; + } + public String toSystem(AuditEventParticipantNetworkType code) { + return code.getSystem(); + } + } + + @Block() + public static class AuditEventAgentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Agent role in the event", formalDefinition="Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context." ) + protected List role; + + /** + * Direct reference to a resource that identifies the agent. + */ + @Child(name = "reference", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Direct reference to resource", formalDefinition="Direct reference to a resource that identifies the agent." ) + protected Reference reference; + + /** + * The actual object that is the target of the reference (Direct reference to a resource that identifies the agent.) + */ + protected Resource referenceTarget; + + /** + * Unique identifier for the user actively participating in the event. + */ + @Child(name = "userId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier for the user", formalDefinition="Unique identifier for the user actively participating in the event." ) + protected Identifier userId; + + /** + * Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available. + */ + @Child(name = "altId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Alternative User id e.g. authentication", formalDefinition="Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available." ) + protected StringType altId; + + /** + * Human-meaningful name for the agent. + */ + @Child(name = "name", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Human-meaningful name for the agent", formalDefinition="Human-meaningful name for the agent." ) + protected StringType name; + + /** + * Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + @Child(name = "requestor", type = {BooleanType.class}, order=6, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether user is initiator", formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited." ) + protected BooleanType requestor; + + /** + * Where the event occurred. + */ + @Child(name = "location", type = {Location.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Where", formalDefinition="Where the event occurred." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Where the event occurred.) + */ + protected Location locationTarget; + + /** + * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used. + */ + @Child(name = "policy", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Policy that authorized event", formalDefinition="The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used." ) + protected List policy; + + /** + * Type of media involved. Used when the event is about exporting/importing onto media. + */ + @Child(name = "media", type = {Coding.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Type of media", formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media." ) + protected Coding media; + + /** + * Logical network location for application activity, if the activity has a network location. + */ + @Child(name = "network", type = {}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Logical network location for application activity", formalDefinition="Logical network location for application activity, if the activity has a network location." ) + protected AuditEventAgentNetworkComponent network; + + /** + * The reason (purpose of use), specific to this agent, that was used during the event being recorded. + */ + @Child(name = "purposeOfUse", type = {Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Reason given for this user", formalDefinition="The reason (purpose of use), specific to this agent, that was used during the event being recorded." ) + protected List purposeOfUse; + + private static final long serialVersionUID = 1802747339L; + + /** + * Constructor + */ + public AuditEventAgentComponent() { + super(); + } + + /** + * Constructor + */ + public AuditEventAgentComponent(BooleanType requestor) { + super(); + this.requestor = requestor; + } + + /** + * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + // syntactic sugar + public AuditEventAgentComponent addRole(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return this; + } + + /** + * @return {@link #reference} (Direct reference to a resource that identifies the agent.) + */ + public Reference getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Reference(); // cc + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Direct reference to a resource that identifies the agent.) + */ + public AuditEventAgentComponent setReference(Reference value) { + this.reference = value; + return this; + } + + /** + * @return {@link #reference} 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. (Direct reference to a resource that identifies the agent.) + */ + public Resource getReferenceTarget() { + return this.referenceTarget; + } + + /** + * @param value {@link #reference} 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. (Direct reference to a resource that identifies the agent.) + */ + public AuditEventAgentComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; + return this; + } + + /** + * @return {@link #userId} (Unique identifier for the user actively participating in the event.) + */ + public Identifier getUserId() { + if (this.userId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentComponent.userId"); + else if (Configuration.doAutoCreate()) + this.userId = new Identifier(); // cc + return this.userId; + } + + public boolean hasUserId() { + return this.userId != null && !this.userId.isEmpty(); + } + + /** + * @param value {@link #userId} (Unique identifier for the user actively participating in the event.) + */ + public AuditEventAgentComponent setUserId(Identifier value) { + this.userId = value; + return this; + } + + /** + * @return {@link #altId} (Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value + */ + public StringType getAltIdElement() { + if (this.altId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentComponent.altId"); + else if (Configuration.doAutoCreate()) + this.altId = new StringType(); // bb + return this.altId; + } + + public boolean hasAltIdElement() { + return this.altId != null && !this.altId.isEmpty(); + } + + public boolean hasAltId() { + return this.altId != null && !this.altId.isEmpty(); + } + + /** + * @param value {@link #altId} (Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value + */ + public AuditEventAgentComponent setAltIdElement(StringType value) { + this.altId = value; + return this; + } + + /** + * @return Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available. + */ + public String getAltId() { + return this.altId == null ? null : this.altId.getValue(); + } + + /** + * @param value Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available. + */ + public AuditEventAgentComponent setAltId(String value) { + if (Utilities.noString(value)) + this.altId = null; + else { + if (this.altId == null) + this.altId = new StringType(); + this.altId.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (Human-meaningful name for the agent.). 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 AuditEventAgentComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Human-meaningful name for the agent.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public AuditEventAgentComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-meaningful name for the agent. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-meaningful name for the agent. + */ + public AuditEventAgentComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value + */ + public BooleanType getRequestorElement() { + if (this.requestor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentComponent.requestor"); + else if (Configuration.doAutoCreate()) + this.requestor = new BooleanType(); // bb + return this.requestor; + } + + public boolean hasRequestorElement() { + return this.requestor != null && !this.requestor.isEmpty(); + } + + public boolean hasRequestor() { + return this.requestor != null && !this.requestor.isEmpty(); + } + + /** + * @param value {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value + */ + public AuditEventAgentComponent setRequestorElement(BooleanType value) { + this.requestor = value; + return this; + } + + /** + * @return Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + public boolean getRequestor() { + return this.requestor == null || this.requestor.isEmpty() ? false : this.requestor.getValue(); + } + + /** + * @param value Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + public AuditEventAgentComponent setRequestor(boolean value) { + if (this.requestor == null) + this.requestor = new BooleanType(); + this.requestor.setValue(value); + return this; + } + + /** + * @return {@link #location} (Where the event occurred.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Where the event occurred.) + */ + public AuditEventAgentComponent 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. (Where the event occurred.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + 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. (Where the event occurred.) + */ + public AuditEventAgentComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) + */ + public List getPolicy() { + if (this.policy == null) + this.policy = new ArrayList(); + return this.policy; + } + + public boolean hasPolicy() { + if (this.policy == null) + return false; + for (UriType item : this.policy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) + */ + // syntactic sugar + public UriType addPolicyElement() {//2 + UriType t = new UriType(); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return t; + } + + /** + * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) + */ + public AuditEventAgentComponent addPolicy(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return this; + } + + /** + * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) + */ + public boolean hasPolicy(String value) { + if (this.policy == null) + return false; + for (UriType v : this.policy) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) + */ + public Coding getMedia() { + if (this.media == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentComponent.media"); + else if (Configuration.doAutoCreate()) + this.media = new Coding(); // cc + return this.media; + } + + public boolean hasMedia() { + return this.media != null && !this.media.isEmpty(); + } + + /** + * @param value {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) + */ + public AuditEventAgentComponent setMedia(Coding value) { + this.media = value; + return this; + } + + /** + * @return {@link #network} (Logical network location for application activity, if the activity has a network location.) + */ + public AuditEventAgentNetworkComponent getNetwork() { + if (this.network == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentComponent.network"); + else if (Configuration.doAutoCreate()) + this.network = new AuditEventAgentNetworkComponent(); // cc + return this.network; + } + + public boolean hasNetwork() { + return this.network != null && !this.network.isEmpty(); + } + + /** + * @param value {@link #network} (Logical network location for application activity, if the activity has a network location.) + */ + public AuditEventAgentComponent setNetwork(AuditEventAgentNetworkComponent value) { + this.network = value; + return this; + } + + /** + * @return {@link #purposeOfUse} (The reason (purpose of use), specific to this agent, that was used during the event being recorded.) + */ + public List getPurposeOfUse() { + if (this.purposeOfUse == null) + this.purposeOfUse = new ArrayList(); + return this.purposeOfUse; + } + + public boolean hasPurposeOfUse() { + if (this.purposeOfUse == null) + return false; + for (Coding item : this.purposeOfUse) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #purposeOfUse} (The reason (purpose of use), specific to this agent, that was used during the event being recorded.) + */ + // syntactic sugar + public Coding addPurposeOfUse() { //3 + Coding t = new Coding(); + if (this.purposeOfUse == null) + this.purposeOfUse = new ArrayList(); + this.purposeOfUse.add(t); + return t; + } + + // syntactic sugar + public AuditEventAgentComponent addPurposeOfUse(Coding t) { //3 + if (t == null) + return this; + if (this.purposeOfUse == null) + this.purposeOfUse = new ArrayList(); + this.purposeOfUse.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "CodeableConcept", "Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("reference", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the agent.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("userId", "Identifier", "Unique identifier for the user actively participating in the event.", 0, java.lang.Integer.MAX_VALUE, userId)); + childrenList.add(new Property("altId", "string", "Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.", 0, java.lang.Integer.MAX_VALUE, altId)); + childrenList.add(new Property("name", "string", "Human-meaningful name for the agent.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("requestor", "boolean", "Indicator that the user is or is not the requestor, or initiator, for the event being audited.", 0, java.lang.Integer.MAX_VALUE, requestor)); + childrenList.add(new Property("location", "Reference(Location)", "Where the event occurred.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("policy", "uri", "The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.", 0, java.lang.Integer.MAX_VALUE, policy)); + childrenList.add(new Property("media", "Coding", "Type of media involved. Used when the event is about exporting/importing onto media.", 0, java.lang.Integer.MAX_VALUE, media)); + childrenList.add(new Property("network", "", "Logical network location for application activity, if the activity has a network location.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("purposeOfUse", "Coding", "The reason (purpose of use), specific to this agent, that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfUse)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference + case -836030906: /*userId*/ return this.userId == null ? new Base[0] : new Base[] {this.userId}; // Identifier + case 92912804: /*altId*/ return this.altId == null ? new Base[0] : new Base[] {this.altId}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 693934258: /*requestor*/ return this.requestor == null ? new Base[0] : new Base[] {this.requestor}; // BooleanType + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference + case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // UriType + case 103772132: /*media*/ return this.media == null ? new Base[0] : new Base[] {this.media}; // Coding + case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // AuditEventAgentNetworkComponent + case -1881902670: /*purposeOfUse*/ return this.purposeOfUse == null ? new Base[0] : this.purposeOfUse.toArray(new Base[this.purposeOfUse.size()]); // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3506294: // role + this.getRole().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -925155509: // reference + this.reference = castToReference(value); // Reference + break; + case -836030906: // userId + this.userId = castToIdentifier(value); // Identifier + break; + case 92912804: // altId + this.altId = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 693934258: // requestor + this.requestor = castToBoolean(value); // BooleanType + break; + case 1901043637: // location + this.location = castToReference(value); // Reference + break; + case -982670030: // policy + this.getPolicy().add(castToUri(value)); // UriType + break; + case 103772132: // media + this.media = castToCoding(value); // Coding + break; + case 1843485230: // network + this.network = (AuditEventAgentNetworkComponent) value; // AuditEventAgentNetworkComponent + break; + case -1881902670: // purposeOfUse + this.getPurposeOfUse().add(castToCoding(value)); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("role")) + this.getRole().add(castToCodeableConcept(value)); + else if (name.equals("reference")) + this.reference = castToReference(value); // Reference + else if (name.equals("userId")) + this.userId = castToIdentifier(value); // Identifier + else if (name.equals("altId")) + this.altId = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("requestor")) + this.requestor = castToBoolean(value); // BooleanType + else if (name.equals("location")) + this.location = castToReference(value); // Reference + else if (name.equals("policy")) + this.getPolicy().add(castToUri(value)); + else if (name.equals("media")) + this.media = castToCoding(value); // Coding + else if (name.equals("network")) + this.network = (AuditEventAgentNetworkComponent) value; // AuditEventAgentNetworkComponent + else if (name.equals("purposeOfUse")) + this.getPurposeOfUse().add(castToCoding(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3506294: return addRole(); // CodeableConcept + case -925155509: return getReference(); // Reference + case -836030906: return getUserId(); // Identifier + case 92912804: throw new FHIRException("Cannot make property altId as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 693934258: throw new FHIRException("Cannot make property requestor as it is not a complex type"); // BooleanType + case 1901043637: return getLocation(); // Reference + case -982670030: throw new FHIRException("Cannot make property policy as it is not a complex type"); // UriType + case 103772132: return getMedia(); // Coding + case 1843485230: return getNetwork(); // AuditEventAgentNetworkComponent + case -1881902670: return addPurposeOfUse(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("role")) { + return addRole(); + } + else if (name.equals("reference")) { + this.reference = new Reference(); + return this.reference; + } + else if (name.equals("userId")) { + this.userId = new Identifier(); + return this.userId; + } + else if (name.equals("altId")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.altId"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.name"); + } + else if (name.equals("requestor")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.requestor"); + } + else if (name.equals("location")) { + this.location = new Reference(); + return this.location; + } + else if (name.equals("policy")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.policy"); + } + else if (name.equals("media")) { + this.media = new Coding(); + return this.media; + } + else if (name.equals("network")) { + this.network = new AuditEventAgentNetworkComponent(); + return this.network; + } + else if (name.equals("purposeOfUse")) { + return addPurposeOfUse(); + } + else + return super.addChild(name); + } + + public AuditEventAgentComponent copy() { + AuditEventAgentComponent dst = new AuditEventAgentComponent(); + copyValues(dst); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + dst.reference = reference == null ? null : reference.copy(); + dst.userId = userId == null ? null : userId.copy(); + dst.altId = altId == null ? null : altId.copy(); + dst.name = name == null ? null : name.copy(); + dst.requestor = requestor == null ? null : requestor.copy(); + dst.location = location == null ? null : location.copy(); + if (policy != null) { + dst.policy = new ArrayList(); + for (UriType i : policy) + dst.policy.add(i.copy()); + }; + dst.media = media == null ? null : media.copy(); + dst.network = network == null ? null : network.copy(); + if (purposeOfUse != null) { + dst.purposeOfUse = new ArrayList(); + for (Coding i : purposeOfUse) + dst.purposeOfUse.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventAgentComponent)) + return false; + AuditEventAgentComponent o = (AuditEventAgentComponent) other; + return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true) && compareDeep(userId, o.userId, true) + && compareDeep(altId, o.altId, true) && compareDeep(name, o.name, true) && compareDeep(requestor, o.requestor, true) + && compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true) && compareDeep(media, o.media, true) + && compareDeep(network, o.network, true) && compareDeep(purposeOfUse, o.purposeOfUse, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventAgentComponent)) + return false; + AuditEventAgentComponent o = (AuditEventAgentComponent) other; + return compareValues(altId, o.altId, true) && compareValues(name, o.name, true) && compareValues(requestor, o.requestor, true) + && compareValues(policy, o.policy, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (reference == null || reference.isEmpty()) + && (userId == null || userId.isEmpty()) && (altId == null || altId.isEmpty()) && (name == null || name.isEmpty()) + && (requestor == null || requestor.isEmpty()) && (location == null || location.isEmpty()) + && (policy == null || policy.isEmpty()) && (media == null || media.isEmpty()) && (network == null || network.isEmpty()) + && (purposeOfUse == null || purposeOfUse.isEmpty()); + } + + public String fhirType() { + return "AuditEvent.agent"; + + } + + } + + @Block() + public static class AuditEventAgentNetworkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier for the network access point of the user device for the audit event. + */ + @Child(name = "address", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Identifier for the network access point of the user device", formalDefinition="An identifier for the network access point of the user device for the audit event." ) + protected StringType address; + + /** + * An identifier for the type of network access point that originated the audit event. + */ + @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The type of network access point", formalDefinition="An identifier for the type of network access point that originated the audit event." ) + protected Enumeration type; + + private static final long serialVersionUID = -1355220390L; + + /** + * Constructor + */ + public AuditEventAgentNetworkComponent() { + super(); + } + + /** + * @return {@link #address} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value + */ + public StringType getAddressElement() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventAgentNetworkComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new StringType(); // bb + return this.address; + } + + public boolean hasAddressElement() { + return this.address != null && !this.address.isEmpty(); + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value + */ + public AuditEventAgentNetworkComponent setAddressElement(StringType value) { + this.address = value; + return this; + } + + /** + * @return An identifier for the network access point of the user device for the audit event. + */ + public String getAddress() { + return this.address == null ? null : this.address.getValue(); + } + + /** + * @param value An identifier for the network access point of the user device for the audit event. + */ + public AuditEventAgentNetworkComponent setAddress(String value) { + if (Utilities.noString(value)) + this.address = null; + else { + if (this.address == null) + this.address = new StringType(); + this.address.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (An identifier for the type of network access point that originated the audit event.). 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 AuditEventAgentNetworkComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new AuditEventParticipantNetworkTypeEnumFactory()); // bb + 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} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public AuditEventAgentNetworkComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return An identifier for the type of network access point that originated the audit event. + */ + public AuditEventParticipantNetworkType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value An identifier for the type of network access point that originated the audit event. + */ + public AuditEventAgentNetworkComponent setType(AuditEventParticipantNetworkType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new AuditEventParticipantNetworkTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("address", "string", "An identifier for the network access point of the user device for the audit event.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("type", "code", "An identifier for the type of network access point that originated the audit event.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1147692044: // address + this.address = castToString(value); // StringType + break; + case 3575610: // type + this.type = new AuditEventParticipantNetworkTypeEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("address")) + this.address = castToString(value); // StringType + else if (name.equals("type")) + this.type = new AuditEventParticipantNetworkTypeEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1147692044: throw new FHIRException("Cannot make property address as it is not a complex type"); // StringType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("address")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.address"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.type"); + } + else + return super.addChild(name); + } + + public AuditEventAgentNetworkComponent copy() { + AuditEventAgentNetworkComponent dst = new AuditEventAgentNetworkComponent(); + copyValues(dst); + dst.address = address == null ? null : address.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventAgentNetworkComponent)) + return false; + AuditEventAgentNetworkComponent o = (AuditEventAgentNetworkComponent) other; + return compareDeep(address, o.address, true) && compareDeep(type, o.type, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventAgentNetworkComponent)) + return false; + AuditEventAgentNetworkComponent o = (AuditEventAgentNetworkComponent) other; + return compareValues(address, o.address, true) && compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (address == null || address.isEmpty()) && (type == null || type.isEmpty()) + ; + } + + public String fhirType() { + return "AuditEvent.agent.network"; + + } + + } + + @Block() + public static class AuditEventSourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group. + */ + @Child(name = "site", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Logical source location within the enterprise", formalDefinition="Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group." ) + protected StringType site; + + /** + * Identifier of the source where the event was detected. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The identity of source detecting the event", formalDefinition="Identifier of the source where the event was detected." ) + protected Identifier identifier; + + /** + * Code specifying the type of source where event originated. + */ + @Child(name = "type", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The type of source where event originated", formalDefinition="Code specifying the type of source where event originated." ) + protected List type; + + private static final long serialVersionUID = -1562673890L; + + /** + * Constructor + */ + public AuditEventSourceComponent() { + super(); + } + + /** + * Constructor + */ + public AuditEventSourceComponent(Identifier identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #site} (Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value + */ + public StringType getSiteElement() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventSourceComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new StringType(); // bb + return this.site; + } + + public boolean hasSiteElement() { + return this.site != null && !this.site.isEmpty(); + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value + */ + public AuditEventSourceComponent setSiteElement(StringType value) { + this.site = value; + return this; + } + + /** + * @return Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group. + */ + public String getSite() { + return this.site == null ? null : this.site.getValue(); + } + + /** + * @param value Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group. + */ + public AuditEventSourceComponent setSite(String value) { + if (Utilities.noString(value)) + this.site = null; + else { + if (this.site == null) + this.site = new StringType(); + this.site.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Identifier of the source where the event was detected.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventSourceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier of the source where the event was detected.) + */ + public AuditEventSourceComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #type} (Code specifying the type of source where event originated.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (Coding item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Code specifying the type of source where event originated.) + */ + // syntactic sugar + public Coding addType() { //3 + Coding t = new Coding(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public AuditEventSourceComponent addType(Coding t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("site", "string", "Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("identifier", "Identifier", "Identifier of the source where the event was detected.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "Coding", "Code specifying the type of source where event originated.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3530567: // site + this.site = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 3575610: // type + this.getType().add(castToCoding(value)); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("site")) + this.site = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("type")) + this.getType().add(castToCoding(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3530567: throw new FHIRException("Cannot make property site as it is not a complex type"); // StringType + case -1618432855: return getIdentifier(); // Identifier + case 3575610: return addType(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("site")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.site"); + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("type")) { + return addType(); + } + else + return super.addChild(name); + } + + public AuditEventSourceComponent copy() { + AuditEventSourceComponent dst = new AuditEventSourceComponent(); + copyValues(dst); + dst.site = site == null ? null : site.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (Coding i : type) + dst.type.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventSourceComponent)) + return false; + AuditEventSourceComponent o = (AuditEventSourceComponent) other; + return compareDeep(site, o.site, true) && compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventSourceComponent)) + return false; + AuditEventSourceComponent o = (AuditEventSourceComponent) other; + return compareValues(site, o.site, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (site == null || site.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (type == null || type.isEmpty()); + } + + public String fhirType() { + return "AuditEvent.source"; + + } + + } + + @Block() + public static class AuditEventEntityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies a specific instance of the entity. The reference should always be version specific. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specific instance of object (e.g. versioned)", formalDefinition="Identifies a specific instance of the entity. The reference should always be version specific." ) + protected Identifier identifier; + + /** + * Identifies a specific instance of the entity. The reference should always be version specific. + */ + @Child(name = "reference", type = {}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specific instance of resource (e.g. versioned)", formalDefinition="Identifies a specific instance of the entity. The reference should always be version specific." ) + protected Reference reference; + + /** + * The actual object that is the target of the reference (Identifies a specific instance of the entity. The reference should always be version specific.) + */ + protected Resource referenceTarget; + + /** + * The type of the object that was involved in this audit event. + */ + @Child(name = "type", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Type of object involved", formalDefinition="The type of the object that was involved in this audit event." ) + protected Coding type; + + /** + * Code representing the role the entity played in the event being audited. + */ + @Child(name = "role", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="What role the entity played", formalDefinition="Code representing the role the entity played in the event being audited." ) + protected Coding role; + + /** + * Identifier for the data life-cycle stage for the entity. + */ + @Child(name = "lifecycle", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Life-cycle stage for the object", formalDefinition="Identifier for the data life-cycle stage for the entity." ) + protected Coding lifecycle; + + /** + * Denotes security labels for the identified entity. + */ + @Child(name = "securityLabel", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Security labels applied to the object", formalDefinition="Denotes security labels for the identified entity." ) + protected List securityLabel; + + /** + * A name of the entity in the audit event. + */ + @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Descriptor for entity", formalDefinition="A name of the entity in the audit event." ) + protected StringType name; + + /** + * Text that describes the entity in more detail. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Descriptive text", formalDefinition="Text that describes the entity in more detail." ) + protected StringType description; + + /** + * The query parameters for a query-type entities. + */ + @Child(name = "query", type = {Base64BinaryType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Query parameters", formalDefinition="The query parameters for a query-type entities." ) + protected Base64BinaryType query; + + /** + * Additional Information about the entity. + */ + @Child(name = "detail", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional Information about the entity", formalDefinition="Additional Information about the entity." ) + protected List detail; + + private static final long serialVersionUID = -1393424632L; + + /** + * Constructor + */ + public AuditEventEntityComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifies a specific instance of the entity. The reference should always be version specific.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEntityComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifies a specific instance of the entity. The reference should always be version specific.) + */ + public AuditEventEntityComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #reference} (Identifies a specific instance of the entity. The reference should always be version specific.) + */ + public Reference getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEntityComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Reference(); // cc + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Identifies a specific instance of the entity. The reference should always be version specific.) + */ + public AuditEventEntityComponent setReference(Reference value) { + this.reference = value; + return this; + } + + /** + * @return {@link #reference} 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 a specific instance of the entity. The reference should always be version specific.) + */ + public Resource getReferenceTarget() { + return this.referenceTarget; + } + + /** + * @param value {@link #reference} 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 a specific instance of the entity. The reference should always be version specific.) + */ + public AuditEventEntityComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; + return this; + } + + /** + * @return {@link #type} (The type of the object that was involved in this audit event.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEntityComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the object that was involved in this audit event.) + */ + public AuditEventEntityComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #role} (Code representing the role the entity played in the event being audited.) + */ + public Coding getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEntityComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Coding(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (Code representing the role the entity played in the event being audited.) + */ + public AuditEventEntityComponent setRole(Coding value) { + this.role = value; + return this; + } + + /** + * @return {@link #lifecycle} (Identifier for the data life-cycle stage for the entity.) + */ + public Coding getLifecycle() { + if (this.lifecycle == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEntityComponent.lifecycle"); + else if (Configuration.doAutoCreate()) + this.lifecycle = new Coding(); // cc + return this.lifecycle; + } + + public boolean hasLifecycle() { + return this.lifecycle != null && !this.lifecycle.isEmpty(); + } + + /** + * @param value {@link #lifecycle} (Identifier for the data life-cycle stage for the entity.) + */ + public AuditEventEntityComponent setLifecycle(Coding value) { + this.lifecycle = value; + return this; + } + + /** + * @return {@link #securityLabel} (Denotes security labels for the identified entity.) + */ + public List getSecurityLabel() { + if (this.securityLabel == null) + this.securityLabel = new ArrayList(); + return this.securityLabel; + } + + public boolean hasSecurityLabel() { + if (this.securityLabel == null) + return false; + for (Coding item : this.securityLabel) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #securityLabel} (Denotes security labels for the identified entity.) + */ + // syntactic sugar + public Coding addSecurityLabel() { //3 + Coding t = new Coding(); + if (this.securityLabel == null) + this.securityLabel = new ArrayList(); + this.securityLabel.add(t); + return t; + } + + // syntactic sugar + public AuditEventEntityComponent addSecurityLabel(Coding t) { //3 + if (t == null) + return this; + if (this.securityLabel == null) + this.securityLabel = new ArrayList(); + this.securityLabel.add(t); + return this; + } + + /** + * @return {@link #name} (A name of the entity in the audit event.). 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 AuditEventEntityComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A name of the entity in the audit event.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public AuditEventEntityComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name of the entity in the audit event. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name of the entity in the audit event. + */ + public AuditEventEntityComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Text that describes the entity in more detail.). 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 AuditEventEntityComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Text that describes the entity in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public AuditEventEntityComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text that describes the entity in more detail. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text that describes the entity in more detail. + */ + public AuditEventEntityComponent 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 #query} (The query parameters for a query-type entities.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value + */ + public Base64BinaryType getQueryElement() { + if (this.query == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEntityComponent.query"); + else if (Configuration.doAutoCreate()) + this.query = new Base64BinaryType(); // bb + return this.query; + } + + public boolean hasQueryElement() { + return this.query != null && !this.query.isEmpty(); + } + + public boolean hasQuery() { + return this.query != null && !this.query.isEmpty(); + } + + /** + * @param value {@link #query} (The query parameters for a query-type entities.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value + */ + public AuditEventEntityComponent setQueryElement(Base64BinaryType value) { + this.query = value; + return this; + } + + /** + * @return The query parameters for a query-type entities. + */ + public byte[] getQuery() { + return this.query == null ? null : this.query.getValue(); + } + + /** + * @param value The query parameters for a query-type entities. + */ + public AuditEventEntityComponent setQuery(byte[] value) { + if (value == null) + this.query = null; + else { + if (this.query == null) + this.query = new Base64BinaryType(); + this.query.setValue(value); + } + return this; + } + + /** + * @return {@link #detail} (Additional Information about the entity.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (AuditEventEntityDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Additional Information about the entity.) + */ + // syntactic sugar + public AuditEventEntityDetailComponent addDetail() { //3 + AuditEventEntityDetailComponent t = new AuditEventEntityDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public AuditEventEntityComponent addDetail(AuditEventEntityDetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifies a specific instance of the entity. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("reference", "Reference(Any)", "Identifies a specific instance of the entity. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("type", "Coding", "The type of the object that was involved in this audit event.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("role", "Coding", "Code representing the role the entity played in the event being audited.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("lifecycle", "Coding", "Identifier for the data life-cycle stage for the entity.", 0, java.lang.Integer.MAX_VALUE, lifecycle)); + childrenList.add(new Property("securityLabel", "Coding", "Denotes security labels for the identified entity.", 0, java.lang.Integer.MAX_VALUE, securityLabel)); + childrenList.add(new Property("name", "string", "A name of the entity in the audit event.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Text that describes the entity in more detail.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("query", "base64Binary", "The query parameters for a query-type entities.", 0, java.lang.Integer.MAX_VALUE, query)); + childrenList.add(new Property("detail", "", "Additional Information about the entity.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding + case -302323862: /*lifecycle*/ return this.lifecycle == null ? new Base[0] : new Base[] {this.lifecycle}; // Coding + case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // Coding + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 107944136: /*query*/ return this.query == null ? new Base[0] : new Base[] {this.query}; // Base64BinaryType + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AuditEventEntityDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -925155509: // reference + this.reference = castToReference(value); // Reference + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 3506294: // role + this.role = castToCoding(value); // Coding + break; + case -302323862: // lifecycle + this.lifecycle = castToCoding(value); // Coding + break; + case -722296940: // securityLabel + this.getSecurityLabel().add(castToCoding(value)); // Coding + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 107944136: // query + this.query = castToBase64Binary(value); // Base64BinaryType + break; + case -1335224239: // detail + this.getDetail().add((AuditEventEntityDetailComponent) value); // AuditEventEntityDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("reference")) + this.reference = castToReference(value); // Reference + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("role")) + this.role = castToCoding(value); // Coding + else if (name.equals("lifecycle")) + this.lifecycle = castToCoding(value); // Coding + else if (name.equals("securityLabel")) + this.getSecurityLabel().add(castToCoding(value)); + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("query")) + this.query = castToBase64Binary(value); // Base64BinaryType + else if (name.equals("detail")) + this.getDetail().add((AuditEventEntityDetailComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -925155509: return getReference(); // Reference + case 3575610: return getType(); // Coding + case 3506294: return getRole(); // Coding + case -302323862: return getLifecycle(); // Coding + case -722296940: return addSecurityLabel(); // Coding + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 107944136: throw new FHIRException("Cannot make property query as it is not a complex type"); // Base64BinaryType + case -1335224239: return addDetail(); // AuditEventEntityDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("reference")) { + this.reference = new Reference(); + return this.reference; + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("role")) { + this.role = new Coding(); + return this.role; + } + else if (name.equals("lifecycle")) { + this.lifecycle = new Coding(); + return this.lifecycle; + } + else if (name.equals("securityLabel")) { + return addSecurityLabel(); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.name"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.description"); + } + else if (name.equals("query")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.query"); + } + else if (name.equals("detail")) { + return addDetail(); + } + else + return super.addChild(name); + } + + public AuditEventEntityComponent copy() { + AuditEventEntityComponent dst = new AuditEventEntityComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.type = type == null ? null : type.copy(); + dst.role = role == null ? null : role.copy(); + dst.lifecycle = lifecycle == null ? null : lifecycle.copy(); + if (securityLabel != null) { + dst.securityLabel = new ArrayList(); + for (Coding i : securityLabel) + dst.securityLabel.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.query = query == null ? null : query.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (AuditEventEntityDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventEntityComponent)) + return false; + AuditEventEntityComponent o = (AuditEventEntityComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true) + && compareDeep(type, o.type, true) && compareDeep(role, o.role, true) && compareDeep(lifecycle, o.lifecycle, true) + && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) + && compareDeep(query, o.query, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventEntityComponent)) + return false; + AuditEventEntityComponent o = (AuditEventEntityComponent) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(query, o.query, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) + && (type == null || type.isEmpty()) && (role == null || role.isEmpty()) && (lifecycle == null || lifecycle.isEmpty()) + && (securityLabel == null || securityLabel.isEmpty()) && (name == null || name.isEmpty()) + && (description == null || description.isEmpty()) && (query == null || query.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + public String fhirType() { + return "AuditEvent.entity"; + + } + + } + + @Block() + public static class AuditEventEntityDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Name of the property. + */ + @Child(name = "type", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of the property", formalDefinition="Name of the property." ) + protected StringType type; + + /** + * Property value. + */ + @Child(name = "value", type = {Base64BinaryType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Property value", formalDefinition="Property value." ) + protected Base64BinaryType value; + + private static final long serialVersionUID = 11139504L; + + /** + * Constructor + */ + public AuditEventEntityDetailComponent() { + super(); + } + + /** + * Constructor + */ + public AuditEventEntityDetailComponent(StringType type, Base64BinaryType value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StringType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEntityDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new StringType(); // bb + 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} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public AuditEventEntityDetailComponent setTypeElement(StringType value) { + this.type = value; + return this; + } + + /** + * @return Name of the property. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Name of the property. + */ + public AuditEventEntityDetailComponent setType(String value) { + if (this.type == null) + this.type = new StringType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Base64BinaryType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEventEntityDetailComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new Base64BinaryType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AuditEventEntityDetailComponent setValueElement(Base64BinaryType value) { + this.value = value; + return this; + } + + /** + * @return Property value. + */ + public byte[] getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value Property value. + */ + public AuditEventEntityDetailComponent setValue(byte[] value) { + if (this.value == null) + this.value = new Base64BinaryType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "string", "Name of the property.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value", "base64Binary", "Property value.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Base64BinaryType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToString(value); // StringType + break; + case 111972721: // value + this.value = castToBase64Binary(value); // Base64BinaryType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToString(value); // StringType + else if (name.equals("value")) + this.value = castToBase64Binary(value); // Base64BinaryType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // StringType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // Base64BinaryType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.type"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.value"); + } + else + return super.addChild(name); + } + + public AuditEventEntityDetailComponent copy() { + AuditEventEntityDetailComponent dst = new AuditEventEntityDetailComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEventEntityDetailComponent)) + return false; + AuditEventEntityDetailComponent o = (AuditEventEntityDetailComponent) other; + return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEventEntityDetailComponent)) + return false; + AuditEventEntityDetailComponent o = (AuditEventEntityDetailComponent) other; + return compareValues(type, o.type, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "AuditEvent.entity.detail"; + + } + + } + + /** + * Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function. + */ + @Child(name = "type", type = {Coding.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type/identifier of event", formalDefinition="Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function." ) + protected Coding type; + + /** + * Identifier for the category of event. + */ + @Child(name = "subtype", type = {Coding.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="More specific type/id for the event", formalDefinition="Identifier for the category of event." ) + protected List subtype; + + /** + * Indicator for type of action performed during the event that generated the audit. + */ + @Child(name = "action", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of action performed during the event", formalDefinition="Indicator for type of action performed during the event that generated the audit." ) + protected Enumeration action; + + /** + * The time when the event occurred on the source. + */ + @Child(name = "recorded", type = {InstantType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time when the event occurred on source", formalDefinition="The time when the event occurred on the source." ) + protected InstantType recorded; + + /** + * Indicates whether the event succeeded or failed. + */ + @Child(name = "outcome", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether the event succeeded or failed", formalDefinition="Indicates whether the event succeeded or failed." ) + protected Enumeration outcome; + + /** + * A free text description of the outcome of the event. + */ + @Child(name = "outcomeDesc", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description of the event outcome", formalDefinition="A free text description of the outcome of the event." ) + protected StringType outcomeDesc; + + /** + * The purposeOfUse (reason) that was used during the event being recorded. + */ + @Child(name = "purposeOfEvent", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The purposeOfUse of the event", formalDefinition="The purposeOfUse (reason) that was used during the event being recorded." ) + protected List purposeOfEvent; + + /** + * An actor taking an active role in the event or activity that is logged. + */ + @Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Actor involved in the event", formalDefinition="An actor taking an active role in the event or activity that is logged." ) + protected List agent; + + /** + * Application systems and processes. + */ + @Child(name = "source", type = {}, order=8, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Application systems and processes", formalDefinition="Application systems and processes." ) + protected AuditEventSourceComponent source; + + /** + * Specific instances of data or objects that have been accessed. + */ + @Child(name = "entity", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Specific instances of data or objects that have been accessed", formalDefinition="Specific instances of data or objects that have been accessed." ) + protected List entity; + + private static final long serialVersionUID = 945153702L; + + /** + * Constructor + */ + public AuditEvent() { + super(); + } + + /** + * Constructor + */ + public AuditEvent(Coding type, InstantType recorded, AuditEventSourceComponent source) { + super(); + this.type = type; + this.recorded = recorded; + this.source = source; + } + + /** + * @return {@link #type} (Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEvent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.) + */ + public AuditEvent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #subtype} (Identifier for the category of event.) + */ + public List getSubtype() { + if (this.subtype == null) + this.subtype = new ArrayList(); + return this.subtype; + } + + public boolean hasSubtype() { + if (this.subtype == null) + return false; + for (Coding item : this.subtype) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subtype} (Identifier for the category of event.) + */ + // syntactic sugar + public Coding addSubtype() { //3 + Coding t = new Coding(); + if (this.subtype == null) + this.subtype = new ArrayList(); + this.subtype.add(t); + return t; + } + + // syntactic sugar + public AuditEvent addSubtype(Coding t) { //3 + if (t == null) + return this; + if (this.subtype == null) + this.subtype = new ArrayList(); + this.subtype.add(t); + return this; + } + + /** + * @return {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public Enumeration getActionElement() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEvent.action"); + else if (Configuration.doAutoCreate()) + this.action = new Enumeration(new AuditEventActionEnumFactory()); // bb + return this.action; + } + + public boolean hasActionElement() { + return this.action != null && !this.action.isEmpty(); + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public AuditEvent setActionElement(Enumeration value) { + this.action = value; + return this; + } + + /** + * @return Indicator for type of action performed during the event that generated the audit. + */ + public AuditEventAction getAction() { + return this.action == null ? null : this.action.getValue(); + } + + /** + * @param value Indicator for type of action performed during the event that generated the audit. + */ + public AuditEvent setAction(AuditEventAction value) { + if (value == null) + this.action = null; + else { + if (this.action == null) + this.action = new Enumeration(new AuditEventActionEnumFactory()); + this.action.setValue(value); + } + return this; + } + + /** + * @return {@link #recorded} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value + */ + public InstantType getRecordedElement() { + if (this.recorded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEvent.recorded"); + else if (Configuration.doAutoCreate()) + this.recorded = new InstantType(); // bb + return this.recorded; + } + + public boolean hasRecordedElement() { + return this.recorded != null && !this.recorded.isEmpty(); + } + + public boolean hasRecorded() { + return this.recorded != null && !this.recorded.isEmpty(); + } + + /** + * @param value {@link #recorded} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value + */ + public AuditEvent setRecordedElement(InstantType value) { + this.recorded = value; + return this; + } + + /** + * @return The time when the event occurred on the source. + */ + public Date getRecorded() { + return this.recorded == null ? null : this.recorded.getValue(); + } + + /** + * @param value The time when the event occurred on the source. + */ + public AuditEvent setRecorded(Date value) { + if (this.recorded == null) + this.recorded = new InstantType(); + this.recorded.setValue(value); + return this; + } + + /** + * @return {@link #outcome} (Indicates whether the event succeeded or failed.). 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 AuditEvent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new AuditEventOutcomeEnumFactory()); // bb + 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} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public AuditEvent setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Indicates whether the event succeeded or failed. + */ + public AuditEventOutcome getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Indicates whether the event succeeded or failed. + */ + public AuditEvent setOutcome(AuditEventOutcome value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new AuditEventOutcomeEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value + */ + public StringType getOutcomeDescElement() { + if (this.outcomeDesc == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEvent.outcomeDesc"); + else if (Configuration.doAutoCreate()) + this.outcomeDesc = new StringType(); // bb + return this.outcomeDesc; + } + + public boolean hasOutcomeDescElement() { + return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); + } + + public boolean hasOutcomeDesc() { + return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); + } + + /** + * @param value {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value + */ + public AuditEvent setOutcomeDescElement(StringType value) { + this.outcomeDesc = value; + return this; + } + + /** + * @return A free text description of the outcome of the event. + */ + public String getOutcomeDesc() { + return this.outcomeDesc == null ? null : this.outcomeDesc.getValue(); + } + + /** + * @param value A free text description of the outcome of the event. + */ + public AuditEvent setOutcomeDesc(String value) { + if (Utilities.noString(value)) + this.outcomeDesc = null; + else { + if (this.outcomeDesc == null) + this.outcomeDesc = new StringType(); + this.outcomeDesc.setValue(value); + } + return this; + } + + /** + * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) + */ + public List getPurposeOfEvent() { + if (this.purposeOfEvent == null) + this.purposeOfEvent = new ArrayList(); + return this.purposeOfEvent; + } + + public boolean hasPurposeOfEvent() { + if (this.purposeOfEvent == null) + return false; + for (Coding item : this.purposeOfEvent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) + */ + // syntactic sugar + public Coding addPurposeOfEvent() { //3 + Coding t = new Coding(); + if (this.purposeOfEvent == null) + this.purposeOfEvent = new ArrayList(); + this.purposeOfEvent.add(t); + return t; + } + + // syntactic sugar + public AuditEvent addPurposeOfEvent(Coding t) { //3 + if (t == null) + return this; + if (this.purposeOfEvent == null) + this.purposeOfEvent = new ArrayList(); + this.purposeOfEvent.add(t); + return this; + } + + /** + * @return {@link #agent} (An actor taking an active role in the event or activity that is logged.) + */ + public List getAgent() { + if (this.agent == null) + this.agent = new ArrayList(); + return this.agent; + } + + public boolean hasAgent() { + if (this.agent == null) + return false; + for (AuditEventAgentComponent item : this.agent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #agent} (An actor taking an active role in the event or activity that is logged.) + */ + // syntactic sugar + public AuditEventAgentComponent addAgent() { //3 + AuditEventAgentComponent t = new AuditEventAgentComponent(); + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return t; + } + + // syntactic sugar + public AuditEvent addAgent(AuditEventAgentComponent t) { //3 + if (t == null) + return this; + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return this; + } + + /** + * @return {@link #source} (Application systems and processes.) + */ + public AuditEventSourceComponent getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AuditEvent.source"); + else if (Configuration.doAutoCreate()) + this.source = new AuditEventSourceComponent(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Application systems and processes.) + */ + public AuditEvent setSource(AuditEventSourceComponent value) { + this.source = value; + return this; + } + + /** + * @return {@link #entity} (Specific instances of data or objects that have been accessed.) + */ + public List getEntity() { + if (this.entity == null) + this.entity = new ArrayList(); + return this.entity; + } + + public boolean hasEntity() { + if (this.entity == null) + return false; + for (AuditEventEntityComponent item : this.entity) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entity} (Specific instances of data or objects that have been accessed.) + */ + // syntactic sugar + public AuditEventEntityComponent addEntity() { //3 + AuditEventEntityComponent t = new AuditEventEntityComponent(); + if (this.entity == null) + this.entity = new ArrayList(); + this.entity.add(t); + return t; + } + + // syntactic sugar + public AuditEvent addEntity(AuditEventEntityComponent t) { //3 + if (t == null) + return this; + if (this.entity == null) + this.entity = new ArrayList(); + this.entity.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subtype", "Coding", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("recorded", "instant", "The time when the event occurred on the source.", 0, java.lang.Integer.MAX_VALUE, recorded)); + childrenList.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, java.lang.Integer.MAX_VALUE, outcomeDesc)); + childrenList.add(new Property("purposeOfEvent", "Coding", "The purposeOfUse (reason) that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfEvent)); + childrenList.add(new Property("agent", "", "An actor taking an active role in the event or activity that is logged.", 0, java.lang.Integer.MAX_VALUE, agent)); + childrenList.add(new Property("source", "", "Application systems and processes.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("entity", "", "Specific instances of data or objects that have been accessed.", 0, java.lang.Integer.MAX_VALUE, entity)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : this.subtype.toArray(new Base[this.subtype.size()]); // Coding + case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // Enumeration + case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // InstantType + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration + case 1062502659: /*outcomeDesc*/ return this.outcomeDesc == null ? new Base[0] : new Base[] {this.outcomeDesc}; // StringType + case -341917691: /*purposeOfEvent*/ return this.purposeOfEvent == null ? new Base[0] : this.purposeOfEvent.toArray(new Base[this.purposeOfEvent.size()]); // Coding + case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // AuditEventAgentComponent + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // AuditEventSourceComponent + case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : this.entity.toArray(new Base[this.entity.size()]); // AuditEventEntityComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case -1867567750: // subtype + this.getSubtype().add(castToCoding(value)); // Coding + break; + case -1422950858: // action + this.action = new AuditEventActionEnumFactory().fromType(value); // Enumeration + break; + case -799233872: // recorded + this.recorded = castToInstant(value); // InstantType + break; + case -1106507950: // outcome + this.outcome = new AuditEventOutcomeEnumFactory().fromType(value); // Enumeration + break; + case 1062502659: // outcomeDesc + this.outcomeDesc = castToString(value); // StringType + break; + case -341917691: // purposeOfEvent + this.getPurposeOfEvent().add(castToCoding(value)); // Coding + break; + case 92750597: // agent + this.getAgent().add((AuditEventAgentComponent) value); // AuditEventAgentComponent + break; + case -896505829: // source + this.source = (AuditEventSourceComponent) value; // AuditEventSourceComponent + break; + case -1298275357: // entity + this.getEntity().add((AuditEventEntityComponent) value); // AuditEventEntityComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("subtype")) + this.getSubtype().add(castToCoding(value)); + else if (name.equals("action")) + this.action = new AuditEventActionEnumFactory().fromType(value); // Enumeration + else if (name.equals("recorded")) + this.recorded = castToInstant(value); // InstantType + else if (name.equals("outcome")) + this.outcome = new AuditEventOutcomeEnumFactory().fromType(value); // Enumeration + else if (name.equals("outcomeDesc")) + this.outcomeDesc = castToString(value); // StringType + else if (name.equals("purposeOfEvent")) + this.getPurposeOfEvent().add(castToCoding(value)); + else if (name.equals("agent")) + this.getAgent().add((AuditEventAgentComponent) value); + else if (name.equals("source")) + this.source = (AuditEventSourceComponent) value; // AuditEventSourceComponent + else if (name.equals("entity")) + this.getEntity().add((AuditEventEntityComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case -1867567750: return addSubtype(); // Coding + case -1422950858: throw new FHIRException("Cannot make property action as it is not a complex type"); // Enumeration + case -799233872: throw new FHIRException("Cannot make property recorded as it is not a complex type"); // InstantType + case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration + case 1062502659: throw new FHIRException("Cannot make property outcomeDesc as it is not a complex type"); // StringType + case -341917691: return addPurposeOfEvent(); // Coding + case 92750597: return addAgent(); // AuditEventAgentComponent + case -896505829: return getSource(); // AuditEventSourceComponent + case -1298275357: return addEntity(); // AuditEventEntityComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("subtype")) { + return addSubtype(); + } + else if (name.equals("action")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.action"); + } + else if (name.equals("recorded")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.recorded"); + } + else if (name.equals("outcome")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.outcome"); + } + else if (name.equals("outcomeDesc")) { + throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.outcomeDesc"); + } + else if (name.equals("purposeOfEvent")) { + return addPurposeOfEvent(); + } + else if (name.equals("agent")) { + return addAgent(); + } + else if (name.equals("source")) { + this.source = new AuditEventSourceComponent(); + return this.source; + } + else if (name.equals("entity")) { + return addEntity(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "AuditEvent"; + + } + + public AuditEvent copy() { + AuditEvent dst = new AuditEvent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (subtype != null) { + dst.subtype = new ArrayList(); + for (Coding i : subtype) + dst.subtype.add(i.copy()); + }; + dst.action = action == null ? null : action.copy(); + dst.recorded = recorded == null ? null : recorded.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy(); + if (purposeOfEvent != null) { + dst.purposeOfEvent = new ArrayList(); + for (Coding i : purposeOfEvent) + dst.purposeOfEvent.add(i.copy()); + }; + if (agent != null) { + dst.agent = new ArrayList(); + for (AuditEventAgentComponent i : agent) + dst.agent.add(i.copy()); + }; + dst.source = source == null ? null : source.copy(); + if (entity != null) { + dst.entity = new ArrayList(); + for (AuditEventEntityComponent i : entity) + dst.entity.add(i.copy()); + }; + return dst; + } + + protected AuditEvent typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AuditEvent)) + return false; + AuditEvent o = (AuditEvent) other; + return compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) && compareDeep(action, o.action, true) + && compareDeep(recorded, o.recorded, true) && compareDeep(outcome, o.outcome, true) && compareDeep(outcomeDesc, o.outcomeDesc, true) + && compareDeep(purposeOfEvent, o.purposeOfEvent, true) && compareDeep(agent, o.agent, true) && compareDeep(source, o.source, true) + && compareDeep(entity, o.entity, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AuditEvent)) + return false; + AuditEvent o = (AuditEvent) other; + return compareValues(action, o.action, true) && compareValues(recorded, o.recorded, true) && compareValues(outcome, o.outcome, true) + && compareValues(outcomeDesc, o.outcomeDesc, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) + && (action == null || action.isEmpty()) && (recorded == null || recorded.isEmpty()) && (outcome == null || outcome.isEmpty()) + && (outcomeDesc == null || outcomeDesc.isEmpty()) && (purposeOfEvent == null || purposeOfEvent.isEmpty()) + && (agent == null || agent.isEmpty()) && (source == null || source.isEmpty()) && (entity == null || entity.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.AuditEvent; + } + + /** + * Search parameter: site + *

+ * Description: Logical source location within the enterprise
+ * Type: token
+ * Path: AuditEvent.source.site
+ *

+ */ + @SearchParamDefinition(name="site", path="AuditEvent.source.site", description="Logical source location within the enterprise", type="token" ) + public static final String SP_SITE = "site"; + /** + * Fluent Client search parameter constant for site + *

+ * Description: Logical source location within the enterprise
+ * Type: token
+ * Path: AuditEvent.source.site
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SITE); + + /** + * Search parameter: entity + *

+ * Description: Specific instance of resource (e.g. versioned)
+ * Type: reference
+ * Path: AuditEvent.entity.reference
+ *

+ */ + @SearchParamDefinition(name="entity", path="AuditEvent.entity.reference", description="Specific instance of resource (e.g. versioned)", type="reference" ) + public static final String SP_ENTITY = "entity"; + /** + * Fluent Client search parameter constant for entity + *

+ * Description: Specific instance of resource (e.g. versioned)
+ * Type: reference
+ * Path: AuditEvent.entity.reference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTITY); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AuditEvent:entity". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTITY = new ca.uhn.fhir.model.api.Include("AuditEvent:entity").toLocked(); + + /** + * Search parameter: entity-type + *

+ * Description: Type of object involved
+ * Type: token
+ * Path: AuditEvent.entity.type
+ *

+ */ + @SearchParamDefinition(name="entity-type", path="AuditEvent.entity.type", description="Type of object involved", type="token" ) + public static final String SP_ENTITY_TYPE = "entity-type"; + /** + * Fluent Client search parameter constant for entity-type + *

+ * Description: Type of object involved
+ * Type: token
+ * Path: AuditEvent.entity.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_TYPE); + + /** + * Search parameter: type + *

+ * Description: Type/identifier of event
+ * Type: token
+ * Path: AuditEvent.type
+ *

+ */ + @SearchParamDefinition(name="type", path="AuditEvent.type", description="Type/identifier of event", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Type/identifier of event
+ * Type: token
+ * Path: AuditEvent.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: date + *

+ * Description: Time when the event occurred on source
+ * Type: date
+ * Path: AuditEvent.recorded
+ *

+ */ + @SearchParamDefinition(name="date", path="AuditEvent.recorded", description="Time when the event occurred on source", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Time when the event occurred on source
+ * Type: date
+ * Path: AuditEvent.recorded
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: agent + *

+ * Description: Direct reference to resource
+ * Type: reference
+ * Path: AuditEvent.agent.reference
+ *

+ */ + @SearchParamDefinition(name="agent", path="AuditEvent.agent.reference", description="Direct reference to resource", type="reference" ) + public static final String SP_AGENT = "agent"; + /** + * Fluent Client search parameter constant for agent + *

+ * Description: Direct reference to resource
+ * Type: reference
+ * Path: AuditEvent.agent.reference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AuditEvent:agent". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include("AuditEvent:agent").toLocked(); + + /** + * Search parameter: agent-name + *

+ * Description: Human-meaningful name for the agent
+ * Type: string
+ * Path: AuditEvent.agent.name
+ *

+ */ + @SearchParamDefinition(name="agent-name", path="AuditEvent.agent.name", description="Human-meaningful name for the agent", type="string" ) + public static final String SP_AGENT_NAME = "agent-name"; + /** + * Fluent Client search parameter constant for agent-name + *

+ * Description: Human-meaningful name for the agent
+ * Type: string
+ * Path: AuditEvent.agent.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam AGENT_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_AGENT_NAME); + + /** + * Search parameter: entity-id + *

+ * Description: Specific instance of object (e.g. versioned)
+ * Type: token
+ * Path: AuditEvent.entity.identifier
+ *

+ */ + @SearchParamDefinition(name="entity-id", path="AuditEvent.entity.identifier", description="Specific instance of object (e.g. versioned)", type="token" ) + public static final String SP_ENTITY_ID = "entity-id"; + /** + * Fluent Client search parameter constant for entity-id + *

+ * Description: Specific instance of object (e.g. versioned)
+ * Type: token
+ * Path: AuditEvent.entity.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_ID); + + /** + * Search parameter: patient + *

+ * Description: Direct reference to resource
+ * Type: reference
+ * Path: AuditEvent.agent.reference, AuditEvent.entity.reference
+ *

+ */ + @SearchParamDefinition(name="patient", path="AuditEvent.agent.reference | AuditEvent.entity.reference", description="Direct reference to resource", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Direct reference to resource
+ * Type: reference
+ * Path: AuditEvent.agent.reference, AuditEvent.entity.reference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AuditEvent:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AuditEvent:patient").toLocked(); + + /** + * Search parameter: source + *

+ * Description: The identity of source detecting the event
+ * Type: token
+ * Path: AuditEvent.source.identifier
+ *

+ */ + @SearchParamDefinition(name="source", path="AuditEvent.source.identifier", description="The identity of source detecting the event", type="token" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: The identity of source detecting the event
+ * Type: token
+ * Path: AuditEvent.source.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SOURCE); + + /** + * Search parameter: altid + *

+ * Description: Alternative User id e.g. authentication
+ * Type: token
+ * Path: AuditEvent.agent.altId
+ *

+ */ + @SearchParamDefinition(name="altid", path="AuditEvent.agent.altId", description="Alternative User id e.g. authentication", type="token" ) + public static final String SP_ALTID = "altid"; + /** + * Fluent Client search parameter constant for altid + *

+ * Description: Alternative User id e.g. authentication
+ * Type: token
+ * Path: AuditEvent.agent.altId
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ALTID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ALTID); + + /** + * Search parameter: address + *

+ * Description: Identifier for the network access point of the user device
+ * Type: token
+ * Path: AuditEvent.agent.network.address
+ *

+ */ + @SearchParamDefinition(name="address", path="AuditEvent.agent.network.address", description="Identifier for the network access point of the user device", type="token" ) + public static final String SP_ADDRESS = "address"; + /** + * Fluent Client search parameter constant for address + *

+ * Description: Identifier for the network access point of the user device
+ * Type: token
+ * Path: AuditEvent.agent.network.address
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS); + + /** + * Search parameter: subtype + *

+ * Description: More specific type/id for the event
+ * Type: token
+ * Path: AuditEvent.subtype
+ *

+ */ + @SearchParamDefinition(name="subtype", path="AuditEvent.subtype", description="More specific type/id for the event", type="token" ) + public static final String SP_SUBTYPE = "subtype"; + /** + * Fluent Client search parameter constant for subtype + *

+ * Description: More specific type/id for the event
+ * Type: token
+ * Path: AuditEvent.subtype
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBTYPE); + + /** + * Search parameter: action + *

+ * Description: Type of action performed during the event
+ * Type: token
+ * Path: AuditEvent.action
+ *

+ */ + @SearchParamDefinition(name="action", path="AuditEvent.action", description="Type of action performed during the event", type="token" ) + public static final String SP_ACTION = "action"; + /** + * Fluent Client search parameter constant for action + *

+ * Description: Type of action performed during the event
+ * Type: token
+ * Path: AuditEvent.action
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTION); + + /** + * Search parameter: policy + *

+ * Description: Policy that authorized event
+ * Type: uri
+ * Path: AuditEvent.agent.policy
+ *

+ */ + @SearchParamDefinition(name="policy", path="AuditEvent.agent.policy", description="Policy that authorized event", type="uri" ) + public static final String SP_POLICY = "policy"; + /** + * Fluent Client search parameter constant for policy + *

+ * Description: Policy that authorized event
+ * Type: uri
+ * Path: AuditEvent.agent.policy
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam POLICY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_POLICY); + + /** + * Search parameter: user + *

+ * Description: Unique identifier for the user
+ * Type: token
+ * Path: AuditEvent.agent.userId
+ *

+ */ + @SearchParamDefinition(name="user", path="AuditEvent.agent.userId", description="Unique identifier for the user", type="token" ) + public static final String SP_USER = "user"; + /** + * Fluent Client search parameter constant for user + *

+ * Description: Unique identifier for the user
+ * Type: token
+ * Path: AuditEvent.agent.userId
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam USER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USER); + + /** + * Search parameter: entity-name + *

+ * Description: Descriptor for entity
+ * Type: string
+ * Path: AuditEvent.entity.name
+ *

+ */ + @SearchParamDefinition(name="entity-name", path="AuditEvent.entity.name", description="Descriptor for entity", type="string" ) + public static final String SP_ENTITY_NAME = "entity-name"; + /** + * Fluent Client search parameter constant for entity-name + *

+ * Description: Descriptor for entity
+ * Type: string
+ * Path: AuditEvent.entity.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ENTITY_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ENTITY_NAME); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BackboneElement.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BackboneElement.java new file mode 100644 index 00000000000..0b116dab9c2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BackboneElement.java @@ -0,0 +1,195 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * Base definition for all elements that are defined inside a resource - but not those in a data type. + */ +@DatatypeDef(name="BackboneElement") +public abstract class BackboneElement extends Element implements IBaseBackboneElement { + + /** + * May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. + */ + @Child(name = "modifierExtension", type = {Extension.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) + @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) + protected List modifierExtension; + + private static final long serialVersionUID = -1431673179L; + + /** + * Constructor + */ + public BackboneElement() { + super(); + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + public List getModifierExtension() { + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + return this.modifierExtension; + } + + public boolean hasModifierExtension() { + if (this.modifierExtension == null) + return false; + for (Extension item : this.modifierExtension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + // syntactic sugar + public Extension addModifierExtension() { //3 + Extension t = new Extension(); + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return t; + } + + // syntactic sugar + public BackboneElement addModifierExtension(Extension t) { //3 + if (t == null) + return this; + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return this; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -298878168: /*modifierExtension*/ return this.modifierExtension == null ? new Base[0] : this.modifierExtension.toArray(new Base[this.modifierExtension.size()]); // Extension + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -298878168: // modifierExtension + this.getModifierExtension().add(castToExtension(value)); // Extension + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("modifierExtension")) + this.getModifierExtension().add(castToExtension(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -298878168: return addModifierExtension(); // Extension + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("modifierExtension")) { + return addModifierExtension(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "BackboneElement"; + + } + + public abstract BackboneElement copy(); + + public void copyValues(BackboneElement dst) { + if (modifierExtension != null) { + dst.modifierExtension = new ArrayList(); + for (Extension i : modifierExtension) + dst.modifierExtension.add(i.copy()); + }; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BackboneElement)) + return false; + BackboneElement o = (BackboneElement) other; + return compareDeep(modifierExtension, o.modifierExtension, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BackboneElement)) + return false; + BackboneElement o = (BackboneElement) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifierExtension == null || modifierExtension.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Base.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Base.java new file mode 100644 index 00000000000..b8927f58887 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Base.java @@ -0,0 +1,609 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.utilities.xhtml.XhtmlNode; + +import ca.uhn.fhir.model.api.IElement; + +public abstract class Base implements Serializable, IBase, IElement { + + /** + * User appended data items - allow users to add extra information to the class + */ +private Map userData; + + /** + * Round tracking xml comments for testing convenience + */ + private List formatCommentsPre; + + /** + * Round tracking xml comments for testing convenience + */ + private List formatCommentsPost; + + + public Object getUserData(String name) { + if (userData == null) + return null; + return userData.get(name); + } + + public void setUserData(String name, Object value) { + if (userData == null) + userData = new HashMap(); + userData.put(name, value); + } + + public void setUserDataINN(String name, Object value) { + if (value == null) + return; + + if (userData == null) + userData = new HashMap(); + userData.put(name, value); + } + + public boolean hasUserData(String name) { + if (userData == null) + return false; + else + return userData.containsKey(name); + } + + public String getUserString(String name) { + return (String) getUserData(name); + } + + public int getUserInt(String name) { + if (!hasUserData(name)) + return 0; + return (Integer) getUserData(name); + } + + public boolean hasFormatComment() { + return (formatCommentsPre != null && !formatCommentsPre.isEmpty()) || (formatCommentsPost != null && !formatCommentsPost.isEmpty()); + } + + public List getFormatCommentsPre() { + if (formatCommentsPre == null) + formatCommentsPre = new ArrayList(); + return formatCommentsPre; + } + + public List getFormatCommentsPost() { + if (formatCommentsPost == null) + formatCommentsPost = new ArrayList(); + return formatCommentsPost; + } + + // these 3 allow evaluation engines to get access to primitive values + public boolean isPrimitive() { + return false; + } + + public boolean hasPrimitiveValue() { + return isPrimitive(); + } + + public String primitiveValue() { + return null; + } + + public abstract String fhirType() ; + + public boolean hasType(String... name) { + String t = fhirType(); + for (String n : name) + if (n.equals(t)) + return true; + return false; + } + + protected abstract void listChildren(List result) ; + + public void setProperty(String name, Base value) throws FHIRException { + throw new FHIRException("Attempt to set unknown property "+name); + } + + public Base addChild(String name) throws FHIRException { + throw new FHIRException("Attempt to add child with unknown name "+name); + } + + /** + * Supports iterating the children elements in some generic processor or browser + * All defined children will be listed, even if they have no value on this instance + * + * Note that the actual content of primitive or xhtml elements is not iterated explicitly. + * To find these, the processing code must recognise the element as a primitive, typecast + * the value to a {@link Type}, and examine the value + * + * @return a list of all the children defined for this element + */ + public List children() { + List result = new ArrayList(); + listChildren(result); + return result; + } + + public Property getChildByName(String name) { + List children = new ArrayList(); + listChildren(children); + for (Property c : children) + if (c.getName().equals(name)) + return c; + return null; + } + + public List listChildrenByName(String name) throws FHIRException { + List result = new ArrayList(); + for (Base b : listChildrenByName(name, true)) + if (b != null) + result.add(b); + return result; + } + + public Base[] listChildrenByName(String name, boolean checkValid) throws FHIRException { + if (name.equals("*")) { + List children = new ArrayList(); + listChildren(children); + List result = new ArrayList(); + for (Property c : children) + if (name.equals("*") || c.getName().equals(name) || (c.getName().endsWith("[x]") && c.getName().startsWith(name))) + result.addAll(c.getValues()); + return result.toArray(new Base[result.size()]); + } + else + return getProperty(name.hashCode(), name, checkValid); + } + + public boolean isEmpty() { + return true; // userData does not count + } + + public boolean equalsDeep(Base other) { + return other == this; + } + + public boolean equalsShallow(Base other) { + return other == this; + } + + public static boolean compareDeep(List e1, List e2, boolean allowNull) { + if (noList(e1) && noList(e2) && allowNull) + return true; + if (noList(e1) || noList(e2)) + return false; + if (e1.size() != e2.size()) + return false; + for (int i = 0; i < e1.size(); i++) { + if (!compareDeep(e1.get(i), e2.get(i), allowNull)) + return false; + } + return true; + } + + private static boolean noList(List list) { + return list == null || list.isEmpty(); + } + + public static boolean compareDeep(Base e1, Base e2, boolean allowNull) { + if (e1 == null && e2 == null && allowNull) + return true; + if (e1 == null || e2 == null) + return false; + if (e2.isMetadataBased() && !e1.isMetadataBased()) // respect existing order for debugging consistency; outcome must be the same either way + return e2.equalsDeep(e1); + else + return e1.equalsDeep(e2); + } + + public static boolean compareDeep(XhtmlNode div1, XhtmlNode div2, boolean allowNull) { + if (div1 == null && div2 == null && allowNull) + return true; + if (div1 == null || div2 == null) + return false; + return div1.equalsDeep(div2); + } + + + public static boolean compareValues(List e1, List e2, boolean allowNull) { + if (e1 == null && e2 == null && allowNull) + return true; + if (e1 == null || e2 == null) + return false; + if (e1.size() != e2.size()) + return false; + for (int i = 0; i < e1.size(); i++) { + if (!compareValues(e1.get(i), e2.get(i), allowNull)) + return false; + } + return true; + } + + public static boolean compareValues(PrimitiveType e1, PrimitiveType e2, boolean allowNull) { + if (e1 == null && e2 == null && allowNull) + return true; + if (e1 == null || e2 == null) + return false; + return e1.equalsShallow(e2); + } + + // -- converters for property setters + + + public BooleanType castToBoolean(Base b) throws FHIRException { + if (b instanceof BooleanType) + return (BooleanType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Boolean"); + } + + public IntegerType castToInteger(Base b) throws FHIRException { + if (b instanceof IntegerType) + return (IntegerType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Integer"); + } + + public DecimalType castToDecimal(Base b) throws FHIRException { + if (b instanceof DecimalType) + return (DecimalType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Decimal"); + } + + public Base64BinaryType castToBase64Binary(Base b) throws FHIRException { + if (b instanceof Base64BinaryType) + return (Base64BinaryType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Base64Binary"); + } + + public InstantType castToInstant(Base b) throws FHIRException { + if (b instanceof InstantType) + return (InstantType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Instant"); + } + + public StringType castToString(Base b) throws FHIRException { + if (b instanceof StringType) + return (StringType) b; + else if (b.hasPrimitiveValue()) + return new StringType(b.primitiveValue()); + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a String"); + } + + public UriType castToUri(Base b) throws FHIRException { + if (b instanceof UriType) + return (UriType) b; + else if (b.hasPrimitiveValue()) + return new UriType(b.primitiveValue()); + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Uri"); + } + + public DateType castToDate(Base b) throws FHIRException { + if (b instanceof DateType) + return (DateType) b; + else if (b.hasPrimitiveValue()) + return new DateType(b.primitiveValue()); + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Date"); + } + + public DateTimeType castToDateTime(Base b) throws FHIRException { + if (b instanceof DateTimeType) + return (DateTimeType) b; + else if (b.fhirType().equals("dateTime")) + return new DateTimeType(b.primitiveValue()); + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a DateTime"); + } + + public TimeType castToTime(Base b) throws FHIRException { + if (b instanceof TimeType) + return (TimeType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Time"); + } + + public CodeType castToCode(Base b) throws FHIRException { + if (b instanceof CodeType) + return (CodeType) b; + else if (b.isPrimitive()) + return new CodeType(b.primitiveValue()); + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Code"); + } + + public OidType castToOid(Base b) throws FHIRException { + if (b instanceof OidType) + return (OidType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Oid"); + } + + public IdType castToId(Base b) throws FHIRException { + if (b instanceof IdType) + return (IdType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Id"); + } + + public UnsignedIntType castToUnsignedInt(Base b) throws FHIRException { + if (b instanceof UnsignedIntType) + return (UnsignedIntType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a UnsignedInt"); + } + + public PositiveIntType castToPositiveInt(Base b) throws FHIRException { + if (b instanceof PositiveIntType) + return (PositiveIntType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a PositiveInt"); + } + + public MarkdownType castToMarkdown(Base b) throws FHIRException { + if (b instanceof MarkdownType) + return (MarkdownType) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Markdown"); + } + + public Annotation castToAnnotation(Base b) throws FHIRException { + if (b instanceof Annotation) + return (Annotation) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Annotation"); + } + + public Attachment castToAttachment(Base b) throws FHIRException { + if (b instanceof Attachment) + return (Attachment) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Attachment"); + } + + public Identifier castToIdentifier(Base b) throws FHIRException { + if (b instanceof Identifier) + return (Identifier) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Identifier"); + } + + public CodeableConcept castToCodeableConcept(Base b) throws FHIRException { + if (b instanceof CodeableConcept) + return (CodeableConcept) b; + else if (b instanceof CodeType) { + CodeableConcept cc = new CodeableConcept(); + cc.addCoding().setCode(((CodeType) b).asStringValue()); + return cc; + } else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a CodeableConcept"); + } + + public Coding castToCoding(Base b) throws FHIRException { + if (b instanceof Coding) + return (Coding) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Coding"); + } + + public Quantity castToQuantity(Base b) throws FHIRException { + if (b instanceof Quantity) + return (Quantity) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Quantity"); + } + + public Money castToMoney(Base b) throws FHIRException { + if (b instanceof Money) + return (Money) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Money"); + } + + public Duration castToDuration(Base b) throws FHIRException { + if (b instanceof Duration) + return (Duration) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Duration"); + } + + public SimpleQuantity castToSimpleQuantity(Base b) throws FHIRException { + if (b instanceof SimpleQuantity) + return (SimpleQuantity) b; + else if (b instanceof Quantity) { + Quantity q = (Quantity) b; + SimpleQuantity sq = new SimpleQuantity(); + sq.setValueElement(q.getValueElement()); + sq.setComparatorElement(q.getComparatorElement()); + sq.setUnitElement(q.getUnitElement()); + sq.setSystemElement(q.getSystemElement()); + sq.setCodeElement(q.getCodeElement()); + return sq; + } else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an SimpleQuantity"); + } + + public Range castToRange(Base b) throws FHIRException { + if (b instanceof Range) + return (Range) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Range"); + } + + public Period castToPeriod(Base b) throws FHIRException { + if (b instanceof Period) + return (Period) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Period"); + } + + public Ratio castToRatio(Base b) throws FHIRException { + if (b instanceof Ratio) + return (Ratio) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Ratio"); + } + + public SampledData castToSampledData(Base b) throws FHIRException { + if (b instanceof SampledData) + return (SampledData) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a SampledData"); + } + + public Signature castToSignature(Base b) throws FHIRException { + if (b instanceof Signature) + return (Signature) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Signature"); + } + + public HumanName castToHumanName(Base b) throws FHIRException { + if (b instanceof HumanName) + return (HumanName) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a HumanName"); + } + + public Address castToAddress(Base b) throws FHIRException { + if (b instanceof Address) + return (Address) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Address"); + } + + public ContactPoint castToContactPoint(Base b) throws FHIRException { + if (b instanceof ContactPoint) + return (ContactPoint) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ContactPoint"); + } + + public Timing castToTiming(Base b) throws FHIRException { + if (b instanceof Timing) + return (Timing) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Timing"); + } + + public Reference castToReference(Base b) throws FHIRException { + if (b instanceof Reference) + return (Reference) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Reference"); + } + + public Meta castToMeta(Base b) throws FHIRException { + if (b instanceof Meta) + return (Meta) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Meta"); + } + + public Extension castToExtension(Base b) throws FHIRException { + if (b instanceof Extension) + return (Extension) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Extension"); + } + + public Resource castToResource(Base b) throws FHIRException { + if (b instanceof Resource) + return (Resource) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Resource"); + } + + public Narrative castToNarrative(Base b) throws FHIRException { + if (b instanceof Narrative) + return (Narrative) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Narrative"); + } + + + public ElementDefinition castToElementDefinition(Base b) throws FHIRException { + if (b instanceof ElementDefinition) + return (ElementDefinition) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ElementDefinition"); + } + + public ModuleMetadata castToModuleMetadata(Base b) throws FHIRException { + if (b instanceof ModuleMetadata) + return (ModuleMetadata) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ModuleMetadata"); + } + + public ActionDefinition castToActionDefinition(Base b) throws FHIRException { + if (b instanceof ActionDefinition) + return (ActionDefinition) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ActionDefinition"); + } + + public DataRequirement castToDataRequirement(Base b) throws FHIRException { + if (b instanceof DataRequirement) + return (DataRequirement) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a DataRequirement"); + } + + public ParameterDefinition castToParameterDefinition(Base b) throws FHIRException { + if (b instanceof ParameterDefinition) + return (ParameterDefinition) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ParameterDefinition"); + } + + public TriggerDefinition castToTriggerDefinition(Base b) throws FHIRException { + if (b instanceof TriggerDefinition) + return (TriggerDefinition) b; + else + throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a TriggerDefinition"); + } + + protected boolean isMetadataBased() { + return false; + } + + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + if (checkValid) + throw new FHIRException("Attempt to read invalid property '"+name+"' on type "+fhirType()); + return null; + } + + public void setProperty(int hash, String name, Base value) throws FHIRException { + throw new FHIRException("Attempt to write to invalid property '"+name+"' on type "+fhirType()); + } + + public Base makeProperty(int hash, String name) throws FHIRException { + throw new FHIRException("Attempt to make an invalid property '"+name+"' on type "+fhirType()); + } + + public static boolean equals(String v1, String v2) { + if (v1 == null && v2 == null) + return true; + else if (v1 == null || v2 == null) + return false; + else + return v1.equals(v2); + } + + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Base64BinaryType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Base64BinaryType.java new file mode 100644 index 00000000000..71c954446ce --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Base64BinaryType.java @@ -0,0 +1,76 @@ +/* +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. + + */ +package org.hl7.fhir.dstu2016may.model; + +import org.apache.commons.codec.binary.Base64; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64 + */ +@DatatypeDef(name="base64binary") +public class Base64BinaryType extends PrimitiveType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public Base64BinaryType() { + super(); + } + + public Base64BinaryType(byte[] theBytes) { + super(); + setValue(theBytes); + } + + public Base64BinaryType(String theValue) { + super(); + setValueAsString(theValue); + } + + protected byte[] parse(String theValue) { + return Base64.decodeBase64(theValue); + } + + protected String encode(byte[] theValue) { + return Base64.encodeBase64String(theValue); + } + + @Override + public Base64BinaryType copy() { + return new Base64BinaryType(getValue()); + } + + public String fhirType() { + return "base64Binary"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseBinary.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseBinary.java new file mode 100644 index 00000000000..b5bb8d44364 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseBinary.java @@ -0,0 +1,26 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.instance.model.api.IBaseBinary; + +public abstract class BaseBinary extends Resource implements IBaseBinary { + + private static final long serialVersionUID = 1L; + + @Override + public String getContentAsBase64() { + return getContentElement().getValueAsString(); + } + + @Override + public BaseBinary setContentAsBase64(String theContent) { + if (theContent != null) { + getContentElement().setValueAsString(theContent); + } else { + setContent(null); + } + return this; + } + + abstract Base64BinaryType getContentElement(); + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseDateTimeType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseDateTimeType.java new file mode 100644 index 00000000000..a6287815483 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseDateTimeType.java @@ -0,0 +1,743 @@ +package org.hl7.fhir.dstu2016may.model; + +import static org.apache.commons.lang3.StringUtils.isBlank; + +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +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.parser.DataFormatException; + +public abstract class BaseDateTimeType extends PrimitiveType { + + private static final long serialVersionUID = 1L; + + static final long NANOS_PER_MILLIS = 1000000L; + static final long NANOS_PER_SECOND = 1000000000L; + + private static final FastDateFormat ourHumanDateFormat = FastDateFormat.getDateInstance(FastDateFormat.MEDIUM); + private static final FastDateFormat ourHumanDateTimeFormat = FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM); + + private String myFractionalSeconds; + private TemporalPrecisionEnum myPrecision = null; + private TimeZone myTimeZone; + private boolean myTimeZoneZulu = false; + + /** + * Constructor + */ + public BaseDateTimeType() { + // nothing + } + + /** + * Constructor + * + * @throws DataFormatException + * 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); + } + } + + /** + * Constructor + */ + public BaseDateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimeZone) { + this(theDate, thePrecision); + setTimeZone(theTimeZone); + } + + /** + * Constructor + * + * @throws DataFormatException + * 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); + } + } + + private void clearTimeZone() { + myTimeZone = null; + myTimeZoneZulu = false; + } + + @Override + protected String encode(Date theValue) { + if (theValue == null) { + return null; + } else { + GregorianCalendar cal; + if (myTimeZoneZulu) { + cal = new GregorianCalendar(TimeZone.getTimeZone("GMT")); + } else if (myTimeZone != null) { + cal = new GregorianCalendar(myTimeZone); + } else { + cal = new GregorianCalendar(); + } + cal.setTime(theValue); + + StringBuilder b = new StringBuilder(); + leftPadWithZeros(cal.get(Calendar.YEAR), 4, b); + if (myPrecision.ordinal() > TemporalPrecisionEnum.YEAR.ordinal()) { + b.append('-'); + leftPadWithZeros(cal.get(Calendar.MONTH) + 1, 2, b); + if (myPrecision.ordinal() > TemporalPrecisionEnum.MONTH.ordinal()) { + b.append('-'); + leftPadWithZeros(cal.get(Calendar.DATE), 2, b); + if (myPrecision.ordinal() > TemporalPrecisionEnum.DAY.ordinal()) { + b.append('T'); + leftPadWithZeros(cal.get(Calendar.HOUR_OF_DAY), 2, b); + b.append(':'); + leftPadWithZeros(cal.get(Calendar.MINUTE), 2, b); + if (myPrecision.ordinal() > TemporalPrecisionEnum.MINUTE.ordinal()) { + b.append(':'); + leftPadWithZeros(cal.get(Calendar.SECOND), 2, b); + if (myPrecision.ordinal() > TemporalPrecisionEnum.SECOND.ordinal()) { + b.append('.'); + b.append(myFractionalSeconds); + for (int i = myFractionalSeconds.length(); i < 3; i++) { + b.append('0'); + } + } + } + + if (myTimeZoneZulu) { + b.append('Z'); + } else if (myTimeZone != null) { + int offset = myTimeZone.getOffset(theValue.getTime()); + if (offset >= 0) { + b.append('+'); + } else { + b.append('-'); + offset = Math.abs(offset); + } + + int hoursOffset = (int) (offset / DateUtils.MILLIS_PER_HOUR); + leftPadWithZeros(hoursOffset, 2, b); + b.append(':'); + int minutesOffset = (int) (offset % DateUtils.MILLIS_PER_HOUR); + minutesOffset = (int) (minutesOffset / DateUtils.MILLIS_PER_MINUTE); + leftPadWithZeros(minutesOffset, 2, b); + } + } + } + } + return b.toString(); + } + } + + /** + * Returns the default precision for the given datatype + */ + protected abstract TemporalPrecisionEnum getDefaultPrecisionForDatatype(); + + private int getOffsetIndex(String theValueString) { + int plusIndex = theValueString.indexOf('+', 16); + int minusIndex = theValueString.indexOf('-', 16); + int zIndex = theValueString.indexOf('Z', 16); + int retVal = Math.max(Math.max(plusIndex, minusIndex), zIndex); + if (retVal == -1) { + return -1; + } + if ((retVal - 2) != (plusIndex + minusIndex + zIndex)) { + throwBadDateFormat(theValueString); + } + return retVal; + } + + /** + * Gets the precision for this datatype (using the default for the given type if not set) + * + * @see #setPrecision(TemporalPrecisionEnum) + */ + public TemporalPrecisionEnum getPrecision() { + if (myPrecision == null) { + return getDefaultPrecisionForDatatype(); + } + return myPrecision; + } + + /** + * Returns the TimeZone associated with this dateTime's value. May return null if no timezone was + * supplied. + */ + public TimeZone getTimeZone() { + if (myTimeZoneZulu) { + return TimeZone.getTimeZone("Z"); + } + return myTimeZone; + } + + /** + * Returns the value of this object as a {@link GregorianCalendar} + */ + public GregorianCalendar getValueAsCalendar() { + if (getValue() == null) { + return null; + } + GregorianCalendar cal; + if (getTimeZone() != null) { + cal = new GregorianCalendar(getTimeZone()); + } else { + cal = new GregorianCalendar(); + } + cal.setTime(getValue()); + return cal; + } + + /** + * To be implemented by subclasses to indicate whether the given precision is allowed by this type + */ + abstract boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision); + + /** + * Returns true if the timezone is set to GMT-0:00 (Z) + */ + public boolean isTimeZoneZulu() { + return myTimeZoneZulu; + } + + /** + * Returns true if this object represents a date that is today's date + * + * @throws NullPointerException + * if {@link #getValue()} returns null + */ + public boolean isToday() { + Validate.notNull(getValue(), getClass().getSimpleName() + " contains null value"); + return DateUtils.isSameDay(new Date(), getValue()); + } + + private void leftPadWithZeros(int theInteger, int theLength, StringBuilder theTarget) { + String string = Integer.toString(theInteger); + for (int i = string.length(); i < theLength; i++) { + theTarget.append('0'); + } + theTarget.append(string); + } + + @Override + protected Date parse(String theValue) throws DataFormatException { + Calendar cal = new GregorianCalendar(0, 0, 0); + cal.setTimeZone(TimeZone.getDefault()); + String value = theValue; + boolean fractionalSecondsSet = false; + + if (value.length() > 0 && (value.charAt(0) == ' ' || value.charAt(value.length() - 1) == ' ')) { + value = value.trim(); + } + + int length = value.length(); + if (length == 0) { + return null; + } + + if (length < 4) { + throwBadDateFormat(value); + } + + TemporalPrecisionEnum precision = null; + cal.set(Calendar.YEAR, parseInt(value, value.substring(0, 4), 0, 9999)); + precision = TemporalPrecisionEnum.YEAR; + if (length > 4) { + validateCharAtIndexIs(value, 4, '-'); + validateLengthIsAtLeast(value, 7); + int monthVal = parseInt(value, value.substring(5, 7), 1, 12) - 1; + cal.set(Calendar.MONTH, monthVal); + precision = TemporalPrecisionEnum.MONTH; + if (length > 7) { + validateCharAtIndexIs(value, 7, '-'); + validateLengthIsAtLeast(value, 10); + cal.set(Calendar.DATE, 1); // for some reason getActualMaximum works incorrectly if date isn't set + int actualMaximum = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + cal.set(Calendar.DAY_OF_MONTH, parseInt(value, value.substring(8, 10), 1, actualMaximum)); + precision = TemporalPrecisionEnum.DAY; + if (length > 10) { + validateLengthIsAtLeast(value, 17); + validateCharAtIndexIs(value, 10, 'T'); // yyyy-mm-ddThh:mm:ss + int offsetIdx = getOffsetIndex(value); + String time; + if (offsetIdx == -1) { + //throwBadDateFormat(theValue); + // No offset - should this be an error? + time = value.substring(11); + } else { + time = value.substring(11, offsetIdx); + String offsetString = value.substring(offsetIdx); + setTimeZone(value, offsetString); + cal.setTimeZone(getTimeZone()); + } + int timeLength = time.length(); + + validateCharAtIndexIs(value, 13, ':'); + cal.set(Calendar.HOUR_OF_DAY, parseInt(value, value.substring(11, 13), 0, 23)); + cal.set(Calendar.MINUTE, parseInt(value, value.substring(14, 16), 0, 59)); + precision = TemporalPrecisionEnum.MINUTE; + if (timeLength > 5) { + validateLengthIsAtLeast(value, 19); + validateCharAtIndexIs(value, 16, ':'); // yyyy-mm-ddThh:mm:ss + cal.set(Calendar.SECOND, parseInt(value, value.substring(17, 19), 0, 59)); + precision = TemporalPrecisionEnum.SECOND; + if (timeLength > 8) { + validateCharAtIndexIs(value, 19, '.'); // yyyy-mm-ddThh:mm:ss.SSSS + validateLengthIsAtLeast(value, 20); + int endIndex = getOffsetIndex(value); + if (endIndex == -1) { + endIndex = value.length(); + } + int millis; + String millisString; + if (endIndex > 23) { + myFractionalSeconds = value.substring(20, endIndex); + fractionalSecondsSet = true; + endIndex = 23; + millisString = value.substring(20, endIndex); + millis = parseInt(value, millisString, 0, 999); + } else { + millisString = value.substring(20, endIndex); + millis = parseInt(value, millisString, 0, 999); + myFractionalSeconds = millisString; + fractionalSecondsSet = true; + } + if (millisString.length() == 1) { + millis = millis * 100; + } else if (millisString.length() == 2) { + millis = millis * 10; + } + cal.set(Calendar.MILLISECOND, millis); + precision = TemporalPrecisionEnum.MILLI; + } + } + } + } else { + cal.set(Calendar.DATE, 1); + } + } else { + cal.set(Calendar.DATE, 1); + } + + if (fractionalSecondsSet == false) { + myFractionalSeconds = ""; + } + + myPrecision = precision; + return cal.getTime(); + + } + + private int parseInt(String theValue, String theSubstring, int theLowerBound, int theUpperBound) { + int retVal = 0; + try { + retVal = Integer.parseInt(theSubstring); + } catch (NumberFormatException e) { + throwBadDateFormat(theValue); + } + + if (retVal < theLowerBound || retVal > theUpperBound) { + throwBadDateFormat(theValue); + } + + return retVal; + } + + /** + * Sets the precision for this datatype + * + * @throws DataFormatException + */ + public void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException { + if (thePrecision == null) { + throw new NullPointerException("Precision may not be null"); + } + myPrecision = thePrecision; + updateStringValue(); + } + + private BaseDateTimeType setTimeZone(String theWholeValue, String theValue) { + + if (isBlank(theValue)) { + throwBadDateFormat(theWholeValue); + } else if (theValue.charAt(0) == 'Z') { + myTimeZone = null; + myTimeZoneZulu = true; + } else if (theValue.length() != 6) { + throwBadDateFormat(theWholeValue, "Timezone offset must be in the form \"Z\", \"-HH:mm\", or \"+HH:mm\""); + } else if (theValue.charAt(3) != ':' || !(theValue.charAt(0) == '+' || theValue.charAt(0) == '-')) { + throwBadDateFormat(theWholeValue, "Timezone offset must be in the form \"Z\", \"-HH:mm\", or \"+HH:mm\""); + } else { + parseInt(theWholeValue, theValue.substring(1, 3), 0, 23); + parseInt(theWholeValue, theValue.substring(4, 6), 0, 59); + myTimeZoneZulu = false; + myTimeZone = TimeZone.getTimeZone("GMT" + theValue); + } + + return this; + } + + public BaseDateTimeType setTimeZone(TimeZone theTimeZone) { + myTimeZone = theTimeZone; + myTimeZoneZulu = false; + updateStringValue(); + return this; + } + + public BaseDateTimeType setTimeZoneZulu(boolean theTimeZoneZulu) { + myTimeZoneZulu = theTimeZoneZulu; + myTimeZone = null; + updateStringValue(); + return this; + } + + /** + * Sets the value for this type using the given Java Date object as the time, and using the default precision for + * this datatype (unless the precision is already set), as well as the local timezone as determined by the local operating + * system. Both of these properties may be modified in subsequent calls if neccesary. + */ + @Override + public BaseDateTimeType setValue(Date theValue) { + setValue(theValue, getPrecision()); + return this; + } + + /** + * Sets the value for this type using the given Java Date object as the time, and using the specified precision, as + * well as the local timezone as determined by the local operating system. Both of + * these properties may be modified in subsequent calls if neccesary. + * + * @param theValue + * The date value + * @param thePrecision + * The precision + * @throws DataFormatException + */ + public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException { + if (getTimeZone() == null) { + setTimeZone(TimeZone.getDefault()); + } + myPrecision = thePrecision; + myFractionalSeconds = ""; + if (theValue != null) { + long millis = theValue.getTime() % 1000; + if (millis < 0) { + // This is for times before 1970 (see bug #444) + millis = 1000 + millis; + } + String fractionalSeconds = Integer.toString((int) millis); + myFractionalSeconds = StringUtils.leftPad(fractionalSeconds, 3, '0'); + } + super.setValue(theValue); + } + + @Override + public void setValueAsString(String theValue) throws DataFormatException { + clearTimeZone(); + super.setValueAsString(theValue); + } + + private void throwBadDateFormat(String theValue) { + throw new DataFormatException("Invalid date/time format: \"" + theValue + "\""); + } + + private void throwBadDateFormat(String theValue, String theMesssage) { + throw new DataFormatException("Invalid date/time format: \"" + theValue + "\": " + theMesssage); + } + + /** + * Returns a human readable version of this date/time using the system local format. + *

+ * Note on time zones: This method renders the value using the time zone that is contained within the value. + * For example, if this date object contains the value "2012-01-05T12:00:00-08:00", + * the human display will be rendered as "12:00:00" even if the application is being executed on a system in a + * different time zone. If this behaviour is not what you want, use + * {@link #toHumanDisplayLocalTimezone()} instead. + *

+ */ + public String toHumanDisplay() { + TimeZone tz = getTimeZone(); + Calendar value = tz != null ? Calendar.getInstance(tz) : Calendar.getInstance(); + value.setTime(getValue()); + + switch (getPrecision()) { + case YEAR: + case MONTH: + case DAY: + return ourHumanDateFormat.format(value); + case MILLI: + case SECOND: + default: + return ourHumanDateTimeFormat.format(value); + } + } + + /** + * Returns a human readable version of this date/time using the system local format, converted to the local timezone + * if neccesary. + * + * @see #toHumanDisplay() for a method which does not convert the time to the local timezone before rendering it. + */ + public String toHumanDisplayLocalTimezone() { + switch (getPrecision()) { + case YEAR: + case MONTH: + case DAY: + return ourHumanDateFormat.format(getValue()); + case MILLI: + case SECOND: + default: + return ourHumanDateTimeFormat.format(getValue()); + } + } + + private void validateCharAtIndexIs(String theValue, int theIndex, char theChar) { + if (theValue.charAt(theIndex) != theChar) { + throwBadDateFormat(theValue, "Expected character '" + theChar + "' at index " + theIndex + " but found " + theValue.charAt(theIndex)); + } + } + + private void validateLengthIsAtLeast(String theValue, int theLength) { + if (theValue.length() < theLength) { + throwBadDateFormat(theValue); + } + } + + /** + * Returns the year, e.g. 2015 + */ + public Integer getYear() { + return getFieldValue(Calendar.YEAR); + } + + /** + * Returns the month with 0-index, e.g. 0=January + */ + public Integer getMonth() { + return getFieldValue(Calendar.MONTH); + } + + /** + * Returns the month with 1-index, e.g. 1=the first day of the month + */ + public Integer getDay() { + return getFieldValue(Calendar.DAY_OF_MONTH); + } + + /** + * Returns the hour of the day in a 24h clock, e.g. 13=1pm + */ + public Integer getHour() { + return getFieldValue(Calendar.HOUR_OF_DAY); + } + + /** + * Returns the minute of the hour in the range 0-59 + */ + public Integer getMinute() { + return getFieldValue(Calendar.MINUTE); + } + + /** + * Returns the second of the minute in the range 0-59 + */ + public Integer getSecond() { + return getFieldValue(Calendar.SECOND); + } + + /** + * Returns the milliseconds within the current second. + *

+ * Note that this method returns the + * same value as {@link #getNanos()} but with less precision. + *

+ */ + public Integer getMillis() { + return getFieldValue(Calendar.MILLISECOND); + } + + /** + * Returns the nanoseconds within the current second + *

+ * Note that this method returns the + * same value as {@link #getMillis()} but with more precision. + *

+ */ + public Long getNanos() { + if (isBlank(myFractionalSeconds)) { + return null; + } + String retVal = StringUtils.rightPad(myFractionalSeconds, 9, '0'); + retVal = retVal.substring(0, 9); + return Long.parseLong(retVal); + } + + /** + * Sets the year, e.g. 2015 + */ + public BaseDateTimeType setYear(int theYear) { + setFieldValue(Calendar.YEAR, theYear, null, 0, 9999); + return this; + } + + /** + * Sets the month with 0-index, e.g. 0=January + */ + public BaseDateTimeType setMonth(int theMonth) { + setFieldValue(Calendar.MONTH, theMonth, null, 0, 11); + return this; + } + + /** + * Sets the month with 1-index, e.g. 1=the first day of the month + */ + public BaseDateTimeType setDay(int theDay) { + setFieldValue(Calendar.DAY_OF_MONTH, theDay, null, 0, 31); + return this; + } + + /** + * Sets the hour of the day in a 24h clock, e.g. 13=1pm + */ + public BaseDateTimeType setHour(int theHour) { + setFieldValue(Calendar.HOUR_OF_DAY, theHour, null, 0, 23); + return this; + } + + /** + * Sets the minute of the hour in the range 0-59 + */ + public BaseDateTimeType setMinute(int theMinute) { + setFieldValue(Calendar.MINUTE, theMinute, null, 0, 59); + return this; + } + + /** + * Sets the second of the minute in the range 0-59 + */ + public BaseDateTimeType setSecond(int theSecond) { + setFieldValue(Calendar.SECOND, theSecond, null, 0, 59); + return this; + } + + /** + * Sets the milliseconds within the current second. + *

+ * Note that this method sets the + * same value as {@link #setNanos(long)} but with less precision. + *

+ */ + public BaseDateTimeType setMillis(int theMillis) { + setFieldValue(Calendar.MILLISECOND, theMillis, null, 0, 999); + return this; + } + + /** + * Sets the nanoseconds within the current second + *

+ * Note that this method sets the + * same value as {@link #setMillis(int)} but with more precision. + *

+ */ + public BaseDateTimeType setNanos(long theNanos) { + validateValueInRange(theNanos, 0, NANOS_PER_SECOND-1); + String fractionalSeconds = StringUtils.leftPad(Long.toString(theNanos), 9, '0'); + + // Strip trailing 0s + for (int i = fractionalSeconds.length(); i > 0; i--) { + if (fractionalSeconds.charAt(i-1) != '0') { + fractionalSeconds = fractionalSeconds.substring(0, i); + break; + } + } + int millis = (int)(theNanos / NANOS_PER_MILLIS); + setFieldValue(Calendar.MILLISECOND, millis, fractionalSeconds, 0, 999); + return this; + } + + private void setFieldValue(int theField, int theValue, String theFractionalSeconds, int theMinimum, int theMaximum) { + validateValueInRange(theValue, theMinimum, theMaximum); + Calendar cal; + if (getValue() == null) { + cal = new GregorianCalendar(0, 0, 0); + } else { + cal = getValueAsCalendar(); + } + if (theField != -1) { + cal.set(theField, theValue); + } + if (theFractionalSeconds != null) { + myFractionalSeconds = theFractionalSeconds; + } else if (theField == Calendar.MILLISECOND) { + myFractionalSeconds = StringUtils.leftPad(Integer.toString(theValue), 3, '0'); + } + super.setValue(cal.getTime()); + } + + private void validateValueInRange(long theValue, long theMinimum, long theMaximum) { + if (theValue < theMinimum || theValue > theMaximum) { + throw new IllegalArgumentException("Value " + theValue + " is not between allowable range: " + theMinimum + " - " + theMaximum); + } + } + + private Integer getFieldValue(int theField) { + if (getValue() == null) { + return null; + } + Calendar cal = getValueAsCalendar(); + return cal.get(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 (b.length() == 16) + b.append(":00"); // schema rule, must have seconds + 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-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseExtension.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseExtension.java new file mode 100644 index 00000000000..e0ef3df9f87 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseExtension.java @@ -0,0 +1,17 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.instance.model.api.IBaseDatatype; +import org.hl7.fhir.instance.model.api.IBaseExtension; +import org.hl7.fhir.instance.model.api.IBaseHasExtensions; + +public abstract class BaseExtension extends Type implements IBaseExtension, IBaseHasExtensions { + + @Override + public Extension setValue(IBaseDatatype theValue) { + setValue((Type)theValue); + return (Extension) this; + } + + public abstract Extension setValue(Type theValue); + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseNarrative.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseNarrative.java new file mode 100644 index 00000000000..e8ca75ac774 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseNarrative.java @@ -0,0 +1,50 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.api.INarrative; +import org.hl7.fhir.utilities.xhtml.XhtmlNode; + +public abstract class BaseNarrative extends Type implements INarrative { + + /** + * Sets the value of + * + * @param theString + * @throws Exception + */ + public void setDivAsString(String theString) { + XhtmlNode div; + if (StringUtils.isNotBlank(theString)) { + div = new XhtmlNode(); + div.setValueAsString(theString); + } else { + div = null; + } + setDiv(div); + } + + protected abstract BaseNarrative setDiv(XhtmlNode theDiv); + + public String getDivAsString() { + XhtmlNode div = getDiv(); + if (div != null && !div.isEmpty()) { + return div.getValueAsString(); + } else { + return null; + } + } + + protected abstract XhtmlNode getDiv(); + + public abstract Enumeration getStatusElement(); + + public INarrative setStatusAsString(String theString) { + getStatusElement().setValueAsString(theString); + return this; + } + + public String getStatusAsString() { + return getStatusElement().getValueAsString(); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseReference.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseReference.java new file mode 100644 index 00000000000..42c8869c99e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseReference.java @@ -0,0 +1,65 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.instance.model.api.IAnyResource; +import org.hl7.fhir.instance.model.api.IBaseReference; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.instance.model.api.IIdType; + +public abstract class BaseReference extends Type implements IBaseReference, ICompositeType { + + /** + * This is not a part of the "wire format" resource, but can be changed/accessed by parsers + */ + private transient IBaseResource resource; + + public BaseReference(String theReference) { + setReference(theReference); + } + + public BaseReference(IIdType theReference) { + if (theReference != null) { + setReference(theReference.getValue()); + } else { + setReference(null); + } + } + + public BaseReference(IAnyResource theResource) { + resource = theResource; + } + + public BaseReference() { + } + + /** + * Retrieves the actual resource referenced by this reference. Note that the resource itself is not + * a part of the FHIR "wire format" and is never transmitted or receieved inline, but this property + * may be changed/accessed by parsers. + */ + public IBaseResource getResource() { + return resource; + } + + @Override + public IIdType getReferenceElement() { + return new IdType(getReference()); + } + + abstract String getReference(); + + /** + * Sets the actual resource referenced by this reference. Note that the resource itself is not + * a part of the FHIR "wire format" and is never transmitted or receieved inline, but this property + * may be changed/accessed by parsers. + */ + public void setResource(IBaseResource theResource) { + resource = theResource; + } + + @Override + public boolean isEmpty() { + return resource == null && super.isEmpty(); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseResource.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseResource.java new file mode 100644 index 00000000000..acca64c20ac --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BaseResource.java @@ -0,0 +1,33 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.instance.model.api.IAnyResource; +import org.hl7.fhir.instance.model.api.IIdType; + +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.model.api.IElement; + +public abstract class BaseResource extends Base implements IAnyResource, IElement { + + private static final long serialVersionUID = 1L; + + /** + * @param value The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. + */ + public BaseResource setId(IIdType value) { + if (value == null) { + setIdElement((IdType)null); + } else if (value instanceof IdType) { + setIdElement((IdType) value); + } else { + setIdElement(new IdType(value.getValue())); + } + return this; + } + + public abstract BaseResource setIdElement(IdType theIdType); + + @Override + public FhirVersionEnum getStructureFhirVersionEnum() { + return FhirVersionEnum.DSTU2_1; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Basic.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Basic.java new file mode 100644 index 00000000000..4de8152c277 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Basic.java @@ -0,0 +1,596 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. + */ +@ResourceDef(name="Basic", profile="http://hl7.org/fhir/Profile/Basic") +public class Basic extends DomainResource { + + /** + * Identifier assigned to the resource for business purposes, outside the context of FHIR. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." ) + protected List identifier; + + /** + * Identifies the 'type' of resource - equivalent to the resource name for other resources. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="Kind of Resource", formalDefinition="Identifies the 'type' of resource - equivalent to the resource name for other resources." ) + protected CodeableConcept code; + + /** + * Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource. + */ + @Child(name = "subject", type = {}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifies the focus of this resource", formalDefinition="Identifies the patient, practitioner, device or any other resource that is the \"focus\" of this resource." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) + */ + protected Resource subjectTarget; + + /** + * Identifies when the resource was first created. + */ + @Child(name = "created", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When created", formalDefinition="Identifies when the resource was first created." ) + protected DateType created; + + /** + * Indicates who was responsible for creating the resource instance. + */ + @Child(name = "author", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who created", formalDefinition="Indicates who was responsible for creating the resource instance." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Indicates who was responsible for creating the resource instance.) + */ + protected Resource authorTarget; + + private static final long serialVersionUID = 650756402L; + + /** + * Constructor + */ + public Basic() { + super(); + } + + /** + * Constructor + */ + public Basic(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) + */ + 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 assigned to the resource for business purposes, outside the context of FHIR.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Basic addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) + */ + public Basic setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) + */ + public Basic 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) + */ + public Resource getSubjectTarget() { + 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) + */ + public Basic setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateType(); // bb + 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} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public Basic setCreatedElement(DateType value) { + this.created = value; + return this; + } + + /** + * @return Identifies when the resource was first created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value Identifies when the resource was first created. + */ + public Basic setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Indicates who was responsible for creating the resource instance.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Indicates who was responsible for creating the resource instance.) + */ + public Basic setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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. (Indicates who was responsible for creating the resource instance.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} 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. (Indicates who was responsible for creating the resource instance.) + */ + public Basic setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the resource for business purposes, outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Identifies the 'type' of resource - equivalent to the resource name for other resources.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Any)", "Identifies the patient, practitioner, device or any other resource that is the \"focus\" of this resource.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("created", "date", "Identifies when the resource was first created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("author", "Reference(Practitioner|Patient|RelatedPerson)", "Indicates who was responsible for creating the resource instance.", 0, java.lang.Integer.MAX_VALUE, author)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateType + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 1028554472: // created + this.created = castToDate(value); // DateType + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("created")) + this.created = castToDate(value); // DateType + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 3059181: return getCode(); // CodeableConcept + case -1867885268: return getSubject(); // Reference + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateType + case -1406328437: return getAuthor(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type Basic.created"); + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Basic"; + + } + + public Basic copy() { + Basic dst = new Basic(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.created = created == null ? null : created.copy(); + dst.author = author == null ? null : author.copy(); + return dst; + } + + protected Basic typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Basic)) + return false; + Basic o = (Basic) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) + && compareDeep(created, o.created, true) && compareDeep(author, o.author, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Basic)) + return false; + Basic o = (Basic) other; + return compareValues(created, o.created, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (subject == null || subject.isEmpty()) && (created == null || created.isEmpty()) && (author == null || author.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Basic; + } + + /** + * Search parameter: author + *

+ * Description: Who created
+ * Type: reference
+ * Path: Basic.author
+ *

+ */ + @SearchParamDefinition(name="author", path="Basic.author", description="Who created", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: Who created
+ * Type: reference
+ * Path: Basic.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Basic:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Basic:author").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: Identifies the focus of this resource
+ * Type: reference
+ * Path: Basic.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Basic.subject", description="Identifies the focus of this resource", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Identifies the focus of this resource
+ * Type: reference
+ * Path: Basic.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Basic:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Basic:patient").toLocked(); + + /** + * Search parameter: created + *

+ * Description: When created
+ * Type: date
+ * Path: Basic.created
+ *

+ */ + @SearchParamDefinition(name="created", path="Basic.created", description="When created", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: When created
+ * Type: date
+ * Path: Basic.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: subject + *

+ * Description: Identifies the focus of this resource
+ * Type: reference
+ * Path: Basic.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Basic.subject", description="Identifies the focus of this resource", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Identifies the focus of this resource
+ * Type: reference
+ * Path: Basic.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Basic:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Basic:subject").toLocked(); + + /** + * Search parameter: code + *

+ * Description: Kind of Resource
+ * Type: token
+ * Path: Basic.code
+ *

+ */ + @SearchParamDefinition(name="code", path="Basic.code", description="Kind of Resource", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Kind of Resource
+ * Type: token
+ * Path: Basic.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: identifier + *

+ * Description: Business identifier
+ * Type: token
+ * Path: Basic.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Basic.identifier", description="Business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Business identifier
+ * Type: token
+ * Path: Basic.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Binary.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Binary.java new file mode 100644 index 00000000000..f6161f92f09 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Binary.java @@ -0,0 +1,301 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBinary; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + */ +@ResourceDef(name="Binary", profile="http://hl7.org/fhir/Profile/Binary") +public class Binary extends BaseBinary implements IBaseBinary { + + /** + * MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + @Child(name = "contentType", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="MimeType of the binary content", formalDefinition="MimeType of the binary content represented as a standard MimeType (BCP 13)." ) + protected CodeType contentType; + + /** + * The actual content, base64 encoded. + */ + @Child(name = "content", type = {Base64BinaryType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." ) + protected Base64BinaryType content; + + private static final long serialVersionUID = 974764407L; + + /** + * Constructor + */ + public Binary() { + super(); + } + + /** + * Constructor + */ + public Binary(CodeType contentType, Base64BinaryType content) { + super(); + this.contentType = contentType; + this.content = content; + } + + /** + * @return {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public CodeType getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Binary.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new CodeType(); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Binary setContentTypeElement(CodeType value) { + this.contentType = value; + return this; + } + + /** + * @return MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + public String getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + public Binary setContentType(String value) { + if (this.contentType == null) + this.contentType = new CodeType(); + this.contentType.setValue(value); + return this; + } + + /** + * @return {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value + */ + public Base64BinaryType getContentElement() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Binary.content"); + else if (Configuration.doAutoCreate()) + this.content = new Base64BinaryType(); // bb + return this.content; + } + + public boolean hasContentElement() { + return this.content != null && !this.content.isEmpty(); + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value + */ + public Binary setContentElement(Base64BinaryType value) { + this.content = value; + return this; + } + + /** + * @return The actual content, base64 encoded. + */ + public byte[] getContent() { + return this.content == null ? null : this.content.getValue(); + } + + /** + * @param value The actual content, base64 encoded. + */ + public Binary setContent(byte[] value) { + if (this.content == null) + this.content = new Base64BinaryType(); + this.content.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("contentType", "code", "MimeType of the binary content represented as a standard MimeType (BCP 13).", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("content", "base64Binary", "The actual content, base64 encoded.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType + case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Base64BinaryType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -389131437: // contentType + this.contentType = castToCode(value); // CodeType + break; + case 951530617: // content + this.content = castToBase64Binary(value); // Base64BinaryType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("contentType")) + this.contentType = castToCode(value); // CodeType + else if (name.equals("content")) + this.content = castToBase64Binary(value); // Base64BinaryType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType + case 951530617: throw new FHIRException("Cannot make property content as it is not a complex type"); // Base64BinaryType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("contentType")) { + throw new FHIRException("Cannot call addChild on a primitive type Binary.contentType"); + } + else if (name.equals("content")) { + throw new FHIRException("Cannot call addChild on a primitive type Binary.content"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Binary"; + + } + + public Binary copy() { + Binary dst = new Binary(); + copyValues(dst); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.content = content == null ? null : content.copy(); + return dst; + } + + protected Binary typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Binary)) + return false; + Binary o = (Binary) other; + return compareDeep(contentType, o.contentType, true) && compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Binary)) + return false; + Binary o = (Binary) other; + return compareValues(contentType, o.contentType, true) && compareValues(content, o.content, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (content == null || content.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Binary; + } + + /** + * Search parameter: contenttype + *

+ * Description: MimeType of the binary content
+ * Type: token
+ * Path: Binary.contentType
+ *

+ */ + @SearchParamDefinition(name="contenttype", path="Binary.contentType", description="MimeType of the binary content", type="token" ) + public static final String SP_CONTENTTYPE = "contenttype"; + /** + * Fluent Client search parameter constant for contenttype + *

+ * Description: MimeType of the binary content
+ * Type: token
+ * Path: Binary.contentType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTENTTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTENTTYPE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BodySite.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BodySite.java new file mode 100644 index 00000000000..608c81c22fc --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BodySite.java @@ -0,0 +1,592 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + */ +@ResourceDef(name="BodySite", profile="http://hl7.org/fhir/Profile/BodySite") +public class BodySite extends DomainResource { + + /** + * The person to which the body site belongs. + */ + @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient", formalDefinition="The person to which the body site belongs." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person to which the body site belongs.) + */ + protected Patient patientTarget; + + /** + * Identifier for this instance of the anatomical location. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Bodysite identifier", formalDefinition="Identifier for this instance of the anatomical location." ) + protected List identifier; + + /** + * Named anatomical location - ideally coded where possible. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Named anatomical location", formalDefinition="Named anatomical location - ideally coded where possible." ) + protected CodeableConcept code; + + /** + * Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane. + */ + @Child(name = "modifier", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Modification to location code", formalDefinition="Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane." ) + protected List modifier; + + /** + * Description of anatomical location. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The Description of anatomical location", formalDefinition="Description of anatomical location." ) + protected StringType description; + + /** + * Image or images used to identify a location. + */ + @Child(name = "image", type = {Attachment.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Attached images", formalDefinition="Image or images used to identify a location." ) + protected List image; + + private static final long serialVersionUID = 1568109920L; + + /** + * Constructor + */ + public BodySite() { + super(); + } + + /** + * Constructor + */ + public BodySite(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #patient} (The person to which the body site belongs.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BodySite.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person to which the body site belongs.) + */ + public BodySite 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 person to which the body site belongs.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BodySite.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 person to which the body site belongs.) + */ + public BodySite setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifier for this instance of the anatomical location.) + */ + 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 this instance of the anatomical location.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public BodySite addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #code} (Named anatomical location - ideally coded where possible.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BodySite.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Named anatomical location - ideally coded where possible.) + */ + public BodySite setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #modifier} (Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (CodeableConcept item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.) + */ + // syntactic sugar + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + // syntactic sugar + public BodySite addModifier(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return this; + } + + /** + * @return {@link #description} (Description of anatomical location.). 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 BodySite.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Description of anatomical location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public BodySite setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Description of anatomical location. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Description of anatomical location. + */ + public BodySite 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 #image} (Image or images used to identify a location.) + */ + public List getImage() { + if (this.image == null) + this.image = new ArrayList(); + return this.image; + } + + public boolean hasImage() { + if (this.image == null) + return false; + for (Attachment item : this.image) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #image} (Image or images used to identify a location.) + */ + // syntactic sugar + public Attachment addImage() { //3 + Attachment t = new Attachment(); + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return t; + } + + // syntactic sugar + public BodySite addImage(Attachment t) { //3 + if (t == null) + return this; + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "The person to which the body site belongs.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("identifier", "Identifier", "Identifier for this instance of the anatomical location.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Named anatomical location - ideally coded where possible.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("modifier", "CodeableConcept", "Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("description", "string", "Description of anatomical location.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("image", "Attachment", "Image or images used to identify a location.", 0, java.lang.Integer.MAX_VALUE, image)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 100313435: /*image*/ return this.image == null ? new Base[0] : this.image.toArray(new Base[this.image.size()]); // Attachment + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -615513385: // modifier + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 100313435: // image + this.getImage().add(castToAttachment(value)); // Attachment + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("modifier")) + this.getModifier().add(castToCodeableConcept(value)); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("image")) + this.getImage().add(castToAttachment(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -791418107: return getPatient(); // Reference + case -1618432855: return addIdentifier(); // Identifier + case 3059181: return getCode(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 100313435: return addImage(); // Attachment + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("modifier")) { + return addModifier(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type BodySite.description"); + } + else if (name.equals("image")) { + return addImage(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "BodySite"; + + } + + public BodySite copy() { + BodySite dst = new BodySite(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + if (modifier != null) { + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) + dst.modifier.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (image != null) { + dst.image = new ArrayList(); + for (Attachment i : image) + dst.image.add(i.copy()); + }; + return dst; + } + + protected BodySite typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BodySite)) + return false; + BodySite o = (BodySite) other; + return compareDeep(patient, o.patient, true) && compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) + && compareDeep(modifier, o.modifier, true) && compareDeep(description, o.description, true) && compareDeep(image, o.image, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BodySite)) + return false; + BodySite o = (BodySite) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (code == null || code.isEmpty()) && (modifier == null || modifier.isEmpty()) && (description == null || description.isEmpty()) + && (image == null || image.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.BodySite; + } + + /** + * Search parameter: patient + *

+ * Description: Patient to whom bodysite belongs
+ * Type: reference
+ * Path: BodySite.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="BodySite.patient", description="Patient to whom bodysite belongs", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Patient to whom bodysite belongs
+ * Type: reference
+ * Path: BodySite.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "BodySite:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("BodySite:patient").toLocked(); + + /** + * Search parameter: code + *

+ * Description: Named anatomical location
+ * Type: token
+ * Path: BodySite.code
+ *

+ */ + @SearchParamDefinition(name="code", path="BodySite.code", description="Named anatomical location", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Named anatomical location
+ * Type: token
+ * Path: BodySite.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: identifier + *

+ * Description: Identifier for this instance of the anatomical location
+ * Type: token
+ * Path: BodySite.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="BodySite.identifier", description="Identifier for this instance of the anatomical location", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Identifier for this instance of the anatomical location
+ * Type: token
+ * Path: BodySite.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BooleanType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BooleanType.java new file mode 100644 index 00000000000..422789ff384 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/BooleanType.java @@ -0,0 +1,102 @@ +/* +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. + + */ +/** + * + */ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.instance.model.api.IBaseBooleanDatatype; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "boolean" in FHIR "true" or "false" + */ +@DatatypeDef(name = "boolean") +public class BooleanType extends PrimitiveType implements IBaseBooleanDatatype { + + private static final long serialVersionUID = 3L; + + public BooleanType() { + super(); + } + + public BooleanType(boolean theBoolean) { + super(); + setValue(theBoolean); + } + + public BooleanType(Boolean theBoolean) { + super(); + setValue(theBoolean); + } + + public BooleanType(String value) { + super(); + setValueAsString(value); + } + + /** + * Returns the value of this type as a primitive boolean. + * + * @return Returns the value of this type as a primitive boolean. + * @throws NullPointerException + * If the value is not set + */ + public boolean booleanValue() { + return getValue().booleanValue(); + } + + public BooleanType copy() { + return new BooleanType(getValue()); + } + + protected String encode(Boolean theValue) { + if (Boolean.TRUE.equals(theValue)) { + return "true"; + } else { + return "false"; + } + } + + public String fhirType() { + return "boolean"; + } + + protected Boolean parse(String theValue) { + String value = theValue.trim(); + if ("true".equals(value)) { + return Boolean.TRUE; + } else if ("false".equals(value)) { + return Boolean.FALSE; + } else { + throw new IllegalArgumentException("Invalid boolean string: '" + theValue + "'"); + } + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Bundle.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Bundle.java new file mode 100644 index 00000000000..16ea314faed --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Bundle.java @@ -0,0 +1,2789 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.instance.model.api.IBaseBundle; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A container for a collection of resources. + */ +@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle") +public class Bundle extends Resource implements IBaseBundle { + + public enum BundleType { + /** + * The bundle is a document. The first resource is a Composition. + */ + DOCUMENT, + /** + * The bundle is a message. The first resource is a MessageHeader. + */ + MESSAGE, + /** + * The bundle is a transaction - intended to be processed by a server as an atomic commit. + */ + TRANSACTION, + /** + * The bundle is a transaction response. Because the response is a transaction response, the transactionhas succeeded, and all responses are error free. + */ + TRANSACTIONRESPONSE, + /** + * The bundle is a transaction - intended to be processed by a server as a group of actions. + */ + BATCH, + /** + * The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success. + */ + BATCHRESPONSE, + /** + * The bundle is a list of resources from a history interaction on a server. + */ + HISTORY, + /** + * The bundle is a list of resources returned as a result of a search/query interaction, operation, or message. + */ + SEARCHSET, + /** + * The bundle is a set of resources collected into a single document for ease of distribution. + */ + COLLECTION, + /** + * added to help the parsers + */ + NULL; + public static BundleType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("document".equals(codeString)) + return DOCUMENT; + if ("message".equals(codeString)) + return MESSAGE; + if ("transaction".equals(codeString)) + return TRANSACTION; + if ("transaction-response".equals(codeString)) + return TRANSACTIONRESPONSE; + if ("batch".equals(codeString)) + return BATCH; + if ("batch-response".equals(codeString)) + return BATCHRESPONSE; + if ("history".equals(codeString)) + return HISTORY; + if ("searchset".equals(codeString)) + return SEARCHSET; + if ("collection".equals(codeString)) + return COLLECTION; + throw new FHIRException("Unknown BundleType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DOCUMENT: return "document"; + case MESSAGE: return "message"; + case TRANSACTION: return "transaction"; + case TRANSACTIONRESPONSE: return "transaction-response"; + case BATCH: return "batch"; + case BATCHRESPONSE: return "batch-response"; + case HISTORY: return "history"; + case SEARCHSET: return "searchset"; + case COLLECTION: return "collection"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DOCUMENT: return "http://hl7.org/fhir/bundle-type"; + case MESSAGE: return "http://hl7.org/fhir/bundle-type"; + case TRANSACTION: return "http://hl7.org/fhir/bundle-type"; + case TRANSACTIONRESPONSE: return "http://hl7.org/fhir/bundle-type"; + case BATCH: return "http://hl7.org/fhir/bundle-type"; + case BATCHRESPONSE: return "http://hl7.org/fhir/bundle-type"; + case HISTORY: return "http://hl7.org/fhir/bundle-type"; + case SEARCHSET: return "http://hl7.org/fhir/bundle-type"; + case COLLECTION: return "http://hl7.org/fhir/bundle-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DOCUMENT: return "The bundle is a document. The first resource is a Composition."; + case MESSAGE: return "The bundle is a message. The first resource is a MessageHeader."; + case TRANSACTION: return "The bundle is a transaction - intended to be processed by a server as an atomic commit."; + case TRANSACTIONRESPONSE: return "The bundle is a transaction response. Because the response is a transaction response, the transactionhas succeeded, and all responses are error free."; + case BATCH: return "The bundle is a transaction - intended to be processed by a server as a group of actions."; + case BATCHRESPONSE: return "The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success."; + case HISTORY: return "The bundle is a list of resources from a history interaction on a server."; + case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; + case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DOCUMENT: return "Document"; + case MESSAGE: return "Message"; + case TRANSACTION: return "Transaction"; + case TRANSACTIONRESPONSE: return "Transaction Response"; + case BATCH: return "Batch"; + case BATCHRESPONSE: return "Batch Response"; + case HISTORY: return "History List"; + case SEARCHSET: return "Search Results"; + case COLLECTION: return "Collection"; + default: return "?"; + } + } + } + + 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; + if ("document".equals(codeString)) + return BundleType.DOCUMENT; + if ("message".equals(codeString)) + return BundleType.MESSAGE; + if ("transaction".equals(codeString)) + return BundleType.TRANSACTION; + if ("transaction-response".equals(codeString)) + return BundleType.TRANSACTIONRESPONSE; + if ("batch".equals(codeString)) + return BundleType.BATCH; + if ("batch-response".equals(codeString)) + return BundleType.BATCHRESPONSE; + if ("history".equals(codeString)) + return BundleType.HISTORY; + if ("searchset".equals(codeString)) + return BundleType.SEARCHSET; + if ("collection".equals(codeString)) + return BundleType.COLLECTION; + throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("document".equals(codeString)) + return new Enumeration(this, BundleType.DOCUMENT); + if ("message".equals(codeString)) + return new Enumeration(this, BundleType.MESSAGE); + if ("transaction".equals(codeString)) + return new Enumeration(this, BundleType.TRANSACTION); + if ("transaction-response".equals(codeString)) + return new Enumeration(this, BundleType.TRANSACTIONRESPONSE); + if ("batch".equals(codeString)) + return new Enumeration(this, BundleType.BATCH); + if ("batch-response".equals(codeString)) + return new Enumeration(this, BundleType.BATCHRESPONSE); + if ("history".equals(codeString)) + return new Enumeration(this, BundleType.HISTORY); + if ("searchset".equals(codeString)) + return new Enumeration(this, BundleType.SEARCHSET); + if ("collection".equals(codeString)) + return new Enumeration(this, BundleType.COLLECTION); + throw new FHIRException("Unknown BundleType code '"+codeString+"'"); + } + public String toCode(BundleType code) { + if (code == BundleType.DOCUMENT) + return "document"; + if (code == BundleType.MESSAGE) + return "message"; + if (code == BundleType.TRANSACTION) + return "transaction"; + if (code == BundleType.TRANSACTIONRESPONSE) + return "transaction-response"; + if (code == BundleType.BATCH) + return "batch"; + if (code == BundleType.BATCHRESPONSE) + return "batch-response"; + if (code == BundleType.HISTORY) + return "history"; + if (code == BundleType.SEARCHSET) + return "searchset"; + if (code == BundleType.COLLECTION) + return "collection"; + return "?"; + } + public String toSystem(BundleType code) { + return code.getSystem(); + } + } + + public enum SearchEntryMode { + /** + * This resource matched the search specification. + */ + MATCH, + /** + * This resource is returned because it is referred to from another resource in the search set. + */ + INCLUDE, + /** + * An OperationOutcome that provides additional information about the processing of a search. + */ + OUTCOME, + /** + * added to help the parsers + */ + NULL; + public static SearchEntryMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("match".equals(codeString)) + return MATCH; + if ("include".equals(codeString)) + return INCLUDE; + if ("outcome".equals(codeString)) + return OUTCOME; + throw new FHIRException("Unknown SearchEntryMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MATCH: return "match"; + case INCLUDE: return "include"; + case OUTCOME: return "outcome"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MATCH: return "http://hl7.org/fhir/search-entry-mode"; + case INCLUDE: return "http://hl7.org/fhir/search-entry-mode"; + case OUTCOME: return "http://hl7.org/fhir/search-entry-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MATCH: return "This resource matched the search specification."; + case INCLUDE: return "This resource is returned because it is referred to from another resource in the search set."; + case OUTCOME: return "An OperationOutcome that provides additional information about the processing of a search."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MATCH: return "Match"; + case INCLUDE: return "Include"; + case OUTCOME: return "Outcome"; + default: return "?"; + } + } + } + + public static class SearchEntryModeEnumFactory implements EnumFactory { + public SearchEntryMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("match".equals(codeString)) + return SearchEntryMode.MATCH; + if ("include".equals(codeString)) + return SearchEntryMode.INCLUDE; + if ("outcome".equals(codeString)) + return SearchEntryMode.OUTCOME; + throw new IllegalArgumentException("Unknown SearchEntryMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("match".equals(codeString)) + return new Enumeration(this, SearchEntryMode.MATCH); + if ("include".equals(codeString)) + return new Enumeration(this, SearchEntryMode.INCLUDE); + if ("outcome".equals(codeString)) + return new Enumeration(this, SearchEntryMode.OUTCOME); + throw new FHIRException("Unknown SearchEntryMode code '"+codeString+"'"); + } + public String toCode(SearchEntryMode code) { + if (code == SearchEntryMode.MATCH) + return "match"; + if (code == SearchEntryMode.INCLUDE) + return "include"; + if (code == SearchEntryMode.OUTCOME) + return "outcome"; + return "?"; + } + public String toSystem(SearchEntryMode code) { + return code.getSystem(); + } + } + + public enum HTTPVerb { + /** + * HTTP GET + */ + GET, + /** + * HTTP POST + */ + POST, + /** + * HTTP PUT + */ + PUT, + /** + * HTTP DELETE + */ + DELETE, + /** + * added to help the parsers + */ + NULL; + public static HTTPVerb fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("GET".equals(codeString)) + return GET; + if ("POST".equals(codeString)) + return POST; + if ("PUT".equals(codeString)) + return PUT; + if ("DELETE".equals(codeString)) + return DELETE; + throw new FHIRException("Unknown HTTPVerb code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case GET: return "GET"; + case POST: return "POST"; + case PUT: return "PUT"; + case DELETE: return "DELETE"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case GET: return "http://hl7.org/fhir/http-verb"; + case POST: return "http://hl7.org/fhir/http-verb"; + case PUT: return "http://hl7.org/fhir/http-verb"; + case DELETE: return "http://hl7.org/fhir/http-verb"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case GET: return "HTTP GET"; + case POST: return "HTTP POST"; + case PUT: return "HTTP PUT"; + case DELETE: return "HTTP DELETE"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case GET: return "GET"; + case POST: return "POST"; + case PUT: return "PUT"; + case DELETE: return "DELETE"; + default: return "?"; + } + } + } + + public static class HTTPVerbEnumFactory implements EnumFactory { + public HTTPVerb fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("GET".equals(codeString)) + return HTTPVerb.GET; + if ("POST".equals(codeString)) + return HTTPVerb.POST; + if ("PUT".equals(codeString)) + return HTTPVerb.PUT; + if ("DELETE".equals(codeString)) + return HTTPVerb.DELETE; + throw new IllegalArgumentException("Unknown HTTPVerb code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("GET".equals(codeString)) + return new Enumeration(this, HTTPVerb.GET); + if ("POST".equals(codeString)) + return new Enumeration(this, HTTPVerb.POST); + if ("PUT".equals(codeString)) + return new Enumeration(this, HTTPVerb.PUT); + if ("DELETE".equals(codeString)) + return new Enumeration(this, HTTPVerb.DELETE); + throw new FHIRException("Unknown HTTPVerb code '"+codeString+"'"); + } + public String toCode(HTTPVerb code) { + if (code == HTTPVerb.GET) + return "GET"; + if (code == HTTPVerb.POST) + return "POST"; + if (code == HTTPVerb.PUT) + return "PUT"; + if (code == HTTPVerb.DELETE) + return "DELETE"; + return "?"; + } + public String toSystem(HTTPVerb code) { + return code.getSystem(); + } + } + + @Block() + public static class BundleLinkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + @Child(name = "relation", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="http://www.iana.org/assignments/link-relations/link-relations.xhtml", formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." ) + protected StringType relation; + + /** + * The reference details for the link. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference details for the link", formalDefinition="The reference details for the link." ) + protected UriType url; + + private static final long serialVersionUID = -1010386066L; + + /** + * Constructor + */ + public BundleLinkComponent() { + super(); + } + + /** + * Constructor + */ + public BundleLinkComponent(StringType relation, UriType url) { + super(); + this.relation = relation; + this.url = url; + } + + /** + * @return {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value + */ + public StringType getRelationElement() { + if (this.relation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleLinkComponent.relation"); + else if (Configuration.doAutoCreate()) + this.relation = new StringType(); // bb + return this.relation; + } + + public boolean hasRelationElement() { + return this.relation != null && !this.relation.isEmpty(); + } + + public boolean hasRelation() { + return this.relation != null && !this.relation.isEmpty(); + } + + /** + * @param value {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value + */ + public BundleLinkComponent setRelationElement(StringType value) { + this.relation = value; + return this; + } + + /** + * @return A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + public String getRelation() { + return this.relation == null ? null : this.relation.getValue(); + } + + /** + * @param value A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + public BundleLinkComponent setRelation(String value) { + if (this.relation == null) + this.relation = new StringType(); + this.relation.setValue(value); + return this; + } + + /** + * @return {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleLinkComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public BundleLinkComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The reference details for the link. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The reference details for the link. + */ + public BundleLinkComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].", 0, java.lang.Integer.MAX_VALUE, relation)); + childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -554436100: /*relation*/ return this.relation == null ? new Base[0] : new Base[] {this.relation}; // StringType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -554436100: // relation + this.relation = castToString(value); // StringType + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("relation")) + this.relation = castToString(value); // StringType + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -554436100: throw new FHIRException("Cannot make property relation as it is not a complex type"); // StringType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("relation")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.relation"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.url"); + } + else + return super.addChild(name); + } + + public BundleLinkComponent copy() { + BundleLinkComponent dst = new BundleLinkComponent(); + copyValues(dst); + dst.relation = relation == null ? null : relation.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleLinkComponent)) + return false; + BundleLinkComponent o = (BundleLinkComponent) other; + return compareDeep(relation, o.relation, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleLinkComponent)) + return false; + BundleLinkComponent o = (BundleLinkComponent) other; + return compareValues(relation, o.relation, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (relation == null || relation.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + public String fhirType() { + return "Bundle.link"; + + } + + } + + @Block() + public static class BundleEntryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A series of links that provide context to this entry. + */ + @Child(name = "link", type = {BundleLinkComponent.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Links related to this entry", formalDefinition="A series of links that provide context to this entry." ) + protected List link; + + /** + * The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: +* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) +* Results from operations might involve resources that are not identified. + */ + @Child(name = "fullUrl", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Absolute URL for resource (server address, or UUID/OID)", formalDefinition="The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified." ) + protected UriType fullUrl; + + /** + * The Resources for the entry. + */ + @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A resource in the bundle", formalDefinition="The Resources for the entry." ) + protected Resource resource; + + /** + * Information about the search process that lead to the creation of this entry. + */ + @Child(name = "search", type = {}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Search related information", formalDefinition="Information about the search process that lead to the creation of this entry." ) + protected BundleEntrySearchComponent search; + + /** + * Additional information about how this entry should be processed as part of a transaction. + */ + @Child(name = "request", type = {}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) + protected BundleEntryRequestComponent request; + + /** + * Additional information about how this entry should be processed as part of a transaction. + */ + @Child(name = "response", type = {}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) + protected BundleEntryResponseComponent response; + + private static final long serialVersionUID = 517783054L; + + /** + * Constructor + */ + public BundleEntryComponent() { + super(); + } + + /** + * @return {@link #link} (A series of links that provide context to this entry.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (BundleLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (A series of links that provide context to this entry.) + */ + // syntactic sugar + public BundleLinkComponent addLink() { //3 + BundleLinkComponent t = new BundleLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public BundleEntryComponent addLink(BundleLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + /** + * @return {@link #fullUrl} (The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: +* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) +* Results from operations might involve resources that are not identified.). This is the underlying object with id, value and extensions. The accessor "getFullUrl" gives direct access to the value + */ + public UriType getFullUrlElement() { + if (this.fullUrl == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.fullUrl"); + else if (Configuration.doAutoCreate()) + this.fullUrl = new UriType(); // bb + return this.fullUrl; + } + + public boolean hasFullUrlElement() { + return this.fullUrl != null && !this.fullUrl.isEmpty(); + } + + public boolean hasFullUrl() { + return this.fullUrl != null && !this.fullUrl.isEmpty(); + } + + /** + * @param value {@link #fullUrl} (The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: +* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) +* Results from operations might involve resources that are not identified.). This is the underlying object with id, value and extensions. The accessor "getFullUrl" gives direct access to the value + */ + public BundleEntryComponent setFullUrlElement(UriType value) { + this.fullUrl = value; + return this; + } + + /** + * @return The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: +* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) +* Results from operations might involve resources that are not identified. + */ + public String getFullUrl() { + return this.fullUrl == null ? null : this.fullUrl.getValue(); + } + + /** + * @param value The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: +* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) +* Results from operations might involve resources that are not identified. + */ + public BundleEntryComponent setFullUrl(String value) { + if (Utilities.noString(value)) + this.fullUrl = null; + else { + if (this.fullUrl == null) + this.fullUrl = new UriType(); + this.fullUrl.setValue(value); + } + return this; + } + + /** + * @return {@link #resource} (The Resources for the entry.) + */ + public Resource getResource() { + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The Resources for the entry.) + */ + public BundleEntryComponent setResource(Resource value) { + this.resource = value; + return this; + } + + /** + * @return {@link #search} (Information about the search process that lead to the creation of this entry.) + */ + public BundleEntrySearchComponent getSearch() { + if (this.search == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.search"); + else if (Configuration.doAutoCreate()) + this.search = new BundleEntrySearchComponent(); // cc + return this.search; + } + + public boolean hasSearch() { + return this.search != null && !this.search.isEmpty(); + } + + /** + * @param value {@link #search} (Information about the search process that lead to the creation of this entry.) + */ + public BundleEntryComponent setSearch(BundleEntrySearchComponent value) { + this.search = value; + return this; + } + + /** + * @return {@link #request} (Additional information about how this entry should be processed as part of a transaction.) + */ + public BundleEntryRequestComponent getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.request"); + else if (Configuration.doAutoCreate()) + this.request = new BundleEntryRequestComponent(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Additional information about how this entry should be processed as part of a transaction.) + */ + public BundleEntryComponent setRequest(BundleEntryRequestComponent value) { + this.request = value; + return this; + } + + /** + * @return {@link #response} (Additional information about how this entry should be processed as part of a transaction.) + */ + public BundleEntryResponseComponent getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.response"); + else if (Configuration.doAutoCreate()) + this.response = new BundleEntryResponseComponent(); // cc + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Additional information about how this entry should be processed as part of a transaction.) + */ + public BundleEntryComponent setResponse(BundleEntryResponseComponent value) { + this.response = value; + return this; + } + + /** + * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. + * If no link is found which matches the given relation, returns null. If more than one + * link is found which matches the given relation, returns the first matching BundleLinkComponent. + * + * @param theRelation + * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. + * @return Returns a matching BundleLinkComponent, or null + * @see IBaseBundle#LINK_NEXT + * @see IBaseBundle#LINK_PREV + * @see IBaseBundle#LINK_SELF + */ + public BundleLinkComponent getLink(String theRelation) { + org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); + for (BundleLinkComponent next : getLink()) { + if (theRelation.equals(next.getRelation())) { + return next; + } + } + return null; + } + + /** + * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. + * If no link is found which matches the given relation, creates a new BundleLinkComponent with the + * given relation and adds it to this Bundle. If more than one + * link is found which matches the given relation, returns the first matching BundleLinkComponent. + * + * @param theRelation + * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. + * @return Returns a matching BundleLinkComponent, or null + * @see IBaseBundle#LINK_NEXT + * @see IBaseBundle#LINK_PREV + * @see IBaseBundle#LINK_SELF + */ + public BundleLinkComponent getLinkOrCreate(String theRelation) { + org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); + for (BundleLinkComponent next : getLink()) { + if (theRelation.equals(next.getRelation())) { + return next; + } + } + BundleLinkComponent retVal = new BundleLinkComponent(); + retVal.setRelation(theRelation); + getLink().add(retVal); + return retVal; + } + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("link", "@Bundle.link", "A series of links that provide context to this entry.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("fullUrl", "uri", "The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified.", 0, java.lang.Integer.MAX_VALUE, fullUrl)); + childrenList.add(new Property("resource", "Resource", "The Resources for the entry.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("search", "", "Information about the search process that lead to the creation of this entry.", 0, java.lang.Integer.MAX_VALUE, search)); + childrenList.add(new Property("request", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, response)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent + case -511251360: /*fullUrl*/ return this.fullUrl == null ? new Base[0] : new Base[] {this.fullUrl}; // UriType + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource + case -906336856: /*search*/ return this.search == null ? new Base[0] : new Base[] {this.search}; // BundleEntrySearchComponent + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // BundleEntryRequestComponent + case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // BundleEntryResponseComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3321850: // link + this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent + break; + case -511251360: // fullUrl + this.fullUrl = castToUri(value); // UriType + break; + case -341064690: // resource + this.resource = castToResource(value); // Resource + break; + case -906336856: // search + this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent + break; + case 1095692943: // request + this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent + break; + case -340323263: // response + this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("link")) + this.getLink().add((BundleLinkComponent) value); + else if (name.equals("fullUrl")) + this.fullUrl = castToUri(value); // UriType + else if (name.equals("resource")) + this.resource = castToResource(value); // Resource + else if (name.equals("search")) + this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent + else if (name.equals("request")) + this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent + else if (name.equals("response")) + this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3321850: return addLink(); // BundleLinkComponent + case -511251360: throw new FHIRException("Cannot make property fullUrl as it is not a complex type"); // UriType + case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource + case -906336856: return getSearch(); // BundleEntrySearchComponent + case 1095692943: return getRequest(); // BundleEntryRequestComponent + case -340323263: return getResponse(); // BundleEntryResponseComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("link")) { + return addLink(); + } + else if (name.equals("fullUrl")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.fullUrl"); + } + else if (name.equals("resource")) { + throw new FHIRException("Cannot call addChild on an abstract type Bundle.resource"); + } + else if (name.equals("search")) { + this.search = new BundleEntrySearchComponent(); + return this.search; + } + else if (name.equals("request")) { + this.request = new BundleEntryRequestComponent(); + return this.request; + } + else if (name.equals("response")) { + this.response = new BundleEntryResponseComponent(); + return this.response; + } + else + return super.addChild(name); + } + + public BundleEntryComponent copy() { + BundleEntryComponent dst = new BundleEntryComponent(); + copyValues(dst); + if (link != null) { + dst.link = new ArrayList(); + for (BundleLinkComponent i : link) + dst.link.add(i.copy()); + }; + dst.fullUrl = fullUrl == null ? null : fullUrl.copy(); + dst.resource = resource == null ? null : resource.copy(); + dst.search = search == null ? null : search.copy(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleEntryComponent)) + return false; + BundleEntryComponent o = (BundleEntryComponent) other; + return compareDeep(link, o.link, true) && compareDeep(fullUrl, o.fullUrl, true) && compareDeep(resource, o.resource, true) + && compareDeep(search, o.search, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleEntryComponent)) + return false; + BundleEntryComponent o = (BundleEntryComponent) other; + return compareValues(fullUrl, o.fullUrl, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (link == null || link.isEmpty()) && (fullUrl == null || fullUrl.isEmpty()) + && (resource == null || resource.isEmpty()) && (search == null || search.isEmpty()) && (request == null || request.isEmpty()) + && (response == null || response.isEmpty()); + } + + public String fhirType() { + return "Bundle.entry"; + + } + + } + + @Block() + public static class BundleEntrySearchComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Why this entry is in the result set - whether it's included as a match or because of an _include requirement. + */ + @Child(name = "mode", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="match | include | outcome - why this is in the result set", formalDefinition="Why this entry is in the result set - whether it's included as a match or because of an _include requirement." ) + protected Enumeration mode; + + /** + * When searching, the server's search ranking score for the entry. + */ + @Child(name = "score", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Search ranking (between 0 and 1)", formalDefinition="When searching, the server's search ranking score for the entry." ) + protected DecimalType score; + + private static final long serialVersionUID = 837739866L; + + /** + * Constructor + */ + public BundleEntrySearchComponent() { + super(); + } + + /** + * @return {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). 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 BundleEntrySearchComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new SearchEntryModeEnumFactory()); // bb + 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} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public BundleEntrySearchComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Why this entry is in the result set - whether it's included as a match or because of an _include requirement. + */ + public SearchEntryMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Why this entry is in the result set - whether it's included as a match or because of an _include requirement. + */ + public BundleEntrySearchComponent setMode(SearchEntryMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(new SearchEntryModeEnumFactory()); + this.mode.setValue(value); + } + return this; + } + + /** + * @return {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value + */ + public DecimalType getScoreElement() { + if (this.score == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntrySearchComponent.score"); + else if (Configuration.doAutoCreate()) + this.score = new DecimalType(); // bb + return this.score; + } + + public boolean hasScoreElement() { + return this.score != null && !this.score.isEmpty(); + } + + public boolean hasScore() { + return this.score != null && !this.score.isEmpty(); + } + + /** + * @param value {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value + */ + public BundleEntrySearchComponent setScoreElement(DecimalType value) { + this.score = value; + return this; + } + + /** + * @return When searching, the server's search ranking score for the entry. + */ + public BigDecimal getScore() { + return this.score == null ? null : this.score.getValue(); + } + + /** + * @param value When searching, the server's search ranking score for the entry. + */ + public BundleEntrySearchComponent setScore(BigDecimal value) { + if (value == null) + this.score = null; + else { + if (this.score == null) + this.score = new DecimalType(); + this.score.setValue(value); + } + return this; + } + + /** + * @param value When searching, the server's search ranking score for the entry. + */ + public BundleEntrySearchComponent setScore(long value) { + this.score = new DecimalType(); + this.score.setValue(value); + return this; + } + + /** + * @param value When searching, the server's search ranking score for the entry. + */ + public BundleEntrySearchComponent setScore(double value) { + this.score = new DecimalType(); + this.score.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "Why this entry is in the result set - whether it's included as a match or because of an _include requirement.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.", 0, java.lang.Integer.MAX_VALUE, score)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration + case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3357091: // mode + this.mode = new SearchEntryModeEnumFactory().fromType(value); // Enumeration + break; + case 109264530: // score + this.score = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("mode")) + this.mode = new SearchEntryModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("score")) + this.score = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 109264530: throw new FHIRException("Cannot make property score as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.mode"); + } + else if (name.equals("score")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.score"); + } + else + return super.addChild(name); + } + + public BundleEntrySearchComponent copy() { + BundleEntrySearchComponent dst = new BundleEntrySearchComponent(); + copyValues(dst); + dst.mode = mode == null ? null : mode.copy(); + dst.score = score == null ? null : score.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleEntrySearchComponent)) + return false; + BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; + return compareDeep(mode, o.mode, true) && compareDeep(score, o.score, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleEntrySearchComponent)) + return false; + BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; + return compareValues(mode, o.mode, true) && compareValues(score, o.score, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (score == null || score.isEmpty()) + ; + } + + public String fhirType() { + return "Bundle.entry.search"; + + } + + } + + @Block() + public static class BundleEntryRequestComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The HTTP verb for this entry in either a change history, or a transaction/ transaction response. + */ + @Child(name = "method", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="GET | POST | PUT | DELETE", formalDefinition="The HTTP verb for this entry in either a change history, or a transaction/ transaction response." ) + protected Enumeration method; + + /** + * The URL for this entry, relative to the root (the address to which the request is posted). + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="URL for HTTP equivalent of this entry", formalDefinition="The URL for this entry, relative to the root (the address to which the request is posted)." ) + protected UriType url; + + /** + * If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). + */ + @Child(name = "ifNoneMatch", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="For managing cache currency", formalDefinition="If the ETag values match, return a 304 Not modified status. See the API documentation for [\"Conditional Read\"](http.html#cread)." ) + protected StringType ifNoneMatch; + + /** + * Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). + */ + @Child(name = "ifModifiedSince", type = {InstantType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread)." ) + protected InstantType ifModifiedSince; + + /** + * Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). + */ + @Child(name = "ifMatch", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency)." ) + protected StringType ifMatch; + + /** + * Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). + */ + @Child(name = "ifNoneExist", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="For conditional creates", formalDefinition="Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\"Conditional Create\"](http.html#ccreate). This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")." ) + protected StringType ifNoneExist; + + private static final long serialVersionUID = -1349769744L; + + /** + * Constructor + */ + public BundleEntryRequestComponent() { + super(); + } + + /** + * Constructor + */ + public BundleEntryRequestComponent(Enumeration method, UriType url) { + super(); + this.method = method; + this.url = url; + } + + /** + * @return {@link #method} (The HTTP verb for this entry in either a change history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value + */ + public Enumeration getMethodElement() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryRequestComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new Enumeration(new HTTPVerbEnumFactory()); // bb + return this.method; + } + + public boolean hasMethodElement() { + return this.method != null && !this.method.isEmpty(); + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (The HTTP verb for this entry in either a change history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value + */ + public BundleEntryRequestComponent setMethodElement(Enumeration value) { + this.method = value; + return this; + } + + /** + * @return The HTTP verb for this entry in either a change history, or a transaction/ transaction response. + */ + public HTTPVerb getMethod() { + return this.method == null ? null : this.method.getValue(); + } + + /** + * @param value The HTTP verb for this entry in either a change history, or a transaction/ transaction response. + */ + public BundleEntryRequestComponent setMethod(HTTPVerb value) { + if (this.method == null) + this.method = new Enumeration(new HTTPVerbEnumFactory()); + this.method.setValue(value); + return this; + } + + /** + * @return {@link #url} (The URL for this entry, relative to the root (the address to which the request is posted).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryRequestComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The URL for this entry, relative to the root (the address to which the request is posted).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public BundleEntryRequestComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The URL for this entry, relative to the root (the address to which the request is posted). + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The URL for this entry, relative to the root (the address to which the request is posted). + */ + public BundleEntryRequestComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value + */ + public StringType getIfNoneMatchElement() { + if (this.ifNoneMatch == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneMatch"); + else if (Configuration.doAutoCreate()) + this.ifNoneMatch = new StringType(); // bb + return this.ifNoneMatch; + } + + public boolean hasIfNoneMatchElement() { + return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); + } + + public boolean hasIfNoneMatch() { + return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); + } + + /** + * @param value {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value + */ + public BundleEntryRequestComponent setIfNoneMatchElement(StringType value) { + this.ifNoneMatch = value; + return this; + } + + /** + * @return If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). + */ + public String getIfNoneMatch() { + return this.ifNoneMatch == null ? null : this.ifNoneMatch.getValue(); + } + + /** + * @param value If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). + */ + public BundleEntryRequestComponent setIfNoneMatch(String value) { + if (Utilities.noString(value)) + this.ifNoneMatch = null; + else { + if (this.ifNoneMatch == null) + this.ifNoneMatch = new StringType(); + this.ifNoneMatch.setValue(value); + } + return this; + } + + /** + * @return {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value + */ + public InstantType getIfModifiedSinceElement() { + if (this.ifModifiedSince == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifModifiedSince"); + else if (Configuration.doAutoCreate()) + this.ifModifiedSince = new InstantType(); // bb + return this.ifModifiedSince; + } + + public boolean hasIfModifiedSinceElement() { + return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); + } + + public boolean hasIfModifiedSince() { + return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); + } + + /** + * @param value {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value + */ + public BundleEntryRequestComponent setIfModifiedSinceElement(InstantType value) { + this.ifModifiedSince = value; + return this; + } + + /** + * @return Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). + */ + public Date getIfModifiedSince() { + return this.ifModifiedSince == null ? null : this.ifModifiedSince.getValue(); + } + + /** + * @param value Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). + */ + public BundleEntryRequestComponent setIfModifiedSince(Date value) { + if (value == null) + this.ifModifiedSince = null; + else { + if (this.ifModifiedSince == null) + this.ifModifiedSince = new InstantType(); + this.ifModifiedSince.setValue(value); + } + return this; + } + + /** + * @return {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value + */ + public StringType getIfMatchElement() { + if (this.ifMatch == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifMatch"); + else if (Configuration.doAutoCreate()) + this.ifMatch = new StringType(); // bb + return this.ifMatch; + } + + public boolean hasIfMatchElement() { + return this.ifMatch != null && !this.ifMatch.isEmpty(); + } + + public boolean hasIfMatch() { + return this.ifMatch != null && !this.ifMatch.isEmpty(); + } + + /** + * @param value {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value + */ + public BundleEntryRequestComponent setIfMatchElement(StringType value) { + this.ifMatch = value; + return this; + } + + /** + * @return Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). + */ + public String getIfMatch() { + return this.ifMatch == null ? null : this.ifMatch.getValue(); + } + + /** + * @param value Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). + */ + public BundleEntryRequestComponent setIfMatch(String value) { + if (Utilities.noString(value)) + this.ifMatch = null; + else { + if (this.ifMatch == null) + this.ifMatch = new StringType(); + this.ifMatch.setValue(value); + } + return this; + } + + /** + * @return {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value + */ + public StringType getIfNoneExistElement() { + if (this.ifNoneExist == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneExist"); + else if (Configuration.doAutoCreate()) + this.ifNoneExist = new StringType(); // bb + return this.ifNoneExist; + } + + public boolean hasIfNoneExistElement() { + return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); + } + + public boolean hasIfNoneExist() { + return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); + } + + /** + * @param value {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value + */ + public BundleEntryRequestComponent setIfNoneExistElement(StringType value) { + this.ifNoneExist = value; + return this; + } + + /** + * @return Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). + */ + public String getIfNoneExist() { + return this.ifNoneExist == null ? null : this.ifNoneExist.getValue(); + } + + /** + * @param value Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). + */ + public BundleEntryRequestComponent setIfNoneExist(String value) { + if (Utilities.noString(value)) + this.ifNoneExist = null; + else { + if (this.ifNoneExist == null) + this.ifNoneExist = new StringType(); + this.ifNoneExist.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("method", "code", "The HTTP verb for this entry in either a change history, or a transaction/ transaction response.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("url", "uri", "The URL for this entry, relative to the root (the address to which the request is posted).", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("ifNoneMatch", "string", "If the ETag values match, return a 304 Not modified status. See the API documentation for [\"Conditional Read\"](http.html#cread).", 0, java.lang.Integer.MAX_VALUE, ifNoneMatch)); + childrenList.add(new Property("ifModifiedSince", "instant", "Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread).", 0, java.lang.Integer.MAX_VALUE, ifModifiedSince)); + childrenList.add(new Property("ifMatch", "string", "Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency).", 0, java.lang.Integer.MAX_VALUE, ifMatch)); + childrenList.add(new Property("ifNoneExist", "string", "Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\"Conditional Create\"](http.html#ccreate). This is just the query portion of the URL - what follows the \"?\" (not including the \"?\").", 0, java.lang.Integer.MAX_VALUE, ifNoneExist)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // Enumeration + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 171868368: /*ifNoneMatch*/ return this.ifNoneMatch == null ? new Base[0] : new Base[] {this.ifNoneMatch}; // StringType + case -2061602860: /*ifModifiedSince*/ return this.ifModifiedSince == null ? new Base[0] : new Base[] {this.ifModifiedSince}; // InstantType + case 1692894888: /*ifMatch*/ return this.ifMatch == null ? new Base[0] : new Base[] {this.ifMatch}; // StringType + case 165155330: /*ifNoneExist*/ return this.ifNoneExist == null ? new Base[0] : new Base[] {this.ifNoneExist}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1077554975: // method + this.method = new HTTPVerbEnumFactory().fromType(value); // Enumeration + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 171868368: // ifNoneMatch + this.ifNoneMatch = castToString(value); // StringType + break; + case -2061602860: // ifModifiedSince + this.ifModifiedSince = castToInstant(value); // InstantType + break; + case 1692894888: // ifMatch + this.ifMatch = castToString(value); // StringType + break; + case 165155330: // ifNoneExist + this.ifNoneExist = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("method")) + this.method = new HTTPVerbEnumFactory().fromType(value); // Enumeration + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("ifNoneMatch")) + this.ifNoneMatch = castToString(value); // StringType + else if (name.equals("ifModifiedSince")) + this.ifModifiedSince = castToInstant(value); // InstantType + else if (name.equals("ifMatch")) + this.ifMatch = castToString(value); // StringType + else if (name.equals("ifNoneExist")) + this.ifNoneExist = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1077554975: throw new FHIRException("Cannot make property method as it is not a complex type"); // Enumeration + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 171868368: throw new FHIRException("Cannot make property ifNoneMatch as it is not a complex type"); // StringType + case -2061602860: throw new FHIRException("Cannot make property ifModifiedSince as it is not a complex type"); // InstantType + case 1692894888: throw new FHIRException("Cannot make property ifMatch as it is not a complex type"); // StringType + case 165155330: throw new FHIRException("Cannot make property ifNoneExist as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("method")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.method"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.url"); + } + else if (name.equals("ifNoneMatch")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifNoneMatch"); + } + else if (name.equals("ifModifiedSince")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifModifiedSince"); + } + else if (name.equals("ifMatch")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifMatch"); + } + else if (name.equals("ifNoneExist")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifNoneExist"); + } + else + return super.addChild(name); + } + + public BundleEntryRequestComponent copy() { + BundleEntryRequestComponent dst = new BundleEntryRequestComponent(); + copyValues(dst); + dst.method = method == null ? null : method.copy(); + dst.url = url == null ? null : url.copy(); + dst.ifNoneMatch = ifNoneMatch == null ? null : ifNoneMatch.copy(); + dst.ifModifiedSince = ifModifiedSince == null ? null : ifModifiedSince.copy(); + dst.ifMatch = ifMatch == null ? null : ifMatch.copy(); + dst.ifNoneExist = ifNoneExist == null ? null : ifNoneExist.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleEntryRequestComponent)) + return false; + BundleEntryRequestComponent o = (BundleEntryRequestComponent) other; + return compareDeep(method, o.method, true) && compareDeep(url, o.url, true) && compareDeep(ifNoneMatch, o.ifNoneMatch, true) + && compareDeep(ifModifiedSince, o.ifModifiedSince, true) && compareDeep(ifMatch, o.ifMatch, true) + && compareDeep(ifNoneExist, o.ifNoneExist, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleEntryRequestComponent)) + return false; + BundleEntryRequestComponent o = (BundleEntryRequestComponent) other; + return compareValues(method, o.method, true) && compareValues(url, o.url, true) && compareValues(ifNoneMatch, o.ifNoneMatch, true) + && compareValues(ifModifiedSince, o.ifModifiedSince, true) && compareValues(ifMatch, o.ifMatch, true) + && compareValues(ifNoneExist, o.ifNoneExist, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (method == null || method.isEmpty()) && (url == null || url.isEmpty()) + && (ifNoneMatch == null || ifNoneMatch.isEmpty()) && (ifModifiedSince == null || ifModifiedSince.isEmpty()) + && (ifMatch == null || ifMatch.isEmpty()) && (ifNoneExist == null || ifNoneExist.isEmpty()) + ; + } + + public String fhirType() { + return "Bundle.entry.request"; + + } + + } + + @Block() + public static class BundleEntryResponseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. + */ + @Child(name = "status", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Status response code (text optional)", formalDefinition="The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code." ) + protected StringType status; + + /** + * The location header created by processing this operation. + */ + @Child(name = "location", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The location, if the operation returns a location", formalDefinition="The location header created by processing this operation." ) + protected UriType location; + + /** + * The etag for the resource, it the operation for the entry produced a versioned resource. + */ + @Child(name = "etag", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The etag for the resource (if relevant)", formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource." ) + protected StringType etag; + + /** + * The date/time that the resource was modified on the server. + */ + @Child(name = "lastModified", type = {InstantType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Server's date time modified", formalDefinition="The date/time that the resource was modified on the server." ) + protected InstantType lastModified; + + private static final long serialVersionUID = -1526413234L; + + /** + * Constructor + */ + public BundleEntryResponseComponent() { + super(); + } + + /** + * Constructor + */ + public BundleEntryResponseComponent(StringType status) { + super(); + this.status = status; + } + + /** + * @return {@link #status} (The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public StringType getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryResponseComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new StringType(); // bb + 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 code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public BundleEntryResponseComponent setStatusElement(StringType value) { + this.status = value; + return this; + } + + /** + * @return The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. + */ + public String getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. + */ + public BundleEntryResponseComponent setStatus(String value) { + if (this.status == null) + this.status = new StringType(); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value + */ + public UriType getLocationElement() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryResponseComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new UriType(); // bb + return this.location; + } + + public boolean hasLocationElement() { + return this.location != null && !this.location.isEmpty(); + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value + */ + public BundleEntryResponseComponent setLocationElement(UriType value) { + this.location = value; + return this; + } + + /** + * @return The location header created by processing this operation. + */ + public String getLocation() { + return this.location == null ? null : this.location.getValue(); + } + + /** + * @param value The location header created by processing this operation. + */ + public BundleEntryResponseComponent setLocation(String value) { + if (Utilities.noString(value)) + this.location = null; + else { + if (this.location == null) + this.location = new UriType(); + this.location.setValue(value); + } + return this; + } + + /** + * @return {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value + */ + public StringType getEtagElement() { + if (this.etag == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryResponseComponent.etag"); + else if (Configuration.doAutoCreate()) + this.etag = new StringType(); // bb + return this.etag; + } + + public boolean hasEtagElement() { + return this.etag != null && !this.etag.isEmpty(); + } + + public boolean hasEtag() { + return this.etag != null && !this.etag.isEmpty(); + } + + /** + * @param value {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value + */ + public BundleEntryResponseComponent setEtagElement(StringType value) { + this.etag = value; + return this; + } + + /** + * @return The etag for the resource, it the operation for the entry produced a versioned resource. + */ + public String getEtag() { + return this.etag == null ? null : this.etag.getValue(); + } + + /** + * @param value The etag for the resource, it the operation for the entry produced a versioned resource. + */ + public BundleEntryResponseComponent setEtag(String value) { + if (Utilities.noString(value)) + this.etag = null; + else { + if (this.etag == null) + this.etag = new StringType(); + this.etag.setValue(value); + } + return this; + } + + /** + * @return {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public InstantType getLastModifiedElement() { + if (this.lastModified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryResponseComponent.lastModified"); + else if (Configuration.doAutoCreate()) + this.lastModified = new InstantType(); // bb + return this.lastModified; + } + + public boolean hasLastModifiedElement() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + public boolean hasLastModified() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + /** + * @param value {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public BundleEntryResponseComponent setLastModifiedElement(InstantType value) { + this.lastModified = value; + return this; + } + + /** + * @return The date/time that the resource was modified on the server. + */ + public Date getLastModified() { + return this.lastModified == null ? null : this.lastModified.getValue(); + } + + /** + * @param value The date/time that the resource was modified on the server. + */ + public BundleEntryResponseComponent setLastModified(Date value) { + if (value == null) + this.lastModified = null; + else { + if (this.lastModified == null) + this.lastModified = new InstantType(); + this.lastModified.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "string", "The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("location", "uri", "The location header created by processing this operation.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("etag", "string", "The etag for the resource, it the operation for the entry produced a versioned resource.", 0, java.lang.Integer.MAX_VALUE, etag)); + childrenList.add(new Property("lastModified", "instant", "The date/time that the resource was modified on the server.", 0, java.lang.Integer.MAX_VALUE, lastModified)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // StringType + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // UriType + case 3123477: /*etag*/ return this.etag == null ? new Base[0] : new Base[] {this.etag}; // StringType + case 1959003007: /*lastModified*/ return this.lastModified == null ? new Base[0] : new Base[] {this.lastModified}; // InstantType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -892481550: // status + this.status = castToString(value); // StringType + break; + case 1901043637: // location + this.location = castToUri(value); // UriType + break; + case 3123477: // etag + this.etag = castToString(value); // StringType + break; + case 1959003007: // lastModified + this.lastModified = castToInstant(value); // InstantType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("status")) + this.status = castToString(value); // StringType + else if (name.equals("location")) + this.location = castToUri(value); // UriType + else if (name.equals("etag")) + this.etag = castToString(value); // StringType + else if (name.equals("lastModified")) + this.lastModified = castToInstant(value); // InstantType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // StringType + case 1901043637: throw new FHIRException("Cannot make property location as it is not a complex type"); // UriType + case 3123477: throw new FHIRException("Cannot make property etag as it is not a complex type"); // StringType + case 1959003007: throw new FHIRException("Cannot make property lastModified as it is not a complex type"); // InstantType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.status"); + } + else if (name.equals("location")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.location"); + } + else if (name.equals("etag")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.etag"); + } + else if (name.equals("lastModified")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.lastModified"); + } + else + return super.addChild(name); + } + + public BundleEntryResponseComponent copy() { + BundleEntryResponseComponent dst = new BundleEntryResponseComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.location = location == null ? null : location.copy(); + dst.etag = etag == null ? null : etag.copy(); + dst.lastModified = lastModified == null ? null : lastModified.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BundleEntryResponseComponent)) + return false; + BundleEntryResponseComponent o = (BundleEntryResponseComponent) other; + return compareDeep(status, o.status, true) && compareDeep(location, o.location, true) && compareDeep(etag, o.etag, true) + && compareDeep(lastModified, o.lastModified, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BundleEntryResponseComponent)) + return false; + BundleEntryResponseComponent o = (BundleEntryResponseComponent) other; + return compareValues(status, o.status, true) && compareValues(location, o.location, true) && compareValues(etag, o.etag, true) + && compareValues(lastModified, o.lastModified, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (location == null || location.isEmpty()) + && (etag == null || etag.isEmpty()) && (lastModified == null || lastModified.isEmpty()); + } + + public String fhirType() { + return "Bundle.entry.response"; + + } + + } + + /** + * Indicates the purpose of this bundle- how it was intended to be used. + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", formalDefinition="Indicates the purpose of this bundle- how it was intended to be used." ) + protected Enumeration type; + + /** + * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + @Child(name = "total", type = {UnsignedIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." ) + protected UnsignedIntType total; + + /** + * A series of links that provide context to this bundle. + */ + @Child(name = "link", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." ) + protected List link; + + /** + * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). + */ + @Child(name = "entry", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Entry in the bundle - will have a resource, or information", formalDefinition="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." ) + protected List entry; + + /** + * Digital Signature - base64 encoded. XML DigSIg or a JWT. + */ + @Child(name = "signature", type = {Signature.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Digital Signature", formalDefinition="Digital Signature - base64 encoded. XML DigSIg or a JWT." ) + protected Signature signature; + + private static final long serialVersionUID = -2041954721L; + + /** + * Constructor + */ + public Bundle() { + super(); + } + + /** + * Constructor + */ + public Bundle(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). 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 Bundle.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new BundleTypeEnumFactory()); // bb + 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} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Bundle setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Indicates the purpose of this bundle- how it was intended to be used. + */ + public BundleType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Indicates the purpose of this bundle- how it was intended to be used. + */ + public Bundle setType(BundleType value) { + if (this.type == null) + this.type = new Enumeration(new BundleTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value + */ + public UnsignedIntType getTotalElement() { + if (this.total == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.total"); + else if (Configuration.doAutoCreate()) + this.total = new UnsignedIntType(); // bb + 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} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value + */ + public Bundle setTotalElement(UnsignedIntType value) { + this.total = value; + return this; + } + + /** + * @return If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + public int getTotal() { + return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue(); + } + + /** + * @param value If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + public Bundle setTotal(int value) { + if (this.total == null) + this.total = new UnsignedIntType(); + this.total.setValue(value); + return this; + } + + /** + * @return {@link #link} (A series of links that provide context to this bundle.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (BundleLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (A series of links that provide context to this bundle.) + */ + // syntactic sugar + public BundleLinkComponent addLink() { //3 + BundleLinkComponent t = new BundleLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public Bundle addLink(BundleLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + /** + * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) + */ + public List getEntry() { + if (this.entry == null) + this.entry = new ArrayList(); + return this.entry; + } + + public boolean hasEntry() { + if (this.entry == null) + return false; + for (BundleEntryComponent item : this.entry) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) + */ + // syntactic sugar + public BundleEntryComponent addEntry() { //3 + BundleEntryComponent t = new BundleEntryComponent(); + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return t; + } + + // syntactic sugar + public Bundle addEntry(BundleEntryComponent t) { //3 + if (t == null) + return this; + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return this; + } + + /** + * @return {@link #signature} (Digital Signature - base64 encoded. XML DigSIg or a JWT.) + */ + public Signature getSignature() { + if (this.signature == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.signature"); + else if (Configuration.doAutoCreate()) + this.signature = new Signature(); // cc + return this.signature; + } + + public boolean hasSignature() { + return this.signature != null && !this.signature.isEmpty(); + } + + /** + * @param value {@link #signature} (Digital Signature - base64 encoded. XML DigSIg or a JWT.) + */ + public Bundle setSignature(Signature value) { + this.signature = value; + return this; + } + + /** + * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. + * If no link is found which matches the given relation, returns null. If more than one + * link is found which matches the given relation, returns the first matching BundleLinkComponent. + * + * @param theRelation + * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. + * @return Returns a matching BundleLinkComponent, or null + * @see IBaseBundle#LINK_NEXT + * @see IBaseBundle#LINK_PREV + * @see IBaseBundle#LINK_SELF + */ + public BundleLinkComponent getLink(String theRelation) { + org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); + for (BundleLinkComponent next : getLink()) { + if (theRelation.equals(next.getRelation())) { + return next; + } + } + return null; + } + + /** + * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. + * If no link is found which matches the given relation, creates a new BundleLinkComponent with the + * given relation and adds it to this Bundle. If more than one + * link is found which matches the given relation, returns the first matching BundleLinkComponent. + * + * @param theRelation + * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. + * @return Returns a matching BundleLinkComponent, or null + * @see IBaseBundle#LINK_NEXT + * @see IBaseBundle#LINK_PREV + * @see IBaseBundle#LINK_SELF + */ + public BundleLinkComponent getLinkOrCreate(String theRelation) { + org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); + for (BundleLinkComponent next : getLink()) { + if (theRelation.equals(next.getRelation())) { + return next; + } + } + BundleLinkComponent retVal = new BundleLinkComponent(); + retVal.setRelation(theRelation); + getLink().add(retVal); + return retVal; + } + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle- how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("total", "unsignedInt", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total)); + childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).", 0, java.lang.Integer.MAX_VALUE, entry)); + childrenList.add(new Property("signature", "Signature", "Digital Signature - base64 encoded. XML DigSIg or a JWT.", 0, java.lang.Integer.MAX_VALUE, signature)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // UnsignedIntType + case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent + case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // BundleEntryComponent + case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : new Base[] {this.signature}; // Signature + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration + break; + case 110549828: // total + this.total = castToUnsignedInt(value); // UnsignedIntType + break; + case 3321850: // link + this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent + break; + case 96667762: // entry + this.getEntry().add((BundleEntryComponent) value); // BundleEntryComponent + break; + case 1073584312: // signature + this.signature = castToSignature(value); // Signature + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("total")) + this.total = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("link")) + this.getLink().add((BundleLinkComponent) value); + else if (name.equals("entry")) + this.getEntry().add((BundleEntryComponent) value); + else if (name.equals("signature")) + this.signature = castToSignature(value); // Signature + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 110549828: throw new FHIRException("Cannot make property total as it is not a complex type"); // UnsignedIntType + case 3321850: return addLink(); // BundleLinkComponent + case 96667762: return addEntry(); // BundleEntryComponent + case 1073584312: return getSignature(); // Signature + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.type"); + } + else if (name.equals("total")) { + throw new FHIRException("Cannot call addChild on a primitive type Bundle.total"); + } + else if (name.equals("link")) { + return addLink(); + } + else if (name.equals("entry")) { + return addEntry(); + } + else if (name.equals("signature")) { + this.signature = new Signature(); + return this.signature; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Bundle"; + + } + + public Bundle copy() { + Bundle dst = new Bundle(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.total = total == null ? null : total.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (BundleLinkComponent i : link) + dst.link.add(i.copy()); + }; + if (entry != null) { + dst.entry = new ArrayList(); + for (BundleEntryComponent i : entry) + dst.entry.add(i.copy()); + }; + dst.signature = signature == null ? null : signature.copy(); + return dst; + } + + protected Bundle typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Bundle)) + return false; + Bundle o = (Bundle) other; + return compareDeep(type, o.type, true) && compareDeep(total, o.total, true) && compareDeep(link, o.link, true) + && compareDeep(entry, o.entry, true) && compareDeep(signature, o.signature, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Bundle)) + return false; + Bundle o = (Bundle) other; + return compareValues(type, o.type, true) && compareValues(total, o.total, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (total == null || total.isEmpty()) + && (link == null || link.isEmpty()) && (entry == null || entry.isEmpty()) && (signature == null || signature.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Bundle; + } + + /** + * Search parameter: message + *

+ * Description: The first resource in the bundle, if the bundle type is "message" - this is a message header, and this parameter provides access to search its contents
+ * Type: reference
+ * Path: Bundle.entry.resource(0)
+ *

+ */ + @SearchParamDefinition(name="message", path="Bundle.entry.resource[0]", description="The first resource in the bundle, if the bundle type is \"message\" - this is a message header, and this parameter provides access to search its contents", type="reference" ) + public static final String SP_MESSAGE = "message"; + /** + * Fluent Client search parameter constant for message + *

+ * Description: The first resource in the bundle, if the bundle type is "message" - this is a message header, and this parameter provides access to search its contents
+ * Type: reference
+ * Path: Bundle.entry.resource(0)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MESSAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MESSAGE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Bundle:message". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_MESSAGE = new ca.uhn.fhir.model.api.Include("Bundle:message").toLocked(); + + /** + * Search parameter: composition + *

+ * Description: The first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to searches its contents
+ * Type: reference
+ * Path: Bundle.entry.resource(0)
+ *

+ */ + @SearchParamDefinition(name="composition", path="Bundle.entry.resource[0]", description="The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to searches its contents", type="reference" ) + public static final String SP_COMPOSITION = "composition"; + /** + * Fluent Client search parameter constant for composition + *

+ * Description: The first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to searches its contents
+ * Type: reference
+ * Path: Bundle.entry.resource(0)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COMPOSITION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Bundle:composition". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSITION = new ca.uhn.fhir.model.api.Include("Bundle:composition").toLocked(); + + /** + * Search parameter: type + *

+ * Description: document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection
+ * Type: token
+ * Path: Bundle.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Bundle.type", description="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection
+ * Type: token
+ * Path: Bundle.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CarePlan.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CarePlan.java new file mode 100644 index 00000000000..d00e09c3702 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CarePlan.java @@ -0,0 +1,3767 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. + */ +@ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan") +public class CarePlan extends DomainResource { + + public enum CarePlanStatus { + /** + * The plan has been suggested but no commitment to it has yet been made. + */ + PROPOSED, + /** + * The plan is in development or awaiting use but is not yet intended to be acted upon. + */ + DRAFT, + /** + * 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, + /** + * The plan has been terminated prior to reaching completion (though it may have been replaced by a new plan). + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static CarePlanStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("draft".equals(codeString)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new FHIRException("Unknown CarePlanStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return "http://hl7.org/fhir/care-plan-status"; + case DRAFT: return "http://hl7.org/fhir/care-plan-status"; + case ACTIVE: return "http://hl7.org/fhir/care-plan-status"; + case COMPLETED: return "http://hl7.org/fhir/care-plan-status"; + case CANCELLED: return "http://hl7.org/fhir/care-plan-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The plan has been suggested but no commitment to it has yet been made."; + case DRAFT: 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."; + case CANCELLED: return "The plan has been terminated prior to reaching completion (though it may have been replaced by a new plan)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case DRAFT: return "Pending"; + case ACTIVE: return "Active"; + case COMPLETED: return "Completed"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + 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; + if ("proposed".equals(codeString)) + return CarePlanStatus.PROPOSED; + if ("draft".equals(codeString)) + return CarePlanStatus.DRAFT; + if ("active".equals(codeString)) + return CarePlanStatus.ACTIVE; + if ("completed".equals(codeString)) + return CarePlanStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return CarePlanStatus.CANCELLED; + throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return new Enumeration(this, CarePlanStatus.PROPOSED); + if ("draft".equals(codeString)) + return new Enumeration(this, CarePlanStatus.DRAFT); + if ("active".equals(codeString)) + return new Enumeration(this, CarePlanStatus.ACTIVE); + if ("completed".equals(codeString)) + return new Enumeration(this, CarePlanStatus.COMPLETED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, CarePlanStatus.CANCELLED); + throw new FHIRException("Unknown CarePlanStatus code '"+codeString+"'"); + } + public String toCode(CarePlanStatus code) { + if (code == CarePlanStatus.PROPOSED) + return "proposed"; + if (code == CarePlanStatus.DRAFT) + return "draft"; + if (code == CarePlanStatus.ACTIVE) + return "active"; + if (code == CarePlanStatus.COMPLETED) + return "completed"; + if (code == CarePlanStatus.CANCELLED) + return "cancelled"; + return "?"; + } + public String toSystem(CarePlanStatus code) { + return code.getSystem(); + } + } + + public enum CarePlanRelationship { + /** + * The referenced plan is considered to be part of this plan. + */ + INCLUDES, + /** + * This plan takes the places of the referenced plan. + */ + REPLACES, + /** + * This plan provides details about how to perform activities defined at a higher level by the referenced plan. + */ + FULFILLS, + /** + * added to help the parsers + */ + NULL; + public static CarePlanRelationship fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("includes".equals(codeString)) + return INCLUDES; + if ("replaces".equals(codeString)) + return REPLACES; + if ("fulfills".equals(codeString)) + return FULFILLS; + throw new FHIRException("Unknown CarePlanRelationship code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INCLUDES: return "includes"; + case REPLACES: return "replaces"; + case FULFILLS: return "fulfills"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INCLUDES: return "http://hl7.org/fhir/care-plan-relationship"; + case REPLACES: return "http://hl7.org/fhir/care-plan-relationship"; + case FULFILLS: return "http://hl7.org/fhir/care-plan-relationship"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INCLUDES: return "The referenced plan is considered to be part of this plan."; + case REPLACES: return "This plan takes the places of the referenced plan."; + case FULFILLS: return "This plan provides details about how to perform activities defined at a higher level by the referenced plan."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INCLUDES: return "Includes"; + case REPLACES: return "Replaces"; + case FULFILLS: return "Fulfills"; + default: return "?"; + } + } + } + + public static class CarePlanRelationshipEnumFactory implements EnumFactory { + public CarePlanRelationship fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("includes".equals(codeString)) + return CarePlanRelationship.INCLUDES; + if ("replaces".equals(codeString)) + return CarePlanRelationship.REPLACES; + if ("fulfills".equals(codeString)) + return CarePlanRelationship.FULFILLS; + throw new IllegalArgumentException("Unknown CarePlanRelationship code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("includes".equals(codeString)) + return new Enumeration(this, CarePlanRelationship.INCLUDES); + if ("replaces".equals(codeString)) + return new Enumeration(this, CarePlanRelationship.REPLACES); + if ("fulfills".equals(codeString)) + return new Enumeration(this, CarePlanRelationship.FULFILLS); + throw new FHIRException("Unknown CarePlanRelationship code '"+codeString+"'"); + } + public String toCode(CarePlanRelationship code) { + if (code == CarePlanRelationship.INCLUDES) + return "includes"; + if (code == CarePlanRelationship.REPLACES) + return "replaces"; + if (code == CarePlanRelationship.FULFILLS) + return "fulfills"; + return "?"; + } + public String toSystem(CarePlanRelationship code) { + return code.getSystem(); + } + } + + public enum CarePlanActivityStatus { + /** + * 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 CarePlanActivityStatus fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown CarePlanActivityStatus code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/care-plan-activity-status"; + case SCHEDULED: return "http://hl7.org/fhir/care-plan-activity-status"; + case INPROGRESS: return "http://hl7.org/fhir/care-plan-activity-status"; + case ONHOLD: return "http://hl7.org/fhir/care-plan-activity-status"; + case COMPLETED: return "http://hl7.org/fhir/care-plan-activity-status"; + case CANCELLED: return "http://hl7.org/fhir/care-plan-activity-status"; + 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 CarePlanActivityStatusEnumFactory implements EnumFactory { + public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-started".equals(codeString)) + return CarePlanActivityStatus.NOTSTARTED; + if ("scheduled".equals(codeString)) + return CarePlanActivityStatus.SCHEDULED; + if ("in-progress".equals(codeString)) + return CarePlanActivityStatus.INPROGRESS; + if ("on-hold".equals(codeString)) + return CarePlanActivityStatus.ONHOLD; + if ("completed".equals(codeString)) + return CarePlanActivityStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return CarePlanActivityStatus.CANCELLED; + throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("not-started".equals(codeString)) + return new Enumeration(this, CarePlanActivityStatus.NOTSTARTED); + if ("scheduled".equals(codeString)) + return new Enumeration(this, CarePlanActivityStatus.SCHEDULED); + if ("in-progress".equals(codeString)) + return new Enumeration(this, CarePlanActivityStatus.INPROGRESS); + if ("on-hold".equals(codeString)) + return new Enumeration(this, CarePlanActivityStatus.ONHOLD); + if ("completed".equals(codeString)) + return new Enumeration(this, CarePlanActivityStatus.COMPLETED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, CarePlanActivityStatus.CANCELLED); + throw new FHIRException("Unknown CarePlanActivityStatus code '"+codeString+"'"); + } + public String toCode(CarePlanActivityStatus code) { + if (code == CarePlanActivityStatus.NOTSTARTED) + return "not-started"; + if (code == CarePlanActivityStatus.SCHEDULED) + return "scheduled"; + if (code == CarePlanActivityStatus.INPROGRESS) + return "in-progress"; + if (code == CarePlanActivityStatus.ONHOLD) + return "on-hold"; + if (code == CarePlanActivityStatus.COMPLETED) + return "completed"; + if (code == CarePlanActivityStatus.CANCELLED) + return "cancelled"; + return "?"; + } + public String toSystem(CarePlanActivityStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class CarePlanRelatedPlanComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the type of relationship this plan has to the target plan. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="includes | replaces | fulfills", formalDefinition="Identifies the type of relationship this plan has to the target plan." ) + protected Enumeration code; + + /** + * A reference to the plan to which a relationship is asserted. + */ + @Child(name = "plan", type = {CarePlan.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Plan relationship exists with", formalDefinition="A reference to the plan to which a relationship is asserted." ) + protected Reference plan; + + /** + * The actual object that is the target of the reference (A reference to the plan to which a relationship is asserted.) + */ + protected CarePlan planTarget; + + private static final long serialVersionUID = 1875598050L; + + /** + * Constructor + */ + public CarePlanRelatedPlanComponent() { + super(); + } + + /** + * Constructor + */ + public CarePlanRelatedPlanComponent(Reference plan) { + super(); + this.plan = plan; + } + + /** + * @return {@link #code} (Identifies the type of relationship this plan has to the target plan.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanRelatedPlanComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new CarePlanRelationshipEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identifies the type of relationship this plan has to the target plan.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CarePlanRelatedPlanComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Identifies the type of relationship this plan has to the target plan. + */ + public CarePlanRelationship getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identifies the type of relationship this plan has to the target plan. + */ + public CarePlanRelatedPlanComponent setCode(CarePlanRelationship value) { + if (value == null) + this.code = null; + else { + if (this.code == null) + this.code = new Enumeration(new CarePlanRelationshipEnumFactory()); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #plan} (A reference to the plan to which a relationship is asserted.) + */ + public Reference getPlan() { + if (this.plan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanRelatedPlanComponent.plan"); + else if (Configuration.doAutoCreate()) + this.plan = new Reference(); // cc + return this.plan; + } + + public boolean hasPlan() { + return this.plan != null && !this.plan.isEmpty(); + } + + /** + * @param value {@link #plan} (A reference to the plan to which a relationship is asserted.) + */ + public CarePlanRelatedPlanComponent 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. (A reference to the plan to which a relationship is asserted.) + */ + public CarePlan getPlanTarget() { + if (this.planTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanRelatedPlanComponent.plan"); + else if (Configuration.doAutoCreate()) + this.planTarget = new CarePlan(); // aa + 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. (A reference to the plan to which a relationship is asserted.) + */ + public CarePlanRelatedPlanComponent setPlanTarget(CarePlan value) { + this.planTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Identifies the type of relationship this plan has to the target plan.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("plan", "Reference(CarePlan)", "A reference to the plan to which a relationship is asserted.", 0, java.lang.Integer.MAX_VALUE, plan)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration + case 3443497: /*plan*/ return this.plan == null ? new Base[0] : new Base[] {this.plan}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = new CarePlanRelationshipEnumFactory().fromType(value); // Enumeration + break; + case 3443497: // plan + this.plan = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = new CarePlanRelationshipEnumFactory().fromType(value); // Enumeration + else if (name.equals("plan")) + this.plan = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration + case 3443497: return getPlan(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type CarePlan.code"); + } + else if (name.equals("plan")) { + this.plan = new Reference(); + return this.plan; + } + else + return super.addChild(name); + } + + public CarePlanRelatedPlanComponent copy() { + CarePlanRelatedPlanComponent dst = new CarePlanRelatedPlanComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.plan = plan == null ? null : plan.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlanRelatedPlanComponent)) + return false; + CarePlanRelatedPlanComponent o = (CarePlanRelatedPlanComponent) other; + return compareDeep(code, o.code, true) && compareDeep(plan, o.plan, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlanRelatedPlanComponent)) + return false; + CarePlanRelatedPlanComponent o = (CarePlanRelatedPlanComponent) other; + return compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (plan == null || plan.isEmpty()) + ; + } + + public String fhirType() { + return "CarePlan.relatedPlan"; + + } + + } + + @Block() + public static class CarePlanParticipantComponent extends BackboneElement implements IBaseBackboneElement { + /** + * 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, modifier=false, summary=false) + @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=0, max=1, modifier=false, summary=false) + @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; + + /** + * Constructor + */ + public CarePlanParticipantComponent() { + super(); + } + + /** + * @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 CarePlanParticipantComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + 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 CarePlanParticipantComponent 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 CarePlanParticipantComponent.member"); + else if (Configuration.doAutoCreate()) + this.member = new Reference(); // cc + 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 CarePlanParticipantComponent 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 CarePlanParticipantComponent 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept + case -1077769574: /*member*/ return this.member == null ? new Base[0] : new Base[] {this.member}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3506294: // role + this.role = castToCodeableConcept(value); // CodeableConcept + break; + case -1077769574: // member + this.member = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("role")) + this.role = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("member")) + this.member = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3506294: return getRole(); // CodeableConcept + case -1077769574: return getMember(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("role")) { + this.role = new CodeableConcept(); + return this.role; + } + else if (name.equals("member")) { + this.member = new Reference(); + return this.member; + } + else + return super.addChild(name); + } + + public CarePlanParticipantComponent copy() { + CarePlanParticipantComponent dst = new CarePlanParticipantComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.member = member == null ? null : member.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlanParticipantComponent)) + return false; + CarePlanParticipantComponent o = (CarePlanParticipantComponent) other; + return compareDeep(role, o.role, true) && compareDeep(member, o.member, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlanParticipantComponent)) + return false; + CarePlanParticipantComponent o = (CarePlanParticipantComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (member == null || member.isEmpty()) + ; + } + + public String fhirType() { + return "CarePlan.participant"; + + } + + } + + @Block() + public static class CarePlanActivityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. + */ + @Child(name = "actionResulting", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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 adherence/status/progress of the activity. + */ + @Child(name = "progress", type = {Annotation.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Comments about the activity status/progress", formalDefinition="Notes about the adherence/status/progress of the activity." ) + protected List progress; + + /** + * The details of the proposed activity represented in a specific resource. + */ + @Child(name = "reference", type = {Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationOrder.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, SupplyRequest.class, VisionPrescription.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) + protected Reference reference; + + /** + * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) + */ + protected Resource referenceTarget; + + /** + * A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. + */ + @Child(name = "detail", type = {}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="In-line definition of activity", formalDefinition="A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) + protected CarePlanActivityDetailComponent detail; + + private static final long serialVersionUID = 40181608L; + + /** + * Constructor + */ + public CarePlanActivityComponent() { + super(); + } + + /** + * @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; + } + + // syntactic sugar + public CarePlanActivityComponent addActionResulting(Reference t) { //3 + if (t == null) + return this; + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + this.actionResulting.add(t); + return this; + } + + /** + * @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 #progress} (Notes about the adherence/status/progress of the activity.) + */ + public List getProgress() { + if (this.progress == null) + this.progress = new ArrayList(); + return this.progress; + } + + public boolean hasProgress() { + if (this.progress == null) + return false; + for (Annotation item : this.progress) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #progress} (Notes about the adherence/status/progress of the activity.) + */ + // syntactic sugar + public Annotation addProgress() { //3 + Annotation t = new Annotation(); + if (this.progress == null) + this.progress = new ArrayList(); + this.progress.add(t); + return t; + } + + // syntactic sugar + public CarePlanActivityComponent addProgress(Annotation t) { //3 + if (t == null) + return this; + if (this.progress == null) + this.progress = new ArrayList(); + this.progress.add(t); + return this; + } + + /** + * @return {@link #reference} (The details of the proposed activity represented in a specific resource.) + */ + public Reference getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Reference(); // cc + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (The details of the proposed activity represented in a specific resource.) + */ + public CarePlanActivityComponent setReference(Reference value) { + this.reference = value; + return this; + } + + /** + * @return {@link #reference} 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 getReferenceTarget() { + return this.referenceTarget; + } + + /** + * @param value {@link #reference} 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 CarePlanActivityComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; + return this; + } + + /** + * @return {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CarePlanActivityDetailComponent getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new CarePlanActivityDetailComponent(); // cc + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CarePlanActivityComponent setDetail(CarePlanActivityDetailComponent value) { + this.detail = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("progress", "Annotation", "Notes about the adherence/status/progress of the activity.", 0, java.lang.Integer.MAX_VALUE, progress)); + childrenList.add(new Property("reference", "Reference(Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationOrder|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|SupplyRequest|VisionPrescription)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("detail", "", "A simple summary of a planned activity 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, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 836386063: /*actionResulting*/ return this.actionResulting == null ? new Base[0] : this.actionResulting.toArray(new Base[this.actionResulting.size()]); // Reference + case -1001078227: /*progress*/ return this.progress == null ? new Base[0] : this.progress.toArray(new Base[this.progress.size()]); // Annotation + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // CarePlanActivityDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 836386063: // actionResulting + this.getActionResulting().add(castToReference(value)); // Reference + break; + case -1001078227: // progress + this.getProgress().add(castToAnnotation(value)); // Annotation + break; + case -925155509: // reference + this.reference = castToReference(value); // Reference + break; + case -1335224239: // detail + this.detail = (CarePlanActivityDetailComponent) value; // CarePlanActivityDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("actionResulting")) + this.getActionResulting().add(castToReference(value)); + else if (name.equals("progress")) + this.getProgress().add(castToAnnotation(value)); + else if (name.equals("reference")) + this.reference = castToReference(value); // Reference + else if (name.equals("detail")) + this.detail = (CarePlanActivityDetailComponent) value; // CarePlanActivityDetailComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 836386063: return addActionResulting(); // Reference + case -1001078227: return addProgress(); // Annotation + case -925155509: return getReference(); // Reference + case -1335224239: return getDetail(); // CarePlanActivityDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("actionResulting")) { + return addActionResulting(); + } + else if (name.equals("progress")) { + return addProgress(); + } + else if (name.equals("reference")) { + this.reference = new Reference(); + return this.reference; + } + else if (name.equals("detail")) { + this.detail = new CarePlanActivityDetailComponent(); + return this.detail; + } + else + return super.addChild(name); + } + + public CarePlanActivityComponent copy() { + CarePlanActivityComponent dst = new CarePlanActivityComponent(); + copyValues(dst); + if (actionResulting != null) { + dst.actionResulting = new ArrayList(); + for (Reference i : actionResulting) + dst.actionResulting.add(i.copy()); + }; + if (progress != null) { + dst.progress = new ArrayList(); + for (Annotation i : progress) + dst.progress.add(i.copy()); + }; + dst.reference = reference == null ? null : reference.copy(); + dst.detail = detail == null ? null : detail.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlanActivityComponent)) + return false; + CarePlanActivityComponent o = (CarePlanActivityComponent) other; + return compareDeep(actionResulting, o.actionResulting, true) && compareDeep(progress, o.progress, true) + && compareDeep(reference, o.reference, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlanActivityComponent)) + return false; + CarePlanActivityComponent o = (CarePlanActivityComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (actionResulting == null || actionResulting.isEmpty()) && (progress == null || progress.isEmpty()) + && (reference == null || reference.isEmpty()) && (detail == null || detail.isEmpty()); + } + + public String fhirType() { + return "CarePlan.activity"; + + } + + } + + @Block() + public static class CarePlanActivityDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * High-level categorization of the type of activity in a care plan. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) + protected CodeableConcept category; + + /** + * Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter." ) + protected CodeableConcept code; + + /** + * Provides the rationale that drove the inclusion of this particular activity as part of the plan. + */ + @Child(name = "reasonCode", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Why activity should be done", formalDefinition="Provides the rationale that drove the inclusion of this particular activity as part of the plan." ) + protected List reasonCode; + + /** + * Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan. + */ + @Child(name = "reasonReference", type = {Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Condition triggering need for activity", formalDefinition="Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan." ) + protected List reasonReference; + /** + * The actual objects that are the target of the reference (Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) + */ + protected List reasonReferenceTarget; + + + /** + * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. + */ + @Child(name = "goal", type = {Goal.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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=6, min=0, max=1, modifier=true, summary=false) + @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; + + /** + * Provides reason why the activity isn't yet started, is on hold, was cancelled, etc. + */ + @Child(name = "statusReason", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reason for current status", formalDefinition="Provides reason why the activity isn't yet started, is on hold, was cancelled, etc." ) + protected CodeableConcept statusReason; + + /** + * 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=8, min=1, max=1, modifier=true, summary=false) + @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; + + /** + * The period, timing or frequency upon which the described activity is to occur. + */ + @Child(name = "scheduled", type = {Timing.class, Period.class, StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @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=10, min=0, max=1, modifier=false, summary=false) + @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=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Who will be 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 to be consumed or supplied in the activity. + */ + @Child(name = "product", type = {CodeableConcept.class, Medication.class, Substance.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="What is to be administered/supplied", formalDefinition="Identifies the food, drug or other product to be consumed or supplied in the activity." ) + protected Type product; + + /** + * Identifies the quantity expected to be consumed in a given day. + */ + @Child(name = "dailyAmount", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="How to consume/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) + protected SimpleQuantity dailyAmount; + + /** + * Identifies the quantity expected to be supplied, administered or consumed by the subject. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="How much to administer/supply/consume", formalDefinition="Identifies the quantity expected to be supplied, administered or consumed by the subject." ) + protected SimpleQuantity quantity; + + /** + * This provides a textual description of constraints on the intended 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 = "description", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Extra info describing activity to perform", formalDefinition="This provides a textual description of constraints on the intended 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 description; + + private static final long serialVersionUID = -1763965702L; + + /** + * Constructor + */ + public CarePlanActivityDetailComponent() { + super(); + } + + /** + * Constructor + */ + public CarePlanActivityDetailComponent(BooleanType prohibited) { + super(); + this.prohibited = prohibited; + } + + /** + * @return {@link #category} (High-level categorization of the type of activity in a care plan.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + 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.) + */ + public CarePlanActivityDetailComponent setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #code} (Detailed description of the type of planned 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 CarePlanActivityDetailComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.) + */ + public CarePlanActivityDetailComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #reasonCode} (Provides the rationale that drove the inclusion of this particular activity as part of the plan.) + */ + public List getReasonCode() { + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + return this.reasonCode; + } + + public boolean hasReasonCode() { + if (this.reasonCode == null) + return false; + for (CodeableConcept item : this.reasonCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonCode} (Provides the rationale that drove the inclusion of this particular activity as part of the plan.) + */ + // syntactic sugar + public CodeableConcept addReasonCode() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + this.reasonCode.add(t); + return t; + } + + // syntactic sugar + public CarePlanActivityDetailComponent addReasonCode(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + this.reasonCode.add(t); + return this; + } + + /** + * @return {@link #reasonReference} (Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) + */ + public List getReasonReference() { + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + return this.reasonReference; + } + + public boolean hasReasonReference() { + if (this.reasonReference == null) + return false; + for (Reference item : this.reasonReference) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonReference} (Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) + */ + // syntactic sugar + public Reference addReasonReference() { //3 + Reference t = new Reference(); + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + this.reasonReference.add(t); + return t; + } + + // syntactic sugar + public CarePlanActivityDetailComponent addReasonReference(Reference t) { //3 + if (t == null) + return this; + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + this.reasonReference.add(t); + return this; + } + + /** + * @return {@link #reasonReference} (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. Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) + */ + public List getReasonReferenceTarget() { + if (this.reasonReferenceTarget == null) + this.reasonReferenceTarget = new ArrayList(); + return this.reasonReferenceTarget; + } + + // syntactic sugar + /** + * @return {@link #reasonReference} (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. Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) + */ + public Condition addReasonReferenceTarget() { + Condition r = new Condition(); + if (this.reasonReferenceTarget == null) + this.reasonReferenceTarget = new ArrayList(); + this.reasonReferenceTarget.add(r); + return r; + } + + /** + * @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; + } + + // syntactic sugar + public CarePlanActivityDetailComponent addGoal(Reference t) { //3 + if (t == null) + return this; + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return this; + } + + /** + * @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 CarePlanActivityDetailComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CarePlanActivityStatusEnumFactory()); // bb + 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 CarePlanActivityDetailComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Identifies what progress is being made for the specific activity. + */ + public CarePlanActivityStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Identifies what progress is being made for the specific activity. + */ + public CarePlanActivityDetailComponent setStatus(CarePlanActivityStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new CarePlanActivityStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.) + */ + public CodeableConcept getStatusReason() { + if (this.statusReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.statusReason"); + else if (Configuration.doAutoCreate()) + this.statusReason = new CodeableConcept(); // cc + return this.statusReason; + } + + public boolean hasStatusReason() { + return this.statusReason != null && !this.statusReason.isEmpty(); + } + + /** + * @param value {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.) + */ + public CarePlanActivityDetailComponent setStatusReason(CodeableConcept value) { + this.statusReason = 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 CarePlanActivityDetailComponent.prohibited"); + else if (Configuration.doAutoCreate()) + this.prohibited = new BooleanType(); // bb + 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 CarePlanActivityDetailComponent 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 || this.prohibited.isEmpty() ? 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 CarePlanActivityDetailComponent setProhibited(boolean value) { + if (this.prohibited == null) + this.prohibited = new BooleanType(); + this.prohibited.setValue(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 FHIRException { + if (!(this.scheduled instanceof Timing)) + throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + public boolean hasScheduledTiming() { + return this.scheduled instanceof Timing; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Period getScheduledPeriod() throws FHIRException { + if (!(this.scheduled instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + public boolean hasScheduledPeriod() { + return this.scheduled instanceof Period; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public StringType getScheduledStringType() throws FHIRException { + if (!(this.scheduled instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (StringType) this.scheduled; + } + + public boolean hasScheduledStringType() { + return this.scheduled instanceof StringType; + } + + 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 CarePlanActivityDetailComponent 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 CarePlanActivityDetailComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + 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 CarePlanActivityDetailComponent 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 CarePlanActivityDetailComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + 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 CarePlanActivityDetailComponent 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; + } + + // syntactic sugar + public CarePlanActivityDetailComponent addPerformer(Reference t) { //3 + if (t == null) + return this; + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return this; + } + + /** + * @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 to be consumed or supplied in the activity.) + */ + public Type getProduct() { + return this.product; + } + + /** + * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) + */ + public CodeableConcept getProductCodeableConcept() throws FHIRException { + if (!(this.product instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.product.getClass().getName()+" was encountered"); + return (CodeableConcept) this.product; + } + + public boolean hasProductCodeableConcept() { + return this.product instanceof CodeableConcept; + } + + /** + * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) + */ + public Reference getProductReference() throws FHIRException { + if (!(this.product instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.product.getClass().getName()+" was encountered"); + return (Reference) this.product; + } + + public boolean hasProductReference() { + return this.product instanceof Reference; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) + */ + public CarePlanActivityDetailComponent setProduct(Type value) { + this.product = value; + return this; + } + + /** + * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public SimpleQuantity getDailyAmount() { + if (this.dailyAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.dailyAmount"); + else if (Configuration.doAutoCreate()) + this.dailyAmount = new SimpleQuantity(); // cc + 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 CarePlanActivityDetailComponent setDailyAmount(SimpleQuantity value) { + this.dailyAmount = value; + return this; + } + + /** + * @return {@link #quantity} (Identifies the quantity expected to be supplied, administered or consumed by the subject.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Identifies the quantity expected to be supplied, administered or consumed by the subject.) + */ + public CarePlanActivityDetailComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #description} (This provides a textual description of constraints on the intended 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 "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (This provides a textual description of constraints on the intended 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 "getDescription" gives direct access to the value + */ + public CarePlanActivityDetailComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return This provides a textual description of constraints on the intended 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 getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value This provides a textual description of constraints on the intended 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 CarePlanActivityDetailComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "CodeableConcept", "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 planned activity; e.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("reasonCode", "CodeableConcept", "Provides the rationale that drove the inclusion of this particular activity as part of the plan.", 0, java.lang.Integer.MAX_VALUE, reasonCode)); + childrenList.add(new Property("reasonReference", "Reference(Condition)", "Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.", 0, java.lang.Integer.MAX_VALUE, reasonReference)); + 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("statusReason", "CodeableConcept", "Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusReason)); + 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("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[x]", "CodeableConcept|Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("dailyAmount", "SimpleQuantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); + childrenList.add(new Property("quantity", "SimpleQuantity", "Identifies the quantity expected to be supplied, administered or consumed by the subject.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("description", "string", "This provides a textual description of constraints on the intended 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, description)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept + case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference + case 3178259: /*goal*/ return this.goal == null ? new Base[0] : this.goal.toArray(new Base[this.goal.size()]); // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept + case 663275198: /*prohibited*/ return this.prohibited == null ? new Base[0] : new Base[] {this.prohibited}; // BooleanType + case -160710483: /*scheduled*/ return this.scheduled == null ? new Base[0] : new Base[] {this.scheduled}; // Type + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference + case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Type + case -768908335: /*dailyAmount*/ return this.dailyAmount == null ? new Base[0] : new Base[] {this.dailyAmount}; // SimpleQuantity + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 722137681: // reasonCode + this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1146218137: // reasonReference + this.getReasonReference().add(castToReference(value)); // Reference + break; + case 3178259: // goal + this.getGoal().add(castToReference(value)); // Reference + break; + case -892481550: // status + this.status = new CarePlanActivityStatusEnumFactory().fromType(value); // Enumeration + break; + case 2051346646: // statusReason + this.statusReason = castToCodeableConcept(value); // CodeableConcept + break; + case 663275198: // prohibited + this.prohibited = castToBoolean(value); // BooleanType + break; + case -160710483: // scheduled + this.scheduled = (Type) value; // Type + break; + case 1901043637: // location + this.location = castToReference(value); // Reference + break; + case 481140686: // performer + this.getPerformer().add(castToReference(value)); // Reference + break; + case -309474065: // product + this.product = (Type) value; // Type + break; + case -768908335: // dailyAmount + this.dailyAmount = castToSimpleQuantity(value); // SimpleQuantity + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("reasonCode")) + this.getReasonCode().add(castToCodeableConcept(value)); + else if (name.equals("reasonReference")) + this.getReasonReference().add(castToReference(value)); + else if (name.equals("goal")) + this.getGoal().add(castToReference(value)); + else if (name.equals("status")) + this.status = new CarePlanActivityStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("statusReason")) + this.statusReason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("prohibited")) + this.prohibited = castToBoolean(value); // BooleanType + else if (name.equals("scheduled[x]")) + this.scheduled = (Type) value; // Type + else if (name.equals("location")) + this.location = castToReference(value); // Reference + else if (name.equals("performer")) + this.getPerformer().add(castToReference(value)); + else if (name.equals("product[x]")) + this.product = (Type) value; // Type + else if (name.equals("dailyAmount")) + this.dailyAmount = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("description")) + this.description = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // CodeableConcept + case 3059181: return getCode(); // CodeableConcept + case 722137681: return addReasonCode(); // CodeableConcept + case -1146218137: return addReasonReference(); // Reference + case 3178259: return addGoal(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 2051346646: return getStatusReason(); // CodeableConcept + case 663275198: throw new FHIRException("Cannot make property prohibited as it is not a complex type"); // BooleanType + case 1162627251: return getScheduled(); // Type + case 1901043637: return getLocation(); // Reference + case 481140686: return addPerformer(); // Reference + case 1753005361: return getProduct(); // Type + case -768908335: return getDailyAmount(); // SimpleQuantity + case -1285004149: return getQuantity(); // SimpleQuantity + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("reasonCode")) { + return addReasonCode(); + } + else if (name.equals("reasonReference")) { + return addReasonReference(); + } + else if (name.equals("goal")) { + return addGoal(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type CarePlan.status"); + } + else if (name.equals("statusReason")) { + this.statusReason = new CodeableConcept(); + return this.statusReason; + } + else if (name.equals("prohibited")) { + throw new FHIRException("Cannot call addChild on a primitive type CarePlan.prohibited"); + } + else if (name.equals("scheduledTiming")) { + this.scheduled = new Timing(); + return this.scheduled; + } + else if (name.equals("scheduledPeriod")) { + this.scheduled = new Period(); + return this.scheduled; + } + else if (name.equals("scheduledString")) { + this.scheduled = new StringType(); + return this.scheduled; + } + else if (name.equals("location")) { + this.location = new Reference(); + return this.location; + } + else if (name.equals("performer")) { + return addPerformer(); + } + else if (name.equals("productCodeableConcept")) { + this.product = new CodeableConcept(); + return this.product; + } + else if (name.equals("productReference")) { + this.product = new Reference(); + return this.product; + } + else if (name.equals("dailyAmount")) { + this.dailyAmount = new SimpleQuantity(); + return this.dailyAmount; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type CarePlan.description"); + } + else + return super.addChild(name); + } + + public CarePlanActivityDetailComponent copy() { + CarePlanActivityDetailComponent dst = new CarePlanActivityDetailComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + if (reasonCode != null) { + dst.reasonCode = new ArrayList(); + for (CodeableConcept i : reasonCode) + dst.reasonCode.add(i.copy()); + }; + if (reasonReference != null) { + dst.reasonReference = new ArrayList(); + for (Reference i : reasonReference) + dst.reasonReference.add(i.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.statusReason = statusReason == null ? null : statusReason.copy(); + dst.prohibited = prohibited == null ? null : prohibited.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.description = description == null ? null : description.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlanActivityDetailComponent)) + return false; + CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other; + return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(reasonCode, o.reasonCode, true) + && compareDeep(reasonReference, o.reasonReference, true) && compareDeep(goal, o.goal, true) && compareDeep(status, o.status, true) + && compareDeep(statusReason, o.statusReason, true) && compareDeep(prohibited, o.prohibited, true) + && compareDeep(scheduled, o.scheduled, true) && compareDeep(location, o.location, true) && compareDeep(performer, o.performer, true) + && compareDeep(product, o.product, true) && compareDeep(dailyAmount, o.dailyAmount, true) && compareDeep(quantity, o.quantity, true) + && compareDeep(description, o.description, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlanActivityDetailComponent)) + return false; + CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other; + return compareValues(status, o.status, true) && compareValues(prohibited, o.prohibited, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) + && (reasonCode == null || reasonCode.isEmpty()) && (reasonReference == null || reasonReference.isEmpty()) + && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) && (statusReason == null || statusReason.isEmpty()) + && (prohibited == null || prohibited.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()) && (description == null || description.isEmpty()) + ; + } + + public String fhirType() { + return "CarePlan.activity.detail"; + + } + + } + + /** + * This records identifiers associated with this care plan 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=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Ids for this plan", formalDefinition="This records identifiers associated with this care plan 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; + + /** + * Identifies the patient or group whose intended care is described by the plan. + */ + @Child(name = "subject", type = {Patient.class, Group.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient or group whose intended care is described by the plan." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Identifies the patient or group whose intended care is described by the plan.) + */ + protected Resource subjectTarget; + + /** + * Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposed | draft | active | completed | cancelled", formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record." ) + protected Enumeration status; + + /** + * Identifies the context in which this particular CarePlan is defined. + */ + @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Created in context of", formalDefinition="Identifies the context in which this particular CarePlan is defined." ) + protected Reference context; + + /** + * The actual object that is the target of the reference (Identifies the context in which this particular CarePlan is defined.) + */ + protected Resource contextTarget; + + /** + * Indicates when the plan did (or is intended to) come into effect and end. + */ + @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true) + @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 individual(s) or ogranization who is responsible for the content of the care plan. + */ + @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class, Organization.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who is responsible for contents of the plan", formalDefinition="Identifies the individual(s) or ogranization who is responsible for the content of the care plan." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) + */ + protected List authorTarget; + + + /** + * Identifies the most recent date on which the plan has been revised. + */ + @Child(name = "modified", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When last updated", formalDefinition="Identifies the most recent date on which the plan has been revised." ) + protected DateTimeType modified; + + /** + * Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Type of plan", formalDefinition="Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc." ) + protected List category; + + /** + * A description of the scope and nature of the plan. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Summary of nature of plan", formalDefinition="A description of the scope and nature of the plan." ) + protected StringType description; + + /** + * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. + */ + @Child(name = "addresses", type = {Condition.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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 addresses; + /** + * 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 addressesTarget; + + + /** + * Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc. + */ + @Child(name = "support", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Information considered as part of plan", formalDefinition="Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc." ) + protected List support; + /** + * The actual objects that are the target of the reference (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) + */ + protected List supportTarget; + + + /** + * Identifies CarePlans with some sort of formal relationship to the current plan. + */ + @Child(name = "relatedPlan", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Plans related to this one", formalDefinition="Identifies CarePlans with some sort of formal relationship to the current plan." ) + protected List relatedPlan; + + /** + * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. + */ + @Child(name = "participant", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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; + + /** + * Describes the intended objective(s) of carrying out the care plan. + */ + @Child(name = "goal", type = {Goal.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Desired outcome of plan", 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 = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Action to occur as part of plan", 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; + + /** + * General notes about the care plan not covered elsewhere. + */ + @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." ) + protected Annotation note; + + private static final long serialVersionUID = -307500543L; + + /** + * Constructor + */ + public CarePlan() { + super(); + } + + /** + * Constructor + */ + public CarePlan(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan 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} (This records identifiers associated with this care plan 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; + } + + // syntactic sugar + public CarePlan addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (Identifies the patient or group whose intended care is described by the plan.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Identifies the patient or group whose intended care is described by the plan.) + */ + public CarePlan 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. (Identifies the patient or group whose intended care is described by the plan.) + */ + public Resource getSubjectTarget() { + 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. (Identifies the patient or group whose intended care is described by the plan.) + */ + public CarePlan setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now a 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 CarePlan.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CarePlanStatusEnumFactory()); // bb + 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 a historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CarePlan setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. + */ + public CarePlanStatus 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 a historical record. + */ + public CarePlan setStatus(CarePlanStatus value) { + if (this.status == null) + this.status = new Enumeration(new CarePlanStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #context} (Identifies the context in which this particular CarePlan is defined.) + */ + public Reference getContext() { + if (this.context == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.context"); + else if (Configuration.doAutoCreate()) + this.context = new Reference(); // cc + return this.context; + } + + public boolean hasContext() { + return this.context != null && !this.context.isEmpty(); + } + + /** + * @param value {@link #context} (Identifies the context in which this particular CarePlan is defined.) + */ + public CarePlan setContext(Reference value) { + this.context = value; + return this; + } + + /** + * @return {@link #context} 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 context in which this particular CarePlan is defined.) + */ + public Resource getContextTarget() { + return this.contextTarget; + } + + /** + * @param value {@link #context} 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 context in which this particular CarePlan is defined.) + */ + public CarePlan setContextTarget(Resource value) { + this.contextTarget = 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 CarePlan.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + 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 CarePlan setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + // syntactic sugar + public CarePlan addAuthor(Reference t) { //3 + if (t == null) + return this; + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return this; + } + + /** + * @return {@link #author} (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 individual(s) or ogranization who is responsible for the content of the care plan.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @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 CarePlan.modified"); + else if (Configuration.doAutoCreate()) + this.modified = new DateTimeType(); // bb + 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 CarePlan 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 CarePlan 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 #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc.) + */ + public List getCategory() { + if (this.category == null) + this.category = new ArrayList(); + return this.category; + } + + public boolean hasCategory() { + if (this.category == null) + return false; + for (CodeableConcept item : this.category) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc.) + */ + // syntactic sugar + public CodeableConcept addCategory() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return t; + } + + // syntactic sugar + public CarePlan addCategory(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return this; + } + + /** + * @return {@link #description} (A description of the scope and nature of the 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 CarePlan.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of the scope and nature of the plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public CarePlan setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the scope and nature of the plan. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the scope and nature of the plan. + */ + public CarePlan 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 #addresses} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + public List getAddresses() { + if (this.addresses == null) + this.addresses = new ArrayList(); + return this.addresses; + } + + public boolean hasAddresses() { + if (this.addresses == null) + return false; + for (Reference item : this.addresses) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #addresses} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + // syntactic sugar + public Reference addAddresses() { //3 + Reference t = new Reference(); + if (this.addresses == null) + this.addresses = new ArrayList(); + this.addresses.add(t); + return t; + } + + // syntactic sugar + public CarePlan addAddresses(Reference t) { //3 + if (t == null) + return this; + if (this.addresses == null) + this.addresses = new ArrayList(); + this.addresses.add(t); + return this; + } + + /** + * @return {@link #addresses} (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 getAddressesTarget() { + if (this.addressesTarget == null) + this.addressesTarget = new ArrayList(); + return this.addressesTarget; + } + + // syntactic sugar + /** + * @return {@link #addresses} (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 addAddressesTarget() { + Condition r = new Condition(); + if (this.addressesTarget == null) + this.addressesTarget = new ArrayList(); + this.addressesTarget.add(r); + return r; + } + + /** + * @return {@link #support} (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) + */ + public List getSupport() { + if (this.support == null) + this.support = new ArrayList(); + return this.support; + } + + public boolean hasSupport() { + if (this.support == null) + return false; + for (Reference item : this.support) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #support} (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) + */ + // syntactic sugar + public Reference addSupport() { //3 + Reference t = new Reference(); + if (this.support == null) + this.support = new ArrayList(); + this.support.add(t); + return t; + } + + // syntactic sugar + public CarePlan addSupport(Reference t) { //3 + if (t == null) + return this; + if (this.support == null) + this.support = new ArrayList(); + this.support.add(t); + return this; + } + + /** + * @return {@link #support} (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 portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) + */ + public List getSupportTarget() { + if (this.supportTarget == null) + this.supportTarget = new ArrayList(); + return this.supportTarget; + } + + /** + * @return {@link #relatedPlan} (Identifies CarePlans with some sort of formal relationship to the current plan.) + */ + public List getRelatedPlan() { + if (this.relatedPlan == null) + this.relatedPlan = new ArrayList(); + return this.relatedPlan; + } + + public boolean hasRelatedPlan() { + if (this.relatedPlan == null) + return false; + for (CarePlanRelatedPlanComponent item : this.relatedPlan) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relatedPlan} (Identifies CarePlans with some sort of formal relationship to the current plan.) + */ + // syntactic sugar + public CarePlanRelatedPlanComponent addRelatedPlan() { //3 + CarePlanRelatedPlanComponent t = new CarePlanRelatedPlanComponent(); + if (this.relatedPlan == null) + this.relatedPlan = new ArrayList(); + this.relatedPlan.add(t); + return t; + } + + // syntactic sugar + public CarePlan addRelatedPlan(CarePlanRelatedPlanComponent t) { //3 + if (t == null) + return this; + if (this.relatedPlan == null) + this.relatedPlan = new ArrayList(); + this.relatedPlan.add(t); + return this; + } + + /** + * @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 (CarePlanParticipantComponent 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 CarePlanParticipantComponent addParticipant() { //3 + CarePlanParticipantComponent t = new CarePlanParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public CarePlan addParticipant(CarePlanParticipantComponent t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + 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; + } + + // syntactic sugar + public CarePlan addGoal(Reference t) { //3 + if (t == null) + return this; + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return this; + } + + /** + * @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 (CarePlanActivityComponent 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 CarePlanActivityComponent addActivity() { //3 + CarePlanActivityComponent t = new CarePlanActivityComponent(); + if (this.activity == null) + this.activity = new ArrayList(); + this.activity.add(t); + return t; + } + + // syntactic sugar + public CarePlan addActivity(CarePlanActivityComponent t) { //3 + if (t == null) + return this; + if (this.activity == null) + this.activity = new ArrayList(); + this.activity.add(t); + return this; + } + + /** + * @return {@link #note} (General notes about the care plan not covered elsewhere.) + */ + public Annotation getNote() { + if (this.note == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.note"); + else if (Configuration.doAutoCreate()) + this.note = new Annotation(); // cc + return this.note; + } + + public boolean hasNote() { + return this.note != null && !this.note.isEmpty(); + } + + /** + * @param value {@link #note} (General notes about the care plan not covered elsewhere.) + */ + public CarePlan setNote(Annotation value) { + this.note = 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 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("subject", "Reference(Patient|Group)", "Identifies the patient or group whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("status", "code", "Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "Identifies the context in which this particular CarePlan is defined.", 0, java.lang.Integer.MAX_VALUE, context)); + 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("author", "Reference(Patient|Practitioner|RelatedPerson|Organization)", "Identifies the individual(s) or ogranization who is responsible for the content of the care plan.", 0, java.lang.Integer.MAX_VALUE, author)); + 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("category", "CodeableConcept", "Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("description", "string", "A description of the scope and nature of the plan.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("addresses", "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, addresses)); + childrenList.add(new Property("support", "Reference(Any)", "Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.", 0, java.lang.Integer.MAX_VALUE, support)); + childrenList.add(new Property("relatedPlan", "", "Identifies CarePlans with some sort of formal relationship to the current plan.", 0, java.lang.Integer.MAX_VALUE, relatedPlan)); + 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("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", "", "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)); + childrenList.add(new Property("note", "Annotation", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference + case -615513399: /*modified*/ return this.modified == null ? new Base[0] : new Base[] {this.modified}; // DateTimeType + case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 874544034: /*addresses*/ return this.addresses == null ? new Base[0] : this.addresses.toArray(new Base[this.addresses.size()]); // Reference + case -1854767153: /*support*/ return this.support == null ? new Base[0] : this.support.toArray(new Base[this.support.size()]); // Reference + case 1112903156: /*relatedPlan*/ return this.relatedPlan == null ? new Base[0] : this.relatedPlan.toArray(new Base[this.relatedPlan.size()]); // CarePlanRelatedPlanComponent + case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // CarePlanParticipantComponent + case 3178259: /*goal*/ return this.goal == null ? new Base[0] : this.goal.toArray(new Base[this.goal.size()]); // Reference + case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : this.activity.toArray(new Base[this.activity.size()]); // CarePlanActivityComponent + case 3387378: /*note*/ return this.note == null ? new Base[0] : new Base[] {this.note}; // Annotation + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new CarePlanStatusEnumFactory().fromType(value); // Enumeration + break; + case 951530927: // context + this.context = castToReference(value); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -1406328437: // author + this.getAuthor().add(castToReference(value)); // Reference + break; + case -615513399: // modified + this.modified = castToDateTime(value); // DateTimeType + break; + case 50511102: // category + this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 874544034: // addresses + this.getAddresses().add(castToReference(value)); // Reference + break; + case -1854767153: // support + this.getSupport().add(castToReference(value)); // Reference + break; + case 1112903156: // relatedPlan + this.getRelatedPlan().add((CarePlanRelatedPlanComponent) value); // CarePlanRelatedPlanComponent + break; + case 767422259: // participant + this.getParticipant().add((CarePlanParticipantComponent) value); // CarePlanParticipantComponent + break; + case 3178259: // goal + this.getGoal().add(castToReference(value)); // Reference + break; + case -1655966961: // activity + this.getActivity().add((CarePlanActivityComponent) value); // CarePlanActivityComponent + break; + case 3387378: // note + this.note = castToAnnotation(value); // Annotation + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new CarePlanStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("context")) + this.context = castToReference(value); // Reference + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("author")) + this.getAuthor().add(castToReference(value)); + else if (name.equals("modified")) + this.modified = castToDateTime(value); // DateTimeType + else if (name.equals("category")) + this.getCategory().add(castToCodeableConcept(value)); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("addresses")) + this.getAddresses().add(castToReference(value)); + else if (name.equals("support")) + this.getSupport().add(castToReference(value)); + else if (name.equals("relatedPlan")) + this.getRelatedPlan().add((CarePlanRelatedPlanComponent) value); + else if (name.equals("participant")) + this.getParticipant().add((CarePlanParticipantComponent) value); + else if (name.equals("goal")) + this.getGoal().add(castToReference(value)); + else if (name.equals("activity")) + this.getActivity().add((CarePlanActivityComponent) value); + else if (name.equals("note")) + this.note = castToAnnotation(value); // Annotation + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1867885268: return getSubject(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 951530927: return getContext(); // Reference + case -991726143: return getPeriod(); // Period + case -1406328437: return addAuthor(); // Reference + case -615513399: throw new FHIRException("Cannot make property modified as it is not a complex type"); // DateTimeType + case 50511102: return addCategory(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 874544034: return addAddresses(); // Reference + case -1854767153: return addSupport(); // Reference + case 1112903156: return addRelatedPlan(); // CarePlanRelatedPlanComponent + case 767422259: return addParticipant(); // CarePlanParticipantComponent + case 3178259: return addGoal(); // Reference + case -1655966961: return addActivity(); // CarePlanActivityComponent + case 3387378: return getNote(); // Annotation + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type CarePlan.status"); + } + else if (name.equals("context")) { + this.context = new Reference(); + return this.context; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("author")) { + return addAuthor(); + } + else if (name.equals("modified")) { + throw new FHIRException("Cannot call addChild on a primitive type CarePlan.modified"); + } + else if (name.equals("category")) { + return addCategory(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type CarePlan.description"); + } + else if (name.equals("addresses")) { + return addAddresses(); + } + else if (name.equals("support")) { + return addSupport(); + } + else if (name.equals("relatedPlan")) { + return addRelatedPlan(); + } + else if (name.equals("participant")) { + return addParticipant(); + } + else if (name.equals("goal")) { + return addGoal(); + } + else if (name.equals("activity")) { + return addActivity(); + } + else if (name.equals("note")) { + this.note = new Annotation(); + return this.note; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "CarePlan"; + + } + + public CarePlan copy() { + CarePlan dst = new CarePlan(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.status = status == null ? null : status.copy(); + dst.context = context == null ? null : context.copy(); + dst.period = period == null ? null : period.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + dst.modified = modified == null ? null : modified.copy(); + if (category != null) { + dst.category = new ArrayList(); + for (CodeableConcept i : category) + dst.category.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (addresses != null) { + dst.addresses = new ArrayList(); + for (Reference i : addresses) + dst.addresses.add(i.copy()); + }; + if (support != null) { + dst.support = new ArrayList(); + for (Reference i : support) + dst.support.add(i.copy()); + }; + if (relatedPlan != null) { + dst.relatedPlan = new ArrayList(); + for (CarePlanRelatedPlanComponent i : relatedPlan) + dst.relatedPlan.add(i.copy()); + }; + if (participant != null) { + dst.participant = new ArrayList(); + for (CarePlanParticipantComponent i : participant) + dst.participant.add(i.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 (CarePlanActivityComponent i : activity) + dst.activity.add(i.copy()); + }; + dst.note = note == null ? null : note.copy(); + return dst; + } + + protected CarePlan typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CarePlan)) + return false; + CarePlan o = (CarePlan) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(status, o.status, true) + && compareDeep(context, o.context, true) && compareDeep(period, o.period, true) && compareDeep(author, o.author, true) + && compareDeep(modified, o.modified, true) && compareDeep(category, o.category, true) && compareDeep(description, o.description, true) + && compareDeep(addresses, o.addresses, true) && compareDeep(support, o.support, true) && compareDeep(relatedPlan, o.relatedPlan, true) + && compareDeep(participant, o.participant, true) && compareDeep(goal, o.goal, true) && compareDeep(activity, o.activity, true) + && compareDeep(note, o.note, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CarePlan)) + return false; + CarePlan o = (CarePlan) other; + return compareValues(status, o.status, true) && compareValues(modified, o.modified, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (status == null || status.isEmpty()) && (context == null || context.isEmpty()) && (period == null || period.isEmpty()) + && (author == null || author.isEmpty()) && (modified == null || modified.isEmpty()) && (category == null || category.isEmpty()) + && (description == null || description.isEmpty()) && (addresses == null || addresses.isEmpty()) + && (support == null || support.isEmpty()) && (relatedPlan == null || relatedPlan.isEmpty()) + && (participant == null || participant.isEmpty()) && (goal == null || goal.isEmpty()) && (activity == null || activity.isEmpty()) + && (note == null || note.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CarePlan; + } + + /** + * Search parameter: activitycode + *

+ * Description: Detail type of activity
+ * Type: token
+ * Path: CarePlan.activity.detail.code
+ *

+ */ + @SearchParamDefinition(name="activitycode", path="CarePlan.activity.detail.code", description="Detail type of activity", type="token" ) + public static final String SP_ACTIVITYCODE = "activitycode"; + /** + * Fluent Client search parameter constant for activitycode + *

+ * Description: Detail type of activity
+ * Type: token
+ * Path: CarePlan.activity.detail.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVITYCODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVITYCODE); + + /** + * Search parameter: condition + *

+ * Description: Health issues this plan addresses
+ * Type: reference
+ * Path: CarePlan.addresses
+ *

+ */ + @SearchParamDefinition(name="condition", path="CarePlan.addresses", description="Health issues this plan addresses", type="reference" ) + public static final String SP_CONDITION = "condition"; + /** + * Fluent Client search parameter constant for condition + *

+ * Description: Health issues this plan addresses
+ * Type: reference
+ * Path: CarePlan.addresses
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CarePlan:condition". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("CarePlan:condition").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: Who care plan is for
+ * Type: reference
+ * Path: CarePlan.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="CarePlan.subject", description="Who care plan is for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Who care plan is for
+ * Type: reference
+ * Path: CarePlan.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CarePlan:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("CarePlan:subject").toLocked(); + + /** + * Search parameter: activitydate + *

+ * Description: Specified date occurs within period specified by CarePlan.activity.timingSchedule
+ * Type: date
+ * Path: CarePlan.activity.detail.scheduled[x]
+ *

+ */ + @SearchParamDefinition(name="activitydate", path="CarePlan.activity.detail.scheduled", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) + public static final String SP_ACTIVITYDATE = "activitydate"; + /** + * Fluent Client search parameter constant for activitydate + *

+ * Description: Specified date occurs within period specified by CarePlan.activity.timingSchedule
+ * Type: date
+ * Path: CarePlan.activity.detail.scheduled[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam ACTIVITYDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ACTIVITYDATE); + + /** + * Search parameter: date + *

+ * Description: Time period plan covers
+ * Type: date
+ * Path: CarePlan.period
+ *

+ */ + @SearchParamDefinition(name="date", path="CarePlan.period", description="Time period plan covers", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Time period plan covers
+ * Type: date
+ * Path: CarePlan.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: goal + *

+ * Description: Desired outcome of plan
+ * Type: reference
+ * Path: CarePlan.goal
+ *

+ */ + @SearchParamDefinition(name="goal", path="CarePlan.goal", description="Desired outcome of plan", type="reference" ) + public static final String SP_GOAL = "goal"; + /** + * Fluent Client search parameter constant for goal + *

+ * Description: Desired outcome of plan
+ * Type: reference
+ * Path: CarePlan.goal
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam GOAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_GOAL); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CarePlan:goal". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_GOAL = new ca.uhn.fhir.model.api.Include("CarePlan:goal").toLocked(); + + /** + * Search parameter: related + *

+ * Description: A combination of the type of relationship and the related plan
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="related", path="", description="A combination of the type of relationship and the related plan", type="composite", compositeOf={"relatedcode", "relatedplan"} ) + public static final String SP_RELATED = "related"; + /** + * Fluent Client search parameter constant for related + *

+ * Description: A combination of the type of relationship and the related plan
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam RELATED = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_RELATED); + + /** + * Search parameter: relatedcode + *

+ * Description: includes | replaces | fulfills
+ * Type: token
+ * Path: CarePlan.relatedPlan.code
+ *

+ */ + @SearchParamDefinition(name="relatedcode", path="CarePlan.relatedPlan.code", description="includes | replaces | fulfills", type="token" ) + public static final String SP_RELATEDCODE = "relatedcode"; + /** + * Fluent Client search parameter constant for relatedcode + *

+ * Description: includes | replaces | fulfills
+ * Type: token
+ * Path: CarePlan.relatedPlan.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATEDCODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATEDCODE); + + /** + * Search parameter: patient + *

+ * Description: Who care plan is for
+ * Type: reference
+ * Path: CarePlan.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="CarePlan.subject", description="Who care plan is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who care plan is for
+ * Type: reference
+ * Path: CarePlan.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CarePlan:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CarePlan:patient").toLocked(); + + /** + * Search parameter: participant + *

+ * Description: Who is involved
+ * Type: reference
+ * Path: CarePlan.participant.member
+ *

+ */ + @SearchParamDefinition(name="participant", path="CarePlan.participant.member", description="Who is involved", type="reference" ) + public static final String SP_PARTICIPANT = "participant"; + /** + * Fluent Client search parameter constant for participant + *

+ * Description: Who is involved
+ * Type: reference
+ * Path: CarePlan.participant.member
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CarePlan:participant". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("CarePlan:participant").toLocked(); + + /** + * Search parameter: performer + *

+ * Description: Matches if the practitioner is listed as a performer in any of the "simple" activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)
+ * Type: reference
+ * Path: CarePlan.activity.detail.performer
+ *

+ */ + @SearchParamDefinition(name="performer", path="CarePlan.activity.detail.performer", description="Matches if the practitioner is listed as a performer in any of the \"simple\" activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)", type="reference" ) + public static final String SP_PERFORMER = "performer"; + /** + * Fluent Client search parameter constant for performer + *

+ * Description: Matches if the practitioner is listed as a performer in any of the "simple" activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)
+ * Type: reference
+ * Path: CarePlan.activity.detail.performer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CarePlan:performer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("CarePlan:performer").toLocked(); + + /** + * Search parameter: activityreference + *

+ * Description: Activity details defined in specific resource
+ * Type: reference
+ * Path: CarePlan.activity.reference
+ *

+ */ + @SearchParamDefinition(name="activityreference", path="CarePlan.activity.reference", description="Activity details defined in specific resource", type="reference" ) + public static final String SP_ACTIVITYREFERENCE = "activityreference"; + /** + * Fluent Client search parameter constant for activityreference + *

+ * Description: Activity details defined in specific resource
+ * Type: reference
+ * Path: CarePlan.activity.reference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTIVITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTIVITYREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CarePlan:activityreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTIVITYREFERENCE = new ca.uhn.fhir.model.api.Include("CarePlan:activityreference").toLocked(); + + /** + * Search parameter: relatedplan + *

+ * Description: Plan relationship exists with
+ * Type: reference
+ * Path: CarePlan.relatedPlan.plan
+ *

+ */ + @SearchParamDefinition(name="relatedplan", path="CarePlan.relatedPlan.plan", description="Plan relationship exists with", type="reference" ) + public static final String SP_RELATEDPLAN = "relatedplan"; + /** + * Fluent Client search parameter constant for relatedplan + *

+ * Description: Plan relationship exists with
+ * Type: reference
+ * Path: CarePlan.relatedPlan.plan
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATEDPLAN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATEDPLAN); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CarePlan:relatedplan". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATEDPLAN = new ca.uhn.fhir.model.api.Include("CarePlan:relatedplan").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CareTeam.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CareTeam.java new file mode 100644 index 00000000000..14f55675f72 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CareTeam.java @@ -0,0 +1,1030 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. + */ +@ResourceDef(name="CareTeam", profile="http://hl7.org/fhir/Profile/CareTeam") +public class CareTeam extends DomainResource { + + @Block() + public static class CareTeamParticipantComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates specific responsibility of an individual within the care team, such as "Primary physician", "Team coordinator", "Caregiver", etc. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of involvement", formalDefinition="Indicates specific responsibility of an individual within the care team, such as \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc." ) + protected CodeableConcept role; + + /** + * The specific person or organization who is participating/expected to participate in the care team. + */ + @Child(name = "member", type = {Practitioner.class, RelatedPerson.class, Patient.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who is involved", formalDefinition="The specific person or organization who is participating/expected to participate in the care team." ) + 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 team.) + */ + protected Resource memberTarget; + + /** + * Indicates when the specific member or organization did (or is intended to) come into effect and end. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Time period of participant", formalDefinition="Indicates when the specific member or organization did (or is intended to) come into effect and end." ) + protected Period period; + + private static final long serialVersionUID = -1416929603L; + + /** + * Constructor + */ + public CareTeamParticipantComponent() { + super(); + } + + /** + * @return {@link #role} (Indicates specific responsibility of an individual within the care team, such as "Primary physician", "Team coordinator", "Caregiver", etc.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamParticipantComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + 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 team, such as "Primary physician", "Team coordinator", "Caregiver", etc.) + */ + public CareTeamParticipantComponent 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 team.) + */ + public Reference getMember() { + if (this.member == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamParticipantComponent.member"); + else if (Configuration.doAutoCreate()) + this.member = new Reference(); // cc + 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 team.) + */ + public CareTeamParticipantComponent 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 team.) + */ + 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 team.) + */ + public CareTeamParticipantComponent setMemberTarget(Resource value) { + this.memberTarget = value; + return this; + } + + /** + * @return {@link #period} (Indicates when the specific member or organization 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 CareTeamParticipantComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Indicates when the specific member or organization did (or is intended to) come into effect and end.) + */ + public CareTeamParticipantComponent setPeriod(Period value) { + this.period = 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 team, such as \"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 team.", 0, java.lang.Integer.MAX_VALUE, member)); + childrenList.add(new Property("period", "Period", "Indicates when the specific member or organization did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept + case -1077769574: /*member*/ return this.member == null ? new Base[0] : new Base[] {this.member}; // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3506294: // role + this.role = castToCodeableConcept(value); // CodeableConcept + break; + case -1077769574: // member + this.member = castToReference(value); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("role")) + this.role = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("member")) + this.member = castToReference(value); // Reference + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3506294: return getRole(); // CodeableConcept + case -1077769574: return getMember(); // Reference + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("role")) { + this.role = new CodeableConcept(); + return this.role; + } + else if (name.equals("member")) { + this.member = new Reference(); + return this.member; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public CareTeamParticipantComponent copy() { + CareTeamParticipantComponent dst = new CareTeamParticipantComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.member = member == null ? null : member.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CareTeamParticipantComponent)) + return false; + CareTeamParticipantComponent o = (CareTeamParticipantComponent) other; + return compareDeep(role, o.role, true) && compareDeep(member, o.member, true) && compareDeep(period, o.period, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CareTeamParticipantComponent)) + return false; + CareTeamParticipantComponent o = (CareTeamParticipantComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (member == null || member.isEmpty()) + && (period == null || period.isEmpty()); + } + + public String fhirType() { + return "CareTeam.participant"; + + } + + } + + /** + * This records identifiers associated with this care team 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. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Ids for this team", formalDefinition="This records identifiers associated with this care team 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." ) + protected List identifier; + + /** + * Indicates whether the care team is currently active, suspended, inactive, or entered in error. + */ + @Child(name = "status", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | suspended | inactive | entered in error", formalDefinition="Indicates whether the care team is currently active, suspended, inactive, or entered in error." ) + protected CodeableConcept status; + + /** + * Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Type of team", formalDefinition="Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team." ) + protected List type; + + /** + * Name of the care team. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the team, such as crisis assessment team", formalDefinition="Name of the care team." ) + protected StringType name; + + /** + * Identifies the patient or group whose intended care is handled by the team. + */ + @Child(name = "subject", type = {Patient.class, Group.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who care team is for", formalDefinition="Identifies the patient or group whose intended care is handled by the team." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Identifies the patient or group whose intended care is handled by the team.) + */ + protected Resource subjectTarget; + + /** + * Indicates when the team did (or is intended to) come into effect and end. + */ + @Child(name = "period", type = {Period.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time period team covers", formalDefinition="Indicates when the team did (or is intended to) come into effect and end." ) + protected Period period; + + /** + * Identifies all people and organizations who are expected to be involved in the care team. + */ + @Child(name = "participant", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Members of the team", formalDefinition="Identifies all people and organizations who are expected to be involved in the care team." ) + protected List participant; + + /** + * The organization responsible for the care team. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization responsible for the care team", formalDefinition="The organization responsible for the care team." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The organization responsible for the care team.) + */ + protected Organization managingOrganizationTarget; + + private static final long serialVersionUID = -917605050L; + + /** + * Constructor + */ + public CareTeam() { + super(); + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care team 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.) + */ + 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 team 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.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public CareTeam addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (Indicates whether the care team is currently active, suspended, inactive, or entered in error.) + */ + public CodeableConcept getStatus() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeam.status"); + else if (Configuration.doAutoCreate()) + this.status = new CodeableConcept(); // cc + return this.status; + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Indicates whether the care team is currently active, suspended, inactive, or entered in error.) + */ + public CareTeam setStatus(CodeableConcept value) { + this.status = value; + return this; + } + + /** + * @return {@link #type} (Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + 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 {@link #type} (Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public CareTeam addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #name} (Name of the care team.). 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 CareTeam.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Name of the care team.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public CareTeam setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name of the care team. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name of the care team. + */ + public CareTeam setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (Identifies the patient or group whose intended care is handled by the team.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeam.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Identifies the patient or group whose intended care is handled by the team.) + */ + public CareTeam 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. (Identifies the patient or group whose intended care is handled by the team.) + */ + public Resource getSubjectTarget() { + 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. (Identifies the patient or group whose intended care is handled by the team.) + */ + public CareTeam setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #period} (Indicates when the team 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 CareTeam.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Indicates when the team did (or is intended to) come into effect and end.) + */ + public CareTeam setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care team.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (CareTeamParticipantComponent 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 team.) + */ + // syntactic sugar + public CareTeamParticipantComponent addParticipant() { //3 + CareTeamParticipantComponent t = new CareTeamParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public CareTeam addParticipant(CareTeamParticipantComponent t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return this; + } + + /** + * @return {@link #managingOrganization} (The organization responsible for the care team.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeam.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The organization responsible for the care team.) + */ + public CareTeam 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 responsible for the care team.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeam.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + 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 responsible for the care team.) + */ + public CareTeam setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care team 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.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "CodeableConcept", "Indicates whether the care team is currently active, suspended, inactive, or entered in error.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "CodeableConcept", "Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("name", "string", "Name of the care team.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("subject", "Reference(Patient|Group)", "Identifies the patient or group whose intended care is handled by the team.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("period", "Period", "Indicates when the team did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care team.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization responsible for the care team.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // CareTeamParticipantComponent + case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = castToCodeableConcept(value); // CodeableConcept + break; + case 3575610: // type + this.getType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case 767422259: // participant + this.getParticipant().add((CareTeamParticipantComponent) value); // CareTeamParticipantComponent + break; + case -2058947787: // managingOrganization + this.managingOrganization = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("type")) + this.getType().add(castToCodeableConcept(value)); + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("participant")) + this.getParticipant().add((CareTeamParticipantComponent) value); + else if (name.equals("managingOrganization")) + this.managingOrganization = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: return getStatus(); // CodeableConcept + case 3575610: return addType(); // CodeableConcept + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1867885268: return getSubject(); // Reference + case -991726143: return getPeriod(); // Period + case 767422259: return addParticipant(); // CareTeamParticipantComponent + case -2058947787: return getManagingOrganization(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + this.status = new CodeableConcept(); + return this.status; + } + else if (name.equals("type")) { + return addType(); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type CareTeam.name"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("participant")) { + return addParticipant(); + } + else if (name.equals("managingOrganization")) { + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "CareTeam"; + + } + + public CareTeam copy() { + CareTeam dst = new CareTeam(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.period = period == null ? null : period.copy(); + if (participant != null) { + dst.participant = new ArrayList(); + for (CareTeamParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + return dst; + } + + protected CareTeam typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CareTeam)) + return false; + CareTeam o = (CareTeam) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) + && compareDeep(name, o.name, true) && compareDeep(subject, o.subject, true) && compareDeep(period, o.period, true) + && compareDeep(participant, o.participant, true) && compareDeep(managingOrganization, o.managingOrganization, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CareTeam)) + return false; + CareTeam o = (CareTeam) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) && (subject == null || subject.isEmpty()) + && (period == null || period.isEmpty()) && (participant == null || participant.isEmpty()) + && (managingOrganization == null || managingOrganization.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CareTeam; + } + + /** + * Search parameter: patient + *

+ * Description: Who care team is for
+ * Type: reference
+ * Path: CareTeam.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="CareTeam.subject", description="Who care team is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who care team is for
+ * Type: reference
+ * Path: CareTeam.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CareTeam:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CareTeam:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: active | suspended | inactive | entered in error
+ * Type: token
+ * Path: CareTeam.status
+ *

+ */ + @SearchParamDefinition(name="status", path="CareTeam.status", description="active | suspended | inactive | entered in error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: active | suspended | inactive | entered in error
+ * Type: token
+ * Path: CareTeam.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: Who care team is for
+ * Type: reference
+ * Path: CareTeam.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="CareTeam.subject", description="Who care team is for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Who care team is for
+ * Type: reference
+ * Path: CareTeam.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CareTeam:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("CareTeam:subject").toLocked(); + + /** + * Search parameter: participant + *

+ * Description: Who is involved
+ * Type: reference
+ * Path: CareTeam.participant.member
+ *

+ */ + @SearchParamDefinition(name="participant", path="CareTeam.participant.member", description="Who is involved", type="reference" ) + public static final String SP_PARTICIPANT = "participant"; + /** + * Fluent Client search parameter constant for participant + *

+ * Description: Who is involved
+ * Type: reference
+ * Path: CareTeam.participant.member
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CareTeam:participant". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("CareTeam:participant").toLocked(); + + /** + * Search parameter: type + *

+ * Description: Type of team
+ * Type: token
+ * Path: CareTeam.type
+ *

+ */ + @SearchParamDefinition(name="type", path="CareTeam.type", description="Type of team", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Type of team
+ * Type: token
+ * Path: CareTeam.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: date + *

+ * Description: Time period team covers
+ * Type: date
+ * Path: CareTeam.period
+ *

+ */ + @SearchParamDefinition(name="date", path="CareTeam.period", description="Time period team covers", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Time period team covers
+ * Type: date
+ * Path: CareTeam.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: External Ids for this team
+ * Type: token
+ * Path: CareTeam.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="CareTeam.identifier", description="External Ids for this team", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: External Ids for this team
+ * Type: token
+ * Path: CareTeam.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Claim.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Claim.java new file mode 100644 index 00000000000..daa109e95fd --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Claim.java @@ -0,0 +1,8270 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * 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="Claim", profile="http://hl7.org/fhir/Profile/Claim") +public class Claim extends DomainResource { + + public enum ClaimType { + /** + * A claim for Institution based, typically in-patient, goods and services. + */ + INSTITUTIONAL, + /** + * A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services. + */ + ORAL, + /** + * A claim for Pharmacy based goods and services. + */ + PHARMACY, + /** + * A claim for Professional, typically out-patient, goods and services. + */ + PROFESSIONAL, + /** + * A claim for Vision (Opthamologist, Optometrist and Optician) goods and services. + */ + VISION, + /** + * added to help the parsers + */ + NULL; + public static ClaimType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("institutional".equals(codeString)) + return INSTITUTIONAL; + if ("oral".equals(codeString)) + return ORAL; + if ("pharmacy".equals(codeString)) + return PHARMACY; + if ("professional".equals(codeString)) + return PROFESSIONAL; + if ("vision".equals(codeString)) + return VISION; + throw new FHIRException("Unknown ClaimType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INSTITUTIONAL: return "institutional"; + case ORAL: return "oral"; + case PHARMACY: return "pharmacy"; + case PROFESSIONAL: return "professional"; + case VISION: return "vision"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INSTITUTIONAL: return "http://hl7.org/fhir/claim-type-link"; + case ORAL: return "http://hl7.org/fhir/claim-type-link"; + case PHARMACY: return "http://hl7.org/fhir/claim-type-link"; + case PROFESSIONAL: return "http://hl7.org/fhir/claim-type-link"; + case VISION: return "http://hl7.org/fhir/claim-type-link"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INSTITUTIONAL: return "A claim for Institution based, typically in-patient, goods and services."; + case ORAL: return "A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services."; + case PHARMACY: return "A claim for Pharmacy based goods and services."; + case PROFESSIONAL: return "A claim for Professional, typically out-patient, goods and services."; + case VISION: return "A claim for Vision (Opthamologist, Optometrist and Optician) goods and services."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INSTITUTIONAL: return "Institutional"; + case ORAL: return "Oral Health"; + case PHARMACY: return "Pharmacy"; + case PROFESSIONAL: return "Professional"; + case VISION: return "Vision"; + default: return "?"; + } + } + } + + public static class ClaimTypeEnumFactory implements EnumFactory { + public ClaimType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("institutional".equals(codeString)) + return ClaimType.INSTITUTIONAL; + if ("oral".equals(codeString)) + return ClaimType.ORAL; + if ("pharmacy".equals(codeString)) + return ClaimType.PHARMACY; + if ("professional".equals(codeString)) + return ClaimType.PROFESSIONAL; + if ("vision".equals(codeString)) + return ClaimType.VISION; + throw new IllegalArgumentException("Unknown ClaimType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("institutional".equals(codeString)) + return new Enumeration(this, ClaimType.INSTITUTIONAL); + if ("oral".equals(codeString)) + return new Enumeration(this, ClaimType.ORAL); + if ("pharmacy".equals(codeString)) + return new Enumeration(this, ClaimType.PHARMACY); + if ("professional".equals(codeString)) + return new Enumeration(this, ClaimType.PROFESSIONAL); + if ("vision".equals(codeString)) + return new Enumeration(this, ClaimType.VISION); + throw new FHIRException("Unknown ClaimType code '"+codeString+"'"); + } + public String toCode(ClaimType code) { + if (code == ClaimType.INSTITUTIONAL) + return "institutional"; + if (code == ClaimType.ORAL) + return "oral"; + if (code == ClaimType.PHARMACY) + return "pharmacy"; + if (code == ClaimType.PROFESSIONAL) + return "professional"; + if (code == ClaimType.VISION) + return "vision"; + return "?"; + } + public String toSystem(ClaimType code) { + return code.getSystem(); + } + } + + public enum Use { + /** + * 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 Use fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown Use code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/claim-use-link"; + case PROPOSED: return "http://hl7.org/fhir/claim-use-link"; + case EXPLORATORY: return "http://hl7.org/fhir/claim-use-link"; + case OTHER: return "http://hl7.org/fhir/claim-use-link"; + 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 UseEnumFactory implements EnumFactory { + public Use fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return Use.COMPLETE; + if ("proposed".equals(codeString)) + return Use.PROPOSED; + if ("exploratory".equals(codeString)) + return Use.EXPLORATORY; + if ("other".equals(codeString)) + return Use.OTHER; + throw new IllegalArgumentException("Unknown Use code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return new Enumeration(this, Use.COMPLETE); + if ("proposed".equals(codeString)) + return new Enumeration(this, Use.PROPOSED); + if ("exploratory".equals(codeString)) + return new Enumeration(this, Use.EXPLORATORY); + if ("other".equals(codeString)) + return new Enumeration(this, Use.OTHER); + throw new FHIRException("Unknown Use code '"+codeString+"'"); + } + public String toCode(Use code) { + if (code == Use.COMPLETE) + return "complete"; + if (code == Use.PROPOSED) + return "proposed"; + if (code == Use.EXPLORATORY) + return "exploratory"; + if (code == Use.OTHER) + return "other"; + return "?"; + } + public String toSystem(Use code) { + return code.getSystem(); + } + } + + @Block() + public static class RelatedClaimsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Other claims which are related to this claim such as prior claim versions or for related services. + */ + @Child(name = "claim", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference to the related claim", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) + protected Type claim; + + /** + * For example prior or umbrella. + */ + @Child(name = "relationship", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How the reference claim is related", formalDefinition="For example prior or umbrella." ) + protected Coding relationship; + + /** + * An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # . + */ + @Child(name = "reference", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Related file or case reference", formalDefinition="An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # ." ) + protected Identifier reference; + + private static final long serialVersionUID = -2033217402L; + + /** + * Constructor + */ + public RelatedClaimsComponent() { + super(); + } + + /** + * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public Type getClaim() { + return this.claim; + } + + /** + * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public Identifier getClaimIdentifier() throws FHIRException { + if (!(this.claim instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claim.getClass().getName()+" was encountered"); + return (Identifier) this.claim; + } + + public boolean hasClaimIdentifier() { + return this.claim instanceof Identifier; + } + + /** + * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public Reference getClaimReference() throws FHIRException { + if (!(this.claim instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claim.getClass().getName()+" was encountered"); + return (Reference) this.claim; + } + + public boolean hasClaimReference() { + return this.claim instanceof Reference; + } + + public boolean hasClaim() { + return this.claim != null && !this.claim.isEmpty(); + } + + /** + * @param value {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public RelatedClaimsComponent setClaim(Type value) { + this.claim = value; + return this; + } + + /** + * @return {@link #relationship} (For example prior or umbrella.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedClaimsComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (For example prior or umbrella.) + */ + public RelatedClaimsComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .) + */ + public Identifier getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedClaimsComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Identifier(); // cc + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .) + */ + public RelatedClaimsComponent setReference(Identifier value) { + this.reference = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("claim[x]", "Identifier|Reference(Claim)", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, claim)); + childrenList.add(new Property("relationship", "Coding", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("reference", "Identifier", "An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .", 0, java.lang.Integer.MAX_VALUE, reference)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Type + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Identifier + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 94742588: // claim + this.claim = (Type) value; // Type + break; + case -261851592: // relationship + this.relationship = castToCoding(value); // Coding + break; + case -925155509: // reference + this.reference = castToIdentifier(value); // Identifier + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("claim[x]")) + this.claim = (Type) value; // Type + else if (name.equals("relationship")) + this.relationship = castToCoding(value); // Coding + else if (name.equals("reference")) + this.reference = castToIdentifier(value); // Identifier + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 683016900: return getClaim(); // Type + case -261851592: return getRelationship(); // Coding + case -925155509: return getReference(); // Identifier + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("claimIdentifier")) { + this.claim = new Identifier(); + return this.claim; + } + else if (name.equals("claimReference")) { + this.claim = new Reference(); + return this.claim; + } + else if (name.equals("relationship")) { + this.relationship = new Coding(); + return this.relationship; + } + else if (name.equals("reference")) { + this.reference = new Identifier(); + return this.reference; + } + else + return super.addChild(name); + } + + public RelatedClaimsComponent copy() { + RelatedClaimsComponent dst = new RelatedClaimsComponent(); + copyValues(dst); + dst.claim = claim == null ? null : claim.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.reference = reference == null ? null : reference.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RelatedClaimsComponent)) + return false; + RelatedClaimsComponent o = (RelatedClaimsComponent) other; + return compareDeep(claim, o.claim, true) && compareDeep(relationship, o.relationship, true) && compareDeep(reference, o.reference, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RelatedClaimsComponent)) + return false; + RelatedClaimsComponent o = (RelatedClaimsComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (claim == null || claim.isEmpty()) && (relationship == null || relationship.isEmpty()) + && (reference == null || reference.isEmpty()); + } + + public String fhirType() { + return "Claim.related"; + + } + + } + + @Block() + public static class PayeeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Type of Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of party: Subscriber, Provider, other", formalDefinition="Type of Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name = "party", type = {Identifier.class, Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Party to receive the payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Type party; + + private static final long serialVersionUID = 1304353420L; + + /** + * Constructor + */ + public PayeeComponent() { + super(); + } + + /** + * Constructor + */ + public PayeeComponent(Coding type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Type of 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(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Type getParty() { + return this.party; + } + + /** + * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Identifier getPartyIdentifier() throws FHIRException { + if (!(this.party instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.party.getClass().getName()+" was encountered"); + return (Identifier) this.party; + } + + public boolean hasPartyIdentifier() { + return this.party instanceof Identifier; + } + + /** + * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Reference getPartyReference() throws FHIRException { + if (!(this.party instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.party.getClass().getName()+" was encountered"); + return (Reference) this.party; + } + + public boolean hasPartyReference() { + return this.party instanceof Reference; + } + + public boolean hasParty() { + return this.party != null && !this.party.isEmpty(); + } + + /** + * @param value {@link #party} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setParty(Type value) { + this.party = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("party[x]", "Identifier|Reference(Practitioner|Organization|Patient|RelatedPerson)", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, party)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 106437350: // party + this.party = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("party[x]")) + this.party = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 1189320666: return getParty(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("partyIdentifier")) { + this.party = new Identifier(); + return this.party; + } + else if (name.equals("partyReference")) { + this.party = new Reference(); + return this.party; + } + else + return super.addChild(name); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.party = party == null ? null : party.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PayeeComponent)) + return false; + PayeeComponent o = (PayeeComponent) other; + return compareDeep(type, o.type, true) && compareDeep(party, o.party, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PayeeComponent)) + return false; + PayeeComponent o = (PayeeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty()) + ; + } + + public String fhirType() { + return "Claim.payee"; + + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Sequence of diagnosis which serves to order and provide a link. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number to covey order of diagnosis", formalDefinition="Sequence of diagnosis which serves to order and provide a link." ) + protected PositiveIntType sequence; + + /** + * The diagnosis. + */ + @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -795010186L; + + /** + * Constructor + */ + public DiagnosisComponent() { + super(); + } + + /** + * Constructor + */ + public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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 which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis which serves to order and provide a link. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis which serves to order and provide a link. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + 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(); // cc + 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", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 1196993265: // diagnosis + this.diagnosis = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("diagnosis")) + this.diagnosis = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 1196993265: return getDiagnosis(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); + } + else if (name.equals("diagnosis")) { + this.diagnosis = new Coding(); + return this.diagnosis; + } + else + return super.addChild(name); + } + + 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; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosisComponent)) + return false; + DiagnosisComponent o = (DiagnosisComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosisComponent)) + return false; + DiagnosisComponent o = (DiagnosisComponent) other; + return compareValues(sequence, o.sequence, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + public String fhirType() { + return "Claim.diagnosis"; + + } + + } + + @Block() + public static class ProcedureComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Sequence of procedures which serves to order and provide a link. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Procedure sequence for reference", formalDefinition="Sequence of procedures which serves to order and provide a link." ) + protected PositiveIntType sequence; + + /** + * Date and optionally time the procedure was performed . + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the procedure was performed", formalDefinition="Date and optionally time the procedure was performed ." ) + protected DateTimeType date; + + /** + * The procedure code. + */ + @Child(name = "procedure", type = {Coding.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient's list of procedures performed", formalDefinition="The procedure code." ) + protected Type procedure; + + private static final long serialVersionUID = 864307347L; + + /** + * Constructor + */ + public ProcedureComponent() { + super(); + } + + /** + * Constructor + */ + public ProcedureComponent(PositiveIntType sequence, Type procedure) { + super(); + this.sequence = sequence; + this.procedure = procedure; + } + + /** + * @return {@link #sequence} (Sequence of procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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 procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ProcedureComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of procedures which serves to order and provide a link. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value Sequence of procedures which serves to order and provide a link. + */ + public ProcedureComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #date} (Date and optionally time the procedure was performed .). 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 ProcedureComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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} (Date and optionally time the procedure was performed .). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ProcedureComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Date and optionally time the procedure was performed . + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Date and optionally time the procedure was performed . + */ + public ProcedureComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #procedure} (The procedure code.) + */ + public Type getProcedure() { + return this.procedure; + } + + /** + * @return {@link #procedure} (The procedure code.) + */ + public Coding getProcedureCoding() throws FHIRException { + if (!(this.procedure instanceof Coding)) + throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.procedure.getClass().getName()+" was encountered"); + return (Coding) this.procedure; + } + + public boolean hasProcedureCoding() { + return this.procedure instanceof Coding; + } + + /** + * @return {@link #procedure} (The procedure code.) + */ + public Reference getProcedureReference() throws FHIRException { + if (!(this.procedure instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.procedure.getClass().getName()+" was encountered"); + return (Reference) this.procedure; + } + + public boolean hasProcedureReference() { + return this.procedure instanceof Reference; + } + + public boolean hasProcedure() { + return this.procedure != null && !this.procedure.isEmpty(); + } + + /** + * @param value {@link #procedure} (The procedure code.) + */ + public ProcedureComponent setProcedure(Type value) { + this.procedure = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "Sequence of procedures which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("date", "dateTime", "Date and optionally time the procedure was performed .", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("procedure[x]", "Coding|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : new Base[] {this.procedure}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1095204141: // procedure + this.procedure = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("procedure[x]")) + this.procedure = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1640074445: return getProcedure(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.date"); + } + else if (name.equals("procedureCoding")) { + this.procedure = new Coding(); + return this.procedure; + } + else if (name.equals("procedureReference")) { + this.procedure = new Reference(); + return this.procedure; + } + else + return super.addChild(name); + } + + public ProcedureComponent copy() { + ProcedureComponent dst = new ProcedureComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.date = date == null ? null : date.copy(); + dst.procedure = procedure == null ? null : procedure.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureComponent)) + return false; + ProcedureComponent o = (ProcedureComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(date, o.date, true) && compareDeep(procedure, o.procedure, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureComponent)) + return false; + ProcedureComponent o = (ProcedureComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (date == null || date.isEmpty()) + && (procedure == null || procedure.isEmpty()); + } + + public String fhirType() { + return "Claim.procedure"; + + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line item. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected PositiveIntType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Type coverage; + + /** + * The contract number of a business agreement which describes the terms and conditions. + */ + @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name = "preAuthRef", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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=6, min=0, max=1, modifier=false, summary=true) + @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=7, min=0, max=1, modifier=false, summary=true) + @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 = 2031704818L; + + /** + * Constructor + */ + public CoverageComponent() { + super(); + } + + /** + * Constructor + */ + public CoverageComponent(PositiveIntType sequence, BooleanType focal, Type coverage) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + } + + /** + * @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 PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). 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(); // bb + 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. The Coverage against which the claim is to be adjudicated.). 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. The Coverage against which the claim is to be adjudicated. + */ + public boolean getFocal() { + return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + 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 Type getCoverage() { + return this.coverage; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Identifier getCoverageIdentifier() throws FHIRException { + if (!(this.coverage instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered"); + return (Identifier) this.coverage; + } + + public boolean hasCoverageIdentifier() { + return this.coverage instanceof Identifier; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverageReference() throws FHIRException { + if (!(this.coverage instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered"); + return (Reference) this.coverage; + } + + public boolean hasCoverageReference() { + return this.coverage instanceof Reference; + } + + 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(Type value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agreement 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(); // bb + 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 agreement 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 agreement 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 agreement 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 #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(); // cc + 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(); // aa + 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(); // cc + 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", "positiveInt", "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. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage[x]", "Identifier|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 agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type + case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType + case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType + case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 97604197: // focal + this.focal = castToBoolean(value); // BooleanType + break; + case -351767064: // coverage + this.coverage = (Type) value; // Type + break; + case 259920682: // businessArrangement + this.businessArrangement = castToString(value); // StringType + break; + case 522246568: // preAuthRef + this.getPreAuthRef().add(castToString(value)); // StringType + break; + case 689513629: // claimResponse + this.claimResponse = castToReference(value); // Reference + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("focal")) + this.focal = castToBoolean(value); // BooleanType + else if (name.equals("coverage[x]")) + this.coverage = (Type) value; // Type + else if (name.equals("businessArrangement")) + this.businessArrangement = castToString(value); // StringType + else if (name.equals("preAuthRef")) + this.getPreAuthRef().add(castToString(value)); + else if (name.equals("claimResponse")) + this.claimResponse = castToReference(value); // Reference + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 97604197: throw new FHIRException("Cannot make property focal as it is not a complex type"); // BooleanType + case 227689880: return getCoverage(); // Type + case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType + case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType + case 689513629: return getClaimResponse(); // Reference + case 1089373397: return getOriginalRuleset(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); + } + else if (name.equals("focal")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.focal"); + } + else if (name.equals("coverageIdentifier")) { + this.coverage = new Identifier(); + return this.coverage; + } + else if (name.equals("coverageReference")) { + this.coverage = new Reference(); + return this.coverage; + } + else if (name.equals("businessArrangement")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.businessArrangement"); + } + else if (name.equals("preAuthRef")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.preAuthRef"); + } + else if (name.equals("claimResponse")) { + this.claimResponse = new Reference(); + return this.claimResponse; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else + return super.addChild(name); + } + + 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(); + 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; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true) + && compareDeep(claimResponse, o.claimResponse, true) && compareDeep(originalRuleset, o.originalRuleset, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) + && compareValues(preAuthRef, o.preAuthRef, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (preAuthRef == null || preAuthRef.isEmpty()) && (claimResponse == null || claimResponse.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()); + } + + public String fhirType() { + return "Claim.coverage"; + + } + + } + + @Block() + public static class OnsetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The start or start and end dates for the treatable condition. + */ + @Child(name = "time", type = {DateType.class, Period.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Illness, injury or treatable condition date", formalDefinition="The start or start and end dates for the treatable condition." ) + protected Type time; + + /** + * Onset typifications eg. Start of pregnancy, start of illnes, etc. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Onset of what", formalDefinition="Onset typifications eg. Start of pregnancy, start of illnes, etc." ) + protected Coding type; + + private static final long serialVersionUID = -560173231L; + + /** + * Constructor + */ + public OnsetComponent() { + super(); + } + + /** + * @return {@link #time} (The start or start and end dates for the treatable condition.) + */ + public Type getTime() { + return this.time; + } + + /** + * @return {@link #time} (The start or start and end dates for the treatable condition.) + */ + public DateType getTimeDateType() throws FHIRException { + if (!(this.time instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.time.getClass().getName()+" was encountered"); + return (DateType) this.time; + } + + public boolean hasTimeDateType() { + return this.time instanceof DateType; + } + + /** + * @return {@link #time} (The start or start and end dates for the treatable condition.) + */ + public Period getTimePeriod() throws FHIRException { + if (!(this.time instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.time.getClass().getName()+" was encountered"); + return (Period) this.time; + } + + public boolean hasTimePeriod() { + return this.time instanceof Period; + } + + public boolean hasTime() { + return this.time != null && !this.time.isEmpty(); + } + + /** + * @param value {@link #time} (The start or start and end dates for the treatable condition.) + */ + public OnsetComponent setTime(Type value) { + this.time = value; + return this; + } + + /** + * @return {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OnsetComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.) + */ + public OnsetComponent setType(Coding value) { + this.type = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("time[x]", "date|Period", "The start or start and end dates for the treatable condition.", 0, java.lang.Integer.MAX_VALUE, time)); + childrenList.add(new Property("type", "Coding", "Onset typifications eg. Start of pregnancy, start of illnes, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // Type + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3560141: // time + this.time = (Type) value; // Type + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("time[x]")) + this.time = (Type) value; // Type + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1313930605: return getTime(); // Type + case 3575610: return getType(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("timeDate")) { + this.time = new DateType(); + return this.time; + } + else if (name.equals("timePeriod")) { + this.time = new Period(); + return this.time; + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else + return super.addChild(name); + } + + public OnsetComponent copy() { + OnsetComponent dst = new OnsetComponent(); + copyValues(dst); + dst.time = time == null ? null : time.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OnsetComponent)) + return false; + OnsetComponent o = (OnsetComponent) other; + return compareDeep(time, o.time, true) && compareDeep(type, o.type, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OnsetComponent)) + return false; + OnsetComponent o = (OnsetComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (time == null || time.isEmpty()) && (type == null || type.isEmpty()) + ; + } + + public String fhirType() { + return "Claim.onset"; + + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @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 = {Identifier.class, Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Type provider; + + /** + * The practitioner who is supervising the work of the servicing provider(s). + */ + @Child(name = "supervisor", type = {Identifier.class, Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Supervising Practitioner", formalDefinition="The practitioner who is supervising the work of the servicing provider(s)." ) + protected Type supervisor; + + /** + * The qualification which is applicable for this service. + */ + @Child(name = "providerQualification", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." ) + protected Coding providerQualification; + + /** + * Diagnosis applicable for this service or product line. + */ + @Child(name = "diagnosisLinkId", type = {PositiveIntType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Applicable diagnoses", 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=7, min=1, max=1, modifier=false, summary=true) + @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; + + /** + * Unusual circumstances which may influence adjudication. + */ + @Child(name = "serviceModifier", type = {Coding.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Service/Product modifiers", formalDefinition="Unusual circumstances which may influence adjudication." ) + protected List serviceModifier; + + /** + * 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=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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; + + /** + * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. + */ + @Child(name = "programCode", type = {Coding.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) + protected List programCode; + + /** + * The date or dates when the enclosed suite of services were performed or completed. + */ + @Child(name = "serviced", type = {DateType.class, Period.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) + protected Type serviced; + + /** + * Where the service was provided. + */ + @Child(name = "place", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Place of service", formalDefinition="Where the service was provided." ) + protected Coding place; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected SimpleQuantity 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=14, min=0, max=1, modifier=false, summary=true) + @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=15, min=0, max=1, modifier=false, summary=true) + @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=16, min=0, max=1, modifier=false, summary=true) + @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 addittional 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=17, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected List udi; + /** + * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) + */ + protected List udiTarget; + + + /** + * Physical service site on the patient (limb, tooth, etc). + */ + @Child(name = "bodySite", type = {Coding.class}, order=19, min=0, max=1, modifier=false, summary=true) + @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=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) + protected List subSite; + + /** + * Second tier of goods and services. + */ + @Child(name = "detail", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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=22, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) + protected ProsthesisComponent prosthesis; + + private static final long serialVersionUID = 1007480127L; + + /** + * Constructor + */ + public ItemsComponent() { + super(); + } + + /** + * Constructor + */ + public ItemsComponent(PositiveIntType 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 PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + 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(); // cc + 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 Type getProvider() { + return this.provider; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Identifier getProviderIdentifier() throws FHIRException { + if (!(this.provider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Identifier) this.provider; + } + + public boolean hasProviderIdentifier() { + return this.provider instanceof Identifier; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProviderReference() throws FHIRException { + if (!(this.provider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Reference) this.provider; + } + + public boolean hasProviderReference() { + return this.provider instanceof Reference; + } + + 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(Type value) { + this.provider = value; + return this; + } + + /** + * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) + */ + public Type getSupervisor() { + return this.supervisor; + } + + /** + * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) + */ + public Identifier getSupervisorIdentifier() throws FHIRException { + if (!(this.supervisor instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.supervisor.getClass().getName()+" was encountered"); + return (Identifier) this.supervisor; + } + + public boolean hasSupervisorIdentifier() { + return this.supervisor instanceof Identifier; + } + + /** + * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) + */ + public Reference getSupervisorReference() throws FHIRException { + if (!(this.supervisor instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.supervisor.getClass().getName()+" was encountered"); + return (Reference) this.supervisor; + } + + public boolean hasSupervisorReference() { + return this.supervisor instanceof Reference; + } + + public boolean hasSupervisor() { + return this.supervisor != null && !this.supervisor.isEmpty(); + } + + /** + * @param value {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) + */ + public ItemsComponent setSupervisor(Type value) { + this.supervisor = value; + return this; + } + + /** + * @return {@link #providerQualification} (The qualification which is applicable for this service.) + */ + public Coding getProviderQualification() { + if (this.providerQualification == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.providerQualification"); + else if (Configuration.doAutoCreate()) + this.providerQualification = new Coding(); // cc + return this.providerQualification; + } + + public boolean hasProviderQualification() { + return this.providerQualification != null && !this.providerQualification.isEmpty(); + } + + /** + * @param value {@link #providerQualification} (The qualification which is applicable for this service.) + */ + public ItemsComponent setProviderQualification(Coding value) { + this.providerQualification = 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 (PositiveIntType item : this.diagnosisLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + // syntactic sugar + public PositiveIntType addDiagnosisLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + 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 + PositiveIntType t = new PositiveIntType(); + 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 (PositiveIntType v : this.diagnosisLinkId) + if (v.equals(value)) // positiveInt + 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(); // cc + 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 #serviceModifier} (Unusual circumstances which may influence adjudication.) + */ + public List getServiceModifier() { + if (this.serviceModifier == null) + this.serviceModifier = new ArrayList(); + return this.serviceModifier; + } + + public boolean hasServiceModifier() { + if (this.serviceModifier == null) + return false; + for (Coding item : this.serviceModifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceModifier} (Unusual circumstances which may influence adjudication.) + */ + // syntactic sugar + public Coding addServiceModifier() { //3 + Coding t = new Coding(); + if (this.serviceModifier == null) + this.serviceModifier = new ArrayList(); + this.serviceModifier.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addServiceModifier(Coding t) { //3 + if (t == null) + return this; + if (this.serviceModifier == null) + this.serviceModifier = new ArrayList(); + this.serviceModifier.add(t); + return this; + } + + /** + * @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; + } + + // syntactic sugar + public ItemsComponent addModifier(Coding t) { //3 + if (t == null) + return this; + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return this; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + public List getProgramCode() { + if (this.programCode == null) + this.programCode = new ArrayList(); + return this.programCode; + } + + public boolean hasProgramCode() { + if (this.programCode == null) + return false; + for (Coding item : this.programCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + // syntactic sugar + public Coding addProgramCode() { //3 + Coding t = new Coding(); + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addProgramCode(Coding t) { //3 + if (t == null) + return this; + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return this; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public Type getServiced() { + return this.serviced; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public DateType getServicedDateType() throws FHIRException { + if (!(this.serviced instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered"); + return (DateType) this.serviced; + } + + public boolean hasServicedDateType() { + return this.serviced instanceof DateType; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public Period getServicedPeriod() throws FHIRException { + if (!(this.serviced instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered"); + return (Period) this.serviced; + } + + public boolean hasServicedPeriod() { + return this.serviced instanceof Period; + } + + public boolean hasServiced() { + return this.serviced != null && !this.serviced.isEmpty(); + } + + /** + * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public ItemsComponent setServiced(Type value) { + this.serviced = value; + return this; + } + + /** + * @return {@link #place} (Where the service was provided.) + */ + public Coding getPlace() { + if (this.place == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.place"); + else if (Configuration.doAutoCreate()) + this.place = new Coding(); // cc + return this.place; + } + + public boolean hasPlace() { + return this.place != null && !this.place.isEmpty(); + } + + /** + * @param value {@link #place} (Where the service was provided.) + */ + public ItemsComponent setPlace(Coding value) { + this.place = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + 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(SimpleQuantity 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(); // cc + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @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(double value) { + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @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(double value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional 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(); // cc + 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 addittional 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 List getUdi() { + if (this.udi == null) + this.udi = new ArrayList(); + return this.udi; + } + + public boolean hasUdi() { + if (this.udi == null) + return false; + for (Reference item : this.udi) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + // syntactic sugar + public Reference addUdi() { //3 + Reference t = new Reference(); + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addUdi(Reference t) { //3 + if (t == null) + return this; + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return this; + } + + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public List getUdiTarget() { + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + return this.udiTarget; + } + + // syntactic sugar + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public Device addUdiTarget() { + Device r = new Device(); + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + this.udiTarget.add(r); + return r; + } + + /** + * @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(); // cc + 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; + } + + // syntactic sugar + public ItemsComponent addSubSite(Coding t) { //3 + if (t == null) + return this; + if (this.subSite == null) + this.subSite = new ArrayList(); + this.subSite.add(t); + return this; + } + + /** + * @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; + } + + // syntactic sugar + public ItemsComponent addDetail(DetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) + */ + public ProsthesisComponent getProsthesis() { + if (this.prosthesis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.prosthesis"); + else if (Configuration.doAutoCreate()) + this.prosthesis = new ProsthesisComponent(); // cc + return this.prosthesis; + } + + public boolean hasProsthesis() { + return this.prosthesis != null && !this.prosthesis.isEmpty(); + } + + /** + * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) + */ + public ItemsComponent setProsthesis(ProsthesisComponent value) { + this.prosthesis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "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[x]", "Identifier|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("supervisor[x]", "Identifier|Reference(Practitioner)", "The practitioner who is supervising the work of the servicing provider(s).", 0, java.lang.Integer.MAX_VALUE, supervisor)); + childrenList.add(new Property("providerQualification", "Coding", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, providerQualification)); + childrenList.add(new Property("diagnosisLinkId", "positiveInt", "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("serviceModifier", "Coding", "Unusual circumstances which may influence adjudication.", 0, java.lang.Integer.MAX_VALUE, serviceModifier)); + 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("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); + childrenList.add(new Property("place", "Coding", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, place)); + childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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", "Reference(Device)", "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("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type + case -1697229976: /*supervisor*/ return this.supervisor == null ? new Base[0] : new Base[] {this.supervisor}; // Type + case -1240156290: /*providerQualification*/ return this.providerQualification == null ? new Base[0] : new Base[] {this.providerQualification}; // Coding + case -1659207418: /*diagnosisLinkId*/ return this.diagnosisLinkId == null ? new Base[0] : this.diagnosisLinkId.toArray(new Base[this.diagnosisLinkId.size()]); // PositiveIntType + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 615164076: /*serviceModifier*/ return this.serviceModifier == null ? new Base[0] : this.serviceModifier.toArray(new Base[this.serviceModifier.size()]); // Coding + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type + case 106748167: /*place*/ return this.place == null ? new Base[0] : new Base[] {this.place}; // Coding + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType + case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money + case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding + case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // Coding + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailComponent + case -2138744398: /*prosthesis*/ return this.prosthesis == null ? new Base[0] : new Base[] {this.prosthesis}; // ProsthesisComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case -987494927: // provider + this.provider = (Type) value; // Type + break; + case -1697229976: // supervisor + this.supervisor = (Type) value; // Type + break; + case -1240156290: // providerQualification + this.providerQualification = castToCoding(value); // Coding + break; + case -1659207418: // diagnosisLinkId + this.getDiagnosisLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 615164076: // serviceModifier + this.getServiceModifier().add(castToCoding(value)); // Coding + break; + case -615513385: // modifier + this.getModifier().add(castToCoding(value)); // Coding + break; + case 1010065041: // programCode + this.getProgramCode().add(castToCoding(value)); // Coding + break; + case 1379209295: // serviced + this.serviced = (Type) value; // Type + break; + case 106748167: // place + this.place = castToCoding(value); // Coding + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -486196699: // unitPrice + this.unitPrice = castToMoney(value); // Money + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case -982754077: // points + this.points = castToDecimal(value); // DecimalType + break; + case 108957: // net + this.net = castToMoney(value); // Money + break; + case 115642: // udi + this.getUdi().add(castToReference(value)); // Reference + break; + case 1702620169: // bodySite + this.bodySite = castToCoding(value); // Coding + break; + case -1868566105: // subSite + this.getSubSite().add(castToCoding(value)); // Coding + break; + case -1335224239: // detail + this.getDetail().add((DetailComponent) value); // DetailComponent + break; + case -2138744398: // prosthesis + this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("provider[x]")) + this.provider = (Type) value; // Type + else if (name.equals("supervisor[x]")) + this.supervisor = (Type) value; // Type + else if (name.equals("providerQualification")) + this.providerQualification = castToCoding(value); // Coding + else if (name.equals("diagnosisLinkId")) + this.getDiagnosisLinkId().add(castToPositiveInt(value)); + else if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("serviceModifier")) + this.getServiceModifier().add(castToCoding(value)); + else if (name.equals("modifier")) + this.getModifier().add(castToCoding(value)); + else if (name.equals("programCode")) + this.getProgramCode().add(castToCoding(value)); + else if (name.equals("serviced[x]")) + this.serviced = (Type) value; // Type + else if (name.equals("place")) + this.place = castToCoding(value); // Coding + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("unitPrice")) + this.unitPrice = castToMoney(value); // Money + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("points")) + this.points = castToDecimal(value); // DecimalType + else if (name.equals("net")) + this.net = castToMoney(value); // Money + else if (name.equals("udi")) + this.getUdi().add(castToReference(value)); + else if (name.equals("bodySite")) + this.bodySite = castToCoding(value); // Coding + else if (name.equals("subSite")) + this.getSubSite().add(castToCoding(value)); + else if (name.equals("detail")) + this.getDetail().add((DetailComponent) value); + else if (name.equals("prosthesis")) + this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 3575610: return getType(); // Coding + case 2064698607: return getProvider(); // Type + case -1823115240: return getSupervisor(); // Type + case -1240156290: return getProviderQualification(); // Coding + case -1659207418: throw new FHIRException("Cannot make property diagnosisLinkId as it is not a complex type"); // PositiveIntType + case 1984153269: return getService(); // Coding + case 615164076: return addServiceModifier(); // Coding + case -615513385: return addModifier(); // Coding + case 1010065041: return addProgramCode(); // Coding + case -1927922223: return getServiced(); // Type + case 106748167: return getPlace(); // Coding + case -1285004149: return getQuantity(); // SimpleQuantity + case -486196699: return getUnitPrice(); // Money + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType + case 108957: return getNet(); // Money + case 115642: return addUdi(); // Reference + case 1702620169: return getBodySite(); // Coding + case -1868566105: return addSubSite(); // Coding + case -1335224239: return addDetail(); // DetailComponent + case -2138744398: return getProsthesis(); // ProsthesisComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("providerIdentifier")) { + this.provider = new Identifier(); + return this.provider; + } + else if (name.equals("providerReference")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("supervisorIdentifier")) { + this.supervisor = new Identifier(); + return this.supervisor; + } + else if (name.equals("supervisorReference")) { + this.supervisor = new Reference(); + return this.supervisor; + } + else if (name.equals("providerQualification")) { + this.providerQualification = new Coding(); + return this.providerQualification; + } + else if (name.equals("diagnosisLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.diagnosisLinkId"); + } + else if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("serviceModifier")) { + return addServiceModifier(); + } + else if (name.equals("modifier")) { + return addModifier(); + } + else if (name.equals("programCode")) { + return addProgramCode(); + } + else if (name.equals("servicedDate")) { + this.serviced = new DateType(); + return this.serviced; + } + else if (name.equals("servicedPeriod")) { + this.serviced = new Period(); + return this.serviced; + } + else if (name.equals("place")) { + this.place = new Coding(); + return this.place; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("unitPrice")) { + this.unitPrice = new Money(); + return this.unitPrice; + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); + } + else if (name.equals("points")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); + } + else if (name.equals("net")) { + this.net = new Money(); + return this.net; + } + else if (name.equals("udi")) { + return addUdi(); + } + else if (name.equals("bodySite")) { + this.bodySite = new Coding(); + return this.bodySite; + } + else if (name.equals("subSite")) { + return addSubSite(); + } + else if (name.equals("detail")) { + return addDetail(); + } + else if (name.equals("prosthesis")) { + this.prosthesis = new ProsthesisComponent(); + return this.prosthesis; + } + else + return super.addChild(name); + } + + 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(); + dst.supervisor = supervisor == null ? null : supervisor.copy(); + dst.providerQualification = providerQualification == null ? null : providerQualification.copy(); + if (diagnosisLinkId != null) { + dst.diagnosisLinkId = new ArrayList(); + for (PositiveIntType i : diagnosisLinkId) + dst.diagnosisLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + if (serviceModifier != null) { + dst.serviceModifier = new ArrayList(); + for (Coding i : serviceModifier) + dst.serviceModifier.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (programCode != null) { + dst.programCode = new ArrayList(); + for (Coding i : programCode) + dst.programCode.add(i.copy()); + }; + dst.serviced = serviced == null ? null : serviced.copy(); + dst.place = place == null ? null : place.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(); + if (udi != null) { + dst.udi = new ArrayList(); + for (Reference i : udi) + dst.udi.add(i.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 (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + dst.prosthesis = prosthesis == null ? null : prosthesis.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true) + && compareDeep(supervisor, o.supervisor, true) && compareDeep(providerQualification, o.providerQualification, true) + && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(service, o.service, true) + && compareDeep(serviceModifier, o.serviceModifier, true) && compareDeep(modifier, o.modifier, true) + && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) && compareDeep(place, o.place, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) + && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) && compareDeep(detail, o.detail, true) + && compareDeep(prosthesis, o.prosthesis, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) + && compareValues(factor, o.factor, true) && compareValues(points, o.points, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (provider == null || provider.isEmpty()) && (supervisor == null || supervisor.isEmpty()) + && (providerQualification == null || providerQualification.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) + && (service == null || service.isEmpty()) && (serviceModifier == null || serviceModifier.isEmpty()) + && (modifier == null || modifier.isEmpty()) && (programCode == null || programCode.isEmpty()) + && (serviced == null || serviced.isEmpty()) && (place == null || place.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()) && (detail == null || detail.isEmpty()) && (prosthesis == null || prosthesis.isEmpty()) + ; + } + + public String fhirType() { + return "Claim.item"; + + } + + } + + @Block() + public static class DetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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; + + /** + * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. + */ + @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) + protected List programCode; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected SimpleQuantity 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=6, min=0, max=1, modifier=false, summary=true) + @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=7, min=0, max=1, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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 addittional 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, modifier=false, summary=true) + @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected List udi; + /** + * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) + */ + protected List udiTarget; + + + /** + * Third tier of goods and services. + */ + @Child(name = "subDetail", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -1099698352L; + + /** + * Constructor + */ + public DetailComponent() { + super(); + } + + /** + * Constructor + */ + public DetailComponent(PositiveIntType 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 PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + 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(); // cc + 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(); // cc + 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 #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + public List getProgramCode() { + if (this.programCode == null) + this.programCode = new ArrayList(); + return this.programCode; + } + + public boolean hasProgramCode() { + if (this.programCode == null) + return false; + for (Coding item : this.programCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + // syntactic sugar + public Coding addProgramCode() { //3 + Coding t = new Coding(); + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return t; + } + + // syntactic sugar + public DetailComponent addProgramCode(Coding t) { //3 + if (t == null) + return this; + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + 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(SimpleQuantity 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(); // cc + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @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(double value) { + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @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(double value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional 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(); // cc + 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 addittional 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 List getUdi() { + if (this.udi == null) + this.udi = new ArrayList(); + return this.udi; + } + + public boolean hasUdi() { + if (this.udi == null) + return false; + for (Reference item : this.udi) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + // syntactic sugar + public Reference addUdi() { //3 + Reference t = new Reference(); + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return t; + } + + // syntactic sugar + public DetailComponent addUdi(Reference t) { //3 + if (t == null) + return this; + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return this; + } + + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public List getUdiTarget() { + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + return this.udiTarget; + } + + // syntactic sugar + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public Device addUdiTarget() { + Device r = new Device(); + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + this.udiTarget.add(r); + return r; + } + + /** + * @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; + } + + // syntactic sugar + public DetailComponent addSubDetail(SubDetailComponent t) { //3 + if (t == null) + return this; + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "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("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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", "Reference(Device)", "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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType + case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money + case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference + case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 1010065041: // programCode + this.getProgramCode().add(castToCoding(value)); // Coding + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -486196699: // unitPrice + this.unitPrice = castToMoney(value); // Money + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case -982754077: // points + this.points = castToDecimal(value); // DecimalType + break; + case 108957: // net + this.net = castToMoney(value); // Money + break; + case 115642: // udi + this.getUdi().add(castToReference(value)); // Reference + break; + case -828829007: // subDetail + this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("programCode")) + this.getProgramCode().add(castToCoding(value)); + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("unitPrice")) + this.unitPrice = castToMoney(value); // Money + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("points")) + this.points = castToDecimal(value); // DecimalType + else if (name.equals("net")) + this.net = castToMoney(value); // Money + else if (name.equals("udi")) + this.getUdi().add(castToReference(value)); + else if (name.equals("subDetail")) + this.getSubDetail().add((SubDetailComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 3575610: return getType(); // Coding + case 1984153269: return getService(); // Coding + case 1010065041: return addProgramCode(); // Coding + case -1285004149: return getQuantity(); // SimpleQuantity + case -486196699: return getUnitPrice(); // Money + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType + case 108957: return getNet(); // Money + case 115642: return addUdi(); // Reference + case -828829007: return addSubDetail(); // SubDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("programCode")) { + return addProgramCode(); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("unitPrice")) { + this.unitPrice = new Money(); + return this.unitPrice; + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); + } + else if (name.equals("points")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); + } + else if (name.equals("net")) { + this.net = new Money(); + return this.net; + } + else if (name.equals("udi")) { + return addUdi(); + } + else if (name.equals("subDetail")) { + return addSubDetail(); + } + else + return super.addChild(name); + } + + 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(); + if (programCode != null) { + dst.programCode = new ArrayList(); + for (Coding i : programCode) + dst.programCode.add(i.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(); + if (udi != null) { + dst.udi = new ArrayList(); + for (Reference i : udi) + dst.udi.add(i.copy()); + }; + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetailComponent)) + return false; + DetailComponent o = (DetailComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) + && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) + && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) + && compareDeep(udi, o.udi, true) && compareDeep(subDetail, o.subDetail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetailComponent)) + return false; + DetailComponent o = (DetailComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (programCode == null || programCode.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()); + } + + public String fhirType() { + return "Claim.item.detail"; + + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addittional service or product or charge. + */ + @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addittional service or product or charge." ) + protected Coding service; + + /** + * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. + */ + @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) + protected List programCode; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected SimpleQuantity quantity; + + /** + * The fee for an addittional service or product or charge. + */ + @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addittional 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=7, min=0, max=1, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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 addittional 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, modifier=false, summary=true) + @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected List udi; + /** + * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) + */ + protected List udiTarget; + + + private static final long serialVersionUID = 846630321L; + + /** + * Constructor + */ + public SubDetailComponent() { + super(); + } + + /** + * Constructor + */ + public SubDetailComponent(PositiveIntType 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 PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + 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(); // cc + 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 addittional 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(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addittional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + public List getProgramCode() { + if (this.programCode == null) + this.programCode = new ArrayList(); + return this.programCode; + } + + public boolean hasProgramCode() { + if (this.programCode == null) + return false; + for (Coding item : this.programCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + // syntactic sugar + public Coding addProgramCode() { //3 + Coding t = new Coding(); + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return t; + } + + // syntactic sugar + public SubDetailComponent addProgramCode(Coding t) { //3 + if (t == null) + return this; + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + 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(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addittional 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(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addittional 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(); // bb + 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; + } + + /** + * @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(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @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(double value) { + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @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(double value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional 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(); // cc + 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 addittional 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 List getUdi() { + if (this.udi == null) + this.udi = new ArrayList(); + return this.udi; + } + + public boolean hasUdi() { + if (this.udi == null) + return false; + for (Reference item : this.udi) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + // syntactic sugar + public Reference addUdi() { //3 + Reference t = new Reference(); + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return t; + } + + // syntactic sugar + public SubDetailComponent addUdi(Reference t) { //3 + if (t == null) + return this; + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return this; + } + + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public List getUdiTarget() { + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + return this.udiTarget; + } + + // syntactic sugar + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public Device addUdiTarget() { + Device r = new Device(); + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + this.udiTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "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 addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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 addittional 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", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType + case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money + case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 1010065041: // programCode + this.getProgramCode().add(castToCoding(value)); // Coding + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -486196699: // unitPrice + this.unitPrice = castToMoney(value); // Money + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case -982754077: // points + this.points = castToDecimal(value); // DecimalType + break; + case 108957: // net + this.net = castToMoney(value); // Money + break; + case 115642: // udi + this.getUdi().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("programCode")) + this.getProgramCode().add(castToCoding(value)); + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("unitPrice")) + this.unitPrice = castToMoney(value); // Money + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("points")) + this.points = castToDecimal(value); // DecimalType + else if (name.equals("net")) + this.net = castToMoney(value); // Money + else if (name.equals("udi")) + this.getUdi().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 3575610: return getType(); // Coding + case 1984153269: return getService(); // Coding + case 1010065041: return addProgramCode(); // Coding + case -1285004149: return getQuantity(); // SimpleQuantity + case -486196699: return getUnitPrice(); // Money + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType + case 108957: return getNet(); // Money + case 115642: return addUdi(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("programCode")) { + return addProgramCode(); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("unitPrice")) { + this.unitPrice = new Money(); + return this.unitPrice; + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); + } + else if (name.equals("points")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); + } + else if (name.equals("net")) { + this.net = new Money(); + return this.net; + } + else if (name.equals("udi")) { + return addUdi(); + } + else + return super.addChild(name); + } + + 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(); + if (programCode != null) { + dst.programCode = new ArrayList(); + for (Coding i : programCode) + dst.programCode.add(i.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(); + if (udi != null) { + dst.udi = new ArrayList(); + for (Reference i : udi) + dst.udi.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) + && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) + && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) + && compareDeep(udi, o.udi, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (programCode == null || programCode.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()); + } + + public String fhirType() { + return "Claim.item.detail.subDetail"; + + } + + } + + @Block() + public static class ProsthesisComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates whether this is the initial placement of a fixed prosthesis. + */ + @Child(name = "initial", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Is this the initial service", formalDefinition="Indicates whether this is the initial placement of a fixed prosthesis." ) + protected BooleanType initial; + + /** + * Date of the initial placement. + */ + @Child(name = "priorDate", type = {DateType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." ) + protected DateType priorDate; + + /** + * Material of the prior denture or bridge prosthesis. (Oral). + */ + @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) + protected Coding priorMaterial; + + private static final long serialVersionUID = 1739349641L; + + /** + * Constructor + */ + public ProsthesisComponent() { + super(); + } + + /** + * @return {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value + */ + public BooleanType getInitialElement() { + if (this.initial == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.initial"); + else if (Configuration.doAutoCreate()) + this.initial = new BooleanType(); // bb + return this.initial; + } + + public boolean hasInitialElement() { + return this.initial != null && !this.initial.isEmpty(); + } + + public boolean hasInitial() { + return this.initial != null && !this.initial.isEmpty(); + } + + /** + * @param value {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value + */ + public ProsthesisComponent setInitialElement(BooleanType value) { + this.initial = value; + return this; + } + + /** + * @return Indicates whether this is the initial placement of a fixed prosthesis. + */ + public boolean getInitial() { + return this.initial == null || this.initial.isEmpty() ? false : this.initial.getValue(); + } + + /** + * @param value Indicates whether this is the initial placement of a fixed prosthesis. + */ + public ProsthesisComponent setInitial(boolean value) { + if (this.initial == null) + this.initial = new BooleanType(); + this.initial.setValue(value); + return this; + } + + /** + * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value + */ + public DateType getPriorDateElement() { + if (this.priorDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.priorDate"); + else if (Configuration.doAutoCreate()) + this.priorDate = new DateType(); // bb + return this.priorDate; + } + + public boolean hasPriorDateElement() { + return this.priorDate != null && !this.priorDate.isEmpty(); + } + + public boolean hasPriorDate() { + return this.priorDate != null && !this.priorDate.isEmpty(); + } + + /** + * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value + */ + public ProsthesisComponent setPriorDateElement(DateType value) { + this.priorDate = value; + return this; + } + + /** + * @return Date of the initial placement. + */ + public Date getPriorDate() { + return this.priorDate == null ? null : this.priorDate.getValue(); + } + + /** + * @param value Date of the initial placement. + */ + public ProsthesisComponent setPriorDate(Date value) { + if (value == null) + this.priorDate = null; + else { + if (this.priorDate == null) + this.priorDate = new DateType(); + this.priorDate.setValue(value); + } + return this; + } + + /** + * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) + */ + public Coding getPriorMaterial() { + if (this.priorMaterial == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); + else if (Configuration.doAutoCreate()) + this.priorMaterial = new Coding(); // cc + return this.priorMaterial; + } + + public boolean hasPriorMaterial() { + return this.priorMaterial != null && !this.priorMaterial.isEmpty(); + } + + /** + * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) + */ + public ProsthesisComponent setPriorMaterial(Coding value) { + this.priorMaterial = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial)); + childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); + childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // BooleanType + case -1770675816: /*priorDate*/ return this.priorDate == null ? new Base[0] : new Base[] {this.priorDate}; // DateType + case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1948342084: // initial + this.initial = castToBoolean(value); // BooleanType + break; + case -1770675816: // priorDate + this.priorDate = castToDate(value); // DateType + break; + case -532999663: // priorMaterial + this.priorMaterial = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("initial")) + this.initial = castToBoolean(value); // BooleanType + else if (name.equals("priorDate")) + this.priorDate = castToDate(value); // DateType + else if (name.equals("priorMaterial")) + this.priorMaterial = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1948342084: throw new FHIRException("Cannot make property initial as it is not a complex type"); // BooleanType + case -1770675816: throw new FHIRException("Cannot make property priorDate as it is not a complex type"); // DateType + case -532999663: return getPriorMaterial(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("initial")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.initial"); + } + else if (name.equals("priorDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.priorDate"); + } + else if (name.equals("priorMaterial")) { + this.priorMaterial = new Coding(); + return this.priorMaterial; + } + else + return super.addChild(name); + } + + public ProsthesisComponent copy() { + ProsthesisComponent dst = new ProsthesisComponent(); + copyValues(dst); + dst.initial = initial == null ? null : initial.copy(); + dst.priorDate = priorDate == null ? null : priorDate.copy(); + dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProsthesisComponent)) + return false; + ProsthesisComponent o = (ProsthesisComponent) other; + return compareDeep(initial, o.initial, true) && compareDeep(priorDate, o.priorDate, true) && compareDeep(priorMaterial, o.priorMaterial, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProsthesisComponent)) + return false; + ProsthesisComponent o = (ProsthesisComponent) other; + return compareValues(initial, o.initial, true) && compareValues(priorDate, o.priorDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty()) + && (priorMaterial == null || priorMaterial.isEmpty()); + } + + public String fhirType() { + return "Claim.item.prosthesis"; + + } + + } + + @Block() + public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The code identifying which tooth is missing. + */ + @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) + protected Coding tooth; + + /** + * Missing reason may be: E-extraction, O-other. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Indicates whether it was extracted or other reason", formalDefinition="Missing reason may be: E-extraction, O-other." ) + protected Coding reason; + + /** + * The date of the extraction either known from records or patient reported estimate. + */ + @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date tooth was extracted if known", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) + protected DateType extractionDate; + + private static final long serialVersionUID = 352913313L; + + /** + * Constructor + */ + public MissingTeethComponent() { + super(); + } + + /** + * Constructor + */ + public MissingTeethComponent(Coding tooth) { + super(); + this.tooth = tooth; + } + + /** + * @return {@link #tooth} (The code identifying which tooth is missing.) + */ + public Coding getTooth() { + if (this.tooth == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); + else if (Configuration.doAutoCreate()) + this.tooth = new Coding(); // cc + return this.tooth; + } + + public boolean hasTooth() { + return this.tooth != null && !this.tooth.isEmpty(); + } + + /** + * @param value {@link #tooth} (The code identifying which tooth is missing.) + */ + public MissingTeethComponent setTooth(Coding value) { + this.tooth = value; + return this; + } + + /** + * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) + */ + public MissingTeethComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value + */ + public DateType getExtractionDateElement() { + if (this.extractionDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate"); + else if (Configuration.doAutoCreate()) + this.extractionDate = new DateType(); // bb + return this.extractionDate; + } + + public boolean hasExtractionDateElement() { + return this.extractionDate != null && !this.extractionDate.isEmpty(); + } + + public boolean hasExtractionDate() { + return this.extractionDate != null && !this.extractionDate.isEmpty(); + } + + /** + * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value + */ + public MissingTeethComponent setExtractionDateElement(DateType value) { + this.extractionDate = value; + return this; + } + + /** + * @return The date of the extraction either known from records or patient reported estimate. + */ + 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(Date value) { + if (value == null) + this.extractionDate = null; + else { + if (this.extractionDate == null) + this.extractionDate = new DateType(); + this.extractionDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); + childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 110545608: /*tooth*/ return this.tooth == null ? new Base[0] : new Base[] {this.tooth}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case 580646965: /*extractionDate*/ return this.extractionDate == null ? new Base[0] : new Base[] {this.extractionDate}; // DateType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 110545608: // tooth + this.tooth = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case 580646965: // extractionDate + this.extractionDate = castToDate(value); // DateType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("tooth")) + this.tooth = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("extractionDate")) + this.extractionDate = castToDate(value); // DateType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 110545608: return getTooth(); // Coding + case -934964668: return getReason(); // Coding + case 580646965: throw new FHIRException("Cannot make property extractionDate as it is not a complex type"); // DateType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("tooth")) { + this.tooth = new Coding(); + return this.tooth; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("extractionDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.extractionDate"); + } + else + return super.addChild(name); + } + + public MissingTeethComponent copy() { + MissingTeethComponent dst = new MissingTeethComponent(); + copyValues(dst); + dst.tooth = tooth == null ? null : tooth.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.extractionDate = extractionDate == null ? null : extractionDate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MissingTeethComponent)) + return false; + MissingTeethComponent o = (MissingTeethComponent) other; + return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MissingTeethComponent)) + return false; + MissingTeethComponent o = (MissingTeethComponent) other; + return compareValues(extractionDate, o.extractionDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty()) + && (extractionDate == null || extractionDate.isEmpty()); + } + + public String fhirType() { + return "Claim.missingTeeth"; + + } + + } + + /** + * The category of claim. + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="institutional | oral | pharmacy | professional | vision", formalDefinition="The category of claim." ) + protected Enumeration type; + + /** + * A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType. + */ + @Child(name = "subType", type = {Coding.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Finer grained claim type information", formalDefinition="A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType." ) + protected List subType; + + /** + * The business identifier for the instance: claim number, pre-determination or pre-authorization number. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: 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=3, min=0, max=1, modifier=false, summary=true) + @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=4, min=0, max=1, modifier=false, summary=true) + @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=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The billable period for which charges are being submitted. + */ + @Child(name = "billablePeriod", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Period for charge submission", formalDefinition="The billable period for which charges are being submitted." ) + protected Period billablePeriod; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name = "target", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Type target; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Type provider; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name = "organization", type = {Identifier.class, Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Type organization; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name = "use", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @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=11, min=0, max=1, modifier=false, summary=true) + @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=12, min=0, max=1, modifier=false, summary=true) + @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 = {Identifier.class, Practitioner.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Type enterer; + + /** + * Facility where the services were provided. + */ + @Child(name = "facility", type = {Identifier.class, Location.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Type facility; + + /** + * Other claims which are related to this claim such as prior claim versions or for related services. + */ + @Child(name = "related", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Related Claims which may be revelant to processing this claimn", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) + protected List related; + + /** + * Prescription to support the dispensing of Pharmacy or Vision products. + */ + @Child(name = "prescription", type = {Identifier.class, MedicationOrder.class, VisionPrescription.class}, order=16, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) + protected Type prescription; + + /** + * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. + */ + @Child(name = "originalPrescription", type = {Identifier.class, MedicationOrder.class}, order=17, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products." ) + protected Type originalPrescription; + + /** + * The party to be reimbursed for the services. + */ + @Child(name = "payee", type = {}, order=18, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="The party to be reimbursed for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name = "referral", type = {Identifier.class, ReferralRequest.class}, order=19, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Type referral; + + /** + * **Insert definition of Occurrence codes. + */ + @Child(name = "occurrenceCode", type = {Coding.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Occurrence Codes", formalDefinition="**Insert definition of Occurrence codes." ) + protected List occurrenceCode; + + /** + * **Insert definition of Occurrence Span codes. + */ + @Child(name = "occurenceSpanCode", type = {Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Occurrence Span Codes", formalDefinition="**Insert definition of Occurrence Span codes." ) + protected List occurenceSpanCode; + + /** + * **Insert definition of Value codes. + */ + @Child(name = "valueCode", type = {Coding.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Value Codes", formalDefinition="**Insert definition of Value codes." ) + protected List valueCode; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name = "diagnosis", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * Ordered list of patient procedures performed to support the adjudication. + */ + @Child(name = "procedure", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Procedures performed", formalDefinition="Ordered list of patient procedures performed to support the adjudication." ) + protected List procedure; + + /** + * List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication. + */ + @Child(name = "specialCondition", type = {Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="List of special Conditions", formalDefinition="List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication." ) + protected List specialCondition; + + /** + * Patient Resource. + */ + @Child(name = "patient", type = {Identifier.class, Patient.class}, order=26, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Type patient; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name = "coverage", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Date of an accident which these services are addressing. + */ + @Child(name = "accidentDate", type = {DateType.class}, order=28, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the accident occurred", formalDefinition="Date of an accident which these services are addressing." ) + protected DateType accidentDate; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name = "accidentType", type = {Coding.class}, order=29, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The nature of the accident", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * Accident Place. + */ + @Child(name = "accidentLocation", type = {Address.class, Location.class}, order=30, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Accident Place", formalDefinition="Accident Place." ) + protected Type accidentLocation; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name = "interventionException", type = {Coding.class}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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; + + /** + * Period, start and last dates of aspects of the Condition or related services. + */ + @Child(name = "onset", type = {}, order=32, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Condition related Onset related dates and codes", formalDefinition="Period, start and last dates of aspects of the Condition or related services." ) + protected List onset; + + /** + * The start and optional end dates of when the patient was precluded from working due to the treatable condition(s). + */ + @Child(name = "employmentImpacted", type = {Period.class}, order=33, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Period unable to work", formalDefinition="The start and optional end dates of when the patient was precluded from working due to the treatable condition(s)." ) + protected Period employmentImpacted; + + /** + * The start and optional end dates of when the patient was confined to a treatment center. + */ + @Child(name = "hospitalization", type = {Period.class}, order=34, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Period in hospital", formalDefinition="The start and optional end dates of when the patient was confined to a treatment center." ) + protected Period hospitalization; + + /** + * First tier of goods and services. + */ + @Child(name = "item", type = {}, order=35, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Goods and Services", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * The total value of the claim. + */ + @Child(name = "total", type = {Money.class}, order=36, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total claim cost", formalDefinition="The total value of the claim." ) + protected Money total; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name = "additionalMaterial", type = {Coding.class}, order=37, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Additional supporting materials and documents", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) + protected List additionalMaterial; + + /** + * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. + */ + @Child(name = "missingTeeth", type = {}, order=38, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) + protected List missingTeeth; + + private static final long serialVersionUID = 1478562254L; + + /** + * Constructor + */ + public Claim() { + super(); + } + + /** + * Constructor + */ + public Claim(Enumeration type, Type patient) { + super(); + this.type = type; + this.patient = patient; + } + + /** + * @return {@link #type} (The category of claim.). 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 Claim.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ClaimTypeEnumFactory()); // bb + 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 category of claim.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Claim setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The category of claim. + */ + public ClaimType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The category of claim. + */ + public Claim setType(ClaimType value) { + if (this.type == null) + this.type = new Enumeration(new ClaimTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) + */ + public List getSubType() { + if (this.subType == null) + this.subType = new ArrayList(); + return this.subType; + } + + public boolean hasSubType() { + if (this.subType == null) + return false; + for (Coding item : this.subType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) + */ + // syntactic sugar + public Coding addSubType() { //3 + Coding t = new Coding(); + if (this.subType == null) + this.subType = new ArrayList(); + this.subType.add(t); + return t; + } + + // syntactic sugar + public Claim addSubType(Coding t) { //3 + if (t == null) + return this; + if (this.subType == null) + this.subType = new ArrayList(); + this.subType.add(t); + return this; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: 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: 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; + } + + // syntactic sugar + public Claim addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @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 Claim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + 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 Claim 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 Claim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 Claim 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 Claim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 Claim 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 Claim 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 #billablePeriod} (The billable period for which charges are being submitted.) + */ + public Period getBillablePeriod() { + if (this.billablePeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.billablePeriod"); + else if (Configuration.doAutoCreate()) + this.billablePeriod = new Period(); // cc + return this.billablePeriod; + } + + public boolean hasBillablePeriod() { + return this.billablePeriod != null && !this.billablePeriod.isEmpty(); + } + + /** + * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.) + */ + public Claim setBillablePeriod(Period value) { + this.billablePeriod = value; + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Type getTarget() { + return this.target; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Identifier getTargetIdentifier() throws FHIRException { + if (!(this.target instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Identifier) this.target; + } + + public boolean hasTargetIdentifier() { + return this.target instanceof Identifier; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTargetReference() throws FHIRException { + if (!(this.target instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Reference) this.target; + } + + public boolean hasTargetReference() { + return this.target instanceof Reference; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Claim setTarget(Type value) { + this.target = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Type getProvider() { + return this.provider; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Identifier getProviderIdentifier() throws FHIRException { + if (!(this.provider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Identifier) this.provider; + } + + public boolean hasProviderIdentifier() { + return this.provider instanceof Identifier; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProviderReference() throws FHIRException { + if (!(this.provider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Reference) this.provider; + } + + public boolean hasProviderReference() { + return this.provider instanceof Reference; + } + + 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 Claim setProvider(Type value) { + this.provider = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + 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 Claim setOrganization(Type value) { + this.organization = 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 Claim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new UseEnumFactory()); // bb + 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 Claim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public Use getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public Claim setUse(Use value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new UseEnumFactory()); + 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 Claim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); // cc + 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 Claim 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 Claim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); // cc + 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 Claim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Type getEnterer() { + return this.enterer; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Identifier getEntererIdentifier() throws FHIRException { + if (!(this.enterer instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.enterer.getClass().getName()+" was encountered"); + return (Identifier) this.enterer; + } + + public boolean hasEntererIdentifier() { + return this.enterer instanceof Identifier; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEntererReference() throws FHIRException { + if (!(this.enterer instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.enterer.getClass().getName()+" was encountered"); + return (Reference) this.enterer; + } + + public boolean hasEntererReference() { + return this.enterer instanceof Reference; + } + + 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 Claim setEnterer(Type value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Type getFacility() { + return this.facility; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Identifier getFacilityIdentifier() throws FHIRException { + if (!(this.facility instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.facility.getClass().getName()+" was encountered"); + return (Identifier) this.facility; + } + + public boolean hasFacilityIdentifier() { + return this.facility instanceof Identifier; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacilityReference() throws FHIRException { + if (!(this.facility instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.facility.getClass().getName()+" was encountered"); + return (Reference) this.facility; + } + + public boolean hasFacilityReference() { + return this.facility instanceof Reference; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public Claim setFacility(Type value) { + this.facility = value; + return this; + } + + /** + * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (RelatedClaimsComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + // syntactic sugar + public RelatedClaimsComponent addRelated() { //3 + RelatedClaimsComponent t = new RelatedClaimsComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + // syntactic sugar + public Claim addRelated(RelatedClaimsComponent t) { //3 + if (t == null) + return this; + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return this; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Type getPrescription() { + return this.prescription; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Identifier getPrescriptionIdentifier() throws FHIRException { + if (!(this.prescription instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.prescription.getClass().getName()+" was encountered"); + return (Identifier) this.prescription; + } + + public boolean hasPrescriptionIdentifier() { + return this.prescription instanceof Identifier; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Reference getPrescriptionReference() throws FHIRException { + if (!(this.prescription instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.prescription.getClass().getName()+" was encountered"); + return (Reference) this.prescription; + } + + public boolean hasPrescriptionReference() { + return this.prescription instanceof Reference; + } + + public boolean hasPrescription() { + return this.prescription != null && !this.prescription.isEmpty(); + } + + /** + * @param value {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Claim setPrescription(Type value) { + this.prescription = value; + return this; + } + + /** + * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Type getOriginalPrescription() { + return this.originalPrescription; + } + + /** + * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Identifier getOriginalPrescriptionIdentifier() throws FHIRException { + if (!(this.originalPrescription instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.originalPrescription.getClass().getName()+" was encountered"); + return (Identifier) this.originalPrescription; + } + + public boolean hasOriginalPrescriptionIdentifier() { + return this.originalPrescription instanceof Identifier; + } + + /** + * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Reference getOriginalPrescriptionReference() throws FHIRException { + if (!(this.originalPrescription instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.originalPrescription.getClass().getName()+" was encountered"); + return (Reference) this.originalPrescription; + } + + public boolean hasOriginalPrescriptionReference() { + return this.originalPrescription instanceof Reference; + } + + public boolean hasOriginalPrescription() { + return this.originalPrescription != null && !this.originalPrescription.isEmpty(); + } + + /** + * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Claim setOriginalPrescription(Type value) { + this.originalPrescription = value; + return this; + } + + /** + * @return {@link #payee} (The party to be reimbursed for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); // cc + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (The party to be reimbursed for the services.) + */ + public Claim 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 Type getReferral() { + return this.referral; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Identifier getReferralIdentifier() throws FHIRException { + if (!(this.referral instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.referral.getClass().getName()+" was encountered"); + return (Identifier) this.referral; + } + + public boolean hasReferralIdentifier() { + return this.referral instanceof Identifier; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferralReference() throws FHIRException { + if (!(this.referral instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.referral.getClass().getName()+" was encountered"); + return (Reference) this.referral; + } + + public boolean hasReferralReference() { + return this.referral instanceof Reference; + } + + 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 Claim setReferral(Type value) { + this.referral = value; + return this; + } + + /** + * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.) + */ + public List getOccurrenceCode() { + if (this.occurrenceCode == null) + this.occurrenceCode = new ArrayList(); + return this.occurrenceCode; + } + + public boolean hasOccurrenceCode() { + if (this.occurrenceCode == null) + return false; + for (Coding item : this.occurrenceCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.) + */ + // syntactic sugar + public Coding addOccurrenceCode() { //3 + Coding t = new Coding(); + if (this.occurrenceCode == null) + this.occurrenceCode = new ArrayList(); + this.occurrenceCode.add(t); + return t; + } + + // syntactic sugar + public Claim addOccurrenceCode(Coding t) { //3 + if (t == null) + return this; + if (this.occurrenceCode == null) + this.occurrenceCode = new ArrayList(); + this.occurrenceCode.add(t); + return this; + } + + /** + * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.) + */ + public List getOccurenceSpanCode() { + if (this.occurenceSpanCode == null) + this.occurenceSpanCode = new ArrayList(); + return this.occurenceSpanCode; + } + + public boolean hasOccurenceSpanCode() { + if (this.occurenceSpanCode == null) + return false; + for (Coding item : this.occurenceSpanCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.) + */ + // syntactic sugar + public Coding addOccurenceSpanCode() { //3 + Coding t = new Coding(); + if (this.occurenceSpanCode == null) + this.occurenceSpanCode = new ArrayList(); + this.occurenceSpanCode.add(t); + return t; + } + + // syntactic sugar + public Claim addOccurenceSpanCode(Coding t) { //3 + if (t == null) + return this; + if (this.occurenceSpanCode == null) + this.occurenceSpanCode = new ArrayList(); + this.occurenceSpanCode.add(t); + return this; + } + + /** + * @return {@link #valueCode} (**Insert definition of Value codes.) + */ + public List getValueCode() { + if (this.valueCode == null) + this.valueCode = new ArrayList(); + return this.valueCode; + } + + public boolean hasValueCode() { + if (this.valueCode == null) + return false; + for (Coding item : this.valueCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valueCode} (**Insert definition of Value codes.) + */ + // syntactic sugar + public Coding addValueCode() { //3 + Coding t = new Coding(); + if (this.valueCode == null) + this.valueCode = new ArrayList(); + this.valueCode.add(t); + return t; + } + + // syntactic sugar + public Claim addValueCode(Coding t) { //3 + if (t == null) + return this; + if (this.valueCode == null) + this.valueCode = new ArrayList(); + this.valueCode.add(t); + 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; + } + + // syntactic sugar + public Claim addDiagnosis(DiagnosisComponent t) { //3 + if (t == null) + return this; + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return this; + } + + /** + * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.) + */ + public List getProcedure() { + if (this.procedure == null) + this.procedure = new ArrayList(); + return this.procedure; + } + + public boolean hasProcedure() { + if (this.procedure == null) + return false; + for (ProcedureComponent item : this.procedure) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.) + */ + // syntactic sugar + public ProcedureComponent addProcedure() { //3 + ProcedureComponent t = new ProcedureComponent(); + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return t; + } + + // syntactic sugar + public Claim addProcedure(ProcedureComponent t) { //3 + if (t == null) + return this; + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return this; + } + + /** + * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) + */ + public List getSpecialCondition() { + if (this.specialCondition == null) + this.specialCondition = new ArrayList(); + return this.specialCondition; + } + + public boolean hasSpecialCondition() { + if (this.specialCondition == null) + return false; + for (Coding item : this.specialCondition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) + */ + // syntactic sugar + public Coding addSpecialCondition() { //3 + Coding t = new Coding(); + if (this.specialCondition == null) + this.specialCondition = new ArrayList(); + this.specialCondition.add(t); + return t; + } + + // syntactic sugar + public Claim addSpecialCondition(Coding t) { //3 + if (t == null) + return this; + if (this.specialCondition == null) + this.specialCondition = new ArrayList(); + this.specialCondition.add(t); + return this; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Type getPatient() { + return this.patient; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Identifier getPatientIdentifier() throws FHIRException { + if (!(this.patient instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.patient.getClass().getName()+" was encountered"); + return (Identifier) this.patient; + } + + public boolean hasPatientIdentifier() { + return this.patient instanceof Identifier; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatientReference() throws FHIRException { + if (!(this.patient instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.patient.getClass().getName()+" was encountered"); + return (Reference) this.patient; + } + + public boolean hasPatientReference() { + return this.patient instanceof Reference; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public Claim setPatient(Type value) { + this.patient = 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; + } + + // syntactic sugar + public Claim addCoverage(CoverageComponent t) { //3 + if (t == null) + return this; + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return this; + } + + /** + * @return {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value + */ + public DateType getAccidentDateElement() { + if (this.accidentDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.accidentDate"); + else if (Configuration.doAutoCreate()) + this.accidentDate = new DateType(); // bb + return this.accidentDate; + } + + public boolean hasAccidentDateElement() { + return this.accidentDate != null && !this.accidentDate.isEmpty(); + } + + public boolean hasAccidentDate() { + return this.accidentDate != null && !this.accidentDate.isEmpty(); + } + + /** + * @param value {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value + */ + public Claim setAccidentDateElement(DateType value) { + this.accidentDate = value; + return this; + } + + /** + * @return Date of an accident which these services are addressing. + */ + public Date getAccidentDate() { + return this.accidentDate == null ? null : this.accidentDate.getValue(); + } + + /** + * @param value Date of an accident which these services are addressing. + */ + public Claim setAccidentDate(Date value) { + if (value == null) + this.accidentDate = null; + else { + if (this.accidentDate == null) + this.accidentDate = new DateType(); + this.accidentDate.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 Claim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); // cc + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Claim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #accidentLocation} (Accident Place.) + */ + public Type getAccidentLocation() { + return this.accidentLocation; + } + + /** + * @return {@link #accidentLocation} (Accident Place.) + */ + public Address getAccidentLocationAddress() throws FHIRException { + if (!(this.accidentLocation instanceof Address)) + throw new FHIRException("Type mismatch: the type Address was expected, but "+this.accidentLocation.getClass().getName()+" was encountered"); + return (Address) this.accidentLocation; + } + + public boolean hasAccidentLocationAddress() { + return this.accidentLocation instanceof Address; + } + + /** + * @return {@link #accidentLocation} (Accident Place.) + */ + public Reference getAccidentLocationReference() throws FHIRException { + if (!(this.accidentLocation instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.accidentLocation.getClass().getName()+" was encountered"); + return (Reference) this.accidentLocation; + } + + public boolean hasAccidentLocationReference() { + return this.accidentLocation instanceof Reference; + } + + public boolean hasAccidentLocation() { + return this.accidentLocation != null && !this.accidentLocation.isEmpty(); + } + + /** + * @param value {@link #accidentLocation} (Accident Place.) + */ + public Claim setAccidentLocation(Type value) { + this.accidentLocation = 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; + } + + // syntactic sugar + public Claim addInterventionException(Coding t) { //3 + if (t == null) + return this; + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return this; + } + + /** + * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.) + */ + public List getOnset() { + if (this.onset == null) + this.onset = new ArrayList(); + return this.onset; + } + + public boolean hasOnset() { + if (this.onset == null) + return false; + for (OnsetComponent item : this.onset) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.) + */ + // syntactic sugar + public OnsetComponent addOnset() { //3 + OnsetComponent t = new OnsetComponent(); + if (this.onset == null) + this.onset = new ArrayList(); + this.onset.add(t); + return t; + } + + // syntactic sugar + public Claim addOnset(OnsetComponent t) { //3 + if (t == null) + return this; + if (this.onset == null) + this.onset = new ArrayList(); + this.onset.add(t); + return this; + } + + /** + * @return {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).) + */ + public Period getEmploymentImpacted() { + if (this.employmentImpacted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.employmentImpacted"); + else if (Configuration.doAutoCreate()) + this.employmentImpacted = new Period(); // cc + return this.employmentImpacted; + } + + public boolean hasEmploymentImpacted() { + return this.employmentImpacted != null && !this.employmentImpacted.isEmpty(); + } + + /** + * @param value {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).) + */ + public Claim setEmploymentImpacted(Period value) { + this.employmentImpacted = value; + return this; + } + + /** + * @return {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.) + */ + public Period getHospitalization() { + if (this.hospitalization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.hospitalization"); + else if (Configuration.doAutoCreate()) + this.hospitalization = new Period(); // cc + return this.hospitalization; + } + + public boolean hasHospitalization() { + return this.hospitalization != null && !this.hospitalization.isEmpty(); + } + + /** + * @param value {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.) + */ + public Claim setHospitalization(Period value) { + this.hospitalization = value; + return this; + } + + /** + * @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; + } + + // syntactic sugar + public Claim addItem(ItemsComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #total} (The total value of the claim.) + */ + public Money getTotal() { + if (this.total == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.total"); + else if (Configuration.doAutoCreate()) + this.total = new Money(); // cc + return this.total; + } + + public boolean hasTotal() { + return this.total != null && !this.total.isEmpty(); + } + + /** + * @param value {@link #total} (The total value of the claim.) + */ + public Claim setTotal(Money value) { + this.total = value; + return this; + } + + /** + * @return {@link #additionalMaterial} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterial() { + if (this.additionalMaterial == null) + this.additionalMaterial = new ArrayList(); + return this.additionalMaterial; + } + + public boolean hasAdditionalMaterial() { + if (this.additionalMaterial == null) + return false; + for (Coding item : this.additionalMaterial) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterial} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterial() { //3 + Coding t = new Coding(); + if (this.additionalMaterial == null) + this.additionalMaterial = new ArrayList(); + this.additionalMaterial.add(t); + return t; + } + + // syntactic sugar + public Claim addAdditionalMaterial(Coding t) { //3 + if (t == null) + return this; + if (this.additionalMaterial == null) + this.additionalMaterial = new ArrayList(); + this.additionalMaterial.add(t); + return this; + } + + /** + * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) + */ + public List getMissingTeeth() { + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + return this.missingTeeth; + } + + public boolean hasMissingTeeth() { + if (this.missingTeeth == null) + return false; + for (MissingTeethComponent item : this.missingTeeth) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) + */ + // syntactic sugar + public MissingTeethComponent addMissingTeeth() { //3 + MissingTeethComponent t = new MissingTeethComponent(); + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + this.missingTeeth.add(t); + return t; + } + + // syntactic sugar + public Claim addMissingTeeth(MissingTeethComponent t) { //3 + if (t == null) + return this; + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + this.missingTeeth.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The category of claim.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subType", "Coding", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType)); + childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: 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("billablePeriod", "Period", "The billable period for which charges are being submitted.", 0, java.lang.Integer.MAX_VALUE, billablePeriod)); + childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider[x]", "Identifier|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[x]", "Identifier|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[x]", "Identifier|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[x]", "Identifier|Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("related", "", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, related)); + childrenList.add(new Property("prescription[x]", "Identifier|Reference(MedicationOrder|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription)); + childrenList.add(new Property("originalPrescription[x]", "Identifier|Reference(MedicationOrder)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); + childrenList.add(new Property("payee", "", "The party to be reimbursed for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral[x]", "Identifier|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("occurrenceCode", "Coding", "**Insert definition of Occurrence codes.", 0, java.lang.Integer.MAX_VALUE, occurrenceCode)); + childrenList.add(new Property("occurenceSpanCode", "Coding", "**Insert definition of Occurrence Span codes.", 0, java.lang.Integer.MAX_VALUE, occurenceSpanCode)); + childrenList.add(new Property("valueCode", "Coding", "**Insert definition of Value codes.", 0, java.lang.Integer.MAX_VALUE, valueCode)); + 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("procedure", "", "Ordered list of patient procedures performed to support the adjudication.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("specialCondition", "Coding", "List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, specialCondition)); + childrenList.add(new Property("patient[x]", "Identifier|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("accidentDate", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, accidentDate)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("accidentLocation[x]", "Address|Reference(Location)", "Accident Place.", 0, java.lang.Integer.MAX_VALUE, accidentLocation)); + 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("onset", "", "Period, start and last dates of aspects of the Condition or related services.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("employmentImpacted", "Period", "The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).", 0, java.lang.Integer.MAX_VALUE, employmentImpacted)); + childrenList.add(new Property("hospitalization", "Period", "The start and optional end dates of when the patient was confined to a treatment center.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("total", "Money", "The total value of the claim.", 0, java.lang.Integer.MAX_VALUE, total)); + childrenList.add(new Property("additionalMaterial", "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, additionalMaterial)); + childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // Coding + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -332066046: /*billablePeriod*/ return this.billablePeriod == null ? new Base[0] : new Base[] {this.billablePeriod}; // Period + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Coding + case 1314609806: /*fundsReserve*/ return this.fundsReserve == null ? new Base[0] : new Base[] {this.fundsReserve}; // Coding + case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Type + case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Type + case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // RelatedClaimsComponent + case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Type + case -1814015861: /*originalPrescription*/ return this.originalPrescription == null ? new Base[0] : new Base[] {this.originalPrescription}; // Type + case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // PayeeComponent + case -722568291: /*referral*/ return this.referral == null ? new Base[0] : new Base[] {this.referral}; // Type + case 1721744222: /*occurrenceCode*/ return this.occurrenceCode == null ? new Base[0] : this.occurrenceCode.toArray(new Base[this.occurrenceCode.size()]); // Coding + case -556690898: /*occurenceSpanCode*/ return this.occurenceSpanCode == null ? new Base[0] : this.occurenceSpanCode.toArray(new Base[this.occurenceSpanCode.size()]); // Coding + case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // Coding + case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent + case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // ProcedureComponent + case -481489822: /*specialCondition*/ return this.specialCondition == null ? new Base[0] : this.specialCondition.toArray(new Base[this.specialCondition.size()]); // Coding + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Type + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent + case -63170979: /*accidentDate*/ return this.accidentDate == null ? new Base[0] : new Base[] {this.accidentDate}; // DateType + case -62671383: /*accidentType*/ return this.accidentType == null ? new Base[0] : new Base[] {this.accidentType}; // Coding + case -1074014492: /*accidentLocation*/ return this.accidentLocation == null ? new Base[0] : new Base[] {this.accidentLocation}; // Type + case 1753076536: /*interventionException*/ return this.interventionException == null ? new Base[0] : this.interventionException.toArray(new Base[this.interventionException.size()]); // Coding + case 105901603: /*onset*/ return this.onset == null ? new Base[0] : this.onset.toArray(new Base[this.onset.size()]); // OnsetComponent + case 1051487345: /*employmentImpacted*/ return this.employmentImpacted == null ? new Base[0] : new Base[] {this.employmentImpacted}; // Period + case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // Period + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent + case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // Money + case -1534875026: /*additionalMaterial*/ return this.additionalMaterial == null ? new Base[0] : this.additionalMaterial.toArray(new Base[this.additionalMaterial.size()]); // Coding + case -1157130302: /*missingTeeth*/ return this.missingTeeth == null ? new Base[0] : this.missingTeeth.toArray(new Base[this.missingTeeth.size()]); // MissingTeethComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new ClaimTypeEnumFactory().fromType(value); // Enumeration + break; + case -1868521062: // subType + this.getSubType().add(castToCoding(value)); // Coding + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case -332066046: // billablePeriod + this.billablePeriod = castToPeriod(value); // Period + break; + case -880905839: // target + this.target = (Type) value; // Type + break; + case -987494927: // provider + this.provider = (Type) value; // Type + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case 116103: // use + this.use = new UseEnumFactory().fromType(value); // Enumeration + break; + case -1165461084: // priority + this.priority = castToCoding(value); // Coding + break; + case 1314609806: // fundsReserve + this.fundsReserve = castToCoding(value); // Coding + break; + case -1591951995: // enterer + this.enterer = (Type) value; // Type + break; + case 501116579: // facility + this.facility = (Type) value; // Type + break; + case 1090493483: // related + this.getRelated().add((RelatedClaimsComponent) value); // RelatedClaimsComponent + break; + case 460301338: // prescription + this.prescription = (Type) value; // Type + break; + case -1814015861: // originalPrescription + this.originalPrescription = (Type) value; // Type + break; + case 106443592: // payee + this.payee = (PayeeComponent) value; // PayeeComponent + break; + case -722568291: // referral + this.referral = (Type) value; // Type + break; + case 1721744222: // occurrenceCode + this.getOccurrenceCode().add(castToCoding(value)); // Coding + break; + case -556690898: // occurenceSpanCode + this.getOccurenceSpanCode().add(castToCoding(value)); // Coding + break; + case -766209282: // valueCode + this.getValueCode().add(castToCoding(value)); // Coding + break; + case 1196993265: // diagnosis + this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent + break; + case -1095204141: // procedure + this.getProcedure().add((ProcedureComponent) value); // ProcedureComponent + break; + case -481489822: // specialCondition + this.getSpecialCondition().add(castToCoding(value)); // Coding + break; + case -791418107: // patient + this.patient = (Type) value; // Type + break; + case -351767064: // coverage + this.getCoverage().add((CoverageComponent) value); // CoverageComponent + break; + case -63170979: // accidentDate + this.accidentDate = castToDate(value); // DateType + break; + case -62671383: // accidentType + this.accidentType = castToCoding(value); // Coding + break; + case -1074014492: // accidentLocation + this.accidentLocation = (Type) value; // Type + break; + case 1753076536: // interventionException + this.getInterventionException().add(castToCoding(value)); // Coding + break; + case 105901603: // onset + this.getOnset().add((OnsetComponent) value); // OnsetComponent + break; + case 1051487345: // employmentImpacted + this.employmentImpacted = castToPeriod(value); // Period + break; + case 1057894634: // hospitalization + this.hospitalization = castToPeriod(value); // Period + break; + case 3242771: // item + this.getItem().add((ItemsComponent) value); // ItemsComponent + break; + case 110549828: // total + this.total = castToMoney(value); // Money + break; + case -1534875026: // additionalMaterial + this.getAdditionalMaterial().add(castToCoding(value)); // Coding + break; + case -1157130302: // missingTeeth + this.getMissingTeeth().add((MissingTeethComponent) value); // MissingTeethComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new ClaimTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("subType")) + this.getSubType().add(castToCoding(value)); + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("billablePeriod")) + this.billablePeriod = castToPeriod(value); // Period + else if (name.equals("target[x]")) + this.target = (Type) value; // Type + else if (name.equals("provider[x]")) + this.provider = (Type) value; // Type + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("use")) + this.use = new UseEnumFactory().fromType(value); // Enumeration + else if (name.equals("priority")) + this.priority = castToCoding(value); // Coding + else if (name.equals("fundsReserve")) + this.fundsReserve = castToCoding(value); // Coding + else if (name.equals("enterer[x]")) + this.enterer = (Type) value; // Type + else if (name.equals("facility[x]")) + this.facility = (Type) value; // Type + else if (name.equals("related")) + this.getRelated().add((RelatedClaimsComponent) value); + else if (name.equals("prescription[x]")) + this.prescription = (Type) value; // Type + else if (name.equals("originalPrescription[x]")) + this.originalPrescription = (Type) value; // Type + else if (name.equals("payee")) + this.payee = (PayeeComponent) value; // PayeeComponent + else if (name.equals("referral[x]")) + this.referral = (Type) value; // Type + else if (name.equals("occurrenceCode")) + this.getOccurrenceCode().add(castToCoding(value)); + else if (name.equals("occurenceSpanCode")) + this.getOccurenceSpanCode().add(castToCoding(value)); + else if (name.equals("valueCode")) + this.getValueCode().add(castToCoding(value)); + else if (name.equals("diagnosis")) + this.getDiagnosis().add((DiagnosisComponent) value); + else if (name.equals("procedure")) + this.getProcedure().add((ProcedureComponent) value); + else if (name.equals("specialCondition")) + this.getSpecialCondition().add(castToCoding(value)); + else if (name.equals("patient[x]")) + this.patient = (Type) value; // Type + else if (name.equals("coverage")) + this.getCoverage().add((CoverageComponent) value); + else if (name.equals("accidentDate")) + this.accidentDate = castToDate(value); // DateType + else if (name.equals("accidentType")) + this.accidentType = castToCoding(value); // Coding + else if (name.equals("accidentLocation[x]")) + this.accidentLocation = (Type) value; // Type + else if (name.equals("interventionException")) + this.getInterventionException().add(castToCoding(value)); + else if (name.equals("onset")) + this.getOnset().add((OnsetComponent) value); + else if (name.equals("employmentImpacted")) + this.employmentImpacted = castToPeriod(value); // Period + else if (name.equals("hospitalization")) + this.hospitalization = castToPeriod(value); // Period + else if (name.equals("item")) + this.getItem().add((ItemsComponent) value); + else if (name.equals("total")) + this.total = castToMoney(value); // Money + else if (name.equals("additionalMaterial")) + this.getAdditionalMaterial().add(castToCoding(value)); + else if (name.equals("missingTeeth")) + this.getMissingTeeth().add((MissingTeethComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -1868521062: return addSubType(); // Coding + case -1618432855: return addIdentifier(); // Identifier + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -332066046: return getBillablePeriod(); // Period + case -815579825: return getTarget(); // Type + case 2064698607: return getProvider(); // Type + case 1326483053: return getOrganization(); // Type + case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration + case -1165461084: return getPriority(); // Coding + case 1314609806: return getFundsReserve(); // Coding + case -812909349: return getEnterer(); // Type + case -542224643: return getFacility(); // Type + case 1090493483: return addRelated(); // RelatedClaimsComponent + case -993324506: return getPrescription(); // Type + case -2067905515: return getOriginalPrescription(); // Type + case 106443592: return getPayee(); // PayeeComponent + case 344221635: return getReferral(); // Type + case 1721744222: return addOccurrenceCode(); // Coding + case -556690898: return addOccurenceSpanCode(); // Coding + case -766209282: return addValueCode(); // Coding + case 1196993265: return addDiagnosis(); // DiagnosisComponent + case -1095204141: return addProcedure(); // ProcedureComponent + case -481489822: return addSpecialCondition(); // Coding + case -2061246629: return getPatient(); // Type + case -351767064: return addCoverage(); // CoverageComponent + case -63170979: throw new FHIRException("Cannot make property accidentDate as it is not a complex type"); // DateType + case -62671383: return getAccidentType(); // Coding + case 1540715292: return getAccidentLocation(); // Type + case 1753076536: return addInterventionException(); // Coding + case 105901603: return addOnset(); // OnsetComponent + case 1051487345: return getEmploymentImpacted(); // Period + case 1057894634: return getHospitalization(); // Period + case 3242771: return addItem(); // ItemsComponent + case 110549828: return getTotal(); // Money + case -1534875026: return addAdditionalMaterial(); // Coding + case -1157130302: return addMissingTeeth(); // MissingTeethComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.type"); + } + else if (name.equals("subType")) { + return addSubType(); + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.created"); + } + else if (name.equals("billablePeriod")) { + this.billablePeriod = new Period(); + return this.billablePeriod; + } + else if (name.equals("targetIdentifier")) { + this.target = new Identifier(); + return this.target; + } + else if (name.equals("targetReference")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("providerIdentifier")) { + this.provider = new Identifier(); + return this.provider; + } + else if (name.equals("providerReference")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.use"); + } + else if (name.equals("priority")) { + this.priority = new Coding(); + return this.priority; + } + else if (name.equals("fundsReserve")) { + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + else if (name.equals("entererIdentifier")) { + this.enterer = new Identifier(); + return this.enterer; + } + else if (name.equals("entererReference")) { + this.enterer = new Reference(); + return this.enterer; + } + else if (name.equals("facilityIdentifier")) { + this.facility = new Identifier(); + return this.facility; + } + else if (name.equals("facilityReference")) { + this.facility = new Reference(); + return this.facility; + } + else if (name.equals("related")) { + return addRelated(); + } + else if (name.equals("prescriptionIdentifier")) { + this.prescription = new Identifier(); + return this.prescription; + } + else if (name.equals("prescriptionReference")) { + this.prescription = new Reference(); + return this.prescription; + } + else if (name.equals("originalPrescriptionIdentifier")) { + this.originalPrescription = new Identifier(); + return this.originalPrescription; + } + else if (name.equals("originalPrescriptionReference")) { + this.originalPrescription = new Reference(); + return this.originalPrescription; + } + else if (name.equals("payee")) { + this.payee = new PayeeComponent(); + return this.payee; + } + else if (name.equals("referralIdentifier")) { + this.referral = new Identifier(); + return this.referral; + } + else if (name.equals("referralReference")) { + this.referral = new Reference(); + return this.referral; + } + else if (name.equals("occurrenceCode")) { + return addOccurrenceCode(); + } + else if (name.equals("occurenceSpanCode")) { + return addOccurenceSpanCode(); + } + else if (name.equals("valueCode")) { + return addValueCode(); + } + else if (name.equals("diagnosis")) { + return addDiagnosis(); + } + else if (name.equals("procedure")) { + return addProcedure(); + } + else if (name.equals("specialCondition")) { + return addSpecialCondition(); + } + else if (name.equals("patientIdentifier")) { + this.patient = new Identifier(); + return this.patient; + } + else if (name.equals("patientReference")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("coverage")) { + return addCoverage(); + } + else if (name.equals("accidentDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.accidentDate"); + } + else if (name.equals("accidentType")) { + this.accidentType = new Coding(); + return this.accidentType; + } + else if (name.equals("accidentLocationAddress")) { + this.accidentLocation = new Address(); + return this.accidentLocation; + } + else if (name.equals("accidentLocationReference")) { + this.accidentLocation = new Reference(); + return this.accidentLocation; + } + else if (name.equals("interventionException")) { + return addInterventionException(); + } + else if (name.equals("onset")) { + return addOnset(); + } + else if (name.equals("employmentImpacted")) { + this.employmentImpacted = new Period(); + return this.employmentImpacted; + } + else if (name.equals("hospitalization")) { + this.hospitalization = new Period(); + return this.hospitalization; + } + else if (name.equals("item")) { + return addItem(); + } + else if (name.equals("total")) { + this.total = new Money(); + return this.total; + } + else if (name.equals("additionalMaterial")) { + return addAdditionalMaterial(); + } + else if (name.equals("missingTeeth")) { + return addMissingTeeth(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Claim"; + + } + + public Claim copy() { + Claim dst = new Claim(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (subType != null) { + dst.subType = new ArrayList(); + for (Coding i : subType) + dst.subType.add(i.copy()); + }; + 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.billablePeriod = billablePeriod == null ? null : billablePeriod.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(); + if (related != null) { + dst.related = new ArrayList(); + for (RelatedClaimsComponent i : related) + dst.related.add(i.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 (occurrenceCode != null) { + dst.occurrenceCode = new ArrayList(); + for (Coding i : occurrenceCode) + dst.occurrenceCode.add(i.copy()); + }; + if (occurenceSpanCode != null) { + dst.occurenceSpanCode = new ArrayList(); + for (Coding i : occurenceSpanCode) + dst.occurenceSpanCode.add(i.copy()); + }; + if (valueCode != null) { + dst.valueCode = new ArrayList(); + for (Coding i : valueCode) + dst.valueCode.add(i.copy()); + }; + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (procedure != null) { + dst.procedure = new ArrayList(); + for (ProcedureComponent i : procedure) + dst.procedure.add(i.copy()); + }; + if (specialCondition != null) { + dst.specialCondition = new ArrayList(); + for (Coding i : specialCondition) + dst.specialCondition.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()); + }; + dst.accidentDate = accidentDate == null ? null : accidentDate.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + dst.accidentLocation = accidentLocation == null ? null : accidentLocation.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (onset != null) { + dst.onset = new ArrayList(); + for (OnsetComponent i : onset) + dst.onset.add(i.copy()); + }; + dst.employmentImpacted = employmentImpacted == null ? null : employmentImpacted.copy(); + dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + dst.total = total == null ? null : total.copy(); + if (additionalMaterial != null) { + dst.additionalMaterial = new ArrayList(); + for (Coding i : additionalMaterial) + dst.additionalMaterial.add(i.copy()); + }; + if (missingTeeth != null) { + dst.missingTeeth = new ArrayList(); + for (MissingTeethComponent i : missingTeeth) + dst.missingTeeth.add(i.copy()); + }; + return dst; + } + + protected Claim typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Claim)) + return false; + Claim o = (Claim) other; + return compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(billablePeriod, o.billablePeriod, true) + && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) + && compareDeep(use, o.use, true) && compareDeep(priority, o.priority, true) && compareDeep(fundsReserve, o.fundsReserve, true) + && compareDeep(enterer, o.enterer, true) && compareDeep(facility, o.facility, true) && compareDeep(related, o.related, true) + && compareDeep(prescription, o.prescription, true) && compareDeep(originalPrescription, o.originalPrescription, true) + && compareDeep(payee, o.payee, true) && compareDeep(referral, o.referral, true) && compareDeep(occurrenceCode, o.occurrenceCode, true) + && compareDeep(occurenceSpanCode, o.occurenceSpanCode, true) && compareDeep(valueCode, o.valueCode, true) + && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(specialCondition, o.specialCondition, true) + && compareDeep(patient, o.patient, true) && compareDeep(coverage, o.coverage, true) && compareDeep(accidentDate, o.accidentDate, true) + && compareDeep(accidentType, o.accidentType, true) && compareDeep(accidentLocation, o.accidentLocation, true) + && compareDeep(interventionException, o.interventionException, true) && compareDeep(onset, o.onset, true) + && compareDeep(employmentImpacted, o.employmentImpacted, true) && compareDeep(hospitalization, o.hospitalization, true) + && compareDeep(item, o.item, true) && compareDeep(total, o.total, true) && compareDeep(additionalMaterial, o.additionalMaterial, true) + && compareDeep(missingTeeth, o.missingTeeth, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Claim)) + return false; + Claim o = (Claim) other; + return compareValues(type, o.type, true) && compareValues(created, o.created, true) && compareValues(use, o.use, true) + && compareValues(accidentDate, o.accidentDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (billablePeriod == null || billablePeriod.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()) && (related == null || related.isEmpty()) + && (prescription == null || prescription.isEmpty()) && (originalPrescription == null || originalPrescription.isEmpty()) + && (payee == null || payee.isEmpty()) && (referral == null || referral.isEmpty()) && (occurrenceCode == null || occurrenceCode.isEmpty()) + && (occurenceSpanCode == null || occurenceSpanCode.isEmpty()) && (valueCode == null || valueCode.isEmpty()) + && (diagnosis == null || diagnosis.isEmpty()) && (procedure == null || procedure.isEmpty()) + && (specialCondition == null || specialCondition.isEmpty()) && (patient == null || patient.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (accidentDate == null || accidentDate.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (accidentLocation == null || accidentLocation.isEmpty()) + && (interventionException == null || interventionException.isEmpty()) && (onset == null || onset.isEmpty()) + && (employmentImpacted == null || employmentImpacted.isEmpty()) && (hospitalization == null || hospitalization.isEmpty()) + && (item == null || item.isEmpty()) && (total == null || total.isEmpty()) && (additionalMaterial == null || additionalMaterial.isEmpty()) + && (missingTeeth == null || missingTeeth.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Claim; + } + + /** + * Search parameter: patientidentifier + *

+ * Description: Patient receiving the services
+ * Type: token
+ * Path: Claim.patientIdentifier
+ *

+ */ + @SearchParamDefinition(name="patientidentifier", path="Claim.patient.as(Identifier)", description="Patient receiving the services", type="token" ) + public static final String SP_PATIENTIDENTIFIER = "patientidentifier"; + /** + * Fluent Client search parameter constant for patientidentifier + *

+ * Description: Patient receiving the services
+ * Type: token
+ * Path: Claim.patientIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATIENTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATIENTIDENTIFIER); + + /** + * Search parameter: targetreference + *

+ * Description: The target payor/insurer for the Claim
+ * Type: reference
+ * Path: Claim.targetReference
+ *

+ */ + @SearchParamDefinition(name="targetreference", path="Claim.target.as(Reference)", description="The target payor/insurer for the Claim", type="reference" ) + public static final String SP_TARGETREFERENCE = "targetreference"; + /** + * Fluent Client search parameter constant for targetreference + *

+ * Description: The target payor/insurer for the Claim
+ * Type: reference
+ * Path: Claim.targetReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGETREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGETREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Claim:targetreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGETREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:targetreference").toLocked(); + + /** + * Search parameter: facilityidentifier + *

+ * Description: Facility responsible for the goods and services
+ * Type: token
+ * Path: Claim.facilityIdentifier
+ *

+ */ + @SearchParamDefinition(name="facilityidentifier", path="Claim.facility.as(Identifier)", description="Facility responsible for the goods and services", type="token" ) + public static final String SP_FACILITYIDENTIFIER = "facilityidentifier"; + /** + * Fluent Client search parameter constant for facilityidentifier + *

+ * Description: Facility responsible for the goods and services
+ * Type: token
+ * Path: Claim.facilityIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITYIDENTIFIER); + + /** + * Search parameter: facilityreference + *

+ * Description: Facility responsible for the goods and services
+ * Type: reference
+ * Path: Claim.facilityReference
+ *

+ */ + @SearchParamDefinition(name="facilityreference", path="Claim.facility.as(Reference)", description="Facility responsible for the goods and services", type="reference" ) + public static final String SP_FACILITYREFERENCE = "facilityreference"; + /** + * Fluent Client search parameter constant for facilityreference + *

+ * Description: Facility responsible for the goods and services
+ * Type: reference
+ * Path: Claim.facilityReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITYREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Claim:facilityreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITYREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:facilityreference").toLocked(); + + /** + * Search parameter: use + *

+ * Description: The kind of financial resource
+ * Type: token
+ * Path: Claim.use
+ *

+ */ + @SearchParamDefinition(name="use", path="Claim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + /** + * Fluent Client search parameter constant for use + *

+ * Description: The kind of financial resource
+ * Type: token
+ * Path: Claim.use
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USE); + + /** + * Search parameter: providerreference + *

+ * Description: Provider responsible for the Claim
+ * Type: reference
+ * Path: Claim.providerReference
+ *

+ */ + @SearchParamDefinition(name="providerreference", path="Claim.provider.as(Reference)", description="Provider responsible for the Claim", type="reference" ) + public static final String SP_PROVIDERREFERENCE = "providerreference"; + /** + * Fluent Client search parameter constant for providerreference + *

+ * Description: Provider responsible for the Claim
+ * Type: reference
+ * Path: Claim.providerReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Claim:providerreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:providerreference").toLocked(); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The reference to the providing organization
+ * Type: token
+ * Path: Claim.organizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="Claim.organization.as(Identifier)", description="The reference to the providing organization", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The reference to the providing organization
+ * Type: token
+ * Path: Claim.organizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: patientreference + *

+ * Description: Patient receiving the services
+ * Type: reference
+ * Path: Claim.patientReference
+ *

+ */ + @SearchParamDefinition(name="patientreference", path="Claim.patient.as(Reference)", description="Patient receiving the services", type="reference" ) + public static final String SP_PATIENTREFERENCE = "patientreference"; + /** + * Fluent Client search parameter constant for patientreference + *

+ * Description: Patient receiving the services
+ * Type: reference
+ * Path: Claim.patientReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENTREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Claim:patientreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENTREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:patientreference").toLocked(); + + /** + * Search parameter: created + *

+ * Description: The creation date for the Claim
+ * Type: date
+ * Path: Claim.created
+ *

+ */ + @SearchParamDefinition(name="created", path="Claim.created", description="The creation date for the Claim", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: The creation date for the Claim
+ * Type: date
+ * Path: Claim.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: priority + *

+ * Description: Processing priority requested
+ * Type: token
+ * Path: Claim.priority
+ *

+ */ + @SearchParamDefinition(name="priority", path="Claim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + /** + * Fluent Client search parameter constant for priority + *

+ * Description: Processing priority requested
+ * Type: token
+ * Path: Claim.priority
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); + + /** + * Search parameter: targetidentifier + *

+ * Description: The target payor/insurer for the Claim
+ * Type: token
+ * Path: Claim.targetIdentifier
+ *

+ */ + @SearchParamDefinition(name="targetidentifier", path="Claim.target.as(Identifier)", description="The target payor/insurer for the Claim", type="token" ) + public static final String SP_TARGETIDENTIFIER = "targetidentifier"; + /** + * Fluent Client search parameter constant for targetidentifier + *

+ * Description: The target payor/insurer for the Claim
+ * Type: token
+ * Path: Claim.targetIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGETIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGETIDENTIFIER); + + /** + * Search parameter: organizationreference + *

+ * Description: The reference to the providing organization
+ * Type: reference
+ * Path: Claim.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="Claim.organization.as(Reference)", description="The reference to the providing organization", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The reference to the providing organization
+ * Type: reference
+ * Path: Claim.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Claim:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:organizationreference").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The primary identifier of the financial resource
+ * Type: token
+ * Path: Claim.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Claim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The primary identifier of the financial resource
+ * Type: token
+ * Path: Claim.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: provideridentifier + *

+ * Description: Provider responsible for the Claim
+ * Type: token
+ * Path: Claim.providerIdentifier
+ *

+ */ + @SearchParamDefinition(name="provideridentifier", path="Claim.provider.as(Identifier)", description="Provider responsible for the Claim", type="token" ) + public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; + /** + * Fluent Client search parameter constant for provideridentifier + *

+ * Description: Provider responsible for the Claim
+ * Type: token
+ * Path: Claim.providerIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ClaimResponse.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ClaimResponse.java new file mode 100644 index 00000000000..7b78a4ef1b8 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ClaimResponse.java @@ -0,0 +1,6116 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome; +import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides the adjudication details from the processing of a Claim resource. + */ +@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse") +public class ClaimResponse extends DomainResource { + + @Block() + public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequenceLinkId; + + /** + * A list of note references to the notes provided below. + */ + @Child(name = "noteNumber", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) + protected List noteNumber; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The second tier service adjudications for submitted services. + */ + @Child(name = "detail", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Detail line items", formalDefinition="The second tier service adjudications for submitted services." ) + protected List detail; + + private static final long serialVersionUID = -1917866697L; + + /** + * Constructor + */ + public ItemsComponent() { + super(); + } + + /** + * Constructor + */ + public ItemsComponent(PositiveIntType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new PositiveIntType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemsComponent setSequenceLinkIdElement(PositiveIntType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new PositiveIntType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public List getNoteNumber() { + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + return this.noteNumber; + } + + public boolean hasNoteNumber() { + if (this.noteNumber == null) + return false; + for (PositiveIntType item : this.noteNumber) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #noteNumber} (A list of note references to the notes provided below.) + */ + // syntactic sugar + public PositiveIntType addNoteNumberElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + this.noteNumber.add(t); + return t; + } + + /** + * @param value {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public ItemsComponent addNoteNumber(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + this.noteNumber.add(t); + return this; + } + + /** + * @param value {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public boolean hasNoteNumber(int value) { + if (this.noteNumber == null) + return false; + for (PositiveIntType v : this.noteNumber) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (ItemAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public ItemAdjudicationComponent addAdjudication() { //3 + ItemAdjudicationComponent t = new ItemAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addAdjudication(ItemAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + /** + * @return {@link #detail} (The second tier service adjudications for submitted 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 (ItemDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (The second tier service adjudications for submitted services.) + */ + // syntactic sugar + public ItemDetailComponent addDetail() { //3 + ItemDetailComponent t = new ItemDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addDetail(ItemDetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("detail", "", "The second tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType + case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // ItemAdjudicationComponent + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // ItemDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422298666: // sequenceLinkId + this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType + break; + case -1110033957: // noteNumber + this.getNoteNumber().add(castToPositiveInt(value)); // PositiveIntType + break; + case -231349275: // adjudication + this.getAdjudication().add((ItemAdjudicationComponent) value); // ItemAdjudicationComponent + break; + case -1335224239: // detail + this.getDetail().add((ItemDetailComponent) value); // ItemDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequenceLinkId")) + this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType + else if (name.equals("noteNumber")) + this.getNoteNumber().add(castToPositiveInt(value)); + else if (name.equals("adjudication")) + this.getAdjudication().add((ItemAdjudicationComponent) value); + else if (name.equals("detail")) + this.getDetail().add((ItemDetailComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType + case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType + case -231349275: return addAdjudication(); // ItemAdjudicationComponent + case -1335224239: return addDetail(); // ItemDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); + } + else if (name.equals("noteNumber")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.noteNumber"); + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else if (name.equals("detail")) { + return addDetail(); + } + else + return super.addChild(name); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (noteNumber != null) { + dst.noteNumber = new ArrayList(); + for (PositiveIntType i : noteNumber) + dst.noteNumber.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (ItemAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (ItemDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(noteNumber, o.noteNumber, true) + && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumber, o.noteNumber, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (noteNumber == null || noteNumber.isEmpty()) + && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + public String fhirType() { + return "ClaimResponse.item"; + + } + + } + + @Block() + public static class ItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monetary amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public ItemAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public ItemAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public ItemAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public ItemAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monetary amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monetary amount associated with the code.) + */ + public ItemAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ItemAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public ItemAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public ItemAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public ItemAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); + } + else + return super.addChild(name); + } + + public ItemAdjudicationComponent copy() { + ItemAdjudicationComponent dst = new ItemAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemAdjudicationComponent)) + return false; + ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemAdjudicationComponent)) + return false; + ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ClaimResponse.item.adjudication"; + + } + + } + + @Block() + public static class ItemDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequenceLinkId; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The third tier service adjudications for submitted services. + */ + @Child(name = "subDetail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Subdetail line items", formalDefinition="The third tier service adjudications for submitted services." ) + protected List subDetail; + + private static final long serialVersionUID = -1751018357L; + + /** + * Constructor + */ + public ItemDetailComponent() { + super(); + } + + /** + * Constructor + */ + public ItemDetailComponent(PositiveIntType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemDetailComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new PositiveIntType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemDetailComponent setSequenceLinkIdElement(PositiveIntType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemDetailComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new PositiveIntType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (DetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public DetailAdjudicationComponent addAdjudication() { //3 + DetailAdjudicationComponent t = new DetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public ItemDetailComponent addAdjudication(DetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + /** + * @return {@link #subDetail} (The third tier service adjudications for submitted 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} (The third tier service adjudications for submitted 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; + } + + // syntactic sugar + public ItemDetailComponent addSubDetail(SubDetailComponent t) { //3 + if (t == null) + return this; + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("subDetail", "", "The third tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // DetailAdjudicationComponent + case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422298666: // sequenceLinkId + this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType + break; + case -231349275: // adjudication + this.getAdjudication().add((DetailAdjudicationComponent) value); // DetailAdjudicationComponent + break; + case -828829007: // subDetail + this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequenceLinkId")) + this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType + else if (name.equals("adjudication")) + this.getAdjudication().add((DetailAdjudicationComponent) value); + else if (name.equals("subDetail")) + this.getSubDetail().add((SubDetailComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType + case -231349275: return addAdjudication(); // DetailAdjudicationComponent + case -828829007: return addSubDetail(); // SubDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else if (name.equals("subDetail")) { + return addSubDetail(); + } + else + return super.addChild(name); + } + + public ItemDetailComponent copy() { + ItemDetailComponent dst = new ItemDetailComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (DetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemDetailComponent)) + return false; + ItemDetailComponent o = (ItemDetailComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true) + && compareDeep(subDetail, o.subDetail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemDetailComponent)) + return false; + ItemDetailComponent o = (ItemDetailComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) + && (subDetail == null || subDetail.isEmpty()); + } + + public String fhirType() { + return "ClaimResponse.item.detail"; + + } + + } + + @Block() + public static class DetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monetary amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public DetailAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public DetailAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public DetailAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public DetailAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monetary amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monetary amount associated with the code.) + */ + public DetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public DetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public DetailAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public DetailAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); + } + else + return super.addChild(name); + } + + public DetailAdjudicationComponent copy() { + DetailAdjudicationComponent dst = new DetailAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetailAdjudicationComponent)) + return false; + DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetailAdjudicationComponent)) + return false; + DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ClaimResponse.item.detail.adjudication"; + + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequenceLinkId; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Subdetail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + private static final long serialVersionUID = 1780202110L; + + /** + * Constructor + */ + public SubDetailComponent() { + super(); + } + + /** + * Constructor + */ + public SubDetailComponent(PositiveIntType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new PositiveIntType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public SubDetailComponent setSequenceLinkIdElement(PositiveIntType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new PositiveIntType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (SubdetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public SubdetailAdjudicationComponent addAdjudication() { //3 + SubdetailAdjudicationComponent t = new SubdetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public SubDetailComponent addAdjudication(SubdetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // SubdetailAdjudicationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422298666: // sequenceLinkId + this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType + break; + case -231349275: // adjudication + this.getAdjudication().add((SubdetailAdjudicationComponent) value); // SubdetailAdjudicationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequenceLinkId")) + this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType + else if (name.equals("adjudication")) + this.getAdjudication().add((SubdetailAdjudicationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType + case -231349275: return addAdjudication(); // SubdetailAdjudicationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else + return super.addChild(name); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (SubdetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) + ; + } + + public String fhirType() { + return "ClaimResponse.item.detail.subDetail"; + + } + + } + + @Block() + public static class SubdetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monetary amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public SubdetailAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public SubdetailAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public SubdetailAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public SubdetailAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monetary amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monetary amount associated with the code.) + */ + public SubdetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SubdetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public SubdetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public SubdetailAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public SubdetailAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); + } + else + return super.addChild(name); + } + + public SubdetailAdjudicationComponent copy() { + SubdetailAdjudicationComponent dst = new SubdetailAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubdetailAdjudicationComponent)) + return false; + SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubdetailAdjudicationComponent)) + return false; + SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ClaimResponse.item.detail.subDetail.adjudication"; + + } + + } + + @Block() + public static class AddedItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * List of input service items which this service line is intended to replace. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." ) + protected List sequenceLinkId; + + /** + * A code to indicate the Professional Service or Product supplied. + */ + @Child(name = "service", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The fee charged for the professional service or product.. + */ + @Child(name = "fee", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) + protected Money fee; + + /** + * A list of note references to the notes provided below. + */ + @Child(name = "noteNumberLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) + protected List noteNumberLinkId; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The second tier service adjudications for payor added services. + */ + @Child(name = "detail", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) + protected List detail; + + private static final long serialVersionUID = -1675935854L; + + /** + * Constructor + */ + public AddedItemComponent() { + super(); + } + + /** + * Constructor + */ + public AddedItemComponent(Coding service) { + super(); + this.service = service; + } + + /** + * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public List getSequenceLinkId() { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkId() { + if (this.sequenceLinkId == null) + return false; + for (PositiveIntType item : this.sequenceLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + // syntactic sugar + public PositiveIntType addSequenceLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + this.sequenceLinkId.add(t); + return t; + } + + /** + * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public AddedItemComponent addSequenceLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + this.sequenceLinkId.add(t); + return this; + } + + /** + * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public boolean hasSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + return false; + for (PositiveIntType v : this.sequenceLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #service} (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 AddedItemComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public AddedItemComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #fee} (The fee charged for the professional service or product..) + */ + public Money getFee() { + if (this.fee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemComponent.fee"); + else if (Configuration.doAutoCreate()) + this.fee = new Money(); // cc + return this.fee; + } + + public boolean hasFee() { + return this.fee != null && !this.fee.isEmpty(); + } + + /** + * @param value {@link #fee} (The fee charged for the professional service or product..) + */ + public AddedItemComponent setFee(Money value) { + this.fee = value; + return this; + } + + /** + * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public List getNoteNumberLinkId() { + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + return this.noteNumberLinkId; + } + + public boolean hasNoteNumberLinkId() { + if (this.noteNumberLinkId == null) + return false; + for (PositiveIntType item : this.noteNumberLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + // syntactic sugar + public PositiveIntType addNoteNumberLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + this.noteNumberLinkId.add(t); + return t; + } + + /** + * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public AddedItemComponent addNoteNumberLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + this.noteNumberLinkId.add(t); + return this; + } + + /** + * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public boolean hasNoteNumberLinkId(int value) { + if (this.noteNumberLinkId == null) + return false; + for (PositiveIntType v : this.noteNumberLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (AddedItemAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public AddedItemAdjudicationComponent addAdjudication() { //3 + AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public AddedItemComponent addAdjudication(AddedItemAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + /** + * @return {@link #detail} (The second tier service adjudications for payor added 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 (AddedItemsDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (The second tier service adjudications for payor added services.) + */ + // syntactic sugar + public AddedItemsDetailComponent addDetail() { //3 + AddedItemsDetailComponent t = new AddedItemsDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public AddedItemComponent addDetail(AddedItemsDetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); + childrenList.add(new Property("noteNumberLinkId", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : this.sequenceLinkId.toArray(new Base[this.sequenceLinkId.size()]); // PositiveIntType + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money + case -1859667856: /*noteNumberLinkId*/ return this.noteNumberLinkId == null ? new Base[0] : this.noteNumberLinkId.toArray(new Base[this.noteNumberLinkId.size()]); // PositiveIntType + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemAdjudicationComponent + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AddedItemsDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422298666: // sequenceLinkId + this.getSequenceLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 101254: // fee + this.fee = castToMoney(value); // Money + break; + case -1859667856: // noteNumberLinkId + this.getNoteNumberLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; + case -231349275: // adjudication + this.getAdjudication().add((AddedItemAdjudicationComponent) value); // AddedItemAdjudicationComponent + break; + case -1335224239: // detail + this.getDetail().add((AddedItemsDetailComponent) value); // AddedItemsDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequenceLinkId")) + this.getSequenceLinkId().add(castToPositiveInt(value)); + else if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("fee")) + this.fee = castToMoney(value); // Money + else if (name.equals("noteNumberLinkId")) + this.getNoteNumberLinkId().add(castToPositiveInt(value)); + else if (name.equals("adjudication")) + this.getAdjudication().add((AddedItemAdjudicationComponent) value); + else if (name.equals("detail")) + this.getDetail().add((AddedItemsDetailComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType + case 1984153269: return getService(); // Coding + case 101254: return getFee(); // Money + case -1859667856: throw new FHIRException("Cannot make property noteNumberLinkId as it is not a complex type"); // PositiveIntType + case -231349275: return addAdjudication(); // AddedItemAdjudicationComponent + case -1335224239: return addDetail(); // AddedItemsDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); + } + else if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("fee")) { + this.fee = new Money(); + return this.fee; + } + else if (name.equals("noteNumberLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.noteNumberLinkId"); + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else if (name.equals("detail")) { + return addDetail(); + } + else + return super.addChild(name); + } + + public AddedItemComponent copy() { + AddedItemComponent dst = new AddedItemComponent(); + copyValues(dst); + if (sequenceLinkId != null) { + dst.sequenceLinkId = new ArrayList(); + for (PositiveIntType i : sequenceLinkId) + dst.sequenceLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.fee = fee == null ? null : fee.copy(); + if (noteNumberLinkId != null) { + dst.noteNumberLinkId = new ArrayList(); + for (PositiveIntType i : noteNumberLinkId) + dst.noteNumberLinkId.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (AddedItemAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (AddedItemsDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemComponent)) + return false; + AddedItemComponent o = (AddedItemComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(service, o.service, true) + && compareDeep(fee, o.fee, true) && compareDeep(noteNumberLinkId, o.noteNumberLinkId, true) && compareDeep(adjudication, o.adjudication, true) + && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemComponent)) + return false; + AddedItemComponent o = (AddedItemComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumberLinkId, o.noteNumberLinkId, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty()) + && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty()) + && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + public String fhirType() { + return "ClaimResponse.addItem"; + + } + + } + + @Block() + public static class AddedItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monetary amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public AddedItemAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public AddedItemAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public AddedItemAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public AddedItemAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monetary amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monetary amount associated with the code.) + */ + public AddedItemAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AddedItemAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); + } + else + return super.addChild(name); + } + + public AddedItemAdjudicationComponent copy() { + AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemAdjudicationComponent)) + return false; + AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemAdjudicationComponent)) + return false; + AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ClaimResponse.addItem.adjudication"; + + } + + } + + @Block() + public static class AddedItemsDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code to indicate the Professional Service or Product supplied. + */ + @Child(name = "service", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The fee charged for the professional service or product.. + */ + @Child(name = "fee", type = {Money.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) + protected Money fee; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + private static final long serialVersionUID = -2104242020L; + + /** + * Constructor + */ + public AddedItemsDetailComponent() { + super(); + } + + /** + * Constructor + */ + public AddedItemsDetailComponent(Coding service) { + super(); + this.service = service; + } + + /** + * @return {@link #service} (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 AddedItemsDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public AddedItemsDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #fee} (The fee charged for the professional service or product..) + */ + public Money getFee() { + if (this.fee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee"); + else if (Configuration.doAutoCreate()) + this.fee = new Money(); // cc + return this.fee; + } + + public boolean hasFee() { + return this.fee != null && !this.fee.isEmpty(); + } + + /** + * @param value {@link #fee} (The fee charged for the professional service or product..) + */ + public AddedItemsDetailComponent setFee(Money value) { + this.fee = value; + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (AddedItemDetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public AddedItemDetailAdjudicationComponent addAdjudication() { //3 + AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public AddedItemsDetailComponent addAdjudication(AddedItemDetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemDetailAdjudicationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 101254: // fee + this.fee = castToMoney(value); // Money + break; + case -231349275: // adjudication + this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); // AddedItemDetailAdjudicationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("fee")) + this.fee = castToMoney(value); // Money + else if (name.equals("adjudication")) + this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1984153269: return getService(); // Coding + case 101254: return getFee(); // Money + case -231349275: return addAdjudication(); // AddedItemDetailAdjudicationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("fee")) { + this.fee = new Money(); + return this.fee; + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else + return super.addChild(name); + } + + public AddedItemsDetailComponent copy() { + AddedItemsDetailComponent dst = new AddedItemsDetailComponent(); + copyValues(dst); + dst.service = service == null ? null : service.copy(); + dst.fee = fee == null ? null : fee.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (AddedItemDetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemsDetailComponent)) + return false; + AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; + return compareDeep(service, o.service, true) && compareDeep(fee, o.fee, true) && compareDeep(adjudication, o.adjudication, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemsDetailComponent)) + return false; + AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty()) + && (adjudication == null || adjudication.isEmpty()); + } + + public String fhirType() { + return "ClaimResponse.addItem.detail"; + + } + + } + + @Block() + public static class AddedItemDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monetary amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public AddedItemDetailAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public AddedItemDetailAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) + */ + public AddedItemDetailAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public AddedItemDetailAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monetary amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monetary amount associated with the code.) + */ + public AddedItemDetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemDetailAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemDetailAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); + } + else + return super.addChild(name); + } + + public AddedItemDetailAdjudicationComponent copy() { + AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemDetailAdjudicationComponent)) + return false; + AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemDetailAdjudicationComponent)) + return false; + AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ClaimResponse.addItem.detail.adjudication"; + + } + + } + + @Block() + public static class ErrorsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Item sequence number", formalDefinition="The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere." ) + protected PositiveIntType sequenceLinkId; + + /** + * The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. + */ + @Child(name = "detailSequenceLinkId", type = {PositiveIntType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition." ) + protected PositiveIntType detailSequenceLinkId; + + /** + * The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. + */ + @Child(name = "subdetailSequenceLinkId", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition." ) + protected PositiveIntType subdetailSequenceLinkId; + + /** + * An error code,from a specified code system, which details why the claim could not be adjudicated. + */ + @Child(name = "code", type = {Coding.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,from a specified code system, which details why the claim could not be adjudicated." ) + protected Coding code; + + private static final long serialVersionUID = -1893641175L; + + /** + * Constructor + */ + public ErrorsComponent() { + super(); + } + + /** + * Constructor + */ + public ErrorsComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new PositiveIntType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setSequenceLinkIdElement(PositiveIntType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere. + */ + public ErrorsComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new PositiveIntType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getDetailSequenceLinkIdElement() { + if (this.detailSequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.detailSequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.detailSequenceLinkId = new PositiveIntType(); // bb + return this.detailSequenceLinkId; + } + + public boolean hasDetailSequenceLinkIdElement() { + return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); + } + + public boolean hasDetailSequenceLinkId() { + return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setDetailSequenceLinkIdElement(PositiveIntType value) { + this.detailSequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. + */ + public int getDetailSequenceLinkId() { + return this.detailSequenceLinkId == null || this.detailSequenceLinkId.isEmpty() ? 0 : this.detailSequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. + */ + public ErrorsComponent setDetailSequenceLinkId(int value) { + if (this.detailSequenceLinkId == null) + this.detailSequenceLinkId = new PositiveIntType(); + this.detailSequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value + */ + public PositiveIntType getSubdetailSequenceLinkIdElement() { + if (this.subdetailSequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.subdetailSequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.subdetailSequenceLinkId = new PositiveIntType(); // bb + return this.subdetailSequenceLinkId; + } + + public boolean hasSubdetailSequenceLinkIdElement() { + return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); + } + + public boolean hasSubdetailSequenceLinkId() { + return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setSubdetailSequenceLinkIdElement(PositiveIntType value) { + this.subdetailSequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. + */ + public int getSubdetailSequenceLinkId() { + return this.subdetailSequenceLinkId == null || this.subdetailSequenceLinkId.isEmpty() ? 0 : this.subdetailSequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. + */ + public ErrorsComponent setSubdetailSequenceLinkId(int value) { + if (this.subdetailSequenceLinkId == null) + this.subdetailSequenceLinkId = new PositiveIntType(); + this.subdetailSequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #code} (An error code,from a specified code system, which details why the claim could not be adjudicated.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (An error code,from a specified code system, which details why the claim could not be adjudicated.) + */ + public ErrorsComponent setCode(Coding value) { + this.code = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("detailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, detailSequenceLinkId)); + childrenList.add(new Property("subdetailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, subdetailSequenceLinkId)); + childrenList.add(new Property("code", "Coding", "An error code,from a specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType + case 516748423: /*detailSequenceLinkId*/ return this.detailSequenceLinkId == null ? new Base[0] : new Base[] {this.detailSequenceLinkId}; // PositiveIntType + case -1061088569: /*subdetailSequenceLinkId*/ return this.subdetailSequenceLinkId == null ? new Base[0] : new Base[] {this.subdetailSequenceLinkId}; // PositiveIntType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422298666: // sequenceLinkId + this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType + break; + case 516748423: // detailSequenceLinkId + this.detailSequenceLinkId = castToPositiveInt(value); // PositiveIntType + break; + case -1061088569: // subdetailSequenceLinkId + this.subdetailSequenceLinkId = castToPositiveInt(value); // PositiveIntType + break; + case 3059181: // code + this.code = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequenceLinkId")) + this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType + else if (name.equals("detailSequenceLinkId")) + this.detailSequenceLinkId = castToPositiveInt(value); // PositiveIntType + else if (name.equals("subdetailSequenceLinkId")) + this.subdetailSequenceLinkId = castToPositiveInt(value); // PositiveIntType + else if (name.equals("code")) + this.code = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType + case 516748423: throw new FHIRException("Cannot make property detailSequenceLinkId as it is not a complex type"); // PositiveIntType + case -1061088569: throw new FHIRException("Cannot make property subdetailSequenceLinkId as it is not a complex type"); // PositiveIntType + case 3059181: return getCode(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); + } + else if (name.equals("detailSequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.detailSequenceLinkId"); + } + else if (name.equals("subdetailSequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.subdetailSequenceLinkId"); + } + else if (name.equals("code")) { + this.code = new Coding(); + return this.code; + } + else + return super.addChild(name); + } + + public ErrorsComponent copy() { + ErrorsComponent dst = new ErrorsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + dst.detailSequenceLinkId = detailSequenceLinkId == null ? null : detailSequenceLinkId.copy(); + dst.subdetailSequenceLinkId = subdetailSequenceLinkId == null ? null : subdetailSequenceLinkId.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ErrorsComponent)) + return false; + ErrorsComponent o = (ErrorsComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(detailSequenceLinkId, o.detailSequenceLinkId, true) + && compareDeep(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true) && compareDeep(code, o.code, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ErrorsComponent)) + return false; + ErrorsComponent o = (ErrorsComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(detailSequenceLinkId, o.detailSequenceLinkId, true) + && compareValues(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (detailSequenceLinkId == null || detailSequenceLinkId.isEmpty()) + && (subdetailSequenceLinkId == null || subdetailSequenceLinkId.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + public String fhirType() { + return "ClaimResponse.error"; + + } + + } + + @Block() + public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An integer associated with each note which may be referred to from each service line item. + */ + @Child(name = "number", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." ) + protected PositiveIntType number; + + /** + * The note purpose: Print/Display. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Note explanatory text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 1768923951L; + + /** + * Constructor + */ + public NotesComponent() { + super(); + } + + /** + * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public PositiveIntType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new PositiveIntType(); // bb + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public NotesComponent setNumberElement(PositiveIntType value) { + this.number = value; + return this; + } + + /** + * @return An integer associated with each note which may be referred to from each service line item. + */ + public int getNumber() { + return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); + } + + /** + * @param value An integer associated with each note which may be referred to from each service line item. + */ + public NotesComponent setNumber(int value) { + if (this.number == null) + this.number = new PositiveIntType(); + this.number.setValue(value); + return this; + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public NotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public NotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public NotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1034364087: // number + this.number = castToPositiveInt(value); // PositiveIntType + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("number")) + this.number = castToPositiveInt(value); // PositiveIntType + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("text")) + this.text = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // PositiveIntType + case 3575610: return getType(); // Coding + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("number")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.number"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.text"); + } + else + return super.addChild(name); + } + + public NotesComponent copy() { + NotesComponent dst = new NotesComponent(); + copyValues(dst); + dst.number = number == null ? null : number.copy(); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareDeep(number, o.number, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareValues(number, o.number, true) && compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty()) + && (text == null || text.isEmpty()); + } + + public String fhirType() { + return "ClaimResponse.note"; + + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line item. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected PositiveIntType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Type coverage; + + /** + * The contract number of a business agreement which describes the terms and conditions. + */ + @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name = "preAuthRef", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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=6, min=0, max=1, modifier=false, summary=true) + @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; + + private static final long serialVersionUID = -1151494539L; + + /** + * Constructor + */ + public CoverageComponent() { + super(); + } + + /** + * Constructor + */ + public CoverageComponent(PositiveIntType sequence, BooleanType focal, Type coverage) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + } + + /** + * @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 PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). 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(); // bb + 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. The Coverage against which the claim is to be adjudicated.). 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. The Coverage against which the claim is to be adjudicated. + */ + public boolean getFocal() { + return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + */ + 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 Type getCoverage() { + return this.coverage; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Identifier getCoverageIdentifier() throws FHIRException { + if (!(this.coverage instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered"); + return (Identifier) this.coverage; + } + + public boolean hasCoverageIdentifier() { + return this.coverage instanceof Identifier; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverageReference() throws FHIRException { + if (!(this.coverage instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered"); + return (Reference) this.coverage; + } + + public boolean hasCoverageReference() { + return this.coverage instanceof Reference; + } + + 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(Type value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agreement 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(); // bb + 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 agreement 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 agreement 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 agreement 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 #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(); // cc + 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(); // aa + 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "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. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage[x]", "Identifier|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 agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type + case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType + case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType + case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 97604197: // focal + this.focal = castToBoolean(value); // BooleanType + break; + case -351767064: // coverage + this.coverage = (Type) value; // Type + break; + case 259920682: // businessArrangement + this.businessArrangement = castToString(value); // StringType + break; + case 522246568: // preAuthRef + this.getPreAuthRef().add(castToString(value)); // StringType + break; + case 689513629: // claimResponse + this.claimResponse = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("focal")) + this.focal = castToBoolean(value); // BooleanType + else if (name.equals("coverage[x]")) + this.coverage = (Type) value; // Type + else if (name.equals("businessArrangement")) + this.businessArrangement = castToString(value); // StringType + else if (name.equals("preAuthRef")) + this.getPreAuthRef().add(castToString(value)); + else if (name.equals("claimResponse")) + this.claimResponse = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 97604197: throw new FHIRException("Cannot make property focal as it is not a complex type"); // BooleanType + case 227689880: return getCoverage(); // Type + case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType + case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType + case 689513629: return getClaimResponse(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequence"); + } + else if (name.equals("focal")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.focal"); + } + else if (name.equals("coverageIdentifier")) { + this.coverage = new Identifier(); + return this.coverage; + } + else if (name.equals("coverageReference")) { + this.coverage = new Reference(); + return this.coverage; + } + else if (name.equals("businessArrangement")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.businessArrangement"); + } + else if (name.equals("preAuthRef")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.preAuthRef"); + } + else if (name.equals("claimResponse")) { + this.claimResponse = new Reference(); + return this.claimResponse; + } + else + return super.addChild(name); + } + + 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(); + if (preAuthRef != null) { + dst.preAuthRef = new ArrayList(); + for (StringType i : preAuthRef) + dst.preAuthRef.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true) + && compareDeep(claimResponse, o.claimResponse, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) + && compareValues(preAuthRef, o.preAuthRef, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (preAuthRef == null || preAuthRef.isEmpty()) && (claimResponse == null || claimResponse.isEmpty()) + ; + } + + public String fhirType() { + return "ClaimResponse.coverage"; + + } + + } + + /** + * The Response business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Response number", formalDefinition="The Response business identifier." ) + protected List identifier; + + /** + * Original request resource referrence. + */ + @Child(name = "request", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." ) + protected Type request; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Identifier.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Type organization; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Type requestProvider; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Type requestOrganization; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name = "payeeType", type = {Coding.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding payeeType; + + /** + * The first tier service adjudications for submitted services. + */ + @Child(name = "item", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Line items", formalDefinition="The first tier service adjudications for submitted services." ) + protected List item; + + /** + * The first tier service adjudications for payor added services. + */ + @Child(name = "addItem", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) + protected List addItem; + + /** + * Mutually exclusive with Services Provided (Item). + */ + @Child(name = "error", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) + protected List error; + + /** + * The total cost of the services reported. + */ + @Child(name = "totalCost", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) + protected Money totalCost; + + /** + * The amount of deductible applied which was not allocated to any particular service line. + */ + @Child(name = "unallocDeductable", type = {Money.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unallocated deductible", formalDefinition="The amount of deductible applied which was not allocated to any particular service line." ) + protected Money unallocDeductable; + + /** + * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible). + */ + @Child(name = "totalBenefit", type = {Money.class}, order=16, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible)." ) + protected Money totalBenefit; + + /** + * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. + */ + @Child(name = "paymentAdjustment", type = {Money.class}, order=17, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." ) + protected Money paymentAdjustment; + + /** + * Reason for the payment adjustment. + */ + @Child(name = "paymentAdjustmentReason", type = {Coding.class}, order=18, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) + protected Coding paymentAdjustmentReason; + + /** + * Estimated payment data. + */ + @Child(name = "paymentDate", type = {DateType.class}, order=19, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." ) + protected DateType paymentDate; + + /** + * Payable less any payment adjustment. + */ + @Child(name = "paymentAmount", type = {Money.class}, order=20, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." ) + protected Money paymentAmount; + + /** + * Payment identifier. + */ + @Child(name = "paymentRef", type = {Identifier.class}, order=21, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifier." ) + protected Identifier paymentRef; + + /** + * Status of funds reservation (For provider, for Patient, None). + */ + @Child(name = "reserved", type = {Coding.class}, order=22, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) + protected Coding reserved; + + /** + * The form to be used for printing the content. + */ + @Child(name = "form", type = {Coding.class}, order=23, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Note text. + */ + @Child(name = "note", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) + protected List note; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name = "coverage", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + private static final long serialVersionUID = 1381594471L; + + /** + * Constructor + */ + public ClaimResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response business identifier.) + */ + 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 Response business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Type getRequest() { + return this.request; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Identifier getRequestIdentifier() throws FHIRException { + if (!(this.request instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Identifier) this.request; + } + + public boolean hasRequestIdentifier() { + return this.request instanceof Identifier; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequestReference() throws FHIRException { + if (!(this.request instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Reference) this.request; + } + + public boolean hasRequestReference() { + return this.request instanceof Reference; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public ClaimResponse setRequest(Type value) { + this.request = value; + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 ClaimResponse setRuleset(Coding value) { + this.ruleset = 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 ClaimResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 ClaimResponse 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 ClaimResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 ClaimResponse 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 ClaimResponse 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 #organization} (The Insurer who produced this adjudicated response.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public ClaimResponse setOrganization(Type value) { + this.organization = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Type getRequestProvider() { + return this.requestProvider; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Identifier getRequestProviderIdentifier() throws FHIRException { + if (!(this.requestProvider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); + return (Identifier) this.requestProvider; + } + + public boolean hasRequestProviderIdentifier() { + return this.requestProvider instanceof Identifier; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProviderReference() throws FHIRException { + if (!(this.requestProvider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); + return (Reference) this.requestProvider; + } + + public boolean hasRequestProviderReference() { + return this.requestProvider instanceof Reference; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ClaimResponse setRequestProvider(Type value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Type getRequestOrganization() { + return this.requestOrganization; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Identifier getRequestOrganizationIdentifier() throws FHIRException { + if (!(this.requestOrganization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); + return (Identifier) this.requestOrganization; + } + + public boolean hasRequestOrganizationIdentifier() { + return this.requestOrganization instanceof Identifier; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganizationReference() throws FHIRException { + if (!(this.requestOrganization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); + return (Reference) this.requestOrganization; + } + + public boolean hasRequestOrganizationReference() { + return this.requestOrganization instanceof Reference; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public ClaimResponse setRequestOrganization(Type value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). 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 ClaimResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb + 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} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public ClaimResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RemittanceOutcome getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public ClaimResponse setOutcome(RemittanceOutcome value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ClaimResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public ClaimResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getPayeeType() { + if (this.payeeType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.payeeType"); + else if (Configuration.doAutoCreate()) + this.payeeType = new Coding(); // cc + return this.payeeType; + } + + public boolean hasPayeeType() { + return this.payeeType != null && !this.payeeType.isEmpty(); + } + + /** + * @param value {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) + */ + public ClaimResponse setPayeeType(Coding value) { + this.payeeType = value; + return this; + } + + /** + * @return {@link #item} (The first tier service adjudications for submitted 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} (The first tier service adjudications for submitted 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; + } + + // syntactic sugar + public ClaimResponse addItem(ItemsComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #addItem} (The first tier service adjudications for payor added services.) + */ + public List getAddItem() { + if (this.addItem == null) + this.addItem = new ArrayList(); + return this.addItem; + } + + public boolean hasAddItem() { + if (this.addItem == null) + return false; + for (AddedItemComponent item : this.addItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #addItem} (The first tier service adjudications for payor added services.) + */ + // syntactic sugar + public AddedItemComponent addAddItem() { //3 + AddedItemComponent t = new AddedItemComponent(); + if (this.addItem == null) + this.addItem = new ArrayList(); + this.addItem.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addAddItem(AddedItemComponent t) { //3 + if (t == null) + return this; + if (this.addItem == null) + this.addItem = new ArrayList(); + this.addItem.add(t); + return this; + } + + /** + * @return {@link #error} (Mutually exclusive with Services Provided (Item).) + */ + public List getError() { + if (this.error == null) + this.error = new ArrayList(); + return this.error; + } + + public boolean hasError() { + if (this.error == null) + return false; + for (ErrorsComponent item : this.error) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #error} (Mutually exclusive with Services Provided (Item).) + */ + // syntactic sugar + public ErrorsComponent addError() { //3 + ErrorsComponent t = new ErrorsComponent(); + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addError(ErrorsComponent t) { //3 + if (t == null) + return this; + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return this; + } + + /** + * @return {@link #totalCost} (The total cost of the services reported.) + */ + public Money getTotalCost() { + if (this.totalCost == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.totalCost"); + else if (Configuration.doAutoCreate()) + this.totalCost = new Money(); // cc + return this.totalCost; + } + + public boolean hasTotalCost() { + return this.totalCost != null && !this.totalCost.isEmpty(); + } + + /** + * @param value {@link #totalCost} (The total cost of the services reported.) + */ + public ClaimResponse setTotalCost(Money value) { + this.totalCost = value; + return this; + } + + /** + * @return {@link #unallocDeductable} (The amount of deductible applied which was not allocated to any particular service line.) + */ + public Money getUnallocDeductable() { + if (this.unallocDeductable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.unallocDeductable"); + else if (Configuration.doAutoCreate()) + this.unallocDeductable = new Money(); // cc + return this.unallocDeductable; + } + + public boolean hasUnallocDeductable() { + return this.unallocDeductable != null && !this.unallocDeductable.isEmpty(); + } + + /** + * @param value {@link #unallocDeductable} (The amount of deductible applied which was not allocated to any particular service line.) + */ + public ClaimResponse setUnallocDeductable(Money value) { + this.unallocDeductable = value; + return this; + } + + /** + * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).) + */ + public Money getTotalBenefit() { + if (this.totalBenefit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.totalBenefit"); + else if (Configuration.doAutoCreate()) + this.totalBenefit = new Money(); // cc + return this.totalBenefit; + } + + public boolean hasTotalBenefit() { + return this.totalBenefit != null && !this.totalBenefit.isEmpty(); + } + + /** + * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).) + */ + public ClaimResponse setTotalBenefit(Money value) { + this.totalBenefit = value; + return this; + } + + /** + * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) + */ + public Money getPaymentAdjustment() { + if (this.paymentAdjustment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustment"); + else if (Configuration.doAutoCreate()) + this.paymentAdjustment = new Money(); // cc + return this.paymentAdjustment; + } + + public boolean hasPaymentAdjustment() { + return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty(); + } + + /** + * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) + */ + public ClaimResponse setPaymentAdjustment(Money value) { + this.paymentAdjustment = value; + return this; + } + + /** + * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) + */ + public Coding getPaymentAdjustmentReason() { + if (this.paymentAdjustmentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustmentReason"); + else if (Configuration.doAutoCreate()) + this.paymentAdjustmentReason = new Coding(); // cc + return this.paymentAdjustmentReason; + } + + public boolean hasPaymentAdjustmentReason() { + return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty(); + } + + /** + * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) + */ + public ClaimResponse setPaymentAdjustmentReason(Coding value) { + this.paymentAdjustmentReason = value; + return this; + } + + /** + * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value + */ + public DateType getPaymentDateElement() { + if (this.paymentDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentDate"); + else if (Configuration.doAutoCreate()) + this.paymentDate = new DateType(); // bb + return this.paymentDate; + } + + public boolean hasPaymentDateElement() { + return this.paymentDate != null && !this.paymentDate.isEmpty(); + } + + public boolean hasPaymentDate() { + return this.paymentDate != null && !this.paymentDate.isEmpty(); + } + + /** + * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value + */ + public ClaimResponse setPaymentDateElement(DateType value) { + this.paymentDate = value; + return this; + } + + /** + * @return Estimated payment data. + */ + public Date getPaymentDate() { + return this.paymentDate == null ? null : this.paymentDate.getValue(); + } + + /** + * @param value Estimated payment data. + */ + public ClaimResponse setPaymentDate(Date value) { + if (value == null) + this.paymentDate = null; + else { + if (this.paymentDate == null) + this.paymentDate = new DateType(); + this.paymentDate.setValue(value); + } + return this; + } + + /** + * @return {@link #paymentAmount} (Payable less any payment adjustment.) + */ + public Money getPaymentAmount() { + if (this.paymentAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAmount"); + else if (Configuration.doAutoCreate()) + this.paymentAmount = new Money(); // cc + return this.paymentAmount; + } + + public boolean hasPaymentAmount() { + return this.paymentAmount != null && !this.paymentAmount.isEmpty(); + } + + /** + * @param value {@link #paymentAmount} (Payable less any payment adjustment.) + */ + public ClaimResponse setPaymentAmount(Money value) { + this.paymentAmount = value; + return this; + } + + /** + * @return {@link #paymentRef} (Payment identifier.) + */ + public Identifier getPaymentRef() { + if (this.paymentRef == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentRef"); + else if (Configuration.doAutoCreate()) + this.paymentRef = new Identifier(); // cc + return this.paymentRef; + } + + public boolean hasPaymentRef() { + return this.paymentRef != null && !this.paymentRef.isEmpty(); + } + + /** + * @param value {@link #paymentRef} (Payment identifier.) + */ + public ClaimResponse setPaymentRef(Identifier value) { + this.paymentRef = value; + return this; + } + + /** + * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) + */ + public Coding getReserved() { + if (this.reserved == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.reserved"); + else if (Configuration.doAutoCreate()) + this.reserved = new Coding(); // cc + return this.reserved; + } + + public boolean hasReserved() { + return this.reserved != null && !this.reserved.isEmpty(); + } + + /** + * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) + */ + public ClaimResponse setReserved(Coding value) { + this.reserved = value; + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public ClaimResponse setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #note} (Note text.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (NotesComponent item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Note text.) + */ + // syntactic sugar + public NotesComponent addNote() { //3 + NotesComponent t = new NotesComponent(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public ClaimResponse addNote(NotesComponent t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + 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; + } + + // syntactic sugar + public ClaimResponse addCoverage(CoverageComponent t) { //3 + if (t == null) + return this; + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + 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("request[x]", "Identifier|Reference(Claim)", "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("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[x]", "Identifier|Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider[x]", "Identifier|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[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + 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("payeeType", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType)); + childrenList.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem)); + childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); + childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductible applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); + childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); + childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment)); + childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason)); + childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate)); + childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount)); + childrenList.add(new Property("paymentRef", "Identifier", "Payment identifier.", 0, java.lang.Integer.MAX_VALUE, paymentRef)); + childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type + case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType + case -316321118: /*payeeType*/ return this.payeeType == null ? new Base[0] : new Base[] {this.payeeType}; // Coding + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent + case -1148899500: /*addItem*/ return this.addItem == null ? new Base[0] : this.addItem.toArray(new Base[this.addItem.size()]); // AddedItemComponent + case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorsComponent + case -577782479: /*totalCost*/ return this.totalCost == null ? new Base[0] : new Base[] {this.totalCost}; // Money + case 2096309753: /*unallocDeductable*/ return this.unallocDeductable == null ? new Base[0] : new Base[] {this.unallocDeductable}; // Money + case 332332211: /*totalBenefit*/ return this.totalBenefit == null ? new Base[0] : new Base[] {this.totalBenefit}; // Money + case 856402963: /*paymentAdjustment*/ return this.paymentAdjustment == null ? new Base[0] : new Base[] {this.paymentAdjustment}; // Money + case -1386508233: /*paymentAdjustmentReason*/ return this.paymentAdjustmentReason == null ? new Base[0] : new Base[] {this.paymentAdjustmentReason}; // Coding + case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateType + case 909332990: /*paymentAmount*/ return this.paymentAmount == null ? new Base[0] : new Base[] {this.paymentAmount}; // Money + case 1612875949: /*paymentRef*/ return this.paymentRef == null ? new Base[0] : new Base[] {this.paymentRef}; // Identifier + case -350385368: /*reserved*/ return this.reserved == null ? new Base[0] : new Base[] {this.reserved}; // Coding + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NotesComponent + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1095692943: // request + this.request = (Type) value; // Type + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case 1601527200: // requestProvider + this.requestProvider = (Type) value; // Type + break; + case 599053666: // requestOrganization + this.requestOrganization = (Type) value; // Type + break; + case -1106507950: // outcome + this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; + case -316321118: // payeeType + this.payeeType = castToCoding(value); // Coding + break; + case 3242771: // item + this.getItem().add((ItemsComponent) value); // ItemsComponent + break; + case -1148899500: // addItem + this.getAddItem().add((AddedItemComponent) value); // AddedItemComponent + break; + case 96784904: // error + this.getError().add((ErrorsComponent) value); // ErrorsComponent + break; + case -577782479: // totalCost + this.totalCost = castToMoney(value); // Money + break; + case 2096309753: // unallocDeductable + this.unallocDeductable = castToMoney(value); // Money + break; + case 332332211: // totalBenefit + this.totalBenefit = castToMoney(value); // Money + break; + case 856402963: // paymentAdjustment + this.paymentAdjustment = castToMoney(value); // Money + break; + case -1386508233: // paymentAdjustmentReason + this.paymentAdjustmentReason = castToCoding(value); // Coding + break; + case -1540873516: // paymentDate + this.paymentDate = castToDate(value); // DateType + break; + case 909332990: // paymentAmount + this.paymentAmount = castToMoney(value); // Money + break; + case 1612875949: // paymentRef + this.paymentRef = castToIdentifier(value); // Identifier + break; + case -350385368: // reserved + this.reserved = castToCoding(value); // Coding + break; + case 3148996: // form + this.form = castToCoding(value); // Coding + break; + case 3387378: // note + this.getNote().add((NotesComponent) value); // NotesComponent + break; + case -351767064: // coverage + this.getCoverage().add((CoverageComponent) value); // CoverageComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("request[x]")) + this.request = (Type) value; // Type + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("requestProvider[x]")) + this.requestProvider = (Type) value; // Type + else if (name.equals("requestOrganization[x]")) + this.requestOrganization = (Type) value; // Type + else if (name.equals("outcome")) + this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType + else if (name.equals("payeeType")) + this.payeeType = castToCoding(value); // Coding + else if (name.equals("item")) + this.getItem().add((ItemsComponent) value); + else if (name.equals("addItem")) + this.getAddItem().add((AddedItemComponent) value); + else if (name.equals("error")) + this.getError().add((ErrorsComponent) value); + else if (name.equals("totalCost")) + this.totalCost = castToMoney(value); // Money + else if (name.equals("unallocDeductable")) + this.unallocDeductable = castToMoney(value); // Money + else if (name.equals("totalBenefit")) + this.totalBenefit = castToMoney(value); // Money + else if (name.equals("paymentAdjustment")) + this.paymentAdjustment = castToMoney(value); // Money + else if (name.equals("paymentAdjustmentReason")) + this.paymentAdjustmentReason = castToCoding(value); // Coding + else if (name.equals("paymentDate")) + this.paymentDate = castToDate(value); // DateType + else if (name.equals("paymentAmount")) + this.paymentAmount = castToMoney(value); // Money + else if (name.equals("paymentRef")) + this.paymentRef = castToIdentifier(value); // Identifier + else if (name.equals("reserved")) + this.reserved = castToCoding(value); // Coding + else if (name.equals("form")) + this.form = castToCoding(value); // Coding + else if (name.equals("note")) + this.getNote().add((NotesComponent) value); + else if (name.equals("coverage")) + this.getCoverage().add((CoverageComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 37106577: return getRequest(); // Type + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 1326483053: return getOrganization(); // Type + case -1694784800: return getRequestProvider(); // Type + case 818740190: return getRequestOrganization(); // Type + case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType + case -316321118: return getPayeeType(); // Coding + case 3242771: return addItem(); // ItemsComponent + case -1148899500: return addAddItem(); // AddedItemComponent + case 96784904: return addError(); // ErrorsComponent + case -577782479: return getTotalCost(); // Money + case 2096309753: return getUnallocDeductable(); // Money + case 332332211: return getTotalBenefit(); // Money + case 856402963: return getPaymentAdjustment(); // Money + case -1386508233: return getPaymentAdjustmentReason(); // Coding + case -1540873516: throw new FHIRException("Cannot make property paymentDate as it is not a complex type"); // DateType + case 909332990: return getPaymentAmount(); // Money + case 1612875949: return getPaymentRef(); // Identifier + case -350385368: return getReserved(); // Coding + case 3148996: return getForm(); // Coding + case 3387378: return addNote(); // NotesComponent + case -351767064: return addCoverage(); // CoverageComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("requestIdentifier")) { + this.request = new Identifier(); + return this.request; + } + else if (name.equals("requestReference")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.created"); + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("requestProviderIdentifier")) { + this.requestProvider = new Identifier(); + return this.requestProvider; + } + else if (name.equals("requestProviderReference")) { + this.requestProvider = new Reference(); + return this.requestProvider; + } + else if (name.equals("requestOrganizationIdentifier")) { + this.requestOrganization = new Identifier(); + return this.requestOrganization; + } + else if (name.equals("requestOrganizationReference")) { + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + else if (name.equals("outcome")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.outcome"); + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.disposition"); + } + else if (name.equals("payeeType")) { + this.payeeType = new Coding(); + return this.payeeType; + } + else if (name.equals("item")) { + return addItem(); + } + else if (name.equals("addItem")) { + return addAddItem(); + } + else if (name.equals("error")) { + return addError(); + } + else if (name.equals("totalCost")) { + this.totalCost = new Money(); + return this.totalCost; + } + else if (name.equals("unallocDeductable")) { + this.unallocDeductable = new Money(); + return this.unallocDeductable; + } + else if (name.equals("totalBenefit")) { + this.totalBenefit = new Money(); + return this.totalBenefit; + } + else if (name.equals("paymentAdjustment")) { + this.paymentAdjustment = new Money(); + return this.paymentAdjustment; + } + else if (name.equals("paymentAdjustmentReason")) { + this.paymentAdjustmentReason = new Coding(); + return this.paymentAdjustmentReason; + } + else if (name.equals("paymentDate")) { + throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.paymentDate"); + } + else if (name.equals("paymentAmount")) { + this.paymentAmount = new Money(); + return this.paymentAmount; + } + else if (name.equals("paymentRef")) { + this.paymentRef = new Identifier(); + return this.paymentRef; + } + else if (name.equals("reserved")) { + this.reserved = new Coding(); + return this.reserved; + } + else if (name.equals("form")) { + this.form = new Coding(); + return this.form; + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("coverage")) { + return addCoverage(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ClaimResponse"; + + } + + public ClaimResponse copy() { + ClaimResponse dst = new ClaimResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.payeeType = payeeType == null ? null : payeeType.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (addItem != null) { + dst.addItem = new ArrayList(); + for (AddedItemComponent i : addItem) + dst.addItem.add(i.copy()); + }; + if (error != null) { + dst.error = new ArrayList(); + for (ErrorsComponent i : error) + dst.error.add(i.copy()); + }; + dst.totalCost = totalCost == null ? null : totalCost.copy(); + dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); + dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); + dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy(); + dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy(); + dst.paymentDate = paymentDate == null ? null : paymentDate.copy(); + dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy(); + dst.paymentRef = paymentRef == null ? null : paymentRef.copy(); + dst.reserved = reserved == null ? null : reserved.copy(); + dst.form = form == null ? null : form.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (NotesComponent i : note) + dst.note.add(i.copy()); + }; + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + return dst; + } + + protected ClaimResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClaimResponse)) + return false; + ClaimResponse o = (ClaimResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(ruleset, o.ruleset, true) + && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) + && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(payeeType, o.payeeType, true) && compareDeep(item, o.item, true) + && compareDeep(addItem, o.addItem, true) && compareDeep(error, o.error, true) && compareDeep(totalCost, o.totalCost, true) + && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true) + && compareDeep(paymentAdjustment, o.paymentAdjustment, true) && compareDeep(paymentAdjustmentReason, o.paymentAdjustmentReason, true) + && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(paymentAmount, o.paymentAmount, true) + && compareDeep(paymentRef, o.paymentRef, true) && compareDeep(reserved, o.reserved, true) && compareDeep(form, o.form, true) + && compareDeep(note, o.note, true) && compareDeep(coverage, o.coverage, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClaimResponse)) + return false; + ClaimResponse o = (ClaimResponse) other; + return compareValues(created, o.created, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) + && compareValues(paymentDate, o.paymentDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.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()) + && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty()) + && (coverage == null || coverage.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ClaimResponse; + } + + /** + * Search parameter: created + *

+ * Description: The creation date
+ * Type: date
+ * Path: ClaimResponse.created
+ *

+ */ + @SearchParamDefinition(name="created", path="ClaimResponse.created", description="The creation date", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: The creation date
+ * Type: date
+ * Path: ClaimResponse.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: requestidentifier + *

+ * Description: The claim reference
+ * Type: token
+ * Path: ClaimResponse.requestIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestidentifier", path="ClaimResponse.request.as(Identifier)", description="The claim reference", type="token" ) + public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; + /** + * Fluent Client search parameter constant for requestidentifier + *

+ * Description: The claim reference
+ * Type: token
+ * Path: ClaimResponse.requestIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); + + /** + * Search parameter: requestreference + *

+ * Description: The claim reference
+ * Type: reference
+ * Path: ClaimResponse.requestReference
+ *

+ */ + @SearchParamDefinition(name="requestreference", path="ClaimResponse.request.as(Reference)", description="The claim reference", type="reference" ) + public static final String SP_REQUESTREFERENCE = "requestreference"; + /** + * Fluent Client search parameter constant for requestreference + *

+ * Description: The claim reference
+ * Type: reference
+ * Path: ClaimResponse.requestReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClaimResponse:requestreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("ClaimResponse:requestreference").toLocked(); + + /** + * Search parameter: paymentdate + *

+ * Description: The expected paymentDate
+ * Type: date
+ * Path: ClaimResponse.paymentDate
+ *

+ */ + @SearchParamDefinition(name="paymentdate", path="ClaimResponse.paymentDate", description="The expected paymentDate", type="date" ) + public static final String SP_PAYMENTDATE = "paymentdate"; + /** + * Fluent Client search parameter constant for paymentdate + *

+ * Description: The expected paymentDate
+ * Type: date
+ * Path: ClaimResponse.paymentDate
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam PAYMENTDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PAYMENTDATE); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: ClaimResponse.organizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="ClaimResponse.organization.as(Identifier)", description="The organization who generated this resource", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: ClaimResponse.organizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: organizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: ClaimResponse.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="ClaimResponse.organization.as(Reference)", description="The organization who generated this resource", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: ClaimResponse.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClaimResponse:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ClaimResponse:organizationreference").toLocked(); + + /** + * Search parameter: outcome + *

+ * Description: The processing outcome
+ * Type: token
+ * Path: ClaimResponse.outcome
+ *

+ */ + @SearchParamDefinition(name="outcome", path="ClaimResponse.outcome", description="The processing outcome", type="token" ) + public static final String SP_OUTCOME = "outcome"; + /** + * Fluent Client search parameter constant for outcome + *

+ * Description: The processing outcome
+ * Type: token
+ * Path: ClaimResponse.outcome
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME); + + /** + * Search parameter: identifier + *

+ * Description: The identity of the insurer
+ * Type: token
+ * Path: ClaimResponse.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the insurer", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identity of the insurer
+ * Type: token
+ * Path: ClaimResponse.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: disposition + *

+ * Description: The contents of the disposition message
+ * Type: string
+ * Path: ClaimResponse.disposition
+ *

+ */ + @SearchParamDefinition(name="disposition", path="ClaimResponse.disposition", description="The contents of the disposition message", type="string" ) + public static final String SP_DISPOSITION = "disposition"; + /** + * Fluent Client search parameter constant for disposition + *

+ * Description: The contents of the disposition message
+ * Type: string
+ * Path: ClaimResponse.disposition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ClinicalImpression.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ClinicalImpression.java new file mode 100644 index 00000000000..5082c3da424 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ClinicalImpression.java @@ -0,0 +1,2399 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * 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. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + */ +@ResourceDef(name="ClinicalImpression", profile="http://hl7.org/fhir/Profile/ClinicalImpression") +public class ClinicalImpression extends DomainResource { + + public enum ClinicalImpressionStatus { + /** + * The assessment is still on-going and results are not yet final. + */ + INPROGRESS, + /** + * The assessment is done and the results are final. + */ + COMPLETED, + /** + * This assessment was never actually done and the record is erroneous (e.g. Wrong patient). + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static ClinicalImpressionStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown ClinicalImpressionStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return "http://hl7.org/fhir/clinical-impression-status"; + case COMPLETED: return "http://hl7.org/fhir/clinical-impression-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/clinical-impression-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The assessment is still on-going and results are not yet final."; + case COMPLETED: return "The assessment is done and the results are final."; + case ENTEREDINERROR: return "This assessment was never actually done and the record is erroneous (e.g. Wrong patient)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In progress"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + public static class ClinicalImpressionStatusEnumFactory implements EnumFactory { + public ClinicalImpressionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return ClinicalImpressionStatus.INPROGRESS; + if ("completed".equals(codeString)) + return ClinicalImpressionStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return ClinicalImpressionStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ClinicalImpressionStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return new Enumeration(this, ClinicalImpressionStatus.INPROGRESS); + if ("completed".equals(codeString)) + return new Enumeration(this, ClinicalImpressionStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, ClinicalImpressionStatus.ENTEREDINERROR); + throw new FHIRException("Unknown ClinicalImpressionStatus code '"+codeString+"'"); + } + public String toCode(ClinicalImpressionStatus code) { + if (code == ClinicalImpressionStatus.INPROGRESS) + return "in-progress"; + if (code == ClinicalImpressionStatus.COMPLETED) + return "completed"; + if (code == ClinicalImpressionStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(ClinicalImpressionStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class ClinicalImpressionInvestigationsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * 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, modifier=false, summary=false) + @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, QuestionnaireResponse.class, FamilyMemberHistory.class, DiagnosticReport.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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; + + /** + * Constructor + */ + public ClinicalImpressionInvestigationsComponent() { + super(); + } + + /** + * Constructor + */ + public ClinicalImpressionInvestigationsComponent(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 ClinicalImpressionInvestigationsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + 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 ClinicalImpressionInvestigationsComponent 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; + } + + // syntactic sugar + public ClinicalImpressionInvestigationsComponent addItem(Reference t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @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|QuestionnaireResponse|FamilyMemberHistory|DiagnosticReport)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 3242771: // item + this.getItem().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("item")) + this.getItem().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case 3242771: return addItem(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("item")) { + return addItem(); + } + else + return super.addChild(name); + } + + public ClinicalImpressionInvestigationsComponent copy() { + ClinicalImpressionInvestigationsComponent dst = new ClinicalImpressionInvestigationsComponent(); + 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; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClinicalImpressionInvestigationsComponent)) + return false; + ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other; + return compareDeep(code, o.code, true) && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClinicalImpressionInvestigationsComponent)) + return false; + ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (item == null || item.isEmpty()) + ; + } + + public String fhirType() { + return "ClinicalImpression.investigations"; + + } + + } + + @Block() + public static class ClinicalImpressionFindingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specific text of code for finding or diagnosis. + */ + @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Specific text or code for finding", formalDefinition="Specific text of code for finding or diagnosis." ) + protected CodeableConcept item; + + /** + * Which investigations support finding or diagnosis. + */ + @Child(name = "cause", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Which investigations support finding", formalDefinition="Which investigations support finding or diagnosis." ) + protected StringType cause; + + private static final long serialVersionUID = -888590978L; + + /** + * Constructor + */ + public ClinicalImpressionFindingComponent() { + super(); + } + + /** + * Constructor + */ + public ClinicalImpressionFindingComponent(CodeableConcept item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Specific text of code for finding or diagnosis.) + */ + public CodeableConcept getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new CodeableConcept(); // cc + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Specific text of code for finding or diagnosis.) + */ + public ClinicalImpressionFindingComponent setItem(CodeableConcept value) { + this.item = value; + return this; + } + + /** + * @return {@link #cause} (Which investigations support finding or 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 ClinicalImpressionFindingComponent.cause"); + else if (Configuration.doAutoCreate()) + this.cause = new StringType(); // bb + 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 finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value + */ + public ClinicalImpressionFindingComponent setCauseElement(StringType value) { + this.cause = value; + return this; + } + + /** + * @return Which investigations support finding or diagnosis. + */ + public String getCause() { + return this.cause == null ? null : this.cause.getValue(); + } + + /** + * @param value Which investigations support finding or diagnosis. + */ + public ClinicalImpressionFindingComponent 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 finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("cause", "string", "Which investigations support finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, cause)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // CodeableConcept + case 94434409: /*cause*/ return this.cause == null ? new Base[0] : new Base[] {this.cause}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3242771: // item + this.item = castToCodeableConcept(value); // CodeableConcept + break; + case 94434409: // cause + this.cause = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("item")) + this.item = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("cause")) + this.cause = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3242771: return getItem(); // CodeableConcept + case 94434409: throw new FHIRException("Cannot make property cause as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("item")) { + this.item = new CodeableConcept(); + return this.item; + } + else if (name.equals("cause")) { + throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.cause"); + } + else + return super.addChild(name); + } + + public ClinicalImpressionFindingComponent copy() { + ClinicalImpressionFindingComponent dst = new ClinicalImpressionFindingComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.cause = cause == null ? null : cause.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClinicalImpressionFindingComponent)) + return false; + ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other; + return compareDeep(item, o.item, true) && compareDeep(cause, o.cause, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClinicalImpressionFindingComponent)) + return false; + ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other; + return compareValues(cause, o.cause, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (cause == null || cause.isEmpty()) + ; + } + + public String fhirType() { + return "ClinicalImpression.finding"; + + } + + } + + @Block() + public static class ClinicalImpressionRuledOutComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specific text of code for diagnosis. + */ + @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) + @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, modifier=false, summary=false) + @Description(shortDefinition="Grounds for elimination", formalDefinition="Grounds for elimination." ) + protected StringType reason; + + private static final long serialVersionUID = -1001661243L; + + /** + * Constructor + */ + public ClinicalImpressionRuledOutComponent() { + super(); + } + + /** + * Constructor + */ + public ClinicalImpressionRuledOutComponent(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 ClinicalImpressionRuledOutComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new CodeableConcept(); // cc + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Specific text of code for diagnosis.) + */ + public ClinicalImpressionRuledOutComponent 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 ClinicalImpressionRuledOutComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new StringType(); // bb + 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 ClinicalImpressionRuledOutComponent 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 ClinicalImpressionRuledOutComponent 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // CodeableConcept + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3242771: // item + this.item = castToCodeableConcept(value); // CodeableConcept + break; + case -934964668: // reason + this.reason = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("item")) + this.item = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("reason")) + this.reason = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3242771: return getItem(); // CodeableConcept + case -934964668: throw new FHIRException("Cannot make property reason as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("item")) { + this.item = new CodeableConcept(); + return this.item; + } + else if (name.equals("reason")) { + throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.reason"); + } + else + return super.addChild(name); + } + + public ClinicalImpressionRuledOutComponent copy() { + ClinicalImpressionRuledOutComponent dst = new ClinicalImpressionRuledOutComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.reason = reason == null ? null : reason.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClinicalImpressionRuledOutComponent)) + return false; + ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other; + return compareDeep(item, o.item, true) && compareDeep(reason, o.reason, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClinicalImpressionRuledOutComponent)) + return false; + ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other; + return compareValues(reason, o.reason, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (reason == null || reason.isEmpty()) + ; + } + + public String fhirType() { + return "ClinicalImpression.ruledOut"; + + } + + } + + /** + * The patient being assessed. + */ + @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The patient being assessed", formalDefinition="The patient being assessed." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient being assessed.) + */ + protected Patient patientTarget; + + /** + * The clinician performing the assessment. + */ + @Child(name = "assessor", type = {Practitioner.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The clinician performing the assessment", formalDefinition="The clinician performing the assessment." ) + protected Reference assessor; + + /** + * The actual object that is the target of the reference (The clinician performing the assessment.) + */ + protected Practitioner assessorTarget; + + /** + * Identifies the workflow status of the assessment. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="in-progress | completed | entered-in-error", formalDefinition="Identifies the workflow status of the assessment." ) + protected Enumeration status; + + /** + * The point in time at which the assessment was concluded (not when it was recorded). + */ + @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @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=4, min=0, max=1, modifier=false, summary=true) + @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 = {ClinicalImpression.class}, order=5, min=0, max=1, modifier=false, summary=false) + @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 ClinicalImpression previousTarget; + + /** + * This a list of the general problems/conditions for a patient. + */ + @Child(name = "problem", type = {Condition.class, AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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; + + + /** + * The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource. + */ + @Child(name = "trigger", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Request or event that necessitated this assessment", formalDefinition="The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource." ) + protected Type trigger; + + /** + * 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=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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=9, min=0, max=1, modifier=false, summary=false) + @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=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." ) + protected StringType summary; + + /** + * Specific findings or diagnoses that was considered likely or relevant to ongoing treatment. + */ + @Child(name = "finding", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Possible or likely findings and diagnoses", formalDefinition="Specific findings or diagnoses that was considered likely or relevant to ongoing treatment." ) + protected List finding; + + /** + * Diagnoses/conditions resolved since the last assessment. + */ + @Child(name = "resolved", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Diagnoses/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=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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=14, min=0, max=1, modifier=false, summary=false) + @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, Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationOrder.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, SupplyRequest.class, VisionPrescription.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Plan of action after assessment", formalDefinition="Plan of action after assessment." ) + protected List plan; + /** + * The actual objects that are the target of the reference (Plan of action after assessment.) + */ + protected List planTarget; + + + /** + * Actions taken during assessment. + */ + @Child(name = "action", type = {ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationOrder.class, DiagnosticOrder.class, NutritionOrder.class, SupplyRequest.class, Appointment.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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 = 1650458630L; + + /** + * Constructor + */ + public ClinicalImpression() { + super(); + } + + /** + * Constructor + */ + public ClinicalImpression(Reference patient, Enumeration status) { + super(); + this.patient = patient; + this.status = status; + } + + /** + * @return {@link #patient} (The patient being assessed.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient being assessed.) + */ + public ClinicalImpression 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 assessed.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 assessed.) + */ + public ClinicalImpression setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #assessor} (The clinician performing the assessment.) + */ + public Reference getAssessor() { + if (this.assessor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.assessor"); + else if (Configuration.doAutoCreate()) + this.assessor = new Reference(); // cc + return this.assessor; + } + + public boolean hasAssessor() { + return this.assessor != null && !this.assessor.isEmpty(); + } + + /** + * @param value {@link #assessor} (The clinician performing the assessment.) + */ + public ClinicalImpression 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 clinician performing the assessment.) + */ + public Practitioner getAssessorTarget() { + if (this.assessorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.assessor"); + else if (Configuration.doAutoCreate()) + this.assessorTarget = new Practitioner(); // aa + 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 clinician performing the assessment.) + */ + public ClinicalImpression setAssessorTarget(Practitioner value) { + this.assessorTarget = value; + return this; + } + + /** + * @return {@link #status} (Identifies the workflow status of the assessment.). 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 ClinicalImpression.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ClinicalImpressionStatusEnumFactory()); // bb + 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 the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ClinicalImpression setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Identifies the workflow status of the assessment. + */ + public ClinicalImpressionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Identifies the workflow status of the assessment. + */ + public ClinicalImpression setStatus(ClinicalImpressionStatus value) { + if (this.status == null) + this.status = new Enumeration(new ClinicalImpressionStatusEnumFactory()); + this.status.setValue(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 ClinicalImpression.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 ClinicalImpression 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 ClinicalImpression setDate(Date value) { + if (value == null) + this.date = null; + else { + 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 ClinicalImpression.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 ClinicalImpression 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 ClinicalImpression 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 ClinicalImpression.previous"); + else if (Configuration.doAutoCreate()) + this.previous = new Reference(); // cc + 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 ClinicalImpression 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 ClinicalImpression getPreviousTarget() { + if (this.previousTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalImpression.previous"); + else if (Configuration.doAutoCreate()) + this.previousTarget = new ClinicalImpression(); // aa + 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 ClinicalImpression setPreviousTarget(ClinicalImpression 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; + } + + // syntactic sugar + public ClinicalImpression addProblem(Reference t) { //3 + if (t == null) + return this; + if (this.problem == null) + this.problem = new ArrayList(); + this.problem.add(t); + return this; + } + + /** + * @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 #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) + */ + public Type getTrigger() { + return this.trigger; + } + + /** + * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) + */ + public CodeableConcept getTriggerCodeableConcept() throws FHIRException { + if (!(this.trigger instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.trigger.getClass().getName()+" was encountered"); + return (CodeableConcept) this.trigger; + } + + public boolean hasTriggerCodeableConcept() { + return this.trigger instanceof CodeableConcept; + } + + /** + * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) + */ + public Reference getTriggerReference() throws FHIRException { + if (!(this.trigger instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.trigger.getClass().getName()+" was encountered"); + return (Reference) this.trigger; + } + + public boolean hasTriggerReference() { + return this.trigger instanceof Reference; + } + + public boolean hasTrigger() { + return this.trigger != null && !this.trigger.isEmpty(); + } + + /** + * @param value {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) + */ + public ClinicalImpression setTrigger(Type value) { + this.trigger = 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 (ClinicalImpressionInvestigationsComponent 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 ClinicalImpressionInvestigationsComponent addInvestigations() { //3 + ClinicalImpressionInvestigationsComponent t = new ClinicalImpressionInvestigationsComponent(); + if (this.investigations == null) + this.investigations = new ArrayList(); + this.investigations.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addInvestigations(ClinicalImpressionInvestigationsComponent t) { //3 + if (t == null) + return this; + if (this.investigations == null) + this.investigations = new ArrayList(); + this.investigations.add(t); + return this; + } + + /** + * @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 ClinicalImpression.protocol"); + else if (Configuration.doAutoCreate()) + this.protocol = new UriType(); // bb + 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 ClinicalImpression 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 ClinicalImpression 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 ClinicalImpression.summary"); + else if (Configuration.doAutoCreate()) + this.summary = new StringType(); // bb + 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 ClinicalImpression 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 ClinicalImpression 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 #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.) + */ + public List getFinding() { + if (this.finding == null) + this.finding = new ArrayList(); + return this.finding; + } + + public boolean hasFinding() { + if (this.finding == null) + return false; + for (ClinicalImpressionFindingComponent item : this.finding) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.) + */ + // syntactic sugar + public ClinicalImpressionFindingComponent addFinding() { //3 + ClinicalImpressionFindingComponent t = new ClinicalImpressionFindingComponent(); + if (this.finding == null) + this.finding = new ArrayList(); + this.finding.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addFinding(ClinicalImpressionFindingComponent t) { //3 + if (t == null) + return this; + if (this.finding == null) + this.finding = new ArrayList(); + this.finding.add(t); + return this; + } + + /** + * @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; + } + + // syntactic sugar + public ClinicalImpression addResolved(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.resolved == null) + this.resolved = new ArrayList(); + this.resolved.add(t); + return this; + } + + /** + * @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 (ClinicalImpressionRuledOutComponent item : this.ruledOut) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ruledOut} (Diagnosis considered not possible.) + */ + // syntactic sugar + public ClinicalImpressionRuledOutComponent addRuledOut() { //3 + ClinicalImpressionRuledOutComponent t = new ClinicalImpressionRuledOutComponent(); + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + this.ruledOut.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addRuledOut(ClinicalImpressionRuledOutComponent t) { //3 + if (t == null) + return this; + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + this.ruledOut.add(t); + return this; + } + + /** + * @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 ClinicalImpression.prognosis"); + else if (Configuration.doAutoCreate()) + this.prognosis = new StringType(); // bb + 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 ClinicalImpression 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 ClinicalImpression 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 List getPlan() { + if (this.plan == null) + this.plan = new ArrayList(); + return this.plan; + } + + public boolean hasPlan() { + if (this.plan == null) + return false; + for (Reference item : this.plan) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #plan} (Plan of action after assessment.) + */ + // syntactic sugar + public Reference addPlan() { //3 + Reference t = new Reference(); + if (this.plan == null) + this.plan = new ArrayList(); + this.plan.add(t); + return t; + } + + // syntactic sugar + public ClinicalImpression addPlan(Reference t) { //3 + if (t == null) + return this; + if (this.plan == null) + this.plan = new ArrayList(); + this.plan.add(t); + return this; + } + + /** + * @return {@link #plan} (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. Plan of action after assessment.) + */ + public List getPlanTarget() { + if (this.planTarget == null) + this.planTarget = new ArrayList(); + return this.planTarget; + } + + /** + * @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; + } + + // syntactic sugar + public ClinicalImpression addAction(Reference t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + /** + * @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 assessed.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinician performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor)); + childrenList.add(new Property("status", "code", "Identifies the workflow status of the assessment.", 0, java.lang.Integer.MAX_VALUE, status)); + 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(ClinicalImpression)", "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("trigger[x]", "CodeableConcept|Reference(Any)", "The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.", 0, java.lang.Integer.MAX_VALUE, trigger)); + 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("finding", "", "Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, finding)); + 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|Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationOrder|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|SupplyRequest|VisionPrescription)", "Plan of action after assessment.", 0, java.lang.Integer.MAX_VALUE, plan)); + childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationOrder|DiagnosticOrder|NutritionOrder|SupplyRequest|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -373213113: /*assessor*/ return this.assessor == null ? new Base[0] : new Base[] {this.assessor}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1273775369: /*previous*/ return this.previous == null ? new Base[0] : new Base[] {this.previous}; // Reference + case -309542241: /*problem*/ return this.problem == null ? new Base[0] : this.problem.toArray(new Base[this.problem.size()]); // Reference + case -1059891784: /*trigger*/ return this.trigger == null ? new Base[0] : new Base[] {this.trigger}; // Type + case -428294735: /*investigations*/ return this.investigations == null ? new Base[0] : this.investigations.toArray(new Base[this.investigations.size()]); // ClinicalImpressionInvestigationsComponent + case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // UriType + case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : new Base[] {this.summary}; // StringType + case -853173367: /*finding*/ return this.finding == null ? new Base[0] : this.finding.toArray(new Base[this.finding.size()]); // ClinicalImpressionFindingComponent + case -341328904: /*resolved*/ return this.resolved == null ? new Base[0] : this.resolved.toArray(new Base[this.resolved.size()]); // CodeableConcept + case 763913542: /*ruledOut*/ return this.ruledOut == null ? new Base[0] : this.ruledOut.toArray(new Base[this.ruledOut.size()]); // ClinicalImpressionRuledOutComponent + case -972050334: /*prognosis*/ return this.prognosis == null ? new Base[0] : new Base[] {this.prognosis}; // StringType + case 3443497: /*plan*/ return this.plan == null ? new Base[0] : this.plan.toArray(new Base[this.plan.size()]); // Reference + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -373213113: // assessor + this.assessor = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new ClinicalImpressionStatusEnumFactory().fromType(value); // Enumeration + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1273775369: // previous + this.previous = castToReference(value); // Reference + break; + case -309542241: // problem + this.getProblem().add(castToReference(value)); // Reference + break; + case -1059891784: // trigger + this.trigger = (Type) value; // Type + break; + case -428294735: // investigations + this.getInvestigations().add((ClinicalImpressionInvestigationsComponent) value); // ClinicalImpressionInvestigationsComponent + break; + case -989163880: // protocol + this.protocol = castToUri(value); // UriType + break; + case -1857640538: // summary + this.summary = castToString(value); // StringType + break; + case -853173367: // finding + this.getFinding().add((ClinicalImpressionFindingComponent) value); // ClinicalImpressionFindingComponent + break; + case -341328904: // resolved + this.getResolved().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 763913542: // ruledOut + this.getRuledOut().add((ClinicalImpressionRuledOutComponent) value); // ClinicalImpressionRuledOutComponent + break; + case -972050334: // prognosis + this.prognosis = castToString(value); // StringType + break; + case 3443497: // plan + this.getPlan().add(castToReference(value)); // Reference + break; + case -1422950858: // action + this.getAction().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("assessor")) + this.assessor = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new ClinicalImpressionStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("previous")) + this.previous = castToReference(value); // Reference + else if (name.equals("problem")) + this.getProblem().add(castToReference(value)); + else if (name.equals("trigger[x]")) + this.trigger = (Type) value; // Type + else if (name.equals("investigations")) + this.getInvestigations().add((ClinicalImpressionInvestigationsComponent) value); + else if (name.equals("protocol")) + this.protocol = castToUri(value); // UriType + else if (name.equals("summary")) + this.summary = castToString(value); // StringType + else if (name.equals("finding")) + this.getFinding().add((ClinicalImpressionFindingComponent) value); + else if (name.equals("resolved")) + this.getResolved().add(castToCodeableConcept(value)); + else if (name.equals("ruledOut")) + this.getRuledOut().add((ClinicalImpressionRuledOutComponent) value); + else if (name.equals("prognosis")) + this.prognosis = castToString(value); // StringType + else if (name.equals("plan")) + this.getPlan().add(castToReference(value)); + else if (name.equals("action")) + this.getAction().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -791418107: return getPatient(); // Reference + case -373213113: return getAssessor(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1273775369: return getPrevious(); // Reference + case -309542241: return addProblem(); // Reference + case 1363514312: return getTrigger(); // Type + case -428294735: return addInvestigations(); // ClinicalImpressionInvestigationsComponent + case -989163880: throw new FHIRException("Cannot make property protocol as it is not a complex type"); // UriType + case -1857640538: throw new FHIRException("Cannot make property summary as it is not a complex type"); // StringType + case -853173367: return addFinding(); // ClinicalImpressionFindingComponent + case -341328904: return addResolved(); // CodeableConcept + case 763913542: return addRuledOut(); // ClinicalImpressionRuledOutComponent + case -972050334: throw new FHIRException("Cannot make property prognosis as it is not a complex type"); // StringType + case 3443497: return addPlan(); // Reference + case -1422950858: return addAction(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("assessor")) { + this.assessor = new Reference(); + return this.assessor; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.status"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.description"); + } + else if (name.equals("previous")) { + this.previous = new Reference(); + return this.previous; + } + else if (name.equals("problem")) { + return addProblem(); + } + else if (name.equals("triggerCodeableConcept")) { + this.trigger = new CodeableConcept(); + return this.trigger; + } + else if (name.equals("triggerReference")) { + this.trigger = new Reference(); + return this.trigger; + } + else if (name.equals("investigations")) { + return addInvestigations(); + } + else if (name.equals("protocol")) { + throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.protocol"); + } + else if (name.equals("summary")) { + throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.summary"); + } + else if (name.equals("finding")) { + return addFinding(); + } + else if (name.equals("resolved")) { + return addResolved(); + } + else if (name.equals("ruledOut")) { + return addRuledOut(); + } + else if (name.equals("prognosis")) { + throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.prognosis"); + } + else if (name.equals("plan")) { + return addPlan(); + } + else if (name.equals("action")) { + return addAction(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ClinicalImpression"; + + } + + public ClinicalImpression copy() { + ClinicalImpression dst = new ClinicalImpression(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.assessor = assessor == null ? null : assessor.copy(); + dst.status = status == null ? null : status.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.trigger = trigger == null ? null : trigger.copy(); + if (investigations != null) { + dst.investigations = new ArrayList(); + for (ClinicalImpressionInvestigationsComponent i : investigations) + dst.investigations.add(i.copy()); + }; + dst.protocol = protocol == null ? null : protocol.copy(); + dst.summary = summary == null ? null : summary.copy(); + if (finding != null) { + dst.finding = new ArrayList(); + for (ClinicalImpressionFindingComponent i : finding) + dst.finding.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 (ClinicalImpressionRuledOutComponent i : ruledOut) + dst.ruledOut.add(i.copy()); + }; + dst.prognosis = prognosis == null ? null : prognosis.copy(); + if (plan != null) { + dst.plan = new ArrayList(); + for (Reference i : plan) + dst.plan.add(i.copy()); + }; + if (action != null) { + dst.action = new ArrayList(); + for (Reference i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + protected ClinicalImpression typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ClinicalImpression)) + return false; + ClinicalImpression o = (ClinicalImpression) other; + return compareDeep(patient, o.patient, true) && compareDeep(assessor, o.assessor, true) && compareDeep(status, o.status, true) + && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) && compareDeep(previous, o.previous, true) + && compareDeep(problem, o.problem, true) && compareDeep(trigger, o.trigger, true) && compareDeep(investigations, o.investigations, true) + && compareDeep(protocol, o.protocol, true) && compareDeep(summary, o.summary, true) && compareDeep(finding, o.finding, true) + && compareDeep(resolved, o.resolved, true) && compareDeep(ruledOut, o.ruledOut, true) && compareDeep(prognosis, o.prognosis, true) + && compareDeep(plan, o.plan, true) && compareDeep(action, o.action, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ClinicalImpression)) + return false; + ClinicalImpression o = (ClinicalImpression) other; + return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true) + && compareValues(protocol, o.protocol, true) && compareValues(summary, o.summary, true) && compareValues(prognosis, o.prognosis, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (assessor == null || assessor.isEmpty()) + && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) + && (previous == null || previous.isEmpty()) && (problem == null || problem.isEmpty()) && (trigger == null || trigger.isEmpty()) + && (investigations == null || investigations.isEmpty()) && (protocol == null || protocol.isEmpty()) + && (summary == null || summary.isEmpty()) && (finding == null || finding.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.ClinicalImpression; + } + + /** + * Search parameter: assessor + *

+ * Description: The clinician performing the assessment
+ * Type: reference
+ * Path: ClinicalImpression.assessor
+ *

+ */ + @SearchParamDefinition(name="assessor", path="ClinicalImpression.assessor", description="The clinician performing the assessment", type="reference" ) + public static final String SP_ASSESSOR = "assessor"; + /** + * Fluent Client search parameter constant for assessor + *

+ * Description: The clinician performing the assessment
+ * Type: reference
+ * Path: ClinicalImpression.assessor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ASSESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ASSESSOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClinicalImpression:assessor". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ASSESSOR = new ca.uhn.fhir.model.api.Include("ClinicalImpression:assessor").toLocked(); + + /** + * Search parameter: trigger + *

+ * Description: Request or event that necessitated this assessment
+ * Type: reference
+ * Path: ClinicalImpression.triggerReference
+ *

+ */ + @SearchParamDefinition(name="trigger", path="ClinicalImpression.trigger.as(Reference)", description="Request or event that necessitated this assessment", type="reference" ) + public static final String SP_TRIGGER = "trigger"; + /** + * Fluent Client search parameter constant for trigger + *

+ * Description: Request or event that necessitated this assessment
+ * Type: reference
+ * Path: ClinicalImpression.triggerReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TRIGGER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TRIGGER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClinicalImpression:trigger". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_TRIGGER = new ca.uhn.fhir.model.api.Include("ClinicalImpression:trigger").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The patient being assessed
+ * Type: reference
+ * Path: ClinicalImpression.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="ClinicalImpression.patient", description="The patient being assessed", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The patient being assessed
+ * Type: reference
+ * Path: ClinicalImpression.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClinicalImpression:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ClinicalImpression:patient").toLocked(); + + /** + * Search parameter: plan + *

+ * Description: Plan of action after assessment
+ * Type: reference
+ * Path: ClinicalImpression.plan
+ *

+ */ + @SearchParamDefinition(name="plan", path="ClinicalImpression.plan", description="Plan of action after assessment", type="reference" ) + public static final String SP_PLAN = "plan"; + /** + * Fluent Client search parameter constant for plan + *

+ * Description: Plan of action after assessment
+ * Type: reference
+ * Path: ClinicalImpression.plan
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PLAN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PLAN); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClinicalImpression:plan". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PLAN = new ca.uhn.fhir.model.api.Include("ClinicalImpression:plan").toLocked(); + + /** + * Search parameter: resolved + *

+ * Description: Diagnoses/conditions resolved since previous assessment
+ * Type: token
+ * Path: ClinicalImpression.resolved
+ *

+ */ + @SearchParamDefinition(name="resolved", path="ClinicalImpression.resolved", description="Diagnoses/conditions resolved since previous assessment", type="token" ) + public static final String SP_RESOLVED = "resolved"; + /** + * Fluent Client search parameter constant for resolved + *

+ * Description: Diagnoses/conditions resolved since previous assessment
+ * Type: token
+ * Path: ClinicalImpression.resolved
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESOLVED = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESOLVED); + + /** + * Search parameter: trigger-code + *

+ * Description: Request or event that necessitated this assessment
+ * Type: token
+ * Path: ClinicalImpression.triggerCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="trigger-code", path="ClinicalImpression.trigger.as(CodeableConcept)", description="Request or event that necessitated this assessment", type="token" ) + public static final String SP_TRIGGER_CODE = "trigger-code"; + /** + * Fluent Client search parameter constant for trigger-code + *

+ * Description: Request or event that necessitated this assessment
+ * Type: token
+ * Path: ClinicalImpression.triggerCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TRIGGER_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TRIGGER_CODE); + + /** + * Search parameter: previous + *

+ * Description: Reference to last assessment
+ * Type: reference
+ * Path: ClinicalImpression.previous
+ *

+ */ + @SearchParamDefinition(name="previous", path="ClinicalImpression.previous", description="Reference to last assessment", type="reference" ) + public static final String SP_PREVIOUS = "previous"; + /** + * Fluent Client search parameter constant for previous + *

+ * Description: Reference to last assessment
+ * Type: reference
+ * Path: ClinicalImpression.previous
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PREVIOUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PREVIOUS); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClinicalImpression:previous". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PREVIOUS = new ca.uhn.fhir.model.api.Include("ClinicalImpression:previous").toLocked(); + + /** + * Search parameter: status + *

+ * Description: in-progress | completed | entered-in-error
+ * Type: token
+ * Path: ClinicalImpression.status
+ *

+ */ + @SearchParamDefinition(name="status", path="ClinicalImpression.status", description="in-progress | completed | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: in-progress | completed | entered-in-error
+ * Type: token
+ * Path: ClinicalImpression.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: action + *

+ * Description: Actions taken during assessment
+ * Type: reference
+ * Path: ClinicalImpression.action
+ *

+ */ + @SearchParamDefinition(name="action", path="ClinicalImpression.action", description="Actions taken during assessment", type="reference" ) + public static final String SP_ACTION = "action"; + /** + * Fluent Client search parameter constant for action + *

+ * Description: Actions taken during assessment
+ * Type: reference
+ * Path: ClinicalImpression.action
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClinicalImpression:action". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTION = new ca.uhn.fhir.model.api.Include("ClinicalImpression:action").toLocked(); + + /** + * Search parameter: finding + *

+ * Description: Specific text or code for finding
+ * Type: token
+ * Path: ClinicalImpression.finding.item
+ *

+ */ + @SearchParamDefinition(name="finding", path="ClinicalImpression.finding.item", description="Specific text or code for finding", type="token" ) + public static final String SP_FINDING = "finding"; + /** + * Fluent Client search parameter constant for finding + *

+ * Description: Specific text or code for finding
+ * Type: token
+ * Path: ClinicalImpression.finding.item
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FINDING = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FINDING); + + /** + * Search parameter: investigation + *

+ * Description: Record of a specific investigation
+ * Type: reference
+ * Path: ClinicalImpression.investigations.item
+ *

+ */ + @SearchParamDefinition(name="investigation", path="ClinicalImpression.investigations.item", description="Record of a specific investigation", type="reference" ) + public static final String SP_INVESTIGATION = "investigation"; + /** + * Fluent Client search parameter constant for investigation + *

+ * Description: Record of a specific investigation
+ * Type: reference
+ * Path: ClinicalImpression.investigations.item
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INVESTIGATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INVESTIGATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClinicalImpression:investigation". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INVESTIGATION = new ca.uhn.fhir.model.api.Include("ClinicalImpression:investigation").toLocked(); + + /** + * Search parameter: problem + *

+ * Description: General assessment of patient state
+ * Type: reference
+ * Path: ClinicalImpression.problem
+ *

+ */ + @SearchParamDefinition(name="problem", path="ClinicalImpression.problem", description="General assessment of patient state", type="reference" ) + public static final String SP_PROBLEM = "problem"; + /** + * Fluent Client search parameter constant for problem + *

+ * Description: General assessment of patient state
+ * Type: reference
+ * Path: ClinicalImpression.problem
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROBLEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROBLEM); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClinicalImpression:problem". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROBLEM = new ca.uhn.fhir.model.api.Include("ClinicalImpression:problem").toLocked(); + + /** + * Search parameter: date + *

+ * Description: When the assessment occurred
+ * Type: date
+ * Path: ClinicalImpression.date
+ *

+ */ + @SearchParamDefinition(name="date", path="ClinicalImpression.date", description="When the assessment occurred", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When the assessment occurred
+ * Type: date
+ * Path: ClinicalImpression.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: ruledout + *

+ * Description: Specific text of code for diagnosis
+ * Type: token
+ * Path: ClinicalImpression.ruledOut.item
+ *

+ */ + @SearchParamDefinition(name="ruledout", path="ClinicalImpression.ruledOut.item", description="Specific text of code for diagnosis", type="token" ) + public static final String SP_RULEDOUT = "ruledout"; + /** + * Fluent Client search parameter constant for ruledout + *

+ * Description: Specific text of code for diagnosis
+ * Type: token
+ * Path: ClinicalImpression.ruledOut.item
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RULEDOUT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RULEDOUT); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeSystem.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeSystem.java new file mode 100644 index 00000000000..d00bca3d9db --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeSystem.java @@ -0,0 +1,4082 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A code system resource specifies a set of codes drawn from one or more code systems. + */ +@ResourceDef(name="CodeSystem", profile="http://hl7.org/fhir/Profile/CodeSystem") +public class CodeSystem extends DomainResource { + + public enum CodeSystemContentMode { + /** + * None of the concepts defined by the code system are included in the code system resource + */ + NOTPRESENT, + /** + * A few representative concepts are included in the code system resource + */ + EXAMPLAR, + /** + * A subset of the code system concepts are included in the code system resource + */ + FRAGMENT, + /** + * All the concepts defined by the code system are included in the code system resource + */ + COMPLETE, + /** + * added to help the parsers + */ + NULL; + public static CodeSystemContentMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("not-present".equals(codeString)) + return NOTPRESENT; + if ("examplar".equals(codeString)) + return EXAMPLAR; + if ("fragment".equals(codeString)) + return FRAGMENT; + if ("complete".equals(codeString)) + return COMPLETE; + throw new FHIRException("Unknown CodeSystemContentMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NOTPRESENT: return "not-present"; + case EXAMPLAR: return "examplar"; + case FRAGMENT: return "fragment"; + case COMPLETE: return "complete"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTPRESENT: return "http://hl7.org/fhir/codesystem-content-mode"; + case EXAMPLAR: return "http://hl7.org/fhir/codesystem-content-mode"; + case FRAGMENT: return "http://hl7.org/fhir/codesystem-content-mode"; + case COMPLETE: return "http://hl7.org/fhir/codesystem-content-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTPRESENT: return "None of the concepts defined by the code system are included in the code system resource"; + case EXAMPLAR: return "A few representative concepts are included in the code system resource"; + case FRAGMENT: return "A subset of the code system concepts are included in the code system resource"; + case COMPLETE: return "All the concepts defined by the code system are included in the code system resource"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTPRESENT: return "Not Present"; + case EXAMPLAR: return "Examplar"; + case FRAGMENT: return "Fragment"; + case COMPLETE: return "Complete"; + default: return "?"; + } + } + } + + public static class CodeSystemContentModeEnumFactory implements EnumFactory { + public CodeSystemContentMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-present".equals(codeString)) + return CodeSystemContentMode.NOTPRESENT; + if ("examplar".equals(codeString)) + return CodeSystemContentMode.EXAMPLAR; + if ("fragment".equals(codeString)) + return CodeSystemContentMode.FRAGMENT; + if ("complete".equals(codeString)) + return CodeSystemContentMode.COMPLETE; + throw new IllegalArgumentException("Unknown CodeSystemContentMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("not-present".equals(codeString)) + return new Enumeration(this, CodeSystemContentMode.NOTPRESENT); + if ("examplar".equals(codeString)) + return new Enumeration(this, CodeSystemContentMode.EXAMPLAR); + if ("fragment".equals(codeString)) + return new Enumeration(this, CodeSystemContentMode.FRAGMENT); + if ("complete".equals(codeString)) + return new Enumeration(this, CodeSystemContentMode.COMPLETE); + throw new FHIRException("Unknown CodeSystemContentMode code '"+codeString+"'"); + } + public String toCode(CodeSystemContentMode code) { + if (code == CodeSystemContentMode.NOTPRESENT) + return "not-present"; + if (code == CodeSystemContentMode.EXAMPLAR) + return "examplar"; + if (code == CodeSystemContentMode.FRAGMENT) + return "fragment"; + if (code == CodeSystemContentMode.COMPLETE) + return "complete"; + return "?"; + } + public String toSystem(CodeSystemContentMode code) { + return code.getSystem(); + } + } + + public enum PropertyType { + /** + * The property value is a code that identifies a concept defined in the code system + */ + CODE, + /** + * The property value is a code defined in an external code system. This may be used for translations, but is not the intent + */ + CODING, + /** + * The property value is a string + */ + STRING, + /** + * The property value is a string (often used to assign ranking values to concepts for supporting score assessments) + */ + INTEGER, + /** + * The property value is a boolean true | false + */ + BOOLEAN, + /** + * The property is a date or a date + time + */ + DATETIME, + /** + * added to help the parsers + */ + NULL; + public static PropertyType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("code".equals(codeString)) + return CODE; + if ("Coding".equals(codeString)) + return CODING; + if ("string".equals(codeString)) + return STRING; + if ("integer".equals(codeString)) + return INTEGER; + if ("boolean".equals(codeString)) + return BOOLEAN; + if ("dateTime".equals(codeString)) + return DATETIME; + throw new FHIRException("Unknown PropertyType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CODE: return "code"; + case CODING: return "Coding"; + case STRING: return "string"; + case INTEGER: return "integer"; + case BOOLEAN: return "boolean"; + case DATETIME: return "dateTime"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CODE: return "http://hl7.org/fhir/concept-property-type"; + case CODING: return "http://hl7.org/fhir/concept-property-type"; + case STRING: return "http://hl7.org/fhir/concept-property-type"; + case INTEGER: return "http://hl7.org/fhir/concept-property-type"; + case BOOLEAN: return "http://hl7.org/fhir/concept-property-type"; + case DATETIME: return "http://hl7.org/fhir/concept-property-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CODE: return "The property value is a code that identifies a concept defined in the code system"; + case CODING: return "The property value is a code defined in an external code system. This may be used for translations, but is not the intent"; + case STRING: return "The property value is a string"; + case INTEGER: return "The property value is a string (often used to assign ranking values to concepts for supporting score assessments)"; + case BOOLEAN: return "The property value is a boolean true | false"; + case DATETIME: return "The property is a date or a date + time"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CODE: return "code (internal reference)"; + case CODING: return "Coding (external reference)"; + case STRING: return "string"; + case INTEGER: return "integer"; + case BOOLEAN: return "boolean"; + case DATETIME: return "dateTime"; + default: return "?"; + } + } + } + + public static class PropertyTypeEnumFactory implements EnumFactory { + public PropertyType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("code".equals(codeString)) + return PropertyType.CODE; + if ("Coding".equals(codeString)) + return PropertyType.CODING; + if ("string".equals(codeString)) + return PropertyType.STRING; + if ("integer".equals(codeString)) + return PropertyType.INTEGER; + if ("boolean".equals(codeString)) + return PropertyType.BOOLEAN; + if ("dateTime".equals(codeString)) + return PropertyType.DATETIME; + throw new IllegalArgumentException("Unknown PropertyType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("code".equals(codeString)) + return new Enumeration(this, PropertyType.CODE); + if ("Coding".equals(codeString)) + return new Enumeration(this, PropertyType.CODING); + if ("string".equals(codeString)) + return new Enumeration(this, PropertyType.STRING); + if ("integer".equals(codeString)) + return new Enumeration(this, PropertyType.INTEGER); + if ("boolean".equals(codeString)) + return new Enumeration(this, PropertyType.BOOLEAN); + if ("dateTime".equals(codeString)) + return new Enumeration(this, PropertyType.DATETIME); + throw new FHIRException("Unknown PropertyType code '"+codeString+"'"); + } + public String toCode(PropertyType code) { + if (code == PropertyType.CODE) + return "code"; + if (code == PropertyType.CODING) + return "Coding"; + if (code == PropertyType.STRING) + return "string"; + if (code == PropertyType.INTEGER) + return "integer"; + if (code == PropertyType.BOOLEAN) + return "boolean"; + if (code == PropertyType.DATETIME) + return "dateTime"; + return "?"; + } + public String toSystem(PropertyType code) { + return code.getSystem(); + } + } + + @Block() + public static class CodeSystemContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the code system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the code system." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public CodeSystemContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the code system.). 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 CodeSystemContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public CodeSystemContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the code system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the code system. + */ + public CodeSystemContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public CodeSystemContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the code system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public CodeSystemContactComponent copy() { + CodeSystemContactComponent dst = new CodeSystemContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeSystemContactComponent)) + return false; + CodeSystemContactComponent o = (CodeSystemContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeSystemContactComponent)) + return false; + CodeSystemContactComponent o = (CodeSystemContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "CodeSystem.contact"; + + } + + } + + @Block() + public static class CodeSystemFilterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The code that identifies thise filter when it is used in the instance. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Code that identifies the filter", formalDefinition="The code that identifies thise filter when it is used in the instance." ) + protected CodeType code; + + /** + * A description of how or why the filter is used. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How or why the filter is used", formalDefinition="A description of how or why the filter is used." ) + protected StringType description; + + /** + * A list of operators that can be used with the filter. + */ + @Child(name = "operator", type = {CodeType.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Operators that can be used with filter", formalDefinition="A list of operators that can be used with the filter." ) + protected List operator; + + /** + * A description of what the value for the filter should be. + */ + @Child(name = "value", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What to use for the value", formalDefinition="A description of what the value for the filter should be." ) + protected StringType value; + + private static final long serialVersionUID = 20272432L; + + /** + * Constructor + */ + public CodeSystemFilterComponent() { + super(); + } + + /** + * Constructor + */ + public CodeSystemFilterComponent(CodeType code, StringType value) { + super(); + this.code = code; + this.value = value; + } + + /** + * @return {@link #code} (The code that identifies thise filter when it is used in the instance.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystemFilterComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The code that identifies thise filter when it is used in the instance.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeSystemFilterComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return The code that identifies thise filter when it is used in the instance. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The code that identifies thise filter when it is used in the instance. + */ + public CodeSystemFilterComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #description} (A description of how or why the filter is used.). 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 CodeSystemFilterComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of how or why the filter is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public CodeSystemFilterComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of how or why the filter is used. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of how or why the filter is used. + */ + public CodeSystemFilterComponent 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 #operator} (A list of operators that can be used with the filter.) + */ + public List getOperator() { + if (this.operator == null) + this.operator = new ArrayList(); + return this.operator; + } + + public boolean hasOperator() { + if (this.operator == null) + return false; + for (CodeType item : this.operator) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operator} (A list of operators that can be used with the filter.) + */ + // syntactic sugar + public CodeType addOperatorElement() {//2 + CodeType t = new CodeType(); + if (this.operator == null) + this.operator = new ArrayList(); + this.operator.add(t); + return t; + } + + /** + * @param value {@link #operator} (A list of operators that can be used with the filter.) + */ + public CodeSystemFilterComponent addOperator(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.operator == null) + this.operator = new ArrayList(); + this.operator.add(t); + return this; + } + + /** + * @param value {@link #operator} (A list of operators that can be used with the filter.) + */ + public boolean hasOperator(String value) { + if (this.operator == null) + return false; + for (CodeType v : this.operator) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #value} (A description of what the value for the filter should be.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystemFilterComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A description of what the value for the filter should be.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public CodeSystemFilterComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return A description of what the value for the filter should be. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A description of what the value for the filter should be. + */ + public CodeSystemFilterComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "The code that identifies thise filter when it is used in the instance.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("description", "string", "A description of how or why the filter is used.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("operator", "code", "A list of operators that can be used with the filter.", 0, java.lang.Integer.MAX_VALUE, operator)); + childrenList.add(new Property("value", "string", "A description of what the value for the filter should be.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -500553564: /*operator*/ return this.operator == null ? new Base[0] : this.operator.toArray(new Base[this.operator.size()]); // CodeType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -500553564: // operator + this.getOperator().add(castToCode(value)); // CodeType + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("operator")) + this.getOperator().add(castToCode(value)); + else if (name.equals("value")) + this.value = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -500553564: throw new FHIRException("Cannot make property operator as it is not a complex type"); // CodeType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description"); + } + else if (name.equals("operator")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.operator"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.value"); + } + else + return super.addChild(name); + } + + public CodeSystemFilterComponent copy() { + CodeSystemFilterComponent dst = new CodeSystemFilterComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.description = description == null ? null : description.copy(); + if (operator != null) { + dst.operator = new ArrayList(); + for (CodeType i : operator) + dst.operator.add(i.copy()); + }; + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeSystemFilterComponent)) + return false; + CodeSystemFilterComponent o = (CodeSystemFilterComponent) other; + return compareDeep(code, o.code, true) && compareDeep(description, o.description, true) && compareDeep(operator, o.operator, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeSystemFilterComponent)) + return false; + CodeSystemFilterComponent o = (CodeSystemFilterComponent) other; + return compareValues(code, o.code, true) && compareValues(description, o.description, true) && compareValues(operator, o.operator, true) + && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (description == null || description.isEmpty()) + && (operator == null || operator.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "CodeSystem.filter"; + + } + + } + + @Block() + public static class CodeSystemPropertyComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifies the property, both internally and externally", formalDefinition="A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters." ) + protected CodeType code; + + /** + * A description of the property- why it is defined, and how it's value might be used. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why the property is defined, and/or what it conveys", formalDefinition="A description of the property- why it is defined, and how it's value might be used." ) + protected StringType description; + + /** + * The type of the property value. + */ + @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="code | Coding | string | integer | boolean | dateTime", formalDefinition="The type of the property value." ) + protected Enumeration type; + + private static final long serialVersionUID = -1346176181L; + + /** + * Constructor + */ + public CodeSystemPropertyComponent() { + super(); + } + + /** + * Constructor + */ + public CodeSystemPropertyComponent(CodeType code, Enumeration type) { + super(); + this.code = code; + this.type = type; + } + + /** + * @return {@link #code} (A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystemPropertyComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeSystemPropertyComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters. + */ + public CodeSystemPropertyComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #description} (A description of the property- why it is defined, and how it's value might be used.). 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 CodeSystemPropertyComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of the property- why it is defined, and how it's value might be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public CodeSystemPropertyComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the property- why it is defined, and how it's value might be used. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the property- why it is defined, and how it's value might be used. + */ + public CodeSystemPropertyComponent 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 #type} (The type of the property value.). 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 CodeSystemPropertyComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new PropertyTypeEnumFactory()); // bb + 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 of the property value.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public CodeSystemPropertyComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of the property value. + */ + public PropertyType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the property value. + */ + public CodeSystemPropertyComponent setType(PropertyType value) { + if (this.type == null) + this.type = new Enumeration(new PropertyTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("description", "string", "A description of the property- why it is defined, and how it's value might be used.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("type", "code", "The type of the property value.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 3575610: // type + this.type = new PropertyTypeEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("type")) + this.type = new PropertyTypeEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.type"); + } + else + return super.addChild(name); + } + + public CodeSystemPropertyComponent copy() { + CodeSystemPropertyComponent dst = new CodeSystemPropertyComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.description = description == null ? null : description.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeSystemPropertyComponent)) + return false; + CodeSystemPropertyComponent o = (CodeSystemPropertyComponent) other; + return compareDeep(code, o.code, true) && compareDeep(description, o.description, true) && compareDeep(type, o.type, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeSystemPropertyComponent)) + return false; + CodeSystemPropertyComponent o = (CodeSystemPropertyComponent) other; + return compareValues(code, o.code, true) && compareValues(description, o.description, true) && compareValues(type, o.type, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (description == null || description.isEmpty()) + && (type == null || type.isEmpty()); + } + + public String fhirType() { + return "CodeSystem.property"; + + } + + } + + @Block() + public static class ConceptDefinitionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code - a text symbol - that uniquely identifies the concept within the code system. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code that identifies concept", formalDefinition="A code - a text symbol - that uniquely identifies the concept within the code system." ) + protected CodeType code; + + /** + * A human readable string that is the recommended default way to present this concept to a user. + */ + @Child(name = "display", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Text to display to the user", formalDefinition="A human readable string that is the recommended default way to present this concept to a user." ) + protected StringType display; + + /** + * The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + @Child(name = "definition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Formal definition", formalDefinition="The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept." ) + protected StringType definition; + + /** + * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc. + */ + @Child(name = "designation", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional representations for the concept", formalDefinition="Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc." ) + protected List designation; + + /** + * A property value for this concept. + */ + @Child(name = "property", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Property value for the concept", formalDefinition="A property value for this concept." ) + protected List property; + + /** + * Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts. + */ + @Child(name = "concept", type = {ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Child Concepts (is-a/contains/categorizes)", formalDefinition="Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts." ) + protected List concept; + + private static final long serialVersionUID = 1495076297L; + + /** + * Constructor + */ + public ConceptDefinitionComponent() { + super(); + } + + /** + * Constructor + */ + public ConceptDefinitionComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A code - a text symbol - that uniquely identifies the concept within the code system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code - a text symbol - that uniquely identifies the concept within the code system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptDefinitionComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A code - a text symbol - that uniquely identifies the concept within the code system. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A code - a text symbol - that uniquely identifies the concept within the code system. + */ + public ConceptDefinitionComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #display} (A human readable string that is the recommended default way to present this concept to a user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (A human readable string that is the recommended default way to present this concept to a user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ConceptDefinitionComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return A human readable string that is the recommended default way to present this concept to a user. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value A human readable string that is the recommended default way to present this concept to a user. + */ + public ConceptDefinitionComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #definition} (The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public StringType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new StringType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public ConceptDefinitionComponent setDefinitionElement(StringType value) { + this.definition = value; + return this; + } + + /** + * @return The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + public ConceptDefinitionComponent setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new StringType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.) + */ + public List getDesignation() { + if (this.designation == null) + this.designation = new ArrayList(); + return this.designation; + } + + public boolean hasDesignation() { + if (this.designation == null) + return false; + for (ConceptDefinitionDesignationComponent item : this.designation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.) + */ + // syntactic sugar + public ConceptDefinitionDesignationComponent addDesignation() { //3 + ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return t; + } + + // syntactic sugar + public ConceptDefinitionComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3 + if (t == null) + return this; + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return this; + } + + /** + * @return {@link #property} (A property value for this concept.) + */ + public List getProperty() { + if (this.property == null) + this.property = new ArrayList(); + return this.property; + } + + public boolean hasProperty() { + if (this.property == null) + return false; + for (ConceptDefinitionPropertyComponent item : this.property) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #property} (A property value for this concept.) + */ + // syntactic sugar + public ConceptDefinitionPropertyComponent addProperty() { //3 + ConceptDefinitionPropertyComponent t = new ConceptDefinitionPropertyComponent(); + if (this.property == null) + this.property = new ArrayList(); + this.property.add(t); + return t; + } + + // syntactic sugar + public ConceptDefinitionComponent addProperty(ConceptDefinitionPropertyComponent t) { //3 + if (t == null) + return this; + if (this.property == null) + this.property = new ArrayList(); + this.property.add(t); + return this; + } + + /** + * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptDefinitionComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.) + */ + // syntactic sugar + public ConceptDefinitionComponent addConcept() { //3 + ConceptDefinitionComponent t = new ConceptDefinitionComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public ConceptDefinitionComponent addConcept(ConceptDefinitionComponent t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "A code - a text symbol - that uniquely identifies the concept within the code system.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "A human readable string that is the recommended default way to present this concept to a user.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("definition", "string", "The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); + childrenList.add(new Property("property", "", "A property value for this concept.", 0, java.lang.Integer.MAX_VALUE, property)); + childrenList.add(new Property("concept", "@CodeSystem.concept", "Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.", 0, java.lang.Integer.MAX_VALUE, concept)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // StringType + case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // ConceptDefinitionDesignationComponent + case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // ConceptDefinitionPropertyComponent + case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptDefinitionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case 1671764162: // display + this.display = castToString(value); // StringType + break; + case -1014418093: // definition + this.definition = castToString(value); // StringType + break; + case -900931593: // designation + this.getDesignation().add((ConceptDefinitionDesignationComponent) value); // ConceptDefinitionDesignationComponent + break; + case -993141291: // property + this.getProperty().add((ConceptDefinitionPropertyComponent) value); // ConceptDefinitionPropertyComponent + break; + case 951024232: // concept + this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("display")) + this.display = castToString(value); // StringType + else if (name.equals("definition")) + this.definition = castToString(value); // StringType + else if (name.equals("designation")) + this.getDesignation().add((ConceptDefinitionDesignationComponent) value); + else if (name.equals("property")) + this.getProperty().add((ConceptDefinitionPropertyComponent) value); + else if (name.equals("concept")) + this.getConcept().add((ConceptDefinitionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType + case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // StringType + case -900931593: return addDesignation(); // ConceptDefinitionDesignationComponent + case -993141291: return addProperty(); // ConceptDefinitionPropertyComponent + case 951024232: return addConcept(); // ConceptDefinitionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code"); + } + else if (name.equals("display")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.display"); + } + else if (name.equals("definition")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.definition"); + } + else if (name.equals("designation")) { + return addDesignation(); + } + else if (name.equals("property")) { + return addProperty(); + } + else if (name.equals("concept")) { + return addConcept(); + } + else + return super.addChild(name); + } + + public ConceptDefinitionComponent copy() { + ConceptDefinitionComponent dst = new ConceptDefinitionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + dst.definition = definition == null ? null : definition.copy(); + if (designation != null) { + dst.designation = new ArrayList(); + for (ConceptDefinitionDesignationComponent i : designation) + dst.designation.add(i.copy()); + }; + if (property != null) { + dst.property = new ArrayList(); + for (ConceptDefinitionPropertyComponent i : property) + dst.property.add(i.copy()); + }; + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptDefinitionComponent i : concept) + dst.concept.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptDefinitionComponent)) + return false; + ConceptDefinitionComponent o = (ConceptDefinitionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(definition, o.definition, true) + && compareDeep(designation, o.designation, true) && compareDeep(property, o.property, true) && compareDeep(concept, o.concept, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptDefinitionComponent)) + return false; + ConceptDefinitionComponent o = (ConceptDefinitionComponent) other; + return compareValues(code, o.code, true) && compareValues(display, o.display, true) && compareValues(definition, o.definition, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) + && (definition == null || definition.isEmpty()) && (designation == null || designation.isEmpty()) + && (property == null || property.isEmpty()) && (concept == null || concept.isEmpty()); + } + + public String fhirType() { + return "CodeSystem.concept"; + + } + + } + + @Block() + public static class ConceptDefinitionDesignationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The language this designation is defined for. + */ + @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Human language of the designation", formalDefinition="The language this designation is defined for." ) + protected CodeType language; + + /** + * A code that details how this designation would be used. + */ + @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." ) + protected Coding use; + + /** + * The text value for this designation. + */ + @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." ) + protected StringType value; + + private static final long serialVersionUID = 1515662414L; + + /** + * Constructor + */ + public ConceptDefinitionDesignationComponent() { + super(); + } + + /** + * Constructor + */ + public ConceptDefinitionDesignationComponent(StringType value) { + super(); + this.value = value; + } + + /** + * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The language this designation is defined for. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The language this designation is defined for. + */ + public ConceptDefinitionDesignationComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (A code that details how this designation would be used.) + */ + public Coding getUse() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Coding(); // cc + return this.use; + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (A code that details how this designation would be used.) + */ + public ConceptDefinitionDesignationComponent setUse(Coding value) { + this.use = value; + return this; + } + + /** + * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ConceptDefinitionDesignationComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The text value for this designation. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The text value for this designation. + */ + public ConceptDefinitionDesignationComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1613589672: // language + this.language = castToCode(value); // CodeType + break; + case 116103: // use + this.use = castToCoding(value); // Coding + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("language")) + this.language = castToCode(value); // CodeType + else if (name.equals("use")) + this.use = castToCoding(value); // Coding + else if (name.equals("value")) + this.value = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType + case 116103: return getUse(); // Coding + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("language")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.language"); + } + else if (name.equals("use")) { + this.use = new Coding(); + return this.use; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.value"); + } + else + return super.addChild(name); + } + + public ConceptDefinitionDesignationComponent copy() { + ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent(); + copyValues(dst); + dst.language = language == null ? null : language.copy(); + dst.use = use == null ? null : use.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptDefinitionDesignationComponent)) + return false; + ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other; + return compareDeep(language, o.language, true) && compareDeep(use, o.use, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptDefinitionDesignationComponent)) + return false; + ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other; + return compareValues(language, o.language, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) + && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "CodeSystem.concept.designation"; + + } + + } + + @Block() + public static class ConceptDefinitionPropertyComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code that is a reference to CodeSystem.property.code. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reference to CodeSystem.property.code", formalDefinition="A code that is a reference to CodeSystem.property.code." ) + protected CodeType code; + + /** + * The value of this property. + */ + @Child(name = "value", type = {CodeType.class, Coding.class, StringType.class, IntegerType.class, BooleanType.class, DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Value of the property for this concept", formalDefinition="The value of this property." ) + protected Type value; + + private static final long serialVersionUID = 1742812311L; + + /** + * Constructor + */ + public ConceptDefinitionPropertyComponent() { + super(); + } + + /** + * Constructor + */ + public ConceptDefinitionPropertyComponent(CodeType code, Type value) { + super(); + this.code = code; + this.value = value; + } + + /** + * @return {@link #code} (A code that is a reference to CodeSystem.property.code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionPropertyComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code that is a reference to CodeSystem.property.code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptDefinitionPropertyComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A code that is a reference to CodeSystem.property.code. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A code that is a reference to CodeSystem.property.code. + */ + public ConceptDefinitionPropertyComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of this property.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The value of this property.) + */ + public CodeType getValueCodeType() throws FHIRException { + if (!(this.value instanceof CodeType)) + throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeType) this.value; + } + + public boolean hasValueCodeType() { + return this.value instanceof CodeType; + } + + /** + * @return {@link #value} (The value of this property.) + */ + public Coding getValueCoding() throws FHIRException { + if (!(this.value instanceof Coding)) + throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Coding) this.value; + } + + public boolean hasValueCoding() { + return this.value instanceof Coding; + } + + /** + * @return {@link #value} (The value of this property.) + */ + public StringType getValueStringType() throws FHIRException { + if (!(this.value instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + public boolean hasValueStringType() { + return this.value instanceof StringType; + } + + /** + * @return {@link #value} (The value of this property.) + */ + public IntegerType getValueIntegerType() throws FHIRException { + if (!(this.value instanceof IntegerType)) + throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IntegerType) this.value; + } + + public boolean hasValueIntegerType() { + return this.value instanceof IntegerType; + } + + /** + * @return {@link #value} (The value of this property.) + */ + public BooleanType getValueBooleanType() throws FHIRException { + if (!(this.value instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + public boolean hasValueBooleanType() { + return this.value instanceof BooleanType; + } + + /** + * @return {@link #value} (The value of this property.) + */ + public DateTimeType getValueDateTimeType() throws FHIRException { + if (!(this.value instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + public boolean hasValueDateTimeType() { + return this.value instanceof DateTimeType; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of this property.) + */ + public ConceptDefinitionPropertyComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "A code that is a reference to CodeSystem.property.code.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value[x]", "code|Coding|string|integer|boolean|dateTime", "The value of this property.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case 111972721: // value + this.value = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("value[x]")) + this.value = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case -1410166417: return getValue(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code"); + } + else if (name.equals("valueCode")) { + this.value = new CodeType(); + return this.value; + } + else if (name.equals("valueCoding")) { + this.value = new Coding(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else + return super.addChild(name); + } + + public ConceptDefinitionPropertyComponent copy() { + ConceptDefinitionPropertyComponent dst = new ConceptDefinitionPropertyComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptDefinitionPropertyComponent)) + return false; + ConceptDefinitionPropertyComponent o = (ConceptDefinitionPropertyComponent) other; + return compareDeep(code, o.code, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptDefinitionPropertyComponent)) + return false; + ConceptDefinitionPropertyComponent o = (ConceptDefinitionPropertyComponent) other; + return compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "CodeSystem.concept.property"; + + } + + } + + /** + * An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Globally unique logical identifier for code system (Coding.system)", formalDefinition="An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional identifier for the code system (e.g. HL7 v2 / CDA)", formalDefinition="Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance." ) + protected Identifier identifier; + + /** + * Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical identifier for this version (Coding.version)", formalDefinition="Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version." ) + protected StringType version; + + /** + * A free text natural language name describing the code system. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this code system", formalDefinition="A free text natural language name describing the code system." ) + protected StringType name; + + /** + * The status of the code system. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the code system." ) + protected Enumeration status; + + /** + * This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the code system. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the code system." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). + */ + @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for given status", formalDefinition="The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition')." ) + protected DateTimeType date; + + /** + * A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system. + */ + @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human language description of the code system", formalDefinition="A free text natural language description of the use of the code system - reason for definition, \"the semantic space\" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions." ) + protected List useContext; + + /** + * Explains why this code system is needed and why it has been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why needed", formalDefinition="Explains why this code system is needed and why it has been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system. + */ + @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system." ) + protected StringType copyright; + + /** + * If code comparison is case sensitive when codes within this system are compared to each other. + */ + @Child(name = "caseSensitive", type = {BooleanType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If code comparison is case sensitive", formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other." ) + protected BooleanType caseSensitive; + + /** + * Canonical URL of value set that contains the entire code system. + */ + @Child(name = "valueSet", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Canonical URL for value set with entire code system", formalDefinition="Canonical URL of value set that contains the entire code system." ) + protected UriType valueSet; + + /** + * True If code system defines a post-composition grammar. + */ + @Child(name = "compositional", type = {BooleanType.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If code system defines a post-composition grammar", formalDefinition="True If code system defines a post-composition grammar." ) + protected BooleanType compositional; + + /** + * This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system. + */ + @Child(name = "versionNeeded", type = {BooleanType.class}, order=16, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If definitions are not stable", formalDefinition="This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system." ) + protected BooleanType versionNeeded; + + /** + * How much of the content of the code system - the concepts and codes it defines - are represented in this resource. + */ + @Child(name = "content", type = {CodeType.class}, order=17, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="not-present | examplar | fragment | complete", formalDefinition="How much of the content of the code system - the concepts and codes it defines - are represented in this resource." ) + protected Enumeration content; + + /** + * The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts. + */ + @Child(name = "count", type = {UnsignedIntType.class}, order=18, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total concepts in the code system", formalDefinition="The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts." ) + protected UnsignedIntType count; + + /** + * A filter that can be used in a value set compose statement when selecting concepts using a filter. + */ + @Child(name = "filter", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Filter that can be used in a value set", formalDefinition="A filter that can be used in a value set compose statement when selecting concepts using a filter." ) + protected List filter; + + /** + * A property defines an additional slot through which additional information can be provided about a concept. + */ + @Child(name = "property", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Additional information supplied about each concept", formalDefinition="A property defines an additional slot through which additional information can be provided about a concept." ) + protected List property; + + /** + * Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are. + */ + @Child(name = "concept", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Concepts in the code system", formalDefinition="Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are." ) + protected List concept; + + private static final long serialVersionUID = 1466696062L; + + /** + * Constructor + */ + public CodeSystem() { + super(); + } + + /** + * Constructor + */ + public CodeSystem(Enumeration status, Enumeration content) { + super(); + this.status = status; + this.content = content; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public CodeSystem setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system. + */ + public CodeSystem setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public CodeSystem setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #version} (Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public CodeSystem setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version. + */ + public CodeSystem setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name describing the code system.). 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 CodeSystem.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name describing the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public CodeSystem setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name describing the code system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name describing the code system. + */ + public CodeSystem setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the code system.). 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 CodeSystem.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 code system.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CodeSystem setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the code system. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the code system. + */ + public CodeSystem setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public CodeSystem setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public CodeSystem setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the code system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the code system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public CodeSystem setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the code system. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the code system. + */ + public CodeSystem setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (CodeSystemContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public CodeSystemContactComponent addContact() { //3 + CodeSystemContactComponent t = new CodeSystemContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public CodeSystem addContact(CodeSystemContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). 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 CodeSystem.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public CodeSystem setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). + */ + public CodeSystem setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system.). 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 CodeSystem.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public CodeSystem setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system. + */ + public CodeSystem 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public CodeSystem addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #requirements} (Explains why this code system is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this code system is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public CodeSystem setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this code system is needed and why it has been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this code system is needed and why it has been constrained as it has. + */ + public CodeSystem setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public CodeSystem setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system. + */ + public CodeSystem setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value + */ + public BooleanType getCaseSensitiveElement() { + if (this.caseSensitive == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.caseSensitive"); + else if (Configuration.doAutoCreate()) + this.caseSensitive = new BooleanType(); // bb + return this.caseSensitive; + } + + public boolean hasCaseSensitiveElement() { + return this.caseSensitive != null && !this.caseSensitive.isEmpty(); + } + + public boolean hasCaseSensitive() { + return this.caseSensitive != null && !this.caseSensitive.isEmpty(); + } + + /** + * @param value {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value + */ + public CodeSystem setCaseSensitiveElement(BooleanType value) { + this.caseSensitive = value; + return this; + } + + /** + * @return If code comparison is case sensitive when codes within this system are compared to each other. + */ + public boolean getCaseSensitive() { + return this.caseSensitive == null || this.caseSensitive.isEmpty() ? false : this.caseSensitive.getValue(); + } + + /** + * @param value If code comparison is case sensitive when codes within this system are compared to each other. + */ + public CodeSystem setCaseSensitive(boolean value) { + if (this.caseSensitive == null) + this.caseSensitive = new BooleanType(); + this.caseSensitive.setValue(value); + return this; + } + + /** + * @return {@link #valueSet} (Canonical URL of value set that contains the entire code system.). This is the underlying object with id, value and extensions. The accessor "getValueSet" gives direct access to the value + */ + public UriType getValueSetElement() { + if (this.valueSet == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.valueSet"); + else if (Configuration.doAutoCreate()) + this.valueSet = new UriType(); // bb + return this.valueSet; + } + + public boolean hasValueSetElement() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + public boolean hasValueSet() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + /** + * @param value {@link #valueSet} (Canonical URL of value set that contains the entire code system.). This is the underlying object with id, value and extensions. The accessor "getValueSet" gives direct access to the value + */ + public CodeSystem setValueSetElement(UriType value) { + this.valueSet = value; + return this; + } + + /** + * @return Canonical URL of value set that contains the entire code system. + */ + public String getValueSet() { + return this.valueSet == null ? null : this.valueSet.getValue(); + } + + /** + * @param value Canonical URL of value set that contains the entire code system. + */ + public CodeSystem setValueSet(String value) { + if (Utilities.noString(value)) + this.valueSet = null; + else { + if (this.valueSet == null) + this.valueSet = new UriType(); + this.valueSet.setValue(value); + } + return this; + } + + /** + * @return {@link #compositional} (True If code system defines a post-composition grammar.). This is the underlying object with id, value and extensions. The accessor "getCompositional" gives direct access to the value + */ + public BooleanType getCompositionalElement() { + if (this.compositional == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.compositional"); + else if (Configuration.doAutoCreate()) + this.compositional = new BooleanType(); // bb + return this.compositional; + } + + public boolean hasCompositionalElement() { + return this.compositional != null && !this.compositional.isEmpty(); + } + + public boolean hasCompositional() { + return this.compositional != null && !this.compositional.isEmpty(); + } + + /** + * @param value {@link #compositional} (True If code system defines a post-composition grammar.). This is the underlying object with id, value and extensions. The accessor "getCompositional" gives direct access to the value + */ + public CodeSystem setCompositionalElement(BooleanType value) { + this.compositional = value; + return this; + } + + /** + * @return True If code system defines a post-composition grammar. + */ + public boolean getCompositional() { + return this.compositional == null || this.compositional.isEmpty() ? false : this.compositional.getValue(); + } + + /** + * @param value True If code system defines a post-composition grammar. + */ + public CodeSystem setCompositional(boolean value) { + if (this.compositional == null) + this.compositional = new BooleanType(); + this.compositional.setValue(value); + return this; + } + + /** + * @return {@link #versionNeeded} (This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.). This is the underlying object with id, value and extensions. The accessor "getVersionNeeded" gives direct access to the value + */ + public BooleanType getVersionNeededElement() { + if (this.versionNeeded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.versionNeeded"); + else if (Configuration.doAutoCreate()) + this.versionNeeded = new BooleanType(); // bb + return this.versionNeeded; + } + + public boolean hasVersionNeededElement() { + return this.versionNeeded != null && !this.versionNeeded.isEmpty(); + } + + public boolean hasVersionNeeded() { + return this.versionNeeded != null && !this.versionNeeded.isEmpty(); + } + + /** + * @param value {@link #versionNeeded} (This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.). This is the underlying object with id, value and extensions. The accessor "getVersionNeeded" gives direct access to the value + */ + public CodeSystem setVersionNeededElement(BooleanType value) { + this.versionNeeded = value; + return this; + } + + /** + * @return This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system. + */ + public boolean getVersionNeeded() { + return this.versionNeeded == null || this.versionNeeded.isEmpty() ? false : this.versionNeeded.getValue(); + } + + /** + * @param value This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system. + */ + public CodeSystem setVersionNeeded(boolean value) { + if (this.versionNeeded == null) + this.versionNeeded = new BooleanType(); + this.versionNeeded.setValue(value); + return this; + } + + /** + * @return {@link #content} (How much of the content of the code system - the concepts and codes it defines - are represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value + */ + public Enumeration getContentElement() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.content"); + else if (Configuration.doAutoCreate()) + this.content = new Enumeration(new CodeSystemContentModeEnumFactory()); // bb + return this.content; + } + + public boolean hasContentElement() { + return this.content != null && !this.content.isEmpty(); + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (How much of the content of the code system - the concepts and codes it defines - are represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value + */ + public CodeSystem setContentElement(Enumeration value) { + this.content = value; + return this; + } + + /** + * @return How much of the content of the code system - the concepts and codes it defines - are represented in this resource. + */ + public CodeSystemContentMode getContent() { + return this.content == null ? null : this.content.getValue(); + } + + /** + * @param value How much of the content of the code system - the concepts and codes it defines - are represented in this resource. + */ + public CodeSystem setContent(CodeSystemContentMode value) { + if (this.content == null) + this.content = new Enumeration(new CodeSystemContentModeEnumFactory()); + this.content.setValue(value); + return this; + } + + /** + * @return {@link #count} (The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public UnsignedIntType getCountElement() { + if (this.count == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystem.count"); + else if (Configuration.doAutoCreate()) + this.count = new UnsignedIntType(); // bb + return this.count; + } + + public boolean hasCountElement() { + return this.count != null && !this.count.isEmpty(); + } + + public boolean hasCount() { + return this.count != null && !this.count.isEmpty(); + } + + /** + * @param value {@link #count} (The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public CodeSystem setCountElement(UnsignedIntType value) { + this.count = value; + return this; + } + + /** + * @return The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts. + */ + public int getCount() { + return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); + } + + /** + * @param value The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts. + */ + public CodeSystem setCount(int value) { + if (this.count == null) + this.count = new UnsignedIntType(); + this.count.setValue(value); + return this; + } + + /** + * @return {@link #filter} (A filter that can be used in a value set compose statement when selecting concepts using a filter.) + */ + public List getFilter() { + if (this.filter == null) + this.filter = new ArrayList(); + return this.filter; + } + + public boolean hasFilter() { + if (this.filter == null) + return false; + for (CodeSystemFilterComponent item : this.filter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #filter} (A filter that can be used in a value set compose statement when selecting concepts using a filter.) + */ + // syntactic sugar + public CodeSystemFilterComponent addFilter() { //3 + CodeSystemFilterComponent t = new CodeSystemFilterComponent(); + if (this.filter == null) + this.filter = new ArrayList(); + this.filter.add(t); + return t; + } + + // syntactic sugar + public CodeSystem addFilter(CodeSystemFilterComponent t) { //3 + if (t == null) + return this; + if (this.filter == null) + this.filter = new ArrayList(); + this.filter.add(t); + return this; + } + + /** + * @return {@link #property} (A property defines an additional slot through which additional information can be provided about a concept.) + */ + public List getProperty() { + if (this.property == null) + this.property = new ArrayList(); + return this.property; + } + + public boolean hasProperty() { + if (this.property == null) + return false; + for (CodeSystemPropertyComponent item : this.property) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #property} (A property defines an additional slot through which additional information can be provided about a concept.) + */ + // syntactic sugar + public CodeSystemPropertyComponent addProperty() { //3 + CodeSystemPropertyComponent t = new CodeSystemPropertyComponent(); + if (this.property == null) + this.property = new ArrayList(); + this.property.add(t); + return t; + } + + // syntactic sugar + public CodeSystem addProperty(CodeSystemPropertyComponent t) { //3 + if (t == null) + return this; + if (this.property == null) + this.property = new ArrayList(); + this.property.add(t); + return this; + } + + /** + * @return {@link #concept} (Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptDefinitionComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.) + */ + // syntactic sugar + public ConceptDefinitionComponent addConcept() { //3 + ConceptDefinitionComponent t = new ConceptDefinitionComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public CodeSystem addConcept(ConceptDefinitionComponent t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name describing the code system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the code system.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the code system.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A free text natural language description of the use of the code system - reason for definition, \"the semantic space\" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("requirements", "string", "Explains why this code system is needed and why it has been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("caseSensitive", "boolean", "If code comparison is case sensitive when codes within this system are compared to each other.", 0, java.lang.Integer.MAX_VALUE, caseSensitive)); + childrenList.add(new Property("valueSet", "uri", "Canonical URL of value set that contains the entire code system.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + childrenList.add(new Property("compositional", "boolean", "True If code system defines a post-composition grammar.", 0, java.lang.Integer.MAX_VALUE, compositional)); + childrenList.add(new Property("versionNeeded", "boolean", "This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.", 0, java.lang.Integer.MAX_VALUE, versionNeeded)); + childrenList.add(new Property("content", "code", "How much of the content of the code system - the concepts and codes it defines - are represented in this resource.", 0, java.lang.Integer.MAX_VALUE, content)); + childrenList.add(new Property("count", "unsignedInt", "The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.", 0, java.lang.Integer.MAX_VALUE, count)); + childrenList.add(new Property("filter", "", "A filter that can be used in a value set compose statement when selecting concepts using a filter.", 0, java.lang.Integer.MAX_VALUE, filter)); + childrenList.add(new Property("property", "", "A property defines an additional slot through which additional information can be provided about a concept.", 0, java.lang.Integer.MAX_VALUE, property)); + childrenList.add(new Property("concept", "", "Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.", 0, java.lang.Integer.MAX_VALUE, concept)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // CodeSystemContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case -35616442: /*caseSensitive*/ return this.caseSensitive == null ? new Base[0] : new Base[] {this.caseSensitive}; // BooleanType + case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // UriType + case 1248023381: /*compositional*/ return this.compositional == null ? new Base[0] : new Base[] {this.compositional}; // BooleanType + case 617270957: /*versionNeeded*/ return this.versionNeeded == null ? new Base[0] : new Base[] {this.versionNeeded}; // BooleanType + case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Enumeration + case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // UnsignedIntType + case -1274492040: /*filter*/ return this.filter == null ? new Base[0] : this.filter.toArray(new Base[this.filter.size()]); // CodeSystemFilterComponent + case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // CodeSystemPropertyComponent + case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptDefinitionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((CodeSystemContactComponent) value); // CodeSystemContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case -35616442: // caseSensitive + this.caseSensitive = castToBoolean(value); // BooleanType + break; + case -1410174671: // valueSet + this.valueSet = castToUri(value); // UriType + break; + case 1248023381: // compositional + this.compositional = castToBoolean(value); // BooleanType + break; + case 617270957: // versionNeeded + this.versionNeeded = castToBoolean(value); // BooleanType + break; + case 951530617: // content + this.content = new CodeSystemContentModeEnumFactory().fromType(value); // Enumeration + break; + case 94851343: // count + this.count = castToUnsignedInt(value); // UnsignedIntType + break; + case -1274492040: // filter + this.getFilter().add((CodeSystemFilterComponent) value); // CodeSystemFilterComponent + break; + case -993141291: // property + this.getProperty().add((CodeSystemPropertyComponent) value); // CodeSystemPropertyComponent + break; + case 951024232: // concept + this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((CodeSystemContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("caseSensitive")) + this.caseSensitive = castToBoolean(value); // BooleanType + else if (name.equals("valueSet")) + this.valueSet = castToUri(value); // UriType + else if (name.equals("compositional")) + this.compositional = castToBoolean(value); // BooleanType + else if (name.equals("versionNeeded")) + this.versionNeeded = castToBoolean(value); // BooleanType + else if (name.equals("content")) + this.content = new CodeSystemContentModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("count")) + this.count = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("filter")) + this.getFilter().add((CodeSystemFilterComponent) value); + else if (name.equals("property")) + this.getProperty().add((CodeSystemPropertyComponent) value); + else if (name.equals("concept")) + this.getConcept().add((ConceptDefinitionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return getIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // CodeSystemContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case -35616442: throw new FHIRException("Cannot make property caseSensitive as it is not a complex type"); // BooleanType + case -1410174671: throw new FHIRException("Cannot make property valueSet as it is not a complex type"); // UriType + case 1248023381: throw new FHIRException("Cannot make property compositional as it is not a complex type"); // BooleanType + case 617270957: throw new FHIRException("Cannot make property versionNeeded as it is not a complex type"); // BooleanType + case 951530617: throw new FHIRException("Cannot make property content as it is not a complex type"); // Enumeration + case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // UnsignedIntType + case -1274492040: return addFilter(); // CodeSystemFilterComponent + case -993141291: return addProperty(); // CodeSystemPropertyComponent + case 951024232: return addConcept(); // ConceptDefinitionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.url"); + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.requirements"); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.copyright"); + } + else if (name.equals("caseSensitive")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.caseSensitive"); + } + else if (name.equals("valueSet")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.valueSet"); + } + else if (name.equals("compositional")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.compositional"); + } + else if (name.equals("versionNeeded")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.versionNeeded"); + } + else if (name.equals("content")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.content"); + } + else if (name.equals("count")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.count"); + } + else if (name.equals("filter")) { + return addFilter(); + } + else if (name.equals("property")) { + return addProperty(); + } + else if (name.equals("concept")) { + return addConcept(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "CodeSystem"; + + } + + public CodeSystem copy() { + CodeSystem dst = new CodeSystem(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (CodeSystemContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy(); + dst.valueSet = valueSet == null ? null : valueSet.copy(); + dst.compositional = compositional == null ? null : compositional.copy(); + dst.versionNeeded = versionNeeded == null ? null : versionNeeded.copy(); + dst.content = content == null ? null : content.copy(); + dst.count = count == null ? null : count.copy(); + if (filter != null) { + dst.filter = new ArrayList(); + for (CodeSystemFilterComponent i : filter) + dst.filter.add(i.copy()); + }; + if (property != null) { + dst.property = new ArrayList(); + for (CodeSystemPropertyComponent i : property) + dst.property.add(i.copy()); + }; + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptDefinitionComponent i : concept) + dst.concept.add(i.copy()); + }; + return dst; + } + + protected CodeSystem typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeSystem)) + return false; + CodeSystem o = (CodeSystem) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) + && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(caseSensitive, o.caseSensitive, true) && compareDeep(valueSet, o.valueSet, true) + && compareDeep(compositional, o.compositional, true) && compareDeep(versionNeeded, o.versionNeeded, true) + && compareDeep(content, o.content, true) && compareDeep(count, o.count, true) && compareDeep(filter, o.filter, true) + && compareDeep(property, o.property, true) && compareDeep(concept, o.concept, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeSystem)) + return false; + CodeSystem o = (CodeSystem) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(copyright, o.copyright, true) && compareValues(caseSensitive, o.caseSensitive, true) + && compareValues(valueSet, o.valueSet, true) && compareValues(compositional, o.compositional, true) + && compareValues(versionNeeded, o.versionNeeded, true) && compareValues(content, o.content, true) && compareValues(count, o.count, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) + && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (caseSensitive == null || caseSensitive.isEmpty()) + && (valueSet == null || valueSet.isEmpty()) && (compositional == null || compositional.isEmpty()) + && (versionNeeded == null || versionNeeded.isEmpty()) && (content == null || content.isEmpty()) + && (count == null || count.isEmpty()) && (filter == null || filter.isEmpty()) && (property == null || property.isEmpty()) + && (concept == null || concept.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CodeSystem; + } + + /** + * Search parameter: content + *

+ * Description: not-present | examplar | fragment | complete
+ * Type: token
+ * Path: CodeSystem.content
+ *

+ */ + @SearchParamDefinition(name="content", path="CodeSystem.content", description="not-present | examplar | fragment | complete", type="token" ) + public static final String SP_CONTENT = "content"; + /** + * Fluent Client search parameter constant for content + *

+ * Description: not-present | examplar | fragment | complete
+ * Type: token
+ * Path: CodeSystem.content
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTENT); + + /** + * Search parameter: system + *

+ * Description: The system for any codes defined by this code system (same as 'url')
+ * Type: uri
+ * Path: CodeSystem.url
+ *

+ */ + @SearchParamDefinition(name="system", path="CodeSystem.url", description="The system for any codes defined by this code system (same as 'url')", type="uri" ) + public static final String SP_SYSTEM = "system"; + /** + * Fluent Client search parameter constant for system + *

+ * Description: The system for any codes defined by this code system (same as 'url')
+ * Type: uri
+ * Path: CodeSystem.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam SYSTEM = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SYSTEM); + + /** + * Search parameter: status + *

+ * Description: The status of the code system
+ * Type: token
+ * Path: CodeSystem.status
+ *

+ */ + @SearchParamDefinition(name="status", path="CodeSystem.status", description="The status of the code system", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The status of the code system
+ * Type: token
+ * Path: CodeSystem.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the code system
+ * Type: string
+ * Path: CodeSystem.description
+ *

+ */ + @SearchParamDefinition(name="description", path="CodeSystem.description", description="Text search in the description of the code system", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the code system
+ * Type: string
+ * Path: CodeSystem.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: The name of the code system
+ * Type: string
+ * Path: CodeSystem.name
+ *

+ */ + @SearchParamDefinition(name="name", path="CodeSystem.name", description="The name of the code system", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: The name of the code system
+ * Type: string
+ * Path: CodeSystem.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the code system
+ * Type: token
+ * Path: CodeSystem.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="CodeSystem.useContext", description="A use context assigned to the code system", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the code system
+ * Type: token
+ * Path: CodeSystem.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: language + *

+ * Description: A language in which a designation is provided
+ * Type: token
+ * Path: CodeSystem.concept.designation.language
+ *

+ */ + @SearchParamDefinition(name="language", path="CodeSystem.concept.designation.language", description="A language in which a designation is provided", type="token" ) + public static final String SP_LANGUAGE = "language"; + /** + * Fluent Client search parameter constant for language + *

+ * Description: A language in which a designation is provided
+ * Type: token
+ * Path: CodeSystem.concept.designation.language
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE); + + /** + * Search parameter: code + *

+ * Description: A code defined in the code system
+ * Type: token
+ * Path: CodeSystem.concept.code
+ *

+ */ + @SearchParamDefinition(name="code", path="CodeSystem.concept.code", description="A code defined in the code system", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: A code defined in the code system
+ * Type: token
+ * Path: CodeSystem.concept.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: The code system publication date
+ * Type: date
+ * Path: CodeSystem.date
+ *

+ */ + @SearchParamDefinition(name="date", path="CodeSystem.date", description="The code system publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The code system publication date
+ * Type: date
+ * Path: CodeSystem.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: The identifier for the code system
+ * Type: token
+ * Path: CodeSystem.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="CodeSystem.identifier", description="The identifier for the code system", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier for the code system
+ * Type: token
+ * Path: CodeSystem.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: url + *

+ * Description: The logical URL for the code system
+ * Type: uri
+ * Path: CodeSystem.url
+ *

+ */ + @SearchParamDefinition(name="url", path="CodeSystem.url", description="The logical URL for the code system", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: The logical URL for the code system
+ * Type: uri
+ * Path: CodeSystem.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the code system
+ * Type: string
+ * Path: CodeSystem.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="CodeSystem.publisher", description="Name of the publisher of the code system", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the code system
+ * Type: string
+ * Path: CodeSystem.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the code system
+ * Type: token
+ * Path: CodeSystem.version
+ *

+ */ + @SearchParamDefinition(name="version", path="CodeSystem.version", description="The version identifier of the code system", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the code system
+ * Type: token
+ * Path: CodeSystem.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeType.java new file mode 100644 index 00000000000..0aa6fb589d0 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeType.java @@ -0,0 +1,76 @@ +/* +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. + + */ +package org.hl7.fhir.dstu2016may.model; + +import static org.apache.commons.lang3.StringUtils.defaultString; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "code" in FHIR, when not bound to an enumerated list of codes + */ +@DatatypeDef(name="code", profileOf=StringType.class) +public class CodeType extends StringType implements Comparable { + + private static final long serialVersionUID = 3L; + + public CodeType() { + super(); + } + + public CodeType(String theCode) { + setValue(theCode); + } + + public int compareTo(CodeType theCode) { + if (theCode == null) { + return 1; + } + return defaultString(getValue()).compareTo(defaultString(theCode.getValue())); + } + + @Override + protected String parse(String theValue) { + return theValue.trim(); + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public CodeType copy() { + return new CodeType(getValue()); + } + + public String fhirType() { + return "code"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeableConcept.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeableConcept.java new file mode 100644 index 00000000000..c6745ab5360 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CodeableConcept.java @@ -0,0 +1,271 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + */ +@DatatypeDef(name="CodeableConcept") +public class CodeableConcept extends Type implements ICompositeType { + + /** + * A reference to a code defined by a terminology system. + */ + @Child(name = "coding", type = {Coding.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Code defined by a terminology system", formalDefinition="A reference to a code defined by a terminology system." ) + protected List coding; + + /** + * A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Plain text representation of the concept", formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." ) + protected StringType text; + + private static final long serialVersionUID = 760353246L; + + /** + * Constructor + */ + public CodeableConcept() { + super(); + } + + /** + * @return {@link #coding} (A reference to a code defined by a terminology system.) + */ + public List getCoding() { + if (this.coding == null) + this.coding = new ArrayList(); + return this.coding; + } + + public boolean hasCoding() { + if (this.coding == null) + return false; + for (Coding item : this.coding) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coding} (A reference to a code defined by a terminology system.) + */ + // syntactic sugar + public Coding addCoding() { //3 + Coding t = new Coding(); + if (this.coding == null) + this.coding = new ArrayList(); + this.coding.add(t); + return t; + } + + // syntactic sugar + public CodeableConcept addCoding(Coding t) { //3 + if (t == null) + return this; + if (this.coding == null) + this.coding = new ArrayList(); + this.coding.add(t); + return this; + } + + /** + * @return {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeableConcept.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public CodeableConcept setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + public CodeableConcept setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("coding", "Coding", "A reference to a code defined by a terminology system.", 0, java.lang.Integer.MAX_VALUE, coding)); + childrenList.add(new Property("text", "string", "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1355086998: /*coding*/ return this.coding == null ? new Base[0] : this.coding.toArray(new Base[this.coding.size()]); // Coding + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1355086998: // coding + this.getCoding().add(castToCoding(value)); // Coding + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("coding")) + this.getCoding().add(castToCoding(value)); + else if (name.equals("text")) + this.text = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1355086998: return addCoding(); // Coding + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("coding")) { + return addCoding(); + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type CodeableConcept.text"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "CodeableConcept"; + + } + + public CodeableConcept copy() { + CodeableConcept dst = new CodeableConcept(); + copyValues(dst); + if (coding != null) { + dst.coding = new ArrayList(); + for (Coding i : coding) + dst.coding.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + return dst; + } + + protected CodeableConcept typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeableConcept)) + return false; + CodeableConcept o = (CodeableConcept) other; + return compareDeep(coding, o.coding, true) && compareDeep(text, o.text, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeableConcept)) + return false; + CodeableConcept o = (CodeableConcept) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (coding == null || coding.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Coding.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Coding.java new file mode 100644 index 00000000000..5f2b70eb769 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Coding.java @@ -0,0 +1,491 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseCoding; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A reference to a code defined by a terminology system. + */ +@DatatypeDef(name="Coding") +public class Coding extends Type implements IBaseCoding, ICompositeType { + + /** + * The identification of the code system that defines the meaning of the symbol in the code. + */ + @Child(name = "system", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identity of the terminology system", formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." ) + protected UriType system; + + /** + * The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Version of the system - if relevant", formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." ) + protected StringType version; + + /** + * A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + @Child(name = "code", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Symbol in syntax defined by the system", formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." ) + protected CodeType code; + + /** + * A representation of the meaning of the code in the system, following the rules of the system. + */ + @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Representation defined by the system", formalDefinition="A representation of the meaning of the code in the system, following the rules of the system." ) + protected StringType display; + + /** + * Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays). + */ + @Child(name = "userSelected", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If this coding was chosen directly by the user", formalDefinition="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." ) + protected BooleanType userSelected; + + private static final long serialVersionUID = -1417514061L; + + /** + * Constructor + */ + public Coding() { + super(); + } + + /** + * Convenience constructor + * + * @param theSystem The {@link #setSystem(String) code system} + * @param theCode The {@link #setCode(String) code} + * @param theDisplay The {@link #setDisplay(String) human readable display} + */ + public Coding(String theSystem, String theCode, String theDisplay) { + setSystem(theSystem); + setCode(theCode); + setDisplay(theDisplay); + } + /** + * @return {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Coding setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return The identification of the code system that defines the meaning of the symbol in the code. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value The identification of the code system that defines the meaning of the symbol in the code. + */ + public Coding setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Coding setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + public Coding setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Coding setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + public Coding setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public Coding setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return A representation of the meaning of the code in the system, following the rules of the system. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value A representation of the meaning of the code in the system, following the rules of the system. + */ + public Coding setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #userSelected} (Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).). This is the underlying object with id, value and extensions. The accessor "getUserSelected" gives direct access to the value + */ + public BooleanType getUserSelectedElement() { + if (this.userSelected == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.userSelected"); + else if (Configuration.doAutoCreate()) + this.userSelected = new BooleanType(); // bb + return this.userSelected; + } + + public boolean hasUserSelectedElement() { + return this.userSelected != null && !this.userSelected.isEmpty(); + } + + public boolean hasUserSelected() { + return this.userSelected != null && !this.userSelected.isEmpty(); + } + + /** + * @param value {@link #userSelected} (Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).). This is the underlying object with id, value and extensions. The accessor "getUserSelected" gives direct access to the value + */ + public Coding setUserSelectedElement(BooleanType value) { + this.userSelected = value; + return this; + } + + /** + * @return Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays). + */ + public boolean getUserSelected() { + return this.userSelected == null || this.userSelected.isEmpty() ? false : this.userSelected.getValue(); + } + + /** + * @param value Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays). + */ + public Coding setUserSelected(boolean value) { + if (this.userSelected == null) + this.userSelected = new BooleanType(); + this.userSelected.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "The identification of the code system that defines the meaning of the symbol in the code.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("code", "code", "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "A representation of the meaning of the code in the system, following the rules of the system.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("userSelected", "boolean", "Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).", 0, java.lang.Integer.MAX_VALUE, userSelected)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType + case 423643014: /*userSelected*/ return this.userSelected == null ? new Base[0] : new Base[] {this.userSelected}; // BooleanType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case 1671764162: // display + this.display = castToString(value); // StringType + break; + case 423643014: // userSelected + this.userSelected = castToBoolean(value); // BooleanType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("display")) + this.display = castToString(value); // StringType + else if (name.equals("userSelected")) + this.userSelected = castToBoolean(value); // BooleanType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType + case 423643014: throw new FHIRException("Cannot make property userSelected as it is not a complex type"); // BooleanType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type Coding.system"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Coding.version"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type Coding.code"); + } + else if (name.equals("display")) { + throw new FHIRException("Cannot call addChild on a primitive type Coding.display"); + } + else if (name.equals("userSelected")) { + throw new FHIRException("Cannot call addChild on a primitive type Coding.userSelected"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Coding"; + + } + + public Coding copy() { + Coding dst = new Coding(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + dst.userSelected = userSelected == null ? null : userSelected.copy(); + return dst; + } + + protected Coding typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Coding)) + return false; + Coding o = (Coding) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) + && compareDeep(display, o.display, true) && compareDeep(userSelected, o.userSelected, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Coding)) + return false; + Coding o = (Coding) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(code, o.code, true) + && compareValues(display, o.display, true) && compareValues(userSelected, o.userSelected, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) && (userSelected == null || userSelected.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Communication.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Communication.java new file mode 100644 index 00000000000..ba2b4565f55 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Communication.java @@ -0,0 +1,1597 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * 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 { + /** + * 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 CommunicationStatus fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown CommunicationStatus code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/communication-status"; + case COMPLETED: return "http://hl7.org/fhir/communication-status"; + case SUSPENDED: return "http://hl7.org/fhir/communication-status"; + case REJECTED: return "http://hl7.org/fhir/communication-status"; + case FAILED: return "http://hl7.org/fhir/communication-status"; + 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 Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return new Enumeration(this, CommunicationStatus.INPROGRESS); + if ("completed".equals(codeString)) + return new Enumeration(this, CommunicationStatus.COMPLETED); + if ("suspended".equals(codeString)) + return new Enumeration(this, CommunicationStatus.SUSPENDED); + if ("rejected".equals(codeString)) + return new Enumeration(this, CommunicationStatus.REJECTED); + if ("failed".equals(codeString)) + return new Enumeration(this, CommunicationStatus.FAILED); + throw new FHIRException("Unknown CommunicationStatus code '"+codeString+"'"); + } + public String toCode(CommunicationStatus code) { + 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 "?"; + } + public String toSystem(CommunicationStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class CommunicationPayloadComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A communicated content (or for multi-part communications, one portion of the communication). + */ + @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Message part content", formalDefinition="A communicated content (or for multi-part communications, one portion of the communication)." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /** + * Constructor + */ + public CommunicationPayloadComponent() { + super(); + } + + /** + * Constructor + */ + public CommunicationPayloadComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) + */ + public StringType getContentStringType() throws FHIRException { + if (!(this.content instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); + return (StringType) this.content; + } + + public boolean hasContentStringType() { + return this.content instanceof StringType; + } + + /** + * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) + */ + public Attachment getContentAttachment() throws FHIRException { + if (!(this.content instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + public boolean hasContentAttachment() { + return this.content instanceof Attachment; + } + + /** + * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) + */ + public Reference getContentReference() throws FHIRException { + if (!(this.content instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContentReference() { + return this.content instanceof Reference; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) + */ + public CommunicationPayloadComponent 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)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 951530617: // content + this.content = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("content[x]")) + this.content = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 264548711: return getContent(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("contentString")) { + this.content = new StringType(); + return this.content; + } + else if (name.equals("contentAttachment")) { + this.content = new Attachment(); + return this.content; + } + else if (name.equals("contentReference")) { + this.content = new Reference(); + return this.content; + } + else + return super.addChild(name); + } + + public CommunicationPayloadComponent copy() { + CommunicationPayloadComponent dst = new CommunicationPayloadComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CommunicationPayloadComponent)) + return false; + CommunicationPayloadComponent o = (CommunicationPayloadComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CommunicationPayloadComponent)) + return false; + CommunicationPayloadComponent o = (CommunicationPayloadComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + public String fhirType() { + return "Communication.payload"; + + } + + } + + /** + * 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=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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 conveyed such as alert, notification, reminder, instruction, etc. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Message category", formalDefinition="The type of message conveyed such as alert, notification, reminder, instruction, etc." ) + protected CodeableConcept category; + + /** + * The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication. + */ + @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which was 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 was the source of the communication.) + */ + protected Resource senderTarget; + + /** + * The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time). + */ + @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Group.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time)." ) + 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 was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).) + */ + protected List recipientTarget; + + + /** + * Text, attachment(s), or resource(s) that was communicated to the recipient. + */ + @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) that was communicated to the recipient." ) + protected List payload; + + /** + * A channel that was used for this communication (e.g. email, fax). + */ + @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A channel of communication", formalDefinition="A channel that was used for this communication (e.g. email, fax)." ) + protected List medium; + + /** + * The status of the transmission. + */ + @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1, modifier=true, summary=true) + @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=7, min=0, max=1, modifier=false, summary=true) + @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=8, min=0, max=1, modifier=false, summary=true) + @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=9, min=0, max=1, modifier=false, summary=true) + @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 = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." ) + protected List reason; + + /** + * The patient who was the focus of this communication. + */ + @Child(name = "subject", type = {Patient.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Focus of message", formalDefinition="The patient who was the focus of this communication." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who was the focus of this communication.) + */ + protected Patient subjectTarget; + + /** + * The communication request that was responsible for producing this communication. + */ + @Child(name = "requestDetail", type = {CommunicationRequest.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="CommunicationRequest producing this message", formalDefinition="The communication request that was responsible for producing this communication." ) + protected Reference requestDetail; + + /** + * The actual object that is the target of the reference (The communication request that was responsible for producing this communication.) + */ + protected CommunicationRequest requestDetailTarget; + + private static final long serialVersionUID = -1654449146L; + + /** + * Constructor + */ + public Communication() { + super(); + } + + /** + * @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; + } + + // syntactic sugar + public Communication addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #category} (The type of message conveyed 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(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (The type of message conveyed 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 was 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(); // cc + 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 was 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 was 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 was 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 was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).) + */ + 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 was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return t; + } + + // syntactic sugar + public Communication addRecipient(Reference t) { //3 + if (t == null) + return this; + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return this; + } + + /** + * @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 was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.) + */ + public List getPayload() { + if (this.payload == null) + this.payload = new ArrayList(); + return this.payload; + } + + public boolean hasPayload() { + if (this.payload == null) + return false; + for (CommunicationPayloadComponent item : this.payload) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.) + */ + // syntactic sugar + public CommunicationPayloadComponent addPayload() { //3 + CommunicationPayloadComponent t = new CommunicationPayloadComponent(); + if (this.payload == null) + this.payload = new ArrayList(); + this.payload.add(t); + return t; + } + + // syntactic sugar + public Communication addPayload(CommunicationPayloadComponent t) { //3 + if (t == null) + return this; + if (this.payload == null) + this.payload = new ArrayList(); + this.payload.add(t); + return this; + } + + /** + * @return {@link #medium} (A channel that was used for this communication (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} (A channel that was used for this communication (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; + } + + // syntactic sugar + public Communication addMedium(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.medium == null) + this.medium = new ArrayList(); + this.medium.add(t); + return this; + } + + /** + * @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(new CommunicationStatusEnumFactory()); // bb + 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(new CommunicationStatusEnumFactory()); + 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(); // cc + 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(); // aa + 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(); // bb + 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(); // bb + 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 #reason} (The reason or justification for the communication.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (The reason or justification for the communication.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public Communication addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #subject} (The patient who was 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(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who was 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 was 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(); // aa + 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 was the focus of this communication.) + */ + public Communication setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #requestDetail} (The communication request that was responsible for producing this communication.) + */ + public Reference getRequestDetail() { + if (this.requestDetail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.requestDetail"); + else if (Configuration.doAutoCreate()) + this.requestDetail = new Reference(); // cc + return this.requestDetail; + } + + public boolean hasRequestDetail() { + return this.requestDetail != null && !this.requestDetail.isEmpty(); + } + + /** + * @param value {@link #requestDetail} (The communication request that was responsible for producing this communication.) + */ + public Communication setRequestDetail(Reference value) { + this.requestDetail = value; + return this; + } + + /** + * @return {@link #requestDetail} 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 communication request that was responsible for producing this communication.) + */ + public CommunicationRequest getRequestDetailTarget() { + if (this.requestDetailTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.requestDetail"); + else if (Configuration.doAutoCreate()) + this.requestDetailTarget = new CommunicationRequest(); // aa + return this.requestDetailTarget; + } + + /** + * @param value {@link #requestDetail} 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 communication request that was responsible for producing this communication.) + */ + public Communication setRequestDetailTarget(CommunicationRequest value) { + this.requestDetailTarget = 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 conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); + childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson|Group)", "The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload)); + childrenList.add(new Property("medium", "CodeableConcept", "A channel that was used for this communication (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("reason", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who was the focus of this communication.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("requestDetail", "Reference(CommunicationRequest)", "The communication request that was responsible for producing this communication.", 0, java.lang.Integer.MAX_VALUE, requestDetail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case -905962955: /*sender*/ return this.sender == null ? new Base[0] : new Base[] {this.sender}; // Reference + case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference + case -786701938: /*payload*/ return this.payload == null ? new Base[0] : this.payload.toArray(new Base[this.payload.size()]); // CommunicationPayloadComponent + case -1078030475: /*medium*/ return this.medium == null ? new Base[0] : this.medium.toArray(new Base[this.medium.size()]); // CodeableConcept + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 3526552: /*sent*/ return this.sent == null ? new Base[0] : new Base[] {this.sent}; // DateTimeType + case -808719903: /*received*/ return this.received == null ? new Base[0] : new Base[] {this.received}; // DateTimeType + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 960204736: /*requestDetail*/ return this.requestDetail == null ? new Base[0] : new Base[] {this.requestDetail}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case -905962955: // sender + this.sender = castToReference(value); // Reference + break; + case 820081177: // recipient + this.getRecipient().add(castToReference(value)); // Reference + break; + case -786701938: // payload + this.getPayload().add((CommunicationPayloadComponent) value); // CommunicationPayloadComponent + break; + case -1078030475: // medium + this.getMedium().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -892481550: // status + this.status = new CommunicationStatusEnumFactory().fromType(value); // Enumeration + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 3526552: // sent + this.sent = castToDateTime(value); // DateTimeType + break; + case -808719903: // received + this.received = castToDateTime(value); // DateTimeType + break; + case -934964668: // reason + this.getReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 960204736: // requestDetail + this.requestDetail = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("sender")) + this.sender = castToReference(value); // Reference + else if (name.equals("recipient")) + this.getRecipient().add(castToReference(value)); + else if (name.equals("payload")) + this.getPayload().add((CommunicationPayloadComponent) value); + else if (name.equals("medium")) + this.getMedium().add(castToCodeableConcept(value)); + else if (name.equals("status")) + this.status = new CommunicationStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("sent")) + this.sent = castToDateTime(value); // DateTimeType + else if (name.equals("received")) + this.received = castToDateTime(value); // DateTimeType + else if (name.equals("reason")) + this.getReason().add(castToCodeableConcept(value)); + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("requestDetail")) + this.requestDetail = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 50511102: return getCategory(); // CodeableConcept + case -905962955: return getSender(); // Reference + case 820081177: return addRecipient(); // Reference + case -786701938: return addPayload(); // CommunicationPayloadComponent + case -1078030475: return addMedium(); // CodeableConcept + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1524132147: return getEncounter(); // Reference + case 3526552: throw new FHIRException("Cannot make property sent as it is not a complex type"); // DateTimeType + case -808719903: throw new FHIRException("Cannot make property received as it is not a complex type"); // DateTimeType + case -934964668: return addReason(); // CodeableConcept + case -1867885268: return getSubject(); // Reference + case 960204736: return getRequestDetail(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("sender")) { + this.sender = new Reference(); + return this.sender; + } + else if (name.equals("recipient")) { + return addRecipient(); + } + else if (name.equals("payload")) { + return addPayload(); + } + else if (name.equals("medium")) { + return addMedium(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Communication.status"); + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("sent")) { + throw new FHIRException("Cannot call addChild on a primitive type Communication.sent"); + } + else if (name.equals("received")) { + throw new FHIRException("Cannot call addChild on a primitive type Communication.received"); + } + else if (name.equals("reason")) { + return addReason(); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("requestDetail")) { + this.requestDetail = new Reference(); + return this.requestDetail; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Communication"; + + } + + 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 (payload != null) { + dst.payload = new ArrayList(); + for (CommunicationPayloadComponent i : payload) + dst.payload.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 (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.requestDetail = requestDetail == null ? null : requestDetail.copy(); + return dst; + } + + protected Communication typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Communication)) + return false; + Communication o = (Communication) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true) + && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true) + && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) && compareDeep(sent, o.sent, true) + && compareDeep(received, o.received, true) && compareDeep(reason, o.reason, true) && compareDeep(subject, o.subject, true) + && compareDeep(requestDetail, o.requestDetail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Communication)) + return false; + Communication o = (Communication) other; + return compareValues(status, o.status, true) && compareValues(sent, o.sent, true) && compareValues(received, o.received, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty()) + && (medium == null || medium.isEmpty()) && (status == null || status.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (sent == null || sent.isEmpty()) && (received == null || received.isEmpty()) && (reason == null || reason.isEmpty()) + && (subject == null || subject.isEmpty()) && (requestDetail == null || requestDetail.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Communication; + } + + /** + * Search parameter: sender + *

+ * Description: Message sender
+ * Type: reference
+ * Path: Communication.sender
+ *

+ */ + @SearchParamDefinition(name="sender", path="Communication.sender", description="Message sender", type="reference" ) + public static final String SP_SENDER = "sender"; + /** + * Fluent Client search parameter constant for sender + *

+ * Description: Message sender
+ * Type: reference
+ * Path: Communication.sender
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SENDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SENDER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Communication:sender". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SENDER = new ca.uhn.fhir.model.api.Include("Communication:sender").toLocked(); + + /** + * Search parameter: sent + *

+ * Description: When sent
+ * Type: date
+ * Path: Communication.sent
+ *

+ */ + @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" ) + public static final String SP_SENT = "sent"; + /** + * Fluent Client search parameter constant for sent + *

+ * Description: When sent
+ * Type: date
+ * Path: Communication.sent
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam SENT = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_SENT); + + /** + * Search parameter: category + *

+ * Description: Message category
+ * Type: token
+ * Path: Communication.category
+ *

+ */ + @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: Message category
+ * Type: token
+ * Path: Communication.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: patient + *

+ * Description: Focus of message
+ * Type: reference
+ * Path: Communication.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Communication.subject", description="Focus of message", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Focus of message
+ * Type: reference
+ * Path: Communication.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Communication:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Communication:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: in-progress | completed | suspended | rejected | failed
+ * Type: token
+ * Path: Communication.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Communication.status", description="in-progress | completed | suspended | rejected | failed", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: in-progress | completed | suspended | rejected | failed
+ * Type: token
+ * Path: Communication.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: Focus of message
+ * Type: reference
+ * Path: Communication.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Communication.subject", description="Focus of message", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Focus of message
+ * Type: reference
+ * Path: Communication.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Communication:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Communication:subject").toLocked(); + + /** + * Search parameter: request + *

+ * Description: CommunicationRequest producing this message
+ * Type: reference
+ * Path: Communication.requestDetail
+ *

+ */ + @SearchParamDefinition(name="request", path="Communication.requestDetail", description="CommunicationRequest producing this message", type="reference" ) + public static final String SP_REQUEST = "request"; + /** + * Fluent Client search parameter constant for request + *

+ * Description: CommunicationRequest producing this message
+ * Type: reference
+ * Path: Communication.requestDetail
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Communication:request". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("Communication:request").toLocked(); + + /** + * Search parameter: received + *

+ * Description: When received
+ * Type: date
+ * Path: Communication.received
+ *

+ */ + @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" ) + public static final String SP_RECEIVED = "received"; + /** + * Fluent Client search parameter constant for received + *

+ * Description: When received
+ * Type: date
+ * Path: Communication.received
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam RECEIVED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_RECEIVED); + + /** + * Search parameter: encounter + *

+ * Description: Encounter leading to message
+ * Type: reference
+ * Path: Communication.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="Communication.encounter", description="Encounter leading to message", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Encounter leading to message
+ * Type: reference
+ * Path: Communication.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Communication:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Communication:encounter").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Unique identifier
+ * Type: token
+ * Path: Communication.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique identifier
+ * Type: token
+ * Path: Communication.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: medium + *

+ * Description: A channel of communication
+ * Type: token
+ * Path: Communication.medium
+ *

+ */ + @SearchParamDefinition(name="medium", path="Communication.medium", description="A channel of communication", type="token" ) + public static final String SP_MEDIUM = "medium"; + /** + * Fluent Client search parameter constant for medium + *

+ * Description: A channel of communication
+ * Type: token
+ * Path: Communication.medium
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam MEDIUM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MEDIUM); + + /** + * Search parameter: recipient + *

+ * Description: Message recipient
+ * Type: reference
+ * Path: Communication.recipient
+ *

+ */ + @SearchParamDefinition(name="recipient", path="Communication.recipient", description="Message recipient", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + /** + * Fluent Client search parameter constant for recipient + *

+ * Description: Message recipient
+ * Type: reference
+ * Path: Communication.recipient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Communication:recipient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("Communication:recipient").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CommunicationRequest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CommunicationRequest.java new file mode 100644 index 00000000000..18072d5fd32 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CommunicationRequest.java @@ -0,0 +1,1736 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + */ +@ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/Profile/CommunicationRequest") +public class CommunicationRequest extends DomainResource { + + public enum CommunicationRequestStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request has been planned. + */ + PLANNED, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the order, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request + */ + REJECTED, + /** + * The communication was attempted, but due to some procedural error, it could not be completed. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + public static CommunicationRequestStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("planned".equals(codeString)) + return PLANNED; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + 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 FHIRException("Unknown CommunicationRequestStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case PLANNED: return "planned"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + 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 PROPOSED: return "http://hl7.org/fhir/communication-request-status"; + case PLANNED: return "http://hl7.org/fhir/communication-request-status"; + case REQUESTED: return "http://hl7.org/fhir/communication-request-status"; + case RECEIVED: return "http://hl7.org/fhir/communication-request-status"; + case ACCEPTED: return "http://hl7.org/fhir/communication-request-status"; + case INPROGRESS: return "http://hl7.org/fhir/communication-request-status"; + case COMPLETED: return "http://hl7.org/fhir/communication-request-status"; + case SUSPENDED: return "http://hl7.org/fhir/communication-request-status"; + case REJECTED: return "http://hl7.org/fhir/communication-request-status"; + case FAILED: return "http://hl7.org/fhir/communication-request-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case PLANNED: return "The request has been planned."; + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request"; + case FAILED: return "The communication was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case PLANNED: return "Planned"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + 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 CommunicationRequestStatusEnumFactory implements EnumFactory { + public CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return CommunicationRequestStatus.PROPOSED; + if ("planned".equals(codeString)) + return CommunicationRequestStatus.PLANNED; + if ("requested".equals(codeString)) + return CommunicationRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return CommunicationRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return CommunicationRequestStatus.ACCEPTED; + if ("in-progress".equals(codeString)) + return CommunicationRequestStatus.INPROGRESS; + if ("completed".equals(codeString)) + return CommunicationRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return CommunicationRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return CommunicationRequestStatus.REJECTED; + if ("failed".equals(codeString)) + return CommunicationRequestStatus.FAILED; + throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.PROPOSED); + if ("planned".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.PLANNED); + if ("requested".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.REQUESTED); + if ("received".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.RECEIVED); + if ("accepted".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.ACCEPTED); + if ("in-progress".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.INPROGRESS); + if ("completed".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.COMPLETED); + if ("suspended".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.SUSPENDED); + if ("rejected".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.REJECTED); + if ("failed".equals(codeString)) + return new Enumeration(this, CommunicationRequestStatus.FAILED); + throw new FHIRException("Unknown CommunicationRequestStatus code '"+codeString+"'"); + } + public String toCode(CommunicationRequestStatus code) { + if (code == CommunicationRequestStatus.PROPOSED) + return "proposed"; + if (code == CommunicationRequestStatus.PLANNED) + return "planned"; + if (code == CommunicationRequestStatus.REQUESTED) + return "requested"; + if (code == CommunicationRequestStatus.RECEIVED) + return "received"; + if (code == CommunicationRequestStatus.ACCEPTED) + return "accepted"; + if (code == CommunicationRequestStatus.INPROGRESS) + return "in-progress"; + if (code == CommunicationRequestStatus.COMPLETED) + return "completed"; + if (code == CommunicationRequestStatus.SUSPENDED) + return "suspended"; + if (code == CommunicationRequestStatus.REJECTED) + return "rejected"; + if (code == CommunicationRequestStatus.FAILED) + return "failed"; + return "?"; + } + public String toSystem(CommunicationRequestStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class CommunicationRequestPayloadComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The communicated content (or for multi-part communications, one portion of the communication). + */ + @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Message part content", formalDefinition="The communicated content (or for multi-part communications, one portion of the communication)." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /** + * Constructor + */ + public CommunicationRequestPayloadComponent() { + super(); + } + + /** + * Constructor + */ + public CommunicationRequestPayloadComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) + */ + public StringType getContentStringType() throws FHIRException { + if (!(this.content instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); + return (StringType) this.content; + } + + public boolean hasContentStringType() { + return this.content instanceof StringType; + } + + /** + * @return {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) + */ + public Attachment getContentAttachment() throws FHIRException { + if (!(this.content instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + public boolean hasContentAttachment() { + return this.content instanceof Attachment; + } + + /** + * @return {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) + */ + public Reference getContentReference() throws FHIRException { + if (!(this.content instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContentReference() { + return this.content instanceof Reference; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) + */ + public CommunicationRequestPayloadComponent 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)", "The communicated content (or for multi-part communications, one portion of the communication).", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 951530617: // content + this.content = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("content[x]")) + this.content = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 264548711: return getContent(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("contentString")) { + this.content = new StringType(); + return this.content; + } + else if (name.equals("contentAttachment")) { + this.content = new Attachment(); + return this.content; + } + else if (name.equals("contentReference")) { + this.content = new Reference(); + return this.content; + } + else + return super.addChild(name); + } + + public CommunicationRequestPayloadComponent copy() { + CommunicationRequestPayloadComponent dst = new CommunicationRequestPayloadComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CommunicationRequestPayloadComponent)) + return false; + CommunicationRequestPayloadComponent o = (CommunicationRequestPayloadComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CommunicationRequestPayloadComponent)) + return false; + CommunicationRequestPayloadComponent o = (CommunicationRequestPayloadComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + public String fhirType() { + return "CommunicationRequest.payload"; + + } + + } + + /** + * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier", formalDefinition="A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system." ) + protected List identifier; + + /** + * The type of message to be sent such as alert, notification, reminder, instruction, etc. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Message category", formalDefinition="The type of message to be sent such as alert, notification, reminder, instruction, etc." ) + protected CodeableConcept category; + + /** + * The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication. + */ + @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which is to be 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 to be the source of the communication.) + */ + protected Resource senderTarget; + + /** + * The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication. + */ + @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which is the intended 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 intended target of the communication.) + */ + protected List recipientTarget; + + + /** + * Text, attachment(s), or resource(s) to be communicated to the recipient. + */ + @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) to be communicated to the recipient." ) + protected List payload; + + /** + * A channel that was used for this communication (e.g. email, fax). + */ + @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A channel of communication", formalDefinition="A channel that was used for this communication (e.g. email, fax)." ) + protected List medium; + + /** + * The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application. + */ + @Child(name = "requester", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An individual who requested a communication", formalDefinition="The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) + */ + protected Resource requesterTarget; + + /** + * The status of the proposal or order. + */ + @Child(name = "status", type = {CodeType.class}, order=7, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed", formalDefinition="The status of the proposal or order." ) + protected Enumeration status; + + /** + * The encounter within which the communication request was created. + */ + @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication request was created." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter within which the communication request was created.) + */ + protected Encounter encounterTarget; + + /** + * The time when this communication is to occur. + */ + @Child(name = "scheduled", type = {DateTimeType.class, Period.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When scheduled", formalDefinition="The time when this communication is to occur." ) + protected Type scheduled; + + /** + * The reason or justification for the communication request. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication request." ) + protected List reason; + + /** + * The time when the request was made. + */ + @Child(name = "requestedOn", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When ordered or proposed", formalDefinition="The time when the request was made." ) + protected DateTimeType requestedOn; + + /** + * The patient who is the focus of this communication request. + */ + @Child(name = "subject", type = {Patient.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Focus of message", formalDefinition="The patient who is the focus of this communication request." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who is the focus of this communication request.) + */ + protected Patient subjectTarget; + + /** + * Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. + */ + @Child(name = "priority", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Message urgency", formalDefinition="Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine." ) + protected CodeableConcept priority; + + private static final long serialVersionUID = 146906020L; + + /** + * Constructor + */ + public CommunicationRequest() { + super(); + } + + /** + * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.) + */ + 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} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public CommunicationRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #category} (The type of message to be sent such as alert, notification, reminder, instruction, etc.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (The type of message to be sent such as alert, notification, reminder, instruction, etc.) + */ + public CommunicationRequest setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.) + */ + public Reference getSender() { + if (this.sender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.sender"); + else if (Configuration.doAutoCreate()) + this.sender = new Reference(); // cc + 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 to be the source of the communication.) + */ + public CommunicationRequest 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 to be 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 to be the source of the communication.) + */ + public CommunicationRequest 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 intended 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 intended 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; + } + + // syntactic sugar + public CommunicationRequest addRecipient(Reference t) { //3 + if (t == null) + return this; + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return this; + } + + /** + * @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 intended target of the communication.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #payload} (Text, attachment(s), or resource(s) to be communicated to the recipient.) + */ + public List getPayload() { + if (this.payload == null) + this.payload = new ArrayList(); + return this.payload; + } + + public boolean hasPayload() { + if (this.payload == null) + return false; + for (CommunicationRequestPayloadComponent item : this.payload) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #payload} (Text, attachment(s), or resource(s) to be communicated to the recipient.) + */ + // syntactic sugar + public CommunicationRequestPayloadComponent addPayload() { //3 + CommunicationRequestPayloadComponent t = new CommunicationRequestPayloadComponent(); + if (this.payload == null) + this.payload = new ArrayList(); + this.payload.add(t); + return t; + } + + // syntactic sugar + public CommunicationRequest addPayload(CommunicationRequestPayloadComponent t) { //3 + if (t == null) + return this; + if (this.payload == null) + this.payload = new ArrayList(); + this.payload.add(t); + return this; + } + + /** + * @return {@link #medium} (A channel that was used for this communication (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} (A channel that was used for this communication (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; + } + + // syntactic sugar + public CommunicationRequest addMedium(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.medium == null) + this.medium = new ArrayList(); + this.medium.add(t); + return this; + } + + /** + * @return {@link #requester} (The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); // cc + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) + */ + public CommunicationRequest setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} 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 responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) + */ + public Resource getRequesterTarget() { + return this.requesterTarget; + } + + /** + * @param value {@link #requester} 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 responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) + */ + public CommunicationRequest setRequesterTarget(Resource value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the proposal or order.). 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 CommunicationRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CommunicationRequestStatusEnumFactory()); // bb + 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 proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CommunicationRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the proposal or order. + */ + public CommunicationRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the proposal or order. + */ + public CommunicationRequest setStatus(CommunicationRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new CommunicationRequestStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #encounter} (The encounter within which the communication request was created.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter within which the communication request was created.) + */ + public CommunicationRequest 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 request was created.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 request was created.) + */ + public CommunicationRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #scheduled} (The time when this communication is to occur.) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The time when this communication is to occur.) + */ + public DateTimeType getScheduledDateTimeType() throws FHIRException { + if (!(this.scheduled instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (DateTimeType) this.scheduled; + } + + public boolean hasScheduledDateTimeType() { + return this.scheduled instanceof DateTimeType; + } + + /** + * @return {@link #scheduled} (The time when this communication is to occur.) + */ + public Period getScheduledPeriod() throws FHIRException { + if (!(this.scheduled instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + public boolean hasScheduledPeriod() { + return this.scheduled instanceof Period; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The time when this communication is to occur.) + */ + public CommunicationRequest setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #reason} (The reason or justification for the communication request.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (The reason or justification for the communication request.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public CommunicationRequest addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #requestedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getRequestedOn" gives direct access to the value + */ + public DateTimeType getRequestedOnElement() { + if (this.requestedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.requestedOn"); + else if (Configuration.doAutoCreate()) + this.requestedOn = new DateTimeType(); // bb + return this.requestedOn; + } + + public boolean hasRequestedOnElement() { + return this.requestedOn != null && !this.requestedOn.isEmpty(); + } + + public boolean hasRequestedOn() { + return this.requestedOn != null && !this.requestedOn.isEmpty(); + } + + /** + * @param value {@link #requestedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getRequestedOn" gives direct access to the value + */ + public CommunicationRequest setRequestedOnElement(DateTimeType value) { + this.requestedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getRequestedOn() { + return this.requestedOn == null ? null : this.requestedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public CommunicationRequest setRequestedOn(Date value) { + if (value == null) + this.requestedOn = null; + else { + if (this.requestedOn == null) + this.requestedOn = new DateTimeType(); + this.requestedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who is the focus of this communication request.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + 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 request.) + */ + public CommunicationRequest 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 request.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + 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 request.) + */ + public CommunicationRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) + */ + public CommunicationRequest setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("category", "CodeableConcept", "The type of message to be sent such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); + childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) to be communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload)); + childrenList.add(new Property("medium", "CodeableConcept", "A channel that was used for this communication (e.g. email, fax).", 0, java.lang.Integer.MAX_VALUE, medium)); + childrenList.add(new Property("requester", "Reference(Practitioner|Patient|RelatedPerson)", "The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("status", "code", "The status of the proposal or order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("scheduled[x]", "dateTime|Period", "The time when this communication is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("reason", "CodeableConcept", "The reason or justification for the communication request.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("requestedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, requestedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the focus of this communication request.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("priority", "CodeableConcept", "Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case -905962955: /*sender*/ return this.sender == null ? new Base[0] : new Base[] {this.sender}; // Reference + case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference + case -786701938: /*payload*/ return this.payload == null ? new Base[0] : this.payload.toArray(new Base[this.payload.size()]); // CommunicationRequestPayloadComponent + case -1078030475: /*medium*/ return this.medium == null ? new Base[0] : this.medium.toArray(new Base[this.medium.size()]); // CodeableConcept + case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -160710483: /*scheduled*/ return this.scheduled == null ? new Base[0] : new Base[] {this.scheduled}; // Type + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept + case 1150582253: /*requestedOn*/ return this.requestedOn == null ? new Base[0] : new Base[] {this.requestedOn}; // DateTimeType + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case -905962955: // sender + this.sender = castToReference(value); // Reference + break; + case 820081177: // recipient + this.getRecipient().add(castToReference(value)); // Reference + break; + case -786701938: // payload + this.getPayload().add((CommunicationRequestPayloadComponent) value); // CommunicationRequestPayloadComponent + break; + case -1078030475: // medium + this.getMedium().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 693933948: // requester + this.requester = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new CommunicationRequestStatusEnumFactory().fromType(value); // Enumeration + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -160710483: // scheduled + this.scheduled = (Type) value; // Type + break; + case -934964668: // reason + this.getReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1150582253: // requestedOn + this.requestedOn = castToDateTime(value); // DateTimeType + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -1165461084: // priority + this.priority = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("sender")) + this.sender = castToReference(value); // Reference + else if (name.equals("recipient")) + this.getRecipient().add(castToReference(value)); + else if (name.equals("payload")) + this.getPayload().add((CommunicationRequestPayloadComponent) value); + else if (name.equals("medium")) + this.getMedium().add(castToCodeableConcept(value)); + else if (name.equals("requester")) + this.requester = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new CommunicationRequestStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("scheduled[x]")) + this.scheduled = (Type) value; // Type + else if (name.equals("reason")) + this.getReason().add(castToCodeableConcept(value)); + else if (name.equals("requestedOn")) + this.requestedOn = castToDateTime(value); // DateTimeType + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("priority")) + this.priority = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 50511102: return getCategory(); // CodeableConcept + case -905962955: return getSender(); // Reference + case 820081177: return addRecipient(); // Reference + case -786701938: return addPayload(); // CommunicationRequestPayloadComponent + case -1078030475: return addMedium(); // CodeableConcept + case 693933948: return getRequester(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1524132147: return getEncounter(); // Reference + case 1162627251: return getScheduled(); // Type + case -934964668: return addReason(); // CodeableConcept + case 1150582253: throw new FHIRException("Cannot make property requestedOn as it is not a complex type"); // DateTimeType + case -1867885268: return getSubject(); // Reference + case -1165461084: return getPriority(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("sender")) { + this.sender = new Reference(); + return this.sender; + } + else if (name.equals("recipient")) { + return addRecipient(); + } + else if (name.equals("payload")) { + return addPayload(); + } + else if (name.equals("medium")) { + return addMedium(); + } + else if (name.equals("requester")) { + this.requester = new Reference(); + return this.requester; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type CommunicationRequest.status"); + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("scheduledDateTime")) { + this.scheduled = new DateTimeType(); + return this.scheduled; + } + else if (name.equals("scheduledPeriod")) { + this.scheduled = new Period(); + return this.scheduled; + } + else if (name.equals("reason")) { + return addReason(); + } + else if (name.equals("requestedOn")) { + throw new FHIRException("Cannot call addChild on a primitive type CommunicationRequest.requestedOn"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("priority")) { + this.priority = new CodeableConcept(); + return this.priority; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "CommunicationRequest"; + + } + + public CommunicationRequest copy() { + CommunicationRequest dst = new CommunicationRequest(); + 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 (payload != null) { + dst.payload = new ArrayList(); + for (CommunicationRequestPayloadComponent i : payload) + dst.payload.add(i.copy()); + }; + if (medium != null) { + dst.medium = new ArrayList(); + for (CodeableConcept i : medium) + dst.medium.add(i.copy()); + }; + dst.requester = requester == null ? null : requester.copy(); + dst.status = status == null ? null : status.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + dst.requestedOn = requestedOn == null ? null : requestedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected CommunicationRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CommunicationRequest)) + return false; + CommunicationRequest o = (CommunicationRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true) + && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true) + && compareDeep(requester, o.requester, true) && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(scheduled, o.scheduled, true) && compareDeep(reason, o.reason, true) && compareDeep(requestedOn, o.requestedOn, true) + && compareDeep(subject, o.subject, true) && compareDeep(priority, o.priority, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CommunicationRequest)) + return false; + CommunicationRequest o = (CommunicationRequest) other; + return compareValues(status, o.status, true) && compareValues(requestedOn, o.requestedOn, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty()) + && (medium == null || medium.isEmpty()) && (requester == null || requester.isEmpty()) && (status == null || status.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (scheduled == null || scheduled.isEmpty()) + && (reason == null || reason.isEmpty()) && (requestedOn == null || requestedOn.isEmpty()) + && (subject == null || subject.isEmpty()) && (priority == null || priority.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CommunicationRequest; + } + + /** + * Search parameter: sender + *

+ * Description: Message sender
+ * Type: reference
+ * Path: CommunicationRequest.sender
+ *

+ */ + @SearchParamDefinition(name="sender", path="CommunicationRequest.sender", description="Message sender", type="reference" ) + public static final String SP_SENDER = "sender"; + /** + * Fluent Client search parameter constant for sender + *

+ * Description: Message sender
+ * Type: reference
+ * Path: CommunicationRequest.sender
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SENDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SENDER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CommunicationRequest:sender". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SENDER = new ca.uhn.fhir.model.api.Include("CommunicationRequest:sender").toLocked(); + + /** + * Search parameter: requested + *

+ * Description: When ordered or proposed
+ * Type: date
+ * Path: CommunicationRequest.requestedOn
+ *

+ */ + @SearchParamDefinition(name="requested", path="CommunicationRequest.requestedOn", description="When ordered or proposed", type="date" ) + public static final String SP_REQUESTED = "requested"; + /** + * Fluent Client search parameter constant for requested + *

+ * Description: When ordered or proposed
+ * Type: date
+ * Path: CommunicationRequest.requestedOn
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam REQUESTED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_REQUESTED); + + /** + * Search parameter: time + *

+ * Description: When scheduled
+ * Type: date
+ * Path: CommunicationRequest.scheduledDateTime
+ *

+ */ + @SearchParamDefinition(name="time", path="CommunicationRequest.scheduled.as(DateTime)", description="When scheduled", type="date" ) + public static final String SP_TIME = "time"; + /** + * Fluent Client search parameter constant for time + *

+ * Description: When scheduled
+ * Type: date
+ * Path: CommunicationRequest.scheduledDateTime
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam TIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_TIME); + + /** + * Search parameter: requester + *

+ * Description: An individual who requested a communication
+ * Type: reference
+ * Path: CommunicationRequest.requester
+ *

+ */ + @SearchParamDefinition(name="requester", path="CommunicationRequest.requester", description="An individual who requested a communication", type="reference" ) + public static final String SP_REQUESTER = "requester"; + /** + * Fluent Client search parameter constant for requester + *

+ * Description: An individual who requested a communication
+ * Type: reference
+ * Path: CommunicationRequest.requester
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CommunicationRequest:requester". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("CommunicationRequest:requester").toLocked(); + + /** + * Search parameter: category + *

+ * Description: Message category
+ * Type: token
+ * Path: CommunicationRequest.category
+ *

+ */ + @SearchParamDefinition(name="category", path="CommunicationRequest.category", description="Message category", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: Message category
+ * Type: token
+ * Path: CommunicationRequest.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: patient + *

+ * Description: Focus of message
+ * Type: reference
+ * Path: CommunicationRequest.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Focus of message
+ * Type: reference
+ * Path: CommunicationRequest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CommunicationRequest:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CommunicationRequest:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed
+ * Type: token
+ * Path: CommunicationRequest.status
+ *

+ */ + @SearchParamDefinition(name="status", path="CommunicationRequest.status", description="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed
+ * Type: token
+ * Path: CommunicationRequest.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: priority + *

+ * Description: Message urgency
+ * Type: token
+ * Path: CommunicationRequest.priority
+ *

+ */ + @SearchParamDefinition(name="priority", path="CommunicationRequest.priority", description="Message urgency", type="token" ) + public static final String SP_PRIORITY = "priority"; + /** + * Fluent Client search parameter constant for priority + *

+ * Description: Message urgency
+ * Type: token
+ * Path: CommunicationRequest.priority
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); + + /** + * Search parameter: subject + *

+ * Description: Focus of message
+ * Type: reference
+ * Path: CommunicationRequest.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Focus of message
+ * Type: reference
+ * Path: CommunicationRequest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CommunicationRequest:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("CommunicationRequest:subject").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Encounter leading to message
+ * Type: reference
+ * Path: CommunicationRequest.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="CommunicationRequest.encounter", description="Encounter leading to message", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Encounter leading to message
+ * Type: reference
+ * Path: CommunicationRequest.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CommunicationRequest:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("CommunicationRequest:encounter").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Unique identifier
+ * Type: token
+ * Path: CommunicationRequest.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="CommunicationRequest.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique identifier
+ * Type: token
+ * Path: CommunicationRequest.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: medium + *

+ * Description: A channel of communication
+ * Type: token
+ * Path: CommunicationRequest.medium
+ *

+ */ + @SearchParamDefinition(name="medium", path="CommunicationRequest.medium", description="A channel of communication", type="token" ) + public static final String SP_MEDIUM = "medium"; + /** + * Fluent Client search parameter constant for medium + *

+ * Description: A channel of communication
+ * Type: token
+ * Path: CommunicationRequest.medium
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam MEDIUM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MEDIUM); + + /** + * Search parameter: recipient + *

+ * Description: Message recipient
+ * Type: reference
+ * Path: CommunicationRequest.recipient
+ *

+ */ + @SearchParamDefinition(name="recipient", path="CommunicationRequest.recipient", description="Message recipient", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + /** + * Fluent Client search parameter constant for recipient + *

+ * Description: Message recipient
+ * Type: reference
+ * Path: CommunicationRequest.recipient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "CommunicationRequest:recipient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("CommunicationRequest:recipient").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Comparison.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Comparison.java new file mode 100644 index 00000000000..c5b1d1de3c1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Comparison.java @@ -0,0 +1,110 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.util.List; + +import org.apache.commons.lang3.NotImplementedException; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +/** + * See http://www.healthintersections.com.au/?p=1941 + * + * @author Grahame + * + */ +public class Comparison { + + public class MatchProfile { + + } + + public static boolean matches(String c1, String c2, MatchProfile profile) { + if (Utilities.noString(c1) || Utilities.noString(c2)) + return false; + c1 = Utilities.normalize(c1); + c2 = Utilities.normalize(c2); + return c1.equals(c2); + } + + public static > boolean matches(Enumeration e1, Enumeration e2, MatchProfile profile) { + if (e1 == null || e2 == null) + return false; + return e1.getValue().equals(e2.getValue()); + } + + public static boolean matches(CodeableConcept c1, CodeableConcept c2, MatchProfile profile) throws FHIRException { + if (profile != null) + throw new NotImplementedException("Not Implemented Yet"); + + if (c1.getCoding().isEmpty() && c2.getCoding().isEmpty()) { + return matches(c1.getText(), c2.getText(), null); + } else { + // in the absence of specific guidance, we just require that all codes match + boolean ok = true; + for (Coding c : c1.getCoding()) { + ok = ok && inList(c2.getCoding(), c, null); + } + for (Coding c : c2.getCoding()) { + ok = ok && inList(c1.getCoding(), c, null); + } + return ok; + } + } + + public static void merge(CodeableConcept dst, CodeableConcept src) { + if (dst.getTextElement() == null && src.getTextElement() != null) + dst.setTextElement(src.getTextElement()); + } + + + public static boolean inList(List list, Coding c, MatchProfile profile) { + for (Coding item : list) { + if (matches(item, c, profile)) + return true; + } + return false; + } + + public static boolean matches(Coding c1, Coding c2, MatchProfile profile) { + if (profile != null) + throw new NotImplementedException("Not Implemented Yet"); + + // in the absence of a profile, we ignore version + return matches(c1.getSystem(), c2.getSystem(), null) && matches(c1.getCode(), c2.getCode(), null); + } + + public static boolean matches(Identifier i1, Identifier i2, MatchProfile profile) { + if (profile != null) + throw new NotImplementedException("Not Implemented Yet"); + + // in the absence of a profile, we ignore version + return matches(i1.getSystem(), i2.getSystem(), null) && matches(i1.getValue(), i2.getValue(), null); + } + + public static void merge(Identifier dst, Identifier src) { + if (dst.getUseElement() == null && src.getUseElement() != null) + dst.setUseElement(src.getUseElement()); + if (dst.getType() == null && src.getType() != null) + dst.setType(src.getType()); + if (dst.getPeriod() == null && src.getPeriod() != null) + dst.setPeriod(src.getPeriod()); + if (dst.getAssigner() == null && src.getAssigner() != null) + dst.setAssigner(src.getAssigner()); + } + + public static boolean matches(ContactPoint c1, ContactPoint c2, Object profile) { + if (profile != null) + throw new NotImplementedException("Not Implemented Yet"); + + // in the absence of a profile, we insist on system + return matches(c1.getSystemElement(), c2.getSystemElement(), null) && matches(c1.getValue(), c2.getValue(), null); + } + + public static void merge(ContactPoint dst, ContactPoint src) { + if (dst.getUseElement() == null && src.getUseElement() != null) + dst.setUseElement(src.getUseElement()); + if (dst.getPeriod() == null && src.getPeriod() != null) + dst.setPeriod(src.getPeriod()); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CompartmentDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CompartmentDefinition.java new file mode 100644 index 00000000000..48a56dbfea4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/CompartmentDefinition.java @@ -0,0 +1,1741 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A compartment definition that defines how resources are accessed on a server. + */ +@ResourceDef(name="CompartmentDefinition", profile="http://hl7.org/fhir/Profile/CompartmentDefinition") +public class CompartmentDefinition extends DomainResource { + + public enum CompartmentType { + /** + * The compartment definition is for the patient compartment + */ + PATIENT, + /** + * The compartment definition is for the encounter compartment + */ + ENCOUNTER, + /** + * The compartment definition is for the related-person compartment + */ + RELATEDPERSON, + /** + * The compartment definition is for the practitioner compartment + */ + PRACTITIONER, + /** + * The compartment definition is for the device compartment + */ + DEVICE, + /** + * added to help the parsers + */ + NULL; + public static CompartmentType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("Patient".equals(codeString)) + return PATIENT; + if ("Encounter".equals(codeString)) + return ENCOUNTER; + if ("RelatedPerson".equals(codeString)) + return RELATEDPERSON; + if ("Practitioner".equals(codeString)) + return PRACTITIONER; + if ("Device".equals(codeString)) + return DEVICE; + throw new FHIRException("Unknown CompartmentType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PATIENT: return "Patient"; + case ENCOUNTER: return "Encounter"; + case RELATEDPERSON: return "RelatedPerson"; + case PRACTITIONER: return "Practitioner"; + case DEVICE: return "Device"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PATIENT: return "http://hl7.org/fhir/compartment-type"; + case ENCOUNTER: return "http://hl7.org/fhir/compartment-type"; + case RELATEDPERSON: return "http://hl7.org/fhir/compartment-type"; + case PRACTITIONER: return "http://hl7.org/fhir/compartment-type"; + case DEVICE: return "http://hl7.org/fhir/compartment-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PATIENT: return "The compartment definition is for the patient compartment"; + case ENCOUNTER: return "The compartment definition is for the encounter compartment"; + case RELATEDPERSON: return "The compartment definition is for the related-person compartment"; + case PRACTITIONER: return "The compartment definition is for the practitioner compartment"; + case DEVICE: return "The compartment definition is for the device compartment"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PATIENT: return "Patient"; + case ENCOUNTER: return "Encounter"; + case RELATEDPERSON: return "RelatedPerson"; + case PRACTITIONER: return "Practitioner"; + case DEVICE: return "Device"; + default: return "?"; + } + } + } + + public static class CompartmentTypeEnumFactory implements EnumFactory { + public CompartmentType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("Patient".equals(codeString)) + return CompartmentType.PATIENT; + if ("Encounter".equals(codeString)) + return CompartmentType.ENCOUNTER; + if ("RelatedPerson".equals(codeString)) + return CompartmentType.RELATEDPERSON; + if ("Practitioner".equals(codeString)) + return CompartmentType.PRACTITIONER; + if ("Device".equals(codeString)) + return CompartmentType.DEVICE; + throw new IllegalArgumentException("Unknown CompartmentType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("Patient".equals(codeString)) + return new Enumeration(this, CompartmentType.PATIENT); + if ("Encounter".equals(codeString)) + return new Enumeration(this, CompartmentType.ENCOUNTER); + if ("RelatedPerson".equals(codeString)) + return new Enumeration(this, CompartmentType.RELATEDPERSON); + if ("Practitioner".equals(codeString)) + return new Enumeration(this, CompartmentType.PRACTITIONER); + if ("Device".equals(codeString)) + return new Enumeration(this, CompartmentType.DEVICE); + throw new FHIRException("Unknown CompartmentType code '"+codeString+"'"); + } + public String toCode(CompartmentType code) { + if (code == CompartmentType.PATIENT) + return "Patient"; + if (code == CompartmentType.ENCOUNTER) + return "Encounter"; + if (code == CompartmentType.RELATEDPERSON) + return "RelatedPerson"; + if (code == CompartmentType.PRACTITIONER) + return "Practitioner"; + if (code == CompartmentType.DEVICE) + return "Device"; + return "?"; + } + public String toSystem(CompartmentType code) { + return code.getSystem(); + } + } + + @Block() + public static class CompartmentDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the compartment definition. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the compartment definition." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public CompartmentDefinitionContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the compartment 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 CompartmentDefinitionContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public CompartmentDefinitionContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the compartment definition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the compartment definition. + */ + public CompartmentDefinitionContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public CompartmentDefinitionContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the compartment definition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public CompartmentDefinitionContactComponent copy() { + CompartmentDefinitionContactComponent dst = new CompartmentDefinitionContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CompartmentDefinitionContactComponent)) + return false; + CompartmentDefinitionContactComponent o = (CompartmentDefinitionContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CompartmentDefinitionContactComponent)) + return false; + CompartmentDefinitionContactComponent o = (CompartmentDefinitionContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "CompartmentDefinition.contact"; + + } + + } + + @Block() + public static class CompartmentDefinitionResourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of a resource supported by the server. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of resource type", formalDefinition="The name of a resource supported by the server." ) + protected CodeType code; + + /** + * The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way. + */ + @Child(name = "param", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Search Parameter Name, or chained params", formalDefinition="The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way." ) + protected List param; + + /** + * Additional doco about the resource and compartment. + */ + @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Additional doco about the resource and compartment", formalDefinition="Additional doco about the resource and compartment." ) + protected StringType documentation; + + private static final long serialVersionUID = 988080897L; + + /** + * Constructor + */ + public CompartmentDefinitionResourceComponent() { + super(); + } + + /** + * Constructor + */ + public CompartmentDefinitionResourceComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (The name of a resource supported by the server.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompartmentDefinitionResourceComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The name of a resource supported by the server.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CompartmentDefinitionResourceComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return The name of a resource supported by the server. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The name of a resource supported by the server. + */ + public CompartmentDefinitionResourceComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #param} (The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.) + */ + public List getParam() { + if (this.param == null) + this.param = new ArrayList(); + return this.param; + } + + public boolean hasParam() { + if (this.param == null) + return false; + for (StringType item : this.param) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #param} (The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.) + */ + // syntactic sugar + public StringType addParamElement() {//2 + StringType t = new StringType(); + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return t; + } + + /** + * @param value {@link #param} (The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.) + */ + public CompartmentDefinitionResourceComponent addParam(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return this; + } + + /** + * @param value {@link #param} (The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.) + */ + public boolean hasParam(String value) { + if (this.param == null) + return false; + for (StringType v : this.param) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #documentation} (Additional doco about the resource and compartment.). 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 CompartmentDefinitionResourceComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Additional doco about the resource and compartment.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public CompartmentDefinitionResourceComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Additional doco about the resource and compartment. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Additional doco about the resource and compartment. + */ + public CompartmentDefinitionResourceComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "The name of a resource supported by the server.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("param", "string", "The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.", 0, java.lang.Integer.MAX_VALUE, param)); + childrenList.add(new Property("documentation", "string", "Additional doco about the resource and compartment.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // StringType + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case 106436749: // param + this.getParam().add(castToString(value)); // StringType + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("param")) + this.getParam().add(castToString(value)); + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case 106436749: throw new FHIRException("Cannot make property param as it is not a complex type"); // StringType + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.code"); + } + else if (name.equals("param")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.param"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.documentation"); + } + else + return super.addChild(name); + } + + public CompartmentDefinitionResourceComponent copy() { + CompartmentDefinitionResourceComponent dst = new CompartmentDefinitionResourceComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (param != null) { + dst.param = new ArrayList(); + for (StringType i : param) + dst.param.add(i.copy()); + }; + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CompartmentDefinitionResourceComponent)) + return false; + CompartmentDefinitionResourceComponent o = (CompartmentDefinitionResourceComponent) other; + return compareDeep(code, o.code, true) && compareDeep(param, o.param, true) && compareDeep(documentation, o.documentation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CompartmentDefinitionResourceComponent)) + return false; + CompartmentDefinitionResourceComponent o = (CompartmentDefinitionResourceComponent) other; + return compareValues(code, o.code, true) && compareValues(param, o.param, true) && compareValues(documentation, o.documentation, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (param == null || param.isEmpty()) + && (documentation == null || documentation.isEmpty()); + } + + public String fhirType() { + return "CompartmentDefinition.resource"; + + } + + } + + /** + * An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Absolute URL used to reference this compartment definition", formalDefinition="An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published." ) + protected UriType url; + + /** + * A free text natural language name identifying the compartment definition. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this compartment definition", formalDefinition="A free text natural language name identifying the compartment definition." ) + protected StringType name; + + /** + * The status of this compartment definition definition. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this compartment definition definition." ) + protected Enumeration status; + + /** + * A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the compartment definition. + */ + @Child(name = "publisher", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the compartment definition." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes." ) + protected DateTimeType date; + + /** + * A free text natural language description of the CompartmentDefinition and its use. + */ + @Child(name = "description", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Natural language description of the CompartmentDefinition", formalDefinition="A free text natural language description of the CompartmentDefinition and its use." ) + protected StringType description; + + /** + * The Scope and Usage that this compartment definition was created to meet. + */ + @Child(name = "requirements", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why this compartment definition is defined", formalDefinition="The Scope and Usage that this compartment definition was created to meet." ) + protected StringType requirements; + + /** + * Which compartment this definition describes. + */ + @Child(name = "code", type = {CodeType.class}, order=9, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient | Encounter | RelatedPerson | Practitioner | Device", formalDefinition="Which compartment this definition describes." ) + protected Enumeration code; + + /** + * Whether the search syntax is supported. + */ + @Child(name = "search", type = {BooleanType.class}, order=10, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether the search syntax is supported", formalDefinition="Whether the search syntax is supported." ) + protected BooleanType search; + + /** + * Information about how a resource it related to the compartment. + */ + @Child(name = "resource", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="How resource is related to the compartment", formalDefinition="Information about how a resource it related to the compartment." ) + protected List resource; + + private static final long serialVersionUID = -1431357313L; + + /** + * Constructor + */ + public CompartmentDefinition() { + super(); + } + + /** + * Constructor + */ + public CompartmentDefinition(UriType url, StringType name, Enumeration code, BooleanType search) { + super(); + this.url = url; + this.name = name; + this.code = code; + this.search = search; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompartmentDefinition.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public CompartmentDefinition setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published. + */ + public CompartmentDefinition setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the compartment 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 CompartmentDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name identifying the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public CompartmentDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the compartment definition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the compartment definition. + */ + public CompartmentDefinition setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of this compartment definition definition.). 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 CompartmentDefinition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 this compartment definition definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CompartmentDefinition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this compartment definition definition. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this compartment definition definition. + */ + public CompartmentDefinition setStatus(ConformanceResourceStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompartmentDefinition.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public CompartmentDefinition setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public CompartmentDefinition setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompartmentDefinition.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public CompartmentDefinition setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the compartment definition. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the compartment definition. + */ + public CompartmentDefinition setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (CompartmentDefinitionContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public CompartmentDefinitionContactComponent addContact() { //3 + CompartmentDefinitionContactComponent t = new CompartmentDefinitionContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public CompartmentDefinition addContact(CompartmentDefinitionContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.). 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 CompartmentDefinition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public CompartmentDefinition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. + */ + public CompartmentDefinition setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the CompartmentDefinition and its use.). 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 CompartmentDefinition.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the CompartmentDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public CompartmentDefinition setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the CompartmentDefinition and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the CompartmentDefinition and its use. + */ + public CompartmentDefinition 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 #requirements} (The Scope and Usage that this compartment definition was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompartmentDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (The Scope and Usage that this compartment definition was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public CompartmentDefinition setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return The Scope and Usage that this compartment definition was created to meet. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value The Scope and Usage that this compartment definition was created to meet. + */ + public CompartmentDefinition setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Which compartment this definition describes.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompartmentDefinition.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new CompartmentTypeEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Which compartment this definition describes.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CompartmentDefinition setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Which compartment this definition describes. + */ + public CompartmentType getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Which compartment this definition describes. + */ + public CompartmentDefinition setCode(CompartmentType value) { + if (this.code == null) + this.code = new Enumeration(new CompartmentTypeEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #search} (Whether the search syntax is supported.). This is the underlying object with id, value and extensions. The accessor "getSearch" gives direct access to the value + */ + public BooleanType getSearchElement() { + if (this.search == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompartmentDefinition.search"); + else if (Configuration.doAutoCreate()) + this.search = new BooleanType(); // bb + return this.search; + } + + public boolean hasSearchElement() { + return this.search != null && !this.search.isEmpty(); + } + + public boolean hasSearch() { + return this.search != null && !this.search.isEmpty(); + } + + /** + * @param value {@link #search} (Whether the search syntax is supported.). This is the underlying object with id, value and extensions. The accessor "getSearch" gives direct access to the value + */ + public CompartmentDefinition setSearchElement(BooleanType value) { + this.search = value; + return this; + } + + /** + * @return Whether the search syntax is supported. + */ + public boolean getSearch() { + return this.search == null || this.search.isEmpty() ? false : this.search.getValue(); + } + + /** + * @param value Whether the search syntax is supported. + */ + public CompartmentDefinition setSearch(boolean value) { + if (this.search == null) + this.search = new BooleanType(); + this.search.setValue(value); + return this; + } + + /** + * @return {@link #resource} (Information about how a resource it related to the compartment.) + */ + public List getResource() { + if (this.resource == null) + this.resource = new ArrayList(); + return this.resource; + } + + public boolean hasResource() { + if (this.resource == null) + return false; + for (CompartmentDefinitionResourceComponent item : this.resource) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #resource} (Information about how a resource it related to the compartment.) + */ + // syntactic sugar + public CompartmentDefinitionResourceComponent addResource() { //3 + CompartmentDefinitionResourceComponent t = new CompartmentDefinitionResourceComponent(); + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return t; + } + + // syntactic sugar + public CompartmentDefinition addResource(CompartmentDefinitionResourceComponent t) { //3 + if (t == null) + return this; + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the compartment definition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of this compartment definition definition.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the compartment definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A free text natural language description of the CompartmentDefinition and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("requirements", "string", "The Scope and Usage that this compartment definition was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("code", "code", "Which compartment this definition describes.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("search", "boolean", "Whether the search syntax is supported.", 0, java.lang.Integer.MAX_VALUE, search)); + childrenList.add(new Property("resource", "", "Information about how a resource it related to the compartment.", 0, java.lang.Integer.MAX_VALUE, resource)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // CompartmentDefinitionContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration + case -906336856: /*search*/ return this.search == null ? new Base[0] : new Base[] {this.search}; // BooleanType + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // CompartmentDefinitionResourceComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((CompartmentDefinitionContactComponent) value); // CompartmentDefinitionContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 3059181: // code + this.code = new CompartmentTypeEnumFactory().fromType(value); // Enumeration + break; + case -906336856: // search + this.search = castToBoolean(value); // BooleanType + break; + case -341064690: // resource + this.getResource().add((CompartmentDefinitionResourceComponent) value); // CompartmentDefinitionResourceComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((CompartmentDefinitionContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("code")) + this.code = new CompartmentTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("search")) + this.search = castToBoolean(value); // BooleanType + else if (name.equals("resource")) + this.getResource().add((CompartmentDefinitionResourceComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // CompartmentDefinitionContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration + case -906336856: throw new FHIRException("Cannot make property search as it is not a complex type"); // BooleanType + case -341064690: return addResource(); // CompartmentDefinitionResourceComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.url"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.description"); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.requirements"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.code"); + } + else if (name.equals("search")) { + throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.search"); + } + else if (name.equals("resource")) { + return addResource(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "CompartmentDefinition"; + + } + + public CompartmentDefinition copy() { + CompartmentDefinition dst = new CompartmentDefinition(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (CompartmentDefinitionContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.code = code == null ? null : code.copy(); + dst.search = search == null ? null : search.copy(); + if (resource != null) { + dst.resource = new ArrayList(); + for (CompartmentDefinitionResourceComponent i : resource) + dst.resource.add(i.copy()); + }; + return dst; + } + + protected CompartmentDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CompartmentDefinition)) + return false; + CompartmentDefinition o = (CompartmentDefinition) other; + return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) + && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(code, o.code, true) && compareDeep(search, o.search, true) + && compareDeep(resource, o.resource, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CompartmentDefinition)) + return false; + CompartmentDefinition o = (CompartmentDefinition) other; + return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(status, o.status, true) + && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(code, o.code, true) && compareValues(search, o.search, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) + && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) + && (description == null || description.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (code == null || code.isEmpty()) && (search == null || search.isEmpty()) && (resource == null || resource.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CompartmentDefinition; + } + + /** + * Search parameter: status + *

+ * Description: draft | active | retired
+ * Type: token
+ * Path: CompartmentDefinition.status
+ *

+ */ + @SearchParamDefinition(name="status", path="CompartmentDefinition.status", description="draft | active | retired", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: draft | active | retired
+ * Type: token
+ * Path: CompartmentDefinition.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: name + *

+ * Description: Informal name for this compartment definition
+ * Type: string
+ * Path: CompartmentDefinition.name
+ *

+ */ + @SearchParamDefinition(name="name", path="CompartmentDefinition.name", description="Informal name for this compartment definition", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Informal name for this compartment definition
+ * Type: string
+ * Path: CompartmentDefinition.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: resource + *

+ * Description: Name of resource type
+ * Type: token
+ * Path: CompartmentDefinition.resource.code
+ *

+ */ + @SearchParamDefinition(name="resource", path="CompartmentDefinition.resource.code", description="Name of resource type", type="token" ) + public static final String SP_RESOURCE = "resource"; + /** + * Fluent Client search parameter constant for resource + *

+ * Description: Name of resource type
+ * Type: token
+ * Path: CompartmentDefinition.resource.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESOURCE); + + /** + * Search parameter: code + *

+ * Description: Patient | Encounter | RelatedPerson | Practitioner | Device
+ * Type: token
+ * Path: CompartmentDefinition.code
+ *

+ */ + @SearchParamDefinition(name="code", path="CompartmentDefinition.code", description="Patient | Encounter | RelatedPerson | Practitioner | Device", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Patient | Encounter | RelatedPerson | Practitioner | Device
+ * Type: token
+ * Path: CompartmentDefinition.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: Publication Date(/time)
+ * Type: date
+ * Path: CompartmentDefinition.date
+ *

+ */ + @SearchParamDefinition(name="date", path="CompartmentDefinition.date", description="Publication Date(/time)", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Publication Date(/time)
+ * Type: date
+ * Path: CompartmentDefinition.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: url + *

+ * Description: Absolute URL used to reference this compartment definition
+ * Type: uri
+ * Path: CompartmentDefinition.url
+ *

+ */ + @SearchParamDefinition(name="url", path="CompartmentDefinition.url", description="Absolute URL used to reference this compartment definition", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: Absolute URL used to reference this compartment definition
+ * Type: uri
+ * Path: CompartmentDefinition.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Composition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Composition.java new file mode 100644 index 00000000000..b6df2d8c49a --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Composition.java @@ -0,0 +1,2742 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. + */ +@ResourceDef(name="Composition", profile="http://hl7.org/fhir/Profile/Composition") +public class Composition extends DomainResource { + + public enum CompositionStatus { + /** + * This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified. + */ + PRELIMINARY, + /** + * This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition. + */ + FINAL, + /** + * The composition content or the referenced resources have been modified (edited or added to) subsequent to being released as "final" and the composition is complete and verified by an authorized person. + */ + AMENDED, + /** + * The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static CompositionStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("preliminary".equals(codeString)) + return PRELIMINARY; + if ("final".equals(codeString)) + return FINAL; + if ("amended".equals(codeString)) + return AMENDED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown CompositionStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PRELIMINARY: return "preliminary"; + case FINAL: return "final"; + case AMENDED: return "amended"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PRELIMINARY: return "http://hl7.org/fhir/composition-status"; + case FINAL: return "http://hl7.org/fhir/composition-status"; + case AMENDED: return "http://hl7.org/fhir/composition-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/composition-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PRELIMINARY: return "This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified."; + case FINAL: return "This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition."; + case AMENDED: return "The composition content or the referenced resources have been modified (edited or added to) subsequent to being released as \"final\" and the composition is complete and verified by an authorized person."; + case ENTEREDINERROR: return "The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PRELIMINARY: return "Preliminary"; + case FINAL: return "Final"; + case AMENDED: return "Amended"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + 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; + if ("preliminary".equals(codeString)) + return CompositionStatus.PRELIMINARY; + if ("final".equals(codeString)) + return CompositionStatus.FINAL; + if ("amended".equals(codeString)) + return CompositionStatus.AMENDED; + if ("entered-in-error".equals(codeString)) + return CompositionStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("preliminary".equals(codeString)) + return new Enumeration(this, CompositionStatus.PRELIMINARY); + if ("final".equals(codeString)) + return new Enumeration(this, CompositionStatus.FINAL); + if ("amended".equals(codeString)) + return new Enumeration(this, CompositionStatus.AMENDED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, CompositionStatus.ENTEREDINERROR); + throw new FHIRException("Unknown CompositionStatus code '"+codeString+"'"); + } + public String toCode(CompositionStatus code) { + if (code == CompositionStatus.PRELIMINARY) + return "preliminary"; + if (code == CompositionStatus.FINAL) + return "final"; + if (code == CompositionStatus.AMENDED) + return "amended"; + if (code == CompositionStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(CompositionStatus code) { + return code.getSystem(); + } + } + + public enum CompositionAttestationMode { + /** + * The person authenticated the content in their personal capacity. + */ + PERSONAL, + /** + * The person authenticated the content in their professional capacity. + */ + PROFESSIONAL, + /** + * The person authenticated the content and accepted legal responsibility for its content. + */ + LEGAL, + /** + * The organization authenticated the content as consistent with their policies and procedures. + */ + OFFICIAL, + /** + * added to help the parsers + */ + NULL; + public static CompositionAttestationMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("personal".equals(codeString)) + return PERSONAL; + if ("professional".equals(codeString)) + return PROFESSIONAL; + if ("legal".equals(codeString)) + return LEGAL; + if ("official".equals(codeString)) + return OFFICIAL; + throw new FHIRException("Unknown CompositionAttestationMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PERSONAL: return "personal"; + case PROFESSIONAL: return "professional"; + case LEGAL: return "legal"; + case OFFICIAL: return "official"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PERSONAL: return "http://hl7.org/fhir/composition-attestation-mode"; + case PROFESSIONAL: return "http://hl7.org/fhir/composition-attestation-mode"; + case LEGAL: return "http://hl7.org/fhir/composition-attestation-mode"; + case OFFICIAL: return "http://hl7.org/fhir/composition-attestation-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PERSONAL: return "The person authenticated the content in their personal capacity."; + case PROFESSIONAL: return "The person authenticated the content in their professional capacity."; + case LEGAL: return "The person authenticated the content and accepted legal responsibility for its content."; + case OFFICIAL: return "The organization authenticated the content as consistent with their policies and procedures."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PERSONAL: return "Personal"; + case PROFESSIONAL: return "Professional"; + case LEGAL: return "Legal"; + case OFFICIAL: return "Official"; + default: return "?"; + } + } + } + + 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; + if ("personal".equals(codeString)) + return CompositionAttestationMode.PERSONAL; + if ("professional".equals(codeString)) + return CompositionAttestationMode.PROFESSIONAL; + if ("legal".equals(codeString)) + return CompositionAttestationMode.LEGAL; + if ("official".equals(codeString)) + return CompositionAttestationMode.OFFICIAL; + throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("personal".equals(codeString)) + return new Enumeration(this, CompositionAttestationMode.PERSONAL); + if ("professional".equals(codeString)) + return new Enumeration(this, CompositionAttestationMode.PROFESSIONAL); + if ("legal".equals(codeString)) + return new Enumeration(this, CompositionAttestationMode.LEGAL); + if ("official".equals(codeString)) + return new Enumeration(this, CompositionAttestationMode.OFFICIAL); + throw new FHIRException("Unknown CompositionAttestationMode code '"+codeString+"'"); + } + public String toCode(CompositionAttestationMode code) { + if (code == CompositionAttestationMode.PERSONAL) + return "personal"; + if (code == CompositionAttestationMode.PROFESSIONAL) + return "professional"; + if (code == CompositionAttestationMode.LEGAL) + return "legal"; + if (code == CompositionAttestationMode.OFFICIAL) + return "official"; + return "?"; + } + public String toSystem(CompositionAttestationMode code) { + return code.getSystem(); + } + } + + @Block() + public static class CompositionAttesterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of attestation the authenticator offers. + */ + @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="personal | professional | legal | official", formalDefinition="The type of attestation the authenticator offers." ) + protected List> mode; + + /** + * When composition was attested by the party. + */ + @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When composition attested", formalDefinition="When composition was attested by the party." ) + protected DateTimeType time; + + /** + * Who attested the composition in the specified way. + */ + @Child(name = "party", type = {Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who attested the composition", formalDefinition="Who attested the composition in the specified way." ) + protected Reference party; + + /** + * The actual object that is the target of the reference (Who attested the composition in the specified way.) + */ + protected Resource partyTarget; + + private static final long serialVersionUID = -436604745L; + + /** + * Constructor + */ + public CompositionAttesterComponent() { + super(); + } + + /** + * @return {@link #mode} (The type of attestation the authenticator offers.) + */ + public List> getMode() { + if (this.mode == null) + this.mode = new ArrayList>(); + return this.mode; + } + + public boolean hasMode() { + if (this.mode == null) + return false; + for (Enumeration item : this.mode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mode} (The type of attestation the authenticator offers.) + */ + // syntactic sugar + public Enumeration addModeElement() {//2 + Enumeration t = new Enumeration(new CompositionAttestationModeEnumFactory()); + if (this.mode == null) + this.mode = new ArrayList>(); + this.mode.add(t); + return t; + } + + /** + * @param value {@link #mode} (The type of attestation the authenticator offers.) + */ + public CompositionAttesterComponent addMode(CompositionAttestationMode value) { //1 + Enumeration t = new Enumeration(new CompositionAttestationModeEnumFactory()); + t.setValue(value); + if (this.mode == null) + this.mode = new ArrayList>(); + this.mode.add(t); + return this; + } + + /** + * @param value {@link #mode} (The type of attestation the authenticator offers.) + */ + public boolean hasMode(CompositionAttestationMode value) { + if (this.mode == null) + return false; + for (Enumeration v : this.mode) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DateTimeType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionAttesterComponent.time"); + else if (Configuration.doAutoCreate()) + this.time = new DateTimeType(); // bb + 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} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public CompositionAttesterComponent setTimeElement(DateTimeType value) { + this.time = value; + return this; + } + + /** + * @return When composition was attested by the party. + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value When composition was attested by the party. + */ + public CompositionAttesterComponent setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new DateTimeType(); + this.time.setValue(value); + } + return this; + } + + /** + * @return {@link #party} (Who attested the composition in the specified way.) + */ + public Reference getParty() { + if (this.party == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionAttesterComponent.party"); + else if (Configuration.doAutoCreate()) + this.party = new Reference(); // cc + return this.party; + } + + public boolean hasParty() { + return this.party != null && !this.party.isEmpty(); + } + + /** + * @param value {@link #party} (Who attested the composition in the specified way.) + */ + public CompositionAttesterComponent setParty(Reference value) { + this.party = value; + return this; + } + + /** + * @return {@link #party} 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. (Who attested the composition in the specified way.) + */ + public Resource getPartyTarget() { + return this.partyTarget; + } + + /** + * @param value {@link #party} 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. (Who attested the composition in the specified way.) + */ + public CompositionAttesterComponent setPartyTarget(Resource value) { + this.partyTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "The type of attestation the authenticator offers.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("time", "dateTime", "When composition was attested by the party.", 0, java.lang.Integer.MAX_VALUE, time)); + childrenList.add(new Property("party", "Reference(Patient|Practitioner|Organization)", "Who attested the composition in the specified way.", 0, java.lang.Integer.MAX_VALUE, party)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : this.mode.toArray(new Base[this.mode.size()]); // Enumeration + case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType + case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3357091: // mode + this.getMode().add(new CompositionAttestationModeEnumFactory().fromType(value)); // Enumeration + break; + case 3560141: // time + this.time = castToDateTime(value); // DateTimeType + break; + case 106437350: // party + this.party = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("mode")) + this.getMode().add(new CompositionAttestationModeEnumFactory().fromType(value)); + else if (name.equals("time")) + this.time = castToDateTime(value); // DateTimeType + else if (name.equals("party")) + this.party = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 3560141: throw new FHIRException("Cannot make property time as it is not a complex type"); // DateTimeType + case 106437350: return getParty(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type Composition.mode"); + } + else if (name.equals("time")) { + throw new FHIRException("Cannot call addChild on a primitive type Composition.time"); + } + else if (name.equals("party")) { + this.party = new Reference(); + return this.party; + } + else + return super.addChild(name); + } + + public CompositionAttesterComponent copy() { + CompositionAttesterComponent dst = new CompositionAttesterComponent(); + copyValues(dst); + if (mode != null) { + dst.mode = new ArrayList>(); + for (Enumeration i : mode) + dst.mode.add(i.copy()); + }; + dst.time = time == null ? null : time.copy(); + dst.party = party == null ? null : party.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CompositionAttesterComponent)) + return false; + CompositionAttesterComponent o = (CompositionAttesterComponent) other; + return compareDeep(mode, o.mode, true) && compareDeep(time, o.time, true) && compareDeep(party, o.party, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CompositionAttesterComponent)) + return false; + CompositionAttesterComponent o = (CompositionAttesterComponent) other; + return compareValues(mode, o.mode, true) && compareValues(time, o.time, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (time == null || time.isEmpty()) + && (party == null || party.isEmpty()); + } + + public String fhirType() { + return "Composition.attester"; + + } + + } + + @Block() + public static class CompositionEventComponent extends BackboneElement implements IBaseBackboneElement { + /** + * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Code(s) that apply to the event being documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act." ) + protected List code; + + /** + * The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The period covered by the documentation", formalDefinition="The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time." ) + protected Period period; + + /** + * The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy. + */ + @Child(name = "detail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The event(s) being documented", formalDefinition="The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy." ) + protected List detail; + /** + * The actual objects that are the target of the reference (The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = -1581379774L; + + /** + * Constructor + */ + public CompositionEventComponent() { + super(); + } + + /** + * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (CodeableConcept item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + // syntactic sugar + public CodeableConcept addCode() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + // syntactic sugar + public CompositionEventComponent addCode(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return this; + } + + /** + * @return {@link #period} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionEventComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) + */ + public CompositionEventComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #detail} (The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public CompositionEventComponent addDetail(Reference t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #detail} (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 description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("period", "Period", "The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("detail", "Reference(Any)", "The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.getCode().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -1335224239: // detail + this.getDetail().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.getCode().add(castToCodeableConcept(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("detail")) + this.getDetail().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return addCode(); // CodeableConcept + case -991726143: return getPeriod(); // Period + case -1335224239: return addDetail(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + return addCode(); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("detail")) { + return addDetail(); + } + else + return super.addChild(name); + } + + public CompositionEventComponent copy() { + CompositionEventComponent dst = new CompositionEventComponent(); + copyValues(dst); + if (code != null) { + dst.code = new ArrayList(); + for (CodeableConcept i : code) + dst.code.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CompositionEventComponent)) + return false; + CompositionEventComponent o = (CompositionEventComponent) other; + return compareDeep(code, o.code, true) && compareDeep(period, o.period, true) && compareDeep(detail, o.detail, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CompositionEventComponent)) + return false; + CompositionEventComponent o = (CompositionEventComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (period == null || period.isEmpty()) + && (detail == null || detail.isEmpty()); + } + + public String fhirType() { + return "Composition.event"; + + } + + } + + @Block() + public static class SectionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Label for section (e.g. for ToC)", formalDefinition="The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents." ) + protected StringType title; + + /** + * A code identifying the kind of content contained within the section. This must be consistent with the section title. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Classification of section (recommended)", formalDefinition="A code identifying the kind of content contained within the section. This must be consistent with the section title." ) + protected CodeableConcept code; + + /** + * A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. + */ + @Child(name = "text", type = {Narrative.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Text summary of the section, for human interpretation", formalDefinition="A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative." ) + protected Narrative text; + + /** + * How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + @Child(name = "mode", type = {CodeType.class}, order=4, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="working | snapshot | changes", formalDefinition="How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted." ) + protected CodeType mode; + + /** + * Specifies the order applied to the items in the section entries. + */ + @Child(name = "orderedBy", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Order of section entries", formalDefinition="Specifies the order applied to the items in the section entries." ) + protected CodeableConcept orderedBy; + + /** + * A reference to the actual resource from which the narrative in the section is derived. + */ + @Child(name = "entry", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A reference to data that supports this section", formalDefinition="A reference to the actual resource from which the narrative in the section is derived." ) + protected List entry; + /** + * The actual objects that are the target of the reference (A reference to the actual resource from which the narrative in the section is derived.) + */ + protected List entryTarget; + + + /** + * If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason. + */ + @Child(name = "emptyReason", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why the section is empty", formalDefinition="If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason." ) + protected CodeableConcept emptyReason; + + /** + * A nested sub-section within this section. + */ + @Child(name = "section", type = {SectionComponent.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Nested Section", formalDefinition="A nested sub-section within this section." ) + protected List section; + + private static final long serialVersionUID = -726390626L; + + /** + * Constructor + */ + public SectionComponent() { + super(); + } + + /** + * @return {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public SectionComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + public SectionComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) + */ + public SectionComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #text} (A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative.) + */ + public Narrative getText() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new Narrative(); // cc + return this.text; + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative.) + */ + public SectionComponent setText(Narrative value) { + this.text = value; + return this; + } + + /** + * @return {@link #mode} (How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public CodeType getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new CodeType(); // bb + 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} (How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public SectionComponent setModeElement(CodeType value) { + this.mode = value; + return this; + } + + /** + * @return How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + public String getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + public SectionComponent setMode(String value) { + if (Utilities.noString(value)) + this.mode = null; + else { + if (this.mode == null) + this.mode = new CodeType(); + this.mode.setValue(value); + } + return this; + } + + /** + * @return {@link #orderedBy} (Specifies the order applied to the items in the section entries.) + */ + public CodeableConcept getOrderedBy() { + if (this.orderedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.orderedBy"); + else if (Configuration.doAutoCreate()) + this.orderedBy = new CodeableConcept(); // cc + return this.orderedBy; + } + + public boolean hasOrderedBy() { + return this.orderedBy != null && !this.orderedBy.isEmpty(); + } + + /** + * @param value {@link #orderedBy} (Specifies the order applied to the items in the section entries.) + */ + public SectionComponent setOrderedBy(CodeableConcept value) { + this.orderedBy = value; + return this; + } + + /** + * @return {@link #entry} (A reference to the actual resource from which the narrative in the section is derived.) + */ + public List getEntry() { + if (this.entry == null) + this.entry = new ArrayList(); + return this.entry; + } + + public boolean hasEntry() { + if (this.entry == null) + return false; + for (Reference item : this.entry) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entry} (A reference to the actual resource from which the narrative in the section is derived.) + */ + // syntactic sugar + public Reference addEntry() { //3 + Reference t = new Reference(); + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return t; + } + + // syntactic sugar + public SectionComponent addEntry(Reference t) { //3 + if (t == null) + return this; + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return this; + } + + /** + * @return {@link #entry} (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 reference to the actual resource from which the narrative in the section is derived.) + */ + public List getEntryTarget() { + if (this.entryTarget == null) + this.entryTarget = new ArrayList(); + return this.entryTarget; + } + + /** + * @return {@link #emptyReason} (If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.) + */ + public CodeableConcept getEmptyReason() { + if (this.emptyReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.emptyReason"); + else if (Configuration.doAutoCreate()) + this.emptyReason = new CodeableConcept(); // cc + return this.emptyReason; + } + + public boolean hasEmptyReason() { + return this.emptyReason != null && !this.emptyReason.isEmpty(); + } + + /** + * @param value {@link #emptyReason} (If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.) + */ + public SectionComponent setEmptyReason(CodeableConcept value) { + this.emptyReason = value; + return this; + } + + /** + * @return {@link #section} (A nested sub-section within this section.) + */ + public List getSection() { + if (this.section == null) + this.section = new ArrayList(); + return this.section; + } + + public boolean hasSection() { + if (this.section == null) + return false; + for (SectionComponent item : this.section) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #section} (A nested sub-section within this section.) + */ + // syntactic sugar + public SectionComponent addSection() { //3 + SectionComponent t = new SectionComponent(); + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return t; + } + + // syntactic sugar + public SectionComponent addSection(SectionComponent t) { //3 + if (t == null) + return this; + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("title", "string", "The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("code", "CodeableConcept", "A code identifying the kind of content contained within the section. This must be consistent with the section title.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("text", "Narrative", "A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("mode", "code", "How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("orderedBy", "CodeableConcept", "Specifies the order applied to the items in the section entries.", 0, java.lang.Integer.MAX_VALUE, orderedBy)); + childrenList.add(new Property("entry", "Reference(Any)", "A reference to the actual resource from which the narrative in the section is derived.", 0, java.lang.Integer.MAX_VALUE, entry)); + childrenList.add(new Property("emptyReason", "CodeableConcept", "If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.", 0, java.lang.Integer.MAX_VALUE, emptyReason)); + childrenList.add(new Property("section", "@Composition.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // Narrative + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // CodeType + case -391079516: /*orderedBy*/ return this.orderedBy == null ? new Base[0] : new Base[] {this.orderedBy}; // CodeableConcept + case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // Reference + case 1140135409: /*emptyReason*/ return this.emptyReason == null ? new Base[0] : new Base[] {this.emptyReason}; // CodeableConcept + case 1970241253: /*section*/ return this.section == null ? new Base[0] : this.section.toArray(new Base[this.section.size()]); // SectionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 110371416: // title + this.title = castToString(value); // StringType + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 3556653: // text + this.text = castToNarrative(value); // Narrative + break; + case 3357091: // mode + this.mode = castToCode(value); // CodeType + break; + case -391079516: // orderedBy + this.orderedBy = castToCodeableConcept(value); // CodeableConcept + break; + case 96667762: // entry + this.getEntry().add(castToReference(value)); // Reference + break; + case 1140135409: // emptyReason + this.emptyReason = castToCodeableConcept(value); // CodeableConcept + break; + case 1970241253: // section + this.getSection().add((SectionComponent) value); // SectionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("text")) + this.text = castToNarrative(value); // Narrative + else if (name.equals("mode")) + this.mode = castToCode(value); // CodeType + else if (name.equals("orderedBy")) + this.orderedBy = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("entry")) + this.getEntry().add(castToReference(value)); + else if (name.equals("emptyReason")) + this.emptyReason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("section")) + this.getSection().add((SectionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case 3059181: return getCode(); // CodeableConcept + case 3556653: return getText(); // Narrative + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // CodeType + case -391079516: return getOrderedBy(); // CodeableConcept + case 96667762: return addEntry(); // Reference + case 1140135409: return getEmptyReason(); // CodeableConcept + case 1970241253: return addSection(); // SectionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type Composition.title"); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("text")) { + this.text = new Narrative(); + return this.text; + } + else if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type Composition.mode"); + } + else if (name.equals("orderedBy")) { + this.orderedBy = new CodeableConcept(); + return this.orderedBy; + } + else if (name.equals("entry")) { + return addEntry(); + } + else if (name.equals("emptyReason")) { + this.emptyReason = new CodeableConcept(); + return this.emptyReason; + } + else if (name.equals("section")) { + return addSection(); + } + else + return super.addChild(name); + } + + public SectionComponent copy() { + SectionComponent dst = new SectionComponent(); + copyValues(dst); + dst.title = title == null ? null : title.copy(); + dst.code = code == null ? null : code.copy(); + dst.text = text == null ? null : text.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.orderedBy = orderedBy == null ? null : orderedBy.copy(); + if (entry != null) { + dst.entry = new ArrayList(); + for (Reference i : entry) + dst.entry.add(i.copy()); + }; + dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); + if (section != null) { + dst.section = new ArrayList(); + for (SectionComponent i : section) + dst.section.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SectionComponent)) + return false; + SectionComponent o = (SectionComponent) other; + return compareDeep(title, o.title, true) && compareDeep(code, o.code, true) && compareDeep(text, o.text, true) + && compareDeep(mode, o.mode, true) && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(entry, o.entry, true) + && compareDeep(emptyReason, o.emptyReason, true) && compareDeep(section, o.section, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SectionComponent)) + return false; + SectionComponent o = (SectionComponent) other; + return compareValues(title, o.title, true) && compareValues(mode, o.mode, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (title == null || title.isEmpty()) && (code == null || code.isEmpty()) + && (text == null || text.isEmpty()) && (mode == null || mode.isEmpty()) && (orderedBy == null || orderedBy.isEmpty()) + && (entry == null || entry.isEmpty()) && (emptyReason == null || emptyReason.isEmpty()) && (section == null || section.isEmpty()) + ; + } + + public String fhirType() { + return "Composition.section"; + + } + + } + + /** + * Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical identifier of composition (version-independent)", formalDefinition="Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time." ) + protected Identifier identifier; + + /** + * The composition editing time, when the composition was last logically changed by the author. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Composition editing time", formalDefinition="The composition editing time, when the composition was last logically changed by the author." ) + protected DateTimeType date; + + /** + * Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Kind of composition (LOINC if possible)", formalDefinition="Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition." ) + protected CodeableConcept type; + + /** + * A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type. + */ + @Child(name = "class", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Categorization of Composition", formalDefinition="A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type." ) + protected CodeableConcept class_; + + /** + * Official human-readable label for the composition. + */ + @Child(name = "title", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human Readable name/title", formalDefinition="Official human-readable label for the composition." ) + protected StringType title; + + /** + * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="preliminary | final | amended | entered-in-error", formalDefinition="The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document." ) + protected Enumeration status; + + /** + * The code specifying the level of confidentiality of the Composition. + */ + @Child(name = "confidentiality", type = {CodeType.class}, order=6, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="As defined by affinity domain", formalDefinition="The code specifying the level of confidentiality of the Composition." ) + protected CodeType confidentiality; + + /** + * Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure). + */ + @Child(name = "subject", type = {}, order=7, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who and/or what the composition is about", formalDefinition="Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + protected Resource subjectTarget; + + /** + * Identifies who is responsible for the information in the composition, not necessarily who typed it in. + */ + @Child(name = "author", type = {Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=8, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who and/or what authored the composition", formalDefinition="Identifies who is responsible for the information in the composition, not necessarily who typed it in." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for the information in the composition, not necessarily who typed it in.) + */ + protected List authorTarget; + + + /** + * A participant who has attested to the accuracy of the composition/document. + */ + @Child(name = "attester", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Attests to accuracy of composition", formalDefinition="A participant who has attested to the accuracy of the composition/document." ) + protected List attester; + + /** + * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. + */ + @Child(name = "custodian", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization which maintains the composition", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information." ) + protected Reference custodian; + + /** + * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + protected Organization custodianTarget; + + /** + * The clinical service, such as a colonoscopy or an appendectomy, being documented. + */ + @Child(name = "event", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The clinical service(s) being documented", formalDefinition="The clinical service, such as a colonoscopy or an appendectomy, being documented." ) + protected List event; + + /** + * Describes the clinical encounter or type of care this documentation is associated with. + */ + @Child(name = "encounter", type = {Encounter.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Context of the Composition", formalDefinition="Describes the clinical encounter or type of care this documentation is associated with." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Describes the clinical encounter or type of care this documentation is associated with.) + */ + protected Encounter encounterTarget; + + /** + * The root of the sections that make up the composition. + */ + @Child(name = "section", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Composition is broken into sections", formalDefinition="The root of the sections that make up the composition." ) + protected List section; + + private static final long serialVersionUID = 2127852326L; + + /** + * Constructor + */ + public Composition() { + super(); + } + + /** + * Constructor + */ + public Composition(DateTimeType date, CodeableConcept type, StringType title, Enumeration status, Reference subject) { + super(); + this.date = date; + this.type = type; + this.title = title; + this.status = status; + this.subject = subject; + } + + /** + * @return {@link #identifier} (Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) + */ + public Composition setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #date} (The composition editing time, when the composition was last logically changed by the author.). 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 Composition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Composition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The composition editing time, when the composition was last logically changed by the author. + */ + 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(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) + */ + public Composition setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #class_} (A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.) + */ + public CodeableConcept getClass_() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new CodeableConcept(); // cc + return this.class_; + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.) + */ + public Composition setClass_(CodeableConcept value) { + this.class_ = value; + return this; + } + + /** + * @return {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public Composition setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return Official human-readable label for the composition. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value Official human-readable label for the composition. + */ + public Composition setTitle(String value) { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + return this; + } + + /** + * @return {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). 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 Composition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CompositionStatusEnumFactory()); // bb + 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 workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Composition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + public CompositionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + public Composition setStatus(CompositionStatus value) { + if (this.status == null) + this.status = new Enumeration(new CompositionStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.). This is the underlying object with id, value and extensions. The accessor "getConfidentiality" gives direct access to the value + */ + public CodeType getConfidentialityElement() { + if (this.confidentiality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.confidentiality"); + else if (Configuration.doAutoCreate()) + this.confidentiality = new CodeType(); // bb + return this.confidentiality; + } + + public boolean hasConfidentialityElement() { + return this.confidentiality != null && !this.confidentiality.isEmpty(); + } + + public boolean hasConfidentiality() { + return this.confidentiality != null && !this.confidentiality.isEmpty(); + } + + /** + * @param value {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.). This is the underlying object with id, value and extensions. The accessor "getConfidentiality" gives direct access to the value + */ + public Composition setConfidentialityElement(CodeType value) { + this.confidentiality = value; + return this; + } + + /** + * @return The code specifying the level of confidentiality of the Composition. + */ + public String getConfidentiality() { + return this.confidentiality == null ? null : this.confidentiality.getValue(); + } + + /** + * @param value The code specifying the level of confidentiality of the Composition. + */ + public Composition setConfidentiality(String value) { + if (Utilities.noString(value)) + this.confidentiality = null; + else { + if (this.confidentiality == null) + this.confidentiality = new CodeType(); + this.confidentiality.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Composition 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. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Resource getSubjectTarget() { + 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. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Composition setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (Identifies who is responsible for the information in the composition, not necessarily who typed it in.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for the information in the composition, not necessarily who typed it in.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + // syntactic sugar + public Composition addAuthor(Reference t) { //3 + if (t == null) + return this; + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return this; + } + + /** + * @return {@link #author} (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 is responsible for the information in the composition, not necessarily who typed it in.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) + */ + public List getAttester() { + if (this.attester == null) + this.attester = new ArrayList(); + return this.attester; + } + + public boolean hasAttester() { + if (this.attester == null) + return false; + for (CompositionAttesterComponent item : this.attester) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) + */ + // syntactic sugar + public CompositionAttesterComponent addAttester() { //3 + CompositionAttesterComponent t = new CompositionAttesterComponent(); + if (this.attester == null) + this.attester = new ArrayList(); + this.attester.add(t); + return t; + } + + // syntactic sugar + public Composition addAttester(CompositionAttesterComponent t) { //3 + if (t == null) + return this; + if (this.attester == null) + this.attester = new ArrayList(); + this.attester.add(t); + return this; + } + + /** + * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Reference getCustodian() { + if (this.custodian == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.custodian"); + else if (Configuration.doAutoCreate()) + this.custodian = new Reference(); // cc + return this.custodian; + } + + public boolean hasCustodian() { + return this.custodian != null && !this.custodian.isEmpty(); + } + + /** + * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Composition setCustodian(Reference value) { + this.custodian = value; + return this; + } + + /** + * @return {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Organization getCustodianTarget() { + if (this.custodianTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.custodian"); + else if (Configuration.doAutoCreate()) + this.custodianTarget = new Organization(); // aa + return this.custodianTarget; + } + + /** + * @param value {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Composition setCustodianTarget(Organization value) { + this.custodianTarget = value; + return this; + } + + /** + * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (CompositionEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) + */ + // syntactic sugar + public CompositionEventComponent addEvent() { //3 + CompositionEventComponent t = new CompositionEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public Composition addEvent(CompositionEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + /** + * @return {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Composition 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. (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Composition setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #section} (The root of the sections that make up the composition.) + */ + public List getSection() { + if (this.section == null) + this.section = new ArrayList(); + return this.section; + } + + public boolean hasSection() { + if (this.section == null) + return false; + for (SectionComponent item : this.section) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #section} (The root of the sections that make up the composition.) + */ + // syntactic sugar + public SectionComponent addSection() { //3 + SectionComponent t = new SectionComponent(); + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return t; + } + + // syntactic sugar + public Composition addSection(SectionComponent t) { //3 + if (t == null) + return this; + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("title", "string", "Official human-readable label for the composition.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("status", "code", "The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("confidentiality", "code", "The code specifying the level of confidentiality of the Composition.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); + childrenList.add(new Property("subject", "Reference(Any)", "Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for the information in the composition, not necessarily who typed it in.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester)); + childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.", 0, java.lang.Integer.MAX_VALUE, custodian)); + childrenList.add(new Property("event", "", "The clinical service, such as a colonoscopy or an appendectomy, being documented.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // CodeableConcept + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -1923018202: /*confidentiality*/ return this.confidentiality == null ? new Base[0] : new Base[] {this.confidentiality}; // CodeType + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference + case 542920370: /*attester*/ return this.attester == null ? new Base[0] : this.attester.toArray(new Base[this.attester.size()]); // CompositionAttesterComponent + case 1611297262: /*custodian*/ return this.custodian == null ? new Base[0] : new Base[] {this.custodian}; // Reference + case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // CompositionEventComponent + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 1970241253: /*section*/ return this.section == null ? new Base[0] : this.section.toArray(new Base[this.section.size()]); // SectionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case 94742904: // class + this.class_ = castToCodeableConcept(value); // CodeableConcept + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case -892481550: // status + this.status = new CompositionStatusEnumFactory().fromType(value); // Enumeration + break; + case -1923018202: // confidentiality + this.confidentiality = castToCode(value); // CodeType + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -1406328437: // author + this.getAuthor().add(castToReference(value)); // Reference + break; + case 542920370: // attester + this.getAttester().add((CompositionAttesterComponent) value); // CompositionAttesterComponent + break; + case 1611297262: // custodian + this.custodian = castToReference(value); // Reference + break; + case 96891546: // event + this.getEvent().add((CompositionEventComponent) value); // CompositionEventComponent + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 1970241253: // section + this.getSection().add((SectionComponent) value); // SectionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("class")) + this.class_ = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("status")) + this.status = new CompositionStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("confidentiality")) + this.confidentiality = castToCode(value); // CodeType + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("author")) + this.getAuthor().add(castToReference(value)); + else if (name.equals("attester")) + this.getAttester().add((CompositionAttesterComponent) value); + else if (name.equals("custodian")) + this.custodian = castToReference(value); // Reference + else if (name.equals("event")) + this.getEvent().add((CompositionEventComponent) value); + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("section")) + this.getSection().add((SectionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 3575610: return getType(); // CodeableConcept + case 94742904: return getClass_(); // CodeableConcept + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -1923018202: throw new FHIRException("Cannot make property confidentiality as it is not a complex type"); // CodeType + case -1867885268: return getSubject(); // Reference + case -1406328437: return addAuthor(); // Reference + case 542920370: return addAttester(); // CompositionAttesterComponent + case 1611297262: return getCustodian(); // Reference + case 96891546: return addEvent(); // CompositionEventComponent + case 1524132147: return getEncounter(); // Reference + case 1970241253: return addSection(); // SectionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type Composition.date"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("class")) { + this.class_ = new CodeableConcept(); + return this.class_; + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type Composition.title"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Composition.status"); + } + else if (name.equals("confidentiality")) { + throw new FHIRException("Cannot call addChild on a primitive type Composition.confidentiality"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("author")) { + return addAuthor(); + } + else if (name.equals("attester")) { + return addAttester(); + } + else if (name.equals("custodian")) { + this.custodian = new Reference(); + return this.custodian; + } + else if (name.equals("event")) { + return addEvent(); + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("section")) { + return addSection(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Composition"; + + } + + public Composition copy() { + Composition dst = new Composition(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.date = date == null ? null : date.copy(); + dst.type = type == null ? null : type.copy(); + dst.class_ = class_ == null ? null : class_.copy(); + dst.title = title == null ? null : title.copy(); + dst.status = status == null ? null : status.copy(); + dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); + dst.subject = subject == null ? null : subject.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + if (attester != null) { + dst.attester = new ArrayList(); + for (CompositionAttesterComponent i : attester) + dst.attester.add(i.copy()); + }; + dst.custodian = custodian == null ? null : custodian.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (CompositionEventComponent i : event) + dst.event.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + if (section != null) { + dst.section = new ArrayList(); + for (SectionComponent i : section) + dst.section.add(i.copy()); + }; + return dst; + } + + protected Composition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Composition)) + return false; + Composition o = (Composition) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(type, o.type, true) + && compareDeep(class_, o.class_, true) && compareDeep(title, o.title, true) && compareDeep(status, o.status, true) + && compareDeep(confidentiality, o.confidentiality, true) && compareDeep(subject, o.subject, true) + && compareDeep(author, o.author, true) && compareDeep(attester, o.attester, true) && compareDeep(custodian, o.custodian, true) + && compareDeep(event, o.event, true) && compareDeep(encounter, o.encounter, true) && compareDeep(section, o.section, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Composition)) + return false; + Composition o = (Composition) other; + return compareValues(date, o.date, true) && compareValues(title, o.title, true) && compareValues(status, o.status, true) + && compareValues(confidentiality, o.confidentiality, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) + && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) && (title == null || title.isEmpty()) + && (status == null || status.isEmpty()) && (confidentiality == null || confidentiality.isEmpty()) + && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (attester == null || attester.isEmpty()) + && (custodian == null || custodian.isEmpty()) && (event == null || event.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (section == null || section.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Composition; + } + + /** + * Search parameter: status + *

+ * Description: preliminary | final | amended | entered-in-error
+ * Type: token
+ * Path: Composition.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Composition.status", description="preliminary | final | amended | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: preliminary | final | amended | entered-in-error
+ * Type: token
+ * Path: Composition.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: Who and/or what the composition is about
+ * Type: reference
+ * Path: Composition.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Who and/or what the composition is about
+ * Type: reference
+ * Path: Composition.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Composition:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Composition:subject").toLocked(); + + /** + * Search parameter: class + *

+ * Description: Categorization of Composition
+ * Type: token
+ * Path: Composition.class
+ *

+ */ + @SearchParamDefinition(name="class", path="Composition.class", description="Categorization of Composition", type="token" ) + public static final String SP_CLASS = "class"; + /** + * Fluent Client search parameter constant for class + *

+ * Description: Categorization of Composition
+ * Type: token
+ * Path: Composition.class
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASS); + + /** + * Search parameter: encounter + *

+ * Description: Context of the Composition
+ * Type: reference
+ * Path: Composition.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="Composition.encounter", description="Context of the Composition", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Context of the Composition
+ * Type: reference
+ * Path: Composition.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Composition:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Composition:encounter").toLocked(); + + /** + * Search parameter: period + *

+ * Description: The period covered by the documentation
+ * Type: date
+ * Path: Composition.event.period
+ *

+ */ + @SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" ) + public static final String SP_PERIOD = "period"; + /** + * Fluent Client search parameter constant for period + *

+ * Description: The period covered by the documentation
+ * Type: date
+ * Path: Composition.event.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); + + /** + * Search parameter: type + *

+ * Description: Kind of composition (LOINC if possible)
+ * Type: token
+ * Path: Composition.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Composition.type", description="Kind of composition (LOINC if possible)", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Kind of composition (LOINC if possible)
+ * Type: token
+ * Path: Composition.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: date + *

+ * Description: Composition editing time
+ * Type: date
+ * Path: Composition.date
+ *

+ */ + @SearchParamDefinition(name="date", path="Composition.date", description="Composition editing time", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Composition editing time
+ * Type: date
+ * Path: Composition.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: section + *

+ * Description: Classification of section (recommended)
+ * Type: token
+ * Path: Composition.section.code
+ *

+ */ + @SearchParamDefinition(name="section", path="Composition.section.code", description="Classification of section (recommended)", type="token" ) + public static final String SP_SECTION = "section"; + /** + * Fluent Client search parameter constant for section + *

+ * Description: Classification of section (recommended)
+ * Type: token
+ * Path: Composition.section.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECTION); + + /** + * Search parameter: author + *

+ * Description: Who and/or what authored the composition
+ * Type: reference
+ * Path: Composition.author
+ *

+ */ + @SearchParamDefinition(name="author", path="Composition.author", description="Who and/or what authored the composition", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: Who and/or what authored the composition
+ * Type: reference
+ * Path: Composition.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Composition:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Composition:author").toLocked(); + + /** + * Search parameter: title + *

+ * Description: Human Readable name/title
+ * Type: string
+ * Path: Composition.title
+ *

+ */ + @SearchParamDefinition(name="title", path="Composition.title", description="Human Readable name/title", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Human Readable name/title
+ * Type: string
+ * Path: Composition.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: patient + *

+ * Description: Who and/or what the composition is about
+ * Type: reference
+ * Path: Composition.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who and/or what the composition is about
+ * Type: reference
+ * Path: Composition.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Composition:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Composition:patient").toLocked(); + + /** + * Search parameter: confidentiality + *

+ * Description: As defined by affinity domain
+ * Type: token
+ * Path: Composition.confidentiality
+ *

+ */ + @SearchParamDefinition(name="confidentiality", path="Composition.confidentiality", description="As defined by affinity domain", type="token" ) + public static final String SP_CONFIDENTIALITY = "confidentiality"; + /** + * Fluent Client search parameter constant for confidentiality + *

+ * Description: As defined by affinity domain
+ * Type: token
+ * Path: Composition.confidentiality
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONFIDENTIALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONFIDENTIALITY); + + /** + * Search parameter: attester + *

+ * Description: Who attested the composition
+ * Type: reference
+ * Path: Composition.attester.party
+ *

+ */ + @SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference" ) + public static final String SP_ATTESTER = "attester"; + /** + * Fluent Client search parameter constant for attester + *

+ * Description: Who attested the composition
+ * Type: reference
+ * Path: Composition.attester.party
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ATTESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ATTESTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Composition:attester". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ATTESTER = new ca.uhn.fhir.model.api.Include("Composition:attester").toLocked(); + + /** + * Search parameter: entry + *

+ * Description: A reference to data that supports this section
+ * Type: reference
+ * Path: Composition.section.entry
+ *

+ */ + @SearchParamDefinition(name="entry", path="Composition.section.entry", description="A reference to data that supports this section", type="reference" ) + public static final String SP_ENTRY = "entry"; + /** + * Fluent Client search parameter constant for entry + *

+ * Description: A reference to data that supports this section
+ * Type: reference
+ * Path: Composition.section.entry
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTRY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTRY); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Composition:entry". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTRY = new ca.uhn.fhir.model.api.Include("Composition:entry").toLocked(); + + /** + * Search parameter: context + *

+ * Description: Code(s) that apply to the event being documented
+ * Type: token
+ * Path: Composition.event.code
+ *

+ */ + @SearchParamDefinition(name="context", path="Composition.event.code", description="Code(s) that apply to the event being documented", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: Code(s) that apply to the event being documented
+ * Type: token
+ * Path: Composition.event.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: identifier + *

+ * Description: Logical identifier of composition (version-independent)
+ * Type: token
+ * Path: Composition.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Composition.identifier", description="Logical identifier of composition (version-independent)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Logical identifier of composition (version-independent)
+ * Type: token
+ * Path: Composition.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ConceptMap.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ConceptMap.java new file mode 100644 index 00000000000..752cfa667d6 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ConceptMap.java @@ -0,0 +1,3031 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalenceEnumFactory; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + */ +@ResourceDef(name="ConceptMap", profile="http://hl7.org/fhir/Profile/ConceptMap") +public class ConceptMap extends DomainResource { + + @Block() + public static class ConceptMapContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the concept map. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the concept map." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public ConceptMapContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the concept map.). 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 ConceptMapContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConceptMapContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the concept map. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the concept map. + */ + public ConceptMapContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ConceptMapContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public ConceptMapContactComponent copy() { + ConceptMapContactComponent dst = new ConceptMapContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptMapContactComponent)) + return false; + ConceptMapContactComponent o = (ConceptMapContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptMapContactComponent)) + return false; + ConceptMapContactComponent o = (ConceptMapContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "ConceptMap.contact"; + + } + + } + + @Block() + public static class SourceElementComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system). + */ + @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code System (if value set crosses code systems)", formalDefinition="An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system)." ) + protected UriType system; + + /** + * The specific version of the code system, as determined by the code system authority. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Specific version of the code system", formalDefinition="The specific version of the code system, as determined by the code system authority." ) + protected StringType version; + + /** + * Identity (code or path) or the element/item being mapped. + */ + @Child(name = "code", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Identifies element being mapped", formalDefinition="Identity (code or path) or the element/item being mapped." ) + protected CodeType code; + + /** + * A concept from the target value set that this concept maps to. + */ + @Child(name = "target", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Concept in target system for element", formalDefinition="A concept from the target value set that this concept maps to." ) + protected List target; + + private static final long serialVersionUID = -387093487L; + + /** + * Constructor + */ + public SourceElementComponent() { + super(); + } + + /** + * @return {@link #system} (An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SourceElementComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public SourceElementComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system). + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system). + */ + public SourceElementComponent setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The specific version of the code system, as determined by the code system authority.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SourceElementComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The specific version of the code system, as determined by the code system authority.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public SourceElementComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The specific version of the code system, as determined by the code system authority. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The specific version of the code system, as determined by the code system authority. + */ + public SourceElementComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SourceElementComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public SourceElementComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item being mapped. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item being mapped. + */ + public SourceElementComponent setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (A concept from the target value set that this concept maps to.) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (TargetElementComponent item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (A concept from the target value set that this concept maps to.) + */ + // syntactic sugar + public TargetElementComponent addTarget() { //3 + TargetElementComponent t = new TargetElementComponent(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + // syntactic sugar + public SourceElementComponent addTarget(TargetElementComponent t) { //3 + if (t == null) + return this; + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system).", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The specific version of the code system, as determined by the code system authority.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item being mapped.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("target", "", "A concept from the target value set that this concept maps to.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // TargetElementComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case -880905839: // target + this.getTarget().add((TargetElementComponent) value); // TargetElementComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("target")) + this.getTarget().add((TargetElementComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case -880905839: return addTarget(); // TargetElementComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.system"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.version"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.code"); + } + else if (name.equals("target")) { + return addTarget(); + } + else + return super.addChild(name); + } + + public SourceElementComponent copy() { + SourceElementComponent dst = new SourceElementComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + dst.code = code == null ? null : code.copy(); + if (target != null) { + dst.target = new ArrayList(); + for (TargetElementComponent i : target) + dst.target.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SourceElementComponent)) + return false; + SourceElementComponent o = (SourceElementComponent) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) + && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SourceElementComponent)) + return false; + SourceElementComponent o = (SourceElementComponent) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(code, o.code, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (code == null || code.isEmpty()) && (target == null || target.isEmpty()); + } + + public String fhirType() { + return "ConceptMap.element"; + + } + + } + + @Block() + public static class TargetElementComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). + */ + @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="System of the target (if necessary)", formalDefinition="An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems)." ) + protected UriType system; + + /** + * The specific version of the code system, as determined by the code system authority. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Specific version of the code system", formalDefinition="The specific version of the code system, as determined by the code system authority." ) + protected StringType version; + + /** + * Identity (code or path) or the element/item that the map refers to. + */ + @Child(name = "code", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code that identifies the target element", formalDefinition="Identity (code or path) or the element/item that the map refers to." ) + protected CodeType code; + + /** + * The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source). + */ + @Child(name = "equivalence", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="equivalent | equal | wider | subsumes | narrower | specializes | inexact | unmatched | disjoint", formalDefinition="The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source)." ) + protected Enumeration equivalence; + + /** + * A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + @Child(name = "comments", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Description of status/issues in mapping", formalDefinition="A description of status/issues in mapping that conveys additional information not represented in the structured data." ) + protected StringType comments; + + /** + * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. + */ + @Child(name = "dependsOn", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Other elements required for this mapping (from context)", formalDefinition="A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value." ) + protected List dependsOn; + + /** + * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on. + */ + @Child(name = "product", type = {OtherElementComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Other concepts that this mapping also produces", formalDefinition="A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on." ) + protected List product; + + private static final long serialVersionUID = 2147112127L; + + /** + * Constructor + */ + public TargetElementComponent() { + super(); + } + + /** + * Constructor + */ + public TargetElementComponent(Enumeration equivalence) { + super(); + this.equivalence = equivalence; + } + + /** + * @return {@link #system} (An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TargetElementComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public TargetElementComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). + */ + public TargetElementComponent setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The specific version of the code system, as determined by the code system authority.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TargetElementComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The specific version of the code system, as determined by the code system authority.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public TargetElementComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The specific version of the code system, as determined by the code system authority. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The specific version of the code system, as determined by the code system authority. + */ + public TargetElementComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TargetElementComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public TargetElementComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item that the map refers to. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item that the map refers to. + */ + public TargetElementComponent setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #equivalence} (The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value + */ + public Enumeration getEquivalenceElement() { + if (this.equivalence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TargetElementComponent.equivalence"); + else if (Configuration.doAutoCreate()) + this.equivalence = new Enumeration(new ConceptMapEquivalenceEnumFactory()); // bb + return this.equivalence; + } + + public boolean hasEquivalenceElement() { + return this.equivalence != null && !this.equivalence.isEmpty(); + } + + public boolean hasEquivalence() { + return this.equivalence != null && !this.equivalence.isEmpty(); + } + + /** + * @param value {@link #equivalence} (The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value + */ + public TargetElementComponent setEquivalenceElement(Enumeration value) { + this.equivalence = value; + return this; + } + + /** + * @return The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source). + */ + public ConceptMapEquivalence getEquivalence() { + return this.equivalence == null ? null : this.equivalence.getValue(); + } + + /** + * @param value The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source). + */ + public TargetElementComponent setEquivalence(ConceptMapEquivalence value) { + if (this.equivalence == null) + this.equivalence = new Enumeration(new ConceptMapEquivalenceEnumFactory()); + this.equivalence.setValue(value); + return this; + } + + /** + * @return {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TargetElementComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); // bb + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public TargetElementComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + public TargetElementComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) + */ + public List getDependsOn() { + if (this.dependsOn == null) + this.dependsOn = new ArrayList(); + return this.dependsOn; + } + + public boolean hasDependsOn() { + if (this.dependsOn == null) + return false; + for (OtherElementComponent item : this.dependsOn) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) + */ + // syntactic sugar + public OtherElementComponent addDependsOn() { //3 + OtherElementComponent t = new OtherElementComponent(); + if (this.dependsOn == null) + this.dependsOn = new ArrayList(); + this.dependsOn.add(t); + return t; + } + + // syntactic sugar + public TargetElementComponent addDependsOn(OtherElementComponent t) { //3 + if (t == null) + return this; + if (this.dependsOn == null) + this.dependsOn = new ArrayList(); + this.dependsOn.add(t); + return this; + } + + /** + * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) + */ + public List getProduct() { + if (this.product == null) + this.product = new ArrayList(); + return this.product; + } + + public boolean hasProduct() { + if (this.product == null) + return false; + for (OtherElementComponent item : this.product) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) + */ + // syntactic sugar + public OtherElementComponent addProduct() { //3 + OtherElementComponent t = new OtherElementComponent(); + if (this.product == null) + this.product = new ArrayList(); + this.product.add(t); + return t; + } + + // syntactic sugar + public TargetElementComponent addProduct(OtherElementComponent t) { //3 + if (t == null) + return this; + if (this.product == null) + this.product = new ArrayList(); + this.product.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The specific version of the code system, as determined by the code system authority.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item that the map refers to.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("equivalence", "code", "The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).", 0, java.lang.Integer.MAX_VALUE, equivalence)); + childrenList.add(new Property("comments", "string", "A description of status/issues in mapping that conveys additional information not represented in the structured data.", 0, java.lang.Integer.MAX_VALUE, comments)); + childrenList.add(new Property("dependsOn", "", "A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.", 0, java.lang.Integer.MAX_VALUE, dependsOn)); + childrenList.add(new Property("product", "@ConceptMap.element.target.dependsOn", "A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.", 0, java.lang.Integer.MAX_VALUE, product)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case -15828692: /*equivalence*/ return this.equivalence == null ? new Base[0] : new Base[] {this.equivalence}; // Enumeration + case -602415628: /*comments*/ return this.comments == null ? new Base[0] : new Base[] {this.comments}; // StringType + case -1109214266: /*dependsOn*/ return this.dependsOn == null ? new Base[0] : this.dependsOn.toArray(new Base[this.dependsOn.size()]); // OtherElementComponent + case -309474065: /*product*/ return this.product == null ? new Base[0] : this.product.toArray(new Base[this.product.size()]); // OtherElementComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case -15828692: // equivalence + this.equivalence = new ConceptMapEquivalenceEnumFactory().fromType(value); // Enumeration + break; + case -602415628: // comments + this.comments = castToString(value); // StringType + break; + case -1109214266: // dependsOn + this.getDependsOn().add((OtherElementComponent) value); // OtherElementComponent + break; + case -309474065: // product + this.getProduct().add((OtherElementComponent) value); // OtherElementComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("equivalence")) + this.equivalence = new ConceptMapEquivalenceEnumFactory().fromType(value); // Enumeration + else if (name.equals("comments")) + this.comments = castToString(value); // StringType + else if (name.equals("dependsOn")) + this.getDependsOn().add((OtherElementComponent) value); + else if (name.equals("product")) + this.getProduct().add((OtherElementComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case -15828692: throw new FHIRException("Cannot make property equivalence as it is not a complex type"); // Enumeration + case -602415628: throw new FHIRException("Cannot make property comments as it is not a complex type"); // StringType + case -1109214266: return addDependsOn(); // OtherElementComponent + case -309474065: return addProduct(); // OtherElementComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.system"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.version"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.code"); + } + else if (name.equals("equivalence")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.equivalence"); + } + else if (name.equals("comments")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.comments"); + } + else if (name.equals("dependsOn")) { + return addDependsOn(); + } + else if (name.equals("product")) { + return addProduct(); + } + else + return super.addChild(name); + } + + public TargetElementComponent copy() { + TargetElementComponent dst = new TargetElementComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + dst.code = code == null ? null : code.copy(); + dst.equivalence = equivalence == null ? null : equivalence.copy(); + dst.comments = comments == null ? null : comments.copy(); + if (dependsOn != null) { + dst.dependsOn = new ArrayList(); + for (OtherElementComponent i : dependsOn) + dst.dependsOn.add(i.copy()); + }; + if (product != null) { + dst.product = new ArrayList(); + for (OtherElementComponent i : product) + dst.product.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TargetElementComponent)) + return false; + TargetElementComponent o = (TargetElementComponent) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) + && compareDeep(equivalence, o.equivalence, true) && compareDeep(comments, o.comments, true) && compareDeep(dependsOn, o.dependsOn, true) + && compareDeep(product, o.product, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TargetElementComponent)) + return false; + TargetElementComponent o = (TargetElementComponent) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(code, o.code, true) + && compareValues(equivalence, o.equivalence, true) && compareValues(comments, o.comments, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (code == null || code.isEmpty()) && (equivalence == null || equivalence.isEmpty()) && (comments == null || comments.isEmpty()) + && (dependsOn == null || dependsOn.isEmpty()) && (product == null || product.isEmpty()); + } + + public String fhirType() { + return "ConceptMap.element.target"; + + } + + } + + @Block() + public static class OtherElementComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + @Child(name = "element", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reference to element/field/ValueSet mapping depends on", formalDefinition="A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition." ) + protected UriType element; + + /** + * An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems). + */ + @Child(name = "system", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code System (if necessary)", formalDefinition="An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems)." ) + protected UriType system; + + /** + * Identity (code or path) or the element/item/ValueSet that the map depends on / refers to. + */ + @Child(name = "code", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Value of the referenced element", formalDefinition="Identity (code or path) or the element/item/ValueSet that the map depends on / refers to." ) + protected StringType code; + + private static final long serialVersionUID = 1365816253L; + + /** + * Constructor + */ + public OtherElementComponent() { + super(); + } + + /** + * Constructor + */ + public OtherElementComponent(UriType element, UriType system, StringType code) { + super(); + this.element = element; + this.system = system; + this.code = code; + } + + /** + * @return {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public UriType getElementElement() { + if (this.element == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.element"); + else if (Configuration.doAutoCreate()) + this.element = new UriType(); // bb + return this.element; + } + + public boolean hasElementElement() { + return this.element != null && !this.element.isEmpty(); + } + + public boolean hasElement() { + return this.element != null && !this.element.isEmpty(); + } + + /** + * @param value {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public OtherElementComponent setElementElement(UriType value) { + this.element = value; + return this; + } + + /** + * @return A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + public String getElement() { + return this.element == null ? null : this.element.getValue(); + } + + /** + * @param value A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + public OtherElementComponent setElement(String value) { + if (this.element == null) + this.element = new UriType(); + this.element.setValue(value); + return this; + } + + /** + * @return {@link #system} (An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public OtherElementComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems). + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems). + */ + public OtherElementComponent setSystem(String value) { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item/ValueSet that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public StringType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new StringType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item/ValueSet that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public OtherElementComponent setCodeElement(StringType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item/ValueSet that the map depends on / refers to. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item/ValueSet that the map depends on / refers to. + */ + public OtherElementComponent setCode(String value) { + if (this.code == null) + this.code = new StringType(); + this.code.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("element", "uri", "A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.", 0, java.lang.Integer.MAX_VALUE, element)); + childrenList.add(new Property("system", "uri", "An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("code", "string", "Identity (code or path) or the element/item/ValueSet that the map depends on / refers to.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // UriType + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1662836996: // element + this.element = castToUri(value); // UriType + break; + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 3059181: // code + this.code = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("element")) + this.element = castToUri(value); // UriType + else if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("code")) + this.code = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1662836996: throw new FHIRException("Cannot make property element as it is not a complex type"); // UriType + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("element")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.element"); + } + else if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.system"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.code"); + } + else + return super.addChild(name); + } + + public OtherElementComponent copy() { + OtherElementComponent dst = new OtherElementComponent(); + copyValues(dst); + dst.element = element == null ? null : element.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OtherElementComponent)) + return false; + OtherElementComponent o = (OtherElementComponent) other; + return compareDeep(element, o.element, true) && compareDeep(system, o.system, true) && compareDeep(code, o.code, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OtherElementComponent)) + return false; + OtherElementComponent o = (OtherElementComponent) other; + return compareValues(element, o.element, true) && compareValues(system, o.system, true) && compareValues(code, o.code, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (element == null || element.isEmpty()) && (system == null || system.isEmpty()) + && (code == null || code.isEmpty()); + } + + public String fhirType() { + return "ConceptMap.element.target.dependsOn"; + + } + + } + + /** + * An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Globally unique logical id for concept map", formalDefinition="An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional identifier for the concept map", formalDefinition="Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance." ) + protected Identifier identifier; + + /** + * The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical id for this version of the concept map", formalDefinition="The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name describing the concept map. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this concept map", formalDefinition="A free text natural language name describing the concept map." ) + protected StringType name; + + /** + * The status of the concept map. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the concept map." ) + protected Enumeration status; + + /** + * This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the concept map. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the concept map." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for given status", formalDefinition="The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes." ) + protected DateTimeType date; + + /** + * A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human language description of the concept map", formalDefinition="A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances." ) + protected List useContext; + + /** + * Explains why this concept map is needed and why it has been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why needed", formalDefinition="Explains why this concept map is needed and why it has been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the concept map and/or its contents. + */ + @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the concept map and/or its contents." ) + protected StringType copyright; + + /** + * The source value set that specifies the concepts that are being mapped. + */ + @Child(name = "source", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=13, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifies the source of the concepts which are being mapped", formalDefinition="The source value set that specifies the concepts that are being mapped." ) + protected Type source; + + /** + * The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. + */ + @Child(name = "target", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=14, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Provides context to the mappings", formalDefinition="The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made." ) + protected Type target; + + /** + * Mappings for an individual concept in the source to one or more concepts in the target. + */ + @Child(name = "element", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Mappings for a concept from the source set", formalDefinition="Mappings for an individual concept in the source to one or more concepts in the target." ) + protected List element; + + private static final long serialVersionUID = 1687563642L; + + /** + * Constructor + */ + public ConceptMap() { + super(); + } + + /** + * Constructor + */ + public ConceptMap(Enumeration status, Type source, Type target) { + super(); + this.status = status; + this.source = source; + this.target = target; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ConceptMap setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published. + */ + public ConceptMap setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public ConceptMap setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConceptMap setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public ConceptMap setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name describing the concept map.). 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 ConceptMap.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConceptMap setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name describing the concept map. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name describing the concept map. + */ + public ConceptMap setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the concept map.). 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 ConceptMap.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ConceptMap setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the concept map. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the concept map. + */ + public ConceptMap setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ConceptMap setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public ConceptMap setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ConceptMap setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the concept map. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the concept map. + */ + public ConceptMap setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ConceptMapContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ConceptMapContactComponent addContact() { //3 + ConceptMapContactComponent t = new ConceptMapContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public ConceptMap addContact(ConceptMapContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.). 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 ConceptMap.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ConceptMap setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes. + */ + public ConceptMap setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). 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 ConceptMap.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConceptMap setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + public ConceptMap 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public ConceptMap addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #requirements} (Explains why this concept map is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this concept map is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ConceptMap setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this concept map is needed and why it has been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this concept map is needed and why it has been constrained as it has. + */ + public ConceptMap setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public ConceptMap setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the concept map and/or its contents. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the concept map and/or its contents. + */ + public ConceptMap setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public Type getSource() { + return this.source; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public UriType getSourceUriType() throws FHIRException { + if (!(this.source instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered"); + return (UriType) this.source; + } + + public boolean hasSourceUriType() { + return this.source instanceof UriType; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public Reference getSourceReference() throws FHIRException { + if (!(this.source instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered"); + return (Reference) this.source; + } + + public boolean hasSourceReference() { + return this.source instanceof Reference; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public ConceptMap setSource(Type value) { + this.source = value; + return this; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public Type getTarget() { + return this.target; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public UriType getTargetUriType() throws FHIRException { + if (!(this.target instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.target.getClass().getName()+" was encountered"); + return (UriType) this.target; + } + + public boolean hasTargetUriType() { + return this.target instanceof UriType; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public Reference getTargetReference() throws FHIRException { + if (!(this.target instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Reference) this.target; + } + + public boolean hasTargetReference() { + return this.target instanceof Reference; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public ConceptMap setTarget(Type value) { + this.target = value; + return this; + } + + /** + * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (SourceElementComponent item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) + */ + // syntactic sugar + public SourceElementComponent addElement() { //3 + SourceElementComponent t = new SourceElementComponent(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + // syntactic sugar + public ConceptMap addElement(SourceElementComponent t) { //3 + if (t == null) + return this; + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name describing the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the concept map.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the concept map.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("requirements", "string", "Explains why this concept map is needed and why it has been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the concept map and/or its contents.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("source[x]", "uri|Reference(ValueSet|StructureDefinition)", "The source value set that specifies the concepts that are being mapped.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target[x]", "uri|Reference(ValueSet|StructureDefinition)", "The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("element", "", "Mappings for an individual concept in the source to one or more concepts in the target.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ConceptMapContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Type + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type + case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // SourceElementComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((ConceptMapContactComponent) value); // ConceptMapContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case -896505829: // source + this.source = (Type) value; // Type + break; + case -880905839: // target + this.target = (Type) value; // Type + break; + case -1662836996: // element + this.getElement().add((SourceElementComponent) value); // SourceElementComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((ConceptMapContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("source[x]")) + this.source = (Type) value; // Type + else if (name.equals("target[x]")) + this.target = (Type) value; // Type + else if (name.equals("element")) + this.getElement().add((SourceElementComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return getIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // ConceptMapContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case -1698413947: return getSource(); // Type + case -815579825: return getTarget(); // Type + case -1662836996: return addElement(); // SourceElementComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.url"); + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.requirements"); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.copyright"); + } + else if (name.equals("sourceUri")) { + this.source = new UriType(); + return this.source; + } + else if (name.equals("sourceReference")) { + this.source = new Reference(); + return this.source; + } + else if (name.equals("targetUri")) { + this.target = new UriType(); + return this.target; + } + else if (name.equals("targetReference")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("element")) { + return addElement(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ConceptMap"; + + } + + public ConceptMap copy() { + ConceptMap dst = new ConceptMap(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ConceptMapContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + if (element != null) { + dst.element = new ArrayList(); + for (SourceElementComponent i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + protected ConceptMap typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptMap)) + return false; + ConceptMap o = (ConceptMap) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) + && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) && compareDeep(element, o.element, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptMap)) + return false; + ConceptMap o = (ConceptMap) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(copyright, o.copyright, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) + && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) + && (element == null || element.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ConceptMap; + } + + /** + * Search parameter: source-system + *

+ * Description: Code System (if value set crosses code systems)
+ * Type: uri
+ * Path: ConceptMap.element.system
+ *

+ */ + @SearchParamDefinition(name="source-system", path="ConceptMap.element.system", description="Code System (if value set crosses code systems)", type="uri" ) + public static final String SP_SOURCE_SYSTEM = "source-system"; + /** + * Fluent Client search parameter constant for source-system + *

+ * Description: Code System (if value set crosses code systems)
+ * Type: uri
+ * Path: ConceptMap.element.system
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam SOURCE_SYSTEM = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SOURCE_SYSTEM); + + /** + * Search parameter: dependson + *

+ * Description: Reference to element/field/ValueSet mapping depends on
+ * Type: uri
+ * Path: ConceptMap.element.target.dependsOn.element
+ *

+ */ + @SearchParamDefinition(name="dependson", path="ConceptMap.element.target.dependsOn.element", description="Reference to element/field/ValueSet mapping depends on", type="uri" ) + public static final String SP_DEPENDSON = "dependson"; + /** + * Fluent Client search parameter constant for dependson + *

+ * Description: Reference to element/field/ValueSet mapping depends on
+ * Type: uri
+ * Path: ConceptMap.element.target.dependsOn.element
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam DEPENDSON = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DEPENDSON); + + /** + * Search parameter: status + *

+ * Description: Status of the concept map
+ * Type: token
+ * Path: ConceptMap.status
+ *

+ */ + @SearchParamDefinition(name="status", path="ConceptMap.status", description="Status of the concept map", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the concept map
+ * Type: token
+ * Path: ConceptMap.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: date + *

+ * Description: The concept map publication date
+ * Type: date
+ * Path: ConceptMap.date
+ *

+ */ + @SearchParamDefinition(name="date", path="ConceptMap.date", description="The concept map publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The concept map publication date
+ * Type: date
+ * Path: ConceptMap.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: url + *

+ * Description: The URL of the concept map
+ * Type: uri
+ * Path: ConceptMap.url
+ *

+ */ + @SearchParamDefinition(name="url", path="ConceptMap.url", description="The URL of the concept map", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: The URL of the concept map
+ * Type: uri
+ * Path: ConceptMap.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: target-code + *

+ * Description: Code that identifies the target element
+ * Type: token
+ * Path: ConceptMap.element.target.code
+ *

+ */ + @SearchParamDefinition(name="target-code", path="ConceptMap.element.target.code", description="Code that identifies the target element", type="token" ) + public static final String SP_TARGET_CODE = "target-code"; + /** + * Fluent Client search parameter constant for target-code + *

+ * Description: Code that identifies the target element
+ * Type: token
+ * Path: ConceptMap.element.target.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGET_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGET_CODE); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the concept map
+ * Type: token
+ * Path: ConceptMap.version
+ *

+ */ + @SearchParamDefinition(name="version", path="ConceptMap.version", description="The version identifier of the concept map", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the concept map
+ * Type: token
+ * Path: ConceptMap.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the concept map
+ * Type: string
+ * Path: ConceptMap.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="ConceptMap.publisher", description="Name of the publisher of the concept map", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the concept map
+ * Type: string
+ * Path: ConceptMap.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: product + *

+ * Description: Reference to element/field/ValueSet mapping depends on
+ * Type: uri
+ * Path: ConceptMap.element.target.product.element
+ *

+ */ + @SearchParamDefinition(name="product", path="ConceptMap.element.target.product.element", description="Reference to element/field/ValueSet mapping depends on", type="uri" ) + public static final String SP_PRODUCT = "product"; + /** + * Fluent Client search parameter constant for product + *

+ * Description: Reference to element/field/ValueSet mapping depends on
+ * Type: uri
+ * Path: ConceptMap.element.target.product.element
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam PRODUCT = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_PRODUCT); + + /** + * Search parameter: source-code + *

+ * Description: Identifies element being mapped
+ * Type: token
+ * Path: ConceptMap.element.code
+ *

+ */ + @SearchParamDefinition(name="source-code", path="ConceptMap.element.code", description="Identifies element being mapped", type="token" ) + public static final String SP_SOURCE_CODE = "source-code"; + /** + * Fluent Client search parameter constant for source-code + *

+ * Description: Identifies element being mapped
+ * Type: token
+ * Path: ConceptMap.element.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SOURCE_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SOURCE_CODE); + + /** + * Search parameter: source-uri + *

+ * Description: Identifies the source of the concepts which are being mapped
+ * Type: reference
+ * Path: ConceptMap.sourceUri
+ *

+ */ + @SearchParamDefinition(name="source-uri", path="ConceptMap.source.as(Uri)", description="Identifies the source of the concepts which are being mapped", type="reference" ) + public static final String SP_SOURCE_URI = "source-uri"; + /** + * Fluent Client search parameter constant for source-uri + *

+ * Description: Identifies the source of the concepts which are being mapped
+ * Type: reference
+ * Path: ConceptMap.sourceUri
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE_URI = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE_URI); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ConceptMap:source-uri". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE_URI = new ca.uhn.fhir.model.api.Include("ConceptMap:source-uri").toLocked(); + + /** + * Search parameter: source + *

+ * Description: Identifies the source of the concepts which are being mapped
+ * Type: reference
+ * Path: ConceptMap.sourceReference
+ *

+ */ + @SearchParamDefinition(name="source", path="ConceptMap.source.as(Reference)", description="Identifies the source of the concepts which are being mapped", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: Identifies the source of the concepts which are being mapped
+ * Type: reference
+ * Path: ConceptMap.sourceReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ConceptMap:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("ConceptMap:source").toLocked(); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the concept map
+ * Type: string
+ * Path: ConceptMap.description
+ *

+ */ + @SearchParamDefinition(name="description", path="ConceptMap.description", description="Text search in the description of the concept map", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the concept map
+ * Type: string
+ * Path: ConceptMap.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: Name of the concept map
+ * Type: string
+ * Path: ConceptMap.name
+ *

+ */ + @SearchParamDefinition(name="name", path="ConceptMap.name", description="Name of the concept map", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the concept map
+ * Type: string
+ * Path: ConceptMap.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the concept map
+ * Type: token
+ * Path: ConceptMap.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="ConceptMap.useContext", description="A use context assigned to the concept map", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the concept map
+ * Type: token
+ * Path: ConceptMap.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: target + *

+ * Description: Provides context to the mappings
+ * Type: reference
+ * Path: ConceptMap.target[x]
+ *

+ */ + @SearchParamDefinition(name="target", path="ConceptMap.target", description="Provides context to the mappings", type="reference" ) + public static final String SP_TARGET = "target"; + /** + * Fluent Client search parameter constant for target + *

+ * Description: Provides context to the mappings
+ * Type: reference
+ * Path: ConceptMap.target[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ConceptMap:target". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("ConceptMap:target").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Additional identifier for the concept map
+ * Type: token
+ * Path: ConceptMap.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ConceptMap.identifier", description="Additional identifier for the concept map", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Additional identifier for the concept map
+ * Type: token
+ * Path: ConceptMap.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: target-system + *

+ * Description: System of the target (if necessary)
+ * Type: uri
+ * Path: ConceptMap.element.target.system
+ *

+ */ + @SearchParamDefinition(name="target-system", path="ConceptMap.element.target.system", description="System of the target (if necessary)", type="uri" ) + public static final String SP_TARGET_SYSTEM = "target-system"; + /** + * Fluent Client search parameter constant for target-system + *

+ * Description: System of the target (if necessary)
+ * Type: uri
+ * Path: ConceptMap.element.target.system
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam TARGET_SYSTEM = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_TARGET_SYSTEM); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Condition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Condition.java new file mode 100644 index 00000000000..3fd6b3bbd65 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Condition.java @@ -0,0 +1,2132 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary. + */ +@ResourceDef(name="Condition", profile="http://hl7.org/fhir/Profile/Condition") +public class Condition extends DomainResource { + + public enum ConditionVerificationStatus { + /** + * This is a tentative diagnosis - still a candidate that is under consideration. + */ + PROVISIONAL, + /** + * One of a set of potential (and typically mutually exclusive) diagnosis asserted to further guide the diagnostic process and preliminary treatment. + */ + DIFFERENTIAL, + /** + * There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition. + */ + CONFIRMED, + /** + * This condition has been ruled out by diagnostic and clinical evidence. + */ + REFUTED, + /** + * The statement was entered in error and is not valid. + */ + ENTEREDINERROR, + /** + * The condition status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static ConditionVerificationStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("provisional".equals(codeString)) + return PROVISIONAL; + if ("differential".equals(codeString)) + return DIFFERENTIAL; + if ("confirmed".equals(codeString)) + return CONFIRMED; + if ("refuted".equals(codeString)) + return REFUTED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new FHIRException("Unknown ConditionVerificationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROVISIONAL: return "provisional"; + case DIFFERENTIAL: return "differential"; + case CONFIRMED: return "confirmed"; + case REFUTED: return "refuted"; + case ENTEREDINERROR: return "entered-in-error"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROVISIONAL: return "http://hl7.org/fhir/condition-ver-status"; + case DIFFERENTIAL: return "http://hl7.org/fhir/condition-ver-status"; + case CONFIRMED: return "http://hl7.org/fhir/condition-ver-status"; + case REFUTED: return "http://hl7.org/fhir/condition-ver-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/condition-ver-status"; + case UNKNOWN: return "http://hl7.org/fhir/condition-ver-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROVISIONAL: return "This is a tentative diagnosis - still a candidate that is under consideration."; + case DIFFERENTIAL: return "One of a set of potential (and typically mutually exclusive) diagnosis asserted to further guide the diagnostic process and preliminary treatment."; + case CONFIRMED: return "There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition."; + case REFUTED: return "This condition has been ruled out by diagnostic and clinical evidence."; + case ENTEREDINERROR: return "The statement was entered in error and is not valid."; + case UNKNOWN: return "The condition status is unknown. Note that \"unknown\" is a value of last resort and every attempt should be made to provide a meaningful value other than \"unknown\"."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROVISIONAL: return "Provisional"; + case DIFFERENTIAL: return "Differential"; + case CONFIRMED: return "Confirmed"; + case REFUTED: return "Refuted"; + case ENTEREDINERROR: return "Entered In Error"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + } + + public static class ConditionVerificationStatusEnumFactory implements EnumFactory { + public ConditionVerificationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("provisional".equals(codeString)) + return ConditionVerificationStatus.PROVISIONAL; + if ("differential".equals(codeString)) + return ConditionVerificationStatus.DIFFERENTIAL; + if ("confirmed".equals(codeString)) + return ConditionVerificationStatus.CONFIRMED; + if ("refuted".equals(codeString)) + return ConditionVerificationStatus.REFUTED; + if ("entered-in-error".equals(codeString)) + return ConditionVerificationStatus.ENTEREDINERROR; + if ("unknown".equals(codeString)) + return ConditionVerificationStatus.UNKNOWN; + throw new IllegalArgumentException("Unknown ConditionVerificationStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("provisional".equals(codeString)) + return new Enumeration(this, ConditionVerificationStatus.PROVISIONAL); + if ("differential".equals(codeString)) + return new Enumeration(this, ConditionVerificationStatus.DIFFERENTIAL); + if ("confirmed".equals(codeString)) + return new Enumeration(this, ConditionVerificationStatus.CONFIRMED); + if ("refuted".equals(codeString)) + return new Enumeration(this, ConditionVerificationStatus.REFUTED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, ConditionVerificationStatus.ENTEREDINERROR); + if ("unknown".equals(codeString)) + return new Enumeration(this, ConditionVerificationStatus.UNKNOWN); + throw new FHIRException("Unknown ConditionVerificationStatus code '"+codeString+"'"); + } + public String toCode(ConditionVerificationStatus code) { + if (code == ConditionVerificationStatus.PROVISIONAL) + return "provisional"; + if (code == ConditionVerificationStatus.DIFFERENTIAL) + return "differential"; + if (code == ConditionVerificationStatus.CONFIRMED) + return "confirmed"; + if (code == ConditionVerificationStatus.REFUTED) + return "refuted"; + if (code == ConditionVerificationStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == ConditionVerificationStatus.UNKNOWN) + return "unknown"; + return "?"; + } + public String toSystem(ConditionVerificationStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class ConditionStageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. + */ + @Child(name = "summary", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Simple summary (disease specific)", formalDefinition="A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific." ) + protected CodeableConcept summary; + + /** + * Reference to a formal record of the evidence on which the staging assessment is based. + */ + @Child(name = "assessment", type = {ClinicalImpression.class, DiagnosticReport.class, Observation.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Formal record of assessment", formalDefinition="Reference to a formal record of the evidence on which the staging assessment is based." ) + protected List assessment; + /** + * The actual objects that are the target of the reference (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + protected List assessmentTarget; + + + private static final long serialVersionUID = -1961530405L; + + /** + * Constructor + */ + public ConditionStageComponent() { + super(); + } + + /** + * @return {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) + */ + public CodeableConcept getSummary() { + if (this.summary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionStageComponent.summary"); + else if (Configuration.doAutoCreate()) + this.summary = new CodeableConcept(); // cc + return this.summary; + } + + public boolean hasSummary() { + return this.summary != null && !this.summary.isEmpty(); + } + + /** + * @param value {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) + */ + public ConditionStageComponent setSummary(CodeableConcept value) { + this.summary = value; + return this; + } + + /** + * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + public List getAssessment() { + if (this.assessment == null) + this.assessment = new ArrayList(); + return this.assessment; + } + + public boolean hasAssessment() { + if (this.assessment == null) + return false; + for (Reference item : this.assessment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + // syntactic sugar + public Reference addAssessment() { //3 + Reference t = new Reference(); + if (this.assessment == null) + this.assessment = new ArrayList(); + this.assessment.add(t); + return t; + } + + // syntactic sugar + public ConditionStageComponent addAssessment(Reference t) { //3 + if (t == null) + return this; + if (this.assessment == null) + this.assessment = new ArrayList(); + this.assessment.add(t); + return this; + } + + /** + * @return {@link #assessment} (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. Reference to a formal record of the evidence on which the staging assessment is based.) + */ + public List getAssessmentTarget() { + if (this.assessmentTarget == null) + this.assessmentTarget = new ArrayList(); + return this.assessmentTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("summary", "CodeableConcept", "A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific.", 0, java.lang.Integer.MAX_VALUE, summary)); + childrenList.add(new Property("assessment", "Reference(ClinicalImpression|DiagnosticReport|Observation)", "Reference to a formal record of the evidence on which the staging assessment is based.", 0, java.lang.Integer.MAX_VALUE, assessment)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : new Base[] {this.summary}; // CodeableConcept + case 2119382722: /*assessment*/ return this.assessment == null ? new Base[0] : this.assessment.toArray(new Base[this.assessment.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1857640538: // summary + this.summary = castToCodeableConcept(value); // CodeableConcept + break; + case 2119382722: // assessment + this.getAssessment().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("summary")) + this.summary = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("assessment")) + this.getAssessment().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1857640538: return getSummary(); // CodeableConcept + case 2119382722: return addAssessment(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("summary")) { + this.summary = new CodeableConcept(); + return this.summary; + } + else if (name.equals("assessment")) { + return addAssessment(); + } + else + return super.addChild(name); + } + + public ConditionStageComponent copy() { + ConditionStageComponent dst = new ConditionStageComponent(); + copyValues(dst); + dst.summary = summary == null ? null : summary.copy(); + if (assessment != null) { + dst.assessment = new ArrayList(); + for (Reference i : assessment) + dst.assessment.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConditionStageComponent)) + return false; + ConditionStageComponent o = (ConditionStageComponent) other; + return compareDeep(summary, o.summary, true) && compareDeep(assessment, o.assessment, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConditionStageComponent)) + return false; + ConditionStageComponent o = (ConditionStageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (summary == null || summary.isEmpty()) && (assessment == null || assessment.isEmpty()) + ; + } + + public String fhirType() { + return "Condition.stage"; + + } + + } + + @Block() + public static class ConditionEvidenceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A manifestation or symptom that led to the recording of this condition. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Manifestation/symptom", formalDefinition="A manifestation or symptom that led to the recording of this condition." ) + protected CodeableConcept code; + + /** + * Links to other relevant information, including pathology reports. + */ + @Child(name = "detail", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Supporting information found elsewhere", formalDefinition="Links to other relevant information, including pathology reports." ) + protected List detail; + /** + * The actual objects that are the target of the reference (Links to other relevant information, including pathology reports.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = 945689926L; + + /** + * Constructor + */ + public ConditionEvidenceComponent() { + super(); + } + + /** + * @return {@link #code} (A manifestation or symptom that led to the recording of this condition.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionEvidenceComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A manifestation or symptom that led to the recording of this condition.) + */ + public ConditionEvidenceComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #detail} (Links to other relevant information, including pathology reports.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Links to other relevant information, including pathology reports.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public ConditionEvidenceComponent addDetail(Reference t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #detail} (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. Links to other relevant information, including pathology reports.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A manifestation or symptom that led to the recording of this condition.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("detail", "Reference(Any)", "Links to other relevant information, including pathology reports.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -1335224239: // detail + this.getDetail().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("detail")) + this.getDetail().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case -1335224239: return addDetail(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("detail")) { + return addDetail(); + } + else + return super.addChild(name); + } + + public ConditionEvidenceComponent copy() { + ConditionEvidenceComponent dst = new ConditionEvidenceComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConditionEvidenceComponent)) + return false; + ConditionEvidenceComponent o = (ConditionEvidenceComponent) other; + return compareDeep(code, o.code, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConditionEvidenceComponent)) + return false; + ConditionEvidenceComponent o = (ConditionEvidenceComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + public String fhirType() { + return "Condition.evidence"; + + } + + } + + /** + * This records identifiers associated with this condition 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=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Ids for this condition", formalDefinition="This records identifiers associated with this condition 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; + + /** + * Indicates the patient who the condition record is associated with. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who has the condition?", formalDefinition="Indicates the patient who the condition record is associated with." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Indicates the patient who the condition record is associated with.) + */ + protected Patient patientTarget; + + /** + * Encounter during which the condition was first asserted. + */ + @Child(name = "encounter", type = {Encounter.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Encounter when condition first asserted", formalDefinition="Encounter during which the condition was first asserted." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Encounter during which the condition was first asserted.) + */ + protected Encounter encounterTarget; + + /** + * Individual who is making the condition statement. + */ + @Child(name = "asserter", type = {Practitioner.class, Patient.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Person who asserts this condition", formalDefinition="Individual who is making the condition statement." ) + protected Reference asserter; + + /** + * The actual object that is the target of the reference (Individual who is making the condition statement.) + */ + protected Resource asserterTarget; + + /** + * A date, when the Condition statement was documented. + */ + @Child(name = "dateRecorded", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When first entered", formalDefinition="A date, when the Condition statement was documented." ) + protected DateType dateRecorded; + + /** + * Identification of the condition, problem or diagnosis. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identification of the condition, problem or diagnosis", formalDefinition="Identification of the condition, problem or diagnosis." ) + protected CodeableConcept code; + + /** + * A category assigned to the condition. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="complaint | symptom | finding | diagnosis", formalDefinition="A category assigned to the condition." ) + protected CodeableConcept category; + + /** + * The clinical status of the condition. + */ + @Child(name = "clinicalStatus", type = {CodeType.class}, order=7, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | relapse | remission | resolved", formalDefinition="The clinical status of the condition." ) + protected CodeType clinicalStatus; + + /** + * The verification status to support the clinical status of the condition. + */ + @Child(name = "verificationStatus", type = {CodeType.class}, order=8, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="provisional | differential | confirmed | refuted | entered-in-error | unknown", formalDefinition="The verification status to support the clinical status of the condition." ) + protected Enumeration verificationStatus; + + /** + * A subjective assessment of the severity of the condition as evaluated by the clinician. + */ + @Child(name = "severity", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Subjective severity of condition", formalDefinition="A subjective assessment of the severity of the condition as evaluated by the clinician." ) + protected CodeableConcept severity; + + /** + * Estimated or actual date or date-time the condition began, in the opinion of the clinician. + */ + @Child(name = "onset", type = {DateTimeType.class, Age.class, Period.class, Range.class, StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Estimated or actual date, date-time, or age", formalDefinition="Estimated or actual date or date-time the condition began, in the opinion of the clinician." ) + protected Type onset; + + /** + * The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate. + */ + @Child(name = "abatement", type = {DateTimeType.class, Age.class, BooleanType.class, Period.class, Range.class, StringType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If/when in resolution/remission", formalDefinition="The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate." ) + protected Type abatement; + + /** + * Clinical stage or grade of a condition. May include formal severity assessments. + */ + @Child(name = "stage", type = {}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Stage/grade, usually assessed formally", formalDefinition="Clinical stage or grade of a condition. May include formal severity assessments." ) + protected ConditionStageComponent stage; + + /** + * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. + */ + @Child(name = "evidence", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Supporting evidence", formalDefinition="Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed." ) + protected List evidence; + + /** + * The anatomical location where this condition manifests itself. + */ + @Child(name = "bodySite", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Anatomical location, if relevant", formalDefinition="The anatomical location where this condition manifests itself." ) + protected List bodySite; + + /** + * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + @Child(name = "notes", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional information about the Condition", formalDefinition="Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis." ) + protected StringType notes; + + private static final long serialVersionUID = -341227215L; + + /** + * Constructor + */ + public Condition() { + super(); + } + + /** + * Constructor + */ + public Condition(Reference patient, CodeableConcept code, Enumeration verificationStatus) { + super(); + this.patient = patient; + this.code = code; + this.verificationStatus = verificationStatus; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this condition 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} (This records identifiers associated with this condition 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; + } + + // syntactic sugar + public Condition addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (Indicates the patient who the condition record is associated with.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Indicates the patient who the condition record is associated with.) + */ + public Condition 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. (Indicates the patient who the condition record is associated with.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (Indicates the patient who the condition record is associated with.) + */ + public Condition setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #encounter} (Encounter during which the condition was first asserted.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (Encounter during which the condition was first asserted.) + */ + public Condition 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. (Encounter during which the condition was first asserted.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (Encounter during which the condition was first asserted.) + */ + public Condition setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #asserter} (Individual who is making the condition statement.) + */ + public Reference getAsserter() { + if (this.asserter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.asserter"); + else if (Configuration.doAutoCreate()) + this.asserter = new Reference(); // cc + return this.asserter; + } + + public boolean hasAsserter() { + return this.asserter != null && !this.asserter.isEmpty(); + } + + /** + * @param value {@link #asserter} (Individual who is making the condition statement.) + */ + public Condition setAsserter(Reference value) { + this.asserter = value; + return this; + } + + /** + * @return {@link #asserter} 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. (Individual who is making the condition statement.) + */ + public Resource getAsserterTarget() { + return this.asserterTarget; + } + + /** + * @param value {@link #asserter} 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. (Individual who is making the condition statement.) + */ + public Condition setAsserterTarget(Resource value) { + this.asserterTarget = value; + return this; + } + + /** + * @return {@link #dateRecorded} (A date, when the Condition statement was documented.). This is the underlying object with id, value and extensions. The accessor "getDateRecorded" gives direct access to the value + */ + public DateType getDateRecordedElement() { + if (this.dateRecorded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.dateRecorded"); + else if (Configuration.doAutoCreate()) + this.dateRecorded = new DateType(); // bb + return this.dateRecorded; + } + + public boolean hasDateRecordedElement() { + return this.dateRecorded != null && !this.dateRecorded.isEmpty(); + } + + public boolean hasDateRecorded() { + return this.dateRecorded != null && !this.dateRecorded.isEmpty(); + } + + /** + * @param value {@link #dateRecorded} (A date, when the Condition statement was documented.). This is the underlying object with id, value and extensions. The accessor "getDateRecorded" gives direct access to the value + */ + public Condition setDateRecordedElement(DateType value) { + this.dateRecorded = value; + return this; + } + + /** + * @return A date, when the Condition statement was documented. + */ + public Date getDateRecorded() { + return this.dateRecorded == null ? null : this.dateRecorded.getValue(); + } + + /** + * @param value A date, when the Condition statement was documented. + */ + public Condition setDateRecorded(Date value) { + if (value == null) + this.dateRecorded = null; + else { + if (this.dateRecorded == null) + this.dateRecorded = new DateType(); + this.dateRecorded.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identification of the condition, problem or diagnosis.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identification of the condition, problem or diagnosis.) + */ + public Condition setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #category} (A category assigned to the condition.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (A category assigned to the condition.) + */ + public Condition setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #clinicalStatus} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value + */ + public CodeType getClinicalStatusElement() { + if (this.clinicalStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.clinicalStatus"); + else if (Configuration.doAutoCreate()) + this.clinicalStatus = new CodeType(); // bb + return this.clinicalStatus; + } + + public boolean hasClinicalStatusElement() { + return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); + } + + public boolean hasClinicalStatus() { + return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); + } + + /** + * @param value {@link #clinicalStatus} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value + */ + public Condition setClinicalStatusElement(CodeType value) { + this.clinicalStatus = value; + return this; + } + + /** + * @return The clinical status of the condition. + */ + public String getClinicalStatus() { + return this.clinicalStatus == null ? null : this.clinicalStatus.getValue(); + } + + /** + * @param value The clinical status of the condition. + */ + public Condition setClinicalStatus(String value) { + if (Utilities.noString(value)) + this.clinicalStatus = null; + else { + if (this.clinicalStatus == null) + this.clinicalStatus = new CodeType(); + this.clinicalStatus.setValue(value); + } + return this; + } + + /** + * @return {@link #verificationStatus} (The verification status to support the clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getVerificationStatus" gives direct access to the value + */ + public Enumeration getVerificationStatusElement() { + if (this.verificationStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.verificationStatus"); + else if (Configuration.doAutoCreate()) + this.verificationStatus = new Enumeration(new ConditionVerificationStatusEnumFactory()); // bb + return this.verificationStatus; + } + + public boolean hasVerificationStatusElement() { + return this.verificationStatus != null && !this.verificationStatus.isEmpty(); + } + + public boolean hasVerificationStatus() { + return this.verificationStatus != null && !this.verificationStatus.isEmpty(); + } + + /** + * @param value {@link #verificationStatus} (The verification status to support the clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getVerificationStatus" gives direct access to the value + */ + public Condition setVerificationStatusElement(Enumeration value) { + this.verificationStatus = value; + return this; + } + + /** + * @return The verification status to support the clinical status of the condition. + */ + public ConditionVerificationStatus getVerificationStatus() { + return this.verificationStatus == null ? null : this.verificationStatus.getValue(); + } + + /** + * @param value The verification status to support the clinical status of the condition. + */ + public Condition setVerificationStatus(ConditionVerificationStatus value) { + if (this.verificationStatus == null) + this.verificationStatus = new Enumeration(new ConditionVerificationStatusEnumFactory()); + this.verificationStatus.setValue(value); + return this; + } + + /** + * @return {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) + */ + public CodeableConcept getSeverity() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new CodeableConcept(); // cc + return this.severity; + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) + */ + public Condition setSeverity(CodeableConcept value) { + this.severity = value; + return this; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Type getOnset() { + return this.onset; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public DateTimeType getOnsetDateTimeType() throws FHIRException { + if (!(this.onset instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (DateTimeType) this.onset; + } + + public boolean hasOnsetDateTimeType() { + return this.onset instanceof DateTimeType; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Age getOnsetAge() throws FHIRException { + if (!(this.onset instanceof Age)) + throw new FHIRException("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Age) this.onset; + } + + public boolean hasOnsetAge() { + return this.onset instanceof Age; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Period getOnsetPeriod() throws FHIRException { + if (!(this.onset instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Period) this.onset; + } + + public boolean hasOnsetPeriod() { + return this.onset instanceof Period; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Range getOnsetRange() throws FHIRException { + if (!(this.onset instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Range) this.onset; + } + + public boolean hasOnsetRange() { + return this.onset instanceof Range; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public StringType getOnsetStringType() throws FHIRException { + if (!(this.onset instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (StringType) this.onset; + } + + public boolean hasOnsetStringType() { + return this.onset instanceof StringType; + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Condition setOnset(Type value) { + this.onset = value; + return this; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Type getAbatement() { + return this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public DateTimeType getAbatementDateTimeType() throws FHIRException { + if (!(this.abatement instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (DateTimeType) this.abatement; + } + + public boolean hasAbatementDateTimeType() { + return this.abatement instanceof DateTimeType; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Age getAbatementAge() throws FHIRException { + if (!(this.abatement instanceof Age)) + throw new FHIRException("Type mismatch: the type Age was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (Age) this.abatement; + } + + public boolean hasAbatementAge() { + return this.abatement instanceof Age; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public BooleanType getAbatementBooleanType() throws FHIRException { + if (!(this.abatement instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (BooleanType) this.abatement; + } + + public boolean hasAbatementBooleanType() { + return this.abatement instanceof BooleanType; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Period getAbatementPeriod() throws FHIRException { + if (!(this.abatement instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (Period) this.abatement; + } + + public boolean hasAbatementPeriod() { + return this.abatement instanceof Period; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Range getAbatementRange() throws FHIRException { + if (!(this.abatement instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (Range) this.abatement; + } + + public boolean hasAbatementRange() { + return this.abatement instanceof Range; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public StringType getAbatementStringType() throws FHIRException { + if (!(this.abatement instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (StringType) this.abatement; + } + + public boolean hasAbatementStringType() { + return this.abatement instanceof StringType; + } + + public boolean hasAbatement() { + return this.abatement != null && !this.abatement.isEmpty(); + } + + /** + * @param value {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Condition setAbatement(Type value) { + this.abatement = value; + return this; + } + + /** + * @return {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) + */ + public ConditionStageComponent getStage() { + if (this.stage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.stage"); + else if (Configuration.doAutoCreate()) + this.stage = new ConditionStageComponent(); // cc + return this.stage; + } + + public boolean hasStage() { + return this.stage != null && !this.stage.isEmpty(); + } + + /** + * @param value {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) + */ + public Condition setStage(ConditionStageComponent value) { + this.stage = value; + return this; + } + + /** + * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) + */ + public List getEvidence() { + if (this.evidence == null) + this.evidence = new ArrayList(); + return this.evidence; + } + + public boolean hasEvidence() { + if (this.evidence == null) + return false; + for (ConditionEvidenceComponent item : this.evidence) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) + */ + // syntactic sugar + public ConditionEvidenceComponent addEvidence() { //3 + ConditionEvidenceComponent t = new ConditionEvidenceComponent(); + if (this.evidence == null) + this.evidence = new ArrayList(); + this.evidence.add(t); + return t; + } + + // syntactic sugar + public Condition addEvidence(ConditionEvidenceComponent t) { //3 + if (t == null) + return this; + if (this.evidence == null) + this.evidence = new ArrayList(); + this.evidence.add(t); + return this; + } + + /** + * @return {@link #bodySite} (The anatomical location where this condition manifests itself.) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (CodeableConcept item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (The anatomical location where this condition manifests itself.) + */ + // syntactic sugar + public CodeableConcept addBodySite() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + // syntactic sugar + public Condition addBodySite(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return this; + } + + /** + * @return {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). 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 Condition.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + 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} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public Condition setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + public Condition 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this condition 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("patient", "Reference(Patient)", "Indicates the patient who the condition record is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which the condition was first asserted.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("asserter", "Reference(Practitioner|Patient)", "Individual who is making the condition statement.", 0, java.lang.Integer.MAX_VALUE, asserter)); + childrenList.add(new Property("dateRecorded", "date", "A date, when the Condition statement was documented.", 0, java.lang.Integer.MAX_VALUE, dateRecorded)); + childrenList.add(new Property("code", "CodeableConcept", "Identification of the condition, problem or diagnosis.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "CodeableConcept", "A category assigned to the condition.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("clinicalStatus", "code", "The clinical status of the condition.", 0, java.lang.Integer.MAX_VALUE, clinicalStatus)); + childrenList.add(new Property("verificationStatus", "code", "The verification status to support the clinical status of the condition.", 0, java.lang.Integer.MAX_VALUE, verificationStatus)); + childrenList.add(new Property("severity", "CodeableConcept", "A subjective assessment of the severity of the condition as evaluated by the clinician.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date or date-time the condition began, in the opinion of the clinician.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("abatement[x]", "dateTime|Age|boolean|Period|Range|string", "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.", 0, java.lang.Integer.MAX_VALUE, abatement)); + childrenList.add(new Property("stage", "", "Clinical stage or grade of a condition. May include formal severity assessments.", 0, java.lang.Integer.MAX_VALUE, stage)); + childrenList.add(new Property("evidence", "", "Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.", 0, java.lang.Integer.MAX_VALUE, evidence)); + childrenList.add(new Property("bodySite", "CodeableConcept", "The anatomical location where this condition manifests itself.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("notes", "string", "Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.", 0, java.lang.Integer.MAX_VALUE, notes)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -373242253: /*asserter*/ return this.asserter == null ? new Base[0] : new Base[] {this.asserter}; // Reference + case 1888120446: /*dateRecorded*/ return this.dateRecorded == null ? new Base[0] : new Base[] {this.dateRecorded}; // DateType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case -462853915: /*clinicalStatus*/ return this.clinicalStatus == null ? new Base[0] : new Base[] {this.clinicalStatus}; // CodeType + case -842509843: /*verificationStatus*/ return this.verificationStatus == null ? new Base[0] : new Base[] {this.verificationStatus}; // Enumeration + case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // CodeableConcept + case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // Type + case -921554001: /*abatement*/ return this.abatement == null ? new Base[0] : new Base[] {this.abatement}; // Type + case 109757182: /*stage*/ return this.stage == null ? new Base[0] : new Base[] {this.stage}; // ConditionStageComponent + case 382967383: /*evidence*/ return this.evidence == null ? new Base[0] : this.evidence.toArray(new Base[this.evidence.size()]); // ConditionEvidenceComponent + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept + case 105008833: /*notes*/ return this.notes == null ? new Base[0] : new Base[] {this.notes}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -373242253: // asserter + this.asserter = castToReference(value); // Reference + break; + case 1888120446: // dateRecorded + this.dateRecorded = castToDate(value); // DateType + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case -462853915: // clinicalStatus + this.clinicalStatus = castToCode(value); // CodeType + break; + case -842509843: // verificationStatus + this.verificationStatus = new ConditionVerificationStatusEnumFactory().fromType(value); // Enumeration + break; + case 1478300413: // severity + this.severity = castToCodeableConcept(value); // CodeableConcept + break; + case 105901603: // onset + this.onset = (Type) value; // Type + break; + case -921554001: // abatement + this.abatement = (Type) value; // Type + break; + case 109757182: // stage + this.stage = (ConditionStageComponent) value; // ConditionStageComponent + break; + case 382967383: // evidence + this.getEvidence().add((ConditionEvidenceComponent) value); // ConditionEvidenceComponent + break; + case 1702620169: // bodySite + this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 105008833: // notes + this.notes = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("asserter")) + this.asserter = castToReference(value); // Reference + else if (name.equals("dateRecorded")) + this.dateRecorded = castToDate(value); // DateType + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("clinicalStatus")) + this.clinicalStatus = castToCode(value); // CodeType + else if (name.equals("verificationStatus")) + this.verificationStatus = new ConditionVerificationStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("severity")) + this.severity = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("onset[x]")) + this.onset = (Type) value; // Type + else if (name.equals("abatement[x]")) + this.abatement = (Type) value; // Type + else if (name.equals("stage")) + this.stage = (ConditionStageComponent) value; // ConditionStageComponent + else if (name.equals("evidence")) + this.getEvidence().add((ConditionEvidenceComponent) value); + else if (name.equals("bodySite")) + this.getBodySite().add(castToCodeableConcept(value)); + else if (name.equals("notes")) + this.notes = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -791418107: return getPatient(); // Reference + case 1524132147: return getEncounter(); // Reference + case -373242253: return getAsserter(); // Reference + case 1888120446: throw new FHIRException("Cannot make property dateRecorded as it is not a complex type"); // DateType + case 3059181: return getCode(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case -462853915: throw new FHIRException("Cannot make property clinicalStatus as it is not a complex type"); // CodeType + case -842509843: throw new FHIRException("Cannot make property verificationStatus as it is not a complex type"); // Enumeration + case 1478300413: return getSeverity(); // CodeableConcept + case -1886216323: return getOnset(); // Type + case -584196495: return getAbatement(); // Type + case 109757182: return getStage(); // ConditionStageComponent + case 382967383: return addEvidence(); // ConditionEvidenceComponent + case 1702620169: return addBodySite(); // CodeableConcept + case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("asserter")) { + this.asserter = new Reference(); + return this.asserter; + } + else if (name.equals("dateRecorded")) { + throw new FHIRException("Cannot call addChild on a primitive type Condition.dateRecorded"); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("clinicalStatus")) { + throw new FHIRException("Cannot call addChild on a primitive type Condition.clinicalStatus"); + } + else if (name.equals("verificationStatus")) { + throw new FHIRException("Cannot call addChild on a primitive type Condition.verificationStatus"); + } + else if (name.equals("severity")) { + this.severity = new CodeableConcept(); + return this.severity; + } + else if (name.equals("onsetDateTime")) { + this.onset = new DateTimeType(); + return this.onset; + } + else if (name.equals("onsetAge")) { + this.onset = new Age(); + return this.onset; + } + else if (name.equals("onsetPeriod")) { + this.onset = new Period(); + return this.onset; + } + else if (name.equals("onsetRange")) { + this.onset = new Range(); + return this.onset; + } + else if (name.equals("onsetString")) { + this.onset = new StringType(); + return this.onset; + } + else if (name.equals("abatementDateTime")) { + this.abatement = new DateTimeType(); + return this.abatement; + } + else if (name.equals("abatementAge")) { + this.abatement = new Age(); + return this.abatement; + } + else if (name.equals("abatementBoolean")) { + this.abatement = new BooleanType(); + return this.abatement; + } + else if (name.equals("abatementPeriod")) { + this.abatement = new Period(); + return this.abatement; + } + else if (name.equals("abatementRange")) { + this.abatement = new Range(); + return this.abatement; + } + else if (name.equals("abatementString")) { + this.abatement = new StringType(); + return this.abatement; + } + else if (name.equals("stage")) { + this.stage = new ConditionStageComponent(); + return this.stage; + } + else if (name.equals("evidence")) { + return addEvidence(); + } + else if (name.equals("bodySite")) { + return addBodySite(); + } + else if (name.equals("notes")) { + throw new FHIRException("Cannot call addChild on a primitive type Condition.notes"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Condition"; + + } + + public Condition copy() { + Condition dst = new Condition(); + 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.encounter = encounter == null ? null : encounter.copy(); + dst.asserter = asserter == null ? null : asserter.copy(); + dst.dateRecorded = dateRecorded == null ? null : dateRecorded.copy(); + dst.code = code == null ? null : code.copy(); + dst.category = category == null ? null : category.copy(); + dst.clinicalStatus = clinicalStatus == null ? null : clinicalStatus.copy(); + dst.verificationStatus = verificationStatus == null ? null : verificationStatus.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.abatement = abatement == null ? null : abatement.copy(); + dst.stage = stage == null ? null : stage.copy(); + if (evidence != null) { + dst.evidence = new ArrayList(); + for (ConditionEvidenceComponent i : evidence) + dst.evidence.add(i.copy()); + }; + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (CodeableConcept i : bodySite) + dst.bodySite.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + return dst; + } + + protected Condition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Condition)) + return false; + Condition o = (Condition) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(asserter, o.asserter, true) && compareDeep(dateRecorded, o.dateRecorded, true) && compareDeep(code, o.code, true) + && compareDeep(category, o.category, true) && compareDeep(clinicalStatus, o.clinicalStatus, true) + && compareDeep(verificationStatus, o.verificationStatus, true) && compareDeep(severity, o.severity, true) + && compareDeep(onset, o.onset, true) && compareDeep(abatement, o.abatement, true) && compareDeep(stage, o.stage, true) + && compareDeep(evidence, o.evidence, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(notes, o.notes, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Condition)) + return false; + Condition o = (Condition) other; + return compareValues(dateRecorded, o.dateRecorded, true) && compareValues(clinicalStatus, o.clinicalStatus, true) + && compareValues(verificationStatus, o.verificationStatus, true) && compareValues(notes, o.notes, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (asserter == null || asserter.isEmpty()) + && (dateRecorded == null || dateRecorded.isEmpty()) && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) + && (clinicalStatus == null || clinicalStatus.isEmpty()) && (verificationStatus == null || verificationStatus.isEmpty()) + && (severity == null || severity.isEmpty()) && (onset == null || onset.isEmpty()) && (abatement == null || abatement.isEmpty()) + && (stage == null || stage.isEmpty()) && (evidence == null || evidence.isEmpty()) && (bodySite == null || bodySite.isEmpty()) + && (notes == null || notes.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Condition; + } + + /** + * Search parameter: date-recorded + *

+ * Description: A date, when the Condition statement was documented
+ * Type: date
+ * Path: Condition.dateRecorded
+ *

+ */ + @SearchParamDefinition(name="date-recorded", path="Condition.dateRecorded", description="A date, when the Condition statement was documented", type="date" ) + public static final String SP_DATE_RECORDED = "date-recorded"; + /** + * Fluent Client search parameter constant for date-recorded + *

+ * Description: A date, when the Condition statement was documented
+ * Type: date
+ * Path: Condition.dateRecorded
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE_RECORDED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE_RECORDED); + + /** + * Search parameter: asserter + *

+ * Description: Person who asserts this condition
+ * Type: reference
+ * Path: Condition.asserter
+ *

+ */ + @SearchParamDefinition(name="asserter", path="Condition.asserter", description="Person who asserts this condition", type="reference" ) + public static final String SP_ASSERTER = "asserter"; + /** + * Fluent Client search parameter constant for asserter + *

+ * Description: Person who asserts this condition
+ * Type: reference
+ * Path: Condition.asserter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ASSERTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ASSERTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Condition:asserter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ASSERTER = new ca.uhn.fhir.model.api.Include("Condition:asserter").toLocked(); + + /** + * Search parameter: onset + *

+ * Description: Date related onsets (dateTime and Period)
+ * Type: date
+ * Path: Condition.onset[x]
+ *

+ */ + @SearchParamDefinition(name="onset", path="Condition.onset.as(dateTime) | Condition.onset.as(Period)", description="Date related onsets (dateTime and Period)", type="date" ) + public static final String SP_ONSET = "onset"; + /** + * Fluent Client search parameter constant for onset + *

+ * Description: Date related onsets (dateTime and Period)
+ * Type: date
+ * Path: Condition.onset[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam ONSET = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ONSET); + + /** + * Search parameter: evidence + *

+ * Description: Manifestation/symptom
+ * Type: token
+ * Path: Condition.evidence.code
+ *

+ */ + @SearchParamDefinition(name="evidence", path="Condition.evidence.code", description="Manifestation/symptom", type="token" ) + public static final String SP_EVIDENCE = "evidence"; + /** + * Fluent Client search parameter constant for evidence + *

+ * Description: Manifestation/symptom
+ * Type: token
+ * Path: Condition.evidence.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVIDENCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVIDENCE); + + /** + * Search parameter: body-site + *

+ * Description: Anatomical location, if relevant
+ * Type: token
+ * Path: Condition.bodySite
+ *

+ */ + @SearchParamDefinition(name="body-site", path="Condition.bodySite", description="Anatomical location, if relevant", type="token" ) + public static final String SP_BODY_SITE = "body-site"; + /** + * Fluent Client search parameter constant for body-site + *

+ * Description: Anatomical location, if relevant
+ * Type: token
+ * Path: Condition.bodySite
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODY_SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODY_SITE); + + /** + * Search parameter: onset-info + *

+ * Description: Other onsets (boolean, age, range, string)
+ * Type: string
+ * Path: Condition.onset[x]
+ *

+ */ + @SearchParamDefinition(name="onset-info", path="Condition.onset.as(boolean) | Condition.onset.as(Quantity) | Condition.onset.as(Range) | Condition.onset.as(string)", description="Other onsets (boolean, age, range, string)", type="string" ) + public static final String SP_ONSET_INFO = "onset-info"; + /** + * Fluent Client search parameter constant for onset-info + *

+ * Description: Other onsets (boolean, age, range, string)
+ * Type: string
+ * Path: Condition.onset[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ONSET_INFO = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ONSET_INFO); + + /** + * Search parameter: severity + *

+ * Description: The severity of the condition
+ * Type: token
+ * Path: Condition.severity
+ *

+ */ + @SearchParamDefinition(name="severity", path="Condition.severity", description="The severity of the condition", type="token" ) + public static final String SP_SEVERITY = "severity"; + /** + * Fluent Client search parameter constant for severity + *

+ * Description: The severity of the condition
+ * Type: token
+ * Path: Condition.severity
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SEVERITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SEVERITY); + + /** + * Search parameter: code + *

+ * Description: Code for the condition
+ * Type: token
+ * Path: Condition.code
+ *

+ */ + @SearchParamDefinition(name="code", path="Condition.code", description="Code for the condition", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Code for the condition
+ * Type: token
+ * Path: Condition.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: encounter + *

+ * Description: Encounter when condition first asserted
+ * Type: reference
+ * Path: Condition.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="Condition.encounter", description="Encounter when condition first asserted", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Encounter when condition first asserted
+ * Type: reference
+ * Path: Condition.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Condition:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Condition:encounter").toLocked(); + + /** + * Search parameter: stage + *

+ * Description: Simple summary (disease specific)
+ * Type: token
+ * Path: Condition.stage.summary
+ *

+ */ + @SearchParamDefinition(name="stage", path="Condition.stage.summary", description="Simple summary (disease specific)", type="token" ) + public static final String SP_STAGE = "stage"; + /** + * Fluent Client search parameter constant for stage + *

+ * Description: Simple summary (disease specific)
+ * Type: token
+ * Path: Condition.stage.summary
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STAGE); + + /** + * Search parameter: category + *

+ * Description: The category of the condition
+ * Type: token
+ * Path: Condition.category
+ *

+ */ + @SearchParamDefinition(name="category", path="Condition.category", description="The category of the condition", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: The category of the condition
+ * Type: token
+ * Path: Condition.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: patient + *

+ * Description: Who has the condition?
+ * Type: reference
+ * Path: Condition.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="Condition.patient", description="Who has the condition?", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who has the condition?
+ * Type: reference
+ * Path: Condition.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Condition:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Condition:patient").toLocked(); + + /** + * Search parameter: clinicalstatus + *

+ * Description: The clinical status of the condition
+ * Type: token
+ * Path: Condition.clinicalStatus
+ *

+ */ + @SearchParamDefinition(name="clinicalstatus", path="Condition.clinicalStatus", description="The clinical status of the condition", type="token" ) + public static final String SP_CLINICALSTATUS = "clinicalstatus"; + /** + * Fluent Client search parameter constant for clinicalstatus + *

+ * Description: The clinical status of the condition
+ * Type: token
+ * Path: Condition.clinicalStatus
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLINICALSTATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLINICALSTATUS); + + /** + * Search parameter: identifier + *

+ * Description: A unique identifier of the condition record
+ * Type: token
+ * Path: Condition.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Condition.identifier", description="A unique identifier of the condition record", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A unique identifier of the condition record
+ * Type: token
+ * Path: Condition.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Configuration.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Configuration.java new file mode 100644 index 00000000000..25da12876ff --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Configuration.java @@ -0,0 +1,106 @@ +package org.hl7.fhir.dstu2016may.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. + +*/ + +/** + * This class is created to help implementers deal with a change to + * the API that was made between versions 0.81 and 0.9 + * + * The change is the behaviour of the .getX() where the cardinality of + * x is 0..1 or 1..1. Before the change, these routines would return + * null if the object had not previously been assigned, and after the ' + * change, they will automatically create the object if it had not + * been assigned (unless the object is polymorphic, in which case, + * only the type specific getters create the object) + * + * When making the transition from the old style to the new style, + * the main change is that when testing for presence or abssense + * of the element, instead of doing one of these two: + * + * if (obj.getProperty() == null) + * if (obj.getProperty() != null) + * + * you instead do + * + * if (!obj.hasProperty()) + * if (obj.hasProperty()) + * + * or else one of these two: + * + * if (obj.getProperty().isEmpty()) + * if (!obj.getProperty().isEmpty()) + * + * The only way to sort this out is by finding all these things + * in the code, and changing them. + * + * To help with that, you can set the status field of this class + * to change how this API behaves. Note: the status value is tied + * to the way that you program. The intent of this class is to + * help make developers the transiition to status = 0. The old + * behaviour is status = 2. To make the transition, set the + * status code to 1. This way, any time a .getX routine needs + * to automatically create an object, an exception will be + * raised instead. The expected use of this is: + * - set status = 1 + * - test your code (all paths) + * - when an exception happens, change the code to use .hasX() or .isEmpty() + * - when all execution paths don't raise an exception, set status = 0 + * - start programming to the new style. + * + * You can set status = 2 and leave it like that, but this is not + * compatible with the utilities and validation code, nor with the + * HAPI code. So everyone shoul make this transition + * + * This is a difficult change to make to an API. Most users should engage with it + * as they migrate from DSTU1 to DSTU2, at the same time as they encounter + * other changes. This change was made in order to align the two java reference + * implementations on a common object model, which is an important outcome that + * justifies making this change to implementers (sorry for any pain caused) + * + * @author Grahame + * + */ +public class Configuration { + + private static int status = 0; + // 0: auto-create + // 1: error + // 2: return null + + public static boolean errorOnAutoCreate() { + return status == 1; + } + + + public static boolean doAutoCreate() { + return status == 0; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Conformance.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Conformance.java new file mode 100644 index 00000000000..f9e4bdd91d0 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Conformance.java @@ -0,0 +1,8989 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType; +import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.instance.model.api.IBaseConformance; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. + */ +@ResourceDef(name="Conformance", profile="http://hl7.org/fhir/Profile/Conformance") +public class Conformance extends DomainResource implements IBaseConformance { + + public enum ConformanceStatementKind { + /** + * The Conformance instance represents the present capabilities of a specific system instance. This is the kind returned by OPTIONS for a FHIR server end-point. + */ + INSTANCE, + /** + * The Conformance instance represents the capabilities of a system or piece of software, independent of a particular installation. + */ + CAPABILITY, + /** + * The Conformance instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'. + */ + REQUIREMENTS, + /** + * added to help the parsers + */ + NULL; + public static ConformanceStatementKind fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("instance".equals(codeString)) + return INSTANCE; + if ("capability".equals(codeString)) + return CAPABILITY; + if ("requirements".equals(codeString)) + return REQUIREMENTS; + throw new FHIRException("Unknown ConformanceStatementKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INSTANCE: return "instance"; + case CAPABILITY: return "capability"; + case REQUIREMENTS: return "requirements"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INSTANCE: return "http://hl7.org/fhir/conformance-statement-kind"; + case CAPABILITY: return "http://hl7.org/fhir/conformance-statement-kind"; + case REQUIREMENTS: return "http://hl7.org/fhir/conformance-statement-kind"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INSTANCE: return "The Conformance instance represents the present capabilities of a specific system instance. This is the kind returned by OPTIONS for a FHIR server end-point."; + case CAPABILITY: return "The Conformance instance represents the capabilities of a system or piece of software, independent of a particular installation."; + case REQUIREMENTS: return "The Conformance instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INSTANCE: return "Instance"; + case CAPABILITY: return "Capability"; + case REQUIREMENTS: return "Requirements"; + default: return "?"; + } + } + } + + public static class ConformanceStatementKindEnumFactory implements EnumFactory { + public ConformanceStatementKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("instance".equals(codeString)) + return ConformanceStatementKind.INSTANCE; + if ("capability".equals(codeString)) + return ConformanceStatementKind.CAPABILITY; + if ("requirements".equals(codeString)) + return ConformanceStatementKind.REQUIREMENTS; + throw new IllegalArgumentException("Unknown ConformanceStatementKind code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("instance".equals(codeString)) + return new Enumeration(this, ConformanceStatementKind.INSTANCE); + if ("capability".equals(codeString)) + return new Enumeration(this, ConformanceStatementKind.CAPABILITY); + if ("requirements".equals(codeString)) + return new Enumeration(this, ConformanceStatementKind.REQUIREMENTS); + throw new FHIRException("Unknown ConformanceStatementKind code '"+codeString+"'"); + } + public String toCode(ConformanceStatementKind code) { + if (code == ConformanceStatementKind.INSTANCE) + return "instance"; + if (code == ConformanceStatementKind.CAPABILITY) + return "capability"; + if (code == ConformanceStatementKind.REQUIREMENTS) + return "requirements"; + return "?"; + } + public String toSystem(ConformanceStatementKind code) { + return code.getSystem(); + } + } + + public enum UnknownContentCode { + /** + * The application does not accept either unknown elements or extensions. + */ + NO, + /** + * The application accepts unknown extensions, but not unknown elements. + */ + EXTENSIONS, + /** + * The application accepts unknown elements, but not unknown extensions. + */ + ELEMENTS, + /** + * The application accepts unknown elements and extensions. + */ + BOTH, + /** + * added to help the parsers + */ + NULL; + public static UnknownContentCode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("no".equals(codeString)) + return NO; + if ("extensions".equals(codeString)) + return EXTENSIONS; + if ("elements".equals(codeString)) + return ELEMENTS; + if ("both".equals(codeString)) + return BOTH; + throw new FHIRException("Unknown UnknownContentCode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NO: return "no"; + case EXTENSIONS: return "extensions"; + case ELEMENTS: return "elements"; + case BOTH: return "both"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NO: return "http://hl7.org/fhir/unknown-content-code"; + case EXTENSIONS: return "http://hl7.org/fhir/unknown-content-code"; + case ELEMENTS: return "http://hl7.org/fhir/unknown-content-code"; + case BOTH: return "http://hl7.org/fhir/unknown-content-code"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NO: return "The application does not accept either unknown elements or extensions."; + case EXTENSIONS: return "The application accepts unknown extensions, but not unknown elements."; + case ELEMENTS: return "The application accepts unknown elements, but not unknown extensions."; + case BOTH: return "The application accepts unknown elements and extensions."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NO: return "Neither Elements or Extensions"; + case EXTENSIONS: return "Unknown Extensions"; + case ELEMENTS: return "Unknown Elements"; + case BOTH: return "Unknown Elements and Extensions"; + default: return "?"; + } + } + } + + public static class UnknownContentCodeEnumFactory implements EnumFactory { + public UnknownContentCode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("no".equals(codeString)) + return UnknownContentCode.NO; + if ("extensions".equals(codeString)) + return UnknownContentCode.EXTENSIONS; + if ("elements".equals(codeString)) + return UnknownContentCode.ELEMENTS; + if ("both".equals(codeString)) + return UnknownContentCode.BOTH; + throw new IllegalArgumentException("Unknown UnknownContentCode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("no".equals(codeString)) + return new Enumeration(this, UnknownContentCode.NO); + if ("extensions".equals(codeString)) + return new Enumeration(this, UnknownContentCode.EXTENSIONS); + if ("elements".equals(codeString)) + return new Enumeration(this, UnknownContentCode.ELEMENTS); + if ("both".equals(codeString)) + return new Enumeration(this, UnknownContentCode.BOTH); + throw new FHIRException("Unknown UnknownContentCode code '"+codeString+"'"); + } + public String toCode(UnknownContentCode code) { + if (code == UnknownContentCode.NO) + return "no"; + if (code == UnknownContentCode.EXTENSIONS) + return "extensions"; + if (code == UnknownContentCode.ELEMENTS) + return "elements"; + if (code == UnknownContentCode.BOTH) + return "both"; + return "?"; + } + public String toSystem(UnknownContentCode code) { + return code.getSystem(); + } + } + + public enum RestfulConformanceMode { + /** + * The application acts as a client for this resource. + */ + CLIENT, + /** + * The application acts as a server for this resource. + */ + SERVER, + /** + * added to help the parsers + */ + NULL; + public static RestfulConformanceMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("client".equals(codeString)) + return CLIENT; + if ("server".equals(codeString)) + return SERVER; + throw new FHIRException("Unknown RestfulConformanceMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CLIENT: return "client"; + case SERVER: return "server"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CLIENT: return "http://hl7.org/fhir/restful-conformance-mode"; + case SERVER: return "http://hl7.org/fhir/restful-conformance-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CLIENT: return "The application acts as a client for this resource."; + case SERVER: return "The application acts as a server for this resource."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CLIENT: return "Client"; + case SERVER: return "Server"; + default: return "?"; + } + } + } + + 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; + if ("client".equals(codeString)) + return RestfulConformanceMode.CLIENT; + if ("server".equals(codeString)) + return RestfulConformanceMode.SERVER; + throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("client".equals(codeString)) + return new Enumeration(this, RestfulConformanceMode.CLIENT); + if ("server".equals(codeString)) + return new Enumeration(this, RestfulConformanceMode.SERVER); + throw new FHIRException("Unknown RestfulConformanceMode code '"+codeString+"'"); + } + public String toCode(RestfulConformanceMode code) { + if (code == RestfulConformanceMode.CLIENT) + return "client"; + if (code == RestfulConformanceMode.SERVER) + return "server"; + return "?"; + } + public String toSystem(RestfulConformanceMode code) { + return code.getSystem(); + } + } + + public enum TypeRestfulInteraction { + /** + * null + */ + READ, + /** + * null + */ + VREAD, + /** + * null + */ + UPDATE, + /** + * null + */ + DELETE, + /** + * null + */ + HISTORYINSTANCE, + /** + * null + */ + HISTORYTYPE, + /** + * null + */ + CREATE, + /** + * null + */ + SEARCHTYPE, + /** + * added to help the parsers + */ + NULL; + public static TypeRestfulInteraction fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("read".equals(codeString)) + return READ; + if ("vread".equals(codeString)) + return VREAD; + if ("update".equals(codeString)) + return UPDATE; + if ("delete".equals(codeString)) + return DELETE; + if ("history-instance".equals(codeString)) + return HISTORYINSTANCE; + if ("history-type".equals(codeString)) + return HISTORYTYPE; + if ("create".equals(codeString)) + return CREATE; + if ("search-type".equals(codeString)) + return SEARCHTYPE; + throw new FHIRException("Unknown TypeRestfulInteraction code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case READ: return "read"; + case VREAD: return "vread"; + case UPDATE: return "update"; + case DELETE: return "delete"; + case HISTORYINSTANCE: return "history-instance"; + case HISTORYTYPE: return "history-type"; + case CREATE: return "create"; + case SEARCHTYPE: return "search-type"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case READ: return "http://hl7.org/fhir/restful-interaction"; + case VREAD: return "http://hl7.org/fhir/restful-interaction"; + case UPDATE: return "http://hl7.org/fhir/restful-interaction"; + case DELETE: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction"; + case CREATE: return "http://hl7.org/fhir/restful-interaction"; + case SEARCHTYPE: return "http://hl7.org/fhir/restful-interaction"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case READ: return ""; + case VREAD: return ""; + case UPDATE: return ""; + case DELETE: return ""; + case HISTORYINSTANCE: return ""; + case HISTORYTYPE: return ""; + case CREATE: return ""; + case SEARCHTYPE: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case READ: return "read"; + case VREAD: return "vread"; + case UPDATE: return "update"; + case DELETE: return "delete"; + case HISTORYINSTANCE: return "history-instance"; + case HISTORYTYPE: return "history-type"; + case CREATE: return "create"; + case SEARCHTYPE: return "search-type"; + default: return "?"; + } + } + } + + 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; + if ("read".equals(codeString)) + return TypeRestfulInteraction.READ; + if ("vread".equals(codeString)) + return TypeRestfulInteraction.VREAD; + if ("update".equals(codeString)) + return TypeRestfulInteraction.UPDATE; + if ("delete".equals(codeString)) + return TypeRestfulInteraction.DELETE; + if ("history-instance".equals(codeString)) + return TypeRestfulInteraction.HISTORYINSTANCE; + if ("history-type".equals(codeString)) + return TypeRestfulInteraction.HISTORYTYPE; + if ("create".equals(codeString)) + return TypeRestfulInteraction.CREATE; + if ("search-type".equals(codeString)) + return TypeRestfulInteraction.SEARCHTYPE; + throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("read".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.READ); + if ("vread".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.VREAD); + if ("update".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.UPDATE); + if ("delete".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.DELETE); + if ("history-instance".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.HISTORYINSTANCE); + if ("history-type".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.HISTORYTYPE); + if ("create".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.CREATE); + if ("search-type".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.SEARCHTYPE); + throw new FHIRException("Unknown TypeRestfulInteraction code '"+codeString+"'"); + } + public String toCode(TypeRestfulInteraction code) { + if (code == TypeRestfulInteraction.READ) + return "read"; + if (code == TypeRestfulInteraction.VREAD) + return "vread"; + if (code == TypeRestfulInteraction.UPDATE) + return "update"; + if (code == TypeRestfulInteraction.DELETE) + return "delete"; + if (code == TypeRestfulInteraction.HISTORYINSTANCE) + return "history-instance"; + if (code == TypeRestfulInteraction.HISTORYTYPE) + return "history-type"; + if (code == TypeRestfulInteraction.CREATE) + return "create"; + if (code == TypeRestfulInteraction.SEARCHTYPE) + return "search-type"; + return "?"; + } + public String toSystem(TypeRestfulInteraction code) { + return code.getSystem(); + } + } + + public enum ResourceVersionPolicy { + /** + * VersionId meta-property is not supported (server) or used (client). + */ + NOVERSION, + /** + * VersionId meta-property is supported (server) or used (client). + */ + VERSIONED, + /** + * VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client). + */ + VERSIONEDUPDATE, + /** + * added to help the parsers + */ + NULL; + public static ResourceVersionPolicy fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("no-version".equals(codeString)) + return NOVERSION; + if ("versioned".equals(codeString)) + return VERSIONED; + if ("versioned-update".equals(codeString)) + return VERSIONEDUPDATE; + throw new FHIRException("Unknown ResourceVersionPolicy code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NOVERSION: return "no-version"; + case VERSIONED: return "versioned"; + case VERSIONEDUPDATE: return "versioned-update"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOVERSION: return "http://hl7.org/fhir/versioning-policy"; + case VERSIONED: return "http://hl7.org/fhir/versioning-policy"; + case VERSIONEDUPDATE: return "http://hl7.org/fhir/versioning-policy"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOVERSION: return "VersionId meta-property is not supported (server) or used (client)."; + case VERSIONED: return "VersionId meta-property is supported (server) or used (client)."; + case VERSIONEDUPDATE: return "VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOVERSION: return "No VersionId Support"; + case VERSIONED: return "Versioned"; + case VERSIONEDUPDATE: return "VersionId tracked fully"; + default: return "?"; + } + } + } + + public static class ResourceVersionPolicyEnumFactory implements EnumFactory { + public ResourceVersionPolicy fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("no-version".equals(codeString)) + return ResourceVersionPolicy.NOVERSION; + if ("versioned".equals(codeString)) + return ResourceVersionPolicy.VERSIONED; + if ("versioned-update".equals(codeString)) + return ResourceVersionPolicy.VERSIONEDUPDATE; + throw new IllegalArgumentException("Unknown ResourceVersionPolicy code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("no-version".equals(codeString)) + return new Enumeration(this, ResourceVersionPolicy.NOVERSION); + if ("versioned".equals(codeString)) + return new Enumeration(this, ResourceVersionPolicy.VERSIONED); + if ("versioned-update".equals(codeString)) + return new Enumeration(this, ResourceVersionPolicy.VERSIONEDUPDATE); + throw new FHIRException("Unknown ResourceVersionPolicy code '"+codeString+"'"); + } + public String toCode(ResourceVersionPolicy code) { + if (code == ResourceVersionPolicy.NOVERSION) + return "no-version"; + if (code == ResourceVersionPolicy.VERSIONED) + return "versioned"; + if (code == ResourceVersionPolicy.VERSIONEDUPDATE) + return "versioned-update"; + return "?"; + } + public String toSystem(ResourceVersionPolicy code) { + return code.getSystem(); + } + } + + public enum ConditionalDeleteStatus { + /** + * No support for conditional deletes. + */ + NOTSUPPORTED, + /** + * Conditional deletes are supported, but only single resources at a time. + */ + SINGLE, + /** + * Conditional deletes are supported, and multiple resources can be deleted in a single interaction. + */ + MULTIPLE, + /** + * added to help the parsers + */ + NULL; + public static ConditionalDeleteStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("not-supported".equals(codeString)) + return NOTSUPPORTED; + if ("single".equals(codeString)) + return SINGLE; + if ("multiple".equals(codeString)) + return MULTIPLE; + throw new FHIRException("Unknown ConditionalDeleteStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NOTSUPPORTED: return "not-supported"; + case SINGLE: return "single"; + case MULTIPLE: return "multiple"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTSUPPORTED: return "http://hl7.org/fhir/conditional-delete-status"; + case SINGLE: return "http://hl7.org/fhir/conditional-delete-status"; + case MULTIPLE: return "http://hl7.org/fhir/conditional-delete-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTSUPPORTED: return "No support for conditional deletes."; + case SINGLE: return "Conditional deletes are supported, but only single resources at a time."; + case MULTIPLE: return "Conditional deletes are supported, and multiple resources can be deleted in a single interaction."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTSUPPORTED: return "Not Supported"; + case SINGLE: return "Single Deletes Supported"; + case MULTIPLE: return "Multiple Deletes Supported"; + default: return "?"; + } + } + } + + public static class ConditionalDeleteStatusEnumFactory implements EnumFactory { + public ConditionalDeleteStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-supported".equals(codeString)) + return ConditionalDeleteStatus.NOTSUPPORTED; + if ("single".equals(codeString)) + return ConditionalDeleteStatus.SINGLE; + if ("multiple".equals(codeString)) + return ConditionalDeleteStatus.MULTIPLE; + throw new IllegalArgumentException("Unknown ConditionalDeleteStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("not-supported".equals(codeString)) + return new Enumeration(this, ConditionalDeleteStatus.NOTSUPPORTED); + if ("single".equals(codeString)) + return new Enumeration(this, ConditionalDeleteStatus.SINGLE); + if ("multiple".equals(codeString)) + return new Enumeration(this, ConditionalDeleteStatus.MULTIPLE); + throw new FHIRException("Unknown ConditionalDeleteStatus code '"+codeString+"'"); + } + public String toCode(ConditionalDeleteStatus code) { + if (code == ConditionalDeleteStatus.NOTSUPPORTED) + return "not-supported"; + if (code == ConditionalDeleteStatus.SINGLE) + return "single"; + if (code == ConditionalDeleteStatus.MULTIPLE) + return "multiple"; + return "?"; + } + public String toSystem(ConditionalDeleteStatus code) { + return code.getSystem(); + } + } + + public enum SearchModifierCode { + /** + * The search parameter returns resources that have a value or not. + */ + MISSING, + /** + * The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents). + */ + EXACT, + /** + * The search parameter returns resources that include the supplied parameter value anywhere within the field being searched. + */ + CONTAINS, + /** + * The search parameter returns resources that do not contain a match . + */ + NOT, + /** + * The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text. + */ + TEXT, + /** + * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set. + */ + IN, + /** + * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set. + */ + NOTIN, + /** + * The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships). + */ + BELOW, + /** + * The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships). + */ + ABOVE, + /** + * The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.). + */ + TYPE, + /** + * added to help the parsers + */ + NULL; + public static SearchModifierCode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("missing".equals(codeString)) + return MISSING; + if ("exact".equals(codeString)) + return EXACT; + if ("contains".equals(codeString)) + return CONTAINS; + if ("not".equals(codeString)) + return NOT; + if ("text".equals(codeString)) + return TEXT; + if ("in".equals(codeString)) + return IN; + if ("not-in".equals(codeString)) + return NOTIN; + if ("below".equals(codeString)) + return BELOW; + if ("above".equals(codeString)) + return ABOVE; + if ("type".equals(codeString)) + return TYPE; + throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MISSING: return "missing"; + case EXACT: return "exact"; + case CONTAINS: return "contains"; + case NOT: return "not"; + case TEXT: return "text"; + case IN: return "in"; + case NOTIN: return "not-in"; + case BELOW: return "below"; + case ABOVE: return "above"; + case TYPE: return "type"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MISSING: return "http://hl7.org/fhir/search-modifier-code"; + case EXACT: return "http://hl7.org/fhir/search-modifier-code"; + case CONTAINS: return "http://hl7.org/fhir/search-modifier-code"; + case NOT: return "http://hl7.org/fhir/search-modifier-code"; + case TEXT: return "http://hl7.org/fhir/search-modifier-code"; + case IN: return "http://hl7.org/fhir/search-modifier-code"; + case NOTIN: return "http://hl7.org/fhir/search-modifier-code"; + case BELOW: return "http://hl7.org/fhir/search-modifier-code"; + case ABOVE: return "http://hl7.org/fhir/search-modifier-code"; + case TYPE: return "http://hl7.org/fhir/search-modifier-code"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MISSING: return "The search parameter returns resources that have a value or not."; + case EXACT: return "The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents)."; + case CONTAINS: return "The search parameter returns resources that include the supplied parameter value anywhere within the field being searched."; + case NOT: return "The search parameter returns resources that do not contain a match ."; + case TEXT: return "The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text."; + case IN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set."; + case NOTIN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set."; + case BELOW: return "The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships)."; + case ABOVE: return "The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships)."; + case TYPE: return "The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MISSING: return "Missing"; + case EXACT: return "Exact"; + case CONTAINS: return "Contains"; + case NOT: return "Not"; + case TEXT: return "Text"; + case IN: return "In"; + case NOTIN: return "Not In"; + case BELOW: return "Below"; + case ABOVE: return "Above"; + case TYPE: return "Type"; + default: return "?"; + } + } + } + + public static class SearchModifierCodeEnumFactory implements EnumFactory { + public SearchModifierCode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("missing".equals(codeString)) + return SearchModifierCode.MISSING; + if ("exact".equals(codeString)) + return SearchModifierCode.EXACT; + if ("contains".equals(codeString)) + return SearchModifierCode.CONTAINS; + if ("not".equals(codeString)) + return SearchModifierCode.NOT; + if ("text".equals(codeString)) + return SearchModifierCode.TEXT; + if ("in".equals(codeString)) + return SearchModifierCode.IN; + if ("not-in".equals(codeString)) + return SearchModifierCode.NOTIN; + if ("below".equals(codeString)) + return SearchModifierCode.BELOW; + if ("above".equals(codeString)) + return SearchModifierCode.ABOVE; + if ("type".equals(codeString)) + return SearchModifierCode.TYPE; + throw new IllegalArgumentException("Unknown SearchModifierCode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("missing".equals(codeString)) + return new Enumeration(this, SearchModifierCode.MISSING); + if ("exact".equals(codeString)) + return new Enumeration(this, SearchModifierCode.EXACT); + if ("contains".equals(codeString)) + return new Enumeration(this, SearchModifierCode.CONTAINS); + if ("not".equals(codeString)) + return new Enumeration(this, SearchModifierCode.NOT); + if ("text".equals(codeString)) + return new Enumeration(this, SearchModifierCode.TEXT); + if ("in".equals(codeString)) + return new Enumeration(this, SearchModifierCode.IN); + if ("not-in".equals(codeString)) + return new Enumeration(this, SearchModifierCode.NOTIN); + if ("below".equals(codeString)) + return new Enumeration(this, SearchModifierCode.BELOW); + if ("above".equals(codeString)) + return new Enumeration(this, SearchModifierCode.ABOVE); + if ("type".equals(codeString)) + return new Enumeration(this, SearchModifierCode.TYPE); + throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); + } + public String toCode(SearchModifierCode code) { + if (code == SearchModifierCode.MISSING) + return "missing"; + if (code == SearchModifierCode.EXACT) + return "exact"; + if (code == SearchModifierCode.CONTAINS) + return "contains"; + if (code == SearchModifierCode.NOT) + return "not"; + if (code == SearchModifierCode.TEXT) + return "text"; + if (code == SearchModifierCode.IN) + return "in"; + if (code == SearchModifierCode.NOTIN) + return "not-in"; + if (code == SearchModifierCode.BELOW) + return "below"; + if (code == SearchModifierCode.ABOVE) + return "above"; + if (code == SearchModifierCode.TYPE) + return "type"; + return "?"; + } + public String toSystem(SearchModifierCode code) { + return code.getSystem(); + } + } + + public enum SystemRestfulInteraction { + /** + * null + */ + TRANSACTION, + /** + * null + */ + SEARCHSYSTEM, + /** + * null + */ + HISTORYSYSTEM, + /** + * added to help the parsers + */ + NULL; + public static SystemRestfulInteraction fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("transaction".equals(codeString)) + return TRANSACTION; + if ("search-system".equals(codeString)) + return SEARCHSYSTEM; + if ("history-system".equals(codeString)) + return HISTORYSYSTEM; + throw new FHIRException("Unknown SystemRestfulInteraction code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case TRANSACTION: return "transaction"; + case SEARCHSYSTEM: return "search-system"; + case HISTORYSYSTEM: return "history-system"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case TRANSACTION: return "http://hl7.org/fhir/restful-interaction"; + case SEARCHSYSTEM: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYSYSTEM: return "http://hl7.org/fhir/restful-interaction"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case TRANSACTION: return ""; + case SEARCHSYSTEM: return ""; + case HISTORYSYSTEM: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case TRANSACTION: return "transaction"; + case SEARCHSYSTEM: return "search-system"; + case HISTORYSYSTEM: return "history-system"; + default: return "?"; + } + } + } + + 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; + if ("transaction".equals(codeString)) + return SystemRestfulInteraction.TRANSACTION; + if ("search-system".equals(codeString)) + return SystemRestfulInteraction.SEARCHSYSTEM; + if ("history-system".equals(codeString)) + return SystemRestfulInteraction.HISTORYSYSTEM; + throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("transaction".equals(codeString)) + return new Enumeration(this, SystemRestfulInteraction.TRANSACTION); + if ("search-system".equals(codeString)) + return new Enumeration(this, SystemRestfulInteraction.SEARCHSYSTEM); + if ("history-system".equals(codeString)) + return new Enumeration(this, SystemRestfulInteraction.HISTORYSYSTEM); + throw new FHIRException("Unknown SystemRestfulInteraction code '"+codeString+"'"); + } + public String toCode(SystemRestfulInteraction code) { + if (code == SystemRestfulInteraction.TRANSACTION) + return "transaction"; + if (code == SystemRestfulInteraction.SEARCHSYSTEM) + return "search-system"; + if (code == SystemRestfulInteraction.HISTORYSYSTEM) + return "history-system"; + return "?"; + } + public String toSystem(SystemRestfulInteraction code) { + return code.getSystem(); + } + } + + public enum TransactionMode { + /** + * Neither batch or transaction is supported. + */ + NOTSUPPORTED, + /** + * Batches are supported. + */ + BATCH, + /** + * Transactions are supported. + */ + TRANSACTION, + /** + * Both batches and transactions are supported. + */ + BOTH, + /** + * added to help the parsers + */ + NULL; + public static TransactionMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("not-supported".equals(codeString)) + return NOTSUPPORTED; + if ("batch".equals(codeString)) + return BATCH; + if ("transaction".equals(codeString)) + return TRANSACTION; + if ("both".equals(codeString)) + return BOTH; + throw new FHIRException("Unknown TransactionMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NOTSUPPORTED: return "not-supported"; + case BATCH: return "batch"; + case TRANSACTION: return "transaction"; + case BOTH: return "both"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTSUPPORTED: return "http://hl7.org/fhir/transaction-mode"; + case BATCH: return "http://hl7.org/fhir/transaction-mode"; + case TRANSACTION: return "http://hl7.org/fhir/transaction-mode"; + case BOTH: return "http://hl7.org/fhir/transaction-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTSUPPORTED: return "Neither batch or transaction is supported."; + case BATCH: return "Batches are supported."; + case TRANSACTION: return "Transactions are supported."; + case BOTH: return "Both batches and transactions are supported."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTSUPPORTED: return "None"; + case BATCH: return "Batches supported"; + case TRANSACTION: return "Transactions Supported"; + case BOTH: return "Batches & Transactions"; + default: return "?"; + } + } + } + + public static class TransactionModeEnumFactory implements EnumFactory { + public TransactionMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-supported".equals(codeString)) + return TransactionMode.NOTSUPPORTED; + if ("batch".equals(codeString)) + return TransactionMode.BATCH; + if ("transaction".equals(codeString)) + return TransactionMode.TRANSACTION; + if ("both".equals(codeString)) + return TransactionMode.BOTH; + throw new IllegalArgumentException("Unknown TransactionMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("not-supported".equals(codeString)) + return new Enumeration(this, TransactionMode.NOTSUPPORTED); + if ("batch".equals(codeString)) + return new Enumeration(this, TransactionMode.BATCH); + if ("transaction".equals(codeString)) + return new Enumeration(this, TransactionMode.TRANSACTION); + if ("both".equals(codeString)) + return new Enumeration(this, TransactionMode.BOTH); + throw new FHIRException("Unknown TransactionMode code '"+codeString+"'"); + } + public String toCode(TransactionMode code) { + if (code == TransactionMode.NOTSUPPORTED) + return "not-supported"; + if (code == TransactionMode.BATCH) + return "batch"; + if (code == TransactionMode.TRANSACTION) + return "transaction"; + if (code == TransactionMode.BOTH) + return "both"; + return "?"; + } + public String toSystem(TransactionMode code) { + return code.getSystem(); + } + } + + public enum MessageSignificanceCategory { + /** + * The message represents/requests a change that should not be processed more than once; e.g. Making a booking for an appointment. + */ + CONSEQUENCE, + /** + * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful. + */ + CURRENCY, + /** + * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications. + */ + NOTIFICATION, + /** + * added to help the parsers + */ + NULL; + public static MessageSignificanceCategory fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("Consequence".equals(codeString)) + return CONSEQUENCE; + if ("Currency".equals(codeString)) + return CURRENCY; + if ("Notification".equals(codeString)) + return NOTIFICATION; + throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CONSEQUENCE: return "Consequence"; + case CURRENCY: return "Currency"; + case NOTIFICATION: return "Notification"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CONSEQUENCE: return "http://hl7.org/fhir/message-significance-category"; + case CURRENCY: return "http://hl7.org/fhir/message-significance-category"; + case NOTIFICATION: return "http://hl7.org/fhir/message-significance-category"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once; e.g. Making a booking for an appointment."; + case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful."; + case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CONSEQUENCE: return "Consequence"; + case CURRENCY: return "Currency"; + case NOTIFICATION: return "Notification"; + default: return "?"; + } + } + } + + 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; + if ("Consequence".equals(codeString)) + return MessageSignificanceCategory.CONSEQUENCE; + if ("Currency".equals(codeString)) + return MessageSignificanceCategory.CURRENCY; + if ("Notification".equals(codeString)) + return MessageSignificanceCategory.NOTIFICATION; + throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("Consequence".equals(codeString)) + return new Enumeration(this, MessageSignificanceCategory.CONSEQUENCE); + if ("Currency".equals(codeString)) + return new Enumeration(this, MessageSignificanceCategory.CURRENCY); + if ("Notification".equals(codeString)) + return new Enumeration(this, MessageSignificanceCategory.NOTIFICATION); + throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public String toCode(MessageSignificanceCategory code) { + if (code == MessageSignificanceCategory.CONSEQUENCE) + return "Consequence"; + if (code == MessageSignificanceCategory.CURRENCY) + return "Currency"; + if (code == MessageSignificanceCategory.NOTIFICATION) + return "Notification"; + return "?"; + } + public String toSystem(MessageSignificanceCategory code) { + return code.getSystem(); + } + } + + public enum ConformanceEventMode { + /** + * The application sends requests and receives responses. + */ + SENDER, + /** + * The application receives requests and sends responses. + */ + RECEIVER, + /** + * added to help the parsers + */ + NULL; + public static ConformanceEventMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("sender".equals(codeString)) + return SENDER; + if ("receiver".equals(codeString)) + return RECEIVER; + throw new FHIRException("Unknown ConformanceEventMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case SENDER: return "sender"; + case RECEIVER: return "receiver"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SENDER: return "http://hl7.org/fhir/message-conformance-event-mode"; + case RECEIVER: return "http://hl7.org/fhir/message-conformance-event-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SENDER: return "The application sends requests and receives responses."; + case RECEIVER: return "The application receives requests and sends responses."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SENDER: return "Sender"; + case RECEIVER: return "Receiver"; + default: return "?"; + } + } + } + + public static class ConformanceEventModeEnumFactory implements EnumFactory { + public ConformanceEventMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("sender".equals(codeString)) + return ConformanceEventMode.SENDER; + if ("receiver".equals(codeString)) + return ConformanceEventMode.RECEIVER; + throw new IllegalArgumentException("Unknown ConformanceEventMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("sender".equals(codeString)) + return new Enumeration(this, ConformanceEventMode.SENDER); + if ("receiver".equals(codeString)) + return new Enumeration(this, ConformanceEventMode.RECEIVER); + throw new FHIRException("Unknown ConformanceEventMode code '"+codeString+"'"); + } + public String toCode(ConformanceEventMode code) { + if (code == ConformanceEventMode.SENDER) + return "sender"; + if (code == ConformanceEventMode.RECEIVER) + return "receiver"; + return "?"; + } + public String toSystem(ConformanceEventMode code) { + return code.getSystem(); + } + } + + public enum DocumentMode { + /** + * The application produces documents of the specified type. + */ + PRODUCER, + /** + * The application consumes documents of the specified type. + */ + CONSUMER, + /** + * added to help the parsers + */ + NULL; + public static DocumentMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("producer".equals(codeString)) + return PRODUCER; + if ("consumer".equals(codeString)) + return CONSUMER; + throw new FHIRException("Unknown DocumentMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PRODUCER: return "producer"; + case CONSUMER: return "consumer"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PRODUCER: return "http://hl7.org/fhir/document-mode"; + case CONSUMER: return "http://hl7.org/fhir/document-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PRODUCER: return "The application produces documents of the specified type."; + case CONSUMER: return "The application consumes documents of the specified type."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PRODUCER: return "Producer"; + case CONSUMER: return "Consumer"; + default: return "?"; + } + } + } + + 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; + if ("producer".equals(codeString)) + return DocumentMode.PRODUCER; + if ("consumer".equals(codeString)) + return DocumentMode.CONSUMER; + throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("producer".equals(codeString)) + return new Enumeration(this, DocumentMode.PRODUCER); + if ("consumer".equals(codeString)) + return new Enumeration(this, DocumentMode.CONSUMER); + throw new FHIRException("Unknown DocumentMode code '"+codeString+"'"); + } + public String toCode(DocumentMode code) { + if (code == DocumentMode.PRODUCER) + return "producer"; + if (code == DocumentMode.CONSUMER) + return "consumer"; + return "?"; + } + public String toSystem(DocumentMode code) { + return code.getSystem(); + } + } + + @Block() + public static class ConformanceContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the conformance. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the conformance." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public ConformanceContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the conformance.). 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 ConformanceContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the conformance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the conformance. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the conformance. + */ + public ConformanceContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ConformanceContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the conformance.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public ConformanceContactComponent copy() { + ConformanceContactComponent dst = new ConformanceContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceContactComponent)) + return false; + ConformanceContactComponent o = (ConformanceContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceContactComponent)) + return false; + ConformanceContactComponent o = (ConformanceContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.contact"; + + } + + } + + @Block() + public static class ConformanceSoftwareComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Name software is known by. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="A name the software is known by", formalDefinition="Name software is known by." ) + protected StringType name; + + /** + * The version identifier for the software covered by this statement. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Version covered by this statement", formalDefinition="The version identifier for the software covered by this statement." ) + protected StringType version; + + /** + * Date this version of the software released. + */ + @Child(name = "releaseDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date this version released", formalDefinition="Date this version of the software released." ) + protected DateTimeType releaseDate; + + private static final long serialVersionUID = 1819769027L; + + /** + * Constructor + */ + public ConformanceSoftwareComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceSoftwareComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (Name software is known by.). 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 ConformanceSoftwareComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceSoftwareComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name software is known by. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name software is known by. + */ + public ConformanceSoftwareComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceSoftwareComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConformanceSoftwareComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version identifier for the software covered by this statement. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version identifier for the software covered by this statement. + */ + public ConformanceSoftwareComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value + */ + public DateTimeType getReleaseDateElement() { + if (this.releaseDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceSoftwareComponent.releaseDate"); + else if (Configuration.doAutoCreate()) + this.releaseDate = new DateTimeType(); // bb + return this.releaseDate; + } + + public boolean hasReleaseDateElement() { + return this.releaseDate != null && !this.releaseDate.isEmpty(); + } + + public boolean hasReleaseDate() { + return this.releaseDate != null && !this.releaseDate.isEmpty(); + } + + /** + * @param value {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value + */ + public ConformanceSoftwareComponent setReleaseDateElement(DateTimeType value) { + this.releaseDate = value; + return this; + } + + /** + * @return Date this version of the software released. + */ + public Date getReleaseDate() { + return this.releaseDate == null ? null : this.releaseDate.getValue(); + } + + /** + * @param value Date this version of the software released. + */ + public ConformanceSoftwareComponent setReleaseDate(Date value) { + if (value == null) + this.releaseDate = null; + else { + if (this.releaseDate == null) + this.releaseDate = new DateTimeType(); + this.releaseDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Name software is known by.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("version", "string", "The version identifier for the software covered by this statement.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("releaseDate", "dateTime", "Date this version of the software released.", 0, java.lang.Integer.MAX_VALUE, releaseDate)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 212873301: /*releaseDate*/ return this.releaseDate == null ? new Base[0] : new Base[] {this.releaseDate}; // DateTimeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 212873301: // releaseDate + this.releaseDate = castToDateTime(value); // DateTimeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("releaseDate")) + this.releaseDate = castToDateTime(value); // DateTimeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 212873301: throw new FHIRException("Cannot make property releaseDate as it is not a complex type"); // DateTimeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.version"); + } + else if (name.equals("releaseDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.releaseDate"); + } + else + return super.addChild(name); + } + + public ConformanceSoftwareComponent copy() { + ConformanceSoftwareComponent dst = new ConformanceSoftwareComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.version = version == null ? null : version.copy(); + dst.releaseDate = releaseDate == null ? null : releaseDate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceSoftwareComponent)) + return false; + ConformanceSoftwareComponent o = (ConformanceSoftwareComponent) other; + return compareDeep(name, o.name, true) && compareDeep(version, o.version, true) && compareDeep(releaseDate, o.releaseDate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceSoftwareComponent)) + return false; + ConformanceSoftwareComponent o = (ConformanceSoftwareComponent) other; + return compareValues(name, o.name, true) && compareValues(version, o.version, true) && compareValues(releaseDate, o.releaseDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (version == null || version.isEmpty()) + && (releaseDate == null || releaseDate.isEmpty()); + } + + public String fhirType() { + return "Conformance.software"; + + } + + } + + @Block() + public static class ConformanceImplementationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Information about the specific installation that this conformance statement relates to. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Describes this specific instance", formalDefinition="Information about the specific installation that this conformance statement relates to." ) + protected StringType description; + + /** + * An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Base URL for the installation", formalDefinition="An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces." ) + protected UriType url; + + private static final long serialVersionUID = -289238508L; + + /** + * Constructor + */ + public ConformanceImplementationComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceImplementationComponent(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #description} (Information about the specific installation that this conformance statement relates to.). 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 ConformanceImplementationComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConformanceImplementationComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Information about the specific installation that this conformance statement relates to. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Information about the specific installation that this conformance statement relates to. + */ + public ConformanceImplementationComponent setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #url} (An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceImplementationComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ConformanceImplementationComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + public ConformanceImplementationComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "Information about the specific installation that this conformance statement relates to.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("url", "uri", "An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.description"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.url"); + } + else + return super.addChild(name); + } + + public ConformanceImplementationComponent copy() { + ConformanceImplementationComponent dst = new ConformanceImplementationComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceImplementationComponent)) + return false; + ConformanceImplementationComponent o = (ConformanceImplementationComponent) other; + return compareDeep(description, o.description, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceImplementationComponent)) + return false; + ConformanceImplementationComponent o = (ConformanceImplementationComponent) other; + return compareValues(description, o.description, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.implementation"; + + } + + } + + @Block() + public static class ConformanceRestComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing ability to initiate or receive restful operations." ) + protected Enumeration mode; + + /** + * Information about the system's restful capabilities that apply across all applications, such as security. + */ + @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." ) + protected StringType documentation; + + /** + * Information about security implementation from an interface perspective - what a client needs to know. + */ + @Child(name = "security", type = {}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security implementation from an interface perspective - what a client needs to know." ) + protected ConformanceRestSecurityComponent security; + + /** + * A specification of the restful capabilities of the solution for a specific resource type. + */ + @Child(name = "resource", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." ) + protected List resource; + + /** + * A specification of restful operations supported by the system. + */ + @Child(name = "interaction", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." ) + protected List interaction; + + /** + * A code that indicates how transactions are supported. + */ + @Child(name = "transactionMode", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="not-supported | batch | transaction | both", formalDefinition="A code that indicates how transactions are supported." ) + protected Enumeration transactionMode; + + /** + * Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. + */ + @Child(name = "searchParam", type = {ConformanceRestResourceSearchParamComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Search params for searching all resources", formalDefinition="Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation." ) + protected List searchParam; + + /** + * Definition of an operation or a named query and with its parameters and their meaning and type. + */ + @Child(name = "operation", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Definition of an operation or a custom query", formalDefinition="Definition of an operation or a named query and with its parameters and their meaning and type." ) + protected List operation; + + /** + * An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL. + */ + @Child(name = "compartment", type = {UriType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Compartments served/used by system", formalDefinition="An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL." ) + protected List compartment; + + private static final long serialVersionUID = 931983837L; + + /** + * Constructor + */ + public ConformanceRestComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceRestComponent(Enumeration mode) { + super(); + this.mode = mode; + } + + /** + * @return {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). 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 ConformanceRestComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new RestfulConformanceModeEnumFactory()); // bb + 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} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceRestComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + public RestfulConformanceMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + public ConformanceRestComponent setMode(RestfulConformanceMode value) { + if (this.mode == null) + this.mode = new Enumeration(new RestfulConformanceModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). 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 ConformanceRestComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceRestComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Information about the system's restful capabilities that apply across all applications, such as security. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Information about the system's restful capabilities that apply across all applications, such as security. + */ + public ConformanceRestComponent 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 #security} (Information about security implementation from an interface perspective - what a client needs to know.) + */ + public ConformanceRestSecurityComponent getSecurity() { + if (this.security == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestComponent.security"); + else if (Configuration.doAutoCreate()) + this.security = new ConformanceRestSecurityComponent(); // cc + return this.security; + } + + public boolean hasSecurity() { + return this.security != null && !this.security.isEmpty(); + } + + /** + * @param value {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.) + */ + public ConformanceRestComponent setSecurity(ConformanceRestSecurityComponent value) { + this.security = value; + return this; + } + + /** + * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) + */ + public List getResource() { + if (this.resource == null) + this.resource = new ArrayList(); + return this.resource; + } + + public boolean hasResource() { + if (this.resource == null) + return false; + for (ConformanceRestResourceComponent item : this.resource) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) + */ + // syntactic sugar + public ConformanceRestResourceComponent addResource() { //3 + ConformanceRestResourceComponent t = new ConformanceRestResourceComponent(); + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestComponent addResource(ConformanceRestResourceComponent t) { //3 + if (t == null) + return this; + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return this; + } + + /** + * @return {@link #interaction} (A specification of restful operations supported by the system.) + */ + public List getInteraction() { + if (this.interaction == null) + this.interaction = new ArrayList(); + return this.interaction; + } + + public boolean hasInteraction() { + if (this.interaction == null) + return false; + for (SystemInteractionComponent item : this.interaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interaction} (A specification of restful operations supported by the system.) + */ + // syntactic sugar + public SystemInteractionComponent addInteraction() { //3 + SystemInteractionComponent t = new SystemInteractionComponent(); + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestComponent addInteraction(SystemInteractionComponent t) { //3 + if (t == null) + return this; + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return this; + } + + /** + * @return {@link #transactionMode} (A code that indicates how transactions are supported.). This is the underlying object with id, value and extensions. The accessor "getTransactionMode" gives direct access to the value + */ + public Enumeration getTransactionModeElement() { + if (this.transactionMode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestComponent.transactionMode"); + else if (Configuration.doAutoCreate()) + this.transactionMode = new Enumeration(new TransactionModeEnumFactory()); // bb + return this.transactionMode; + } + + public boolean hasTransactionModeElement() { + return this.transactionMode != null && !this.transactionMode.isEmpty(); + } + + public boolean hasTransactionMode() { + return this.transactionMode != null && !this.transactionMode.isEmpty(); + } + + /** + * @param value {@link #transactionMode} (A code that indicates how transactions are supported.). This is the underlying object with id, value and extensions. The accessor "getTransactionMode" gives direct access to the value + */ + public ConformanceRestComponent setTransactionModeElement(Enumeration value) { + this.transactionMode = value; + return this; + } + + /** + * @return A code that indicates how transactions are supported. + */ + public TransactionMode getTransactionMode() { + return this.transactionMode == null ? null : this.transactionMode.getValue(); + } + + /** + * @param value A code that indicates how transactions are supported. + */ + public ConformanceRestComponent setTransactionMode(TransactionMode value) { + if (value == null) + this.transactionMode = null; + else { + if (this.transactionMode == null) + this.transactionMode = new Enumeration(new TransactionModeEnumFactory()); + this.transactionMode.setValue(value); + } + return this; + } + + /** + * @return {@link #searchParam} (Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) + */ + public List getSearchParam() { + if (this.searchParam == null) + this.searchParam = new ArrayList(); + return this.searchParam; + } + + public boolean hasSearchParam() { + if (this.searchParam == null) + return false; + for (ConformanceRestResourceSearchParamComponent item : this.searchParam) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #searchParam} (Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) + */ + // syntactic sugar + public ConformanceRestResourceSearchParamComponent addSearchParam() { //3 + ConformanceRestResourceSearchParamComponent t = new ConformanceRestResourceSearchParamComponent(); + if (this.searchParam == null) + this.searchParam = new ArrayList(); + this.searchParam.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestComponent addSearchParam(ConformanceRestResourceSearchParamComponent t) { //3 + if (t == null) + return this; + if (this.searchParam == null) + this.searchParam = new ArrayList(); + this.searchParam.add(t); + return this; + } + + /** + * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) + */ + public List getOperation() { + if (this.operation == null) + this.operation = new ArrayList(); + return this.operation; + } + + public boolean hasOperation() { + if (this.operation == null) + return false; + for (ConformanceRestOperationComponent item : this.operation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) + */ + // syntactic sugar + public ConformanceRestOperationComponent addOperation() { //3 + ConformanceRestOperationComponent t = new ConformanceRestOperationComponent(); + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestComponent addOperation(ConformanceRestOperationComponent t) { //3 + if (t == null) + return this; + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return this; + } + + /** + * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.) + */ + public List getCompartment() { + if (this.compartment == null) + this.compartment = new ArrayList(); + return this.compartment; + } + + public boolean hasCompartment() { + if (this.compartment == null) + return false; + for (UriType item : this.compartment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.) + */ + // syntactic sugar + public UriType addCompartmentElement() {//2 + UriType t = new UriType(); + if (this.compartment == null) + this.compartment = new ArrayList(); + this.compartment.add(t); + return t; + } + + /** + * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.) + */ + public ConformanceRestComponent addCompartment(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.compartment == null) + this.compartment = new ArrayList(); + this.compartment.add(t); + return this; + } + + /** + * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.) + */ + public boolean hasCompartment(String value) { + if (this.compartment == null) + return false; + for (UriType v : this.compartment) + if (v.equals(value)) // uri + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, java.lang.Integer.MAX_VALUE, security)); + childrenList.add(new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction)); + childrenList.add(new Property("transactionMode", "code", "A code that indicates how transactions are supported.", 0, java.lang.Integer.MAX_VALUE, transactionMode)); + childrenList.add(new Property("searchParam", "@Conformance.rest.resource.searchParam", "Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam)); + childrenList.add(new Property("operation", "", "Definition of an operation or a named query and with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation)); + childrenList.add(new Property("compartment", "uri", "An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.", 0, java.lang.Integer.MAX_VALUE, compartment)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + case 949122880: /*security*/ return this.security == null ? new Base[0] : new Base[] {this.security}; // ConformanceRestSecurityComponent + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // ConformanceRestResourceComponent + case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // SystemInteractionComponent + case 1262805409: /*transactionMode*/ return this.transactionMode == null ? new Base[0] : new Base[] {this.transactionMode}; // Enumeration + case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // ConformanceRestResourceSearchParamComponent + case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : this.operation.toArray(new Base[this.operation.size()]); // ConformanceRestOperationComponent + case -397756334: /*compartment*/ return this.compartment == null ? new Base[0] : this.compartment.toArray(new Base[this.compartment.size()]); // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3357091: // mode + this.mode = new RestfulConformanceModeEnumFactory().fromType(value); // Enumeration + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + case 949122880: // security + this.security = (ConformanceRestSecurityComponent) value; // ConformanceRestSecurityComponent + break; + case -341064690: // resource + this.getResource().add((ConformanceRestResourceComponent) value); // ConformanceRestResourceComponent + break; + case 1844104722: // interaction + this.getInteraction().add((SystemInteractionComponent) value); // SystemInteractionComponent + break; + case 1262805409: // transactionMode + this.transactionMode = new TransactionModeEnumFactory().fromType(value); // Enumeration + break; + case -553645115: // searchParam + this.getSearchParam().add((ConformanceRestResourceSearchParamComponent) value); // ConformanceRestResourceSearchParamComponent + break; + case 1662702951: // operation + this.getOperation().add((ConformanceRestOperationComponent) value); // ConformanceRestOperationComponent + break; + case -397756334: // compartment + this.getCompartment().add(castToUri(value)); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("mode")) + this.mode = new RestfulConformanceModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else if (name.equals("security")) + this.security = (ConformanceRestSecurityComponent) value; // ConformanceRestSecurityComponent + else if (name.equals("resource")) + this.getResource().add((ConformanceRestResourceComponent) value); + else if (name.equals("interaction")) + this.getInteraction().add((SystemInteractionComponent) value); + else if (name.equals("transactionMode")) + this.transactionMode = new TransactionModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("searchParam")) + this.getSearchParam().add((ConformanceRestResourceSearchParamComponent) value); + else if (name.equals("operation")) + this.getOperation().add((ConformanceRestOperationComponent) value); + else if (name.equals("compartment")) + this.getCompartment().add(castToUri(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + case 949122880: return getSecurity(); // ConformanceRestSecurityComponent + case -341064690: return addResource(); // ConformanceRestResourceComponent + case 1844104722: return addInteraction(); // SystemInteractionComponent + case 1262805409: throw new FHIRException("Cannot make property transactionMode as it is not a complex type"); // Enumeration + case -553645115: return addSearchParam(); // ConformanceRestResourceSearchParamComponent + case 1662702951: return addOperation(); // ConformanceRestOperationComponent + case -397756334: throw new FHIRException("Cannot make property compartment as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.mode"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); + } + else if (name.equals("security")) { + this.security = new ConformanceRestSecurityComponent(); + return this.security; + } + else if (name.equals("resource")) { + return addResource(); + } + else if (name.equals("interaction")) { + return addInteraction(); + } + else if (name.equals("transactionMode")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.transactionMode"); + } + else if (name.equals("searchParam")) { + return addSearchParam(); + } + else if (name.equals("operation")) { + return addOperation(); + } + else if (name.equals("compartment")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.compartment"); + } + else + return super.addChild(name); + } + + public ConformanceRestComponent copy() { + ConformanceRestComponent dst = new ConformanceRestComponent(); + copyValues(dst); + dst.mode = mode == null ? null : mode.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.security = security == null ? null : security.copy(); + if (resource != null) { + dst.resource = new ArrayList(); + for (ConformanceRestResourceComponent i : resource) + dst.resource.add(i.copy()); + }; + if (interaction != null) { + dst.interaction = new ArrayList(); + for (SystemInteractionComponent i : interaction) + dst.interaction.add(i.copy()); + }; + dst.transactionMode = transactionMode == null ? null : transactionMode.copy(); + if (searchParam != null) { + dst.searchParam = new ArrayList(); + for (ConformanceRestResourceSearchParamComponent i : searchParam) + dst.searchParam.add(i.copy()); + }; + if (operation != null) { + dst.operation = new ArrayList(); + for (ConformanceRestOperationComponent i : operation) + dst.operation.add(i.copy()); + }; + if (compartment != null) { + dst.compartment = new ArrayList(); + for (UriType i : compartment) + dst.compartment.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestComponent)) + return false; + ConformanceRestComponent o = (ConformanceRestComponent) other; + return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(security, o.security, true) + && compareDeep(resource, o.resource, true) && compareDeep(interaction, o.interaction, true) && compareDeep(transactionMode, o.transactionMode, true) + && compareDeep(searchParam, o.searchParam, true) && compareDeep(operation, o.operation, true) && compareDeep(compartment, o.compartment, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestComponent)) + return false; + ConformanceRestComponent o = (ConformanceRestComponent) other; + return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true) && compareValues(transactionMode, o.transactionMode, true) + && compareValues(compartment, o.compartment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (security == null || security.isEmpty()) && (resource == null || resource.isEmpty()) && (interaction == null || interaction.isEmpty()) + && (transactionMode == null || transactionMode.isEmpty()) && (searchParam == null || searchParam.isEmpty()) + && (operation == null || operation.isEmpty()) && (compartment == null || compartment.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.rest"; + + } + + } + + @Block() + public static class ConformanceRestSecurityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + @Child(name = "cors", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Adds CORS Headers (http://enable-cors.org/)", formalDefinition="Server adds CORS headers when responding to requests - this enables javascript applications to use the server." ) + protected BooleanType cors; + + /** + * Types of security services are supported/required by the system. + */ + @Child(name = "service", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", formalDefinition="Types of security services are supported/required by the system." ) + protected List service; + + /** + * General description of how security works. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." ) + protected StringType description; + + /** + * Certificates associated with security profiles. + */ + @Child(name = "certificate", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Certificates associated with security profiles", formalDefinition="Certificates associated with security profiles." ) + protected List certificate; + + private static final long serialVersionUID = 391663952L; + + /** + * Constructor + */ + public ConformanceRestSecurityComponent() { + super(); + } + + /** + * @return {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value + */ + public BooleanType getCorsElement() { + if (this.cors == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.cors"); + else if (Configuration.doAutoCreate()) + this.cors = new BooleanType(); // bb + return this.cors; + } + + public boolean hasCorsElement() { + return this.cors != null && !this.cors.isEmpty(); + } + + public boolean hasCors() { + return this.cors != null && !this.cors.isEmpty(); + } + + /** + * @param value {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value + */ + public ConformanceRestSecurityComponent setCorsElement(BooleanType value) { + this.cors = value; + return this; + } + + /** + * @return Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + public boolean getCors() { + return this.cors == null || this.cors.isEmpty() ? false : this.cors.getValue(); + } + + /** + * @param value Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + public ConformanceRestSecurityComponent setCors(boolean value) { + if (this.cors == null) + this.cors = new BooleanType(); + this.cors.setValue(value); + return this; + } + + /** + * @return {@link #service} (Types of security services are supported/required by the system.) + */ + public List getService() { + if (this.service == null) + this.service = new ArrayList(); + return this.service; + } + + public boolean hasService() { + if (this.service == null) + return false; + for (CodeableConcept item : this.service) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #service} (Types of security services are supported/required by the system.) + */ + // syntactic sugar + public CodeableConcept addService() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.service == null) + this.service = new ArrayList(); + this.service.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestSecurityComponent addService(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.service == null) + this.service = new ArrayList(); + this.service.add(t); + return this; + } + + /** + * @return {@link #description} (General description of how security works.). 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 ConformanceRestSecurityComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConformanceRestSecurityComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return General description of how security works. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value General description of how security works. + */ + public ConformanceRestSecurityComponent 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 #certificate} (Certificates associated with security profiles.) + */ + public List getCertificate() { + if (this.certificate == null) + this.certificate = new ArrayList(); + return this.certificate; + } + + public boolean hasCertificate() { + if (this.certificate == null) + return false; + for (ConformanceRestSecurityCertificateComponent item : this.certificate) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #certificate} (Certificates associated with security profiles.) + */ + // syntactic sugar + public ConformanceRestSecurityCertificateComponent addCertificate() { //3 + ConformanceRestSecurityCertificateComponent t = new ConformanceRestSecurityCertificateComponent(); + if (this.certificate == null) + this.certificate = new ArrayList(); + this.certificate.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestSecurityComponent addCertificate(ConformanceRestSecurityCertificateComponent t) { //3 + if (t == null) + return this; + if (this.certificate == null) + this.certificate = new ArrayList(); + this.certificate.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, java.lang.Integer.MAX_VALUE, cors)); + childrenList.add(new Property("service", "CodeableConcept", "Types of security services are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("description", "string", "General description of how security works.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059629: /*cors*/ return this.cors == null ? new Base[0] : new Base[] {this.cors}; // BooleanType + case 1984153269: /*service*/ return this.service == null ? new Base[0] : this.service.toArray(new Base[this.service.size()]); // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 1952399767: /*certificate*/ return this.certificate == null ? new Base[0] : this.certificate.toArray(new Base[this.certificate.size()]); // ConformanceRestSecurityCertificateComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059629: // cors + this.cors = castToBoolean(value); // BooleanType + break; + case 1984153269: // service + this.getService().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 1952399767: // certificate + this.getCertificate().add((ConformanceRestSecurityCertificateComponent) value); // ConformanceRestSecurityCertificateComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("cors")) + this.cors = castToBoolean(value); // BooleanType + else if (name.equals("service")) + this.getService().add(castToCodeableConcept(value)); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("certificate")) + this.getCertificate().add((ConformanceRestSecurityCertificateComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059629: throw new FHIRException("Cannot make property cors as it is not a complex type"); // BooleanType + case 1984153269: return addService(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 1952399767: return addCertificate(); // ConformanceRestSecurityCertificateComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("cors")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.cors"); + } + else if (name.equals("service")) { + return addService(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.description"); + } + else if (name.equals("certificate")) { + return addCertificate(); + } + else + return super.addChild(name); + } + + public ConformanceRestSecurityComponent copy() { + ConformanceRestSecurityComponent dst = new ConformanceRestSecurityComponent(); + copyValues(dst); + dst.cors = cors == null ? null : cors.copy(); + if (service != null) { + dst.service = new ArrayList(); + for (CodeableConcept i : service) + dst.service.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (certificate != null) { + dst.certificate = new ArrayList(); + for (ConformanceRestSecurityCertificateComponent i : certificate) + dst.certificate.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestSecurityComponent)) + return false; + ConformanceRestSecurityComponent o = (ConformanceRestSecurityComponent) other; + return compareDeep(cors, o.cors, true) && compareDeep(service, o.service, true) && compareDeep(description, o.description, true) + && compareDeep(certificate, o.certificate, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestSecurityComponent)) + return false; + ConformanceRestSecurityComponent o = (ConformanceRestSecurityComponent) other; + return compareValues(cors, o.cors, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (cors == null || cors.isEmpty()) && (service == null || service.isEmpty()) + && (description == null || description.isEmpty()) && (certificate == null || certificate.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.rest.security"; + + } + + } + + @Block() + public static class ConformanceRestSecurityCertificateComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Mime type for certificate. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Mime type for certificate", formalDefinition="Mime type for certificate." ) + protected CodeType type; + + /** + * Actual certificate. + */ + @Child(name = "blob", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Actual certificate", formalDefinition="Actual certificate." ) + protected Base64BinaryType blob; + + private static final long serialVersionUID = 2092655854L; + + /** + * Constructor + */ + public ConformanceRestSecurityCertificateComponent() { + super(); + } + + /** + * @return {@link #type} (Mime type for certificate.). 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 ConformanceRestSecurityCertificateComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestSecurityCertificateComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return Mime type for certificate. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Mime type for certificate. + */ + public ConformanceRestSecurityCertificateComponent 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 #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public Base64BinaryType getBlobElement() { + if (this.blob == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.blob"); + else if (Configuration.doAutoCreate()) + this.blob = new Base64BinaryType(); // bb + return this.blob; + } + + public boolean hasBlobElement() { + return this.blob != null && !this.blob.isEmpty(); + } + + public boolean hasBlob() { + return this.blob != null && !this.blob.isEmpty(); + } + + /** + * @param value {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public ConformanceRestSecurityCertificateComponent setBlobElement(Base64BinaryType value) { + this.blob = value; + return this; + } + + /** + * @return Actual certificate. + */ + public byte[] getBlob() { + return this.blob == null ? null : this.blob.getValue(); + } + + /** + * @param value Actual certificate. + */ + public ConformanceRestSecurityCertificateComponent setBlob(byte[] value) { + if (value == null) + this.blob = null; + else { + if (this.blob == null) + this.blob = new Base64BinaryType(); + this.blob.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Mime type for certificate.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("blob", "base64Binary", "Actual certificate.", 0, java.lang.Integer.MAX_VALUE, blob)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case 3026845: /*blob*/ return this.blob == null ? new Base[0] : new Base[] {this.blob}; // Base64BinaryType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case 3026845: // blob + this.blob = castToBase64Binary(value); // Base64BinaryType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("blob")) + this.blob = castToBase64Binary(value); // Base64BinaryType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case 3026845: throw new FHIRException("Cannot make property blob as it is not a complex type"); // Base64BinaryType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.type"); + } + else if (name.equals("blob")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.blob"); + } + else + return super.addChild(name); + } + + public ConformanceRestSecurityCertificateComponent copy() { + ConformanceRestSecurityCertificateComponent dst = new ConformanceRestSecurityCertificateComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.blob = blob == null ? null : blob.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestSecurityCertificateComponent)) + return false; + ConformanceRestSecurityCertificateComponent o = (ConformanceRestSecurityCertificateComponent) other; + return compareDeep(type, o.type, true) && compareDeep(blob, o.blob, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestSecurityCertificateComponent)) + return false; + ConformanceRestSecurityCertificateComponent o = (ConformanceRestSecurityCertificateComponent) other; + return compareValues(type, o.type, true) && compareValues(blob, o.blob, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (blob == null || blob.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.rest.security.certificate"; + + } + + } + + @Block() + public static class ConformanceRestResourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A type of resource exposed via the restful interface. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." ) + protected CodeType type; + + /** + * A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Base System profile for all uses of resource", formalDefinition="A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + protected StructureDefinition profileTarget; + + /** + * Identifies a restful operation supported by the solution. + */ + @Child(name = "interaction", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." ) + protected List interaction; + + /** + * This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API. + */ + @Child(name = "versioning", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="no-version | versioned | versioned-update", formalDefinition="This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API." ) + protected Enumeration versioning; + + /** + * A flag for whether the server is able to return past versions as part of the vRead operation. + */ + @Child(name = "readHistory", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether vRead can return past versions", formalDefinition="A flag for whether the server is able to return past versions as part of the vRead operation." ) + protected BooleanType readHistory; + + /** + * A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. + */ + @Child(name = "updateCreate", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If update can commit to a new identity", formalDefinition="A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server." ) + protected BooleanType updateCreate; + + /** + * A flag that indicates that the server supports conditional create. + */ + @Child(name = "conditionalCreate", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If allows/uses conditional create", formalDefinition="A flag that indicates that the server supports conditional create." ) + protected BooleanType conditionalCreate; + + /** + * A flag that indicates that the server supports conditional update. + */ + @Child(name = "conditionalUpdate", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If allows/uses conditional update", formalDefinition="A flag that indicates that the server supports conditional update." ) + protected BooleanType conditionalUpdate; + + /** + * A code that indicates how the server supports conditional delete. + */ + @Child(name = "conditionalDelete", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="not-supported | single | multiple - how conditional delete is supported", formalDefinition="A code that indicates how the server supports conditional delete." ) + protected Enumeration conditionalDelete; + + /** + * A list of _include values supported by the server. + */ + @Child(name = "searchInclude", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." ) + protected List searchInclude; + + /** + * A list of _revinclude (reverse include) values supported by the server. + */ + @Child(name = "searchRevInclude", type = {StringType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="_revinclude values supported by the server", formalDefinition="A list of _revinclude (reverse include) values supported by the server." ) + protected List searchRevInclude; + + /** + * Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. + */ + @Child(name = "searchParam", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Search params supported by implementation", formalDefinition="Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation." ) + protected List searchParam; + + private static final long serialVersionUID = 1781959905L; + + /** + * Constructor + */ + public ConformanceRestResourceComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceRestResourceComponent(CodeType type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A type of resource exposed via the restful interface.). 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 ConformanceRestResourceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestResourceComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return A type of resource exposed via the restful interface. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A type of resource exposed via the restful interface. + */ + public ConformanceRestResourceComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + public ConformanceRestResourceComponent 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 specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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 specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + public ConformanceRestResourceComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #interaction} (Identifies a restful operation supported by the solution.) + */ + public List getInteraction() { + if (this.interaction == null) + this.interaction = new ArrayList(); + return this.interaction; + } + + public boolean hasInteraction() { + if (this.interaction == null) + return false; + for (ResourceInteractionComponent item : this.interaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interaction} (Identifies a restful operation supported by the solution.) + */ + // syntactic sugar + public ResourceInteractionComponent addInteraction() { //3 + ResourceInteractionComponent t = new ResourceInteractionComponent(); + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestResourceComponent addInteraction(ResourceInteractionComponent t) { //3 + if (t == null) + return this; + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return this; + } + + /** + * @return {@link #versioning} (This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value + */ + public Enumeration getVersioningElement() { + if (this.versioning == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.versioning"); + else if (Configuration.doAutoCreate()) + this.versioning = new Enumeration(new ResourceVersionPolicyEnumFactory()); // bb + return this.versioning; + } + + public boolean hasVersioningElement() { + return this.versioning != null && !this.versioning.isEmpty(); + } + + public boolean hasVersioning() { + return this.versioning != null && !this.versioning.isEmpty(); + } + + /** + * @param value {@link #versioning} (This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value + */ + public ConformanceRestResourceComponent setVersioningElement(Enumeration value) { + this.versioning = value; + return this; + } + + /** + * @return This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API. + */ + public ResourceVersionPolicy getVersioning() { + return this.versioning == null ? null : this.versioning.getValue(); + } + + /** + * @param value This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API. + */ + public ConformanceRestResourceComponent setVersioning(ResourceVersionPolicy value) { + if (value == null) + this.versioning = null; + else { + if (this.versioning == null) + this.versioning = new Enumeration(new ResourceVersionPolicyEnumFactory()); + this.versioning.setValue(value); + } + return this; + } + + /** + * @return {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value + */ + public BooleanType getReadHistoryElement() { + if (this.readHistory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.readHistory"); + else if (Configuration.doAutoCreate()) + this.readHistory = new BooleanType(); // bb + return this.readHistory; + } + + public boolean hasReadHistoryElement() { + return this.readHistory != null && !this.readHistory.isEmpty(); + } + + public boolean hasReadHistory() { + return this.readHistory != null && !this.readHistory.isEmpty(); + } + + /** + * @param value {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value + */ + public ConformanceRestResourceComponent setReadHistoryElement(BooleanType value) { + this.readHistory = value; + return this; + } + + /** + * @return A flag for whether the server is able to return past versions as part of the vRead operation. + */ + public boolean getReadHistory() { + return this.readHistory == null || this.readHistory.isEmpty() ? false : this.readHistory.getValue(); + } + + /** + * @param value A flag for whether the server is able to return past versions as part of the vRead operation. + */ + public ConformanceRestResourceComponent setReadHistory(boolean value) { + if (this.readHistory == null) + this.readHistory = new BooleanType(); + this.readHistory.setValue(value); + return this; + } + + /** + * @return {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value + */ + public BooleanType getUpdateCreateElement() { + if (this.updateCreate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.updateCreate"); + else if (Configuration.doAutoCreate()) + this.updateCreate = new BooleanType(); // bb + return this.updateCreate; + } + + public boolean hasUpdateCreateElement() { + return this.updateCreate != null && !this.updateCreate.isEmpty(); + } + + public boolean hasUpdateCreate() { + return this.updateCreate != null && !this.updateCreate.isEmpty(); + } + + /** + * @param value {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value + */ + public ConformanceRestResourceComponent setUpdateCreateElement(BooleanType value) { + this.updateCreate = value; + return this; + } + + /** + * @return A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. + */ + public boolean getUpdateCreate() { + return this.updateCreate == null || this.updateCreate.isEmpty() ? false : this.updateCreate.getValue(); + } + + /** + * @param value A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. + */ + public ConformanceRestResourceComponent setUpdateCreate(boolean value) { + if (this.updateCreate == null) + this.updateCreate = new BooleanType(); + this.updateCreate.setValue(value); + return this; + } + + /** + * @return {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value + */ + public BooleanType getConditionalCreateElement() { + if (this.conditionalCreate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalCreate"); + else if (Configuration.doAutoCreate()) + this.conditionalCreate = new BooleanType(); // bb + return this.conditionalCreate; + } + + public boolean hasConditionalCreateElement() { + return this.conditionalCreate != null && !this.conditionalCreate.isEmpty(); + } + + public boolean hasConditionalCreate() { + return this.conditionalCreate != null && !this.conditionalCreate.isEmpty(); + } + + /** + * @param value {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value + */ + public ConformanceRestResourceComponent setConditionalCreateElement(BooleanType value) { + this.conditionalCreate = value; + return this; + } + + /** + * @return A flag that indicates that the server supports conditional create. + */ + public boolean getConditionalCreate() { + return this.conditionalCreate == null || this.conditionalCreate.isEmpty() ? false : this.conditionalCreate.getValue(); + } + + /** + * @param value A flag that indicates that the server supports conditional create. + */ + public ConformanceRestResourceComponent setConditionalCreate(boolean value) { + if (this.conditionalCreate == null) + this.conditionalCreate = new BooleanType(); + this.conditionalCreate.setValue(value); + return this; + } + + /** + * @return {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value + */ + public BooleanType getConditionalUpdateElement() { + if (this.conditionalUpdate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalUpdate"); + else if (Configuration.doAutoCreate()) + this.conditionalUpdate = new BooleanType(); // bb + return this.conditionalUpdate; + } + + public boolean hasConditionalUpdateElement() { + return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty(); + } + + public boolean hasConditionalUpdate() { + return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty(); + } + + /** + * @param value {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value + */ + public ConformanceRestResourceComponent setConditionalUpdateElement(BooleanType value) { + this.conditionalUpdate = value; + return this; + } + + /** + * @return A flag that indicates that the server supports conditional update. + */ + public boolean getConditionalUpdate() { + return this.conditionalUpdate == null || this.conditionalUpdate.isEmpty() ? false : this.conditionalUpdate.getValue(); + } + + /** + * @param value A flag that indicates that the server supports conditional update. + */ + public ConformanceRestResourceComponent setConditionalUpdate(boolean value) { + if (this.conditionalUpdate == null) + this.conditionalUpdate = new BooleanType(); + this.conditionalUpdate.setValue(value); + return this; + } + + /** + * @return {@link #conditionalDelete} (A code that indicates how the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value + */ + public Enumeration getConditionalDeleteElement() { + if (this.conditionalDelete == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalDelete"); + else if (Configuration.doAutoCreate()) + this.conditionalDelete = new Enumeration(new ConditionalDeleteStatusEnumFactory()); // bb + return this.conditionalDelete; + } + + public boolean hasConditionalDeleteElement() { + return this.conditionalDelete != null && !this.conditionalDelete.isEmpty(); + } + + public boolean hasConditionalDelete() { + return this.conditionalDelete != null && !this.conditionalDelete.isEmpty(); + } + + /** + * @param value {@link #conditionalDelete} (A code that indicates how the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value + */ + public ConformanceRestResourceComponent setConditionalDeleteElement(Enumeration value) { + this.conditionalDelete = value; + return this; + } + + /** + * @return A code that indicates how the server supports conditional delete. + */ + public ConditionalDeleteStatus getConditionalDelete() { + return this.conditionalDelete == null ? null : this.conditionalDelete.getValue(); + } + + /** + * @param value A code that indicates how the server supports conditional delete. + */ + public ConformanceRestResourceComponent setConditionalDelete(ConditionalDeleteStatus value) { + if (value == null) + this.conditionalDelete = null; + else { + if (this.conditionalDelete == null) + this.conditionalDelete = new Enumeration(new ConditionalDeleteStatusEnumFactory()); + this.conditionalDelete.setValue(value); + } + return this; + } + + /** + * @return {@link #searchInclude} (A list of _include values supported by the server.) + */ + public List getSearchInclude() { + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + return this.searchInclude; + } + + public boolean hasSearchInclude() { + if (this.searchInclude == null) + return false; + for (StringType item : this.searchInclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #searchInclude} (A list of _include values supported by the server.) + */ + // syntactic sugar + public StringType addSearchIncludeElement() {//2 + StringType t = new StringType(); + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + this.searchInclude.add(t); + return t; + } + + /** + * @param value {@link #searchInclude} (A list of _include values supported by the server.) + */ + public ConformanceRestResourceComponent addSearchInclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + this.searchInclude.add(t); + return this; + } + + /** + * @param value {@link #searchInclude} (A list of _include values supported by the server.) + */ + public boolean hasSearchInclude(String value) { + if (this.searchInclude == null) + return false; + for (StringType v : this.searchInclude) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.) + */ + public List getSearchRevInclude() { + if (this.searchRevInclude == null) + this.searchRevInclude = new ArrayList(); + return this.searchRevInclude; + } + + public boolean hasSearchRevInclude() { + if (this.searchRevInclude == null) + return false; + for (StringType item : this.searchRevInclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.) + */ + // syntactic sugar + public StringType addSearchRevIncludeElement() {//2 + StringType t = new StringType(); + if (this.searchRevInclude == null) + this.searchRevInclude = new ArrayList(); + this.searchRevInclude.add(t); + return t; + } + + /** + * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.) + */ + public ConformanceRestResourceComponent addSearchRevInclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.searchRevInclude == null) + this.searchRevInclude = new ArrayList(); + this.searchRevInclude.add(t); + return this; + } + + /** + * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.) + */ + public boolean hasSearchRevInclude(String value) { + if (this.searchRevInclude == null) + return false; + for (StringType v : this.searchRevInclude) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) + */ + public List getSearchParam() { + if (this.searchParam == null) + this.searchParam = new ArrayList(); + return this.searchParam; + } + + public boolean hasSearchParam() { + if (this.searchParam == null) + return false; + for (ConformanceRestResourceSearchParamComponent item : this.searchParam) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) + */ + // syntactic sugar + public ConformanceRestResourceSearchParamComponent addSearchParam() { //3 + ConformanceRestResourceSearchParamComponent t = new ConformanceRestResourceSearchParamComponent(); + if (this.searchParam == null) + this.searchParam = new ArrayList(); + this.searchParam.add(t); + return t; + } + + // syntactic sugar + public ConformanceRestResourceComponent addSearchParam(ConformanceRestResourceSearchParamComponent t) { //3 + if (t == null) + return this; + if (this.searchParam == null) + this.searchParam = new ArrayList(); + this.searchParam.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction)); + childrenList.add(new Property("versioning", "code", "This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.", 0, java.lang.Integer.MAX_VALUE, versioning)); + childrenList.add(new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, java.lang.Integer.MAX_VALUE, readHistory)); + childrenList.add(new Property("updateCreate", "boolean", "A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.", 0, java.lang.Integer.MAX_VALUE, updateCreate)); + childrenList.add(new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, java.lang.Integer.MAX_VALUE, conditionalCreate)); + childrenList.add(new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, java.lang.Integer.MAX_VALUE, conditionalUpdate)); + childrenList.add(new Property("conditionalDelete", "code", "A code that indicates how the server supports conditional delete.", 0, java.lang.Integer.MAX_VALUE, conditionalDelete)); + childrenList.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude)); + childrenList.add(new Property("searchRevInclude", "string", "A list of _revinclude (reverse include) values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchRevInclude)); + childrenList.add(new Property("searchParam", "", "Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // ResourceInteractionComponent + case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration + case 187518494: /*readHistory*/ return this.readHistory == null ? new Base[0] : new Base[] {this.readHistory}; // BooleanType + case -1400550619: /*updateCreate*/ return this.updateCreate == null ? new Base[0] : new Base[] {this.updateCreate}; // BooleanType + case 6401826: /*conditionalCreate*/ return this.conditionalCreate == null ? new Base[0] : new Base[] {this.conditionalCreate}; // BooleanType + case 519849711: /*conditionalUpdate*/ return this.conditionalUpdate == null ? new Base[0] : new Base[] {this.conditionalUpdate}; // BooleanType + case 23237585: /*conditionalDelete*/ return this.conditionalDelete == null ? new Base[0] : new Base[] {this.conditionalDelete}; // Enumeration + case -1035904544: /*searchInclude*/ return this.searchInclude == null ? new Base[0] : this.searchInclude.toArray(new Base[this.searchInclude.size()]); // StringType + case -2123884979: /*searchRevInclude*/ return this.searchRevInclude == null ? new Base[0] : this.searchRevInclude.toArray(new Base[this.searchRevInclude.size()]); // StringType + case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // ConformanceRestResourceSearchParamComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + case 1844104722: // interaction + this.getInteraction().add((ResourceInteractionComponent) value); // ResourceInteractionComponent + break; + case -670487542: // versioning + this.versioning = new ResourceVersionPolicyEnumFactory().fromType(value); // Enumeration + break; + case 187518494: // readHistory + this.readHistory = castToBoolean(value); // BooleanType + break; + case -1400550619: // updateCreate + this.updateCreate = castToBoolean(value); // BooleanType + break; + case 6401826: // conditionalCreate + this.conditionalCreate = castToBoolean(value); // BooleanType + break; + case 519849711: // conditionalUpdate + this.conditionalUpdate = castToBoolean(value); // BooleanType + break; + case 23237585: // conditionalDelete + this.conditionalDelete = new ConditionalDeleteStatusEnumFactory().fromType(value); // Enumeration + break; + case -1035904544: // searchInclude + this.getSearchInclude().add(castToString(value)); // StringType + break; + case -2123884979: // searchRevInclude + this.getSearchRevInclude().add(castToString(value)); // StringType + break; + case -553645115: // searchParam + this.getSearchParam().add((ConformanceRestResourceSearchParamComponent) value); // ConformanceRestResourceSearchParamComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else if (name.equals("interaction")) + this.getInteraction().add((ResourceInteractionComponent) value); + else if (name.equals("versioning")) + this.versioning = new ResourceVersionPolicyEnumFactory().fromType(value); // Enumeration + else if (name.equals("readHistory")) + this.readHistory = castToBoolean(value); // BooleanType + else if (name.equals("updateCreate")) + this.updateCreate = castToBoolean(value); // BooleanType + else if (name.equals("conditionalCreate")) + this.conditionalCreate = castToBoolean(value); // BooleanType + else if (name.equals("conditionalUpdate")) + this.conditionalUpdate = castToBoolean(value); // BooleanType + else if (name.equals("conditionalDelete")) + this.conditionalDelete = new ConditionalDeleteStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("searchInclude")) + this.getSearchInclude().add(castToString(value)); + else if (name.equals("searchRevInclude")) + this.getSearchRevInclude().add(castToString(value)); + else if (name.equals("searchParam")) + this.getSearchParam().add((ConformanceRestResourceSearchParamComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case -309425751: return getProfile(); // Reference + case 1844104722: return addInteraction(); // ResourceInteractionComponent + case -670487542: throw new FHIRException("Cannot make property versioning as it is not a complex type"); // Enumeration + case 187518494: throw new FHIRException("Cannot make property readHistory as it is not a complex type"); // BooleanType + case -1400550619: throw new FHIRException("Cannot make property updateCreate as it is not a complex type"); // BooleanType + case 6401826: throw new FHIRException("Cannot make property conditionalCreate as it is not a complex type"); // BooleanType + case 519849711: throw new FHIRException("Cannot make property conditionalUpdate as it is not a complex type"); // BooleanType + case 23237585: throw new FHIRException("Cannot make property conditionalDelete as it is not a complex type"); // Enumeration + case -1035904544: throw new FHIRException("Cannot make property searchInclude as it is not a complex type"); // StringType + case -2123884979: throw new FHIRException("Cannot make property searchRevInclude as it is not a complex type"); // StringType + case -553645115: return addSearchParam(); // ConformanceRestResourceSearchParamComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.type"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else if (name.equals("interaction")) { + return addInteraction(); + } + else if (name.equals("versioning")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.versioning"); + } + else if (name.equals("readHistory")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.readHistory"); + } + else if (name.equals("updateCreate")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.updateCreate"); + } + else if (name.equals("conditionalCreate")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.conditionalCreate"); + } + else if (name.equals("conditionalUpdate")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.conditionalUpdate"); + } + else if (name.equals("conditionalDelete")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.conditionalDelete"); + } + else if (name.equals("searchInclude")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.searchInclude"); + } + else if (name.equals("searchRevInclude")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.searchRevInclude"); + } + else if (name.equals("searchParam")) { + return addSearchParam(); + } + else + return super.addChild(name); + } + + public ConformanceRestResourceComponent copy() { + ConformanceRestResourceComponent dst = new ConformanceRestResourceComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + if (interaction != null) { + dst.interaction = new ArrayList(); + for (ResourceInteractionComponent i : interaction) + dst.interaction.add(i.copy()); + }; + dst.versioning = versioning == null ? null : versioning.copy(); + dst.readHistory = readHistory == null ? null : readHistory.copy(); + dst.updateCreate = updateCreate == null ? null : updateCreate.copy(); + dst.conditionalCreate = conditionalCreate == null ? null : conditionalCreate.copy(); + dst.conditionalUpdate = conditionalUpdate == null ? null : conditionalUpdate.copy(); + dst.conditionalDelete = conditionalDelete == null ? null : conditionalDelete.copy(); + if (searchInclude != null) { + dst.searchInclude = new ArrayList(); + for (StringType i : searchInclude) + dst.searchInclude.add(i.copy()); + }; + if (searchRevInclude != null) { + dst.searchRevInclude = new ArrayList(); + for (StringType i : searchRevInclude) + dst.searchRevInclude.add(i.copy()); + }; + if (searchParam != null) { + dst.searchParam = new ArrayList(); + for (ConformanceRestResourceSearchParamComponent i : searchParam) + dst.searchParam.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestResourceComponent)) + return false; + ConformanceRestResourceComponent o = (ConformanceRestResourceComponent) other; + return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(interaction, o.interaction, true) + && compareDeep(versioning, o.versioning, true) && compareDeep(readHistory, o.readHistory, true) + && compareDeep(updateCreate, o.updateCreate, true) && compareDeep(conditionalCreate, o.conditionalCreate, true) + && compareDeep(conditionalUpdate, o.conditionalUpdate, true) && compareDeep(conditionalDelete, o.conditionalDelete, true) + && compareDeep(searchInclude, o.searchInclude, true) && compareDeep(searchRevInclude, o.searchRevInclude, true) + && compareDeep(searchParam, o.searchParam, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestResourceComponent)) + return false; + ConformanceRestResourceComponent o = (ConformanceRestResourceComponent) other; + return compareValues(type, o.type, true) && compareValues(versioning, o.versioning, true) && compareValues(readHistory, o.readHistory, true) + && compareValues(updateCreate, o.updateCreate, true) && compareValues(conditionalCreate, o.conditionalCreate, true) + && compareValues(conditionalUpdate, o.conditionalUpdate, true) && compareValues(conditionalDelete, o.conditionalDelete, true) + && compareValues(searchInclude, o.searchInclude, true) && compareValues(searchRevInclude, o.searchRevInclude, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) + && (interaction == null || interaction.isEmpty()) && (versioning == null || versioning.isEmpty()) + && (readHistory == null || readHistory.isEmpty()) && (updateCreate == null || updateCreate.isEmpty()) + && (conditionalCreate == null || conditionalCreate.isEmpty()) && (conditionalUpdate == null || conditionalUpdate.isEmpty()) + && (conditionalDelete == null || conditionalDelete.isEmpty()) && (searchInclude == null || searchInclude.isEmpty()) + && (searchRevInclude == null || searchRevInclude.isEmpty()) && (searchParam == null || searchParam.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.rest.resource"; + + } + + } + + @Block() + public static class ResourceInteractionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Coded identifier of the operation, supported by the system resource. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="read | vread | update | delete | history-instance | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." ) + protected Enumeration code; + + /** + * Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'." ) + protected StringType documentation; + + private static final long serialVersionUID = -437507806L; + + /** + * Constructor + */ + public ResourceInteractionComponent() { + super(); + } + + /** + * Constructor + */ + public ResourceInteractionComponent(Enumeration code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResourceInteractionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new TypeRestfulInteractionEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ResourceInteractionComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Coded identifier of the operation, supported by the system resource. + */ + public TypeRestfulInteraction getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Coded identifier of the operation, supported by the system resource. + */ + public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { + if (this.code == null) + this.code = new Enumeration(new TypeRestfulInteractionEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). 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 ResourceInteractionComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ResourceInteractionComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + public ResourceInteractionComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = new TypeRestfulInteractionEnumFactory().fromType(value); // Enumeration + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = new TypeRestfulInteractionEnumFactory().fromType(value); // Enumeration + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.code"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); + } + else + return super.addChild(name); + } + + public ResourceInteractionComponent copy() { + ResourceInteractionComponent dst = new ResourceInteractionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ResourceInteractionComponent)) + return false; + ResourceInteractionComponent o = (ResourceInteractionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ResourceInteractionComponent)) + return false; + ResourceInteractionComponent o = (ResourceInteractionComponent) other; + return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.rest.resource.interaction"; + + } + + } + + @Block() + public static class ConformanceRestResourceSearchParamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the search parameter used in the interface. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." ) + protected StringType name; + + /** + * An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). + */ + @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Source of definition for parameter", formalDefinition="An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]])." ) + protected UriType definition; + + /** + * The type of value a search parameter refers to, and how the content is interpreted. + */ + @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) + protected Enumeration type; + + /** + * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Server-specific usage", formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms." ) + protected StringType documentation; + + /** + * Types of resource (if a resource is referenced). + */ + @Child(name = "target", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) + protected List target; + + /** + * A modifier supported for the search parameter. + */ + @Child(name = "modifier", type = {CodeType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="missing | exact | contains | not | text | in | not-in | below | above | type", formalDefinition="A modifier supported for the search parameter." ) + protected List> modifier; + + /** + * Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type. + */ + @Child(name = "chain", type = {StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Chained names supported", formalDefinition="Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type." ) + protected List chain; + + private static final long serialVersionUID = -1020405086L; + + /** + * Constructor + */ + public ConformanceRestResourceSearchParamComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceRestResourceSearchParamComponent(StringType name, Enumeration type) { + super(); + this.name = name; + this.type = type; + } + + /** + * @return {@link #name} (The name of the search parameter used in the interface.). 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 ConformanceRestResourceSearchParamComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the search parameter used in the interface. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the search parameter used in the interface. + */ + public ConformanceRestResourceSearchParamComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public UriType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new UriType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setDefinitionElement(UriType value) { + this.definition = value; + return this; + } + + /** + * @return An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). + */ + public ConformanceRestResourceSearchParamComponent setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new UriType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). 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 ConformanceRestResourceSearchParamComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new SearchParamTypeEnumFactory()); // bb + 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 of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParamType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of value a search parameter refers to, and how the content is interpreted. + */ + public ConformanceRestResourceSearchParamComponent setType(SearchParamType value) { + if (this.type == null) + this.type = new Enumeration(new SearchParamTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). 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 ConformanceRestResourceSearchParamComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + public ConformanceRestResourceSearchParamComponent 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 #target} (Types of resource (if a resource is referenced).) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (CodeType item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + // syntactic sugar + public CodeType addTargetElement() {//2 + CodeType t = new CodeType(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public ConformanceRestResourceSearchParamComponent addTarget(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public boolean hasTarget(String value) { + if (this.target == null) + return false; + for (CodeType v : this.target) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #modifier} (A modifier supported for the search parameter.) + */ + public List> getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList>(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Enumeration item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (A modifier supported for the search parameter.) + */ + // syntactic sugar + public Enumeration addModifierElement() {//2 + Enumeration t = new Enumeration(new SearchModifierCodeEnumFactory()); + if (this.modifier == null) + this.modifier = new ArrayList>(); + this.modifier.add(t); + return t; + } + + /** + * @param value {@link #modifier} (A modifier supported for the search parameter.) + */ + public ConformanceRestResourceSearchParamComponent addModifier(SearchModifierCode value) { //1 + Enumeration t = new Enumeration(new SearchModifierCodeEnumFactory()); + t.setValue(value); + if (this.modifier == null) + this.modifier = new ArrayList>(); + this.modifier.add(t); + return this; + } + + /** + * @param value {@link #modifier} (A modifier supported for the search parameter.) + */ + public boolean hasModifier(SearchModifierCode value) { + if (this.modifier == null) + return false; + for (Enumeration v : this.modifier) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.) + */ + public List getChain() { + if (this.chain == null) + this.chain = new ArrayList(); + return this.chain; + } + + public boolean hasChain() { + if (this.chain == null) + return false; + for (StringType item : this.chain) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.) + */ + // syntactic sugar + public StringType addChainElement() {//2 + StringType t = new StringType(); + if (this.chain == null) + this.chain = new ArrayList(); + this.chain.add(t); + return t; + } + + /** + * @param value {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.) + */ + public ConformanceRestResourceSearchParamComponent addChain(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.chain == null) + this.chain = new ArrayList(); + this.chain.add(t); + return this; + } + + /** + * @param value {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.) + */ + public boolean hasChain(String value) { + if (this.chain == null) + return false; + for (StringType v : this.chain) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("modifier", "code", "A modifier supported for the search parameter.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("chain", "string", "Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.", 0, java.lang.Integer.MAX_VALUE, chain)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // CodeType + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Enumeration + case 94623425: /*chain*/ return this.chain == null ? new Base[0] : this.chain.toArray(new Base[this.chain.size()]); // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1014418093: // definition + this.definition = castToUri(value); // UriType + break; + case 3575610: // type + this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + case -880905839: // target + this.getTarget().add(castToCode(value)); // CodeType + break; + case -615513385: // modifier + this.getModifier().add(new SearchModifierCodeEnumFactory().fromType(value)); // Enumeration + break; + case 94623425: // chain + this.getChain().add(castToString(value)); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("definition")) + this.definition = castToUri(value); // UriType + else if (name.equals("type")) + this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else if (name.equals("target")) + this.getTarget().add(castToCode(value)); + else if (name.equals("modifier")) + this.getModifier().add(new SearchModifierCodeEnumFactory().fromType(value)); + else if (name.equals("chain")) + this.getChain().add(castToString(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // UriType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // CodeType + case -615513385: throw new FHIRException("Cannot make property modifier as it is not a complex type"); // Enumeration + case 94623425: throw new FHIRException("Cannot make property chain as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); + } + else if (name.equals("definition")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.definition"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.type"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); + } + else if (name.equals("target")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.target"); + } + else if (name.equals("modifier")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.modifier"); + } + else if (name.equals("chain")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.chain"); + } + else + return super.addChild(name); + } + + public ConformanceRestResourceSearchParamComponent copy() { + ConformanceRestResourceSearchParamComponent dst = new ConformanceRestResourceSearchParamComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.definition = definition == null ? null : definition.copy(); + dst.type = type == null ? null : type.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + if (target != null) { + dst.target = new ArrayList(); + for (CodeType i : target) + dst.target.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList>(); + for (Enumeration i : modifier) + dst.modifier.add(i.copy()); + }; + if (chain != null) { + dst.chain = new ArrayList(); + for (StringType i : chain) + dst.chain.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestResourceSearchParamComponent)) + return false; + ConformanceRestResourceSearchParamComponent o = (ConformanceRestResourceSearchParamComponent) other; + return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(type, o.type, true) + && compareDeep(documentation, o.documentation, true) && compareDeep(target, o.target, true) && compareDeep(modifier, o.modifier, true) + && compareDeep(chain, o.chain, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestResourceSearchParamComponent)) + return false; + ConformanceRestResourceSearchParamComponent o = (ConformanceRestResourceSearchParamComponent) other; + return compareValues(name, o.name, true) && compareValues(definition, o.definition, true) && compareValues(type, o.type, true) + && compareValues(documentation, o.documentation, true) && compareValues(target, o.target, true) && compareValues(modifier, o.modifier, true) + && compareValues(chain, o.chain, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) + && (type == null || type.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (target == null || target.isEmpty()) && (modifier == null || modifier.isEmpty()) && (chain == null || chain.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.rest.resource.searchParam"; + + } + + } + + @Block() + public static class SystemInteractionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A coded identifier of the operation, supported by the system. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="transaction | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." ) + protected Enumeration code; + + /** + * Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented." ) + protected StringType documentation; + + private static final long serialVersionUID = 510675287L; + + /** + * Constructor + */ + public SystemInteractionComponent() { + super(); + } + + /** + * Constructor + */ + public SystemInteractionComponent(Enumeration code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SystemInteractionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new SystemRestfulInteractionEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public SystemInteractionComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return A coded identifier of the operation, supported by the system. + */ + public SystemRestfulInteraction getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A coded identifier of the operation, supported by the system. + */ + public SystemInteractionComponent setCode(SystemRestfulInteraction value) { + if (this.code == null) + this.code = new Enumeration(new SystemRestfulInteractionEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). 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 SystemInteractionComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public SystemInteractionComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + public SystemInteractionComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = new SystemRestfulInteractionEnumFactory().fromType(value); // Enumeration + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = new SystemRestfulInteractionEnumFactory().fromType(value); // Enumeration + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.code"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); + } + else + return super.addChild(name); + } + + public SystemInteractionComponent copy() { + SystemInteractionComponent dst = new SystemInteractionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SystemInteractionComponent)) + return false; + SystemInteractionComponent o = (SystemInteractionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SystemInteractionComponent)) + return false; + SystemInteractionComponent o = (SystemInteractionComponent) other; + return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.rest.interaction"; + + } + + } + + @Block() + public static class ConformanceRestOperationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name by which the operation/query is invoked", formalDefinition="The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called." ) + protected StringType name; + + /** + * Where the formal definition can be found. + */ + @Child(name = "definition", type = {OperationDefinition.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The defined operation/query", formalDefinition="Where the formal definition can be found." ) + protected Reference definition; + + /** + * The actual object that is the target of the reference (Where the formal definition can be found.) + */ + protected OperationDefinition definitionTarget; + + private static final long serialVersionUID = 122107272L; + + /** + * Constructor + */ + public ConformanceRestOperationComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceRestOperationComponent(StringType name, Reference definition) { + super(); + this.name = name; + this.definition = definition; + } + + /** + * @return {@link #name} (The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called.). 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 ConformanceRestOperationComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceRestOperationComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called. + */ + public ConformanceRestOperationComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #definition} (Where the formal definition can be found.) + */ + public Reference getDefinition() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new Reference(); // cc + return this.definition; + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (Where the formal definition can be found.) + */ + public ConformanceRestOperationComponent setDefinition(Reference value) { + this.definition = value; + return this; + } + + /** + * @return {@link #definition} 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. (Where the formal definition can be found.) + */ + public OperationDefinition getDefinitionTarget() { + if (this.definitionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definitionTarget = new OperationDefinition(); // aa + return this.definitionTarget; + } + + /** + * @param value {@link #definition} 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. (Where the formal definition can be found.) + */ + public ConformanceRestOperationComponent setDefinitionTarget(OperationDefinition value) { + this.definitionTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, java.lang.Integer.MAX_VALUE, definition)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1014418093: // definition + this.definition = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("definition")) + this.definition = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1014418093: return getDefinition(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); + } + else if (name.equals("definition")) { + this.definition = new Reference(); + return this.definition; + } + else + return super.addChild(name); + } + + public ConformanceRestOperationComponent copy() { + ConformanceRestOperationComponent dst = new ConformanceRestOperationComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.definition = definition == null ? null : definition.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceRestOperationComponent)) + return false; + ConformanceRestOperationComponent o = (ConformanceRestOperationComponent) other; + return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceRestOperationComponent)) + return false; + ConformanceRestOperationComponent o = (ConformanceRestOperationComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.rest.operation"; + + } + + } + + @Block() + public static class ConformanceMessagingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An endpoint (network accessible address) to which messages and/or replies are to be sent. + */ + @Child(name = "endpoint", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Where messages should be sent", formalDefinition="An endpoint (network accessible address) to which messages and/or replies are to be sent." ) + protected List endpoint; + + /** + * Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + @Child(name = "reliableCache", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reliable Message Cache Length (min)", formalDefinition="Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender)." ) + protected UnsignedIntType reliableCache; + + /** + * Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Messaging interface behavior details", formalDefinition="Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner." ) + protected StringType documentation; + + /** + * A description of the solution's support for an event at this end-point. + */ + @Child(name = "event", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Declare support for this event", formalDefinition="A description of the solution's support for an event at this end-point." ) + protected List event; + + private static final long serialVersionUID = -712362545L; + + /** + * Constructor + */ + public ConformanceMessagingComponent() { + super(); + } + + /** + * @return {@link #endpoint} (An endpoint (network accessible address) to which messages and/or replies are to be sent.) + */ + public List getEndpoint() { + if (this.endpoint == null) + this.endpoint = new ArrayList(); + return this.endpoint; + } + + public boolean hasEndpoint() { + if (this.endpoint == null) + return false; + for (ConformanceMessagingEndpointComponent item : this.endpoint) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #endpoint} (An endpoint (network accessible address) to which messages and/or replies are to be sent.) + */ + // syntactic sugar + public ConformanceMessagingEndpointComponent addEndpoint() { //3 + ConformanceMessagingEndpointComponent t = new ConformanceMessagingEndpointComponent(); + if (this.endpoint == null) + this.endpoint = new ArrayList(); + this.endpoint.add(t); + return t; + } + + // syntactic sugar + public ConformanceMessagingComponent addEndpoint(ConformanceMessagingEndpointComponent t) { //3 + if (t == null) + return this; + if (this.endpoint == null) + this.endpoint = new ArrayList(); + this.endpoint.add(t); + return this; + } + + /** + * @return {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value + */ + public UnsignedIntType getReliableCacheElement() { + if (this.reliableCache == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingComponent.reliableCache"); + else if (Configuration.doAutoCreate()) + this.reliableCache = new UnsignedIntType(); // bb + return this.reliableCache; + } + + public boolean hasReliableCacheElement() { + return this.reliableCache != null && !this.reliableCache.isEmpty(); + } + + public boolean hasReliableCache() { + return this.reliableCache != null && !this.reliableCache.isEmpty(); + } + + /** + * @param value {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value + */ + public ConformanceMessagingComponent setReliableCacheElement(UnsignedIntType value) { + this.reliableCache = value; + return this; + } + + /** + * @return Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + public int getReliableCache() { + return this.reliableCache == null || this.reliableCache.isEmpty() ? 0 : this.reliableCache.getValue(); + } + + /** + * @param value Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + public ConformanceMessagingComponent setReliableCache(int value) { + if (this.reliableCache == null) + this.reliableCache = new UnsignedIntType(); + this.reliableCache.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). 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 ConformanceMessagingComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceMessagingComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + public ConformanceMessagingComponent 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 #event} (A description of the solution's support for an event at this end-point.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (ConformanceMessagingEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A description of the solution's support for an event at this end-point.) + */ + // syntactic sugar + public ConformanceMessagingEventComponent addEvent() { //3 + ConformanceMessagingEventComponent t = new ConformanceMessagingEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public ConformanceMessagingComponent addEvent(ConformanceMessagingEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("endpoint", "", "An endpoint (network accessible address) to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + childrenList.add(new Property("reliableCache", "unsignedInt", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, java.lang.Integer.MAX_VALUE, reliableCache)); + childrenList.add(new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("event", "", "A description of the solution's support for an event at this end-point.", 0, java.lang.Integer.MAX_VALUE, event)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // ConformanceMessagingEndpointComponent + case 897803608: /*reliableCache*/ return this.reliableCache == null ? new Base[0] : new Base[] {this.reliableCache}; // UnsignedIntType + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // ConformanceMessagingEventComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1741102485: // endpoint + this.getEndpoint().add((ConformanceMessagingEndpointComponent) value); // ConformanceMessagingEndpointComponent + break; + case 897803608: // reliableCache + this.reliableCache = castToUnsignedInt(value); // UnsignedIntType + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + case 96891546: // event + this.getEvent().add((ConformanceMessagingEventComponent) value); // ConformanceMessagingEventComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("endpoint")) + this.getEndpoint().add((ConformanceMessagingEndpointComponent) value); + else if (name.equals("reliableCache")) + this.reliableCache = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else if (name.equals("event")) + this.getEvent().add((ConformanceMessagingEventComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1741102485: return addEndpoint(); // ConformanceMessagingEndpointComponent + case 897803608: throw new FHIRException("Cannot make property reliableCache as it is not a complex type"); // UnsignedIntType + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + case 96891546: return addEvent(); // ConformanceMessagingEventComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("endpoint")) { + return addEndpoint(); + } + else if (name.equals("reliableCache")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.reliableCache"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); + } + else if (name.equals("event")) { + return addEvent(); + } + else + return super.addChild(name); + } + + public ConformanceMessagingComponent copy() { + ConformanceMessagingComponent dst = new ConformanceMessagingComponent(); + copyValues(dst); + if (endpoint != null) { + dst.endpoint = new ArrayList(); + for (ConformanceMessagingEndpointComponent i : endpoint) + dst.endpoint.add(i.copy()); + }; + dst.reliableCache = reliableCache == null ? null : reliableCache.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (ConformanceMessagingEventComponent i : event) + dst.event.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceMessagingComponent)) + return false; + ConformanceMessagingComponent o = (ConformanceMessagingComponent) other; + return compareDeep(endpoint, o.endpoint, true) && compareDeep(reliableCache, o.reliableCache, true) + && compareDeep(documentation, o.documentation, true) && compareDeep(event, o.event, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceMessagingComponent)) + return false; + ConformanceMessagingComponent o = (ConformanceMessagingComponent) other; + return compareValues(reliableCache, o.reliableCache, true) && compareValues(documentation, o.documentation, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (endpoint == null || endpoint.isEmpty()) && (reliableCache == null || reliableCache.isEmpty()) + && (documentation == null || documentation.isEmpty()) && (event == null || event.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.messaging"; + + } + + } + + @Block() + public static class ConformanceMessagingEndpointComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A list of the messaging transport protocol(s) identifiers, supported by this endpoint. + */ + @Child(name = "protocol", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." ) + protected Coding protocol; + + /** + * The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier. + */ + @Child(name = "address", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Address of end-point", formalDefinition="The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier." ) + protected UriType address; + + private static final long serialVersionUID = 1294656428L; + + /** + * Constructor + */ + public ConformanceMessagingEndpointComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceMessagingEndpointComponent(Coding protocol, UriType address) { + super(); + this.protocol = protocol; + this.address = address; + } + + /** + * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) + */ + public Coding getProtocol() { + if (this.protocol == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEndpointComponent.protocol"); + else if (Configuration.doAutoCreate()) + this.protocol = new Coding(); // cc + return this.protocol; + } + + public boolean hasProtocol() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + /** + * @param value {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) + */ + public ConformanceMessagingEndpointComponent setProtocol(Coding value) { + this.protocol = value; + return this; + } + + /** + * @return {@link #address} (The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value + */ + public UriType getAddressElement() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEndpointComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new UriType(); // bb + return this.address; + } + + public boolean hasAddressElement() { + return this.address != null && !this.address.isEmpty(); + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value + */ + public ConformanceMessagingEndpointComponent setAddressElement(UriType value) { + this.address = value; + return this; + } + + /** + * @return The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier. + */ + public String getAddress() { + return this.address == null ? null : this.address.getValue(); + } + + /** + * @param value The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier. + */ + public ConformanceMessagingEndpointComponent setAddress(String value) { + if (this.address == null) + this.address = new UriType(); + this.address.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("address", "uri", "The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.", 0, java.lang.Integer.MAX_VALUE, address)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // Coding + case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -989163880: // protocol + this.protocol = castToCoding(value); // Coding + break; + case -1147692044: // address + this.address = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("protocol")) + this.protocol = castToCoding(value); // Coding + else if (name.equals("address")) + this.address = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -989163880: return getProtocol(); // Coding + case -1147692044: throw new FHIRException("Cannot make property address as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("protocol")) { + this.protocol = new Coding(); + return this.protocol; + } + else if (name.equals("address")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.address"); + } + else + return super.addChild(name); + } + + public ConformanceMessagingEndpointComponent copy() { + ConformanceMessagingEndpointComponent dst = new ConformanceMessagingEndpointComponent(); + copyValues(dst); + dst.protocol = protocol == null ? null : protocol.copy(); + dst.address = address == null ? null : address.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceMessagingEndpointComponent)) + return false; + ConformanceMessagingEndpointComponent o = (ConformanceMessagingEndpointComponent) other; + return compareDeep(protocol, o.protocol, true) && compareDeep(address, o.address, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceMessagingEndpointComponent)) + return false; + ConformanceMessagingEndpointComponent o = (ConformanceMessagingEndpointComponent) other; + return compareValues(address, o.address, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (protocol == null || protocol.isEmpty()) && (address == null || address.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.messaging.endpoint"; + + } + + } + + @Block() + public static class ConformanceMessagingEventComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A coded identifier of a supported messaging event. + */ + @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." ) + protected Coding code; + + /** + * The impact of the content of the message. + */ + @Child(name = "category", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." ) + protected Enumeration category; + + /** + * The mode of this event declaration - whether application is sender or receiver. + */ + @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." ) + protected Enumeration mode; + + /** + * A resource associated with the event. This is the resource that defines the event. + */ + @Child(name = "focus", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Resource that's focus of message", formalDefinition="A resource associated with the event. This is the resource that defines the event." ) + protected CodeType focus; + + /** + * Information about the request for this event. + */ + @Child(name = "request", type = {StructureDefinition.class}, order=5, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Profile that describes the request", formalDefinition="Information about the request for this event." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Information about the request for this event.) + */ + protected StructureDefinition requestTarget; + + /** + * Information about the response for this event. + */ + @Child(name = "response", type = {StructureDefinition.class}, order=6, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Profile that describes the response", formalDefinition="Information about the response for this event." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Information about the response for this event.) + */ + protected StructureDefinition responseTarget; + + /** + * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + @Child(name = "documentation", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Endpoint-specific event documentation", formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." ) + protected StringType documentation; + + private static final long serialVersionUID = -47031390L; + + /** + * Constructor + */ + public ConformanceMessagingEventComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceMessagingEventComponent(Coding code, Enumeration mode, CodeType focus, Reference request, Reference response) { + super(); + this.code = code; + this.mode = mode; + this.focus = focus; + this.request = request; + this.response = response; + } + + /** + * @return {@link #code} (A coded identifier of a supported messaging event.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A coded identifier of a supported messaging event.) + */ + public ConformanceMessagingEventComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #category} (The impact of the content of the message.). 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 ConformanceMessagingEventComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); // bb + 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} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public ConformanceMessagingEventComponent setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return The impact of the content of the message. + */ + public MessageSignificanceCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value The impact of the content of the message. + */ + public ConformanceMessagingEventComponent setCategory(MessageSignificanceCategory value) { + if (value == null) + this.category = null; + else { + if (this.category == null) + this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); + this.category.setValue(value); + } + return this; + } + + /** + * @return {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). 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 ConformanceMessagingEventComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new ConformanceEventModeEnumFactory()); // bb + 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 mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceMessagingEventComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return The mode of this event declaration - whether application is sender or receiver. + */ + public ConformanceEventMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value The mode of this event declaration - whether application is sender or receiver. + */ + public ConformanceMessagingEventComponent setMode(ConformanceEventMode value) { + if (this.mode == null) + this.mode = new Enumeration(new ConformanceEventModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value + */ + public CodeType getFocusElement() { + if (this.focus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.focus"); + else if (Configuration.doAutoCreate()) + this.focus = new CodeType(); // bb + return this.focus; + } + + public boolean hasFocusElement() { + return this.focus != null && !this.focus.isEmpty(); + } + + public boolean hasFocus() { + return this.focus != null && !this.focus.isEmpty(); + } + + /** + * @param value {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value + */ + public ConformanceMessagingEventComponent setFocusElement(CodeType value) { + this.focus = value; + return this; + } + + /** + * @return A resource associated with the event. This is the resource that defines the event. + */ + public String getFocus() { + return this.focus == null ? null : this.focus.getValue(); + } + + /** + * @param value A resource associated with the event. This is the resource that defines the event. + */ + public ConformanceMessagingEventComponent setFocus(String value) { + if (this.focus == null) + this.focus = new CodeType(); + this.focus.setValue(value); + return this; + } + + /** + * @return {@link #request} (Information about the request for this event.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Information about the request for this event.) + */ + public ConformanceMessagingEventComponent setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (Information about the request for this event.) + */ + public StructureDefinition getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new StructureDefinition(); // aa + 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. (Information about the request for this event.) + */ + public ConformanceMessagingEventComponent setRequestTarget(StructureDefinition value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Information about the response for this event.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); // cc + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Information about the response for this event.) + */ + public ConformanceMessagingEventComponent setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} 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. (Information about the response for this event.) + */ + public StructureDefinition getResponseTarget() { + if (this.responseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); + else if (Configuration.doAutoCreate()) + this.responseTarget = new StructureDefinition(); // aa + return this.responseTarget; + } + + /** + * @param value {@link #response} 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. (Information about the response for this event.) + */ + public ConformanceMessagingEventComponent setResponseTarget(StructureDefinition value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). 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 ConformanceMessagingEventComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceMessagingEventComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + public ConformanceMessagingEventComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "code", "The impact of the content of the message.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("focus", "code", "A resource associated with the event. This is the resource that defines the event.", 0, java.lang.Integer.MAX_VALUE, focus)); + childrenList.add(new Property("request", "Reference(StructureDefinition)", "Information about the request for this event.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(StructureDefinition)", "Information about the response for this event.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration + case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // CodeType + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCoding(value); // Coding + break; + case 50511102: // category + this.category = new MessageSignificanceCategoryEnumFactory().fromType(value); // Enumeration + break; + case 3357091: // mode + this.mode = new ConformanceEventModeEnumFactory().fromType(value); // Enumeration + break; + case 97604824: // focus + this.focus = castToCode(value); // CodeType + break; + case 1095692943: // request + this.request = castToReference(value); // Reference + break; + case -340323263: // response + this.response = castToReference(value); // Reference + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCoding(value); // Coding + else if (name.equals("category")) + this.category = new MessageSignificanceCategoryEnumFactory().fromType(value); // Enumeration + else if (name.equals("mode")) + this.mode = new ConformanceEventModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("focus")) + this.focus = castToCode(value); // CodeType + else if (name.equals("request")) + this.request = castToReference(value); // Reference + else if (name.equals("response")) + this.response = castToReference(value); // Reference + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // Coding + case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 97604824: throw new FHIRException("Cannot make property focus as it is not a complex type"); // CodeType + case 1095692943: return getRequest(); // Reference + case -340323263: return getResponse(); // Reference + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new Coding(); + return this.code; + } + else if (name.equals("category")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.category"); + } + else if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.mode"); + } + else if (name.equals("focus")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.focus"); + } + else if (name.equals("request")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("response")) { + this.response = new Reference(); + return this.response; + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); + } + else + return super.addChild(name); + } + + public ConformanceMessagingEventComponent copy() { + ConformanceMessagingEventComponent dst = new ConformanceMessagingEventComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.category = category == null ? null : category.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.focus = focus == null ? null : focus.copy(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceMessagingEventComponent)) + return false; + ConformanceMessagingEventComponent o = (ConformanceMessagingEventComponent) other; + return compareDeep(code, o.code, true) && compareDeep(category, o.category, true) && compareDeep(mode, o.mode, true) + && compareDeep(focus, o.focus, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) + && compareDeep(documentation, o.documentation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceMessagingEventComponent)) + return false; + ConformanceMessagingEventComponent o = (ConformanceMessagingEventComponent) other; + return compareValues(category, o.category, true) && compareValues(mode, o.mode, true) && compareValues(focus, o.focus, true) + && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) + && (mode == null || mode.isEmpty()) && (focus == null || focus.isEmpty()) && (request == null || request.isEmpty()) + && (response == null || response.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + public String fhirType() { + return "Conformance.messaging.event"; + + } + + } + + @Block() + public static class ConformanceDocumentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Mode of this document declaration - whether application is producer or consumer. + */ + @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether application is producer or consumer." ) + protected Enumeration mode; + + /** + * A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Description of document support", formalDefinition="A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc." ) + protected StringType documentation; + + /** + * A constraint on a resource used in the document. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Constraint on a resource used in the document", formalDefinition="A constraint on a resource used in the document." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A constraint on a resource used in the document.) + */ + protected StructureDefinition profileTarget; + + private static final long serialVersionUID = -1059555053L; + + /** + * Constructor + */ + public ConformanceDocumentComponent() { + super(); + } + + /** + * Constructor + */ + public ConformanceDocumentComponent(Enumeration mode, Reference profile) { + super(); + this.mode = mode; + this.profile = profile; + } + + /** + * @return {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). 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 ConformanceDocumentComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new DocumentModeEnumFactory()); // bb + 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} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceDocumentComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Mode of this document declaration - whether application is producer or consumer. + */ + public DocumentMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Mode of this document declaration - whether application is producer or consumer. + */ + public ConformanceDocumentComponent setMode(DocumentMode value) { + if (this.mode == null) + this.mode = new Enumeration(new DocumentModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). 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 ConformanceDocumentComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceDocumentComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + public ConformanceDocumentComponent 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 #profile} (A constraint on a resource used in the document.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A constraint on a resource used in the document.) + */ + public ConformanceDocumentComponent 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 constraint on a resource used in the document.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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 constraint on a resource used in the document.) + */ + public ConformanceDocumentComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "Mode of this document declaration - whether application is producer or consumer.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("documentation", "string", "A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A constraint on a resource used in the document.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3357091: // mode + this.mode = new DocumentModeEnumFactory().fromType(value); // Enumeration + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("mode")) + this.mode = new DocumentModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + case -309425751: return getProfile(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.mode"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else + return super.addChild(name); + } + + public ConformanceDocumentComponent copy() { + ConformanceDocumentComponent dst = new ConformanceDocumentComponent(); + copyValues(dst); + dst.mode = mode == null ? null : mode.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConformanceDocumentComponent)) + return false; + ConformanceDocumentComponent o = (ConformanceDocumentComponent) other; + return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(profile, o.profile, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConformanceDocumentComponent)) + return false; + ConformanceDocumentComponent o = (ConformanceDocumentComponent) other; + return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (profile == null || profile.isEmpty()); + } + + public String fhirType() { + return "Conformance.document"; + + } + + } + + /** + * An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical uri to reference this statement", formalDefinition="An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published." ) + protected UriType url; + + /** + * The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical id for this version of the statement", formalDefinition="The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name identifying the conformance statement. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this conformance statement", formalDefinition="A free text natural language name identifying the conformance statement." ) + protected StringType name; + + /** + * The status of this conformance statement. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this conformance statement." ) + protected Enumeration status; + + /** + * A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes." ) + protected DateTimeType date; + + /** + * The name of the individual or organization that published the conformance. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the conformance." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human description of the conformance statement", formalDefinition="A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements." ) + protected List useContext; + + /** + * Explains why this conformance statement is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why this resource has been created", formalDefinition="Explains why this conformance statement is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. + */ + @Child(name = "copyright", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement." ) + protected StringType copyright; + + /** + * The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase). + */ + @Child(name = "kind", type = {CodeType.class}, order=12, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="instance | capability | requirements", formalDefinition="The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase)." ) + protected Enumeration kind; + + /** + * Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation. + */ + @Child(name = "software", type = {}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Software that is covered by this conformance statement", formalDefinition="Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation." ) + protected ConformanceSoftwareComponent software; + + /** + * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program. + */ + @Child(name = "implementation", type = {}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If this describes a specific instance", formalDefinition="Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program." ) + protected ConformanceImplementationComponent implementation; + + /** + * The version of the FHIR specification on which this conformance statement is based. + */ + @Child(name = "fhirVersion", type = {IdType.class}, order=15, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="FHIR Version the system uses", formalDefinition="The version of the FHIR specification on which this conformance statement is based." ) + protected IdType fhirVersion; + + /** + * A code that indicates whether the application accepts unknown elements or extensions when reading resources. + */ + @Child(name = "acceptUnknown", type = {CodeType.class}, order=16, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="no | extensions | elements | both", formalDefinition="A code that indicates whether the application accepts unknown elements or extensions when reading resources." ) + protected Enumeration acceptUnknown; + + /** + * A list of the formats supported by this implementation using their content types. + */ + @Child(name = "format", type = {CodeType.class}, order=17, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="formats supported (xml | json | mime type)", formalDefinition="A list of the formats supported by this implementation using their content types." ) + protected List format; + + /** + * A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Profiles for use cases supported", formalDefinition="A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}." ) + protected List profile; + /** + * The actual objects that are the target of the reference (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + protected List profileTarget; + + + /** + * A definition of the restful capabilities of the solution, if any. + */ + @Child(name = "rest", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." ) + protected List rest; + + /** + * A description of the messaging capabilities of the solution. + */ + @Child(name = "messaging", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." ) + protected List messaging; + + /** + * A document definition. + */ + @Child(name = "document", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Document definition", formalDefinition="A document definition." ) + protected List document; + + private static final long serialVersionUID = 64276427L; + + /** + * Constructor + */ + public Conformance() { + super(); + } + + /** + * Constructor + */ + public Conformance(Enumeration status, DateTimeType date, Enumeration kind, IdType fhirVersion, Enumeration acceptUnknown) { + super(); + this.status = status; + this.date = date; + this.kind = kind; + this.fhirVersion = fhirVersion; + this.acceptUnknown = acceptUnknown; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Conformance setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published. + */ + public Conformance setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Conformance setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public Conformance setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the conformance statement.). 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 Conformance.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Conformance setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the conformance statement. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the conformance statement. + */ + public Conformance setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of this conformance statement.). 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 Conformance.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Conformance setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this conformance statement. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this conformance statement. + */ + public Conformance setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public Conformance setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public Conformance setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes.). 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 Conformance.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Conformance setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes. + */ + public Conformance setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the conformance.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the conformance.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public Conformance setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the conformance. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the conformance. + */ + public Conformance setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ConformanceContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ConformanceContactComponent addContact() { //3 + ConformanceContactComponent t = new ConformanceContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Conformance addContact(ConformanceContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). 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 Conformance.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Conformance setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + public Conformance 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public Conformance addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #requirements} (Explains why this conformance statement is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this conformance statement is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public Conformance setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this conformance statement is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this conformance statement is needed and why it's been constrained as it has. + */ + public Conformance setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public Conformance setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. + */ + public Conformance setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #kind} (The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new ConformanceStatementKindEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Conformance setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase). + */ + public ConformanceStatementKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase). + */ + public Conformance setKind(ConformanceStatementKind value) { + if (this.kind == null) + this.kind = new Enumeration(new ConformanceStatementKindEnumFactory()); + this.kind.setValue(value); + return this; + } + + /** + * @return {@link #software} (Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.) + */ + public ConformanceSoftwareComponent getSoftware() { + if (this.software == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.software"); + else if (Configuration.doAutoCreate()) + this.software = new ConformanceSoftwareComponent(); // cc + return this.software; + } + + public boolean hasSoftware() { + return this.software != null && !this.software.isEmpty(); + } + + /** + * @param value {@link #software} (Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.) + */ + public Conformance setSoftware(ConformanceSoftwareComponent value) { + this.software = value; + return this; + } + + /** + * @return {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) + */ + public ConformanceImplementationComponent getImplementation() { + if (this.implementation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.implementation"); + else if (Configuration.doAutoCreate()) + this.implementation = new ConformanceImplementationComponent(); // cc + return this.implementation; + } + + public boolean hasImplementation() { + return this.implementation != null && !this.implementation.isEmpty(); + } + + /** + * @param value {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) + */ + public Conformance setImplementation(ConformanceImplementationComponent value) { + this.implementation = value; + return this; + } + + /** + * @return {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public IdType getFhirVersionElement() { + if (this.fhirVersion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.fhirVersion"); + else if (Configuration.doAutoCreate()) + this.fhirVersion = new IdType(); // bb + return this.fhirVersion; + } + + public boolean hasFhirVersionElement() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + public boolean hasFhirVersion() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + /** + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public Conformance setFhirVersionElement(IdType value) { + this.fhirVersion = value; + return this; + } + + /** + * @return The version of the FHIR specification on which this conformance statement is based. + */ + public String getFhirVersion() { + return this.fhirVersion == null ? null : this.fhirVersion.getValue(); + } + + /** + * @param value The version of the FHIR specification on which this conformance statement is based. + */ + public Conformance setFhirVersion(String value) { + if (this.fhirVersion == null) + this.fhirVersion = new IdType(); + this.fhirVersion.setValue(value); + return this; + } + + /** + * @return {@link #acceptUnknown} (A code that indicates whether the application accepts unknown elements or extensions when reading resources.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value + */ + public Enumeration getAcceptUnknownElement() { + if (this.acceptUnknown == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.acceptUnknown"); + else if (Configuration.doAutoCreate()) + this.acceptUnknown = new Enumeration(new UnknownContentCodeEnumFactory()); // bb + return this.acceptUnknown; + } + + public boolean hasAcceptUnknownElement() { + return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); + } + + public boolean hasAcceptUnknown() { + return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); + } + + /** + * @param value {@link #acceptUnknown} (A code that indicates whether the application accepts unknown elements or extensions when reading resources.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value + */ + public Conformance setAcceptUnknownElement(Enumeration value) { + this.acceptUnknown = value; + return this; + } + + /** + * @return A code that indicates whether the application accepts unknown elements or extensions when reading resources. + */ + public UnknownContentCode getAcceptUnknown() { + return this.acceptUnknown == null ? null : this.acceptUnknown.getValue(); + } + + /** + * @param value A code that indicates whether the application accepts unknown elements or extensions when reading resources. + */ + public Conformance setAcceptUnknown(UnknownContentCode value) { + if (this.acceptUnknown == null) + this.acceptUnknown = new Enumeration(new UnknownContentCodeEnumFactory()); + this.acceptUnknown.setValue(value); + return this; + } + + /** + * @return {@link #format} (A list of the formats supported by this implementation using their content types.) + */ + public List getFormat() { + if (this.format == null) + this.format = new ArrayList(); + return this.format; + } + + public boolean hasFormat() { + if (this.format == null) + return false; + for (CodeType item : this.format) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #format} (A list of the formats supported by this implementation using their content types.) + */ + // syntactic sugar + public CodeType addFormatElement() {//2 + CodeType t = new CodeType(); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return t; + } + + /** + * @param value {@link #format} (A list of the formats supported by this implementation using their content types.) + */ + public Conformance addFormat(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return this; + } + + /** + * @param value {@link #format} (A list of the formats supported by this implementation using their content types.) + */ + public boolean hasFormat(String value) { + if (this.format == null) + return false; + for (CodeType v : this.format) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + public List getProfile() { + if (this.profile == null) + this.profile = new ArrayList(); + return this.profile; + } + + public boolean hasProfile() { + if (this.profile == null) + return false; + for (Reference item : this.profile) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + // syntactic sugar + public Reference addProfile() { //3 + Reference t = new Reference(); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return t; + } + + // syntactic sugar + public Conformance addProfile(Reference t) { //3 + if (t == null) + return this; + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return this; + } + + /** + * @return {@link #profile} (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 list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + public List getProfileTarget() { + if (this.profileTarget == null) + this.profileTarget = new ArrayList(); + return this.profileTarget; + } + + // syntactic sugar + /** + * @return {@link #profile} (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 list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + */ + public StructureDefinition addProfileTarget() { + StructureDefinition r = new StructureDefinition(); + if (this.profileTarget == null) + this.profileTarget = new ArrayList(); + this.profileTarget.add(r); + return r; + } + + /** + * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) + */ + public List getRest() { + if (this.rest == null) + this.rest = new ArrayList(); + return this.rest; + } + + public boolean hasRest() { + if (this.rest == null) + return false; + for (ConformanceRestComponent item : this.rest) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) + */ + // syntactic sugar + public ConformanceRestComponent addRest() { //3 + ConformanceRestComponent t = new ConformanceRestComponent(); + if (this.rest == null) + this.rest = new ArrayList(); + this.rest.add(t); + return t; + } + + // syntactic sugar + public Conformance addRest(ConformanceRestComponent t) { //3 + if (t == null) + return this; + if (this.rest == null) + this.rest = new ArrayList(); + this.rest.add(t); + return this; + } + + /** + * @return {@link #messaging} (A description of the messaging capabilities of the solution.) + */ + public List getMessaging() { + if (this.messaging == null) + this.messaging = new ArrayList(); + return this.messaging; + } + + public boolean hasMessaging() { + if (this.messaging == null) + return false; + for (ConformanceMessagingComponent item : this.messaging) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #messaging} (A description of the messaging capabilities of the solution.) + */ + // syntactic sugar + public ConformanceMessagingComponent addMessaging() { //3 + ConformanceMessagingComponent t = new ConformanceMessagingComponent(); + if (this.messaging == null) + this.messaging = new ArrayList(); + this.messaging.add(t); + return t; + } + + // syntactic sugar + public Conformance addMessaging(ConformanceMessagingComponent t) { //3 + if (t == null) + return this; + if (this.messaging == null) + this.messaging = new ArrayList(); + this.messaging.add(t); + return this; + } + + /** + * @return {@link #document} (A document definition.) + */ + public List getDocument() { + if (this.document == null) + this.document = new ArrayList(); + return this.document; + } + + public boolean hasDocument() { + if (this.document == null) + return false; + for (ConformanceDocumentComponent item : this.document) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #document} (A document definition.) + */ + // syntactic sugar + public ConformanceDocumentComponent addDocument() { //3 + ConformanceDocumentComponent t = new ConformanceDocumentComponent(); + if (this.document == null) + this.document = new ArrayList(); + this.document.add(t); + return t; + } + + // syntactic sugar + public Conformance addDocument(ConformanceDocumentComponent t) { //3 + if (t == null) + return this; + if (this.document == null) + this.document = new ArrayList(); + this.document.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the conformance statement.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of this conformance statement.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the conformance.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("description", "string", "A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("requirements", "string", "Explains why this conformance statement is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("kind", "code", "The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("software", "", "Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.", 0, java.lang.Integer.MAX_VALUE, software)); + childrenList.add(new Property("implementation", "", "Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, java.lang.Integer.MAX_VALUE, implementation)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this conformance statement is based.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("acceptUnknown", "code", "A code that indicates whether the application accepts unknown elements or extensions when reading resources.", 0, java.lang.Integer.MAX_VALUE, acceptUnknown)); + childrenList.add(new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest)); + childrenList.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging)); + childrenList.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ConformanceContactComponent + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration + case 1319330215: /*software*/ return this.software == null ? new Base[0] : new Base[] {this.software}; // ConformanceSoftwareComponent + case 1683336114: /*implementation*/ return this.implementation == null ? new Base[0] : new Base[] {this.implementation}; // ConformanceImplementationComponent + case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType + case -1862642142: /*acceptUnknown*/ return this.acceptUnknown == null ? new Base[0] : new Base[] {this.acceptUnknown}; // Enumeration + case -1268779017: /*format*/ return this.format == null ? new Base[0] : this.format.toArray(new Base[this.format.size()]); // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference + case 3496916: /*rest*/ return this.rest == null ? new Base[0] : this.rest.toArray(new Base[this.rest.size()]); // ConformanceRestComponent + case -1440008444: /*messaging*/ return this.messaging == null ? new Base[0] : this.messaging.toArray(new Base[this.messaging.size()]); // ConformanceMessagingComponent + case 861720859: /*document*/ return this.document == null ? new Base[0] : this.document.toArray(new Base[this.document.size()]); // ConformanceDocumentComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((ConformanceContactComponent) value); // ConformanceContactComponent + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case 3292052: // kind + this.kind = new ConformanceStatementKindEnumFactory().fromType(value); // Enumeration + break; + case 1319330215: // software + this.software = (ConformanceSoftwareComponent) value; // ConformanceSoftwareComponent + break; + case 1683336114: // implementation + this.implementation = (ConformanceImplementationComponent) value; // ConformanceImplementationComponent + break; + case 461006061: // fhirVersion + this.fhirVersion = castToId(value); // IdType + break; + case -1862642142: // acceptUnknown + this.acceptUnknown = new UnknownContentCodeEnumFactory().fromType(value); // Enumeration + break; + case -1268779017: // format + this.getFormat().add(castToCode(value)); // CodeType + break; + case -309425751: // profile + this.getProfile().add(castToReference(value)); // Reference + break; + case 3496916: // rest + this.getRest().add((ConformanceRestComponent) value); // ConformanceRestComponent + break; + case -1440008444: // messaging + this.getMessaging().add((ConformanceMessagingComponent) value); // ConformanceMessagingComponent + break; + case 861720859: // document + this.getDocument().add((ConformanceDocumentComponent) value); // ConformanceDocumentComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((ConformanceContactComponent) value); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("kind")) + this.kind = new ConformanceStatementKindEnumFactory().fromType(value); // Enumeration + else if (name.equals("software")) + this.software = (ConformanceSoftwareComponent) value; // ConformanceSoftwareComponent + else if (name.equals("implementation")) + this.implementation = (ConformanceImplementationComponent) value; // ConformanceImplementationComponent + else if (name.equals("fhirVersion")) + this.fhirVersion = castToId(value); // IdType + else if (name.equals("acceptUnknown")) + this.acceptUnknown = new UnknownContentCodeEnumFactory().fromType(value); // Enumeration + else if (name.equals("format")) + this.getFormat().add(castToCode(value)); + else if (name.equals("profile")) + this.getProfile().add(castToReference(value)); + else if (name.equals("rest")) + this.getRest().add((ConformanceRestComponent) value); + else if (name.equals("messaging")) + this.getMessaging().add((ConformanceMessagingComponent) value); + else if (name.equals("document")) + this.getDocument().add((ConformanceDocumentComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // ConformanceContactComponent + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration + case 1319330215: return getSoftware(); // ConformanceSoftwareComponent + case 1683336114: return getImplementation(); // ConformanceImplementationComponent + case 461006061: throw new FHIRException("Cannot make property fhirVersion as it is not a complex type"); // IdType + case -1862642142: throw new FHIRException("Cannot make property acceptUnknown as it is not a complex type"); // Enumeration + case -1268779017: throw new FHIRException("Cannot make property format as it is not a complex type"); // CodeType + case -309425751: return addProfile(); // Reference + case 3496916: return addRest(); // ConformanceRestComponent + case -1440008444: return addMessaging(); // ConformanceMessagingComponent + case 861720859: return addDocument(); // ConformanceDocumentComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.url"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.experimental"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.date"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.requirements"); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.copyright"); + } + else if (name.equals("kind")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.kind"); + } + else if (name.equals("software")) { + this.software = new ConformanceSoftwareComponent(); + return this.software; + } + else if (name.equals("implementation")) { + this.implementation = new ConformanceImplementationComponent(); + return this.implementation; + } + else if (name.equals("fhirVersion")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.fhirVersion"); + } + else if (name.equals("acceptUnknown")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.acceptUnknown"); + } + else if (name.equals("format")) { + throw new FHIRException("Cannot call addChild on a primitive type Conformance.format"); + } + else if (name.equals("profile")) { + return addProfile(); + } + else if (name.equals("rest")) { + return addRest(); + } + else if (name.equals("messaging")) { + return addMessaging(); + } + else if (name.equals("document")) { + return addDocument(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Conformance"; + + } + + public Conformance copy() { + Conformance dst = new Conformance(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ConformanceContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.kind = kind == null ? null : kind.copy(); + dst.software = software == null ? null : software.copy(); + dst.implementation = implementation == null ? null : implementation.copy(); + dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); + dst.acceptUnknown = acceptUnknown == null ? null : acceptUnknown.copy(); + if (format != null) { + dst.format = new ArrayList(); + for (CodeType i : format) + dst.format.add(i.copy()); + }; + if (profile != null) { + dst.profile = new ArrayList(); + for (Reference i : profile) + dst.profile.add(i.copy()); + }; + if (rest != null) { + dst.rest = new ArrayList(); + for (ConformanceRestComponent i : rest) + dst.rest.add(i.copy()); + }; + if (messaging != null) { + dst.messaging = new ArrayList(); + for (ConformanceMessagingComponent i : messaging) + dst.messaging.add(i.copy()); + }; + if (document != null) { + dst.document = new ArrayList(); + for (ConformanceDocumentComponent i : document) + dst.document.add(i.copy()); + }; + return dst; + } + + protected Conformance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Conformance)) + return false; + Conformance o = (Conformance) other; + return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) + && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) + && compareDeep(useContext, o.useContext, true) && compareDeep(requirements, o.requirements, true) + && compareDeep(copyright, o.copyright, true) && compareDeep(kind, o.kind, true) && compareDeep(software, o.software, true) + && compareDeep(implementation, o.implementation, true) && compareDeep(fhirVersion, o.fhirVersion, true) + && compareDeep(acceptUnknown, o.acceptUnknown, true) && compareDeep(format, o.format, true) && compareDeep(profile, o.profile, true) + && compareDeep(rest, o.rest, true) && compareDeep(messaging, o.messaging, true) && compareDeep(document, o.document, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Conformance)) + return false; + Conformance o = (Conformance) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) + && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(copyright, o.copyright, true) && compareValues(kind, o.kind, true) && compareValues(fhirVersion, o.fhirVersion, true) + && compareValues(acceptUnknown, o.acceptUnknown, true) && compareValues(format, o.format, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) + && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (requirements == null || requirements.isEmpty()) && (copyright == null || copyright.isEmpty()) + && (kind == null || kind.isEmpty()) && (software == null || software.isEmpty()) && (implementation == null || implementation.isEmpty()) + && (fhirVersion == null || fhirVersion.isEmpty()) && (acceptUnknown == null || acceptUnknown.isEmpty()) + && (format == null || format.isEmpty()) && (profile == null || profile.isEmpty()) && (rest == null || rest.isEmpty()) + && (messaging == null || messaging.isEmpty()) && (document == null || document.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Conformance; + } + + /** + * Search parameter: securityservice + *

+ * Description: OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates
+ * Type: token
+ * Path: Conformance.rest.security.service
+ *

+ */ + @SearchParamDefinition(name="securityservice", path="Conformance.rest.security.service", description="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", type="token" ) + public static final String SP_SECURITYSERVICE = "securityservice"; + /** + * Fluent Client search parameter constant for securityservice + *

+ * Description: OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates
+ * Type: token
+ * Path: Conformance.rest.security.service
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITYSERVICE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITYSERVICE); + + /** + * Search parameter: status + *

+ * Description: The current status of the conformance statement
+ * Type: token
+ * Path: Conformance.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Conformance.status", description="The current status of the conformance statement", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the conformance statement
+ * Type: token
+ * Path: Conformance.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: resource + *

+ * Description: Name of a resource mentioned in a conformance statement
+ * Type: token
+ * Path: Conformance.rest.resource.type
+ *

+ */ + @SearchParamDefinition(name="resource", path="Conformance.rest.resource.type", description="Name of a resource mentioned in a conformance statement", type="token" ) + public static final String SP_RESOURCE = "resource"; + /** + * Fluent Client search parameter constant for resource + *

+ * Description: Name of a resource mentioned in a conformance statement
+ * Type: token
+ * Path: Conformance.rest.resource.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESOURCE); + + /** + * Search parameter: format + *

+ * Description: formats supported (xml | json | mime type)
+ * Type: token
+ * Path: Conformance.format
+ *

+ */ + @SearchParamDefinition(name="format", path="Conformance.format", description="formats supported (xml | json | mime type)", type="token" ) + public static final String SP_FORMAT = "format"; + /** + * Fluent Client search parameter constant for format + *

+ * Description: formats supported (xml | json | mime type)
+ * Type: token
+ * Path: Conformance.format
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMAT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMAT); + + /** + * Search parameter: date + *

+ * Description: The conformance statement publication date
+ * Type: date
+ * Path: Conformance.date
+ *

+ */ + @SearchParamDefinition(name="date", path="Conformance.date", description="The conformance statement publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The conformance statement publication date
+ * Type: date
+ * Path: Conformance.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: url + *

+ * Description: The uri that identifies the conformance statement
+ * Type: uri
+ * Path: Conformance.url
+ *

+ */ + @SearchParamDefinition(name="url", path="Conformance.url", description="The uri that identifies the conformance statement", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: The uri that identifies the conformance statement
+ * Type: uri
+ * Path: Conformance.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the conformance statement
+ * Type: token
+ * Path: Conformance.version
+ *

+ */ + @SearchParamDefinition(name="version", path="Conformance.version", description="The version identifier of the conformance statement", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the conformance statement
+ * Type: token
+ * Path: Conformance.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the conformance statement
+ * Type: string
+ * Path: Conformance.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="Conformance.publisher", description="Name of the publisher of the conformance statement", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the conformance statement
+ * Type: string
+ * Path: Conformance.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: mode + *

+ * Description: Mode - restful (server/client) or messaging (sender/receiver)
+ * Type: token
+ * Path: Conformance.rest.mode
+ *

+ */ + @SearchParamDefinition(name="mode", path="Conformance.rest.mode", description="Mode - restful (server/client) or messaging (sender/receiver)", type="token" ) + public static final String SP_MODE = "mode"; + /** + * Fluent Client search parameter constant for mode + *

+ * Description: Mode - restful (server/client) or messaging (sender/receiver)
+ * Type: token
+ * Path: Conformance.rest.mode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam MODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MODE); + + /** + * Search parameter: resourceprofile + *

+ * Description: A profile id invoked in a conformance statement
+ * Type: reference
+ * Path: Conformance.rest.resource.profile
+ *

+ */ + @SearchParamDefinition(name="resourceprofile", path="Conformance.rest.resource.profile", description="A profile id invoked in a conformance statement", type="reference" ) + public static final String SP_RESOURCEPROFILE = "resourceprofile"; + /** + * Fluent Client search parameter constant for resourceprofile + *

+ * Description: A profile id invoked in a conformance statement
+ * Type: reference
+ * Path: Conformance.rest.resource.profile
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESOURCEPROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESOURCEPROFILE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Conformance:resourceprofile". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RESOURCEPROFILE = new ca.uhn.fhir.model.api.Include("Conformance:resourceprofile").toLocked(); + + /** + * Search parameter: software + *

+ * Description: Part of a the name of a software application
+ * Type: string
+ * Path: Conformance.software.name
+ *

+ */ + @SearchParamDefinition(name="software", path="Conformance.software.name", description="Part of a the name of a software application", type="string" ) + public static final String SP_SOFTWARE = "software"; + /** + * Fluent Client search parameter constant for software + *

+ * Description: Part of a the name of a software application
+ * Type: string
+ * Path: Conformance.software.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam SOFTWARE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SOFTWARE); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the conformance statement
+ * Type: string
+ * Path: Conformance.description
+ *

+ */ + @SearchParamDefinition(name="description", path="Conformance.description", description="Text search in the description of the conformance statement", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the conformance statement
+ * Type: string
+ * Path: Conformance.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: event + *

+ * Description: Event code in a conformance statement
+ * Type: token
+ * Path: Conformance.messaging.event.code
+ *

+ */ + @SearchParamDefinition(name="event", path="Conformance.messaging.event.code", description="Event code in a conformance statement", type="token" ) + public static final String SP_EVENT = "event"; + /** + * Fluent Client search parameter constant for event + *

+ * Description: Event code in a conformance statement
+ * Type: token
+ * Path: Conformance.messaging.event.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT); + + /** + * Search parameter: name + *

+ * Description: Name of the conformance statement
+ * Type: string
+ * Path: Conformance.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Conformance.name", description="Name of the conformance statement", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the conformance statement
+ * Type: string
+ * Path: Conformance.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the conformance statement
+ * Type: token
+ * Path: Conformance.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="Conformance.useContext", description="A use context assigned to the conformance statement", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the conformance statement
+ * Type: token
+ * Path: Conformance.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: supported-profile + *

+ * Description: Profiles for use cases supported
+ * Type: reference
+ * Path: Conformance.profile
+ *

+ */ + @SearchParamDefinition(name="supported-profile", path="Conformance.profile", description="Profiles for use cases supported", type="reference" ) + public static final String SP_SUPPORTED_PROFILE = "supported-profile"; + /** + * Fluent Client search parameter constant for supported-profile + *

+ * Description: Profiles for use cases supported
+ * Type: reference
+ * Path: Conformance.profile
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPORTED_PROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPORTED_PROFILE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Conformance:supported-profile". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPORTED_PROFILE = new ca.uhn.fhir.model.api.Include("Conformance:supported-profile").toLocked(); + + /** + * Search parameter: fhirversion + *

+ * Description: The version of FHIR
+ * Type: token
+ * Path: Conformance.version
+ *

+ */ + @SearchParamDefinition(name="fhirversion", path="Conformance.version", description="The version of FHIR", type="token" ) + public static final String SP_FHIRVERSION = "fhirversion"; + /** + * Fluent Client search parameter constant for fhirversion + *

+ * Description: The version of FHIR
+ * Type: token
+ * Path: Conformance.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FHIRVERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FHIRVERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Constants.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Constants.java new file mode 100644 index 00000000000..9e23286e81c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Constants.java @@ -0,0 +1,40 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 + + +public class Constants { + + public final static String VERSION = "1.4.0"; + public final static String REVISION = "8226"; + public final static String DATE = "Sun May 08 03:05:30 AEST 2016"; +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ContactPoint.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ContactPoint.java new file mode 100644 index 00000000000..bc64dddead0 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ContactPoint.java @@ -0,0 +1,724 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + */ +@DatatypeDef(name="ContactPoint") +public class ContactPoint extends Type implements ICompositeType { + + public enum ContactPointSystem { + /** + * 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. + */ + PHONE, + /** + * The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. + */ + FAX, + /** + * The value is an email address. + */ + EMAIL, + /** + * The value is a pager number. These may be local pager numbers that are only usable on a particular pager system. + */ + PAGER, + /** + * A contact that is not a phone, fax, or email address. The format of the value SHOULD be a URL. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. If this is not a URL, then it will require human interpretation. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static ContactPointSystem fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("phone".equals(codeString)) + return PHONE; + if ("fax".equals(codeString)) + return FAX; + if ("email".equals(codeString)) + return EMAIL; + if ("pager".equals(codeString)) + return PAGER; + if ("other".equals(codeString)) + return OTHER; + throw new FHIRException("Unknown ContactPointSystem code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PHONE: return "phone"; + case FAX: return "fax"; + case EMAIL: return "email"; + case PAGER: return "pager"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PHONE: return "http://hl7.org/fhir/contact-point-system"; + case FAX: return "http://hl7.org/fhir/contact-point-system"; + case EMAIL: return "http://hl7.org/fhir/contact-point-system"; + case PAGER: return "http://hl7.org/fhir/contact-point-system"; + case OTHER: return "http://hl7.org/fhir/contact-point-system"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PHONE: return "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."; + case FAX: return "The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; + case EMAIL: return "The value is an email address."; + case PAGER: return "The value is a pager number. These may be local pager numbers that are only usable on a particular pager system."; + case OTHER: return "A contact that is not a phone, fax, or email address. The format of the value SHOULD be a URL. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. If this is not a URL, then it will require human interpretation."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PHONE: return "Phone"; + case FAX: return "Fax"; + case EMAIL: return "Email"; + case PAGER: return "Pager"; + case OTHER: return "URL"; + default: return "?"; + } + } + } + + 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; + if ("phone".equals(codeString)) + return ContactPointSystem.PHONE; + if ("fax".equals(codeString)) + return ContactPointSystem.FAX; + if ("email".equals(codeString)) + return ContactPointSystem.EMAIL; + if ("pager".equals(codeString)) + return ContactPointSystem.PAGER; + if ("other".equals(codeString)) + return ContactPointSystem.OTHER; + throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("phone".equals(codeString)) + return new Enumeration(this, ContactPointSystem.PHONE); + if ("fax".equals(codeString)) + return new Enumeration(this, ContactPointSystem.FAX); + if ("email".equals(codeString)) + return new Enumeration(this, ContactPointSystem.EMAIL); + if ("pager".equals(codeString)) + return new Enumeration(this, ContactPointSystem.PAGER); + if ("other".equals(codeString)) + return new Enumeration(this, ContactPointSystem.OTHER); + throw new FHIRException("Unknown ContactPointSystem code '"+codeString+"'"); + } + public String toCode(ContactPointSystem code) { + if (code == ContactPointSystem.PHONE) + return "phone"; + if (code == ContactPointSystem.FAX) + return "fax"; + if (code == ContactPointSystem.EMAIL) + return "email"; + if (code == ContactPointSystem.PAGER) + return "pager"; + if (code == ContactPointSystem.OTHER) + return "other"; + return "?"; + } + public String toSystem(ContactPointSystem code) { + return code.getSystem(); + } + } + + public enum ContactPointUse { + /** + * 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. + */ + HOME, + /** + * An office contact point. First choice for business related contacts during business hours. + */ + WORK, + /** + * A temporary contact point. The period can provide more detailed information. + */ + TEMP, + /** + * This contact point is no longer in use (or was never correct, but retained for records). + */ + OLD, + /** + * A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business. + */ + MOBILE, + /** + * added to help the parsers + */ + NULL; + public static ContactPointUse fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return HOME; + if ("work".equals(codeString)) + return WORK; + if ("temp".equals(codeString)) + return TEMP; + if ("old".equals(codeString)) + return OLD; + if ("mobile".equals(codeString)) + return MOBILE; + throw new FHIRException("Unknown ContactPointUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HOME: return "home"; + case WORK: return "work"; + case TEMP: return "temp"; + case OLD: return "old"; + case MOBILE: return "mobile"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HOME: return "http://hl7.org/fhir/contact-point-use"; + case WORK: return "http://hl7.org/fhir/contact-point-use"; + case TEMP: return "http://hl7.org/fhir/contact-point-use"; + case OLD: return "http://hl7.org/fhir/contact-point-use"; + case MOBILE: return "http://hl7.org/fhir/contact-point-use"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HOME: return "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."; + case WORK: return "An office contact point. First choice for business related contacts during business hours."; + case TEMP: return "A temporary contact point. The period can provide more detailed information."; + case OLD: return "This contact point is no longer in use (or was never correct, but retained for records)."; + case MOBILE: return "A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HOME: return "Home"; + case WORK: return "Work"; + case TEMP: return "Temp"; + case OLD: return "Old"; + case MOBILE: return "Mobile"; + default: return "?"; + } + } + } + + 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; + if ("home".equals(codeString)) + return ContactPointUse.HOME; + if ("work".equals(codeString)) + return ContactPointUse.WORK; + if ("temp".equals(codeString)) + return ContactPointUse.TEMP; + if ("old".equals(codeString)) + return ContactPointUse.OLD; + if ("mobile".equals(codeString)) + return ContactPointUse.MOBILE; + throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return new Enumeration(this, ContactPointUse.HOME); + if ("work".equals(codeString)) + return new Enumeration(this, ContactPointUse.WORK); + if ("temp".equals(codeString)) + return new Enumeration(this, ContactPointUse.TEMP); + if ("old".equals(codeString)) + return new Enumeration(this, ContactPointUse.OLD); + if ("mobile".equals(codeString)) + return new Enumeration(this, ContactPointUse.MOBILE); + throw new FHIRException("Unknown ContactPointUse code '"+codeString+"'"); + } + public String toCode(ContactPointUse code) { + if (code == ContactPointUse.HOME) + return "home"; + if (code == ContactPointUse.WORK) + return "work"; + if (code == ContactPointUse.TEMP) + return "temp"; + if (code == ContactPointUse.OLD) + return "old"; + if (code == ContactPointUse.MOBILE) + return "mobile"; + return "?"; + } + public String toSystem(ContactPointUse code) { + return code.getSystem(); + } + } + + /** + * Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + @Child(name = "system", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="phone | fax | email | pager | other", formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact." ) + protected Enumeration system; + + /** + * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + @Child(name = "value", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The actual contact point details", formalDefinition="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." ) + protected StringType value; + + /** + * Identifies the purpose for the contact point. + */ + @Child(name = "use", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="home | work | temp | old | mobile - purpose of this contact point", formalDefinition="Identifies the purpose for the contact point." ) + protected Enumeration use; + + /** + * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values. + */ + @Child(name = "rank", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specify preferred order of use (1 = highest)", formalDefinition="Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values." ) + protected PositiveIntType rank; + + /** + * Time period when the contact point was/is in use. + */ + @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time period when the contact point was/is in use", formalDefinition="Time period when the contact point was/is in use." ) + protected Period period; + + private static final long serialVersionUID = 1509610874L; + + /** + * Constructor + */ + public ContactPoint() { + super(); + } + + /** + * @return {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Enumeration getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.system"); + else if (Configuration.doAutoCreate()) + this.system = new Enumeration(new ContactPointSystemEnumFactory()); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ContactPoint setSystemElement(Enumeration value) { + this.system = value; + return this; + } + + /** + * @return Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + public ContactPointSystem getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + public ContactPoint setSystem(ContactPointSystem value) { + if (value == null) + this.system = null; + else { + if (this.system == null) + this.system = new Enumeration(new ContactPointSystemEnumFactory()); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ContactPoint setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + public ContactPoint setValue(String value) { + if (Utilities.noString(value)) + this.value = null; + else { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (Identifies the purpose for the contact point.). 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 ContactPoint.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new ContactPointUseEnumFactory()); // bb + 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} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public ContactPoint setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Identifies the purpose for the contact point. + */ + public ContactPointUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Identifies the purpose for the contact point. + */ + public ContactPoint setUse(ContactPointUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new ContactPointUseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #rank} (Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values.). This is the underlying object with id, value and extensions. The accessor "getRank" gives direct access to the value + */ + public PositiveIntType getRankElement() { + if (this.rank == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.rank"); + else if (Configuration.doAutoCreate()) + this.rank = new PositiveIntType(); // bb + return this.rank; + } + + public boolean hasRankElement() { + return this.rank != null && !this.rank.isEmpty(); + } + + public boolean hasRank() { + return this.rank != null && !this.rank.isEmpty(); + } + + /** + * @param value {@link #rank} (Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values.). This is the underlying object with id, value and extensions. The accessor "getRank" gives direct access to the value + */ + public ContactPoint setRankElement(PositiveIntType value) { + this.rank = value; + return this; + } + + /** + * @return Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values. + */ + public int getRank() { + return this.rank == null || this.rank.isEmpty() ? 0 : this.rank.getValue(); + } + + /** + * @param value Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values. + */ + public ContactPoint setRank(int value) { + if (this.rank == null) + this.rank = new PositiveIntType(); + this.rank.setValue(value); + return this; + } + + /** + * @return {@link #period} (Time period when the contact point was/is in use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period when the contact point was/is in use.) + */ + public ContactPoint setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "code", "Telecommunications form for contact point - what communications system is required to make use of the contact.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("value", "string", "The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("use", "code", "Identifies the purpose for the contact point.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("rank", "positiveInt", "Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values.", 0, java.lang.Integer.MAX_VALUE, rank)); + childrenList.add(new Property("period", "Period", "Time period when the contact point was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // Enumeration + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration + case 3492908: /*rank*/ return this.rank == null ? new Base[0] : new Base[] {this.rank}; // PositiveIntType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -887328209: // system + this.system = new ContactPointSystemEnumFactory().fromType(value); // Enumeration + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + case 116103: // use + this.use = new ContactPointUseEnumFactory().fromType(value); // Enumeration + break; + case 3492908: // rank + this.rank = castToPositiveInt(value); // PositiveIntType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("system")) + this.system = new ContactPointSystemEnumFactory().fromType(value); // Enumeration + else if (name.equals("value")) + this.value = castToString(value); // StringType + else if (name.equals("use")) + this.use = new ContactPointUseEnumFactory().fromType(value); // Enumeration + else if (name.equals("rank")) + this.rank = castToPositiveInt(value); // PositiveIntType + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // Enumeration + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration + case 3492908: throw new FHIRException("Cannot make property rank as it is not a complex type"); // PositiveIntType + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type ContactPoint.system"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ContactPoint.value"); + } + else if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type ContactPoint.use"); + } + else if (name.equals("rank")) { + throw new FHIRException("Cannot call addChild on a primitive type ContactPoint.rank"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ContactPoint"; + + } + + public ContactPoint copy() { + ContactPoint dst = new ContactPoint(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.value = value == null ? null : value.copy(); + dst.use = use == null ? null : use.copy(); + dst.rank = rank == null ? null : rank.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected ContactPoint typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ContactPoint)) + return false; + ContactPoint o = (ContactPoint) other; + return compareDeep(system, o.system, true) && compareDeep(value, o.value, true) && compareDeep(use, o.use, true) + && compareDeep(rank, o.rank, true) && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ContactPoint)) + return false; + ContactPoint o = (ContactPoint) other; + return compareValues(system, o.system, true) && compareValues(value, o.value, true) && compareValues(use, o.use, true) + && compareValues(rank, o.rank, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) + && (use == null || use.isEmpty()) && (rank == null || rank.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Contract.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Contract.java new file mode 100644 index 00000000000..0a2260ea600 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Contract.java @@ -0,0 +1,4811 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + */ +@ResourceDef(name="Contract", profile="http://hl7.org/fhir/Profile/Contract") +public class Contract extends DomainResource { + + @Block() + public static class AgentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Who or what parties are assigned roles in this Contract. + */ + @Child(name = "actor", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Agent Type", formalDefinition="Who or what parties are assigned roles in this Contract." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (Who or what parties are assigned roles in this Contract.) + */ + protected Resource actorTarget; + + /** + * Role type of agent assigned roles in this Contract. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Agent Role", formalDefinition="Role type of agent assigned roles in this Contract." ) + protected List role; + + private static final long serialVersionUID = -454551165L; + + /** + * Constructor + */ + public AgentComponent() { + super(); + } + + /** + * Constructor + */ + public AgentComponent(Reference actor) { + super(); + this.actor = actor; + } + + /** + * @return {@link #actor} (Who or what parties are assigned roles in this Contract.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AgentComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (Who or what parties are assigned roles in this Contract.) + */ + public AgentComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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. (Who or what parties are assigned roles in this Contract.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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. (Who or what parties are assigned roles in this Contract.) + */ + public AgentComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #role} (Role type of agent assigned roles in this Contract.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Role type of agent assigned roles in this Contract.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + // syntactic sugar + public AgentComponent addRole(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("actor", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance)", "Who or what parties are assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("role", "CodeableConcept", "Role type of agent assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, role)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference + case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 92645877: // actor + this.actor = castToReference(value); // Reference + break; + case 3506294: // role + this.getRole().add(castToCodeableConcept(value)); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("actor")) + this.actor = castToReference(value); // Reference + else if (name.equals("role")) + this.getRole().add(castToCodeableConcept(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 92645877: return getActor(); // Reference + case 3506294: return addRole(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("actor")) { + this.actor = new Reference(); + return this.actor; + } + else if (name.equals("role")) { + return addRole(); + } + else + return super.addChild(name); + } + + public AgentComponent copy() { + AgentComponent dst = new AgentComponent(); + copyValues(dst); + dst.actor = actor == null ? null : actor.copy(); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AgentComponent)) + return false; + AgentComponent o = (AgentComponent) other; + return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AgentComponent)) + return false; + AgentComponent o = (AgentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (actor == null || actor.isEmpty()) && (role == null || role.isEmpty()) + ; + } + + public String fhirType() { + return "Contract.agent"; + + } + + } + + @Block() + public static class SignatoryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Role of this Contract signer, e.g. notary, grantee. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Signer Type", formalDefinition="Role of this Contract signer, e.g. notary, grantee." ) + protected Coding type; + + /** + * Party which is a signator to this Contract. + */ + @Child(name = "party", type = {Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Signatory Party", formalDefinition="Party which is a signator to this Contract." ) + protected Reference party; + + /** + * The actual object that is the target of the reference (Party which is a signator to this Contract.) + */ + protected Resource partyTarget; + + /** + * Legally binding Contract DSIG signature contents in Base64. + */ + @Child(name = "signature", type = {Signature.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Documentation Signature", formalDefinition="Legally binding Contract DSIG signature contents in Base64." ) + protected List signature; + + private static final long serialVersionUID = 1948139228L; + + /** + * Constructor + */ + public SignatoryComponent() { + super(); + } + + /** + * Constructor + */ + public SignatoryComponent(Coding type, Reference party) { + super(); + this.type = type; + this.party = party; + } + + /** + * @return {@link #type} (Role of this Contract signer, e.g. notary, grantee.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SignatoryComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Role of this Contract signer, e.g. notary, grantee.) + */ + public SignatoryComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #party} (Party which is a signator to this Contract.) + */ + public Reference getParty() { + if (this.party == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SignatoryComponent.party"); + else if (Configuration.doAutoCreate()) + this.party = new Reference(); // cc + return this.party; + } + + public boolean hasParty() { + return this.party != null && !this.party.isEmpty(); + } + + /** + * @param value {@link #party} (Party which is a signator to this Contract.) + */ + public SignatoryComponent setParty(Reference value) { + this.party = value; + return this; + } + + /** + * @return {@link #party} 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. (Party which is a signator to this Contract.) + */ + public Resource getPartyTarget() { + return this.partyTarget; + } + + /** + * @param value {@link #party} 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. (Party which is a signator to this Contract.) + */ + public SignatoryComponent setPartyTarget(Resource value) { + this.partyTarget = value; + return this; + } + + /** + * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.) + */ + public List getSignature() { + if (this.signature == null) + this.signature = new ArrayList(); + return this.signature; + } + + public boolean hasSignature() { + if (this.signature == null) + return false; + for (Signature item : this.signature) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.) + */ + // syntactic sugar + public Signature addSignature() { //3 + Signature t = new Signature(); + if (this.signature == null) + this.signature = new ArrayList(); + this.signature.add(t); + return t; + } + + // syntactic sugar + public SignatoryComponent addSignature(Signature t) { //3 + if (t == null) + return this; + if (this.signature == null) + this.signature = new ArrayList(); + this.signature.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Role of this Contract signer, e.g. notary, grantee.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("party", "Reference(Organization|Patient|Practitioner|RelatedPerson)", "Party which is a signator to this Contract.", 0, java.lang.Integer.MAX_VALUE, party)); + childrenList.add(new Property("signature", "Signature", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference + case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : this.signature.toArray(new Base[this.signature.size()]); // Signature + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 106437350: // party + this.party = castToReference(value); // Reference + break; + case 1073584312: // signature + this.getSignature().add(castToSignature(value)); // Signature + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("party")) + this.party = castToReference(value); // Reference + else if (name.equals("signature")) + this.getSignature().add(castToSignature(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 106437350: return getParty(); // Reference + case 1073584312: return addSignature(); // Signature + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("party")) { + this.party = new Reference(); + return this.party; + } + else if (name.equals("signature")) { + return addSignature(); + } + else + return super.addChild(name); + } + + public SignatoryComponent copy() { + SignatoryComponent dst = new SignatoryComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.party = party == null ? null : party.copy(); + if (signature != null) { + dst.signature = new ArrayList(); + for (Signature i : signature) + dst.signature.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SignatoryComponent)) + return false; + SignatoryComponent o = (SignatoryComponent) other; + return compareDeep(type, o.type, true) && compareDeep(party, o.party, true) && compareDeep(signature, o.signature, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SignatoryComponent)) + return false; + SignatoryComponent o = (SignatoryComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty()) + && (signature == null || signature.isEmpty()); + } + + public String fhirType() { + return "Contract.signer"; + + } + + } + + @Block() + public static class ValuedItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specific type of Contract Valued Item that may be priced. + */ + @Child(name = "entity", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Valued Item Type", formalDefinition="Specific type of Contract Valued Item that may be priced." ) + protected Type entity; + + /** + * Identifies a Contract Valued Item instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Valued Item Identifier", formalDefinition="Identifies a Contract Valued Item instance." ) + protected Identifier identifier; + + /** + * Indicates the time during which this Contract ValuedItem information is effective. + */ + @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract ValuedItem information is effective." ) + protected DateTimeType effectiveTime; + + /** + * Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Count of Contract Valued Items", formalDefinition="Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances." ) + protected SimpleQuantity quantity; + + /** + * A Contract Valued Item unit valuation measure. + */ + @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Valued Item fee, charge, or cost", formalDefinition="A Contract Valued Item unit valuation measure." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. 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, modifier=false, summary=false) + @Description(shortDefinition="Contract Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. 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 Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. + */ + @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. 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, modifier=false, summary=false) + @Description(shortDefinition="Total Contract Valued Item Value", formalDefinition="Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. 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 = 1782449516L; + + /** + * Constructor + */ + public ValuedItemComponent() { + super(); + } + + /** + * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) + */ + public Type getEntity() { + return this.entity; + } + + /** + * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) + */ + public CodeableConcept getEntityCodeableConcept() throws FHIRException { + if (!(this.entity instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered"); + return (CodeableConcept) this.entity; + } + + public boolean hasEntityCodeableConcept() { + return this.entity instanceof CodeableConcept; + } + + /** + * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) + */ + public Reference getEntityReference() throws FHIRException { + if (!(this.entity instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered"); + return (Reference) this.entity; + } + + public boolean hasEntityReference() { + return this.entity instanceof Reference; + } + + public boolean hasEntity() { + return this.entity != null && !this.entity.isEmpty(); + } + + /** + * @param value {@link #entity} (Specific type of Contract Valued Item that may be priced.) + */ + public ValuedItemComponent setEntity(Type value) { + this.entity = value; + return this; + } + + /** + * @return {@link #identifier} (Identifies a Contract Valued Item instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifies a Contract Valued Item instance.) + */ + public ValuedItemComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value + */ + public DateTimeType getEffectiveTimeElement() { + if (this.effectiveTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.effectiveTime"); + else if (Configuration.doAutoCreate()) + this.effectiveTime = new DateTimeType(); // bb + return this.effectiveTime; + } + + public boolean hasEffectiveTimeElement() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + public boolean hasEffectiveTime() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + /** + * @param value {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value + */ + public ValuedItemComponent setEffectiveTimeElement(DateTimeType value) { + this.effectiveTime = value; + return this; + } + + /** + * @return Indicates the time during which this Contract ValuedItem information is effective. + */ + public Date getEffectiveTime() { + return this.effectiveTime == null ? null : this.effectiveTime.getValue(); + } + + /** + * @param value Indicates the time during which this Contract ValuedItem information is effective. + */ + public ValuedItemComponent setEffectiveTime(Date value) { + if (value == null) + this.effectiveTime = null; + else { + if (this.effectiveTime == null) + this.effectiveTime = new DateTimeType(); + this.effectiveTime.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.) + */ + public ValuedItemComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (A Contract Valued Item unit valuation measure.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValuedItemComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (A Contract Valued Item unit valuation measure.) + */ + public ValuedItemComponent 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 the Contract Valued Item delivered. 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 ValuedItemComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + 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 the Contract Valued Item delivered. 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 ValuedItemComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. 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 the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ValuedItemComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ValuedItemComponent setFactor(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ValuedItemComponent setFactor(double value) { + 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 Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, 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 ValuedItemComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); // bb + 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 Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, 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 ValuedItemComponent 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 Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, 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 Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. + */ + public ValuedItemComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. + */ + public ValuedItemComponent setPoints(long value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. + */ + public ValuedItemComponent setPoints(double value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @return {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. 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 ValuedItemComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); // cc + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. 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 ValuedItemComponent setNet(Money value) { + this.net = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); + childrenList.add(new Property("quantity", "SimpleQuantity", "Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 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 the Contract Valued Item delivered. 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 Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Type + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // DateTimeType + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType + case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1298275357: // entity + this.entity = (Type) value; // Type + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -929905388: // effectiveTime + this.effectiveTime = castToDateTime(value); // DateTimeType + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -486196699: // unitPrice + this.unitPrice = castToMoney(value); // Money + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case -982754077: // points + this.points = castToDecimal(value); // DecimalType + break; + case 108957: // net + this.net = castToMoney(value); // Money + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("entity[x]")) + this.entity = (Type) value; // Type + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("effectiveTime")) + this.effectiveTime = castToDateTime(value); // DateTimeType + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("unitPrice")) + this.unitPrice = castToMoney(value); // Money + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("points")) + this.points = castToDecimal(value); // DecimalType + else if (name.equals("net")) + this.net = castToMoney(value); // Money + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -740568643: return getEntity(); // Type + case -1618432855: return getIdentifier(); // Identifier + case -929905388: throw new FHIRException("Cannot make property effectiveTime as it is not a complex type"); // DateTimeType + case -1285004149: return getQuantity(); // SimpleQuantity + case -486196699: return getUnitPrice(); // Money + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType + case 108957: return getNet(); // Money + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("entityCodeableConcept")) { + this.entity = new CodeableConcept(); + return this.entity; + } + else if (name.equals("entityReference")) { + this.entity = new Reference(); + return this.entity; + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("effectiveTime")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.effectiveTime"); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("unitPrice")) { + this.unitPrice = new Money(); + return this.unitPrice; + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.factor"); + } + else if (name.equals("points")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.points"); + } + else if (name.equals("net")) { + this.net = new Money(); + return this.net; + } + else + return super.addChild(name); + } + + public ValuedItemComponent copy() { + ValuedItemComponent dst = new ValuedItemComponent(); + copyValues(dst); + dst.entity = entity == null ? null : entity.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.effectiveTime = effectiveTime == null ? null : effectiveTime.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; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValuedItemComponent)) + return false; + ValuedItemComponent o = (ValuedItemComponent) other; + return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(points, o.points, true) && compareDeep(net, o.net, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValuedItemComponent)) + return false; + ValuedItemComponent o = (ValuedItemComponent) other; + return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true) + && compareValues(points, o.points, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (entity == null || entity.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (effectiveTime == null || effectiveTime.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) + && (net == null || net.isEmpty()); + } + + public String fhirType() { + return "Contract.valuedItem"; + + } + + } + + @Block() + public static class TermComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Unique identifier for this particular Contract Provision. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contract Term identifier", formalDefinition="Unique identifier for this particular Contract Provision." ) + protected Identifier identifier; + + /** + * When this Contract Provision was issued. + */ + @Child(name = "issued", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contract Term Issue Date Time", formalDefinition="When this Contract Provision was issued." ) + protected DateTimeType issued; + + /** + * Relevant time or time-period when this Contract Provision is applicable. + */ + @Child(name = "applies", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contract Term Effective Time", formalDefinition="Relevant time or time-period when this Contract Provision is applicable." ) + protected Period applies; + + /** + * Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Type", formalDefinition="Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit." ) + protected CodeableConcept type; + + /** + * Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment. + */ + @Child(name = "subType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Subtype", formalDefinition="Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment." ) + protected CodeableConcept subType; + + /** + * The matter of concern in the context of this provision of the agrement. + */ + @Child(name = "topic", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Context of the Contract term", formalDefinition="The matter of concern in the context of this provision of the agrement." ) + protected List topic; + /** + * The actual objects that are the target of the reference (The matter of concern in the context of this provision of the agrement.) + */ + protected List topicTarget; + + + /** + * Action stipulated by this Contract Provision. + */ + @Child(name = "action", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Action", formalDefinition="Action stipulated by this Contract Provision." ) + protected List action; + + /** + * Reason or purpose for the action stipulated by this Contract Provision. + */ + @Child(name = "actionReason", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Action Reason", formalDefinition="Reason or purpose for the action stipulated by this Contract Provision." ) + protected List actionReason; + + /** + * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. + */ + @Child(name = "agent", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Agent List", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." ) + protected List agent; + + /** + * Human readable form of this Contract Provision. + */ + @Child(name = "text", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Human readable Contract term text", formalDefinition="Human readable form of this Contract Provision." ) + protected StringType text; + + /** + * Contract Provision Valued Item List. + */ + @Child(name = "valuedItem", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Valued Item", formalDefinition="Contract Provision Valued Item List." ) + protected List valuedItem; + + /** + * Nested group of Contract Provisions. + */ + @Child(name = "group", type = {TermComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Nested Contract Term Group", formalDefinition="Nested group of Contract Provisions." ) + protected List group; + + private static final long serialVersionUID = -1949614999L; + + /** + * Constructor + */ + public TermComponent() { + super(); + } + + /** + * @return {@link #identifier} (Unique identifier for this particular Contract Provision.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique identifier for this particular Contract Provision.) + */ + public TermComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #issued} (When this Contract Provision 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 TermComponent.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); // bb + 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 Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public TermComponent setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return When this Contract Provision was issued. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value When this Contract Provision was issued. + */ + public TermComponent 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 or time-period when this Contract Provision is applicable.) + */ + public Period getApplies() { + if (this.applies == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.applies"); + else if (Configuration.doAutoCreate()) + this.applies = new Period(); // cc + return this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.) + */ + public TermComponent setApplies(Period value) { + this.applies = value; + return this; + } + + /** + * @return {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.) + */ + public TermComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subType} (Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.) + */ + public CodeableConcept getSubType() { + if (this.subType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.subType"); + else if (Configuration.doAutoCreate()) + this.subType = new CodeableConcept(); // cc + return this.subType; + } + + public boolean hasSubType() { + return this.subType != null && !this.subType.isEmpty(); + } + + /** + * @param value {@link #subType} (Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.) + */ + public TermComponent setSubType(CodeableConcept value) { + this.subType = value; + return this; + } + + /** + * @return {@link #topic} (The matter of concern in the context of this provision of the agrement.) + */ + public List getTopic() { + if (this.topic == null) + this.topic = new ArrayList(); + return this.topic; + } + + public boolean hasTopic() { + if (this.topic == null) + return false; + for (Reference item : this.topic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #topic} (The matter of concern in the context of this provision of the agrement.) + */ + // syntactic sugar + public Reference addTopic() { //3 + Reference t = new Reference(); + if (this.topic == null) + this.topic = new ArrayList(); + this.topic.add(t); + return t; + } + + // syntactic sugar + public TermComponent addTopic(Reference t) { //3 + if (t == null) + return this; + if (this.topic == null) + this.topic = new ArrayList(); + this.topic.add(t); + return this; + } + + /** + * @return {@link #topic} (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 matter of concern in the context of this provision of the agrement.) + */ + public List getTopicTarget() { + if (this.topicTarget == null) + this.topicTarget = new ArrayList(); + return this.topicTarget; + } + + /** + * @return {@link #action} (Action stipulated by this Contract Provision.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (CodeableConcept item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Action stipulated by this Contract Provision.) + */ + // syntactic sugar + public CodeableConcept addAction() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public TermComponent addAction(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + /** + * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.) + */ + public List getActionReason() { + if (this.actionReason == null) + this.actionReason = new ArrayList(); + return this.actionReason; + } + + public boolean hasActionReason() { + if (this.actionReason == null) + return false; + for (CodeableConcept item : this.actionReason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.) + */ + // syntactic sugar + public CodeableConcept addActionReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.actionReason == null) + this.actionReason = new ArrayList(); + this.actionReason.add(t); + return t; + } + + // syntactic sugar + public TermComponent addActionReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.actionReason == null) + this.actionReason = new ArrayList(); + this.actionReason.add(t); + return this; + } + + /** + * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) + */ + public List getAgent() { + if (this.agent == null) + this.agent = new ArrayList(); + return this.agent; + } + + public boolean hasAgent() { + if (this.agent == null) + return false; + for (TermAgentComponent item : this.agent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) + */ + // syntactic sugar + public TermAgentComponent addAgent() { //3 + TermAgentComponent t = new TermAgentComponent(); + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return t; + } + + // syntactic sugar + public TermComponent addAgent(TermAgentComponent t) { //3 + if (t == null) + return this; + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return this; + } + + /** + * @return {@link #text} (Human readable form of this Contract Provision.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Human readable form of this Contract Provision.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public TermComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Human readable form of this Contract Provision. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Human readable form of this Contract Provision. + */ + public TermComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #valuedItem} (Contract Provision Valued Item List.) + */ + public List getValuedItem() { + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + return this.valuedItem; + } + + public boolean hasValuedItem() { + if (this.valuedItem == null) + return false; + for (TermValuedItemComponent item : this.valuedItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valuedItem} (Contract Provision Valued Item List.) + */ + // syntactic sugar + public TermValuedItemComponent addValuedItem() { //3 + TermValuedItemComponent t = new TermValuedItemComponent(); + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + this.valuedItem.add(t); + return t; + } + + // syntactic sugar + public TermComponent addValuedItem(TermValuedItemComponent t) { //3 + if (t == null) + return this; + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + this.valuedItem.add(t); + return this; + } + + /** + * @return {@link #group} (Nested group of Contract Provisions.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (TermComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (Nested group of Contract Provisions.) + */ + // syntactic sugar + public TermComponent addGroup() { //3 + TermComponent t = new TermComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public TermComponent addGroup(TermComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("type", "CodeableConcept", "Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subType", "CodeableConcept", "Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.", 0, java.lang.Integer.MAX_VALUE, subType)); + childrenList.add(new Property("topic", "Reference(Any)", "The matter of concern in the context of this provision of the agrement.", 0, java.lang.Integer.MAX_VALUE, topic)); + childrenList.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("actionReason", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actionReason)); + childrenList.add(new Property("agent", "", "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, agent)); + childrenList.add(new Property("text", "string", "Human readable form of this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("valuedItem", "", "Contract Provision Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem)); + childrenList.add(new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType + case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : new Base[] {this.subType}; // CodeableConcept + case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // Reference + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // CodeableConcept + case 1465121818: /*actionReason*/ return this.actionReason == null ? new Base[0] : this.actionReason.toArray(new Base[this.actionReason.size()]); // CodeableConcept + case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // TermAgentComponent + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + case 2046675654: /*valuedItem*/ return this.valuedItem == null ? new Base[0] : this.valuedItem.toArray(new Base[this.valuedItem.size()]); // TermValuedItemComponent + case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // TermComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -1179159893: // issued + this.issued = castToDateTime(value); // DateTimeType + break; + case -793235316: // applies + this.applies = castToPeriod(value); // Period + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1868521062: // subType + this.subType = castToCodeableConcept(value); // CodeableConcept + break; + case 110546223: // topic + this.getTopic().add(castToReference(value)); // Reference + break; + case -1422950858: // action + this.getAction().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1465121818: // actionReason + this.getActionReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 92750597: // agent + this.getAgent().add((TermAgentComponent) value); // TermAgentComponent + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + case 2046675654: // valuedItem + this.getValuedItem().add((TermValuedItemComponent) value); // TermValuedItemComponent + break; + case 98629247: // group + this.getGroup().add((TermComponent) value); // TermComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("issued")) + this.issued = castToDateTime(value); // DateTimeType + else if (name.equals("applies")) + this.applies = castToPeriod(value); // Period + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subType")) + this.subType = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("topic")) + this.getTopic().add(castToReference(value)); + else if (name.equals("action")) + this.getAction().add(castToCodeableConcept(value)); + else if (name.equals("actionReason")) + this.getActionReason().add(castToCodeableConcept(value)); + else if (name.equals("agent")) + this.getAgent().add((TermAgentComponent) value); + else if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("valuedItem")) + this.getValuedItem().add((TermValuedItemComponent) value); + else if (name.equals("group")) + this.getGroup().add((TermComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // DateTimeType + case -793235316: return getApplies(); // Period + case 3575610: return getType(); // CodeableConcept + case -1868521062: return getSubType(); // CodeableConcept + case 110546223: return addTopic(); // Reference + case -1422950858: return addAction(); // CodeableConcept + case 1465121818: return addActionReason(); // CodeableConcept + case 92750597: return addAgent(); // TermAgentComponent + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case 2046675654: return addValuedItem(); // TermValuedItemComponent + case 98629247: return addGroup(); // TermComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("issued")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.issued"); + } + else if (name.equals("applies")) { + this.applies = new Period(); + return this.applies; + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("subType")) { + this.subType = new CodeableConcept(); + return this.subType; + } + else if (name.equals("topic")) { + return addTopic(); + } + else if (name.equals("action")) { + return addAction(); + } + else if (name.equals("actionReason")) { + return addActionReason(); + } + else if (name.equals("agent")) { + return addAgent(); + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.text"); + } + else if (name.equals("valuedItem")) { + return addValuedItem(); + } + else if (name.equals("group")) { + return addGroup(); + } + else + return super.addChild(name); + } + + public TermComponent copy() { + TermComponent dst = new TermComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.applies = applies == null ? null : applies.copy(); + dst.type = type == null ? null : type.copy(); + dst.subType = subType == null ? null : subType.copy(); + if (topic != null) { + dst.topic = new ArrayList(); + for (Reference i : topic) + dst.topic.add(i.copy()); + }; + if (action != null) { + dst.action = new ArrayList(); + for (CodeableConcept i : action) + dst.action.add(i.copy()); + }; + if (actionReason != null) { + dst.actionReason = new ArrayList(); + for (CodeableConcept i : actionReason) + dst.actionReason.add(i.copy()); + }; + if (agent != null) { + dst.agent = new ArrayList(); + for (TermAgentComponent i : agent) + dst.agent.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + if (valuedItem != null) { + dst.valuedItem = new ArrayList(); + for (TermValuedItemComponent i : valuedItem) + dst.valuedItem.add(i.copy()); + }; + if (group != null) { + dst.group = new ArrayList(); + for (TermComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TermComponent)) + return false; + TermComponent o = (TermComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) + && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(topic, o.topic, true) + && compareDeep(action, o.action, true) && compareDeep(actionReason, o.actionReason, true) && compareDeep(agent, o.agent, true) + && compareDeep(text, o.text, true) && compareDeep(valuedItem, o.valuedItem, true) && compareDeep(group, o.group, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TermComponent)) + return false; + TermComponent o = (TermComponent) other; + return compareValues(issued, o.issued, true) && compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (issued == null || issued.isEmpty()) + && (applies == null || applies.isEmpty()) && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty()) + && (topic == null || topic.isEmpty()) && (action == null || action.isEmpty()) && (actionReason == null || actionReason.isEmpty()) + && (agent == null || agent.isEmpty()) && (text == null || text.isEmpty()) && (valuedItem == null || valuedItem.isEmpty()) + && (group == null || group.isEmpty()); + } + + public String fhirType() { + return "Contract.term"; + + } + + } + + @Block() + public static class TermAgentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The agent assigned a role in this Contract Provision. + */ + @Child(name = "actor", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Agent List", formalDefinition="The agent assigned a role in this Contract Provision." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The agent assigned a role in this Contract Provision.) + */ + protected Resource actorTarget; + + /** + * Role played by the agent assigned this role in the execution of this Contract Provision. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Agent Role", formalDefinition="Role played by the agent assigned this role in the execution of this Contract Provision." ) + protected List role; + + private static final long serialVersionUID = -454551165L; + + /** + * Constructor + */ + public TermAgentComponent() { + super(); + } + + /** + * Constructor + */ + public TermAgentComponent(Reference actor) { + super(); + this.actor = actor; + } + + /** + * @return {@link #actor} (The agent assigned a role in this Contract Provision.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermAgentComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The agent assigned a role in this Contract Provision.) + */ + public TermAgentComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 agent assigned a role in this Contract Provision.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 agent assigned a role in this Contract Provision.) + */ + public TermAgentComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #role} (Role played by the agent assigned this role in the execution of this Contract Provision.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Role played by the agent assigned this role in the execution of this Contract Provision.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + // syntactic sugar + public TermAgentComponent addRole(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("actor", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance)", "The agent assigned a role in this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("role", "CodeableConcept", "Role played by the agent assigned this role in the execution of this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, role)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference + case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 92645877: // actor + this.actor = castToReference(value); // Reference + break; + case 3506294: // role + this.getRole().add(castToCodeableConcept(value)); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("actor")) + this.actor = castToReference(value); // Reference + else if (name.equals("role")) + this.getRole().add(castToCodeableConcept(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 92645877: return getActor(); // Reference + case 3506294: return addRole(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("actor")) { + this.actor = new Reference(); + return this.actor; + } + else if (name.equals("role")) { + return addRole(); + } + else + return super.addChild(name); + } + + public TermAgentComponent copy() { + TermAgentComponent dst = new TermAgentComponent(); + copyValues(dst); + dst.actor = actor == null ? null : actor.copy(); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TermAgentComponent)) + return false; + TermAgentComponent o = (TermAgentComponent) other; + return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TermAgentComponent)) + return false; + TermAgentComponent o = (TermAgentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (actor == null || actor.isEmpty()) && (role == null || role.isEmpty()) + ; + } + + public String fhirType() { + return "Contract.term.agent"; + + } + + } + + @Block() + public static class TermValuedItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specific type of Contract Provision Valued Item that may be priced. + */ + @Child(name = "entity", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Valued Item Type", formalDefinition="Specific type of Contract Provision Valued Item that may be priced." ) + protected Type entity; + + /** + * Identifies a Contract Provision Valued Item instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Valued Item Identifier", formalDefinition="Identifies a Contract Provision Valued Item instance." ) + protected Identifier identifier; + + /** + * Indicates the time during which this Contract Term ValuedItem information is effective. + */ + @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract Term ValuedItem information is effective." ) + protected DateTimeType effectiveTime; + + /** + * Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Valued Item Count", formalDefinition="Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances." ) + protected SimpleQuantity quantity; + + /** + * A Contract Provision Valued Item unit valuation measure. + */ + @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Valued Item fee, charge, or cost", formalDefinition="A Contract Provision Valued Item unit valuation measure." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. 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, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. 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 Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. + */ + @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Term Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. 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, modifier=false, summary=false) + @Description(shortDefinition="Total Contract Term Valued Item Value", formalDefinition="Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. 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 = 1782449516L; + + /** + * Constructor + */ + public TermValuedItemComponent() { + super(); + } + + /** + * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) + */ + public Type getEntity() { + return this.entity; + } + + /** + * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) + */ + public CodeableConcept getEntityCodeableConcept() throws FHIRException { + if (!(this.entity instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered"); + return (CodeableConcept) this.entity; + } + + public boolean hasEntityCodeableConcept() { + return this.entity instanceof CodeableConcept; + } + + /** + * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) + */ + public Reference getEntityReference() throws FHIRException { + if (!(this.entity instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered"); + return (Reference) this.entity; + } + + public boolean hasEntityReference() { + return this.entity instanceof Reference; + } + + public boolean hasEntity() { + return this.entity != null && !this.entity.isEmpty(); + } + + /** + * @param value {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) + */ + public TermValuedItemComponent setEntity(Type value) { + this.entity = value; + return this; + } + + /** + * @return {@link #identifier} (Identifies a Contract Provision Valued Item instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifies a Contract Provision Valued Item instance.) + */ + public TermValuedItemComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #effectiveTime} (Indicates the time during which this Contract Term ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value + */ + public DateTimeType getEffectiveTimeElement() { + if (this.effectiveTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.effectiveTime"); + else if (Configuration.doAutoCreate()) + this.effectiveTime = new DateTimeType(); // bb + return this.effectiveTime; + } + + public boolean hasEffectiveTimeElement() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + public boolean hasEffectiveTime() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + /** + * @param value {@link #effectiveTime} (Indicates the time during which this Contract Term ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value + */ + public TermValuedItemComponent setEffectiveTimeElement(DateTimeType value) { + this.effectiveTime = value; + return this; + } + + /** + * @return Indicates the time during which this Contract Term ValuedItem information is effective. + */ + public Date getEffectiveTime() { + return this.effectiveTime == null ? null : this.effectiveTime.getValue(); + } + + /** + * @param value Indicates the time during which this Contract Term ValuedItem information is effective. + */ + public TermValuedItemComponent setEffectiveTime(Date value) { + if (value == null) + this.effectiveTime = null; + else { + if (this.effectiveTime == null) + this.effectiveTime = new DateTimeType(); + this.effectiveTime.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.) + */ + public TermValuedItemComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (A Contract Provision Valued Item unit valuation measure.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TermValuedItemComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (A Contract Provision Valued Item unit valuation measure.) + */ + public TermValuedItemComponent 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 the Contract Provision Valued Item delivered. 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 TermValuedItemComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + 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 the Contract Provision Valued Item delivered. 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 TermValuedItemComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. 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 the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public TermValuedItemComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public TermValuedItemComponent setFactor(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public TermValuedItemComponent setFactor(double value) { + 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 Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, 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 TermValuedItemComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); // bb + 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 Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, 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 TermValuedItemComponent 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 Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, 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 Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. + */ + public TermValuedItemComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. + */ + public TermValuedItemComponent setPoints(long value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. + */ + public TermValuedItemComponent setPoints(double value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @return {@link #net} (Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. 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 TermValuedItemComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); // cc + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. 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 TermValuedItemComponent setNet(Money value) { + this.net = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Provision Valued Item that may be priced.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("identifier", "Identifier", "Identifies a Contract Provision Valued Item instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract Term ValuedItem information is effective.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); + childrenList.add(new Property("quantity", "SimpleQuantity", "Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "A Contract Provision Valued Item unit valuation measure.", 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 the Contract Provision Valued Item delivered. 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 Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Type + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // DateTimeType + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType + case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1298275357: // entity + this.entity = (Type) value; // Type + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -929905388: // effectiveTime + this.effectiveTime = castToDateTime(value); // DateTimeType + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -486196699: // unitPrice + this.unitPrice = castToMoney(value); // Money + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case -982754077: // points + this.points = castToDecimal(value); // DecimalType + break; + case 108957: // net + this.net = castToMoney(value); // Money + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("entity[x]")) + this.entity = (Type) value; // Type + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("effectiveTime")) + this.effectiveTime = castToDateTime(value); // DateTimeType + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("unitPrice")) + this.unitPrice = castToMoney(value); // Money + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("points")) + this.points = castToDecimal(value); // DecimalType + else if (name.equals("net")) + this.net = castToMoney(value); // Money + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -740568643: return getEntity(); // Type + case -1618432855: return getIdentifier(); // Identifier + case -929905388: throw new FHIRException("Cannot make property effectiveTime as it is not a complex type"); // DateTimeType + case -1285004149: return getQuantity(); // SimpleQuantity + case -486196699: return getUnitPrice(); // Money + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType + case 108957: return getNet(); // Money + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("entityCodeableConcept")) { + this.entity = new CodeableConcept(); + return this.entity; + } + else if (name.equals("entityReference")) { + this.entity = new Reference(); + return this.entity; + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("effectiveTime")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.effectiveTime"); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("unitPrice")) { + this.unitPrice = new Money(); + return this.unitPrice; + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.factor"); + } + else if (name.equals("points")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.points"); + } + else if (name.equals("net")) { + this.net = new Money(); + return this.net; + } + else + return super.addChild(name); + } + + public TermValuedItemComponent copy() { + TermValuedItemComponent dst = new TermValuedItemComponent(); + copyValues(dst); + dst.entity = entity == null ? null : entity.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.effectiveTime = effectiveTime == null ? null : effectiveTime.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; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TermValuedItemComponent)) + return false; + TermValuedItemComponent o = (TermValuedItemComponent) other; + return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(points, o.points, true) && compareDeep(net, o.net, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TermValuedItemComponent)) + return false; + TermValuedItemComponent o = (TermValuedItemComponent) other; + return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true) + && compareValues(points, o.points, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (entity == null || entity.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (effectiveTime == null || effectiveTime.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) + && (net == null || net.isEmpty()); + } + + public String fhirType() { + return "Contract.term.valuedItem"; + + } + + } + + @Block() + public static class FriendlyLanguageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability. + */ + @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Easily comprehended representation of this Contract", formalDefinition="Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /** + * Constructor + */ + public FriendlyLanguageComponent() { + super(); + } + + /** + * Constructor + */ + public FriendlyLanguageComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) + */ + public Attachment getContentAttachment() throws FHIRException { + if (!(this.content instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + public boolean hasContentAttachment() { + return this.content instanceof Attachment; + } + + /** + * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) + */ + public Reference getContentReference() throws FHIRException { + if (!(this.content instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContentReference() { + return this.content instanceof Reference; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) + */ + public FriendlyLanguageComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 951530617: // content + this.content = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("content[x]")) + this.content = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 264548711: return getContent(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("contentAttachment")) { + this.content = new Attachment(); + return this.content; + } + else if (name.equals("contentReference")) { + this.content = new Reference(); + return this.content; + } + else + return super.addChild(name); + } + + public FriendlyLanguageComponent copy() { + FriendlyLanguageComponent dst = new FriendlyLanguageComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof FriendlyLanguageComponent)) + return false; + FriendlyLanguageComponent o = (FriendlyLanguageComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof FriendlyLanguageComponent)) + return false; + FriendlyLanguageComponent o = (FriendlyLanguageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + public String fhirType() { + return "Contract.friendly"; + + } + + } + + @Block() + public static class LegalLanguageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Contract legal text in human renderable form. + */ + @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract Legal Text", formalDefinition="Contract legal text in human renderable form." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /** + * Constructor + */ + public LegalLanguageComponent() { + super(); + } + + /** + * Constructor + */ + public LegalLanguageComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (Contract legal text in human renderable form.) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (Contract legal text in human renderable form.) + */ + public Attachment getContentAttachment() throws FHIRException { + if (!(this.content instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + public boolean hasContentAttachment() { + return this.content instanceof Attachment; + } + + /** + * @return {@link #content} (Contract legal text in human renderable form.) + */ + public Reference getContentReference() throws FHIRException { + if (!(this.content instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContentReference() { + return this.content instanceof Reference; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (Contract legal text in human renderable form.) + */ + public LegalLanguageComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 951530617: // content + this.content = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("content[x]")) + this.content = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 264548711: return getContent(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("contentAttachment")) { + this.content = new Attachment(); + return this.content; + } + else if (name.equals("contentReference")) { + this.content = new Reference(); + return this.content; + } + else + return super.addChild(name); + } + + public LegalLanguageComponent copy() { + LegalLanguageComponent dst = new LegalLanguageComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LegalLanguageComponent)) + return false; + LegalLanguageComponent o = (LegalLanguageComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LegalLanguageComponent)) + return false; + LegalLanguageComponent o = (LegalLanguageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + public String fhirType() { + return "Contract.legal"; + + } + + } + + @Block() + public static class ComputableLanguageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal). + */ + @Child(name = "content", type = {Attachment.class, DocumentReference.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Computable Contract Rules", formalDefinition="Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal)." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + /** + * Constructor + */ + public ComputableLanguageComponent() { + super(); + } + + /** + * Constructor + */ + public ComputableLanguageComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) + */ + public Attachment getContentAttachment() throws FHIRException { + if (!(this.content instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + public boolean hasContentAttachment() { + return this.content instanceof Attachment; + } + + /** + * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) + */ + public Reference getContentReference() throws FHIRException { + if (!(this.content instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContentReference() { + return this.content instanceof Reference; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) + */ + public ComputableLanguageComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 951530617: // content + this.content = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("content[x]")) + this.content = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 264548711: return getContent(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("contentAttachment")) { + this.content = new Attachment(); + return this.content; + } + else if (name.equals("contentReference")) { + this.content = new Reference(); + return this.content; + } + else + return super.addChild(name); + } + + public ComputableLanguageComponent copy() { + ComputableLanguageComponent dst = new ComputableLanguageComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ComputableLanguageComponent)) + return false; + ComputableLanguageComponent o = (ComputableLanguageComponent) other; + return compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ComputableLanguageComponent)) + return false; + ComputableLanguageComponent o = (ComputableLanguageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + public String fhirType() { + return "Contract.rule"; + + } + + } + + /** + * Unique identifier for this Contract. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contract identifier", formalDefinition="Unique identifier for this Contract." ) + protected Identifier identifier; + + /** + * When this Contract was issued. + */ + @Child(name = "issued", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When this Contract was issued", formalDefinition="When this Contract was issued." ) + protected DateTimeType issued; + + /** + * Relevant time or time-period when this Contract is applicable. + */ + @Child(name = "applies", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Effective time", formalDefinition="Relevant time or time-period when this Contract is applicable." ) + protected Period applies; + + /** + * The target entity impacted by or of interest to parties to the agreement. + */ + @Child(name = "subject", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contract Target Entity", formalDefinition="The target entity impacted by or of interest to parties to the agreement." ) + protected List subject; + /** + * The actual objects that are the target of the reference (The target entity impacted by or of interest to parties to the agreement.) + */ + protected List subjectTarget; + + + /** + * The matter of concern in the context of this agreement. + */ + @Child(name = "topic", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Context of the Contract", formalDefinition="The matter of concern in the context of this agreement." ) + protected List topic; + /** + * The actual objects that are the target of the reference (The matter of concern in the context of this agreement.) + */ + protected List topicTarget; + + + /** + * A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies. + */ + @Child(name = "authority", type = {Organization.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Authority under which this Contract has standing", formalDefinition="A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies." ) + protected List authority; + /** + * The actual objects that are the target of the reference (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + protected List authorityTarget; + + + /** + * Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources. + */ + @Child(name = "domain", type = {Location.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Domain in which this Contract applies", formalDefinition="Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources." ) + protected List domain; + /** + * The actual objects that are the target of the reference (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + protected List domainTarget; + + + /** + * Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contract Type", formalDefinition="Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc." ) + protected CodeableConcept type; + + /** + * More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent. + */ + @Child(name = "subType", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contract Subtype", formalDefinition="More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent." ) + protected List subType; + + /** + * Action stipulated by this Contract. + */ + @Child(name = "action", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Action", formalDefinition="Action stipulated by this Contract." ) + protected List action; + + /** + * Reason for action stipulated by this Contract. + */ + @Child(name = "actionReason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Action Reason", formalDefinition="Reason for action stipulated by this Contract." ) + protected List actionReason; + + /** + * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. + */ + @Child(name = "agent", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Agent", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." ) + protected List agent; + + /** + * Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness. + */ + @Child(name = "signer", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Signer", formalDefinition="Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness." ) + protected List signer; + + /** + * Contract Valued Item List. + */ + @Child(name = "valuedItem", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Valued Item", formalDefinition="Contract Valued Item List." ) + protected List valuedItem; + + /** + * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. + */ + @Child(name = "term", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Term List", formalDefinition="One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups." ) + protected List term; + + /** + * Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract. + */ + @Child(name = "binding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract." ) + protected Type binding; + + /** + * The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. + */ + @Child(name = "friendly", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Friendly Language", formalDefinition="The \"patient friendly language\" versionof the Contract in whole or in parts. \"Patient friendly language\" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement." ) + protected List friendly; + + /** + * List of Legal expressions or representations of this Contract. + */ + @Child(name = "legal", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract Legal Language", formalDefinition="List of Legal expressions or representations of this Contract." ) + protected List legal; + + /** + * List of Computable Policy Rule Language Representations of this Contract. + */ + @Child(name = "rule", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Computable Contract Language", formalDefinition="List of Computable Policy Rule Language Representations of this Contract." ) + protected List rule; + + private static final long serialVersionUID = -1116217303L; + + /** + * Constructor + */ + public Contract() { + super(); + } + + /** + * @return {@link #identifier} (Unique identifier for this Contract.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique identifier for this Contract.) + */ + public Contract setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #issued} (When this Contract 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 Contract.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); // bb + 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 Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public Contract setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return When this Contract was issued. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value When this Contract was issued. + */ + public Contract 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 or time-period when this Contract is applicable.) + */ + public Period getApplies() { + if (this.applies == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.applies"); + else if (Configuration.doAutoCreate()) + this.applies = new Period(); // cc + return this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (Relevant time or time-period when this Contract is applicable.) + */ + public Contract setApplies(Period value) { + this.applies = value; + return this; + } + + /** + * @return {@link #subject} (The target entity impacted by or of interest to parties to the agreement.) + */ + public List getSubject() { + if (this.subject == null) + this.subject = new ArrayList(); + return this.subject; + } + + public boolean hasSubject() { + if (this.subject == null) + return false; + for (Reference item : this.subject) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subject} (The target entity impacted by or of interest to parties to the agreement.) + */ + // syntactic sugar + public Reference addSubject() { //3 + Reference t = new Reference(); + if (this.subject == null) + this.subject = new ArrayList(); + this.subject.add(t); + return t; + } + + // syntactic sugar + public Contract addSubject(Reference t) { //3 + if (t == null) + return this; + if (this.subject == null) + this.subject = new ArrayList(); + this.subject.add(t); + return this; + } + + /** + * @return {@link #subject} (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 target entity impacted by or of interest to parties to the agreement.) + */ + public List getSubjectTarget() { + if (this.subjectTarget == null) + this.subjectTarget = new ArrayList(); + return this.subjectTarget; + } + + /** + * @return {@link #topic} (The matter of concern in the context of this agreement.) + */ + public List getTopic() { + if (this.topic == null) + this.topic = new ArrayList(); + return this.topic; + } + + public boolean hasTopic() { + if (this.topic == null) + return false; + for (Reference item : this.topic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #topic} (The matter of concern in the context of this agreement.) + */ + // syntactic sugar + public Reference addTopic() { //3 + Reference t = new Reference(); + if (this.topic == null) + this.topic = new ArrayList(); + this.topic.add(t); + return t; + } + + // syntactic sugar + public Contract addTopic(Reference t) { //3 + if (t == null) + return this; + if (this.topic == null) + this.topic = new ArrayList(); + this.topic.add(t); + return this; + } + + /** + * @return {@link #topic} (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 matter of concern in the context of this agreement.) + */ + public List getTopicTarget() { + if (this.topicTarget == null) + this.topicTarget = new ArrayList(); + return this.topicTarget; + } + + /** + * @return {@link #authority} (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + 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, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + // syntactic sugar + public Reference addAuthority() { //3 + Reference t = new Reference(); + if (this.authority == null) + this.authority = new ArrayList(); + this.authority.add(t); + return t; + } + + // syntactic sugar + public Contract addAuthority(Reference t) { //3 + if (t == null) + return this; + if (this.authority == null) + this.authority = new ArrayList(); + this.authority.add(t); + return this; + } + + /** + * @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, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + 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, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) + */ + public Organization addAuthorityTarget() { + Organization r = new Organization(); + if (this.authorityTarget == null) + this.authorityTarget = new ArrayList(); + this.authorityTarget.add(r); + return r; + } + + /** + * @return {@link #domain} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + 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} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + // syntactic sugar + public Reference addDomain() { //3 + Reference t = new Reference(); + if (this.domain == null) + this.domain = new ArrayList(); + this.domain.add(t); + return t; + } + + // syntactic sugar + public Contract addDomain(Reference t) { //3 + if (t == null) + return this; + if (this.domain == null) + this.domain = new ArrayList(); + this.domain.add(t); + return this; + } + + /** + * @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. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + 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. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) + */ + 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 such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.) + */ + public Contract setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.) + */ + public List getSubType() { + if (this.subType == null) + this.subType = new ArrayList(); + return this.subType; + } + + public boolean hasSubType() { + if (this.subType == null) + return false; + for (CodeableConcept item : this.subType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.) + */ + // syntactic sugar + public CodeableConcept addSubType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.subType == null) + this.subType = new ArrayList(); + this.subType.add(t); + return t; + } + + // syntactic sugar + public Contract addSubType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.subType == null) + this.subType = new ArrayList(); + this.subType.add(t); + return this; + } + + /** + * @return {@link #action} (Action stipulated by this Contract.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (CodeableConcept item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Action stipulated by this Contract.) + */ + // syntactic sugar + public CodeableConcept addAction() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public Contract addAction(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + /** + * @return {@link #actionReason} (Reason for action stipulated by this Contract.) + */ + public List getActionReason() { + if (this.actionReason == null) + this.actionReason = new ArrayList(); + return this.actionReason; + } + + public boolean hasActionReason() { + if (this.actionReason == null) + return false; + for (CodeableConcept item : this.actionReason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actionReason} (Reason for action stipulated by this Contract.) + */ + // syntactic sugar + public CodeableConcept addActionReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.actionReason == null) + this.actionReason = new ArrayList(); + this.actionReason.add(t); + return t; + } + + // syntactic sugar + public Contract addActionReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.actionReason == null) + this.actionReason = new ArrayList(); + this.actionReason.add(t); + return this; + } + + /** + * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) + */ + public List getAgent() { + if (this.agent == null) + this.agent = new ArrayList(); + return this.agent; + } + + public boolean hasAgent() { + if (this.agent == null) + return false; + for (AgentComponent item : this.agent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) + */ + // syntactic sugar + public AgentComponent addAgent() { //3 + AgentComponent t = new AgentComponent(); + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return t; + } + + // syntactic sugar + public Contract addAgent(AgentComponent t) { //3 + if (t == null) + return this; + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return this; + } + + /** + * @return {@link #signer} (Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.) + */ + public List getSigner() { + if (this.signer == null) + this.signer = new ArrayList(); + return this.signer; + } + + public boolean hasSigner() { + if (this.signer == null) + return false; + for (SignatoryComponent item : this.signer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #signer} (Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.) + */ + // syntactic sugar + public SignatoryComponent addSigner() { //3 + SignatoryComponent t = new SignatoryComponent(); + if (this.signer == null) + this.signer = new ArrayList(); + this.signer.add(t); + return t; + } + + // syntactic sugar + public Contract addSigner(SignatoryComponent t) { //3 + if (t == null) + return this; + if (this.signer == null) + this.signer = new ArrayList(); + this.signer.add(t); + return this; + } + + /** + * @return {@link #valuedItem} (Contract Valued Item List.) + */ + public List getValuedItem() { + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + return this.valuedItem; + } + + public boolean hasValuedItem() { + if (this.valuedItem == null) + return false; + for (ValuedItemComponent item : this.valuedItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valuedItem} (Contract Valued Item List.) + */ + // syntactic sugar + public ValuedItemComponent addValuedItem() { //3 + ValuedItemComponent t = new ValuedItemComponent(); + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + this.valuedItem.add(t); + return t; + } + + // syntactic sugar + public Contract addValuedItem(ValuedItemComponent t) { //3 + if (t == null) + return this; + if (this.valuedItem == null) + this.valuedItem = new ArrayList(); + this.valuedItem.add(t); + return this; + } + + /** + * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.) + */ + public List getTerm() { + if (this.term == null) + this.term = new ArrayList(); + return this.term; + } + + public boolean hasTerm() { + if (this.term == null) + return false; + for (TermComponent item : this.term) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.) + */ + // syntactic sugar + public TermComponent addTerm() { //3 + TermComponent t = new TermComponent(); + if (this.term == null) + this.term = new ArrayList(); + this.term.add(t); + return t; + } + + // syntactic sugar + public Contract addTerm(TermComponent t) { //3 + if (t == null) + return this; + if (this.term == null) + this.term = new ArrayList(); + this.term.add(t); + return this; + } + + /** + * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) + */ + public Type getBinding() { + return this.binding; + } + + /** + * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) + */ + public Attachment getBindingAttachment() throws FHIRException { + if (!(this.binding instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.binding.getClass().getName()+" was encountered"); + return (Attachment) this.binding; + } + + public boolean hasBindingAttachment() { + return this.binding instanceof Attachment; + } + + /** + * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) + */ + public Reference getBindingReference() throws FHIRException { + if (!(this.binding instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.binding.getClass().getName()+" was encountered"); + return (Reference) this.binding; + } + + public boolean hasBindingReference() { + return this.binding instanceof Reference; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) + */ + public Contract setBinding(Type value) { + this.binding = value; + return this; + } + + /** + * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.) + */ + public List getFriendly() { + if (this.friendly == null) + this.friendly = new ArrayList(); + return this.friendly; + } + + public boolean hasFriendly() { + if (this.friendly == null) + return false; + for (FriendlyLanguageComponent item : this.friendly) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.) + */ + // syntactic sugar + public FriendlyLanguageComponent addFriendly() { //3 + FriendlyLanguageComponent t = new FriendlyLanguageComponent(); + if (this.friendly == null) + this.friendly = new ArrayList(); + this.friendly.add(t); + return t; + } + + // syntactic sugar + public Contract addFriendly(FriendlyLanguageComponent t) { //3 + if (t == null) + return this; + if (this.friendly == null) + this.friendly = new ArrayList(); + this.friendly.add(t); + return this; + } + + /** + * @return {@link #legal} (List of Legal expressions or representations of this Contract.) + */ + public List getLegal() { + if (this.legal == null) + this.legal = new ArrayList(); + return this.legal; + } + + public boolean hasLegal() { + if (this.legal == null) + return false; + for (LegalLanguageComponent item : this.legal) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #legal} (List of Legal expressions or representations of this Contract.) + */ + // syntactic sugar + public LegalLanguageComponent addLegal() { //3 + LegalLanguageComponent t = new LegalLanguageComponent(); + if (this.legal == null) + this.legal = new ArrayList(); + this.legal.add(t); + return t; + } + + // syntactic sugar + public Contract addLegal(LegalLanguageComponent t) { //3 + if (t == null) + return this; + if (this.legal == null) + this.legal = new ArrayList(); + this.legal.add(t); + return this; + } + + /** + * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.) + */ + public List getRule() { + if (this.rule == null) + this.rule = new ArrayList(); + return this.rule; + } + + public boolean hasRule() { + if (this.rule == null) + return false; + for (ComputableLanguageComponent item : this.rule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.) + */ + // syntactic sugar + public ComputableLanguageComponent addRule() { //3 + ComputableLanguageComponent t = new ComputableLanguageComponent(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + // syntactic sugar + public Contract addRule(ComputableLanguageComponent t) { //3 + if (t == null) + return this; + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this Contract.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("issued", "dateTime", "When this Contract was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("subject", "Reference(Any)", "The target entity impacted by or of interest to parties to the agreement.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("topic", "Reference(Any)", "The matter of concern in the context of this agreement.", 0, java.lang.Integer.MAX_VALUE, topic)); + childrenList.add(new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("domain", "Reference(Location)", "Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.", 0, java.lang.Integer.MAX_VALUE, domain)); + childrenList.add(new Property("type", "CodeableConcept", "Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subType", "CodeableConcept", "More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.", 0, java.lang.Integer.MAX_VALUE, subType)); + childrenList.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("actionReason", "CodeableConcept", "Reason for action stipulated by this Contract.", 0, java.lang.Integer.MAX_VALUE, actionReason)); + childrenList.add(new Property("agent", "", "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, agent)); + childrenList.add(new Property("signer", "", "Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.", 0, java.lang.Integer.MAX_VALUE, signer)); + childrenList.add(new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem)); + childrenList.add(new Property("term", "", "One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("binding[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract.", 0, java.lang.Integer.MAX_VALUE, binding)); + childrenList.add(new Property("friendly", "", "The \"patient friendly language\" versionof the Contract in whole or in parts. \"Patient friendly language\" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.", 0, java.lang.Integer.MAX_VALUE, friendly)); + childrenList.add(new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal)); + childrenList.add(new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, rule)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType + case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference + case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // Reference + case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : this.authority.toArray(new Base[this.authority.size()]); // Reference + case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : this.domain.toArray(new Base[this.domain.size()]); // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // CodeableConcept + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // CodeableConcept + case 1465121818: /*actionReason*/ return this.actionReason == null ? new Base[0] : this.actionReason.toArray(new Base[this.actionReason.size()]); // CodeableConcept + case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // AgentComponent + case -902467798: /*signer*/ return this.signer == null ? new Base[0] : this.signer.toArray(new Base[this.signer.size()]); // SignatoryComponent + case 2046675654: /*valuedItem*/ return this.valuedItem == null ? new Base[0] : this.valuedItem.toArray(new Base[this.valuedItem.size()]); // ValuedItemComponent + case 3556460: /*term*/ return this.term == null ? new Base[0] : this.term.toArray(new Base[this.term.size()]); // TermComponent + case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // Type + case -1423054677: /*friendly*/ return this.friendly == null ? new Base[0] : this.friendly.toArray(new Base[this.friendly.size()]); // FriendlyLanguageComponent + case 102851257: /*legal*/ return this.legal == null ? new Base[0] : this.legal.toArray(new Base[this.legal.size()]); // LegalLanguageComponent + case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // ComputableLanguageComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -1179159893: // issued + this.issued = castToDateTime(value); // DateTimeType + break; + case -793235316: // applies + this.applies = castToPeriod(value); // Period + break; + case -1867885268: // subject + this.getSubject().add(castToReference(value)); // Reference + break; + case 110546223: // topic + this.getTopic().add(castToReference(value)); // Reference + break; + case 1475610435: // authority + this.getAuthority().add(castToReference(value)); // Reference + break; + case -1326197564: // domain + this.getDomain().add(castToReference(value)); // Reference + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1868521062: // subType + this.getSubType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1422950858: // action + this.getAction().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1465121818: // actionReason + this.getActionReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 92750597: // agent + this.getAgent().add((AgentComponent) value); // AgentComponent + break; + case -902467798: // signer + this.getSigner().add((SignatoryComponent) value); // SignatoryComponent + break; + case 2046675654: // valuedItem + this.getValuedItem().add((ValuedItemComponent) value); // ValuedItemComponent + break; + case 3556460: // term + this.getTerm().add((TermComponent) value); // TermComponent + break; + case -108220795: // binding + this.binding = (Type) value; // Type + break; + case -1423054677: // friendly + this.getFriendly().add((FriendlyLanguageComponent) value); // FriendlyLanguageComponent + break; + case 102851257: // legal + this.getLegal().add((LegalLanguageComponent) value); // LegalLanguageComponent + break; + case 3512060: // rule + this.getRule().add((ComputableLanguageComponent) value); // ComputableLanguageComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("issued")) + this.issued = castToDateTime(value); // DateTimeType + else if (name.equals("applies")) + this.applies = castToPeriod(value); // Period + else if (name.equals("subject")) + this.getSubject().add(castToReference(value)); + else if (name.equals("topic")) + this.getTopic().add(castToReference(value)); + else if (name.equals("authority")) + this.getAuthority().add(castToReference(value)); + else if (name.equals("domain")) + this.getDomain().add(castToReference(value)); + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subType")) + this.getSubType().add(castToCodeableConcept(value)); + else if (name.equals("action")) + this.getAction().add(castToCodeableConcept(value)); + else if (name.equals("actionReason")) + this.getActionReason().add(castToCodeableConcept(value)); + else if (name.equals("agent")) + this.getAgent().add((AgentComponent) value); + else if (name.equals("signer")) + this.getSigner().add((SignatoryComponent) value); + else if (name.equals("valuedItem")) + this.getValuedItem().add((ValuedItemComponent) value); + else if (name.equals("term")) + this.getTerm().add((TermComponent) value); + else if (name.equals("binding[x]")) + this.binding = (Type) value; // Type + else if (name.equals("friendly")) + this.getFriendly().add((FriendlyLanguageComponent) value); + else if (name.equals("legal")) + this.getLegal().add((LegalLanguageComponent) value); + else if (name.equals("rule")) + this.getRule().add((ComputableLanguageComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // DateTimeType + case -793235316: return getApplies(); // Period + case -1867885268: return addSubject(); // Reference + case 110546223: return addTopic(); // Reference + case 1475610435: return addAuthority(); // Reference + case -1326197564: return addDomain(); // Reference + case 3575610: return getType(); // CodeableConcept + case -1868521062: return addSubType(); // CodeableConcept + case -1422950858: return addAction(); // CodeableConcept + case 1465121818: return addActionReason(); // CodeableConcept + case 92750597: return addAgent(); // AgentComponent + case -902467798: return addSigner(); // SignatoryComponent + case 2046675654: return addValuedItem(); // ValuedItemComponent + case 3556460: return addTerm(); // TermComponent + case 1514826715: return getBinding(); // Type + case -1423054677: return addFriendly(); // FriendlyLanguageComponent + case 102851257: return addLegal(); // LegalLanguageComponent + case 3512060: return addRule(); // ComputableLanguageComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("issued")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.issued"); + } + else if (name.equals("applies")) { + this.applies = new Period(); + return this.applies; + } + else if (name.equals("subject")) { + return addSubject(); + } + else if (name.equals("topic")) { + return addTopic(); + } + else if (name.equals("authority")) { + return addAuthority(); + } + else if (name.equals("domain")) { + return addDomain(); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("subType")) { + return addSubType(); + } + else if (name.equals("action")) { + return addAction(); + } + else if (name.equals("actionReason")) { + return addActionReason(); + } + else if (name.equals("agent")) { + return addAgent(); + } + else if (name.equals("signer")) { + return addSigner(); + } + else if (name.equals("valuedItem")) { + return addValuedItem(); + } + else if (name.equals("term")) { + return addTerm(); + } + else if (name.equals("bindingAttachment")) { + this.binding = new Attachment(); + return this.binding; + } + else if (name.equals("bindingReference")) { + this.binding = new Reference(); + return this.binding; + } + else if (name.equals("friendly")) { + return addFriendly(); + } + else if (name.equals("legal")) { + return addLegal(); + } + else if (name.equals("rule")) { + return addRule(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Contract"; + + } + + public Contract copy() { + Contract dst = new Contract(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.applies = applies == null ? null : applies.copy(); + if (subject != null) { + dst.subject = new ArrayList(); + for (Reference i : subject) + dst.subject.add(i.copy()); + }; + if (topic != null) { + dst.topic = new ArrayList(); + for (Reference i : topic) + dst.topic.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(); + for (CodeableConcept i : subType) + dst.subType.add(i.copy()); + }; + if (action != null) { + dst.action = new ArrayList(); + for (CodeableConcept i : action) + dst.action.add(i.copy()); + }; + if (actionReason != null) { + dst.actionReason = new ArrayList(); + for (CodeableConcept i : actionReason) + dst.actionReason.add(i.copy()); + }; + if (agent != null) { + dst.agent = new ArrayList(); + for (AgentComponent i : agent) + dst.agent.add(i.copy()); + }; + if (signer != null) { + dst.signer = new ArrayList(); + for (SignatoryComponent i : signer) + dst.signer.add(i.copy()); + }; + if (valuedItem != null) { + dst.valuedItem = new ArrayList(); + for (ValuedItemComponent i : valuedItem) + dst.valuedItem.add(i.copy()); + }; + if (term != null) { + dst.term = new ArrayList(); + for (TermComponent i : term) + dst.term.add(i.copy()); + }; + dst.binding = binding == null ? null : binding.copy(); + if (friendly != null) { + dst.friendly = new ArrayList(); + for (FriendlyLanguageComponent i : friendly) + dst.friendly.add(i.copy()); + }; + if (legal != null) { + dst.legal = new ArrayList(); + for (LegalLanguageComponent i : legal) + dst.legal.add(i.copy()); + }; + if (rule != null) { + dst.rule = new ArrayList(); + for (ComputableLanguageComponent i : rule) + dst.rule.add(i.copy()); + }; + return dst; + } + + protected Contract typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Contract)) + return false; + Contract o = (Contract) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) + && compareDeep(subject, o.subject, true) && compareDeep(topic, o.topic, true) && compareDeep(authority, o.authority, true) + && compareDeep(domain, o.domain, true) && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) + && compareDeep(action, o.action, true) && compareDeep(actionReason, o.actionReason, true) && compareDeep(agent, o.agent, true) + && compareDeep(signer, o.signer, true) && compareDeep(valuedItem, o.valuedItem, true) && compareDeep(term, o.term, true) + && compareDeep(binding, o.binding, true) && compareDeep(friendly, o.friendly, true) && compareDeep(legal, o.legal, true) + && compareDeep(rule, o.rule, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Contract)) + return false; + Contract o = (Contract) other; + return compareValues(issued, o.issued, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (issued == null || issued.isEmpty()) + && (applies == null || applies.isEmpty()) && (subject == null || subject.isEmpty()) && (topic == null || topic.isEmpty()) + && (authority == null || authority.isEmpty()) && (domain == null || domain.isEmpty()) && (type == null || type.isEmpty()) + && (subType == null || subType.isEmpty()) && (action == null || action.isEmpty()) && (actionReason == null || actionReason.isEmpty()) + && (agent == null || agent.isEmpty()) && (signer == null || signer.isEmpty()) && (valuedItem == null || valuedItem.isEmpty()) + && (term == null || term.isEmpty()) && (binding == null || binding.isEmpty()) && (friendly == null || friendly.isEmpty()) + && (legal == null || legal.isEmpty()) && (rule == null || rule.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Contract; + } + + /** + * Search parameter: topic + *

+ * Description: The identity of the topic of the contract
+ * Type: reference
+ * Path: Contract.topic
+ *

+ */ + @SearchParamDefinition(name="topic", path="Contract.topic", description="The identity of the topic of the contract", type="reference" ) + public static final String SP_TOPIC = "topic"; + /** + * Fluent Client search parameter constant for topic + *

+ * Description: The identity of the topic of the contract
+ * Type: reference
+ * Path: Contract.topic
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TOPIC = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TOPIC); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Contract:topic". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_TOPIC = new ca.uhn.fhir.model.api.Include("Contract:topic").toLocked(); + + /** + * Search parameter: authority + *

+ * Description: The authority of the contract
+ * Type: reference
+ * Path: Contract.authority
+ *

+ */ + @SearchParamDefinition(name="authority", path="Contract.authority", description="The authority of the contract", type="reference" ) + public static final String SP_AUTHORITY = "authority"; + /** + * Fluent Client search parameter constant for authority + *

+ * Description: The authority of the contract
+ * Type: reference
+ * Path: Contract.authority
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHORITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHORITY); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Contract:authority". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHORITY = new ca.uhn.fhir.model.api.Include("Contract:authority").toLocked(); + + /** + * Search parameter: signer + *

+ * Description: Contract Signatory Party
+ * Type: reference
+ * Path: Contract.signer.party
+ *

+ */ + @SearchParamDefinition(name="signer", path="Contract.signer.party", description="Contract Signatory Party", type="reference" ) + public static final String SP_SIGNER = "signer"; + /** + * Fluent Client search parameter constant for signer + *

+ * Description: Contract Signatory Party
+ * Type: reference
+ * Path: Contract.signer.party
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SIGNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SIGNER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Contract:signer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SIGNER = new ca.uhn.fhir.model.api.Include("Contract:signer").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The identity of the subject of the contract (if a patient)
+ * Type: reference
+ * Path: Contract.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Contract.subject", description="The identity of the subject of the contract (if a patient)", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of the subject of the contract (if a patient)
+ * Type: reference
+ * Path: Contract.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Contract:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Contract:patient").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: The identity of the subject of the contract
+ * Type: reference
+ * Path: Contract.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Contract.subject", description="The identity of the subject of the contract", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: The identity of the subject of the contract
+ * Type: reference
+ * Path: Contract.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Contract:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Contract:subject").toLocked(); + + /** + * Search parameter: issued + *

+ * Description: The date/time the contract was issued
+ * Type: date
+ * Path: Contract.issued
+ *

+ */ + @SearchParamDefinition(name="issued", path="Contract.issued", description="The date/time the contract was issued", type="date" ) + public static final String SP_ISSUED = "issued"; + /** + * Fluent Client search parameter constant for issued + *

+ * Description: The date/time the contract was issued
+ * Type: date
+ * Path: Contract.issued
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED); + + /** + * Search parameter: domain + *

+ * Description: The domain of the contract
+ * Type: reference
+ * Path: Contract.domain
+ *

+ */ + @SearchParamDefinition(name="domain", path="Contract.domain", description="The domain of the contract", type="reference" ) + public static final String SP_DOMAIN = "domain"; + /** + * Fluent Client search parameter constant for domain + *

+ * Description: The domain of the contract
+ * Type: reference
+ * Path: Contract.domain
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DOMAIN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DOMAIN); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Contract:domain". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DOMAIN = new ca.uhn.fhir.model.api.Include("Contract:domain").toLocked(); + + /** + * Search parameter: ttopic + *

+ * Description: The identity of the topic of the contract terms
+ * Type: reference
+ * Path: Contract.term.topic
+ *

+ */ + @SearchParamDefinition(name="ttopic", path="Contract.term.topic", description="The identity of the topic of the contract terms", type="reference" ) + public static final String SP_TTOPIC = "ttopic"; + /** + * Fluent Client search parameter constant for ttopic + *

+ * Description: The identity of the topic of the contract terms
+ * Type: reference
+ * Path: Contract.term.topic
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TTOPIC = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TTOPIC); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Contract:ttopic". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_TTOPIC = new ca.uhn.fhir.model.api.Include("Contract:ttopic").toLocked(); + + /** + * Search parameter: agent + *

+ * Description: Agent to the Contact
+ * Type: reference
+ * Path: Contract.agent.actor
+ *

+ */ + @SearchParamDefinition(name="agent", path="Contract.agent.actor", description="Agent to the Contact", type="reference" ) + public static final String SP_AGENT = "agent"; + /** + * Fluent Client search parameter constant for agent + *

+ * Description: Agent to the Contact
+ * Type: reference
+ * Path: Contract.agent.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Contract:agent". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include("Contract:agent").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The identity of the contract
+ * Type: token
+ * Path: Contract.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Contract.identifier", description="The identity of the contract", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identity of the contract
+ * Type: token
+ * Path: Contract.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Count.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Count.java new file mode 100644 index 00000000000..9c22997fd3d --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Count.java @@ -0,0 +1,88 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Count", profileOf=Quantity.class) +public class Count extends Quantity { + + private static final long serialVersionUID = 1069574054L; + + public Count copy() { + Count dst = new Count(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Count typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Count)) + return false; + Count o = (Count) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Count)) + return false; + Count o = (Count) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Coverage.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Coverage.java new file mode 100644 index 00000000000..36fdeb710ce --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Coverage.java @@ -0,0 +1,1537 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Financial instrument which may be used to pay for or reimburse health care products and services. + */ +@ResourceDef(name="Coverage", profile="http://hl7.org/fhir/Profile/Coverage") +public class Coverage extends DomainResource { + + /** + * The program or plan underwriter or payor. + */ + @Child(name = "issuer", type = {Identifier.class, Organization.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier for the plan issuer", formalDefinition="The program or plan underwriter or payor." ) + protected Type issuer; + + /** + * Business Identification Number (BIN number) used to identify the routing of eClaims. + */ + @Child(name = "bin", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="BIN Number", formalDefinition="Business Identification Number (BIN number) used to identify the routing of eClaims." ) + protected StringType bin; + + /** + * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Coverage start and end dates", formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." ) + protected Period period; + + /** + * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. + */ + @Child(name = "type", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of coverage", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." ) + protected Coding type; + + /** + * The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. + */ + @Child(name = "planholder", type = {Identifier.class, Patient.class, Organization.class}, order=4, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="Plan holder", formalDefinition="The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due." ) + protected Type planholder; + + /** + * The party who benefits from the insurance coverage. + */ + @Child(name = "beneficiary", type = {Identifier.class, Patient.class}, order=5, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="Plan Beneficiary", formalDefinition="The party who benefits from the insurance coverage." ) + protected Type beneficiary; + + /** + * The relationship of the patient to the planholdersubscriber). + */ + @Child(name = "relationship", type = {Coding.class}, order=6, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Patient relationship to planholder", formalDefinition="The relationship of the patient to the planholdersubscriber)." ) + protected Coding relationship; + + /** + * The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID. + */ + @Child(name = "identifier", type = {Identifier.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The primary coverage ID", formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID." ) + protected List identifier; + + /** + * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + @Child(name = "group", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the group", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) + protected StringType group; + + /** + * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + @Child(name = "plan", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the plan", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) + protected StringType plan; + + /** + * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + @Child(name = "subPlan", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the subsection of the plan", formalDefinition="Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID." ) + protected StringType subPlan; + + /** + * A unique identifier for a dependent under the coverage. + */ + @Child(name = "dependent", type = {PositiveIntType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Dependent number", formalDefinition="A unique identifier for a dependent under the coverage." ) + protected PositiveIntType dependent; + + /** + * An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The plan instance or sequence counter", formalDefinition="An optional counter for a particular instance of the identified coverage which increments upon each renewal." ) + protected PositiveIntType sequence; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name = "exception", type = {Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * The identifier for a community of providers. + */ + @Child(name = "network", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer network", formalDefinition="The identifier for a community of providers." ) + protected StringType network; + + /** + * The policy(s) which constitute this insurance coverage. + */ + @Child(name = "contract", type = {Contract.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." ) + protected List contract; + /** + * The actual objects that are the target of the reference (The policy(s) which constitute this insurance coverage.) + */ + protected List contractTarget; + + + private static final long serialVersionUID = -1269320450L; + + /** + * Constructor + */ + public Coverage() { + super(); + } + + /** + * Constructor + */ + public Coverage(Type issuer, Type planholder, Type beneficiary, Coding relationship) { + super(); + this.issuer = issuer; + this.planholder = planholder; + this.beneficiary = beneficiary; + this.relationship = relationship; + } + + /** + * @return {@link #issuer} (The program or plan underwriter or payor.) + */ + public Type getIssuer() { + return this.issuer; + } + + /** + * @return {@link #issuer} (The program or plan underwriter or payor.) + */ + public Identifier getIssuerIdentifier() throws FHIRException { + if (!(this.issuer instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.issuer.getClass().getName()+" was encountered"); + return (Identifier) this.issuer; + } + + public boolean hasIssuerIdentifier() { + return this.issuer instanceof Identifier; + } + + /** + * @return {@link #issuer} (The program or plan underwriter or payor.) + */ + public Reference getIssuerReference() throws FHIRException { + if (!(this.issuer instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.issuer.getClass().getName()+" was encountered"); + return (Reference) this.issuer; + } + + public boolean hasIssuerReference() { + return this.issuer instanceof Reference; + } + + public boolean hasIssuer() { + return this.issuer != null && !this.issuer.isEmpty(); + } + + /** + * @param value {@link #issuer} (The program or plan underwriter or payor.) + */ + public Coverage setIssuer(Type value) { + this.issuer = value; + return this; + } + + /** + * @return {@link #bin} (Business Identification Number (BIN number) used to identify the routing of eClaims.). This is the underlying object with id, value and extensions. The accessor "getBin" gives direct access to the value + */ + public StringType getBinElement() { + if (this.bin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.bin"); + else if (Configuration.doAutoCreate()) + this.bin = new StringType(); // bb + return this.bin; + } + + public boolean hasBinElement() { + return this.bin != null && !this.bin.isEmpty(); + } + + public boolean hasBin() { + return this.bin != null && !this.bin.isEmpty(); + } + + /** + * @param value {@link #bin} (Business Identification Number (BIN number) used to identify the routing of eClaims.). This is the underlying object with id, value and extensions. The accessor "getBin" gives direct access to the value + */ + public Coverage setBinElement(StringType value) { + this.bin = value; + return this; + } + + /** + * @return Business Identification Number (BIN number) used to identify the routing of eClaims. + */ + public String getBin() { + return this.bin == null ? null : this.bin.getValue(); + } + + /** + * @param value Business Identification Number (BIN number) used to identify the routing of eClaims. + */ + public Coverage setBin(String value) { + if (Utilities.noString(value)) + this.bin = null; + else { + if (this.bin == null) + this.bin = new StringType(); + this.bin.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) + */ + public Coverage setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) + */ + public Coverage setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Type getPlanholder() { + return this.planholder; + } + + /** + * @return {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Identifier getPlanholderIdentifier() throws FHIRException { + if (!(this.planholder instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.planholder.getClass().getName()+" was encountered"); + return (Identifier) this.planholder; + } + + public boolean hasPlanholderIdentifier() { + return this.planholder instanceof Identifier; + } + + /** + * @return {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Reference getPlanholderReference() throws FHIRException { + if (!(this.planholder instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.planholder.getClass().getName()+" was encountered"); + return (Reference) this.planholder; + } + + public boolean hasPlanholderReference() { + return this.planholder instanceof Reference; + } + + public boolean hasPlanholder() { + return this.planholder != null && !this.planholder.isEmpty(); + } + + /** + * @param value {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Coverage setPlanholder(Type value) { + this.planholder = value; + return this; + } + + /** + * @return {@link #beneficiary} (The party who benefits from the insurance coverage.) + */ + public Type getBeneficiary() { + return this.beneficiary; + } + + /** + * @return {@link #beneficiary} (The party who benefits from the insurance coverage.) + */ + public Identifier getBeneficiaryIdentifier() throws FHIRException { + if (!(this.beneficiary instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.beneficiary.getClass().getName()+" was encountered"); + return (Identifier) this.beneficiary; + } + + public boolean hasBeneficiaryIdentifier() { + return this.beneficiary instanceof Identifier; + } + + /** + * @return {@link #beneficiary} (The party who benefits from the insurance coverage.) + */ + public Reference getBeneficiaryReference() throws FHIRException { + if (!(this.beneficiary instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.beneficiary.getClass().getName()+" was encountered"); + return (Reference) this.beneficiary; + } + + public boolean hasBeneficiaryReference() { + return this.beneficiary instanceof Reference; + } + + public boolean hasBeneficiary() { + return this.beneficiary != null && !this.beneficiary.isEmpty(); + } + + /** + * @param value {@link #beneficiary} (The party who benefits from the insurance coverage.) + */ + public Coverage setBeneficiary(Type value) { + this.beneficiary = value; + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the planholdersubscriber).) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the planholdersubscriber).) + */ + public Coverage setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) + */ + 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 main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Coverage addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value + */ + public StringType getGroupElement() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.group"); + else if (Configuration.doAutoCreate()) + this.group = new StringType(); // bb + return this.group; + } + + public boolean hasGroupElement() { + return this.group != null && !this.group.isEmpty(); + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value + */ + public Coverage setGroupElement(StringType value) { + this.group = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public String getGroup() { + return this.group == null ? null : this.group.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public Coverage setGroup(String value) { + if (Utilities.noString(value)) + this.group = null; + else { + if (this.group == null) + this.group = new StringType(); + this.group.setValue(value); + } + return this; + } + + /** + * @return {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value + */ + public StringType getPlanElement() { + if (this.plan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.plan"); + else if (Configuration.doAutoCreate()) + this.plan = new StringType(); // bb + return this.plan; + } + + public boolean hasPlanElement() { + return this.plan != null && !this.plan.isEmpty(); + } + + public boolean hasPlan() { + return this.plan != null && !this.plan.isEmpty(); + } + + /** + * @param value {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value + */ + public Coverage setPlanElement(StringType value) { + this.plan = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public String getPlan() { + return this.plan == null ? null : this.plan.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public Coverage setPlan(String value) { + if (Utilities.noString(value)) + this.plan = null; + else { + if (this.plan == null) + this.plan = new StringType(); + this.plan.setValue(value); + } + return this; + } + + /** + * @return {@link #subPlan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value + */ + public StringType getSubPlanElement() { + if (this.subPlan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subPlan"); + else if (Configuration.doAutoCreate()) + this.subPlan = new StringType(); // bb + return this.subPlan; + } + + public boolean hasSubPlanElement() { + return this.subPlan != null && !this.subPlan.isEmpty(); + } + + public boolean hasSubPlan() { + return this.subPlan != null && !this.subPlan.isEmpty(); + } + + /** + * @param value {@link #subPlan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value + */ + public Coverage setSubPlanElement(StringType value) { + this.subPlan = value; + return this; + } + + /** + * @return Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + public String getSubPlan() { + return this.subPlan == null ? null : this.subPlan.getValue(); + } + + /** + * @param value Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + public Coverage setSubPlan(String value) { + if (Utilities.noString(value)) + this.subPlan = null; + else { + if (this.subPlan == null) + this.subPlan = new StringType(); + this.subPlan.setValue(value); + } + return this; + } + + /** + * @return {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value + */ + public PositiveIntType getDependentElement() { + if (this.dependent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.dependent"); + else if (Configuration.doAutoCreate()) + this.dependent = new PositiveIntType(); // bb + return this.dependent; + } + + public boolean hasDependentElement() { + return this.dependent != null && !this.dependent.isEmpty(); + } + + public boolean hasDependent() { + return this.dependent != null && !this.dependent.isEmpty(); + } + + /** + * @param value {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value + */ + public Coverage setDependentElement(PositiveIntType value) { + this.dependent = value; + return this; + } + + /** + * @return A unique identifier for a dependent under the coverage. + */ + public int getDependent() { + return this.dependent == null || this.dependent.isEmpty() ? 0 : this.dependent.getValue(); + } + + /** + * @param value A unique identifier for a dependent under the coverage. + */ + public Coverage setDependent(int value) { + if (this.dependent == null) + this.dependent = new PositiveIntType(); + this.dependent.setValue(value); + return this; + } + + /** + * @return {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public Coverage setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + public Coverage setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @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; + } + + // syntactic sugar + public Coverage addException(Coding t) { //3 + if (t == null) + return this; + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return this; + } + + /** + * @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 Coverage.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); // bb + 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 Coverage 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 Coverage 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 #network} (The identifier for a community of providers.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value + */ + public StringType getNetworkElement() { + if (this.network == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.network"); + else if (Configuration.doAutoCreate()) + this.network = new StringType(); // bb + return this.network; + } + + public boolean hasNetworkElement() { + return this.network != null && !this.network.isEmpty(); + } + + public boolean hasNetwork() { + return this.network != null && !this.network.isEmpty(); + } + + /** + * @param value {@link #network} (The identifier for a community of providers.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value + */ + public Coverage setNetworkElement(StringType value) { + this.network = value; + return this; + } + + /** + * @return The identifier for a community of providers. + */ + public String getNetwork() { + return this.network == null ? null : this.network.getValue(); + } + + /** + * @param value The identifier for a community of providers. + */ + public Coverage setNetwork(String value) { + if (Utilities.noString(value)) + this.network = null; + else { + if (this.network == null) + this.network = new StringType(); + this.network.setValue(value); + } + return this; + } + + /** + * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) + */ + public List getContract() { + if (this.contract == null) + this.contract = new ArrayList(); + return this.contract; + } + + public boolean hasContract() { + if (this.contract == null) + return false; + for (Reference item : this.contract) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) + */ + // syntactic sugar + public Reference addContract() { //3 + Reference t = new Reference(); + if (this.contract == null) + this.contract = new ArrayList(); + this.contract.add(t); + return t; + } + + // syntactic sugar + public Coverage addContract(Reference t) { //3 + if (t == null) + return this; + if (this.contract == null) + this.contract = new ArrayList(); + this.contract.add(t); + return this; + } + + /** + * @return {@link #contract} (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 policy(s) which constitute this insurance coverage.) + */ + public List getContractTarget() { + if (this.contractTarget == null) + this.contractTarget = new ArrayList(); + return this.contractTarget; + } + + // syntactic sugar + /** + * @return {@link #contract} (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 policy(s) which constitute this insurance coverage.) + */ + public Contract addContractTarget() { + Contract r = new Contract(); + if (this.contractTarget == null) + this.contractTarget = new ArrayList(); + this.contractTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("issuer[x]", "Identifier|Reference(Organization)", "The program or plan underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, issuer)); + childrenList.add(new Property("bin", "string", "Business Identification Number (BIN number) used to identify the routing of eClaims.", 0, java.lang.Integer.MAX_VALUE, bin)); + childrenList.add(new Property("period", "Period", "Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("type", "Coding", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("planholder[x]", "Identifier|Reference(Patient|Organization)", "The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.", 0, java.lang.Integer.MAX_VALUE, planholder)); + childrenList.add(new Property("beneficiary[x]", "Identifier|Reference(Patient)", "The party who benefits from the insurance coverage.", 0, java.lang.Integer.MAX_VALUE, beneficiary)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the planholdersubscriber).", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("identifier", "Identifier", "The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("group", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("plan", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, plan)); + childrenList.add(new Property("subPlan", "string", "Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.", 0, java.lang.Integer.MAX_VALUE, subPlan)); + childrenList.add(new Property("dependent", "positiveInt", "A unique identifier for a dependent under the coverage.", 0, java.lang.Integer.MAX_VALUE, dependent)); + childrenList.add(new Property("sequence", "positiveInt", "An optional counter for a particular instance of the identified coverage which increments upon each renewal.", 0, java.lang.Integer.MAX_VALUE, sequence)); + 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("network", "string", "The identifier for a community of providers.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // Type + case 97543: /*bin*/ return this.bin == null ? new Base[0] : new Base[] {this.bin}; // StringType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 1007064597: /*planholder*/ return this.planholder == null ? new Base[0] : new Base[] {this.planholder}; // Type + case -565102875: /*beneficiary*/ return this.beneficiary == null ? new Base[0] : new Base[] {this.beneficiary}; // Type + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 98629247: /*group*/ return this.group == null ? new Base[0] : new Base[] {this.group}; // StringType + case 3443497: /*plan*/ return this.plan == null ? new Base[0] : new Base[] {this.plan}; // StringType + case -1868653175: /*subPlan*/ return this.subPlan == null ? new Base[0] : new Base[] {this.subPlan}; // StringType + case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : new Base[] {this.dependent}; // PositiveIntType + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 1481625679: /*exception*/ return this.exception == null ? new Base[0] : this.exception.toArray(new Base[this.exception.size()]); // Coding + case -907977868: /*school*/ return this.school == null ? new Base[0] : new Base[] {this.school}; // StringType + case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // StringType + case -566947566: /*contract*/ return this.contract == null ? new Base[0] : this.contract.toArray(new Base[this.contract.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1179159879: // issuer + this.issuer = (Type) value; // Type + break; + case 97543: // bin + this.bin = castToString(value); // StringType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 1007064597: // planholder + this.planholder = (Type) value; // Type + break; + case -565102875: // beneficiary + this.beneficiary = (Type) value; // Type + break; + case -261851592: // relationship + this.relationship = castToCoding(value); // Coding + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 98629247: // group + this.group = castToString(value); // StringType + break; + case 3443497: // plan + this.plan = castToString(value); // StringType + break; + case -1868653175: // subPlan + this.subPlan = castToString(value); // StringType + break; + case -1109226753: // dependent + this.dependent = castToPositiveInt(value); // PositiveIntType + break; + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 1481625679: // exception + this.getException().add(castToCoding(value)); // Coding + break; + case -907977868: // school + this.school = castToString(value); // StringType + break; + case 1843485230: // network + this.network = castToString(value); // StringType + break; + case -566947566: // contract + this.getContract().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("issuer[x]")) + this.issuer = (Type) value; // Type + else if (name.equals("bin")) + this.bin = castToString(value); // StringType + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("planholder[x]")) + this.planholder = (Type) value; // Type + else if (name.equals("beneficiary[x]")) + this.beneficiary = (Type) value; // Type + else if (name.equals("relationship")) + this.relationship = castToCoding(value); // Coding + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("group")) + this.group = castToString(value); // StringType + else if (name.equals("plan")) + this.plan = castToString(value); // StringType + else if (name.equals("subPlan")) + this.subPlan = castToString(value); // StringType + else if (name.equals("dependent")) + this.dependent = castToPositiveInt(value); // PositiveIntType + else if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("exception")) + this.getException().add(castToCoding(value)); + else if (name.equals("school")) + this.school = castToString(value); // StringType + else if (name.equals("network")) + this.network = castToString(value); // StringType + else if (name.equals("contract")) + this.getContract().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 185649959: return getIssuer(); // Type + case 97543: throw new FHIRException("Cannot make property bin as it is not a complex type"); // StringType + case -991726143: return getPeriod(); // Period + case 3575610: return getType(); // Coding + case 1114937931: return getPlanholder(); // Type + case 1292142459: return getBeneficiary(); // Type + case -261851592: return getRelationship(); // Coding + case -1618432855: return addIdentifier(); // Identifier + case 98629247: throw new FHIRException("Cannot make property group as it is not a complex type"); // StringType + case 3443497: throw new FHIRException("Cannot make property plan as it is not a complex type"); // StringType + case -1868653175: throw new FHIRException("Cannot make property subPlan as it is not a complex type"); // StringType + case -1109226753: throw new FHIRException("Cannot make property dependent as it is not a complex type"); // PositiveIntType + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 1481625679: return addException(); // Coding + case -907977868: throw new FHIRException("Cannot make property school as it is not a complex type"); // StringType + case 1843485230: throw new FHIRException("Cannot make property network as it is not a complex type"); // StringType + case -566947566: return addContract(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("issuerIdentifier")) { + this.issuer = new Identifier(); + return this.issuer; + } + else if (name.equals("issuerReference")) { + this.issuer = new Reference(); + return this.issuer; + } + else if (name.equals("bin")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.bin"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("planholderIdentifier")) { + this.planholder = new Identifier(); + return this.planholder; + } + else if (name.equals("planholderReference")) { + this.planholder = new Reference(); + return this.planholder; + } + else if (name.equals("beneficiaryIdentifier")) { + this.beneficiary = new Identifier(); + return this.beneficiary; + } + else if (name.equals("beneficiaryReference")) { + this.beneficiary = new Reference(); + return this.beneficiary; + } + else if (name.equals("relationship")) { + this.relationship = new Coding(); + return this.relationship; + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("group")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.group"); + } + else if (name.equals("plan")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.plan"); + } + else if (name.equals("subPlan")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.subPlan"); + } + else if (name.equals("dependent")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.dependent"); + } + else if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.sequence"); + } + else if (name.equals("exception")) { + return addException(); + } + else if (name.equals("school")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.school"); + } + else if (name.equals("network")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.network"); + } + else if (name.equals("contract")) { + return addContract(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Coverage"; + + } + + public Coverage copy() { + Coverage dst = new Coverage(); + copyValues(dst); + dst.issuer = issuer == null ? null : issuer.copy(); + dst.bin = bin == null ? null : bin.copy(); + dst.period = period == null ? null : period.copy(); + dst.type = type == null ? null : type.copy(); + dst.planholder = planholder == null ? null : planholder.copy(); + dst.beneficiary = beneficiary == null ? null : beneficiary.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.group = group == null ? null : group.copy(); + dst.plan = plan == null ? null : plan.copy(); + dst.subPlan = subPlan == null ? null : subPlan.copy(); + dst.dependent = dependent == null ? null : dependent.copy(); + dst.sequence = sequence == null ? null : sequence.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.network = network == null ? null : network.copy(); + if (contract != null) { + dst.contract = new ArrayList(); + for (Reference i : contract) + dst.contract.add(i.copy()); + }; + return dst; + } + + protected Coverage typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Coverage)) + return false; + Coverage o = (Coverage) other; + return compareDeep(issuer, o.issuer, true) && compareDeep(bin, o.bin, true) && compareDeep(period, o.period, true) + && compareDeep(type, o.type, true) && compareDeep(planholder, o.planholder, true) && compareDeep(beneficiary, o.beneficiary, true) + && compareDeep(relationship, o.relationship, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(group, o.group, true) && compareDeep(plan, o.plan, true) && compareDeep(subPlan, o.subPlan, true) + && compareDeep(dependent, o.dependent, true) && compareDeep(sequence, o.sequence, true) && compareDeep(exception, o.exception, true) + && compareDeep(school, o.school, true) && compareDeep(network, o.network, true) && compareDeep(contract, o.contract, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Coverage)) + return false; + Coverage o = (Coverage) other; + return compareValues(bin, o.bin, true) && compareValues(group, o.group, true) && compareValues(plan, o.plan, true) + && compareValues(subPlan, o.subPlan, true) && compareValues(dependent, o.dependent, true) && compareValues(sequence, o.sequence, true) + && compareValues(school, o.school, true) && compareValues(network, o.network, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (issuer == null || issuer.isEmpty()) && (bin == null || bin.isEmpty()) + && (period == null || period.isEmpty()) && (type == null || type.isEmpty()) && (planholder == null || planholder.isEmpty()) + && (beneficiary == null || beneficiary.isEmpty()) && (relationship == null || relationship.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) && (plan == null || plan.isEmpty()) + && (subPlan == null || subPlan.isEmpty()) && (dependent == null || dependent.isEmpty()) && (sequence == null || sequence.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (network == null || network.isEmpty()) + && (contract == null || contract.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Coverage; + } + + /** + * Search parameter: dependent + *

+ * Description: Dependent number
+ * Type: token
+ * Path: Coverage.dependent
+ *

+ */ + @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="token" ) + public static final String SP_DEPENDENT = "dependent"; + /** + * Fluent Client search parameter constant for dependent + *

+ * Description: Dependent number
+ * Type: token
+ * Path: Coverage.dependent
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam DEPENDENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DEPENDENT); + + /** + * Search parameter: beneficiaryreference + *

+ * Description: Covered party
+ * Type: reference
+ * Path: Coverage.beneficiaryReference
+ *

+ */ + @SearchParamDefinition(name="beneficiaryreference", path="Coverage.beneficiary.as(Reference)", description="Covered party", type="reference" ) + public static final String SP_BENEFICIARYREFERENCE = "beneficiaryreference"; + /** + * Fluent Client search parameter constant for beneficiaryreference + *

+ * Description: Covered party
+ * Type: reference
+ * Path: Coverage.beneficiaryReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BENEFICIARYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BENEFICIARYREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Coverage:beneficiaryreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_BENEFICIARYREFERENCE = new ca.uhn.fhir.model.api.Include("Coverage:beneficiaryreference").toLocked(); + + /** + * Search parameter: planholderidentifier + *

+ * Description: Reference to the planholder
+ * Type: token
+ * Path: Coverage.planholderIdentifier
+ *

+ */ + @SearchParamDefinition(name="planholderidentifier", path="Coverage.planholder.as(Identifier)", description="Reference to the planholder", type="token" ) + public static final String SP_PLANHOLDERIDENTIFIER = "planholderidentifier"; + /** + * Fluent Client search parameter constant for planholderidentifier + *

+ * Description: Reference to the planholder
+ * Type: token
+ * Path: Coverage.planholderIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PLANHOLDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PLANHOLDERIDENTIFIER); + + /** + * Search parameter: type + *

+ * Description: The kind of coverage (health plan, auto, Workers Compensation)
+ * Type: token
+ * Path: Coverage.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage (health plan, auto, Workers Compensation)", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The kind of coverage (health plan, auto, Workers Compensation)
+ * Type: token
+ * Path: Coverage.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: issueridentifier + *

+ * Description: The identity of the insurer
+ * Type: token
+ * Path: Coverage.issuerIdentifier
+ *

+ */ + @SearchParamDefinition(name="issueridentifier", path="Coverage.issuer.as(Identifier)", description="The identity of the insurer", type="token" ) + public static final String SP_ISSUERIDENTIFIER = "issueridentifier"; + /** + * Fluent Client search parameter constant for issueridentifier + *

+ * Description: The identity of the insurer
+ * Type: token
+ * Path: Coverage.issuerIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ISSUERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ISSUERIDENTIFIER); + + /** + * Search parameter: subplan + *

+ * Description: Sub-plan identifier
+ * Type: token
+ * Path: Coverage.subPlan
+ *

+ */ + @SearchParamDefinition(name="subplan", path="Coverage.subPlan", description="Sub-plan identifier", type="token" ) + public static final String SP_SUBPLAN = "subplan"; + /** + * Fluent Client search parameter constant for subplan + *

+ * Description: Sub-plan identifier
+ * Type: token
+ * Path: Coverage.subPlan
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBPLAN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBPLAN); + + /** + * Search parameter: issuerreference + *

+ * Description: The identity of the insurer
+ * Type: reference
+ * Path: Coverage.issuerReference
+ *

+ */ + @SearchParamDefinition(name="issuerreference", path="Coverage.issuer.as(Reference)", description="The identity of the insurer", type="reference" ) + public static final String SP_ISSUERREFERENCE = "issuerreference"; + /** + * Fluent Client search parameter constant for issuerreference + *

+ * Description: The identity of the insurer
+ * Type: reference
+ * Path: Coverage.issuerReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ISSUERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ISSUERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Coverage:issuerreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ISSUERREFERENCE = new ca.uhn.fhir.model.api.Include("Coverage:issuerreference").toLocked(); + + /** + * Search parameter: plan + *

+ * Description: A plan or policy identifier
+ * Type: token
+ * Path: Coverage.plan
+ *

+ */ + @SearchParamDefinition(name="plan", path="Coverage.plan", description="A plan or policy identifier", type="token" ) + public static final String SP_PLAN = "plan"; + /** + * Fluent Client search parameter constant for plan + *

+ * Description: A plan or policy identifier
+ * Type: token
+ * Path: Coverage.plan
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PLAN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PLAN); + + /** + * Search parameter: sequence + *

+ * Description: Sequence number
+ * Type: token
+ * Path: Coverage.sequence
+ *

+ */ + @SearchParamDefinition(name="sequence", path="Coverage.sequence", description="Sequence number", type="token" ) + public static final String SP_SEQUENCE = "sequence"; + /** + * Fluent Client search parameter constant for sequence + *

+ * Description: Sequence number
+ * Type: token
+ * Path: Coverage.sequence
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SEQUENCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SEQUENCE); + + /** + * Search parameter: beneficiaryidentifier + *

+ * Description: Covered party
+ * Type: token
+ * Path: Coverage.beneficiaryIdentifier
+ *

+ */ + @SearchParamDefinition(name="beneficiaryidentifier", path="Coverage.beneficiary.as(Identifier)", description="Covered party", type="token" ) + public static final String SP_BENEFICIARYIDENTIFIER = "beneficiaryidentifier"; + /** + * Fluent Client search parameter constant for beneficiaryidentifier + *

+ * Description: Covered party
+ * Type: token
+ * Path: Coverage.beneficiaryIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam BENEFICIARYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BENEFICIARYIDENTIFIER); + + /** + * Search parameter: group + *

+ * Description: Group identifier
+ * Type: token
+ * Path: Coverage.group
+ *

+ */ + @SearchParamDefinition(name="group", path="Coverage.group", description="Group identifier", type="token" ) + public static final String SP_GROUP = "group"; + /** + * Fluent Client search parameter constant for group + *

+ * Description: Group identifier
+ * Type: token
+ * Path: Coverage.group
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam GROUP = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GROUP); + + /** + * Search parameter: planholderreference + *

+ * Description: Reference to the planholder
+ * Type: reference
+ * Path: Coverage.planholderReference
+ *

+ */ + @SearchParamDefinition(name="planholderreference", path="Coverage.planholder.as(Reference)", description="Reference to the planholder", type="reference" ) + public static final String SP_PLANHOLDERREFERENCE = "planholderreference"; + /** + * Fluent Client search parameter constant for planholderreference + *

+ * Description: Reference to the planholder
+ * Type: reference
+ * Path: Coverage.planholderReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PLANHOLDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PLANHOLDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Coverage:planholderreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PLANHOLDERREFERENCE = new ca.uhn.fhir.model.api.Include("Coverage:planholderreference").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The primary identifier of the insured and the coverage
+ * Type: token
+ * Path: Coverage.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Coverage.identifier", description="The primary identifier of the insured and the coverage", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The primary identifier of the insured and the coverage
+ * Type: token
+ * Path: Coverage.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DataElement.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DataElement.java new file mode 100644 index 00000000000..45043ebf7a6 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DataElement.java @@ -0,0 +1,2046 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The formal description of a single piece of information that can be gathered and reported. + */ +@ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement") +public class DataElement extends DomainResource { + + public enum DataElementStringency { + /** + * The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required). + */ + COMPARABLE, + /** + * The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully comparable. + */ + FULLYSPECIFIED, + /** + * The data element allows multiple units of measure having equivalent meaning; e.g. "cc" (cubic centimeter) and "mL" (milliliter). + */ + EQUIVALENT, + /** + * The data element allows multiple units of measure that are convertable between each other (e.g. inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning. + */ + CONVERTABLE, + /** + * A convertable data element where unit conversions are different only by a power of 10; e.g. g, mg, kg. + */ + SCALEABLE, + /** + * The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible. + */ + FLEXIBLE, + /** + * added to help the parsers + */ + NULL; + public static DataElementStringency fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("comparable".equals(codeString)) + return COMPARABLE; + if ("fully-specified".equals(codeString)) + return FULLYSPECIFIED; + if ("equivalent".equals(codeString)) + return EQUIVALENT; + if ("convertable".equals(codeString)) + return CONVERTABLE; + if ("scaleable".equals(codeString)) + return SCALEABLE; + if ("flexible".equals(codeString)) + return FLEXIBLE; + throw new FHIRException("Unknown DataElementStringency code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPARABLE: return "comparable"; + case FULLYSPECIFIED: return "fully-specified"; + case EQUIVALENT: return "equivalent"; + case CONVERTABLE: return "convertable"; + case SCALEABLE: return "scaleable"; + case FLEXIBLE: return "flexible"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPARABLE: return "http://hl7.org/fhir/dataelement-stringency"; + case FULLYSPECIFIED: return "http://hl7.org/fhir/dataelement-stringency"; + case EQUIVALENT: return "http://hl7.org/fhir/dataelement-stringency"; + case CONVERTABLE: return "http://hl7.org/fhir/dataelement-stringency"; + case SCALEABLE: return "http://hl7.org/fhir/dataelement-stringency"; + case FLEXIBLE: return "http://hl7.org/fhir/dataelement-stringency"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPARABLE: return "The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required)."; + case FULLYSPECIFIED: return "The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully comparable."; + case EQUIVALENT: return "The data element allows multiple units of measure having equivalent meaning; e.g. \"cc\" (cubic centimeter) and \"mL\" (milliliter)."; + case CONVERTABLE: return "The data element allows multiple units of measure that are convertable between each other (e.g. inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning."; + case SCALEABLE: return "A convertable data element where unit conversions are different only by a power of 10; e.g. g, mg, kg."; + case FLEXIBLE: return "The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPARABLE: return "Comparable"; + case FULLYSPECIFIED: return "Fully Specified"; + case EQUIVALENT: return "Equivalent"; + case CONVERTABLE: return "Convertable"; + case SCALEABLE: return "Scaleable"; + case FLEXIBLE: return "Flexible"; + default: return "?"; + } + } + } + + public static class DataElementStringencyEnumFactory implements EnumFactory { + public DataElementStringency fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("comparable".equals(codeString)) + return DataElementStringency.COMPARABLE; + if ("fully-specified".equals(codeString)) + return DataElementStringency.FULLYSPECIFIED; + if ("equivalent".equals(codeString)) + return DataElementStringency.EQUIVALENT; + if ("convertable".equals(codeString)) + return DataElementStringency.CONVERTABLE; + if ("scaleable".equals(codeString)) + return DataElementStringency.SCALEABLE; + if ("flexible".equals(codeString)) + return DataElementStringency.FLEXIBLE; + throw new IllegalArgumentException("Unknown DataElementStringency code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("comparable".equals(codeString)) + return new Enumeration(this, DataElementStringency.COMPARABLE); + if ("fully-specified".equals(codeString)) + return new Enumeration(this, DataElementStringency.FULLYSPECIFIED); + if ("equivalent".equals(codeString)) + return new Enumeration(this, DataElementStringency.EQUIVALENT); + if ("convertable".equals(codeString)) + return new Enumeration(this, DataElementStringency.CONVERTABLE); + if ("scaleable".equals(codeString)) + return new Enumeration(this, DataElementStringency.SCALEABLE); + if ("flexible".equals(codeString)) + return new Enumeration(this, DataElementStringency.FLEXIBLE); + throw new FHIRException("Unknown DataElementStringency code '"+codeString+"'"); + } + public String toCode(DataElementStringency code) { + if (code == DataElementStringency.COMPARABLE) + return "comparable"; + if (code == DataElementStringency.FULLYSPECIFIED) + return "fully-specified"; + if (code == DataElementStringency.EQUIVALENT) + return "equivalent"; + if (code == DataElementStringency.CONVERTABLE) + return "convertable"; + if (code == DataElementStringency.SCALEABLE) + return "scaleable"; + if (code == DataElementStringency.FLEXIBLE) + return "flexible"; + return "?"; + } + public String toSystem(DataElementStringency code) { + return code.getSystem(); + } + } + + @Block() + public static class DataElementContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the data element. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the data element." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public DataElementContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the data element.). 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 DataElementContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the data element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public DataElementContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the data element. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the data element. + */ + public DataElementContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public DataElementContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the data element.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public DataElementContactComponent copy() { + DataElementContactComponent dst = new DataElementContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataElementContactComponent)) + return false; + DataElementContactComponent o = (DataElementContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataElementContactComponent)) + return false; + DataElementContactComponent o = (DataElementContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "DataElement.contact"; + + } + + } + + @Block() + public static class DataElementMappingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. + */ + @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis." ) + protected IdType identity; + + /** + * An absolute URI that identifies the specification that this mapping is expressed to. + */ + @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." ) + protected UriType uri; + + /** + * A name for the specification that is being mapped to. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @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 = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @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 comment; + + private static final long serialVersionUID = 9610265L; + + /** + * Constructor + */ + public DataElementMappingComponent() { + super(); + } + + /** + * Constructor + */ + public DataElementMappingComponent(IdType identity) { + super(); + this.identity = identity; + } + + /** + * @return {@link #identity} (An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); // bb + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public DataElementMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. + */ + public DataElementMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); // bb + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public DataElementMappingComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return An absolute URI that identifies the specification that this mapping is expressed to. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value An absolute URI that identifies the specification that this mapping is expressed to. + */ + public DataElementMappingComponent setUri(String value) { + if (Utilities.noString(value)) + this.uri = null; + else { + if (this.uri == null) + this.uri = new UriType(); + this.uri.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 + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (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 + */ + public DataElementMappingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name for the specification that is being mapped to. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name for the specification that is being mapped to. + */ + public DataElementMappingComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #comment} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public DataElementMappingComponent setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public DataElementMappingComponent setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.", 0, java.lang.Integer.MAX_VALUE, identity)); + childrenList.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); + 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("comment", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comment)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType + case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -135761730: // identity + this.identity = castToId(value); // IdType + break; + case 116076: // uri + this.uri = castToUri(value); // UriType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identity")) + this.identity = castToId(value); // IdType + else if (name.equals("uri")) + this.uri = castToUri(value); // UriType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -135761730: throw new FHIRException("Cannot make property identity as it is not a complex type"); // IdType + case 116076: throw new FHIRException("Cannot make property uri as it is not a complex type"); // UriType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identity")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.identity"); + } + else if (name.equals("uri")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.uri"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.name"); + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.comment"); + } + else + return super.addChild(name); + } + + public DataElementMappingComponent copy() { + DataElementMappingComponent dst = new DataElementMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.uri = uri == null ? null : uri.copy(); + dst.name = name == null ? null : name.copy(); + dst.comment = comment == null ? null : comment.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataElementMappingComponent)) + return false; + DataElementMappingComponent o = (DataElementMappingComponent) other; + return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true) + && compareDeep(comment, o.comment, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataElementMappingComponent)) + return false; + DataElementMappingComponent o = (DataElementMappingComponent) other; + return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true) + && compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) + && (name == null || name.isEmpty()) && (comment == null || comment.isEmpty()); + } + + public String fhirType() { + return "DataElement.mapping"; + + } + + } + + /** + * An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Globally unique logical id for data element", formalDefinition="An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Logical id to reference this data element", formalDefinition="Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance." ) + protected List identifier; + + /** + * The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical id for this version of the data element", formalDefinition="The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually." ) + protected StringType version; + + /** + * The status of the data element. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the data element." ) + protected Enumeration status; + + /** + * A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the data element. + */ + @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the data element." ) + protected StringType publisher; + + /** + * The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for this version of the data element", formalDefinition="The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes." ) + protected DateTimeType date; + + /** + * The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Descriptive label for this element definition", formalDefinition="The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used." ) + protected StringType name; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions." ) + protected List useContext; + + /** + * A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. + */ + @Child(name = "copyright", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element." ) + protected StringType copyright; + + /** + * Identifies how precise the data element is in its definition. + */ + @Child(name = "stringency", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="comparable | fully-specified | equivalent | convertable | scaleable | flexible", formalDefinition="Identifies how precise the data element is in its definition." ) + protected Enumeration stringency; + + /** + * Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with. + */ + @Child(name = "mapping", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="External specification mapped to", formalDefinition="Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with." ) + protected List mapping; + + /** + * Defines the structure, type, allowed values and other constraining characteristics of the data element. + */ + @Child(name = "element", type = {ElementDefinition.class}, order=13, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Definition of element", formalDefinition="Defines the structure, type, allowed values and other constraining characteristics of the data element." ) + protected List element; + + private static final long serialVersionUID = 411433995L; + + /** + * Constructor + */ + public DataElement() { + super(); + } + + /** + * Constructor + */ + public DataElement(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public DataElement setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. + */ + public DataElement setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + 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} (Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DataElement addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public DataElement setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + public DataElement setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the data element.). 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 DataElement.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DataElement setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the data element. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the data element. + */ + public DataElement setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public DataElement setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public DataElement setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public DataElement setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the data element. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the data element. + */ + public DataElement setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes.). 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 DataElement.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DataElement setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes. + */ + public DataElement setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). 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 DataElement.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public DataElement setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + public DataElement setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (DataElementContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public DataElementContactComponent addContact() { //3 + DataElementContactComponent t = new DataElementContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public DataElement addContact(DataElementContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public DataElement addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public DataElement setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. + */ + public DataElement setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #stringency} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getStringency" gives direct access to the value + */ + public Enumeration getStringencyElement() { + if (this.stringency == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.stringency"); + else if (Configuration.doAutoCreate()) + this.stringency = new Enumeration(new DataElementStringencyEnumFactory()); // bb + return this.stringency; + } + + public boolean hasStringencyElement() { + return this.stringency != null && !this.stringency.isEmpty(); + } + + public boolean hasStringency() { + return this.stringency != null && !this.stringency.isEmpty(); + } + + /** + * @param value {@link #stringency} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getStringency" gives direct access to the value + */ + public DataElement setStringencyElement(Enumeration value) { + this.stringency = value; + return this; + } + + /** + * @return Identifies how precise the data element is in its definition. + */ + public DataElementStringency getStringency() { + return this.stringency == null ? null : this.stringency.getValue(); + } + + /** + * @param value Identifies how precise the data element is in its definition. + */ + public DataElement setStringency(DataElementStringency value) { + if (value == null) + this.stringency = null; + else { + if (this.stringency == null) + this.stringency = new Enumeration(new DataElementStringencyEnumFactory()); + this.stringency.setValue(value); + } + return this; + } + + /** + * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (DataElementMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.) + */ + // syntactic sugar + public DataElementMappingComponent addMapping() { //3 + DataElementMappingComponent t = new DataElementMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + // syntactic sugar + public DataElement addMapping(DataElementMappingComponent t) { //3 + if (t == null) + return this; + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return this; + } + + /** + * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ElementDefinition item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.) + */ + // syntactic sugar + public ElementDefinition addElement() { //3 + ElementDefinition t = new ElementDefinition(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + // syntactic sugar + public DataElement addElement(ElementDefinition t) { //3 + if (t == null) + return this; + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("status", "code", "The status of the data element.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the data element.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("date", "dateTime", "The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("name", "string", "The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("stringency", "code", "Identifies how precise the data element is in its definition.", 0, java.lang.Integer.MAX_VALUE, stringency)); + childrenList.add(new Property("mapping", "", "Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.", 0, java.lang.Integer.MAX_VALUE, mapping)); + childrenList.add(new Property("element", "ElementDefinition", "Defines the structure, type, allowed values and other constraining characteristics of the data element.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // DataElementContactComponent + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case -1572568464: /*stringency*/ return this.stringency == null ? new Base[0] : new Base[] {this.stringency}; // Enumeration + case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // DataElementMappingComponent + case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((DataElementContactComponent) value); // DataElementContactComponent + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case -1572568464: // stringency + this.stringency = new DataElementStringencyEnumFactory().fromType(value); // Enumeration + break; + case 837556430: // mapping + this.getMapping().add((DataElementMappingComponent) value); // DataElementMappingComponent + break; + case -1662836996: // element + this.getElement().add(castToElementDefinition(value)); // ElementDefinition + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((DataElementContactComponent) value); + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("stringency")) + this.stringency = new DataElementStringencyEnumFactory().fromType(value); // Enumeration + else if (name.equals("mapping")) + this.getMapping().add((DataElementMappingComponent) value); + else if (name.equals("element")) + this.getElement().add(castToElementDefinition(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return addIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 951526432: return addContact(); // DataElementContactComponent + case -669707736: return addUseContext(); // CodeableConcept + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case -1572568464: throw new FHIRException("Cannot make property stringency as it is not a complex type"); // Enumeration + case 837556430: return addMapping(); // DataElementMappingComponent + case -1662836996: return addElement(); // ElementDefinition + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.url"); + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.version"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.publisher"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.date"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.name"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.copyright"); + } + else if (name.equals("stringency")) { + throw new FHIRException("Cannot call addChild on a primitive type DataElement.stringency"); + } + else if (name.equals("mapping")) { + return addMapping(); + } + else if (name.equals("element")) { + return addElement(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DataElement"; + + } + + public DataElement copy() { + DataElement dst = new DataElement(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + dst.date = date == null ? null : date.copy(); + dst.name = name == null ? null : name.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (DataElementContactComponent i : contact) + dst.contact.add(i.copy()); + }; + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.copyright = copyright == null ? null : copyright.copy(); + dst.stringency = stringency == null ? null : stringency.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (DataElementMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + if (element != null) { + dst.element = new ArrayList(); + for (ElementDefinition i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + protected DataElement typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataElement)) + return false; + DataElement o = (DataElement) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(date, o.date, true) && compareDeep(name, o.name, true) && compareDeep(contact, o.contact, true) + && compareDeep(useContext, o.useContext, true) && compareDeep(copyright, o.copyright, true) && compareDeep(stringency, o.stringency, true) + && compareDeep(mapping, o.mapping, true) && compareDeep(element, o.element, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataElement)) + return false; + DataElement o = (DataElement) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(status, o.status, true) + && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(name, o.name, true) && compareValues(copyright, o.copyright, true) + && compareValues(stringency, o.stringency, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (date == null || date.isEmpty()) && (name == null || name.isEmpty()) + && (contact == null || contact.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (stringency == null || stringency.isEmpty()) + && (mapping == null || mapping.isEmpty()) && (element == null || element.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DataElement; + } + + /** + * Search parameter: stringency + *

+ * Description: The stringency of the data element definition
+ * Type: token
+ * Path: DataElement.stringency
+ *

+ */ + @SearchParamDefinition(name="stringency", path="DataElement.stringency", description="The stringency of the data element definition", type="token" ) + public static final String SP_STRINGENCY = "stringency"; + /** + * Fluent Client search parameter constant for stringency + *

+ * Description: The stringency of the data element definition
+ * Type: token
+ * Path: DataElement.stringency
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STRINGENCY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STRINGENCY); + + /** + * Search parameter: status + *

+ * Description: The current status of the data element
+ * Type: token
+ * Path: DataElement.status
+ *

+ */ + @SearchParamDefinition(name="status", path="DataElement.status", description="The current status of the data element", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the data element
+ * Type: token
+ * Path: DataElement.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the data element. This corresponds to the definition of the first DataElement.element.
+ * Type: string
+ * Path: DataElement.element.definition
+ *

+ */ + @SearchParamDefinition(name="description", path="DataElement.element.definition", description="Text search in the description of the data element. This corresponds to the definition of the first DataElement.element.", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the data element. This corresponds to the definition of the first DataElement.element.
+ * Type: string
+ * Path: DataElement.element.definition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: Name of the data element
+ * Type: string
+ * Path: DataElement.name
+ *

+ */ + @SearchParamDefinition(name="name", path="DataElement.name", description="Name of the data element", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the data element
+ * Type: string
+ * Path: DataElement.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the data element
+ * Type: token
+ * Path: DataElement.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="DataElement.useContext", description="A use context assigned to the data element", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the data element
+ * Type: token
+ * Path: DataElement.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: code + *

+ * Description: A code for the data element (server may choose to do subsumption)
+ * Type: token
+ * Path: DataElement.element.code
+ *

+ */ + @SearchParamDefinition(name="code", path="DataElement.element.code", description="A code for the data element (server may choose to do subsumption)", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: A code for the data element (server may choose to do subsumption)
+ * Type: token
+ * Path: DataElement.element.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: The data element publication date
+ * Type: date
+ * Path: DataElement.date
+ *

+ */ + @SearchParamDefinition(name="date", path="DataElement.date", description="The data element publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The data element publication date
+ * Type: date
+ * Path: DataElement.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: The identifier of the data element
+ * Type: token
+ * Path: DataElement.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DataElement.identifier", description="The identifier of the data element", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier of the data element
+ * Type: token
+ * Path: DataElement.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: url + *

+ * Description: The official URL for the data element
+ * Type: uri
+ * Path: DataElement.url
+ *

+ */ + @SearchParamDefinition(name="url", path="DataElement.url", description="The official URL for the data element", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: The official URL for the data element
+ * Type: uri
+ * Path: DataElement.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the data element
+ * Type: string
+ * Path: DataElement.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="DataElement.publisher", description="Name of the publisher of the data element", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the data element
+ * Type: string
+ * Path: DataElement.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the data element
+ * Type: string
+ * Path: DataElement.version
+ *

+ */ + @SearchParamDefinition(name="version", path="DataElement.version", description="The version identifier of the data element", type="string" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the data element
+ * Type: string
+ * Path: DataElement.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DataRequirement.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DataRequirement.java new file mode 100644 index 00000000000..977a7a2bcbb --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DataRequirement.java @@ -0,0 +1,1153 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; +import org.hl7.fhir.instance.model.api.ICompositeType; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. + */ +@DatatypeDef(name="DataRequirement") +public class DataRequirement extends Type implements ICompositeType { + + @Block() + public static class DataRequirementCodeFilterComponent extends Element implements IBaseDatatypeElement { + /** + * The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. + */ + @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The code-valued attribute of the filter", formalDefinition="The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept." ) + protected StringType path; + + /** + * The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset. + */ + @Child(name = "valueSet", type = {StringType.class, ValueSet.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Valueset for the filter", formalDefinition="The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset." ) + protected Type valueSet; + + /** + * The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes. + */ + @Child(name = "valueCode", type = {CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Code value of the filter", formalDefinition="The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes." ) + protected List valueCode; + + /** + * The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings. + */ + @Child(name = "valueCoding", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Coding value of the filter", formalDefinition="The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings." ) + protected List valueCoding; + + /** + * The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts. + */ + @Child(name = "valueCodeableConcept", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="CodeableConcept value of the filter", formalDefinition="The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts." ) + protected List valueCodeableConcept; + + private static final long serialVersionUID = -888422840L; + + /** + * Constructor + */ + public DataRequirementCodeFilterComponent() { + super(); + } + + /** + * Constructor + */ + public DataRequirementCodeFilterComponent(StringType path) { + super(); + this.path = path; + } + + /** + * @return {@link #path} (The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataRequirementCodeFilterComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public DataRequirementCodeFilterComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. + */ + public DataRequirementCodeFilterComponent setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #valueSet} (The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) + */ + public Type getValueSet() { + return this.valueSet; + } + + /** + * @return {@link #valueSet} (The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) + */ + public StringType getValueSetStringType() throws FHIRException { + if (!(this.valueSet instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (StringType) this.valueSet; + } + + public boolean hasValueSetStringType() { + return this.valueSet instanceof StringType; + } + + /** + * @return {@link #valueSet} (The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) + */ + public Reference getValueSetReference() throws FHIRException { + if (!(this.valueSet instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (Reference) this.valueSet; + } + + public boolean hasValueSetReference() { + return this.valueSet instanceof Reference; + } + + public boolean hasValueSet() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + /** + * @param value {@link #valueSet} (The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) + */ + public DataRequirementCodeFilterComponent setValueSet(Type value) { + this.valueSet = value; + return this; + } + + /** + * @return {@link #valueCode} (The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.) + */ + public List getValueCode() { + if (this.valueCode == null) + this.valueCode = new ArrayList(); + return this.valueCode; + } + + public boolean hasValueCode() { + if (this.valueCode == null) + return false; + for (CodeType item : this.valueCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valueCode} (The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.) + */ + // syntactic sugar + public CodeType addValueCodeElement() {//2 + CodeType t = new CodeType(); + if (this.valueCode == null) + this.valueCode = new ArrayList(); + this.valueCode.add(t); + return t; + } + + /** + * @param value {@link #valueCode} (The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.) + */ + public DataRequirementCodeFilterComponent addValueCode(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.valueCode == null) + this.valueCode = new ArrayList(); + this.valueCode.add(t); + return this; + } + + /** + * @param value {@link #valueCode} (The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.) + */ + public boolean hasValueCode(String value) { + if (this.valueCode == null) + return false; + for (CodeType v : this.valueCode) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #valueCoding} (The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings.) + */ + public List getValueCoding() { + if (this.valueCoding == null) + this.valueCoding = new ArrayList(); + return this.valueCoding; + } + + public boolean hasValueCoding() { + if (this.valueCoding == null) + return false; + for (Coding item : this.valueCoding) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valueCoding} (The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings.) + */ + // syntactic sugar + public Coding addValueCoding() { //3 + Coding t = new Coding(); + if (this.valueCoding == null) + this.valueCoding = new ArrayList(); + this.valueCoding.add(t); + return t; + } + + // syntactic sugar + public DataRequirementCodeFilterComponent addValueCoding(Coding t) { //3 + if (t == null) + return this; + if (this.valueCoding == null) + this.valueCoding = new ArrayList(); + this.valueCoding.add(t); + return this; + } + + /** + * @return {@link #valueCodeableConcept} (The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts.) + */ + public List getValueCodeableConcept() { + if (this.valueCodeableConcept == null) + this.valueCodeableConcept = new ArrayList(); + return this.valueCodeableConcept; + } + + public boolean hasValueCodeableConcept() { + if (this.valueCodeableConcept == null) + return false; + for (CodeableConcept item : this.valueCodeableConcept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valueCodeableConcept} (The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts.) + */ + // syntactic sugar + public CodeableConcept addValueCodeableConcept() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.valueCodeableConcept == null) + this.valueCodeableConcept = new ArrayList(); + this.valueCodeableConcept.add(t); + return t; + } + + // syntactic sugar + public DataRequirementCodeFilterComponent addValueCodeableConcept(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.valueCodeableConcept == null) + this.valueCodeableConcept = new ArrayList(); + this.valueCodeableConcept.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("valueSet[x]", "string|Reference(ValueSet)", "The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + childrenList.add(new Property("valueCode", "code", "The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.", 0, java.lang.Integer.MAX_VALUE, valueCode)); + childrenList.add(new Property("valueCoding", "Coding", "The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings.", 0, java.lang.Integer.MAX_VALUE, valueCoding)); + childrenList.add(new Property("valueCodeableConcept", "CodeableConcept", "The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts.", 0, java.lang.Integer.MAX_VALUE, valueCodeableConcept)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type + case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // CodeType + case -1887705029: /*valueCoding*/ return this.valueCoding == null ? new Base[0] : this.valueCoding.toArray(new Base[this.valueCoding.size()]); // Coding + case 924902896: /*valueCodeableConcept*/ return this.valueCodeableConcept == null ? new Base[0] : this.valueCodeableConcept.toArray(new Base[this.valueCodeableConcept.size()]); // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3433509: // path + this.path = castToString(value); // StringType + break; + case -1410174671: // valueSet + this.valueSet = (Type) value; // Type + break; + case -766209282: // valueCode + this.getValueCode().add(castToCode(value)); // CodeType + break; + case -1887705029: // valueCoding + this.getValueCoding().add(castToCoding(value)); // Coding + break; + case 924902896: // valueCodeableConcept + this.getValueCodeableConcept().add(castToCodeableConcept(value)); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("valueSet[x]")) + this.valueSet = (Type) value; // Type + else if (name.equals("valueCode")) + this.getValueCode().add(castToCode(value)); + else if (name.equals("valueCoding")) + this.getValueCoding().add(castToCoding(value)); + else if (name.equals("valueCodeableConcept")) + this.getValueCodeableConcept().add(castToCodeableConcept(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case -1438410321: return getValueSet(); // Type + case -766209282: throw new FHIRException("Cannot make property valueCode as it is not a complex type"); // CodeType + case -1887705029: return addValueCoding(); // Coding + case 924902896: return addValueCodeableConcept(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.path"); + } + else if (name.equals("valueSetString")) { + this.valueSet = new StringType(); + return this.valueSet; + } + else if (name.equals("valueSetReference")) { + this.valueSet = new Reference(); + return this.valueSet; + } + else if (name.equals("valueCode")) { + throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.valueCode"); + } + else if (name.equals("valueCoding")) { + return addValueCoding(); + } + else if (name.equals("valueCodeableConcept")) { + return addValueCodeableConcept(); + } + else + return super.addChild(name); + } + + public DataRequirementCodeFilterComponent copy() { + DataRequirementCodeFilterComponent dst = new DataRequirementCodeFilterComponent(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + dst.valueSet = valueSet == null ? null : valueSet.copy(); + if (valueCode != null) { + dst.valueCode = new ArrayList(); + for (CodeType i : valueCode) + dst.valueCode.add(i.copy()); + }; + if (valueCoding != null) { + dst.valueCoding = new ArrayList(); + for (Coding i : valueCoding) + dst.valueCoding.add(i.copy()); + }; + if (valueCodeableConcept != null) { + dst.valueCodeableConcept = new ArrayList(); + for (CodeableConcept i : valueCodeableConcept) + dst.valueCodeableConcept.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataRequirementCodeFilterComponent)) + return false; + DataRequirementCodeFilterComponent o = (DataRequirementCodeFilterComponent) other; + return compareDeep(path, o.path, true) && compareDeep(valueSet, o.valueSet, true) && compareDeep(valueCode, o.valueCode, true) + && compareDeep(valueCoding, o.valueCoding, true) && compareDeep(valueCodeableConcept, o.valueCodeableConcept, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataRequirementCodeFilterComponent)) + return false; + DataRequirementCodeFilterComponent o = (DataRequirementCodeFilterComponent) other; + return compareValues(path, o.path, true) && compareValues(valueCode, o.valueCode, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (valueSet == null || valueSet.isEmpty()) + && (valueCode == null || valueCode.isEmpty()) && (valueCoding == null || valueCoding.isEmpty()) + && (valueCodeableConcept == null || valueCodeableConcept.isEmpty()); + } + + public String fhirType() { + return "DataRequirement.codeFilter"; + + } + + } + + @Block() + public static class DataRequirementDateFilterComponent extends Element implements IBaseDatatypeElement { + /** + * The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. + */ + @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The date-valued attribute of the filter", formalDefinition="The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing." ) + protected StringType path; + + /** + * The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. + */ + @Child(name = "value", type = {DateTimeType.class, Period.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The value of the filter, as a Period or dateTime value", formalDefinition="The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime." ) + protected Type value; + + private static final long serialVersionUID = 1791957163L; + + /** + * Constructor + */ + public DataRequirementDateFilterComponent() { + super(); + } + + /** + * Constructor + */ + public DataRequirementDateFilterComponent(StringType path) { + super(); + this.path = path; + } + + /** + * @return {@link #path} (The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataRequirementDateFilterComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public DataRequirementDateFilterComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. + */ + public DataRequirementDateFilterComponent setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) + */ + public DateTimeType getValueDateTimeType() throws FHIRException { + if (!(this.value instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + public boolean hasValueDateTimeType() { + return this.value instanceof DateTimeType; + } + + /** + * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) + */ + public Period getValuePeriod() throws FHIRException { + if (!(this.value instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Period) this.value; + } + + public boolean hasValuePeriod() { + return this.value instanceof Period; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) + */ + public DataRequirementDateFilterComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("value[x]", "dateTime|Period", "The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3433509: // path + this.path = castToString(value); // StringType + break; + case 111972721: // value + this.value = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("value[x]")) + this.value = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case -1410166417: return getValue(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.path"); + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else + return super.addChild(name); + } + + public DataRequirementDateFilterComponent copy() { + DataRequirementDateFilterComponent dst = new DataRequirementDateFilterComponent(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataRequirementDateFilterComponent)) + return false; + DataRequirementDateFilterComponent o = (DataRequirementDateFilterComponent) other; + return compareDeep(path, o.path, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataRequirementDateFilterComponent)) + return false; + DataRequirementDateFilterComponent o = (DataRequirementDateFilterComponent) other; + return compareValues(path, o.path, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "DataRequirement.dateFilter"; + + } + + } + + /** + * The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The type of the required data", formalDefinition="The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile." ) + protected CodeType type; + + /** + * The profile of the required data, specified as the uri of the profile definition. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The profile of the required data", formalDefinition="The profile of the required data, specified as the uri of the profile definition." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (The profile of the required data, specified as the uri of the profile definition.) + */ + protected StructureDefinition profileTarget; + + /** + * Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. + */ + @Child(name = "mustSupport", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Indicates that specific structure elements are referenced by the knowledge module", formalDefinition="Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available." ) + protected List mustSupport; + + /** + * Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. + */ + @Child(name = "codeFilter", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Code filters for the data", formalDefinition="Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data." ) + protected List codeFilter; + + /** + * Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. + */ + @Child(name = "dateFilter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Date filters for the data", formalDefinition="Date filters specify additional constraints on the data in terms of the applicable date range for specific elements." ) + protected List dateFilter; + + private static final long serialVersionUID = 1768899744L; + + /** + * Constructor + */ + public DataRequirement() { + super(); + } + + /** + * Constructor + */ + public DataRequirement(CodeType type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.). 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 DataRequirement.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public DataRequirement setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. + */ + public DataRequirement setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataRequirement.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) + */ + public DataRequirement 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. (The profile of the required data, specified as the uri of the profile definition.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataRequirement.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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. (The profile of the required data, specified as the uri of the profile definition.) + */ + public DataRequirement setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) + */ + public List getMustSupport() { + if (this.mustSupport == null) + this.mustSupport = new ArrayList(); + return this.mustSupport; + } + + public boolean hasMustSupport() { + if (this.mustSupport == null) + return false; + for (StringType item : this.mustSupport) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) + */ + // syntactic sugar + public StringType addMustSupportElement() {//2 + StringType t = new StringType(); + if (this.mustSupport == null) + this.mustSupport = new ArrayList(); + this.mustSupport.add(t); + return t; + } + + /** + * @param value {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) + */ + public DataRequirement addMustSupport(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.mustSupport == null) + this.mustSupport = new ArrayList(); + this.mustSupport.add(t); + return this; + } + + /** + * @param value {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) + */ + public boolean hasMustSupport(String value) { + if (this.mustSupport == null) + return false; + for (StringType v : this.mustSupport) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #codeFilter} (Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data.) + */ + public List getCodeFilter() { + if (this.codeFilter == null) + this.codeFilter = new ArrayList(); + return this.codeFilter; + } + + public boolean hasCodeFilter() { + if (this.codeFilter == null) + return false; + for (DataRequirementCodeFilterComponent item : this.codeFilter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeFilter} (Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data.) + */ + // syntactic sugar + public DataRequirementCodeFilterComponent addCodeFilter() { //3 + DataRequirementCodeFilterComponent t = new DataRequirementCodeFilterComponent(); + if (this.codeFilter == null) + this.codeFilter = new ArrayList(); + this.codeFilter.add(t); + return t; + } + + // syntactic sugar + public DataRequirement addCodeFilter(DataRequirementCodeFilterComponent t) { //3 + if (t == null) + return this; + if (this.codeFilter == null) + this.codeFilter = new ArrayList(); + this.codeFilter.add(t); + return this; + } + + /** + * @return {@link #dateFilter} (Date filters specify additional constraints on the data in terms of the applicable date range for specific elements.) + */ + public List getDateFilter() { + if (this.dateFilter == null) + this.dateFilter = new ArrayList(); + return this.dateFilter; + } + + public boolean hasDateFilter() { + if (this.dateFilter == null) + return false; + for (DataRequirementDateFilterComponent item : this.dateFilter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dateFilter} (Date filters specify additional constraints on the data in terms of the applicable date range for specific elements.) + */ + // syntactic sugar + public DataRequirementDateFilterComponent addDateFilter() { //3 + DataRequirementDateFilterComponent t = new DataRequirementDateFilterComponent(); + if (this.dateFilter == null) + this.dateFilter = new ArrayList(); + this.dateFilter.add(t); + return t; + } + + // syntactic sugar + public DataRequirement addDateFilter(DataRequirementDateFilterComponent t) { //3 + if (t == null) + return this; + if (this.dateFilter == null) + this.dateFilter = new ArrayList(); + this.dateFilter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "The profile of the required data, specified as the uri of the profile definition.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("mustSupport", "string", "Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); + childrenList.add(new Property("codeFilter", "", "Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data.", 0, java.lang.Integer.MAX_VALUE, codeFilter)); + childrenList.add(new Property("dateFilter", "", "Date filters specify additional constraints on the data in terms of the applicable date range for specific elements.", 0, java.lang.Integer.MAX_VALUE, dateFilter)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : this.mustSupport.toArray(new Base[this.mustSupport.size()]); // StringType + case -1303674939: /*codeFilter*/ return this.codeFilter == null ? new Base[0] : this.codeFilter.toArray(new Base[this.codeFilter.size()]); // DataRequirementCodeFilterComponent + case 149531846: /*dateFilter*/ return this.dateFilter == null ? new Base[0] : this.dateFilter.toArray(new Base[this.dateFilter.size()]); // DataRequirementDateFilterComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + case -1402857082: // mustSupport + this.getMustSupport().add(castToString(value)); // StringType + break; + case -1303674939: // codeFilter + this.getCodeFilter().add((DataRequirementCodeFilterComponent) value); // DataRequirementCodeFilterComponent + break; + case 149531846: // dateFilter + this.getDateFilter().add((DataRequirementDateFilterComponent) value); // DataRequirementDateFilterComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else if (name.equals("mustSupport")) + this.getMustSupport().add(castToString(value)); + else if (name.equals("codeFilter")) + this.getCodeFilter().add((DataRequirementCodeFilterComponent) value); + else if (name.equals("dateFilter")) + this.getDateFilter().add((DataRequirementDateFilterComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case -309425751: return getProfile(); // Reference + case -1402857082: throw new FHIRException("Cannot make property mustSupport as it is not a complex type"); // StringType + case -1303674939: return addCodeFilter(); // DataRequirementCodeFilterComponent + case 149531846: return addDateFilter(); // DataRequirementDateFilterComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.type"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else if (name.equals("mustSupport")) { + throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.mustSupport"); + } + else if (name.equals("codeFilter")) { + return addCodeFilter(); + } + else if (name.equals("dateFilter")) { + return addDateFilter(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DataRequirement"; + + } + + public DataRequirement copy() { + DataRequirement dst = new DataRequirement(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + if (mustSupport != null) { + dst.mustSupport = new ArrayList(); + for (StringType i : mustSupport) + dst.mustSupport.add(i.copy()); + }; + if (codeFilter != null) { + dst.codeFilter = new ArrayList(); + for (DataRequirementCodeFilterComponent i : codeFilter) + dst.codeFilter.add(i.copy()); + }; + if (dateFilter != null) { + dst.dateFilter = new ArrayList(); + for (DataRequirementDateFilterComponent i : dateFilter) + dst.dateFilter.add(i.copy()); + }; + return dst; + } + + protected DataRequirement typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DataRequirement)) + return false; + DataRequirement o = (DataRequirement) other; + return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(mustSupport, o.mustSupport, true) + && compareDeep(codeFilter, o.codeFilter, true) && compareDeep(dateFilter, o.dateFilter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DataRequirement)) + return false; + DataRequirement o = (DataRequirement) other; + return compareValues(type, o.type, true) && compareValues(mustSupport, o.mustSupport, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) + && (mustSupport == null || mustSupport.isEmpty()) && (codeFilter == null || codeFilter.isEmpty()) + && (dateFilter == null || dateFilter.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DateTimeType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DateTimeType.java new file mode 100644 index 00000000000..f9d4b2e2e33 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DateTimeType.java @@ -0,0 +1,196 @@ +/* +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. + +*/ + +package org.hl7.fhir.dstu2016may.model; + +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import java.util.zip.DataFormatException; + +import org.apache.commons.lang3.time.DateUtils; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Represents a FHIR dateTime datatype. Valid precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ +@DatatypeDef(name = "dateTime") +public class DateTimeType extends BaseDateTimeType { + + private static final long serialVersionUID = 3L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.SECOND; + + /** + * Constructor + */ + public DateTimeType() { + super(); + } + + /** + * Create a new DateTimeDt with seconds precision and the local time zone + */ + public DateTimeType(Date theDate) { + super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); + } + + /** + * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ * + * @throws DataFormatException + * If the specified precision is not allowed for this type + */ + public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) { + super(theDate, thePrecision, TimeZone.getDefault()); + } + + /** + * Create a new instance using a string date/time + * + * @throws DataFormatException + * If the specified precision is not allowed for this type + */ + public DateTimeType(String theValue) { + super(theValue); + } + + /** + * Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type + * are: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ + public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { + 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) { + case YEAR: + case MONTH: + case DAY: + case SECOND: + case MILLI: + return true; + default: + return false; + } + } + + /** + * Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time + * zone + */ + public static DateTimeType now() { + return new DateTimeType(new Date(), TemporalPrecisionEnum.SECOND, TimeZone.getDefault()); + } + + /** + * Returns the default precision for this datatype + * + * @see #DEFAULT_PRECISION + */ + @Override + protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { + return DEFAULT_PRECISION; + } + + @Override + public DateTimeType copy() { + return new DateTimeType(getValueAsString()); + } + + /** + * Creates a new instance by parsing an HL7 v3 format date time string + */ + public static DateTimeType parseV3(String theV3String) { + DateTimeType retVal = new DateTimeType(); + 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; + } + + + public String fhirType() { + return "dateTime"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DateType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DateType.java new file mode 100644 index 00000000000..32148c05b18 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DateType.java @@ -0,0 +1,171 @@ +/* +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. + +*/ + +package org.hl7.fhir.dstu2016may.model; + +import java.util.Calendar; + +/** + * Primitive type "date" in FHIR: any day in a gregorian calendar + */ + +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Represents a FHIR date datatype. Valid precisions values for this type are: + *
    + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} + *
+ */ +@DatatypeDef(name = "date") +public class DateType extends BaseDateTimeType { + + private static final long serialVersionUID = 3L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.DAY; + + /** + * Constructor + */ + public DateType() { + super(); + } + + /** + * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type + */ + public DateType(Date theDate) { + super(theDate, DEFAULT_PRECISION); + } + + /** + * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: + *
    + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} + *
+ * + * @throws ca.uhn.fhir.parser.DataFormatException + * If the specified precision is not allowed for this type + */ + public DateType(Date theDate, TemporalPrecisionEnum thePrecision) { + super(theDate, thePrecision); + } + + /** + * Constructor which accepts a date as a string in FHIR format + * + * @throws ca.uhn.fhir.parser.DataFormatException + * If the precision in the date string is not allowed for this type + */ + public DateType(String theDate) { + super(theDate); + } + + /** + * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type. + */ + public DateType(Calendar theCalendar) { + super(theCalendar.getTime(), DEFAULT_PRECISION); + setTimeZone(theCalendar.getTimeZone()); + } + + /** + * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type. + * + * @param theYear The year, e.g. 2015 + * @param theMonth The month, e.g. 0 for January + * @param theDay The day (1 indexed) e.g. 1 for the first day of the month + */ + public DateType(int theYear, int theMonth, int theDay) { + this(toCalendarZulu(theYear, theMonth, theDay)); + } + + private static GregorianCalendar toCalendarZulu(int theYear, int theMonth, int theDay) { + GregorianCalendar retVal = new GregorianCalendar(TimeZone.getTimeZone("GMT")); + retVal.set(Calendar.YEAR, theYear); + retVal.set(Calendar.MONTH, theMonth); + retVal.set(Calendar.DATE, theDay); + return retVal; + } + + @Override + boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { + switch (thePrecision) { + case YEAR: + case MONTH: + case DAY: + return true; + default: + return false; + } + } + + /** + * Returns the default precision for this datatype + * + * @see #DEFAULT_PRECISION + */ + @Override + protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { + return DEFAULT_PRECISION; + } + + @Override + public DateType copy() { + return new DateType(getValueAsString()); + } + + public static InstantType today() { + return new InstantType(new Date(), TemporalPrecisionEnum.DAY, TimeZone.getDefault()); + } + + /** + * Creates a new instance by parsing an HL7 v3 format date time string + */ + public static DateType parseV3(String theV3String) { + DateType retVal = new DateType(); + retVal.setValueAsV3String(theV3String); + return retVal; + } + + public String fhirType() { + return "date"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecimalType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecimalType.java new file mode 100644 index 00000000000..e8c934e6bb4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecimalType.java @@ -0,0 +1,177 @@ +/* +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. + + */ +/** + * + */ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.math.RoundingMode; + +import org.hl7.fhir.instance.model.api.IBaseDecimalDatatype; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "decimal" in FHIR: A rational number + */ +@DatatypeDef(name = "decimal") +public class DecimalType extends PrimitiveType implements Comparable, IBaseDecimalDatatype { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public DecimalType() { + super(); + } + + /** + * Constructor + */ + public DecimalType(BigDecimal theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + public DecimalType(double theValue) { + // Use the valueOf here because the constructor gives wacky precision + // changes due to the floating point conversion + setValue(BigDecimal.valueOf(theValue)); + } + + /** + * Constructor + */ + public DecimalType(long theValue) { + setValue(new BigDecimal(theValue)); + } + + /** + * Constructor + */ + public DecimalType(String theValue) { + setValue(new BigDecimal(theValue)); + } + + @Override + public int compareTo(DecimalType theObj) { + if (getValue() == null && theObj.getValue() == null) { + return 0; + } + if (getValue() != null && theObj.getValue() == null) { + return 1; + } + if (getValue() == null && theObj.getValue() != null) { + return -1; + } + return getValue().compareTo(theObj.getValue()); + } + + @Override + protected String encode(BigDecimal theValue) { + return getValue().toPlainString(); + } + + /** + * Gets the value as an integer, using {@link BigDecimal#intValue()} + */ + public int getValueAsInteger() { + return getValue().intValue(); + } + + public Number getValueAsNumber() { + return getValue(); + } + + @Override + protected BigDecimal parse(String theValue) { + return new BigDecimal(theValue); + } + + /** + * Rounds the value to the given prevision + * + * @see MathContext#getPrecision() + */ + public void round(int thePrecision) { + if (getValue() != null) { + BigDecimal newValue = getValue().round(new MathContext(thePrecision)); + setValue(newValue); + } + } + + /** + * Rounds the value to the given prevision + * + * @see MathContext#getPrecision() + * @see MathContext#getRoundingMode() + */ + public void round(int thePrecision, RoundingMode theRoundingMode) { + if (getValue() != null) { + BigDecimal newValue = getValue().round(new MathContext(thePrecision, theRoundingMode)); + setValue(newValue); + } + } + + /** + * Sets a new value using an integer + */ + public void setValueAsInteger(int theValue) { + setValue(new BigDecimal(theValue)); + } + + /** + * Sets a new value using a long + */ + public void setValue(long theValue) { + setValue(new BigDecimal(theValue)); + } + + /** + * Sets a new value using a double + */ + public void setValue(double theValue) { + setValue(new BigDecimal(theValue)); + } + + @Override + public DecimalType copy() { + return new DecimalType(getValue()); + } + + public String fhirType() { + return "decimal"; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecisionSupportRule.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecisionSupportRule.java new file mode 100644 index 00000000000..5d01e848b0d --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecisionSupportRule.java @@ -0,0 +1,595 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events. + */ +@ResourceDef(name="DecisionSupportRule", profile="http://hl7.org/fhir/Profile/DecisionSupportRule") +public class DecisionSupportRule extends DomainResource { + + /** + * The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence. + */ + @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Module information for the rule", formalDefinition="The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence." ) + protected ModuleMetadata moduleMetadata; + + /** + * A reference to a Library containing the formal logic used by the rule. + */ + @Child(name = "library", type = {Library.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Logic used within the rule", formalDefinition="A reference to a Library containing the formal logic used by the rule." ) + protected List library; + /** + * The actual objects that are the target of the reference (A reference to a Library containing the formal logic used by the rule.) + */ + protected List libraryTarget; + + + /** + * The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow. + */ + @Child(name = "trigger", type = {TriggerDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="\"when\" the rule should be invoked", formalDefinition="The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow." ) + protected List trigger; + + /** + * The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library. + */ + @Child(name = "condition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="\"if\" some condition is true", formalDefinition="The condition element describes he \"if\" portion of the rule that determines whether or not the rule \"fires\". The condition must be the name of an expression in a referenced library." ) + protected StringType condition; + + /** + * The action element defines the "when" portion of the rule that determines what actions should be performed if the condition evaluates to true. + */ + @Child(name = "action", type = {ActionDefinition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="\"then\" perform these actions", formalDefinition="The action element defines the \"when\" portion of the rule that determines what actions should be performed if the condition evaluates to true." ) + protected List action; + + private static final long serialVersionUID = -810482843L; + + /** + * Constructor + */ + public DecisionSupportRule() { + super(); + } + + /** + * @return {@link #moduleMetadata} (The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence.) + */ + public ModuleMetadata getModuleMetadata() { + if (this.moduleMetadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DecisionSupportRule.moduleMetadata"); + else if (Configuration.doAutoCreate()) + this.moduleMetadata = new ModuleMetadata(); // cc + return this.moduleMetadata; + } + + public boolean hasModuleMetadata() { + return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); + } + + /** + * @param value {@link #moduleMetadata} (The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence.) + */ + public DecisionSupportRule setModuleMetadata(ModuleMetadata value) { + this.moduleMetadata = value; + return this; + } + + /** + * @return {@link #library} (A reference to a Library containing the formal logic used by the rule.) + */ + public List getLibrary() { + if (this.library == null) + this.library = new ArrayList(); + return this.library; + } + + public boolean hasLibrary() { + if (this.library == null) + return false; + for (Reference item : this.library) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #library} (A reference to a Library containing the formal logic used by the rule.) + */ + // syntactic sugar + public Reference addLibrary() { //3 + Reference t = new Reference(); + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return t; + } + + // syntactic sugar + public DecisionSupportRule addLibrary(Reference t) { //3 + if (t == null) + return this; + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return this; + } + + /** + * @return {@link #library} (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 reference to a Library containing the formal logic used by the rule.) + */ + public List getLibraryTarget() { + if (this.libraryTarget == null) + this.libraryTarget = new ArrayList(); + return this.libraryTarget; + } + + // syntactic sugar + /** + * @return {@link #library} (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 reference to a Library containing the formal logic used by the rule.) + */ + public Library addLibraryTarget() { + Library r = new Library(); + if (this.libraryTarget == null) + this.libraryTarget = new ArrayList(); + this.libraryTarget.add(r); + return r; + } + + /** + * @return {@link #trigger} (The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.) + */ + public List getTrigger() { + if (this.trigger == null) + this.trigger = new ArrayList(); + return this.trigger; + } + + public boolean hasTrigger() { + if (this.trigger == null) + return false; + for (TriggerDefinition item : this.trigger) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #trigger} (The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.) + */ + // syntactic sugar + public TriggerDefinition addTrigger() { //3 + TriggerDefinition t = new TriggerDefinition(); + if (this.trigger == null) + this.trigger = new ArrayList(); + this.trigger.add(t); + return t; + } + + // syntactic sugar + public DecisionSupportRule addTrigger(TriggerDefinition t) { //3 + if (t == null) + return this; + if (this.trigger == null) + this.trigger = new ArrayList(); + this.trigger.add(t); + return this; + } + + /** + * @return {@link #condition} (The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value + */ + public StringType getConditionElement() { + if (this.condition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DecisionSupportRule.condition"); + else if (Configuration.doAutoCreate()) + this.condition = new StringType(); // bb + return this.condition; + } + + public boolean hasConditionElement() { + return this.condition != null && !this.condition.isEmpty(); + } + + public boolean hasCondition() { + return this.condition != null && !this.condition.isEmpty(); + } + + /** + * @param value {@link #condition} (The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value + */ + public DecisionSupportRule setConditionElement(StringType value) { + this.condition = value; + return this; + } + + /** + * @return The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library. + */ + public String getCondition() { + return this.condition == null ? null : this.condition.getValue(); + } + + /** + * @param value The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library. + */ + public DecisionSupportRule setCondition(String value) { + if (Utilities.noString(value)) + this.condition = null; + else { + if (this.condition == null) + this.condition = new StringType(); + this.condition.setValue(value); + } + return this; + } + + /** + * @return {@link #action} (The action element defines the "when" portion of the rule that determines what actions should be performed if the condition evaluates to true.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (ActionDefinition item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (The action element defines the "when" portion of the rule that determines what actions should be performed if the condition evaluates to true.) + */ + // syntactic sugar + public ActionDefinition addAction() { //3 + ActionDefinition t = new ActionDefinition(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public DecisionSupportRule addAction(ActionDefinition t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); + childrenList.add(new Property("library", "Reference(Library)", "A reference to a Library containing the formal logic used by the rule.", 0, java.lang.Integer.MAX_VALUE, library)); + childrenList.add(new Property("trigger", "TriggerDefinition", "The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.", 0, java.lang.Integer.MAX_VALUE, trigger)); + childrenList.add(new Property("condition", "string", "The condition element describes he \"if\" portion of the rule that determines whether or not the rule \"fires\". The condition must be the name of an expression in a referenced library.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("action", "ActionDefinition", "The action element defines the \"when\" portion of the rule that determines what actions should be performed if the condition evaluates to true.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata + case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // Reference + case -1059891784: /*trigger*/ return this.trigger == null ? new Base[0] : this.trigger.toArray(new Base[this.trigger.size()]); // TriggerDefinition + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // StringType + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // ActionDefinition + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 455891387: // moduleMetadata + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + break; + case 166208699: // library + this.getLibrary().add(castToReference(value)); // Reference + break; + case -1059891784: // trigger + this.getTrigger().add(castToTriggerDefinition(value)); // TriggerDefinition + break; + case -861311717: // condition + this.condition = castToString(value); // StringType + break; + case -1422950858: // action + this.getAction().add(castToActionDefinition(value)); // ActionDefinition + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("moduleMetadata")) + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + else if (name.equals("library")) + this.getLibrary().add(castToReference(value)); + else if (name.equals("trigger")) + this.getTrigger().add(castToTriggerDefinition(value)); + else if (name.equals("condition")) + this.condition = castToString(value); // StringType + else if (name.equals("action")) + this.getAction().add(castToActionDefinition(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 455891387: return getModuleMetadata(); // ModuleMetadata + case 166208699: return addLibrary(); // Reference + case -1059891784: return addTrigger(); // TriggerDefinition + case -861311717: throw new FHIRException("Cannot make property condition as it is not a complex type"); // StringType + case -1422950858: return addAction(); // ActionDefinition + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("moduleMetadata")) { + this.moduleMetadata = new ModuleMetadata(); + return this.moduleMetadata; + } + else if (name.equals("library")) { + return addLibrary(); + } + else if (name.equals("trigger")) { + return addTrigger(); + } + else if (name.equals("condition")) { + throw new FHIRException("Cannot call addChild on a primitive type DecisionSupportRule.condition"); + } + else if (name.equals("action")) { + return addAction(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DecisionSupportRule"; + + } + + public DecisionSupportRule copy() { + DecisionSupportRule dst = new DecisionSupportRule(); + copyValues(dst); + dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); + if (library != null) { + dst.library = new ArrayList(); + for (Reference i : library) + dst.library.add(i.copy()); + }; + if (trigger != null) { + dst.trigger = new ArrayList(); + for (TriggerDefinition i : trigger) + dst.trigger.add(i.copy()); + }; + dst.condition = condition == null ? null : condition.copy(); + if (action != null) { + dst.action = new ArrayList(); + for (ActionDefinition i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + protected DecisionSupportRule typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DecisionSupportRule)) + return false; + DecisionSupportRule o = (DecisionSupportRule) other; + return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(library, o.library, true) + && compareDeep(trigger, o.trigger, true) && compareDeep(condition, o.condition, true) && compareDeep(action, o.action, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DecisionSupportRule)) + return false; + DecisionSupportRule o = (DecisionSupportRule) other; + return compareValues(condition, o.condition, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (library == null || library.isEmpty()) + && (trigger == null || trigger.isEmpty()) && (condition == null || condition.isEmpty()) && (action == null || action.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DecisionSupportRule; + } + + /** + * Search parameter: topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: DecisionSupportRule.moduleMetadata.topic
+ *

+ */ + @SearchParamDefinition(name="topic", path="DecisionSupportRule.moduleMetadata.topic", description="Topics associated with the module", type="token" ) + public static final String SP_TOPIC = "topic"; + /** + * Fluent Client search parameter constant for topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: DecisionSupportRule.moduleMetadata.topic
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); + + /** + * Search parameter: title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: DecisionSupportRule.moduleMetadata.title
+ *

+ */ + @SearchParamDefinition(name="title", path="DecisionSupportRule.moduleMetadata.title", description="Text search against the title", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: DecisionSupportRule.moduleMetadata.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: DecisionSupportRule.moduleMetadata.status
+ *

+ */ + @SearchParamDefinition(name="status", path="DecisionSupportRule.moduleMetadata.status", description="Status of the module", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: DecisionSupportRule.moduleMetadata.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: DecisionSupportRule.moduleMetadata.description
+ *

+ */ + @SearchParamDefinition(name="description", path="DecisionSupportRule.moduleMetadata.description", description="Text search against the description", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: DecisionSupportRule.moduleMetadata.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: DecisionSupportRule.moduleMetadata.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DecisionSupportRule.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: DecisionSupportRule.moduleMetadata.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: DecisionSupportRule.moduleMetadata.version
+ *

+ */ + @SearchParamDefinition(name="version", path="DecisionSupportRule.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: DecisionSupportRule.moduleMetadata.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecisionSupportServiceModule.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecisionSupportServiceModule.java new file mode 100644 index 00000000000..c18a59a5bc2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DecisionSupportServiceModule.java @@ -0,0 +1,500 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking. + */ +@ResourceDef(name="DecisionSupportServiceModule", profile="http://hl7.org/fhir/Profile/DecisionSupportServiceModule") +public class DecisionSupportServiceModule extends DomainResource { + + /** + * The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence. + */ + @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Metadata for the service module", formalDefinition="The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence." ) + protected ModuleMetadata moduleMetadata; + + /** + * The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow. + */ + @Child(name = "trigger", type = {TriggerDefinition.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="\"when\" the module should be invoked", formalDefinition="The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow." ) + protected List trigger; + + /** + * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. + */ + @Child(name = "parameter", type = {ParameterDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Parameters to the module", formalDefinition="The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse." ) + protected List parameter; + + /** + * Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation. + */ + @Child(name = "dataRequirement", type = {DataRequirement.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Data requirements for the module", formalDefinition="Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation." ) + protected List dataRequirement; + + private static final long serialVersionUID = 1154664442L; + + /** + * Constructor + */ + public DecisionSupportServiceModule() { + super(); + } + + /** + * @return {@link #moduleMetadata} (The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence.) + */ + public ModuleMetadata getModuleMetadata() { + if (this.moduleMetadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DecisionSupportServiceModule.moduleMetadata"); + else if (Configuration.doAutoCreate()) + this.moduleMetadata = new ModuleMetadata(); // cc + return this.moduleMetadata; + } + + public boolean hasModuleMetadata() { + return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); + } + + /** + * @param value {@link #moduleMetadata} (The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence.) + */ + public DecisionSupportServiceModule setModuleMetadata(ModuleMetadata value) { + this.moduleMetadata = value; + return this; + } + + /** + * @return {@link #trigger} (The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.) + */ + public List getTrigger() { + if (this.trigger == null) + this.trigger = new ArrayList(); + return this.trigger; + } + + public boolean hasTrigger() { + if (this.trigger == null) + return false; + for (TriggerDefinition item : this.trigger) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #trigger} (The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.) + */ + // syntactic sugar + public TriggerDefinition addTrigger() { //3 + TriggerDefinition t = new TriggerDefinition(); + if (this.trigger == null) + this.trigger = new ArrayList(); + this.trigger.add(t); + return t; + } + + // syntactic sugar + public DecisionSupportServiceModule addTrigger(TriggerDefinition t) { //3 + if (t == null) + return this; + if (this.trigger == null) + this.trigger = new ArrayList(); + this.trigger.add(t); + return this; + } + + /** + * @return {@link #parameter} (The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (ParameterDefinition item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.) + */ + // syntactic sugar + public ParameterDefinition addParameter() { //3 + ParameterDefinition t = new ParameterDefinition(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public DecisionSupportServiceModule addParameter(ParameterDefinition t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + /** + * @return {@link #dataRequirement} (Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation.) + */ + public List getDataRequirement() { + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + return this.dataRequirement; + } + + public boolean hasDataRequirement() { + if (this.dataRequirement == null) + return false; + for (DataRequirement item : this.dataRequirement) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dataRequirement} (Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation.) + */ + // syntactic sugar + public DataRequirement addDataRequirement() { //3 + DataRequirement t = new DataRequirement(); + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + this.dataRequirement.add(t); + return t; + } + + // syntactic sugar + public DecisionSupportServiceModule addDataRequirement(DataRequirement t) { //3 + if (t == null) + return this; + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + this.dataRequirement.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); + childrenList.add(new Property("trigger", "TriggerDefinition", "The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.", 0, java.lang.Integer.MAX_VALUE, trigger)); + childrenList.add(new Property("parameter", "ParameterDefinition", "The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("dataRequirement", "DataRequirement", "Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation.", 0, java.lang.Integer.MAX_VALUE, dataRequirement)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata + case -1059891784: /*trigger*/ return this.trigger == null ? new Base[0] : this.trigger.toArray(new Base[this.trigger.size()]); // TriggerDefinition + case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParameterDefinition + case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 455891387: // moduleMetadata + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + break; + case -1059891784: // trigger + this.getTrigger().add(castToTriggerDefinition(value)); // TriggerDefinition + break; + case 1954460585: // parameter + this.getParameter().add(castToParameterDefinition(value)); // ParameterDefinition + break; + case 629147193: // dataRequirement + this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("moduleMetadata")) + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + else if (name.equals("trigger")) + this.getTrigger().add(castToTriggerDefinition(value)); + else if (name.equals("parameter")) + this.getParameter().add(castToParameterDefinition(value)); + else if (name.equals("dataRequirement")) + this.getDataRequirement().add(castToDataRequirement(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 455891387: return getModuleMetadata(); // ModuleMetadata + case -1059891784: return addTrigger(); // TriggerDefinition + case 1954460585: return addParameter(); // ParameterDefinition + case 629147193: return addDataRequirement(); // DataRequirement + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("moduleMetadata")) { + this.moduleMetadata = new ModuleMetadata(); + return this.moduleMetadata; + } + else if (name.equals("trigger")) { + return addTrigger(); + } + else if (name.equals("parameter")) { + return addParameter(); + } + else if (name.equals("dataRequirement")) { + return addDataRequirement(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DecisionSupportServiceModule"; + + } + + public DecisionSupportServiceModule copy() { + DecisionSupportServiceModule dst = new DecisionSupportServiceModule(); + copyValues(dst); + dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); + if (trigger != null) { + dst.trigger = new ArrayList(); + for (TriggerDefinition i : trigger) + dst.trigger.add(i.copy()); + }; + if (parameter != null) { + dst.parameter = new ArrayList(); + for (ParameterDefinition i : parameter) + dst.parameter.add(i.copy()); + }; + if (dataRequirement != null) { + dst.dataRequirement = new ArrayList(); + for (DataRequirement i : dataRequirement) + dst.dataRequirement.add(i.copy()); + }; + return dst; + } + + protected DecisionSupportServiceModule typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DecisionSupportServiceModule)) + return false; + DecisionSupportServiceModule o = (DecisionSupportServiceModule) other; + return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(trigger, o.trigger, true) + && compareDeep(parameter, o.parameter, true) && compareDeep(dataRequirement, o.dataRequirement, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DecisionSupportServiceModule)) + return false; + DecisionSupportServiceModule o = (DecisionSupportServiceModule) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (trigger == null || trigger.isEmpty()) + && (parameter == null || parameter.isEmpty()) && (dataRequirement == null || dataRequirement.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DecisionSupportServiceModule; + } + + /** + * Search parameter: topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: DecisionSupportServiceModule.moduleMetadata.topic
+ *

+ */ + @SearchParamDefinition(name="topic", path="DecisionSupportServiceModule.moduleMetadata.topic", description="Topics associated with the module", type="token" ) + public static final String SP_TOPIC = "topic"; + /** + * Fluent Client search parameter constant for topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: DecisionSupportServiceModule.moduleMetadata.topic
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); + + /** + * Search parameter: title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: DecisionSupportServiceModule.moduleMetadata.title
+ *

+ */ + @SearchParamDefinition(name="title", path="DecisionSupportServiceModule.moduleMetadata.title", description="Text search against the title", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: DecisionSupportServiceModule.moduleMetadata.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: DecisionSupportServiceModule.moduleMetadata.status
+ *

+ */ + @SearchParamDefinition(name="status", path="DecisionSupportServiceModule.moduleMetadata.status", description="Status of the module", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: DecisionSupportServiceModule.moduleMetadata.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: DecisionSupportServiceModule.moduleMetadata.description
+ *

+ */ + @SearchParamDefinition(name="description", path="DecisionSupportServiceModule.moduleMetadata.description", description="Text search against the description", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: DecisionSupportServiceModule.moduleMetadata.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: DecisionSupportServiceModule.moduleMetadata.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DecisionSupportServiceModule.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: DecisionSupportServiceModule.moduleMetadata.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: DecisionSupportServiceModule.moduleMetadata.version
+ *

+ */ + @SearchParamDefinition(name="version", path="DecisionSupportServiceModule.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: DecisionSupportServiceModule.moduleMetadata.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DetectedIssue.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DetectedIssue.java new file mode 100644 index 00000000000..3ac2c3b35ba --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DetectedIssue.java @@ -0,0 +1,1308 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + */ +@ResourceDef(name="DetectedIssue", profile="http://hl7.org/fhir/Profile/DetectedIssue") +public class DetectedIssue extends DomainResource { + + public enum DetectedIssueSeverity { + /** + * Indicates the issue may be life-threatening or has the potential to cause permanent injury. + */ + HIGH, + /** + * Indicates the issue may result in noticeable adverse consequences but is unlikely to be life-threatening or cause permanent injury. + */ + MODERATE, + /** + * Indicates the issue may result in some adverse consequences but is unlikely to substantially affect the situation of the subject. + */ + LOW, + /** + * added to help the parsers + */ + NULL; + public static DetectedIssueSeverity fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("high".equals(codeString)) + return HIGH; + if ("moderate".equals(codeString)) + return MODERATE; + if ("low".equals(codeString)) + return LOW; + throw new FHIRException("Unknown DetectedIssueSeverity code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HIGH: return "high"; + case MODERATE: return "moderate"; + case LOW: return "low"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HIGH: return "http://hl7.org/fhir/detectedissue-severity"; + case MODERATE: return "http://hl7.org/fhir/detectedissue-severity"; + case LOW: return "http://hl7.org/fhir/detectedissue-severity"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HIGH: return "Indicates the issue may be life-threatening or has the potential to cause permanent injury."; + case MODERATE: return "Indicates the issue may result in noticeable adverse consequences but is unlikely to be life-threatening or cause permanent injury."; + case LOW: return "Indicates the issue may result in some adverse consequences but is unlikely to substantially affect the situation of the subject."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HIGH: return "High"; + case MODERATE: return "Moderate"; + case LOW: return "Low"; + default: return "?"; + } + } + } + + public static class DetectedIssueSeverityEnumFactory implements EnumFactory { + public DetectedIssueSeverity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("high".equals(codeString)) + return DetectedIssueSeverity.HIGH; + if ("moderate".equals(codeString)) + return DetectedIssueSeverity.MODERATE; + if ("low".equals(codeString)) + return DetectedIssueSeverity.LOW; + throw new IllegalArgumentException("Unknown DetectedIssueSeverity code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("high".equals(codeString)) + return new Enumeration(this, DetectedIssueSeverity.HIGH); + if ("moderate".equals(codeString)) + return new Enumeration(this, DetectedIssueSeverity.MODERATE); + if ("low".equals(codeString)) + return new Enumeration(this, DetectedIssueSeverity.LOW); + throw new FHIRException("Unknown DetectedIssueSeverity code '"+codeString+"'"); + } + public String toCode(DetectedIssueSeverity code) { + if (code == DetectedIssueSeverity.HIGH) + return "high"; + if (code == DetectedIssueSeverity.MODERATE) + return "moderate"; + if (code == DetectedIssueSeverity.LOW) + return "low"; + return "?"; + } + public String toSystem(DetectedIssueSeverity code) { + return code.getSystem(); + } + } + + @Block() + public static class DetectedIssueMitigationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue. + */ + @Child(name = "action", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="What mitigation?", formalDefinition="Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue." ) + protected CodeableConcept action; + + /** + * Indicates when the mitigating action was documented. + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Date committed", formalDefinition="Indicates when the mitigating action was documented." ) + protected DateTimeType date; + + /** + * Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. + */ + @Child(name = "author", type = {Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who is committing?", formalDefinition="Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + protected Practitioner authorTarget; + + private static final long serialVersionUID = -1994768436L; + + /** + * Constructor + */ + public DetectedIssueMitigationComponent() { + super(); + } + + /** + * Constructor + */ + public DetectedIssueMitigationComponent(CodeableConcept action) { + super(); + this.action = action; + } + + /** + * @return {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.) + */ + public CodeableConcept getAction() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssueMitigationComponent.action"); + else if (Configuration.doAutoCreate()) + this.action = new CodeableConcept(); // cc + return this.action; + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.) + */ + public DetectedIssueMitigationComponent setAction(CodeableConcept value) { + this.action = value; + return this; + } + + /** + * @return {@link #date} (Indicates when the mitigating action was documented.). 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 DetectedIssueMitigationComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DetectedIssueMitigationComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Indicates when the mitigating action was documented. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Indicates when the mitigating action was documented. + */ + public DetectedIssueMitigationComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssueMitigationComponent.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public DetectedIssueMitigationComponent setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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 practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public Practitioner getAuthorTarget() { + if (this.authorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssueMitigationComponent.author"); + else if (Configuration.doAutoCreate()) + this.authorTarget = new Practitioner(); // aa + return this.authorTarget; + } + + /** + * @param value {@link #author} 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 practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public DetectedIssueMitigationComponent setAuthorTarget(Practitioner value) { + this.authorTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("action", "CodeableConcept", "Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("date", "dateTime", "Indicates when the mitigating action was documented.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("author", "Reference(Practitioner)", "Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.", 0, java.lang.Integer.MAX_VALUE, author)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // CodeableConcept + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422950858: // action + this.action = castToCodeableConcept(value); // CodeableConcept + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("action")) + this.action = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422950858: return getAction(); // CodeableConcept + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1406328437: return getAuthor(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("action")) { + this.action = new CodeableConcept(); + return this.action; + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.date"); + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else + return super.addChild(name); + } + + public DetectedIssueMitigationComponent copy() { + DetectedIssueMitigationComponent dst = new DetectedIssueMitigationComponent(); + copyValues(dst); + dst.action = action == null ? null : action.copy(); + dst.date = date == null ? null : date.copy(); + dst.author = author == null ? null : author.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetectedIssueMitigationComponent)) + return false; + DetectedIssueMitigationComponent o = (DetectedIssueMitigationComponent) other; + return compareDeep(action, o.action, true) && compareDeep(date, o.date, true) && compareDeep(author, o.author, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetectedIssueMitigationComponent)) + return false; + DetectedIssueMitigationComponent o = (DetectedIssueMitigationComponent) other; + return compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (action == null || action.isEmpty()) && (date == null || date.isEmpty()) + && (author == null || author.isEmpty()); + } + + public String fhirType() { + return "DetectedIssue.mitigation"; + + } + + } + + /** + * Indicates the patient whose record the detected issue is associated with. + */ + @Child(name = "patient", type = {Patient.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Associated patient", formalDefinition="Indicates the patient whose record the detected issue is associated with." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Indicates the patient whose record the detected issue is associated with.) + */ + protected Patient patientTarget; + + /** + * Identifies the general type of issue identified. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Issue Category, e.g. drug-drug, duplicate therapy, etc.", formalDefinition="Identifies the general type of issue identified." ) + protected CodeableConcept category; + + /** + * Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + @Child(name = "severity", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="high | moderate | low", formalDefinition="Indicates the degree of importance associated with the identified issue based on the potential impact on the patient." ) + protected Enumeration severity; + + /** + * Indicates the resource representing the current activity or proposed activity that is potentially problematic. + */ + @Child(name = "implicated", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Problem resource", formalDefinition="Indicates the resource representing the current activity or proposed activity that is potentially problematic." ) + protected List implicated; + /** + * The actual objects that are the target of the reference (Indicates the resource representing the current activity or proposed activity that is potentially problematic.) + */ + protected List implicatedTarget; + + + /** + * A textual explanation of the detected issue. + */ + @Child(name = "detail", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Description and context", formalDefinition="A textual explanation of the detected issue." ) + protected StringType detail; + + /** + * The date or date-time when the detected issue was initially identified. + */ + @Child(name = "date", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When identified", formalDefinition="The date or date-time when the detected issue was initially identified." ) + protected DateTimeType date; + + /** + * Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review. + */ + @Child(name = "author", type = {Practitioner.class, Device.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The provider or device that identified the issue", formalDefinition="Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) + */ + protected Resource authorTarget; + + /** + * Business identifier associated with the detected issue record. + */ + @Child(name = "identifier", type = {Identifier.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique id for the detected issue", formalDefinition="Business identifier associated with the detected issue record." ) + protected Identifier identifier; + + /** + * The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified. + */ + @Child(name = "reference", type = {UriType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Authority for issue", formalDefinition="The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified." ) + protected UriType reference; + + /** + * Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. + */ + @Child(name = "mitigation", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Step taken to address", formalDefinition="Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action." ) + protected List mitigation; + + private static final long serialVersionUID = -403732234L; + + /** + * Constructor + */ + public DetectedIssue() { + super(); + } + + /** + * @return {@link #patient} (Indicates the patient whose record the detected issue is associated with.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssue.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Indicates the patient whose record the detected issue is associated with.) + */ + public DetectedIssue 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. (Indicates the patient whose record the detected issue is associated with.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssue.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (Indicates the patient whose record the detected issue is associated with.) + */ + public DetectedIssue setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #category} (Identifies the general type of issue identified.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssue.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Identifies the general type of issue identified.) + */ + public DetectedIssue setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssue.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(new DetectedIssueSeverityEnumFactory()); // bb + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public DetectedIssue setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + public DetectedIssueSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + public DetectedIssue setSeverity(DetectedIssueSeverity value) { + if (value == null) + this.severity = null; + else { + if (this.severity == null) + this.severity = new Enumeration(new DetectedIssueSeverityEnumFactory()); + this.severity.setValue(value); + } + return this; + } + + /** + * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that is potentially problematic.) + */ + public List getImplicated() { + if (this.implicated == null) + this.implicated = new ArrayList(); + return this.implicated; + } + + public boolean hasImplicated() { + if (this.implicated == null) + return false; + for (Reference item : this.implicated) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that is potentially problematic.) + */ + // syntactic sugar + public Reference addImplicated() { //3 + Reference t = new Reference(); + if (this.implicated == null) + this.implicated = new ArrayList(); + this.implicated.add(t); + return t; + } + + // syntactic sugar + public DetectedIssue addImplicated(Reference t) { //3 + if (t == null) + return this; + if (this.implicated == null) + this.implicated = new ArrayList(); + this.implicated.add(t); + return this; + } + + /** + * @return {@link #implicated} (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. Indicates the resource representing the current activity or proposed activity that is potentially problematic.) + */ + public List getImplicatedTarget() { + if (this.implicatedTarget == null) + this.implicatedTarget = new ArrayList(); + return this.implicatedTarget; + } + + /** + * @return {@link #detail} (A textual explanation of the detected issue.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value + */ + public StringType getDetailElement() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssue.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new StringType(); // bb + return this.detail; + } + + public boolean hasDetailElement() { + return this.detail != null && !this.detail.isEmpty(); + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (A textual explanation of the detected issue.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value + */ + public DetectedIssue setDetailElement(StringType value) { + this.detail = value; + return this; + } + + /** + * @return A textual explanation of the detected issue. + */ + public String getDetail() { + return this.detail == null ? null : this.detail.getValue(); + } + + /** + * @param value A textual explanation of the detected issue. + */ + public DetectedIssue setDetail(String value) { + if (Utilities.noString(value)) + this.detail = null; + else { + if (this.detail == null) + this.detail = new StringType(); + this.detail.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date or date-time when the detected issue was initially identified.). 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 DetectedIssue.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date or date-time when the detected issue was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DetectedIssue setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date or date-time when the detected issue was initially identified. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date or date-time when the detected issue was initially identified. + */ + public DetectedIssue setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssue.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) + */ + public DetectedIssue setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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. (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} 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. (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) + */ + public DetectedIssue setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Business identifier associated with the detected issue record.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssue.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Business identifier associated with the detected issue record.) + */ + public DetectedIssue setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public UriType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetectedIssue.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new UriType(); // bb + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public DetectedIssue setReferenceElement(UriType value) { + this.reference = value; + return this; + } + + /** + * @return The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified. + */ + public DetectedIssue setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new UriType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) + */ + public List getMitigation() { + if (this.mitigation == null) + this.mitigation = new ArrayList(); + return this.mitigation; + } + + public boolean hasMitigation() { + if (this.mitigation == null) + return false; + for (DetectedIssueMitigationComponent item : this.mitigation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) + */ + // syntactic sugar + public DetectedIssueMitigationComponent addMitigation() { //3 + DetectedIssueMitigationComponent t = new DetectedIssueMitigationComponent(); + if (this.mitigation == null) + this.mitigation = new ArrayList(); + this.mitigation.add(t); + return t; + } + + // syntactic sugar + public DetectedIssue addMitigation(DetectedIssueMitigationComponent t) { //3 + if (t == null) + return this; + if (this.mitigation == null) + this.mitigation = new ArrayList(); + this.mitigation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient whose record the detected issue is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("category", "CodeableConcept", "Identifies the general type of issue identified.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("severity", "code", "Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("implicated", "Reference(Any)", "Indicates the resource representing the current activity or proposed activity that is potentially problematic.", 0, java.lang.Integer.MAX_VALUE, implicated)); + childrenList.add(new Property("detail", "string", "A textual explanation of the detected issue.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("date", "dateTime", "The date or date-time when the detected issue was initially identified.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("author", "Reference(Practitioner|Device)", "Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("identifier", "Identifier", "Business identifier associated with the detected issue record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("reference", "uri", "The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("mitigation", "", "Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.", 0, java.lang.Integer.MAX_VALUE, mitigation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration + case -810216884: /*implicated*/ return this.implicated == null ? new Base[0] : this.implicated.toArray(new Base[this.implicated.size()]); // Reference + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // StringType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType + case 1293793087: /*mitigation*/ return this.mitigation == null ? new Base[0] : this.mitigation.toArray(new Base[this.mitigation.size()]); // DetectedIssueMitigationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case 1478300413: // severity + this.severity = new DetectedIssueSeverityEnumFactory().fromType(value); // Enumeration + break; + case -810216884: // implicated + this.getImplicated().add(castToReference(value)); // Reference + break; + case -1335224239: // detail + this.detail = castToString(value); // StringType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -925155509: // reference + this.reference = castToUri(value); // UriType + break; + case 1293793087: // mitigation + this.getMitigation().add((DetectedIssueMitigationComponent) value); // DetectedIssueMitigationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("severity")) + this.severity = new DetectedIssueSeverityEnumFactory().fromType(value); // Enumeration + else if (name.equals("implicated")) + this.getImplicated().add(castToReference(value)); + else if (name.equals("detail")) + this.detail = castToString(value); // StringType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("reference")) + this.reference = castToUri(value); // UriType + else if (name.equals("mitigation")) + this.getMitigation().add((DetectedIssueMitigationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -791418107: return getPatient(); // Reference + case 50511102: return getCategory(); // CodeableConcept + case 1478300413: throw new FHIRException("Cannot make property severity as it is not a complex type"); // Enumeration + case -810216884: return addImplicated(); // Reference + case -1335224239: throw new FHIRException("Cannot make property detail as it is not a complex type"); // StringType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1406328437: return getAuthor(); // Reference + case -1618432855: return getIdentifier(); // Identifier + case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // UriType + case 1293793087: return addMitigation(); // DetectedIssueMitigationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("severity")) { + throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.severity"); + } + else if (name.equals("implicated")) { + return addImplicated(); + } + else if (name.equals("detail")) { + throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.detail"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.date"); + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("reference")) { + throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.reference"); + } + else if (name.equals("mitigation")) { + return addMitigation(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DetectedIssue"; + + } + + public DetectedIssue copy() { + DetectedIssue dst = new DetectedIssue(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.category = category == null ? null : category.copy(); + dst.severity = severity == null ? null : severity.copy(); + if (implicated != null) { + dst.implicated = new ArrayList(); + for (Reference i : implicated) + dst.implicated.add(i.copy()); + }; + dst.detail = detail == null ? null : detail.copy(); + dst.date = date == null ? null : date.copy(); + dst.author = author == null ? null : author.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.reference = reference == null ? null : reference.copy(); + if (mitigation != null) { + dst.mitigation = new ArrayList(); + for (DetectedIssueMitigationComponent i : mitigation) + dst.mitigation.add(i.copy()); + }; + return dst; + } + + protected DetectedIssue typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetectedIssue)) + return false; + DetectedIssue o = (DetectedIssue) other; + return compareDeep(patient, o.patient, true) && compareDeep(category, o.category, true) && compareDeep(severity, o.severity, true) + && compareDeep(implicated, o.implicated, true) && compareDeep(detail, o.detail, true) && compareDeep(date, o.date, true) + && compareDeep(author, o.author, true) && compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true) + && compareDeep(mitigation, o.mitigation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetectedIssue)) + return false; + DetectedIssue o = (DetectedIssue) other; + return compareValues(severity, o.severity, true) && compareValues(detail, o.detail, true) && compareValues(date, o.date, true) + && compareValues(reference, o.reference, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (category == null || category.isEmpty()) + && (severity == null || severity.isEmpty()) && (implicated == null || implicated.isEmpty()) + && (detail == null || detail.isEmpty()) && (date == null || date.isEmpty()) && (author == null || author.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) + && (mitigation == null || mitigation.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DetectedIssue; + } + + /** + * Search parameter: author + *

+ * Description: The provider or device that identified the issue
+ * Type: reference
+ * Path: DetectedIssue.author
+ *

+ */ + @SearchParamDefinition(name="author", path="DetectedIssue.author", description="The provider or device that identified the issue", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: The provider or device that identified the issue
+ * Type: reference
+ * Path: DetectedIssue.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DetectedIssue:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("DetectedIssue:author").toLocked(); + + /** + * Search parameter: category + *

+ * Description: Issue Category, e.g. drug-drug, duplicate therapy, etc.
+ * Type: token
+ * Path: DetectedIssue.category
+ *

+ */ + @SearchParamDefinition(name="category", path="DetectedIssue.category", description="Issue Category, e.g. drug-drug, duplicate therapy, etc.", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: Issue Category, e.g. drug-drug, duplicate therapy, etc.
+ * Type: token
+ * Path: DetectedIssue.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: implicated + *

+ * Description: Problem resource
+ * Type: reference
+ * Path: DetectedIssue.implicated
+ *

+ */ + @SearchParamDefinition(name="implicated", path="DetectedIssue.implicated", description="Problem resource", type="reference" ) + public static final String SP_IMPLICATED = "implicated"; + /** + * Fluent Client search parameter constant for implicated + *

+ * Description: Problem resource
+ * Type: reference
+ * Path: DetectedIssue.implicated
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam IMPLICATED = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_IMPLICATED); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DetectedIssue:implicated". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_IMPLICATED = new ca.uhn.fhir.model.api.Include("DetectedIssue:implicated").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: Associated patient
+ * Type: reference
+ * Path: DetectedIssue.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="DetectedIssue.patient", description="Associated patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Associated patient
+ * Type: reference
+ * Path: DetectedIssue.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DetectedIssue:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DetectedIssue:patient").toLocked(); + + /** + * Search parameter: date + *

+ * Description: When identified
+ * Type: date
+ * Path: DetectedIssue.date
+ *

+ */ + @SearchParamDefinition(name="date", path="DetectedIssue.date", description="When identified", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When identified
+ * Type: date
+ * Path: DetectedIssue.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Unique id for the detected issue
+ * Type: token
+ * Path: DetectedIssue.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DetectedIssue.identifier", description="Unique id for the detected issue", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique id for the detected issue
+ * Type: token
+ * Path: DetectedIssue.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Device.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Device.java new file mode 100644 index 00000000000..9620d73de38 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Device.java @@ -0,0 +1,1497 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. + */ +@ResourceDef(name="Device", profile="http://hl7.org/fhir/Profile/Device") +public class Device extends DomainResource { + + public enum DeviceStatus { + /** + * The Device is available for use. + */ + AVAILABLE, + /** + * The Device is no longer available for use (e.g. lost, expired, damaged). + */ + NOTAVAILABLE, + /** + * The Device was entered in error and voided. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static DeviceStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("available".equals(codeString)) + return AVAILABLE; + if ("not-available".equals(codeString)) + return NOTAVAILABLE; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown DeviceStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case AVAILABLE: return "available"; + case NOTAVAILABLE: return "not-available"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AVAILABLE: return "http://hl7.org/fhir/devicestatus"; + case NOTAVAILABLE: return "http://hl7.org/fhir/devicestatus"; + case ENTEREDINERROR: return "http://hl7.org/fhir/devicestatus"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AVAILABLE: return "The Device is available for use."; + case NOTAVAILABLE: return "The Device is no longer available for use (e.g. lost, expired, damaged)."; + case ENTEREDINERROR: return "The Device was entered in error and voided."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AVAILABLE: return "Available"; + case NOTAVAILABLE: return "Not Available"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + public static class DeviceStatusEnumFactory implements EnumFactory { + public DeviceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("available".equals(codeString)) + return DeviceStatus.AVAILABLE; + if ("not-available".equals(codeString)) + return DeviceStatus.NOTAVAILABLE; + if ("entered-in-error".equals(codeString)) + return DeviceStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DeviceStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("available".equals(codeString)) + return new Enumeration(this, DeviceStatus.AVAILABLE); + if ("not-available".equals(codeString)) + return new Enumeration(this, DeviceStatus.NOTAVAILABLE); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, DeviceStatus.ENTEREDINERROR); + throw new FHIRException("Unknown DeviceStatus code '"+codeString+"'"); + } + public String toCode(DeviceStatus code) { + if (code == DeviceStatus.AVAILABLE) + return "available"; + if (code == DeviceStatus.NOTAVAILABLE) + return "not-available"; + if (code == DeviceStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(DeviceStatus code) { + return code.getSystem(); + } + } + + /** + * Unique instance identifiers assigned to a device by manufacturers other organizations or owners. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Instance identifier", formalDefinition="Unique instance identifiers assigned to a device by manufacturers other organizations or owners." ) + protected List identifier; + + /** + * [Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package. + */ + @Child(name = "udiCarrier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Unique Device Identifier (UDI) Barcode string", formalDefinition="[Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package." ) + protected Identifier udiCarrier; + + /** + * Status of the Device availability. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="available | not-available | entered-in-error", formalDefinition="Status of the Device availability." ) + protected Enumeration status; + + /** + * Code or identifier to identify a kind of device. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="What kind of device this is", formalDefinition="Code or identifier to identify a kind of device." ) + protected CodeableConcept type; + + /** + * Lot number assigned by the manufacturer. + */ + @Child(name = "lotNumber", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." ) + protected StringType lotNumber; + + /** + * A name of the manufacturer. + */ + @Child(name = "manufacturer", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." ) + protected StringType manufacturer; + + /** + * The date and time when the device was manufactured. + */ + @Child(name = "manufactureDate", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Date when the device was made", formalDefinition="The date and time when the device was manufactured." ) + protected DateTimeType manufactureDate; + + /** + * The date and time beyond which this device is no longer valid or should not be used (if applicable). + */ + @Child(name = "expirationDate", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Date and time of expiry of this device (if applicable)", formalDefinition="The date and time beyond which this device is no longer valid or should not be used (if applicable)." ) + protected DateTimeType expirationDate; + + /** + * The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + @Child(name = "model", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Model id assigned by the manufacturer", formalDefinition="The \"model\" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type." ) + protected StringType model; + + /** + * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + @Child(name = "version", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Version number (i.e. software)", formalDefinition="The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware." ) + protected StringType version; + + /** + * Patient information, If the device is affixed to a person. + */ + @Child(name = "patient", type = {Patient.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Patient to whom Device is affixed", formalDefinition="Patient information, If the device is affixed to a person." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient information, If the device is affixed to a person.) + */ + protected Patient patientTarget; + + /** + * An organization that is responsible for the provision and ongoing maintenance of the device. + */ + @Child(name = "owner", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." ) + protected Reference owner; + + /** + * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + protected Organization ownerTarget; + + /** + * Contact details for an organization or a particular human that is responsible for the device. + */ + @Child(name = "contact", type = {ContactPoint.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." ) + protected List contact; + + /** + * The place where the device can be found. + */ + @Child(name = "location", type = {Location.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Where the resource is found", formalDefinition="The place where the device can be found." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The place where the device can be found.) + */ + protected Location locationTarget; + + /** + * A network address on which the device may be contacted directly. + */ + @Child(name = "url", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." ) + protected UriType url; + + /** + * Descriptive information, usage information or implantation information that is not captured in an existing element. + */ + @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Device notes and comments", formalDefinition="Descriptive information, usage information or implantation information that is not captured in an existing element." ) + protected List note; + + private static final long serialVersionUID = -710362206L; + + /** + * Constructor + */ + public Device() { + super(); + } + + /** + * Constructor + */ + public Device(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #identifier} (Unique instance identifiers assigned to a device by manufacturers other organizations or owners.) + */ + 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} (Unique instance identifiers assigned to a device by manufacturers other organizations or owners.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Device addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #udiCarrier} ([Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package.) + */ + public Identifier getUdiCarrier() { + if (this.udiCarrier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.udiCarrier"); + else if (Configuration.doAutoCreate()) + this.udiCarrier = new Identifier(); // cc + return this.udiCarrier; + } + + public boolean hasUdiCarrier() { + return this.udiCarrier != null && !this.udiCarrier.isEmpty(); + } + + /** + * @param value {@link #udiCarrier} ([Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package.) + */ + public Device setUdiCarrier(Identifier value) { + this.udiCarrier = value; + return this; + } + + /** + * @return {@link #status} (Status of the Device availability.). 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 Device.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DeviceStatusEnumFactory()); // bb + 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} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Device setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Status of the Device availability. + */ + public DeviceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Status of the Device availability. + */ + public Device setStatus(DeviceStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new DeviceStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Code or identifier to identify a kind of device.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Code or identifier to identify a kind of device.) + */ + public Device setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public StringType getLotNumberElement() { + if (this.lotNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.lotNumber"); + else if (Configuration.doAutoCreate()) + this.lotNumber = new StringType(); // bb + return this.lotNumber; + } + + public boolean hasLotNumberElement() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + public boolean hasLotNumber() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + /** + * @param value {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public Device setLotNumberElement(StringType value) { + this.lotNumber = value; + return this; + } + + /** + * @return Lot number assigned by the manufacturer. + */ + public String getLotNumber() { + return this.lotNumber == null ? null : this.lotNumber.getValue(); + } + + /** + * @param value Lot number assigned by the manufacturer. + */ + public Device setLotNumber(String value) { + if (Utilities.noString(value)) + this.lotNumber = null; + else { + if (this.lotNumber == null) + this.lotNumber = new StringType(); + this.lotNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value + */ + public StringType getManufacturerElement() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new StringType(); // bb + return this.manufacturer; + } + + public boolean hasManufacturerElement() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value + */ + public Device setManufacturerElement(StringType value) { + this.manufacturer = value; + return this; + } + + /** + * @return A name of the manufacturer. + */ + public String getManufacturer() { + return this.manufacturer == null ? null : this.manufacturer.getValue(); + } + + /** + * @param value A name of the manufacturer. + */ + public Device setManufacturer(String value) { + if (Utilities.noString(value)) + this.manufacturer = null; + else { + if (this.manufacturer == null) + this.manufacturer = new StringType(); + this.manufacturer.setValue(value); + } + return this; + } + + /** + * @return {@link #manufactureDate} (The date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value + */ + public DateTimeType getManufactureDateElement() { + if (this.manufactureDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.manufactureDate"); + else if (Configuration.doAutoCreate()) + this.manufactureDate = new DateTimeType(); // bb + return this.manufactureDate; + } + + public boolean hasManufactureDateElement() { + return this.manufactureDate != null && !this.manufactureDate.isEmpty(); + } + + public boolean hasManufactureDate() { + return this.manufactureDate != null && !this.manufactureDate.isEmpty(); + } + + /** + * @param value {@link #manufactureDate} (The date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value + */ + public Device setManufactureDateElement(DateTimeType value) { + this.manufactureDate = value; + return this; + } + + /** + * @return The date and time when the device was manufactured. + */ + public Date getManufactureDate() { + return this.manufactureDate == null ? null : this.manufactureDate.getValue(); + } + + /** + * @param value The date and time when the device was manufactured. + */ + public Device setManufactureDate(Date value) { + if (value == null) + this.manufactureDate = null; + else { + if (this.manufactureDate == null) + this.manufactureDate = new DateTimeType(); + this.manufactureDate.setValue(value); + } + return this; + } + + /** + * @return {@link #expirationDate} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public DateTimeType getExpirationDateElement() { + if (this.expirationDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.expirationDate"); + else if (Configuration.doAutoCreate()) + this.expirationDate = new DateTimeType(); // bb + return this.expirationDate; + } + + public boolean hasExpirationDateElement() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + public boolean hasExpirationDate() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + /** + * @param value {@link #expirationDate} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public Device setExpirationDateElement(DateTimeType value) { + this.expirationDate = value; + return this; + } + + /** + * @return The date and time beyond which this device is no longer valid or should not be used (if applicable). + */ + public Date getExpirationDate() { + return this.expirationDate == null ? null : this.expirationDate.getValue(); + } + + /** + * @param value The date and time beyond which this device is no longer valid or should not be used (if applicable). + */ + public Device setExpirationDate(Date value) { + if (value == null) + this.expirationDate = null; + else { + if (this.expirationDate == null) + this.expirationDate = new DateTimeType(); + this.expirationDate.setValue(value); + } + return this; + } + + /** + * @return {@link #model} (The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value + */ + public StringType getModelElement() { + if (this.model == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.model"); + else if (Configuration.doAutoCreate()) + this.model = new StringType(); // bb + return this.model; + } + + public boolean hasModelElement() { + return this.model != null && !this.model.isEmpty(); + } + + public boolean hasModel() { + return this.model != null && !this.model.isEmpty(); + } + + /** + * @param value {@link #model} (The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value + */ + public Device setModelElement(StringType value) { + this.model = value; + return this; + } + + /** + * @return The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + public String getModel() { + return this.model == null ? null : this.model.getValue(); + } + + /** + * @param value The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + public Device setModel(String value) { + if (Utilities.noString(value)) + this.model = null; + else { + if (this.model == null) + this.model = new StringType(); + this.model.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Device setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + public Device setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (Patient information, If the device is affixed to a person.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient information, If the device is affixed to a person.) + */ + public Device 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 information, If the device is affixed to a person.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 information, If the device is affixed to a person.) + */ + public Device setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Reference getOwner() { + if (this.owner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.owner"); + else if (Configuration.doAutoCreate()) + this.owner = new Reference(); // cc + return this.owner; + } + + public boolean hasOwner() { + return this.owner != null && !this.owner.isEmpty(); + } + + /** + * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Device setOwner(Reference value) { + this.owner = value; + return this; + } + + /** + * @return {@link #owner} 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. (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Organization getOwnerTarget() { + if (this.ownerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.owner"); + else if (Configuration.doAutoCreate()) + this.ownerTarget = new Organization(); // aa + return this.ownerTarget; + } + + /** + * @param value {@link #owner} 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. (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Device setOwnerTarget(Organization value) { + this.ownerTarget = value; + return this; + } + + /** + * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactPoint item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) + */ + // syntactic sugar + public ContactPoint addContact() { //3 + ContactPoint t = new ContactPoint(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Device addContact(ContactPoint t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #location} (The place where the device can be found.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The place where the device can be found.) + */ + public Device 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. (The place where the device can be found.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + 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. (The place where the device can be found.) + */ + public Device setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Device setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return A network address on which the device may be contacted directly. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value A network address on which the device may be contacted directly. + */ + public Device setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public Device addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by manufacturers other organizations or owners.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("udiCarrier", "Identifier", "[Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package.", 0, java.lang.Integer.MAX_VALUE, udiCarrier)); + childrenList.add(new Property("status", "code", "Status of the Device availability.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "CodeableConcept", "Code or identifier to identify a kind of device.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); + childrenList.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("manufactureDate", "dateTime", "The date and time when the device was manufactured.", 0, java.lang.Integer.MAX_VALUE, manufactureDate)); + childrenList.add(new Property("expirationDate", "dateTime", "The date and time beyond which this device is no longer valid or should not be used (if applicable).", 0, java.lang.Integer.MAX_VALUE, expirationDate)); + childrenList.add(new Property("model", "string", "The \"model\" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.", 0, java.lang.Integer.MAX_VALUE, model)); + childrenList.add(new Property("version", "string", "The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient information, If the device is affixed to a person.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, java.lang.Integer.MAX_VALUE, owner)); + childrenList.add(new Property("contact", "ContactPoint", "Contact details for an organization or a particular human that is responsible for the device.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("location", "Reference(Location)", "The place where the device can be found.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("note", "Annotation", "Descriptive information, usage information or implantation information that is not captured in an existing element.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1343558178: /*udiCarrier*/ return this.udiCarrier == null ? new Base[0] : new Base[] {this.udiCarrier}; // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType + case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // StringType + case 416714767: /*manufactureDate*/ return this.manufactureDate == null ? new Base[0] : new Base[] {this.manufactureDate}; // DateTimeType + case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateTimeType + case 104069929: /*model*/ return this.model == null ? new Base[0] : new Base[] {this.model}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1343558178: // udiCarrier + this.udiCarrier = castToIdentifier(value); // Identifier + break; + case -892481550: // status + this.status = new DeviceStatusEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case 462547450: // lotNumber + this.lotNumber = castToString(value); // StringType + break; + case -1969347631: // manufacturer + this.manufacturer = castToString(value); // StringType + break; + case 416714767: // manufactureDate + this.manufactureDate = castToDateTime(value); // DateTimeType + break; + case -668811523: // expirationDate + this.expirationDate = castToDateTime(value); // DateTimeType + break; + case 104069929: // model + this.model = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 106164915: // owner + this.owner = castToReference(value); // Reference + break; + case 951526432: // contact + this.getContact().add(castToContactPoint(value)); // ContactPoint + break; + case 1901043637: // location + this.location = castToReference(value); // Reference + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("udiCarrier")) + this.udiCarrier = castToIdentifier(value); // Identifier + else if (name.equals("status")) + this.status = new DeviceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("lotNumber")) + this.lotNumber = castToString(value); // StringType + else if (name.equals("manufacturer")) + this.manufacturer = castToString(value); // StringType + else if (name.equals("manufactureDate")) + this.manufactureDate = castToDateTime(value); // DateTimeType + else if (name.equals("expirationDate")) + this.expirationDate = castToDateTime(value); // DateTimeType + else if (name.equals("model")) + this.model = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("owner")) + this.owner = castToReference(value); // Reference + else if (name.equals("contact")) + this.getContact().add(castToContactPoint(value)); + else if (name.equals("location")) + this.location = castToReference(value); // Reference + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1343558178: return getUdiCarrier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3575610: return getType(); // CodeableConcept + case 462547450: throw new FHIRException("Cannot make property lotNumber as it is not a complex type"); // StringType + case -1969347631: throw new FHIRException("Cannot make property manufacturer as it is not a complex type"); // StringType + case 416714767: throw new FHIRException("Cannot make property manufactureDate as it is not a complex type"); // DateTimeType + case -668811523: throw new FHIRException("Cannot make property expirationDate as it is not a complex type"); // DateTimeType + case 104069929: throw new FHIRException("Cannot make property model as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case -791418107: return getPatient(); // Reference + case 106164915: return getOwner(); // Reference + case 951526432: return addContact(); // ContactPoint + case 1901043637: return getLocation(); // Reference + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 3387378: return addNote(); // Annotation + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("udiCarrier")) { + this.udiCarrier = new Identifier(); + return this.udiCarrier; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Device.status"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("lotNumber")) { + throw new FHIRException("Cannot call addChild on a primitive type Device.lotNumber"); + } + else if (name.equals("manufacturer")) { + throw new FHIRException("Cannot call addChild on a primitive type Device.manufacturer"); + } + else if (name.equals("manufactureDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Device.manufactureDate"); + } + else if (name.equals("expirationDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Device.expirationDate"); + } + else if (name.equals("model")) { + throw new FHIRException("Cannot call addChild on a primitive type Device.model"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Device.version"); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("owner")) { + this.owner = new Reference(); + return this.owner; + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("location")) { + this.location = new Reference(); + return this.location; + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Device.url"); + } + else if (name.equals("note")) { + return addNote(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Device"; + + } + + public Device copy() { + Device dst = new Device(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.udiCarrier = udiCarrier == null ? null : udiCarrier.copy(); + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.manufactureDate = manufactureDate == null ? null : manufactureDate.copy(); + dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); + dst.model = model == null ? null : model.copy(); + dst.version = version == null ? null : version.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.owner = owner == null ? null : owner.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactPoint i : contact) + dst.contact.add(i.copy()); + }; + dst.location = location == null ? null : location.copy(); + dst.url = url == null ? null : url.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + return dst; + } + + protected Device typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Device)) + return false; + Device o = (Device) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(udiCarrier, o.udiCarrier, true) + && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) && compareDeep(lotNumber, o.lotNumber, true) + && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(manufactureDate, o.manufactureDate, true) + && compareDeep(expirationDate, o.expirationDate, true) && compareDeep(model, o.model, true) && compareDeep(version, o.version, true) + && compareDeep(patient, o.patient, true) && compareDeep(owner, o.owner, true) && compareDeep(contact, o.contact, true) + && compareDeep(location, o.location, true) && compareDeep(url, o.url, true) && compareDeep(note, o.note, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Device)) + return false; + Device o = (Device) other; + return compareValues(status, o.status, true) && compareValues(lotNumber, o.lotNumber, true) && compareValues(manufacturer, o.manufacturer, true) + && compareValues(manufactureDate, o.manufactureDate, true) && compareValues(expirationDate, o.expirationDate, true) + && compareValues(model, o.model, true) && compareValues(version, o.version, true) && compareValues(url, o.url, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (udiCarrier == null || udiCarrier.isEmpty()) + && (status == null || status.isEmpty()) && (type == null || type.isEmpty()) && (lotNumber == null || lotNumber.isEmpty()) + && (manufacturer == null || manufacturer.isEmpty()) && (manufactureDate == null || manufactureDate.isEmpty()) + && (expirationDate == null || expirationDate.isEmpty()) && (model == null || model.isEmpty()) + && (version == null || version.isEmpty()) && (patient == null || patient.isEmpty()) && (owner == null || owner.isEmpty()) + && (contact == null || contact.isEmpty()) && (location == null || location.isEmpty()) && (url == null || url.isEmpty()) + && (note == null || note.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Device; + } + + /** + * Search parameter: organization + *

+ * Description: The organization responsible for the device
+ * Type: reference
+ * Path: Device.owner
+ *

+ */ + @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: The organization responsible for the device
+ * Type: reference
+ * Path: Device.owner
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Device:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Device:organization").toLocked(); + + /** + * Search parameter: model + *

+ * Description: The model of the device
+ * Type: string
+ * Path: Device.model
+ *

+ */ + @SearchParamDefinition(name="model", path="Device.model", description="The model of the device", type="string" ) + public static final String SP_MODEL = "model"; + /** + * Fluent Client search parameter constant for model + *

+ * Description: The model of the device
+ * Type: string
+ * Path: Device.model
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam MODEL = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MODEL); + + /** + * Search parameter: patient + *

+ * Description: Patient information, if the resource is affixed to a person
+ * Type: reference
+ * Path: Device.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Patient information, if the resource is affixed to a person
+ * Type: reference
+ * Path: Device.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Device:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Device:patient").toLocked(); + + /** + * Search parameter: udicarrier + *

+ * Description: Barcode string (udi)
+ * Type: token
+ * Path: Device.udiCarrier
+ *

+ */ + @SearchParamDefinition(name="udicarrier", path="Device.udiCarrier", description="Barcode string (udi)", type="token" ) + public static final String SP_UDICARRIER = "udicarrier"; + /** + * Fluent Client search parameter constant for udicarrier + *

+ * Description: Barcode string (udi)
+ * Type: token
+ * Path: Device.udiCarrier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam UDICARRIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_UDICARRIER); + + /** + * Search parameter: location + *

+ * Description: A location, where the resource is found
+ * Type: reference
+ * Path: Device.location
+ *

+ */ + @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: A location, where the resource is found
+ * Type: reference
+ * Path: Device.location
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Device:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Device:location").toLocked(); + + /** + * Search parameter: manufacturer + *

+ * Description: The manufacturer of the device
+ * Type: string
+ * Path: Device.manufacturer
+ *

+ */ + @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" ) + public static final String SP_MANUFACTURER = "manufacturer"; + /** + * Fluent Client search parameter constant for manufacturer + *

+ * Description: The manufacturer of the device
+ * Type: string
+ * Path: Device.manufacturer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MANUFACTURER); + + /** + * Search parameter: type + *

+ * Description: The type of the device
+ * Type: token
+ * Path: Device.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The type of the device
+ * Type: token
+ * Path: Device.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: Instance id from manufacturer, owner, and others
+ * Type: token
+ * Path: Device.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner, and others", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Instance id from manufacturer, owner, and others
+ * Type: token
+ * Path: Device.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: url + *

+ * Description: Network address to contact device
+ * Type: uri
+ * Path: Device.url
+ *

+ */ + @SearchParamDefinition(name="url", path="Device.url", description="Network address to contact device", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: Network address to contact device
+ * Type: uri
+ * Path: Device.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceComponent.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceComponent.java new file mode 100644 index 00000000000..d860f0e6448 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceComponent.java @@ -0,0 +1,1288 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. + */ +@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent") +public class DeviceComponent extends DomainResource { + + public enum MeasmntPrinciple { + /** + * Measurement principle isn't in the list. + */ + OTHER, + /** + * Measurement is done using the chemical principle. + */ + CHEMICAL, + /** + * Measurement is done using the electrical principle. + */ + ELECTRICAL, + /** + * Measurement is done using the impedance principle. + */ + IMPEDANCE, + /** + * Measurement is done using the nuclear principle. + */ + NUCLEAR, + /** + * Measurement is done using the optical principle. + */ + OPTICAL, + /** + * Measurement is done using the thermal principle. + */ + THERMAL, + /** + * Measurement is done using the biological principle. + */ + BIOLOGICAL, + /** + * Measurement is done using the mechanical principle. + */ + MECHANICAL, + /** + * Measurement is done using the acoustical principle. + */ + ACOUSTICAL, + /** + * Measurement is done using the manual principle. + */ + MANUAL, + /** + * added to help the parsers + */ + NULL; + public static MeasmntPrinciple fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("other".equals(codeString)) + return OTHER; + if ("chemical".equals(codeString)) + return CHEMICAL; + if ("electrical".equals(codeString)) + return ELECTRICAL; + if ("impedance".equals(codeString)) + return IMPEDANCE; + if ("nuclear".equals(codeString)) + return NUCLEAR; + if ("optical".equals(codeString)) + return OPTICAL; + if ("thermal".equals(codeString)) + return THERMAL; + if ("biological".equals(codeString)) + return BIOLOGICAL; + if ("mechanical".equals(codeString)) + return MECHANICAL; + if ("acoustical".equals(codeString)) + return ACOUSTICAL; + if ("manual".equals(codeString)) + return MANUAL; + throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OTHER: return "other"; + case CHEMICAL: return "chemical"; + case ELECTRICAL: return "electrical"; + case IMPEDANCE: return "impedance"; + case NUCLEAR: return "nuclear"; + case OPTICAL: return "optical"; + case THERMAL: return "thermal"; + case BIOLOGICAL: return "biological"; + case MECHANICAL: return "mechanical"; + case ACOUSTICAL: return "acoustical"; + case MANUAL: return "manual"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OTHER: return "http://hl7.org/fhir/measurement-principle"; + case CHEMICAL: return "http://hl7.org/fhir/measurement-principle"; + case ELECTRICAL: return "http://hl7.org/fhir/measurement-principle"; + case IMPEDANCE: return "http://hl7.org/fhir/measurement-principle"; + case NUCLEAR: return "http://hl7.org/fhir/measurement-principle"; + case OPTICAL: return "http://hl7.org/fhir/measurement-principle"; + case THERMAL: return "http://hl7.org/fhir/measurement-principle"; + case BIOLOGICAL: return "http://hl7.org/fhir/measurement-principle"; + case MECHANICAL: return "http://hl7.org/fhir/measurement-principle"; + case ACOUSTICAL: return "http://hl7.org/fhir/measurement-principle"; + case MANUAL: return "http://hl7.org/fhir/measurement-principle"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OTHER: return "Measurement principle isn't in the list."; + case CHEMICAL: return "Measurement is done using the chemical principle."; + case ELECTRICAL: return "Measurement is done using the electrical principle."; + case IMPEDANCE: return "Measurement is done using the impedance principle."; + case NUCLEAR: return "Measurement is done using the nuclear principle."; + case OPTICAL: return "Measurement is done using the optical principle."; + case THERMAL: return "Measurement is done using the thermal principle."; + case BIOLOGICAL: return "Measurement is done using the biological principle."; + case MECHANICAL: return "Measurement is done using the mechanical principle."; + case ACOUSTICAL: return "Measurement is done using the acoustical principle."; + case MANUAL: return "Measurement is done using the manual principle."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OTHER: return "MSP Other"; + case CHEMICAL: return "MSP Chemical"; + case ELECTRICAL: return "MSP Electrical"; + case IMPEDANCE: return "MSP Impedance"; + case NUCLEAR: return "MSP Nuclear"; + case OPTICAL: return "MSP Optical"; + case THERMAL: return "MSP Thermal"; + case BIOLOGICAL: return "MSP Biological"; + case MECHANICAL: return "MSP Mechanical"; + case ACOUSTICAL: return "MSP Acoustical"; + case MANUAL: return "MSP Manual"; + default: return "?"; + } + } + } + + public static class MeasmntPrincipleEnumFactory implements EnumFactory { + public MeasmntPrinciple fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("other".equals(codeString)) + return MeasmntPrinciple.OTHER; + if ("chemical".equals(codeString)) + return MeasmntPrinciple.CHEMICAL; + if ("electrical".equals(codeString)) + return MeasmntPrinciple.ELECTRICAL; + if ("impedance".equals(codeString)) + return MeasmntPrinciple.IMPEDANCE; + if ("nuclear".equals(codeString)) + return MeasmntPrinciple.NUCLEAR; + if ("optical".equals(codeString)) + return MeasmntPrinciple.OPTICAL; + if ("thermal".equals(codeString)) + return MeasmntPrinciple.THERMAL; + if ("biological".equals(codeString)) + return MeasmntPrinciple.BIOLOGICAL; + if ("mechanical".equals(codeString)) + return MeasmntPrinciple.MECHANICAL; + if ("acoustical".equals(codeString)) + return MeasmntPrinciple.ACOUSTICAL; + if ("manual".equals(codeString)) + return MeasmntPrinciple.MANUAL; + throw new IllegalArgumentException("Unknown MeasmntPrinciple code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("other".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.OTHER); + if ("chemical".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.CHEMICAL); + if ("electrical".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.ELECTRICAL); + if ("impedance".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.IMPEDANCE); + if ("nuclear".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.NUCLEAR); + if ("optical".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.OPTICAL); + if ("thermal".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.THERMAL); + if ("biological".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.BIOLOGICAL); + if ("mechanical".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.MECHANICAL); + if ("acoustical".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.ACOUSTICAL); + if ("manual".equals(codeString)) + return new Enumeration(this, MeasmntPrinciple.MANUAL); + throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'"); + } + public String toCode(MeasmntPrinciple code) { + if (code == MeasmntPrinciple.OTHER) + return "other"; + if (code == MeasmntPrinciple.CHEMICAL) + return "chemical"; + if (code == MeasmntPrinciple.ELECTRICAL) + return "electrical"; + if (code == MeasmntPrinciple.IMPEDANCE) + return "impedance"; + if (code == MeasmntPrinciple.NUCLEAR) + return "nuclear"; + if (code == MeasmntPrinciple.OPTICAL) + return "optical"; + if (code == MeasmntPrinciple.THERMAL) + return "thermal"; + if (code == MeasmntPrinciple.BIOLOGICAL) + return "biological"; + if (code == MeasmntPrinciple.MECHANICAL) + return "mechanical"; + if (code == MeasmntPrinciple.ACOUSTICAL) + return "acoustical"; + if (code == MeasmntPrinciple.MANUAL) + return "manual"; + return "?"; + } + public String toSystem(MeasmntPrinciple code) { + return code.getSystem(); + } + } + + @Block() + public static class DeviceComponentProductionSpecificationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc. + */ + @Child(name = "specType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specification type", formalDefinition="Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc." ) + protected CodeableConcept specType; + + /** + * Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of. + */ + @Child(name = "componentId", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Internal component unique identification", formalDefinition="Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of." ) + protected Identifier componentId; + + /** + * Describes the printable string defining the component. + */ + @Child(name = "productionSpec", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A printable string defining the component", formalDefinition="Describes the printable string defining the component." ) + protected StringType productionSpec; + + private static final long serialVersionUID = -1476597516L; + + /** + * Constructor + */ + public DeviceComponentProductionSpecificationComponent() { + super(); + } + + /** + * @return {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) + */ + public CodeableConcept getSpecType() { + if (this.specType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType"); + else if (Configuration.doAutoCreate()) + this.specType = new CodeableConcept(); // cc + return this.specType; + } + + public boolean hasSpecType() { + return this.specType != null && !this.specType.isEmpty(); + } + + /** + * @param value {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) + */ + public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { + this.specType = value; + return this; + } + + /** + * @return {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) + */ + public Identifier getComponentId() { + if (this.componentId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId"); + else if (Configuration.doAutoCreate()) + this.componentId = new Identifier(); // cc + return this.componentId; + } + + public boolean hasComponentId() { + return this.componentId != null && !this.componentId.isEmpty(); + } + + /** + * @param value {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) + */ + public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { + this.componentId = value; + return this; + } + + /** + * @return {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value + */ + public StringType getProductionSpecElement() { + if (this.productionSpec == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec"); + else if (Configuration.doAutoCreate()) + this.productionSpec = new StringType(); // bb + return this.productionSpec; + } + + public boolean hasProductionSpecElement() { + return this.productionSpec != null && !this.productionSpec.isEmpty(); + } + + public boolean hasProductionSpec() { + return this.productionSpec != null && !this.productionSpec.isEmpty(); + } + + /** + * @param value {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value + */ + public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { + this.productionSpec = value; + return this; + } + + /** + * @return Describes the printable string defining the component. + */ + public String getProductionSpec() { + return this.productionSpec == null ? null : this.productionSpec.getValue(); + } + + /** + * @param value Describes the printable string defining the component. + */ + public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { + if (Utilities.noString(value)) + this.productionSpec = null; + else { + if (this.productionSpec == null) + this.productionSpec = new StringType(); + this.productionSpec.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("specType", "CodeableConcept", "Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, java.lang.Integer.MAX_VALUE, specType)); + childrenList.add(new Property("componentId", "Identifier", "Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.", 0, java.lang.Integer.MAX_VALUE, componentId)); + childrenList.add(new Property("productionSpec", "string", "Describes the printable string defining the component.", 0, java.lang.Integer.MAX_VALUE, productionSpec)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -2133482091: /*specType*/ return this.specType == null ? new Base[0] : new Base[] {this.specType}; // CodeableConcept + case -985933064: /*componentId*/ return this.componentId == null ? new Base[0] : new Base[] {this.componentId}; // Identifier + case 182147092: /*productionSpec*/ return this.productionSpec == null ? new Base[0] : new Base[] {this.productionSpec}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -2133482091: // specType + this.specType = castToCodeableConcept(value); // CodeableConcept + break; + case -985933064: // componentId + this.componentId = castToIdentifier(value); // Identifier + break; + case 182147092: // productionSpec + this.productionSpec = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("specType")) + this.specType = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("componentId")) + this.componentId = castToIdentifier(value); // Identifier + else if (name.equals("productionSpec")) + this.productionSpec = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -2133482091: return getSpecType(); // CodeableConcept + case -985933064: return getComponentId(); // Identifier + case 182147092: throw new FHIRException("Cannot make property productionSpec as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("specType")) { + this.specType = new CodeableConcept(); + return this.specType; + } + else if (name.equals("componentId")) { + this.componentId = new Identifier(); + return this.componentId; + } + else if (name.equals("productionSpec")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.productionSpec"); + } + else + return super.addChild(name); + } + + public DeviceComponentProductionSpecificationComponent copy() { + DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent(); + copyValues(dst); + dst.specType = specType == null ? null : specType.copy(); + dst.componentId = componentId == null ? null : componentId.copy(); + dst.productionSpec = productionSpec == null ? null : productionSpec.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceComponentProductionSpecificationComponent)) + return false; + DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other; + return compareDeep(specType, o.specType, true) && compareDeep(componentId, o.componentId, true) + && compareDeep(productionSpec, o.productionSpec, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceComponentProductionSpecificationComponent)) + return false; + DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other; + return compareValues(productionSpec, o.productionSpec, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (specType == null || specType.isEmpty()) && (componentId == null || componentId.isEmpty()) + && (productionSpec == null || productionSpec.isEmpty()); + } + + public String fhirType() { + return "DeviceComponent.productionSpecification"; + + } + + } + + /** + * Describes the specific component type as defined in the object-oriented or metric nomenclature partition. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What kind of component it is", formalDefinition="Describes the specific component type as defined in the object-oriented or metric nomenclature partition." ) + protected CodeableConcept type; + + /** + * Describes the local assigned unique identification by the software. For example: handle ID. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Instance id assigned by the software stack", formalDefinition="Describes the local assigned unique identification by the software. For example: handle ID." ) + protected Identifier identifier; + + /** + * Describes the timestamp for the most recent system change which includes device configuration or setting change. + */ + @Child(name = "lastSystemChange", type = {InstantType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Recent system change timestamp", formalDefinition="Describes the timestamp for the most recent system change which includes device configuration or setting change." ) + protected InstantType lastSystemChange; + + /** + * Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc. + */ + @Child(name = "source", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A source device of this component", formalDefinition="Describes the link to the source Device 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 source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + protected Device sourceTarget; + + /** + * Describes the link to the parent resource. For example: Channel is linked to its VMD parent. + */ + @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Parent resource link", formalDefinition="Describes the link to the parent resource. For example: Channel is linked to its VMD parent." ) + protected Reference parent; + + /** + * The actual object that is the target of the reference (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + protected DeviceComponent parentTarget; + + /** + * Indicates current operational status of the device. For example: On, Off, Standby, etc. + */ + @Child(name = "operationalStatus", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Component operational status", formalDefinition="Indicates current operational status of the device. For example: On, Off, Standby, etc." ) + protected List operationalStatus; + + /** + * Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular. + */ + @Child(name = "parameterGroup", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Current supported parameter group", formalDefinition="Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular." ) + protected CodeableConcept parameterGroup; + + /** + * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + @Child(name = "measurementPrinciple", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) + protected Enumeration measurementPrinciple; + + /** + * Describes the production specification such as component revision, serial number, etc. + */ + @Child(name = "productionSpecification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Production specification of the component", formalDefinition="Describes the production specification such as component revision, serial number, etc." ) + protected List productionSpecification; + + /** + * Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US. + */ + @Child(name = "languageCode", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Language code for the human-readable text strings produced by the device", formalDefinition="Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US." ) + protected CodeableConcept languageCode; + + private static final long serialVersionUID = -1742890034L; + + /** + * Constructor + */ + public DeviceComponent() { + super(); + } + + /** + * Constructor + */ + public DeviceComponent(CodeableConcept type, Identifier identifier, InstantType lastSystemChange) { + super(); + this.type = type; + this.identifier = identifier; + this.lastSystemChange = lastSystemChange; + } + + /** + * @return {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) + */ + public DeviceComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) + */ + public DeviceComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value + */ + public InstantType getLastSystemChangeElement() { + if (this.lastSystemChange == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange"); + else if (Configuration.doAutoCreate()) + this.lastSystemChange = new InstantType(); // bb + return this.lastSystemChange; + } + + public boolean hasLastSystemChangeElement() { + return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); + } + + public boolean hasLastSystemChange() { + return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); + } + + /** + * @param value {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value + */ + public DeviceComponent setLastSystemChangeElement(InstantType value) { + this.lastSystemChange = value; + return this; + } + + /** + * @return Describes the timestamp for the most recent system change which includes device configuration or setting change. + */ + 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(Date value) { + if (this.lastSystemChange == null) + this.lastSystemChange = new InstantType(); + this.lastSystemChange.setValue(value); + return this; + } + + /** + * @return {@link #source} (Describes the link to the source Device 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 DeviceComponent.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceComponent 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 source Device 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 DeviceComponent.source"); + else if (Configuration.doAutoCreate()) + this.sourceTarget = new Device(); // aa + 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 source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceComponent setSourceTarget(Device value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public Reference getParent() { + if (this.parent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parent"); + else if (Configuration.doAutoCreate()) + this.parent = new Reference(); // cc + return this.parent; + } + + public boolean hasParent() { + return this.parent != null && !this.parent.isEmpty(); + } + + /** + * @param value {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent 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 parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent getParentTarget() { + if (this.parentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parent"); + else if (Configuration.doAutoCreate()) + this.parentTarget = new DeviceComponent(); // aa + 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 parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent setParentTarget(DeviceComponent value) { + this.parentTarget = value; + return this; + } + + /** + * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) + */ + public List getOperationalStatus() { + if (this.operationalStatus == null) + this.operationalStatus = new ArrayList(); + return this.operationalStatus; + } + + public boolean hasOperationalStatus() { + if (this.operationalStatus == null) + return false; + for (CodeableConcept item : this.operationalStatus) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) + */ + // syntactic sugar + public CodeableConcept addOperationalStatus() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.operationalStatus == null) + this.operationalStatus = new ArrayList(); + this.operationalStatus.add(t); + return t; + } + + // syntactic sugar + public DeviceComponent addOperationalStatus(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.operationalStatus == null) + this.operationalStatus = new ArrayList(); + this.operationalStatus.add(t); + return this; + } + + /** + * @return {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.) + */ + public CodeableConcept getParameterGroup() { + if (this.parameterGroup == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parameterGroup"); + else if (Configuration.doAutoCreate()) + this.parameterGroup = new CodeableConcept(); // cc + return this.parameterGroup; + } + + public boolean hasParameterGroup() { + return this.parameterGroup != null && !this.parameterGroup.isEmpty(); + } + + /** + * @param value {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.) + */ + public DeviceComponent setParameterGroup(CodeableConcept value) { + this.parameterGroup = value; + return this; + } + + /** + * @return {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value + */ + public Enumeration getMeasurementPrincipleElement() { + if (this.measurementPrinciple == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple"); + else if (Configuration.doAutoCreate()) + this.measurementPrinciple = new Enumeration(new MeasmntPrincipleEnumFactory()); // bb + return this.measurementPrinciple; + } + + public boolean hasMeasurementPrincipleElement() { + return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); + } + + public boolean hasMeasurementPrinciple() { + return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); + } + + /** + * @param value {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value + */ + public DeviceComponent setMeasurementPrincipleElement(Enumeration value) { + this.measurementPrinciple = value; + return this; + } + + /** + * @return Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + public MeasmntPrinciple getMeasurementPrinciple() { + return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue(); + } + + /** + * @param value Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + public DeviceComponent setMeasurementPrinciple(MeasmntPrinciple value) { + if (value == null) + this.measurementPrinciple = null; + else { + if (this.measurementPrinciple == null) + this.measurementPrinciple = new Enumeration(new MeasmntPrincipleEnumFactory()); + this.measurementPrinciple.setValue(value); + } + return this; + } + + /** + * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) + */ + public List getProductionSpecification() { + if (this.productionSpecification == null) + this.productionSpecification = new ArrayList(); + return this.productionSpecification; + } + + public boolean hasProductionSpecification() { + if (this.productionSpecification == null) + return false; + for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) + */ + // syntactic sugar + public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3 + DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent(); + if (this.productionSpecification == null) + this.productionSpecification = new ArrayList(); + this.productionSpecification.add(t); + return t; + } + + // syntactic sugar + public DeviceComponent addProductionSpecification(DeviceComponentProductionSpecificationComponent t) { //3 + if (t == null) + return this; + if (this.productionSpecification == null) + this.productionSpecification = new ArrayList(); + this.productionSpecification.add(t); + return this; + } + + /** + * @return {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) + */ + public CodeableConcept getLanguageCode() { + if (this.languageCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.languageCode"); + else if (Configuration.doAutoCreate()) + this.languageCode = new CodeableConcept(); // cc + return this.languageCode; + } + + public boolean hasLanguageCode() { + return this.languageCode != null && !this.languageCode.isEmpty(); + } + + /** + * @param value {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) + */ + public DeviceComponent setLanguageCode(CodeableConcept value) { + this.languageCode = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Describes the specific component type as defined in the object-oriented or metric nomenclature partition.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "Describes the local assigned unique identification by the software. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("lastSystemChange", "instant", "Describes the timestamp for the most recent system change which includes device configuration or setting change.", 0, java.lang.Integer.MAX_VALUE, lastSystemChange)); + childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the source Device 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 parent resource. For example: Channel is linked to its VMD parent.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("operationalStatus", "CodeableConcept", "Indicates current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); + childrenList.add(new Property("parameterGroup", "CodeableConcept", "Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.", 0, java.lang.Integer.MAX_VALUE, parameterGroup)); + childrenList.add(new Property("measurementPrinciple", "code", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementPrinciple)); + childrenList.add(new Property("productionSpecification", "", "Describes the production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification)); + childrenList.add(new Property("languageCode", "CodeableConcept", "Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.", 0, java.lang.Integer.MAX_VALUE, languageCode)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -2072475531: /*lastSystemChange*/ return this.lastSystemChange == null ? new Base[0] : new Base[] {this.lastSystemChange}; // InstantType + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference + case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference + case -2103166364: /*operationalStatus*/ return this.operationalStatus == null ? new Base[0] : this.operationalStatus.toArray(new Base[this.operationalStatus.size()]); // CodeableConcept + case 1111110742: /*parameterGroup*/ return this.parameterGroup == null ? new Base[0] : new Base[] {this.parameterGroup}; // CodeableConcept + case 24324384: /*measurementPrinciple*/ return this.measurementPrinciple == null ? new Base[0] : new Base[] {this.measurementPrinciple}; // Enumeration + case -455527222: /*productionSpecification*/ return this.productionSpecification == null ? new Base[0] : this.productionSpecification.toArray(new Base[this.productionSpecification.size()]); // DeviceComponentProductionSpecificationComponent + case -2092349083: /*languageCode*/ return this.languageCode == null ? new Base[0] : new Base[] {this.languageCode}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -2072475531: // lastSystemChange + this.lastSystemChange = castToInstant(value); // InstantType + break; + case -896505829: // source + this.source = castToReference(value); // Reference + break; + case -995424086: // parent + this.parent = castToReference(value); // Reference + break; + case -2103166364: // operationalStatus + this.getOperationalStatus().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1111110742: // parameterGroup + this.parameterGroup = castToCodeableConcept(value); // CodeableConcept + break; + case 24324384: // measurementPrinciple + this.measurementPrinciple = new MeasmntPrincipleEnumFactory().fromType(value); // Enumeration + break; + case -455527222: // productionSpecification + this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value); // DeviceComponentProductionSpecificationComponent + break; + case -2092349083: // languageCode + this.languageCode = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("lastSystemChange")) + this.lastSystemChange = castToInstant(value); // InstantType + else if (name.equals("source")) + this.source = castToReference(value); // Reference + else if (name.equals("parent")) + this.parent = castToReference(value); // Reference + else if (name.equals("operationalStatus")) + this.getOperationalStatus().add(castToCodeableConcept(value)); + else if (name.equals("parameterGroup")) + this.parameterGroup = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("measurementPrinciple")) + this.measurementPrinciple = new MeasmntPrincipleEnumFactory().fromType(value); // Enumeration + else if (name.equals("productionSpecification")) + this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value); + else if (name.equals("languageCode")) + this.languageCode = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // CodeableConcept + case -1618432855: return getIdentifier(); // Identifier + case -2072475531: throw new FHIRException("Cannot make property lastSystemChange as it is not a complex type"); // InstantType + case -896505829: return getSource(); // Reference + case -995424086: return getParent(); // Reference + case -2103166364: return addOperationalStatus(); // CodeableConcept + case 1111110742: return getParameterGroup(); // CodeableConcept + case 24324384: throw new FHIRException("Cannot make property measurementPrinciple as it is not a complex type"); // Enumeration + case -455527222: return addProductionSpecification(); // DeviceComponentProductionSpecificationComponent + case -2092349083: return getLanguageCode(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("lastSystemChange")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.lastSystemChange"); + } + else if (name.equals("source")) { + this.source = new Reference(); + return this.source; + } + else if (name.equals("parent")) { + this.parent = new Reference(); + return this.parent; + } + else if (name.equals("operationalStatus")) { + return addOperationalStatus(); + } + else if (name.equals("parameterGroup")) { + this.parameterGroup = new CodeableConcept(); + return this.parameterGroup; + } + else if (name.equals("measurementPrinciple")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.measurementPrinciple"); + } + else if (name.equals("productionSpecification")) { + return addProductionSpecification(); + } + else if (name.equals("languageCode")) { + this.languageCode = new CodeableConcept(); + return this.languageCode; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DeviceComponent"; + + } + + public DeviceComponent copy() { + DeviceComponent dst = new DeviceComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy(); + dst.source = source == null ? null : source.copy(); + dst.parent = parent == null ? null : parent.copy(); + if (operationalStatus != null) { + dst.operationalStatus = new ArrayList(); + for (CodeableConcept i : operationalStatus) + dst.operationalStatus.add(i.copy()); + }; + dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy(); + dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy(); + if (productionSpecification != null) { + dst.productionSpecification = new ArrayList(); + for (DeviceComponentProductionSpecificationComponent i : productionSpecification) + dst.productionSpecification.add(i.copy()); + }; + dst.languageCode = languageCode == null ? null : languageCode.copy(); + return dst; + } + + protected DeviceComponent typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceComponent)) + return false; + DeviceComponent o = (DeviceComponent) other; + return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(lastSystemChange, o.lastSystemChange, true) + && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) + && compareDeep(parameterGroup, o.parameterGroup, true) && compareDeep(measurementPrinciple, o.measurementPrinciple, true) + && compareDeep(productionSpecification, o.productionSpecification, true) && compareDeep(languageCode, o.languageCode, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceComponent)) + return false; + DeviceComponent o = (DeviceComponent) other; + return compareValues(lastSystemChange, o.lastSystemChange, true) && compareValues(measurementPrinciple, o.measurementPrinciple, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (lastSystemChange == null || lastSystemChange.isEmpty()) && (source == null || source.isEmpty()) + && (parent == null || parent.isEmpty()) && (operationalStatus == null || operationalStatus.isEmpty()) + && (parameterGroup == null || parameterGroup.isEmpty()) && (measurementPrinciple == null || measurementPrinciple.isEmpty()) + && (productionSpecification == null || productionSpecification.isEmpty()) && (languageCode == null || languageCode.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceComponent; + } + + /** + * Search parameter: source + *

+ * Description: The device source
+ * Type: reference
+ * Path: DeviceComponent.source
+ *

+ */ + @SearchParamDefinition(name="source", path="DeviceComponent.source", description="The device source", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: The device source
+ * Type: reference
+ * Path: DeviceComponent.source
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceComponent:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("DeviceComponent:source").toLocked(); + + /** + * Search parameter: parent + *

+ * Description: The parent DeviceComponent resource
+ * Type: reference
+ * Path: DeviceComponent.parent
+ *

+ */ + @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference" ) + public static final String SP_PARENT = "parent"; + /** + * Fluent Client search parameter constant for parent + *

+ * Description: The parent DeviceComponent resource
+ * Type: reference
+ * Path: DeviceComponent.parent
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceComponent:parent". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceComponent:parent").toLocked(); + + /** + * Search parameter: type + *

+ * Description: The device component type
+ * Type: token
+ * Path: DeviceComponent.type
+ *

+ */ + @SearchParamDefinition(name="type", path="DeviceComponent.type", description="The device component type", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The device component type
+ * Type: token
+ * Path: DeviceComponent.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceMetric.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceMetric.java new file mode 100644 index 00000000000..8bf346261e6 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceMetric.java @@ -0,0 +1,1791 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * 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 DomainResource { + + public enum DeviceMetricOperationalStatus { + /** + * 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 DeviceMetricOperationalStatus fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown DeviceMetricOperationalStatus code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/metric-operational-status"; + case OFF: return "http://hl7.org/fhir/metric-operational-status"; + case STANDBY: return "http://hl7.org/fhir/metric-operational-status"; + 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 DeviceMetricOperationalStatusEnumFactory implements EnumFactory { + public DeviceMetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("on".equals(codeString)) + return DeviceMetricOperationalStatus.ON; + if ("off".equals(codeString)) + return DeviceMetricOperationalStatus.OFF; + if ("standby".equals(codeString)) + return DeviceMetricOperationalStatus.STANDBY; + throw new IllegalArgumentException("Unknown DeviceMetricOperationalStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("on".equals(codeString)) + return new Enumeration(this, DeviceMetricOperationalStatus.ON); + if ("off".equals(codeString)) + return new Enumeration(this, DeviceMetricOperationalStatus.OFF); + if ("standby".equals(codeString)) + return new Enumeration(this, DeviceMetricOperationalStatus.STANDBY); + throw new FHIRException("Unknown DeviceMetricOperationalStatus code '"+codeString+"'"); + } + public String toCode(DeviceMetricOperationalStatus code) { + if (code == DeviceMetricOperationalStatus.ON) + return "on"; + if (code == DeviceMetricOperationalStatus.OFF) + return "off"; + if (code == DeviceMetricOperationalStatus.STANDBY) + return "standby"; + return "?"; + } + public String toSystem(DeviceMetricOperationalStatus code) { + return code.getSystem(); + } + } + + public enum DeviceMetricColor { + /** + * Color for representation - black. + */ + BLACK, + /** + * Color for representation - red. + */ + RED, + /** + * Color for representation - green. + */ + GREEN, + /** + * Color for representation - yellow. + */ + YELLOW, + /** + * Color for representation - blue. + */ + BLUE, + /** + * Color for representation - magenta. + */ + MAGENTA, + /** + * Color for representation - cyan. + */ + CYAN, + /** + * Color for representation - white. + */ + WHITE, + /** + * added to help the parsers + */ + NULL; + public static DeviceMetricColor fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("black".equals(codeString)) + return BLACK; + if ("red".equals(codeString)) + return RED; + if ("green".equals(codeString)) + return GREEN; + if ("yellow".equals(codeString)) + return YELLOW; + if ("blue".equals(codeString)) + return BLUE; + if ("magenta".equals(codeString)) + return MAGENTA; + if ("cyan".equals(codeString)) + return CYAN; + if ("white".equals(codeString)) + return WHITE; + throw new FHIRException("Unknown DeviceMetricColor code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case BLACK: return "black"; + case RED: return "red"; + case GREEN: return "green"; + case YELLOW: return "yellow"; + case BLUE: return "blue"; + case MAGENTA: return "magenta"; + case CYAN: return "cyan"; + case WHITE: return "white"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case BLACK: return "http://hl7.org/fhir/metric-color"; + case RED: return "http://hl7.org/fhir/metric-color"; + case GREEN: return "http://hl7.org/fhir/metric-color"; + case YELLOW: return "http://hl7.org/fhir/metric-color"; + case BLUE: return "http://hl7.org/fhir/metric-color"; + case MAGENTA: return "http://hl7.org/fhir/metric-color"; + case CYAN: return "http://hl7.org/fhir/metric-color"; + case WHITE: return "http://hl7.org/fhir/metric-color"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case BLACK: return "Color for representation - black."; + case RED: return "Color for representation - red."; + case GREEN: return "Color for representation - green."; + case YELLOW: return "Color for representation - yellow."; + case BLUE: return "Color for representation - blue."; + case MAGENTA: return "Color for representation - magenta."; + case CYAN: return "Color for representation - cyan."; + case WHITE: return "Color for representation - white."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case BLACK: return "Color Black"; + case RED: return "Color Red"; + case GREEN: return "Color Green"; + case YELLOW: return "Color Yellow"; + case BLUE: return "Color Blue"; + case MAGENTA: return "Color Magenta"; + case CYAN: return "Color Cyan"; + case WHITE: return "Color White"; + default: return "?"; + } + } + } + + public static class DeviceMetricColorEnumFactory implements EnumFactory { + public DeviceMetricColor fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("black".equals(codeString)) + return DeviceMetricColor.BLACK; + if ("red".equals(codeString)) + return DeviceMetricColor.RED; + if ("green".equals(codeString)) + return DeviceMetricColor.GREEN; + if ("yellow".equals(codeString)) + return DeviceMetricColor.YELLOW; + if ("blue".equals(codeString)) + return DeviceMetricColor.BLUE; + if ("magenta".equals(codeString)) + return DeviceMetricColor.MAGENTA; + if ("cyan".equals(codeString)) + return DeviceMetricColor.CYAN; + if ("white".equals(codeString)) + return DeviceMetricColor.WHITE; + throw new IllegalArgumentException("Unknown DeviceMetricColor code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("black".equals(codeString)) + return new Enumeration(this, DeviceMetricColor.BLACK); + if ("red".equals(codeString)) + return new Enumeration(this, DeviceMetricColor.RED); + if ("green".equals(codeString)) + return new Enumeration(this, DeviceMetricColor.GREEN); + if ("yellow".equals(codeString)) + return new Enumeration(this, DeviceMetricColor.YELLOW); + if ("blue".equals(codeString)) + return new Enumeration(this, DeviceMetricColor.BLUE); + if ("magenta".equals(codeString)) + return new Enumeration(this, DeviceMetricColor.MAGENTA); + if ("cyan".equals(codeString)) + return new Enumeration(this, DeviceMetricColor.CYAN); + if ("white".equals(codeString)) + return new Enumeration(this, DeviceMetricColor.WHITE); + throw new FHIRException("Unknown DeviceMetricColor code '"+codeString+"'"); + } + public String toCode(DeviceMetricColor code) { + if (code == DeviceMetricColor.BLACK) + return "black"; + if (code == DeviceMetricColor.RED) + return "red"; + if (code == DeviceMetricColor.GREEN) + return "green"; + if (code == DeviceMetricColor.YELLOW) + return "yellow"; + if (code == DeviceMetricColor.BLUE) + return "blue"; + if (code == DeviceMetricColor.MAGENTA) + return "magenta"; + if (code == DeviceMetricColor.CYAN) + return "cyan"; + if (code == DeviceMetricColor.WHITE) + return "white"; + return "?"; + } + public String toSystem(DeviceMetricColor code) { + return code.getSystem(); + } + } + + public enum DeviceMetricCategory { + /** + * 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 DeviceMetricCategory fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown DeviceMetricCategory code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/metric-category"; + case SETTING: return "http://hl7.org/fhir/metric-category"; + case CALCULATION: return "http://hl7.org/fhir/metric-category"; + case UNSPECIFIED: return "http://hl7.org/fhir/metric-category"; + 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 DeviceMetricCategoryEnumFactory implements EnumFactory { + public DeviceMetricCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("measurement".equals(codeString)) + return DeviceMetricCategory.MEASUREMENT; + if ("setting".equals(codeString)) + return DeviceMetricCategory.SETTING; + if ("calculation".equals(codeString)) + return DeviceMetricCategory.CALCULATION; + if ("unspecified".equals(codeString)) + return DeviceMetricCategory.UNSPECIFIED; + throw new IllegalArgumentException("Unknown DeviceMetricCategory code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("measurement".equals(codeString)) + return new Enumeration(this, DeviceMetricCategory.MEASUREMENT); + if ("setting".equals(codeString)) + return new Enumeration(this, DeviceMetricCategory.SETTING); + if ("calculation".equals(codeString)) + return new Enumeration(this, DeviceMetricCategory.CALCULATION); + if ("unspecified".equals(codeString)) + return new Enumeration(this, DeviceMetricCategory.UNSPECIFIED); + throw new FHIRException("Unknown DeviceMetricCategory code '"+codeString+"'"); + } + public String toCode(DeviceMetricCategory code) { + if (code == DeviceMetricCategory.MEASUREMENT) + return "measurement"; + if (code == DeviceMetricCategory.SETTING) + return "setting"; + if (code == DeviceMetricCategory.CALCULATION) + return "calculation"; + if (code == DeviceMetricCategory.UNSPECIFIED) + return "unspecified"; + return "?"; + } + public String toSystem(DeviceMetricCategory code) { + return code.getSystem(); + } + } + + public enum DeviceMetricCalibrationType { + /** + * TODO + */ + UNSPECIFIED, + /** + * TODO + */ + OFFSET, + /** + * TODO + */ + GAIN, + /** + * TODO + */ + TWOPOINT, + /** + * added to help the parsers + */ + NULL; + public static DeviceMetricCalibrationType fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown DeviceMetricCalibrationType code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/metric-calibration-type"; + case OFFSET: return "http://hl7.org/fhir/metric-calibration-type"; + case GAIN: return "http://hl7.org/fhir/metric-calibration-type"; + case TWOPOINT: return "http://hl7.org/fhir/metric-calibration-type"; + 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 DeviceMetricCalibrationTypeEnumFactory implements EnumFactory { + public DeviceMetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unspecified".equals(codeString)) + return DeviceMetricCalibrationType.UNSPECIFIED; + if ("offset".equals(codeString)) + return DeviceMetricCalibrationType.OFFSET; + if ("gain".equals(codeString)) + return DeviceMetricCalibrationType.GAIN; + if ("two-point".equals(codeString)) + return DeviceMetricCalibrationType.TWOPOINT; + throw new IllegalArgumentException("Unknown DeviceMetricCalibrationType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("unspecified".equals(codeString)) + return new Enumeration(this, DeviceMetricCalibrationType.UNSPECIFIED); + if ("offset".equals(codeString)) + return new Enumeration(this, DeviceMetricCalibrationType.OFFSET); + if ("gain".equals(codeString)) + return new Enumeration(this, DeviceMetricCalibrationType.GAIN); + if ("two-point".equals(codeString)) + return new Enumeration(this, DeviceMetricCalibrationType.TWOPOINT); + throw new FHIRException("Unknown DeviceMetricCalibrationType code '"+codeString+"'"); + } + public String toCode(DeviceMetricCalibrationType code) { + if (code == DeviceMetricCalibrationType.UNSPECIFIED) + return "unspecified"; + if (code == DeviceMetricCalibrationType.OFFSET) + return "offset"; + if (code == DeviceMetricCalibrationType.GAIN) + return "gain"; + if (code == DeviceMetricCalibrationType.TWOPOINT) + return "two-point"; + return "?"; + } + public String toSystem(DeviceMetricCalibrationType code) { + return code.getSystem(); + } + } + + public enum DeviceMetricCalibrationState { + /** + * 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 DeviceMetricCalibrationState fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown DeviceMetricCalibrationState code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/metric-calibration-state"; + case CALIBRATIONREQUIRED: return "http://hl7.org/fhir/metric-calibration-state"; + case CALIBRATED: return "http://hl7.org/fhir/metric-calibration-state"; + case UNSPECIFIED: return "http://hl7.org/fhir/metric-calibration-state"; + 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 DeviceMetricCalibrationStateEnumFactory implements EnumFactory { + public DeviceMetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-calibrated".equals(codeString)) + return DeviceMetricCalibrationState.NOTCALIBRATED; + if ("calibration-required".equals(codeString)) + return DeviceMetricCalibrationState.CALIBRATIONREQUIRED; + if ("calibrated".equals(codeString)) + return DeviceMetricCalibrationState.CALIBRATED; + if ("unspecified".equals(codeString)) + return DeviceMetricCalibrationState.UNSPECIFIED; + throw new IllegalArgumentException("Unknown DeviceMetricCalibrationState code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("not-calibrated".equals(codeString)) + return new Enumeration(this, DeviceMetricCalibrationState.NOTCALIBRATED); + if ("calibration-required".equals(codeString)) + return new Enumeration(this, DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + if ("calibrated".equals(codeString)) + return new Enumeration(this, DeviceMetricCalibrationState.CALIBRATED); + if ("unspecified".equals(codeString)) + return new Enumeration(this, DeviceMetricCalibrationState.UNSPECIFIED); + throw new FHIRException("Unknown DeviceMetricCalibrationState code '"+codeString+"'"); + } + public String toCode(DeviceMetricCalibrationState code) { + if (code == DeviceMetricCalibrationState.NOTCALIBRATED) + return "not-calibrated"; + if (code == DeviceMetricCalibrationState.CALIBRATIONREQUIRED) + return "calibration-required"; + if (code == DeviceMetricCalibrationState.CALIBRATED) + return "calibrated"; + if (code == DeviceMetricCalibrationState.UNSPECIFIED) + return "unspecified"; + return "?"; + } + public String toSystem(DeviceMetricCalibrationState code) { + return code.getSystem(); + } + } + + @Block() + public static class DeviceMetricCalibrationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the type of the calibration method. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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 = 1163986578L; + + /** + * Constructor + */ + public DeviceMetricCalibrationComponent() { + 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 DeviceMetricCalibrationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new DeviceMetricCalibrationTypeEnumFactory()); // bb + 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 DeviceMetricCalibrationComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Describes the type of the calibration method. + */ + public DeviceMetricCalibrationType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Describes the type of the calibration method. + */ + public DeviceMetricCalibrationComponent setType(DeviceMetricCalibrationType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new DeviceMetricCalibrationTypeEnumFactory()); + 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 DeviceMetricCalibrationComponent.state"); + else if (Configuration.doAutoCreate()) + this.state = new Enumeration(new DeviceMetricCalibrationStateEnumFactory()); // bb + 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 DeviceMetricCalibrationComponent setStateElement(Enumeration value) { + this.state = value; + return this; + } + + /** + * @return Describes the state of the calibration. + */ + public DeviceMetricCalibrationState getState() { + return this.state == null ? null : this.state.getValue(); + } + + /** + * @param value Describes the state of the calibration. + */ + public DeviceMetricCalibrationComponent setState(DeviceMetricCalibrationState value) { + if (value == null) + this.state = null; + else { + if (this.state == null) + this.state = new Enumeration(new DeviceMetricCalibrationStateEnumFactory()); + 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 DeviceMetricCalibrationComponent.time"); + else if (Configuration.doAutoCreate()) + this.time = new InstantType(); // bb + 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 DeviceMetricCalibrationComponent 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 DeviceMetricCalibrationComponent 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 109757585: /*state*/ return this.state == null ? new Base[0] : new Base[] {this.state}; // Enumeration + case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // InstantType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new DeviceMetricCalibrationTypeEnumFactory().fromType(value); // Enumeration + break; + case 109757585: // state + this.state = new DeviceMetricCalibrationStateEnumFactory().fromType(value); // Enumeration + break; + case 3560141: // time + this.time = castToInstant(value); // InstantType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new DeviceMetricCalibrationTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("state")) + this.state = new DeviceMetricCalibrationStateEnumFactory().fromType(value); // Enumeration + else if (name.equals("time")) + this.time = castToInstant(value); // InstantType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 109757585: throw new FHIRException("Cannot make property state as it is not a complex type"); // Enumeration + case 3560141: throw new FHIRException("Cannot make property time as it is not a complex type"); // InstantType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.type"); + } + else if (name.equals("state")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.state"); + } + else if (name.equals("time")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.time"); + } + else + return super.addChild(name); + } + + public DeviceMetricCalibrationComponent copy() { + DeviceMetricCalibrationComponent dst = new DeviceMetricCalibrationComponent(); + 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; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceMetricCalibrationComponent)) + return false; + DeviceMetricCalibrationComponent o = (DeviceMetricCalibrationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(state, o.state, true) && compareDeep(time, o.time, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceMetricCalibrationComponent)) + return false; + DeviceMetricCalibrationComponent o = (DeviceMetricCalibrationComponent) other; + return compareValues(type, o.type, true) && compareValues(state, o.state, true) && compareValues(time, o.time, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (state == null || state.isEmpty()) + && (time == null || time.isEmpty()); + } + + public String fhirType() { + return "DeviceMetric.calibration"; + + } + + } + + /** + * Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1, modifier=false, summary=true) + @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=1, min=1, max=1, modifier=false, summary=true) + @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. 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." ) + 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=2, min=0, max=1, modifier=false, summary=true) + @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=3, min=0, max=1, modifier=false, summary=true) + @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=4, min=0, max=1, modifier=false, summary=true) + @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. 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 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 = "operationalStatus", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="on | off | standby", formalDefinition="Indicates current operational state of the device. For example: On, Off, Standby, etc." ) + protected Enumeration operationalStatus; + + /** + * Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta. + */ + @Child(name = "color", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="black | red | green | yellow | blue | magenta | cyan | white", formalDefinition="Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta." ) + protected Enumeration 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, modifier=false, summary=true) + @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. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured. + */ + @Child(name = "measurementPeriod", type = {Timing.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Describes the measurement repetition time", formalDefinition="Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured." ) + protected Timing measurementPeriod; + + /** + * Describes the calibrations that have been performed or that are required to be performed. + */ + @Child(name = "calibration", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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 calibration; + + private static final long serialVersionUID = 1786401018L; + + /** + * Constructor + */ + public DeviceMetric() { + super(); + } + + /** + * Constructor + */ + 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(); // cc + 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(); // cc + 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(); // cc + 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(); // cc + 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(); // aa + 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(); // cc + 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(); // aa + 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 #operationalStatus} (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 "getOperationalStatus" gives direct access to the value + */ + public Enumeration getOperationalStatusElement() { + if (this.operationalStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.operationalStatus"); + else if (Configuration.doAutoCreate()) + this.operationalStatus = new Enumeration(new DeviceMetricOperationalStatusEnumFactory()); // bb + return this.operationalStatus; + } + + public boolean hasOperationalStatusElement() { + return this.operationalStatus != null && !this.operationalStatus.isEmpty(); + } + + public boolean hasOperationalStatus() { + return this.operationalStatus != null && !this.operationalStatus.isEmpty(); + } + + /** + * @param value {@link #operationalStatus} (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 "getOperationalStatus" gives direct access to the value + */ + public DeviceMetric setOperationalStatusElement(Enumeration value) { + this.operationalStatus = value; + return this; + } + + /** + * @return Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + public DeviceMetricOperationalStatus getOperationalStatus() { + return this.operationalStatus == null ? null : this.operationalStatus.getValue(); + } + + /** + * @param value Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + public DeviceMetric setOperationalStatus(DeviceMetricOperationalStatus value) { + if (value == null) + this.operationalStatus = null; + else { + if (this.operationalStatus == null) + this.operationalStatus = new Enumeration(new DeviceMetricOperationalStatusEnumFactory()); + this.operationalStatus.setValue(value); + } + return this; + } + + /** + * @return {@link #color} (Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value + */ + public Enumeration getColorElement() { + if (this.color == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.color"); + else if (Configuration.doAutoCreate()) + this.color = new Enumeration(new DeviceMetricColorEnumFactory()); // bb + return this.color; + } + + public boolean hasColorElement() { + return this.color != null && !this.color.isEmpty(); + } + + public boolean hasColor() { + return this.color != null && !this.color.isEmpty(); + } + + /** + * @param value {@link #color} (Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value + */ + public DeviceMetric setColorElement(Enumeration value) { + this.color = value; + return this; + } + + /** + * @return Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta. + */ + public DeviceMetricColor getColor() { + return this.color == null ? null : this.color.getValue(); + } + + /** + * @param value Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta. + */ + public DeviceMetric setColor(DeviceMetricColor value) { + if (value == null) + this.color = null; + else { + if (this.color == null) + this.color = new Enumeration(new DeviceMetricColorEnumFactory()); + this.color.setValue(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(new DeviceMetricCategoryEnumFactory()); // bb + 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 DeviceMetricCategory 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(DeviceMetricCategory value) { + if (this.category == null) + this.category = new Enumeration(new DeviceMetricCategoryEnumFactory()); + this.category.setValue(value); + return this; + } + + /** + * @return {@link #measurementPeriod} (Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.) + */ + 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(); // cc + 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. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.) + */ + public DeviceMetric setMeasurementPeriod(Timing value) { + this.measurementPeriod = value; + return this; + } + + /** + * @return {@link #calibration} (Describes the calibrations that have been performed or that are required to be performed.) + */ + public List getCalibration() { + if (this.calibration == null) + this.calibration = new ArrayList(); + return this.calibration; + } + + public boolean hasCalibration() { + if (this.calibration == null) + return false; + for (DeviceMetricCalibrationComponent item : this.calibration) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #calibration} (Describes the calibrations that have been performed or that are required to be performed.) + */ + // syntactic sugar + public DeviceMetricCalibrationComponent addCalibration() { //3 + DeviceMetricCalibrationComponent t = new DeviceMetricCalibrationComponent(); + if (this.calibration == null) + this.calibration = new ArrayList(); + this.calibration.add(t); + return t; + } + + // syntactic sugar + public DeviceMetric addCalibration(DeviceMetricCalibrationComponent t) { //3 + if (t == null) + return this; + if (this.calibration == null) + this.calibration = new ArrayList(); + this.calibration.add(t); + return this; + } + + 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. 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.", 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. 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.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("operationalStatus", "code", "Indicates current operational state of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); + childrenList.add(new Property("color", "code", "Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.", 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 necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.", 0, java.lang.Integer.MAX_VALUE, measurementPeriod)); + childrenList.add(new Property("calibration", "", "Describes the calibrations that have been performed or that are required to be performed.", 0, java.lang.Integer.MAX_VALUE, calibration)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // CodeableConcept + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference + case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference + case -2103166364: /*operationalStatus*/ return this.operationalStatus == null ? new Base[0] : new Base[] {this.operationalStatus}; // Enumeration + case 94842723: /*color*/ return this.color == null ? new Base[0] : new Base[] {this.color}; // Enumeration + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration + case -1300332387: /*measurementPeriod*/ return this.measurementPeriod == null ? new Base[0] : new Base[] {this.measurementPeriod}; // Timing + case 1421318634: /*calibration*/ return this.calibration == null ? new Base[0] : this.calibration.toArray(new Base[this.calibration.size()]); // DeviceMetricCalibrationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 3594628: // unit + this.unit = castToCodeableConcept(value); // CodeableConcept + break; + case -896505829: // source + this.source = castToReference(value); // Reference + break; + case -995424086: // parent + this.parent = castToReference(value); // Reference + break; + case -2103166364: // operationalStatus + this.operationalStatus = new DeviceMetricOperationalStatusEnumFactory().fromType(value); // Enumeration + break; + case 94842723: // color + this.color = new DeviceMetricColorEnumFactory().fromType(value); // Enumeration + break; + case 50511102: // category + this.category = new DeviceMetricCategoryEnumFactory().fromType(value); // Enumeration + break; + case -1300332387: // measurementPeriod + this.measurementPeriod = castToTiming(value); // Timing + break; + case 1421318634: // calibration + this.getCalibration().add((DeviceMetricCalibrationComponent) value); // DeviceMetricCalibrationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("unit")) + this.unit = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("source")) + this.source = castToReference(value); // Reference + else if (name.equals("parent")) + this.parent = castToReference(value); // Reference + else if (name.equals("operationalStatus")) + this.operationalStatus = new DeviceMetricOperationalStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("color")) + this.color = new DeviceMetricColorEnumFactory().fromType(value); // Enumeration + else if (name.equals("category")) + this.category = new DeviceMetricCategoryEnumFactory().fromType(value); // Enumeration + else if (name.equals("measurementPeriod")) + this.measurementPeriod = castToTiming(value); // Timing + else if (name.equals("calibration")) + this.getCalibration().add((DeviceMetricCalibrationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // CodeableConcept + case -1618432855: return getIdentifier(); // Identifier + case 3594628: return getUnit(); // CodeableConcept + case -896505829: return getSource(); // Reference + case -995424086: return getParent(); // Reference + case -2103166364: throw new FHIRException("Cannot make property operationalStatus as it is not a complex type"); // Enumeration + case 94842723: throw new FHIRException("Cannot make property color as it is not a complex type"); // Enumeration + case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration + case -1300332387: return getMeasurementPeriod(); // Timing + case 1421318634: return addCalibration(); // DeviceMetricCalibrationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("unit")) { + this.unit = new CodeableConcept(); + return this.unit; + } + else if (name.equals("source")) { + this.source = new Reference(); + return this.source; + } + else if (name.equals("parent")) { + this.parent = new Reference(); + return this.parent; + } + else if (name.equals("operationalStatus")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.operationalStatus"); + } + else if (name.equals("color")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.color"); + } + else if (name.equals("category")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.category"); + } + else if (name.equals("measurementPeriod")) { + this.measurementPeriod = new Timing(); + return this.measurementPeriod; + } + else if (name.equals("calibration")) { + return addCalibration(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DeviceMetric"; + + } + + 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.operationalStatus = operationalStatus == null ? null : operationalStatus.copy(); + dst.color = color == null ? null : color.copy(); + dst.category = category == null ? null : category.copy(); + dst.measurementPeriod = measurementPeriod == null ? null : measurementPeriod.copy(); + if (calibration != null) { + dst.calibration = new ArrayList(); + for (DeviceMetricCalibrationComponent i : calibration) + dst.calibration.add(i.copy()); + }; + return dst; + } + + protected DeviceMetric typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceMetric)) + return false; + DeviceMetric o = (DeviceMetric) other; + return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(unit, o.unit, true) + && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) + && compareDeep(color, o.color, true) && compareDeep(category, o.category, true) && compareDeep(measurementPeriod, o.measurementPeriod, true) + && compareDeep(calibration, o.calibration, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceMetric)) + return false; + DeviceMetric o = (DeviceMetric) other; + return compareValues(operationalStatus, o.operationalStatus, true) && compareValues(color, o.color, true) + && compareValues(category, o.category, true); + } + + 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()) + && (operationalStatus == null || operationalStatus.isEmpty()) && (color == null || color.isEmpty()) + && (category == null || category.isEmpty()) && (measurementPeriod == null || measurementPeriod.isEmpty()) + && (calibration == null || calibration.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceMetric; + } + + /** + * Search parameter: category + *

+ * Description: The category of the metric
+ * Type: token
+ * Path: DeviceMetric.category
+ *

+ */ + @SearchParamDefinition(name="category", path="DeviceMetric.category", description="The category of the metric", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: The category of the metric
+ * Type: token
+ * Path: DeviceMetric.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: source + *

+ * Description: The device resource
+ * Type: reference
+ * Path: DeviceMetric.source
+ *

+ */ + @SearchParamDefinition(name="source", path="DeviceMetric.source", description="The device resource", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: The device resource
+ * Type: reference
+ * Path: DeviceMetric.source
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceMetric:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("DeviceMetric:source").toLocked(); + + /** + * Search parameter: parent + *

+ * Description: The parent DeviceMetric resource
+ * Type: reference
+ * Path: DeviceMetric.parent
+ *

+ */ + @SearchParamDefinition(name="parent", path="DeviceMetric.parent", description="The parent DeviceMetric resource", type="reference" ) + public static final String SP_PARENT = "parent"; + /** + * Fluent Client search parameter constant for parent + *

+ * Description: The parent DeviceMetric resource
+ * Type: reference
+ * Path: DeviceMetric.parent
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceMetric:parent". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceMetric:parent").toLocked(); + + /** + * Search parameter: type + *

+ * Description: The component type
+ * Type: token
+ * Path: DeviceMetric.type
+ *

+ */ + @SearchParamDefinition(name="type", path="DeviceMetric.type", description="The component type", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The component type
+ * Type: token
+ * Path: DeviceMetric.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: The identifier of the metric
+ * Type: token
+ * Path: DeviceMetric.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DeviceMetric.identifier", description="The identifier of the metric", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier of the metric
+ * Type: token
+ * Path: DeviceMetric.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceUseRequest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceUseRequest.java new file mode 100644 index 00000000000..b8940f172d1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceUseRequest.java @@ -0,0 +1,1475 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. + */ +@ResourceDef(name="DeviceUseRequest", profile="http://hl7.org/fhir/Profile/DeviceUseRequest") +public class DeviceUseRequest extends DomainResource { + + public enum DeviceUseRequestStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request has been planned. + */ + PLANNED, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the request but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The request was attempted, but due to some procedural error, it could not be completed. + */ + ABORTED, + /** + * added to help the parsers + */ + NULL; + public static DeviceUseRequestStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("planned".equals(codeString)) + return PLANNED; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + 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 ("aborted".equals(codeString)) + return ABORTED; + throw new FHIRException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case PLANNED: return "planned"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case ABORTED: return "aborted"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return "http://hl7.org/fhir/device-use-request-status"; + case PLANNED: return "http://hl7.org/fhir/device-use-request-status"; + case REQUESTED: return "http://hl7.org/fhir/device-use-request-status"; + case RECEIVED: return "http://hl7.org/fhir/device-use-request-status"; + case ACCEPTED: return "http://hl7.org/fhir/device-use-request-status"; + case INPROGRESS: return "http://hl7.org/fhir/device-use-request-status"; + case COMPLETED: return "http://hl7.org/fhir/device-use-request-status"; + case SUSPENDED: return "http://hl7.org/fhir/device-use-request-status"; + case REJECTED: return "http://hl7.org/fhir/device-use-request-status"; + case ABORTED: return "http://hl7.org/fhir/device-use-request-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case PLANNED: return "The request has been planned."; + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the request but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case ABORTED: return "The request was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case PLANNED: return "Planned"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Completed"; + case SUSPENDED: return "Suspended"; + case REJECTED: return "Rejected"; + case ABORTED: return "Aborted"; + default: return "?"; + } + } + } + + 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; + if ("proposed".equals(codeString)) + return DeviceUseRequestStatus.PROPOSED; + if ("planned".equals(codeString)) + return DeviceUseRequestStatus.PLANNED; + if ("requested".equals(codeString)) + return DeviceUseRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return DeviceUseRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return DeviceUseRequestStatus.ACCEPTED; + if ("in-progress".equals(codeString)) + return DeviceUseRequestStatus.INPROGRESS; + if ("completed".equals(codeString)) + return DeviceUseRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return DeviceUseRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return DeviceUseRequestStatus.REJECTED; + if ("aborted".equals(codeString)) + return DeviceUseRequestStatus.ABORTED; + throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.PROPOSED); + if ("planned".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.PLANNED); + if ("requested".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.REQUESTED); + if ("received".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.RECEIVED); + if ("accepted".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.ACCEPTED); + if ("in-progress".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.INPROGRESS); + if ("completed".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.COMPLETED); + if ("suspended".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.SUSPENDED); + if ("rejected".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.REJECTED); + if ("aborted".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.ABORTED); + throw new FHIRException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); + } + public String toCode(DeviceUseRequestStatus code) { + if (code == DeviceUseRequestStatus.PROPOSED) + return "proposed"; + if (code == DeviceUseRequestStatus.PLANNED) + return "planned"; + if (code == DeviceUseRequestStatus.REQUESTED) + return "requested"; + if (code == DeviceUseRequestStatus.RECEIVED) + return "received"; + if (code == DeviceUseRequestStatus.ACCEPTED) + return "accepted"; + if (code == DeviceUseRequestStatus.INPROGRESS) + return "in-progress"; + if (code == DeviceUseRequestStatus.COMPLETED) + return "completed"; + if (code == DeviceUseRequestStatus.SUSPENDED) + return "suspended"; + if (code == DeviceUseRequestStatus.REJECTED) + return "rejected"; + if (code == DeviceUseRequestStatus.ABORTED) + return "aborted"; + return "?"; + } + public String toSystem(DeviceUseRequestStatus code) { + return code.getSystem(); + } + } + + public enum DeviceUseRequestPriority { + /** + * The request has a normal priority. + */ + ROUTINE, + /** + * The request should be done urgently. + */ + URGENT, + /** + * The request is time-critical. + */ + STAT, + /** + * The request should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + public static DeviceUseRequestPriority fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new FHIRException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return "http://hl7.org/fhir/device-use-request-priority"; + case URGENT: return "http://hl7.org/fhir/device-use-request-priority"; + case STAT: return "http://hl7.org/fhir/device-use-request-priority"; + case ASAP: return "http://hl7.org/fhir/device-use-request-priority"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The request has a normal priority."; + case URGENT: return "The request should be done urgently."; + case STAT: return "The request is time-critical."; + case ASAP: return "The request should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "ASAP"; + default: return "?"; + } + } + } + + 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; + if ("routine".equals(codeString)) + return DeviceUseRequestPriority.ROUTINE; + if ("urgent".equals(codeString)) + return DeviceUseRequestPriority.URGENT; + if ("stat".equals(codeString)) + return DeviceUseRequestPriority.STAT; + if ("asap".equals(codeString)) + return DeviceUseRequestPriority.ASAP; + throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return new Enumeration(this, DeviceUseRequestPriority.ROUTINE); + if ("urgent".equals(codeString)) + return new Enumeration(this, DeviceUseRequestPriority.URGENT); + if ("stat".equals(codeString)) + return new Enumeration(this, DeviceUseRequestPriority.STAT); + if ("asap".equals(codeString)) + return new Enumeration(this, DeviceUseRequestPriority.ASAP); + throw new FHIRException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + } + public String toCode(DeviceUseRequestPriority code) { + if (code == DeviceUseRequestPriority.ROUTINE) + return "routine"; + if (code == DeviceUseRequestPriority.URGENT) + return "urgent"; + if (code == DeviceUseRequestPriority.STAT) + return "stat"; + if (code == DeviceUseRequestPriority.ASAP) + return "asap"; + return "?"; + } + public String toSystem(DeviceUseRequestPriority code) { + return code.getSystem(); + } + } + + /** + * Indicates the site on the subject's body where the device should be used ( i.e. the target site). + */ + @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device should be used ( i.e. the target site)." ) + protected Type bodySite; + + /** + * The status of the request. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | aborted", formalDefinition="The status of the request." ) + protected Enumeration status; + + /** + * The details of the device to be used. + */ + @Child(name = "device", type = {Device.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Device requested", formalDefinition="The details of the device to be used." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The details of the device to be used.) + */ + protected Device deviceTarget; + + /** + * An encounter that provides additional context in which this request is made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Encounter motivating request", formalDefinition="An encounter that provides additional context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * Identifiers assigned to this order by the orderer or by the receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Request identifier", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) + protected List identifier; + + /** + * Reason or justification for the use of this device. + */ + @Child(name = "indication", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Reason for request", formalDefinition="Reason or justification for the use of this device." ) + protected List indication; + + /** + * Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. + */ + @Child(name = "notes", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Notes or comments", formalDefinition="Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) + protected List notes; + + /** + * The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%. + */ + @Child(name = "prnReason", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="PRN", formalDefinition="The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%." ) + protected List prnReason; + + /** + * The time when the request was made. + */ + @Child(name = "orderedOn", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When ordered", formalDefinition="The time when the request was made." ) + protected DateTimeType orderedOn; + + /** + * The time at which the request was made/recorded. + */ + @Child(name = "recordedOn", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When recorded", formalDefinition="The time at which the request was made/recorded." ) + protected DateTimeType recordedOn; + + /** + * The patient who will use the device. + */ + @Child(name = "subject", type = {Patient.class}, order=10, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Focus of request", formalDefinition="The patient who will use the device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who will use the device.) + */ + protected Patient subjectTarget; + + /** + * The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Schedule for use", formalDefinition="The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"." ) + protected Type timing; + + /** + * Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + @Child(name = "priority", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine." ) + protected Enumeration priority; + + private static final long serialVersionUID = 1208477058L; + + /** + * Constructor + */ + public DeviceUseRequest() { + super(); + } + + /** + * Constructor + */ + public DeviceUseRequest(Reference device, Reference subject) { + super(); + this.device = device; + this.subject = subject; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) + */ + public Type getBodySite() { + return this.bodySite; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) + */ + public CodeableConcept getBodySiteCodeableConcept() throws FHIRException { + if (!(this.bodySite instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (CodeableConcept) this.bodySite; + } + + public boolean hasBodySiteCodeableConcept() { + return this.bodySite instanceof CodeableConcept; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) + */ + public Reference getBodySiteReference() throws FHIRException { + if (!(this.bodySite instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (Reference) this.bodySite; + } + + public boolean hasBodySiteReference() { + return this.bodySite instanceof Reference; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) + */ + public DeviceUseRequest setBodySite(Type value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #status} (The status of the request.). 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 DeviceUseRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DeviceUseRequestStatusEnumFactory()); // bb + 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 request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DeviceUseRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the request. + */ + public DeviceUseRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the request. + */ + public DeviceUseRequest setStatus(DeviceUseRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new DeviceUseRequestStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #device} (The details of the device to be used.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); // cc + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The details of the device to be used.) + */ + public DeviceUseRequest setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} 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 device to be used.) + */ + public Device getDeviceTarget() { + if (this.deviceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.device"); + else if (Configuration.doAutoCreate()) + this.deviceTarget = new Device(); // aa + return this.deviceTarget; + } + + /** + * @param value {@link #device} 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 device to be used.) + */ + public DeviceUseRequest setDeviceTarget(Device value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #encounter} (An encounter that provides additional context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (An encounter that provides additional context in which this request is made.) + */ + public DeviceUseRequest 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. (An encounter that provides additional context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (An encounter that provides additional context in which this request is made.) + */ + public DeviceUseRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) + */ + 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 assigned to this order by the orderer or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DeviceUseRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #indication} (Reason or justification for the use of this device.) + */ + 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} (Reason or justification for the use of this device.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + // syntactic sugar + public DeviceUseRequest addIndication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return this; + } + + /** + * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StringType item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + // syntactic sugar + public StringType addNotesElement() {//2 + StringType t = new StringType(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public DeviceUseRequest addNotes(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public boolean hasNotes(String value) { + if (this.notes == null) + return false; + for (StringType v : this.notes) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) + */ + public List getPrnReason() { + if (this.prnReason == null) + this.prnReason = new ArrayList(); + return this.prnReason; + } + + public boolean hasPrnReason() { + if (this.prnReason == null) + return false; + for (CodeableConcept item : this.prnReason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) + */ + // syntactic sugar + public CodeableConcept addPrnReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.prnReason == null) + this.prnReason = new ArrayList(); + this.prnReason.add(t); + return t; + } + + // syntactic sugar + public DeviceUseRequest addPrnReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.prnReason == null) + this.prnReason = new ArrayList(); + this.prnReason.add(t); + return this; + } + + /** + * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DateTimeType getOrderedOnElement() { + if (this.orderedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.orderedOn"); + else if (Configuration.doAutoCreate()) + this.orderedOn = new DateTimeType(); // bb + return this.orderedOn; + } + + public boolean hasOrderedOnElement() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + public boolean hasOrderedOn() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + /** + * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DeviceUseRequest setOrderedOnElement(DateTimeType value) { + this.orderedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getOrderedOn() { + return this.orderedOn == null ? null : this.orderedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public DeviceUseRequest setOrderedOn(Date value) { + if (value == null) + this.orderedOn = null; + else { + if (this.orderedOn == null) + this.orderedOn = new DateTimeType(); + this.orderedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DateTimeType getRecordedOnElement() { + if (this.recordedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.recordedOn"); + else if (Configuration.doAutoCreate()) + this.recordedOn = new DateTimeType(); // bb + return this.recordedOn; + } + + public boolean hasRecordedOnElement() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + public boolean hasRecordedOn() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + /** + * @param value {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DeviceUseRequest setRecordedOnElement(DateTimeType value) { + this.recordedOn = value; + return this; + } + + /** + * @return The time at which the request was made/recorded. + */ + 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(Date value) { + if (value == null) + this.recordedOn = null; + else { + if (this.recordedOn == null) + this.recordedOn = new DateTimeType(); + this.recordedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who will use the device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who will use the device.) + */ + public DeviceUseRequest 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 will use the device.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + 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 will use the device.) + */ + public DeviceUseRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getTimingTiming() throws FHIRException { + if (!(this.timing instanceof Timing)) + throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + public boolean hasTimingTiming() { + return this.timing instanceof Timing; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getTimingPeriod() throws FHIRException { + if (!(this.timing instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + public boolean hasTimingPeriod() { + return this.timing instanceof Period; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getTimingDateTimeType() throws FHIRException { + if (!(this.timing instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + public boolean hasTimingDateTimeType() { + return this.timing instanceof DateTimeType; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DeviceUseRequest setTiming(Type value) { + this.timing = value; + return this; + } + + /** + * @return {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new DeviceUseRequestPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public DeviceUseRequest setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + public DeviceUseRequestPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + public DeviceUseRequest setPriority(DeviceUseRequestPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new DeviceUseRequestPriorityEnumFactory()); + this.priority.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device should be used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("status", "code", "The status of the request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("device", "Reference(Device)", "The details of the device to be used.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("notes", "string", "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("prnReason", "CodeableConcept", "The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.", 0, java.lang.Integer.MAX_VALUE, prnReason)); + childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); + childrenList.add(new Property("recordedOn", "dateTime", "The time at which the request was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will use the device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("priority", "code", "Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Type + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // CodeableConcept + case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // StringType + case 1825472528: /*prnReason*/ return this.prnReason == null ? new Base[0] : this.prnReason.toArray(new Base[this.prnReason.size()]); // CodeableConcept + case -391079124: /*orderedOn*/ return this.orderedOn == null ? new Base[0] : new Base[] {this.orderedOn}; // DateTimeType + case 735397551: /*recordedOn*/ return this.recordedOn == null ? new Base[0] : new Base[] {this.recordedOn}; // DateTimeType + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1702620169: // bodySite + this.bodySite = (Type) value; // Type + break; + case -892481550: // status + this.status = new DeviceUseRequestStatusEnumFactory().fromType(value); // Enumeration + break; + case -1335157162: // device + this.device = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -597168804: // indication + this.getIndication().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 105008833: // notes + this.getNotes().add(castToString(value)); // StringType + break; + case 1825472528: // prnReason + this.getPrnReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -391079124: // orderedOn + this.orderedOn = castToDateTime(value); // DateTimeType + break; + case 735397551: // recordedOn + this.recordedOn = castToDateTime(value); // DateTimeType + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -873664438: // timing + this.timing = (Type) value; // Type + break; + case -1165461084: // priority + this.priority = new DeviceUseRequestPriorityEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("bodySite[x]")) + this.bodySite = (Type) value; // Type + else if (name.equals("status")) + this.status = new DeviceUseRequestStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("device")) + this.device = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("indication")) + this.getIndication().add(castToCodeableConcept(value)); + else if (name.equals("notes")) + this.getNotes().add(castToString(value)); + else if (name.equals("prnReason")) + this.getPrnReason().add(castToCodeableConcept(value)); + else if (name.equals("orderedOn")) + this.orderedOn = castToDateTime(value); // DateTimeType + else if (name.equals("recordedOn")) + this.recordedOn = castToDateTime(value); // DateTimeType + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("timing[x]")) + this.timing = (Type) value; // Type + else if (name.equals("priority")) + this.priority = new DeviceUseRequestPriorityEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -806219817: return getBodySite(); // Type + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -1335157162: return getDevice(); // Reference + case 1524132147: return getEncounter(); // Reference + case -1618432855: return addIdentifier(); // Identifier + case -597168804: return addIndication(); // CodeableConcept + case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType + case 1825472528: return addPrnReason(); // CodeableConcept + case -391079124: throw new FHIRException("Cannot make property orderedOn as it is not a complex type"); // DateTimeType + case 735397551: throw new FHIRException("Cannot make property recordedOn as it is not a complex type"); // DateTimeType + case -1867885268: return getSubject(); // Reference + case 164632566: return getTiming(); // Type + case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("bodySiteCodeableConcept")) { + this.bodySite = new CodeableConcept(); + return this.bodySite; + } + else if (name.equals("bodySiteReference")) { + this.bodySite = new Reference(); + return this.bodySite; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.status"); + } + else if (name.equals("device")) { + this.device = new Reference(); + return this.device; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("indication")) { + return addIndication(); + } + else if (name.equals("notes")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.notes"); + } + else if (name.equals("prnReason")) { + return addPrnReason(); + } + else if (name.equals("orderedOn")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.orderedOn"); + } + else if (name.equals("recordedOn")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.recordedOn"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("timingTiming")) { + this.timing = new Timing(); + return this.timing; + } + else if (name.equals("timingPeriod")) { + this.timing = new Period(); + return this.timing; + } + else if (name.equals("timingDateTime")) { + this.timing = new DateTimeType(); + return this.timing; + } + else if (name.equals("priority")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.priority"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DeviceUseRequest"; + + } + + public DeviceUseRequest copy() { + DeviceUseRequest dst = new DeviceUseRequest(); + copyValues(dst); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.status = status == null ? null : status.copy(); + dst.device = device == null ? null : device.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + if (notes != null) { + dst.notes = new ArrayList(); + for (StringType i : notes) + dst.notes.add(i.copy()); + }; + if (prnReason != null) { + dst.prnReason = new ArrayList(); + for (CodeableConcept i : prnReason) + dst.prnReason.add(i.copy()); + }; + dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); + dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.timing = timing == null ? null : timing.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected DeviceUseRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceUseRequest)) + return false; + DeviceUseRequest o = (DeviceUseRequest) other; + return compareDeep(bodySite, o.bodySite, true) && compareDeep(status, o.status, true) && compareDeep(device, o.device, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(identifier, o.identifier, true) && compareDeep(indication, o.indication, true) + && compareDeep(notes, o.notes, true) && compareDeep(prnReason, o.prnReason, true) && compareDeep(orderedOn, o.orderedOn, true) + && compareDeep(recordedOn, o.recordedOn, true) && compareDeep(subject, o.subject, true) && compareDeep(timing, o.timing, true) + && compareDeep(priority, o.priority, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceUseRequest)) + return false; + DeviceUseRequest o = (DeviceUseRequest) other; + return compareValues(status, o.status, true) && compareValues(notes, o.notes, true) && compareValues(orderedOn, o.orderedOn, true) + && compareValues(recordedOn, o.recordedOn, true) && compareValues(priority, o.priority, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) + && (device == null || device.isEmpty()) && (encounter == null || encounter.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (indication == null || indication.isEmpty()) && (notes == null || notes.isEmpty()) && (prnReason == null || prnReason.isEmpty()) + && (orderedOn == null || orderedOn.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) + && (subject == null || subject.isEmpty()) && (timing == null || timing.isEmpty()) && (priority == null || priority.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceUseRequest; + } + + /** + * Search parameter: patient + *

+ * Description: Search by subject - a patient
+ * Type: reference
+ * Path: DeviceUseRequest.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="DeviceUseRequest.subject", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Search by subject - a patient
+ * Type: reference
+ * Path: DeviceUseRequest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceUseRequest:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DeviceUseRequest:patient").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: Search by subject
+ * Type: reference
+ * Path: DeviceUseRequest.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="DeviceUseRequest.subject", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Search by subject
+ * Type: reference
+ * Path: DeviceUseRequest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceUseRequest:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DeviceUseRequest:subject").toLocked(); + + /** + * Search parameter: device + *

+ * Description: Device requested
+ * Type: reference
+ * Path: DeviceUseRequest.device
+ *

+ */ + @SearchParamDefinition(name="device", path="DeviceUseRequest.device", description="Device requested", type="reference" ) + public static final String SP_DEVICE = "device"; + /** + * Fluent Client search parameter constant for device + *

+ * Description: Device requested
+ * Type: reference
+ * Path: DeviceUseRequest.device
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceUseRequest:device". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("DeviceUseRequest:device").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceUseStatement.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceUseStatement.java new file mode 100644 index 00000000000..d760b5e79ae --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DeviceUseStatement.java @@ -0,0 +1,845 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. + */ +@ResourceDef(name="DeviceUseStatement", profile="http://hl7.org/fhir/Profile/DeviceUseStatement") +public class DeviceUseStatement extends DomainResource { + + /** + * Indicates the site on the subject's body where the device was used ( i.e. the target site). + */ + @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device was used ( i.e. the target site)." ) + protected Type bodySite; + + /** + * The time period over which the device was used. + */ + @Child(name = "whenUsed", type = {Period.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="The time period over which the device was used." ) + protected Period whenUsed; + + /** + * The details of the device used. + */ + @Child(name = "device", type = {Device.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="The details of the device used." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The details of the device used.) + */ + protected Device deviceTarget; + + /** + * An external identifier for this statement such as an IRI. + */ + @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="An external identifier for this statement such as an IRI." ) + protected List identifier; + + /** + * Reason or justification for the use of the device. + */ + @Child(name = "indication", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="Reason or justification for the use of the device." ) + protected List indication; + + /** + * Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. + */ + @Child(name = "notes", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) + protected List notes; + + /** + * The time at which the statement was made/recorded. + */ + @Child(name = "recordedOn", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="The time at which the statement was made/recorded." ) + protected DateTimeType recordedOn; + + /** + * The patient who used the device. + */ + @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="The patient who used the device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who used the device.) + */ + protected Patient subjectTarget; + + /** + * How often the device was used. + */ + @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="How often the device was used." ) + protected Type timing; + + private static final long serialVersionUID = -1668571635L; + + /** + * Constructor + */ + public DeviceUseStatement() { + super(); + } + + /** + * Constructor + */ + public DeviceUseStatement(Reference device, Reference subject) { + super(); + this.device = device; + this.subject = subject; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) + */ + public Type getBodySite() { + return this.bodySite; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) + */ + public CodeableConcept getBodySiteCodeableConcept() throws FHIRException { + if (!(this.bodySite instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (CodeableConcept) this.bodySite; + } + + public boolean hasBodySiteCodeableConcept() { + return this.bodySite instanceof CodeableConcept; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) + */ + public Reference getBodySiteReference() throws FHIRException { + if (!(this.bodySite instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); + return (Reference) this.bodySite; + } + + public boolean hasBodySiteReference() { + return this.bodySite instanceof Reference; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) + */ + public DeviceUseStatement setBodySite(Type value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #whenUsed} (The time period over which the device was used.) + */ + public Period getWhenUsed() { + if (this.whenUsed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.whenUsed"); + else if (Configuration.doAutoCreate()) + this.whenUsed = new Period(); // cc + return this.whenUsed; + } + + public boolean hasWhenUsed() { + return this.whenUsed != null && !this.whenUsed.isEmpty(); + } + + /** + * @param value {@link #whenUsed} (The time period over which the device was used.) + */ + public DeviceUseStatement setWhenUsed(Period value) { + this.whenUsed = value; + return this; + } + + /** + * @return {@link #device} (The details of the device used.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); // cc + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The details of the device used.) + */ + public DeviceUseStatement setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} 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 device used.) + */ + public Device getDeviceTarget() { + if (this.deviceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.device"); + else if (Configuration.doAutoCreate()) + this.deviceTarget = new Device(); // aa + return this.deviceTarget; + } + + /** + * @param value {@link #device} 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 device used.) + */ + public DeviceUseStatement setDeviceTarget(Device value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #identifier} (An external identifier for this statement such as an IRI.) + */ + 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} (An external identifier for this statement such as an IRI.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DeviceUseStatement addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #indication} (Reason or justification for the use of the device.) + */ + 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} (Reason or justification for the use of the device.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + // syntactic sugar + public DeviceUseStatement addIndication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return this; + } + + /** + * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StringType item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + // syntactic sugar + public StringType addNotesElement() {//2 + StringType t = new StringType(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public DeviceUseStatement addNotes(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public boolean hasNotes(String value) { + if (this.notes == null) + return false; + for (StringType v : this.notes) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DateTimeType getRecordedOnElement() { + if (this.recordedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.recordedOn"); + else if (Configuration.doAutoCreate()) + this.recordedOn = new DateTimeType(); // bb + return this.recordedOn; + } + + public boolean hasRecordedOnElement() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + public boolean hasRecordedOn() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + /** + * @param value {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DeviceUseStatement setRecordedOnElement(DateTimeType value) { + this.recordedOn = value; + return this; + } + + /** + * @return The time at which the statement was made/recorded. + */ + 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(Date value) { + if (value == null) + this.recordedOn = null; + else { + if (this.recordedOn == null) + this.recordedOn = new DateTimeType(); + this.recordedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who used the device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who used the device.) + */ + public DeviceUseStatement 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 used the device.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + 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 used the device.) + */ + public DeviceUseStatement setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Timing getTimingTiming() throws FHIRException { + if (!(this.timing instanceof Timing)) + throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + public boolean hasTimingTiming() { + return this.timing instanceof Timing; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Period getTimingPeriod() throws FHIRException { + if (!(this.timing instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + public boolean hasTimingPeriod() { + return this.timing instanceof Period; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public DateTimeType getTimingDateTimeType() throws FHIRException { + if (!(this.timing instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + public boolean hasTimingDateTimeType() { + return this.timing instanceof DateTimeType; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (How often the device was used.) + */ + public DeviceUseStatement setTiming(Type value) { + this.timing = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device was used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("whenUsed", "Period", "The time period over which the device was used.", 0, java.lang.Integer.MAX_VALUE, whenUsed)); + childrenList.add(new Property("device", "Reference(Device)", "The details of the device used.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of the device.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("notes", "string", "Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("recordedOn", "dateTime", "The time at which the statement was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who used the device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, java.lang.Integer.MAX_VALUE, timing)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Type + case 2042879511: /*whenUsed*/ return this.whenUsed == null ? new Base[0] : new Base[] {this.whenUsed}; // Period + case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // CodeableConcept + case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // StringType + case 735397551: /*recordedOn*/ return this.recordedOn == null ? new Base[0] : new Base[] {this.recordedOn}; // DateTimeType + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1702620169: // bodySite + this.bodySite = (Type) value; // Type + break; + case 2042879511: // whenUsed + this.whenUsed = castToPeriod(value); // Period + break; + case -1335157162: // device + this.device = castToReference(value); // Reference + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -597168804: // indication + this.getIndication().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 105008833: // notes + this.getNotes().add(castToString(value)); // StringType + break; + case 735397551: // recordedOn + this.recordedOn = castToDateTime(value); // DateTimeType + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -873664438: // timing + this.timing = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("bodySite[x]")) + this.bodySite = (Type) value; // Type + else if (name.equals("whenUsed")) + this.whenUsed = castToPeriod(value); // Period + else if (name.equals("device")) + this.device = castToReference(value); // Reference + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("indication")) + this.getIndication().add(castToCodeableConcept(value)); + else if (name.equals("notes")) + this.getNotes().add(castToString(value)); + else if (name.equals("recordedOn")) + this.recordedOn = castToDateTime(value); // DateTimeType + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("timing[x]")) + this.timing = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -806219817: return getBodySite(); // Type + case 2042879511: return getWhenUsed(); // Period + case -1335157162: return getDevice(); // Reference + case -1618432855: return addIdentifier(); // Identifier + case -597168804: return addIndication(); // CodeableConcept + case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType + case 735397551: throw new FHIRException("Cannot make property recordedOn as it is not a complex type"); // DateTimeType + case -1867885268: return getSubject(); // Reference + case 164632566: return getTiming(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("bodySiteCodeableConcept")) { + this.bodySite = new CodeableConcept(); + return this.bodySite; + } + else if (name.equals("bodySiteReference")) { + this.bodySite = new Reference(); + return this.bodySite; + } + else if (name.equals("whenUsed")) { + this.whenUsed = new Period(); + return this.whenUsed; + } + else if (name.equals("device")) { + this.device = new Reference(); + return this.device; + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("indication")) { + return addIndication(); + } + else if (name.equals("notes")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceUseStatement.notes"); + } + else if (name.equals("recordedOn")) { + throw new FHIRException("Cannot call addChild on a primitive type DeviceUseStatement.recordedOn"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("timingTiming")) { + this.timing = new Timing(); + return this.timing; + } + else if (name.equals("timingPeriod")) { + this.timing = new Period(); + return this.timing; + } + else if (name.equals("timingDateTime")) { + this.timing = new DateTimeType(); + return this.timing; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DeviceUseStatement"; + + } + + public DeviceUseStatement copy() { + DeviceUseStatement dst = new DeviceUseStatement(); + copyValues(dst); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.whenUsed = whenUsed == null ? null : whenUsed.copy(); + dst.device = device == null ? null : device.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + if (notes != null) { + dst.notes = new ArrayList(); + for (StringType i : notes) + dst.notes.add(i.copy()); + }; + dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.timing = timing == null ? null : timing.copy(); + return dst; + } + + protected DeviceUseStatement typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DeviceUseStatement)) + return false; + DeviceUseStatement o = (DeviceUseStatement) other; + return compareDeep(bodySite, o.bodySite, true) && compareDeep(whenUsed, o.whenUsed, true) && compareDeep(device, o.device, true) + && compareDeep(identifier, o.identifier, true) && compareDeep(indication, o.indication, true) && compareDeep(notes, o.notes, true) + && compareDeep(recordedOn, o.recordedOn, true) && compareDeep(subject, o.subject, true) && compareDeep(timing, o.timing, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DeviceUseStatement)) + return false; + DeviceUseStatement o = (DeviceUseStatement) other; + return compareValues(notes, o.notes, true) && compareValues(recordedOn, o.recordedOn, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (whenUsed == null || whenUsed.isEmpty()) + && (device == null || device.isEmpty()) && (identifier == null || identifier.isEmpty()) && (indication == null || indication.isEmpty()) + && (notes == null || notes.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) && (subject == null || subject.isEmpty()) + && (timing == null || timing.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceUseStatement; + } + + /** + * Search parameter: patient + *

+ * Description: Search by subject - a patient
+ * Type: reference
+ * Path: DeviceUseStatement.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="DeviceUseStatement.subject", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Search by subject - a patient
+ * Type: reference
+ * Path: DeviceUseStatement.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceUseStatement:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:patient").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: Search by subject
+ * Type: reference
+ * Path: DeviceUseStatement.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="DeviceUseStatement.subject", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Search by subject
+ * Type: reference
+ * Path: DeviceUseStatement.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceUseStatement:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:subject").toLocked(); + + /** + * Search parameter: device + *

+ * Description: Search by device
+ * Type: reference
+ * Path: DeviceUseStatement.device
+ *

+ */ + @SearchParamDefinition(name="device", path="DeviceUseStatement.device", description="Search by device", type="reference" ) + public static final String SP_DEVICE = "device"; + /** + * Fluent Client search parameter constant for device + *

+ * Description: Search by device
+ * Type: reference
+ * Path: DeviceUseStatement.device
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DeviceUseStatement:device". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:device").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DiagnosticOrder.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DiagnosticOrder.java new file mode 100644 index 00000000000..33372a38a05 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DiagnosticOrder.java @@ -0,0 +1,2497 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A record of a request for a diagnostic investigation service to be performed. + */ +@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/Profile/DiagnosticOrder") +public class DiagnosticOrder extends DomainResource { + + public enum DiagnosticOrderStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request is in preliminary form prior to being sent. + */ + DRAFT, + /** + * The request has been planned. + */ + PLANNED, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the order, but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the order, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work is complete, and the outcomes are being reviewed for approval. + */ + REVIEW, + /** + * The work has been completed, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been withdrawn. + */ + CANCELLED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed. + */ + FAILED, + /** + * The request was entered in error and voided. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static DiagnosticOrderStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("draft".equals(codeString)) + return DRAFT; + if ("planned".equals(codeString)) + return PLANNED; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("review".equals(codeString)) + return REVIEW; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("failed".equals(codeString)) + return FAILED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case DRAFT: return "draft"; + case PLANNED: return "planned"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in-progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return "http://hl7.org/fhir/diagnostic-order-status"; + case DRAFT: return "http://hl7.org/fhir/diagnostic-order-status"; + case PLANNED: return "http://hl7.org/fhir/diagnostic-order-status"; + case REQUESTED: return "http://hl7.org/fhir/diagnostic-order-status"; + case RECEIVED: return "http://hl7.org/fhir/diagnostic-order-status"; + case ACCEPTED: return "http://hl7.org/fhir/diagnostic-order-status"; + case INPROGRESS: return "http://hl7.org/fhir/diagnostic-order-status"; + case REVIEW: return "http://hl7.org/fhir/diagnostic-order-status"; + case COMPLETED: return "http://hl7.org/fhir/diagnostic-order-status"; + case CANCELLED: return "http://hl7.org/fhir/diagnostic-order-status"; + case SUSPENDED: return "http://hl7.org/fhir/diagnostic-order-status"; + case REJECTED: return "http://hl7.org/fhir/diagnostic-order-status"; + case FAILED: return "http://hl7.org/fhir/diagnostic-order-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/diagnostic-order-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case DRAFT: return "The request is in preliminary form prior to being sent."; + case PLANNED: return "The request has been planned."; + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the order, but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; + case COMPLETED: return "The work has been completed, the report(s) released, and no further work is planned."; + case CANCELLED: return "The request has been withdrawn."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed."; + case ENTEREDINERROR: return "The request was entered in error and voided."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case DRAFT: return "Draft"; + case PLANNED: return "Planned"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + case INPROGRESS: return "In-Progress"; + case REVIEW: return "Review"; + case COMPLETED: return "Completed"; + case CANCELLED: return "Cancelled"; + case SUSPENDED: return "Suspended"; + case REJECTED: return "Rejected"; + case FAILED: return "Failed"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + 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; + if ("proposed".equals(codeString)) + return DiagnosticOrderStatus.PROPOSED; + if ("draft".equals(codeString)) + return DiagnosticOrderStatus.DRAFT; + if ("planned".equals(codeString)) + return DiagnosticOrderStatus.PLANNED; + if ("requested".equals(codeString)) + return DiagnosticOrderStatus.REQUESTED; + if ("received".equals(codeString)) + return DiagnosticOrderStatus.RECEIVED; + if ("accepted".equals(codeString)) + return DiagnosticOrderStatus.ACCEPTED; + if ("in-progress".equals(codeString)) + return DiagnosticOrderStatus.INPROGRESS; + if ("review".equals(codeString)) + return DiagnosticOrderStatus.REVIEW; + if ("completed".equals(codeString)) + return DiagnosticOrderStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return DiagnosticOrderStatus.CANCELLED; + if ("suspended".equals(codeString)) + return DiagnosticOrderStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return DiagnosticOrderStatus.REJECTED; + if ("failed".equals(codeString)) + return DiagnosticOrderStatus.FAILED; + if ("entered-in-error".equals(codeString)) + return DiagnosticOrderStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.PROPOSED); + if ("draft".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.DRAFT); + if ("planned".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.PLANNED); + if ("requested".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.REQUESTED); + if ("received".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.RECEIVED); + if ("accepted".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.ACCEPTED); + if ("in-progress".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.INPROGRESS); + if ("review".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.REVIEW); + if ("completed".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.COMPLETED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.CANCELLED); + if ("suspended".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.SUSPENDED); + if ("rejected".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.REJECTED); + if ("failed".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.FAILED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, DiagnosticOrderStatus.ENTEREDINERROR); + throw new FHIRException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); + } + public String toCode(DiagnosticOrderStatus code) { + if (code == DiagnosticOrderStatus.PROPOSED) + return "proposed"; + if (code == DiagnosticOrderStatus.DRAFT) + return "draft"; + if (code == DiagnosticOrderStatus.PLANNED) + return "planned"; + if (code == DiagnosticOrderStatus.REQUESTED) + return "requested"; + if (code == DiagnosticOrderStatus.RECEIVED) + return "received"; + if (code == DiagnosticOrderStatus.ACCEPTED) + return "accepted"; + if (code == DiagnosticOrderStatus.INPROGRESS) + return "in-progress"; + if (code == DiagnosticOrderStatus.REVIEW) + return "review"; + if (code == DiagnosticOrderStatus.COMPLETED) + return "completed"; + if (code == DiagnosticOrderStatus.CANCELLED) + return "cancelled"; + if (code == DiagnosticOrderStatus.SUSPENDED) + return "suspended"; + if (code == DiagnosticOrderStatus.REJECTED) + return "rejected"; + if (code == DiagnosticOrderStatus.FAILED) + return "failed"; + if (code == DiagnosticOrderStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(DiagnosticOrderStatus code) { + return code.getSystem(); + } + } + + public enum DiagnosticOrderPriority { + /** + * The order has a normal priority . + */ + ROUTINE, + /** + * The order should be urgently. + */ + URGENT, + /** + * The order is time-critical. + */ + STAT, + /** + * The order should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + public static DiagnosticOrderPriority fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new FHIRException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return "http://hl7.org/fhir/diagnostic-order-priority"; + case URGENT: return "http://hl7.org/fhir/diagnostic-order-priority"; + case STAT: return "http://hl7.org/fhir/diagnostic-order-priority"; + case ASAP: return "http://hl7.org/fhir/diagnostic-order-priority"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The order has a normal priority ."; + case URGENT: return "The order should be urgently."; + case STAT: return "The order is time-critical."; + case ASAP: return "The order should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "ASAP"; + default: return "?"; + } + } + } + + 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; + if ("routine".equals(codeString)) + return DiagnosticOrderPriority.ROUTINE; + if ("urgent".equals(codeString)) + return DiagnosticOrderPriority.URGENT; + if ("stat".equals(codeString)) + return DiagnosticOrderPriority.STAT; + if ("asap".equals(codeString)) + return DiagnosticOrderPriority.ASAP; + throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return new Enumeration(this, DiagnosticOrderPriority.ROUTINE); + if ("urgent".equals(codeString)) + return new Enumeration(this, DiagnosticOrderPriority.URGENT); + if ("stat".equals(codeString)) + return new Enumeration(this, DiagnosticOrderPriority.STAT); + if ("asap".equals(codeString)) + return new Enumeration(this, DiagnosticOrderPriority.ASAP); + throw new FHIRException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + } + public String toCode(DiagnosticOrderPriority code) { + if (code == DiagnosticOrderPriority.ROUTINE) + return "routine"; + if (code == DiagnosticOrderPriority.URGENT) + return "urgent"; + if (code == DiagnosticOrderPriority.STAT) + return "stat"; + if (code == DiagnosticOrderPriority.ASAP) + return "asap"; + return "?"; + } + public String toSystem(DiagnosticOrderPriority code) { + return code.getSystem(); + } + } + + @Block() + public static class DiagnosticOrderEventComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The status for the event. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", formalDefinition="The status for the event." ) + protected Enumeration status; + + /** + * Additional information about the event that occurred - e.g. if the status remained unchanged. + */ + @Child(name = "description", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="More information about the event and its context", formalDefinition="Additional information about the event that occurred - e.g. if the status remained unchanged." ) + protected CodeableConcept description; + + /** + * The date/time at which the event occurred. + */ + @Child(name = "dateTime", type = {DateTimeType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The date at which the event happened", formalDefinition="The date/time at which the event occurred." ) + protected DateTimeType dateTime; + + /** + * The person responsible for performing or recording the action. + */ + @Child(name = "actor", type = {Practitioner.class, Device.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who recorded or did this", formalDefinition="The person responsible for performing or recording the action." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The person responsible for performing or recording the action.) + */ + protected Resource actorTarget; + + private static final long serialVersionUID = -370793723L; + + /** + * Constructor + */ + public DiagnosticOrderEventComponent() { + super(); + } + + /** + * Constructor + */ + public DiagnosticOrderEventComponent(Enumeration status, DateTimeType dateTime) { + super(); + this.status = status; + this.dateTime = dateTime; + } + + /** + * @return {@link #status} (The status for the event.). 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 DiagnosticOrderEventComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb + 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 for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrderEventComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status for the event. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status for the event. + */ + public DiagnosticOrderEventComponent setStatus(DiagnosticOrderStatus value) { + if (this.status == null) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) + */ + public CodeableConcept getDescription() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new CodeableConcept(); // cc + return this.description; + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) + */ + public DiagnosticOrderEventComponent setDescription(CodeableConcept value) { + this.description = value; + return this; + } + + /** + * @return {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); // bb + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DiagnosticOrderEventComponent setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date/time at which the event occurred. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The date/time at which the event occurred. + */ + public DiagnosticOrderEventComponent setDateTime(Date value) { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + return this; + } + + /** + * @return {@link #actor} (The person responsible for performing or recording the action.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The person responsible for performing or recording the action.) + */ + public DiagnosticOrderEventComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 responsible for performing or recording the action.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 responsible for performing or recording the action.) + */ + public DiagnosticOrderEventComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "The status for the event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("description", "CodeableConcept", "Additional information about the event that occurred - e.g. if the status remained unchanged.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("dateTime", "dateTime", "The date/time at which the event occurred.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("actor", "Reference(Practitioner|Device)", "The person responsible for performing or recording the action.", 0, java.lang.Integer.MAX_VALUE, actor)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // CodeableConcept + case 1792749467: /*dateTime*/ return this.dateTime == null ? new Base[0] : new Base[] {this.dateTime}; // DateTimeType + case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -892481550: // status + this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration + break; + case -1724546052: // description + this.description = castToCodeableConcept(value); // CodeableConcept + break; + case 1792749467: // dateTime + this.dateTime = castToDateTime(value); // DateTimeType + break; + case 92645877: // actor + this.actor = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("status")) + this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("description")) + this.description = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("dateTime")) + this.dateTime = castToDateTime(value); // DateTimeType + else if (name.equals("actor")) + this.actor = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -1724546052: return getDescription(); // CodeableConcept + case 1792749467: throw new FHIRException("Cannot make property dateTime as it is not a complex type"); // DateTimeType + case 92645877: return getActor(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.status"); + } + else if (name.equals("description")) { + this.description = new CodeableConcept(); + return this.description; + } + else if (name.equals("dateTime")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.dateTime"); + } + else if (name.equals("actor")) { + this.actor = new Reference(); + return this.actor; + } + else + return super.addChild(name); + } + + public DiagnosticOrderEventComponent copy() { + DiagnosticOrderEventComponent dst = new DiagnosticOrderEventComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.description = description == null ? null : description.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + dst.actor = actor == null ? null : actor.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticOrderEventComponent)) + return false; + DiagnosticOrderEventComponent o = (DiagnosticOrderEventComponent) other; + return compareDeep(status, o.status, true) && compareDeep(description, o.description, true) && compareDeep(dateTime, o.dateTime, true) + && compareDeep(actor, o.actor, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticOrderEventComponent)) + return false; + DiagnosticOrderEventComponent o = (DiagnosticOrderEventComponent) other; + return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) + && (dateTime == null || dateTime.isEmpty()) && (actor == null || actor.isEmpty()); + } + + public String fhirType() { + return "DiagnosticOrder.event"; + + } + + } + + @Block() + public static class DiagnosticOrderItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Code to indicate the item (test or panel) being ordered", formalDefinition="A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested." ) + protected CodeableConcept code; + + /** + * If the item is related to a specific specimen. + */ + @Child(name = "specimen", type = {Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="If this item relates to specific specimens", formalDefinition="If the item is related to a specific specimen." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (If the item is related to a specific specimen.) + */ + protected List specimenTarget; + + + /** + * Anatomical location where the request test should be performed. This is the target site. + */ + @Child(name = "bodySite", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Location of requested test (if applicable)", formalDefinition="Anatomical location where the request test should be performed. This is the target site." ) + protected CodeableConcept bodySite; + + /** + * The status of this individual item within the order. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", formalDefinition="The status of this individual item within the order." ) + protected Enumeration status; + + /** + * A summary of the events of interest that have occurred as this item of the request is processed. + */ + @Child(name = "event", type = {DiagnosticOrderEventComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Events specific to this item", formalDefinition="A summary of the events of interest that have occurred as this item of the request is processed." ) + protected List event; + + private static final long serialVersionUID = 381238192L; + + /** + * Constructor + */ + public DiagnosticOrderItemComponent() { + super(); + } + + /** + * Constructor + */ + public DiagnosticOrderItemComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) + */ + public DiagnosticOrderItemComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #specimen} (If the item is related to a specific specimen.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (If the item is related to a specific specimen.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrderItemComponent addSpecimen(Reference t) { //3 + if (t == null) + return this; + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return this; + } + + /** + * @return {@link #specimen} (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. If the item is related to a specific specimen.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (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. If the item is related to a specific specimen.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) + */ + public CodeableConcept getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new CodeableConcept(); // cc + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) + */ + public DiagnosticOrderItemComponent setBodySite(CodeableConcept value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #status} (The status of this individual item within the order.). 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 DiagnosticOrderItemComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb + 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 this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrderItemComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this individual item within the order. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this individual item within the order. + */ + public DiagnosticOrderItemComponent setStatus(DiagnosticOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (DiagnosticOrderEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) + */ + // syntactic sugar + public DiagnosticOrderEventComponent addEvent() { //3 + DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrderItemComponent addEvent(DiagnosticOrderEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "If the item is related to a specific specimen.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Anatomical location where the request test should be performed. This is the target site.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("status", "code", "The status of this individual item within the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("event", "@DiagnosticOrder.event", "A summary of the events of interest that have occurred as this item of the request is processed.", 0, java.lang.Integer.MAX_VALUE, event)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // DiagnosticOrderEventComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -2132868344: // specimen + this.getSpecimen().add(castToReference(value)); // Reference + break; + case 1702620169: // bodySite + this.bodySite = castToCodeableConcept(value); // CodeableConcept + break; + case -892481550: // status + this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration + break; + case 96891546: // event + this.getEvent().add((DiagnosticOrderEventComponent) value); // DiagnosticOrderEventComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("specimen")) + this.getSpecimen().add(castToReference(value)); + else if (name.equals("bodySite")) + this.bodySite = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("status")) + this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("event")) + this.getEvent().add((DiagnosticOrderEventComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case -2132868344: return addSpecimen(); // Reference + case 1702620169: return getBodySite(); // CodeableConcept + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 96891546: return addEvent(); // DiagnosticOrderEventComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("specimen")) { + return addSpecimen(); + } + else if (name.equals("bodySite")) { + this.bodySite = new CodeableConcept(); + return this.bodySite; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.status"); + } + else if (name.equals("event")) { + return addEvent(); + } + else + return super.addChild(name); + } + + public DiagnosticOrderItemComponent copy() { + DiagnosticOrderItemComponent dst = new DiagnosticOrderItemComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.status = status == null ? null : status.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (DiagnosticOrderEventComponent i : event) + dst.event.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticOrderItemComponent)) + return false; + DiagnosticOrderItemComponent o = (DiagnosticOrderItemComponent) other; + return compareDeep(code, o.code, true) && compareDeep(specimen, o.specimen, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(status, o.status, true) && compareDeep(event, o.event, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticOrderItemComponent)) + return false; + DiagnosticOrderItemComponent o = (DiagnosticOrderItemComponent) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (specimen == null || specimen.isEmpty()) + && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) && (event == null || event.isEmpty()) + ; + } + + public String fhirType() { + return "DiagnosticOrder.item"; + + } + + } + + /** + * Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller." ) + protected List identifier; + + /** + * The status of the order. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", formalDefinition="The status of the order." ) + protected Enumeration status; + + /** + * The clinical priority associated with this order. + */ + @Child(name = "priority", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) + protected Enumeration priority; + + /** + * On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). + */ + @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who and/or what test is about", formalDefinition="On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + protected Resource subjectTarget; + + /** + * An encounter that provides additional information about the healthcare context in which this request is made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The encounter that this diagnostic order is associated with", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * The practitioner that holds legal responsibility for ordering the investigation. + */ + @Child(name = "orderer", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who ordered the test", formalDefinition="The practitioner that holds legal responsibility for ordering the investigation." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the investigation.) + */ + protected Practitioner ordererTarget; + + /** + * An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Explanation/Justification for test", formalDefinition="An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation." ) + protected List reason; + + /** + * Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order. + */ + @Child(name = "supportingInformation", type = {Observation.class, Condition.class, DocumentReference.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional clinical information", formalDefinition="Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order." ) + protected List supportingInformation; + /** + * The actual objects that are the target of the reference (Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.) + */ + protected List supportingInformationTarget; + + + /** + * One or more specimens that the diagnostic investigation is about. + */ + @Child(name = "specimen", type = {Specimen.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="If the whole order relates to specific specimens", formalDefinition="One or more specimens that the diagnostic investigation is about." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (One or more specimens that the diagnostic investigation is about.) + */ + protected List specimenTarget; + + + /** + * A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed. + */ + @Child(name = "event", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A list of events of interest in the lifecycle", formalDefinition="A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed." ) + protected List event; + + /** + * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested. + */ + @Child(name = "item", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The items the orderer requested", formalDefinition="The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested." ) + protected List item; + + /** + * Any other notes associated with this patient, specimen or order (e.g. "patient hates needles"). + */ + @Child(name = "note", type = {Annotation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Other notes and comments", formalDefinition="Any other notes associated with this patient, specimen or order (e.g. \"patient hates needles\")." ) + protected List note; + + private static final long serialVersionUID = 1170289657L; + + /** + * Constructor + */ + public DiagnosticOrder() { + super(); + } + + /** + * Constructor + */ + public DiagnosticOrder(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.) + */ + 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 assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (The status of the order.). 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 DiagnosticOrder.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb + 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 order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrder setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the order. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the order. + */ + public DiagnosticOrder setStatus(DiagnosticOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new DiagnosticOrderPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public DiagnosticOrder setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return The clinical priority associated with this order. + */ + public DiagnosticOrderPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value The clinical priority associated with this order. + */ + public DiagnosticOrder setPriority(DiagnosticOrderPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new DiagnosticOrderPriorityEnumFactory()); + this.priority.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public DiagnosticOrder 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. (On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public Resource getSubjectTarget() { + 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. (On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public DiagnosticOrder setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public DiagnosticOrder 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. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public DiagnosticOrder setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); // cc + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) + */ + public DiagnosticOrder setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} 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 that holds legal responsibility for ordering the investigation.) + */ + public Practitioner getOrdererTarget() { + if (this.ordererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.ordererTarget = new Practitioner(); // aa + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} 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 that holds legal responsibility for ordering the investigation.) + */ + public DiagnosticOrder setOrdererTarget(Practitioner value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #reason} (An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.) + */ + public List getSupportingInformation() { + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + return this.supportingInformation; + } + + public boolean hasSupportingInformation() { + if (this.supportingInformation == null) + return false; + for (Reference item : this.supportingInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.) + */ + // syntactic sugar + public Reference addSupportingInformation() { //3 + Reference t = new Reference(); + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addSupportingInformation(Reference t) { //3 + if (t == null) + return this; + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return this; + } + + /** + * @return {@link #supportingInformation} (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. Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.) + */ + public List getSupportingInformationTarget() { + if (this.supportingInformationTarget == null) + this.supportingInformationTarget = new ArrayList(); + return this.supportingInformationTarget; + } + + /** + * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addSpecimen(Reference t) { //3 + if (t == null) + return this; + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return this; + } + + /** + * @return {@link #specimen} (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. One or more specimens that the diagnostic investigation is about.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (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. One or more specimens that the diagnostic investigation is about.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (DiagnosticOrderEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed.) + */ + // syntactic sugar + public DiagnosticOrderEventComponent addEvent() { //3 + DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addEvent(DiagnosticOrderEventComponent t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + /** + * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (DiagnosticOrderItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) + */ + // syntactic sugar + public DiagnosticOrderItemComponent addItem() { //3 + DiagnosticOrderItemComponent t = new DiagnosticOrderItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addItem(DiagnosticOrderItemComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #note} (Any other notes associated with this patient, specimen or order (e.g. "patient hates needles").) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Any other notes associated with this patient, specimen or order (e.g. "patient hates needles").) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public DiagnosticOrder addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the investigation.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("reason", "CodeableConcept", "An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("supportingInformation", "Reference(Observation|Condition|DocumentReference)", "Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "One or more specimens that the diagnostic investigation is about.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("event", "", "A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("item", "", "The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("note", "Annotation", "Any other notes associated with this patient, specimen or order (e.g. \"patient hates needles\").", 0, java.lang.Integer.MAX_VALUE, note)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -1207109509: /*orderer*/ return this.orderer == null ? new Base[0] : new Base[] {this.orderer}; // Reference + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept + case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference + case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference + case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // DiagnosticOrderEventComponent + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // DiagnosticOrderItemComponent + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration + break; + case -1165461084: // priority + this.priority = new DiagnosticOrderPriorityEnumFactory().fromType(value); // Enumeration + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -1207109509: // orderer + this.orderer = castToReference(value); // Reference + break; + case -934964668: // reason + this.getReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1248768647: // supportingInformation + this.getSupportingInformation().add(castToReference(value)); // Reference + break; + case -2132868344: // specimen + this.getSpecimen().add(castToReference(value)); // Reference + break; + case 96891546: // event + this.getEvent().add((DiagnosticOrderEventComponent) value); // DiagnosticOrderEventComponent + break; + case 3242771: // item + this.getItem().add((DiagnosticOrderItemComponent) value); // DiagnosticOrderItemComponent + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("priority")) + this.priority = new DiagnosticOrderPriorityEnumFactory().fromType(value); // Enumeration + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("orderer")) + this.orderer = castToReference(value); // Reference + else if (name.equals("reason")) + this.getReason().add(castToCodeableConcept(value)); + else if (name.equals("supportingInformation")) + this.getSupportingInformation().add(castToReference(value)); + else if (name.equals("specimen")) + this.getSpecimen().add(castToReference(value)); + else if (name.equals("event")) + this.getEvent().add((DiagnosticOrderEventComponent) value); + else if (name.equals("item")) + this.getItem().add((DiagnosticOrderItemComponent) value); + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration + case -1867885268: return getSubject(); // Reference + case 1524132147: return getEncounter(); // Reference + case -1207109509: return getOrderer(); // Reference + case -934964668: return addReason(); // CodeableConcept + case -1248768647: return addSupportingInformation(); // Reference + case -2132868344: return addSpecimen(); // Reference + case 96891546: return addEvent(); // DiagnosticOrderEventComponent + case 3242771: return addItem(); // DiagnosticOrderItemComponent + case 3387378: return addNote(); // Annotation + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.status"); + } + else if (name.equals("priority")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.priority"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("orderer")) { + this.orderer = new Reference(); + return this.orderer; + } + else if (name.equals("reason")) { + return addReason(); + } + else if (name.equals("supportingInformation")) { + return addSupportingInformation(); + } + else if (name.equals("specimen")) { + return addSpecimen(); + } + else if (name.equals("event")) { + return addEvent(); + } + else if (name.equals("item")) { + return addItem(); + } + else if (name.equals("note")) { + return addNote(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DiagnosticOrder"; + + } + + public DiagnosticOrder copy() { + DiagnosticOrder dst = new DiagnosticOrder(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (supportingInformation != null) { + dst.supportingInformation = new ArrayList(); + for (Reference i : supportingInformation) + dst.supportingInformation.add(i.copy()); + }; + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + if (event != null) { + dst.event = new ArrayList(); + for (DiagnosticOrderEventComponent i : event) + dst.event.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (DiagnosticOrderItemComponent i : item) + dst.item.add(i.copy()); + }; + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + return dst; + } + + protected DiagnosticOrder typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticOrder)) + return false; + DiagnosticOrder o = (DiagnosticOrder) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(priority, o.priority, true) + && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) && compareDeep(orderer, o.orderer, true) + && compareDeep(reason, o.reason, true) && compareDeep(supportingInformation, o.supportingInformation, true) + && compareDeep(specimen, o.specimen, true) && compareDeep(event, o.event, true) && compareDeep(item, o.item, true) + && compareDeep(note, o.note, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticOrder)) + return false; + DiagnosticOrder o = (DiagnosticOrder) other; + return compareValues(status, o.status, true) && compareValues(priority, o.priority, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (priority == null || priority.isEmpty()) && (subject == null || subject.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (orderer == null || orderer.isEmpty()) && (reason == null || reason.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) + && (specimen == null || specimen.isEmpty()) && (event == null || event.isEmpty()) && (item == null || item.isEmpty()) + && (note == null || note.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DiagnosticOrder; + } + + /** + * Search parameter: orderer + *

+ * Description: Who ordered the test
+ * Type: reference
+ * Path: DiagnosticOrder.orderer
+ *

+ */ + @SearchParamDefinition(name="orderer", path="DiagnosticOrder.orderer", description="Who ordered the test", type="reference" ) + public static final String SP_ORDERER = "orderer"; + /** + * Fluent Client search parameter constant for orderer + *

+ * Description: Who ordered the test
+ * Type: reference
+ * Path: DiagnosticOrder.orderer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORDERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORDERER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticOrder:orderer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORDERER = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:orderer").toLocked(); + + /** + * Search parameter: status + *

+ * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
+ * Type: token
+ * Path: DiagnosticOrder.status
+ *

+ */ + @SearchParamDefinition(name="status", path="DiagnosticOrder.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
+ * Type: token
+ * Path: DiagnosticOrder.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: Who and/or what test is about
+ * Type: reference
+ * Path: DiagnosticOrder.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Who and/or what test is about
+ * Type: reference
+ * Path: DiagnosticOrder.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticOrder:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:subject").toLocked(); + + /** + * Search parameter: item-status + *

+ * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
+ * Type: token
+ * Path: DiagnosticOrder.item.status
+ *

+ */ + @SearchParamDefinition(name="item-status", path="DiagnosticOrder.item.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", type="token" ) + public static final String SP_ITEM_STATUS = "item-status"; + /** + * Fluent Client search parameter constant for item-status + *

+ * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
+ * Type: token
+ * Path: DiagnosticOrder.item.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ITEM_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ITEM_STATUS); + + /** + * Search parameter: event-status + *

+ * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
+ * Type: token
+ * Path: DiagnosticOrder.event.status
+ *

+ */ + @SearchParamDefinition(name="event-status", path="DiagnosticOrder.event.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", type="token" ) + public static final String SP_EVENT_STATUS = "event-status"; + /** + * Fluent Client search parameter constant for event-status + *

+ * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
+ * Type: token
+ * Path: DiagnosticOrder.event.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT_STATUS); + + /** + * Search parameter: actor + *

+ * Description: Who recorded or did this
+ * Type: reference
+ * Path: DiagnosticOrder.event.actor, DiagnosticOrder.item.event.actor
+ *

+ */ + @SearchParamDefinition(name="actor", path="DiagnosticOrder.event.actor | DiagnosticOrder.item.event.actor", description="Who recorded or did this", type="reference" ) + public static final String SP_ACTOR = "actor"; + /** + * Fluent Client search parameter constant for actor + *

+ * Description: Who recorded or did this
+ * Type: reference
+ * Path: DiagnosticOrder.event.actor, DiagnosticOrder.item.event.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticOrder:actor". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:actor").toLocked(); + + /** + * Search parameter: code + *

+ * Description: Code to indicate the item (test or panel) being ordered
+ * Type: token
+ * Path: DiagnosticOrder.item.code
+ *

+ */ + @SearchParamDefinition(name="code", path="DiagnosticOrder.item.code", description="Code to indicate the item (test or panel) being ordered", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Code to indicate the item (test or panel) being ordered
+ * Type: token
+ * Path: DiagnosticOrder.item.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: encounter + *

+ * Description: The encounter that this diagnostic order is associated with
+ * Type: reference
+ * Path: DiagnosticOrder.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="DiagnosticOrder.encounter", description="The encounter that this diagnostic order is associated with", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: The encounter that this diagnostic order is associated with
+ * Type: reference
+ * Path: DiagnosticOrder.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticOrder:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:encounter").toLocked(); + + /** + * Search parameter: item-past-status + *

+ * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
+ * Type: token
+ * Path: DiagnosticOrder.item.event.status
+ *

+ */ + @SearchParamDefinition(name="item-past-status", path="DiagnosticOrder.item.event.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", type="token" ) + public static final String SP_ITEM_PAST_STATUS = "item-past-status"; + /** + * Fluent Client search parameter constant for item-past-status + *

+ * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
+ * Type: token
+ * Path: DiagnosticOrder.item.event.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ITEM_PAST_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ITEM_PAST_STATUS); + + /** + * Search parameter: patient + *

+ * Description: Who and/or what test is about
+ * Type: reference
+ * Path: DiagnosticOrder.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who and/or what test is about
+ * Type: reference
+ * Path: DiagnosticOrder.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticOrder:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:patient").toLocked(); + + /** + * Search parameter: bodysite + *

+ * Description: Location of requested test (if applicable)
+ * Type: token
+ * Path: DiagnosticOrder.item.bodySite
+ *

+ */ + @SearchParamDefinition(name="bodysite", path="DiagnosticOrder.item.bodySite", description="Location of requested test (if applicable)", type="token" ) + public static final String SP_BODYSITE = "bodysite"; + /** + * Fluent Client search parameter constant for bodysite + *

+ * Description: Location of requested test (if applicable)
+ * Type: token
+ * Path: DiagnosticOrder.item.bodySite
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODYSITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODYSITE); + + /** + * Search parameter: item-date + *

+ * Description: The date at which the event happened
+ * Type: date
+ * Path: DiagnosticOrder.item.event.dateTime
+ *

+ */ + @SearchParamDefinition(name="item-date", path="DiagnosticOrder.item.event.dateTime", description="The date at which the event happened", type="date" ) + public static final String SP_ITEM_DATE = "item-date"; + /** + * Fluent Client search parameter constant for item-date + *

+ * Description: The date at which the event happened
+ * Type: date
+ * Path: DiagnosticOrder.item.event.dateTime
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam ITEM_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ITEM_DATE); + + /** + * Search parameter: specimen + *

+ * Description: If the whole order relates to specific specimens
+ * Type: reference
+ * Path: DiagnosticOrder.specimen, DiagnosticOrder.item.specimen
+ *

+ */ + @SearchParamDefinition(name="specimen", path="DiagnosticOrder.specimen | DiagnosticOrder.item.specimen", description="If the whole order relates to specific specimens", type="reference" ) + public static final String SP_SPECIMEN = "specimen"; + /** + * Fluent Client search parameter constant for specimen + *

+ * Description: If the whole order relates to specific specimens
+ * Type: reference
+ * Path: DiagnosticOrder.specimen, DiagnosticOrder.item.specimen
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticOrder:specimen". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:specimen").toLocked(); + + /** + * Search parameter: event-status-date + *

+ * Description: A combination of past-status and date
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="event-status-date", path="", description="A combination of past-status and date", type="composite", compositeOf={"event-status", "event-date"} ) + public static final String SP_EVENT_STATUS_DATE = "event-status-date"; + /** + * Fluent Client search parameter constant for event-status-date + *

+ * Description: A combination of past-status and date
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam EVENT_STATUS_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_EVENT_STATUS_DATE); + + /** + * Search parameter: event-date + *

+ * Description: The date at which the event happened
+ * Type: date
+ * Path: DiagnosticOrder.event.dateTime
+ *

+ */ + @SearchParamDefinition(name="event-date", path="DiagnosticOrder.event.dateTime", description="The date at which the event happened", type="date" ) + public static final String SP_EVENT_DATE = "event-date"; + /** + * Fluent Client search parameter constant for event-date + *

+ * Description: The date at which the event happened
+ * Type: date
+ * Path: DiagnosticOrder.event.dateTime
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam EVENT_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EVENT_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Identifiers assigned to this order
+ * Type: token
+ * Path: DiagnosticOrder.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DiagnosticOrder.identifier", description="Identifiers assigned to this order", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Identifiers assigned to this order
+ * Type: token
+ * Path: DiagnosticOrder.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: item-status-date + *

+ * Description: A combination of item-past-status and item-date
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="item-status-date", path="", description="A combination of item-past-status and item-date", type="composite", compositeOf={"item-past-status", "item-date"} ) + public static final String SP_ITEM_STATUS_DATE = "item-status-date"; + /** + * Fluent Client search parameter constant for item-status-date + *

+ * Description: A combination of item-past-status and item-date
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam ITEM_STATUS_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_ITEM_STATUS_DATE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DiagnosticReport.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DiagnosticReport.java new file mode 100644 index 00000000000..a7c162756e2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DiagnosticReport.java @@ -0,0 +1,2056 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. + */ +@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport") +public class DiagnosticReport extends DomainResource { + + public enum DiagnosticReportStatus { + /** + * The existence of the report is registered, but there is nothing yet available. + */ + REGISTERED, + /** + * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified. + */ + PARTIAL, + /** + * The report is complete and verified by an authorized person. + */ + FINAL, + /** + * The report has been modified subsequent to being Final, and is complete and verified by an authorized person + */ + CORRECTED, + /** + * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed. + */ + APPENDED, + /** + * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). + */ + CANCELLED, + /** + * The report has been withdrawn following a previous final release. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static DiagnosticReportStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return REGISTERED; + if ("partial".equals(codeString)) + return PARTIAL; + if ("final".equals(codeString)) + return FINAL; + if ("corrected".equals(codeString)) + return CORRECTED; + if ("appended".equals(codeString)) + return APPENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REGISTERED: return "registered"; + case PARTIAL: return "partial"; + case FINAL: return "final"; + case CORRECTED: return "corrected"; + case APPENDED: return "appended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REGISTERED: return "http://hl7.org/fhir/diagnostic-report-status"; + case PARTIAL: return "http://hl7.org/fhir/diagnostic-report-status"; + case FINAL: return "http://hl7.org/fhir/diagnostic-report-status"; + case CORRECTED: return "http://hl7.org/fhir/diagnostic-report-status"; + case APPENDED: return "http://hl7.org/fhir/diagnostic-report-status"; + case CANCELLED: return "http://hl7.org/fhir/diagnostic-report-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/diagnostic-report-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REGISTERED: return "The existence of the report is registered, but there is nothing yet available."; + case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified."; + case FINAL: return "The report is complete and verified by an authorized person."; + case CORRECTED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person"; + case APPENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed."; + case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\")."; + case ENTEREDINERROR: return "The report has been withdrawn following a previous final release."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REGISTERED: return "Registered"; + case PARTIAL: return "Partial"; + case FINAL: return "Final"; + case CORRECTED: return "Corrected"; + case APPENDED: return "Appended"; + case CANCELLED: return "Cancelled"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + 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; + if ("registered".equals(codeString)) + return DiagnosticReportStatus.REGISTERED; + if ("partial".equals(codeString)) + return DiagnosticReportStatus.PARTIAL; + if ("final".equals(codeString)) + return DiagnosticReportStatus.FINAL; + if ("corrected".equals(codeString)) + return DiagnosticReportStatus.CORRECTED; + if ("appended".equals(codeString)) + return DiagnosticReportStatus.APPENDED; + if ("cancelled".equals(codeString)) + return DiagnosticReportStatus.CANCELLED; + if ("entered-in-error".equals(codeString)) + return DiagnosticReportStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return new Enumeration(this, DiagnosticReportStatus.REGISTERED); + if ("partial".equals(codeString)) + return new Enumeration(this, DiagnosticReportStatus.PARTIAL); + if ("final".equals(codeString)) + return new Enumeration(this, DiagnosticReportStatus.FINAL); + if ("corrected".equals(codeString)) + return new Enumeration(this, DiagnosticReportStatus.CORRECTED); + if ("appended".equals(codeString)) + return new Enumeration(this, DiagnosticReportStatus.APPENDED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, DiagnosticReportStatus.CANCELLED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, DiagnosticReportStatus.ENTEREDINERROR); + throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'"); + } + public String toCode(DiagnosticReportStatus code) { + if (code == DiagnosticReportStatus.REGISTERED) + return "registered"; + if (code == DiagnosticReportStatus.PARTIAL) + return "partial"; + if (code == DiagnosticReportStatus.FINAL) + return "final"; + if (code == DiagnosticReportStatus.CORRECTED) + return "corrected"; + if (code == DiagnosticReportStatus.APPENDED) + return "appended"; + if (code == DiagnosticReportStatus.CANCELLED) + return "cancelled"; + if (code == DiagnosticReportStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(DiagnosticReportStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class DiagnosticReportImageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + @Child(name = "comment", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Comment about the image (e.g. explanation)", formalDefinition="A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features." ) + protected StringType comment; + + /** + * Reference to the image source. + */ + @Child(name = "link", type = {Media.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." ) + protected Reference link; + + /** + * The actual object that is the target of the reference (Reference to the image source.) + */ + protected Media linkTarget; + + private static final long serialVersionUID = 935791940L; + + /** + * Constructor + */ + public DiagnosticReportImageComponent() { + super(); + } + + /** + * Constructor + */ + public DiagnosticReportImageComponent(Reference link) { + super(); + this.link = link; + } + + /** + * @return {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public DiagnosticReportImageComponent setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + public DiagnosticReportImageComponent setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #link} (Reference to the image source.) + */ + public Reference getLink() { + if (this.link == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); + else if (Configuration.doAutoCreate()) + this.link = new Reference(); // cc + return this.link; + } + + public boolean hasLink() { + return this.link != null && !this.link.isEmpty(); + } + + /** + * @param value {@link #link} (Reference to the image source.) + */ + public DiagnosticReportImageComponent setLink(Reference value) { + this.link = value; + return this; + } + + /** + * @return {@link #link} 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 image source.) + */ + public Media getLinkTarget() { + if (this.linkTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); + else if (Configuration.doAutoCreate()) + this.linkTarget = new Media(); // aa + return this.linkTarget; + } + + /** + * @param value {@link #link} 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 image source.) + */ + public DiagnosticReportImageComponent setLinkTarget(Media value) { + this.linkTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, java.lang.Integer.MAX_VALUE, link)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + case 3321850: /*link*/ return this.link == null ? new Base[0] : new Base[] {this.link}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + case 3321850: // link + this.link = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("comment")) + this.comment = castToString(value); // StringType + else if (name.equals("link")) + this.link = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + case 3321850: return getLink(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.comment"); + } + else if (name.equals("link")) { + this.link = new Reference(); + return this.link; + } + else + return super.addChild(name); + } + + public DiagnosticReportImageComponent copy() { + DiagnosticReportImageComponent dst = new DiagnosticReportImageComponent(); + copyValues(dst); + dst.comment = comment == null ? null : comment.copy(); + dst.link = link == null ? null : link.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticReportImageComponent)) + return false; + DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other; + return compareDeep(comment, o.comment, true) && compareDeep(link, o.link, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticReportImageComponent)) + return false; + DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other; + return compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (comment == null || comment.isEmpty()) && (link == null || link.isEmpty()) + ; + } + + public String fhirType() { + return "DiagnosticReport.image"; + + } + + } + + /** + * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Id for external references to this report", formalDefinition="The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider." ) + protected List identifier; + + /** + * The status of the diagnostic report as a whole. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="registered | partial | final | corrected | appended | cancelled | entered-in-error", formalDefinition="The status of the diagnostic report as a whole." ) + protected Enumeration status; + + /** + * A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service category", formalDefinition="A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes." ) + protected CodeableConcept category; + + /** + * A code or name that describes this diagnostic report. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." ) + protected CodeableConcept code; + + /** + * The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The subject of the report, usually, but not always, the patient", formalDefinition="The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + protected Resource subjectTarget; + + /** + * The link to the health care event (encounter) when the order was made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Health care event when test ordered", formalDefinition="The link to the health care event (encounter) when the order was made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The link to the health care event (encounter) when the order was made.) + */ + protected Encounter encounterTarget; + + /** + * The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. + */ + @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Clinically Relevant time/time-period for report", formalDefinition="The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself." ) + protected Type effective; + + /** + * The date and time that this version of the report was released from the source diagnostic service. + */ + @Child(name = "issued", type = {InstantType.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="DateTime this version was released", formalDefinition="The date and time that this version of the report was released from the source diagnostic service." ) + protected InstantType issued; + + /** + * The diagnostic service that is responsible for issuing the report. + */ + @Child(name = "performer", type = {Practitioner.class, Organization.class}, order=8, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (The diagnostic service that is responsible for issuing the report.) + */ + protected Resource performerTarget; + + /** + * Details concerning a test or procedure requested. + */ + @Child(name = "request", type = {DiagnosticOrder.class, ProcedureRequest.class, ReferralRequest.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="What was requested", formalDefinition="Details concerning a test or procedure requested." ) + protected List request; + /** + * The actual objects that are the target of the reference (Details concerning a test or procedure requested.) + */ + protected List requestTarget; + + + /** + * Details about the specimens on which this diagnostic report is based. + */ + @Child(name = "specimen", type = {Specimen.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this diagnostic report is based." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (Details about the specimens on which this diagnostic report is based.) + */ + protected List specimenTarget; + + + /** + * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels"). + */ + @Child(name = "result", type = {Observation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Observations - simple, or complex nested groups", formalDefinition="Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. \"atomic\" results), or they can be grouping observations that include references to other members of the group (e.g. \"panels\")." ) + protected List result; + /** + * The actual objects that are the target of the reference (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + protected List resultTarget; + + + /** + * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images. + */ + @Child(name = "imagingStudy", type = {ImagingStudy.class, ImagingObjectSelection.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Reference to full details of imaging associated with the diagnostic report", formalDefinition="One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images." ) + protected List imagingStudy; + /** + * The actual objects that are the target of the reference (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + protected List imagingStudyTarget; + + + /** + * A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). + */ + @Child(name = "image", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Key images associated with this report", formalDefinition="A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest)." ) + protected List image; + + /** + * Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + @Child(name = "conclusion", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Clinical Interpretation of test results", formalDefinition="Concise and clinically contextualized narrative interpretation of the diagnostic report." ) + protected StringType conclusion; + + /** + * Codes for the conclusion. + */ + @Child(name = "codedDiagnosis", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Codes for the conclusion", formalDefinition="Codes for the conclusion." ) + protected List codedDiagnosis; + + /** + * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. + */ + @Child(name = "presentedForm", type = {Attachment.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Entire report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." ) + protected List presentedForm; + + private static final long serialVersionUID = 920334551L; + + /** + * Constructor + */ + public DiagnosticReport() { + super(); + } + + /** + * Constructor + */ + public DiagnosticReport(Enumeration status, CodeableConcept code, Reference subject, Type effective, InstantType issued, Reference performer) { + super(); + this.status = status; + this.code = code; + this.subject = subject; + this.effective = effective; + this.issued = issued; + this.performer = performer; + } + + /** + * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) + */ + 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 local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (The status of the diagnostic report as a whole.). 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 DiagnosticReport.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DiagnosticReportStatusEnumFactory()); // bb + 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 diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticReport setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the diagnostic report as a whole. + */ + public DiagnosticReportStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the diagnostic report as a whole. + */ + public DiagnosticReport setStatus(DiagnosticReportStatus value) { + if (this.status == null) + this.status = new Enumeration(new DiagnosticReportStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #category} (A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.) + */ + public DiagnosticReport setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #code} (A code or name that describes this diagnostic report.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code or name that describes this diagnostic report.) + */ + public DiagnosticReport setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public DiagnosticReport 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 subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public Resource getSubjectTarget() { + 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 subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public DiagnosticReport setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The link to the health care event (encounter) when the order was made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The link to the health care event (encounter) when the order was made.) + */ + public DiagnosticReport 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 link to the health care event (encounter) when the order was made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 link to the health care event (encounter) when the order was made.) + */ + public DiagnosticReport setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public Type getEffective() { + return this.effective; + } + + /** + * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public DateTimeType getEffectiveDateTimeType() throws FHIRException { + if (!(this.effective instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (DateTimeType) this.effective; + } + + public boolean hasEffectiveDateTimeType() { + return this.effective instanceof DateTimeType; + } + + /** + * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public Period getEffectivePeriod() throws FHIRException { + if (!(this.effective instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (Period) this.effective; + } + + public boolean hasEffectivePeriod() { + return this.effective instanceof Period; + } + + public boolean hasEffective() { + return this.effective != null && !this.effective.isEmpty(); + } + + /** + * @param value {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public DiagnosticReport setEffective(Type value) { + this.effective = value; + return this; + } + + /** + * @return {@link #issued} (The date and time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public InstantType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new InstantType(); // bb + 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} (The date and time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DiagnosticReport setIssuedElement(InstantType value) { + this.issued = value; + return this; + } + + /** + * @return The date and time that this version of the report was released from the source diagnostic service. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value The date and time that this version of the report was released from the source diagnostic service. + */ + public DiagnosticReport setIssued(Date value) { + if (this.issued == null) + this.issued = new InstantType(); + this.issued.setValue(value); + return this; + } + + /** + * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (The diagnostic service that is responsible for issuing the report.) + */ + public DiagnosticReport setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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 diagnostic service that is responsible for issuing the report.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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 diagnostic service that is responsible for issuing the report.) + */ + public DiagnosticReport setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #request} (Details concerning a test or procedure requested.) + */ + public List getRequest() { + if (this.request == null) + this.request = new ArrayList(); + return this.request; + } + + public boolean hasRequest() { + if (this.request == null) + return false; + for (Reference item : this.request) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #request} (Details concerning a test or procedure requested.) + */ + // syntactic sugar + public Reference addRequest() { //3 + Reference t = new Reference(); + if (this.request == null) + this.request = new ArrayList(); + this.request.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addRequest(Reference t) { //3 + if (t == null) + return this; + if (this.request == null) + this.request = new ArrayList(); + this.request.add(t); + return this; + } + + /** + * @return {@link #request} (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. Details concerning a test or procedure requested.) + */ + public List getRequestTarget() { + if (this.requestTarget == null) + this.requestTarget = new ArrayList(); + return this.requestTarget; + } + + /** + * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addSpecimen(Reference t) { //3 + if (t == null) + return this; + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return this; + } + + /** + * @return {@link #specimen} (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. Details about the specimens on which this diagnostic report is based.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (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. Details about the specimens on which this diagnostic report is based.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public List getResult() { + if (this.result == null) + this.result = new ArrayList(); + return this.result; + } + + public boolean hasResult() { + if (this.result == null) + return false; + for (Reference item : this.result) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + // syntactic sugar + public Reference addResult() { //3 + Reference t = new Reference(); + if (this.result == null) + this.result = new ArrayList(); + this.result.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addResult(Reference t) { //3 + if (t == null) + return this; + if (this.result == null) + this.result = new ArrayList(); + this.result.add(t); + return this; + } + + /** + * @return {@link #result} (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. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public List getResultTarget() { + if (this.resultTarget == null) + this.resultTarget = new ArrayList(); + return this.resultTarget; + } + + // syntactic sugar + /** + * @return {@link #result} (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. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public Observation addResultTarget() { + Observation r = new Observation(); + if (this.resultTarget == null) + this.resultTarget = new ArrayList(); + this.resultTarget.add(r); + return r; + } + + /** + * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + public List getImagingStudy() { + if (this.imagingStudy == null) + this.imagingStudy = new ArrayList(); + return this.imagingStudy; + } + + public boolean hasImagingStudy() { + if (this.imagingStudy == null) + return false; + for (Reference item : this.imagingStudy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + // syntactic sugar + public Reference addImagingStudy() { //3 + Reference t = new Reference(); + if (this.imagingStudy == null) + this.imagingStudy = new ArrayList(); + this.imagingStudy.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addImagingStudy(Reference t) { //3 + if (t == null) + return this; + if (this.imagingStudy == null) + this.imagingStudy = new ArrayList(); + this.imagingStudy.add(t); + return this; + } + + /** + * @return {@link #imagingStudy} (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. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + public List getImagingStudyTarget() { + if (this.imagingStudyTarget == null) + this.imagingStudyTarget = new ArrayList(); + return this.imagingStudyTarget; + } + + /** + * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) + */ + public List getImage() { + if (this.image == null) + this.image = new ArrayList(); + return this.image; + } + + public boolean hasImage() { + if (this.image == null) + return false; + for (DiagnosticReportImageComponent item : this.image) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) + */ + // syntactic sugar + public DiagnosticReportImageComponent addImage() { //3 + DiagnosticReportImageComponent t = new DiagnosticReportImageComponent(); + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addImage(DiagnosticReportImageComponent t) { //3 + if (t == null) + return this; + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return this; + } + + /** + * @return {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value + */ + public StringType getConclusionElement() { + if (this.conclusion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.conclusion"); + else if (Configuration.doAutoCreate()) + this.conclusion = new StringType(); // bb + return this.conclusion; + } + + public boolean hasConclusionElement() { + return this.conclusion != null && !this.conclusion.isEmpty(); + } + + public boolean hasConclusion() { + return this.conclusion != null && !this.conclusion.isEmpty(); + } + + /** + * @param value {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value + */ + public DiagnosticReport setConclusionElement(StringType value) { + this.conclusion = value; + return this; + } + + /** + * @return Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + public String getConclusion() { + return this.conclusion == null ? null : this.conclusion.getValue(); + } + + /** + * @param value Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + public DiagnosticReport setConclusion(String value) { + if (Utilities.noString(value)) + this.conclusion = null; + else { + if (this.conclusion == null) + this.conclusion = new StringType(); + this.conclusion.setValue(value); + } + return this; + } + + /** + * @return {@link #codedDiagnosis} (Codes for the conclusion.) + */ + public List getCodedDiagnosis() { + if (this.codedDiagnosis == null) + this.codedDiagnosis = new ArrayList(); + return this.codedDiagnosis; + } + + public boolean hasCodedDiagnosis() { + if (this.codedDiagnosis == null) + return false; + for (CodeableConcept item : this.codedDiagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codedDiagnosis} (Codes for the conclusion.) + */ + // syntactic sugar + public CodeableConcept addCodedDiagnosis() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.codedDiagnosis == null) + this.codedDiagnosis = new ArrayList(); + this.codedDiagnosis.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addCodedDiagnosis(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.codedDiagnosis == null) + this.codedDiagnosis = new ArrayList(); + this.codedDiagnosis.add(t); + return this; + } + + /** + * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) + */ + public List getPresentedForm() { + if (this.presentedForm == null) + this.presentedForm = new ArrayList(); + return this.presentedForm; + } + + public boolean hasPresentedForm() { + if (this.presentedForm == null) + return false; + for (Attachment item : this.presentedForm) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) + */ + // syntactic sugar + public Attachment addPresentedForm() { //3 + Attachment t = new Attachment(); + if (this.presentedForm == null) + this.presentedForm = new ArrayList(); + this.presentedForm.add(t); + return t; + } + + // syntactic sugar + public DiagnosticReport addPresentedForm(Attachment t) { //3 + if (t == null) + return this; + if (this.presentedForm == null) + this.presentedForm = new ArrayList(); + this.presentedForm.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "The status of the diagnostic report as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The link to the health care event (encounter) when the order was made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, effective)); + childrenList.add(new Property("issued", "instant", "The date and time that this version of the report was released from the source diagnostic service.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("request", "Reference(DiagnosticOrder|ProcedureRequest|ReferralRequest)", "Details concerning a test or procedure requested.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("result", "Reference(Observation)", "Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. \"atomic\" results), or they can be grouping observations that include references to other members of the group (e.g. \"panels\").", 0, java.lang.Integer.MAX_VALUE, result)); + childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy|ImagingObjectSelection)", "One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); + childrenList.add(new Property("image", "", "A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).", 0, java.lang.Integer.MAX_VALUE, image)); + childrenList.add(new Property("conclusion", "string", "Concise and clinically contextualized narrative interpretation of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusion)); + childrenList.add(new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis)); + childrenList.add(new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type + case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference + case 1095692943: /*request*/ return this.request == null ? new Base[0] : this.request.toArray(new Base[this.request.size()]); // Reference + case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference + case -934426595: /*result*/ return this.result == null ? new Base[0] : this.result.toArray(new Base[this.result.size()]); // Reference + case -814900911: /*imagingStudy*/ return this.imagingStudy == null ? new Base[0] : this.imagingStudy.toArray(new Base[this.imagingStudy.size()]); // Reference + case 100313435: /*image*/ return this.image == null ? new Base[0] : this.image.toArray(new Base[this.image.size()]); // DiagnosticReportImageComponent + case -1731259873: /*conclusion*/ return this.conclusion == null ? new Base[0] : new Base[] {this.conclusion}; // StringType + case -1364269926: /*codedDiagnosis*/ return this.codedDiagnosis == null ? new Base[0] : this.codedDiagnosis.toArray(new Base[this.codedDiagnosis.size()]); // CodeableConcept + case 230090366: /*presentedForm*/ return this.presentedForm == null ? new Base[0] : this.presentedForm.toArray(new Base[this.presentedForm.size()]); // Attachment + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new DiagnosticReportStatusEnumFactory().fromType(value); // Enumeration + break; + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -1468651097: // effective + this.effective = (Type) value; // Type + break; + case -1179159893: // issued + this.issued = castToInstant(value); // InstantType + break; + case 481140686: // performer + this.performer = castToReference(value); // Reference + break; + case 1095692943: // request + this.getRequest().add(castToReference(value)); // Reference + break; + case -2132868344: // specimen + this.getSpecimen().add(castToReference(value)); // Reference + break; + case -934426595: // result + this.getResult().add(castToReference(value)); // Reference + break; + case -814900911: // imagingStudy + this.getImagingStudy().add(castToReference(value)); // Reference + break; + case 100313435: // image + this.getImage().add((DiagnosticReportImageComponent) value); // DiagnosticReportImageComponent + break; + case -1731259873: // conclusion + this.conclusion = castToString(value); // StringType + break; + case -1364269926: // codedDiagnosis + this.getCodedDiagnosis().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 230090366: // presentedForm + this.getPresentedForm().add(castToAttachment(value)); // Attachment + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new DiagnosticReportStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("effective[x]")) + this.effective = (Type) value; // Type + else if (name.equals("issued")) + this.issued = castToInstant(value); // InstantType + else if (name.equals("performer")) + this.performer = castToReference(value); // Reference + else if (name.equals("request")) + this.getRequest().add(castToReference(value)); + else if (name.equals("specimen")) + this.getSpecimen().add(castToReference(value)); + else if (name.equals("result")) + this.getResult().add(castToReference(value)); + else if (name.equals("imagingStudy")) + this.getImagingStudy().add(castToReference(value)); + else if (name.equals("image")) + this.getImage().add((DiagnosticReportImageComponent) value); + else if (name.equals("conclusion")) + this.conclusion = castToString(value); // StringType + else if (name.equals("codedDiagnosis")) + this.getCodedDiagnosis().add(castToCodeableConcept(value)); + else if (name.equals("presentedForm")) + this.getPresentedForm().add(castToAttachment(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 50511102: return getCategory(); // CodeableConcept + case 3059181: return getCode(); // CodeableConcept + case -1867885268: return getSubject(); // Reference + case 1524132147: return getEncounter(); // Reference + case 247104889: return getEffective(); // Type + case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // InstantType + case 481140686: return getPerformer(); // Reference + case 1095692943: return addRequest(); // Reference + case -2132868344: return addSpecimen(); // Reference + case -934426595: return addResult(); // Reference + case -814900911: return addImagingStudy(); // Reference + case 100313435: return addImage(); // DiagnosticReportImageComponent + case -1731259873: throw new FHIRException("Cannot make property conclusion as it is not a complex type"); // StringType + case -1364269926: return addCodedDiagnosis(); // CodeableConcept + case 230090366: return addPresentedForm(); // Attachment + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.status"); + } + else if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("effectiveDateTime")) { + this.effective = new DateTimeType(); + return this.effective; + } + else if (name.equals("effectivePeriod")) { + this.effective = new Period(); + return this.effective; + } + else if (name.equals("issued")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.issued"); + } + else if (name.equals("performer")) { + this.performer = new Reference(); + return this.performer; + } + else if (name.equals("request")) { + return addRequest(); + } + else if (name.equals("specimen")) { + return addSpecimen(); + } + else if (name.equals("result")) { + return addResult(); + } + else if (name.equals("imagingStudy")) { + return addImagingStudy(); + } + else if (name.equals("image")) { + return addImage(); + } + else if (name.equals("conclusion")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.conclusion"); + } + else if (name.equals("codedDiagnosis")) { + return addCodedDiagnosis(); + } + else if (name.equals("presentedForm")) { + return addPresentedForm(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DiagnosticReport"; + + } + + public DiagnosticReport copy() { + DiagnosticReport dst = new DiagnosticReport(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.effective = effective == null ? null : effective.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.performer = performer == null ? null : performer.copy(); + if (request != null) { + dst.request = new ArrayList(); + for (Reference i : request) + dst.request.add(i.copy()); + }; + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + if (result != null) { + dst.result = new ArrayList(); + for (Reference i : result) + dst.result.add(i.copy()); + }; + if (imagingStudy != null) { + dst.imagingStudy = new ArrayList(); + for (Reference i : imagingStudy) + dst.imagingStudy.add(i.copy()); + }; + if (image != null) { + dst.image = new ArrayList(); + for (DiagnosticReportImageComponent i : image) + dst.image.add(i.copy()); + }; + dst.conclusion = conclusion == null ? null : conclusion.copy(); + if (codedDiagnosis != null) { + dst.codedDiagnosis = new ArrayList(); + for (CodeableConcept i : codedDiagnosis) + dst.codedDiagnosis.add(i.copy()); + }; + if (presentedForm != null) { + dst.presentedForm = new ArrayList(); + for (Attachment i : presentedForm) + dst.presentedForm.add(i.copy()); + }; + return dst; + } + + protected DiagnosticReport typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosticReport)) + return false; + DiagnosticReport o = (DiagnosticReport) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) + && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(effective, o.effective, true) && compareDeep(issued, o.issued, true) && compareDeep(performer, o.performer, true) + && compareDeep(request, o.request, true) && compareDeep(specimen, o.specimen, true) && compareDeep(result, o.result, true) + && compareDeep(imagingStudy, o.imagingStudy, true) && compareDeep(image, o.image, true) && compareDeep(conclusion, o.conclusion, true) + && compareDeep(codedDiagnosis, o.codedDiagnosis, true) && compareDeep(presentedForm, o.presentedForm, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosticReport)) + return false; + DiagnosticReport o = (DiagnosticReport) other; + return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(conclusion, o.conclusion, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) && (subject == null || subject.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (effective == null || effective.isEmpty()) + && (issued == null || issued.isEmpty()) && (performer == null || performer.isEmpty()) && (request == null || request.isEmpty()) + && (specimen == null || specimen.isEmpty()) && (result == null || result.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) + && (image == null || image.isEmpty()) && (conclusion == null || conclusion.isEmpty()) && (codedDiagnosis == null || codedDiagnosis.isEmpty()) + && (presentedForm == null || presentedForm.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DiagnosticReport; + } + + /** + * Search parameter: result + *

+ * Description: Link to an atomic result (observation resource)
+ * Type: reference
+ * Path: DiagnosticReport.result
+ *

+ */ + @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference" ) + public static final String SP_RESULT = "result"; + /** + * Fluent Client search parameter constant for result + *

+ * Description: Link to an atomic result (observation resource)
+ * Type: reference
+ * Path: DiagnosticReport.result
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESULT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESULT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticReport:result". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RESULT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:result").toLocked(); + + /** + * Search parameter: status + *

+ * Description: The status of the report
+ * Type: token
+ * Path: DiagnosticReport.status
+ *

+ */ + @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The status of the report
+ * Type: token
+ * Path: DiagnosticReport.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: The subject of the report
+ * Type: reference
+ * Path: DiagnosticReport.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="DiagnosticReport.subject", description="The subject of the report", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: The subject of the report
+ * Type: reference
+ * Path: DiagnosticReport.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticReport:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:subject").toLocked(); + + /** + * Search parameter: issued + *

+ * Description: When the report was issued
+ * Type: date
+ * Path: DiagnosticReport.issued
+ *

+ */ + @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" ) + public static final String SP_ISSUED = "issued"; + /** + * Fluent Client search parameter constant for issued + *

+ * Description: When the report was issued
+ * Type: date
+ * Path: DiagnosticReport.issued
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED); + + /** + * Search parameter: diagnosis + *

+ * Description: A coded diagnosis on the report
+ * Type: token
+ * Path: DiagnosticReport.codedDiagnosis
+ *

+ */ + @SearchParamDefinition(name="diagnosis", path="DiagnosticReport.codedDiagnosis", description="A coded diagnosis on the report", type="token" ) + public static final String SP_DIAGNOSIS = "diagnosis"; + /** + * Fluent Client search parameter constant for diagnosis + *

+ * Description: A coded diagnosis on the report
+ * Type: token
+ * Path: DiagnosticReport.codedDiagnosis
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam DIAGNOSIS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DIAGNOSIS); + + /** + * Search parameter: image + *

+ * Description: A reference to the image source.
+ * Type: reference
+ * Path: DiagnosticReport.image.link
+ *

+ */ + @SearchParamDefinition(name="image", path="DiagnosticReport.image.link", description="A reference to the image source.", type="reference" ) + public static final String SP_IMAGE = "image"; + /** + * Fluent Client search parameter constant for image + *

+ * Description: A reference to the image source.
+ * Type: reference
+ * Path: DiagnosticReport.image.link
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam IMAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_IMAGE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticReport:image". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_IMAGE = new ca.uhn.fhir.model.api.Include("DiagnosticReport:image").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: The Encounter when the order was made
+ * Type: reference
+ * Path: DiagnosticReport.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="DiagnosticReport.encounter", description="The Encounter when the order was made", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: The Encounter when the order was made
+ * Type: reference
+ * Path: DiagnosticReport.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticReport:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:encounter").toLocked(); + + /** + * Search parameter: code + *

+ * Description: 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
+ * Path: DiagnosticReport.code
+ *

+ */ + @SearchParamDefinition(name="code", path="DiagnosticReport.code", description="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_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: 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
+ * Path: DiagnosticReport.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: The clinically relevant time of the report
+ * Type: date
+ * Path: DiagnosticReport.effective[x]
+ *

+ */ + @SearchParamDefinition(name="date", path="DiagnosticReport.effective", description="The clinically relevant time of the report", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The clinically relevant time of the report
+ * Type: date
+ * Path: DiagnosticReport.effective[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: category + *

+ * Description: Which diagnostic discipline/department created the report
+ * Type: token
+ * Path: DiagnosticReport.category
+ *

+ */ + @SearchParamDefinition(name="category", path="DiagnosticReport.category", description="Which diagnostic discipline/department created the report", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: Which diagnostic discipline/department created the report
+ * Type: token
+ * Path: DiagnosticReport.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: patient + *

+ * Description: The subject of the report if a patient
+ * Type: reference
+ * Path: DiagnosticReport.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="DiagnosticReport.subject", description="The subject of the report if a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The subject of the report if a patient
+ * Type: reference
+ * Path: DiagnosticReport.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticReport:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:patient").toLocked(); + + /** + * Search parameter: request + *

+ * Description: Reference to the test or procedure request.
+ * Type: reference
+ * Path: DiagnosticReport.request
+ *

+ */ + @SearchParamDefinition(name="request", path="DiagnosticReport.request", description="Reference to the test or procedure request.", type="reference" ) + public static final String SP_REQUEST = "request"; + /** + * Fluent Client search parameter constant for request + *

+ * Description: Reference to the test or procedure request.
+ * Type: reference
+ * Path: DiagnosticReport.request
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticReport:request". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("DiagnosticReport:request").toLocked(); + + /** + * Search parameter: specimen + *

+ * Description: The specimen details
+ * Type: reference
+ * Path: DiagnosticReport.specimen
+ *

+ */ + @SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference" ) + public static final String SP_SPECIMEN = "specimen"; + /** + * Fluent Client search parameter constant for specimen + *

+ * Description: The specimen details
+ * Type: reference
+ * Path: DiagnosticReport.specimen
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticReport:specimen". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("DiagnosticReport:specimen").toLocked(); + + /** + * Search parameter: performer + *

+ * Description: Who was the source of the report (organization)
+ * Type: reference
+ * Path: DiagnosticReport.performer
+ *

+ */ + @SearchParamDefinition(name="performer", path="DiagnosticReport.performer", description="Who was the source of the report (organization)", type="reference" ) + public static final String SP_PERFORMER = "performer"; + /** + * Fluent Client search parameter constant for performer + *

+ * Description: Who was the source of the report (organization)
+ * Type: reference
+ * Path: DiagnosticReport.performer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DiagnosticReport:performer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:performer").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: An identifier for the report
+ * Type: token
+ * Path: DiagnosticReport.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DiagnosticReport.identifier", description="An identifier for the report", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: An identifier for the report
+ * Type: token
+ * Path: DiagnosticReport.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Distance.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Distance.java new file mode 100644 index 00000000000..5826150550e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Distance.java @@ -0,0 +1,88 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Distance", profileOf=Quantity.class) +public class Distance extends Quantity { + + private static final long serialVersionUID = 1069574054L; + + public Distance copy() { + Distance dst = new Distance(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Distance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Distance)) + return false; + Distance o = (Distance) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Distance)) + return false; + Distance o = (Distance) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DocumentManifest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DocumentManifest.java new file mode 100644 index 00000000000..cf8c1ab23bf --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DocumentManifest.java @@ -0,0 +1,1587 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A manifest that defines a set of documents. + */ +@ResourceDef(name="DocumentManifest", profile="http://hl7.org/fhir/Profile/DocumentManifest") +public class DocumentManifest extends DomainResource { + + @Block() + public static class DocumentManifestContentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed. + */ + @Child(name = "p", type = {Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contents of this set of documents", formalDefinition="The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed." ) + protected Type p; + + private static final long serialVersionUID = -347538500L; + + /** + * Constructor + */ + public DocumentManifestContentComponent() { + super(); + } + + /** + * Constructor + */ + public DocumentManifestContentComponent(Type p) { + super(); + this.p = p; + } + + /** + * @return {@link #p} (The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) + */ + public Type getP() { + return this.p; + } + + /** + * @return {@link #p} (The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) + */ + public Attachment getPAttachment() throws FHIRException { + if (!(this.p instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.p.getClass().getName()+" was encountered"); + return (Attachment) this.p; + } + + public boolean hasPAttachment() { + return this.p instanceof Attachment; + } + + /** + * @return {@link #p} (The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) + */ + public Reference getPReference() throws FHIRException { + if (!(this.p instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.p.getClass().getName()+" was encountered"); + return (Reference) this.p; + } + + public boolean hasPReference() { + return this.p instanceof Reference; + } + + public boolean hasP() { + return this.p != null && !this.p.isEmpty(); + } + + /** + * @param value {@link #p} (The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) + */ + public DocumentManifestContentComponent setP(Type value) { + this.p = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("p[x]", "Attachment|Reference(Any)", "The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.", 0, java.lang.Integer.MAX_VALUE, p)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 112: /*p*/ return this.p == null ? new Base[0] : new Base[] {this.p}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 112: // p + this.p = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("p[x]")) + this.p = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3427856: return getP(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("pAttachment")) { + this.p = new Attachment(); + return this.p; + } + else if (name.equals("pReference")) { + this.p = new Reference(); + return this.p; + } + else + return super.addChild(name); + } + + public DocumentManifestContentComponent copy() { + DocumentManifestContentComponent dst = new DocumentManifestContentComponent(); + copyValues(dst); + dst.p = p == null ? null : p.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentManifestContentComponent)) + return false; + DocumentManifestContentComponent o = (DocumentManifestContentComponent) other; + return compareDeep(p, o.p, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentManifestContentComponent)) + return false; + DocumentManifestContentComponent o = (DocumentManifestContentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (p == null || p.isEmpty()); + } + + public String fhirType() { + return "DocumentManifest.content"; + + } + + } + + @Block() + public static class DocumentManifestRelatedComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifiers of things that are related", formalDefinition="Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers." ) + protected Identifier identifier; + + /** + * Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc. + */ + @Child(name = "ref", type = {}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Related Resource", formalDefinition="Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc." ) + protected Reference ref; + + /** + * The actual object that is the target of the reference (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) + */ + protected Resource refTarget; + + private static final long serialVersionUID = -1670123330L; + + /** + * Constructor + */ + public DocumentManifestRelatedComponent() { + super(); + } + + /** + * @return {@link #identifier} (Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifestRelatedComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers.) + */ + public DocumentManifestRelatedComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #ref} (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) + */ + public Reference getRef() { + if (this.ref == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifestRelatedComponent.ref"); + else if (Configuration.doAutoCreate()) + this.ref = new Reference(); // cc + return this.ref; + } + + public boolean hasRef() { + return this.ref != null && !this.ref.isEmpty(); + } + + /** + * @param value {@link #ref} (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) + */ + public DocumentManifestRelatedComponent setRef(Reference value) { + this.ref = value; + return this; + } + + /** + * @return {@link #ref} 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. (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) + */ + public Resource getRefTarget() { + return this.refTarget; + } + + /** + * @param value {@link #ref} 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. (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) + */ + public DocumentManifestRelatedComponent setRefTarget(Resource value) { + this.refTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ref", "Reference(Any)", "Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.", 0, java.lang.Integer.MAX_VALUE, ref)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 112787: /*ref*/ return this.ref == null ? new Base[0] : new Base[] {this.ref}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 112787: // ref + this.ref = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("ref")) + this.ref = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 112787: return getRef(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("ref")) { + this.ref = new Reference(); + return this.ref; + } + else + return super.addChild(name); + } + + public DocumentManifestRelatedComponent copy() { + DocumentManifestRelatedComponent dst = new DocumentManifestRelatedComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.ref = ref == null ? null : ref.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentManifestRelatedComponent)) + return false; + DocumentManifestRelatedComponent o = (DocumentManifestRelatedComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ref, o.ref, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentManifestRelatedComponent)) + return false; + DocumentManifestRelatedComponent o = (DocumentManifestRelatedComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ref == null || ref.isEmpty()) + ; + } + + public String fhirType() { + return "DocumentManifest.related"; + + } + + } + + /** + * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. + */ + @Child(name = "masterIdentifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique Identifier for the set of documents", formalDefinition="A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts." ) + protected Identifier masterIdentifier; + + /** + * Other identifiers associated with the document manifest, including version independent identifiers. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Other identifiers for the manifest", formalDefinition="Other identifiers associated with the document manifest, including version independent identifiers." ) + protected List identifier; + + /** + * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case). + */ + @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The subject of the set of documents", formalDefinition="Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + protected Resource subjectTarget; + + /** + * A patient, practitioner, or organization for which this set of documents is intended. + */ + @Child(name = "recipient", type = {Patient.class, Practitioner.class, RelatedPerson.class, Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Intended to get notified about this set of documents", formalDefinition="A patient, practitioner, or organization for which this set of documents is intended." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (A patient, practitioner, or organization for which this set of documents is intended.) + */ + protected List recipientTarget; + + + /** + * Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Kind of document set", formalDefinition="Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider." ) + protected CodeableConcept type; + + /** + * Identifies who is responsible for creating the manifest, and adding documents to it. + */ + @Child(name = "author", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who and/or what authored the manifest", formalDefinition="Identifies who is responsible for creating the manifest, and adding documents to it." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for creating the manifest, and adding documents to it.) + */ + protected List authorTarget; + + + /** + * 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.). + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When this document manifest created", formalDefinition="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.)." ) + protected DateTimeType created; + + /** + * Identifies the source system, application, or software that produced the document manifest. + */ + @Child(name = "source", type = {UriType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The source system/application/software", formalDefinition="Identifies the source system, application, or software that produced the document manifest." ) + protected UriType source; + + /** + * The status of this document manifest. + */ + @Child(name = "status", type = {CodeType.class}, order=8, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="current | superseded | entered-in-error", formalDefinition="The status of this document manifest." ) + protected Enumeration status; + + /** + * Human-readable description of the source document. This is sometimes known as the "title". + */ + @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the \"title\"." ) + protected StringType description; + + /** + * The list of Documents included in the manifest. + */ + @Child(name = "content", type = {}, order=10, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The items included", formalDefinition="The list of Documents included in the manifest." ) + protected List content; + + /** + * Related identifiers or resources associated with the DocumentManifest. + */ + @Child(name = "related", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Related things", formalDefinition="Related identifiers or resources associated with the DocumentManifest." ) + protected List related; + + private static final long serialVersionUID = -2056683927L; + + /** + * Constructor + */ + public DocumentManifest() { + super(); + } + + /** + * Constructor + */ + public DocumentManifest(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) + */ + public Identifier getMasterIdentifier() { + if (this.masterIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.masterIdentifier"); + else if (Configuration.doAutoCreate()) + this.masterIdentifier = new Identifier(); // cc + return this.masterIdentifier; + } + + public boolean hasMasterIdentifier() { + return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); + } + + /** + * @param value {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) + */ + public DocumentManifest setMasterIdentifier(Identifier value) { + this.masterIdentifier = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers associated with the document manifest, including version independent identifiers.) + */ + 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} (Other identifiers associated with the document manifest, including version independent identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public DocumentManifest 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. (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public Resource getSubjectTarget() { + 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. (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public DocumentManifest setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) + */ + 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} (A patient, practitioner, or organization for which this set of documents is intended.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addRecipient(Reference t) { //3 + if (t == null) + return this; + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return this; + } + + /** + * @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. A patient, practitioner, or organization for which this set of documents is intended.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) + */ + public DocumentManifest setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #author} (Identifies who is responsible for creating the manifest, and adding documents to it.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for creating the manifest, and adding documents to it.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addAuthor(Reference t) { //3 + if (t == null) + return this; + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return this; + } + + /** + * @return {@link #author} (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 is responsible for creating the manifest, and adding documents to it.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #created} (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.).). 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 DocumentManifest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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} (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.).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DocumentManifest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @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 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(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 #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public UriType getSourceElement() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.source"); + else if (Configuration.doAutoCreate()) + this.source = new UriType(); // bb + return this.source; + } + + public boolean hasSourceElement() { + return this.source != null && !this.source.isEmpty(); + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public DocumentManifest setSourceElement(UriType value) { + this.source = value; + return this; + } + + /** + * @return Identifies the source system, application, or software that produced the document manifest. + */ + public String getSource() { + return this.source == null ? null : this.source.getValue(); + } + + /** + * @param value Identifies the source system, application, or software that produced the document manifest. + */ + public DocumentManifest setSource(String value) { + if (Utilities.noString(value)) + this.source = null; + else { + if (this.source == null) + this.source = new UriType(); + this.source.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of this document manifest.). 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 DocumentManifest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); // bb + 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 this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DocumentManifest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this document manifest. + */ + public DocumentReferenceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this document manifest. + */ + public DocumentManifest setStatus(DocumentReferenceStatus value) { + if (this.status == null) + this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). 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 DocumentManifest.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public DocumentManifest setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of the source document. This is sometimes known as the "title". + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of the source document. This is sometimes known as the "title". + */ + public DocumentManifest 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 #content} (The list of Documents included in the manifest.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (DocumentManifestContentComponent item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (The list of Documents included in the manifest.) + */ + // syntactic sugar + public DocumentManifestContentComponent addContent() { //3 + DocumentManifestContentComponent t = new DocumentManifestContentComponent(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addContent(DocumentManifestContentComponent t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; + } + + /** + * @return {@link #related} (Related identifiers or resources associated with the DocumentManifest.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (DocumentManifestRelatedComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (Related identifiers or resources associated with the DocumentManifest.) + */ + // syntactic sugar + public DocumentManifestRelatedComponent addRelated() { //3 + DocumentManifestRelatedComponent t = new DocumentManifestRelatedComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + // syntactic sugar + public DocumentManifest addRelated(DocumentManifestRelatedComponent t) { //3 + if (t == null) + return this; + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("masterIdentifier", "Identifier", "A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document manifest, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("recipient", "Reference(Patient|Practitioner|RelatedPerson|Organization)", "A patient, practitioner, or organization for which this set of documents is intended.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("author", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Identifies who is responsible for creating the manifest, and adding documents to it.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("created", "dateTime", "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.).", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("source", "uri", "Identifies the source system, application, or software that produced the document manifest.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("status", "code", "The status of this document manifest.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the \"title\".", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("content", "", "The list of Documents included in the manifest.", 0, java.lang.Integer.MAX_VALUE, content)); + childrenList.add(new Property("related", "", "Related identifiers or resources associated with the DocumentManifest.", 0, java.lang.Integer.MAX_VALUE, related)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 243769515: /*masterIdentifier*/ return this.masterIdentifier == null ? new Base[0] : new Base[] {this.masterIdentifier}; // Identifier + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // UriType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // DocumentManifestContentComponent + case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // DocumentManifestRelatedComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 243769515: // masterIdentifier + this.masterIdentifier = castToIdentifier(value); // Identifier + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 820081177: // recipient + this.getRecipient().add(castToReference(value)); // Reference + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1406328437: // author + this.getAuthor().add(castToReference(value)); // Reference + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case -896505829: // source + this.source = castToUri(value); // UriType + break; + case -892481550: // status + this.status = new DocumentReferenceStatusEnumFactory().fromType(value); // Enumeration + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 951530617: // content + this.getContent().add((DocumentManifestContentComponent) value); // DocumentManifestContentComponent + break; + case 1090493483: // related + this.getRelated().add((DocumentManifestRelatedComponent) value); // DocumentManifestRelatedComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("masterIdentifier")) + this.masterIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("recipient")) + this.getRecipient().add(castToReference(value)); + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("author")) + this.getAuthor().add(castToReference(value)); + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("source")) + this.source = castToUri(value); // UriType + else if (name.equals("status")) + this.status = new DocumentReferenceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("content")) + this.getContent().add((DocumentManifestContentComponent) value); + else if (name.equals("related")) + this.getRelated().add((DocumentManifestRelatedComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 243769515: return getMasterIdentifier(); // Identifier + case -1618432855: return addIdentifier(); // Identifier + case -1867885268: return getSubject(); // Reference + case 820081177: return addRecipient(); // Reference + case 3575610: return getType(); // CodeableConcept + case -1406328437: return addAuthor(); // Reference + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -896505829: throw new FHIRException("Cannot make property source as it is not a complex type"); // UriType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 951530617: return addContent(); // DocumentManifestContentComponent + case 1090493483: return addRelated(); // DocumentManifestRelatedComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("masterIdentifier")) { + this.masterIdentifier = new Identifier(); + return this.masterIdentifier; + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("recipient")) { + return addRecipient(); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("author")) { + return addAuthor(); + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentManifest.created"); + } + else if (name.equals("source")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentManifest.source"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentManifest.status"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentManifest.description"); + } + else if (name.equals("content")) { + return addContent(); + } + else if (name.equals("related")) { + return addRelated(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DocumentManifest"; + + } + + public DocumentManifest copy() { + DocumentManifest dst = new DocumentManifest(); + copyValues(dst); + dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + dst.created = created == null ? null : created.copy(); + dst.source = source == null ? null : source.copy(); + dst.status = status == null ? null : status.copy(); + dst.description = description == null ? null : description.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (DocumentManifestContentComponent i : content) + dst.content.add(i.copy()); + }; + if (related != null) { + dst.related = new ArrayList(); + for (DocumentManifestRelatedComponent i : related) + dst.related.add(i.copy()); + }; + return dst; + } + + protected DocumentManifest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentManifest)) + return false; + DocumentManifest o = (DocumentManifest) other; + return compareDeep(masterIdentifier, o.masterIdentifier, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(subject, o.subject, true) && compareDeep(recipient, o.recipient, true) && compareDeep(type, o.type, true) + && compareDeep(author, o.author, true) && compareDeep(created, o.created, true) && compareDeep(source, o.source, true) + && compareDeep(status, o.status, true) && compareDeep(description, o.description, true) && compareDeep(content, o.content, true) + && compareDeep(related, o.related, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentManifest)) + return false; + DocumentManifest o = (DocumentManifest) other; + return compareValues(created, o.created, true) && compareValues(source, o.source, true) && compareValues(status, o.status, true) + && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (subject == null || subject.isEmpty()) && (recipient == null || recipient.isEmpty()) && (type == null || type.isEmpty()) + && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) && (source == null || source.isEmpty()) + && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) + && (content == null || content.isEmpty()) && (related == null || related.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DocumentManifest; + } + + /** + * Search parameter: related-ref + *

+ * Description: Related Resource
+ * Type: reference
+ * Path: DocumentManifest.related.ref
+ *

+ */ + @SearchParamDefinition(name="related-ref", path="DocumentManifest.related.ref", description="Related Resource", type="reference" ) + public static final String SP_RELATED_REF = "related-ref"; + /** + * Fluent Client search parameter constant for related-ref + *

+ * Description: Related Resource
+ * Type: reference
+ * Path: DocumentManifest.related.ref
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATED_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATED_REF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentManifest:related-ref". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATED_REF = new ca.uhn.fhir.model.api.Include("DocumentManifest:related-ref").toLocked(); + + /** + * Search parameter: related-id + *

+ * Description: Identifiers of things that are related
+ * Type: token
+ * Path: DocumentManifest.related.identifier
+ *

+ */ + @SearchParamDefinition(name="related-id", path="DocumentManifest.related.identifier", description="Identifiers of things that are related", type="token" ) + public static final String SP_RELATED_ID = "related-id"; + /** + * Fluent Client search parameter constant for related-id + *

+ * Description: Identifiers of things that are related
+ * Type: token
+ * Path: DocumentManifest.related.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATED_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATED_ID); + + /** + * Search parameter: content-ref + *

+ * Description: Contents of this set of documents
+ * Type: reference
+ * Path: DocumentManifest.content.pReference
+ *

+ */ + @SearchParamDefinition(name="content-ref", path="DocumentManifest.content.p.as(Reference)", description="Contents of this set of documents", type="reference" ) + public static final String SP_CONTENT_REF = "content-ref"; + /** + * Fluent Client search parameter constant for content-ref + *

+ * Description: Contents of this set of documents
+ * Type: reference
+ * Path: DocumentManifest.content.pReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTENT_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTENT_REF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentManifest:content-ref". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTENT_REF = new ca.uhn.fhir.model.api.Include("DocumentManifest:content-ref").toLocked(); + + /** + * Search parameter: status + *

+ * Description: current | superseded | entered-in-error
+ * Type: token
+ * Path: DocumentManifest.status
+ *

+ */ + @SearchParamDefinition(name="status", path="DocumentManifest.status", description="current | superseded | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: current | superseded | entered-in-error
+ * Type: token
+ * Path: DocumentManifest.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: The subject of the set of documents
+ * Type: reference
+ * Path: DocumentManifest.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: The subject of the set of documents
+ * Type: reference
+ * Path: DocumentManifest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentManifest:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DocumentManifest:subject").toLocked(); + + /** + * Search parameter: type + *

+ * Description: Kind of document set
+ * Type: token
+ * Path: DocumentManifest.type
+ *

+ */ + @SearchParamDefinition(name="type", path="DocumentManifest.type", description="Kind of document set", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Kind of document set
+ * Type: token
+ * Path: DocumentManifest.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: recipient + *

+ * Description: Intended to get notified about this set of documents
+ * Type: reference
+ * Path: DocumentManifest.recipient
+ *

+ */ + @SearchParamDefinition(name="recipient", path="DocumentManifest.recipient", description="Intended to get notified about this set of documents", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + /** + * Fluent Client search parameter constant for recipient + *

+ * Description: Intended to get notified about this set of documents
+ * Type: reference
+ * Path: DocumentManifest.recipient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentManifest:recipient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("DocumentManifest:recipient").toLocked(); + + /** + * Search parameter: author + *

+ * Description: Who and/or what authored the manifest
+ * Type: reference
+ * Path: DocumentManifest.author
+ *

+ */ + @SearchParamDefinition(name="author", path="DocumentManifest.author", description="Who and/or what authored the manifest", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: Who and/or what authored the manifest
+ * Type: reference
+ * Path: DocumentManifest.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentManifest:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("DocumentManifest:author").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The subject of the set of documents
+ * Type: reference
+ * Path: DocumentManifest.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The subject of the set of documents
+ * Type: reference
+ * Path: DocumentManifest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentManifest:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DocumentManifest:patient").toLocked(); + + /** + * Search parameter: source + *

+ * Description: The source system/application/software
+ * Type: uri
+ * Path: DocumentManifest.source
+ *

+ */ + @SearchParamDefinition(name="source", path="DocumentManifest.source", description="The source system/application/software", type="uri" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: The source system/application/software
+ * Type: uri
+ * Path: DocumentManifest.source
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam SOURCE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SOURCE); + + /** + * Search parameter: created + *

+ * Description: When this document manifest created
+ * Type: date
+ * Path: DocumentManifest.created
+ *

+ */ + @SearchParamDefinition(name="created", path="DocumentManifest.created", description="When this document manifest created", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: When this document manifest created
+ * Type: date
+ * Path: DocumentManifest.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: description + *

+ * Description: Human-readable description (title)
+ * Type: string
+ * Path: DocumentManifest.description
+ *

+ */ + @SearchParamDefinition(name="description", path="DocumentManifest.description", description="Human-readable description (title)", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Human-readable description (title)
+ * Type: string
+ * Path: DocumentManifest.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: identifier + *

+ * Description: Unique Identifier for the set of documents
+ * Type: token
+ * Path: DocumentManifest.masterIdentifier, DocumentManifest.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DocumentManifest.masterIdentifier | DocumentManifest.identifier", description="Unique Identifier for the set of documents", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique Identifier for the set of documents
+ * Type: token
+ * Path: DocumentManifest.masterIdentifier, DocumentManifest.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DocumentReference.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DocumentReference.java new file mode 100644 index 00000000000..741b44e8cbd --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DocumentReference.java @@ -0,0 +1,2991 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A reference to a document . + */ +@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/Profile/DocumentReference") +public class DocumentReference extends DomainResource { + + public enum DocumentRelationshipType { + /** + * This document logically replaces or supersedes the target document. + */ + REPLACES, + /** + * This document was generated by transforming the target document (e.g. format or language conversion). + */ + TRANSFORMS, + /** + * This document is a signature of the target document. + */ + SIGNS, + /** + * This document adds additional information to the target document. + */ + APPENDS, + /** + * added to help the parsers + */ + NULL; + public static DocumentRelationshipType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("replaces".equals(codeString)) + return REPLACES; + if ("transforms".equals(codeString)) + return TRANSFORMS; + if ("signs".equals(codeString)) + return SIGNS; + if ("appends".equals(codeString)) + return APPENDS; + throw new FHIRException("Unknown DocumentRelationshipType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REPLACES: return "replaces"; + case TRANSFORMS: return "transforms"; + case SIGNS: return "signs"; + case APPENDS: return "appends"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REPLACES: return "http://hl7.org/fhir/document-relationship-type"; + case TRANSFORMS: return "http://hl7.org/fhir/document-relationship-type"; + case SIGNS: return "http://hl7.org/fhir/document-relationship-type"; + case APPENDS: return "http://hl7.org/fhir/document-relationship-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REPLACES: return "This document logically replaces or supersedes the target document."; + case TRANSFORMS: return "This document was generated by transforming the target document (e.g. format or language conversion)."; + case SIGNS: return "This document is a signature of the target document."; + case APPENDS: return "This document adds additional information to the target document."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REPLACES: return "Replaces"; + case TRANSFORMS: return "Transforms"; + case SIGNS: return "Signs"; + case APPENDS: return "Appends"; + default: return "?"; + } + } + } + + 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; + if ("replaces".equals(codeString)) + return DocumentRelationshipType.REPLACES; + if ("transforms".equals(codeString)) + return DocumentRelationshipType.TRANSFORMS; + if ("signs".equals(codeString)) + return DocumentRelationshipType.SIGNS; + if ("appends".equals(codeString)) + return DocumentRelationshipType.APPENDS; + throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("replaces".equals(codeString)) + return new Enumeration(this, DocumentRelationshipType.REPLACES); + if ("transforms".equals(codeString)) + return new Enumeration(this, DocumentRelationshipType.TRANSFORMS); + if ("signs".equals(codeString)) + return new Enumeration(this, DocumentRelationshipType.SIGNS); + if ("appends".equals(codeString)) + return new Enumeration(this, DocumentRelationshipType.APPENDS); + throw new FHIRException("Unknown DocumentRelationshipType code '"+codeString+"'"); + } + public String toCode(DocumentRelationshipType code) { + if (code == DocumentRelationshipType.REPLACES) + return "replaces"; + if (code == DocumentRelationshipType.TRANSFORMS) + return "transforms"; + if (code == DocumentRelationshipType.SIGNS) + return "signs"; + if (code == DocumentRelationshipType.APPENDS) + return "appends"; + return "?"; + } + public String toSystem(DocumentRelationshipType code) { + return code.getSystem(); + } + } + + @Block() + public static class DocumentReferenceRelatesToComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of relationship that this document has with anther document. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="replaces | transforms | signs | appends", formalDefinition="The type of relationship that this document has with anther document." ) + protected Enumeration code; + + /** + * The target document of this relationship. + */ + @Child(name = "target", type = {DocumentReference.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Target of the relationship", formalDefinition="The target document of this relationship." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The target document of this relationship.) + */ + protected DocumentReference targetTarget; + + private static final long serialVersionUID = -347257495L; + + /** + * Constructor + */ + public DocumentReferenceRelatesToComponent() { + super(); + } + + /** + * Constructor + */ + public DocumentReferenceRelatesToComponent(Enumeration code, Reference target) { + super(); + this.code = code; + this.target = target; + } + + /** + * @return {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new DocumentRelationshipTypeEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public DocumentReferenceRelatesToComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return The type of relationship that this document has with anther document. + */ + public DocumentRelationshipType getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The type of relationship that this document has with anther document. + */ + public DocumentReferenceRelatesToComponent setCode(DocumentRelationshipType value) { + if (this.code == null) + this.code = new Enumeration(new DocumentRelationshipTypeEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #target} (The target document of this relationship.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The target document of this relationship.) + */ + public DocumentReferenceRelatesToComponent 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. (The target document of this relationship.) + */ + public DocumentReference getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new DocumentReference(); // aa + 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. (The target document of this relationship.) + */ + public DocumentReferenceRelatesToComponent setTargetTarget(DocumentReference value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "The type of relationship that this document has with anther document.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("target", "Reference(DocumentReference)", "The target document of this relationship.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = new DocumentRelationshipTypeEnumFactory().fromType(value); // Enumeration + break; + case -880905839: // target + this.target = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = new DocumentRelationshipTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("target")) + this.target = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration + case -880905839: return getTarget(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.code"); + } + else if (name.equals("target")) { + this.target = new Reference(); + return this.target; + } + else + return super.addChild(name); + } + + public DocumentReferenceRelatesToComponent copy() { + DocumentReferenceRelatesToComponent dst = new DocumentReferenceRelatesToComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReferenceRelatesToComponent)) + return false; + DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other; + return compareDeep(code, o.code, true) && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReferenceRelatesToComponent)) + return false; + DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other; + return compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + public String fhirType() { + return "DocumentReference.relatesTo"; + + } + + } + + @Block() + public static class DocumentReferenceContentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The document or url of the document along with critical metadata to prove content has integrity. + */ + @Child(name = "attachment", type = {Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where to access the document", formalDefinition="The document or url of the document along with critical metadata to prove content has integrity." ) + protected Attachment attachment; + + /** + * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. + */ + @Child(name = "format", type = {Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Format/content rules for the document", formalDefinition="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType." ) + protected List format; + + private static final long serialVersionUID = -1412643085L; + + /** + * Constructor + */ + public DocumentReferenceContentComponent() { + super(); + } + + /** + * Constructor + */ + public DocumentReferenceContentComponent(Attachment attachment) { + super(); + this.attachment = attachment; + } + + /** + * @return {@link #attachment} (The document or url of the document along with critical metadata to prove content has integrity.) + */ + public Attachment getAttachment() { + if (this.attachment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContentComponent.attachment"); + else if (Configuration.doAutoCreate()) + this.attachment = new Attachment(); // cc + return this.attachment; + } + + public boolean hasAttachment() { + return this.attachment != null && !this.attachment.isEmpty(); + } + + /** + * @param value {@link #attachment} (The document or url of the document along with critical metadata to prove content has integrity.) + */ + public DocumentReferenceContentComponent setAttachment(Attachment value) { + this.attachment = value; + return this; + } + + /** + * @return {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) + */ + public List getFormat() { + if (this.format == null) + this.format = new ArrayList(); + return this.format; + } + + public boolean hasFormat() { + if (this.format == null) + return false; + for (Coding item : this.format) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) + */ + // syntactic sugar + public Coding addFormat() { //3 + Coding t = new Coding(); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return t; + } + + // syntactic sugar + public DocumentReferenceContentComponent addFormat(Coding t) { //3 + if (t == null) + return this; + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("attachment", "Attachment", "The document or url of the document along with critical metadata to prove content has integrity.", 0, java.lang.Integer.MAX_VALUE, attachment)); + childrenList.add(new Property("format", "Coding", "An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.", 0, java.lang.Integer.MAX_VALUE, format)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1963501277: /*attachment*/ return this.attachment == null ? new Base[0] : new Base[] {this.attachment}; // Attachment + case -1268779017: /*format*/ return this.format == null ? new Base[0] : this.format.toArray(new Base[this.format.size()]); // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1963501277: // attachment + this.attachment = castToAttachment(value); // Attachment + break; + case -1268779017: // format + this.getFormat().add(castToCoding(value)); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("attachment")) + this.attachment = castToAttachment(value); // Attachment + else if (name.equals("format")) + this.getFormat().add(castToCoding(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1963501277: return getAttachment(); // Attachment + case -1268779017: return addFormat(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("attachment")) { + this.attachment = new Attachment(); + return this.attachment; + } + else if (name.equals("format")) { + return addFormat(); + } + else + return super.addChild(name); + } + + public DocumentReferenceContentComponent copy() { + DocumentReferenceContentComponent dst = new DocumentReferenceContentComponent(); + copyValues(dst); + dst.attachment = attachment == null ? null : attachment.copy(); + if (format != null) { + dst.format = new ArrayList(); + for (Coding i : format) + dst.format.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReferenceContentComponent)) + return false; + DocumentReferenceContentComponent o = (DocumentReferenceContentComponent) other; + return compareDeep(attachment, o.attachment, true) && compareDeep(format, o.format, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReferenceContentComponent)) + return false; + DocumentReferenceContentComponent o = (DocumentReferenceContentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (attachment == null || attachment.isEmpty()) && (format == null || format.isEmpty()) + ; + } + + public String fhirType() { + return "DocumentReference.content"; + + } + + } + + @Block() + public static class DocumentReferenceContextComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the clinical encounter or type of care that the document content is associated with. + */ + @Child(name = "encounter", type = {Encounter.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Context of the document content", formalDefinition="Describes the clinical encounter or type of care that the document content is associated with." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Describes the clinical encounter or type of care that the document content is associated with.) + */ + protected Encounter encounterTarget; + + /** + * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. + */ + @Child(name = "event", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Main Clinical Acts Documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act." ) + protected List event; + + /** + * The time period over which the service that is described by the document was provided. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time of service that is being documented", formalDefinition="The time period over which the service that is described by the document was provided." ) + protected Period period; + + /** + * The kind of facility where the patient was seen. + */ + @Child(name = "facilityType", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Kind of facility where patient was seen", formalDefinition="The kind of facility where the patient was seen." ) + protected CodeableConcept facilityType; + + /** + * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. + */ + @Child(name = "practiceSetting", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional details about where the content was created (e.g. clinical specialty)", formalDefinition="This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty." ) + protected CodeableConcept practiceSetting; + + /** + * The Patient Information as known when the document was published. May be a reference to a version specific, or contained. + */ + @Child(name = "sourcePatientInfo", type = {Patient.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient demographics from source", formalDefinition="The Patient Information as known when the document was published. May be a reference to a version specific, or contained." ) + protected Reference sourcePatientInfo; + + /** + * The actual object that is the target of the reference (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + protected Patient sourcePatientInfoTarget; + + /** + * Related identifiers or resources associated with the DocumentReference. + */ + @Child(name = "related", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Related identifiers or resources", formalDefinition="Related identifiers or resources associated with the DocumentReference." ) + protected List related; + + private static final long serialVersionUID = 994799273L; + + /** + * Constructor + */ + public DocumentReferenceContextComponent() { + super(); + } + + /** + * @return {@link #encounter} (Describes the clinical encounter or type of care that the document content is associated with.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (Describes the clinical encounter or type of care that the document content is associated with.) + */ + public DocumentReferenceContextComponent 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. (Describes the clinical encounter or type of care that the document content is associated with.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (Describes the clinical encounter or type of care that the document content is associated with.) + */ + public DocumentReferenceContextComponent setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (CodeableConcept item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + // syntactic sugar + public CodeableConcept addEvent() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + // syntactic sugar + public DocumentReferenceContextComponent addEvent(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + /** + * @return {@link #period} (The time period over which the service that is described by the document was provided.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The time period over which the service that is described by the document was provided.) + */ + public DocumentReferenceContextComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #facilityType} (The kind of facility where the patient was seen.) + */ + public CodeableConcept getFacilityType() { + if (this.facilityType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.facilityType"); + else if (Configuration.doAutoCreate()) + this.facilityType = new CodeableConcept(); // cc + return this.facilityType; + } + + public boolean hasFacilityType() { + return this.facilityType != null && !this.facilityType.isEmpty(); + } + + /** + * @param value {@link #facilityType} (The kind of facility where the patient was seen.) + */ + public DocumentReferenceContextComponent setFacilityType(CodeableConcept value) { + this.facilityType = value; + return this; + } + + /** + * @return {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.) + */ + public CodeableConcept getPracticeSetting() { + if (this.practiceSetting == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.practiceSetting"); + else if (Configuration.doAutoCreate()) + this.practiceSetting = new CodeableConcept(); // cc + return this.practiceSetting; + } + + public boolean hasPracticeSetting() { + return this.practiceSetting != null && !this.practiceSetting.isEmpty(); + } + + /** + * @param value {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.) + */ + public DocumentReferenceContextComponent setPracticeSetting(CodeableConcept value) { + this.practiceSetting = value; + return this; + } + + /** + * @return {@link #sourcePatientInfo} (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + public Reference getSourcePatientInfo() { + if (this.sourcePatientInfo == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.sourcePatientInfo"); + else if (Configuration.doAutoCreate()) + this.sourcePatientInfo = new Reference(); // cc + return this.sourcePatientInfo; + } + + public boolean hasSourcePatientInfo() { + return this.sourcePatientInfo != null && !this.sourcePatientInfo.isEmpty(); + } + + /** + * @param value {@link #sourcePatientInfo} (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + public DocumentReferenceContextComponent setSourcePatientInfo(Reference value) { + this.sourcePatientInfo = value; + return this; + } + + /** + * @return {@link #sourcePatientInfo} 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 Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + public Patient getSourcePatientInfoTarget() { + if (this.sourcePatientInfoTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.sourcePatientInfo"); + else if (Configuration.doAutoCreate()) + this.sourcePatientInfoTarget = new Patient(); // aa + return this.sourcePatientInfoTarget; + } + + /** + * @param value {@link #sourcePatientInfo} 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 Information as known when the document was published. May be a reference to a version specific, or contained.) + */ + public DocumentReferenceContextComponent setSourcePatientInfoTarget(Patient value) { + this.sourcePatientInfoTarget = value; + return this; + } + + /** + * @return {@link #related} (Related identifiers or resources associated with the DocumentReference.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (DocumentReferenceContextRelatedComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (Related identifiers or resources associated with the DocumentReference.) + */ + // syntactic sugar + public DocumentReferenceContextRelatedComponent addRelated() { //3 + DocumentReferenceContextRelatedComponent t = new DocumentReferenceContextRelatedComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + // syntactic sugar + public DocumentReferenceContextComponent addRelated(DocumentReferenceContextRelatedComponent t) { //3 + if (t == null) + return this; + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care that the document content is associated with.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("event", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("period", "Period", "The time period over which the service that is described by the document was provided.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("facilityType", "CodeableConcept", "The kind of facility where the patient was seen.", 0, java.lang.Integer.MAX_VALUE, facilityType)); + childrenList.add(new Property("practiceSetting", "CodeableConcept", "This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.", 0, java.lang.Integer.MAX_VALUE, practiceSetting)); + childrenList.add(new Property("sourcePatientInfo", "Reference(Patient)", "The Patient Information as known when the document was published. May be a reference to a version specific, or contained.", 0, java.lang.Integer.MAX_VALUE, sourcePatientInfo)); + childrenList.add(new Property("related", "", "Related identifiers or resources associated with the DocumentReference.", 0, java.lang.Integer.MAX_VALUE, related)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // CodeableConcept + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 370698365: /*facilityType*/ return this.facilityType == null ? new Base[0] : new Base[] {this.facilityType}; // CodeableConcept + case 331373717: /*practiceSetting*/ return this.practiceSetting == null ? new Base[0] : new Base[] {this.practiceSetting}; // CodeableConcept + case 2031381048: /*sourcePatientInfo*/ return this.sourcePatientInfo == null ? new Base[0] : new Base[] {this.sourcePatientInfo}; // Reference + case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // DocumentReferenceContextRelatedComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 96891546: // event + this.getEvent().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case 370698365: // facilityType + this.facilityType = castToCodeableConcept(value); // CodeableConcept + break; + case 331373717: // practiceSetting + this.practiceSetting = castToCodeableConcept(value); // CodeableConcept + break; + case 2031381048: // sourcePatientInfo + this.sourcePatientInfo = castToReference(value); // Reference + break; + case 1090493483: // related + this.getRelated().add((DocumentReferenceContextRelatedComponent) value); // DocumentReferenceContextRelatedComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("event")) + this.getEvent().add(castToCodeableConcept(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("facilityType")) + this.facilityType = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("practiceSetting")) + this.practiceSetting = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("sourcePatientInfo")) + this.sourcePatientInfo = castToReference(value); // Reference + else if (name.equals("related")) + this.getRelated().add((DocumentReferenceContextRelatedComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1524132147: return getEncounter(); // Reference + case 96891546: return addEvent(); // CodeableConcept + case -991726143: return getPeriod(); // Period + case 370698365: return getFacilityType(); // CodeableConcept + case 331373717: return getPracticeSetting(); // CodeableConcept + case 2031381048: return getSourcePatientInfo(); // Reference + case 1090493483: return addRelated(); // DocumentReferenceContextRelatedComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("event")) { + return addEvent(); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("facilityType")) { + this.facilityType = new CodeableConcept(); + return this.facilityType; + } + else if (name.equals("practiceSetting")) { + this.practiceSetting = new CodeableConcept(); + return this.practiceSetting; + } + else if (name.equals("sourcePatientInfo")) { + this.sourcePatientInfo = new Reference(); + return this.sourcePatientInfo; + } + else if (name.equals("related")) { + return addRelated(); + } + else + return super.addChild(name); + } + + public DocumentReferenceContextComponent copy() { + DocumentReferenceContextComponent dst = new DocumentReferenceContextComponent(); + copyValues(dst); + dst.encounter = encounter == null ? null : encounter.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (CodeableConcept i : event) + dst.event.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.facilityType = facilityType == null ? null : facilityType.copy(); + dst.practiceSetting = practiceSetting == null ? null : practiceSetting.copy(); + dst.sourcePatientInfo = sourcePatientInfo == null ? null : sourcePatientInfo.copy(); + if (related != null) { + dst.related = new ArrayList(); + for (DocumentReferenceContextRelatedComponent i : related) + dst.related.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReferenceContextComponent)) + return false; + DocumentReferenceContextComponent o = (DocumentReferenceContextComponent) other; + return compareDeep(encounter, o.encounter, true) && compareDeep(event, o.event, true) && compareDeep(period, o.period, true) + && compareDeep(facilityType, o.facilityType, true) && compareDeep(practiceSetting, o.practiceSetting, true) + && compareDeep(sourcePatientInfo, o.sourcePatientInfo, true) && compareDeep(related, o.related, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReferenceContextComponent)) + return false; + DocumentReferenceContextComponent o = (DocumentReferenceContextComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (encounter == null || encounter.isEmpty()) && (event == null || event.isEmpty()) + && (period == null || period.isEmpty()) && (facilityType == null || facilityType.isEmpty()) + && (practiceSetting == null || practiceSetting.isEmpty()) && (sourcePatientInfo == null || sourcePatientInfo.isEmpty()) + && (related == null || related.isEmpty()); + } + + public String fhirType() { + return "DocumentReference.context"; + + } + + } + + @Block() + public static class DocumentReferenceContextRelatedComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier of related objects or events", formalDefinition="Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing." ) + protected Identifier identifier; + + /** + * Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing. + */ + @Child(name = "ref", type = {}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Related Resource", formalDefinition="Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing." ) + protected Reference ref; + + /** + * The actual object that is the target of the reference (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + protected Resource refTarget; + + private static final long serialVersionUID = -1670123330L; + + /** + * Constructor + */ + public DocumentReferenceContextRelatedComponent() { + super(); + } + + /** + * @return {@link #identifier} (Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextRelatedComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentReferenceContextRelatedComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #ref} (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public Reference getRef() { + if (this.ref == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextRelatedComponent.ref"); + else if (Configuration.doAutoCreate()) + this.ref = new Reference(); // cc + return this.ref; + } + + public boolean hasRef() { + return this.ref != null && !this.ref.isEmpty(); + } + + /** + * @param value {@link #ref} (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentReferenceContextRelatedComponent setRef(Reference value) { + this.ref = value; + return this; + } + + /** + * @return {@link #ref} 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. (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public Resource getRefTarget() { + return this.refTarget; + } + + /** + * @param value {@link #ref} 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. (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) + */ + public DocumentReferenceContextRelatedComponent setRefTarget(Resource value) { + this.refTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ref", "Reference(Any)", "Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, ref)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 112787: /*ref*/ return this.ref == null ? new Base[0] : new Base[] {this.ref}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 112787: // ref + this.ref = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("ref")) + this.ref = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 112787: return getRef(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("ref")) { + this.ref = new Reference(); + return this.ref; + } + else + return super.addChild(name); + } + + public DocumentReferenceContextRelatedComponent copy() { + DocumentReferenceContextRelatedComponent dst = new DocumentReferenceContextRelatedComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.ref = ref == null ? null : ref.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReferenceContextRelatedComponent)) + return false; + DocumentReferenceContextRelatedComponent o = (DocumentReferenceContextRelatedComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ref, o.ref, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReferenceContextRelatedComponent)) + return false; + DocumentReferenceContextRelatedComponent o = (DocumentReferenceContextRelatedComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ref == null || ref.isEmpty()) + ; + } + + public String fhirType() { + return "DocumentReference.context.related"; + + } + + } + + /** + * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. + */ + @Child(name = "masterIdentifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Master Version Specific Identifier", formalDefinition="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document." ) + protected Identifier masterIdentifier; + + /** + * Other identifiers associated with the document, including version independent identifiers. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Other identifiers for the document", formalDefinition="Other identifiers associated with the document, including version independent identifiers." ) + protected List identifier; + + /** + * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). + */ + @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who/what is the subject of the document", formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + protected Resource subjectTarget; + + /** + * Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Kind of document (LOINC if possible)", formalDefinition="Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced." ) + protected CodeableConcept type; + + /** + * A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type. + */ + @Child(name = "class", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Categorization of document", formalDefinition="A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type." ) + protected CodeableConcept class_; + + /** + * Identifies who is responsible for adding the information to the document. + */ + @Child(name = "author", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) + */ + protected List authorTarget; + + + /** + * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. + */ + @Child(name = "custodian", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization which maintains the document", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document." ) + protected Reference custodian; + + /** + * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + protected Organization custodianTarget; + + /** + * Which person or organization authenticates that this document is valid. + */ + @Child(name = "authenticator", type = {Practitioner.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who/what authenticated the document", formalDefinition="Which person or organization authenticates that this document is valid." ) + protected Reference authenticator; + + /** + * The actual object that is the target of the reference (Which person or organization authenticates that this document is valid.) + */ + protected Resource authenticatorTarget; + + /** + * When the document was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Document creation time", formalDefinition="When the document was created." ) + protected DateTimeType created; + + /** + * When the document reference was created. + */ + @Child(name = "indexed", type = {InstantType.class}, order=9, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="When this document reference created", formalDefinition="When the document reference was created." ) + protected InstantType indexed; + + /** + * The status of this document reference. + */ + @Child(name = "status", type = {CodeType.class}, order=10, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="current | superseded | entered-in-error", formalDefinition="The status of this document reference." ) + protected Enumeration status; + + /** + * The status of the underlying document. + */ + @Child(name = "docStatus", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="preliminary | final | appended | amended | entered-in-error", formalDefinition="The status of the underlying document." ) + protected CodeableConcept docStatus; + + /** + * Relationships that this document has with other document references that already exist. + */ + @Child(name = "relatesTo", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) + @Description(shortDefinition="Relationships to other documents", formalDefinition="Relationships that this document has with other document references that already exist." ) + protected List relatesTo; + + /** + * Human-readable description of the source document. This is sometimes known as the "title". + */ + @Child(name = "description", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the \"title\"." ) + protected StringType description; + + /** + * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to. + */ + @Child(name = "securityLabel", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Document security-tags", formalDefinition="A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \"reference\" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to." ) + protected List securityLabel; + + /** + * The document and format referenced. There may be multiple content element repetitions, each with a different format. + */ + @Child(name = "content", type = {}, order=15, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Document referenced", formalDefinition="The document and format referenced. There may be multiple content element repetitions, each with a different format." ) + protected List content; + + /** + * The clinical context in which the document was prepared. + */ + @Child(name = "context", type = {}, order=16, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Clinical context of document", formalDefinition="The clinical context in which the document was prepared." ) + protected DocumentReferenceContextComponent context; + + private static final long serialVersionUID = -1009325322L; + + /** + * Constructor + */ + public DocumentReference() { + super(); + } + + /** + * Constructor + */ + public DocumentReference(CodeableConcept type, InstantType indexed, Enumeration status) { + super(); + this.type = type; + this.indexed = indexed; + this.status = status; + } + + /** + * @return {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) + */ + public Identifier getMasterIdentifier() { + if (this.masterIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.masterIdentifier"); + else if (Configuration.doAutoCreate()) + this.masterIdentifier = new Identifier(); // cc + return this.masterIdentifier; + } + + public boolean hasMasterIdentifier() { + return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); + } + + /** + * @param value {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) + */ + public DocumentReference setMasterIdentifier(Identifier value) { + this.masterIdentifier = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers associated with the document, including version independent identifiers.) + */ + 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} (Other identifiers associated with the document, including version independent identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public DocumentReference 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. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public Resource getSubjectTarget() { + 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. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public DocumentReference setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #type} (Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.) + */ + public DocumentReference setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #class_} (A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.) + */ + public CodeableConcept getClass_() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new CodeableConcept(); // cc + return this.class_; + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.) + */ + public DocumentReference setClass_(CodeableConcept value) { + this.class_ = value; + return this; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addAuthor(Reference t) { //3 + if (t == null) + return this; + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return this; + } + + /** + * @return {@link #author} (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 is responsible for adding the information to the document.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public Reference getCustodian() { + if (this.custodian == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.custodian"); + else if (Configuration.doAutoCreate()) + this.custodian = new Reference(); // cc + return this.custodian; + } + + public boolean hasCustodian() { + return this.custodian != null && !this.custodian.isEmpty(); + } + + /** + * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public DocumentReference setCustodian(Reference value) { + this.custodian = value; + return this; + } + + /** + * @return {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public Organization getCustodianTarget() { + if (this.custodianTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.custodian"); + else if (Configuration.doAutoCreate()) + this.custodianTarget = new Organization(); // aa + return this.custodianTarget; + } + + /** + * @param value {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public DocumentReference setCustodianTarget(Organization value) { + this.custodianTarget = value; + return this; + } + + /** + * @return {@link #authenticator} (Which person or organization authenticates that this document is valid.) + */ + public Reference getAuthenticator() { + if (this.authenticator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.authenticator"); + else if (Configuration.doAutoCreate()) + this.authenticator = new Reference(); // cc + return this.authenticator; + } + + public boolean hasAuthenticator() { + return this.authenticator != null && !this.authenticator.isEmpty(); + } + + /** + * @param value {@link #authenticator} (Which person or organization authenticates that this document is valid.) + */ + public DocumentReference setAuthenticator(Reference value) { + this.authenticator = value; + return this; + } + + /** + * @return {@link #authenticator} 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. (Which person or organization authenticates that this document is valid.) + */ + public Resource getAuthenticatorTarget() { + return this.authenticatorTarget; + } + + /** + * @param value {@link #authenticator} 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. (Which person or organization authenticates that this document is valid.) + */ + public DocumentReference setAuthenticatorTarget(Resource value) { + this.authenticatorTarget = value; + return this; + } + + /** + * @return {@link #created} (When the document was created.). 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 DocumentReference.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DocumentReference setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return When the document was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value When the document was created. + */ + public DocumentReference 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 #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value + */ + public InstantType getIndexedElement() { + if (this.indexed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.indexed"); + else if (Configuration.doAutoCreate()) + this.indexed = new InstantType(); // bb + return this.indexed; + } + + public boolean hasIndexedElement() { + return this.indexed != null && !this.indexed.isEmpty(); + } + + public boolean hasIndexed() { + return this.indexed != null && !this.indexed.isEmpty(); + } + + /** + * @param value {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value + */ + public DocumentReference setIndexedElement(InstantType value) { + this.indexed = value; + return this; + } + + /** + * @return When the document reference was created. + */ + public Date getIndexed() { + return this.indexed == null ? null : this.indexed.getValue(); + } + + /** + * @param value When the document reference was created. + */ + public DocumentReference setIndexed(Date value) { + if (this.indexed == null) + this.indexed = new InstantType(); + this.indexed.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of this document reference.). 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 DocumentReference.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); // bb + 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 this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DocumentReference setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this document reference. + */ + public DocumentReferenceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this document reference. + */ + public DocumentReference setStatus(DocumentReferenceStatus value) { + if (this.status == null) + this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #docStatus} (The status of the underlying document.) + */ + public CodeableConcept getDocStatus() { + if (this.docStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.docStatus"); + else if (Configuration.doAutoCreate()) + this.docStatus = new CodeableConcept(); // cc + return this.docStatus; + } + + public boolean hasDocStatus() { + return this.docStatus != null && !this.docStatus.isEmpty(); + } + + /** + * @param value {@link #docStatus} (The status of the underlying document.) + */ + public DocumentReference setDocStatus(CodeableConcept value) { + this.docStatus = value; + return this; + } + + /** + * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) + */ + public List getRelatesTo() { + if (this.relatesTo == null) + this.relatesTo = new ArrayList(); + return this.relatesTo; + } + + public boolean hasRelatesTo() { + if (this.relatesTo == null) + return false; + for (DocumentReferenceRelatesToComponent item : this.relatesTo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) + */ + // syntactic sugar + public DocumentReferenceRelatesToComponent addRelatesTo() { //3 + DocumentReferenceRelatesToComponent t = new DocumentReferenceRelatesToComponent(); + if (this.relatesTo == null) + this.relatesTo = new ArrayList(); + this.relatesTo.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addRelatesTo(DocumentReferenceRelatesToComponent t) { //3 + if (t == null) + return this; + if (this.relatesTo == null) + this.relatesTo = new ArrayList(); + this.relatesTo.add(t); + return this; + } + + /** + * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). 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 DocumentReference.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public DocumentReference setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of the source document. This is sometimes known as the "title". + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of the source document. This is sometimes known as the "title". + */ + public DocumentReference 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 #securityLabel} (A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.) + */ + public List getSecurityLabel() { + if (this.securityLabel == null) + this.securityLabel = new ArrayList(); + return this.securityLabel; + } + + public boolean hasSecurityLabel() { + if (this.securityLabel == null) + return false; + for (CodeableConcept item : this.securityLabel) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #securityLabel} (A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.) + */ + // syntactic sugar + public CodeableConcept addSecurityLabel() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.securityLabel == null) + this.securityLabel = new ArrayList(); + this.securityLabel.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addSecurityLabel(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.securityLabel == null) + this.securityLabel = new ArrayList(); + this.securityLabel.add(t); + return this; + } + + /** + * @return {@link #content} (The document and format referenced. There may be multiple content element repetitions, each with a different format.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (DocumentReferenceContentComponent item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (The document and format referenced. There may be multiple content element repetitions, each with a different format.) + */ + // syntactic sugar + public DocumentReferenceContentComponent addContent() { //3 + DocumentReferenceContentComponent t = new DocumentReferenceContentComponent(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + // syntactic sugar + public DocumentReference addContent(DocumentReferenceContentComponent t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; + } + + /** + * @return {@link #context} (The clinical context in which the document was prepared.) + */ + public DocumentReferenceContextComponent getContext() { + if (this.context == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.context"); + else if (Configuration.doAutoCreate()) + this.context = new DocumentReferenceContextComponent(); // cc + return this.context; + } + + public boolean hasContext() { + return this.context != null && !this.context.isEmpty(); + } + + /** + * @param value {@link #context} (The clinical context in which the document was prepared.) + */ + public DocumentReference setContext(DocumentReferenceContextComponent value) { + this.context = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("masterIdentifier", "Identifier", "Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("author", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.", 0, java.lang.Integer.MAX_VALUE, custodian)); + childrenList.add(new Property("authenticator", "Reference(Practitioner|Organization)", "Which person or organization authenticates that this document is valid.", 0, java.lang.Integer.MAX_VALUE, authenticator)); + childrenList.add(new Property("created", "dateTime", "When the document was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("indexed", "instant", "When the document reference was created.", 0, java.lang.Integer.MAX_VALUE, indexed)); + childrenList.add(new Property("status", "code", "The status of this document reference.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("docStatus", "CodeableConcept", "The status of the underlying document.", 0, java.lang.Integer.MAX_VALUE, docStatus)); + childrenList.add(new Property("relatesTo", "", "Relationships that this document has with other document references that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo)); + childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the \"title\".", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("securityLabel", "CodeableConcept", "A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \"reference\" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.", 0, java.lang.Integer.MAX_VALUE, securityLabel)); + childrenList.add(new Property("content", "", "The document and format referenced. There may be multiple content element repetitions, each with a different format.", 0, java.lang.Integer.MAX_VALUE, content)); + childrenList.add(new Property("context", "", "The clinical context in which the document was prepared.", 0, java.lang.Integer.MAX_VALUE, context)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 243769515: /*masterIdentifier*/ return this.masterIdentifier == null ? new Base[0] : new Base[] {this.masterIdentifier}; // Identifier + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // CodeableConcept + case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference + case 1611297262: /*custodian*/ return this.custodian == null ? new Base[0] : new Base[] {this.custodian}; // Reference + case 1815000435: /*authenticator*/ return this.authenticator == null ? new Base[0] : new Base[] {this.authenticator}; // Reference + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 1943292145: /*indexed*/ return this.indexed == null ? new Base[0] : new Base[] {this.indexed}; // InstantType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -23496886: /*docStatus*/ return this.docStatus == null ? new Base[0] : new Base[] {this.docStatus}; // CodeableConcept + case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // DocumentReferenceRelatesToComponent + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // CodeableConcept + case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // DocumentReferenceContentComponent + case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // DocumentReferenceContextComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 243769515: // masterIdentifier + this.masterIdentifier = castToIdentifier(value); // Identifier + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case 94742904: // class + this.class_ = castToCodeableConcept(value); // CodeableConcept + break; + case -1406328437: // author + this.getAuthor().add(castToReference(value)); // Reference + break; + case 1611297262: // custodian + this.custodian = castToReference(value); // Reference + break; + case 1815000435: // authenticator + this.authenticator = castToReference(value); // Reference + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case 1943292145: // indexed + this.indexed = castToInstant(value); // InstantType + break; + case -892481550: // status + this.status = new DocumentReferenceStatusEnumFactory().fromType(value); // Enumeration + break; + case -23496886: // docStatus + this.docStatus = castToCodeableConcept(value); // CodeableConcept + break; + case -7765931: // relatesTo + this.getRelatesTo().add((DocumentReferenceRelatesToComponent) value); // DocumentReferenceRelatesToComponent + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -722296940: // securityLabel + this.getSecurityLabel().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 951530617: // content + this.getContent().add((DocumentReferenceContentComponent) value); // DocumentReferenceContentComponent + break; + case 951530927: // context + this.context = (DocumentReferenceContextComponent) value; // DocumentReferenceContextComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("masterIdentifier")) + this.masterIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("class")) + this.class_ = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("author")) + this.getAuthor().add(castToReference(value)); + else if (name.equals("custodian")) + this.custodian = castToReference(value); // Reference + else if (name.equals("authenticator")) + this.authenticator = castToReference(value); // Reference + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("indexed")) + this.indexed = castToInstant(value); // InstantType + else if (name.equals("status")) + this.status = new DocumentReferenceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("docStatus")) + this.docStatus = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("relatesTo")) + this.getRelatesTo().add((DocumentReferenceRelatesToComponent) value); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("securityLabel")) + this.getSecurityLabel().add(castToCodeableConcept(value)); + else if (name.equals("content")) + this.getContent().add((DocumentReferenceContentComponent) value); + else if (name.equals("context")) + this.context = (DocumentReferenceContextComponent) value; // DocumentReferenceContextComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 243769515: return getMasterIdentifier(); // Identifier + case -1618432855: return addIdentifier(); // Identifier + case -1867885268: return getSubject(); // Reference + case 3575610: return getType(); // CodeableConcept + case 94742904: return getClass_(); // CodeableConcept + case -1406328437: return addAuthor(); // Reference + case 1611297262: return getCustodian(); // Reference + case 1815000435: return getAuthenticator(); // Reference + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 1943292145: throw new FHIRException("Cannot make property indexed as it is not a complex type"); // InstantType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -23496886: return getDocStatus(); // CodeableConcept + case -7765931: return addRelatesTo(); // DocumentReferenceRelatesToComponent + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -722296940: return addSecurityLabel(); // CodeableConcept + case 951530617: return addContent(); // DocumentReferenceContentComponent + case 951530927: return getContext(); // DocumentReferenceContextComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("masterIdentifier")) { + this.masterIdentifier = new Identifier(); + return this.masterIdentifier; + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("class")) { + this.class_ = new CodeableConcept(); + return this.class_; + } + else if (name.equals("author")) { + return addAuthor(); + } + else if (name.equals("custodian")) { + this.custodian = new Reference(); + return this.custodian; + } + else if (name.equals("authenticator")) { + this.authenticator = new Reference(); + return this.authenticator; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.created"); + } + else if (name.equals("indexed")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.indexed"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.status"); + } + else if (name.equals("docStatus")) { + this.docStatus = new CodeableConcept(); + return this.docStatus; + } + else if (name.equals("relatesTo")) { + return addRelatesTo(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.description"); + } + else if (name.equals("securityLabel")) { + return addSecurityLabel(); + } + else if (name.equals("content")) { + return addContent(); + } + else if (name.equals("context")) { + this.context = new DocumentReferenceContextComponent(); + return this.context; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DocumentReference"; + + } + + public DocumentReference copy() { + DocumentReference dst = new DocumentReference(); + copyValues(dst); + dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.type = type == null ? null : type.copy(); + dst.class_ = class_ == null ? null : class_.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + dst.custodian = custodian == null ? null : custodian.copy(); + dst.authenticator = authenticator == null ? null : authenticator.copy(); + dst.created = created == null ? null : created.copy(); + dst.indexed = indexed == null ? null : indexed.copy(); + dst.status = status == null ? null : status.copy(); + dst.docStatus = docStatus == null ? null : docStatus.copy(); + if (relatesTo != null) { + dst.relatesTo = new ArrayList(); + for (DocumentReferenceRelatesToComponent i : relatesTo) + dst.relatesTo.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (securityLabel != null) { + dst.securityLabel = new ArrayList(); + for (CodeableConcept i : securityLabel) + dst.securityLabel.add(i.copy()); + }; + if (content != null) { + dst.content = new ArrayList(); + for (DocumentReferenceContentComponent i : content) + dst.content.add(i.copy()); + }; + dst.context = context == null ? null : context.copy(); + return dst; + } + + protected DocumentReference typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DocumentReference)) + return false; + DocumentReference o = (DocumentReference) other; + return compareDeep(masterIdentifier, o.masterIdentifier, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(subject, o.subject, true) && compareDeep(type, o.type, true) && compareDeep(class_, o.class_, true) + && compareDeep(author, o.author, true) && compareDeep(custodian, o.custodian, true) && compareDeep(authenticator, o.authenticator, true) + && compareDeep(created, o.created, true) && compareDeep(indexed, o.indexed, true) && compareDeep(status, o.status, true) + && compareDeep(docStatus, o.docStatus, true) && compareDeep(relatesTo, o.relatesTo, true) && compareDeep(description, o.description, true) + && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(content, o.content, true) && compareDeep(context, o.context, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DocumentReference)) + return false; + DocumentReference o = (DocumentReference) other; + return compareValues(created, o.created, true) && compareValues(indexed, o.indexed, true) && compareValues(status, o.status, true) + && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (subject == null || subject.isEmpty()) && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) + && (author == null || author.isEmpty()) && (custodian == null || custodian.isEmpty()) && (authenticator == null || authenticator.isEmpty()) + && (created == null || created.isEmpty()) && (indexed == null || indexed.isEmpty()) && (status == null || status.isEmpty()) + && (docStatus == null || docStatus.isEmpty()) && (relatesTo == null || relatesTo.isEmpty()) + && (description == null || description.isEmpty()) && (securityLabel == null || securityLabel.isEmpty()) + && (content == null || content.isEmpty()) && (context == null || context.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DocumentReference; + } + + /** + * Search parameter: related-ref + *

+ * Description: Related Resource
+ * Type: reference
+ * Path: DocumentReference.context.related.ref
+ *

+ */ + @SearchParamDefinition(name="related-ref", path="DocumentReference.context.related.ref", description="Related Resource", type="reference" ) + public static final String SP_RELATED_REF = "related-ref"; + /** + * Fluent Client search parameter constant for related-ref + *

+ * Description: Related Resource
+ * Type: reference
+ * Path: DocumentReference.context.related.ref
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATED_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATED_REF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentReference:related-ref". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATED_REF = new ca.uhn.fhir.model.api.Include("DocumentReference:related-ref").toLocked(); + + /** + * Search parameter: related-id + *

+ * Description: Identifier of related objects or events
+ * Type: token
+ * Path: DocumentReference.context.related.identifier
+ *

+ */ + @SearchParamDefinition(name="related-id", path="DocumentReference.context.related.identifier", description="Identifier of related objects or events", type="token" ) + public static final String SP_RELATED_ID = "related-id"; + /** + * Fluent Client search parameter constant for related-id + *

+ * Description: Identifier of related objects or events
+ * Type: token
+ * Path: DocumentReference.context.related.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATED_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATED_ID); + + /** + * Search parameter: indexed + *

+ * Description: When this document reference created
+ * Type: date
+ * Path: DocumentReference.indexed
+ *

+ */ + @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="When this document reference created", type="date" ) + public static final String SP_INDEXED = "indexed"; + /** + * Fluent Client search parameter constant for indexed + *

+ * Description: When this document reference created
+ * Type: date
+ * Path: DocumentReference.indexed
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam INDEXED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_INDEXED); + + /** + * Search parameter: location + *

+ * Description: Uri where the data can be found
+ * Type: uri
+ * Path: DocumentReference.content.attachment.url
+ *

+ */ + @SearchParamDefinition(name="location", path="DocumentReference.content.attachment.url", description="Uri where the data can be found", type="uri" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: Uri where the data can be found
+ * Type: uri
+ * Path: DocumentReference.content.attachment.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam LOCATION = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_LOCATION); + + /** + * Search parameter: relatesto + *

+ * Description: Target of the relationship
+ * Type: reference
+ * Path: DocumentReference.relatesTo.target
+ *

+ */ + @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="Target of the relationship", type="reference" ) + public static final String SP_RELATESTO = "relatesto"; + /** + * Fluent Client search parameter constant for relatesto + *

+ * Description: Target of the relationship
+ * Type: reference
+ * Path: DocumentReference.relatesTo.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATESTO = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATESTO); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentReference:relatesto". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATESTO = new ca.uhn.fhir.model.api.Include("DocumentReference:relatesto").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: Who/what is the subject of the document
+ * Type: reference
+ * Path: DocumentReference.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="Who/what is the subject of the document", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Who/what is the subject of the document
+ * Type: reference
+ * Path: DocumentReference.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentReference:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DocumentReference:subject").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Context of the document content
+ * Type: reference
+ * Path: DocumentReference.context.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="DocumentReference.context.encounter", description="Context of the document content", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Context of the document content
+ * Type: reference
+ * Path: DocumentReference.context.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentReference:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DocumentReference:encounter").toLocked(); + + /** + * Search parameter: type + *

+ * Description: Kind of document (LOINC if possible)
+ * Type: token
+ * Path: DocumentReference.type
+ *

+ */ + @SearchParamDefinition(name="type", path="DocumentReference.type", description="Kind of document (LOINC if possible)", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Kind of document (LOINC if possible)
+ * Type: token
+ * Path: DocumentReference.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: securitylabel + *

+ * Description: Document security-tags
+ * Type: token
+ * Path: DocumentReference.securityLabel
+ *

+ */ + @SearchParamDefinition(name="securitylabel", path="DocumentReference.securityLabel", description="Document security-tags", type="token" ) + public static final String SP_SECURITYLABEL = "securitylabel"; + /** + * Fluent Client search parameter constant for securitylabel + *

+ * Description: Document security-tags
+ * Type: token
+ * Path: DocumentReference.securityLabel
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITYLABEL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITYLABEL); + + /** + * Search parameter: setting + *

+ * Description: Additional details about where the content was created (e.g. clinical specialty)
+ * Type: token
+ * Path: DocumentReference.context.practiceSetting
+ *

+ */ + @SearchParamDefinition(name="setting", path="DocumentReference.context.practiceSetting", description="Additional details about where the content was created (e.g. clinical specialty)", type="token" ) + public static final String SP_SETTING = "setting"; + /** + * Fluent Client search parameter constant for setting + *

+ * Description: Additional details about where the content was created (e.g. clinical specialty)
+ * Type: token
+ * Path: DocumentReference.context.practiceSetting
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SETTING = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SETTING); + + /** + * Search parameter: author + *

+ * Description: Who and/or what authored the document
+ * Type: reference
+ * Path: DocumentReference.author
+ *

+ */ + @SearchParamDefinition(name="author", path="DocumentReference.author", description="Who and/or what authored the document", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: Who and/or what authored the document
+ * Type: reference
+ * Path: DocumentReference.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentReference:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("DocumentReference:author").toLocked(); + + /** + * Search parameter: custodian + *

+ * Description: Organization which maintains the document
+ * Type: reference
+ * Path: DocumentReference.custodian
+ *

+ */ + @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="Organization which maintains the document", type="reference" ) + public static final String SP_CUSTODIAN = "custodian"; + /** + * Fluent Client search parameter constant for custodian + *

+ * Description: Organization which maintains the document
+ * Type: reference
+ * Path: DocumentReference.custodian
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CUSTODIAN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CUSTODIAN); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentReference:custodian". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CUSTODIAN = new ca.uhn.fhir.model.api.Include("DocumentReference:custodian").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: Who/what is the subject of the document
+ * Type: reference
+ * Path: DocumentReference.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="DocumentReference.subject", description="Who/what is the subject of the document", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who/what is the subject of the document
+ * Type: reference
+ * Path: DocumentReference.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentReference:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DocumentReference:patient").toLocked(); + + /** + * Search parameter: facility + *

+ * Description: Kind of facility where patient was seen
+ * Type: token
+ * Path: DocumentReference.context.facilityType
+ *

+ */ + @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="Kind of facility where patient was seen", type="token" ) + public static final String SP_FACILITY = "facility"; + /** + * Fluent Client search parameter constant for facility + *

+ * Description: Kind of facility where patient was seen
+ * Type: token
+ * Path: DocumentReference.context.facilityType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITY); + + /** + * Search parameter: created + *

+ * Description: Document creation time
+ * Type: date
+ * Path: DocumentReference.created
+ *

+ */ + @SearchParamDefinition(name="created", path="DocumentReference.created", description="Document creation time", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: Document creation time
+ * Type: date
+ * Path: DocumentReference.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: description + *

+ * Description: Human-readable description (title)
+ * Type: string
+ * Path: DocumentReference.description
+ *

+ */ + @SearchParamDefinition(name="description", path="DocumentReference.description", description="Human-readable description (title)", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Human-readable description (title)
+ * Type: string
+ * Path: DocumentReference.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: event + *

+ * Description: Main Clinical Acts Documented
+ * Type: token
+ * Path: DocumentReference.context.event
+ *

+ */ + @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="Main Clinical Acts Documented", type="token" ) + public static final String SP_EVENT = "event"; + /** + * Fluent Client search parameter constant for event + *

+ * Description: Main Clinical Acts Documented
+ * Type: token
+ * Path: DocumentReference.context.event
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT); + + /** + * Search parameter: status + *

+ * Description: current | superseded | entered-in-error
+ * Type: token
+ * Path: DocumentReference.status
+ *

+ */ + @SearchParamDefinition(name="status", path="DocumentReference.status", description="current | superseded | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: current | superseded | entered-in-error
+ * Type: token
+ * Path: DocumentReference.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: relation + *

+ * Description: replaces | transforms | signs | appends
+ * Type: token
+ * Path: DocumentReference.relatesTo.code
+ *

+ */ + @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="replaces | transforms | signs | appends", type="token" ) + public static final String SP_RELATION = "relation"; + /** + * Fluent Client search parameter constant for relation + *

+ * Description: replaces | transforms | signs | appends
+ * Type: token
+ * Path: DocumentReference.relatesTo.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATION); + + /** + * Search parameter: class + *

+ * Description: Categorization of document
+ * Type: token
+ * Path: DocumentReference.class
+ *

+ */ + @SearchParamDefinition(name="class", path="DocumentReference.class", description="Categorization of document", type="token" ) + public static final String SP_CLASS = "class"; + /** + * Fluent Client search parameter constant for class + *

+ * Description: Categorization of document
+ * Type: token
+ * Path: DocumentReference.class
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASS); + + /** + * Search parameter: format + *

+ * Description: Format/content rules for the document
+ * Type: token
+ * Path: DocumentReference.content.format
+ *

+ */ + @SearchParamDefinition(name="format", path="DocumentReference.content.format", description="Format/content rules for the document", type="token" ) + public static final String SP_FORMAT = "format"; + /** + * Fluent Client search parameter constant for format + *

+ * Description: Format/content rules for the document
+ * Type: token
+ * Path: DocumentReference.content.format
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMAT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMAT); + + /** + * Search parameter: period + *

+ * Description: Time of service that is being documented
+ * Type: date
+ * Path: DocumentReference.context.period
+ *

+ */ + @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="Time of service that is being documented", type="date" ) + public static final String SP_PERIOD = "period"; + /** + * Fluent Client search parameter constant for period + *

+ * Description: Time of service that is being documented
+ * Type: date
+ * Path: DocumentReference.context.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); + + /** + * Search parameter: authenticator + *

+ * Description: Who/what authenticated the document
+ * Type: reference
+ * Path: DocumentReference.authenticator
+ *

+ */ + @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="Who/what authenticated the document", type="reference" ) + public static final String SP_AUTHENTICATOR = "authenticator"; + /** + * Fluent Client search parameter constant for authenticator + *

+ * Description: Who/what authenticated the document
+ * Type: reference
+ * Path: DocumentReference.authenticator
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHENTICATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHENTICATOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "DocumentReference:authenticator". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHENTICATOR = new ca.uhn.fhir.model.api.Include("DocumentReference:authenticator").toLocked(); + + /** + * Search parameter: relationship + *

+ * Description: Combination of relation and relatesTo
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="relationship", path="", description="Combination of relation and relatesTo", type="composite", compositeOf={"relatesto", "relation"} ) + public static final String SP_RELATIONSHIP = "relationship"; + /** + * Fluent Client search parameter constant for relationship + *

+ * Description: Combination of relation and relatesTo
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam RELATIONSHIP = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_RELATIONSHIP); + + /** + * Search parameter: language + *

+ * Description: Human language of the content (BCP-47)
+ * Type: token
+ * Path: DocumentReference.content.attachment.language
+ *

+ */ + @SearchParamDefinition(name="language", path="DocumentReference.content.attachment.language", description="Human language of the content (BCP-47)", type="token" ) + public static final String SP_LANGUAGE = "language"; + /** + * Fluent Client search parameter constant for language + *

+ * Description: Human language of the content (BCP-47)
+ * Type: token
+ * Path: DocumentReference.content.attachment.language
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE); + + /** + * Search parameter: identifier + *

+ * Description: Master Version Specific Identifier
+ * Type: token
+ * Path: DocumentReference.masterIdentifier, DocumentReference.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier | DocumentReference.identifier", description="Master Version Specific Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Master Version Specific Identifier
+ * Type: token
+ * Path: DocumentReference.masterIdentifier, DocumentReference.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DomainResource.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DomainResource.java new file mode 100644 index 00000000000..f2794e50265 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/DomainResource.java @@ -0,0 +1,390 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseHasExtensions; +import org.hl7.fhir.instance.model.api.IBaseHasModifierExtensions; +import org.hl7.fhir.instance.model.api.IDomainResource; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A resource that includes narrative, extensions, and contained resources. + */ +public abstract class DomainResource extends Resource implements IBaseHasExtensions, IBaseHasModifierExtensions, IDomainResource { + + /** + * A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. + */ + @Child(name = "text", type = {Narrative.class}, order=0, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Text summary of the resource, for human interpretation", formalDefinition="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." ) + protected Narrative text; + + /** + * These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. + */ + @Child(name = "contained", type = {Resource.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contained, inline Resources", formalDefinition="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." ) + protected List contained; + + /** + * May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. + */ + @Child(name = "extension", type = {Extension.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) + protected List extension; + + /** + * May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. + */ + @Child(name = "modifierExtension", type = {Extension.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=false) + @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) + protected List modifierExtension; + + private static final long serialVersionUID = -970285559L; + + /** + * Constructor + */ + public DomainResource() { + super(); + } + + /** + * @return {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) + */ + public Narrative getText() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DomainResource.text"); + else if (Configuration.doAutoCreate()) + this.text = new Narrative(); // cc + return this.text; + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) + */ + public DomainResource setText(Narrative value) { + this.text = value; + return this; + } + + /** + * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) + */ + public List getContained() { + if (this.contained == null) + this.contained = new ArrayList(); + return this.contained; + } + + public boolean hasContained() { + if (this.contained == null) + return false; + for (Resource item : this.contained) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) + */ + // syntactic sugar + public DomainResource addContained(Resource t) { //3 + if (t == null) + return this; + if (this.contained == null) + this.contained = new ArrayList(); + this.contained.add(t); + return this; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + public List getExtension() { + if (this.extension == null) + this.extension = new ArrayList(); + return this.extension; + } + + public boolean hasExtension() { + if (this.extension == null) + return false; + for (Extension item : this.extension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + // syntactic sugar + public Extension addExtension() { //3 + Extension t = new Extension(); + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return t; + } + + // syntactic sugar + public DomainResource addExtension(Extension t) { //3 + if (t == null) + return this; + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return this; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + public List getModifierExtension() { + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + return this.modifierExtension; + } + + public boolean hasModifierExtension() { + if (this.modifierExtension == null) + return false; + for (Extension item : this.modifierExtension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + // syntactic sugar + public Extension addModifierExtension() { //3 + Extension t = new Extension(); + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return t; + } + + // syntactic sugar + public DomainResource addModifierExtension(Extension t) { //3 + if (t == null) + return this; + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return this; + } + + /** + * Returns a list of extensions from this element which have the given URL. Note that + * this list may not be modified (you can not add or remove elements from it) + */ + public List getExtensionsByUrl(String theUrl) { + org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must be provided with a value"); + ArrayList retVal = new ArrayList(); + for (Extension next : getExtension()) { + if (theUrl.equals(next.getUrl())) { + retVal.add(next); + } + } + return Collections.unmodifiableList(retVal); + } + + /** + * Returns a list of modifier extensions from this element which have the given URL. Note that + * this list may not be modified (you can not add or remove elements from it) + */ + public List getModifierExtensionsByUrl(String theUrl) { + org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must be provided with a value"); + ArrayList retVal = new ArrayList(); + for (Extension next : getModifierExtension()) { + if (theUrl.equals(next.getUrl())) { + retVal.add(next); + } + } + return Collections.unmodifiableList(retVal); + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("text", "Narrative", "A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("contained", "Resource", "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", 0, java.lang.Integer.MAX_VALUE, contained)); + childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); + childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // Narrative + case -410956685: /*contained*/ return this.contained == null ? new Base[0] : this.contained.toArray(new Base[this.contained.size()]); // Resource + case -612557761: /*extension*/ return this.extension == null ? new Base[0] : this.extension.toArray(new Base[this.extension.size()]); // Extension + case -298878168: /*modifierExtension*/ return this.modifierExtension == null ? new Base[0] : this.modifierExtension.toArray(new Base[this.modifierExtension.size()]); // Extension + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3556653: // text + this.text = castToNarrative(value); // Narrative + break; + case -410956685: // contained + this.getContained().add(castToResource(value)); // Resource + break; + case -612557761: // extension + this.getExtension().add(castToExtension(value)); // Extension + break; + case -298878168: // modifierExtension + this.getModifierExtension().add(castToExtension(value)); // Extension + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("text")) + this.text = castToNarrative(value); // Narrative + else if (name.equals("contained")) + this.getContained().add(castToResource(value)); + else if (name.equals("extension")) + this.getExtension().add(castToExtension(value)); + else if (name.equals("modifierExtension")) + this.getModifierExtension().add(castToExtension(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3556653: return getText(); // Narrative + case -410956685: throw new FHIRException("Cannot make property contained as it is not a complex type"); // Resource + case -612557761: return addExtension(); // Extension + case -298878168: return addModifierExtension(); // Extension + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("text")) { + this.text = new Narrative(); + return this.text; + } + else if (name.equals("contained")) { + throw new FHIRException("Cannot call addChild on an abstract type DomainResource.contained"); + } + else if (name.equals("extension")) { + return addExtension(); + } + else if (name.equals("modifierExtension")) { + return addModifierExtension(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "DomainResource"; + + } + + public abstract DomainResource copy(); + + public void copyValues(DomainResource dst) { + dst.text = text == null ? null : text.copy(); + if (contained != null) { + dst.contained = new ArrayList(); + for (Resource i : contained) + dst.contained.add(i.copy()); + }; + if (extension != null) { + dst.extension = new ArrayList(); + for (Extension i : extension) + dst.extension.add(i.copy()); + }; + if (modifierExtension != null) { + dst.modifierExtension = new ArrayList(); + for (Extension i : modifierExtension) + dst.modifierExtension.add(i.copy()); + }; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DomainResource)) + return false; + DomainResource o = (DomainResource) other; + return compareDeep(text, o.text, true) && compareDeep(contained, o.contained, true) && compareDeep(extension, o.extension, true) + && compareDeep(modifierExtension, o.modifierExtension, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DomainResource)) + return false; + DomainResource o = (DomainResource) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (contained == null || contained.isEmpty()) + && (extension == null || extension.isEmpty()) && (modifierExtension == null || modifierExtension.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Duration.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Duration.java new file mode 100644 index 00000000000..cacf0291421 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Duration.java @@ -0,0 +1,88 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Duration", profileOf=Quantity.class) +public class Duration extends Quantity { + + private static final long serialVersionUID = 1069574054L; + + public Duration copy() { + Duration dst = new Duration(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Duration typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Duration)) + return false; + Duration o = (Duration) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Duration)) + return false; + Duration o = (Duration) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Element.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Element.java new file mode 100644 index 00000000000..1aac6d3fb1f --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Element.java @@ -0,0 +1,298 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseElement; +import org.hl7.fhir.instance.model.api.IBaseHasExtensions; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * Base definition for all elements in a resource. + */ +public abstract class Element extends Base implements IBaseHasExtensions, IBaseElement { + + /** + * unique id for the element within a resource (for internal references). + */ + @Child(name = "id", type = {IdType.class}, order=0, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="xml:id (or equivalent in JSON)", formalDefinition="unique id for the element within a resource (for internal references)." ) + protected IdType id; + + /** + * May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. + */ + @Child(name = "extension", type = {Extension.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) + protected List extension; + + private static final long serialVersionUID = -158027598L; + + /** + * Constructor + */ + public Element() { + super(); + } + + /** + * @return {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public IdType getIdElement() { + if (this.id == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Element.id"); + else if (Configuration.doAutoCreate()) + this.id = new IdType(); // bb + return this.id; + } + + public boolean hasIdElement() { + return this.id != null && !this.id.isEmpty(); + } + + public boolean hasId() { + return this.id != null && !this.id.isEmpty(); + } + + /** + * @param value {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public Element setIdElement(IdType value) { + this.id = value; + return this; + } + + /** + * @return unique id for the element within a resource (for internal references). + */ + public String getId() { + return this.id == null ? null : this.id.getValue(); + } + + /** + * @param value unique id for the element within a resource (for internal references). + */ + public Element setId(String value) { + if (Utilities.noString(value)) + this.id = null; + else { + if (this.id == null) + this.id = new IdType(); + this.id.setValue(value); + } + return this; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + public List getExtension() { + if (this.extension == null) + this.extension = new ArrayList(); + return this.extension; + } + + public boolean hasExtension() { + if (this.extension == null) + return false; + for (Extension item : this.extension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + // syntactic sugar + public Extension addExtension() { //3 + Extension t = new Extension(); + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return t; + } + + // syntactic sugar + public Element addExtension(Extension t) { //3 + if (t == null) + return this; + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return this; + } + + /** + * Returns an unmodifiable list containing all extensions on this element which + * match the given URL. + * + * @param theUrl The URL. Must not be blank or null. + * @return an unmodifiable list containing all extensions on this element which + * match the given URL + */ + public List getExtensionsByUrl(String theUrl) { + org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must not be blank or null"); + ArrayList retVal = new ArrayList(); + for (Extension next : getExtension()) { + if (theUrl.equals(next.getUrl())) { + retVal.add(next); + } + } + return java.util.Collections.unmodifiableList(retVal); + } + public boolean hasExtension(String theUrl) { + return !getExtensionsByUrl(theUrl).isEmpty(); + } + + public String getExtensionString(String theUrl) throws FHIRException { + List ext = getExtensionsByUrl(theUrl); + if (ext.isEmpty()) + return null; + if (ext.size() > 1) + throw new FHIRException("Multiple matching extensions found"); + if (!ext.get(0).getValue().isPrimitive()) + throw new FHIRException("Extension could not be converted to a string"); + return ext.get(0).getValue().primitiveValue(); + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("id", "id", "unique id for the element within a resource (for internal references).", 0, java.lang.Integer.MAX_VALUE, id)); + childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3355: /*id*/ return this.id == null ? new Base[0] : new Base[] {this.id}; // IdType + case -612557761: /*extension*/ return this.extension == null ? new Base[0] : this.extension.toArray(new Base[this.extension.size()]); // Extension + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3355: // id + this.id = castToId(value); // IdType + break; + case -612557761: // extension + this.getExtension().add(castToExtension(value)); // Extension + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("id")) + this.id = castToId(value); // IdType + else if (name.equals("extension")) + this.getExtension().add(castToExtension(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3355: throw new FHIRException("Cannot make property id as it is not a complex type"); // IdType + case -612557761: return addExtension(); // Extension + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("id")) { + throw new FHIRException("Cannot call addChild on a primitive type Element.id"); + } + else if (name.equals("extension")) { + return addExtension(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Element"; + + } + + public abstract Element copy(); + + public void copyValues(Element dst) { + dst.id = id == null ? null : id.copy(); + if (extension != null) { + dst.extension = new ArrayList(); + for (Extension i : extension) + dst.extension.add(i.copy()); + }; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Element)) + return false; + Element o = (Element) other; + return compareDeep(id, o.id, true) && compareDeep(extension, o.extension, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Element)) + return false; + Element o = (Element) other; + return compareValues(id, o.id, true); + } + + public boolean isEmpty() { + boolean retVal = super.isEmpty() && (id == null || id.isEmpty()) && (extension == null || extension.isEmpty()); + return retVal + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ElementDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ElementDefinition.java new file mode 100644 index 00000000000..fcf50a3be48 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ElementDefinition.java @@ -0,0 +1,5451 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength; +import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrengthEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * Captures constraints on each element within the resource, profile, or extension. + */ +@DatatypeDef(name="ElementDefinition") +public class ElementDefinition extends Type implements ICompositeType { + + public enum PropertyRepresentation { + /** + * In XML, this property is represented as an attribute not an element. + */ + XMLATTR, + /** + * This element is represented using the XML text attribute (primitives only) + */ + XMLTEXT, + /** + * The type of this element is indicated using xsi:type + */ + TYPEATTR, + /** + * Use CDA narrative instead of XHTML + */ + CDATEXT, + /** + * added to help the parsers + */ + NULL; + public static PropertyRepresentation fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("xmlAttr".equals(codeString)) + return XMLATTR; + if ("xmlText".equals(codeString)) + return XMLTEXT; + if ("typeAttr".equals(codeString)) + return TYPEATTR; + if ("cdaText".equals(codeString)) + return CDATEXT; + throw new FHIRException("Unknown PropertyRepresentation code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case XMLATTR: return "xmlAttr"; + case XMLTEXT: return "xmlText"; + case TYPEATTR: return "typeAttr"; + case CDATEXT: return "cdaText"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case XMLATTR: return "http://hl7.org/fhir/property-representation"; + case XMLTEXT: return "http://hl7.org/fhir/property-representation"; + case TYPEATTR: return "http://hl7.org/fhir/property-representation"; + case CDATEXT: return "http://hl7.org/fhir/property-representation"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case XMLATTR: return "In XML, this property is represented as an attribute not an element."; + case XMLTEXT: return "This element is represented using the XML text attribute (primitives only)"; + case TYPEATTR: return "The type of this element is indicated using xsi:type"; + case CDATEXT: return "Use CDA narrative instead of XHTML"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case XMLATTR: return "XML Attribute"; + case XMLTEXT: return "XML Text"; + case TYPEATTR: return "Type Attribute"; + case CDATEXT: return "CDA Text Format"; + default: return "?"; + } + } + } + + 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; + if ("xmlText".equals(codeString)) + return PropertyRepresentation.XMLTEXT; + if ("typeAttr".equals(codeString)) + return PropertyRepresentation.TYPEATTR; + if ("cdaText".equals(codeString)) + return PropertyRepresentation.CDATEXT; + throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("xmlAttr".equals(codeString)) + return new Enumeration(this, PropertyRepresentation.XMLATTR); + if ("xmlText".equals(codeString)) + return new Enumeration(this, PropertyRepresentation.XMLTEXT); + if ("typeAttr".equals(codeString)) + return new Enumeration(this, PropertyRepresentation.TYPEATTR); + if ("cdaText".equals(codeString)) + return new Enumeration(this, PropertyRepresentation.CDATEXT); + throw new FHIRException("Unknown PropertyRepresentation code '"+codeString+"'"); + } + public String toCode(PropertyRepresentation code) { + if (code == PropertyRepresentation.XMLATTR) + return "xmlAttr"; + if (code == PropertyRepresentation.XMLTEXT) + return "xmlText"; + if (code == PropertyRepresentation.TYPEATTR) + return "typeAttr"; + if (code == PropertyRepresentation.CDATEXT) + return "cdaText"; + return "?"; + } + public String toSystem(PropertyRepresentation code) { + return code.getSystem(); + } + } + + public enum SlicingRules { + /** + * No additional content is allowed other than that described by the slices in this profile. + */ + CLOSED, + /** + * Additional content is allowed anywhere in the list. + */ + OPEN, + /** + * Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required. + */ + OPENATEND, + /** + * added to help the parsers + */ + NULL; + public static SlicingRules fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("closed".equals(codeString)) + return CLOSED; + if ("open".equals(codeString)) + return OPEN; + if ("openAtEnd".equals(codeString)) + return OPENATEND; + throw new FHIRException("Unknown SlicingRules code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CLOSED: return "closed"; + case OPEN: return "open"; + case OPENATEND: return "openAtEnd"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CLOSED: return "http://hl7.org/fhir/resource-slicing-rules"; + case OPEN: return "http://hl7.org/fhir/resource-slicing-rules"; + case OPENATEND: return "http://hl7.org/fhir/resource-slicing-rules"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CLOSED: return "No additional content is allowed other than that described by the slices in this profile."; + case OPEN: return "Additional content is allowed anywhere in the list."; + case OPENATEND: return "Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CLOSED: return "Closed"; + case OPEN: return "Open"; + case OPENATEND: return "Open at End"; + default: return "?"; + } + } + } + + public static class SlicingRulesEnumFactory implements EnumFactory { + public SlicingRules fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("closed".equals(codeString)) + return SlicingRules.CLOSED; + if ("open".equals(codeString)) + return SlicingRules.OPEN; + if ("openAtEnd".equals(codeString)) + return SlicingRules.OPENATEND; + throw new IllegalArgumentException("Unknown SlicingRules code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("closed".equals(codeString)) + return new Enumeration(this, SlicingRules.CLOSED); + if ("open".equals(codeString)) + return new Enumeration(this, SlicingRules.OPEN); + if ("openAtEnd".equals(codeString)) + return new Enumeration(this, SlicingRules.OPENATEND); + throw new FHIRException("Unknown SlicingRules code '"+codeString+"'"); + } + public String toCode(SlicingRules code) { + if (code == SlicingRules.CLOSED) + return "closed"; + if (code == SlicingRules.OPEN) + return "open"; + if (code == SlicingRules.OPENATEND) + return "openAtEnd"; + return "?"; + } + public String toSystem(SlicingRules code) { + return code.getSystem(); + } + } + + public enum AggregationMode { + /** + * The reference is a local reference to a contained resource. + */ + CONTAINED, + /** + * The reference to a resource that has to be resolved externally to the resource that includes the reference. + */ + REFERENCED, + /** + * The resource the reference points to will be found in the same bundle as the resource that includes the reference. + */ + BUNDLED, + /** + * added to help the parsers + */ + NULL; + public static AggregationMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("contained".equals(codeString)) + return CONTAINED; + if ("referenced".equals(codeString)) + return REFERENCED; + if ("bundled".equals(codeString)) + return BUNDLED; + throw new FHIRException("Unknown AggregationMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CONTAINED: return "contained"; + case REFERENCED: return "referenced"; + case BUNDLED: return "bundled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CONTAINED: return "http://hl7.org/fhir/resource-aggregation-mode"; + case REFERENCED: return "http://hl7.org/fhir/resource-aggregation-mode"; + case BUNDLED: return "http://hl7.org/fhir/resource-aggregation-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CONTAINED: return "The reference is a local reference to a contained resource."; + case REFERENCED: return "The reference to a resource that has to be resolved externally to the resource that includes the reference."; + case BUNDLED: return "The resource the reference points to will be found in the same bundle as the resource that includes the reference."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CONTAINED: return "Contained"; + case REFERENCED: return "Referenced"; + case BUNDLED: return "Bundled"; + default: return "?"; + } + } + } + + public static class AggregationModeEnumFactory implements EnumFactory { + public AggregationMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("contained".equals(codeString)) + return AggregationMode.CONTAINED; + if ("referenced".equals(codeString)) + return AggregationMode.REFERENCED; + if ("bundled".equals(codeString)) + return AggregationMode.BUNDLED; + throw new IllegalArgumentException("Unknown AggregationMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("contained".equals(codeString)) + return new Enumeration(this, AggregationMode.CONTAINED); + if ("referenced".equals(codeString)) + return new Enumeration(this, AggregationMode.REFERENCED); + if ("bundled".equals(codeString)) + return new Enumeration(this, AggregationMode.BUNDLED); + throw new FHIRException("Unknown AggregationMode code '"+codeString+"'"); + } + public String toCode(AggregationMode code) { + if (code == AggregationMode.CONTAINED) + return "contained"; + if (code == AggregationMode.REFERENCED) + return "referenced"; + if (code == AggregationMode.BUNDLED) + return "bundled"; + return "?"; + } + public String toSystem(AggregationMode code) { + return code.getSystem(); + } + } + + public enum ReferenceVersionRules { + /** + * The reference may be either version independent or version specific + */ + EITHER, + /** + * The reference must be version independent + */ + INDEPENDENT, + /** + * The reference must be version specific + */ + SPECIFIC, + /** + * added to help the parsers + */ + NULL; + public static ReferenceVersionRules fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("either".equals(codeString)) + return EITHER; + if ("independent".equals(codeString)) + return INDEPENDENT; + if ("specific".equals(codeString)) + return SPECIFIC; + throw new FHIRException("Unknown ReferenceVersionRules code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case EITHER: return "either"; + case INDEPENDENT: return "independent"; + case SPECIFIC: return "specific"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EITHER: return "http://hl7.org/fhir/reference-version-rules"; + case INDEPENDENT: return "http://hl7.org/fhir/reference-version-rules"; + case SPECIFIC: return "http://hl7.org/fhir/reference-version-rules"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case EITHER: return "The reference may be either version independent or version specific"; + case INDEPENDENT: return "The reference must be version independent"; + case SPECIFIC: return "The reference must be version specific"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case EITHER: return "Either Specific or independent"; + case INDEPENDENT: return "Version independent"; + case SPECIFIC: return "Version Specific"; + default: return "?"; + } + } + } + + public static class ReferenceVersionRulesEnumFactory implements EnumFactory { + public ReferenceVersionRules fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("either".equals(codeString)) + return ReferenceVersionRules.EITHER; + if ("independent".equals(codeString)) + return ReferenceVersionRules.INDEPENDENT; + if ("specific".equals(codeString)) + return ReferenceVersionRules.SPECIFIC; + throw new IllegalArgumentException("Unknown ReferenceVersionRules code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("either".equals(codeString)) + return new Enumeration(this, ReferenceVersionRules.EITHER); + if ("independent".equals(codeString)) + return new Enumeration(this, ReferenceVersionRules.INDEPENDENT); + if ("specific".equals(codeString)) + return new Enumeration(this, ReferenceVersionRules.SPECIFIC); + throw new FHIRException("Unknown ReferenceVersionRules code '"+codeString+"'"); + } + public String toCode(ReferenceVersionRules code) { + if (code == ReferenceVersionRules.EITHER) + return "either"; + if (code == ReferenceVersionRules.INDEPENDENT) + return "independent"; + if (code == ReferenceVersionRules.SPECIFIC) + return "specific"; + return "?"; + } + public String toSystem(ReferenceVersionRules code) { + return code.getSystem(); + } + } + + public enum ConstraintSeverity { + /** + * If the constraint is violated, the resource is not conformant. + */ + ERROR, + /** + * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. + */ + WARNING, + /** + * added to help the parsers + */ + NULL; + public static ConstraintSeverity fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("error".equals(codeString)) + return ERROR; + if ("warning".equals(codeString)) + return WARNING; + throw new FHIRException("Unknown ConstraintSeverity code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ERROR: return "error"; + case WARNING: return "warning"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ERROR: return "http://hl7.org/fhir/constraint-severity"; + case WARNING: return "http://hl7.org/fhir/constraint-severity"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ERROR: return "If the constraint is violated, the resource is not conformant."; + case WARNING: return "If the constraint is violated, the resource is conformant, but it is not necessarily following best practice."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ERROR: return "Error"; + case WARNING: return "Warning"; + default: return "?"; + } + } + } + + 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; + if ("error".equals(codeString)) + return ConstraintSeverity.ERROR; + if ("warning".equals(codeString)) + return ConstraintSeverity.WARNING; + throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("error".equals(codeString)) + return new Enumeration(this, ConstraintSeverity.ERROR); + if ("warning".equals(codeString)) + return new Enumeration(this, ConstraintSeverity.WARNING); + throw new FHIRException("Unknown ConstraintSeverity code '"+codeString+"'"); + } + public String toCode(ConstraintSeverity code) { + if (code == ConstraintSeverity.ERROR) + return "error"; + if (code == ConstraintSeverity.WARNING) + return "warning"; + return "?"; + } + public String toSystem(ConstraintSeverity code) { + return code.getSystem(); + } + } + + @Block() + public static class ElementDefinitionSlicingComponent extends Element implements IBaseDatatypeElement { + /** + * Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. + */ + @Child(name = "discriminator", type = {StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Element values that are used to distinguish the slices", formalDefinition="Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices." ) + protected List discriminator; + + /** + * A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Text description of how slicing works (or not)", formalDefinition="A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated." ) + protected StringType description; + + /** + * If the matching elements have to occur in the same order as defined in the profile. + */ + @Child(name = "ordered", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If elements must be in same order as slices", formalDefinition="If the matching elements have to occur in the same order as defined in the profile." ) + protected BooleanType ordered; + + /** + * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + @Child(name = "rules", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="closed | open | openAtEnd", formalDefinition="Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end." ) + protected Enumeration rules; + + private static final long serialVersionUID = 233544215L; + + /** + * Constructor + */ + public ElementDefinitionSlicingComponent() { + super(); + } + + /** + * Constructor + */ + public ElementDefinitionSlicingComponent(Enumeration rules) { + super(); + this.rules = rules; + } + + /** + * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public List getDiscriminator() { + if (this.discriminator == null) + this.discriminator = new ArrayList(); + return this.discriminator; + } + + public boolean hasDiscriminator() { + if (this.discriminator == null) + return false; + for (StringType item : this.discriminator) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + // syntactic sugar + public StringType addDiscriminatorElement() {//2 + StringType t = new StringType(); + if (this.discriminator == null) + this.discriminator = new ArrayList(); + this.discriminator.add(t); + return t; + } + + /** + * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public ElementDefinitionSlicingComponent addDiscriminator(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.discriminator == null) + this.discriminator = new ArrayList(); + this.discriminator.add(t); + return this; + } + + /** + * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public boolean hasDiscriminator(String value) { + if (this.discriminator == null) + return false; + for (StringType v : this.discriminator) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). 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 ElementDefinitionSlicingComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + public ElementDefinitionSlicingComponent 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 #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value + */ + public BooleanType getOrderedElement() { + if (this.ordered == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.ordered"); + else if (Configuration.doAutoCreate()) + this.ordered = new BooleanType(); // bb + return this.ordered; + } + + public boolean hasOrderedElement() { + return this.ordered != null && !this.ordered.isEmpty(); + } + + public boolean hasOrdered() { + return this.ordered != null && !this.ordered.isEmpty(); + } + + /** + * @param value {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setOrderedElement(BooleanType value) { + this.ordered = value; + return this; + } + + /** + * @return If the matching elements have to occur in the same order as defined in the profile. + */ + public boolean getOrdered() { + return this.ordered == null || this.ordered.isEmpty() ? false : this.ordered.getValue(); + } + + /** + * @param value If the matching elements have to occur in the same order as defined in the profile. + */ + public ElementDefinitionSlicingComponent setOrdered(boolean value) { + if (this.ordered == null) + this.ordered = new BooleanType(); + this.ordered.setValue(value); + return this; + } + + /** + * @return {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value + */ + public Enumeration getRulesElement() { + if (this.rules == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.rules"); + else if (Configuration.doAutoCreate()) + this.rules = new Enumeration(new SlicingRulesEnumFactory()); // bb + return this.rules; + } + + public boolean hasRulesElement() { + return this.rules != null && !this.rules.isEmpty(); + } + + public boolean hasRules() { + return this.rules != null && !this.rules.isEmpty(); + } + + /** + * @param value {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setRulesElement(Enumeration value) { + this.rules = value; + return this; + } + + /** + * @return Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + public SlicingRules getRules() { + return this.rules == null ? null : this.rules.getValue(); + } + + /** + * @param value Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + public ElementDefinitionSlicingComponent setRules(SlicingRules value) { + if (this.rules == null) + this.rules = new Enumeration(new SlicingRulesEnumFactory()); + this.rules.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("discriminator", "string", "Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.", 0, java.lang.Integer.MAX_VALUE, discriminator)); + childrenList.add(new Property("description", "string", "A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("ordered", "boolean", "If the matching elements have to occur in the same order as defined in the profile.", 0, java.lang.Integer.MAX_VALUE, ordered)); + childrenList.add(new Property("rules", "code", "Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.", 0, java.lang.Integer.MAX_VALUE, rules)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1888270692: /*discriminator*/ return this.discriminator == null ? new Base[0] : this.discriminator.toArray(new Base[this.discriminator.size()]); // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1207109523: /*ordered*/ return this.ordered == null ? new Base[0] : new Base[] {this.ordered}; // BooleanType + case 108873975: /*rules*/ return this.rules == null ? new Base[0] : new Base[] {this.rules}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1888270692: // discriminator + this.getDiscriminator().add(castToString(value)); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1207109523: // ordered + this.ordered = castToBoolean(value); // BooleanType + break; + case 108873975: // rules + this.rules = new SlicingRulesEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("discriminator")) + this.getDiscriminator().add(castToString(value)); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("ordered")) + this.ordered = castToBoolean(value); // BooleanType + else if (name.equals("rules")) + this.rules = new SlicingRulesEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1888270692: throw new FHIRException("Cannot make property discriminator as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1207109523: throw new FHIRException("Cannot make property ordered as it is not a complex type"); // BooleanType + case 108873975: throw new FHIRException("Cannot make property rules as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("discriminator")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.discriminator"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.description"); + } + else if (name.equals("ordered")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.ordered"); + } + else if (name.equals("rules")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.rules"); + } + else + return super.addChild(name); + } + + public ElementDefinitionSlicingComponent copy() { + ElementDefinitionSlicingComponent dst = new ElementDefinitionSlicingComponent(); + copyValues(dst); + if (discriminator != null) { + dst.discriminator = new ArrayList(); + for (StringType i : discriminator) + dst.discriminator.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.ordered = ordered == null ? null : ordered.copy(); + dst.rules = rules == null ? null : rules.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionSlicingComponent)) + return false; + ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other; + return compareDeep(discriminator, o.discriminator, true) && compareDeep(description, o.description, true) + && compareDeep(ordered, o.ordered, true) && compareDeep(rules, o.rules, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionSlicingComponent)) + return false; + ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other; + return compareValues(discriminator, o.discriminator, true) && compareValues(description, o.description, true) + && compareValues(ordered, o.ordered, true) && compareValues(rules, o.rules, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (discriminator == null || discriminator.isEmpty()) && (description == null || description.isEmpty()) + && (ordered == null || ordered.isEmpty()) && (rules == null || rules.isEmpty()); + } + + public String fhirType() { + return "ElementDefinition.slicing"; + + } + + } + + @Block() + public static class ElementDefinitionBaseComponent extends Element implements IBaseDatatypeElement { + /** + * The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base. + */ + @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Path that identifies the base element", formalDefinition="The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base." ) + protected StringType path; + + /** + * Minimum cardinality of the base element identified by the path. + */ + @Child(name = "min", type = {IntegerType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Min cardinality of the base element", formalDefinition="Minimum cardinality of the base element identified by the path." ) + protected IntegerType min; + + /** + * Maximum cardinality of the base element identified by the path. + */ + @Child(name = "max", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Max cardinality of the base element", formalDefinition="Maximum cardinality of the base element identified by the path." ) + protected StringType max; + + private static final long serialVersionUID = 232204455L; + + /** + * Constructor + */ + public ElementDefinitionBaseComponent() { + super(); + } + + /** + * Constructor + */ + public ElementDefinitionBaseComponent(StringType path, IntegerType min, StringType max) { + super(); + this.path = path; + this.min = min; + this.max = max; + } + + /** + * @return {@link #path} (The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public ElementDefinitionBaseComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base. + */ + public ElementDefinitionBaseComponent setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #min} (Minimum cardinality of the base element identified by the path.). 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 ElementDefinitionBaseComponent.min"); + else if (Configuration.doAutoCreate()) + this.min = new IntegerType(); // bb + 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} (Minimum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public ElementDefinitionBaseComponent setMinElement(IntegerType value) { + this.min = value; + return this; + } + + /** + * @return Minimum cardinality of the base element identified by the path. + */ + public int getMin() { + return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value Minimum cardinality of the base element identified by the path. + */ + public ElementDefinitionBaseComponent setMin(int value) { + if (this.min == null) + this.min = new IntegerType(); + this.min.setValue(value); + return this; + } + + /** + * @return {@link #max} (Maximum cardinality of the base element identified by the path.). 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 ElementDefinitionBaseComponent.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + 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} (Maximum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public ElementDefinitionBaseComponent setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return Maximum cardinality of the base element identified by the path. + */ + public String getMax() { + return this.max == null ? null : this.max.getValue(); + } + + /** + * @param value Maximum cardinality of the base element identified by the path. + */ + public ElementDefinitionBaseComponent setMax(String value) { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("min", "integer", "Minimum cardinality of the base element identified by the path.", 0, java.lang.Integer.MAX_VALUE, min)); + childrenList.add(new Property("max", "string", "Maximum cardinality of the base element identified by the path.", 0, java.lang.Integer.MAX_VALUE, max)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType + case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3433509: // path + this.path = castToString(value); // StringType + break; + case 108114: // min + this.min = castToInteger(value); // IntegerType + break; + case 107876: // max + this.max = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("min")) + this.min = castToInteger(value); // IntegerType + else if (name.equals("max")) + this.max = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType + case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path"); + } + else if (name.equals("min")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.min"); + } + else if (name.equals("max")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.max"); + } + else + return super.addChild(name); + } + + public ElementDefinitionBaseComponent copy() { + ElementDefinitionBaseComponent dst = new ElementDefinitionBaseComponent(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionBaseComponent)) + return false; + ElementDefinitionBaseComponent o = (ElementDefinitionBaseComponent) other; + return compareDeep(path, o.path, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionBaseComponent)) + return false; + ElementDefinitionBaseComponent o = (ElementDefinitionBaseComponent) other; + return compareValues(path, o.path, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (min == null || min.isEmpty()) + && (max == null || max.isEmpty()); + } + + public String fhirType() { + return "ElementDefinition.base"; + + } + + } + + @Block() + public static class TypeRefComponent extends Element implements IBaseDatatypeElement { + /** + * Name of Data type or Resource that is a(or the) type used for this element. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of Data type or Resource", formalDefinition="Name of Data type or Resource that is a(or the) type used for this element." ) + protected CodeType code; + + /** + * Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide. + */ + @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Profile (StructureDefinition) to apply (or IG)", formalDefinition="Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide." ) + protected List profile; + + /** + * If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. + */ + @Child(name = "aggregation", type = {CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="contained | referenced | bundled - how aggregated", formalDefinition="If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle." ) + protected List> aggregation; + + /** + * Whether this reference needs to be version specific or version independent, or whetehr either can be used. + */ + @Child(name = "versioning", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="either | independent | specific", formalDefinition="Whether this reference needs to be version specific or version independent, or whetehr either can be used." ) + protected Enumeration versioning; + + private static final long serialVersionUID = -829583924L; + + /** + * Constructor + */ + public TypeRefComponent() { + super(); + } + + /** + * Constructor + */ + public TypeRefComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TypeRefComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public TypeRefComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Name of Data type or Resource that is a(or the) type used for this element. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Name of Data type or Resource that is a(or the) type used for this element. + */ + public TypeRefComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #profile} (Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.) + */ + public List getProfile() { + if (this.profile == null) + this.profile = new ArrayList(); + return this.profile; + } + + public boolean hasProfile() { + if (this.profile == null) + return false; + for (UriType item : this.profile) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #profile} (Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.) + */ + // syntactic sugar + public UriType addProfileElement() {//2 + UriType t = new UriType(); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return t; + } + + /** + * @param value {@link #profile} (Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.) + */ + public TypeRefComponent addProfile(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return this; + } + + /** + * @param value {@link #profile} (Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.) + */ + public boolean hasProfile(String value) { + if (this.profile == null) + return false; + for (UriType v : this.profile) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public List> getAggregation() { + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + return this.aggregation; + } + + public boolean hasAggregation() { + if (this.aggregation == null) + return false; + for (Enumeration item : this.aggregation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + // syntactic sugar + public Enumeration addAggregationElement() {//2 + Enumeration t = new Enumeration(new AggregationModeEnumFactory()); + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + this.aggregation.add(t); + return t; + } + + /** + * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public TypeRefComponent addAggregation(AggregationMode value) { //1 + Enumeration t = new Enumeration(new AggregationModeEnumFactory()); + t.setValue(value); + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + this.aggregation.add(t); + return this; + } + + /** + * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public boolean hasAggregation(AggregationMode value) { + if (this.aggregation == null) + return false; + for (Enumeration v : this.aggregation) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #versioning} (Whether this reference needs to be version specific or version independent, or whetehr either can be used.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value + */ + public Enumeration getVersioningElement() { + if (this.versioning == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TypeRefComponent.versioning"); + else if (Configuration.doAutoCreate()) + this.versioning = new Enumeration(new ReferenceVersionRulesEnumFactory()); // bb + return this.versioning; + } + + public boolean hasVersioningElement() { + return this.versioning != null && !this.versioning.isEmpty(); + } + + public boolean hasVersioning() { + return this.versioning != null && !this.versioning.isEmpty(); + } + + /** + * @param value {@link #versioning} (Whether this reference needs to be version specific or version independent, or whetehr either can be used.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value + */ + public TypeRefComponent setVersioningElement(Enumeration value) { + this.versioning = value; + return this; + } + + /** + * @return Whether this reference needs to be version specific or version independent, or whetehr either can be used. + */ + public ReferenceVersionRules getVersioning() { + return this.versioning == null ? null : this.versioning.getValue(); + } + + /** + * @param value Whether this reference needs to be version specific or version independent, or whetehr either can be used. + */ + public TypeRefComponent setVersioning(ReferenceVersionRules value) { + if (value == null) + this.versioning = null; + else { + if (this.versioning == null) + this.versioning = new Enumeration(new ReferenceVersionRulesEnumFactory()); + this.versioning.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Name of Data type or Resource that is a(or the) type used for this element.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("profile", "uri", "Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("aggregation", "code", "If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.", 0, java.lang.Integer.MAX_VALUE, aggregation)); + childrenList.add(new Property("versioning", "code", "Whether this reference needs to be version specific or version independent, or whetehr either can be used.", 0, java.lang.Integer.MAX_VALUE, versioning)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // UriType + case 841524962: /*aggregation*/ return this.aggregation == null ? new Base[0] : this.aggregation.toArray(new Base[this.aggregation.size()]); // Enumeration + case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case -309425751: // profile + this.getProfile().add(castToUri(value)); // UriType + break; + case 841524962: // aggregation + this.getAggregation().add(new AggregationModeEnumFactory().fromType(value)); // Enumeration + break; + case -670487542: // versioning + this.versioning = new ReferenceVersionRulesEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("profile")) + this.getProfile().add(castToUri(value)); + else if (name.equals("aggregation")) + this.getAggregation().add(new AggregationModeEnumFactory().fromType(value)); + else if (name.equals("versioning")) + this.versioning = new ReferenceVersionRulesEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case -309425751: throw new FHIRException("Cannot make property profile as it is not a complex type"); // UriType + case 841524962: throw new FHIRException("Cannot make property aggregation as it is not a complex type"); // Enumeration + case -670487542: throw new FHIRException("Cannot make property versioning as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.code"); + } + else if (name.equals("profile")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.profile"); + } + else if (name.equals("aggregation")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.aggregation"); + } + else if (name.equals("versioning")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.versioning"); + } + else + return super.addChild(name); + } + + public TypeRefComponent copy() { + TypeRefComponent dst = new TypeRefComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (profile != null) { + dst.profile = new ArrayList(); + for (UriType i : profile) + dst.profile.add(i.copy()); + }; + if (aggregation != null) { + dst.aggregation = new ArrayList>(); + for (Enumeration i : aggregation) + dst.aggregation.add(i.copy()); + }; + dst.versioning = versioning == null ? null : versioning.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TypeRefComponent)) + return false; + TypeRefComponent o = (TypeRefComponent) other; + return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(aggregation, o.aggregation, true) + && compareDeep(versioning, o.versioning, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TypeRefComponent)) + return false; + TypeRefComponent o = (TypeRefComponent) other; + return compareValues(code, o.code, true) && compareValues(profile, o.profile, true) && compareValues(aggregation, o.aggregation, true) + && compareValues(versioning, o.versioning, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (profile == null || profile.isEmpty()) + && (aggregation == null || aggregation.isEmpty()) && (versioning == null || versioning.isEmpty()) + ; + } + + public String fhirType() { + return "ElementDefinition.type"; + + } + + } + + @Block() + public static class ElementDefinitionConstraintComponent extends Element implements IBaseDatatypeElement { + /** + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + @Child(name = "key", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Target of 'condition' reference above", formalDefinition="Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality." ) + protected IdType key; + + /** + * Description of why this constraint is necessary or appropriate. + */ + @Child(name = "requirements", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why this constraint is necessary or appropriate", formalDefinition="Description of why this constraint is necessary or appropriate." ) + protected StringType requirements; + + /** + * Identifies the impact constraint violation has on the conformance of the instance. + */ + @Child(name = "severity", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." ) + protected Enumeration severity; + + /** + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + @Child(name = "human", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human description of constraint", formalDefinition="Text that can be used to describe the constraint in messages identifying that the constraint has been violated." ) + protected StringType human; + + /** + * A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met. + */ + @Child(name = "expression", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="FluentPath expression of constraint", formalDefinition="A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met." ) + protected StringType expression; + + /** + * An XPath expression of constraint that can be executed to see if this constraint is met. + */ + @Child(name = "xpath", type = {StringType.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." ) + protected StringType xpath; + + private static final long serialVersionUID = -1412249932L; + + /** + * Constructor + */ + public ElementDefinitionConstraintComponent() { + super(); + } + + /** + * Constructor + */ + public ElementDefinitionConstraintComponent(IdType key, Enumeration severity, StringType human, StringType xpath) { + super(); + this.key = key; + this.severity = severity; + this.human = human; + this.xpath = xpath; + } + + /** + * @return {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value + */ + public IdType getKeyElement() { + if (this.key == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key"); + else if (Configuration.doAutoCreate()) + this.key = new IdType(); // bb + return this.key; + } + + public boolean hasKeyElement() { + return this.key != null && !this.key.isEmpty(); + } + + public boolean hasKey() { + return this.key != null && !this.key.isEmpty(); + } + + /** + * @param value {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setKeyElement(IdType value) { + this.key = value; + return this; + } + + /** + * @return Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + public String getKey() { + return this.key == null ? null : this.key.getValue(); + } + + /** + * @param value Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + public ElementDefinitionConstraintComponent setKey(String value) { + if (this.key == null) + this.key = new IdType(); + this.key.setValue(value); + return this; + } + + /** + * @return {@link #requirements} (Description of why this constraint is necessary or appropriate.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Description of why this constraint is necessary or appropriate.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Description of why this constraint is necessary or appropriate. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Description of why this constraint is necessary or appropriate. + */ + public ElementDefinitionConstraintComponent setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(new ConstraintSeverityEnumFactory()); // bb + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Identifies the impact constraint violation has on the conformance of the instance. + */ + public ConstraintSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Identifies the impact constraint violation has on the conformance of the instance. + */ + public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { + if (this.severity == null) + this.severity = new Enumeration(new ConstraintSeverityEnumFactory()); + this.severity.setValue(value); + return this; + } + + /** + * @return {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value + */ + public StringType getHumanElement() { + if (this.human == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human"); + else if (Configuration.doAutoCreate()) + this.human = new StringType(); // bb + return this.human; + } + + public boolean hasHumanElement() { + return this.human != null && !this.human.isEmpty(); + } + + public boolean hasHuman() { + return this.human != null && !this.human.isEmpty(); + } + + /** + * @param value {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setHumanElement(StringType value) { + this.human = value; + return this; + } + + /** + * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + public String getHuman() { + return this.human == null ? null : this.human.getValue(); + } + + /** + * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + public ElementDefinitionConstraintComponent setHuman(String value) { + if (this.human == null) + this.human = new StringType(); + this.human.setValue(value); + return this; + } + + /** + * @return {@link #expression} (A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public StringType getExpressionElement() { + if (this.expression == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.expression"); + else if (Configuration.doAutoCreate()) + this.expression = new StringType(); // bb + return this.expression; + } + + public boolean hasExpressionElement() { + return this.expression != null && !this.expression.isEmpty(); + } + + public boolean hasExpression() { + return this.expression != null && !this.expression.isEmpty(); + } + + /** + * @param value {@link #expression} (A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setExpressionElement(StringType value) { + this.expression = value; + return this; + } + + /** + * @return A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met. + */ + public String getExpression() { + return this.expression == null ? null : this.expression.getValue(); + } + + /** + * @param value A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met. + */ + public ElementDefinitionConstraintComponent setExpression(String value) { + if (Utilities.noString(value)) + this.expression = null; + else { + if (this.expression == null) + this.expression = new StringType(); + this.expression.setValue(value); + } + return this; + } + + /** + * @return {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public StringType getXpathElement() { + if (this.xpath == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath"); + else if (Configuration.doAutoCreate()) + this.xpath = new StringType(); // bb + return this.xpath; + } + + public boolean hasXpathElement() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + public boolean hasXpath() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + /** + * @param value {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setXpathElement(StringType value) { + this.xpath = value; + return this; + } + + /** + * @return An XPath expression of constraint that can be executed to see if this constraint is met. + */ + public String getXpath() { + return this.xpath == null ? null : this.xpath.getValue(); + } + + /** + * @param value An XPath expression of constraint that can be executed to see if this constraint is met. + */ + public ElementDefinitionConstraintComponent setXpath(String value) { + if (this.xpath == null) + this.xpath = new StringType(); + this.xpath.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("key", "id", "Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.", 0, java.lang.Integer.MAX_VALUE, key)); + childrenList.add(new Property("requirements", "string", "Description of why this constraint is necessary or appropriate.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("human", "string", "Text that can be used to describe the constraint in messages identifying that the constraint has been violated.", 0, java.lang.Integer.MAX_VALUE, human)); + childrenList.add(new Property("expression", "string", "A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met.", 0, java.lang.Integer.MAX_VALUE, expression)); + childrenList.add(new Property("xpath", "string", "An XPath expression of constraint that can be executed to see if this constraint is met.", 0, java.lang.Integer.MAX_VALUE, xpath)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 106079: /*key*/ return this.key == null ? new Base[0] : new Base[] {this.key}; // IdType + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration + case 99639597: /*human*/ return this.human == null ? new Base[0] : new Base[] {this.human}; // StringType + case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType + case 114256029: /*xpath*/ return this.xpath == null ? new Base[0] : new Base[] {this.xpath}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 106079: // key + this.key = castToId(value); // IdType + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1478300413: // severity + this.severity = new ConstraintSeverityEnumFactory().fromType(value); // Enumeration + break; + case 99639597: // human + this.human = castToString(value); // StringType + break; + case -1795452264: // expression + this.expression = castToString(value); // StringType + break; + case 114256029: // xpath + this.xpath = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("key")) + this.key = castToId(value); // IdType + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("severity")) + this.severity = new ConstraintSeverityEnumFactory().fromType(value); // Enumeration + else if (name.equals("human")) + this.human = castToString(value); // StringType + else if (name.equals("expression")) + this.expression = castToString(value); // StringType + else if (name.equals("xpath")) + this.xpath = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 106079: throw new FHIRException("Cannot make property key as it is not a complex type"); // IdType + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1478300413: throw new FHIRException("Cannot make property severity as it is not a complex type"); // Enumeration + case 99639597: throw new FHIRException("Cannot make property human as it is not a complex type"); // StringType + case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType + case 114256029: throw new FHIRException("Cannot make property xpath as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("key")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.key"); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements"); + } + else if (name.equals("severity")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.severity"); + } + else if (name.equals("human")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.human"); + } + else if (name.equals("expression")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.expression"); + } + else if (name.equals("xpath")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.xpath"); + } + else + return super.addChild(name); + } + + public ElementDefinitionConstraintComponent copy() { + ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent(); + copyValues(dst); + dst.key = key == null ? null : key.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.human = human == null ? null : human.copy(); + dst.expression = expression == null ? null : expression.copy(); + dst.xpath = xpath == null ? null : xpath.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionConstraintComponent)) + return false; + ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other; + return compareDeep(key, o.key, true) && compareDeep(requirements, o.requirements, true) && compareDeep(severity, o.severity, true) + && compareDeep(human, o.human, true) && compareDeep(expression, o.expression, true) && compareDeep(xpath, o.xpath, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionConstraintComponent)) + return false; + ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other; + return compareValues(key, o.key, true) && compareValues(requirements, o.requirements, true) && compareValues(severity, o.severity, true) + && compareValues(human, o.human, true) && compareValues(expression, o.expression, true) && compareValues(xpath, o.xpath, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (key == null || key.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (severity == null || severity.isEmpty()) && (human == null || human.isEmpty()) && (expression == null || expression.isEmpty()) + && (xpath == null || xpath.isEmpty()); + } + + public String fhirType() { + return "ElementDefinition.constraint"; + + } + + } + + @Block() + public static class ElementDefinitionBindingComponent extends Element implements IBaseDatatypeElement { + /** + * Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + @Child(name = "strength", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="required | extensible | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances." ) + protected Enumeration strength; + + /** + * Describes the intended use of this particular set of codes. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." ) + protected StringType description; + + /** + * Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. + */ + @Child(name = "valueSet", type = {UriType.class, ValueSet.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used." ) + protected Type valueSet; + + private static final long serialVersionUID = 1355538460L; + + /** + * Constructor + */ + public ElementDefinitionBindingComponent() { + super(); + } + + /** + * Constructor + */ + public ElementDefinitionBindingComponent(Enumeration strength) { + super(); + this.strength = strength; + } + + /** + * @return {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value + */ + public Enumeration getStrengthElement() { + if (this.strength == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.strength"); + else if (Configuration.doAutoCreate()) + this.strength = new Enumeration(new BindingStrengthEnumFactory()); // bb + return this.strength; + } + + public boolean hasStrengthElement() { + return this.strength != null && !this.strength.isEmpty(); + } + + public boolean hasStrength() { + return this.strength != null && !this.strength.isEmpty(); + } + + /** + * @param value {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value + */ + public ElementDefinitionBindingComponent setStrengthElement(Enumeration value) { + this.strength = value; + return this; + } + + /** + * @return Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + public BindingStrength getStrength() { + return this.strength == null ? null : this.strength.getValue(); + } + + /** + * @param value Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + public ElementDefinitionBindingComponent setStrength(BindingStrength value) { + if (this.strength == null) + this.strength = new Enumeration(new BindingStrengthEnumFactory()); + this.strength.setValue(value); + return this; + } + + /** + * @return {@link #description} (Describes the intended use of this particular set of codes.). 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 ElementDefinitionBindingComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Describes the intended use of this particular set of codes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Describes the intended use of this particular set of codes. + */ + public ElementDefinitionBindingComponent 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 #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public Type getValueSet() { + return this.valueSet; + } + + /** + * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public UriType getValueSetUriType() throws FHIRException { + if (!(this.valueSet instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (UriType) this.valueSet; + } + + public boolean hasValueSetUriType() { + return this.valueSet instanceof UriType; + } + + /** + * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public Reference getValueSetReference() throws FHIRException { + if (!(this.valueSet instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (Reference) this.valueSet; + } + + public boolean hasValueSetReference() { + return this.valueSet instanceof Reference; + } + + public boolean hasValueSet() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + /** + * @param value {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public ElementDefinitionBindingComponent setValueSet(Type value) { + this.valueSet = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("strength", "code", "Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.", 0, java.lang.Integer.MAX_VALUE, strength)); + childrenList.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("valueSet[x]", "uri|Reference(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Enumeration + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1791316033: // strength + this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1410174671: // valueSet + this.valueSet = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("strength")) + this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("valueSet[x]")) + this.valueSet = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1791316033: throw new FHIRException("Cannot make property strength as it is not a complex type"); // Enumeration + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1438410321: return getValueSet(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("strength")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.strength"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.description"); + } + else if (name.equals("valueSetUri")) { + this.valueSet = new UriType(); + return this.valueSet; + } + else if (name.equals("valueSetReference")) { + this.valueSet = new Reference(); + return this.valueSet; + } + else + return super.addChild(name); + } + + public ElementDefinitionBindingComponent copy() { + ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent(); + copyValues(dst); + dst.strength = strength == null ? null : strength.copy(); + dst.description = description == null ? null : description.copy(); + dst.valueSet = valueSet == null ? null : valueSet.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionBindingComponent)) + return false; + ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other; + return compareDeep(strength, o.strength, true) && compareDeep(description, o.description, true) + && compareDeep(valueSet, o.valueSet, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionBindingComponent)) + return false; + ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other; + return compareValues(strength, o.strength, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (strength == null || strength.isEmpty()) && (description == null || description.isEmpty()) + && (valueSet == null || valueSet.isEmpty()); + } + + public String fhirType() { + return "ElementDefinition.binding"; + + } + + } + + @Block() + public static class ElementDefinitionMappingComponent extends Element implements IBaseDatatypeElement { + /** + * An internal reference to the definition of a mapping. + */ + @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." ) + protected IdType identity; + + /** + * Identifies the computable language in which mapping.map is expressed. + */ + @Child(name = "language", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Computable language of mapping", formalDefinition="Identifies the computable language in which mapping.map is expressed." ) + protected CodeType language; + + /** + * Expresses what part of the target specification corresponds to this element. + */ + @Child(name = "map", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @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 = -669205371L; + + /** + * Constructor + */ + public ElementDefinitionMappingComponent() { + super(); + } + + /** + * Constructor + */ + public ElementDefinitionMappingComponent(IdType identity, StringType map) { + super(); + this.identity = identity; + this.map = map; + } + + /** + * @return {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); // bb + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public ElementDefinitionMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An internal reference to the definition of a mapping. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An internal reference to the definition of a mapping. + */ + public ElementDefinitionMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public ElementDefinitionMappingComponent setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return Identifies the computable language in which mapping.map is expressed. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value Identifies the computable language in which mapping.map is expressed. + */ + public ElementDefinitionMappingComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value + */ + public StringType getMapElement() { + if (this.map == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map"); + else if (Configuration.doAutoCreate()) + this.map = new StringType(); // bb + return this.map; + } + + public boolean hasMapElement() { + return this.map != null && !this.map.isEmpty(); + } + + public boolean hasMap() { + return this.map != null && !this.map.isEmpty(); + } + + /** + * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value + */ + public ElementDefinitionMappingComponent setMapElement(StringType value) { + this.map = value; + return this; + } + + /** + * @return Expresses what part of the target specification corresponds to this element. + */ + public String getMap() { + return this.map == null ? null : this.map.getValue(); + } + + /** + * @param value Expresses what part of the target specification corresponds to this element. + */ + public ElementDefinitionMappingComponent setMap(String value) { + if (this.map == null) + this.map = new StringType(); + this.map.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, java.lang.Integer.MAX_VALUE, identity)); + childrenList.add(new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, map)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType + case 107868: /*map*/ return this.map == null ? new Base[0] : new Base[] {this.map}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -135761730: // identity + this.identity = castToId(value); // IdType + break; + case -1613589672: // language + this.language = castToCode(value); // CodeType + break; + case 107868: // map + this.map = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identity")) + this.identity = castToId(value); // IdType + else if (name.equals("language")) + this.language = castToCode(value); // CodeType + else if (name.equals("map")) + this.map = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -135761730: throw new FHIRException("Cannot make property identity as it is not a complex type"); // IdType + case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType + case 107868: throw new FHIRException("Cannot make property map as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identity")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.identity"); + } + else if (name.equals("language")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.language"); + } + else if (name.equals("map")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.map"); + } + else + return super.addChild(name); + } + + public ElementDefinitionMappingComponent copy() { + ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.language = language == null ? null : language.copy(); + dst.map = map == null ? null : map.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionMappingComponent)) + return false; + ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other; + return compareDeep(identity, o.identity, true) && compareDeep(language, o.language, true) && compareDeep(map, o.map, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionMappingComponent)) + return false; + ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other; + return compareValues(identity, o.identity, true) && compareValues(language, o.language, true) && compareValues(map, o.map, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (language == null || language.isEmpty()) + && (map == null || map.isEmpty()); + } + + public String fhirType() { + return "ElementDefinition.mapping"; + + } + + } + + /** + * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + @Child(name = "path", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The path of the element (see the Detailed Descriptions)", formalDefinition="The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource or extension." ) + protected StringType path; + + /** + * Codes that define how this element is represented in instances, when the deviation varies from the normal case. + */ + @Child(name = "representation", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="xmlAttr | xmlText | typeAttr | cdaText", formalDefinition="Codes that define how this element is represented in instances, when the deviation varies from the normal case." ) + protected List> representation; + + /** + * The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name for this particular element definition (reference target)", formalDefinition="The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element." ) + protected StringType name; + + /** + * The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. + */ + @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name for element to display with or prompt for element", formalDefinition="The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form." ) + protected StringType label; + + /** + * A code that provides the meaning for the element according to a particular terminology. + */ + @Child(name = "code", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Defining code", formalDefinition="A code that provides the meaning for the element according to a particular terminology." ) + protected List code; + + /** + * Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). + */ + @Child(name = "slicing", type = {}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="This element is sliced - slices follow", formalDefinition="Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)." ) + protected ElementDefinitionSlicingComponent slicing; + + /** + * A concise description of what this element means (e.g. for use in autogenerated summaries). + */ + @Child(name = "short", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Concise definition for xml presentation", formalDefinition="A concise description of what this element means (e.g. for use in autogenerated summaries)." ) + protected StringType short_; + + /** + * Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + @Child(name = "definition", type = {MarkdownType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Full formal definition as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource." ) + protected MarkdownType definition; + + /** + * Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + @Child(name = "comments", type = {MarkdownType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Comments about the use of this element", formalDefinition="Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc." ) + protected MarkdownType comments; + + /** + * This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. + */ + @Child(name = "requirements", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why this resource has been created", formalDefinition="This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element." ) + protected MarkdownType requirements; + + /** + * Identifies additional names by which this element might also be known. + */ + @Child(name = "alias", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." ) + protected List alias; + + /** + * The minimum number of times this element SHALL appear in the instance. + */ + @Child(name = "min", type = {IntegerType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." ) + protected IntegerType min; + + /** + * The maximum number of times this element is permitted to appear in the instance. + */ + @Child(name = "max", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." ) + protected StringType max; + + /** + * Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition. + */ + @Child(name = "base", type = {}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Base definition information for tools", formalDefinition="Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition." ) + protected ElementDefinitionBaseComponent base; + + /** + * Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element. + */ + @Child(name = "contentReference", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference to definition of content for the element", formalDefinition="Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element." ) + protected UriType contentReference; + + /** + * The data type or resource that the value of this element is permitted to be. + */ + @Child(name = "type", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Data type and Profile for this element", formalDefinition="The data type or resource that the value of this element is permitted to be." ) + protected List type; + + /** + * The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false'). + */ + @Child(name = "defaultValue", type = {}, order=16, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specified value if missing from instance", formalDefinition="The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false')." ) + protected org.hl7.fhir.dstu2016may.model.Type defaultValue; + + /** + * The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'. + */ + @Child(name = "meaningWhenMissing", type = {MarkdownType.class}, order=17, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Implicit meaning when this element is missing", formalDefinition="The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'." ) + protected MarkdownType meaningWhenMissing; + + /** + * Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. + */ + @Child(name = "fixed", type = {}, order=18, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Value must be exactly this", formalDefinition="Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing." ) + protected org.hl7.fhir.dstu2016may.model.Type fixed; + + /** + * Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.). + */ + @Child(name = "pattern", type = {}, order=19, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Value must have at least these property values", formalDefinition="Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.)." ) + protected org.hl7.fhir.dstu2016may.model.Type pattern; + + /** + * A sample value for this element demonstrating the type of information that would typically be captured. + */ + @Child(name = "example", type = {}, order=20, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Example value (as defined for type)", formalDefinition="A sample value for this element demonstrating the type of information that would typically be captured." ) + protected org.hl7.fhir.dstu2016may.model.Type example; + + /** + * The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. + */ + @Child(name = "minValue", type = {}, order=21, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Minimum Allowed Value (for some types)", formalDefinition="The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity." ) + protected org.hl7.fhir.dstu2016may.model.Type minValue; + + /** + * The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. + */ + @Child(name = "maxValue", type = {}, order=22, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Maximum Allowed Value (for some types)", formalDefinition="The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity." ) + protected org.hl7.fhir.dstu2016may.model.Type maxValue; + + /** + * Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + @Child(name = "maxLength", type = {IntegerType.class}, order=23, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Max length for strings", formalDefinition="Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element." ) + protected IntegerType maxLength; + + /** + * A reference to an invariant that may make additional statements about the cardinality or value in the instance. + */ + @Child(name = "condition", type = {IdType.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Reference to invariant about presence", formalDefinition="A reference to an invariant that may make additional statements about the cardinality or value in the instance." ) + protected List condition; + + /** + * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. + */ + @Child(name = "constraint", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Condition that must evaluate to true", formalDefinition="Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance." ) + protected List constraint; + + /** + * If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported. + */ + @Child(name = "mustSupport", type = {BooleanType.class}, order=26, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If the element must supported", formalDefinition="If true, implementations that produce or consume resources SHALL provide \"support\" for the element in some meaningful way. If false, the element may be ignored and not supported." ) + protected BooleanType mustSupport; + + /** + * If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + @Child(name = "isModifier", type = {BooleanType.class}, order=27, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If this modifies the meaning of other elements", formalDefinition="If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system." ) + protected BooleanType isModifier; + + /** + * Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + @Child(name = "isSummary", type = {BooleanType.class}, order=28, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." ) + protected BooleanType isSummary; + + /** + * Binds to a value set if this element is coded (code, Coding, CodeableConcept). + */ + @Child(name = "binding", type = {}, order=29, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)." ) + protected ElementDefinitionBindingComponent binding; + + /** + * Identifies a concept from an external specification that roughly corresponds to this element. + */ + @Child(name = "mapping", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) + protected List mapping; + + private static final long serialVersionUID = -904637873L; + + /** + * Constructor + */ + public ElementDefinition() { + super(); + } + + /** + * Constructor + */ + public ElementDefinition(StringType path) { + super(); + this.path = path; + } + + /** + * @return {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public ElementDefinition setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + public ElementDefinition setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public List> getRepresentation() { + if (this.representation == null) + this.representation = new ArrayList>(); + return this.representation; + } + + public boolean hasRepresentation() { + if (this.representation == null) + return false; + for (Enumeration item : this.representation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + // syntactic sugar + public Enumeration addRepresentationElement() {//2 + Enumeration t = new Enumeration(new PropertyRepresentationEnumFactory()); + if (this.representation == null) + this.representation = new ArrayList>(); + this.representation.add(t); + return t; + } + + /** + * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public ElementDefinition addRepresentation(PropertyRepresentation value) { //1 + Enumeration t = new Enumeration(new PropertyRepresentationEnumFactory()); + t.setValue(value); + if (this.representation == null) + this.representation = new ArrayList>(); + this.representation.add(t); + return this; + } + + /** + * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public boolean hasRepresentation(PropertyRepresentation value) { + if (this.representation == null) + return false; + for (Enumeration v : this.representation) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #name} (The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.). 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 ElementDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ElementDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element. + */ + public ElementDefinition setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #label} (The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public StringType getLabelElement() { + if (this.label == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.label"); + else if (Configuration.doAutoCreate()) + this.label = new StringType(); // bb + return this.label; + } + + public boolean hasLabelElement() { + return this.label != null && !this.label.isEmpty(); + } + + public boolean hasLabel() { + return this.label != null && !this.label.isEmpty(); + } + + /** + * @param value {@link #label} (The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public ElementDefinition setLabelElement(StringType value) { + this.label = value; + return this; + } + + /** + * @return The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. + */ + public String getLabel() { + return this.label == null ? null : this.label.getValue(); + } + + /** + * @param value The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. + */ + public ElementDefinition setLabel(String value) { + if (Utilities.noString(value)) + this.label = null; + else { + if (this.label == null) + this.label = new StringType(); + this.label.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A code that provides the meaning for the element according to a particular terminology.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (Coding item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (A code that provides the meaning for the element according to a particular terminology.) + */ + // syntactic sugar + public Coding addCode() { //3 + Coding t = new Coding(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + // syntactic sugar + public ElementDefinition addCode(Coding t) { //3 + if (t == null) + return this; + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return this; + } + + /** + * @return {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) + */ + public ElementDefinitionSlicingComponent getSlicing() { + if (this.slicing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.slicing"); + else if (Configuration.doAutoCreate()) + this.slicing = new ElementDefinitionSlicingComponent(); // cc + return this.slicing; + } + + public boolean hasSlicing() { + return this.slicing != null && !this.slicing.isEmpty(); + } + + /** + * @param value {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) + */ + public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { + this.slicing = value; + return this; + } + + /** + * @return {@link #short_} (A concise description of what this element means (e.g. for use in autogenerated summaries).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value + */ + public StringType getShortElement() { + if (this.short_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.short_"); + else if (Configuration.doAutoCreate()) + this.short_ = new StringType(); // bb + return this.short_; + } + + public boolean hasShortElement() { + return this.short_ != null && !this.short_.isEmpty(); + } + + public boolean hasShort() { + return this.short_ != null && !this.short_.isEmpty(); + } + + /** + * @param value {@link #short_} (A concise description of what this element means (e.g. for use in autogenerated summaries).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value + */ + public ElementDefinition setShortElement(StringType value) { + this.short_ = value; + return this; + } + + /** + * @return A concise description of what this element means (e.g. for use in autogenerated summaries). + */ + public String getShort() { + return this.short_ == null ? null : this.short_.getValue(); + } + + /** + * @param value A concise description of what this element means (e.g. for use in autogenerated summaries). + */ + public ElementDefinition setShort(String value) { + if (Utilities.noString(value)) + this.short_ = null; + else { + if (this.short_ == null) + this.short_ = new StringType(); + this.short_.setValue(value); + } + return this; + } + + /** + * @return {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public MarkdownType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new MarkdownType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public ElementDefinition setDefinitionElement(MarkdownType value) { + this.definition = value; + return this; + } + + /** + * @return Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + public ElementDefinition setDefinition(String value) { + if (value == null) + this.definition = null; + else { + if (this.definition == null) + this.definition = new MarkdownType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public MarkdownType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new MarkdownType(); // bb + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public ElementDefinition setCommentsElement(MarkdownType value) { + this.comments = value; + return this; + } + + /** + * @return Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + public ElementDefinition setComments(String value) { + if (value == null) + this.comments = null; + else { + if (this.comments == null) + this.comments = new MarkdownType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public MarkdownType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new MarkdownType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ElementDefinition setRequirementsElement(MarkdownType value) { + this.requirements = value; + return this; + } + + /** + * @return This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. + */ + public ElementDefinition setRequirements(String value) { + if (value == null) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new MarkdownType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #alias} (Identifies additional names by which this element might also be known.) + */ + public List getAlias() { + if (this.alias == null) + this.alias = new ArrayList(); + return this.alias; + } + + public boolean hasAlias() { + if (this.alias == null) + return false; + for (StringType item : this.alias) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #alias} (Identifies additional names by which this element might also be known.) + */ + // syntactic sugar + public StringType addAliasElement() {//2 + StringType t = new StringType(); + if (this.alias == null) + this.alias = new ArrayList(); + this.alias.add(t); + return t; + } + + /** + * @param value {@link #alias} (Identifies additional names by which this element might also be known.) + */ + public ElementDefinition addAlias(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.alias == null) + this.alias = new ArrayList(); + this.alias.add(t); + return this; + } + + /** + * @param value {@link #alias} (Identifies additional names by which this element might also be known.) + */ + public boolean hasAlias(String value) { + if (this.alias == null) + return false; + for (StringType v : this.alias) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #min} (The minimum number of times this element SHALL appear in the instance.). 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 ElementDefinition.min"); + else if (Configuration.doAutoCreate()) + this.min = new IntegerType(); // bb + 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 element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public ElementDefinition setMinElement(IntegerType value) { + this.min = value; + return this; + } + + /** + * @return The minimum number of times this element SHALL appear in the instance. + */ + public int getMin() { + return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value The minimum number of times this element SHALL appear in the instance. + */ + public ElementDefinition 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 instance.). 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 ElementDefinition.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + 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 instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public ElementDefinition setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return The maximum number of times this element is permitted to appear in the instance. + */ + 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 instance. + */ + public ElementDefinition setMax(String value) { + if (Utilities.noString(value)) + this.max = null; + else { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + } + return this; + } + + /** + * @return {@link #base} (Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition.) + */ + public ElementDefinitionBaseComponent getBase() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.base"); + else if (Configuration.doAutoCreate()) + this.base = new ElementDefinitionBaseComponent(); // cc + return this.base; + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition.) + */ + public ElementDefinition setBase(ElementDefinitionBaseComponent value) { + this.base = value; + return this; + } + + /** + * @return {@link #contentReference} (Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getContentReference" gives direct access to the value + */ + public UriType getContentReferenceElement() { + if (this.contentReference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.contentReference"); + else if (Configuration.doAutoCreate()) + this.contentReference = new UriType(); // bb + return this.contentReference; + } + + public boolean hasContentReferenceElement() { + return this.contentReference != null && !this.contentReference.isEmpty(); + } + + public boolean hasContentReference() { + return this.contentReference != null && !this.contentReference.isEmpty(); + } + + /** + * @param value {@link #contentReference} (Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getContentReference" gives direct access to the value + */ + public ElementDefinition setContentReferenceElement(UriType value) { + this.contentReference = value; + return this; + } + + /** + * @return Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element. + */ + public String getContentReference() { + return this.contentReference == null ? null : this.contentReference.getValue(); + } + + /** + * @param value Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element. + */ + public ElementDefinition setContentReference(String value) { + if (Utilities.noString(value)) + this.contentReference = null; + else { + if (this.contentReference == null) + this.contentReference = new UriType(); + this.contentReference.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (TypeRefComponent item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) + */ + // syntactic sugar + public TypeRefComponent addType() { //3 + TypeRefComponent t = new TypeRefComponent(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public ElementDefinition addType(TypeRefComponent t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #defaultValue} (The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').) + */ + public org.hl7.fhir.dstu2016may.model.Type getDefaultValue() { + return this.defaultValue; + } + + public boolean hasDefaultValue() { + return this.defaultValue != null && !this.defaultValue.isEmpty(); + } + + /** + * @param value {@link #defaultValue} (The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').) + */ + public ElementDefinition setDefaultValue(org.hl7.fhir.dstu2016may.model.Type value) { + this.defaultValue = value; + return this; + } + + /** + * @return {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value + */ + public MarkdownType getMeaningWhenMissingElement() { + if (this.meaningWhenMissing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing"); + else if (Configuration.doAutoCreate()) + this.meaningWhenMissing = new MarkdownType(); // bb + return this.meaningWhenMissing; + } + + public boolean hasMeaningWhenMissingElement() { + return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); + } + + public boolean hasMeaningWhenMissing() { + return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); + } + + /** + * @param value {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value + */ + public ElementDefinition setMeaningWhenMissingElement(MarkdownType value) { + this.meaningWhenMissing = value; + return this; + } + + /** + * @return The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'. + */ + public String getMeaningWhenMissing() { + return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue(); + } + + /** + * @param value The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'. + */ + public ElementDefinition setMeaningWhenMissing(String value) { + if (value == null) + this.meaningWhenMissing = null; + else { + if (this.meaningWhenMissing == null) + this.meaningWhenMissing = new MarkdownType(); + this.meaningWhenMissing.setValue(value); + } + return this; + } + + /** + * @return {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) + */ + public org.hl7.fhir.dstu2016may.model.Type getFixed() { + return this.fixed; + } + + public boolean hasFixed() { + return this.fixed != null && !this.fixed.isEmpty(); + } + + /** + * @param value {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) + */ + public ElementDefinition setFixed(org.hl7.fhir.dstu2016may.model.Type value) { + this.fixed = value; + return this; + } + + /** + * @return {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).) + */ + public org.hl7.fhir.dstu2016may.model.Type getPattern() { + return this.pattern; + } + + public boolean hasPattern() { + return this.pattern != null && !this.pattern.isEmpty(); + } + + /** + * @param value {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).) + */ + public ElementDefinition setPattern(org.hl7.fhir.dstu2016may.model.Type value) { + this.pattern = value; + return this; + } + + /** + * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) + */ + public org.hl7.fhir.dstu2016may.model.Type getExample() { + return this.example; + } + + public boolean hasExample() { + return this.example != null && !this.example.isEmpty(); + } + + /** + * @param value {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) + */ + public ElementDefinition setExample(org.hl7.fhir.dstu2016may.model.Type value) { + this.example = value; + return this; + } + + /** + * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.) + */ + public org.hl7.fhir.dstu2016may.model.Type getMinValue() { + return this.minValue; + } + + public boolean hasMinValue() { + return this.minValue != null && !this.minValue.isEmpty(); + } + + /** + * @param value {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.) + */ + public ElementDefinition setMinValue(org.hl7.fhir.dstu2016may.model.Type value) { + this.minValue = value; + return this; + } + + /** + * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.) + */ + public org.hl7.fhir.dstu2016may.model.Type getMaxValue() { + return this.maxValue; + } + + public boolean hasMaxValue() { + return this.maxValue != null && !this.maxValue.isEmpty(); + } + + /** + * @param value {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.) + */ + public ElementDefinition setMaxValue(org.hl7.fhir.dstu2016may.model.Type value) { + this.maxValue = value; + return this; + } + + /** + * @return {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public IntegerType getMaxLengthElement() { + if (this.maxLength == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.maxLength"); + else if (Configuration.doAutoCreate()) + this.maxLength = new IntegerType(); // bb + return this.maxLength; + } + + public boolean hasMaxLengthElement() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + public boolean hasMaxLength() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + /** + * @param value {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public ElementDefinition setMaxLengthElement(IntegerType value) { + this.maxLength = value; + return this; + } + + /** + * @return Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + public int getMaxLength() { + return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue(); + } + + /** + * @param value Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + public ElementDefinition setMaxLength(int value) { + if (this.maxLength == null) + this.maxLength = new IntegerType(); + this.maxLength.setValue(value); + return this; + } + + /** + * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (IdType item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + // syntactic sugar + public IdType addConditionElement() {//2 + IdType t = new IdType(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public ElementDefinition addCondition(String value) { //1 + IdType t = new IdType(); + t.setValue(value); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + /** + * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public boolean hasCondition(String value) { + if (this.condition == null) + return false; + for (IdType v : this.condition) + if (v.equals(value)) // id + return true; + return false; + } + + /** + * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) + */ + public List getConstraint() { + if (this.constraint == null) + this.constraint = new ArrayList(); + return this.constraint; + } + + public boolean hasConstraint() { + if (this.constraint == null) + return false; + for (ElementDefinitionConstraintComponent item : this.constraint) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) + */ + // syntactic sugar + public ElementDefinitionConstraintComponent addConstraint() { //3 + ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent(); + if (this.constraint == null) + this.constraint = new ArrayList(); + this.constraint.add(t); + return t; + } + + // syntactic sugar + public ElementDefinition addConstraint(ElementDefinitionConstraintComponent t) { //3 + if (t == null) + return this; + if (this.constraint == null) + this.constraint = new ArrayList(); + this.constraint.add(t); + return this; + } + + /** + * @return {@link #mustSupport} (If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value + */ + public BooleanType getMustSupportElement() { + if (this.mustSupport == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.mustSupport"); + else if (Configuration.doAutoCreate()) + this.mustSupport = new BooleanType(); // bb + return this.mustSupport; + } + + public boolean hasMustSupportElement() { + return this.mustSupport != null && !this.mustSupport.isEmpty(); + } + + public boolean hasMustSupport() { + return this.mustSupport != null && !this.mustSupport.isEmpty(); + } + + /** + * @param value {@link #mustSupport} (If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value + */ + public ElementDefinition setMustSupportElement(BooleanType value) { + this.mustSupport = value; + return this; + } + + /** + * @return If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported. + */ + public boolean getMustSupport() { + return this.mustSupport == null || this.mustSupport.isEmpty() ? false : this.mustSupport.getValue(); + } + + /** + * @param value If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported. + */ + public ElementDefinition setMustSupport(boolean value) { + if (this.mustSupport == null) + this.mustSupport = new BooleanType(); + this.mustSupport.setValue(value); + return this; + } + + /** + * @return {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value + */ + public BooleanType getIsModifierElement() { + if (this.isModifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.isModifier"); + else if (Configuration.doAutoCreate()) + this.isModifier = new BooleanType(); // bb + return this.isModifier; + } + + public boolean hasIsModifierElement() { + return this.isModifier != null && !this.isModifier.isEmpty(); + } + + public boolean hasIsModifier() { + return this.isModifier != null && !this.isModifier.isEmpty(); + } + + /** + * @param value {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value + */ + public ElementDefinition setIsModifierElement(BooleanType value) { + this.isModifier = value; + return this; + } + + /** + * @return If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + public boolean getIsModifier() { + return this.isModifier == null || this.isModifier.isEmpty() ? false : this.isModifier.getValue(); + } + + /** + * @param value If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + public ElementDefinition setIsModifier(boolean value) { + if (this.isModifier == null) + this.isModifier = new BooleanType(); + this.isModifier.setValue(value); + return this; + } + + /** + * @return {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value + */ + public BooleanType getIsSummaryElement() { + if (this.isSummary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.isSummary"); + else if (Configuration.doAutoCreate()) + this.isSummary = new BooleanType(); // bb + return this.isSummary; + } + + public boolean hasIsSummaryElement() { + return this.isSummary != null && !this.isSummary.isEmpty(); + } + + public boolean hasIsSummary() { + return this.isSummary != null && !this.isSummary.isEmpty(); + } + + /** + * @param value {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value + */ + public ElementDefinition setIsSummaryElement(BooleanType value) { + this.isSummary = value; + return this; + } + + /** + * @return Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + public boolean getIsSummary() { + return this.isSummary == null || this.isSummary.isEmpty() ? false : this.isSummary.getValue(); + } + + /** + * @param value Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + public ElementDefinition setIsSummary(boolean value) { + if (this.isSummary == null) + this.isSummary = new BooleanType(); + this.isSummary.setValue(value); + return this; + } + + /** + * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) + */ + public ElementDefinitionBindingComponent getBinding() { + if (this.binding == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.binding"); + else if (Configuration.doAutoCreate()) + this.binding = new ElementDefinitionBindingComponent(); // cc + return this.binding; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) + */ + public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { + this.binding = value; + return this; + } + + /** + * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (ElementDefinitionMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) + */ + // syntactic sugar + public ElementDefinitionMappingComponent addMapping() { //3 + ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + // syntactic sugar + public ElementDefinition addMapping(ElementDefinitionMappingComponent t) { //3 + if (t == null) + return this; + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource or extension.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("representation", "code", "Codes that define how this element is represented in instances, when the deviation varies from the normal case.", 0, java.lang.Integer.MAX_VALUE, representation)); + childrenList.add(new Property("name", "string", "The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("label", "string", "The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.", 0, java.lang.Integer.MAX_VALUE, label)); + childrenList.add(new Property("code", "Coding", "A code that provides the meaning for the element according to a particular terminology.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("slicing", "", "Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).", 0, java.lang.Integer.MAX_VALUE, slicing)); + childrenList.add(new Property("short", "string", "A concise description of what this element means (e.g. for use in autogenerated summaries).", 0, java.lang.Integer.MAX_VALUE, short_)); + childrenList.add(new Property("definition", "markdown", "Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("comments", "markdown", "Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, java.lang.Integer.MAX_VALUE, comments)); + childrenList.add(new Property("requirements", "markdown", "This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("alias", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, alias)); + childrenList.add(new Property("min", "integer", "The minimum number of times this element SHALL appear in the instance.", 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 instance.", 0, java.lang.Integer.MAX_VALUE, max)); + childrenList.add(new Property("base", "", "Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("contentReference", "uri", "Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.", 0, java.lang.Integer.MAX_VALUE, contentReference)); + childrenList.add(new Property("type", "", "The data type or resource that the value of this element is permitted to be.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, java.lang.Integer.MAX_VALUE, defaultValue)); + childrenList.add(new Property("meaningWhenMissing", "markdown", "The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.", 0, java.lang.Integer.MAX_VALUE, meaningWhenMissing)); + childrenList.add(new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, java.lang.Integer.MAX_VALUE, fixed)); + childrenList.add(new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, java.lang.Integer.MAX_VALUE, pattern)); + childrenList.add(new Property("example[x]", "*", "A 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("minValue[x]", "*", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, java.lang.Integer.MAX_VALUE, minValue)); + childrenList.add(new Property("maxValue[x]", "*", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, java.lang.Integer.MAX_VALUE, maxValue)); + childrenList.add(new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, java.lang.Integer.MAX_VALUE, maxLength)); + childrenList.add(new Property("condition", "id", "A reference to an invariant that may make additional statements about the cardinality or value in the instance.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("constraint", "", "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.", 0, java.lang.Integer.MAX_VALUE, constraint)); + childrenList.add(new Property("mustSupport", "boolean", "If true, implementations that produce or consume resources SHALL provide \"support\" for the element in some meaningful way. If false, the element may be ignored and not supported.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); + childrenList.add(new Property("isModifier", "boolean", "If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.", 0, java.lang.Integer.MAX_VALUE, isModifier)); + childrenList.add(new Property("isSummary", "boolean", "Whether the element should be included if a client requests a search with the parameter _summary=true.", 0, java.lang.Integer.MAX_VALUE, isSummary)); + 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)); + childrenList.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case -671065907: /*representation*/ return this.representation == null ? new Base[0] : this.representation.toArray(new Base[this.representation.size()]); // Enumeration + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding + case -2119287345: /*slicing*/ return this.slicing == null ? new Base[0] : new Base[] {this.slicing}; // ElementDefinitionSlicingComponent + case 109413500: /*short*/ return this.short_ == null ? new Base[0] : new Base[] {this.short_}; // StringType + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // MarkdownType + case -602415628: /*comments*/ return this.comments == null ? new Base[0] : new Base[] {this.comments}; // MarkdownType + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // MarkdownType + case 92902992: /*alias*/ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType + case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType + case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType + case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // ElementDefinitionBaseComponent + case 1193747154: /*contentReference*/ return this.contentReference == null ? new Base[0] : new Base[] {this.contentReference}; // UriType + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // TypeRefComponent + case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // org.hl7.fhir.dstu2016may.model.Type + case 1857257103: /*meaningWhenMissing*/ return this.meaningWhenMissing == null ? new Base[0] : new Base[] {this.meaningWhenMissing}; // MarkdownType + case 97445748: /*fixed*/ return this.fixed == null ? new Base[0] : new Base[] {this.fixed}; // org.hl7.fhir.dstu2016may.model.Type + case -791090288: /*pattern*/ return this.pattern == null ? new Base[0] : new Base[] {this.pattern}; // org.hl7.fhir.dstu2016may.model.Type + case -1322970774: /*example*/ return this.example == null ? new Base[0] : new Base[] {this.example}; // org.hl7.fhir.dstu2016may.model.Type + case -1376969153: /*minValue*/ return this.minValue == null ? new Base[0] : new Base[] {this.minValue}; // org.hl7.fhir.dstu2016may.model.Type + case 399227501: /*maxValue*/ return this.maxValue == null ? new Base[0] : new Base[] {this.maxValue}; // org.hl7.fhir.dstu2016may.model.Type + case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // IdType + case -190376483: /*constraint*/ return this.constraint == null ? new Base[0] : this.constraint.toArray(new Base[this.constraint.size()]); // ElementDefinitionConstraintComponent + case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : new Base[] {this.mustSupport}; // BooleanType + case -1408783839: /*isModifier*/ return this.isModifier == null ? new Base[0] : new Base[] {this.isModifier}; // BooleanType + case 1857548060: /*isSummary*/ return this.isSummary == null ? new Base[0] : new Base[] {this.isSummary}; // BooleanType + case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // ElementDefinitionBindingComponent + case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // ElementDefinitionMappingComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3433509: // path + this.path = castToString(value); // StringType + break; + case -671065907: // representation + this.getRepresentation().add(new PropertyRepresentationEnumFactory().fromType(value)); // Enumeration + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 102727412: // label + this.label = castToString(value); // StringType + break; + case 3059181: // code + this.getCode().add(castToCoding(value)); // Coding + break; + case -2119287345: // slicing + this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent + break; + case 109413500: // short + this.short_ = castToString(value); // StringType + break; + case -1014418093: // definition + this.definition = castToMarkdown(value); // MarkdownType + break; + case -602415628: // comments + this.comments = castToMarkdown(value); // MarkdownType + break; + case -1619874672: // requirements + this.requirements = castToMarkdown(value); // MarkdownType + break; + case 92902992: // alias + this.getAlias().add(castToString(value)); // StringType + break; + case 108114: // min + this.min = castToInteger(value); // IntegerType + break; + case 107876: // max + this.max = castToString(value); // StringType + break; + case 3016401: // base + this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent + break; + case 1193747154: // contentReference + this.contentReference = castToUri(value); // UriType + break; + case 3575610: // type + this.getType().add((TypeRefComponent) value); // TypeRefComponent + break; + case -659125328: // defaultValue + this.defaultValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + case 1857257103: // meaningWhenMissing + this.meaningWhenMissing = castToMarkdown(value); // MarkdownType + break; + case 97445748: // fixed + this.fixed = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + case -791090288: // pattern + this.pattern = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + case -1322970774: // example + this.example = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + case -1376969153: // minValue + this.minValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + case 399227501: // maxValue + this.maxValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + case -791400086: // maxLength + this.maxLength = castToInteger(value); // IntegerType + break; + case -861311717: // condition + this.getCondition().add(castToId(value)); // IdType + break; + case -190376483: // constraint + this.getConstraint().add((ElementDefinitionConstraintComponent) value); // ElementDefinitionConstraintComponent + break; + case -1402857082: // mustSupport + this.mustSupport = castToBoolean(value); // BooleanType + break; + case -1408783839: // isModifier + this.isModifier = castToBoolean(value); // BooleanType + break; + case 1857548060: // isSummary + this.isSummary = castToBoolean(value); // BooleanType + break; + case -108220795: // binding + this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent + break; + case 837556430: // mapping + this.getMapping().add((ElementDefinitionMappingComponent) value); // ElementDefinitionMappingComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("representation")) + this.getRepresentation().add(new PropertyRepresentationEnumFactory().fromType(value)); + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("label")) + this.label = castToString(value); // StringType + else if (name.equals("code")) + this.getCode().add(castToCoding(value)); + else if (name.equals("slicing")) + this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent + else if (name.equals("short")) + this.short_ = castToString(value); // StringType + else if (name.equals("definition")) + this.definition = castToMarkdown(value); // MarkdownType + else if (name.equals("comments")) + this.comments = castToMarkdown(value); // MarkdownType + else if (name.equals("requirements")) + this.requirements = castToMarkdown(value); // MarkdownType + else if (name.equals("alias")) + this.getAlias().add(castToString(value)); + else if (name.equals("min")) + this.min = castToInteger(value); // IntegerType + else if (name.equals("max")) + this.max = castToString(value); // StringType + else if (name.equals("base")) + this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent + else if (name.equals("contentReference")) + this.contentReference = castToUri(value); // UriType + else if (name.equals("type")) + this.getType().add((TypeRefComponent) value); + else if (name.equals("defaultValue[x]")) + this.defaultValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else if (name.equals("meaningWhenMissing")) + this.meaningWhenMissing = castToMarkdown(value); // MarkdownType + else if (name.equals("fixed[x]")) + this.fixed = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else if (name.equals("pattern[x]")) + this.pattern = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else if (name.equals("example[x]")) + this.example = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else if (name.equals("minValue[x]")) + this.minValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else if (name.equals("maxValue[x]")) + this.maxValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else if (name.equals("maxLength")) + this.maxLength = castToInteger(value); // IntegerType + else if (name.equals("condition")) + this.getCondition().add(castToId(value)); + else if (name.equals("constraint")) + this.getConstraint().add((ElementDefinitionConstraintComponent) value); + else if (name.equals("mustSupport")) + this.mustSupport = castToBoolean(value); // BooleanType + else if (name.equals("isModifier")) + this.isModifier = castToBoolean(value); // BooleanType + else if (name.equals("isSummary")) + this.isSummary = castToBoolean(value); // BooleanType + else if (name.equals("binding")) + this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent + else if (name.equals("mapping")) + this.getMapping().add((ElementDefinitionMappingComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case -671065907: throw new FHIRException("Cannot make property representation as it is not a complex type"); // Enumeration + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType + case 3059181: return addCode(); // Coding + case -2119287345: return getSlicing(); // ElementDefinitionSlicingComponent + case 109413500: throw new FHIRException("Cannot make property short as it is not a complex type"); // StringType + case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // MarkdownType + case -602415628: throw new FHIRException("Cannot make property comments as it is not a complex type"); // MarkdownType + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // MarkdownType + case 92902992: throw new FHIRException("Cannot make property alias as it is not a complex type"); // StringType + case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType + case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType + case 3016401: return getBase(); // ElementDefinitionBaseComponent + case 1193747154: throw new FHIRException("Cannot make property contentReference as it is not a complex type"); // UriType + case 3575610: return addType(); // TypeRefComponent + case 587922128: return getDefaultValue(); // org.hl7.fhir.dstu2016may.model.Type + case 1857257103: throw new FHIRException("Cannot make property meaningWhenMissing as it is not a complex type"); // MarkdownType + case -391522164: return getFixed(); // org.hl7.fhir.dstu2016may.model.Type + case -885125392: return getPattern(); // org.hl7.fhir.dstu2016may.model.Type + case -2002328874: return getExample(); // org.hl7.fhir.dstu2016may.model.Type + case -55301663: return getMinValue(); // org.hl7.fhir.dstu2016may.model.Type + case 622130931: return getMaxValue(); // org.hl7.fhir.dstu2016may.model.Type + case -791400086: throw new FHIRException("Cannot make property maxLength as it is not a complex type"); // IntegerType + case -861311717: throw new FHIRException("Cannot make property condition as it is not a complex type"); // IdType + case -190376483: return addConstraint(); // ElementDefinitionConstraintComponent + case -1402857082: throw new FHIRException("Cannot make property mustSupport as it is not a complex type"); // BooleanType + case -1408783839: throw new FHIRException("Cannot make property isModifier as it is not a complex type"); // BooleanType + case 1857548060: throw new FHIRException("Cannot make property isSummary as it is not a complex type"); // BooleanType + case -108220795: return getBinding(); // ElementDefinitionBindingComponent + case 837556430: return addMapping(); // ElementDefinitionMappingComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path"); + } + else if (name.equals("representation")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.representation"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.name"); + } + else if (name.equals("label")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.label"); + } + else if (name.equals("code")) { + return addCode(); + } + else if (name.equals("slicing")) { + this.slicing = new ElementDefinitionSlicingComponent(); + return this.slicing; + } + else if (name.equals("short")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.short"); + } + else if (name.equals("definition")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.definition"); + } + else if (name.equals("comments")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.comments"); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements"); + } + else if (name.equals("alias")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.alias"); + } + else if (name.equals("min")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.min"); + } + else if (name.equals("max")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.max"); + } + else if (name.equals("base")) { + this.base = new ElementDefinitionBaseComponent(); + return this.base; + } + else if (name.equals("contentReference")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.contentReference"); + } + else if (name.equals("type")) { + return addType(); + } + else if (name.equals("defaultValueBoolean")) { + this.defaultValue = new BooleanType(); + return this.defaultValue; + } + else if (name.equals("defaultValueInteger")) { + this.defaultValue = new IntegerType(); + return this.defaultValue; + } + else if (name.equals("defaultValueDecimal")) { + this.defaultValue = new DecimalType(); + return this.defaultValue; + } + else if (name.equals("defaultValueBase64Binary")) { + this.defaultValue = new Base64BinaryType(); + return this.defaultValue; + } + else if (name.equals("defaultValueInstant")) { + this.defaultValue = new InstantType(); + return this.defaultValue; + } + else if (name.equals("defaultValueString")) { + this.defaultValue = new StringType(); + return this.defaultValue; + } + else if (name.equals("defaultValueUri")) { + this.defaultValue = new UriType(); + return this.defaultValue; + } + else if (name.equals("defaultValueDate")) { + this.defaultValue = new DateType(); + return this.defaultValue; + } + else if (name.equals("defaultValueDateTime")) { + this.defaultValue = new DateTimeType(); + return this.defaultValue; + } + else if (name.equals("defaultValueTime")) { + this.defaultValue = new TimeType(); + return this.defaultValue; + } + else if (name.equals("defaultValueCode")) { + this.defaultValue = new CodeType(); + return this.defaultValue; + } + else if (name.equals("defaultValueOid")) { + this.defaultValue = new OidType(); + return this.defaultValue; + } + else if (name.equals("defaultValueId")) { + this.defaultValue = new IdType(); + return this.defaultValue; + } + else if (name.equals("defaultValueUnsignedInt")) { + this.defaultValue = new UnsignedIntType(); + return this.defaultValue; + } + else if (name.equals("defaultValuePositiveInt")) { + this.defaultValue = new PositiveIntType(); + return this.defaultValue; + } + else if (name.equals("defaultValueMarkdown")) { + this.defaultValue = new MarkdownType(); + return this.defaultValue; + } + else if (name.equals("defaultValueAnnotation")) { + this.defaultValue = new Annotation(); + return this.defaultValue; + } + else if (name.equals("defaultValueAttachment")) { + this.defaultValue = new Attachment(); + return this.defaultValue; + } + else if (name.equals("defaultValueIdentifier")) { + this.defaultValue = new Identifier(); + return this.defaultValue; + } + else if (name.equals("defaultValueCodeableConcept")) { + this.defaultValue = new CodeableConcept(); + return this.defaultValue; + } + else if (name.equals("defaultValueCoding")) { + this.defaultValue = new Coding(); + return this.defaultValue; + } + else if (name.equals("defaultValueQuantity")) { + this.defaultValue = new Quantity(); + return this.defaultValue; + } + else if (name.equals("defaultValueRange")) { + this.defaultValue = new Range(); + return this.defaultValue; + } + else if (name.equals("defaultValuePeriod")) { + this.defaultValue = new Period(); + return this.defaultValue; + } + else if (name.equals("defaultValueRatio")) { + this.defaultValue = new Ratio(); + return this.defaultValue; + } + else if (name.equals("defaultValueSampledData")) { + this.defaultValue = new SampledData(); + return this.defaultValue; + } + else if (name.equals("defaultValueSignature")) { + this.defaultValue = new Signature(); + return this.defaultValue; + } + else if (name.equals("defaultValueHumanName")) { + this.defaultValue = new HumanName(); + return this.defaultValue; + } + else if (name.equals("defaultValueAddress")) { + this.defaultValue = new Address(); + return this.defaultValue; + } + else if (name.equals("defaultValueContactPoint")) { + this.defaultValue = new ContactPoint(); + return this.defaultValue; + } + else if (name.equals("defaultValueTiming")) { + this.defaultValue = new Timing(); + return this.defaultValue; + } + else if (name.equals("defaultValueReference")) { + this.defaultValue = new Reference(); + return this.defaultValue; + } + else if (name.equals("defaultValueMeta")) { + this.defaultValue = new Meta(); + return this.defaultValue; + } + else if (name.equals("meaningWhenMissing")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.meaningWhenMissing"); + } + else if (name.equals("fixedBoolean")) { + this.fixed = new BooleanType(); + return this.fixed; + } + else if (name.equals("fixedInteger")) { + this.fixed = new IntegerType(); + return this.fixed; + } + else if (name.equals("fixedDecimal")) { + this.fixed = new DecimalType(); + return this.fixed; + } + else if (name.equals("fixedBase64Binary")) { + this.fixed = new Base64BinaryType(); + return this.fixed; + } + else if (name.equals("fixedInstant")) { + this.fixed = new InstantType(); + return this.fixed; + } + else if (name.equals("fixedString")) { + this.fixed = new StringType(); + return this.fixed; + } + else if (name.equals("fixedUri")) { + this.fixed = new UriType(); + return this.fixed; + } + else if (name.equals("fixedDate")) { + this.fixed = new DateType(); + return this.fixed; + } + else if (name.equals("fixedDateTime")) { + this.fixed = new DateTimeType(); + return this.fixed; + } + else if (name.equals("fixedTime")) { + this.fixed = new TimeType(); + return this.fixed; + } + else if (name.equals("fixedCode")) { + this.fixed = new CodeType(); + return this.fixed; + } + else if (name.equals("fixedOid")) { + this.fixed = new OidType(); + return this.fixed; + } + else if (name.equals("fixedId")) { + this.fixed = new IdType(); + return this.fixed; + } + else if (name.equals("fixedUnsignedInt")) { + this.fixed = new UnsignedIntType(); + return this.fixed; + } + else if (name.equals("fixedPositiveInt")) { + this.fixed = new PositiveIntType(); + return this.fixed; + } + else if (name.equals("fixedMarkdown")) { + this.fixed = new MarkdownType(); + return this.fixed; + } + else if (name.equals("fixedAnnotation")) { + this.fixed = new Annotation(); + return this.fixed; + } + else if (name.equals("fixedAttachment")) { + this.fixed = new Attachment(); + return this.fixed; + } + else if (name.equals("fixedIdentifier")) { + this.fixed = new Identifier(); + return this.fixed; + } + else if (name.equals("fixedCodeableConcept")) { + this.fixed = new CodeableConcept(); + return this.fixed; + } + else if (name.equals("fixedCoding")) { + this.fixed = new Coding(); + return this.fixed; + } + else if (name.equals("fixedQuantity")) { + this.fixed = new Quantity(); + return this.fixed; + } + else if (name.equals("fixedRange")) { + this.fixed = new Range(); + return this.fixed; + } + else if (name.equals("fixedPeriod")) { + this.fixed = new Period(); + return this.fixed; + } + else if (name.equals("fixedRatio")) { + this.fixed = new Ratio(); + return this.fixed; + } + else if (name.equals("fixedSampledData")) { + this.fixed = new SampledData(); + return this.fixed; + } + else if (name.equals("fixedSignature")) { + this.fixed = new Signature(); + return this.fixed; + } + else if (name.equals("fixedHumanName")) { + this.fixed = new HumanName(); + return this.fixed; + } + else if (name.equals("fixedAddress")) { + this.fixed = new Address(); + return this.fixed; + } + else if (name.equals("fixedContactPoint")) { + this.fixed = new ContactPoint(); + return this.fixed; + } + else if (name.equals("fixedTiming")) { + this.fixed = new Timing(); + return this.fixed; + } + else if (name.equals("fixedReference")) { + this.fixed = new Reference(); + return this.fixed; + } + else if (name.equals("fixedMeta")) { + this.fixed = new Meta(); + return this.fixed; + } + else if (name.equals("patternBoolean")) { + this.pattern = new BooleanType(); + return this.pattern; + } + else if (name.equals("patternInteger")) { + this.pattern = new IntegerType(); + return this.pattern; + } + else if (name.equals("patternDecimal")) { + this.pattern = new DecimalType(); + return this.pattern; + } + else if (name.equals("patternBase64Binary")) { + this.pattern = new Base64BinaryType(); + return this.pattern; + } + else if (name.equals("patternInstant")) { + this.pattern = new InstantType(); + return this.pattern; + } + else if (name.equals("patternString")) { + this.pattern = new StringType(); + return this.pattern; + } + else if (name.equals("patternUri")) { + this.pattern = new UriType(); + return this.pattern; + } + else if (name.equals("patternDate")) { + this.pattern = new DateType(); + return this.pattern; + } + else if (name.equals("patternDateTime")) { + this.pattern = new DateTimeType(); + return this.pattern; + } + else if (name.equals("patternTime")) { + this.pattern = new TimeType(); + return this.pattern; + } + else if (name.equals("patternCode")) { + this.pattern = new CodeType(); + return this.pattern; + } + else if (name.equals("patternOid")) { + this.pattern = new OidType(); + return this.pattern; + } + else if (name.equals("patternId")) { + this.pattern = new IdType(); + return this.pattern; + } + else if (name.equals("patternUnsignedInt")) { + this.pattern = new UnsignedIntType(); + return this.pattern; + } + else if (name.equals("patternPositiveInt")) { + this.pattern = new PositiveIntType(); + return this.pattern; + } + else if (name.equals("patternMarkdown")) { + this.pattern = new MarkdownType(); + return this.pattern; + } + else if (name.equals("patternAnnotation")) { + this.pattern = new Annotation(); + return this.pattern; + } + else if (name.equals("patternAttachment")) { + this.pattern = new Attachment(); + return this.pattern; + } + else if (name.equals("patternIdentifier")) { + this.pattern = new Identifier(); + return this.pattern; + } + else if (name.equals("patternCodeableConcept")) { + this.pattern = new CodeableConcept(); + return this.pattern; + } + else if (name.equals("patternCoding")) { + this.pattern = new Coding(); + return this.pattern; + } + else if (name.equals("patternQuantity")) { + this.pattern = new Quantity(); + return this.pattern; + } + else if (name.equals("patternRange")) { + this.pattern = new Range(); + return this.pattern; + } + else if (name.equals("patternPeriod")) { + this.pattern = new Period(); + return this.pattern; + } + else if (name.equals("patternRatio")) { + this.pattern = new Ratio(); + return this.pattern; + } + else if (name.equals("patternSampledData")) { + this.pattern = new SampledData(); + return this.pattern; + } + else if (name.equals("patternSignature")) { + this.pattern = new Signature(); + return this.pattern; + } + else if (name.equals("patternHumanName")) { + this.pattern = new HumanName(); + return this.pattern; + } + else if (name.equals("patternAddress")) { + this.pattern = new Address(); + return this.pattern; + } + else if (name.equals("patternContactPoint")) { + this.pattern = new ContactPoint(); + return this.pattern; + } + else if (name.equals("patternTiming")) { + this.pattern = new Timing(); + return this.pattern; + } + else if (name.equals("patternReference")) { + this.pattern = new Reference(); + return this.pattern; + } + else if (name.equals("patternMeta")) { + this.pattern = new Meta(); + return this.pattern; + } + else if (name.equals("exampleBoolean")) { + this.example = new BooleanType(); + return this.example; + } + else if (name.equals("exampleInteger")) { + this.example = new IntegerType(); + return this.example; + } + else if (name.equals("exampleDecimal")) { + this.example = new DecimalType(); + return this.example; + } + else if (name.equals("exampleBase64Binary")) { + this.example = new Base64BinaryType(); + return this.example; + } + else if (name.equals("exampleInstant")) { + this.example = new InstantType(); + return this.example; + } + else if (name.equals("exampleString")) { + this.example = new StringType(); + return this.example; + } + else if (name.equals("exampleUri")) { + this.example = new UriType(); + return this.example; + } + else if (name.equals("exampleDate")) { + this.example = new DateType(); + return this.example; + } + else if (name.equals("exampleDateTime")) { + this.example = new DateTimeType(); + return this.example; + } + else if (name.equals("exampleTime")) { + this.example = new TimeType(); + return this.example; + } + else if (name.equals("exampleCode")) { + this.example = new CodeType(); + return this.example; + } + else if (name.equals("exampleOid")) { + this.example = new OidType(); + return this.example; + } + else if (name.equals("exampleId")) { + this.example = new IdType(); + return this.example; + } + else if (name.equals("exampleUnsignedInt")) { + this.example = new UnsignedIntType(); + return this.example; + } + else if (name.equals("examplePositiveInt")) { + this.example = new PositiveIntType(); + return this.example; + } + else if (name.equals("exampleMarkdown")) { + this.example = new MarkdownType(); + return this.example; + } + else if (name.equals("exampleAnnotation")) { + this.example = new Annotation(); + return this.example; + } + else if (name.equals("exampleAttachment")) { + this.example = new Attachment(); + return this.example; + } + else if (name.equals("exampleIdentifier")) { + this.example = new Identifier(); + return this.example; + } + else if (name.equals("exampleCodeableConcept")) { + this.example = new CodeableConcept(); + return this.example; + } + else if (name.equals("exampleCoding")) { + this.example = new Coding(); + return this.example; + } + else if (name.equals("exampleQuantity")) { + this.example = new Quantity(); + return this.example; + } + else if (name.equals("exampleRange")) { + this.example = new Range(); + return this.example; + } + else if (name.equals("examplePeriod")) { + this.example = new Period(); + return this.example; + } + else if (name.equals("exampleRatio")) { + this.example = new Ratio(); + return this.example; + } + else if (name.equals("exampleSampledData")) { + this.example = new SampledData(); + return this.example; + } + else if (name.equals("exampleSignature")) { + this.example = new Signature(); + return this.example; + } + else if (name.equals("exampleHumanName")) { + this.example = new HumanName(); + return this.example; + } + else if (name.equals("exampleAddress")) { + this.example = new Address(); + return this.example; + } + else if (name.equals("exampleContactPoint")) { + this.example = new ContactPoint(); + return this.example; + } + else if (name.equals("exampleTiming")) { + this.example = new Timing(); + return this.example; + } + else if (name.equals("exampleReference")) { + this.example = new Reference(); + return this.example; + } + else if (name.equals("exampleMeta")) { + this.example = new Meta(); + return this.example; + } + else if (name.equals("minValueBoolean")) { + this.minValue = new BooleanType(); + return this.minValue; + } + else if (name.equals("minValueInteger")) { + this.minValue = new IntegerType(); + return this.minValue; + } + else if (name.equals("minValueDecimal")) { + this.minValue = new DecimalType(); + return this.minValue; + } + else if (name.equals("minValueBase64Binary")) { + this.minValue = new Base64BinaryType(); + return this.minValue; + } + else if (name.equals("minValueInstant")) { + this.minValue = new InstantType(); + return this.minValue; + } + else if (name.equals("minValueString")) { + this.minValue = new StringType(); + return this.minValue; + } + else if (name.equals("minValueUri")) { + this.minValue = new UriType(); + return this.minValue; + } + else if (name.equals("minValueDate")) { + this.minValue = new DateType(); + return this.minValue; + } + else if (name.equals("minValueDateTime")) { + this.minValue = new DateTimeType(); + return this.minValue; + } + else if (name.equals("minValueTime")) { + this.minValue = new TimeType(); + return this.minValue; + } + else if (name.equals("minValueCode")) { + this.minValue = new CodeType(); + return this.minValue; + } + else if (name.equals("minValueOid")) { + this.minValue = new OidType(); + return this.minValue; + } + else if (name.equals("minValueId")) { + this.minValue = new IdType(); + return this.minValue; + } + else if (name.equals("minValueUnsignedInt")) { + this.minValue = new UnsignedIntType(); + return this.minValue; + } + else if (name.equals("minValuePositiveInt")) { + this.minValue = new PositiveIntType(); + return this.minValue; + } + else if (name.equals("minValueMarkdown")) { + this.minValue = new MarkdownType(); + return this.minValue; + } + else if (name.equals("minValueAnnotation")) { + this.minValue = new Annotation(); + return this.minValue; + } + else if (name.equals("minValueAttachment")) { + this.minValue = new Attachment(); + return this.minValue; + } + else if (name.equals("minValueIdentifier")) { + this.minValue = new Identifier(); + return this.minValue; + } + else if (name.equals("minValueCodeableConcept")) { + this.minValue = new CodeableConcept(); + return this.minValue; + } + else if (name.equals("minValueCoding")) { + this.minValue = new Coding(); + return this.minValue; + } + else if (name.equals("minValueQuantity")) { + this.minValue = new Quantity(); + return this.minValue; + } + else if (name.equals("minValueRange")) { + this.minValue = new Range(); + return this.minValue; + } + else if (name.equals("minValuePeriod")) { + this.minValue = new Period(); + return this.minValue; + } + else if (name.equals("minValueRatio")) { + this.minValue = new Ratio(); + return this.minValue; + } + else if (name.equals("minValueSampledData")) { + this.minValue = new SampledData(); + return this.minValue; + } + else if (name.equals("minValueSignature")) { + this.minValue = new Signature(); + return this.minValue; + } + else if (name.equals("minValueHumanName")) { + this.minValue = new HumanName(); + return this.minValue; + } + else if (name.equals("minValueAddress")) { + this.minValue = new Address(); + return this.minValue; + } + else if (name.equals("minValueContactPoint")) { + this.minValue = new ContactPoint(); + return this.minValue; + } + else if (name.equals("minValueTiming")) { + this.minValue = new Timing(); + return this.minValue; + } + else if (name.equals("minValueReference")) { + this.minValue = new Reference(); + return this.minValue; + } + else if (name.equals("minValueMeta")) { + this.minValue = new Meta(); + return this.minValue; + } + else if (name.equals("maxValueBoolean")) { + this.maxValue = new BooleanType(); + return this.maxValue; + } + else if (name.equals("maxValueInteger")) { + this.maxValue = new IntegerType(); + return this.maxValue; + } + else if (name.equals("maxValueDecimal")) { + this.maxValue = new DecimalType(); + return this.maxValue; + } + else if (name.equals("maxValueBase64Binary")) { + this.maxValue = new Base64BinaryType(); + return this.maxValue; + } + else if (name.equals("maxValueInstant")) { + this.maxValue = new InstantType(); + return this.maxValue; + } + else if (name.equals("maxValueString")) { + this.maxValue = new StringType(); + return this.maxValue; + } + else if (name.equals("maxValueUri")) { + this.maxValue = new UriType(); + return this.maxValue; + } + else if (name.equals("maxValueDate")) { + this.maxValue = new DateType(); + return this.maxValue; + } + else if (name.equals("maxValueDateTime")) { + this.maxValue = new DateTimeType(); + return this.maxValue; + } + else if (name.equals("maxValueTime")) { + this.maxValue = new TimeType(); + return this.maxValue; + } + else if (name.equals("maxValueCode")) { + this.maxValue = new CodeType(); + return this.maxValue; + } + else if (name.equals("maxValueOid")) { + this.maxValue = new OidType(); + return this.maxValue; + } + else if (name.equals("maxValueId")) { + this.maxValue = new IdType(); + return this.maxValue; + } + else if (name.equals("maxValueUnsignedInt")) { + this.maxValue = new UnsignedIntType(); + return this.maxValue; + } + else if (name.equals("maxValuePositiveInt")) { + this.maxValue = new PositiveIntType(); + return this.maxValue; + } + else if (name.equals("maxValueMarkdown")) { + this.maxValue = new MarkdownType(); + return this.maxValue; + } + else if (name.equals("maxValueAnnotation")) { + this.maxValue = new Annotation(); + return this.maxValue; + } + else if (name.equals("maxValueAttachment")) { + this.maxValue = new Attachment(); + return this.maxValue; + } + else if (name.equals("maxValueIdentifier")) { + this.maxValue = new Identifier(); + return this.maxValue; + } + else if (name.equals("maxValueCodeableConcept")) { + this.maxValue = new CodeableConcept(); + return this.maxValue; + } + else if (name.equals("maxValueCoding")) { + this.maxValue = new Coding(); + return this.maxValue; + } + else if (name.equals("maxValueQuantity")) { + this.maxValue = new Quantity(); + return this.maxValue; + } + else if (name.equals("maxValueRange")) { + this.maxValue = new Range(); + return this.maxValue; + } + else if (name.equals("maxValuePeriod")) { + this.maxValue = new Period(); + return this.maxValue; + } + else if (name.equals("maxValueRatio")) { + this.maxValue = new Ratio(); + return this.maxValue; + } + else if (name.equals("maxValueSampledData")) { + this.maxValue = new SampledData(); + return this.maxValue; + } + else if (name.equals("maxValueSignature")) { + this.maxValue = new Signature(); + return this.maxValue; + } + else if (name.equals("maxValueHumanName")) { + this.maxValue = new HumanName(); + return this.maxValue; + } + else if (name.equals("maxValueAddress")) { + this.maxValue = new Address(); + return this.maxValue; + } + else if (name.equals("maxValueContactPoint")) { + this.maxValue = new ContactPoint(); + return this.maxValue; + } + else if (name.equals("maxValueTiming")) { + this.maxValue = new Timing(); + return this.maxValue; + } + else if (name.equals("maxValueReference")) { + this.maxValue = new Reference(); + return this.maxValue; + } + else if (name.equals("maxValueMeta")) { + this.maxValue = new Meta(); + return this.maxValue; + } + else if (name.equals("maxLength")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.maxLength"); + } + else if (name.equals("condition")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.condition"); + } + else if (name.equals("constraint")) { + return addConstraint(); + } + else if (name.equals("mustSupport")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mustSupport"); + } + else if (name.equals("isModifier")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isModifier"); + } + else if (name.equals("isSummary")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isSummary"); + } + else if (name.equals("binding")) { + this.binding = new ElementDefinitionBindingComponent(); + return this.binding; + } + else if (name.equals("mapping")) { + return addMapping(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ElementDefinition"; + + } + + public ElementDefinition copy() { + ElementDefinition dst = new ElementDefinition(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + if (representation != null) { + dst.representation = new ArrayList>(); + for (Enumeration i : representation) + dst.representation.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.label = label == null ? null : label.copy(); + if (code != null) { + dst.code = new ArrayList(); + for (Coding i : code) + dst.code.add(i.copy()); + }; + dst.slicing = slicing == null ? null : slicing.copy(); + dst.short_ = short_ == null ? null : short_.copy(); + dst.definition = definition == null ? null : definition.copy(); + dst.comments = comments == null ? null : comments.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + if (alias != null) { + dst.alias = new ArrayList(); + for (StringType i : alias) + dst.alias.add(i.copy()); + }; + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + dst.base = base == null ? null : base.copy(); + dst.contentReference = contentReference == null ? null : contentReference.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (TypeRefComponent i : type) + dst.type.add(i.copy()); + }; + dst.defaultValue = defaultValue == null ? null : defaultValue.copy(); + dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy(); + dst.fixed = fixed == null ? null : fixed.copy(); + dst.pattern = pattern == null ? null : pattern.copy(); + dst.example = example == null ? null : example.copy(); + dst.minValue = minValue == null ? null : minValue.copy(); + dst.maxValue = maxValue == null ? null : maxValue.copy(); + dst.maxLength = maxLength == null ? null : maxLength.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (IdType i : condition) + dst.condition.add(i.copy()); + }; + if (constraint != null) { + dst.constraint = new ArrayList(); + for (ElementDefinitionConstraintComponent i : constraint) + dst.constraint.add(i.copy()); + }; + dst.mustSupport = mustSupport == null ? null : mustSupport.copy(); + dst.isModifier = isModifier == null ? null : isModifier.copy(); + dst.isSummary = isSummary == null ? null : isSummary.copy(); + dst.binding = binding == null ? null : binding.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (ElementDefinitionMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + return dst; + } + + protected ElementDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinition)) + return false; + ElementDefinition o = (ElementDefinition) other; + return compareDeep(path, o.path, true) && compareDeep(representation, o.representation, true) && compareDeep(name, o.name, true) + && compareDeep(label, o.label, true) && compareDeep(code, o.code, true) && compareDeep(slicing, o.slicing, true) + && compareDeep(short_, o.short_, true) && compareDeep(definition, o.definition, true) && compareDeep(comments, o.comments, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(alias, o.alias, true) && compareDeep(min, o.min, true) + && compareDeep(max, o.max, true) && compareDeep(base, o.base, true) && compareDeep(contentReference, o.contentReference, true) + && compareDeep(type, o.type, true) && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(meaningWhenMissing, o.meaningWhenMissing, true) + && compareDeep(fixed, o.fixed, true) && compareDeep(pattern, o.pattern, true) && compareDeep(example, o.example, true) + && compareDeep(minValue, o.minValue, true) && compareDeep(maxValue, o.maxValue, true) && compareDeep(maxLength, o.maxLength, true) + && compareDeep(condition, o.condition, true) && compareDeep(constraint, o.constraint, true) && compareDeep(mustSupport, o.mustSupport, true) + && compareDeep(isModifier, o.isModifier, true) && compareDeep(isSummary, o.isSummary, true) && compareDeep(binding, o.binding, true) + && compareDeep(mapping, o.mapping, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinition)) + return false; + ElementDefinition o = (ElementDefinition) other; + return compareValues(path, o.path, true) && compareValues(representation, o.representation, true) && compareValues(name, o.name, true) + && compareValues(label, o.label, true) && compareValues(short_, o.short_, true) && compareValues(definition, o.definition, true) + && compareValues(comments, o.comments, true) && compareValues(requirements, o.requirements, true) && compareValues(alias, o.alias, true) + && compareValues(min, o.min, true) && compareValues(max, o.max, true) && compareValues(contentReference, o.contentReference, true) + && compareValues(meaningWhenMissing, o.meaningWhenMissing, true) && compareValues(maxLength, o.maxLength, true) + && compareValues(condition, o.condition, true) && compareValues(mustSupport, o.mustSupport, true) && compareValues(isModifier, o.isModifier, true) + && compareValues(isSummary, o.isSummary, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (representation == null || representation.isEmpty()) + && (name == null || name.isEmpty()) && (label == null || label.isEmpty()) && (code == null || code.isEmpty()) + && (slicing == null || slicing.isEmpty()) && (short_ == null || short_.isEmpty()) && (definition == null || definition.isEmpty()) + && (comments == null || comments.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (alias == null || alias.isEmpty()) && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) + && (base == null || base.isEmpty()) && (contentReference == null || contentReference.isEmpty()) + && (type == null || type.isEmpty()) && (defaultValue == null || defaultValue.isEmpty()) && (meaningWhenMissing == null || meaningWhenMissing.isEmpty()) + && (fixed == null || fixed.isEmpty()) && (pattern == null || pattern.isEmpty()) && (example == null || example.isEmpty()) + && (minValue == null || minValue.isEmpty()) && (maxValue == null || maxValue.isEmpty()) && (maxLength == null || maxLength.isEmpty()) + && (condition == null || condition.isEmpty()) && (constraint == null || constraint.isEmpty()) + && (mustSupport == null || mustSupport.isEmpty()) && (isModifier == null || isModifier.isEmpty()) + && (isSummary == null || isSummary.isEmpty()) && (binding == null || binding.isEmpty()) && (mapping == null || mapping.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EligibilityRequest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EligibilityRequest.java new file mode 100644 index 00000000000..be4f6646317 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EligibilityRequest.java @@ -0,0 +1,1353 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + */ +@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest") +public class EligibilityRequest extends DomainResource { + + /** + * The Response business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name = "target", type = {Identifier.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Type target; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Type provider; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "organization", type = {Identifier.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Type organization; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name = "priority", type = {Coding.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name = "enterer", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Type enterer; + + /** + * Facility where the services were provided. + */ + @Child(name = "facility", type = {Identifier.class, Location.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Type facility; + + /** + * Patient Resource. + */ + @Child(name = "patient", type = {Identifier.class, Patient.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Type patient; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected Type coverage; + + /** + * The contract number of a business agreement which describes the terms and conditions. + */ + @Child(name = "businessArrangement", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The date or dates when the enclosed suite of services were performed or completed. + */ + @Child(name = "serviced", type = {DateType.class, Period.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Estimated date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) + protected Type serviced; + + /** + * Dental, Vision, Medical, Pharmacy, Rehab etc. + */ + @Child(name = "benefitCategory", type = {Coding.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) + protected Coding benefitCategory; + + /** + * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. + */ + @Child(name = "benefitSubCategory", type = {Coding.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) + protected Coding benefitSubCategory; + + private static final long serialVersionUID = 313969968L; + + /** + * Constructor + */ + public EligibilityRequest() { + super(); + } + + /** + * @return {@link #identifier} (The Response business identifier.) + */ + 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 Response business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EligibilityRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 EligibilityRequest setRuleset(Coding value) { + this.ruleset = 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 EligibilityRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 EligibilityRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public EligibilityRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public EligibilityRequest 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} (The Insurer who is target of the request.) + */ + public Type getTarget() { + return this.target; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Identifier getTargetIdentifier() throws FHIRException { + if (!(this.target instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Identifier) this.target; + } + + public boolean hasTargetIdentifier() { + return this.target instanceof Identifier; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTargetReference() throws FHIRException { + if (!(this.target instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Reference) this.target; + } + + public boolean hasTargetReference() { + return this.target instanceof Reference; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public EligibilityRequest setTarget(Type value) { + this.target = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Type getProvider() { + return this.provider; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Identifier getProviderIdentifier() throws FHIRException { + if (!(this.provider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Identifier) this.provider; + } + + public boolean hasProviderIdentifier() { + return this.provider instanceof Identifier; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProviderReference() throws FHIRException { + if (!(this.provider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Reference) this.provider; + } + + public boolean hasProviderReference() { + return this.provider instanceof Reference; + } + + 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 EligibilityRequest setProvider(Type value) { + this.provider = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public EligibilityRequest setOrganization(Type value) { + this.organization = 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 EligibilityRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); // cc + 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 EligibilityRequest setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Type getEnterer() { + return this.enterer; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Identifier getEntererIdentifier() throws FHIRException { + if (!(this.enterer instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.enterer.getClass().getName()+" was encountered"); + return (Identifier) this.enterer; + } + + public boolean hasEntererIdentifier() { + return this.enterer instanceof Identifier; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEntererReference() throws FHIRException { + if (!(this.enterer instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.enterer.getClass().getName()+" was encountered"); + return (Reference) this.enterer; + } + + public boolean hasEntererReference() { + return this.enterer instanceof Reference; + } + + 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 EligibilityRequest setEnterer(Type value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Type getFacility() { + return this.facility; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Identifier getFacilityIdentifier() throws FHIRException { + if (!(this.facility instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.facility.getClass().getName()+" was encountered"); + return (Identifier) this.facility; + } + + public boolean hasFacilityIdentifier() { + return this.facility instanceof Identifier; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacilityReference() throws FHIRException { + if (!(this.facility instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.facility.getClass().getName()+" was encountered"); + return (Reference) this.facility; + } + + public boolean hasFacilityReference() { + return this.facility instanceof Reference; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public EligibilityRequest setFacility(Type value) { + this.facility = value; + return this; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Type getPatient() { + return this.patient; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Identifier getPatientIdentifier() throws FHIRException { + if (!(this.patient instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.patient.getClass().getName()+" was encountered"); + return (Identifier) this.patient; + } + + public boolean hasPatientIdentifier() { + return this.patient instanceof Identifier; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatientReference() throws FHIRException { + if (!(this.patient instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.patient.getClass().getName()+" was encountered"); + return (Reference) this.patient; + } + + public boolean hasPatientReference() { + return this.patient instanceof Reference; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public EligibilityRequest setPatient(Type value) { + this.patient = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public Type getCoverage() { + return this.coverage; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public Identifier getCoverageIdentifier() throws FHIRException { + if (!(this.coverage instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered"); + return (Identifier) this.coverage; + } + + public boolean hasCoverageIdentifier() { + return this.coverage instanceof Identifier; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public Reference getCoverageReference() throws FHIRException { + if (!(this.coverage instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered"); + return (Reference) this.coverage; + } + + public boolean hasCoverageReference() { + return this.coverage instanceof Reference; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public EligibilityRequest setCoverage(Type value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agreement 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 EligibilityRequest.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); // bb + 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 agreement 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 EligibilityRequest setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agreement 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 agreement which describes the terms and conditions. + */ + public EligibilityRequest 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 #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public Type getServiced() { + return this.serviced; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public DateType getServicedDateType() throws FHIRException { + if (!(this.serviced instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered"); + return (DateType) this.serviced; + } + + public boolean hasServicedDateType() { + return this.serviced instanceof DateType; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public Period getServicedPeriod() throws FHIRException { + if (!(this.serviced instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered"); + return (Period) this.serviced; + } + + public boolean hasServicedPeriod() { + return this.serviced instanceof Period; + } + + public boolean hasServiced() { + return this.serviced != null && !this.serviced.isEmpty(); + } + + /** + * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public EligibilityRequest setServiced(Type value) { + this.serviced = value; + return this; + } + + /** + * @return {@link #benefitCategory} (Dental, Vision, Medical, Pharmacy, Rehab etc.) + */ + public Coding getBenefitCategory() { + if (this.benefitCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.benefitCategory"); + else if (Configuration.doAutoCreate()) + this.benefitCategory = new Coding(); // cc + return this.benefitCategory; + } + + public boolean hasBenefitCategory() { + return this.benefitCategory != null && !this.benefitCategory.isEmpty(); + } + + /** + * @param value {@link #benefitCategory} (Dental, Vision, Medical, Pharmacy, Rehab etc.) + */ + public EligibilityRequest setBenefitCategory(Coding value) { + this.benefitCategory = value; + return this; + } + + /** + * @return {@link #benefitSubCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) + */ + public Coding getBenefitSubCategory() { + if (this.benefitSubCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.benefitSubCategory"); + else if (Configuration.doAutoCreate()) + this.benefitSubCategory = new Coding(); // cc + return this.benefitSubCategory; + } + + public boolean hasBenefitSubCategory() { + return this.benefitSubCategory != null && !this.benefitSubCategory.isEmpty(); + } + + /** + * @param value {@link #benefitSubCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) + */ + public EligibilityRequest setBenefitSubCategory(Coding value) { + this.benefitSubCategory = 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("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider[x]", "Identifier|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[x]", "Identifier|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("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("enterer[x]", "Identifier|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[x]", "Identifier|Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("patient[x]", "Identifier|Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage[x]", "Identifier|Reference(Coverage)", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); + childrenList.add(new Property("benefitCategory", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, benefitCategory)); + childrenList.add(new Property("benefitSubCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, benefitSubCategory)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Coding + case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Type + case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Type + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Type + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type + case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType + case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type + case -1023390027: /*benefitCategory*/ return this.benefitCategory == null ? new Base[0] : new Base[] {this.benefitCategory}; // Coding + case 1987878471: /*benefitSubCategory*/ return this.benefitSubCategory == null ? new Base[0] : new Base[] {this.benefitSubCategory}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case -880905839: // target + this.target = (Type) value; // Type + break; + case -987494927: // provider + this.provider = (Type) value; // Type + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case -1165461084: // priority + this.priority = castToCoding(value); // Coding + break; + case -1591951995: // enterer + this.enterer = (Type) value; // Type + break; + case 501116579: // facility + this.facility = (Type) value; // Type + break; + case -791418107: // patient + this.patient = (Type) value; // Type + break; + case -351767064: // coverage + this.coverage = (Type) value; // Type + break; + case 259920682: // businessArrangement + this.businessArrangement = castToString(value); // StringType + break; + case 1379209295: // serviced + this.serviced = (Type) value; // Type + break; + case -1023390027: // benefitCategory + this.benefitCategory = castToCoding(value); // Coding + break; + case 1987878471: // benefitSubCategory + this.benefitSubCategory = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("target[x]")) + this.target = (Type) value; // Type + else if (name.equals("provider[x]")) + this.provider = (Type) value; // Type + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("priority")) + this.priority = castToCoding(value); // Coding + else if (name.equals("enterer[x]")) + this.enterer = (Type) value; // Type + else if (name.equals("facility[x]")) + this.facility = (Type) value; // Type + else if (name.equals("patient[x]")) + this.patient = (Type) value; // Type + else if (name.equals("coverage[x]")) + this.coverage = (Type) value; // Type + else if (name.equals("businessArrangement")) + this.businessArrangement = castToString(value); // StringType + else if (name.equals("serviced[x]")) + this.serviced = (Type) value; // Type + else if (name.equals("benefitCategory")) + this.benefitCategory = castToCoding(value); // Coding + else if (name.equals("benefitSubCategory")) + this.benefitSubCategory = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -815579825: return getTarget(); // Type + case 2064698607: return getProvider(); // Type + case 1326483053: return getOrganization(); // Type + case -1165461084: return getPriority(); // Coding + case -812909349: return getEnterer(); // Type + case -542224643: return getFacility(); // Type + case -2061246629: return getPatient(); // Type + case 227689880: return getCoverage(); // Type + case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType + case -1927922223: return getServiced(); // Type + case -1023390027: return getBenefitCategory(); // Coding + case 1987878471: return getBenefitSubCategory(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.created"); + } + else if (name.equals("targetIdentifier")) { + this.target = new Identifier(); + return this.target; + } + else if (name.equals("targetReference")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("providerIdentifier")) { + this.provider = new Identifier(); + return this.provider; + } + else if (name.equals("providerReference")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("priority")) { + this.priority = new Coding(); + return this.priority; + } + else if (name.equals("entererIdentifier")) { + this.enterer = new Identifier(); + return this.enterer; + } + else if (name.equals("entererReference")) { + this.enterer = new Reference(); + return this.enterer; + } + else if (name.equals("facilityIdentifier")) { + this.facility = new Identifier(); + return this.facility; + } + else if (name.equals("facilityReference")) { + this.facility = new Reference(); + return this.facility; + } + else if (name.equals("patientIdentifier")) { + this.patient = new Identifier(); + return this.patient; + } + else if (name.equals("patientReference")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("coverageIdentifier")) { + this.coverage = new Identifier(); + return this.coverage; + } + else if (name.equals("coverageReference")) { + this.coverage = new Reference(); + return this.coverage; + } + else if (name.equals("businessArrangement")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.businessArrangement"); + } + else if (name.equals("servicedDate")) { + this.serviced = new DateType(); + return this.serviced; + } + else if (name.equals("servicedPeriod")) { + this.serviced = new Period(); + return this.serviced; + } + else if (name.equals("benefitCategory")) { + this.benefitCategory = new Coding(); + return this.benefitCategory; + } + else if (name.equals("benefitSubCategory")) { + this.benefitSubCategory = new Coding(); + return this.benefitSubCategory; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "EligibilityRequest"; + + } + + public EligibilityRequest copy() { + EligibilityRequest dst = new EligibilityRequest(); + 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.priority = priority == null ? null : priority.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.serviced = serviced == null ? null : serviced.copy(); + dst.benefitCategory = benefitCategory == null ? null : benefitCategory.copy(); + dst.benefitSubCategory = benefitSubCategory == null ? null : benefitSubCategory.copy(); + return dst; + } + + protected EligibilityRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EligibilityRequest)) + return false; + EligibilityRequest o = (EligibilityRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) + && compareDeep(organization, o.organization, true) && compareDeep(priority, o.priority, true) && compareDeep(enterer, o.enterer, true) + && compareDeep(facility, o.facility, true) && compareDeep(patient, o.patient, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(serviced, o.serviced, true) + && compareDeep(benefitCategory, o.benefitCategory, true) && compareDeep(benefitSubCategory, o.benefitSubCategory, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EligibilityRequest)) + return false; + EligibilityRequest o = (EligibilityRequest) other; + return compareValues(created, o.created, true) && compareValues(businessArrangement, o.businessArrangement, true) + ; + } + + 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()) + && (priority == null || priority.isEmpty()) && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) + && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (serviced == null || serviced.isEmpty()) && (benefitCategory == null || benefitCategory.isEmpty()) + && (benefitSubCategory == null || benefitSubCategory.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EligibilityRequest; + } + + /** + * Search parameter: patientidentifier + *

+ * Description: The reference to the patient
+ * Type: token
+ * Path: EligibilityRequest.patientIdentifier
+ *

+ */ + @SearchParamDefinition(name="patientidentifier", path="EligibilityRequest.patient.as(Identifier)", description="The reference to the patient", type="token" ) + public static final String SP_PATIENTIDENTIFIER = "patientidentifier"; + /** + * Fluent Client search parameter constant for patientidentifier + *

+ * Description: The reference to the patient
+ * Type: token
+ * Path: EligibilityRequest.patientIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATIENTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATIENTIDENTIFIER); + + /** + * Search parameter: created + *

+ * Description: The creation date for the EOB
+ * Type: date
+ * Path: EligibilityRequest.created
+ *

+ */ + @SearchParamDefinition(name="created", path="EligibilityRequest.created", description="The creation date for the EOB", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: The creation date for the EOB
+ * Type: date
+ * Path: EligibilityRequest.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: facilityidentifier + *

+ * Description: Facility responsible for the goods and services
+ * Type: token
+ * Path: EligibilityRequest.facilityidentifier
+ *

+ */ + @SearchParamDefinition(name="facilityidentifier", path="EligibilityRequest.facility.as(identifier)", description="Facility responsible for the goods and services", type="token" ) + public static final String SP_FACILITYIDENTIFIER = "facilityidentifier"; + /** + * Fluent Client search parameter constant for facilityidentifier + *

+ * Description: Facility responsible for the goods and services
+ * Type: token
+ * Path: EligibilityRequest.facilityidentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITYIDENTIFIER); + + /** + * Search parameter: facilityreference + *

+ * Description: Facility responsible for the goods and services
+ * Type: reference
+ * Path: EligibilityRequest.facilityReference
+ *

+ */ + @SearchParamDefinition(name="facilityreference", path="EligibilityRequest.facility.as(Reference)", description="Facility responsible for the goods and services", type="reference" ) + public static final String SP_FACILITYREFERENCE = "facilityreference"; + /** + * Fluent Client search parameter constant for facilityreference + *

+ * Description: Facility responsible for the goods and services
+ * Type: reference
+ * Path: EligibilityRequest.facilityReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITYREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityRequest:facilityreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITYREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityRequest:facilityreference").toLocked(); + + /** + * Search parameter: providerreference + *

+ * Description: The reference to the provider
+ * Type: reference
+ * Path: EligibilityRequest.providerReference
+ *

+ */ + @SearchParamDefinition(name="providerreference", path="EligibilityRequest.provider.as(Reference)", description="The reference to the provider", type="reference" ) + public static final String SP_PROVIDERREFERENCE = "providerreference"; + /** + * Fluent Client search parameter constant for providerreference + *

+ * Description: The reference to the provider
+ * Type: reference
+ * Path: EligibilityRequest.providerReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityRequest:providerreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityRequest:providerreference").toLocked(); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The reference to the providing organization
+ * Type: token
+ * Path: EligibilityRequest.organizationidentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="EligibilityRequest.organization.as(identifier)", description="The reference to the providing organization", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The reference to the providing organization
+ * Type: token
+ * Path: EligibilityRequest.organizationidentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: organizationreference + *

+ * Description: The reference to the providing organization
+ * Type: reference
+ * Path: EligibilityRequest.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="EligibilityRequest.organization.as(Reference)", description="The reference to the providing organization", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The reference to the providing organization
+ * Type: reference
+ * Path: EligibilityRequest.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityRequest:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityRequest:organizationreference").toLocked(); + + /** + * Search parameter: patientreference + *

+ * Description: The reference to the patient
+ * Type: reference
+ * Path: EligibilityRequest.patientReference
+ *

+ */ + @SearchParamDefinition(name="patientreference", path="EligibilityRequest.patient.as(Reference)", description="The reference to the patient", type="reference" ) + public static final String SP_PATIENTREFERENCE = "patientreference"; + /** + * Fluent Client search parameter constant for patientreference + *

+ * Description: The reference to the patient
+ * Type: reference
+ * Path: EligibilityRequest.patientReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENTREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityRequest:patientreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENTREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityRequest:patientreference").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The business identifier of the Eligibility
+ * Type: token
+ * Path: EligibilityRequest.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier of the Eligibility
+ * Type: token
+ * Path: EligibilityRequest.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: provideridentifier + *

+ * Description: The reference to the provider
+ * Type: token
+ * Path: EligibilityRequest.provideridentifier
+ *

+ */ + @SearchParamDefinition(name="provideridentifier", path="EligibilityRequest.provider.as(identifier)", description="The reference to the provider", type="token" ) + public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; + /** + * Fluent Client search parameter constant for provideridentifier + *

+ * Description: The reference to the provider
+ * Type: token
+ * Path: EligibilityRequest.provideridentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EligibilityResponse.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EligibilityResponse.java new file mode 100644 index 00000000000..b2655686fc9 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EligibilityResponse.java @@ -0,0 +1,2163 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome; +import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides eligibility and plan details from the processing of an Eligibility resource. + */ +@ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse") +public class EligibilityResponse extends DomainResource { + + @Block() + public static class BenefitsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Dental, Vision, Medical, Pharmacy, Rehab etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) + protected Coding category; + + /** + * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. + */ + @Child(name = "subCategory", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) + protected Coding subCategory; + + /** + * Network designation. + */ + @Child(name = "network", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="In or out of network", formalDefinition="Network designation." ) + protected Coding network; + + /** + * Unit designation: individual or family. + */ + @Child(name = "unit", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Individual or family", formalDefinition="Unit designation: individual or family." ) + protected Coding unit; + + /** + * The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'. + */ + @Child(name = "term", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Annual or lifetime", formalDefinition="The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'." ) + protected Coding term; + + /** + * Benefits Used to date. + */ + @Child(name = "financial", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Benefit Summary", formalDefinition="Benefits Used to date." ) + protected List financial; + + private static final long serialVersionUID = 1708176773L; + + /** + * Constructor + */ + public BenefitsComponent() { + super(); + } + + /** + * Constructor + */ + public BenefitsComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitsComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) + */ + public BenefitsComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) + */ + public Coding getSubCategory() { + if (this.subCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitsComponent.subCategory"); + else if (Configuration.doAutoCreate()) + this.subCategory = new Coding(); // cc + return this.subCategory; + } + + public boolean hasSubCategory() { + return this.subCategory != null && !this.subCategory.isEmpty(); + } + + /** + * @param value {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) + */ + public BenefitsComponent setSubCategory(Coding value) { + this.subCategory = value; + return this; + } + + /** + * @return {@link #network} (Network designation.) + */ + public Coding getNetwork() { + if (this.network == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitsComponent.network"); + else if (Configuration.doAutoCreate()) + this.network = new Coding(); // cc + return this.network; + } + + public boolean hasNetwork() { + return this.network != null && !this.network.isEmpty(); + } + + /** + * @param value {@link #network} (Network designation.) + */ + public BenefitsComponent setNetwork(Coding value) { + this.network = value; + return this; + } + + /** + * @return {@link #unit} (Unit designation: individual or family.) + */ + public Coding getUnit() { + if (this.unit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitsComponent.unit"); + else if (Configuration.doAutoCreate()) + this.unit = new Coding(); // cc + return this.unit; + } + + public boolean hasUnit() { + return this.unit != null && !this.unit.isEmpty(); + } + + /** + * @param value {@link #unit} (Unit designation: individual or family.) + */ + public BenefitsComponent setUnit(Coding value) { + this.unit = value; + return this; + } + + /** + * @return {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) + */ + public Coding getTerm() { + if (this.term == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitsComponent.term"); + else if (Configuration.doAutoCreate()) + this.term = new Coding(); // cc + return this.term; + } + + public boolean hasTerm() { + return this.term != null && !this.term.isEmpty(); + } + + /** + * @param value {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) + */ + public BenefitsComponent setTerm(Coding value) { + this.term = value; + return this; + } + + /** + * @return {@link #financial} (Benefits Used to date.) + */ + public List getFinancial() { + if (this.financial == null) + this.financial = new ArrayList(); + return this.financial; + } + + public boolean hasFinancial() { + if (this.financial == null) + return false; + for (BenefitComponent item : this.financial) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #financial} (Benefits Used to date.) + */ + // syntactic sugar + public BenefitComponent addFinancial() { //3 + BenefitComponent t = new BenefitComponent(); + if (this.financial == null) + this.financial = new ArrayList(); + this.financial.add(t); + return t; + } + + // syntactic sugar + public BenefitsComponent addFinancial(BenefitComponent t) { //3 + if (t == null) + return this; + if (this.financial == null) + this.financial = new ArrayList(); + this.financial.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("subCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, subCategory)); + childrenList.add(new Property("network", "Coding", "Network designation.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("unit", "Coding", "Unit designation: individual or family.", 0, java.lang.Integer.MAX_VALUE, unit)); + childrenList.add(new Property("term", "Coding", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("financial", "", "Benefits Used to date.", 0, java.lang.Integer.MAX_VALUE, financial)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case 1365024606: /*subCategory*/ return this.subCategory == null ? new Base[0] : new Base[] {this.subCategory}; // Coding + case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // Coding + case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // Coding + case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // Coding + case 357555337: /*financial*/ return this.financial == null ? new Base[0] : this.financial.toArray(new Base[this.financial.size()]); // BenefitComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case 1365024606: // subCategory + this.subCategory = castToCoding(value); // Coding + break; + case 1843485230: // network + this.network = castToCoding(value); // Coding + break; + case 3594628: // unit + this.unit = castToCoding(value); // Coding + break; + case 3556460: // term + this.term = castToCoding(value); // Coding + break; + case 357555337: // financial + this.getFinancial().add((BenefitComponent) value); // BenefitComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("subCategory")) + this.subCategory = castToCoding(value); // Coding + else if (name.equals("network")) + this.network = castToCoding(value); // Coding + else if (name.equals("unit")) + this.unit = castToCoding(value); // Coding + else if (name.equals("term")) + this.term = castToCoding(value); // Coding + else if (name.equals("financial")) + this.getFinancial().add((BenefitComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case 1365024606: return getSubCategory(); // Coding + case 1843485230: return getNetwork(); // Coding + case 3594628: return getUnit(); // Coding + case 3556460: return getTerm(); // Coding + case 357555337: return addFinancial(); // BenefitComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("subCategory")) { + this.subCategory = new Coding(); + return this.subCategory; + } + else if (name.equals("network")) { + this.network = new Coding(); + return this.network; + } + else if (name.equals("unit")) { + this.unit = new Coding(); + return this.unit; + } + else if (name.equals("term")) { + this.term = new Coding(); + return this.term; + } + else if (name.equals("financial")) { + return addFinancial(); + } + else + return super.addChild(name); + } + + public BenefitsComponent copy() { + BenefitsComponent dst = new BenefitsComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.subCategory = subCategory == null ? null : subCategory.copy(); + dst.network = network == null ? null : network.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.term = term == null ? null : term.copy(); + if (financial != null) { + dst.financial = new ArrayList(); + for (BenefitComponent i : financial) + dst.financial.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BenefitsComponent)) + return false; + BenefitsComponent o = (BenefitsComponent) other; + return compareDeep(category, o.category, true) && compareDeep(subCategory, o.subCategory, true) + && compareDeep(network, o.network, true) && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) + && compareDeep(financial, o.financial, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BenefitsComponent)) + return false; + BenefitsComponent o = (BenefitsComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (subCategory == null || subCategory.isEmpty()) + && (network == null || network.isEmpty()) && (unit == null || unit.isEmpty()) && (term == null || term.isEmpty()) + && (financial == null || financial.isEmpty()); + } + + public String fhirType() { + return "EligibilityResponse.benefitBalance"; + + } + + } + + @Block() + public static class BenefitComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Deductable, visits, benefit amount. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Deductable, visits, benefit amount", formalDefinition="Deductable, visits, benefit amount." ) + protected Coding type; + + /** + * Benefits allowed. + */ + @Child(name = "benefit", type = {UnsignedIntType.class, Money.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefits allowed", formalDefinition="Benefits allowed." ) + protected Type benefit; + + /** + * Benefits used. + */ + @Child(name = "benefitUsed", type = {UnsignedIntType.class, Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefits used", formalDefinition="Benefits used." ) + protected Type benefitUsed; + + private static final long serialVersionUID = 1742418909L; + + /** + * Constructor + */ + public BenefitComponent() { + super(); + } + + /** + * Constructor + */ + public BenefitComponent(Coding type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Deductable, visits, benefit amount.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Deductable, visits, benefit amount.) + */ + public BenefitComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #benefit} (Benefits allowed.) + */ + public Type getBenefit() { + return this.benefit; + } + + /** + * @return {@link #benefit} (Benefits allowed.) + */ + public UnsignedIntType getBenefitUnsignedIntType() throws FHIRException { + if (!(this.benefit instanceof UnsignedIntType)) + throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.benefit.getClass().getName()+" was encountered"); + return (UnsignedIntType) this.benefit; + } + + public boolean hasBenefitUnsignedIntType() { + return this.benefit instanceof UnsignedIntType; + } + + /** + * @return {@link #benefit} (Benefits allowed.) + */ + public Money getBenefitMoney() throws FHIRException { + if (!(this.benefit instanceof Money)) + throw new FHIRException("Type mismatch: the type Money was expected, but "+this.benefit.getClass().getName()+" was encountered"); + return (Money) this.benefit; + } + + public boolean hasBenefitMoney() { + return this.benefit instanceof Money; + } + + public boolean hasBenefit() { + return this.benefit != null && !this.benefit.isEmpty(); + } + + /** + * @param value {@link #benefit} (Benefits allowed.) + */ + public BenefitComponent setBenefit(Type value) { + this.benefit = value; + return this; + } + + /** + * @return {@link #benefitUsed} (Benefits used.) + */ + public Type getBenefitUsed() { + return this.benefitUsed; + } + + /** + * @return {@link #benefitUsed} (Benefits used.) + */ + public UnsignedIntType getBenefitUsedUnsignedIntType() throws FHIRException { + if (!(this.benefitUsed instanceof UnsignedIntType)) + throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.benefitUsed.getClass().getName()+" was encountered"); + return (UnsignedIntType) this.benefitUsed; + } + + public boolean hasBenefitUsedUnsignedIntType() { + return this.benefitUsed instanceof UnsignedIntType; + } + + /** + * @return {@link #benefitUsed} (Benefits used.) + */ + public Money getBenefitUsedMoney() throws FHIRException { + if (!(this.benefitUsed instanceof Money)) + throw new FHIRException("Type mismatch: the type Money was expected, but "+this.benefitUsed.getClass().getName()+" was encountered"); + return (Money) this.benefitUsed; + } + + public boolean hasBenefitUsedMoney() { + return this.benefitUsed instanceof Money; + } + + public boolean hasBenefitUsed() { + return this.benefitUsed != null && !this.benefitUsed.isEmpty(); + } + + /** + * @param value {@link #benefitUsed} (Benefits used.) + */ + public BenefitComponent setBenefitUsed(Type value) { + this.benefitUsed = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Deductable, visits, benefit amount.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("benefit[x]", "unsignedInt|Money", "Benefits allowed.", 0, java.lang.Integer.MAX_VALUE, benefit)); + childrenList.add(new Property("benefitUsed[x]", "unsignedInt|Money", "Benefits used.", 0, java.lang.Integer.MAX_VALUE, benefitUsed)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : new Base[] {this.benefit}; // Type + case -549981964: /*benefitUsed*/ return this.benefitUsed == null ? new Base[0] : new Base[] {this.benefitUsed}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case -222710633: // benefit + this.benefit = (Type) value; // Type + break; + case -549981964: // benefitUsed + this.benefitUsed = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("benefit[x]")) + this.benefit = (Type) value; // Type + else if (name.equals("benefitUsed[x]")) + this.benefitUsed = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 952095881: return getBenefit(); // Type + case 787635980: return getBenefitUsed(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("benefitUnsignedInt")) { + this.benefit = new UnsignedIntType(); + return this.benefit; + } + else if (name.equals("benefitMoney")) { + this.benefit = new Money(); + return this.benefit; + } + else if (name.equals("benefitUsedUnsignedInt")) { + this.benefitUsed = new UnsignedIntType(); + return this.benefitUsed; + } + else if (name.equals("benefitUsedMoney")) { + this.benefitUsed = new Money(); + return this.benefitUsed; + } + else + return super.addChild(name); + } + + public BenefitComponent copy() { + BenefitComponent dst = new BenefitComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.benefit = benefit == null ? null : benefit.copy(); + dst.benefitUsed = benefitUsed == null ? null : benefitUsed.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BenefitComponent)) + return false; + BenefitComponent o = (BenefitComponent) other; + return compareDeep(type, o.type, true) && compareDeep(benefit, o.benefit, true) && compareDeep(benefitUsed, o.benefitUsed, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BenefitComponent)) + return false; + BenefitComponent o = (BenefitComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (benefit == null || benefit.isEmpty()) + && (benefitUsed == null || benefitUsed.isEmpty()); + } + + public String fhirType() { + return "EligibilityResponse.benefitBalance.financial"; + + } + + } + + @Block() + public static class ErrorsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An error code,from a specified code system, which details why the eligibility check could not be performed. + */ + @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,from a specified code system, which details why the eligibility check could not be performed." ) + protected Coding code; + + private static final long serialVersionUID = -739538393L; + + /** + * Constructor + */ + public ErrorsComponent() { + super(); + } + + /** + * Constructor + */ + public ErrorsComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (An error code,from a specified code system, which details why the eligibility check could not be performed.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (An error code,from a specified code system, which details why the eligibility check could not be performed.) + */ + public ErrorsComponent setCode(Coding value) { + this.code = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "An error code,from a specified code system, which details why the eligibility check could not be performed.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new Coding(); + return this.code; + } + else + return super.addChild(name); + } + + public ErrorsComponent copy() { + ErrorsComponent dst = new ErrorsComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ErrorsComponent)) + return false; + ErrorsComponent o = (ErrorsComponent) other; + return compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ErrorsComponent)) + return false; + ErrorsComponent o = (ErrorsComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()); + } + + public String fhirType() { + return "EligibilityResponse.error"; + + } + + } + + /** + * The Response business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {Identifier.class, EligibilityRequest.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) + protected Type request; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Type organization; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Type requestProvider; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Type requestOrganization; + + /** + * Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. + */ + @Child(name = "inforce", type = {BooleanType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Coverage inforce", formalDefinition="Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates." ) + protected BooleanType inforce; + + /** + * The contract resource which may provide more detailed information. + */ + @Child(name = "contract", type = {Contract.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contract details", formalDefinition="The contract resource which may provide more detailed information." ) + protected Reference contract; + + /** + * The actual object that is the target of the reference (The contract resource which may provide more detailed information.) + */ + protected Contract contractTarget; + + /** + * The form to be used for printing the content. + */ + @Child(name = "form", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Benefits and optionally current balances by Category. + */ + @Child(name = "benefitBalance", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Benefits by Category", formalDefinition="Benefits and optionally current balances by Category." ) + protected List benefitBalance; + + /** + * Mutually exclusive with Services Provided (Item). + */ + @Child(name = "error", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) + protected List error; + + private static final long serialVersionUID = -674605791L; + + /** + * Constructor + */ + public EligibilityResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response business identifier.) + */ + 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 Response business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EligibilityResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Type getRequest() { + return this.request; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Identifier getRequestIdentifier() throws FHIRException { + if (!(this.request instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Identifier) this.request; + } + + public boolean hasRequestIdentifier() { + return this.request instanceof Identifier; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequestReference() throws FHIRException { + if (!(this.request instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Reference) this.request; + } + + public boolean hasRequestReference() { + return this.request instanceof Reference; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public EligibilityResponse setRequest(Type value) { + this.request = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). 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 EligibilityResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb + 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} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public EligibilityResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RemittanceOutcome getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public EligibilityResponse setOutcome(RemittanceOutcome value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public EligibilityResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public EligibilityResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 EligibilityResponse setRuleset(Coding value) { + this.ruleset = 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 EligibilityResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 EligibilityResponse 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 EligibilityResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 EligibilityResponse 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 EligibilityResponse 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 #organization} (The Insurer who produced this adjudicated response.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public EligibilityResponse setOrganization(Type value) { + this.organization = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Type getRequestProvider() { + return this.requestProvider; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Identifier getRequestProviderIdentifier() throws FHIRException { + if (!(this.requestProvider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); + return (Identifier) this.requestProvider; + } + + public boolean hasRequestProviderIdentifier() { + return this.requestProvider instanceof Identifier; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProviderReference() throws FHIRException { + if (!(this.requestProvider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); + return (Reference) this.requestProvider; + } + + public boolean hasRequestProviderReference() { + return this.requestProvider instanceof Reference; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EligibilityResponse setRequestProvider(Type value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Type getRequestOrganization() { + return this.requestOrganization; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Identifier getRequestOrganizationIdentifier() throws FHIRException { + if (!(this.requestOrganization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); + return (Identifier) this.requestOrganization; + } + + public boolean hasRequestOrganizationIdentifier() { + return this.requestOrganization instanceof Identifier; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganizationReference() throws FHIRException { + if (!(this.requestOrganization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); + return (Reference) this.requestOrganization; + } + + public boolean hasRequestOrganizationReference() { + return this.requestOrganization instanceof Reference; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public EligibilityResponse setRequestOrganization(Type value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #inforce} (Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.). This is the underlying object with id, value and extensions. The accessor "getInforce" gives direct access to the value + */ + public BooleanType getInforceElement() { + if (this.inforce == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.inforce"); + else if (Configuration.doAutoCreate()) + this.inforce = new BooleanType(); // bb + return this.inforce; + } + + public boolean hasInforceElement() { + return this.inforce != null && !this.inforce.isEmpty(); + } + + public boolean hasInforce() { + return this.inforce != null && !this.inforce.isEmpty(); + } + + /** + * @param value {@link #inforce} (Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.). This is the underlying object with id, value and extensions. The accessor "getInforce" gives direct access to the value + */ + public EligibilityResponse setInforceElement(BooleanType value) { + this.inforce = value; + return this; + } + + /** + * @return Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. + */ + public boolean getInforce() { + return this.inforce == null || this.inforce.isEmpty() ? false : this.inforce.getValue(); + } + + /** + * @param value Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. + */ + public EligibilityResponse setInforce(boolean value) { + if (this.inforce == null) + this.inforce = new BooleanType(); + this.inforce.setValue(value); + return this; + } + + /** + * @return {@link #contract} (The contract resource which may provide more detailed information.) + */ + public Reference getContract() { + if (this.contract == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.contract"); + else if (Configuration.doAutoCreate()) + this.contract = new Reference(); // cc + return this.contract; + } + + public boolean hasContract() { + return this.contract != null && !this.contract.isEmpty(); + } + + /** + * @param value {@link #contract} (The contract resource which may provide more detailed information.) + */ + public EligibilityResponse setContract(Reference value) { + this.contract = value; + return this; + } + + /** + * @return {@link #contract} 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 contract resource which may provide more detailed information.) + */ + public Contract getContractTarget() { + if (this.contractTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.contract"); + else if (Configuration.doAutoCreate()) + this.contractTarget = new Contract(); // aa + return this.contractTarget; + } + + /** + * @param value {@link #contract} 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 contract resource which may provide more detailed information.) + */ + public EligibilityResponse setContractTarget(Contract value) { + this.contractTarget = value; + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public EligibilityResponse setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #benefitBalance} (Benefits and optionally current balances by Category.) + */ + public List getBenefitBalance() { + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + return this.benefitBalance; + } + + public boolean hasBenefitBalance() { + if (this.benefitBalance == null) + return false; + for (BenefitsComponent item : this.benefitBalance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #benefitBalance} (Benefits and optionally current balances by Category.) + */ + // syntactic sugar + public BenefitsComponent addBenefitBalance() { //3 + BenefitsComponent t = new BenefitsComponent(); + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + this.benefitBalance.add(t); + return t; + } + + // syntactic sugar + public EligibilityResponse addBenefitBalance(BenefitsComponent t) { //3 + if (t == null) + return this; + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + this.benefitBalance.add(t); + return this; + } + + /** + * @return {@link #error} (Mutually exclusive with Services Provided (Item).) + */ + public List getError() { + if (this.error == null) + this.error = new ArrayList(); + return this.error; + } + + public boolean hasError() { + if (this.error == null) + return false; + for (ErrorsComponent item : this.error) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #error} (Mutually exclusive with Services Provided (Item).) + */ + // syntactic sugar + public ErrorsComponent addError() { //3 + ErrorsComponent t = new ErrorsComponent(); + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return t; + } + + // syntactic sugar + public EligibilityResponse addError(ErrorsComponent t) { //3 + if (t == null) + return this; + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + 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("request[x]", "Identifier|Reference(EligibilityRequest)", "Original request resource reference.", 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("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[x]", "Identifier|Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider[x]", "Identifier|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[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + childrenList.add(new Property("inforce", "boolean", "Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.", 0, java.lang.Integer.MAX_VALUE, inforce)); + childrenList.add(new Property("contract", "Reference(Contract)", "The contract resource which may provide more detailed information.", 0, java.lang.Integer.MAX_VALUE, contract)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("benefitBalance", "", "Benefits and optionally current balances by Category.", 0, java.lang.Integer.MAX_VALUE, benefitBalance)); + childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type + case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type + case 1945431270: /*inforce*/ return this.inforce == null ? new Base[0] : new Base[] {this.inforce}; // BooleanType + case -566947566: /*contract*/ return this.contract == null ? new Base[0] : new Base[] {this.contract}; // Reference + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding + case 596003397: /*benefitBalance*/ return this.benefitBalance == null ? new Base[0] : this.benefitBalance.toArray(new Base[this.benefitBalance.size()]); // BenefitsComponent + case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorsComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1095692943: // request + this.request = (Type) value; // Type + break; + case -1106507950: // outcome + this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case 1601527200: // requestProvider + this.requestProvider = (Type) value; // Type + break; + case 599053666: // requestOrganization + this.requestOrganization = (Type) value; // Type + break; + case 1945431270: // inforce + this.inforce = castToBoolean(value); // BooleanType + break; + case -566947566: // contract + this.contract = castToReference(value); // Reference + break; + case 3148996: // form + this.form = castToCoding(value); // Coding + break; + case 596003397: // benefitBalance + this.getBenefitBalance().add((BenefitsComponent) value); // BenefitsComponent + break; + case 96784904: // error + this.getError().add((ErrorsComponent) value); // ErrorsComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("request[x]")) + this.request = (Type) value; // Type + else if (name.equals("outcome")) + this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("requestProvider[x]")) + this.requestProvider = (Type) value; // Type + else if (name.equals("requestOrganization[x]")) + this.requestOrganization = (Type) value; // Type + else if (name.equals("inforce")) + this.inforce = castToBoolean(value); // BooleanType + else if (name.equals("contract")) + this.contract = castToReference(value); // Reference + else if (name.equals("form")) + this.form = castToCoding(value); // Coding + else if (name.equals("benefitBalance")) + this.getBenefitBalance().add((BenefitsComponent) value); + else if (name.equals("error")) + this.getError().add((ErrorsComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 37106577: return getRequest(); // Type + case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 1326483053: return getOrganization(); // Type + case -1694784800: return getRequestProvider(); // Type + case 818740190: return getRequestOrganization(); // Type + case 1945431270: throw new FHIRException("Cannot make property inforce as it is not a complex type"); // BooleanType + case -566947566: return getContract(); // Reference + case 3148996: return getForm(); // Coding + case 596003397: return addBenefitBalance(); // BenefitsComponent + case 96784904: return addError(); // ErrorsComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("requestIdentifier")) { + this.request = new Identifier(); + return this.request; + } + else if (name.equals("requestReference")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("outcome")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.outcome"); + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.disposition"); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.created"); + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("requestProviderIdentifier")) { + this.requestProvider = new Identifier(); + return this.requestProvider; + } + else if (name.equals("requestProviderReference")) { + this.requestProvider = new Reference(); + return this.requestProvider; + } + else if (name.equals("requestOrganizationIdentifier")) { + this.requestOrganization = new Identifier(); + return this.requestOrganization; + } + else if (name.equals("requestOrganizationReference")) { + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + else if (name.equals("inforce")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.inforce"); + } + else if (name.equals("contract")) { + this.contract = new Reference(); + return this.contract; + } + else if (name.equals("form")) { + this.form = new Coding(); + return this.form; + } + else if (name.equals("benefitBalance")) { + return addBenefitBalance(); + } + else if (name.equals("error")) { + return addError(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "EligibilityResponse"; + + } + + public EligibilityResponse copy() { + EligibilityResponse dst = new EligibilityResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.inforce = inforce == null ? null : inforce.copy(); + dst.contract = contract == null ? null : contract.copy(); + dst.form = form == null ? null : form.copy(); + if (benefitBalance != null) { + dst.benefitBalance = new ArrayList(); + for (BenefitsComponent i : benefitBalance) + dst.benefitBalance.add(i.copy()); + }; + if (error != null) { + dst.error = new ArrayList(); + for (ErrorsComponent i : error) + dst.error.add(i.copy()); + }; + return dst; + } + + protected EligibilityResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EligibilityResponse)) + return false; + EligibilityResponse o = (EligibilityResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(inforce, o.inforce, true) + && compareDeep(contract, o.contract, true) && compareDeep(form, o.form, true) && compareDeep(benefitBalance, o.benefitBalance, true) + && compareDeep(error, o.error, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EligibilityResponse)) + return false; + EligibilityResponse o = (EligibilityResponse) other; + return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + && compareValues(inforce, o.inforce, true); + } + + public boolean isEmpty() { + 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()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (inforce == null || inforce.isEmpty()) && (contract == null || contract.isEmpty()) && (form == null || form.isEmpty()) + && (benefitBalance == null || benefitBalance.isEmpty()) && (error == null || error.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EligibilityResponse; + } + + /** + * Search parameter: requestorganizationreference + *

+ * Description: The EligibilityRequest organization
+ * Type: reference
+ * Path: EligibilityResponse.requestOrganizationReference
+ *

+ */ + @SearchParamDefinition(name="requestorganizationreference", path="EligibilityResponse.requestOrganization.as(Reference)", description="The EligibilityRequest organization", type="reference" ) + public static final String SP_REQUESTORGANIZATIONREFERENCE = "requestorganizationreference"; + /** + * Fluent Client search parameter constant for requestorganizationreference + *

+ * Description: The EligibilityRequest organization
+ * Type: reference
+ * Path: EligibilityResponse.requestOrganizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityResponse:requestorganizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityResponse:requestorganizationreference").toLocked(); + + /** + * Search parameter: created + *

+ * Description: The creation date
+ * Type: date
+ * Path: EligibilityResponse.created
+ *

+ */ + @SearchParamDefinition(name="created", path="EligibilityResponse.created", description="The creation date", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: The creation date
+ * Type: date
+ * Path: EligibilityResponse.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: requestorganizationidentifier + *

+ * Description: The EligibilityRequest organization
+ * Type: token
+ * Path: EligibilityResponse.requestOrganizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestorganizationidentifier", path="EligibilityResponse.requestOrganization.as(Identifier)", description="The EligibilityRequest organization", type="token" ) + public static final String SP_REQUESTORGANIZATIONIDENTIFIER = "requestorganizationidentifier"; + /** + * Fluent Client search parameter constant for requestorganizationidentifier + *

+ * Description: The EligibilityRequest organization
+ * Type: token
+ * Path: EligibilityResponse.requestOrganizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTORGANIZATIONIDENTIFIER); + + /** + * Search parameter: requestprovideridentifier + *

+ * Description: The EligibilityRequest provider
+ * Type: token
+ * Path: EligibilityResponse.requestProviderIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestprovideridentifier", path="EligibilityResponse.requestProvider.as(Identifier)", description="The EligibilityRequest provider", type="token" ) + public static final String SP_REQUESTPROVIDERIDENTIFIER = "requestprovideridentifier"; + /** + * Fluent Client search parameter constant for requestprovideridentifier + *

+ * Description: The EligibilityRequest provider
+ * Type: token
+ * Path: EligibilityResponse.requestProviderIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTPROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTPROVIDERIDENTIFIER); + + /** + * Search parameter: requestidentifier + *

+ * Description: The EligibilityRequest reference
+ * Type: token
+ * Path: EligibilityResponse.requestIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestidentifier", path="EligibilityResponse.request.as(Identifier)", description="The EligibilityRequest reference", type="token" ) + public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; + /** + * Fluent Client search parameter constant for requestidentifier + *

+ * Description: The EligibilityRequest reference
+ * Type: token
+ * Path: EligibilityResponse.requestIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); + + /** + * Search parameter: requestreference + *

+ * Description: The EligibilityRequest reference
+ * Type: reference
+ * Path: EligibilityResponse.requestReference
+ *

+ */ + @SearchParamDefinition(name="requestreference", path="EligibilityResponse.request.as(Reference)", description="The EligibilityRequest reference", type="reference" ) + public static final String SP_REQUESTREFERENCE = "requestreference"; + /** + * Fluent Client search parameter constant for requestreference + *

+ * Description: The EligibilityRequest reference
+ * Type: reference
+ * Path: EligibilityResponse.requestReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityResponse:requestreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityResponse:requestreference").toLocked(); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The organization which generated this resource
+ * Type: token
+ * Path: EligibilityResponse.organizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="EligibilityResponse.organization.as(Identifier)", description="The organization which generated this resource", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The organization which generated this resource
+ * Type: token
+ * Path: EligibilityResponse.organizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: requestproviderreference + *

+ * Description: The EligibilityRequest provider
+ * Type: reference
+ * Path: EligibilityResponse.requestProviderReference
+ *

+ */ + @SearchParamDefinition(name="requestproviderreference", path="EligibilityResponse.requestProvider.as(Reference)", description="The EligibilityRequest provider", type="reference" ) + public static final String SP_REQUESTPROVIDERREFERENCE = "requestproviderreference"; + /** + * Fluent Client search parameter constant for requestproviderreference + *

+ * Description: The EligibilityRequest provider
+ * Type: reference
+ * Path: EligibilityResponse.requestProviderReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTPROVIDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityResponse:requestproviderreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityResponse:requestproviderreference").toLocked(); + + /** + * Search parameter: organizationreference + *

+ * Description: The organization which generated this resource
+ * Type: reference
+ * Path: EligibilityResponse.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="EligibilityResponse.organization.as(Reference)", description="The organization which generated this resource", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The organization which generated this resource
+ * Type: reference
+ * Path: EligibilityResponse.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityResponse:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityResponse:organizationreference").toLocked(); + + /** + * Search parameter: outcome + *

+ * Description: The processing outcome
+ * Type: token
+ * Path: EligibilityResponse.outcome
+ *

+ */ + @SearchParamDefinition(name="outcome", path="EligibilityResponse.outcome", description="The processing outcome", type="token" ) + public static final String SP_OUTCOME = "outcome"; + /** + * Fluent Client search parameter constant for outcome + *

+ * Description: The processing outcome
+ * Type: token
+ * Path: EligibilityResponse.outcome
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME); + + /** + * Search parameter: identifier + *

+ * Description: The business identifier
+ * Type: token
+ * Path: EligibilityResponse.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="EligibilityResponse.identifier", description="The business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier
+ * Type: token
+ * Path: EligibilityResponse.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: disposition + *

+ * Description: The contents of the disposition message
+ * Type: string
+ * Path: EligibilityResponse.disposition
+ *

+ */ + @SearchParamDefinition(name="disposition", path="EligibilityResponse.disposition", description="The contents of the disposition message", type="string" ) + public static final String SP_DISPOSITION = "disposition"; + /** + * Fluent Client search parameter constant for disposition + *

+ * Description: The contents of the disposition message
+ * Type: string
+ * Path: EligibilityResponse.disposition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Encounter.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Encounter.java new file mode 100644 index 00000000000..940d9d1332c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Encounter.java @@ -0,0 +1,3850 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + */ +@ResourceDef(name="Encounter", profile="http://hl7.org/fhir/Profile/Encounter") +public class Encounter extends DomainResource { + + public enum EncounterState { + /** + * The Encounter has not yet started. + */ + PLANNED, + /** + * The Patient is present for the encounter, however is not currently meeting with a practitioner. + */ + ARRIVED, + /** + * The Encounter has begun and the patient is present / the practitioner and the patient are meeting. + */ + INPROGRESS, + /** + * The Encounter has begun, but the patient is temporarily on leave. + */ + ONLEAVE, + /** + * The Encounter has ended. + */ + FINISHED, + /** + * The Encounter has ended before it has begun. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static EncounterState fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("arrived".equals(codeString)) + return ARRIVED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("onleave".equals(codeString)) + return ONLEAVE; + if ("finished".equals(codeString)) + return FINISHED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new FHIRException("Unknown EncounterState code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case ARRIVED: return "arrived"; + case INPROGRESS: return "in-progress"; + case ONLEAVE: return "onleave"; + case FINISHED: return "finished"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return "http://hl7.org/fhir/encounter-state"; + case ARRIVED: return "http://hl7.org/fhir/encounter-state"; + case INPROGRESS: return "http://hl7.org/fhir/encounter-state"; + case ONLEAVE: return "http://hl7.org/fhir/encounter-state"; + case FINISHED: return "http://hl7.org/fhir/encounter-state"; + case CANCELLED: return "http://hl7.org/fhir/encounter-state"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "The Encounter has not yet started."; + case ARRIVED: return "The Patient is present for the encounter, however is not currently meeting with a practitioner."; + case INPROGRESS: return "The Encounter has begun and the patient is present / the practitioner and the patient are meeting."; + case ONLEAVE: return "The Encounter has begun, but the patient is temporarily on leave."; + case FINISHED: return "The Encounter has ended."; + case CANCELLED: return "The Encounter has ended before it has begun."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "Planned"; + case ARRIVED: return "Arrived"; + case INPROGRESS: return "in Progress"; + case ONLEAVE: return "On Leave"; + case FINISHED: return "Finished"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + 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; + if ("planned".equals(codeString)) + return EncounterState.PLANNED; + if ("arrived".equals(codeString)) + return EncounterState.ARRIVED; + if ("in-progress".equals(codeString)) + return EncounterState.INPROGRESS; + if ("onleave".equals(codeString)) + return EncounterState.ONLEAVE; + if ("finished".equals(codeString)) + return EncounterState.FINISHED; + if ("cancelled".equals(codeString)) + return EncounterState.CANCELLED; + throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return new Enumeration(this, EncounterState.PLANNED); + if ("arrived".equals(codeString)) + return new Enumeration(this, EncounterState.ARRIVED); + if ("in-progress".equals(codeString)) + return new Enumeration(this, EncounterState.INPROGRESS); + if ("onleave".equals(codeString)) + return new Enumeration(this, EncounterState.ONLEAVE); + if ("finished".equals(codeString)) + return new Enumeration(this, EncounterState.FINISHED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, EncounterState.CANCELLED); + throw new FHIRException("Unknown EncounterState code '"+codeString+"'"); + } + public String toCode(EncounterState code) { + if (code == EncounterState.PLANNED) + return "planned"; + if (code == EncounterState.ARRIVED) + return "arrived"; + if (code == EncounterState.INPROGRESS) + return "in-progress"; + if (code == EncounterState.ONLEAVE) + return "onleave"; + if (code == EncounterState.FINISHED) + return "finished"; + if (code == EncounterState.CANCELLED) + return "cancelled"; + return "?"; + } + public String toSystem(EncounterState code) { + return code.getSystem(); + } + } + + public enum EncounterClass { + /** + * An encounter during which the patient is hospitalized and stays overnight. + */ + INPATIENT, + /** + * An encounter during which the patient is not hospitalized overnight. + */ + OUTPATIENT, + /** + * An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit. + */ + AMBULATORY, + /** + * An encounter in the Emergency Care Department. + */ + EMERGENCY, + /** + * An encounter where the practitioner visits the patient at his/her home. + */ + HOME, + /** + * An encounter taking place outside the regular environment for giving care. + */ + FIELD, + /** + * An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight. + */ + DAYTIME, + /** + * An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact. + */ + VIRTUAL, + /** + * Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static EncounterClass fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("inpatient".equals(codeString)) + return INPATIENT; + if ("outpatient".equals(codeString)) + return OUTPATIENT; + if ("ambulatory".equals(codeString)) + return AMBULATORY; + if ("emergency".equals(codeString)) + return EMERGENCY; + if ("home".equals(codeString)) + return HOME; + if ("field".equals(codeString)) + return FIELD; + if ("daytime".equals(codeString)) + return DAYTIME; + if ("virtual".equals(codeString)) + return VIRTUAL; + if ("other".equals(codeString)) + return OTHER; + throw new FHIRException("Unknown EncounterClass code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPATIENT: return "inpatient"; + case OUTPATIENT: return "outpatient"; + case AMBULATORY: return "ambulatory"; + case EMERGENCY: return "emergency"; + case HOME: return "home"; + case FIELD: return "field"; + case DAYTIME: return "daytime"; + case VIRTUAL: return "virtual"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPATIENT: return "http://hl7.org/fhir/encounter-class"; + case OUTPATIENT: return "http://hl7.org/fhir/encounter-class"; + case AMBULATORY: return "http://hl7.org/fhir/encounter-class"; + case EMERGENCY: return "http://hl7.org/fhir/encounter-class"; + case HOME: return "http://hl7.org/fhir/encounter-class"; + case FIELD: return "http://hl7.org/fhir/encounter-class"; + case DAYTIME: return "http://hl7.org/fhir/encounter-class"; + case VIRTUAL: return "http://hl7.org/fhir/encounter-class"; + case OTHER: return "http://hl7.org/fhir/encounter-class"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPATIENT: return "An encounter during which the patient is hospitalized and stays overnight."; + case OUTPATIENT: return "An encounter during which the patient is not hospitalized overnight."; + case AMBULATORY: return "An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit."; + case EMERGENCY: return "An encounter in the Emergency Care Department."; + case HOME: return "An encounter where the practitioner visits the patient at his/her home."; + case FIELD: return "An encounter taking place outside the regular environment for giving care."; + case DAYTIME: return "An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight."; + case VIRTUAL: return "An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact."; + case OTHER: return "Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPATIENT: return "Inpatient"; + case OUTPATIENT: return "Outpatient"; + case AMBULATORY: return "Ambulatory"; + case EMERGENCY: return "Emergency"; + case HOME: return "Home"; + case FIELD: return "Field"; + case DAYTIME: return "Daytime"; + case VIRTUAL: return "Virtual"; + case OTHER: return "Other"; + default: return "?"; + } + } + } + + 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; + if ("inpatient".equals(codeString)) + return EncounterClass.INPATIENT; + if ("outpatient".equals(codeString)) + return EncounterClass.OUTPATIENT; + if ("ambulatory".equals(codeString)) + return EncounterClass.AMBULATORY; + if ("emergency".equals(codeString)) + return EncounterClass.EMERGENCY; + if ("home".equals(codeString)) + return EncounterClass.HOME; + if ("field".equals(codeString)) + return EncounterClass.FIELD; + if ("daytime".equals(codeString)) + return EncounterClass.DAYTIME; + if ("virtual".equals(codeString)) + return EncounterClass.VIRTUAL; + if ("other".equals(codeString)) + return EncounterClass.OTHER; + throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("inpatient".equals(codeString)) + return new Enumeration(this, EncounterClass.INPATIENT); + if ("outpatient".equals(codeString)) + return new Enumeration(this, EncounterClass.OUTPATIENT); + if ("ambulatory".equals(codeString)) + return new Enumeration(this, EncounterClass.AMBULATORY); + if ("emergency".equals(codeString)) + return new Enumeration(this, EncounterClass.EMERGENCY); + if ("home".equals(codeString)) + return new Enumeration(this, EncounterClass.HOME); + if ("field".equals(codeString)) + return new Enumeration(this, EncounterClass.FIELD); + if ("daytime".equals(codeString)) + return new Enumeration(this, EncounterClass.DAYTIME); + if ("virtual".equals(codeString)) + return new Enumeration(this, EncounterClass.VIRTUAL); + if ("other".equals(codeString)) + return new Enumeration(this, EncounterClass.OTHER); + throw new FHIRException("Unknown EncounterClass code '"+codeString+"'"); + } + public String toCode(EncounterClass code) { + if (code == EncounterClass.INPATIENT) + return "inpatient"; + if (code == EncounterClass.OUTPATIENT) + return "outpatient"; + if (code == EncounterClass.AMBULATORY) + return "ambulatory"; + if (code == EncounterClass.EMERGENCY) + return "emergency"; + if (code == EncounterClass.HOME) + return "home"; + if (code == EncounterClass.FIELD) + return "field"; + if (code == EncounterClass.DAYTIME) + return "daytime"; + if (code == EncounterClass.VIRTUAL) + return "virtual"; + if (code == EncounterClass.OTHER) + return "other"; + return "?"; + } + public String toSystem(EncounterClass code) { + return code.getSystem(); + } + } + + public enum EncounterLocationStatus { + /** + * The patient is planned to be moved to this location at some point in the future. + */ + PLANNED, + /** + * The patient is currently at this location, or was between the period specified. + +A system may update these records when the patient leaves the location to either reserved, or completed + */ + ACTIVE, + /** + * This location is held empty for this patient. + */ + RESERVED, + /** + * The patient was at this location during the period specified. + +Not to be used when the patient is currently at the location + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + public static EncounterLocationStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("active".equals(codeString)) + return ACTIVE; + if ("reserved".equals(codeString)) + return RESERVED; + if ("completed".equals(codeString)) + return COMPLETED; + throw new FHIRException("Unknown EncounterLocationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case ACTIVE: return "active"; + case RESERVED: return "reserved"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return "http://hl7.org/fhir/encounter-location-status"; + case ACTIVE: return "http://hl7.org/fhir/encounter-location-status"; + case RESERVED: return "http://hl7.org/fhir/encounter-location-status"; + case COMPLETED: return "http://hl7.org/fhir/encounter-location-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "The patient is planned to be moved to this location at some point in the future."; + case ACTIVE: return "The patient is currently at this location, or was between the period specified.\n\nA system may update these records when the patient leaves the location to either reserved, or completed"; + case RESERVED: return "This location is held empty for this patient."; + case COMPLETED: return "The patient was at this location during the period specified.\n\nNot to be used when the patient is currently at the location"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "Planned"; + case ACTIVE: return "Active"; + case RESERVED: return "Reserved"; + case COMPLETED: return "Completed"; + default: return "?"; + } + } + } + + public static class EncounterLocationStatusEnumFactory implements EnumFactory { + public EncounterLocationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return EncounterLocationStatus.PLANNED; + if ("active".equals(codeString)) + return EncounterLocationStatus.ACTIVE; + if ("reserved".equals(codeString)) + return EncounterLocationStatus.RESERVED; + if ("completed".equals(codeString)) + return EncounterLocationStatus.COMPLETED; + throw new IllegalArgumentException("Unknown EncounterLocationStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return new Enumeration(this, EncounterLocationStatus.PLANNED); + if ("active".equals(codeString)) + return new Enumeration(this, EncounterLocationStatus.ACTIVE); + if ("reserved".equals(codeString)) + return new Enumeration(this, EncounterLocationStatus.RESERVED); + if ("completed".equals(codeString)) + return new Enumeration(this, EncounterLocationStatus.COMPLETED); + throw new FHIRException("Unknown EncounterLocationStatus code '"+codeString+"'"); + } + public String toCode(EncounterLocationStatus code) { + if (code == EncounterLocationStatus.PLANNED) + return "planned"; + if (code == EncounterLocationStatus.ACTIVE) + return "active"; + if (code == EncounterLocationStatus.RESERVED) + return "reserved"; + if (code == EncounterLocationStatus.COMPLETED) + return "completed"; + return "?"; + } + public String toSystem(EncounterLocationStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class EncounterStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * planned | arrived | in-progress | onleave | finished | cancelled. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="planned | arrived | in-progress | onleave | finished | cancelled", formalDefinition="planned | arrived | in-progress | onleave | finished | cancelled." ) + protected Enumeration status; + + /** + * The time that the episode was in the specified status. + */ + @Child(name = "period", type = {Period.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The time that the episode was in the specified status", formalDefinition="The time that the episode was in the specified status." ) + protected Period period; + + private static final long serialVersionUID = 919229161L; + + /** + * Constructor + */ + public EncounterStatusHistoryComponent() { + super(); + } + + /** + * Constructor + */ + public EncounterStatusHistoryComponent(Enumeration status, Period period) { + super(); + this.status = status; + this.period = period; + } + + /** + * @return {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). 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 EncounterStatusHistoryComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EncounterStateEnumFactory()); // bb + 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} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public EncounterStatusHistoryComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | arrived | in-progress | onleave | finished | cancelled. + */ + public EncounterState getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | arrived | in-progress | onleave | finished | cancelled. + */ + public EncounterStatusHistoryComponent setStatus(EncounterState value) { + if (this.status == null) + this.status = new Enumeration(new EncounterStateEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (The time that the episode was in the specified status.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterStatusHistoryComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The time that the episode was in the specified status.) + */ + public EncounterStatusHistoryComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "planned | arrived | in-progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "The time that the episode was in the specified status.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -892481550: // status + this.status = new EncounterStateEnumFactory().fromType(value); // Enumeration + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("status")) + this.status = new EncounterStateEnumFactory().fromType(value); // Enumeration + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Encounter.status"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public EncounterStatusHistoryComponent copy() { + EncounterStatusHistoryComponent dst = new EncounterStatusHistoryComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EncounterStatusHistoryComponent)) + return false; + EncounterStatusHistoryComponent o = (EncounterStatusHistoryComponent) other; + return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EncounterStatusHistoryComponent)) + return false; + EncounterStatusHistoryComponent o = (EncounterStatusHistoryComponent) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + public String fhirType() { + return "Encounter.statusHistory"; + + } + + } + + @Block() + public static class EncounterParticipantComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Role of participant in encounter. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Role of participant in encounter", formalDefinition="Role of participant in encounter." ) + protected List type; + + /** + * The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Period of time during the encounter participant was present", formalDefinition="The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period." ) + protected Period period; + + /** + * Persons involved in the encounter other than the patient. + */ + @Child(name = "individual", type = {Practitioner.class, RelatedPerson.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Persons involved in the encounter other than the patient", formalDefinition="Persons involved in the encounter other than the patient." ) + protected Reference individual; + + /** + * The actual object that is the target of the reference (Persons involved in the encounter other than the patient.) + */ + protected Resource individualTarget; + + private static final long serialVersionUID = 317095765L; + + /** + * Constructor + */ + public EncounterParticipantComponent() { + super(); + } + + /** + * @return {@link #type} (Role of participant in encounter.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + 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 {@link #type} (Role of participant in encounter.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public EncounterParticipantComponent addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #period} (The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterParticipantComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.) + */ + public EncounterParticipantComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #individual} (Persons involved in the encounter other than the patient.) + */ + public Reference getIndividual() { + if (this.individual == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterParticipantComponent.individual"); + else if (Configuration.doAutoCreate()) + this.individual = new Reference(); // cc + return this.individual; + } + + public boolean hasIndividual() { + return this.individual != null && !this.individual.isEmpty(); + } + + /** + * @param value {@link #individual} (Persons involved in the encounter other than the patient.) + */ + public EncounterParticipantComponent setIndividual(Reference value) { + this.individual = value; + return this; + } + + /** + * @return {@link #individual} 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. (Persons involved in the encounter other than the patient.) + */ + public Resource getIndividualTarget() { + return this.individualTarget; + } + + /** + * @param value {@link #individual} 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. (Persons involved in the encounter other than the patient.) + */ + public EncounterParticipantComponent setIndividualTarget(Resource value) { + this.individualTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Role of participant in encounter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("period", "Period", "The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("individual", "Reference(Practitioner|RelatedPerson)", "Persons involved in the encounter other than the patient.", 0, java.lang.Integer.MAX_VALUE, individual)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -46292327: /*individual*/ return this.individual == null ? new Base[0] : new Base[] {this.individual}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.getType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -46292327: // individual + this.individual = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.getType().add(castToCodeableConcept(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("individual")) + this.individual = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return addType(); // CodeableConcept + case -991726143: return getPeriod(); // Period + case -46292327: return getIndividual(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + return addType(); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("individual")) { + this.individual = new Reference(); + return this.individual; + } + else + return super.addChild(name); + } + + public EncounterParticipantComponent copy() { + EncounterParticipantComponent dst = new EncounterParticipantComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.individual = individual == null ? null : individual.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EncounterParticipantComponent)) + return false; + EncounterParticipantComponent o = (EncounterParticipantComponent) other; + return compareDeep(type, o.type, true) && compareDeep(period, o.period, true) && compareDeep(individual, o.individual, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EncounterParticipantComponent)) + return false; + EncounterParticipantComponent o = (EncounterParticipantComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (period == null || period.isEmpty()) + && (individual == null || individual.isEmpty()); + } + + public String fhirType() { + return "Encounter.participant"; + + } + + } + + @Block() + public static class EncounterHospitalizationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Pre-admission identifier. + */ + @Child(name = "preAdmissionIdentifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Pre-admission identifier", formalDefinition="Pre-admission identifier." ) + protected Identifier preAdmissionIdentifier; + + /** + * The location from which the patient came before admission. + */ + @Child(name = "origin", type = {Location.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The location from which the patient came before admission", formalDefinition="The location from which the patient came before admission." ) + protected Reference origin; + + /** + * The actual object that is the target of the reference (The location from which the patient came before admission.) + */ + protected Location originTarget; + + /** + * From where patient was admitted (physician referral, transfer). + */ + @Child(name = "admitSource", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="From where patient was admitted (physician referral, transfer)", formalDefinition="From where patient was admitted (physician referral, transfer)." ) + protected CodeableConcept admitSource; + + /** + * The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter. + */ + @Child(name = "admittingDiagnosis", type = {Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The admitting diagnosis as reported by admitting practitioner", formalDefinition="The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter." ) + protected List admittingDiagnosis; + /** + * The actual objects that are the target of the reference (The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) + */ + protected List admittingDiagnosisTarget; + + + /** + * Whether this hospitalization is a readmission and why if known. + */ + @Child(name = "reAdmission", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The type of hospital re-admission that has occurred (if any). If the value is absent, then this is not identified as a readmission", formalDefinition="Whether this hospitalization is a readmission and why if known." ) + protected CodeableConcept reAdmission; + + /** + * Diet preferences reported by the patient. + */ + @Child(name = "dietPreference", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Diet preferences reported by the patient", formalDefinition="Diet preferences reported by the patient." ) + protected List dietPreference; + + /** + * Special courtesies (VIP, board member). + */ + @Child(name = "specialCourtesy", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Special courtesies (VIP, board member)", formalDefinition="Special courtesies (VIP, board member)." ) + protected List specialCourtesy; + + /** + * Wheelchair, translator, stretcher, etc. + */ + @Child(name = "specialArrangement", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Wheelchair, translator, stretcher, etc.", formalDefinition="Wheelchair, translator, stretcher, etc." ) + protected List specialArrangement; + + /** + * Location to which the patient is discharged. + */ + @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Location to which the patient is discharged", formalDefinition="Location to which the patient is discharged." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Location to which the patient is discharged.) + */ + protected Location destinationTarget; + + /** + * Category or kind of location after discharge. + */ + @Child(name = "dischargeDisposition", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Category or kind of location after discharge", formalDefinition="Category or kind of location after discharge." ) + protected CodeableConcept dischargeDisposition; + + /** + * The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete. + */ + @Child(name = "dischargeDiagnosis", type = {Condition.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete", formalDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete." ) + protected List dischargeDiagnosis; + /** + * The actual objects that are the target of the reference (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + protected List dischargeDiagnosisTarget; + + + private static final long serialVersionUID = 164618034L; + + /** + * Constructor + */ + public EncounterHospitalizationComponent() { + super(); + } + + /** + * @return {@link #preAdmissionIdentifier} (Pre-admission identifier.) + */ + public Identifier getPreAdmissionIdentifier() { + if (this.preAdmissionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.preAdmissionIdentifier"); + else if (Configuration.doAutoCreate()) + this.preAdmissionIdentifier = new Identifier(); // cc + return this.preAdmissionIdentifier; + } + + public boolean hasPreAdmissionIdentifier() { + return this.preAdmissionIdentifier != null && !this.preAdmissionIdentifier.isEmpty(); + } + + /** + * @param value {@link #preAdmissionIdentifier} (Pre-admission identifier.) + */ + public EncounterHospitalizationComponent setPreAdmissionIdentifier(Identifier value) { + this.preAdmissionIdentifier = value; + return this; + } + + /** + * @return {@link #origin} (The location from which the patient came before admission.) + */ + public Reference getOrigin() { + if (this.origin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); + else if (Configuration.doAutoCreate()) + this.origin = new Reference(); // cc + return this.origin; + } + + public boolean hasOrigin() { + return this.origin != null && !this.origin.isEmpty(); + } + + /** + * @param value {@link #origin} (The location from which the patient came before admission.) + */ + public EncounterHospitalizationComponent setOrigin(Reference value) { + this.origin = value; + return this; + } + + /** + * @return {@link #origin} 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 location from which the patient came before admission.) + */ + public Location getOriginTarget() { + if (this.originTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); + else if (Configuration.doAutoCreate()) + this.originTarget = new Location(); // aa + return this.originTarget; + } + + /** + * @param value {@link #origin} 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 location from which the patient came before admission.) + */ + public EncounterHospitalizationComponent setOriginTarget(Location value) { + this.originTarget = value; + return this; + } + + /** + * @return {@link #admitSource} (From where patient was admitted (physician referral, transfer).) + */ + public CodeableConcept getAdmitSource() { + if (this.admitSource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.admitSource"); + else if (Configuration.doAutoCreate()) + this.admitSource = new CodeableConcept(); // cc + return this.admitSource; + } + + public boolean hasAdmitSource() { + return this.admitSource != null && !this.admitSource.isEmpty(); + } + + /** + * @param value {@link #admitSource} (From where patient was admitted (physician referral, transfer).) + */ + public EncounterHospitalizationComponent setAdmitSource(CodeableConcept value) { + this.admitSource = value; + return this; + } + + /** + * @return {@link #admittingDiagnosis} (The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) + */ + public List getAdmittingDiagnosis() { + if (this.admittingDiagnosis == null) + this.admittingDiagnosis = new ArrayList(); + return this.admittingDiagnosis; + } + + public boolean hasAdmittingDiagnosis() { + if (this.admittingDiagnosis == null) + return false; + for (Reference item : this.admittingDiagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #admittingDiagnosis} (The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) + */ + // syntactic sugar + public Reference addAdmittingDiagnosis() { //3 + Reference t = new Reference(); + if (this.admittingDiagnosis == null) + this.admittingDiagnosis = new ArrayList(); + this.admittingDiagnosis.add(t); + return t; + } + + // syntactic sugar + public EncounterHospitalizationComponent addAdmittingDiagnosis(Reference t) { //3 + if (t == null) + return this; + if (this.admittingDiagnosis == null) + this.admittingDiagnosis = new ArrayList(); + this.admittingDiagnosis.add(t); + return this; + } + + /** + * @return {@link #admittingDiagnosis} (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 admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) + */ + public List getAdmittingDiagnosisTarget() { + if (this.admittingDiagnosisTarget == null) + this.admittingDiagnosisTarget = new ArrayList(); + return this.admittingDiagnosisTarget; + } + + // syntactic sugar + /** + * @return {@link #admittingDiagnosis} (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 admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) + */ + public Condition addAdmittingDiagnosisTarget() { + Condition r = new Condition(); + if (this.admittingDiagnosisTarget == null) + this.admittingDiagnosisTarget = new ArrayList(); + this.admittingDiagnosisTarget.add(r); + return r; + } + + /** + * @return {@link #reAdmission} (Whether this hospitalization is a readmission and why if known.) + */ + public CodeableConcept getReAdmission() { + if (this.reAdmission == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.reAdmission"); + else if (Configuration.doAutoCreate()) + this.reAdmission = new CodeableConcept(); // cc + return this.reAdmission; + } + + public boolean hasReAdmission() { + return this.reAdmission != null && !this.reAdmission.isEmpty(); + } + + /** + * @param value {@link #reAdmission} (Whether this hospitalization is a readmission and why if known.) + */ + public EncounterHospitalizationComponent setReAdmission(CodeableConcept value) { + this.reAdmission = value; + return this; + } + + /** + * @return {@link #dietPreference} (Diet preferences reported by the patient.) + */ + public List getDietPreference() { + if (this.dietPreference == null) + this.dietPreference = new ArrayList(); + return this.dietPreference; + } + + public boolean hasDietPreference() { + if (this.dietPreference == null) + return false; + for (CodeableConcept item : this.dietPreference) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dietPreference} (Diet preferences reported by the patient.) + */ + // syntactic sugar + public CodeableConcept addDietPreference() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.dietPreference == null) + this.dietPreference = new ArrayList(); + this.dietPreference.add(t); + return t; + } + + // syntactic sugar + public EncounterHospitalizationComponent addDietPreference(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.dietPreference == null) + this.dietPreference = new ArrayList(); + this.dietPreference.add(t); + return this; + } + + /** + * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) + */ + public List getSpecialCourtesy() { + if (this.specialCourtesy == null) + this.specialCourtesy = new ArrayList(); + return this.specialCourtesy; + } + + public boolean hasSpecialCourtesy() { + if (this.specialCourtesy == null) + return false; + for (CodeableConcept item : this.specialCourtesy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) + */ + // syntactic sugar + public CodeableConcept addSpecialCourtesy() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialCourtesy == null) + this.specialCourtesy = new ArrayList(); + this.specialCourtesy.add(t); + return t; + } + + // syntactic sugar + public EncounterHospitalizationComponent addSpecialCourtesy(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialCourtesy == null) + this.specialCourtesy = new ArrayList(); + this.specialCourtesy.add(t); + return this; + } + + /** + * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) + */ + public List getSpecialArrangement() { + if (this.specialArrangement == null) + this.specialArrangement = new ArrayList(); + return this.specialArrangement; + } + + public boolean hasSpecialArrangement() { + if (this.specialArrangement == null) + return false; + for (CodeableConcept item : this.specialArrangement) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) + */ + // syntactic sugar + public CodeableConcept addSpecialArrangement() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialArrangement == null) + this.specialArrangement = new ArrayList(); + this.specialArrangement.add(t); + return t; + } + + // syntactic sugar + public EncounterHospitalizationComponent addSpecialArrangement(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialArrangement == null) + this.specialArrangement = new ArrayList(); + this.specialArrangement.add(t); + return this; + } + + /** + * @return {@link #destination} (Location to which the patient is discharged.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); // cc + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Location to which the patient is discharged.) + */ + public EncounterHospitalizationComponent setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} 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. (Location to which the patient is discharged.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); // aa + return this.destinationTarget; + } + + /** + * @param value {@link #destination} 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. (Location to which the patient is discharged.) + */ + public EncounterHospitalizationComponent setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #dischargeDisposition} (Category or kind of location after discharge.) + */ + public CodeableConcept getDischargeDisposition() { + if (this.dischargeDisposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDisposition"); + else if (Configuration.doAutoCreate()) + this.dischargeDisposition = new CodeableConcept(); // cc + return this.dischargeDisposition; + } + + public boolean hasDischargeDisposition() { + return this.dischargeDisposition != null && !this.dischargeDisposition.isEmpty(); + } + + /** + * @param value {@link #dischargeDisposition} (Category or kind of location after discharge.) + */ + public EncounterHospitalizationComponent setDischargeDisposition(CodeableConcept value) { + this.dischargeDisposition = value; + return this; + } + + /** + * @return {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public List getDischargeDiagnosis() { + if (this.dischargeDiagnosis == null) + this.dischargeDiagnosis = new ArrayList(); + return this.dischargeDiagnosis; + } + + public boolean hasDischargeDiagnosis() { + if (this.dischargeDiagnosis == null) + return false; + for (Reference item : this.dischargeDiagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + // syntactic sugar + public Reference addDischargeDiagnosis() { //3 + Reference t = new Reference(); + if (this.dischargeDiagnosis == null) + this.dischargeDiagnosis = new ArrayList(); + this.dischargeDiagnosis.add(t); + return t; + } + + // syntactic sugar + public EncounterHospitalizationComponent addDischargeDiagnosis(Reference t) { //3 + if (t == null) + return this; + if (this.dischargeDiagnosis == null) + this.dischargeDiagnosis = new ArrayList(); + this.dischargeDiagnosis.add(t); + return this; + } + + /** + * @return {@link #dischargeDiagnosis} (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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public List getDischargeDiagnosisTarget() { + if (this.dischargeDiagnosisTarget == null) + this.dischargeDiagnosisTarget = new ArrayList(); + return this.dischargeDiagnosisTarget; + } + + // syntactic sugar + /** + * @return {@link #dischargeDiagnosis} (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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public Condition addDischargeDiagnosisTarget() { + Condition r = new Condition(); + if (this.dischargeDiagnosisTarget == null) + this.dischargeDiagnosisTarget = new ArrayList(); + this.dischargeDiagnosisTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("preAdmissionIdentifier", "Identifier", "Pre-admission identifier.", 0, java.lang.Integer.MAX_VALUE, preAdmissionIdentifier)); + childrenList.add(new Property("origin", "Reference(Location)", "The location from which the patient came before admission.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("admitSource", "CodeableConcept", "From where patient was admitted (physician referral, transfer).", 0, java.lang.Integer.MAX_VALUE, admitSource)); + childrenList.add(new Property("admittingDiagnosis", "Reference(Condition)", "The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.", 0, java.lang.Integer.MAX_VALUE, admittingDiagnosis)); + childrenList.add(new Property("reAdmission", "CodeableConcept", "Whether this hospitalization is a readmission and why if known.", 0, java.lang.Integer.MAX_VALUE, reAdmission)); + childrenList.add(new Property("dietPreference", "CodeableConcept", "Diet preferences reported by the patient.", 0, java.lang.Integer.MAX_VALUE, dietPreference)); + childrenList.add(new Property("specialCourtesy", "CodeableConcept", "Special courtesies (VIP, board member).", 0, java.lang.Integer.MAX_VALUE, specialCourtesy)); + childrenList.add(new Property("specialArrangement", "CodeableConcept", "Wheelchair, translator, stretcher, etc.", 0, java.lang.Integer.MAX_VALUE, specialArrangement)); + childrenList.add(new Property("destination", "Reference(Location)", "Location to which the patient is discharged.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("dischargeDisposition", "CodeableConcept", "Category or kind of location after discharge.", 0, java.lang.Integer.MAX_VALUE, dischargeDisposition)); + childrenList.add(new Property("dischargeDiagnosis", "Reference(Condition)", "The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.", 0, java.lang.Integer.MAX_VALUE, dischargeDiagnosis)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -965394961: /*preAdmissionIdentifier*/ return this.preAdmissionIdentifier == null ? new Base[0] : new Base[] {this.preAdmissionIdentifier}; // Identifier + case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // Reference + case 538887120: /*admitSource*/ return this.admitSource == null ? new Base[0] : new Base[] {this.admitSource}; // CodeableConcept + case 2048045678: /*admittingDiagnosis*/ return this.admittingDiagnosis == null ? new Base[0] : this.admittingDiagnosis.toArray(new Base[this.admittingDiagnosis.size()]); // Reference + case 669348630: /*reAdmission*/ return this.reAdmission == null ? new Base[0] : new Base[] {this.reAdmission}; // CodeableConcept + case -1360641041: /*dietPreference*/ return this.dietPreference == null ? new Base[0] : this.dietPreference.toArray(new Base[this.dietPreference.size()]); // CodeableConcept + case 1583588345: /*specialCourtesy*/ return this.specialCourtesy == null ? new Base[0] : this.specialCourtesy.toArray(new Base[this.specialCourtesy.size()]); // CodeableConcept + case 47410321: /*specialArrangement*/ return this.specialArrangement == null ? new Base[0] : this.specialArrangement.toArray(new Base[this.specialArrangement.size()]); // CodeableConcept + case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference + case 528065941: /*dischargeDisposition*/ return this.dischargeDisposition == null ? new Base[0] : new Base[] {this.dischargeDisposition}; // CodeableConcept + case -1985183665: /*dischargeDiagnosis*/ return this.dischargeDiagnosis == null ? new Base[0] : this.dischargeDiagnosis.toArray(new Base[this.dischargeDiagnosis.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -965394961: // preAdmissionIdentifier + this.preAdmissionIdentifier = castToIdentifier(value); // Identifier + break; + case -1008619738: // origin + this.origin = castToReference(value); // Reference + break; + case 538887120: // admitSource + this.admitSource = castToCodeableConcept(value); // CodeableConcept + break; + case 2048045678: // admittingDiagnosis + this.getAdmittingDiagnosis().add(castToReference(value)); // Reference + break; + case 669348630: // reAdmission + this.reAdmission = castToCodeableConcept(value); // CodeableConcept + break; + case -1360641041: // dietPreference + this.getDietPreference().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1583588345: // specialCourtesy + this.getSpecialCourtesy().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 47410321: // specialArrangement + this.getSpecialArrangement().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1429847026: // destination + this.destination = castToReference(value); // Reference + break; + case 528065941: // dischargeDisposition + this.dischargeDisposition = castToCodeableConcept(value); // CodeableConcept + break; + case -1985183665: // dischargeDiagnosis + this.getDischargeDiagnosis().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("preAdmissionIdentifier")) + this.preAdmissionIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("origin")) + this.origin = castToReference(value); // Reference + else if (name.equals("admitSource")) + this.admitSource = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("admittingDiagnosis")) + this.getAdmittingDiagnosis().add(castToReference(value)); + else if (name.equals("reAdmission")) + this.reAdmission = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("dietPreference")) + this.getDietPreference().add(castToCodeableConcept(value)); + else if (name.equals("specialCourtesy")) + this.getSpecialCourtesy().add(castToCodeableConcept(value)); + else if (name.equals("specialArrangement")) + this.getSpecialArrangement().add(castToCodeableConcept(value)); + else if (name.equals("destination")) + this.destination = castToReference(value); // Reference + else if (name.equals("dischargeDisposition")) + this.dischargeDisposition = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("dischargeDiagnosis")) + this.getDischargeDiagnosis().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -965394961: return getPreAdmissionIdentifier(); // Identifier + case -1008619738: return getOrigin(); // Reference + case 538887120: return getAdmitSource(); // CodeableConcept + case 2048045678: return addAdmittingDiagnosis(); // Reference + case 669348630: return getReAdmission(); // CodeableConcept + case -1360641041: return addDietPreference(); // CodeableConcept + case 1583588345: return addSpecialCourtesy(); // CodeableConcept + case 47410321: return addSpecialArrangement(); // CodeableConcept + case -1429847026: return getDestination(); // Reference + case 528065941: return getDischargeDisposition(); // CodeableConcept + case -1985183665: return addDischargeDiagnosis(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("preAdmissionIdentifier")) { + this.preAdmissionIdentifier = new Identifier(); + return this.preAdmissionIdentifier; + } + else if (name.equals("origin")) { + this.origin = new Reference(); + return this.origin; + } + else if (name.equals("admitSource")) { + this.admitSource = new CodeableConcept(); + return this.admitSource; + } + else if (name.equals("admittingDiagnosis")) { + return addAdmittingDiagnosis(); + } + else if (name.equals("reAdmission")) { + this.reAdmission = new CodeableConcept(); + return this.reAdmission; + } + else if (name.equals("dietPreference")) { + return addDietPreference(); + } + else if (name.equals("specialCourtesy")) { + return addSpecialCourtesy(); + } + else if (name.equals("specialArrangement")) { + return addSpecialArrangement(); + } + else if (name.equals("destination")) { + this.destination = new Reference(); + return this.destination; + } + else if (name.equals("dischargeDisposition")) { + this.dischargeDisposition = new CodeableConcept(); + return this.dischargeDisposition; + } + else if (name.equals("dischargeDiagnosis")) { + return addDischargeDiagnosis(); + } + else + return super.addChild(name); + } + + public EncounterHospitalizationComponent copy() { + EncounterHospitalizationComponent dst = new EncounterHospitalizationComponent(); + copyValues(dst); + dst.preAdmissionIdentifier = preAdmissionIdentifier == null ? null : preAdmissionIdentifier.copy(); + dst.origin = origin == null ? null : origin.copy(); + dst.admitSource = admitSource == null ? null : admitSource.copy(); + if (admittingDiagnosis != null) { + dst.admittingDiagnosis = new ArrayList(); + for (Reference i : admittingDiagnosis) + dst.admittingDiagnosis.add(i.copy()); + }; + dst.reAdmission = reAdmission == null ? null : reAdmission.copy(); + if (dietPreference != null) { + dst.dietPreference = new ArrayList(); + for (CodeableConcept i : dietPreference) + dst.dietPreference.add(i.copy()); + }; + if (specialCourtesy != null) { + dst.specialCourtesy = new ArrayList(); + for (CodeableConcept i : specialCourtesy) + dst.specialCourtesy.add(i.copy()); + }; + if (specialArrangement != null) { + dst.specialArrangement = new ArrayList(); + for (CodeableConcept i : specialArrangement) + dst.specialArrangement.add(i.copy()); + }; + dst.destination = destination == null ? null : destination.copy(); + dst.dischargeDisposition = dischargeDisposition == null ? null : dischargeDisposition.copy(); + if (dischargeDiagnosis != null) { + dst.dischargeDiagnosis = new ArrayList(); + for (Reference i : dischargeDiagnosis) + dst.dischargeDiagnosis.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EncounterHospitalizationComponent)) + return false; + EncounterHospitalizationComponent o = (EncounterHospitalizationComponent) other; + return compareDeep(preAdmissionIdentifier, o.preAdmissionIdentifier, true) && compareDeep(origin, o.origin, true) + && compareDeep(admitSource, o.admitSource, true) && compareDeep(admittingDiagnosis, o.admittingDiagnosis, true) + && compareDeep(reAdmission, o.reAdmission, true) && compareDeep(dietPreference, o.dietPreference, true) + && compareDeep(specialCourtesy, o.specialCourtesy, true) && compareDeep(specialArrangement, o.specialArrangement, true) + && compareDeep(destination, o.destination, true) && compareDeep(dischargeDisposition, o.dischargeDisposition, true) + && compareDeep(dischargeDiagnosis, o.dischargeDiagnosis, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EncounterHospitalizationComponent)) + return false; + EncounterHospitalizationComponent o = (EncounterHospitalizationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (preAdmissionIdentifier == null || preAdmissionIdentifier.isEmpty()) + && (origin == null || origin.isEmpty()) && (admitSource == null || admitSource.isEmpty()) + && (admittingDiagnosis == null || admittingDiagnosis.isEmpty()) && (reAdmission == null || reAdmission.isEmpty()) + && (dietPreference == null || dietPreference.isEmpty()) && (specialCourtesy == null || specialCourtesy.isEmpty()) + && (specialArrangement == null || specialArrangement.isEmpty()) && (destination == null || destination.isEmpty()) + && (dischargeDisposition == null || dischargeDisposition.isEmpty()) && (dischargeDiagnosis == null || dischargeDiagnosis.isEmpty()) + ; + } + + public String fhirType() { + return "Encounter.hospitalization"; + + } + + } + + @Block() + public static class EncounterLocationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The location where the encounter takes place. + */ + @Child(name = "location", type = {Location.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Location the encounter takes place", formalDefinition="The location where the encounter takes place." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The location where the encounter takes place.) + */ + protected Location locationTarget; + + /** + * The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="planned | active | reserved | completed", formalDefinition="The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time." ) + protected Enumeration status; + + /** + * Time period during which the patient was present at the location. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Time period during which the patient was present at the location", formalDefinition="Time period during which the patient was present at the location." ) + protected Period period; + + private static final long serialVersionUID = -322984880L; + + /** + * Constructor + */ + public EncounterLocationComponent() { + super(); + } + + /** + * Constructor + */ + public EncounterLocationComponent(Reference location) { + super(); + this.location = location; + } + + /** + * @return {@link #location} (The location where the encounter takes place.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location where the encounter takes place.) + */ + public EncounterLocationComponent 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. (The location where the encounter takes place.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + 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. (The location where the encounter takes place.) + */ + public EncounterLocationComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.). 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 EncounterLocationComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EncounterLocationStatusEnumFactory()); // bb + 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 participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public EncounterLocationComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. + */ + public EncounterLocationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. + */ + public EncounterLocationComponent setStatus(EncounterLocationStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new EncounterLocationStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period during which the patient was present at the location.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period during which the patient was present at the location.) + */ + public EncounterLocationComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("location", "Reference(Location)", "The location where the encounter takes place.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("status", "code", "The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "Time period during which the patient was present at the location.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1901043637: // location + this.location = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new EncounterLocationStatusEnumFactory().fromType(value); // Enumeration + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("location")) + this.location = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new EncounterLocationStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1901043637: return getLocation(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("location")) { + this.location = new Reference(); + return this.location; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Encounter.status"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public EncounterLocationComponent copy() { + EncounterLocationComponent dst = new EncounterLocationComponent(); + copyValues(dst); + dst.location = location == null ? null : location.copy(); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EncounterLocationComponent)) + return false; + EncounterLocationComponent o = (EncounterLocationComponent) other; + return compareDeep(location, o.location, true) && compareDeep(status, o.status, true) && compareDeep(period, o.period, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EncounterLocationComponent)) + return false; + EncounterLocationComponent o = (EncounterLocationComponent) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (location == null || location.isEmpty()) && (status == null || status.isEmpty()) + && (period == null || period.isEmpty()); + } + + public String fhirType() { + return "Encounter.location"; + + } + + } + + /** + * Identifier(s) by which this encounter is known. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Identifier(s) by which this encounter is known", formalDefinition="Identifier(s) by which this encounter is known." ) + protected List identifier; + + /** + * planned | arrived | in-progress | onleave | finished | cancelled. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="planned | arrived | in-progress | onleave | finished | cancelled", formalDefinition="planned | arrived | in-progress | onleave | finished | cancelled." ) + protected Enumeration status; + + /** + * The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them. + */ + @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="List of past encounter statuses", formalDefinition="The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them." ) + protected List statusHistory; + + /** + * inpatient | outpatient | ambulatory | emergency +. + */ + @Child(name = "class", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="inpatient | outpatient | ambulatory | emergency +", formalDefinition="inpatient | outpatient | ambulatory | emergency +." ) + protected Enumeration class_; + + /** + * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). + */ + @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Specific type of encounter", formalDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)." ) + protected List type; + + /** + * Indicates the urgency of the encounter. + */ + @Child(name = "priority", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Indicates the urgency of the encounter", formalDefinition="Indicates the urgency of the encounter." ) + protected CodeableConcept priority; + + /** + * The patient present at the encounter. + */ + @Child(name = "patient", type = {Patient.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The patient present at the encounter", formalDefinition="The patient present at the encounter." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient present at the encounter.) + */ + protected Patient patientTarget; + + /** + * Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years). + */ + @Child(name = "episodeOfCare", type = {EpisodeOfCare.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Episode(s) of care that this encounter should be recorded against", formalDefinition="Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years)." ) + protected List episodeOfCare; + /** + * The actual objects that are the target of the reference (Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) + */ + protected List episodeOfCareTarget; + + + /** + * The referral request this encounter satisfies (incoming referral). + */ + @Child(name = "incomingReferral", type = {ReferralRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The ReferralRequest that initiated this encounter", formalDefinition="The referral request this encounter satisfies (incoming referral)." ) + protected List incomingReferral; + /** + * The actual objects that are the target of the reference (The referral request this encounter satisfies (incoming referral).) + */ + protected List incomingReferralTarget; + + + /** + * The list of people responsible for providing the service. + */ + @Child(name = "participant", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="List of participants involved in the encounter", formalDefinition="The list of people responsible for providing the service." ) + protected List participant; + + /** + * The appointment that scheduled this encounter. + */ + @Child(name = "appointment", type = {Appointment.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The appointment that scheduled this encounter", formalDefinition="The appointment that scheduled this encounter." ) + protected Reference appointment; + + /** + * The actual object that is the target of the reference (The appointment that scheduled this encounter.) + */ + protected Appointment appointmentTarget; + + /** + * The start and end time of the encounter. + */ + @Child(name = "period", type = {Period.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The start and end time of the encounter", formalDefinition="The start and end time of the encounter." ) + protected Period period; + + /** + * Quantity of time the encounter lasted. This excludes the time during leaves of absence. + */ + @Child(name = "length", type = {Duration.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Quantity of time the encounter lasted (less time absent)", formalDefinition="Quantity of time the encounter lasted. This excludes the time during leaves of absence." ) + protected Duration length; + + /** + * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Reason the encounter takes place (code)", formalDefinition="Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis." ) + protected List reason; + + /** + * Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. + */ + @Child(name = "indication", type = {Condition.class, Procedure.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Reason the encounter takes place (resource)", formalDefinition="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure." ) + protected List indication; + /** + * The actual objects that are the target of the reference (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) + */ + protected List indicationTarget; + + + /** + * Details about the admission to a healthcare service. + */ + @Child(name = "hospitalization", type = {}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Details about the admission to a healthcare service", formalDefinition="Details about the admission to a healthcare service." ) + protected EncounterHospitalizationComponent hospitalization; + + /** + * List of locations where the patient has been during this encounter. + */ + @Child(name = "location", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="List of locations where the patient has been", formalDefinition="List of locations where the patient has been during this encounter." ) + protected List location; + + /** + * An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization. + */ + @Child(name = "serviceProvider", type = {Organization.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The custodian organization of this Encounter record", formalDefinition="An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization." ) + protected Reference serviceProvider; + + /** + * The actual object that is the target of the reference (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + protected Organization serviceProviderTarget; + + /** + * Another Encounter of which this encounter is a part of (administratively or in time). + */ + @Child(name = "partOf", type = {Encounter.class}, order=18, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Another Encounter this encounter is part of", formalDefinition="Another Encounter of which this encounter is a part of (administratively or in time)." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + protected Encounter partOfTarget; + + private static final long serialVersionUID = 929562300L; + + /** + * Constructor + */ + public Encounter() { + super(); + } + + /** + * Constructor + */ + public Encounter(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (Identifier(s) by which this encounter is known.) + */ + 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(s) by which this encounter is known.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Encounter addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). 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 Encounter.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EncounterStateEnumFactory()); // bb + 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} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Encounter setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | arrived | in-progress | onleave | finished | cancelled. + */ + public EncounterState getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | arrived | in-progress | onleave | finished | cancelled. + */ + public Encounter setStatus(EncounterState value) { + if (this.status == null) + this.status = new Enumeration(new EncounterStateEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #statusHistory} (The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.) + */ + public List getStatusHistory() { + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + return this.statusHistory; + } + + public boolean hasStatusHistory() { + if (this.statusHistory == null) + return false; + for (EncounterStatusHistoryComponent item : this.statusHistory) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #statusHistory} (The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.) + */ + // syntactic sugar + public EncounterStatusHistoryComponent addStatusHistory() { //3 + EncounterStatusHistoryComponent t = new EncounterStatusHistoryComponent(); + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + this.statusHistory.add(t); + return t; + } + + // syntactic sugar + public Encounter addStatusHistory(EncounterStatusHistoryComponent t) { //3 + if (t == null) + return this; + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + this.statusHistory.add(t); + return this; + } + + /** + * @return {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value + */ + public Enumeration getClass_Element() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new Enumeration(new EncounterClassEnumFactory()); // bb + return this.class_; + } + + public boolean hasClass_Element() { + return this.class_ != null && !this.class_.isEmpty(); + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value + */ + public Encounter setClass_Element(Enumeration value) { + this.class_ = value; + return this; + } + + /** + * @return inpatient | outpatient | ambulatory | emergency +. + */ + public EncounterClass getClass_() { + return this.class_ == null ? null : this.class_.getValue(); + } + + /** + * @param value inpatient | outpatient | ambulatory | emergency +. + */ + public Encounter setClass_(EncounterClass value) { + if (value == null) + this.class_ = null; + else { + if (this.class_ == null) + this.class_ = new Enumeration(new EncounterClassEnumFactory()); + this.class_.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + 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 {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public Encounter addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #priority} (Indicates the urgency of the encounter.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Indicates the urgency of the encounter.) + */ + public Encounter setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + /** + * @return {@link #patient} (The patient present at the encounter.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient present at the encounter.) + */ + public Encounter 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 present at the encounter.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 present at the encounter.) + */ + public Encounter setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) + */ + public List getEpisodeOfCare() { + if (this.episodeOfCare == null) + this.episodeOfCare = new ArrayList(); + return this.episodeOfCare; + } + + public boolean hasEpisodeOfCare() { + if (this.episodeOfCare == null) + return false; + for (Reference item : this.episodeOfCare) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) + */ + // syntactic sugar + public Reference addEpisodeOfCare() { //3 + Reference t = new Reference(); + if (this.episodeOfCare == null) + this.episodeOfCare = new ArrayList(); + this.episodeOfCare.add(t); + return t; + } + + // syntactic sugar + public Encounter addEpisodeOfCare(Reference t) { //3 + if (t == null) + return this; + if (this.episodeOfCare == null) + this.episodeOfCare = new ArrayList(); + this.episodeOfCare.add(t); + return this; + } + + /** + * @return {@link #episodeOfCare} (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. Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) + */ + public List getEpisodeOfCareTarget() { + if (this.episodeOfCareTarget == null) + this.episodeOfCareTarget = new ArrayList(); + return this.episodeOfCareTarget; + } + + // syntactic sugar + /** + * @return {@link #episodeOfCare} (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. Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) + */ + public EpisodeOfCare addEpisodeOfCareTarget() { + EpisodeOfCare r = new EpisodeOfCare(); + if (this.episodeOfCareTarget == null) + this.episodeOfCareTarget = new ArrayList(); + this.episodeOfCareTarget.add(r); + return r; + } + + /** + * @return {@link #incomingReferral} (The referral request this encounter satisfies (incoming referral).) + */ + public List getIncomingReferral() { + if (this.incomingReferral == null) + this.incomingReferral = new ArrayList(); + return this.incomingReferral; + } + + public boolean hasIncomingReferral() { + if (this.incomingReferral == null) + return false; + for (Reference item : this.incomingReferral) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #incomingReferral} (The referral request this encounter satisfies (incoming referral).) + */ + // syntactic sugar + public Reference addIncomingReferral() { //3 + Reference t = new Reference(); + if (this.incomingReferral == null) + this.incomingReferral = new ArrayList(); + this.incomingReferral.add(t); + return t; + } + + // syntactic sugar + public Encounter addIncomingReferral(Reference t) { //3 + if (t == null) + return this; + if (this.incomingReferral == null) + this.incomingReferral = new ArrayList(); + this.incomingReferral.add(t); + return this; + } + + /** + * @return {@link #incomingReferral} (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 referral request this encounter satisfies (incoming referral).) + */ + public List getIncomingReferralTarget() { + if (this.incomingReferralTarget == null) + this.incomingReferralTarget = new ArrayList(); + return this.incomingReferralTarget; + } + + // syntactic sugar + /** + * @return {@link #incomingReferral} (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 referral request this encounter satisfies (incoming referral).) + */ + public ReferralRequest addIncomingReferralTarget() { + ReferralRequest r = new ReferralRequest(); + if (this.incomingReferralTarget == null) + this.incomingReferralTarget = new ArrayList(); + this.incomingReferralTarget.add(r); + return r; + } + + /** + * @return {@link #participant} (The list of people responsible for providing the service.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (EncounterParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (The list of people responsible for providing the service.) + */ + // syntactic sugar + public EncounterParticipantComponent addParticipant() { //3 + EncounterParticipantComponent t = new EncounterParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public Encounter addParticipant(EncounterParticipantComponent t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return this; + } + + /** + * @return {@link #appointment} (The appointment that scheduled this encounter.) + */ + public Reference getAppointment() { + if (this.appointment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.appointment"); + else if (Configuration.doAutoCreate()) + this.appointment = new Reference(); // cc + return this.appointment; + } + + public boolean hasAppointment() { + return this.appointment != null && !this.appointment.isEmpty(); + } + + /** + * @param value {@link #appointment} (The appointment that scheduled this encounter.) + */ + public Encounter setAppointment(Reference value) { + this.appointment = value; + return this; + } + + /** + * @return {@link #appointment} 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 appointment that scheduled this encounter.) + */ + public Appointment getAppointmentTarget() { + if (this.appointmentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.appointment"); + else if (Configuration.doAutoCreate()) + this.appointmentTarget = new Appointment(); // aa + return this.appointmentTarget; + } + + /** + * @param value {@link #appointment} 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 appointment that scheduled this encounter.) + */ + public Encounter setAppointmentTarget(Appointment value) { + this.appointmentTarget = value; + return this; + } + + /** + * @return {@link #period} (The start and end time of the encounter.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The start and end time of the encounter.) + */ + public Encounter setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) + */ + public Duration getLength() { + if (this.length == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.length"); + else if (Configuration.doAutoCreate()) + this.length = new Duration(); // cc + return this.length; + } + + public boolean hasLength() { + return this.length != null && !this.length.isEmpty(); + } + + /** + * @param value {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) + */ + public Encounter setLength(Duration value) { + this.length = value; + return this; + } + + /** + * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public Encounter addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + return this.indication; + } + + public boolean hasIndication() { + if (this.indication == null) + return false; + for (Reference item : this.indication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) + */ + // syntactic sugar + public Reference addIndication() { //3 + Reference t = new Reference(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + // syntactic sugar + public Encounter addIndication(Reference t) { //3 + if (t == null) + return this; + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return this; + } + + /** + * @return {@link #indication} (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. Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) + */ + public List getIndicationTarget() { + if (this.indicationTarget == null) + this.indicationTarget = new ArrayList(); + return this.indicationTarget; + } + + /** + * @return {@link #hospitalization} (Details about the admission to a healthcare service.) + */ + public EncounterHospitalizationComponent getHospitalization() { + if (this.hospitalization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.hospitalization"); + else if (Configuration.doAutoCreate()) + this.hospitalization = new EncounterHospitalizationComponent(); // cc + return this.hospitalization; + } + + public boolean hasHospitalization() { + return this.hospitalization != null && !this.hospitalization.isEmpty(); + } + + /** + * @param value {@link #hospitalization} (Details about the admission to a healthcare service.) + */ + public Encounter setHospitalization(EncounterHospitalizationComponent value) { + this.hospitalization = value; + return this; + } + + /** + * @return {@link #location} (List of locations where the patient has been during this encounter.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (EncounterLocationComponent item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (List of locations where the patient has been during this encounter.) + */ + // syntactic sugar + public EncounterLocationComponent addLocation() { //3 + EncounterLocationComponent t = new EncounterLocationComponent(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + // syntactic sugar + public Encounter addLocation(EncounterLocationComponent t) { //3 + if (t == null) + return this; + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @return {@link #serviceProvider} (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + public Reference getServiceProvider() { + if (this.serviceProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.serviceProvider"); + else if (Configuration.doAutoCreate()) + this.serviceProvider = new Reference(); // cc + return this.serviceProvider; + } + + public boolean hasServiceProvider() { + return this.serviceProvider != null && !this.serviceProvider.isEmpty(); + } + + /** + * @param value {@link #serviceProvider} (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + public Encounter setServiceProvider(Reference value) { + this.serviceProvider = value; + return this; + } + + /** + * @return {@link #serviceProvider} 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. (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + public Organization getServiceProviderTarget() { + if (this.serviceProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.serviceProvider"); + else if (Configuration.doAutoCreate()) + this.serviceProviderTarget = new Organization(); // aa + return this.serviceProviderTarget; + } + + /** + * @param value {@link #serviceProvider} 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. (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) + */ + public Encounter setServiceProviderTarget(Organization value) { + this.serviceProviderTarget = value; + return this; + } + + /** + * @return {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); // cc + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} 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. (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Encounter(); // aa + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} 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. (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter setPartOfTarget(Encounter value) { + this.partOfTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this encounter is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "planned | arrived | in-progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("statusHistory", "", "The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.", 0, java.lang.Integer.MAX_VALUE, statusHistory)); + childrenList.add(new Property("class", "code", "inpatient | outpatient | ambulatory | emergency +.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("type", "CodeableConcept", "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("priority", "CodeableConcept", "Indicates the urgency of the encounter.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient present at the encounter.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("episodeOfCare", "Reference(EpisodeOfCare)", "Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).", 0, java.lang.Integer.MAX_VALUE, episodeOfCare)); + childrenList.add(new Property("incomingReferral", "Reference(ReferralRequest)", "The referral request this encounter satisfies (incoming referral).", 0, java.lang.Integer.MAX_VALUE, incomingReferral)); + childrenList.add(new Property("participant", "", "The list of people responsible for providing the service.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("appointment", "Reference(Appointment)", "The appointment that scheduled this encounter.", 0, java.lang.Integer.MAX_VALUE, appointment)); + childrenList.add(new Property("period", "Period", "The start and end time of the encounter.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("length", "Duration", "Quantity of time the encounter lasted. This excludes the time during leaves of absence.", 0, java.lang.Integer.MAX_VALUE, length)); + childrenList.add(new Property("reason", "CodeableConcept", "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("indication", "Reference(Condition|Procedure)", "Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("hospitalization", "", "Details about the admission to a healthcare service.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); + childrenList.add(new Property("location", "", "List of locations where the patient has been during this encounter.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("serviceProvider", "Reference(Organization)", "An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.", 0, java.lang.Integer.MAX_VALUE, serviceProvider)); + childrenList.add(new Property("partOf", "Reference(Encounter)", "Another Encounter of which this encounter is a part of (administratively or in time).", 0, java.lang.Integer.MAX_VALUE, partOf)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -986695614: /*statusHistory*/ return this.statusHistory == null ? new Base[0] : this.statusHistory.toArray(new Base[this.statusHistory.size()]); // EncounterStatusHistoryComponent + case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1892140189: /*episodeOfCare*/ return this.episodeOfCare == null ? new Base[0] : this.episodeOfCare.toArray(new Base[this.episodeOfCare.size()]); // Reference + case -1258204701: /*incomingReferral*/ return this.incomingReferral == null ? new Base[0] : this.incomingReferral.toArray(new Base[this.incomingReferral.size()]); // Reference + case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // EncounterParticipantComponent + case -1474995297: /*appointment*/ return this.appointment == null ? new Base[0] : new Base[] {this.appointment}; // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -1106363674: /*length*/ return this.length == null ? new Base[0] : new Base[] {this.length}; // Duration + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept + case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // Reference + case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // EncounterHospitalizationComponent + case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // EncounterLocationComponent + case 243182534: /*serviceProvider*/ return this.serviceProvider == null ? new Base[0] : new Base[] {this.serviceProvider}; // Reference + case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : new Base[] {this.partOf}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new EncounterStateEnumFactory().fromType(value); // Enumeration + break; + case -986695614: // statusHistory + this.getStatusHistory().add((EncounterStatusHistoryComponent) value); // EncounterStatusHistoryComponent + break; + case 94742904: // class + this.class_ = new EncounterClassEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.getType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1165461084: // priority + this.priority = castToCodeableConcept(value); // CodeableConcept + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1892140189: // episodeOfCare + this.getEpisodeOfCare().add(castToReference(value)); // Reference + break; + case -1258204701: // incomingReferral + this.getIncomingReferral().add(castToReference(value)); // Reference + break; + case 767422259: // participant + this.getParticipant().add((EncounterParticipantComponent) value); // EncounterParticipantComponent + break; + case -1474995297: // appointment + this.appointment = castToReference(value); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -1106363674: // length + this.length = castToDuration(value); // Duration + break; + case -934964668: // reason + this.getReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -597168804: // indication + this.getIndication().add(castToReference(value)); // Reference + break; + case 1057894634: // hospitalization + this.hospitalization = (EncounterHospitalizationComponent) value; // EncounterHospitalizationComponent + break; + case 1901043637: // location + this.getLocation().add((EncounterLocationComponent) value); // EncounterLocationComponent + break; + case 243182534: // serviceProvider + this.serviceProvider = castToReference(value); // Reference + break; + case -995410646: // partOf + this.partOf = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new EncounterStateEnumFactory().fromType(value); // Enumeration + else if (name.equals("statusHistory")) + this.getStatusHistory().add((EncounterStatusHistoryComponent) value); + else if (name.equals("class")) + this.class_ = new EncounterClassEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.getType().add(castToCodeableConcept(value)); + else if (name.equals("priority")) + this.priority = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("episodeOfCare")) + this.getEpisodeOfCare().add(castToReference(value)); + else if (name.equals("incomingReferral")) + this.getIncomingReferral().add(castToReference(value)); + else if (name.equals("participant")) + this.getParticipant().add((EncounterParticipantComponent) value); + else if (name.equals("appointment")) + this.appointment = castToReference(value); // Reference + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("length")) + this.length = castToDuration(value); // Duration + else if (name.equals("reason")) + this.getReason().add(castToCodeableConcept(value)); + else if (name.equals("indication")) + this.getIndication().add(castToReference(value)); + else if (name.equals("hospitalization")) + this.hospitalization = (EncounterHospitalizationComponent) value; // EncounterHospitalizationComponent + else if (name.equals("location")) + this.getLocation().add((EncounterLocationComponent) value); + else if (name.equals("serviceProvider")) + this.serviceProvider = castToReference(value); // Reference + else if (name.equals("partOf")) + this.partOf = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -986695614: return addStatusHistory(); // EncounterStatusHistoryComponent + case 94742904: throw new FHIRException("Cannot make property class as it is not a complex type"); // Enumeration + case 3575610: return addType(); // CodeableConcept + case -1165461084: return getPriority(); // CodeableConcept + case -791418107: return getPatient(); // Reference + case -1892140189: return addEpisodeOfCare(); // Reference + case -1258204701: return addIncomingReferral(); // Reference + case 767422259: return addParticipant(); // EncounterParticipantComponent + case -1474995297: return getAppointment(); // Reference + case -991726143: return getPeriod(); // Period + case -1106363674: return getLength(); // Duration + case -934964668: return addReason(); // CodeableConcept + case -597168804: return addIndication(); // Reference + case 1057894634: return getHospitalization(); // EncounterHospitalizationComponent + case 1901043637: return addLocation(); // EncounterLocationComponent + case 243182534: return getServiceProvider(); // Reference + case -995410646: return getPartOf(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Encounter.status"); + } + else if (name.equals("statusHistory")) { + return addStatusHistory(); + } + else if (name.equals("class")) { + throw new FHIRException("Cannot call addChild on a primitive type Encounter.class"); + } + else if (name.equals("type")) { + return addType(); + } + else if (name.equals("priority")) { + this.priority = new CodeableConcept(); + return this.priority; + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("episodeOfCare")) { + return addEpisodeOfCare(); + } + else if (name.equals("incomingReferral")) { + return addIncomingReferral(); + } + else if (name.equals("participant")) { + return addParticipant(); + } + else if (name.equals("appointment")) { + this.appointment = new Reference(); + return this.appointment; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("length")) { + this.length = new Duration(); + return this.length; + } + else if (name.equals("reason")) { + return addReason(); + } + else if (name.equals("indication")) { + return addIndication(); + } + else if (name.equals("hospitalization")) { + this.hospitalization = new EncounterHospitalizationComponent(); + return this.hospitalization; + } + else if (name.equals("location")) { + return addLocation(); + } + else if (name.equals("serviceProvider")) { + this.serviceProvider = new Reference(); + return this.serviceProvider; + } + else if (name.equals("partOf")) { + this.partOf = new Reference(); + return this.partOf; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Encounter"; + + } + + public Encounter copy() { + Encounter dst = new Encounter(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + if (statusHistory != null) { + dst.statusHistory = new ArrayList(); + for (EncounterStatusHistoryComponent i : statusHistory) + dst.statusHistory.add(i.copy()); + }; + dst.class_ = class_ == null ? null : class_.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.priority = priority == null ? null : priority.copy(); + dst.patient = patient == null ? null : patient.copy(); + if (episodeOfCare != null) { + dst.episodeOfCare = new ArrayList(); + for (Reference i : episodeOfCare) + dst.episodeOfCare.add(i.copy()); + }; + if (incomingReferral != null) { + dst.incomingReferral = new ArrayList(); + for (Reference i : incomingReferral) + dst.incomingReferral.add(i.copy()); + }; + if (participant != null) { + dst.participant = new ArrayList(); + for (EncounterParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.appointment = appointment == null ? null : appointment.copy(); + dst.period = period == null ? null : period.copy(); + dst.length = length == null ? null : length.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (Reference i : indication) + dst.indication.add(i.copy()); + }; + dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (EncounterLocationComponent i : location) + dst.location.add(i.copy()); + }; + dst.serviceProvider = serviceProvider == null ? null : serviceProvider.copy(); + dst.partOf = partOf == null ? null : partOf.copy(); + return dst; + } + + protected Encounter typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Encounter)) + return false; + Encounter o = (Encounter) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) + && compareDeep(class_, o.class_, true) && compareDeep(type, o.type, true) && compareDeep(priority, o.priority, true) + && compareDeep(patient, o.patient, true) && compareDeep(episodeOfCare, o.episodeOfCare, true) && compareDeep(incomingReferral, o.incomingReferral, true) + && compareDeep(participant, o.participant, true) && compareDeep(appointment, o.appointment, true) + && compareDeep(period, o.period, true) && compareDeep(length, o.length, true) && compareDeep(reason, o.reason, true) + && compareDeep(indication, o.indication, true) && compareDeep(hospitalization, o.hospitalization, true) + && compareDeep(location, o.location, true) && compareDeep(serviceProvider, o.serviceProvider, true) + && compareDeep(partOf, o.partOf, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Encounter)) + return false; + Encounter o = (Encounter) other; + return compareValues(status, o.status, true) && compareValues(class_, o.class_, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (statusHistory == null || statusHistory.isEmpty()) && (class_ == null || class_.isEmpty()) + && (type == null || type.isEmpty()) && (priority == null || priority.isEmpty()) && (patient == null || patient.isEmpty()) + && (episodeOfCare == null || episodeOfCare.isEmpty()) && (incomingReferral == null || incomingReferral.isEmpty()) + && (participant == null || participant.isEmpty()) && (appointment == null || appointment.isEmpty()) + && (period == null || period.isEmpty()) && (length == null || length.isEmpty()) && (reason == null || reason.isEmpty()) + && (indication == null || indication.isEmpty()) && (hospitalization == null || hospitalization.isEmpty()) + && (location == null || location.isEmpty()) && (serviceProvider == null || serviceProvider.isEmpty()) + && (partOf == null || partOf.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Encounter; + } + + /** + * Search parameter: participant-type + *

+ * Description: Role of participant in encounter
+ * Type: token
+ * Path: Encounter.participant.type
+ *

+ */ + @SearchParamDefinition(name="participant-type", path="Encounter.participant.type", description="Role of participant in encounter", type="token" ) + public static final String SP_PARTICIPANT_TYPE = "participant-type"; + /** + * Fluent Client search parameter constant for participant-type + *

+ * Description: Role of participant in encounter
+ * Type: token
+ * Path: Encounter.participant.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PARTICIPANT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PARTICIPANT_TYPE); + + /** + * Search parameter: episodeofcare + *

+ * Description: Episode(s) of care that this encounter should be recorded against
+ * Type: reference
+ * Path: Encounter.episodeOfCare
+ *

+ */ + @SearchParamDefinition(name="episodeofcare", path="Encounter.episodeOfCare", description="Episode(s) of care that this encounter should be recorded against", type="reference" ) + public static final String SP_EPISODEOFCARE = "episodeofcare"; + /** + * Fluent Client search parameter constant for episodeofcare + *

+ * Description: Episode(s) of care that this encounter should be recorded against
+ * Type: reference
+ * Path: Encounter.episodeOfCare
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EPISODEOFCARE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_EPISODEOFCARE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:episodeofcare". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_EPISODEOFCARE = new ca.uhn.fhir.model.api.Include("Encounter:episodeofcare").toLocked(); + + /** + * Search parameter: status + *

+ * Description: planned | arrived | in-progress | onleave | finished | cancelled
+ * Type: token
+ * Path: Encounter.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Encounter.status", description="planned | arrived | in-progress | onleave | finished | cancelled", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: planned | arrived | in-progress | onleave | finished | cancelled
+ * Type: token
+ * Path: Encounter.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: reason + *

+ * Description: Reason the encounter takes place (code)
+ * Type: token
+ * Path: Encounter.reason
+ *

+ */ + @SearchParamDefinition(name="reason", path="Encounter.reason", description="Reason the encounter takes place (code)", type="token" ) + public static final String SP_REASON = "reason"; + /** + * Fluent Client search parameter constant for reason + *

+ * Description: Reason the encounter takes place (code)
+ * Type: token
+ * Path: Encounter.reason
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON); + + /** + * Search parameter: condition + *

+ * Description: Reason the encounter takes place (resource)
+ * Type: reference
+ * Path: Encounter.indication
+ *

+ */ + @SearchParamDefinition(name="condition", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) + public static final String SP_CONDITION = "condition"; + /** + * Fluent Client search parameter constant for condition + *

+ * Description: Reason the encounter takes place (resource)
+ * Type: reference
+ * Path: Encounter.indication
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:condition". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("Encounter:condition").toLocked(); + + /** + * Search parameter: location + *

+ * Description: Location the encounter takes place
+ * Type: reference
+ * Path: Encounter.location.location
+ *

+ */ + @SearchParamDefinition(name="location", path="Encounter.location.location", description="Location the encounter takes place", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: Location the encounter takes place
+ * Type: reference
+ * Path: Encounter.location.location
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Encounter:location").toLocked(); + + /** + * Search parameter: indication + *

+ * Description: Reason the encounter takes place (resource)
+ * Type: reference
+ * Path: Encounter.indication
+ *

+ */ + @SearchParamDefinition(name="indication", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) + public static final String SP_INDICATION = "indication"; + /** + * Fluent Client search parameter constant for indication + *

+ * Description: Reason the encounter takes place (resource)
+ * Type: reference
+ * Path: Encounter.indication
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INDICATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:indication". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INDICATION = new ca.uhn.fhir.model.api.Include("Encounter:indication").toLocked(); + + /** + * Search parameter: type + *

+ * Description: Specific type of encounter
+ * Type: token
+ * Path: Encounter.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Encounter.type", description="Specific type of encounter", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Specific type of encounter
+ * Type: token
+ * Path: Encounter.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: date + *

+ * Description: A date within the period the Encounter lasted
+ * Type: date
+ * Path: Encounter.period
+ *

+ */ + @SearchParamDefinition(name="date", path="Encounter.period", description="A date within the period the Encounter lasted", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: A date within the period the Encounter lasted
+ * Type: date
+ * Path: Encounter.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: special-arrangement + *

+ * Description: Wheelchair, translator, stretcher, etc.
+ * Type: token
+ * Path: Encounter.hospitalization.specialArrangement
+ *

+ */ + @SearchParamDefinition(name="special-arrangement", path="Encounter.hospitalization.specialArrangement", description="Wheelchair, translator, stretcher, etc.", type="token" ) + public static final String SP_SPECIAL_ARRANGEMENT = "special-arrangement"; + /** + * Fluent Client search parameter constant for special-arrangement + *

+ * Description: Wheelchair, translator, stretcher, etc.
+ * Type: token
+ * Path: Encounter.hospitalization.specialArrangement
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIAL_ARRANGEMENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIAL_ARRANGEMENT); + + /** + * Search parameter: part-of + *

+ * Description: Another Encounter this encounter is part of
+ * Type: reference
+ * Path: Encounter.partOf
+ *

+ */ + @SearchParamDefinition(name="part-of", path="Encounter.partOf", description="Another Encounter this encounter is part of", type="reference" ) + public static final String SP_PART_OF = "part-of"; + /** + * Fluent Client search parameter constant for part-of + *

+ * Description: Another Encounter this encounter is part of
+ * Type: reference
+ * Path: Encounter.partOf
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:part-of". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Encounter:part-of").toLocked(); + + /** + * Search parameter: appointment + *

+ * Description: The appointment that scheduled this encounter
+ * Type: reference
+ * Path: Encounter.appointment
+ *

+ */ + @SearchParamDefinition(name="appointment", path="Encounter.appointment", description="The appointment that scheduled this encounter", type="reference" ) + public static final String SP_APPOINTMENT = "appointment"; + /** + * Fluent Client search parameter constant for appointment + *

+ * Description: The appointment that scheduled this encounter
+ * Type: reference
+ * Path: Encounter.appointment
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam APPOINTMENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_APPOINTMENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:appointment". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_APPOINTMENT = new ca.uhn.fhir.model.api.Include("Encounter:appointment").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The patient present at the encounter
+ * Type: reference
+ * Path: Encounter.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="Encounter.patient", description="The patient present at the encounter", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The patient present at the encounter
+ * Type: reference
+ * Path: Encounter.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Encounter:patient").toLocked(); + + /** + * Search parameter: practitioner + *

+ * Description: Persons involved in the encounter other than the patient
+ * Type: reference
+ * Path: Encounter.participant.individual
+ *

+ */ + @SearchParamDefinition(name="practitioner", path="Encounter.participant.individual", description="Persons involved in the encounter other than the patient", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + /** + * Fluent Client search parameter constant for practitioner + *

+ * Description: Persons involved in the encounter other than the patient
+ * Type: reference
+ * Path: Encounter.participant.individual
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:practitioner". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Encounter:practitioner").toLocked(); + + /** + * Search parameter: length + *

+ * Description: Length of encounter in days
+ * Type: number
+ * Path: Encounter.length
+ *

+ */ + @SearchParamDefinition(name="length", path="Encounter.length", description="Length of encounter in days", type="number" ) + public static final String SP_LENGTH = "length"; + /** + * Fluent Client search parameter constant for length + *

+ * Description: Length of encounter in days
+ * Type: number
+ * Path: Encounter.length
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.NumberClientParam LENGTH = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_LENGTH); + + /** + * Search parameter: participant + *

+ * Description: Persons involved in the encounter other than the patient
+ * Type: reference
+ * Path: Encounter.participant.individual
+ *

+ */ + @SearchParamDefinition(name="participant", path="Encounter.participant.individual", description="Persons involved in the encounter other than the patient", type="reference" ) + public static final String SP_PARTICIPANT = "participant"; + /** + * Fluent Client search parameter constant for participant + *

+ * Description: Persons involved in the encounter other than the patient
+ * Type: reference
+ * Path: Encounter.participant.individual
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:participant". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("Encounter:participant").toLocked(); + + /** + * Search parameter: incomingreferral + *

+ * Description: The ReferralRequest that initiated this encounter
+ * Type: reference
+ * Path: Encounter.incomingReferral
+ *

+ */ + @SearchParamDefinition(name="incomingreferral", path="Encounter.incomingReferral", description="The ReferralRequest that initiated this encounter", type="reference" ) + public static final String SP_INCOMINGREFERRAL = "incomingreferral"; + /** + * Fluent Client search parameter constant for incomingreferral + *

+ * Description: The ReferralRequest that initiated this encounter
+ * Type: reference
+ * Path: Encounter.incomingReferral
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INCOMINGREFERRAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INCOMINGREFERRAL); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:incomingreferral". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INCOMINGREFERRAL = new ca.uhn.fhir.model.api.Include("Encounter:incomingreferral").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Identifier(s) by which this encounter is known
+ * Type: token
+ * Path: Encounter.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Encounter.identifier", description="Identifier(s) by which this encounter is known", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Identifier(s) by which this encounter is known
+ * Type: token
+ * Path: Encounter.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: procedure + *

+ * Description: Reason the encounter takes place (resource)
+ * Type: reference
+ * Path: Encounter.indication
+ *

+ */ + @SearchParamDefinition(name="procedure", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) + public static final String SP_PROCEDURE = "procedure"; + /** + * Fluent Client search parameter constant for procedure + *

+ * Description: Reason the encounter takes place (resource)
+ * Type: reference
+ * Path: Encounter.indication
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROCEDURE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROCEDURE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:procedure". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROCEDURE = new ca.uhn.fhir.model.api.Include("Encounter:procedure").toLocked(); + + /** + * Search parameter: location-period + *

+ * Description: Time period during which the patient was present at the location
+ * Type: date
+ * Path: Encounter.location.period
+ *

+ */ + @SearchParamDefinition(name="location-period", path="Encounter.location.period", description="Time period during which the patient was present at the location", type="date" ) + public static final String SP_LOCATION_PERIOD = "location-period"; + /** + * Fluent Client search parameter constant for location-period + *

+ * Description: Time period during which the patient was present at the location
+ * Type: date
+ * Path: Encounter.location.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam LOCATION_PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_LOCATION_PERIOD); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnrollmentRequest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnrollmentRequest.java new file mode 100644 index 00000000000..720e7aef7d5 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnrollmentRequest.java @@ -0,0 +1,841 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. + */ +@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest") +public class EnrollmentRequest extends DomainResource { + + /** + * The Response business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) + @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; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Patient Resource. + */ + @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient subjectTarget; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name = "coverage", type = {Coverage.class}, order=8, min=1, max=1, modifier=false, summary=true) + @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 relationship of the patient to the subscriber. + */ + @Child(name = "relationship", type = {Coding.class}, order=9, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + private static final long serialVersionUID = -1656505325L; + + /** + * Constructor + */ + public EnrollmentRequest() { + super(); + } + + /** + * Constructor + */ + public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) { + super(); + this.subject = subject; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #identifier} (The Response business identifier.) + */ + 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 Response business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EnrollmentRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 EnrollmentRequest setRuleset(Coding value) { + this.ruleset = 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 EnrollmentRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 EnrollmentRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public EnrollmentRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public EnrollmentRequest 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} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public EnrollmentRequest 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. (The Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); // aa + 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. (The Insurer who is target of the request.) + */ + public EnrollmentRequest setTargetTarget(Organization value) { + this.targetTarget = 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 EnrollmentRequest.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + 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 EnrollmentRequest 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 EnrollmentRequest.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); // aa + 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 EnrollmentRequest setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public EnrollmentRequest 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 services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + 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 services rendered to the patient.) + */ + public EnrollmentRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #subject} (Patient Resource.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Patient Resource.) + */ + public EnrollmentRequest 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. (Patient Resource.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + 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. (Patient Resource.) + */ + public EnrollmentRequest setSubjectTarget(Patient value) { + this.subjectTarget = 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 EnrollmentRequest.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); // cc + 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 EnrollmentRequest 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 EnrollmentRequest.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); // aa + 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 EnrollmentRequest setCoverageTarget(Coverage value) { + this.coverageTarget = 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 EnrollmentRequest.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); // cc + 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 EnrollmentRequest setRelationship(Coding value) { + this.relationship = 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("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("subject", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject)); + 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("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case -880905839: // target + this.target = castToReference(value); // Reference + break; + case -987494927: // provider + this.provider = castToReference(value); // Reference + break; + case 1178922291: // organization + this.organization = castToReference(value); // Reference + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -351767064: // coverage + this.coverage = castToReference(value); // Reference + break; + case -261851592: // relationship + this.relationship = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("target")) + this.target = castToReference(value); // Reference + else if (name.equals("provider")) + this.provider = castToReference(value); // Reference + else if (name.equals("organization")) + this.organization = castToReference(value); // Reference + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("coverage")) + this.coverage = castToReference(value); // Reference + else if (name.equals("relationship")) + this.relationship = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -880905839: return getTarget(); // Reference + case -987494927: return getProvider(); // Reference + case 1178922291: return getOrganization(); // Reference + case -1867885268: return getSubject(); // Reference + case -351767064: return getCoverage(); // Reference + case -261851592: return getRelationship(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type EnrollmentRequest.created"); + } + else if (name.equals("target")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("provider")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("organization")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("coverage")) { + this.coverage = new Reference(); + return this.coverage; + } + else if (name.equals("relationship")) { + this.relationship = new Coding(); + return this.relationship; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "EnrollmentRequest"; + + } + + public EnrollmentRequest copy() { + EnrollmentRequest dst = new EnrollmentRequest(); + 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.subject = subject == null ? null : subject.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + return dst; + } + + protected EnrollmentRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EnrollmentRequest)) + return false; + EnrollmentRequest o = (EnrollmentRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) + && compareDeep(organization, o.organization, true) && compareDeep(subject, o.subject, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(relationship, o.relationship, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EnrollmentRequest)) + return false; + EnrollmentRequest o = (EnrollmentRequest) other; + return compareValues(created, o.created, true); + } + + 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()) + && (subject == null || subject.isEmpty()) && (coverage == null || coverage.isEmpty()) && (relationship == null || relationship.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EnrollmentRequest; + } + + /** + * Search parameter: patient + *

+ * Description: The party to be enrolled
+ * Type: reference
+ * Path: EnrollmentRequest.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The party to be enrolled
+ * Type: reference
+ * Path: EnrollmentRequest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EnrollmentRequest:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:patient").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: The party to be enrolled
+ * Type: reference
+ * Path: EnrollmentRequest.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: The party to be enrolled
+ * Type: reference
+ * Path: EnrollmentRequest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EnrollmentRequest:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:subject").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The business identifier of the Enrollment
+ * Type: token
+ * Path: EnrollmentRequest.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier of the Enrollment
+ * Type: token
+ * Path: EnrollmentRequest.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnrollmentResponse.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnrollmentResponse.java new file mode 100644 index 00000000000..9bfcc33ab81 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnrollmentResponse.java @@ -0,0 +1,807 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome; +import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides enrollment and plan details from the processing of an Enrollment resource. + */ +@ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/Profile/EnrollmentResponse") +public class EnrollmentResponse extends DomainResource { + + /** + * The Response business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {EnrollmentRequest.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource reference.) + */ + protected EnrollmentRequest requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + private static final long serialVersionUID = -1740067108L; + + /** + * Constructor + */ + public EnrollmentResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response business identifier.) + */ + 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 Response business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EnrollmentResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public EnrollmentResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 reference.) + */ + 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 EnrollmentRequest(); // aa + 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 reference.) + */ + public EnrollmentResponse setRequestTarget(EnrollmentRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). 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 EnrollmentResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb + 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} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public EnrollmentResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RemittanceOutcome getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public EnrollmentResponse setOutcome(RemittanceOutcome value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public EnrollmentResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public EnrollmentResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 EnrollmentResponse setRuleset(Coding value) { + this.ruleset = 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 EnrollmentResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 EnrollmentResponse 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 EnrollmentResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 EnrollmentResponse 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 EnrollmentResponse 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 #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public EnrollmentResponse 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 Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + 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 Insurer who produced this adjudicated response.) + */ + public EnrollmentResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); // cc + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EnrollmentResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} 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 getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); // aa + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} 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 EnrollmentResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); // cc + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public EnrollmentResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} 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 services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); // aa + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} 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 EnrollmentResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = 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("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 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("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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference + case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1095692943: // request + this.request = castToReference(value); // Reference + break; + case -1106507950: // outcome + this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case 1178922291: // organization + this.organization = castToReference(value); // Reference + break; + case 1601527200: // requestProvider + this.requestProvider = castToReference(value); // Reference + break; + case 599053666: // requestOrganization + this.requestOrganization = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("request")) + this.request = castToReference(value); // Reference + else if (name.equals("outcome")) + this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("organization")) + this.organization = castToReference(value); // Reference + else if (name.equals("requestProvider")) + this.requestProvider = castToReference(value); // Reference + else if (name.equals("requestOrganization")) + this.requestOrganization = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 1095692943: return getRequest(); // Reference + case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 1178922291: return getOrganization(); // Reference + case 1601527200: return getRequestProvider(); // Reference + case 599053666: return getRequestOrganization(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("request")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("outcome")) { + throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.outcome"); + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.disposition"); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.created"); + } + else if (name.equals("organization")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("requestProvider")) { + this.requestProvider = new Reference(); + return this.requestProvider; + } + else if (name.equals("requestOrganization")) { + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "EnrollmentResponse"; + + } + + public EnrollmentResponse copy() { + EnrollmentResponse dst = new EnrollmentResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + return dst; + } + + protected EnrollmentResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EnrollmentResponse)) + return false; + EnrollmentResponse o = (EnrollmentResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EnrollmentResponse)) + return false; + EnrollmentResponse o = (EnrollmentResponse) other; + return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + ; + } + + public boolean isEmpty() { + 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()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EnrollmentResponse; + } + + /** + * Search parameter: identifier + *

+ * Description: The business identifier of the Explanation of Benefit
+ * Type: token
+ * Path: EnrollmentResponse.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="EnrollmentResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier of the Explanation of Benefit
+ * Type: token
+ * Path: EnrollmentResponse.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnumFactory.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnumFactory.java new file mode 100644 index 00000000000..45dcd4d0868 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EnumFactory.java @@ -0,0 +1,62 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.instance.model.api.IBaseEnumFactory; + + +/* +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. + +*/ + +/** + * Helper class to help manage generic enumerated types + */ +public interface EnumFactory> extends IBaseEnumFactory { + + /** + * Read an enumeration value from the string that represents it on the XML or JSON + * @param codeString the value found in the XML or JSON + * @return the enumeration value + * @throws Exception is the value is not known + */ + public T fromCode(String codeString) throws IllegalArgumentException; + + /** + * Get the XML/JSON representation for an enumerated value + * @param code - the enumeration value + * @return the XML/JSON representation + */ + public String toCode(T code); + + /** + * Get the XML/JSON representation for an enumerated value + * @param code - the enumeration value + * @return the XML/JSON representation + */ + public String toSystem(T code); + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Enumeration.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Enumeration.java new file mode 100644 index 00000000000..46866e756a1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Enumeration.java @@ -0,0 +1,134 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + +import org.hl7.fhir.instance.model.api.IBaseEnumeration; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/* +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. + +*/ + +/** + * Primitive type "code" in FHIR, where the code is tied to an enumerated list of possible values + * + */ +@DatatypeDef(name = "code", isSpecialization = true) +public class Enumeration> extends PrimitiveType implements IBaseEnumeration { + + private static final long serialVersionUID = 1L; + private EnumFactory myEnumFactory; + + /** + * Constructor + * + * @deprecated This no-arg constructor is provided for serialization only - Do not use + */ + @Deprecated + public Enumeration() { + // nothing + } + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory) { + if (theEnumFactory == null) + throw new IllegalArgumentException("An enumeration factory must be provided"); + myEnumFactory = theEnumFactory; + } + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory, String theValue) { + if (theEnumFactory == null) + throw new IllegalArgumentException("An enumeration factory must be provided"); + myEnumFactory = theEnumFactory; + setValueAsString(theValue); + } + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory, T theValue) { + if (theEnumFactory == null) + throw new IllegalArgumentException("An enumeration factory must be provided"); + myEnumFactory = theEnumFactory; + setValue(theValue); + } + + @Override + public Enumeration copy() { + return new Enumeration(myEnumFactory, getValue()); + } + + @Override + protected String encode(T theValue) { + return myEnumFactory.toCode(theValue); + } + + public String fhirType() { + return "code"; + } + + /** + * Provides the enum factory which binds this enumeration to a specific ValueSet + */ + public EnumFactory getEnumFactory() { + return myEnumFactory; + } + + @Override + protected T parse(String theValue) { + if (myEnumFactory != null) { + return myEnumFactory.fromCode(theValue); + } + return null; + } + + @SuppressWarnings("unchecked") + @Override + public void readExternal(ObjectInput theIn) throws IOException, ClassNotFoundException { + myEnumFactory = (EnumFactory) theIn.readObject(); + super.readExternal(theIn); + } + + public String toSystem() { + return getEnumFactory().toSystem(getValue()); + } + + @Override + public void writeExternal(ObjectOutput theOut) throws IOException { + theOut.writeObject(myEnumFactory); + super.writeExternal(theOut); + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Enumerations.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Enumerations.java new file mode 100644 index 00000000000..42b59557c44 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Enumerations.java @@ -0,0 +1,10084 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.exceptions.FHIRException; + +public class Enumerations { + +// In here: +// AbstractType: A type defined by FHIR that is an abstract type +// AdministrativeGender: The gender of a person used for administrative purposes. +// AgeUnits: A valueSet of UCUM codes for representing age value units. +// BindingStrength: Indication of the degree of conformance expectations associated with a binding. +// ConceptMapEquivalence: The degree of equivalence between concepts. +// ConformanceResourceStatus: The lifecycle status of a Value Set or Concept Map. +// DataAbsentReason: Used to specify why the normally expected content of the data element is missing. +// DataType: The type of an element - one of the FHIR data types. +// DocumentReferenceStatus: The status of the document reference. +// FHIRAllTypes: Either an abstract type, a resource or a data type. +// FHIRDefinedType: Either a resource or a data type. +// MessageEvent: One of the message events defined as part of FHIR. +// NoteType: The presentation types of notes. +// RemittanceOutcome: The outcome of the processing. +// ResourceType: One of the resource types defined as part of FHIR. +// SearchParamType: Data types allowed to be used for search parameters. +// SpecialValues: A set of generally useful codes defined so they can be included in value sets. + + + public enum AbstractType { + /** + * A place holder that means any kind of data type + */ + TYPE, + /** + * A place holder that means any kind of resource + */ + ANY, + /** + * added to help the parsers + */ + NULL; + public static AbstractType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("Type".equals(codeString)) + return TYPE; + if ("Any".equals(codeString)) + return ANY; + throw new FHIRException("Unknown AbstractType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case TYPE: return "Type"; + case ANY: return "Any"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case TYPE: return "http://hl7.org/fhir/abstract-types"; + case ANY: return "http://hl7.org/fhir/abstract-types"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case TYPE: return "A place holder that means any kind of data type"; + case ANY: return "A place holder that means any kind of resource"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case TYPE: return "Type"; + case ANY: return "Any"; + default: return "?"; + } + } + } + + public static class AbstractTypeEnumFactory implements EnumFactory { + public AbstractType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("Type".equals(codeString)) + return AbstractType.TYPE; + if ("Any".equals(codeString)) + return AbstractType.ANY; + throw new IllegalArgumentException("Unknown AbstractType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("Type".equals(codeString)) + return new Enumeration(this, AbstractType.TYPE); + if ("Any".equals(codeString)) + return new Enumeration(this, AbstractType.ANY); + throw new FHIRException("Unknown AbstractType code '"+codeString+"'"); + } + public String toCode(AbstractType code) { + if (code == AbstractType.TYPE) + return "Type"; + if (code == AbstractType.ANY) + return "Any"; + return "?"; + } + public String toSystem(AbstractType code) { + return code.getSystem(); + } + } + + public enum AdministrativeGender { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static AdministrativeGender fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown AdministrativeGender code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/administrative-gender"; + case FEMALE: return "http://hl7.org/fhir/administrative-gender"; + case OTHER: return "http://hl7.org/fhir/administrative-gender"; + case UNKNOWN: return "http://hl7.org/fhir/administrative-gender"; + 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 Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return new Enumeration(this, AdministrativeGender.MALE); + if ("female".equals(codeString)) + return new Enumeration(this, AdministrativeGender.FEMALE); + if ("other".equals(codeString)) + return new Enumeration(this, AdministrativeGender.OTHER); + if ("unknown".equals(codeString)) + return new Enumeration(this, AdministrativeGender.UNKNOWN); + throw new FHIRException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) { + 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 String toSystem(AdministrativeGender code) { + return code.getSystem(); + } + } + + public enum AgeUnits { + /** + * null + */ + MIN, + /** + * null + */ + H, + /** + * null + */ + D, + /** + * null + */ + WK, + /** + * null + */ + MO, + /** + * null + */ + A, + /** + * added to help the parsers + */ + NULL; + public static AgeUnits fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + 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 FHIRException("Unknown AgeUnits code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + 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 String getSystem() { + switch (this) { + case MIN: return "http://unitsofmeasure.org"; + case H: return "http://unitsofmeasure.org"; + case D: return "http://unitsofmeasure.org"; + case WK: return "http://unitsofmeasure.org"; + case MO: return "http://unitsofmeasure.org"; + case A: return "http://unitsofmeasure.org"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MIN: return ""; + case H: return ""; + case D: return ""; + case WK: return ""; + case MO: return ""; + case A: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MIN: return "Minute"; + case H: return "Hour"; + case D: return "Day"; + case WK: return "Week"; + case MO: return "Month"; + case A: return "Year"; + default: return "?"; + } + } + } + + public static class AgeUnitsEnumFactory implements EnumFactory { + public AgeUnits fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("min".equals(codeString)) + return AgeUnits.MIN; + if ("h".equals(codeString)) + return AgeUnits.H; + if ("d".equals(codeString)) + return AgeUnits.D; + if ("wk".equals(codeString)) + return AgeUnits.WK; + if ("mo".equals(codeString)) + return AgeUnits.MO; + if ("a".equals(codeString)) + return AgeUnits.A; + throw new IllegalArgumentException("Unknown AgeUnits code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("min".equals(codeString)) + return new Enumeration(this, AgeUnits.MIN); + if ("h".equals(codeString)) + return new Enumeration(this, AgeUnits.H); + if ("d".equals(codeString)) + return new Enumeration(this, AgeUnits.D); + if ("wk".equals(codeString)) + return new Enumeration(this, AgeUnits.WK); + if ("mo".equals(codeString)) + return new Enumeration(this, AgeUnits.MO); + if ("a".equals(codeString)) + return new Enumeration(this, AgeUnits.A); + throw new FHIRException("Unknown AgeUnits code '"+codeString+"'"); + } + public String toCode(AgeUnits code) { + if (code == AgeUnits.MIN) + return "min"; + if (code == AgeUnits.H) + return "h"; + if (code == AgeUnits.D) + return "d"; + if (code == AgeUnits.WK) + return "wk"; + if (code == AgeUnits.MO) + return "mo"; + if (code == AgeUnits.A) + return "a"; + return "?"; + } + public String toSystem(AgeUnits code) { + return code.getSystem(); + } + } + + public enum BindingStrength { + /** + * To be conformant, instances of this element SHALL include a code from the specified value set. + */ + REQUIRED, + /** + * To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the value set does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead. + */ + EXTENSIBLE, + /** + * Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant. + */ + PREFERRED, + /** + * Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included. + */ + EXAMPLE, + /** + * added to help the parsers + */ + NULL; + public static BindingStrength fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return REQUIRED; + if ("extensible".equals(codeString)) + return EXTENSIBLE; + if ("preferred".equals(codeString)) + return PREFERRED; + if ("example".equals(codeString)) + return EXAMPLE; + throw new FHIRException("Unknown BindingStrength code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUIRED: return "required"; + case EXTENSIBLE: return "extensible"; + case PREFERRED: return "preferred"; + case EXAMPLE: return "example"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUIRED: return "http://hl7.org/fhir/binding-strength"; + case EXTENSIBLE: return "http://hl7.org/fhir/binding-strength"; + case PREFERRED: return "http://hl7.org/fhir/binding-strength"; + case EXAMPLE: return "http://hl7.org/fhir/binding-strength"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUIRED: return "To be conformant, instances of this element SHALL include a code from the specified value set."; + case EXTENSIBLE: return "To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the value set does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead."; + case PREFERRED: return "Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant."; + case EXAMPLE: return "Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUIRED: return "Required"; + case EXTENSIBLE: return "Extensible"; + case PREFERRED: return "Preferred"; + case EXAMPLE: return "Example"; + default: return "?"; + } + } + } + + public static class BindingStrengthEnumFactory implements EnumFactory { + public BindingStrength fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return BindingStrength.REQUIRED; + if ("extensible".equals(codeString)) + return BindingStrength.EXTENSIBLE; + if ("preferred".equals(codeString)) + return BindingStrength.PREFERRED; + if ("example".equals(codeString)) + return BindingStrength.EXAMPLE; + throw new IllegalArgumentException("Unknown BindingStrength code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return new Enumeration(this, BindingStrength.REQUIRED); + if ("extensible".equals(codeString)) + return new Enumeration(this, BindingStrength.EXTENSIBLE); + if ("preferred".equals(codeString)) + return new Enumeration(this, BindingStrength.PREFERRED); + if ("example".equals(codeString)) + return new Enumeration(this, BindingStrength.EXAMPLE); + throw new FHIRException("Unknown BindingStrength code '"+codeString+"'"); + } + public String toCode(BindingStrength code) { + if (code == BindingStrength.REQUIRED) + return "required"; + if (code == BindingStrength.EXTENSIBLE) + return "extensible"; + if (code == BindingStrength.PREFERRED) + return "preferred"; + if (code == BindingStrength.EXAMPLE) + return "example"; + return "?"; + } + public String toSystem(BindingStrength code) { + return code.getSystem(); + } + } + + public enum ConceptMapEquivalence { + /** + * 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 identical or irrelevant (i.e. intentionally identical). + */ + EQUAL, + /** + * The target mapping is wider in meaning than the source concept. + */ + WIDER, + /** + * The target mapping subsumes the meaning of the source concept (e.g. the source is-a target). + */ + SUBSUMES, + /** + * 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 attempting to use these mappings operationally. + */ + NARROWER, + /** + * The target mapping specializes the meaning of the source concept (e.g. the target is-a source). + */ + SPECIALIZES, + /** + * 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 attempting to use these mappings operationally. + */ + INEXACT, + /** + * There is no match for this concept in the destination concept system. + */ + UNMATCHED, + /** + * This is an explicit assertion that there is no mapping between the source and target concept. + */ + DISJOINT, + /** + * added to help the parsers + */ + NULL; + public static ConceptMapEquivalence fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("equivalent".equals(codeString)) + return EQUIVALENT; + if ("equal".equals(codeString)) + return EQUAL; + if ("wider".equals(codeString)) + return WIDER; + if ("subsumes".equals(codeString)) + return SUBSUMES; + if ("narrower".equals(codeString)) + return NARROWER; + if ("specializes".equals(codeString)) + return SPECIALIZES; + if ("inexact".equals(codeString)) + return INEXACT; + if ("unmatched".equals(codeString)) + return UNMATCHED; + if ("disjoint".equals(codeString)) + return DISJOINT; + throw new FHIRException("Unknown ConceptMapEquivalence code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case EQUIVALENT: return "equivalent"; + case EQUAL: return "equal"; + case WIDER: return "wider"; + case SUBSUMES: return "subsumes"; + case NARROWER: return "narrower"; + case SPECIALIZES: return "specializes"; + case INEXACT: return "inexact"; + case UNMATCHED: return "unmatched"; + case DISJOINT: return "disjoint"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EQUIVALENT: return "http://hl7.org/fhir/concept-map-equivalence"; + case EQUAL: return "http://hl7.org/fhir/concept-map-equivalence"; + case WIDER: return "http://hl7.org/fhir/concept-map-equivalence"; + case SUBSUMES: return "http://hl7.org/fhir/concept-map-equivalence"; + case NARROWER: return "http://hl7.org/fhir/concept-map-equivalence"; + case SPECIALIZES: return "http://hl7.org/fhir/concept-map-equivalence"; + case INEXACT: return "http://hl7.org/fhir/concept-map-equivalence"; + case UNMATCHED: return "http://hl7.org/fhir/concept-map-equivalence"; + case DISJOINT: return "http://hl7.org/fhir/concept-map-equivalence"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + 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 identical or irrelevant (i.e. intentionally 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 attempting to use these mappings operationally."; + case SPECIALIZES: return "The target mapping specializes 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, 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 attempting 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 "?"; + } + } + public String getDisplay() { + switch (this) { + case EQUIVALENT: return "Equivalent"; + case EQUAL: return "Equal"; + case WIDER: return "Wider"; + case SUBSUMES: return "Subsumes"; + case NARROWER: return "Narrower"; + case SPECIALIZES: return "Specializes"; + case INEXACT: return "Inexact"; + case UNMATCHED: return "Unmatched"; + case DISJOINT: return "Disjoint"; + default: return "?"; + } + } + } + + public static class ConceptMapEquivalenceEnumFactory implements EnumFactory { + public ConceptMapEquivalence fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("equivalent".equals(codeString)) + return ConceptMapEquivalence.EQUIVALENT; + if ("equal".equals(codeString)) + return ConceptMapEquivalence.EQUAL; + if ("wider".equals(codeString)) + return ConceptMapEquivalence.WIDER; + if ("subsumes".equals(codeString)) + return ConceptMapEquivalence.SUBSUMES; + if ("narrower".equals(codeString)) + return ConceptMapEquivalence.NARROWER; + if ("specializes".equals(codeString)) + return ConceptMapEquivalence.SPECIALIZES; + if ("inexact".equals(codeString)) + return ConceptMapEquivalence.INEXACT; + if ("unmatched".equals(codeString)) + return ConceptMapEquivalence.UNMATCHED; + if ("disjoint".equals(codeString)) + return ConceptMapEquivalence.DISJOINT; + throw new IllegalArgumentException("Unknown ConceptMapEquivalence code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("equivalent".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.EQUIVALENT); + if ("equal".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.EQUAL); + if ("wider".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.WIDER); + if ("subsumes".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.SUBSUMES); + if ("narrower".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.NARROWER); + if ("specializes".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.SPECIALIZES); + if ("inexact".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.INEXACT); + if ("unmatched".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.UNMATCHED); + if ("disjoint".equals(codeString)) + return new Enumeration(this, ConceptMapEquivalence.DISJOINT); + throw new FHIRException("Unknown ConceptMapEquivalence code '"+codeString+"'"); + } + public String toCode(ConceptMapEquivalence code) { + if (code == ConceptMapEquivalence.EQUIVALENT) + return "equivalent"; + if (code == ConceptMapEquivalence.EQUAL) + return "equal"; + if (code == ConceptMapEquivalence.WIDER) + return "wider"; + if (code == ConceptMapEquivalence.SUBSUMES) + return "subsumes"; + if (code == ConceptMapEquivalence.NARROWER) + return "narrower"; + if (code == ConceptMapEquivalence.SPECIALIZES) + return "specializes"; + if (code == ConceptMapEquivalence.INEXACT) + return "inexact"; + if (code == ConceptMapEquivalence.UNMATCHED) + return "unmatched"; + if (code == ConceptMapEquivalence.DISJOINT) + return "disjoint"; + return "?"; + } + public String toSystem(ConceptMapEquivalence code) { + return code.getSystem(); + } + } + + public enum ConformanceResourceStatus { + /** + * This resource is still under development. + */ + DRAFT, + /** + * This resource is ready for normal use. + */ + ACTIVE, + /** + * This resource has been withdrawn or superseded and should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + public static ConformanceResourceStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new FHIRException("Unknown ConformanceResourceStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return "http://hl7.org/fhir/conformance-resource-status"; + case ACTIVE: return "http://hl7.org/fhir/conformance-resource-status"; + case RETIRED: return "http://hl7.org/fhir/conformance-resource-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This resource is still under development."; + case ACTIVE: return "This resource is ready for normal use."; + case RETIRED: return "This resource has been withdrawn or superseded and should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case ACTIVE: return "Active"; + case RETIRED: return "Retired"; + default: return "?"; + } + } + } + + public static class ConformanceResourceStatusEnumFactory implements EnumFactory { + public ConformanceResourceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ConformanceResourceStatus.DRAFT; + if ("active".equals(codeString)) + return ConformanceResourceStatus.ACTIVE; + if ("retired".equals(codeString)) + return ConformanceResourceStatus.RETIRED; + throw new IllegalArgumentException("Unknown ConformanceResourceStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return new Enumeration(this, ConformanceResourceStatus.DRAFT); + if ("active".equals(codeString)) + return new Enumeration(this, ConformanceResourceStatus.ACTIVE); + if ("retired".equals(codeString)) + return new Enumeration(this, ConformanceResourceStatus.RETIRED); + throw new FHIRException("Unknown ConformanceResourceStatus code '"+codeString+"'"); + } + public String toCode(ConformanceResourceStatus code) { + if (code == ConformanceResourceStatus.DRAFT) + return "draft"; + if (code == ConformanceResourceStatus.ACTIVE) + return "active"; + if (code == ConformanceResourceStatus.RETIRED) + return "retired"; + return "?"; + } + public String toSystem(ConformanceResourceStatus code) { + return code.getSystem(); + } + } + + public enum DataAbsentReason { + /** + * The value is not known. + */ + UNKNOWN, + /** + * The source human does not know the value. + */ + ASKED, + /** + * There is reason to expect (from the workflow) that the value may become known. + */ + TEMP, + /** + * The workflow didn't lead to this value being known. + */ + NOTASKED, + /** + * The information is not available due to security, privacy or related reasons. + */ + MASKED, + /** + * The source system wasn't capable of supporting this element. + */ + UNSUPPORTED, + /** + * The content of the data is represented in the resource narrative. + */ + ASTEXT, + /** + * Some system or workflow process error means that the information is not available. + */ + ERROR, + /** + * NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value. + */ + NAN, + /** + * added to help the parsers + */ + NULL; + public static DataAbsentReason fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("unknown".equals(codeString)) + return UNKNOWN; + if ("asked".equals(codeString)) + return ASKED; + if ("temp".equals(codeString)) + return TEMP; + if ("not-asked".equals(codeString)) + return NOTASKED; + if ("masked".equals(codeString)) + return MASKED; + if ("unsupported".equals(codeString)) + return UNSUPPORTED; + if ("astext".equals(codeString)) + return ASTEXT; + if ("error".equals(codeString)) + return ERROR; + if ("NaN".equals(codeString)) + return NAN; + throw new FHIRException("Unknown DataAbsentReason code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case UNKNOWN: return "unknown"; + case ASKED: return "asked"; + case TEMP: return "temp"; + case NOTASKED: return "not-asked"; + case MASKED: return "masked"; + case UNSUPPORTED: return "unsupported"; + case ASTEXT: return "astext"; + case ERROR: return "error"; + case NAN: return "NaN"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNKNOWN: return "http://hl7.org/fhir/data-absent-reason"; + case ASKED: return "http://hl7.org/fhir/data-absent-reason"; + case TEMP: return "http://hl7.org/fhir/data-absent-reason"; + case NOTASKED: return "http://hl7.org/fhir/data-absent-reason"; + case MASKED: return "http://hl7.org/fhir/data-absent-reason"; + case UNSUPPORTED: return "http://hl7.org/fhir/data-absent-reason"; + case ASTEXT: return "http://hl7.org/fhir/data-absent-reason"; + case ERROR: return "http://hl7.org/fhir/data-absent-reason"; + case NAN: return "http://hl7.org/fhir/data-absent-reason"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNKNOWN: return "The value is not known."; + case ASKED: return "The source human does not know the value."; + case TEMP: return "There is reason to expect (from the workflow) that the value may become known."; + case NOTASKED: return "The workflow didn't lead to this value being known."; + case MASKED: return "The information is not available due to security, privacy or related reasons."; + case UNSUPPORTED: return "The source system wasn't capable of supporting this element."; + case ASTEXT: return "The content of the data is represented in the resource narrative."; + case ERROR: return "Some system or workflow process error means that the information is not available."; + case NAN: return "NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNKNOWN: return "Unknown"; + case ASKED: return "Asked"; + case TEMP: return "Temp"; + case NOTASKED: return "Not Asked"; + case MASKED: return "Masked"; + case UNSUPPORTED: return "Unsupported"; + case ASTEXT: return "As Text"; + case ERROR: return "Error"; + case NAN: return "Not a Number"; + default: return "?"; + } + } + } + + 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; + if ("unknown".equals(codeString)) + return DataAbsentReason.UNKNOWN; + if ("asked".equals(codeString)) + return DataAbsentReason.ASKED; + if ("temp".equals(codeString)) + return DataAbsentReason.TEMP; + if ("not-asked".equals(codeString)) + return DataAbsentReason.NOTASKED; + if ("masked".equals(codeString)) + return DataAbsentReason.MASKED; + if ("unsupported".equals(codeString)) + return DataAbsentReason.UNSUPPORTED; + if ("astext".equals(codeString)) + return DataAbsentReason.ASTEXT; + if ("error".equals(codeString)) + return DataAbsentReason.ERROR; + if ("NaN".equals(codeString)) + return DataAbsentReason.NAN; + throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("unknown".equals(codeString)) + return new Enumeration(this, DataAbsentReason.UNKNOWN); + if ("asked".equals(codeString)) + return new Enumeration(this, DataAbsentReason.ASKED); + if ("temp".equals(codeString)) + return new Enumeration(this, DataAbsentReason.TEMP); + if ("not-asked".equals(codeString)) + return new Enumeration(this, DataAbsentReason.NOTASKED); + if ("masked".equals(codeString)) + return new Enumeration(this, DataAbsentReason.MASKED); + if ("unsupported".equals(codeString)) + return new Enumeration(this, DataAbsentReason.UNSUPPORTED); + if ("astext".equals(codeString)) + return new Enumeration(this, DataAbsentReason.ASTEXT); + if ("error".equals(codeString)) + return new Enumeration(this, DataAbsentReason.ERROR); + if ("NaN".equals(codeString)) + return new Enumeration(this, DataAbsentReason.NAN); + throw new FHIRException("Unknown DataAbsentReason code '"+codeString+"'"); + } + public String toCode(DataAbsentReason code) { + if (code == DataAbsentReason.UNKNOWN) + return "unknown"; + if (code == DataAbsentReason.ASKED) + return "asked"; + if (code == DataAbsentReason.TEMP) + return "temp"; + if (code == DataAbsentReason.NOTASKED) + return "not-asked"; + if (code == DataAbsentReason.MASKED) + return "masked"; + if (code == DataAbsentReason.UNSUPPORTED) + return "unsupported"; + if (code == DataAbsentReason.ASTEXT) + return "astext"; + if (code == DataAbsentReason.ERROR) + return "error"; + if (code == DataAbsentReason.NAN) + return "NaN"; + return "?"; + } + public String toSystem(DataAbsentReason code) { + return code.getSystem(); + } + } + + public enum DataType { + /** + * The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library. + */ + ACTIONDEFINITION, + /** + * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. + */ + ADDRESS, + /** + * null + */ + AGE, + /** + * A text note which also contains information about who made the statement and when. + */ + ANNOTATION, + /** + * For referring to data content defined in other formats. + */ + ATTACHMENT, + /** + * Base definition for all elements that are defined inside a resource - but not those in a data type. + */ + BACKBONEELEMENT, + /** + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + */ + CODEABLECONCEPT, + /** + * A reference to a code defined by a terminology system. + */ + CODING, + /** + * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + */ + CONTACTPOINT, + /** + * null + */ + COUNT, + /** + * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. + */ + DATAREQUIREMENT, + /** + * null + */ + DISTANCE, + /** + * null + */ + DURATION, + /** + * Base definition for all elements in a resource. + */ + ELEMENT, + /** + * Captures constraints on each element within the resource, profile, or extension. + */ + ELEMENTDEFINITION, + /** + * Optional Extensions Element - found in all resources. + */ + EXTENSION, + /** + * A human's name with the ability to identify parts and usage. + */ + HUMANNAME, + /** + * A technical identifier - identifies some entity uniquely and unambiguously. + */ + IDENTIFIER, + /** + * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + */ + META, + /** + * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information. + */ + MODULEMETADATA, + /** + * null + */ + MONEY, + /** + * A human-readable formatted text, including images. + */ + NARRATIVE, + /** + * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. + */ + PARAMETERDEFINITION, + /** + * A time period defined by a start and end date and optionally time. + */ + PERIOD, + /** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ + QUANTITY, + /** + * A set of ordered Quantities defined by a low and high limit. + */ + RANGE, + /** + * A relationship of two Quantity values - expressed as a numerator and a denominator. + */ + RATIO, + /** + * A reference from one resource to another. + */ + REFERENCE, + /** + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + */ + SAMPLEDDATA, + /** + * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities. + */ + SIGNATURE, + /** + * null + */ + SIMPLEQUANTITY, + /** + * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. + */ + TIMING, + /** + * A description of a triggering event. + */ + TRIGGERDEFINITION, + /** + * A stream of bytes + */ + BASE64BINARY, + /** + * Value of "true" or "false" + */ + BOOLEAN, + /** + * A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents + */ + CODE, + /** + * A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. + */ + DATE, + /** + * A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. + */ + DATETIME, + /** + * A rational number with implicit precision + */ + DECIMAL, + /** + * Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive. + */ + ID, + /** + * An instant in time - known at least to the second + */ + INSTANT, + /** + * A whole number + */ + INTEGER, + /** + * A string that may contain markdown syntax for optional processing by a mark down presentation engine + */ + MARKDOWN, + /** + * An oid represented as a URI + */ + OID, + /** + * An integer with a value that is positive (e.g. >0) + */ + POSITIVEINT, + /** + * A sequence of Unicode characters + */ + STRING, + /** + * A time during the day, with no date specified + */ + TIME, + /** + * An integer with a value that is not negative (e.g. >= 0) + */ + UNSIGNEDINT, + /** + * String of characters used to identify a name or a resource + */ + URI, + /** + * A UUID, represented as a URI + */ + UUID, + /** + * XHTML format, as defined by W3C, but restricted usage (mainly, no active content) + */ + XHTML, + /** + * added to help the parsers + */ + NULL; + public static DataType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return ACTIONDEFINITION; + if ("Address".equals(codeString)) + return ADDRESS; + if ("Age".equals(codeString)) + return AGE; + if ("Annotation".equals(codeString)) + return ANNOTATION; + if ("Attachment".equals(codeString)) + return ATTACHMENT; + if ("BackboneElement".equals(codeString)) + return BACKBONEELEMENT; + if ("CodeableConcept".equals(codeString)) + return CODEABLECONCEPT; + if ("Coding".equals(codeString)) + return CODING; + if ("ContactPoint".equals(codeString)) + return CONTACTPOINT; + if ("Count".equals(codeString)) + return COUNT; + if ("DataRequirement".equals(codeString)) + return DATAREQUIREMENT; + if ("Distance".equals(codeString)) + return DISTANCE; + if ("Duration".equals(codeString)) + return DURATION; + if ("Element".equals(codeString)) + return ELEMENT; + if ("ElementDefinition".equals(codeString)) + return ELEMENTDEFINITION; + if ("Extension".equals(codeString)) + return EXTENSION; + if ("HumanName".equals(codeString)) + return HUMANNAME; + if ("Identifier".equals(codeString)) + return IDENTIFIER; + if ("Meta".equals(codeString)) + return META; + if ("ModuleMetadata".equals(codeString)) + return MODULEMETADATA; + if ("Money".equals(codeString)) + return MONEY; + if ("Narrative".equals(codeString)) + return NARRATIVE; + if ("ParameterDefinition".equals(codeString)) + return PARAMETERDEFINITION; + if ("Period".equals(codeString)) + return PERIOD; + if ("Quantity".equals(codeString)) + return QUANTITY; + if ("Range".equals(codeString)) + return RANGE; + if ("Ratio".equals(codeString)) + return RATIO; + if ("Reference".equals(codeString)) + return REFERENCE; + if ("SampledData".equals(codeString)) + return SAMPLEDDATA; + if ("Signature".equals(codeString)) + return SIGNATURE; + if ("SimpleQuantity".equals(codeString)) + return SIMPLEQUANTITY; + if ("Timing".equals(codeString)) + return TIMING; + if ("TriggerDefinition".equals(codeString)) + return TRIGGERDEFINITION; + if ("base64Binary".equals(codeString)) + return BASE64BINARY; + if ("boolean".equals(codeString)) + return BOOLEAN; + if ("code".equals(codeString)) + return CODE; + if ("date".equals(codeString)) + return DATE; + if ("dateTime".equals(codeString)) + return DATETIME; + if ("decimal".equals(codeString)) + return DECIMAL; + if ("id".equals(codeString)) + return ID; + if ("instant".equals(codeString)) + return INSTANT; + if ("integer".equals(codeString)) + return INTEGER; + if ("markdown".equals(codeString)) + return MARKDOWN; + if ("oid".equals(codeString)) + return OID; + if ("positiveInt".equals(codeString)) + return POSITIVEINT; + if ("string".equals(codeString)) + return STRING; + if ("time".equals(codeString)) + return TIME; + if ("unsignedInt".equals(codeString)) + return UNSIGNEDINT; + if ("uri".equals(codeString)) + return URI; + if ("uuid".equals(codeString)) + return UUID; + if ("xhtml".equals(codeString)) + return XHTML; + throw new FHIRException("Unknown DataType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIONDEFINITION: return "ActionDefinition"; + case ADDRESS: return "Address"; + case AGE: return "Age"; + case ANNOTATION: return "Annotation"; + case ATTACHMENT: return "Attachment"; + case BACKBONEELEMENT: return "BackboneElement"; + case CODEABLECONCEPT: return "CodeableConcept"; + case CODING: return "Coding"; + case CONTACTPOINT: return "ContactPoint"; + case COUNT: return "Count"; + case DATAREQUIREMENT: return "DataRequirement"; + case DISTANCE: return "Distance"; + case DURATION: return "Duration"; + case ELEMENT: return "Element"; + case ELEMENTDEFINITION: return "ElementDefinition"; + case EXTENSION: return "Extension"; + case HUMANNAME: return "HumanName"; + case IDENTIFIER: return "Identifier"; + case META: return "Meta"; + case MODULEMETADATA: return "ModuleMetadata"; + case MONEY: return "Money"; + case NARRATIVE: return "Narrative"; + case PARAMETERDEFINITION: return "ParameterDefinition"; + case PERIOD: return "Period"; + case QUANTITY: return "Quantity"; + case RANGE: return "Range"; + case RATIO: return "Ratio"; + case REFERENCE: return "Reference"; + case SAMPLEDDATA: return "SampledData"; + case SIGNATURE: return "Signature"; + case SIMPLEQUANTITY: return "SimpleQuantity"; + case TIMING: return "Timing"; + case TRIGGERDEFINITION: return "TriggerDefinition"; + case BASE64BINARY: return "base64Binary"; + case BOOLEAN: return "boolean"; + case CODE: return "code"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case DECIMAL: return "decimal"; + case ID: return "id"; + case INSTANT: return "instant"; + case INTEGER: return "integer"; + case MARKDOWN: return "markdown"; + case OID: return "oid"; + case POSITIVEINT: return "positiveInt"; + case STRING: return "string"; + case TIME: return "time"; + case UNSIGNEDINT: return "unsignedInt"; + case URI: return "uri"; + case UUID: return "uuid"; + case XHTML: return "xhtml"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIONDEFINITION: return "http://hl7.org/fhir/data-types"; + case ADDRESS: return "http://hl7.org/fhir/data-types"; + case AGE: return "http://hl7.org/fhir/data-types"; + case ANNOTATION: return "http://hl7.org/fhir/data-types"; + case ATTACHMENT: return "http://hl7.org/fhir/data-types"; + case BACKBONEELEMENT: return "http://hl7.org/fhir/data-types"; + case CODEABLECONCEPT: return "http://hl7.org/fhir/data-types"; + case CODING: return "http://hl7.org/fhir/data-types"; + case CONTACTPOINT: return "http://hl7.org/fhir/data-types"; + case COUNT: return "http://hl7.org/fhir/data-types"; + case DATAREQUIREMENT: return "http://hl7.org/fhir/data-types"; + case DISTANCE: return "http://hl7.org/fhir/data-types"; + case DURATION: return "http://hl7.org/fhir/data-types"; + case ELEMENT: return "http://hl7.org/fhir/data-types"; + case ELEMENTDEFINITION: return "http://hl7.org/fhir/data-types"; + case EXTENSION: return "http://hl7.org/fhir/data-types"; + case HUMANNAME: return "http://hl7.org/fhir/data-types"; + case IDENTIFIER: return "http://hl7.org/fhir/data-types"; + case META: return "http://hl7.org/fhir/data-types"; + case MODULEMETADATA: return "http://hl7.org/fhir/data-types"; + case MONEY: return "http://hl7.org/fhir/data-types"; + case NARRATIVE: return "http://hl7.org/fhir/data-types"; + case PARAMETERDEFINITION: return "http://hl7.org/fhir/data-types"; + case PERIOD: return "http://hl7.org/fhir/data-types"; + case QUANTITY: return "http://hl7.org/fhir/data-types"; + case RANGE: return "http://hl7.org/fhir/data-types"; + case RATIO: return "http://hl7.org/fhir/data-types"; + case REFERENCE: return "http://hl7.org/fhir/data-types"; + case SAMPLEDDATA: return "http://hl7.org/fhir/data-types"; + case SIGNATURE: return "http://hl7.org/fhir/data-types"; + case SIMPLEQUANTITY: return "http://hl7.org/fhir/data-types"; + case TIMING: return "http://hl7.org/fhir/data-types"; + case TRIGGERDEFINITION: return "http://hl7.org/fhir/data-types"; + case BASE64BINARY: return "http://hl7.org/fhir/data-types"; + case BOOLEAN: return "http://hl7.org/fhir/data-types"; + case CODE: return "http://hl7.org/fhir/data-types"; + case DATE: return "http://hl7.org/fhir/data-types"; + case DATETIME: return "http://hl7.org/fhir/data-types"; + case DECIMAL: return "http://hl7.org/fhir/data-types"; + case ID: return "http://hl7.org/fhir/data-types"; + case INSTANT: return "http://hl7.org/fhir/data-types"; + case INTEGER: return "http://hl7.org/fhir/data-types"; + case MARKDOWN: return "http://hl7.org/fhir/data-types"; + case OID: return "http://hl7.org/fhir/data-types"; + case POSITIVEINT: return "http://hl7.org/fhir/data-types"; + case STRING: return "http://hl7.org/fhir/data-types"; + case TIME: return "http://hl7.org/fhir/data-types"; + case UNSIGNEDINT: return "http://hl7.org/fhir/data-types"; + case URI: return "http://hl7.org/fhir/data-types"; + case UUID: return "http://hl7.org/fhir/data-types"; + case XHTML: return "http://hl7.org/fhir/data-types"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIONDEFINITION: return "The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library."; + case ADDRESS: return "An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world."; + case AGE: return ""; + case ANNOTATION: return "A text note which also contains information about who made the statement and when."; + case ATTACHMENT: return "For referring to data content defined in other formats."; + case BACKBONEELEMENT: return "Base definition for all elements that are defined inside a resource - but not those in a data type."; + case CODEABLECONCEPT: return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text."; + case CODING: return "A reference to a code defined by a terminology system."; + case CONTACTPOINT: return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc."; + case COUNT: return ""; + case DATAREQUIREMENT: return "Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data."; + case DISTANCE: return ""; + case DURATION: return ""; + case ELEMENT: return "Base definition for all elements in a resource."; + case ELEMENTDEFINITION: return "Captures constraints on each element within the resource, profile, or extension."; + case EXTENSION: return "Optional Extensions Element - found in all resources."; + case HUMANNAME: return "A human's name with the ability to identify parts and usage."; + case IDENTIFIER: return "A technical identifier - identifies some entity uniquely and unambiguously."; + case META: return "The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource."; + case MODULEMETADATA: return "The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information."; + case MONEY: return ""; + case NARRATIVE: return "A human-readable formatted text, including images."; + case PARAMETERDEFINITION: return "The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse."; + case PERIOD: return "A time period defined by a start and end date and optionally time."; + case QUANTITY: return "A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies."; + case RANGE: return "A set of ordered Quantities defined by a low and high limit."; + case RATIO: return "A relationship of two Quantity values - expressed as a numerator and a denominator."; + case REFERENCE: return "A reference from one resource to another."; + case SAMPLEDDATA: return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data."; + case SIGNATURE: return "A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities."; + case SIMPLEQUANTITY: return ""; + case TIMING: return "Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds."; + case TRIGGERDEFINITION: return "A description of a triggering event."; + case BASE64BINARY: return "A stream of bytes"; + case BOOLEAN: return "Value of \"true\" or \"false\""; + case CODE: return "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents"; + case DATE: return "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates."; + case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates."; + case DECIMAL: return "A rational number with implicit precision"; + case ID: return "Any combination of letters, numerals, \"-\" and \".\", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive."; + case INSTANT: return "An instant in time - known at least to the second"; + case INTEGER: return "A whole number"; + case MARKDOWN: return "A string that may contain markdown syntax for optional processing by a mark down presentation engine"; + case OID: return "An oid represented as a URI"; + case POSITIVEINT: return "An integer with a value that is positive (e.g. >0)"; + case STRING: return "A sequence of Unicode characters"; + case TIME: return "A time during the day, with no date specified"; + case UNSIGNEDINT: return "An integer with a value that is not negative (e.g. >= 0)"; + case URI: return "String of characters used to identify a name or a resource"; + case UUID: return "A UUID, represented as a URI"; + case XHTML: return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIONDEFINITION: return "ActionDefinition"; + case ADDRESS: return "Address"; + case AGE: return "Age"; + case ANNOTATION: return "Annotation"; + case ATTACHMENT: return "Attachment"; + case BACKBONEELEMENT: return "BackboneElement"; + case CODEABLECONCEPT: return "CodeableConcept"; + case CODING: return "Coding"; + case CONTACTPOINT: return "ContactPoint"; + case COUNT: return "Count"; + case DATAREQUIREMENT: return "DataRequirement"; + case DISTANCE: return "Distance"; + case DURATION: return "Duration"; + case ELEMENT: return "Element"; + case ELEMENTDEFINITION: return "ElementDefinition"; + case EXTENSION: return "Extension"; + case HUMANNAME: return "HumanName"; + case IDENTIFIER: return "Identifier"; + case META: return "Meta"; + case MODULEMETADATA: return "ModuleMetadata"; + case MONEY: return "Money"; + case NARRATIVE: return "Narrative"; + case PARAMETERDEFINITION: return "ParameterDefinition"; + case PERIOD: return "Period"; + case QUANTITY: return "Quantity"; + case RANGE: return "Range"; + case RATIO: return "Ratio"; + case REFERENCE: return "Reference"; + case SAMPLEDDATA: return "SampledData"; + case SIGNATURE: return "Signature"; + case SIMPLEQUANTITY: return "SimpleQuantity"; + case TIMING: return "Timing"; + case TRIGGERDEFINITION: return "TriggerDefinition"; + case BASE64BINARY: return "base64Binary"; + case BOOLEAN: return "boolean"; + case CODE: return "code"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case DECIMAL: return "decimal"; + case ID: return "id"; + case INSTANT: return "instant"; + case INTEGER: return "integer"; + case MARKDOWN: return "markdown"; + case OID: return "oid"; + case POSITIVEINT: return "positiveInt"; + case STRING: return "string"; + case TIME: return "time"; + case UNSIGNEDINT: return "unsignedInt"; + case URI: return "uri"; + case UUID: return "uuid"; + case XHTML: return "XHTML"; + default: return "?"; + } + } + } + + public static class DataTypeEnumFactory implements EnumFactory { + public DataType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return DataType.ACTIONDEFINITION; + if ("Address".equals(codeString)) + return DataType.ADDRESS; + if ("Age".equals(codeString)) + return DataType.AGE; + if ("Annotation".equals(codeString)) + return DataType.ANNOTATION; + if ("Attachment".equals(codeString)) + return DataType.ATTACHMENT; + if ("BackboneElement".equals(codeString)) + return DataType.BACKBONEELEMENT; + if ("CodeableConcept".equals(codeString)) + return DataType.CODEABLECONCEPT; + if ("Coding".equals(codeString)) + return DataType.CODING; + if ("ContactPoint".equals(codeString)) + return DataType.CONTACTPOINT; + if ("Count".equals(codeString)) + return DataType.COUNT; + if ("DataRequirement".equals(codeString)) + return DataType.DATAREQUIREMENT; + if ("Distance".equals(codeString)) + return DataType.DISTANCE; + if ("Duration".equals(codeString)) + return DataType.DURATION; + if ("Element".equals(codeString)) + return DataType.ELEMENT; + if ("ElementDefinition".equals(codeString)) + return DataType.ELEMENTDEFINITION; + if ("Extension".equals(codeString)) + return DataType.EXTENSION; + if ("HumanName".equals(codeString)) + return DataType.HUMANNAME; + if ("Identifier".equals(codeString)) + return DataType.IDENTIFIER; + if ("Meta".equals(codeString)) + return DataType.META; + if ("ModuleMetadata".equals(codeString)) + return DataType.MODULEMETADATA; + if ("Money".equals(codeString)) + return DataType.MONEY; + if ("Narrative".equals(codeString)) + return DataType.NARRATIVE; + if ("ParameterDefinition".equals(codeString)) + return DataType.PARAMETERDEFINITION; + if ("Period".equals(codeString)) + return DataType.PERIOD; + if ("Quantity".equals(codeString)) + return DataType.QUANTITY; + if ("Range".equals(codeString)) + return DataType.RANGE; + if ("Ratio".equals(codeString)) + return DataType.RATIO; + if ("Reference".equals(codeString)) + return DataType.REFERENCE; + if ("SampledData".equals(codeString)) + return DataType.SAMPLEDDATA; + if ("Signature".equals(codeString)) + return DataType.SIGNATURE; + if ("SimpleQuantity".equals(codeString)) + return DataType.SIMPLEQUANTITY; + if ("Timing".equals(codeString)) + return DataType.TIMING; + if ("TriggerDefinition".equals(codeString)) + return DataType.TRIGGERDEFINITION; + if ("base64Binary".equals(codeString)) + return DataType.BASE64BINARY; + if ("boolean".equals(codeString)) + return DataType.BOOLEAN; + if ("code".equals(codeString)) + return DataType.CODE; + if ("date".equals(codeString)) + return DataType.DATE; + if ("dateTime".equals(codeString)) + return DataType.DATETIME; + if ("decimal".equals(codeString)) + return DataType.DECIMAL; + if ("id".equals(codeString)) + return DataType.ID; + if ("instant".equals(codeString)) + return DataType.INSTANT; + if ("integer".equals(codeString)) + return DataType.INTEGER; + if ("markdown".equals(codeString)) + return DataType.MARKDOWN; + if ("oid".equals(codeString)) + return DataType.OID; + if ("positiveInt".equals(codeString)) + return DataType.POSITIVEINT; + if ("string".equals(codeString)) + return DataType.STRING; + if ("time".equals(codeString)) + return DataType.TIME; + if ("unsignedInt".equals(codeString)) + return DataType.UNSIGNEDINT; + if ("uri".equals(codeString)) + return DataType.URI; + if ("uuid".equals(codeString)) + return DataType.UUID; + if ("xhtml".equals(codeString)) + return DataType.XHTML; + throw new IllegalArgumentException("Unknown DataType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return new Enumeration(this, DataType.ACTIONDEFINITION); + if ("Address".equals(codeString)) + return new Enumeration(this, DataType.ADDRESS); + if ("Age".equals(codeString)) + return new Enumeration(this, DataType.AGE); + if ("Annotation".equals(codeString)) + return new Enumeration(this, DataType.ANNOTATION); + if ("Attachment".equals(codeString)) + return new Enumeration(this, DataType.ATTACHMENT); + if ("BackboneElement".equals(codeString)) + return new Enumeration(this, DataType.BACKBONEELEMENT); + if ("CodeableConcept".equals(codeString)) + return new Enumeration(this, DataType.CODEABLECONCEPT); + if ("Coding".equals(codeString)) + return new Enumeration(this, DataType.CODING); + if ("ContactPoint".equals(codeString)) + return new Enumeration(this, DataType.CONTACTPOINT); + if ("Count".equals(codeString)) + return new Enumeration(this, DataType.COUNT); + if ("DataRequirement".equals(codeString)) + return new Enumeration(this, DataType.DATAREQUIREMENT); + if ("Distance".equals(codeString)) + return new Enumeration(this, DataType.DISTANCE); + if ("Duration".equals(codeString)) + return new Enumeration(this, DataType.DURATION); + if ("Element".equals(codeString)) + return new Enumeration(this, DataType.ELEMENT); + if ("ElementDefinition".equals(codeString)) + return new Enumeration(this, DataType.ELEMENTDEFINITION); + if ("Extension".equals(codeString)) + return new Enumeration(this, DataType.EXTENSION); + if ("HumanName".equals(codeString)) + return new Enumeration(this, DataType.HUMANNAME); + if ("Identifier".equals(codeString)) + return new Enumeration(this, DataType.IDENTIFIER); + if ("Meta".equals(codeString)) + return new Enumeration(this, DataType.META); + if ("ModuleMetadata".equals(codeString)) + return new Enumeration(this, DataType.MODULEMETADATA); + if ("Money".equals(codeString)) + return new Enumeration(this, DataType.MONEY); + if ("Narrative".equals(codeString)) + return new Enumeration(this, DataType.NARRATIVE); + if ("ParameterDefinition".equals(codeString)) + return new Enumeration(this, DataType.PARAMETERDEFINITION); + if ("Period".equals(codeString)) + return new Enumeration(this, DataType.PERIOD); + if ("Quantity".equals(codeString)) + return new Enumeration(this, DataType.QUANTITY); + if ("Range".equals(codeString)) + return new Enumeration(this, DataType.RANGE); + if ("Ratio".equals(codeString)) + return new Enumeration(this, DataType.RATIO); + if ("Reference".equals(codeString)) + return new Enumeration(this, DataType.REFERENCE); + if ("SampledData".equals(codeString)) + return new Enumeration(this, DataType.SAMPLEDDATA); + if ("Signature".equals(codeString)) + return new Enumeration(this, DataType.SIGNATURE); + if ("SimpleQuantity".equals(codeString)) + return new Enumeration(this, DataType.SIMPLEQUANTITY); + if ("Timing".equals(codeString)) + return new Enumeration(this, DataType.TIMING); + if ("TriggerDefinition".equals(codeString)) + return new Enumeration(this, DataType.TRIGGERDEFINITION); + if ("base64Binary".equals(codeString)) + return new Enumeration(this, DataType.BASE64BINARY); + if ("boolean".equals(codeString)) + return new Enumeration(this, DataType.BOOLEAN); + if ("code".equals(codeString)) + return new Enumeration(this, DataType.CODE); + if ("date".equals(codeString)) + return new Enumeration(this, DataType.DATE); + if ("dateTime".equals(codeString)) + return new Enumeration(this, DataType.DATETIME); + if ("decimal".equals(codeString)) + return new Enumeration(this, DataType.DECIMAL); + if ("id".equals(codeString)) + return new Enumeration(this, DataType.ID); + if ("instant".equals(codeString)) + return new Enumeration(this, DataType.INSTANT); + if ("integer".equals(codeString)) + return new Enumeration(this, DataType.INTEGER); + if ("markdown".equals(codeString)) + return new Enumeration(this, DataType.MARKDOWN); + if ("oid".equals(codeString)) + return new Enumeration(this, DataType.OID); + if ("positiveInt".equals(codeString)) + return new Enumeration(this, DataType.POSITIVEINT); + if ("string".equals(codeString)) + return new Enumeration(this, DataType.STRING); + if ("time".equals(codeString)) + return new Enumeration(this, DataType.TIME); + if ("unsignedInt".equals(codeString)) + return new Enumeration(this, DataType.UNSIGNEDINT); + if ("uri".equals(codeString)) + return new Enumeration(this, DataType.URI); + if ("uuid".equals(codeString)) + return new Enumeration(this, DataType.UUID); + if ("xhtml".equals(codeString)) + return new Enumeration(this, DataType.XHTML); + throw new FHIRException("Unknown DataType code '"+codeString+"'"); + } + public String toCode(DataType code) { + if (code == DataType.ACTIONDEFINITION) + return "ActionDefinition"; + if (code == DataType.ADDRESS) + return "Address"; + if (code == DataType.AGE) + return "Age"; + if (code == DataType.ANNOTATION) + return "Annotation"; + if (code == DataType.ATTACHMENT) + return "Attachment"; + if (code == DataType.BACKBONEELEMENT) + return "BackboneElement"; + if (code == DataType.CODEABLECONCEPT) + return "CodeableConcept"; + if (code == DataType.CODING) + return "Coding"; + if (code == DataType.CONTACTPOINT) + return "ContactPoint"; + if (code == DataType.COUNT) + return "Count"; + if (code == DataType.DATAREQUIREMENT) + return "DataRequirement"; + if (code == DataType.DISTANCE) + return "Distance"; + if (code == DataType.DURATION) + return "Duration"; + if (code == DataType.ELEMENT) + return "Element"; + if (code == DataType.ELEMENTDEFINITION) + return "ElementDefinition"; + if (code == DataType.EXTENSION) + return "Extension"; + if (code == DataType.HUMANNAME) + return "HumanName"; + if (code == DataType.IDENTIFIER) + return "Identifier"; + if (code == DataType.META) + return "Meta"; + if (code == DataType.MODULEMETADATA) + return "ModuleMetadata"; + if (code == DataType.MONEY) + return "Money"; + if (code == DataType.NARRATIVE) + return "Narrative"; + if (code == DataType.PARAMETERDEFINITION) + return "ParameterDefinition"; + if (code == DataType.PERIOD) + return "Period"; + if (code == DataType.QUANTITY) + return "Quantity"; + if (code == DataType.RANGE) + return "Range"; + if (code == DataType.RATIO) + return "Ratio"; + if (code == DataType.REFERENCE) + return "Reference"; + if (code == DataType.SAMPLEDDATA) + return "SampledData"; + if (code == DataType.SIGNATURE) + return "Signature"; + if (code == DataType.SIMPLEQUANTITY) + return "SimpleQuantity"; + if (code == DataType.TIMING) + return "Timing"; + if (code == DataType.TRIGGERDEFINITION) + return "TriggerDefinition"; + if (code == DataType.BASE64BINARY) + return "base64Binary"; + if (code == DataType.BOOLEAN) + return "boolean"; + if (code == DataType.CODE) + return "code"; + if (code == DataType.DATE) + return "date"; + if (code == DataType.DATETIME) + return "dateTime"; + if (code == DataType.DECIMAL) + return "decimal"; + if (code == DataType.ID) + return "id"; + if (code == DataType.INSTANT) + return "instant"; + if (code == DataType.INTEGER) + return "integer"; + if (code == DataType.MARKDOWN) + return "markdown"; + if (code == DataType.OID) + return "oid"; + if (code == DataType.POSITIVEINT) + return "positiveInt"; + if (code == DataType.STRING) + return "string"; + if (code == DataType.TIME) + return "time"; + if (code == DataType.UNSIGNEDINT) + return "unsignedInt"; + if (code == DataType.URI) + return "uri"; + if (code == DataType.UUID) + return "uuid"; + if (code == DataType.XHTML) + return "xhtml"; + return "?"; + } + public String toSystem(DataType code) { + return code.getSystem(); + } + } + + public enum DocumentReferenceStatus { + /** + * This is the current reference for this document. + */ + CURRENT, + /** + * This reference has been superseded by another reference. + */ + SUPERSEDED, + /** + * This reference was created in error. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static DocumentReferenceStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return CURRENT; + if ("superseded".equals(codeString)) + return SUPERSEDED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CURRENT: return "current"; + case SUPERSEDED: return "superseded"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CURRENT: return "http://hl7.org/fhir/document-reference-status"; + case SUPERSEDED: return "http://hl7.org/fhir/document-reference-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/document-reference-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CURRENT: return "This is the current reference for this document."; + case SUPERSEDED: return "This reference has been superseded by another reference."; + case ENTEREDINERROR: return "This reference was created in error."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CURRENT: return "Current"; + case SUPERSEDED: return "Superseded"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + 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; + if ("current".equals(codeString)) + return DocumentReferenceStatus.CURRENT; + if ("superseded".equals(codeString)) + return DocumentReferenceStatus.SUPERSEDED; + if ("entered-in-error".equals(codeString)) + return DocumentReferenceStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return new Enumeration(this, DocumentReferenceStatus.CURRENT); + if ("superseded".equals(codeString)) + return new Enumeration(this, DocumentReferenceStatus.SUPERSEDED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, DocumentReferenceStatus.ENTEREDINERROR); + throw new FHIRException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public String toCode(DocumentReferenceStatus code) { + if (code == DocumentReferenceStatus.CURRENT) + return "current"; + if (code == DocumentReferenceStatus.SUPERSEDED) + return "superseded"; + if (code == DocumentReferenceStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(DocumentReferenceStatus code) { + return code.getSystem(); + } + } + + public enum FHIRAllTypes { + /** + * The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library. + */ + ACTIONDEFINITION, + /** + * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. + */ + ADDRESS, + /** + * null + */ + AGE, + /** + * A text note which also contains information about who made the statement and when. + */ + ANNOTATION, + /** + * For referring to data content defined in other formats. + */ + ATTACHMENT, + /** + * Base definition for all elements that are defined inside a resource - but not those in a data type. + */ + BACKBONEELEMENT, + /** + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + */ + CODEABLECONCEPT, + /** + * A reference to a code defined by a terminology system. + */ + CODING, + /** + * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + */ + CONTACTPOINT, + /** + * null + */ + COUNT, + /** + * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. + */ + DATAREQUIREMENT, + /** + * null + */ + DISTANCE, + /** + * null + */ + DURATION, + /** + * Base definition for all elements in a resource. + */ + ELEMENT, + /** + * Captures constraints on each element within the resource, profile, or extension. + */ + ELEMENTDEFINITION, + /** + * Optional Extensions Element - found in all resources. + */ + EXTENSION, + /** + * A human's name with the ability to identify parts and usage. + */ + HUMANNAME, + /** + * A technical identifier - identifies some entity uniquely and unambiguously. + */ + IDENTIFIER, + /** + * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + */ + META, + /** + * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information. + */ + MODULEMETADATA, + /** + * null + */ + MONEY, + /** + * A human-readable formatted text, including images. + */ + NARRATIVE, + /** + * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. + */ + PARAMETERDEFINITION, + /** + * A time period defined by a start and end date and optionally time. + */ + PERIOD, + /** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ + QUANTITY, + /** + * A set of ordered Quantities defined by a low and high limit. + */ + RANGE, + /** + * A relationship of two Quantity values - expressed as a numerator and a denominator. + */ + RATIO, + /** + * A reference from one resource to another. + */ + REFERENCE, + /** + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + */ + SAMPLEDDATA, + /** + * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities. + */ + SIGNATURE, + /** + * null + */ + SIMPLEQUANTITY, + /** + * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. + */ + TIMING, + /** + * A description of a triggering event. + */ + TRIGGERDEFINITION, + /** + * A stream of bytes + */ + BASE64BINARY, + /** + * Value of "true" or "false" + */ + BOOLEAN, + /** + * A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents + */ + CODE, + /** + * A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. + */ + DATE, + /** + * A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. + */ + DATETIME, + /** + * A rational number with implicit precision + */ + DECIMAL, + /** + * Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive. + */ + ID, + /** + * An instant in time - known at least to the second + */ + INSTANT, + /** + * A whole number + */ + INTEGER, + /** + * A string that may contain markdown syntax for optional processing by a mark down presentation engine + */ + MARKDOWN, + /** + * An oid represented as a URI + */ + OID, + /** + * An integer with a value that is positive (e.g. >0) + */ + POSITIVEINT, + /** + * A sequence of Unicode characters + */ + STRING, + /** + * A time during the day, with no date specified + */ + TIME, + /** + * An integer with a value that is not negative (e.g. >= 0) + */ + UNSIGNEDINT, + /** + * String of characters used to identify a name or a resource + */ + URI, + /** + * A UUID, represented as a URI + */ + UUID, + /** + * XHTML format, as defined by W3C, but restricted usage (mainly, no active content) + */ + XHTML, + /** + * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc. + */ + ACCOUNT, + /** + * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + */ + ALLERGYINTOLERANCE, + /** + * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). + */ + APPOINTMENT, + /** + * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. + */ + APPOINTMENTRESPONSE, + /** + * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + */ + AUDITEVENT, + /** + * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. + */ + BASIC, + /** + * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + */ + BINARY, + /** + * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + */ + BODYSITE, + /** + * A container for a collection of resources. + */ + BUNDLE, + /** + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. + */ + CAREPLAN, + /** + * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. + */ + CARETEAM, + /** + * 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. + */ + CLAIM, + /** + * This resource provides the adjudication details from the processing of a Claim resource. + */ + CLAIMRESPONSE, + /** + * 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. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + */ + CLINICALIMPRESSION, + /** + * A code system resource specifies a set of codes drawn from one or more code systems. + */ + CODESYSTEM, + /** + * 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. + */ + COMMUNICATION, + /** + * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + */ + COMMUNICATIONREQUEST, + /** + * A compartment definition that defines how resources are accessed on a server. + */ + COMPARTMENTDEFINITION, + /** + * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. + */ + COMPOSITION, + /** + * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + */ + CONCEPTMAP, + /** + * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary. + */ + CONDITION, + /** + * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. + */ + CONFORMANCE, + /** + * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + */ + CONTRACT, + /** + * Financial instrument which may be used to pay for or reimburse health care products and services. + */ + COVERAGE, + /** + * The formal description of a single piece of information that can be gathered and reported. + */ + DATAELEMENT, + /** + * This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events. + */ + DECISIONSUPPORTRULE, + /** + * The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking. + */ + DECISIONSUPPORTSERVICEMODULE, + /** + * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + */ + DETECTEDISSUE, + /** + * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. + */ + DEVICE, + /** + * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. + */ + DEVICECOMPONENT, + /** + * Describes a measurement, calculation or setting capability of a medical device. + */ + DEVICEMETRIC, + /** + * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. + */ + DEVICEUSEREQUEST, + /** + * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. + */ + DEVICEUSESTATEMENT, + /** + * A record of a request for a diagnostic investigation service to be performed. + */ + DIAGNOSTICORDER, + /** + * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. + */ + DIAGNOSTICREPORT, + /** + * A manifest that defines a set of documents. + */ + DOCUMENTMANIFEST, + /** + * A reference to a document . + */ + DOCUMENTREFERENCE, + /** + * A resource that includes narrative, extensions, and contained resources. + */ + DOMAINRESOURCE, + /** + * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + */ + ELIGIBILITYREQUEST, + /** + * This resource provides eligibility and plan details from the processing of an Eligibility resource. + */ + ELIGIBILITYRESPONSE, + /** + * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + */ + ENCOUNTER, + /** + * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. + */ + ENROLLMENTREQUEST, + /** + * This resource provides enrollment and plan details from the processing of an Enrollment resource. + */ + ENROLLMENTRESPONSE, + /** + * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + */ + EPISODEOFCARE, + /** + * Resource to define constraints on the Expansion of a FHIR ValueSet. + */ + EXPANSIONPROFILE, + /** + * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. + */ + EXPLANATIONOFBENEFIT, + /** + * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. + */ + FAMILYMEMBERHISTORY, + /** + * Prospective warnings of potential issues when providing care to the patient. + */ + FLAG, + /** + * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. + */ + GOAL, + /** + * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. + */ + GROUP, + /** + * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. + */ + GUIDANCERESPONSE, + /** + * The details of a healthcare service available at a location. + */ + HEALTHCARESERVICE, + /** + * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. + */ + IMAGINGEXCERPT, + /** + * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. + */ + IMAGINGOBJECTSELECTION, + /** + * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. + */ + IMAGINGSTUDY, + /** + * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. + */ + IMMUNIZATION, + /** + * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. + */ + IMMUNIZATIONRECOMMENDATION, + /** + * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts. + */ + IMPLEMENTATIONGUIDE, + /** + * The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library. + */ + LIBRARY, + /** + * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". + */ + LINKAGE, + /** + * A set of information summarized from a list of other resources. + */ + LIST, + /** + * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + */ + LOCATION, + /** + * The Measure resource provides the definition of a quality measure. + */ + MEASURE, + /** + * The MeasureReport resource contains the results of evaluating a measure. + */ + MEASUREREPORT, + /** + * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + */ + MEDIA, + /** + * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. + */ + MEDICATION, + /** + * Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + */ + MEDICATIONADMINISTRATION, + /** + * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. + */ + MEDICATIONDISPENSE, + /** + * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc. + */ + MEDICATIONORDER, + /** + * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. + */ + MEDICATIONSTATEMENT, + /** + * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + */ + MESSAGEHEADER, + /** + * The ModuleDefinition resource defines the data requirements for a quality artifact. + */ + MODULEDEFINITION, + /** + * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + */ + NAMINGSYSTEM, + /** + * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + */ + NUTRITIONORDER, + /** + * Measurements and simple assertions made about a patient, device or other subject. + */ + OBSERVATION, + /** + * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + */ + OPERATIONDEFINITION, + /** + * A collection of error, warning or information messages that result from a system action. + */ + OPERATIONOUTCOME, + /** + * A request to perform an action. + */ + ORDER, + /** + * A response to an order. + */ + ORDERRESPONSE, + /** + * This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support. + */ + ORDERSET, + /** + * 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. + */ + ORGANIZATION, + /** + * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. + */ + PARAMETERS, + /** + * Demographics and other administrative information about an individual or animal receiving care or other health-related services. + */ + PATIENT, + /** + * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. + */ + PAYMENTNOTICE, + /** + * This resource provides payment details and claim references supporting a bulk payment. + */ + PAYMENTRECONCILIATION, + /** + * Demographics and administrative information about a person independent of a specific health-related context. + */ + PERSON, + /** + * A person who is directly or indirectly involved in the provisioning of healthcare. + */ + PRACTITIONER, + /** + * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. + */ + PRACTITIONERROLE, + /** + * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. + */ + PROCEDURE, + /** + * A request for a procedure to be performed. May be a proposal or an order. + */ + PROCEDUREREQUEST, + /** + * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. + */ + PROCESSREQUEST, + /** + * This resource provides processing status, errors and notes from the processing of a resource. + */ + PROCESSRESPONSE, + /** + * A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points. + */ + PROTOCOL, + /** + * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. + */ + PROVENANCE, + /** + * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ + QUESTIONNAIRE, + /** + * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ + QUESTIONNAIRERESPONSE, + /** + * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. + */ + REFERRALREQUEST, + /** + * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. + */ + RELATEDPERSON, + /** + * This is the base resource type for everything. + */ + RESOURCE, + /** + * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + */ + RISKASSESSMENT, + /** + * A container for slot(s) of time that may be available for booking appointments. + */ + SCHEDULE, + /** + * A search parameter that defines a named search item that can be used to search/filter on a resource. + */ + SEARCHPARAMETER, + /** + * Variation and Sequence data. + */ + SEQUENCE, + /** + * A slot of time on a schedule that may be available for booking appointments. + */ + SLOT, + /** + * A sample to be used for analysis. + */ + SPECIMEN, + /** + * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + */ + STRUCTUREDEFINITION, + /** + * A Map of relationships between 2 structures that can be used to transform data. + */ + STRUCTUREMAP, + /** + * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. + */ + SUBSCRIPTION, + /** + * A homogeneous material with a definite composition. + */ + SUBSTANCE, + /** + * Record of delivery of what is supplied. + */ + SUPPLYDELIVERY, + /** + * A record of a request for a medication, substance or device used in the healthcare setting. + */ + SUPPLYREQUEST, + /** + * A task to be performed. + */ + TASK, + /** + * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + */ + TESTSCRIPT, + /** + * A value set specifies a set of codes drawn from one or more code systems. + */ + VALUESET, + /** + * An authorization for the supply of glasses and/or contact lenses to a patient. + */ + VISIONPRESCRIPTION, + /** + * A place holder that means any kind of data type + */ + TYPE, + /** + * A place holder that means any kind of resource + */ + ANY, + /** + * added to help the parsers + */ + NULL; + public static FHIRAllTypes fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return ACTIONDEFINITION; + if ("Address".equals(codeString)) + return ADDRESS; + if ("Age".equals(codeString)) + return AGE; + if ("Annotation".equals(codeString)) + return ANNOTATION; + if ("Attachment".equals(codeString)) + return ATTACHMENT; + if ("BackboneElement".equals(codeString)) + return BACKBONEELEMENT; + if ("CodeableConcept".equals(codeString)) + return CODEABLECONCEPT; + if ("Coding".equals(codeString)) + return CODING; + if ("ContactPoint".equals(codeString)) + return CONTACTPOINT; + if ("Count".equals(codeString)) + return COUNT; + if ("DataRequirement".equals(codeString)) + return DATAREQUIREMENT; + if ("Distance".equals(codeString)) + return DISTANCE; + if ("Duration".equals(codeString)) + return DURATION; + if ("Element".equals(codeString)) + return ELEMENT; + if ("ElementDefinition".equals(codeString)) + return ELEMENTDEFINITION; + if ("Extension".equals(codeString)) + return EXTENSION; + if ("HumanName".equals(codeString)) + return HUMANNAME; + if ("Identifier".equals(codeString)) + return IDENTIFIER; + if ("Meta".equals(codeString)) + return META; + if ("ModuleMetadata".equals(codeString)) + return MODULEMETADATA; + if ("Money".equals(codeString)) + return MONEY; + if ("Narrative".equals(codeString)) + return NARRATIVE; + if ("ParameterDefinition".equals(codeString)) + return PARAMETERDEFINITION; + if ("Period".equals(codeString)) + return PERIOD; + if ("Quantity".equals(codeString)) + return QUANTITY; + if ("Range".equals(codeString)) + return RANGE; + if ("Ratio".equals(codeString)) + return RATIO; + if ("Reference".equals(codeString)) + return REFERENCE; + if ("SampledData".equals(codeString)) + return SAMPLEDDATA; + if ("Signature".equals(codeString)) + return SIGNATURE; + if ("SimpleQuantity".equals(codeString)) + return SIMPLEQUANTITY; + if ("Timing".equals(codeString)) + return TIMING; + if ("TriggerDefinition".equals(codeString)) + return TRIGGERDEFINITION; + if ("base64Binary".equals(codeString)) + return BASE64BINARY; + if ("boolean".equals(codeString)) + return BOOLEAN; + if ("code".equals(codeString)) + return CODE; + if ("date".equals(codeString)) + return DATE; + if ("dateTime".equals(codeString)) + return DATETIME; + if ("decimal".equals(codeString)) + return DECIMAL; + if ("id".equals(codeString)) + return ID; + if ("instant".equals(codeString)) + return INSTANT; + if ("integer".equals(codeString)) + return INTEGER; + if ("markdown".equals(codeString)) + return MARKDOWN; + if ("oid".equals(codeString)) + return OID; + if ("positiveInt".equals(codeString)) + return POSITIVEINT; + if ("string".equals(codeString)) + return STRING; + if ("time".equals(codeString)) + return TIME; + if ("unsignedInt".equals(codeString)) + return UNSIGNEDINT; + if ("uri".equals(codeString)) + return URI; + if ("uuid".equals(codeString)) + return UUID; + if ("xhtml".equals(codeString)) + return XHTML; + if ("Account".equals(codeString)) + return ACCOUNT; + if ("AllergyIntolerance".equals(codeString)) + return ALLERGYINTOLERANCE; + if ("Appointment".equals(codeString)) + return APPOINTMENT; + if ("AppointmentResponse".equals(codeString)) + return APPOINTMENTRESPONSE; + if ("AuditEvent".equals(codeString)) + return AUDITEVENT; + if ("Basic".equals(codeString)) + return BASIC; + if ("Binary".equals(codeString)) + return BINARY; + if ("BodySite".equals(codeString)) + return BODYSITE; + if ("Bundle".equals(codeString)) + return BUNDLE; + if ("CarePlan".equals(codeString)) + return CAREPLAN; + if ("CareTeam".equals(codeString)) + return CARETEAM; + if ("Claim".equals(codeString)) + return CLAIM; + if ("ClaimResponse".equals(codeString)) + return CLAIMRESPONSE; + if ("ClinicalImpression".equals(codeString)) + return CLINICALIMPRESSION; + if ("CodeSystem".equals(codeString)) + return CODESYSTEM; + if ("Communication".equals(codeString)) + return COMMUNICATION; + if ("CommunicationRequest".equals(codeString)) + return COMMUNICATIONREQUEST; + if ("CompartmentDefinition".equals(codeString)) + return COMPARTMENTDEFINITION; + if ("Composition".equals(codeString)) + return COMPOSITION; + if ("ConceptMap".equals(codeString)) + return CONCEPTMAP; + if ("Condition".equals(codeString)) + return CONDITION; + if ("Conformance".equals(codeString)) + return CONFORMANCE; + if ("Contract".equals(codeString)) + return CONTRACT; + if ("Coverage".equals(codeString)) + return COVERAGE; + if ("DataElement".equals(codeString)) + return DATAELEMENT; + if ("DecisionSupportRule".equals(codeString)) + return DECISIONSUPPORTRULE; + if ("DecisionSupportServiceModule".equals(codeString)) + return DECISIONSUPPORTSERVICEMODULE; + if ("DetectedIssue".equals(codeString)) + return DETECTEDISSUE; + if ("Device".equals(codeString)) + return DEVICE; + if ("DeviceComponent".equals(codeString)) + return DEVICECOMPONENT; + if ("DeviceMetric".equals(codeString)) + return DEVICEMETRIC; + if ("DeviceUseRequest".equals(codeString)) + return DEVICEUSEREQUEST; + if ("DeviceUseStatement".equals(codeString)) + return DEVICEUSESTATEMENT; + if ("DiagnosticOrder".equals(codeString)) + return DIAGNOSTICORDER; + if ("DiagnosticReport".equals(codeString)) + return DIAGNOSTICREPORT; + if ("DocumentManifest".equals(codeString)) + return DOCUMENTMANIFEST; + if ("DocumentReference".equals(codeString)) + return DOCUMENTREFERENCE; + if ("DomainResource".equals(codeString)) + return DOMAINRESOURCE; + if ("EligibilityRequest".equals(codeString)) + return ELIGIBILITYREQUEST; + if ("EligibilityResponse".equals(codeString)) + return ELIGIBILITYRESPONSE; + if ("Encounter".equals(codeString)) + return ENCOUNTER; + if ("EnrollmentRequest".equals(codeString)) + return ENROLLMENTREQUEST; + if ("EnrollmentResponse".equals(codeString)) + return ENROLLMENTRESPONSE; + if ("EpisodeOfCare".equals(codeString)) + return EPISODEOFCARE; + if ("ExpansionProfile".equals(codeString)) + return EXPANSIONPROFILE; + if ("ExplanationOfBenefit".equals(codeString)) + return EXPLANATIONOFBENEFIT; + if ("FamilyMemberHistory".equals(codeString)) + return FAMILYMEMBERHISTORY; + if ("Flag".equals(codeString)) + return FLAG; + if ("Goal".equals(codeString)) + return GOAL; + if ("Group".equals(codeString)) + return GROUP; + if ("GuidanceResponse".equals(codeString)) + return GUIDANCERESPONSE; + if ("HealthcareService".equals(codeString)) + return HEALTHCARESERVICE; + if ("ImagingExcerpt".equals(codeString)) + return IMAGINGEXCERPT; + if ("ImagingObjectSelection".equals(codeString)) + return IMAGINGOBJECTSELECTION; + if ("ImagingStudy".equals(codeString)) + return IMAGINGSTUDY; + if ("Immunization".equals(codeString)) + return IMMUNIZATION; + if ("ImmunizationRecommendation".equals(codeString)) + return IMMUNIZATIONRECOMMENDATION; + if ("ImplementationGuide".equals(codeString)) + return IMPLEMENTATIONGUIDE; + if ("Library".equals(codeString)) + return LIBRARY; + if ("Linkage".equals(codeString)) + return LINKAGE; + if ("List".equals(codeString)) + return LIST; + if ("Location".equals(codeString)) + return LOCATION; + if ("Measure".equals(codeString)) + return MEASURE; + if ("MeasureReport".equals(codeString)) + return MEASUREREPORT; + if ("Media".equals(codeString)) + return MEDIA; + if ("Medication".equals(codeString)) + return MEDICATION; + if ("MedicationAdministration".equals(codeString)) + return MEDICATIONADMINISTRATION; + if ("MedicationDispense".equals(codeString)) + return MEDICATIONDISPENSE; + if ("MedicationOrder".equals(codeString)) + return MEDICATIONORDER; + if ("MedicationStatement".equals(codeString)) + return MEDICATIONSTATEMENT; + if ("MessageHeader".equals(codeString)) + return MESSAGEHEADER; + if ("ModuleDefinition".equals(codeString)) + return MODULEDEFINITION; + if ("NamingSystem".equals(codeString)) + return NAMINGSYSTEM; + if ("NutritionOrder".equals(codeString)) + return NUTRITIONORDER; + if ("Observation".equals(codeString)) + return OBSERVATION; + if ("OperationDefinition".equals(codeString)) + return OPERATIONDEFINITION; + if ("OperationOutcome".equals(codeString)) + return OPERATIONOUTCOME; + if ("Order".equals(codeString)) + return ORDER; + if ("OrderResponse".equals(codeString)) + return ORDERRESPONSE; + if ("OrderSet".equals(codeString)) + return ORDERSET; + if ("Organization".equals(codeString)) + return ORGANIZATION; + if ("Parameters".equals(codeString)) + return PARAMETERS; + if ("Patient".equals(codeString)) + return PATIENT; + if ("PaymentNotice".equals(codeString)) + return PAYMENTNOTICE; + if ("PaymentReconciliation".equals(codeString)) + return PAYMENTRECONCILIATION; + if ("Person".equals(codeString)) + return PERSON; + if ("Practitioner".equals(codeString)) + return PRACTITIONER; + if ("PractitionerRole".equals(codeString)) + return PRACTITIONERROLE; + if ("Procedure".equals(codeString)) + return PROCEDURE; + if ("ProcedureRequest".equals(codeString)) + return PROCEDUREREQUEST; + if ("ProcessRequest".equals(codeString)) + return PROCESSREQUEST; + if ("ProcessResponse".equals(codeString)) + return PROCESSRESPONSE; + if ("Protocol".equals(codeString)) + return PROTOCOL; + if ("Provenance".equals(codeString)) + return PROVENANCE; + if ("Questionnaire".equals(codeString)) + return QUESTIONNAIRE; + if ("QuestionnaireResponse".equals(codeString)) + return QUESTIONNAIRERESPONSE; + if ("ReferralRequest".equals(codeString)) + return REFERRALREQUEST; + if ("RelatedPerson".equals(codeString)) + return RELATEDPERSON; + if ("Resource".equals(codeString)) + return RESOURCE; + if ("RiskAssessment".equals(codeString)) + return RISKASSESSMENT; + if ("Schedule".equals(codeString)) + return SCHEDULE; + if ("SearchParameter".equals(codeString)) + return SEARCHPARAMETER; + if ("Sequence".equals(codeString)) + return SEQUENCE; + if ("Slot".equals(codeString)) + return SLOT; + if ("Specimen".equals(codeString)) + return SPECIMEN; + if ("StructureDefinition".equals(codeString)) + return STRUCTUREDEFINITION; + if ("StructureMap".equals(codeString)) + return STRUCTUREMAP; + if ("Subscription".equals(codeString)) + return SUBSCRIPTION; + if ("Substance".equals(codeString)) + return SUBSTANCE; + if ("SupplyDelivery".equals(codeString)) + return SUPPLYDELIVERY; + if ("SupplyRequest".equals(codeString)) + return SUPPLYREQUEST; + if ("Task".equals(codeString)) + return TASK; + if ("TestScript".equals(codeString)) + return TESTSCRIPT; + if ("ValueSet".equals(codeString)) + return VALUESET; + if ("VisionPrescription".equals(codeString)) + return VISIONPRESCRIPTION; + if ("Type".equals(codeString)) + return TYPE; + if ("Any".equals(codeString)) + return ANY; + throw new FHIRException("Unknown FHIRAllTypes code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIONDEFINITION: return "ActionDefinition"; + case ADDRESS: return "Address"; + case AGE: return "Age"; + case ANNOTATION: return "Annotation"; + case ATTACHMENT: return "Attachment"; + case BACKBONEELEMENT: return "BackboneElement"; + case CODEABLECONCEPT: return "CodeableConcept"; + case CODING: return "Coding"; + case CONTACTPOINT: return "ContactPoint"; + case COUNT: return "Count"; + case DATAREQUIREMENT: return "DataRequirement"; + case DISTANCE: return "Distance"; + case DURATION: return "Duration"; + case ELEMENT: return "Element"; + case ELEMENTDEFINITION: return "ElementDefinition"; + case EXTENSION: return "Extension"; + case HUMANNAME: return "HumanName"; + case IDENTIFIER: return "Identifier"; + case META: return "Meta"; + case MODULEMETADATA: return "ModuleMetadata"; + case MONEY: return "Money"; + case NARRATIVE: return "Narrative"; + case PARAMETERDEFINITION: return "ParameterDefinition"; + case PERIOD: return "Period"; + case QUANTITY: return "Quantity"; + case RANGE: return "Range"; + case RATIO: return "Ratio"; + case REFERENCE: return "Reference"; + case SAMPLEDDATA: return "SampledData"; + case SIGNATURE: return "Signature"; + case SIMPLEQUANTITY: return "SimpleQuantity"; + case TIMING: return "Timing"; + case TRIGGERDEFINITION: return "TriggerDefinition"; + case BASE64BINARY: return "base64Binary"; + case BOOLEAN: return "boolean"; + case CODE: return "code"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case DECIMAL: return "decimal"; + case ID: return "id"; + case INSTANT: return "instant"; + case INTEGER: return "integer"; + case MARKDOWN: return "markdown"; + case OID: return "oid"; + case POSITIVEINT: return "positiveInt"; + case STRING: return "string"; + case TIME: return "time"; + case UNSIGNEDINT: return "unsignedInt"; + case URI: return "uri"; + case UUID: return "uuid"; + case XHTML: return "xhtml"; + case ACCOUNT: return "Account"; + case ALLERGYINTOLERANCE: return "AllergyIntolerance"; + case APPOINTMENT: return "Appointment"; + case APPOINTMENTRESPONSE: return "AppointmentResponse"; + case AUDITEVENT: return "AuditEvent"; + case BASIC: return "Basic"; + case BINARY: return "Binary"; + case BODYSITE: return "BodySite"; + case BUNDLE: return "Bundle"; + case CAREPLAN: return "CarePlan"; + case CARETEAM: return "CareTeam"; + case CLAIM: return "Claim"; + case CLAIMRESPONSE: return "ClaimResponse"; + case CLINICALIMPRESSION: return "ClinicalImpression"; + case CODESYSTEM: return "CodeSystem"; + case COMMUNICATION: return "Communication"; + case COMMUNICATIONREQUEST: return "CommunicationRequest"; + case COMPARTMENTDEFINITION: return "CompartmentDefinition"; + case COMPOSITION: return "Composition"; + case CONCEPTMAP: return "ConceptMap"; + case CONDITION: return "Condition"; + case CONFORMANCE: return "Conformance"; + case CONTRACT: return "Contract"; + case COVERAGE: return "Coverage"; + case DATAELEMENT: return "DataElement"; + case DECISIONSUPPORTRULE: return "DecisionSupportRule"; + case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; + case DETECTEDISSUE: return "DetectedIssue"; + case DEVICE: return "Device"; + case DEVICECOMPONENT: return "DeviceComponent"; + case DEVICEMETRIC: return "DeviceMetric"; + case DEVICEUSEREQUEST: return "DeviceUseRequest"; + case DEVICEUSESTATEMENT: return "DeviceUseStatement"; + case DIAGNOSTICORDER: return "DiagnosticOrder"; + case DIAGNOSTICREPORT: return "DiagnosticReport"; + case DOCUMENTMANIFEST: return "DocumentManifest"; + case DOCUMENTREFERENCE: return "DocumentReference"; + case DOMAINRESOURCE: return "DomainResource"; + case ELIGIBILITYREQUEST: return "EligibilityRequest"; + case ELIGIBILITYRESPONSE: return "EligibilityResponse"; + case ENCOUNTER: return "Encounter"; + case ENROLLMENTREQUEST: return "EnrollmentRequest"; + case ENROLLMENTRESPONSE: return "EnrollmentResponse"; + case EPISODEOFCARE: return "EpisodeOfCare"; + case EXPANSIONPROFILE: return "ExpansionProfile"; + case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; + case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; + case FLAG: return "Flag"; + case GOAL: return "Goal"; + case GROUP: return "Group"; + case GUIDANCERESPONSE: return "GuidanceResponse"; + case HEALTHCARESERVICE: return "HealthcareService"; + case IMAGINGEXCERPT: return "ImagingExcerpt"; + case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; + case IMAGINGSTUDY: return "ImagingStudy"; + case IMMUNIZATION: return "Immunization"; + case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; + case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; + case LIBRARY: return "Library"; + case LINKAGE: return "Linkage"; + case LIST: return "List"; + case LOCATION: return "Location"; + case MEASURE: return "Measure"; + case MEASUREREPORT: return "MeasureReport"; + case MEDIA: return "Media"; + case MEDICATION: return "Medication"; + case MEDICATIONADMINISTRATION: return "MedicationAdministration"; + case MEDICATIONDISPENSE: return "MedicationDispense"; + case MEDICATIONORDER: return "MedicationOrder"; + case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEHEADER: return "MessageHeader"; + case MODULEDEFINITION: return "ModuleDefinition"; + case NAMINGSYSTEM: return "NamingSystem"; + case NUTRITIONORDER: return "NutritionOrder"; + case OBSERVATION: return "Observation"; + case OPERATIONDEFINITION: return "OperationDefinition"; + case OPERATIONOUTCOME: return "OperationOutcome"; + case ORDER: return "Order"; + case ORDERRESPONSE: return "OrderResponse"; + case ORDERSET: return "OrderSet"; + case ORGANIZATION: return "Organization"; + case PARAMETERS: return "Parameters"; + case PATIENT: return "Patient"; + case PAYMENTNOTICE: return "PaymentNotice"; + case PAYMENTRECONCILIATION: return "PaymentReconciliation"; + case PERSON: return "Person"; + case PRACTITIONER: return "Practitioner"; + case PRACTITIONERROLE: return "PractitionerRole"; + case PROCEDURE: return "Procedure"; + case PROCEDUREREQUEST: return "ProcedureRequest"; + case PROCESSREQUEST: return "ProcessRequest"; + case PROCESSRESPONSE: return "ProcessResponse"; + case PROTOCOL: return "Protocol"; + case PROVENANCE: return "Provenance"; + case QUESTIONNAIRE: return "Questionnaire"; + case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; + case REFERRALREQUEST: return "ReferralRequest"; + case RELATEDPERSON: return "RelatedPerson"; + case RESOURCE: return "Resource"; + case RISKASSESSMENT: return "RiskAssessment"; + case SCHEDULE: return "Schedule"; + case SEARCHPARAMETER: return "SearchParameter"; + case SEQUENCE: return "Sequence"; + case SLOT: return "Slot"; + case SPECIMEN: return "Specimen"; + case STRUCTUREDEFINITION: return "StructureDefinition"; + case STRUCTUREMAP: return "StructureMap"; + case SUBSCRIPTION: return "Subscription"; + case SUBSTANCE: return "Substance"; + case SUPPLYDELIVERY: return "SupplyDelivery"; + case SUPPLYREQUEST: return "SupplyRequest"; + case TASK: return "Task"; + case TESTSCRIPT: return "TestScript"; + case VALUESET: return "ValueSet"; + case VISIONPRESCRIPTION: return "VisionPrescription"; + case TYPE: return "Type"; + case ANY: return "Any"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIONDEFINITION: return "http://hl7.org/fhir/data-types"; + case ADDRESS: return "http://hl7.org/fhir/data-types"; + case AGE: return "http://hl7.org/fhir/data-types"; + case ANNOTATION: return "http://hl7.org/fhir/data-types"; + case ATTACHMENT: return "http://hl7.org/fhir/data-types"; + case BACKBONEELEMENT: return "http://hl7.org/fhir/data-types"; + case CODEABLECONCEPT: return "http://hl7.org/fhir/data-types"; + case CODING: return "http://hl7.org/fhir/data-types"; + case CONTACTPOINT: return "http://hl7.org/fhir/data-types"; + case COUNT: return "http://hl7.org/fhir/data-types"; + case DATAREQUIREMENT: return "http://hl7.org/fhir/data-types"; + case DISTANCE: return "http://hl7.org/fhir/data-types"; + case DURATION: return "http://hl7.org/fhir/data-types"; + case ELEMENT: return "http://hl7.org/fhir/data-types"; + case ELEMENTDEFINITION: return "http://hl7.org/fhir/data-types"; + case EXTENSION: return "http://hl7.org/fhir/data-types"; + case HUMANNAME: return "http://hl7.org/fhir/data-types"; + case IDENTIFIER: return "http://hl7.org/fhir/data-types"; + case META: return "http://hl7.org/fhir/data-types"; + case MODULEMETADATA: return "http://hl7.org/fhir/data-types"; + case MONEY: return "http://hl7.org/fhir/data-types"; + case NARRATIVE: return "http://hl7.org/fhir/data-types"; + case PARAMETERDEFINITION: return "http://hl7.org/fhir/data-types"; + case PERIOD: return "http://hl7.org/fhir/data-types"; + case QUANTITY: return "http://hl7.org/fhir/data-types"; + case RANGE: return "http://hl7.org/fhir/data-types"; + case RATIO: return "http://hl7.org/fhir/data-types"; + case REFERENCE: return "http://hl7.org/fhir/data-types"; + case SAMPLEDDATA: return "http://hl7.org/fhir/data-types"; + case SIGNATURE: return "http://hl7.org/fhir/data-types"; + case SIMPLEQUANTITY: return "http://hl7.org/fhir/data-types"; + case TIMING: return "http://hl7.org/fhir/data-types"; + case TRIGGERDEFINITION: return "http://hl7.org/fhir/data-types"; + case BASE64BINARY: return "http://hl7.org/fhir/data-types"; + case BOOLEAN: return "http://hl7.org/fhir/data-types"; + case CODE: return "http://hl7.org/fhir/data-types"; + case DATE: return "http://hl7.org/fhir/data-types"; + case DATETIME: return "http://hl7.org/fhir/data-types"; + case DECIMAL: return "http://hl7.org/fhir/data-types"; + case ID: return "http://hl7.org/fhir/data-types"; + case INSTANT: return "http://hl7.org/fhir/data-types"; + case INTEGER: return "http://hl7.org/fhir/data-types"; + case MARKDOWN: return "http://hl7.org/fhir/data-types"; + case OID: return "http://hl7.org/fhir/data-types"; + case POSITIVEINT: return "http://hl7.org/fhir/data-types"; + case STRING: return "http://hl7.org/fhir/data-types"; + case TIME: return "http://hl7.org/fhir/data-types"; + case UNSIGNEDINT: return "http://hl7.org/fhir/data-types"; + case URI: return "http://hl7.org/fhir/data-types"; + case UUID: return "http://hl7.org/fhir/data-types"; + case XHTML: return "http://hl7.org/fhir/data-types"; + case ACCOUNT: return "http://hl7.org/fhir/resource-types"; + case ALLERGYINTOLERANCE: return "http://hl7.org/fhir/resource-types"; + case APPOINTMENT: return "http://hl7.org/fhir/resource-types"; + case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; + case AUDITEVENT: return "http://hl7.org/fhir/resource-types"; + case BASIC: return "http://hl7.org/fhir/resource-types"; + case BINARY: return "http://hl7.org/fhir/resource-types"; + case BODYSITE: return "http://hl7.org/fhir/resource-types"; + case BUNDLE: return "http://hl7.org/fhir/resource-types"; + case CAREPLAN: return "http://hl7.org/fhir/resource-types"; + case CARETEAM: return "http://hl7.org/fhir/resource-types"; + case CLAIM: return "http://hl7.org/fhir/resource-types"; + case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types"; + case CLINICALIMPRESSION: return "http://hl7.org/fhir/resource-types"; + case CODESYSTEM: return "http://hl7.org/fhir/resource-types"; + case COMMUNICATION: return "http://hl7.org/fhir/resource-types"; + case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; + case COMPARTMENTDEFINITION: return "http://hl7.org/fhir/resource-types"; + case COMPOSITION: return "http://hl7.org/fhir/resource-types"; + case CONCEPTMAP: return "http://hl7.org/fhir/resource-types"; + case CONDITION: return "http://hl7.org/fhir/resource-types"; + case CONFORMANCE: return "http://hl7.org/fhir/resource-types"; + case CONTRACT: return "http://hl7.org/fhir/resource-types"; + case COVERAGE: return "http://hl7.org/fhir/resource-types"; + case DATAELEMENT: return "http://hl7.org/fhir/resource-types"; + case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/resource-types"; + case DECISIONSUPPORTSERVICEMODULE: return "http://hl7.org/fhir/resource-types"; + case DETECTEDISSUE: return "http://hl7.org/fhir/resource-types"; + case DEVICE: return "http://hl7.org/fhir/resource-types"; + case DEVICECOMPONENT: return "http://hl7.org/fhir/resource-types"; + case DEVICEMETRIC: return "http://hl7.org/fhir/resource-types"; + case DEVICEUSEREQUEST: return "http://hl7.org/fhir/resource-types"; + case DEVICEUSESTATEMENT: return "http://hl7.org/fhir/resource-types"; + case DIAGNOSTICORDER: return "http://hl7.org/fhir/resource-types"; + case DIAGNOSTICREPORT: return "http://hl7.org/fhir/resource-types"; + case DOCUMENTMANIFEST: return "http://hl7.org/fhir/resource-types"; + case DOCUMENTREFERENCE: return "http://hl7.org/fhir/resource-types"; + case DOMAINRESOURCE: return "http://hl7.org/fhir/resource-types"; + case ELIGIBILITYREQUEST: return "http://hl7.org/fhir/resource-types"; + case ELIGIBILITYRESPONSE: return "http://hl7.org/fhir/resource-types"; + case ENCOUNTER: return "http://hl7.org/fhir/resource-types"; + case ENROLLMENTREQUEST: return "http://hl7.org/fhir/resource-types"; + case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; + case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types"; + case EXPANSIONPROFILE: return "http://hl7.org/fhir/resource-types"; + case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types"; + case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types"; + case FLAG: return "http://hl7.org/fhir/resource-types"; + case GOAL: return "http://hl7.org/fhir/resource-types"; + case GROUP: return "http://hl7.org/fhir/resource-types"; + case GUIDANCERESPONSE: return "http://hl7.org/fhir/resource-types"; + case HEALTHCARESERVICE: return "http://hl7.org/fhir/resource-types"; + case IMAGINGEXCERPT: return "http://hl7.org/fhir/resource-types"; + case IMAGINGOBJECTSELECTION: return "http://hl7.org/fhir/resource-types"; + case IMAGINGSTUDY: return "http://hl7.org/fhir/resource-types"; + case IMMUNIZATION: return "http://hl7.org/fhir/resource-types"; + case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/resource-types"; + case IMPLEMENTATIONGUIDE: return "http://hl7.org/fhir/resource-types"; + case LIBRARY: return "http://hl7.org/fhir/resource-types"; + case LINKAGE: return "http://hl7.org/fhir/resource-types"; + case LIST: return "http://hl7.org/fhir/resource-types"; + case LOCATION: return "http://hl7.org/fhir/resource-types"; + case MEASURE: return "http://hl7.org/fhir/resource-types"; + case MEASUREREPORT: return "http://hl7.org/fhir/resource-types"; + case MEDIA: return "http://hl7.org/fhir/resource-types"; + case MEDICATION: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONADMINISTRATION: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONORDER: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; + case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; + case MODULEDEFINITION: return "http://hl7.org/fhir/resource-types"; + case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; + case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types"; + case OBSERVATION: return "http://hl7.org/fhir/resource-types"; + case OPERATIONDEFINITION: return "http://hl7.org/fhir/resource-types"; + case OPERATIONOUTCOME: return "http://hl7.org/fhir/resource-types"; + case ORDER: return "http://hl7.org/fhir/resource-types"; + case ORDERRESPONSE: return "http://hl7.org/fhir/resource-types"; + case ORDERSET: return "http://hl7.org/fhir/resource-types"; + case ORGANIZATION: return "http://hl7.org/fhir/resource-types"; + case PARAMETERS: return "http://hl7.org/fhir/resource-types"; + case PATIENT: return "http://hl7.org/fhir/resource-types"; + case PAYMENTNOTICE: return "http://hl7.org/fhir/resource-types"; + case PAYMENTRECONCILIATION: return "http://hl7.org/fhir/resource-types"; + case PERSON: return "http://hl7.org/fhir/resource-types"; + case PRACTITIONER: return "http://hl7.org/fhir/resource-types"; + case PRACTITIONERROLE: return "http://hl7.org/fhir/resource-types"; + case PROCEDURE: return "http://hl7.org/fhir/resource-types"; + case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types"; + case PROCESSREQUEST: return "http://hl7.org/fhir/resource-types"; + case PROCESSRESPONSE: return "http://hl7.org/fhir/resource-types"; + case PROTOCOL: return "http://hl7.org/fhir/resource-types"; + case PROVENANCE: return "http://hl7.org/fhir/resource-types"; + case QUESTIONNAIRE: return "http://hl7.org/fhir/resource-types"; + case QUESTIONNAIRERESPONSE: return "http://hl7.org/fhir/resource-types"; + case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; + case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; + case RESOURCE: return "http://hl7.org/fhir/resource-types"; + case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; + case SCHEDULE: return "http://hl7.org/fhir/resource-types"; + case SEARCHPARAMETER: return "http://hl7.org/fhir/resource-types"; + case SEQUENCE: return "http://hl7.org/fhir/resource-types"; + case SLOT: return "http://hl7.org/fhir/resource-types"; + case SPECIMEN: return "http://hl7.org/fhir/resource-types"; + case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types"; + case STRUCTUREMAP: return "http://hl7.org/fhir/resource-types"; + case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types"; + case SUBSTANCE: return "http://hl7.org/fhir/resource-types"; + case SUPPLYDELIVERY: return "http://hl7.org/fhir/resource-types"; + case SUPPLYREQUEST: return "http://hl7.org/fhir/resource-types"; + case TASK: return "http://hl7.org/fhir/resource-types"; + case TESTSCRIPT: return "http://hl7.org/fhir/resource-types"; + case VALUESET: return "http://hl7.org/fhir/resource-types"; + case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types"; + case TYPE: return "http://hl7.org/fhir/abstract-types"; + case ANY: return "http://hl7.org/fhir/abstract-types"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIONDEFINITION: return "The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library."; + case ADDRESS: return "An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world."; + case AGE: return ""; + case ANNOTATION: return "A text note which also contains information about who made the statement and when."; + case ATTACHMENT: return "For referring to data content defined in other formats."; + case BACKBONEELEMENT: return "Base definition for all elements that are defined inside a resource - but not those in a data type."; + case CODEABLECONCEPT: return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text."; + case CODING: return "A reference to a code defined by a terminology system."; + case CONTACTPOINT: return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc."; + case COUNT: return ""; + case DATAREQUIREMENT: return "Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data."; + case DISTANCE: return ""; + case DURATION: return ""; + case ELEMENT: return "Base definition for all elements in a resource."; + case ELEMENTDEFINITION: return "Captures constraints on each element within the resource, profile, or extension."; + case EXTENSION: return "Optional Extensions Element - found in all resources."; + case HUMANNAME: return "A human's name with the ability to identify parts and usage."; + case IDENTIFIER: return "A technical identifier - identifies some entity uniquely and unambiguously."; + case META: return "The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource."; + case MODULEMETADATA: return "The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information."; + case MONEY: return ""; + case NARRATIVE: return "A human-readable formatted text, including images."; + case PARAMETERDEFINITION: return "The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse."; + case PERIOD: return "A time period defined by a start and end date and optionally time."; + case QUANTITY: return "A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies."; + case RANGE: return "A set of ordered Quantities defined by a low and high limit."; + case RATIO: return "A relationship of two Quantity values - expressed as a numerator and a denominator."; + case REFERENCE: return "A reference from one resource to another."; + case SAMPLEDDATA: return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data."; + case SIGNATURE: return "A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities."; + case SIMPLEQUANTITY: return ""; + case TIMING: return "Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds."; + case TRIGGERDEFINITION: return "A description of a triggering event."; + case BASE64BINARY: return "A stream of bytes"; + case BOOLEAN: return "Value of \"true\" or \"false\""; + case CODE: return "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents"; + case DATE: return "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates."; + case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates."; + case DECIMAL: return "A rational number with implicit precision"; + case ID: return "Any combination of letters, numerals, \"-\" and \".\", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive."; + case INSTANT: return "An instant in time - known at least to the second"; + case INTEGER: return "A whole number"; + case MARKDOWN: return "A string that may contain markdown syntax for optional processing by a mark down presentation engine"; + case OID: return "An oid represented as a URI"; + case POSITIVEINT: return "An integer with a value that is positive (e.g. >0)"; + case STRING: return "A sequence of Unicode characters"; + case TIME: return "A time during the day, with no date specified"; + case UNSIGNEDINT: return "An integer with a value that is not negative (e.g. >= 0)"; + case URI: return "String of characters used to identify a name or a resource"; + case UUID: return "A UUID, represented as a URI"; + case XHTML: return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)"; + case ACCOUNT: return "A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc."; + case ALLERGYINTOLERANCE: return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance."; + case APPOINTMENT: return "A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s)."; + case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection."; + case AUDITEVENT: return "A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage."; + case BASIC: return "Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification."; + case BINARY: return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc."; + case BODYSITE: return "Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case."; + case BUNDLE: return "A container for a collection of resources."; + case CAREPLAN: return "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions."; + case CARETEAM: return "The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient."; + case CLAIM: return "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."; + case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource."; + case CLINICALIMPRESSION: return "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. This resource is called \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion with the recording of assessment tools such as Apgar score."; + case CODESYSTEM: return "A code system resource specifies a set of codes drawn from one or more code systems."; + case COMMUNICATION: return "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."; + case COMMUNICATIONREQUEST: return "A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition."; + case COMPARTMENTDEFINITION: return "A compartment definition that defines how resources are accessed on a server."; + case COMPOSITION: return "A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained."; + case CONCEPTMAP: return "A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models."; + case CONDITION: return "Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary."; + case CONFORMANCE: return "A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation."; + case CONTRACT: return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters."; + case COVERAGE: return "Financial instrument which may be used to pay for or reimburse health care products and services."; + case DATAELEMENT: return "The formal description of a single piece of information that can be gathered and reported."; + case DECISIONSUPPORTRULE: return "This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events."; + case DECISIONSUPPORTSERVICEMODULE: return "The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking."; + case DETECTEDISSUE: return "Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc."; + case DEVICE: return "This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc."; + case DEVICECOMPONENT: return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device."; + case DEVICEMETRIC: return "Describes a measurement, calculation or setting capability of a medical device."; + case DEVICEUSEREQUEST: return "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker."; + case DEVICEUSESTATEMENT: return "A record of a device being used by a patient where the record is the result of a report from the patient or another clinician."; + case DIAGNOSTICORDER: return "A record of a request for a diagnostic investigation service to be performed."; + case DIAGNOSTICREPORT: return "The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports."; + case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; + case DOCUMENTREFERENCE: return "A reference to a document ."; + case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; + case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; + case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; + case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."; + case ENROLLMENTREQUEST: return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage."; + case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource."; + case EPISODEOFCARE: return "An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time."; + case EXPANSIONPROFILE: return "Resource to define constraints on the Expansion of a FHIR ValueSet."; + case EXPLANATIONOFBENEFIT: return "This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided."; + case FAMILYMEMBERHISTORY: return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient."; + case FLAG: return "Prospective warnings of potential issues when providing care to the patient."; + case GOAL: return "Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc."; + case GROUP: return "Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization."; + case GUIDANCERESPONSE: return "A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken."; + case HEALTHCARESERVICE: return "The details of a healthcare service available at a location."; + case IMAGINGEXCERPT: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; + case IMAGINGOBJECTSELECTION: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; + case IMAGINGSTUDY: return "Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities."; + case IMMUNIZATION: return "Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed."; + case IMMUNIZATIONRECOMMENDATION: return "A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification."; + case IMPLEMENTATIONGUIDE: return "A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts."; + case LIBRARY: return "The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library."; + case LINKAGE: return "Identifies two or more records (resource instances) that are referring to the same real-world \"occurrence\"."; + case LIST: return "A set of information summarized from a list of other resources."; + case LOCATION: return "Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated."; + case MEASURE: return "The Measure resource provides the definition of a quality measure."; + case MEASUREREPORT: return "The MeasureReport resource contains the results of evaluating a measure."; + case MEDIA: return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference."; + case MEDICATION: return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication."; + case MEDICATIONADMINISTRATION: return "Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner."; + case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; + case MEDICATIONORDER: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationOrder\" rather than \"MedicationPrescription\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc."; + case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; + case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle."; + case MODULEDEFINITION: return "The ModuleDefinition resource defines the data requirements for a quality artifact."; + case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; + case NUTRITIONORDER: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; + case OBSERVATION: return "Measurements and simple assertions made about a patient, device or other subject."; + case OPERATIONDEFINITION: return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction)."; + case OPERATIONOUTCOME: return "A collection of error, warning or information messages that result from a system action."; + case ORDER: return "A request to perform an action."; + case ORDERRESPONSE: return "A response to an order."; + case ORDERSET: return "This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support."; + case ORGANIZATION: return "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."; + case PARAMETERS: return "This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it."; + case PATIENT: return "Demographics and other administrative information about an individual or animal receiving care or other health-related services."; + case PAYMENTNOTICE: return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references."; + case PAYMENTRECONCILIATION: return "This resource provides payment details and claim references supporting a bulk payment."; + case PERSON: return "Demographics and administrative information about a person independent of a specific health-related context."; + case PRACTITIONER: return "A person who is directly or indirectly involved in the provisioning of healthcare."; + case PRACTITIONERROLE: return "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time."; + case PROCEDURE: return "An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy."; + case PROCEDUREREQUEST: return "A request for a procedure to be performed. May be a proposal or an order."; + case PROCESSREQUEST: return "This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources."; + case PROCESSRESPONSE: return "This resource provides processing status, errors and notes from the processing of a resource."; + case PROTOCOL: return "A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points."; + case PROVENANCE: return "Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies."; + case QUESTIONNAIRE: return "A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; + case QUESTIONNAIRERESPONSE: return "A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; + case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; + case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process."; + case RESOURCE: return "This is the base resource type for everything."; + case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; + case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; + case SEARCHPARAMETER: return "A search parameter that defines a named search item that can be used to search/filter on a resource."; + case SEQUENCE: return "Variation and Sequence data."; + case SLOT: return "A slot of time on a schedule that may be available for booking appointments."; + case SPECIMEN: return "A sample to be used for analysis."; + case STRUCTUREDEFINITION: return "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types."; + case STRUCTUREMAP: return "A Map of relationships between 2 structures that can be used to transform data."; + case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action."; + case SUBSTANCE: return "A homogeneous material with a definite composition."; + case SUPPLYDELIVERY: return "Record of delivery of what is supplied."; + case SUPPLYREQUEST: return "A record of a request for a medication, substance or device used in the healthcare setting."; + case TASK: return "A task to be performed."; + case TESTSCRIPT: return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification."; + case VALUESET: return "A value set specifies a set of codes drawn from one or more code systems."; + case VISIONPRESCRIPTION: return "An authorization for the supply of glasses and/or contact lenses to a patient."; + case TYPE: return "A place holder that means any kind of data type"; + case ANY: return "A place holder that means any kind of resource"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIONDEFINITION: return "ActionDefinition"; + case ADDRESS: return "Address"; + case AGE: return "Age"; + case ANNOTATION: return "Annotation"; + case ATTACHMENT: return "Attachment"; + case BACKBONEELEMENT: return "BackboneElement"; + case CODEABLECONCEPT: return "CodeableConcept"; + case CODING: return "Coding"; + case CONTACTPOINT: return "ContactPoint"; + case COUNT: return "Count"; + case DATAREQUIREMENT: return "DataRequirement"; + case DISTANCE: return "Distance"; + case DURATION: return "Duration"; + case ELEMENT: return "Element"; + case ELEMENTDEFINITION: return "ElementDefinition"; + case EXTENSION: return "Extension"; + case HUMANNAME: return "HumanName"; + case IDENTIFIER: return "Identifier"; + case META: return "Meta"; + case MODULEMETADATA: return "ModuleMetadata"; + case MONEY: return "Money"; + case NARRATIVE: return "Narrative"; + case PARAMETERDEFINITION: return "ParameterDefinition"; + case PERIOD: return "Period"; + case QUANTITY: return "Quantity"; + case RANGE: return "Range"; + case RATIO: return "Ratio"; + case REFERENCE: return "Reference"; + case SAMPLEDDATA: return "SampledData"; + case SIGNATURE: return "Signature"; + case SIMPLEQUANTITY: return "SimpleQuantity"; + case TIMING: return "Timing"; + case TRIGGERDEFINITION: return "TriggerDefinition"; + case BASE64BINARY: return "base64Binary"; + case BOOLEAN: return "boolean"; + case CODE: return "code"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case DECIMAL: return "decimal"; + case ID: return "id"; + case INSTANT: return "instant"; + case INTEGER: return "integer"; + case MARKDOWN: return "markdown"; + case OID: return "oid"; + case POSITIVEINT: return "positiveInt"; + case STRING: return "string"; + case TIME: return "time"; + case UNSIGNEDINT: return "unsignedInt"; + case URI: return "uri"; + case UUID: return "uuid"; + case XHTML: return "XHTML"; + case ACCOUNT: return "Account"; + case ALLERGYINTOLERANCE: return "AllergyIntolerance"; + case APPOINTMENT: return "Appointment"; + case APPOINTMENTRESPONSE: return "AppointmentResponse"; + case AUDITEVENT: return "AuditEvent"; + case BASIC: return "Basic"; + case BINARY: return "Binary"; + case BODYSITE: return "BodySite"; + case BUNDLE: return "Bundle"; + case CAREPLAN: return "CarePlan"; + case CARETEAM: return "CareTeam"; + case CLAIM: return "Claim"; + case CLAIMRESPONSE: return "ClaimResponse"; + case CLINICALIMPRESSION: return "ClinicalImpression"; + case CODESYSTEM: return "CodeSystem"; + case COMMUNICATION: return "Communication"; + case COMMUNICATIONREQUEST: return "CommunicationRequest"; + case COMPARTMENTDEFINITION: return "CompartmentDefinition"; + case COMPOSITION: return "Composition"; + case CONCEPTMAP: return "ConceptMap"; + case CONDITION: return "Condition"; + case CONFORMANCE: return "Conformance"; + case CONTRACT: return "Contract"; + case COVERAGE: return "Coverage"; + case DATAELEMENT: return "DataElement"; + case DECISIONSUPPORTRULE: return "DecisionSupportRule"; + case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; + case DETECTEDISSUE: return "DetectedIssue"; + case DEVICE: return "Device"; + case DEVICECOMPONENT: return "DeviceComponent"; + case DEVICEMETRIC: return "DeviceMetric"; + case DEVICEUSEREQUEST: return "DeviceUseRequest"; + case DEVICEUSESTATEMENT: return "DeviceUseStatement"; + case DIAGNOSTICORDER: return "DiagnosticOrder"; + case DIAGNOSTICREPORT: return "DiagnosticReport"; + case DOCUMENTMANIFEST: return "DocumentManifest"; + case DOCUMENTREFERENCE: return "DocumentReference"; + case DOMAINRESOURCE: return "DomainResource"; + case ELIGIBILITYREQUEST: return "EligibilityRequest"; + case ELIGIBILITYRESPONSE: return "EligibilityResponse"; + case ENCOUNTER: return "Encounter"; + case ENROLLMENTREQUEST: return "EnrollmentRequest"; + case ENROLLMENTRESPONSE: return "EnrollmentResponse"; + case EPISODEOFCARE: return "EpisodeOfCare"; + case EXPANSIONPROFILE: return "ExpansionProfile"; + case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; + case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; + case FLAG: return "Flag"; + case GOAL: return "Goal"; + case GROUP: return "Group"; + case GUIDANCERESPONSE: return "GuidanceResponse"; + case HEALTHCARESERVICE: return "HealthcareService"; + case IMAGINGEXCERPT: return "ImagingExcerpt"; + case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; + case IMAGINGSTUDY: return "ImagingStudy"; + case IMMUNIZATION: return "Immunization"; + case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; + case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; + case LIBRARY: return "Library"; + case LINKAGE: return "Linkage"; + case LIST: return "List"; + case LOCATION: return "Location"; + case MEASURE: return "Measure"; + case MEASUREREPORT: return "MeasureReport"; + case MEDIA: return "Media"; + case MEDICATION: return "Medication"; + case MEDICATIONADMINISTRATION: return "MedicationAdministration"; + case MEDICATIONDISPENSE: return "MedicationDispense"; + case MEDICATIONORDER: return "MedicationOrder"; + case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEHEADER: return "MessageHeader"; + case MODULEDEFINITION: return "ModuleDefinition"; + case NAMINGSYSTEM: return "NamingSystem"; + case NUTRITIONORDER: return "NutritionOrder"; + case OBSERVATION: return "Observation"; + case OPERATIONDEFINITION: return "OperationDefinition"; + case OPERATIONOUTCOME: return "OperationOutcome"; + case ORDER: return "Order"; + case ORDERRESPONSE: return "OrderResponse"; + case ORDERSET: return "OrderSet"; + case ORGANIZATION: return "Organization"; + case PARAMETERS: return "Parameters"; + case PATIENT: return "Patient"; + case PAYMENTNOTICE: return "PaymentNotice"; + case PAYMENTRECONCILIATION: return "PaymentReconciliation"; + case PERSON: return "Person"; + case PRACTITIONER: return "Practitioner"; + case PRACTITIONERROLE: return "PractitionerRole"; + case PROCEDURE: return "Procedure"; + case PROCEDUREREQUEST: return "ProcedureRequest"; + case PROCESSREQUEST: return "ProcessRequest"; + case PROCESSRESPONSE: return "ProcessResponse"; + case PROTOCOL: return "Protocol"; + case PROVENANCE: return "Provenance"; + case QUESTIONNAIRE: return "Questionnaire"; + case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; + case REFERRALREQUEST: return "ReferralRequest"; + case RELATEDPERSON: return "RelatedPerson"; + case RESOURCE: return "Resource"; + case RISKASSESSMENT: return "RiskAssessment"; + case SCHEDULE: return "Schedule"; + case SEARCHPARAMETER: return "SearchParameter"; + case SEQUENCE: return "Sequence"; + case SLOT: return "Slot"; + case SPECIMEN: return "Specimen"; + case STRUCTUREDEFINITION: return "StructureDefinition"; + case STRUCTUREMAP: return "StructureMap"; + case SUBSCRIPTION: return "Subscription"; + case SUBSTANCE: return "Substance"; + case SUPPLYDELIVERY: return "SupplyDelivery"; + case SUPPLYREQUEST: return "SupplyRequest"; + case TASK: return "Task"; + case TESTSCRIPT: return "TestScript"; + case VALUESET: return "ValueSet"; + case VISIONPRESCRIPTION: return "VisionPrescription"; + case TYPE: return "Type"; + case ANY: return "Any"; + default: return "?"; + } + } + } + + public static class FHIRAllTypesEnumFactory implements EnumFactory { + public FHIRAllTypes fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return FHIRAllTypes.ACTIONDEFINITION; + if ("Address".equals(codeString)) + return FHIRAllTypes.ADDRESS; + if ("Age".equals(codeString)) + return FHIRAllTypes.AGE; + if ("Annotation".equals(codeString)) + return FHIRAllTypes.ANNOTATION; + if ("Attachment".equals(codeString)) + return FHIRAllTypes.ATTACHMENT; + if ("BackboneElement".equals(codeString)) + return FHIRAllTypes.BACKBONEELEMENT; + if ("CodeableConcept".equals(codeString)) + return FHIRAllTypes.CODEABLECONCEPT; + if ("Coding".equals(codeString)) + return FHIRAllTypes.CODING; + if ("ContactPoint".equals(codeString)) + return FHIRAllTypes.CONTACTPOINT; + if ("Count".equals(codeString)) + return FHIRAllTypes.COUNT; + if ("DataRequirement".equals(codeString)) + return FHIRAllTypes.DATAREQUIREMENT; + if ("Distance".equals(codeString)) + return FHIRAllTypes.DISTANCE; + if ("Duration".equals(codeString)) + return FHIRAllTypes.DURATION; + if ("Element".equals(codeString)) + return FHIRAllTypes.ELEMENT; + if ("ElementDefinition".equals(codeString)) + return FHIRAllTypes.ELEMENTDEFINITION; + if ("Extension".equals(codeString)) + return FHIRAllTypes.EXTENSION; + if ("HumanName".equals(codeString)) + return FHIRAllTypes.HUMANNAME; + if ("Identifier".equals(codeString)) + return FHIRAllTypes.IDENTIFIER; + if ("Meta".equals(codeString)) + return FHIRAllTypes.META; + if ("ModuleMetadata".equals(codeString)) + return FHIRAllTypes.MODULEMETADATA; + if ("Money".equals(codeString)) + return FHIRAllTypes.MONEY; + if ("Narrative".equals(codeString)) + return FHIRAllTypes.NARRATIVE; + if ("ParameterDefinition".equals(codeString)) + return FHIRAllTypes.PARAMETERDEFINITION; + if ("Period".equals(codeString)) + return FHIRAllTypes.PERIOD; + if ("Quantity".equals(codeString)) + return FHIRAllTypes.QUANTITY; + if ("Range".equals(codeString)) + return FHIRAllTypes.RANGE; + if ("Ratio".equals(codeString)) + return FHIRAllTypes.RATIO; + if ("Reference".equals(codeString)) + return FHIRAllTypes.REFERENCE; + if ("SampledData".equals(codeString)) + return FHIRAllTypes.SAMPLEDDATA; + if ("Signature".equals(codeString)) + return FHIRAllTypes.SIGNATURE; + if ("SimpleQuantity".equals(codeString)) + return FHIRAllTypes.SIMPLEQUANTITY; + if ("Timing".equals(codeString)) + return FHIRAllTypes.TIMING; + if ("TriggerDefinition".equals(codeString)) + return FHIRAllTypes.TRIGGERDEFINITION; + if ("base64Binary".equals(codeString)) + return FHIRAllTypes.BASE64BINARY; + if ("boolean".equals(codeString)) + return FHIRAllTypes.BOOLEAN; + if ("code".equals(codeString)) + return FHIRAllTypes.CODE; + if ("date".equals(codeString)) + return FHIRAllTypes.DATE; + if ("dateTime".equals(codeString)) + return FHIRAllTypes.DATETIME; + if ("decimal".equals(codeString)) + return FHIRAllTypes.DECIMAL; + if ("id".equals(codeString)) + return FHIRAllTypes.ID; + if ("instant".equals(codeString)) + return FHIRAllTypes.INSTANT; + if ("integer".equals(codeString)) + return FHIRAllTypes.INTEGER; + if ("markdown".equals(codeString)) + return FHIRAllTypes.MARKDOWN; + if ("oid".equals(codeString)) + return FHIRAllTypes.OID; + if ("positiveInt".equals(codeString)) + return FHIRAllTypes.POSITIVEINT; + if ("string".equals(codeString)) + return FHIRAllTypes.STRING; + if ("time".equals(codeString)) + return FHIRAllTypes.TIME; + if ("unsignedInt".equals(codeString)) + return FHIRAllTypes.UNSIGNEDINT; + if ("uri".equals(codeString)) + return FHIRAllTypes.URI; + if ("uuid".equals(codeString)) + return FHIRAllTypes.UUID; + if ("xhtml".equals(codeString)) + return FHIRAllTypes.XHTML; + if ("Account".equals(codeString)) + return FHIRAllTypes.ACCOUNT; + if ("AllergyIntolerance".equals(codeString)) + return FHIRAllTypes.ALLERGYINTOLERANCE; + if ("Appointment".equals(codeString)) + return FHIRAllTypes.APPOINTMENT; + if ("AppointmentResponse".equals(codeString)) + return FHIRAllTypes.APPOINTMENTRESPONSE; + if ("AuditEvent".equals(codeString)) + return FHIRAllTypes.AUDITEVENT; + if ("Basic".equals(codeString)) + return FHIRAllTypes.BASIC; + if ("Binary".equals(codeString)) + return FHIRAllTypes.BINARY; + if ("BodySite".equals(codeString)) + return FHIRAllTypes.BODYSITE; + if ("Bundle".equals(codeString)) + return FHIRAllTypes.BUNDLE; + if ("CarePlan".equals(codeString)) + return FHIRAllTypes.CAREPLAN; + if ("CareTeam".equals(codeString)) + return FHIRAllTypes.CARETEAM; + if ("Claim".equals(codeString)) + return FHIRAllTypes.CLAIM; + if ("ClaimResponse".equals(codeString)) + return FHIRAllTypes.CLAIMRESPONSE; + if ("ClinicalImpression".equals(codeString)) + return FHIRAllTypes.CLINICALIMPRESSION; + if ("CodeSystem".equals(codeString)) + return FHIRAllTypes.CODESYSTEM; + if ("Communication".equals(codeString)) + return FHIRAllTypes.COMMUNICATION; + if ("CommunicationRequest".equals(codeString)) + return FHIRAllTypes.COMMUNICATIONREQUEST; + if ("CompartmentDefinition".equals(codeString)) + return FHIRAllTypes.COMPARTMENTDEFINITION; + if ("Composition".equals(codeString)) + return FHIRAllTypes.COMPOSITION; + if ("ConceptMap".equals(codeString)) + return FHIRAllTypes.CONCEPTMAP; + if ("Condition".equals(codeString)) + return FHIRAllTypes.CONDITION; + if ("Conformance".equals(codeString)) + return FHIRAllTypes.CONFORMANCE; + if ("Contract".equals(codeString)) + return FHIRAllTypes.CONTRACT; + if ("Coverage".equals(codeString)) + return FHIRAllTypes.COVERAGE; + if ("DataElement".equals(codeString)) + return FHIRAllTypes.DATAELEMENT; + if ("DecisionSupportRule".equals(codeString)) + return FHIRAllTypes.DECISIONSUPPORTRULE; + if ("DecisionSupportServiceModule".equals(codeString)) + return FHIRAllTypes.DECISIONSUPPORTSERVICEMODULE; + if ("DetectedIssue".equals(codeString)) + return FHIRAllTypes.DETECTEDISSUE; + if ("Device".equals(codeString)) + return FHIRAllTypes.DEVICE; + if ("DeviceComponent".equals(codeString)) + return FHIRAllTypes.DEVICECOMPONENT; + if ("DeviceMetric".equals(codeString)) + return FHIRAllTypes.DEVICEMETRIC; + if ("DeviceUseRequest".equals(codeString)) + return FHIRAllTypes.DEVICEUSEREQUEST; + if ("DeviceUseStatement".equals(codeString)) + return FHIRAllTypes.DEVICEUSESTATEMENT; + if ("DiagnosticOrder".equals(codeString)) + return FHIRAllTypes.DIAGNOSTICORDER; + if ("DiagnosticReport".equals(codeString)) + return FHIRAllTypes.DIAGNOSTICREPORT; + if ("DocumentManifest".equals(codeString)) + return FHIRAllTypes.DOCUMENTMANIFEST; + if ("DocumentReference".equals(codeString)) + return FHIRAllTypes.DOCUMENTREFERENCE; + if ("DomainResource".equals(codeString)) + return FHIRAllTypes.DOMAINRESOURCE; + if ("EligibilityRequest".equals(codeString)) + return FHIRAllTypes.ELIGIBILITYREQUEST; + if ("EligibilityResponse".equals(codeString)) + return FHIRAllTypes.ELIGIBILITYRESPONSE; + if ("Encounter".equals(codeString)) + return FHIRAllTypes.ENCOUNTER; + if ("EnrollmentRequest".equals(codeString)) + return FHIRAllTypes.ENROLLMENTREQUEST; + if ("EnrollmentResponse".equals(codeString)) + return FHIRAllTypes.ENROLLMENTRESPONSE; + if ("EpisodeOfCare".equals(codeString)) + return FHIRAllTypes.EPISODEOFCARE; + if ("ExpansionProfile".equals(codeString)) + return FHIRAllTypes.EXPANSIONPROFILE; + if ("ExplanationOfBenefit".equals(codeString)) + return FHIRAllTypes.EXPLANATIONOFBENEFIT; + if ("FamilyMemberHistory".equals(codeString)) + return FHIRAllTypes.FAMILYMEMBERHISTORY; + if ("Flag".equals(codeString)) + return FHIRAllTypes.FLAG; + if ("Goal".equals(codeString)) + return FHIRAllTypes.GOAL; + if ("Group".equals(codeString)) + return FHIRAllTypes.GROUP; + if ("GuidanceResponse".equals(codeString)) + return FHIRAllTypes.GUIDANCERESPONSE; + if ("HealthcareService".equals(codeString)) + return FHIRAllTypes.HEALTHCARESERVICE; + if ("ImagingExcerpt".equals(codeString)) + return FHIRAllTypes.IMAGINGEXCERPT; + if ("ImagingObjectSelection".equals(codeString)) + return FHIRAllTypes.IMAGINGOBJECTSELECTION; + if ("ImagingStudy".equals(codeString)) + return FHIRAllTypes.IMAGINGSTUDY; + if ("Immunization".equals(codeString)) + return FHIRAllTypes.IMMUNIZATION; + if ("ImmunizationRecommendation".equals(codeString)) + return FHIRAllTypes.IMMUNIZATIONRECOMMENDATION; + if ("ImplementationGuide".equals(codeString)) + return FHIRAllTypes.IMPLEMENTATIONGUIDE; + if ("Library".equals(codeString)) + return FHIRAllTypes.LIBRARY; + if ("Linkage".equals(codeString)) + return FHIRAllTypes.LINKAGE; + if ("List".equals(codeString)) + return FHIRAllTypes.LIST; + if ("Location".equals(codeString)) + return FHIRAllTypes.LOCATION; + if ("Measure".equals(codeString)) + return FHIRAllTypes.MEASURE; + if ("MeasureReport".equals(codeString)) + return FHIRAllTypes.MEASUREREPORT; + if ("Media".equals(codeString)) + return FHIRAllTypes.MEDIA; + if ("Medication".equals(codeString)) + return FHIRAllTypes.MEDICATION; + if ("MedicationAdministration".equals(codeString)) + return FHIRAllTypes.MEDICATIONADMINISTRATION; + if ("MedicationDispense".equals(codeString)) + return FHIRAllTypes.MEDICATIONDISPENSE; + if ("MedicationOrder".equals(codeString)) + return FHIRAllTypes.MEDICATIONORDER; + if ("MedicationStatement".equals(codeString)) + return FHIRAllTypes.MEDICATIONSTATEMENT; + if ("MessageHeader".equals(codeString)) + return FHIRAllTypes.MESSAGEHEADER; + if ("ModuleDefinition".equals(codeString)) + return FHIRAllTypes.MODULEDEFINITION; + if ("NamingSystem".equals(codeString)) + return FHIRAllTypes.NAMINGSYSTEM; + if ("NutritionOrder".equals(codeString)) + return FHIRAllTypes.NUTRITIONORDER; + if ("Observation".equals(codeString)) + return FHIRAllTypes.OBSERVATION; + if ("OperationDefinition".equals(codeString)) + return FHIRAllTypes.OPERATIONDEFINITION; + if ("OperationOutcome".equals(codeString)) + return FHIRAllTypes.OPERATIONOUTCOME; + if ("Order".equals(codeString)) + return FHIRAllTypes.ORDER; + if ("OrderResponse".equals(codeString)) + return FHIRAllTypes.ORDERRESPONSE; + if ("OrderSet".equals(codeString)) + return FHIRAllTypes.ORDERSET; + if ("Organization".equals(codeString)) + return FHIRAllTypes.ORGANIZATION; + if ("Parameters".equals(codeString)) + return FHIRAllTypes.PARAMETERS; + if ("Patient".equals(codeString)) + return FHIRAllTypes.PATIENT; + if ("PaymentNotice".equals(codeString)) + return FHIRAllTypes.PAYMENTNOTICE; + if ("PaymentReconciliation".equals(codeString)) + return FHIRAllTypes.PAYMENTRECONCILIATION; + if ("Person".equals(codeString)) + return FHIRAllTypes.PERSON; + if ("Practitioner".equals(codeString)) + return FHIRAllTypes.PRACTITIONER; + if ("PractitionerRole".equals(codeString)) + return FHIRAllTypes.PRACTITIONERROLE; + if ("Procedure".equals(codeString)) + return FHIRAllTypes.PROCEDURE; + if ("ProcedureRequest".equals(codeString)) + return FHIRAllTypes.PROCEDUREREQUEST; + if ("ProcessRequest".equals(codeString)) + return FHIRAllTypes.PROCESSREQUEST; + if ("ProcessResponse".equals(codeString)) + return FHIRAllTypes.PROCESSRESPONSE; + if ("Protocol".equals(codeString)) + return FHIRAllTypes.PROTOCOL; + if ("Provenance".equals(codeString)) + return FHIRAllTypes.PROVENANCE; + if ("Questionnaire".equals(codeString)) + return FHIRAllTypes.QUESTIONNAIRE; + if ("QuestionnaireResponse".equals(codeString)) + return FHIRAllTypes.QUESTIONNAIRERESPONSE; + if ("ReferralRequest".equals(codeString)) + return FHIRAllTypes.REFERRALREQUEST; + if ("RelatedPerson".equals(codeString)) + return FHIRAllTypes.RELATEDPERSON; + if ("Resource".equals(codeString)) + return FHIRAllTypes.RESOURCE; + if ("RiskAssessment".equals(codeString)) + return FHIRAllTypes.RISKASSESSMENT; + if ("Schedule".equals(codeString)) + return FHIRAllTypes.SCHEDULE; + if ("SearchParameter".equals(codeString)) + return FHIRAllTypes.SEARCHPARAMETER; + if ("Sequence".equals(codeString)) + return FHIRAllTypes.SEQUENCE; + if ("Slot".equals(codeString)) + return FHIRAllTypes.SLOT; + if ("Specimen".equals(codeString)) + return FHIRAllTypes.SPECIMEN; + if ("StructureDefinition".equals(codeString)) + return FHIRAllTypes.STRUCTUREDEFINITION; + if ("StructureMap".equals(codeString)) + return FHIRAllTypes.STRUCTUREMAP; + if ("Subscription".equals(codeString)) + return FHIRAllTypes.SUBSCRIPTION; + if ("Substance".equals(codeString)) + return FHIRAllTypes.SUBSTANCE; + if ("SupplyDelivery".equals(codeString)) + return FHIRAllTypes.SUPPLYDELIVERY; + if ("SupplyRequest".equals(codeString)) + return FHIRAllTypes.SUPPLYREQUEST; + if ("Task".equals(codeString)) + return FHIRAllTypes.TASK; + if ("TestScript".equals(codeString)) + return FHIRAllTypes.TESTSCRIPT; + if ("ValueSet".equals(codeString)) + return FHIRAllTypes.VALUESET; + if ("VisionPrescription".equals(codeString)) + return FHIRAllTypes.VISIONPRESCRIPTION; + if ("Type".equals(codeString)) + return FHIRAllTypes.TYPE; + if ("Any".equals(codeString)) + return FHIRAllTypes.ANY; + throw new IllegalArgumentException("Unknown FHIRAllTypes code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ACTIONDEFINITION); + if ("Address".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ADDRESS); + if ("Age".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.AGE); + if ("Annotation".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ANNOTATION); + if ("Attachment".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ATTACHMENT); + if ("BackboneElement".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.BACKBONEELEMENT); + if ("CodeableConcept".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CODEABLECONCEPT); + if ("Coding".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CODING); + if ("ContactPoint".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CONTACTPOINT); + if ("Count".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.COUNT); + if ("DataRequirement".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DATAREQUIREMENT); + if ("Distance".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DISTANCE); + if ("Duration".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DURATION); + if ("Element".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ELEMENT); + if ("ElementDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ELEMENTDEFINITION); + if ("Extension".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.EXTENSION); + if ("HumanName".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.HUMANNAME); + if ("Identifier".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.IDENTIFIER); + if ("Meta".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.META); + if ("ModuleMetadata".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MODULEMETADATA); + if ("Money".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MONEY); + if ("Narrative".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.NARRATIVE); + if ("ParameterDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PARAMETERDEFINITION); + if ("Period".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PERIOD); + if ("Quantity".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.QUANTITY); + if ("Range".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.RANGE); + if ("Ratio".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.RATIO); + if ("Reference".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.REFERENCE); + if ("SampledData".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SAMPLEDDATA); + if ("Signature".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SIGNATURE); + if ("SimpleQuantity".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SIMPLEQUANTITY); + if ("Timing".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.TIMING); + if ("TriggerDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.TRIGGERDEFINITION); + if ("base64Binary".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.BASE64BINARY); + if ("boolean".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.BOOLEAN); + if ("code".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CODE); + if ("date".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DATE); + if ("dateTime".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DATETIME); + if ("decimal".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DECIMAL); + if ("id".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ID); + if ("instant".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.INSTANT); + if ("integer".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.INTEGER); + if ("markdown".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MARKDOWN); + if ("oid".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.OID); + if ("positiveInt".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.POSITIVEINT); + if ("string".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.STRING); + if ("time".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.TIME); + if ("unsignedInt".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.UNSIGNEDINT); + if ("uri".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.URI); + if ("uuid".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.UUID); + if ("xhtml".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.XHTML); + if ("Account".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ACCOUNT); + if ("AllergyIntolerance".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ALLERGYINTOLERANCE); + if ("Appointment".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.APPOINTMENT); + if ("AppointmentResponse".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.APPOINTMENTRESPONSE); + if ("AuditEvent".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.AUDITEVENT); + if ("Basic".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.BASIC); + if ("Binary".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.BINARY); + if ("BodySite".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.BODYSITE); + if ("Bundle".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.BUNDLE); + if ("CarePlan".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CAREPLAN); + if ("CareTeam".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CARETEAM); + if ("Claim".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CLAIM); + if ("ClaimResponse".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CLAIMRESPONSE); + if ("ClinicalImpression".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CLINICALIMPRESSION); + if ("CodeSystem".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CODESYSTEM); + if ("Communication".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.COMMUNICATION); + if ("CommunicationRequest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.COMMUNICATIONREQUEST); + if ("CompartmentDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.COMPARTMENTDEFINITION); + if ("Composition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.COMPOSITION); + if ("ConceptMap".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CONCEPTMAP); + if ("Condition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CONDITION); + if ("Conformance".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CONFORMANCE); + if ("Contract".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.CONTRACT); + if ("Coverage".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.COVERAGE); + if ("DataElement".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DATAELEMENT); + if ("DecisionSupportRule".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DECISIONSUPPORTRULE); + if ("DecisionSupportServiceModule".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DECISIONSUPPORTSERVICEMODULE); + if ("DetectedIssue".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DETECTEDISSUE); + if ("Device".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DEVICE); + if ("DeviceComponent".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DEVICECOMPONENT); + if ("DeviceMetric".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DEVICEMETRIC); + if ("DeviceUseRequest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DEVICEUSEREQUEST); + if ("DeviceUseStatement".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DEVICEUSESTATEMENT); + if ("DiagnosticOrder".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DIAGNOSTICORDER); + if ("DiagnosticReport".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DIAGNOSTICREPORT); + if ("DocumentManifest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DOCUMENTMANIFEST); + if ("DocumentReference".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DOCUMENTREFERENCE); + if ("DomainResource".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.DOMAINRESOURCE); + if ("EligibilityRequest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ELIGIBILITYREQUEST); + if ("EligibilityResponse".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ELIGIBILITYRESPONSE); + if ("Encounter".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ENCOUNTER); + if ("EnrollmentRequest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ENROLLMENTREQUEST); + if ("EnrollmentResponse".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ENROLLMENTRESPONSE); + if ("EpisodeOfCare".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.EPISODEOFCARE); + if ("ExpansionProfile".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.EXPANSIONPROFILE); + if ("ExplanationOfBenefit".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.EXPLANATIONOFBENEFIT); + if ("FamilyMemberHistory".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.FAMILYMEMBERHISTORY); + if ("Flag".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.FLAG); + if ("Goal".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.GOAL); + if ("Group".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.GROUP); + if ("GuidanceResponse".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.GUIDANCERESPONSE); + if ("HealthcareService".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.HEALTHCARESERVICE); + if ("ImagingExcerpt".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.IMAGINGEXCERPT); + if ("ImagingObjectSelection".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.IMAGINGOBJECTSELECTION); + if ("ImagingStudy".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.IMAGINGSTUDY); + if ("Immunization".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.IMMUNIZATION); + if ("ImmunizationRecommendation".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.IMMUNIZATIONRECOMMENDATION); + if ("ImplementationGuide".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.IMPLEMENTATIONGUIDE); + if ("Library".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.LIBRARY); + if ("Linkage".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.LINKAGE); + if ("List".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.LIST); + if ("Location".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.LOCATION); + if ("Measure".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MEASURE); + if ("MeasureReport".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MEASUREREPORT); + if ("Media".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MEDIA); + if ("Medication".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MEDICATION); + if ("MedicationAdministration".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MEDICATIONADMINISTRATION); + if ("MedicationDispense".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MEDICATIONDISPENSE); + if ("MedicationOrder".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MEDICATIONORDER); + if ("MedicationStatement".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MEDICATIONSTATEMENT); + if ("MessageHeader".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MESSAGEHEADER); + if ("ModuleDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MODULEDEFINITION); + if ("NamingSystem".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.NAMINGSYSTEM); + if ("NutritionOrder".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.NUTRITIONORDER); + if ("Observation".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.OBSERVATION); + if ("OperationDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.OPERATIONDEFINITION); + if ("OperationOutcome".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.OPERATIONOUTCOME); + if ("Order".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ORDER); + if ("OrderResponse".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ORDERRESPONSE); + if ("OrderSet".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ORDERSET); + if ("Organization".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ORGANIZATION); + if ("Parameters".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PARAMETERS); + if ("Patient".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PATIENT); + if ("PaymentNotice".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PAYMENTNOTICE); + if ("PaymentReconciliation".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PAYMENTRECONCILIATION); + if ("Person".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PERSON); + if ("Practitioner".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PRACTITIONER); + if ("PractitionerRole".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PRACTITIONERROLE); + if ("Procedure".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PROCEDURE); + if ("ProcedureRequest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PROCEDUREREQUEST); + if ("ProcessRequest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PROCESSREQUEST); + if ("ProcessResponse".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PROCESSRESPONSE); + if ("Protocol".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PROTOCOL); + if ("Provenance".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.PROVENANCE); + if ("Questionnaire".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.QUESTIONNAIRE); + if ("QuestionnaireResponse".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.QUESTIONNAIRERESPONSE); + if ("ReferralRequest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.REFERRALREQUEST); + if ("RelatedPerson".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.RELATEDPERSON); + if ("Resource".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.RESOURCE); + if ("RiskAssessment".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.RISKASSESSMENT); + if ("Schedule".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SCHEDULE); + if ("SearchParameter".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SEARCHPARAMETER); + if ("Sequence".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SEQUENCE); + if ("Slot".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SLOT); + if ("Specimen".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SPECIMEN); + if ("StructureDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.STRUCTUREDEFINITION); + if ("StructureMap".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.STRUCTUREMAP); + if ("Subscription".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SUBSCRIPTION); + if ("Substance".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SUBSTANCE); + if ("SupplyDelivery".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SUPPLYDELIVERY); + if ("SupplyRequest".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.SUPPLYREQUEST); + if ("Task".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.TASK); + if ("TestScript".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.TESTSCRIPT); + if ("ValueSet".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.VALUESET); + if ("VisionPrescription".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.VISIONPRESCRIPTION); + if ("Type".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.TYPE); + if ("Any".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.ANY); + throw new FHIRException("Unknown FHIRAllTypes code '"+codeString+"'"); + } + public String toCode(FHIRAllTypes code) { + if (code == FHIRAllTypes.ACTIONDEFINITION) + return "ActionDefinition"; + if (code == FHIRAllTypes.ADDRESS) + return "Address"; + if (code == FHIRAllTypes.AGE) + return "Age"; + if (code == FHIRAllTypes.ANNOTATION) + return "Annotation"; + if (code == FHIRAllTypes.ATTACHMENT) + return "Attachment"; + if (code == FHIRAllTypes.BACKBONEELEMENT) + return "BackboneElement"; + if (code == FHIRAllTypes.CODEABLECONCEPT) + return "CodeableConcept"; + if (code == FHIRAllTypes.CODING) + return "Coding"; + if (code == FHIRAllTypes.CONTACTPOINT) + return "ContactPoint"; + if (code == FHIRAllTypes.COUNT) + return "Count"; + if (code == FHIRAllTypes.DATAREQUIREMENT) + return "DataRequirement"; + if (code == FHIRAllTypes.DISTANCE) + return "Distance"; + if (code == FHIRAllTypes.DURATION) + return "Duration"; + if (code == FHIRAllTypes.ELEMENT) + return "Element"; + if (code == FHIRAllTypes.ELEMENTDEFINITION) + return "ElementDefinition"; + if (code == FHIRAllTypes.EXTENSION) + return "Extension"; + if (code == FHIRAllTypes.HUMANNAME) + return "HumanName"; + if (code == FHIRAllTypes.IDENTIFIER) + return "Identifier"; + if (code == FHIRAllTypes.META) + return "Meta"; + if (code == FHIRAllTypes.MODULEMETADATA) + return "ModuleMetadata"; + if (code == FHIRAllTypes.MONEY) + return "Money"; + if (code == FHIRAllTypes.NARRATIVE) + return "Narrative"; + if (code == FHIRAllTypes.PARAMETERDEFINITION) + return "ParameterDefinition"; + if (code == FHIRAllTypes.PERIOD) + return "Period"; + if (code == FHIRAllTypes.QUANTITY) + return "Quantity"; + if (code == FHIRAllTypes.RANGE) + return "Range"; + if (code == FHIRAllTypes.RATIO) + return "Ratio"; + if (code == FHIRAllTypes.REFERENCE) + return "Reference"; + if (code == FHIRAllTypes.SAMPLEDDATA) + return "SampledData"; + if (code == FHIRAllTypes.SIGNATURE) + return "Signature"; + if (code == FHIRAllTypes.SIMPLEQUANTITY) + return "SimpleQuantity"; + if (code == FHIRAllTypes.TIMING) + return "Timing"; + if (code == FHIRAllTypes.TRIGGERDEFINITION) + return "TriggerDefinition"; + if (code == FHIRAllTypes.BASE64BINARY) + return "base64Binary"; + if (code == FHIRAllTypes.BOOLEAN) + return "boolean"; + if (code == FHIRAllTypes.CODE) + return "code"; + if (code == FHIRAllTypes.DATE) + return "date"; + if (code == FHIRAllTypes.DATETIME) + return "dateTime"; + if (code == FHIRAllTypes.DECIMAL) + return "decimal"; + if (code == FHIRAllTypes.ID) + return "id"; + if (code == FHIRAllTypes.INSTANT) + return "instant"; + if (code == FHIRAllTypes.INTEGER) + return "integer"; + if (code == FHIRAllTypes.MARKDOWN) + return "markdown"; + if (code == FHIRAllTypes.OID) + return "oid"; + if (code == FHIRAllTypes.POSITIVEINT) + return "positiveInt"; + if (code == FHIRAllTypes.STRING) + return "string"; + if (code == FHIRAllTypes.TIME) + return "time"; + if (code == FHIRAllTypes.UNSIGNEDINT) + return "unsignedInt"; + if (code == FHIRAllTypes.URI) + return "uri"; + if (code == FHIRAllTypes.UUID) + return "uuid"; + if (code == FHIRAllTypes.XHTML) + return "xhtml"; + if (code == FHIRAllTypes.ACCOUNT) + return "Account"; + if (code == FHIRAllTypes.ALLERGYINTOLERANCE) + return "AllergyIntolerance"; + if (code == FHIRAllTypes.APPOINTMENT) + return "Appointment"; + if (code == FHIRAllTypes.APPOINTMENTRESPONSE) + return "AppointmentResponse"; + if (code == FHIRAllTypes.AUDITEVENT) + return "AuditEvent"; + if (code == FHIRAllTypes.BASIC) + return "Basic"; + if (code == FHIRAllTypes.BINARY) + return "Binary"; + if (code == FHIRAllTypes.BODYSITE) + return "BodySite"; + if (code == FHIRAllTypes.BUNDLE) + return "Bundle"; + if (code == FHIRAllTypes.CAREPLAN) + return "CarePlan"; + if (code == FHIRAllTypes.CARETEAM) + return "CareTeam"; + if (code == FHIRAllTypes.CLAIM) + return "Claim"; + if (code == FHIRAllTypes.CLAIMRESPONSE) + return "ClaimResponse"; + if (code == FHIRAllTypes.CLINICALIMPRESSION) + return "ClinicalImpression"; + if (code == FHIRAllTypes.CODESYSTEM) + return "CodeSystem"; + if (code == FHIRAllTypes.COMMUNICATION) + return "Communication"; + if (code == FHIRAllTypes.COMMUNICATIONREQUEST) + return "CommunicationRequest"; + if (code == FHIRAllTypes.COMPARTMENTDEFINITION) + return "CompartmentDefinition"; + if (code == FHIRAllTypes.COMPOSITION) + return "Composition"; + if (code == FHIRAllTypes.CONCEPTMAP) + return "ConceptMap"; + if (code == FHIRAllTypes.CONDITION) + return "Condition"; + if (code == FHIRAllTypes.CONFORMANCE) + return "Conformance"; + if (code == FHIRAllTypes.CONTRACT) + return "Contract"; + if (code == FHIRAllTypes.COVERAGE) + return "Coverage"; + if (code == FHIRAllTypes.DATAELEMENT) + return "DataElement"; + if (code == FHIRAllTypes.DECISIONSUPPORTRULE) + return "DecisionSupportRule"; + if (code == FHIRAllTypes.DECISIONSUPPORTSERVICEMODULE) + return "DecisionSupportServiceModule"; + if (code == FHIRAllTypes.DETECTEDISSUE) + return "DetectedIssue"; + if (code == FHIRAllTypes.DEVICE) + return "Device"; + if (code == FHIRAllTypes.DEVICECOMPONENT) + return "DeviceComponent"; + if (code == FHIRAllTypes.DEVICEMETRIC) + return "DeviceMetric"; + if (code == FHIRAllTypes.DEVICEUSEREQUEST) + return "DeviceUseRequest"; + if (code == FHIRAllTypes.DEVICEUSESTATEMENT) + return "DeviceUseStatement"; + if (code == FHIRAllTypes.DIAGNOSTICORDER) + return "DiagnosticOrder"; + if (code == FHIRAllTypes.DIAGNOSTICREPORT) + return "DiagnosticReport"; + if (code == FHIRAllTypes.DOCUMENTMANIFEST) + return "DocumentManifest"; + if (code == FHIRAllTypes.DOCUMENTREFERENCE) + return "DocumentReference"; + if (code == FHIRAllTypes.DOMAINRESOURCE) + return "DomainResource"; + if (code == FHIRAllTypes.ELIGIBILITYREQUEST) + return "EligibilityRequest"; + if (code == FHIRAllTypes.ELIGIBILITYRESPONSE) + return "EligibilityResponse"; + if (code == FHIRAllTypes.ENCOUNTER) + return "Encounter"; + if (code == FHIRAllTypes.ENROLLMENTREQUEST) + return "EnrollmentRequest"; + if (code == FHIRAllTypes.ENROLLMENTRESPONSE) + return "EnrollmentResponse"; + if (code == FHIRAllTypes.EPISODEOFCARE) + return "EpisodeOfCare"; + if (code == FHIRAllTypes.EXPANSIONPROFILE) + return "ExpansionProfile"; + if (code == FHIRAllTypes.EXPLANATIONOFBENEFIT) + return "ExplanationOfBenefit"; + if (code == FHIRAllTypes.FAMILYMEMBERHISTORY) + return "FamilyMemberHistory"; + if (code == FHIRAllTypes.FLAG) + return "Flag"; + if (code == FHIRAllTypes.GOAL) + return "Goal"; + if (code == FHIRAllTypes.GROUP) + return "Group"; + if (code == FHIRAllTypes.GUIDANCERESPONSE) + return "GuidanceResponse"; + if (code == FHIRAllTypes.HEALTHCARESERVICE) + return "HealthcareService"; + if (code == FHIRAllTypes.IMAGINGEXCERPT) + return "ImagingExcerpt"; + if (code == FHIRAllTypes.IMAGINGOBJECTSELECTION) + return "ImagingObjectSelection"; + if (code == FHIRAllTypes.IMAGINGSTUDY) + return "ImagingStudy"; + if (code == FHIRAllTypes.IMMUNIZATION) + return "Immunization"; + if (code == FHIRAllTypes.IMMUNIZATIONRECOMMENDATION) + return "ImmunizationRecommendation"; + if (code == FHIRAllTypes.IMPLEMENTATIONGUIDE) + return "ImplementationGuide"; + if (code == FHIRAllTypes.LIBRARY) + return "Library"; + if (code == FHIRAllTypes.LINKAGE) + return "Linkage"; + if (code == FHIRAllTypes.LIST) + return "List"; + if (code == FHIRAllTypes.LOCATION) + return "Location"; + if (code == FHIRAllTypes.MEASURE) + return "Measure"; + if (code == FHIRAllTypes.MEASUREREPORT) + return "MeasureReport"; + if (code == FHIRAllTypes.MEDIA) + return "Media"; + if (code == FHIRAllTypes.MEDICATION) + return "Medication"; + if (code == FHIRAllTypes.MEDICATIONADMINISTRATION) + return "MedicationAdministration"; + if (code == FHIRAllTypes.MEDICATIONDISPENSE) + return "MedicationDispense"; + if (code == FHIRAllTypes.MEDICATIONORDER) + return "MedicationOrder"; + if (code == FHIRAllTypes.MEDICATIONSTATEMENT) + return "MedicationStatement"; + if (code == FHIRAllTypes.MESSAGEHEADER) + return "MessageHeader"; + if (code == FHIRAllTypes.MODULEDEFINITION) + return "ModuleDefinition"; + if (code == FHIRAllTypes.NAMINGSYSTEM) + return "NamingSystem"; + if (code == FHIRAllTypes.NUTRITIONORDER) + return "NutritionOrder"; + if (code == FHIRAllTypes.OBSERVATION) + return "Observation"; + if (code == FHIRAllTypes.OPERATIONDEFINITION) + return "OperationDefinition"; + if (code == FHIRAllTypes.OPERATIONOUTCOME) + return "OperationOutcome"; + if (code == FHIRAllTypes.ORDER) + return "Order"; + if (code == FHIRAllTypes.ORDERRESPONSE) + return "OrderResponse"; + if (code == FHIRAllTypes.ORDERSET) + return "OrderSet"; + if (code == FHIRAllTypes.ORGANIZATION) + return "Organization"; + if (code == FHIRAllTypes.PARAMETERS) + return "Parameters"; + if (code == FHIRAllTypes.PATIENT) + return "Patient"; + if (code == FHIRAllTypes.PAYMENTNOTICE) + return "PaymentNotice"; + if (code == FHIRAllTypes.PAYMENTRECONCILIATION) + return "PaymentReconciliation"; + if (code == FHIRAllTypes.PERSON) + return "Person"; + if (code == FHIRAllTypes.PRACTITIONER) + return "Practitioner"; + if (code == FHIRAllTypes.PRACTITIONERROLE) + return "PractitionerRole"; + if (code == FHIRAllTypes.PROCEDURE) + return "Procedure"; + if (code == FHIRAllTypes.PROCEDUREREQUEST) + return "ProcedureRequest"; + if (code == FHIRAllTypes.PROCESSREQUEST) + return "ProcessRequest"; + if (code == FHIRAllTypes.PROCESSRESPONSE) + return "ProcessResponse"; + if (code == FHIRAllTypes.PROTOCOL) + return "Protocol"; + if (code == FHIRAllTypes.PROVENANCE) + return "Provenance"; + if (code == FHIRAllTypes.QUESTIONNAIRE) + return "Questionnaire"; + if (code == FHIRAllTypes.QUESTIONNAIRERESPONSE) + return "QuestionnaireResponse"; + if (code == FHIRAllTypes.REFERRALREQUEST) + return "ReferralRequest"; + if (code == FHIRAllTypes.RELATEDPERSON) + return "RelatedPerson"; + if (code == FHIRAllTypes.RESOURCE) + return "Resource"; + if (code == FHIRAllTypes.RISKASSESSMENT) + return "RiskAssessment"; + if (code == FHIRAllTypes.SCHEDULE) + return "Schedule"; + if (code == FHIRAllTypes.SEARCHPARAMETER) + return "SearchParameter"; + if (code == FHIRAllTypes.SEQUENCE) + return "Sequence"; + if (code == FHIRAllTypes.SLOT) + return "Slot"; + if (code == FHIRAllTypes.SPECIMEN) + return "Specimen"; + if (code == FHIRAllTypes.STRUCTUREDEFINITION) + return "StructureDefinition"; + if (code == FHIRAllTypes.STRUCTUREMAP) + return "StructureMap"; + if (code == FHIRAllTypes.SUBSCRIPTION) + return "Subscription"; + if (code == FHIRAllTypes.SUBSTANCE) + return "Substance"; + if (code == FHIRAllTypes.SUPPLYDELIVERY) + return "SupplyDelivery"; + if (code == FHIRAllTypes.SUPPLYREQUEST) + return "SupplyRequest"; + if (code == FHIRAllTypes.TASK) + return "Task"; + if (code == FHIRAllTypes.TESTSCRIPT) + return "TestScript"; + if (code == FHIRAllTypes.VALUESET) + return "ValueSet"; + if (code == FHIRAllTypes.VISIONPRESCRIPTION) + return "VisionPrescription"; + if (code == FHIRAllTypes.TYPE) + return "Type"; + if (code == FHIRAllTypes.ANY) + return "Any"; + return "?"; + } + public String toSystem(FHIRAllTypes code) { + return code.getSystem(); + } + } + + public enum FHIRDefinedType { + /** + * The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library. + */ + ACTIONDEFINITION, + /** + * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. + */ + ADDRESS, + /** + * null + */ + AGE, + /** + * A text note which also contains information about who made the statement and when. + */ + ANNOTATION, + /** + * For referring to data content defined in other formats. + */ + ATTACHMENT, + /** + * Base definition for all elements that are defined inside a resource - but not those in a data type. + */ + BACKBONEELEMENT, + /** + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + */ + CODEABLECONCEPT, + /** + * A reference to a code defined by a terminology system. + */ + CODING, + /** + * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + */ + CONTACTPOINT, + /** + * null + */ + COUNT, + /** + * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. + */ + DATAREQUIREMENT, + /** + * null + */ + DISTANCE, + /** + * null + */ + DURATION, + /** + * Base definition for all elements in a resource. + */ + ELEMENT, + /** + * Captures constraints on each element within the resource, profile, or extension. + */ + ELEMENTDEFINITION, + /** + * Optional Extensions Element - found in all resources. + */ + EXTENSION, + /** + * A human's name with the ability to identify parts and usage. + */ + HUMANNAME, + /** + * A technical identifier - identifies some entity uniquely and unambiguously. + */ + IDENTIFIER, + /** + * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + */ + META, + /** + * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information. + */ + MODULEMETADATA, + /** + * null + */ + MONEY, + /** + * A human-readable formatted text, including images. + */ + NARRATIVE, + /** + * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. + */ + PARAMETERDEFINITION, + /** + * A time period defined by a start and end date and optionally time. + */ + PERIOD, + /** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ + QUANTITY, + /** + * A set of ordered Quantities defined by a low and high limit. + */ + RANGE, + /** + * A relationship of two Quantity values - expressed as a numerator and a denominator. + */ + RATIO, + /** + * A reference from one resource to another. + */ + REFERENCE, + /** + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + */ + SAMPLEDDATA, + /** + * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities. + */ + SIGNATURE, + /** + * null + */ + SIMPLEQUANTITY, + /** + * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. + */ + TIMING, + /** + * A description of a triggering event. + */ + TRIGGERDEFINITION, + /** + * A stream of bytes + */ + BASE64BINARY, + /** + * Value of "true" or "false" + */ + BOOLEAN, + /** + * A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents + */ + CODE, + /** + * A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. + */ + DATE, + /** + * A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. + */ + DATETIME, + /** + * A rational number with implicit precision + */ + DECIMAL, + /** + * Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive. + */ + ID, + /** + * An instant in time - known at least to the second + */ + INSTANT, + /** + * A whole number + */ + INTEGER, + /** + * A string that may contain markdown syntax for optional processing by a mark down presentation engine + */ + MARKDOWN, + /** + * An oid represented as a URI + */ + OID, + /** + * An integer with a value that is positive (e.g. >0) + */ + POSITIVEINT, + /** + * A sequence of Unicode characters + */ + STRING, + /** + * A time during the day, with no date specified + */ + TIME, + /** + * An integer with a value that is not negative (e.g. >= 0) + */ + UNSIGNEDINT, + /** + * String of characters used to identify a name or a resource + */ + URI, + /** + * A UUID, represented as a URI + */ + UUID, + /** + * XHTML format, as defined by W3C, but restricted usage (mainly, no active content) + */ + XHTML, + /** + * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc. + */ + ACCOUNT, + /** + * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + */ + ALLERGYINTOLERANCE, + /** + * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). + */ + APPOINTMENT, + /** + * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. + */ + APPOINTMENTRESPONSE, + /** + * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + */ + AUDITEVENT, + /** + * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. + */ + BASIC, + /** + * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + */ + BINARY, + /** + * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + */ + BODYSITE, + /** + * A container for a collection of resources. + */ + BUNDLE, + /** + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. + */ + CAREPLAN, + /** + * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. + */ + CARETEAM, + /** + * 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. + */ + CLAIM, + /** + * This resource provides the adjudication details from the processing of a Claim resource. + */ + CLAIMRESPONSE, + /** + * 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. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + */ + CLINICALIMPRESSION, + /** + * A code system resource specifies a set of codes drawn from one or more code systems. + */ + CODESYSTEM, + /** + * 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. + */ + COMMUNICATION, + /** + * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + */ + COMMUNICATIONREQUEST, + /** + * A compartment definition that defines how resources are accessed on a server. + */ + COMPARTMENTDEFINITION, + /** + * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. + */ + COMPOSITION, + /** + * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + */ + CONCEPTMAP, + /** + * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary. + */ + CONDITION, + /** + * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. + */ + CONFORMANCE, + /** + * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + */ + CONTRACT, + /** + * Financial instrument which may be used to pay for or reimburse health care products and services. + */ + COVERAGE, + /** + * The formal description of a single piece of information that can be gathered and reported. + */ + DATAELEMENT, + /** + * This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events. + */ + DECISIONSUPPORTRULE, + /** + * The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking. + */ + DECISIONSUPPORTSERVICEMODULE, + /** + * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + */ + DETECTEDISSUE, + /** + * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. + */ + DEVICE, + /** + * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. + */ + DEVICECOMPONENT, + /** + * Describes a measurement, calculation or setting capability of a medical device. + */ + DEVICEMETRIC, + /** + * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. + */ + DEVICEUSEREQUEST, + /** + * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. + */ + DEVICEUSESTATEMENT, + /** + * A record of a request for a diagnostic investigation service to be performed. + */ + DIAGNOSTICORDER, + /** + * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. + */ + DIAGNOSTICREPORT, + /** + * A manifest that defines a set of documents. + */ + DOCUMENTMANIFEST, + /** + * A reference to a document . + */ + DOCUMENTREFERENCE, + /** + * A resource that includes narrative, extensions, and contained resources. + */ + DOMAINRESOURCE, + /** + * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + */ + ELIGIBILITYREQUEST, + /** + * This resource provides eligibility and plan details from the processing of an Eligibility resource. + */ + ELIGIBILITYRESPONSE, + /** + * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + */ + ENCOUNTER, + /** + * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. + */ + ENROLLMENTREQUEST, + /** + * This resource provides enrollment and plan details from the processing of an Enrollment resource. + */ + ENROLLMENTRESPONSE, + /** + * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + */ + EPISODEOFCARE, + /** + * Resource to define constraints on the Expansion of a FHIR ValueSet. + */ + EXPANSIONPROFILE, + /** + * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. + */ + EXPLANATIONOFBENEFIT, + /** + * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. + */ + FAMILYMEMBERHISTORY, + /** + * Prospective warnings of potential issues when providing care to the patient. + */ + FLAG, + /** + * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. + */ + GOAL, + /** + * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. + */ + GROUP, + /** + * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. + */ + GUIDANCERESPONSE, + /** + * The details of a healthcare service available at a location. + */ + HEALTHCARESERVICE, + /** + * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. + */ + IMAGINGEXCERPT, + /** + * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. + */ + IMAGINGOBJECTSELECTION, + /** + * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. + */ + IMAGINGSTUDY, + /** + * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. + */ + IMMUNIZATION, + /** + * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. + */ + IMMUNIZATIONRECOMMENDATION, + /** + * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts. + */ + IMPLEMENTATIONGUIDE, + /** + * The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library. + */ + LIBRARY, + /** + * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". + */ + LINKAGE, + /** + * A set of information summarized from a list of other resources. + */ + LIST, + /** + * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + */ + LOCATION, + /** + * The Measure resource provides the definition of a quality measure. + */ + MEASURE, + /** + * The MeasureReport resource contains the results of evaluating a measure. + */ + MEASUREREPORT, + /** + * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + */ + MEDIA, + /** + * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. + */ + MEDICATION, + /** + * Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + */ + MEDICATIONADMINISTRATION, + /** + * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. + */ + MEDICATIONDISPENSE, + /** + * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc. + */ + MEDICATIONORDER, + /** + * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. + */ + MEDICATIONSTATEMENT, + /** + * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + */ + MESSAGEHEADER, + /** + * The ModuleDefinition resource defines the data requirements for a quality artifact. + */ + MODULEDEFINITION, + /** + * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + */ + NAMINGSYSTEM, + /** + * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + */ + NUTRITIONORDER, + /** + * Measurements and simple assertions made about a patient, device or other subject. + */ + OBSERVATION, + /** + * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + */ + OPERATIONDEFINITION, + /** + * A collection of error, warning or information messages that result from a system action. + */ + OPERATIONOUTCOME, + /** + * A request to perform an action. + */ + ORDER, + /** + * A response to an order. + */ + ORDERRESPONSE, + /** + * This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support. + */ + ORDERSET, + /** + * 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. + */ + ORGANIZATION, + /** + * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. + */ + PARAMETERS, + /** + * Demographics and other administrative information about an individual or animal receiving care or other health-related services. + */ + PATIENT, + /** + * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. + */ + PAYMENTNOTICE, + /** + * This resource provides payment details and claim references supporting a bulk payment. + */ + PAYMENTRECONCILIATION, + /** + * Demographics and administrative information about a person independent of a specific health-related context. + */ + PERSON, + /** + * A person who is directly or indirectly involved in the provisioning of healthcare. + */ + PRACTITIONER, + /** + * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. + */ + PRACTITIONERROLE, + /** + * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. + */ + PROCEDURE, + /** + * A request for a procedure to be performed. May be a proposal or an order. + */ + PROCEDUREREQUEST, + /** + * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. + */ + PROCESSREQUEST, + /** + * This resource provides processing status, errors and notes from the processing of a resource. + */ + PROCESSRESPONSE, + /** + * A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points. + */ + PROTOCOL, + /** + * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. + */ + PROVENANCE, + /** + * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ + QUESTIONNAIRE, + /** + * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ + QUESTIONNAIRERESPONSE, + /** + * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. + */ + REFERRALREQUEST, + /** + * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. + */ + RELATEDPERSON, + /** + * This is the base resource type for everything. + */ + RESOURCE, + /** + * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + */ + RISKASSESSMENT, + /** + * A container for slot(s) of time that may be available for booking appointments. + */ + SCHEDULE, + /** + * A search parameter that defines a named search item that can be used to search/filter on a resource. + */ + SEARCHPARAMETER, + /** + * Variation and Sequence data. + */ + SEQUENCE, + /** + * A slot of time on a schedule that may be available for booking appointments. + */ + SLOT, + /** + * A sample to be used for analysis. + */ + SPECIMEN, + /** + * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + */ + STRUCTUREDEFINITION, + /** + * A Map of relationships between 2 structures that can be used to transform data. + */ + STRUCTUREMAP, + /** + * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. + */ + SUBSCRIPTION, + /** + * A homogeneous material with a definite composition. + */ + SUBSTANCE, + /** + * Record of delivery of what is supplied. + */ + SUPPLYDELIVERY, + /** + * A record of a request for a medication, substance or device used in the healthcare setting. + */ + SUPPLYREQUEST, + /** + * A task to be performed. + */ + TASK, + /** + * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + */ + TESTSCRIPT, + /** + * A value set specifies a set of codes drawn from one or more code systems. + */ + VALUESET, + /** + * An authorization for the supply of glasses and/or contact lenses to a patient. + */ + VISIONPRESCRIPTION, + /** + * added to help the parsers + */ + NULL; + public static FHIRDefinedType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return ACTIONDEFINITION; + if ("Address".equals(codeString)) + return ADDRESS; + if ("Age".equals(codeString)) + return AGE; + if ("Annotation".equals(codeString)) + return ANNOTATION; + if ("Attachment".equals(codeString)) + return ATTACHMENT; + if ("BackboneElement".equals(codeString)) + return BACKBONEELEMENT; + if ("CodeableConcept".equals(codeString)) + return CODEABLECONCEPT; + if ("Coding".equals(codeString)) + return CODING; + if ("ContactPoint".equals(codeString)) + return CONTACTPOINT; + if ("Count".equals(codeString)) + return COUNT; + if ("DataRequirement".equals(codeString)) + return DATAREQUIREMENT; + if ("Distance".equals(codeString)) + return DISTANCE; + if ("Duration".equals(codeString)) + return DURATION; + if ("Element".equals(codeString)) + return ELEMENT; + if ("ElementDefinition".equals(codeString)) + return ELEMENTDEFINITION; + if ("Extension".equals(codeString)) + return EXTENSION; + if ("HumanName".equals(codeString)) + return HUMANNAME; + if ("Identifier".equals(codeString)) + return IDENTIFIER; + if ("Meta".equals(codeString)) + return META; + if ("ModuleMetadata".equals(codeString)) + return MODULEMETADATA; + if ("Money".equals(codeString)) + return MONEY; + if ("Narrative".equals(codeString)) + return NARRATIVE; + if ("ParameterDefinition".equals(codeString)) + return PARAMETERDEFINITION; + if ("Period".equals(codeString)) + return PERIOD; + if ("Quantity".equals(codeString)) + return QUANTITY; + if ("Range".equals(codeString)) + return RANGE; + if ("Ratio".equals(codeString)) + return RATIO; + if ("Reference".equals(codeString)) + return REFERENCE; + if ("SampledData".equals(codeString)) + return SAMPLEDDATA; + if ("Signature".equals(codeString)) + return SIGNATURE; + if ("SimpleQuantity".equals(codeString)) + return SIMPLEQUANTITY; + if ("Timing".equals(codeString)) + return TIMING; + if ("TriggerDefinition".equals(codeString)) + return TRIGGERDEFINITION; + if ("base64Binary".equals(codeString)) + return BASE64BINARY; + if ("boolean".equals(codeString)) + return BOOLEAN; + if ("code".equals(codeString)) + return CODE; + if ("date".equals(codeString)) + return DATE; + if ("dateTime".equals(codeString)) + return DATETIME; + if ("decimal".equals(codeString)) + return DECIMAL; + if ("id".equals(codeString)) + return ID; + if ("instant".equals(codeString)) + return INSTANT; + if ("integer".equals(codeString)) + return INTEGER; + if ("markdown".equals(codeString)) + return MARKDOWN; + if ("oid".equals(codeString)) + return OID; + if ("positiveInt".equals(codeString)) + return POSITIVEINT; + if ("string".equals(codeString)) + return STRING; + if ("time".equals(codeString)) + return TIME; + if ("unsignedInt".equals(codeString)) + return UNSIGNEDINT; + if ("uri".equals(codeString)) + return URI; + if ("uuid".equals(codeString)) + return UUID; + if ("xhtml".equals(codeString)) + return XHTML; + if ("Account".equals(codeString)) + return ACCOUNT; + if ("AllergyIntolerance".equals(codeString)) + return ALLERGYINTOLERANCE; + if ("Appointment".equals(codeString)) + return APPOINTMENT; + if ("AppointmentResponse".equals(codeString)) + return APPOINTMENTRESPONSE; + if ("AuditEvent".equals(codeString)) + return AUDITEVENT; + if ("Basic".equals(codeString)) + return BASIC; + if ("Binary".equals(codeString)) + return BINARY; + if ("BodySite".equals(codeString)) + return BODYSITE; + if ("Bundle".equals(codeString)) + return BUNDLE; + if ("CarePlan".equals(codeString)) + return CAREPLAN; + if ("CareTeam".equals(codeString)) + return CARETEAM; + if ("Claim".equals(codeString)) + return CLAIM; + if ("ClaimResponse".equals(codeString)) + return CLAIMRESPONSE; + if ("ClinicalImpression".equals(codeString)) + return CLINICALIMPRESSION; + if ("CodeSystem".equals(codeString)) + return CODESYSTEM; + if ("Communication".equals(codeString)) + return COMMUNICATION; + if ("CommunicationRequest".equals(codeString)) + return COMMUNICATIONREQUEST; + if ("CompartmentDefinition".equals(codeString)) + return COMPARTMENTDEFINITION; + if ("Composition".equals(codeString)) + return COMPOSITION; + if ("ConceptMap".equals(codeString)) + return CONCEPTMAP; + if ("Condition".equals(codeString)) + return CONDITION; + if ("Conformance".equals(codeString)) + return CONFORMANCE; + if ("Contract".equals(codeString)) + return CONTRACT; + if ("Coverage".equals(codeString)) + return COVERAGE; + if ("DataElement".equals(codeString)) + return DATAELEMENT; + if ("DecisionSupportRule".equals(codeString)) + return DECISIONSUPPORTRULE; + if ("DecisionSupportServiceModule".equals(codeString)) + return DECISIONSUPPORTSERVICEMODULE; + if ("DetectedIssue".equals(codeString)) + return DETECTEDISSUE; + if ("Device".equals(codeString)) + return DEVICE; + if ("DeviceComponent".equals(codeString)) + return DEVICECOMPONENT; + if ("DeviceMetric".equals(codeString)) + return DEVICEMETRIC; + if ("DeviceUseRequest".equals(codeString)) + return DEVICEUSEREQUEST; + if ("DeviceUseStatement".equals(codeString)) + return DEVICEUSESTATEMENT; + if ("DiagnosticOrder".equals(codeString)) + return DIAGNOSTICORDER; + if ("DiagnosticReport".equals(codeString)) + return DIAGNOSTICREPORT; + if ("DocumentManifest".equals(codeString)) + return DOCUMENTMANIFEST; + if ("DocumentReference".equals(codeString)) + return DOCUMENTREFERENCE; + if ("DomainResource".equals(codeString)) + return DOMAINRESOURCE; + if ("EligibilityRequest".equals(codeString)) + return ELIGIBILITYREQUEST; + if ("EligibilityResponse".equals(codeString)) + return ELIGIBILITYRESPONSE; + if ("Encounter".equals(codeString)) + return ENCOUNTER; + if ("EnrollmentRequest".equals(codeString)) + return ENROLLMENTREQUEST; + if ("EnrollmentResponse".equals(codeString)) + return ENROLLMENTRESPONSE; + if ("EpisodeOfCare".equals(codeString)) + return EPISODEOFCARE; + if ("ExpansionProfile".equals(codeString)) + return EXPANSIONPROFILE; + if ("ExplanationOfBenefit".equals(codeString)) + return EXPLANATIONOFBENEFIT; + if ("FamilyMemberHistory".equals(codeString)) + return FAMILYMEMBERHISTORY; + if ("Flag".equals(codeString)) + return FLAG; + if ("Goal".equals(codeString)) + return GOAL; + if ("Group".equals(codeString)) + return GROUP; + if ("GuidanceResponse".equals(codeString)) + return GUIDANCERESPONSE; + if ("HealthcareService".equals(codeString)) + return HEALTHCARESERVICE; + if ("ImagingExcerpt".equals(codeString)) + return IMAGINGEXCERPT; + if ("ImagingObjectSelection".equals(codeString)) + return IMAGINGOBJECTSELECTION; + if ("ImagingStudy".equals(codeString)) + return IMAGINGSTUDY; + if ("Immunization".equals(codeString)) + return IMMUNIZATION; + if ("ImmunizationRecommendation".equals(codeString)) + return IMMUNIZATIONRECOMMENDATION; + if ("ImplementationGuide".equals(codeString)) + return IMPLEMENTATIONGUIDE; + if ("Library".equals(codeString)) + return LIBRARY; + if ("Linkage".equals(codeString)) + return LINKAGE; + if ("List".equals(codeString)) + return LIST; + if ("Location".equals(codeString)) + return LOCATION; + if ("Measure".equals(codeString)) + return MEASURE; + if ("MeasureReport".equals(codeString)) + return MEASUREREPORT; + if ("Media".equals(codeString)) + return MEDIA; + if ("Medication".equals(codeString)) + return MEDICATION; + if ("MedicationAdministration".equals(codeString)) + return MEDICATIONADMINISTRATION; + if ("MedicationDispense".equals(codeString)) + return MEDICATIONDISPENSE; + if ("MedicationOrder".equals(codeString)) + return MEDICATIONORDER; + if ("MedicationStatement".equals(codeString)) + return MEDICATIONSTATEMENT; + if ("MessageHeader".equals(codeString)) + return MESSAGEHEADER; + if ("ModuleDefinition".equals(codeString)) + return MODULEDEFINITION; + if ("NamingSystem".equals(codeString)) + return NAMINGSYSTEM; + if ("NutritionOrder".equals(codeString)) + return NUTRITIONORDER; + if ("Observation".equals(codeString)) + return OBSERVATION; + if ("OperationDefinition".equals(codeString)) + return OPERATIONDEFINITION; + if ("OperationOutcome".equals(codeString)) + return OPERATIONOUTCOME; + if ("Order".equals(codeString)) + return ORDER; + if ("OrderResponse".equals(codeString)) + return ORDERRESPONSE; + if ("OrderSet".equals(codeString)) + return ORDERSET; + if ("Organization".equals(codeString)) + return ORGANIZATION; + if ("Parameters".equals(codeString)) + return PARAMETERS; + if ("Patient".equals(codeString)) + return PATIENT; + if ("PaymentNotice".equals(codeString)) + return PAYMENTNOTICE; + if ("PaymentReconciliation".equals(codeString)) + return PAYMENTRECONCILIATION; + if ("Person".equals(codeString)) + return PERSON; + if ("Practitioner".equals(codeString)) + return PRACTITIONER; + if ("PractitionerRole".equals(codeString)) + return PRACTITIONERROLE; + if ("Procedure".equals(codeString)) + return PROCEDURE; + if ("ProcedureRequest".equals(codeString)) + return PROCEDUREREQUEST; + if ("ProcessRequest".equals(codeString)) + return PROCESSREQUEST; + if ("ProcessResponse".equals(codeString)) + return PROCESSRESPONSE; + if ("Protocol".equals(codeString)) + return PROTOCOL; + if ("Provenance".equals(codeString)) + return PROVENANCE; + if ("Questionnaire".equals(codeString)) + return QUESTIONNAIRE; + if ("QuestionnaireResponse".equals(codeString)) + return QUESTIONNAIRERESPONSE; + if ("ReferralRequest".equals(codeString)) + return REFERRALREQUEST; + if ("RelatedPerson".equals(codeString)) + return RELATEDPERSON; + if ("Resource".equals(codeString)) + return RESOURCE; + if ("RiskAssessment".equals(codeString)) + return RISKASSESSMENT; + if ("Schedule".equals(codeString)) + return SCHEDULE; + if ("SearchParameter".equals(codeString)) + return SEARCHPARAMETER; + if ("Sequence".equals(codeString)) + return SEQUENCE; + if ("Slot".equals(codeString)) + return SLOT; + if ("Specimen".equals(codeString)) + return SPECIMEN; + if ("StructureDefinition".equals(codeString)) + return STRUCTUREDEFINITION; + if ("StructureMap".equals(codeString)) + return STRUCTUREMAP; + if ("Subscription".equals(codeString)) + return SUBSCRIPTION; + if ("Substance".equals(codeString)) + return SUBSTANCE; + if ("SupplyDelivery".equals(codeString)) + return SUPPLYDELIVERY; + if ("SupplyRequest".equals(codeString)) + return SUPPLYREQUEST; + if ("Task".equals(codeString)) + return TASK; + if ("TestScript".equals(codeString)) + return TESTSCRIPT; + if ("ValueSet".equals(codeString)) + return VALUESET; + if ("VisionPrescription".equals(codeString)) + return VISIONPRESCRIPTION; + throw new FHIRException("Unknown FHIRDefinedType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIONDEFINITION: return "ActionDefinition"; + case ADDRESS: return "Address"; + case AGE: return "Age"; + case ANNOTATION: return "Annotation"; + case ATTACHMENT: return "Attachment"; + case BACKBONEELEMENT: return "BackboneElement"; + case CODEABLECONCEPT: return "CodeableConcept"; + case CODING: return "Coding"; + case CONTACTPOINT: return "ContactPoint"; + case COUNT: return "Count"; + case DATAREQUIREMENT: return "DataRequirement"; + case DISTANCE: return "Distance"; + case DURATION: return "Duration"; + case ELEMENT: return "Element"; + case ELEMENTDEFINITION: return "ElementDefinition"; + case EXTENSION: return "Extension"; + case HUMANNAME: return "HumanName"; + case IDENTIFIER: return "Identifier"; + case META: return "Meta"; + case MODULEMETADATA: return "ModuleMetadata"; + case MONEY: return "Money"; + case NARRATIVE: return "Narrative"; + case PARAMETERDEFINITION: return "ParameterDefinition"; + case PERIOD: return "Period"; + case QUANTITY: return "Quantity"; + case RANGE: return "Range"; + case RATIO: return "Ratio"; + case REFERENCE: return "Reference"; + case SAMPLEDDATA: return "SampledData"; + case SIGNATURE: return "Signature"; + case SIMPLEQUANTITY: return "SimpleQuantity"; + case TIMING: return "Timing"; + case TRIGGERDEFINITION: return "TriggerDefinition"; + case BASE64BINARY: return "base64Binary"; + case BOOLEAN: return "boolean"; + case CODE: return "code"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case DECIMAL: return "decimal"; + case ID: return "id"; + case INSTANT: return "instant"; + case INTEGER: return "integer"; + case MARKDOWN: return "markdown"; + case OID: return "oid"; + case POSITIVEINT: return "positiveInt"; + case STRING: return "string"; + case TIME: return "time"; + case UNSIGNEDINT: return "unsignedInt"; + case URI: return "uri"; + case UUID: return "uuid"; + case XHTML: return "xhtml"; + case ACCOUNT: return "Account"; + case ALLERGYINTOLERANCE: return "AllergyIntolerance"; + case APPOINTMENT: return "Appointment"; + case APPOINTMENTRESPONSE: return "AppointmentResponse"; + case AUDITEVENT: return "AuditEvent"; + case BASIC: return "Basic"; + case BINARY: return "Binary"; + case BODYSITE: return "BodySite"; + case BUNDLE: return "Bundle"; + case CAREPLAN: return "CarePlan"; + case CARETEAM: return "CareTeam"; + case CLAIM: return "Claim"; + case CLAIMRESPONSE: return "ClaimResponse"; + case CLINICALIMPRESSION: return "ClinicalImpression"; + case CODESYSTEM: return "CodeSystem"; + case COMMUNICATION: return "Communication"; + case COMMUNICATIONREQUEST: return "CommunicationRequest"; + case COMPARTMENTDEFINITION: return "CompartmentDefinition"; + case COMPOSITION: return "Composition"; + case CONCEPTMAP: return "ConceptMap"; + case CONDITION: return "Condition"; + case CONFORMANCE: return "Conformance"; + case CONTRACT: return "Contract"; + case COVERAGE: return "Coverage"; + case DATAELEMENT: return "DataElement"; + case DECISIONSUPPORTRULE: return "DecisionSupportRule"; + case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; + case DETECTEDISSUE: return "DetectedIssue"; + case DEVICE: return "Device"; + case DEVICECOMPONENT: return "DeviceComponent"; + case DEVICEMETRIC: return "DeviceMetric"; + case DEVICEUSEREQUEST: return "DeviceUseRequest"; + case DEVICEUSESTATEMENT: return "DeviceUseStatement"; + case DIAGNOSTICORDER: return "DiagnosticOrder"; + case DIAGNOSTICREPORT: return "DiagnosticReport"; + case DOCUMENTMANIFEST: return "DocumentManifest"; + case DOCUMENTREFERENCE: return "DocumentReference"; + case DOMAINRESOURCE: return "DomainResource"; + case ELIGIBILITYREQUEST: return "EligibilityRequest"; + case ELIGIBILITYRESPONSE: return "EligibilityResponse"; + case ENCOUNTER: return "Encounter"; + case ENROLLMENTREQUEST: return "EnrollmentRequest"; + case ENROLLMENTRESPONSE: return "EnrollmentResponse"; + case EPISODEOFCARE: return "EpisodeOfCare"; + case EXPANSIONPROFILE: return "ExpansionProfile"; + case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; + case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; + case FLAG: return "Flag"; + case GOAL: return "Goal"; + case GROUP: return "Group"; + case GUIDANCERESPONSE: return "GuidanceResponse"; + case HEALTHCARESERVICE: return "HealthcareService"; + case IMAGINGEXCERPT: return "ImagingExcerpt"; + case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; + case IMAGINGSTUDY: return "ImagingStudy"; + case IMMUNIZATION: return "Immunization"; + case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; + case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; + case LIBRARY: return "Library"; + case LINKAGE: return "Linkage"; + case LIST: return "List"; + case LOCATION: return "Location"; + case MEASURE: return "Measure"; + case MEASUREREPORT: return "MeasureReport"; + case MEDIA: return "Media"; + case MEDICATION: return "Medication"; + case MEDICATIONADMINISTRATION: return "MedicationAdministration"; + case MEDICATIONDISPENSE: return "MedicationDispense"; + case MEDICATIONORDER: return "MedicationOrder"; + case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEHEADER: return "MessageHeader"; + case MODULEDEFINITION: return "ModuleDefinition"; + case NAMINGSYSTEM: return "NamingSystem"; + case NUTRITIONORDER: return "NutritionOrder"; + case OBSERVATION: return "Observation"; + case OPERATIONDEFINITION: return "OperationDefinition"; + case OPERATIONOUTCOME: return "OperationOutcome"; + case ORDER: return "Order"; + case ORDERRESPONSE: return "OrderResponse"; + case ORDERSET: return "OrderSet"; + case ORGANIZATION: return "Organization"; + case PARAMETERS: return "Parameters"; + case PATIENT: return "Patient"; + case PAYMENTNOTICE: return "PaymentNotice"; + case PAYMENTRECONCILIATION: return "PaymentReconciliation"; + case PERSON: return "Person"; + case PRACTITIONER: return "Practitioner"; + case PRACTITIONERROLE: return "PractitionerRole"; + case PROCEDURE: return "Procedure"; + case PROCEDUREREQUEST: return "ProcedureRequest"; + case PROCESSREQUEST: return "ProcessRequest"; + case PROCESSRESPONSE: return "ProcessResponse"; + case PROTOCOL: return "Protocol"; + case PROVENANCE: return "Provenance"; + case QUESTIONNAIRE: return "Questionnaire"; + case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; + case REFERRALREQUEST: return "ReferralRequest"; + case RELATEDPERSON: return "RelatedPerson"; + case RESOURCE: return "Resource"; + case RISKASSESSMENT: return "RiskAssessment"; + case SCHEDULE: return "Schedule"; + case SEARCHPARAMETER: return "SearchParameter"; + case SEQUENCE: return "Sequence"; + case SLOT: return "Slot"; + case SPECIMEN: return "Specimen"; + case STRUCTUREDEFINITION: return "StructureDefinition"; + case STRUCTUREMAP: return "StructureMap"; + case SUBSCRIPTION: return "Subscription"; + case SUBSTANCE: return "Substance"; + case SUPPLYDELIVERY: return "SupplyDelivery"; + case SUPPLYREQUEST: return "SupplyRequest"; + case TASK: return "Task"; + case TESTSCRIPT: return "TestScript"; + case VALUESET: return "ValueSet"; + case VISIONPRESCRIPTION: return "VisionPrescription"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIONDEFINITION: return "http://hl7.org/fhir/data-types"; + case ADDRESS: return "http://hl7.org/fhir/data-types"; + case AGE: return "http://hl7.org/fhir/data-types"; + case ANNOTATION: return "http://hl7.org/fhir/data-types"; + case ATTACHMENT: return "http://hl7.org/fhir/data-types"; + case BACKBONEELEMENT: return "http://hl7.org/fhir/data-types"; + case CODEABLECONCEPT: return "http://hl7.org/fhir/data-types"; + case CODING: return "http://hl7.org/fhir/data-types"; + case CONTACTPOINT: return "http://hl7.org/fhir/data-types"; + case COUNT: return "http://hl7.org/fhir/data-types"; + case DATAREQUIREMENT: return "http://hl7.org/fhir/data-types"; + case DISTANCE: return "http://hl7.org/fhir/data-types"; + case DURATION: return "http://hl7.org/fhir/data-types"; + case ELEMENT: return "http://hl7.org/fhir/data-types"; + case ELEMENTDEFINITION: return "http://hl7.org/fhir/data-types"; + case EXTENSION: return "http://hl7.org/fhir/data-types"; + case HUMANNAME: return "http://hl7.org/fhir/data-types"; + case IDENTIFIER: return "http://hl7.org/fhir/data-types"; + case META: return "http://hl7.org/fhir/data-types"; + case MODULEMETADATA: return "http://hl7.org/fhir/data-types"; + case MONEY: return "http://hl7.org/fhir/data-types"; + case NARRATIVE: return "http://hl7.org/fhir/data-types"; + case PARAMETERDEFINITION: return "http://hl7.org/fhir/data-types"; + case PERIOD: return "http://hl7.org/fhir/data-types"; + case QUANTITY: return "http://hl7.org/fhir/data-types"; + case RANGE: return "http://hl7.org/fhir/data-types"; + case RATIO: return "http://hl7.org/fhir/data-types"; + case REFERENCE: return "http://hl7.org/fhir/data-types"; + case SAMPLEDDATA: return "http://hl7.org/fhir/data-types"; + case SIGNATURE: return "http://hl7.org/fhir/data-types"; + case SIMPLEQUANTITY: return "http://hl7.org/fhir/data-types"; + case TIMING: return "http://hl7.org/fhir/data-types"; + case TRIGGERDEFINITION: return "http://hl7.org/fhir/data-types"; + case BASE64BINARY: return "http://hl7.org/fhir/data-types"; + case BOOLEAN: return "http://hl7.org/fhir/data-types"; + case CODE: return "http://hl7.org/fhir/data-types"; + case DATE: return "http://hl7.org/fhir/data-types"; + case DATETIME: return "http://hl7.org/fhir/data-types"; + case DECIMAL: return "http://hl7.org/fhir/data-types"; + case ID: return "http://hl7.org/fhir/data-types"; + case INSTANT: return "http://hl7.org/fhir/data-types"; + case INTEGER: return "http://hl7.org/fhir/data-types"; + case MARKDOWN: return "http://hl7.org/fhir/data-types"; + case OID: return "http://hl7.org/fhir/data-types"; + case POSITIVEINT: return "http://hl7.org/fhir/data-types"; + case STRING: return "http://hl7.org/fhir/data-types"; + case TIME: return "http://hl7.org/fhir/data-types"; + case UNSIGNEDINT: return "http://hl7.org/fhir/data-types"; + case URI: return "http://hl7.org/fhir/data-types"; + case UUID: return "http://hl7.org/fhir/data-types"; + case XHTML: return "http://hl7.org/fhir/data-types"; + case ACCOUNT: return "http://hl7.org/fhir/resource-types"; + case ALLERGYINTOLERANCE: return "http://hl7.org/fhir/resource-types"; + case APPOINTMENT: return "http://hl7.org/fhir/resource-types"; + case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; + case AUDITEVENT: return "http://hl7.org/fhir/resource-types"; + case BASIC: return "http://hl7.org/fhir/resource-types"; + case BINARY: return "http://hl7.org/fhir/resource-types"; + case BODYSITE: return "http://hl7.org/fhir/resource-types"; + case BUNDLE: return "http://hl7.org/fhir/resource-types"; + case CAREPLAN: return "http://hl7.org/fhir/resource-types"; + case CARETEAM: return "http://hl7.org/fhir/resource-types"; + case CLAIM: return "http://hl7.org/fhir/resource-types"; + case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types"; + case CLINICALIMPRESSION: return "http://hl7.org/fhir/resource-types"; + case CODESYSTEM: return "http://hl7.org/fhir/resource-types"; + case COMMUNICATION: return "http://hl7.org/fhir/resource-types"; + case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; + case COMPARTMENTDEFINITION: return "http://hl7.org/fhir/resource-types"; + case COMPOSITION: return "http://hl7.org/fhir/resource-types"; + case CONCEPTMAP: return "http://hl7.org/fhir/resource-types"; + case CONDITION: return "http://hl7.org/fhir/resource-types"; + case CONFORMANCE: return "http://hl7.org/fhir/resource-types"; + case CONTRACT: return "http://hl7.org/fhir/resource-types"; + case COVERAGE: return "http://hl7.org/fhir/resource-types"; + case DATAELEMENT: return "http://hl7.org/fhir/resource-types"; + case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/resource-types"; + case DECISIONSUPPORTSERVICEMODULE: return "http://hl7.org/fhir/resource-types"; + case DETECTEDISSUE: return "http://hl7.org/fhir/resource-types"; + case DEVICE: return "http://hl7.org/fhir/resource-types"; + case DEVICECOMPONENT: return "http://hl7.org/fhir/resource-types"; + case DEVICEMETRIC: return "http://hl7.org/fhir/resource-types"; + case DEVICEUSEREQUEST: return "http://hl7.org/fhir/resource-types"; + case DEVICEUSESTATEMENT: return "http://hl7.org/fhir/resource-types"; + case DIAGNOSTICORDER: return "http://hl7.org/fhir/resource-types"; + case DIAGNOSTICREPORT: return "http://hl7.org/fhir/resource-types"; + case DOCUMENTMANIFEST: return "http://hl7.org/fhir/resource-types"; + case DOCUMENTREFERENCE: return "http://hl7.org/fhir/resource-types"; + case DOMAINRESOURCE: return "http://hl7.org/fhir/resource-types"; + case ELIGIBILITYREQUEST: return "http://hl7.org/fhir/resource-types"; + case ELIGIBILITYRESPONSE: return "http://hl7.org/fhir/resource-types"; + case ENCOUNTER: return "http://hl7.org/fhir/resource-types"; + case ENROLLMENTREQUEST: return "http://hl7.org/fhir/resource-types"; + case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; + case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types"; + case EXPANSIONPROFILE: return "http://hl7.org/fhir/resource-types"; + case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types"; + case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types"; + case FLAG: return "http://hl7.org/fhir/resource-types"; + case GOAL: return "http://hl7.org/fhir/resource-types"; + case GROUP: return "http://hl7.org/fhir/resource-types"; + case GUIDANCERESPONSE: return "http://hl7.org/fhir/resource-types"; + case HEALTHCARESERVICE: return "http://hl7.org/fhir/resource-types"; + case IMAGINGEXCERPT: return "http://hl7.org/fhir/resource-types"; + case IMAGINGOBJECTSELECTION: return "http://hl7.org/fhir/resource-types"; + case IMAGINGSTUDY: return "http://hl7.org/fhir/resource-types"; + case IMMUNIZATION: return "http://hl7.org/fhir/resource-types"; + case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/resource-types"; + case IMPLEMENTATIONGUIDE: return "http://hl7.org/fhir/resource-types"; + case LIBRARY: return "http://hl7.org/fhir/resource-types"; + case LINKAGE: return "http://hl7.org/fhir/resource-types"; + case LIST: return "http://hl7.org/fhir/resource-types"; + case LOCATION: return "http://hl7.org/fhir/resource-types"; + case MEASURE: return "http://hl7.org/fhir/resource-types"; + case MEASUREREPORT: return "http://hl7.org/fhir/resource-types"; + case MEDIA: return "http://hl7.org/fhir/resource-types"; + case MEDICATION: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONADMINISTRATION: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONORDER: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; + case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; + case MODULEDEFINITION: return "http://hl7.org/fhir/resource-types"; + case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; + case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types"; + case OBSERVATION: return "http://hl7.org/fhir/resource-types"; + case OPERATIONDEFINITION: return "http://hl7.org/fhir/resource-types"; + case OPERATIONOUTCOME: return "http://hl7.org/fhir/resource-types"; + case ORDER: return "http://hl7.org/fhir/resource-types"; + case ORDERRESPONSE: return "http://hl7.org/fhir/resource-types"; + case ORDERSET: return "http://hl7.org/fhir/resource-types"; + case ORGANIZATION: return "http://hl7.org/fhir/resource-types"; + case PARAMETERS: return "http://hl7.org/fhir/resource-types"; + case PATIENT: return "http://hl7.org/fhir/resource-types"; + case PAYMENTNOTICE: return "http://hl7.org/fhir/resource-types"; + case PAYMENTRECONCILIATION: return "http://hl7.org/fhir/resource-types"; + case PERSON: return "http://hl7.org/fhir/resource-types"; + case PRACTITIONER: return "http://hl7.org/fhir/resource-types"; + case PRACTITIONERROLE: return "http://hl7.org/fhir/resource-types"; + case PROCEDURE: return "http://hl7.org/fhir/resource-types"; + case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types"; + case PROCESSREQUEST: return "http://hl7.org/fhir/resource-types"; + case PROCESSRESPONSE: return "http://hl7.org/fhir/resource-types"; + case PROTOCOL: return "http://hl7.org/fhir/resource-types"; + case PROVENANCE: return "http://hl7.org/fhir/resource-types"; + case QUESTIONNAIRE: return "http://hl7.org/fhir/resource-types"; + case QUESTIONNAIRERESPONSE: return "http://hl7.org/fhir/resource-types"; + case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; + case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; + case RESOURCE: return "http://hl7.org/fhir/resource-types"; + case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; + case SCHEDULE: return "http://hl7.org/fhir/resource-types"; + case SEARCHPARAMETER: return "http://hl7.org/fhir/resource-types"; + case SEQUENCE: return "http://hl7.org/fhir/resource-types"; + case SLOT: return "http://hl7.org/fhir/resource-types"; + case SPECIMEN: return "http://hl7.org/fhir/resource-types"; + case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types"; + case STRUCTUREMAP: return "http://hl7.org/fhir/resource-types"; + case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types"; + case SUBSTANCE: return "http://hl7.org/fhir/resource-types"; + case SUPPLYDELIVERY: return "http://hl7.org/fhir/resource-types"; + case SUPPLYREQUEST: return "http://hl7.org/fhir/resource-types"; + case TASK: return "http://hl7.org/fhir/resource-types"; + case TESTSCRIPT: return "http://hl7.org/fhir/resource-types"; + case VALUESET: return "http://hl7.org/fhir/resource-types"; + case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIONDEFINITION: return "The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library."; + case ADDRESS: return "An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world."; + case AGE: return ""; + case ANNOTATION: return "A text note which also contains information about who made the statement and when."; + case ATTACHMENT: return "For referring to data content defined in other formats."; + case BACKBONEELEMENT: return "Base definition for all elements that are defined inside a resource - but not those in a data type."; + case CODEABLECONCEPT: return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text."; + case CODING: return "A reference to a code defined by a terminology system."; + case CONTACTPOINT: return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc."; + case COUNT: return ""; + case DATAREQUIREMENT: return "Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data."; + case DISTANCE: return ""; + case DURATION: return ""; + case ELEMENT: return "Base definition for all elements in a resource."; + case ELEMENTDEFINITION: return "Captures constraints on each element within the resource, profile, or extension."; + case EXTENSION: return "Optional Extensions Element - found in all resources."; + case HUMANNAME: return "A human's name with the ability to identify parts and usage."; + case IDENTIFIER: return "A technical identifier - identifies some entity uniquely and unambiguously."; + case META: return "The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource."; + case MODULEMETADATA: return "The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information."; + case MONEY: return ""; + case NARRATIVE: return "A human-readable formatted text, including images."; + case PARAMETERDEFINITION: return "The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse."; + case PERIOD: return "A time period defined by a start and end date and optionally time."; + case QUANTITY: return "A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies."; + case RANGE: return "A set of ordered Quantities defined by a low and high limit."; + case RATIO: return "A relationship of two Quantity values - expressed as a numerator and a denominator."; + case REFERENCE: return "A reference from one resource to another."; + case SAMPLEDDATA: return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data."; + case SIGNATURE: return "A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities."; + case SIMPLEQUANTITY: return ""; + case TIMING: return "Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds."; + case TRIGGERDEFINITION: return "A description of a triggering event."; + case BASE64BINARY: return "A stream of bytes"; + case BOOLEAN: return "Value of \"true\" or \"false\""; + case CODE: return "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents"; + case DATE: return "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates."; + case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates."; + case DECIMAL: return "A rational number with implicit precision"; + case ID: return "Any combination of letters, numerals, \"-\" and \".\", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive."; + case INSTANT: return "An instant in time - known at least to the second"; + case INTEGER: return "A whole number"; + case MARKDOWN: return "A string that may contain markdown syntax for optional processing by a mark down presentation engine"; + case OID: return "An oid represented as a URI"; + case POSITIVEINT: return "An integer with a value that is positive (e.g. >0)"; + case STRING: return "A sequence of Unicode characters"; + case TIME: return "A time during the day, with no date specified"; + case UNSIGNEDINT: return "An integer with a value that is not negative (e.g. >= 0)"; + case URI: return "String of characters used to identify a name or a resource"; + case UUID: return "A UUID, represented as a URI"; + case XHTML: return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)"; + case ACCOUNT: return "A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc."; + case ALLERGYINTOLERANCE: return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance."; + case APPOINTMENT: return "A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s)."; + case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection."; + case AUDITEVENT: return "A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage."; + case BASIC: return "Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification."; + case BINARY: return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc."; + case BODYSITE: return "Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case."; + case BUNDLE: return "A container for a collection of resources."; + case CAREPLAN: return "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions."; + case CARETEAM: return "The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient."; + case CLAIM: return "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."; + case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource."; + case CLINICALIMPRESSION: return "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. This resource is called \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion with the recording of assessment tools such as Apgar score."; + case CODESYSTEM: return "A code system resource specifies a set of codes drawn from one or more code systems."; + case COMMUNICATION: return "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."; + case COMMUNICATIONREQUEST: return "A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition."; + case COMPARTMENTDEFINITION: return "A compartment definition that defines how resources are accessed on a server."; + case COMPOSITION: return "A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained."; + case CONCEPTMAP: return "A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models."; + case CONDITION: return "Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary."; + case CONFORMANCE: return "A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation."; + case CONTRACT: return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters."; + case COVERAGE: return "Financial instrument which may be used to pay for or reimburse health care products and services."; + case DATAELEMENT: return "The formal description of a single piece of information that can be gathered and reported."; + case DECISIONSUPPORTRULE: return "This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events."; + case DECISIONSUPPORTSERVICEMODULE: return "The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking."; + case DETECTEDISSUE: return "Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc."; + case DEVICE: return "This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc."; + case DEVICECOMPONENT: return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device."; + case DEVICEMETRIC: return "Describes a measurement, calculation or setting capability of a medical device."; + case DEVICEUSEREQUEST: return "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker."; + case DEVICEUSESTATEMENT: return "A record of a device being used by a patient where the record is the result of a report from the patient or another clinician."; + case DIAGNOSTICORDER: return "A record of a request for a diagnostic investigation service to be performed."; + case DIAGNOSTICREPORT: return "The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports."; + case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; + case DOCUMENTREFERENCE: return "A reference to a document ."; + case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; + case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; + case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; + case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."; + case ENROLLMENTREQUEST: return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage."; + case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource."; + case EPISODEOFCARE: return "An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time."; + case EXPANSIONPROFILE: return "Resource to define constraints on the Expansion of a FHIR ValueSet."; + case EXPLANATIONOFBENEFIT: return "This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided."; + case FAMILYMEMBERHISTORY: return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient."; + case FLAG: return "Prospective warnings of potential issues when providing care to the patient."; + case GOAL: return "Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc."; + case GROUP: return "Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization."; + case GUIDANCERESPONSE: return "A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken."; + case HEALTHCARESERVICE: return "The details of a healthcare service available at a location."; + case IMAGINGEXCERPT: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; + case IMAGINGOBJECTSELECTION: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; + case IMAGINGSTUDY: return "Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities."; + case IMMUNIZATION: return "Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed."; + case IMMUNIZATIONRECOMMENDATION: return "A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification."; + case IMPLEMENTATIONGUIDE: return "A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts."; + case LIBRARY: return "The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library."; + case LINKAGE: return "Identifies two or more records (resource instances) that are referring to the same real-world \"occurrence\"."; + case LIST: return "A set of information summarized from a list of other resources."; + case LOCATION: return "Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated."; + case MEASURE: return "The Measure resource provides the definition of a quality measure."; + case MEASUREREPORT: return "The MeasureReport resource contains the results of evaluating a measure."; + case MEDIA: return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference."; + case MEDICATION: return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication."; + case MEDICATIONADMINISTRATION: return "Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner."; + case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; + case MEDICATIONORDER: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationOrder\" rather than \"MedicationPrescription\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc."; + case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; + case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle."; + case MODULEDEFINITION: return "The ModuleDefinition resource defines the data requirements for a quality artifact."; + case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; + case NUTRITIONORDER: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; + case OBSERVATION: return "Measurements and simple assertions made about a patient, device or other subject."; + case OPERATIONDEFINITION: return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction)."; + case OPERATIONOUTCOME: return "A collection of error, warning or information messages that result from a system action."; + case ORDER: return "A request to perform an action."; + case ORDERRESPONSE: return "A response to an order."; + case ORDERSET: return "This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support."; + case ORGANIZATION: return "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."; + case PARAMETERS: return "This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it."; + case PATIENT: return "Demographics and other administrative information about an individual or animal receiving care or other health-related services."; + case PAYMENTNOTICE: return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references."; + case PAYMENTRECONCILIATION: return "This resource provides payment details and claim references supporting a bulk payment."; + case PERSON: return "Demographics and administrative information about a person independent of a specific health-related context."; + case PRACTITIONER: return "A person who is directly or indirectly involved in the provisioning of healthcare."; + case PRACTITIONERROLE: return "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time."; + case PROCEDURE: return "An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy."; + case PROCEDUREREQUEST: return "A request for a procedure to be performed. May be a proposal or an order."; + case PROCESSREQUEST: return "This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources."; + case PROCESSRESPONSE: return "This resource provides processing status, errors and notes from the processing of a resource."; + case PROTOCOL: return "A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points."; + case PROVENANCE: return "Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies."; + case QUESTIONNAIRE: return "A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; + case QUESTIONNAIRERESPONSE: return "A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; + case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; + case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process."; + case RESOURCE: return "This is the base resource type for everything."; + case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; + case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; + case SEARCHPARAMETER: return "A search parameter that defines a named search item that can be used to search/filter on a resource."; + case SEQUENCE: return "Variation and Sequence data."; + case SLOT: return "A slot of time on a schedule that may be available for booking appointments."; + case SPECIMEN: return "A sample to be used for analysis."; + case STRUCTUREDEFINITION: return "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types."; + case STRUCTUREMAP: return "A Map of relationships between 2 structures that can be used to transform data."; + case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action."; + case SUBSTANCE: return "A homogeneous material with a definite composition."; + case SUPPLYDELIVERY: return "Record of delivery of what is supplied."; + case SUPPLYREQUEST: return "A record of a request for a medication, substance or device used in the healthcare setting."; + case TASK: return "A task to be performed."; + case TESTSCRIPT: return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification."; + case VALUESET: return "A value set specifies a set of codes drawn from one or more code systems."; + case VISIONPRESCRIPTION: return "An authorization for the supply of glasses and/or contact lenses to a patient."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIONDEFINITION: return "ActionDefinition"; + case ADDRESS: return "Address"; + case AGE: return "Age"; + case ANNOTATION: return "Annotation"; + case ATTACHMENT: return "Attachment"; + case BACKBONEELEMENT: return "BackboneElement"; + case CODEABLECONCEPT: return "CodeableConcept"; + case CODING: return "Coding"; + case CONTACTPOINT: return "ContactPoint"; + case COUNT: return "Count"; + case DATAREQUIREMENT: return "DataRequirement"; + case DISTANCE: return "Distance"; + case DURATION: return "Duration"; + case ELEMENT: return "Element"; + case ELEMENTDEFINITION: return "ElementDefinition"; + case EXTENSION: return "Extension"; + case HUMANNAME: return "HumanName"; + case IDENTIFIER: return "Identifier"; + case META: return "Meta"; + case MODULEMETADATA: return "ModuleMetadata"; + case MONEY: return "Money"; + case NARRATIVE: return "Narrative"; + case PARAMETERDEFINITION: return "ParameterDefinition"; + case PERIOD: return "Period"; + case QUANTITY: return "Quantity"; + case RANGE: return "Range"; + case RATIO: return "Ratio"; + case REFERENCE: return "Reference"; + case SAMPLEDDATA: return "SampledData"; + case SIGNATURE: return "Signature"; + case SIMPLEQUANTITY: return "SimpleQuantity"; + case TIMING: return "Timing"; + case TRIGGERDEFINITION: return "TriggerDefinition"; + case BASE64BINARY: return "base64Binary"; + case BOOLEAN: return "boolean"; + case CODE: return "code"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case DECIMAL: return "decimal"; + case ID: return "id"; + case INSTANT: return "instant"; + case INTEGER: return "integer"; + case MARKDOWN: return "markdown"; + case OID: return "oid"; + case POSITIVEINT: return "positiveInt"; + case STRING: return "string"; + case TIME: return "time"; + case UNSIGNEDINT: return "unsignedInt"; + case URI: return "uri"; + case UUID: return "uuid"; + case XHTML: return "XHTML"; + case ACCOUNT: return "Account"; + case ALLERGYINTOLERANCE: return "AllergyIntolerance"; + case APPOINTMENT: return "Appointment"; + case APPOINTMENTRESPONSE: return "AppointmentResponse"; + case AUDITEVENT: return "AuditEvent"; + case BASIC: return "Basic"; + case BINARY: return "Binary"; + case BODYSITE: return "BodySite"; + case BUNDLE: return "Bundle"; + case CAREPLAN: return "CarePlan"; + case CARETEAM: return "CareTeam"; + case CLAIM: return "Claim"; + case CLAIMRESPONSE: return "ClaimResponse"; + case CLINICALIMPRESSION: return "ClinicalImpression"; + case CODESYSTEM: return "CodeSystem"; + case COMMUNICATION: return "Communication"; + case COMMUNICATIONREQUEST: return "CommunicationRequest"; + case COMPARTMENTDEFINITION: return "CompartmentDefinition"; + case COMPOSITION: return "Composition"; + case CONCEPTMAP: return "ConceptMap"; + case CONDITION: return "Condition"; + case CONFORMANCE: return "Conformance"; + case CONTRACT: return "Contract"; + case COVERAGE: return "Coverage"; + case DATAELEMENT: return "DataElement"; + case DECISIONSUPPORTRULE: return "DecisionSupportRule"; + case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; + case DETECTEDISSUE: return "DetectedIssue"; + case DEVICE: return "Device"; + case DEVICECOMPONENT: return "DeviceComponent"; + case DEVICEMETRIC: return "DeviceMetric"; + case DEVICEUSEREQUEST: return "DeviceUseRequest"; + case DEVICEUSESTATEMENT: return "DeviceUseStatement"; + case DIAGNOSTICORDER: return "DiagnosticOrder"; + case DIAGNOSTICREPORT: return "DiagnosticReport"; + case DOCUMENTMANIFEST: return "DocumentManifest"; + case DOCUMENTREFERENCE: return "DocumentReference"; + case DOMAINRESOURCE: return "DomainResource"; + case ELIGIBILITYREQUEST: return "EligibilityRequest"; + case ELIGIBILITYRESPONSE: return "EligibilityResponse"; + case ENCOUNTER: return "Encounter"; + case ENROLLMENTREQUEST: return "EnrollmentRequest"; + case ENROLLMENTRESPONSE: return "EnrollmentResponse"; + case EPISODEOFCARE: return "EpisodeOfCare"; + case EXPANSIONPROFILE: return "ExpansionProfile"; + case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; + case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; + case FLAG: return "Flag"; + case GOAL: return "Goal"; + case GROUP: return "Group"; + case GUIDANCERESPONSE: return "GuidanceResponse"; + case HEALTHCARESERVICE: return "HealthcareService"; + case IMAGINGEXCERPT: return "ImagingExcerpt"; + case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; + case IMAGINGSTUDY: return "ImagingStudy"; + case IMMUNIZATION: return "Immunization"; + case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; + case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; + case LIBRARY: return "Library"; + case LINKAGE: return "Linkage"; + case LIST: return "List"; + case LOCATION: return "Location"; + case MEASURE: return "Measure"; + case MEASUREREPORT: return "MeasureReport"; + case MEDIA: return "Media"; + case MEDICATION: return "Medication"; + case MEDICATIONADMINISTRATION: return "MedicationAdministration"; + case MEDICATIONDISPENSE: return "MedicationDispense"; + case MEDICATIONORDER: return "MedicationOrder"; + case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEHEADER: return "MessageHeader"; + case MODULEDEFINITION: return "ModuleDefinition"; + case NAMINGSYSTEM: return "NamingSystem"; + case NUTRITIONORDER: return "NutritionOrder"; + case OBSERVATION: return "Observation"; + case OPERATIONDEFINITION: return "OperationDefinition"; + case OPERATIONOUTCOME: return "OperationOutcome"; + case ORDER: return "Order"; + case ORDERRESPONSE: return "OrderResponse"; + case ORDERSET: return "OrderSet"; + case ORGANIZATION: return "Organization"; + case PARAMETERS: return "Parameters"; + case PATIENT: return "Patient"; + case PAYMENTNOTICE: return "PaymentNotice"; + case PAYMENTRECONCILIATION: return "PaymentReconciliation"; + case PERSON: return "Person"; + case PRACTITIONER: return "Practitioner"; + case PRACTITIONERROLE: return "PractitionerRole"; + case PROCEDURE: return "Procedure"; + case PROCEDUREREQUEST: return "ProcedureRequest"; + case PROCESSREQUEST: return "ProcessRequest"; + case PROCESSRESPONSE: return "ProcessResponse"; + case PROTOCOL: return "Protocol"; + case PROVENANCE: return "Provenance"; + case QUESTIONNAIRE: return "Questionnaire"; + case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; + case REFERRALREQUEST: return "ReferralRequest"; + case RELATEDPERSON: return "RelatedPerson"; + case RESOURCE: return "Resource"; + case RISKASSESSMENT: return "RiskAssessment"; + case SCHEDULE: return "Schedule"; + case SEARCHPARAMETER: return "SearchParameter"; + case SEQUENCE: return "Sequence"; + case SLOT: return "Slot"; + case SPECIMEN: return "Specimen"; + case STRUCTUREDEFINITION: return "StructureDefinition"; + case STRUCTUREMAP: return "StructureMap"; + case SUBSCRIPTION: return "Subscription"; + case SUBSTANCE: return "Substance"; + case SUPPLYDELIVERY: return "SupplyDelivery"; + case SUPPLYREQUEST: return "SupplyRequest"; + case TASK: return "Task"; + case TESTSCRIPT: return "TestScript"; + case VALUESET: return "ValueSet"; + case VISIONPRESCRIPTION: return "VisionPrescription"; + default: return "?"; + } + } + } + + public static class FHIRDefinedTypeEnumFactory implements EnumFactory { + public FHIRDefinedType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return FHIRDefinedType.ACTIONDEFINITION; + if ("Address".equals(codeString)) + return FHIRDefinedType.ADDRESS; + if ("Age".equals(codeString)) + return FHIRDefinedType.AGE; + if ("Annotation".equals(codeString)) + return FHIRDefinedType.ANNOTATION; + if ("Attachment".equals(codeString)) + return FHIRDefinedType.ATTACHMENT; + if ("BackboneElement".equals(codeString)) + return FHIRDefinedType.BACKBONEELEMENT; + if ("CodeableConcept".equals(codeString)) + return FHIRDefinedType.CODEABLECONCEPT; + if ("Coding".equals(codeString)) + return FHIRDefinedType.CODING; + if ("ContactPoint".equals(codeString)) + return FHIRDefinedType.CONTACTPOINT; + if ("Count".equals(codeString)) + return FHIRDefinedType.COUNT; + if ("DataRequirement".equals(codeString)) + return FHIRDefinedType.DATAREQUIREMENT; + if ("Distance".equals(codeString)) + return FHIRDefinedType.DISTANCE; + if ("Duration".equals(codeString)) + return FHIRDefinedType.DURATION; + if ("Element".equals(codeString)) + return FHIRDefinedType.ELEMENT; + if ("ElementDefinition".equals(codeString)) + return FHIRDefinedType.ELEMENTDEFINITION; + if ("Extension".equals(codeString)) + return FHIRDefinedType.EXTENSION; + if ("HumanName".equals(codeString)) + return FHIRDefinedType.HUMANNAME; + if ("Identifier".equals(codeString)) + return FHIRDefinedType.IDENTIFIER; + if ("Meta".equals(codeString)) + return FHIRDefinedType.META; + if ("ModuleMetadata".equals(codeString)) + return FHIRDefinedType.MODULEMETADATA; + if ("Money".equals(codeString)) + return FHIRDefinedType.MONEY; + if ("Narrative".equals(codeString)) + return FHIRDefinedType.NARRATIVE; + if ("ParameterDefinition".equals(codeString)) + return FHIRDefinedType.PARAMETERDEFINITION; + if ("Period".equals(codeString)) + return FHIRDefinedType.PERIOD; + if ("Quantity".equals(codeString)) + return FHIRDefinedType.QUANTITY; + if ("Range".equals(codeString)) + return FHIRDefinedType.RANGE; + if ("Ratio".equals(codeString)) + return FHIRDefinedType.RATIO; + if ("Reference".equals(codeString)) + return FHIRDefinedType.REFERENCE; + if ("SampledData".equals(codeString)) + return FHIRDefinedType.SAMPLEDDATA; + if ("Signature".equals(codeString)) + return FHIRDefinedType.SIGNATURE; + if ("SimpleQuantity".equals(codeString)) + return FHIRDefinedType.SIMPLEQUANTITY; + if ("Timing".equals(codeString)) + return FHIRDefinedType.TIMING; + if ("TriggerDefinition".equals(codeString)) + return FHIRDefinedType.TRIGGERDEFINITION; + if ("base64Binary".equals(codeString)) + return FHIRDefinedType.BASE64BINARY; + if ("boolean".equals(codeString)) + return FHIRDefinedType.BOOLEAN; + if ("code".equals(codeString)) + return FHIRDefinedType.CODE; + if ("date".equals(codeString)) + return FHIRDefinedType.DATE; + if ("dateTime".equals(codeString)) + return FHIRDefinedType.DATETIME; + if ("decimal".equals(codeString)) + return FHIRDefinedType.DECIMAL; + if ("id".equals(codeString)) + return FHIRDefinedType.ID; + if ("instant".equals(codeString)) + return FHIRDefinedType.INSTANT; + if ("integer".equals(codeString)) + return FHIRDefinedType.INTEGER; + if ("markdown".equals(codeString)) + return FHIRDefinedType.MARKDOWN; + if ("oid".equals(codeString)) + return FHIRDefinedType.OID; + if ("positiveInt".equals(codeString)) + return FHIRDefinedType.POSITIVEINT; + if ("string".equals(codeString)) + return FHIRDefinedType.STRING; + if ("time".equals(codeString)) + return FHIRDefinedType.TIME; + if ("unsignedInt".equals(codeString)) + return FHIRDefinedType.UNSIGNEDINT; + if ("uri".equals(codeString)) + return FHIRDefinedType.URI; + if ("uuid".equals(codeString)) + return FHIRDefinedType.UUID; + if ("xhtml".equals(codeString)) + return FHIRDefinedType.XHTML; + if ("Account".equals(codeString)) + return FHIRDefinedType.ACCOUNT; + if ("AllergyIntolerance".equals(codeString)) + return FHIRDefinedType.ALLERGYINTOLERANCE; + if ("Appointment".equals(codeString)) + return FHIRDefinedType.APPOINTMENT; + if ("AppointmentResponse".equals(codeString)) + return FHIRDefinedType.APPOINTMENTRESPONSE; + if ("AuditEvent".equals(codeString)) + return FHIRDefinedType.AUDITEVENT; + if ("Basic".equals(codeString)) + return FHIRDefinedType.BASIC; + if ("Binary".equals(codeString)) + return FHIRDefinedType.BINARY; + if ("BodySite".equals(codeString)) + return FHIRDefinedType.BODYSITE; + if ("Bundle".equals(codeString)) + return FHIRDefinedType.BUNDLE; + if ("CarePlan".equals(codeString)) + return FHIRDefinedType.CAREPLAN; + if ("CareTeam".equals(codeString)) + return FHIRDefinedType.CARETEAM; + if ("Claim".equals(codeString)) + return FHIRDefinedType.CLAIM; + if ("ClaimResponse".equals(codeString)) + return FHIRDefinedType.CLAIMRESPONSE; + if ("ClinicalImpression".equals(codeString)) + return FHIRDefinedType.CLINICALIMPRESSION; + if ("CodeSystem".equals(codeString)) + return FHIRDefinedType.CODESYSTEM; + if ("Communication".equals(codeString)) + return FHIRDefinedType.COMMUNICATION; + if ("CommunicationRequest".equals(codeString)) + return FHIRDefinedType.COMMUNICATIONREQUEST; + if ("CompartmentDefinition".equals(codeString)) + return FHIRDefinedType.COMPARTMENTDEFINITION; + if ("Composition".equals(codeString)) + return FHIRDefinedType.COMPOSITION; + if ("ConceptMap".equals(codeString)) + return FHIRDefinedType.CONCEPTMAP; + if ("Condition".equals(codeString)) + return FHIRDefinedType.CONDITION; + if ("Conformance".equals(codeString)) + return FHIRDefinedType.CONFORMANCE; + if ("Contract".equals(codeString)) + return FHIRDefinedType.CONTRACT; + if ("Coverage".equals(codeString)) + return FHIRDefinedType.COVERAGE; + if ("DataElement".equals(codeString)) + return FHIRDefinedType.DATAELEMENT; + if ("DecisionSupportRule".equals(codeString)) + return FHIRDefinedType.DECISIONSUPPORTRULE; + if ("DecisionSupportServiceModule".equals(codeString)) + return FHIRDefinedType.DECISIONSUPPORTSERVICEMODULE; + if ("DetectedIssue".equals(codeString)) + return FHIRDefinedType.DETECTEDISSUE; + if ("Device".equals(codeString)) + return FHIRDefinedType.DEVICE; + if ("DeviceComponent".equals(codeString)) + return FHIRDefinedType.DEVICECOMPONENT; + if ("DeviceMetric".equals(codeString)) + return FHIRDefinedType.DEVICEMETRIC; + if ("DeviceUseRequest".equals(codeString)) + return FHIRDefinedType.DEVICEUSEREQUEST; + if ("DeviceUseStatement".equals(codeString)) + return FHIRDefinedType.DEVICEUSESTATEMENT; + if ("DiagnosticOrder".equals(codeString)) + return FHIRDefinedType.DIAGNOSTICORDER; + if ("DiagnosticReport".equals(codeString)) + return FHIRDefinedType.DIAGNOSTICREPORT; + if ("DocumentManifest".equals(codeString)) + return FHIRDefinedType.DOCUMENTMANIFEST; + if ("DocumentReference".equals(codeString)) + return FHIRDefinedType.DOCUMENTREFERENCE; + if ("DomainResource".equals(codeString)) + return FHIRDefinedType.DOMAINRESOURCE; + if ("EligibilityRequest".equals(codeString)) + return FHIRDefinedType.ELIGIBILITYREQUEST; + if ("EligibilityResponse".equals(codeString)) + return FHIRDefinedType.ELIGIBILITYRESPONSE; + if ("Encounter".equals(codeString)) + return FHIRDefinedType.ENCOUNTER; + if ("EnrollmentRequest".equals(codeString)) + return FHIRDefinedType.ENROLLMENTREQUEST; + if ("EnrollmentResponse".equals(codeString)) + return FHIRDefinedType.ENROLLMENTRESPONSE; + if ("EpisodeOfCare".equals(codeString)) + return FHIRDefinedType.EPISODEOFCARE; + if ("ExpansionProfile".equals(codeString)) + return FHIRDefinedType.EXPANSIONPROFILE; + if ("ExplanationOfBenefit".equals(codeString)) + return FHIRDefinedType.EXPLANATIONOFBENEFIT; + if ("FamilyMemberHistory".equals(codeString)) + return FHIRDefinedType.FAMILYMEMBERHISTORY; + if ("Flag".equals(codeString)) + return FHIRDefinedType.FLAG; + if ("Goal".equals(codeString)) + return FHIRDefinedType.GOAL; + if ("Group".equals(codeString)) + return FHIRDefinedType.GROUP; + if ("GuidanceResponse".equals(codeString)) + return FHIRDefinedType.GUIDANCERESPONSE; + if ("HealthcareService".equals(codeString)) + return FHIRDefinedType.HEALTHCARESERVICE; + if ("ImagingExcerpt".equals(codeString)) + return FHIRDefinedType.IMAGINGEXCERPT; + if ("ImagingObjectSelection".equals(codeString)) + return FHIRDefinedType.IMAGINGOBJECTSELECTION; + if ("ImagingStudy".equals(codeString)) + return FHIRDefinedType.IMAGINGSTUDY; + if ("Immunization".equals(codeString)) + return FHIRDefinedType.IMMUNIZATION; + if ("ImmunizationRecommendation".equals(codeString)) + return FHIRDefinedType.IMMUNIZATIONRECOMMENDATION; + if ("ImplementationGuide".equals(codeString)) + return FHIRDefinedType.IMPLEMENTATIONGUIDE; + if ("Library".equals(codeString)) + return FHIRDefinedType.LIBRARY; + if ("Linkage".equals(codeString)) + return FHIRDefinedType.LINKAGE; + if ("List".equals(codeString)) + return FHIRDefinedType.LIST; + if ("Location".equals(codeString)) + return FHIRDefinedType.LOCATION; + if ("Measure".equals(codeString)) + return FHIRDefinedType.MEASURE; + if ("MeasureReport".equals(codeString)) + return FHIRDefinedType.MEASUREREPORT; + if ("Media".equals(codeString)) + return FHIRDefinedType.MEDIA; + if ("Medication".equals(codeString)) + return FHIRDefinedType.MEDICATION; + if ("MedicationAdministration".equals(codeString)) + return FHIRDefinedType.MEDICATIONADMINISTRATION; + if ("MedicationDispense".equals(codeString)) + return FHIRDefinedType.MEDICATIONDISPENSE; + if ("MedicationOrder".equals(codeString)) + return FHIRDefinedType.MEDICATIONORDER; + if ("MedicationStatement".equals(codeString)) + return FHIRDefinedType.MEDICATIONSTATEMENT; + if ("MessageHeader".equals(codeString)) + return FHIRDefinedType.MESSAGEHEADER; + if ("ModuleDefinition".equals(codeString)) + return FHIRDefinedType.MODULEDEFINITION; + if ("NamingSystem".equals(codeString)) + return FHIRDefinedType.NAMINGSYSTEM; + if ("NutritionOrder".equals(codeString)) + return FHIRDefinedType.NUTRITIONORDER; + if ("Observation".equals(codeString)) + return FHIRDefinedType.OBSERVATION; + if ("OperationDefinition".equals(codeString)) + return FHIRDefinedType.OPERATIONDEFINITION; + if ("OperationOutcome".equals(codeString)) + return FHIRDefinedType.OPERATIONOUTCOME; + if ("Order".equals(codeString)) + return FHIRDefinedType.ORDER; + if ("OrderResponse".equals(codeString)) + return FHIRDefinedType.ORDERRESPONSE; + if ("OrderSet".equals(codeString)) + return FHIRDefinedType.ORDERSET; + if ("Organization".equals(codeString)) + return FHIRDefinedType.ORGANIZATION; + if ("Parameters".equals(codeString)) + return FHIRDefinedType.PARAMETERS; + if ("Patient".equals(codeString)) + return FHIRDefinedType.PATIENT; + if ("PaymentNotice".equals(codeString)) + return FHIRDefinedType.PAYMENTNOTICE; + if ("PaymentReconciliation".equals(codeString)) + return FHIRDefinedType.PAYMENTRECONCILIATION; + if ("Person".equals(codeString)) + return FHIRDefinedType.PERSON; + if ("Practitioner".equals(codeString)) + return FHIRDefinedType.PRACTITIONER; + if ("PractitionerRole".equals(codeString)) + return FHIRDefinedType.PRACTITIONERROLE; + if ("Procedure".equals(codeString)) + return FHIRDefinedType.PROCEDURE; + if ("ProcedureRequest".equals(codeString)) + return FHIRDefinedType.PROCEDUREREQUEST; + if ("ProcessRequest".equals(codeString)) + return FHIRDefinedType.PROCESSREQUEST; + if ("ProcessResponse".equals(codeString)) + return FHIRDefinedType.PROCESSRESPONSE; + if ("Protocol".equals(codeString)) + return FHIRDefinedType.PROTOCOL; + if ("Provenance".equals(codeString)) + return FHIRDefinedType.PROVENANCE; + if ("Questionnaire".equals(codeString)) + return FHIRDefinedType.QUESTIONNAIRE; + if ("QuestionnaireResponse".equals(codeString)) + return FHIRDefinedType.QUESTIONNAIRERESPONSE; + if ("ReferralRequest".equals(codeString)) + return FHIRDefinedType.REFERRALREQUEST; + if ("RelatedPerson".equals(codeString)) + return FHIRDefinedType.RELATEDPERSON; + if ("Resource".equals(codeString)) + return FHIRDefinedType.RESOURCE; + if ("RiskAssessment".equals(codeString)) + return FHIRDefinedType.RISKASSESSMENT; + if ("Schedule".equals(codeString)) + return FHIRDefinedType.SCHEDULE; + if ("SearchParameter".equals(codeString)) + return FHIRDefinedType.SEARCHPARAMETER; + if ("Sequence".equals(codeString)) + return FHIRDefinedType.SEQUENCE; + if ("Slot".equals(codeString)) + return FHIRDefinedType.SLOT; + if ("Specimen".equals(codeString)) + return FHIRDefinedType.SPECIMEN; + if ("StructureDefinition".equals(codeString)) + return FHIRDefinedType.STRUCTUREDEFINITION; + if ("StructureMap".equals(codeString)) + return FHIRDefinedType.STRUCTUREMAP; + if ("Subscription".equals(codeString)) + return FHIRDefinedType.SUBSCRIPTION; + if ("Substance".equals(codeString)) + return FHIRDefinedType.SUBSTANCE; + if ("SupplyDelivery".equals(codeString)) + return FHIRDefinedType.SUPPLYDELIVERY; + if ("SupplyRequest".equals(codeString)) + return FHIRDefinedType.SUPPLYREQUEST; + if ("Task".equals(codeString)) + return FHIRDefinedType.TASK; + if ("TestScript".equals(codeString)) + return FHIRDefinedType.TESTSCRIPT; + if ("ValueSet".equals(codeString)) + return FHIRDefinedType.VALUESET; + if ("VisionPrescription".equals(codeString)) + return FHIRDefinedType.VISIONPRESCRIPTION; + throw new IllegalArgumentException("Unknown FHIRDefinedType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("ActionDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ACTIONDEFINITION); + if ("Address".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ADDRESS); + if ("Age".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.AGE); + if ("Annotation".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ANNOTATION); + if ("Attachment".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ATTACHMENT); + if ("BackboneElement".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.BACKBONEELEMENT); + if ("CodeableConcept".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CODEABLECONCEPT); + if ("Coding".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CODING); + if ("ContactPoint".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CONTACTPOINT); + if ("Count".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.COUNT); + if ("DataRequirement".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DATAREQUIREMENT); + if ("Distance".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DISTANCE); + if ("Duration".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DURATION); + if ("Element".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ELEMENT); + if ("ElementDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ELEMENTDEFINITION); + if ("Extension".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.EXTENSION); + if ("HumanName".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.HUMANNAME); + if ("Identifier".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.IDENTIFIER); + if ("Meta".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.META); + if ("ModuleMetadata".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MODULEMETADATA); + if ("Money".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MONEY); + if ("Narrative".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.NARRATIVE); + if ("ParameterDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PARAMETERDEFINITION); + if ("Period".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PERIOD); + if ("Quantity".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.QUANTITY); + if ("Range".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.RANGE); + if ("Ratio".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.RATIO); + if ("Reference".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.REFERENCE); + if ("SampledData".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SAMPLEDDATA); + if ("Signature".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SIGNATURE); + if ("SimpleQuantity".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SIMPLEQUANTITY); + if ("Timing".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.TIMING); + if ("TriggerDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.TRIGGERDEFINITION); + if ("base64Binary".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.BASE64BINARY); + if ("boolean".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.BOOLEAN); + if ("code".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CODE); + if ("date".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DATE); + if ("dateTime".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DATETIME); + if ("decimal".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DECIMAL); + if ("id".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ID); + if ("instant".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.INSTANT); + if ("integer".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.INTEGER); + if ("markdown".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MARKDOWN); + if ("oid".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.OID); + if ("positiveInt".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.POSITIVEINT); + if ("string".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.STRING); + if ("time".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.TIME); + if ("unsignedInt".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.UNSIGNEDINT); + if ("uri".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.URI); + if ("uuid".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.UUID); + if ("xhtml".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.XHTML); + if ("Account".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ACCOUNT); + if ("AllergyIntolerance".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ALLERGYINTOLERANCE); + if ("Appointment".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.APPOINTMENT); + if ("AppointmentResponse".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.APPOINTMENTRESPONSE); + if ("AuditEvent".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.AUDITEVENT); + if ("Basic".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.BASIC); + if ("Binary".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.BINARY); + if ("BodySite".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.BODYSITE); + if ("Bundle".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.BUNDLE); + if ("CarePlan".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CAREPLAN); + if ("CareTeam".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CARETEAM); + if ("Claim".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CLAIM); + if ("ClaimResponse".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CLAIMRESPONSE); + if ("ClinicalImpression".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CLINICALIMPRESSION); + if ("CodeSystem".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CODESYSTEM); + if ("Communication".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.COMMUNICATION); + if ("CommunicationRequest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.COMMUNICATIONREQUEST); + if ("CompartmentDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.COMPARTMENTDEFINITION); + if ("Composition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.COMPOSITION); + if ("ConceptMap".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CONCEPTMAP); + if ("Condition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CONDITION); + if ("Conformance".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CONFORMANCE); + if ("Contract".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.CONTRACT); + if ("Coverage".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.COVERAGE); + if ("DataElement".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DATAELEMENT); + if ("DecisionSupportRule".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DECISIONSUPPORTRULE); + if ("DecisionSupportServiceModule".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DECISIONSUPPORTSERVICEMODULE); + if ("DetectedIssue".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DETECTEDISSUE); + if ("Device".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DEVICE); + if ("DeviceComponent".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DEVICECOMPONENT); + if ("DeviceMetric".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DEVICEMETRIC); + if ("DeviceUseRequest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DEVICEUSEREQUEST); + if ("DeviceUseStatement".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DEVICEUSESTATEMENT); + if ("DiagnosticOrder".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DIAGNOSTICORDER); + if ("DiagnosticReport".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DIAGNOSTICREPORT); + if ("DocumentManifest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DOCUMENTMANIFEST); + if ("DocumentReference".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DOCUMENTREFERENCE); + if ("DomainResource".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.DOMAINRESOURCE); + if ("EligibilityRequest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ELIGIBILITYREQUEST); + if ("EligibilityResponse".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ELIGIBILITYRESPONSE); + if ("Encounter".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ENCOUNTER); + if ("EnrollmentRequest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ENROLLMENTREQUEST); + if ("EnrollmentResponse".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ENROLLMENTRESPONSE); + if ("EpisodeOfCare".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.EPISODEOFCARE); + if ("ExpansionProfile".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.EXPANSIONPROFILE); + if ("ExplanationOfBenefit".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.EXPLANATIONOFBENEFIT); + if ("FamilyMemberHistory".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.FAMILYMEMBERHISTORY); + if ("Flag".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.FLAG); + if ("Goal".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.GOAL); + if ("Group".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.GROUP); + if ("GuidanceResponse".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.GUIDANCERESPONSE); + if ("HealthcareService".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.HEALTHCARESERVICE); + if ("ImagingExcerpt".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.IMAGINGEXCERPT); + if ("ImagingObjectSelection".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.IMAGINGOBJECTSELECTION); + if ("ImagingStudy".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.IMAGINGSTUDY); + if ("Immunization".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.IMMUNIZATION); + if ("ImmunizationRecommendation".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.IMMUNIZATIONRECOMMENDATION); + if ("ImplementationGuide".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.IMPLEMENTATIONGUIDE); + if ("Library".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.LIBRARY); + if ("Linkage".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.LINKAGE); + if ("List".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.LIST); + if ("Location".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.LOCATION); + if ("Measure".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MEASURE); + if ("MeasureReport".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MEASUREREPORT); + if ("Media".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MEDIA); + if ("Medication".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MEDICATION); + if ("MedicationAdministration".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MEDICATIONADMINISTRATION); + if ("MedicationDispense".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MEDICATIONDISPENSE); + if ("MedicationOrder".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MEDICATIONORDER); + if ("MedicationStatement".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MEDICATIONSTATEMENT); + if ("MessageHeader".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MESSAGEHEADER); + if ("ModuleDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MODULEDEFINITION); + if ("NamingSystem".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.NAMINGSYSTEM); + if ("NutritionOrder".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.NUTRITIONORDER); + if ("Observation".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.OBSERVATION); + if ("OperationDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.OPERATIONDEFINITION); + if ("OperationOutcome".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.OPERATIONOUTCOME); + if ("Order".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ORDER); + if ("OrderResponse".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ORDERRESPONSE); + if ("OrderSet".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ORDERSET); + if ("Organization".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.ORGANIZATION); + if ("Parameters".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PARAMETERS); + if ("Patient".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PATIENT); + if ("PaymentNotice".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PAYMENTNOTICE); + if ("PaymentReconciliation".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PAYMENTRECONCILIATION); + if ("Person".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PERSON); + if ("Practitioner".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PRACTITIONER); + if ("PractitionerRole".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PRACTITIONERROLE); + if ("Procedure".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PROCEDURE); + if ("ProcedureRequest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PROCEDUREREQUEST); + if ("ProcessRequest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PROCESSREQUEST); + if ("ProcessResponse".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PROCESSRESPONSE); + if ("Protocol".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PROTOCOL); + if ("Provenance".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.PROVENANCE); + if ("Questionnaire".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.QUESTIONNAIRE); + if ("QuestionnaireResponse".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.QUESTIONNAIRERESPONSE); + if ("ReferralRequest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.REFERRALREQUEST); + if ("RelatedPerson".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.RELATEDPERSON); + if ("Resource".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.RESOURCE); + if ("RiskAssessment".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.RISKASSESSMENT); + if ("Schedule".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SCHEDULE); + if ("SearchParameter".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SEARCHPARAMETER); + if ("Sequence".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SEQUENCE); + if ("Slot".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SLOT); + if ("Specimen".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SPECIMEN); + if ("StructureDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.STRUCTUREDEFINITION); + if ("StructureMap".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.STRUCTUREMAP); + if ("Subscription".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SUBSCRIPTION); + if ("Substance".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SUBSTANCE); + if ("SupplyDelivery".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SUPPLYDELIVERY); + if ("SupplyRequest".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.SUPPLYREQUEST); + if ("Task".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.TASK); + if ("TestScript".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.TESTSCRIPT); + if ("ValueSet".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.VALUESET); + if ("VisionPrescription".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.VISIONPRESCRIPTION); + throw new FHIRException("Unknown FHIRDefinedType code '"+codeString+"'"); + } + public String toCode(FHIRDefinedType code) { + if (code == FHIRDefinedType.ACTIONDEFINITION) + return "ActionDefinition"; + if (code == FHIRDefinedType.ADDRESS) + return "Address"; + if (code == FHIRDefinedType.AGE) + return "Age"; + if (code == FHIRDefinedType.ANNOTATION) + return "Annotation"; + if (code == FHIRDefinedType.ATTACHMENT) + return "Attachment"; + if (code == FHIRDefinedType.BACKBONEELEMENT) + return "BackboneElement"; + if (code == FHIRDefinedType.CODEABLECONCEPT) + return "CodeableConcept"; + if (code == FHIRDefinedType.CODING) + return "Coding"; + if (code == FHIRDefinedType.CONTACTPOINT) + return "ContactPoint"; + if (code == FHIRDefinedType.COUNT) + return "Count"; + if (code == FHIRDefinedType.DATAREQUIREMENT) + return "DataRequirement"; + if (code == FHIRDefinedType.DISTANCE) + return "Distance"; + if (code == FHIRDefinedType.DURATION) + return "Duration"; + if (code == FHIRDefinedType.ELEMENT) + return "Element"; + if (code == FHIRDefinedType.ELEMENTDEFINITION) + return "ElementDefinition"; + if (code == FHIRDefinedType.EXTENSION) + return "Extension"; + if (code == FHIRDefinedType.HUMANNAME) + return "HumanName"; + if (code == FHIRDefinedType.IDENTIFIER) + return "Identifier"; + if (code == FHIRDefinedType.META) + return "Meta"; + if (code == FHIRDefinedType.MODULEMETADATA) + return "ModuleMetadata"; + if (code == FHIRDefinedType.MONEY) + return "Money"; + if (code == FHIRDefinedType.NARRATIVE) + return "Narrative"; + if (code == FHIRDefinedType.PARAMETERDEFINITION) + return "ParameterDefinition"; + if (code == FHIRDefinedType.PERIOD) + return "Period"; + if (code == FHIRDefinedType.QUANTITY) + return "Quantity"; + if (code == FHIRDefinedType.RANGE) + return "Range"; + if (code == FHIRDefinedType.RATIO) + return "Ratio"; + if (code == FHIRDefinedType.REFERENCE) + return "Reference"; + if (code == FHIRDefinedType.SAMPLEDDATA) + return "SampledData"; + if (code == FHIRDefinedType.SIGNATURE) + return "Signature"; + if (code == FHIRDefinedType.SIMPLEQUANTITY) + return "SimpleQuantity"; + if (code == FHIRDefinedType.TIMING) + return "Timing"; + if (code == FHIRDefinedType.TRIGGERDEFINITION) + return "TriggerDefinition"; + if (code == FHIRDefinedType.BASE64BINARY) + return "base64Binary"; + if (code == FHIRDefinedType.BOOLEAN) + return "boolean"; + if (code == FHIRDefinedType.CODE) + return "code"; + if (code == FHIRDefinedType.DATE) + return "date"; + if (code == FHIRDefinedType.DATETIME) + return "dateTime"; + if (code == FHIRDefinedType.DECIMAL) + return "decimal"; + if (code == FHIRDefinedType.ID) + return "id"; + if (code == FHIRDefinedType.INSTANT) + return "instant"; + if (code == FHIRDefinedType.INTEGER) + return "integer"; + if (code == FHIRDefinedType.MARKDOWN) + return "markdown"; + if (code == FHIRDefinedType.OID) + return "oid"; + if (code == FHIRDefinedType.POSITIVEINT) + return "positiveInt"; + if (code == FHIRDefinedType.STRING) + return "string"; + if (code == FHIRDefinedType.TIME) + return "time"; + if (code == FHIRDefinedType.UNSIGNEDINT) + return "unsignedInt"; + if (code == FHIRDefinedType.URI) + return "uri"; + if (code == FHIRDefinedType.UUID) + return "uuid"; + if (code == FHIRDefinedType.XHTML) + return "xhtml"; + if (code == FHIRDefinedType.ACCOUNT) + return "Account"; + if (code == FHIRDefinedType.ALLERGYINTOLERANCE) + return "AllergyIntolerance"; + if (code == FHIRDefinedType.APPOINTMENT) + return "Appointment"; + if (code == FHIRDefinedType.APPOINTMENTRESPONSE) + return "AppointmentResponse"; + if (code == FHIRDefinedType.AUDITEVENT) + return "AuditEvent"; + if (code == FHIRDefinedType.BASIC) + return "Basic"; + if (code == FHIRDefinedType.BINARY) + return "Binary"; + if (code == FHIRDefinedType.BODYSITE) + return "BodySite"; + if (code == FHIRDefinedType.BUNDLE) + return "Bundle"; + if (code == FHIRDefinedType.CAREPLAN) + return "CarePlan"; + if (code == FHIRDefinedType.CARETEAM) + return "CareTeam"; + if (code == FHIRDefinedType.CLAIM) + return "Claim"; + if (code == FHIRDefinedType.CLAIMRESPONSE) + return "ClaimResponse"; + if (code == FHIRDefinedType.CLINICALIMPRESSION) + return "ClinicalImpression"; + if (code == FHIRDefinedType.CODESYSTEM) + return "CodeSystem"; + if (code == FHIRDefinedType.COMMUNICATION) + return "Communication"; + if (code == FHIRDefinedType.COMMUNICATIONREQUEST) + return "CommunicationRequest"; + if (code == FHIRDefinedType.COMPARTMENTDEFINITION) + return "CompartmentDefinition"; + if (code == FHIRDefinedType.COMPOSITION) + return "Composition"; + if (code == FHIRDefinedType.CONCEPTMAP) + return "ConceptMap"; + if (code == FHIRDefinedType.CONDITION) + return "Condition"; + if (code == FHIRDefinedType.CONFORMANCE) + return "Conformance"; + if (code == FHIRDefinedType.CONTRACT) + return "Contract"; + if (code == FHIRDefinedType.COVERAGE) + return "Coverage"; + if (code == FHIRDefinedType.DATAELEMENT) + return "DataElement"; + if (code == FHIRDefinedType.DECISIONSUPPORTRULE) + return "DecisionSupportRule"; + if (code == FHIRDefinedType.DECISIONSUPPORTSERVICEMODULE) + return "DecisionSupportServiceModule"; + if (code == FHIRDefinedType.DETECTEDISSUE) + return "DetectedIssue"; + if (code == FHIRDefinedType.DEVICE) + return "Device"; + if (code == FHIRDefinedType.DEVICECOMPONENT) + return "DeviceComponent"; + if (code == FHIRDefinedType.DEVICEMETRIC) + return "DeviceMetric"; + if (code == FHIRDefinedType.DEVICEUSEREQUEST) + return "DeviceUseRequest"; + if (code == FHIRDefinedType.DEVICEUSESTATEMENT) + return "DeviceUseStatement"; + if (code == FHIRDefinedType.DIAGNOSTICORDER) + return "DiagnosticOrder"; + if (code == FHIRDefinedType.DIAGNOSTICREPORT) + return "DiagnosticReport"; + if (code == FHIRDefinedType.DOCUMENTMANIFEST) + return "DocumentManifest"; + if (code == FHIRDefinedType.DOCUMENTREFERENCE) + return "DocumentReference"; + if (code == FHIRDefinedType.DOMAINRESOURCE) + return "DomainResource"; + if (code == FHIRDefinedType.ELIGIBILITYREQUEST) + return "EligibilityRequest"; + if (code == FHIRDefinedType.ELIGIBILITYRESPONSE) + return "EligibilityResponse"; + if (code == FHIRDefinedType.ENCOUNTER) + return "Encounter"; + if (code == FHIRDefinedType.ENROLLMENTREQUEST) + return "EnrollmentRequest"; + if (code == FHIRDefinedType.ENROLLMENTRESPONSE) + return "EnrollmentResponse"; + if (code == FHIRDefinedType.EPISODEOFCARE) + return "EpisodeOfCare"; + if (code == FHIRDefinedType.EXPANSIONPROFILE) + return "ExpansionProfile"; + if (code == FHIRDefinedType.EXPLANATIONOFBENEFIT) + return "ExplanationOfBenefit"; + if (code == FHIRDefinedType.FAMILYMEMBERHISTORY) + return "FamilyMemberHistory"; + if (code == FHIRDefinedType.FLAG) + return "Flag"; + if (code == FHIRDefinedType.GOAL) + return "Goal"; + if (code == FHIRDefinedType.GROUP) + return "Group"; + if (code == FHIRDefinedType.GUIDANCERESPONSE) + return "GuidanceResponse"; + if (code == FHIRDefinedType.HEALTHCARESERVICE) + return "HealthcareService"; + if (code == FHIRDefinedType.IMAGINGEXCERPT) + return "ImagingExcerpt"; + if (code == FHIRDefinedType.IMAGINGOBJECTSELECTION) + return "ImagingObjectSelection"; + if (code == FHIRDefinedType.IMAGINGSTUDY) + return "ImagingStudy"; + if (code == FHIRDefinedType.IMMUNIZATION) + return "Immunization"; + if (code == FHIRDefinedType.IMMUNIZATIONRECOMMENDATION) + return "ImmunizationRecommendation"; + if (code == FHIRDefinedType.IMPLEMENTATIONGUIDE) + return "ImplementationGuide"; + if (code == FHIRDefinedType.LIBRARY) + return "Library"; + if (code == FHIRDefinedType.LINKAGE) + return "Linkage"; + if (code == FHIRDefinedType.LIST) + return "List"; + if (code == FHIRDefinedType.LOCATION) + return "Location"; + if (code == FHIRDefinedType.MEASURE) + return "Measure"; + if (code == FHIRDefinedType.MEASUREREPORT) + return "MeasureReport"; + if (code == FHIRDefinedType.MEDIA) + return "Media"; + if (code == FHIRDefinedType.MEDICATION) + return "Medication"; + if (code == FHIRDefinedType.MEDICATIONADMINISTRATION) + return "MedicationAdministration"; + if (code == FHIRDefinedType.MEDICATIONDISPENSE) + return "MedicationDispense"; + if (code == FHIRDefinedType.MEDICATIONORDER) + return "MedicationOrder"; + if (code == FHIRDefinedType.MEDICATIONSTATEMENT) + return "MedicationStatement"; + if (code == FHIRDefinedType.MESSAGEHEADER) + return "MessageHeader"; + if (code == FHIRDefinedType.MODULEDEFINITION) + return "ModuleDefinition"; + if (code == FHIRDefinedType.NAMINGSYSTEM) + return "NamingSystem"; + if (code == FHIRDefinedType.NUTRITIONORDER) + return "NutritionOrder"; + if (code == FHIRDefinedType.OBSERVATION) + return "Observation"; + if (code == FHIRDefinedType.OPERATIONDEFINITION) + return "OperationDefinition"; + if (code == FHIRDefinedType.OPERATIONOUTCOME) + return "OperationOutcome"; + if (code == FHIRDefinedType.ORDER) + return "Order"; + if (code == FHIRDefinedType.ORDERRESPONSE) + return "OrderResponse"; + if (code == FHIRDefinedType.ORDERSET) + return "OrderSet"; + if (code == FHIRDefinedType.ORGANIZATION) + return "Organization"; + if (code == FHIRDefinedType.PARAMETERS) + return "Parameters"; + if (code == FHIRDefinedType.PATIENT) + return "Patient"; + if (code == FHIRDefinedType.PAYMENTNOTICE) + return "PaymentNotice"; + if (code == FHIRDefinedType.PAYMENTRECONCILIATION) + return "PaymentReconciliation"; + if (code == FHIRDefinedType.PERSON) + return "Person"; + if (code == FHIRDefinedType.PRACTITIONER) + return "Practitioner"; + if (code == FHIRDefinedType.PRACTITIONERROLE) + return "PractitionerRole"; + if (code == FHIRDefinedType.PROCEDURE) + return "Procedure"; + if (code == FHIRDefinedType.PROCEDUREREQUEST) + return "ProcedureRequest"; + if (code == FHIRDefinedType.PROCESSREQUEST) + return "ProcessRequest"; + if (code == FHIRDefinedType.PROCESSRESPONSE) + return "ProcessResponse"; + if (code == FHIRDefinedType.PROTOCOL) + return "Protocol"; + if (code == FHIRDefinedType.PROVENANCE) + return "Provenance"; + if (code == FHIRDefinedType.QUESTIONNAIRE) + return "Questionnaire"; + if (code == FHIRDefinedType.QUESTIONNAIRERESPONSE) + return "QuestionnaireResponse"; + if (code == FHIRDefinedType.REFERRALREQUEST) + return "ReferralRequest"; + if (code == FHIRDefinedType.RELATEDPERSON) + return "RelatedPerson"; + if (code == FHIRDefinedType.RESOURCE) + return "Resource"; + if (code == FHIRDefinedType.RISKASSESSMENT) + return "RiskAssessment"; + if (code == FHIRDefinedType.SCHEDULE) + return "Schedule"; + if (code == FHIRDefinedType.SEARCHPARAMETER) + return "SearchParameter"; + if (code == FHIRDefinedType.SEQUENCE) + return "Sequence"; + if (code == FHIRDefinedType.SLOT) + return "Slot"; + if (code == FHIRDefinedType.SPECIMEN) + return "Specimen"; + if (code == FHIRDefinedType.STRUCTUREDEFINITION) + return "StructureDefinition"; + if (code == FHIRDefinedType.STRUCTUREMAP) + return "StructureMap"; + if (code == FHIRDefinedType.SUBSCRIPTION) + return "Subscription"; + if (code == FHIRDefinedType.SUBSTANCE) + return "Substance"; + if (code == FHIRDefinedType.SUPPLYDELIVERY) + return "SupplyDelivery"; + if (code == FHIRDefinedType.SUPPLYREQUEST) + return "SupplyRequest"; + if (code == FHIRDefinedType.TASK) + return "Task"; + if (code == FHIRDefinedType.TESTSCRIPT) + return "TestScript"; + if (code == FHIRDefinedType.VALUESET) + return "ValueSet"; + if (code == FHIRDefinedType.VISIONPRESCRIPTION) + return "VisionPrescription"; + return "?"; + } + public String toSystem(FHIRDefinedType code) { + return code.getSystem(); + } + } + + public enum MessageEvent { + /** + * The definition of a code system is used to create a simple collection of codes suitable for use for data entry or validation. An expanded code system will be returned, or an error message. + */ + CODESYSTEMEXPAND, + /** + * Change the status of a Medication Administration to show that it is complete. + */ + MEDICATIONADMINISTRATIONCOMPLETE, + /** + * Someone wishes to record that the record of administration of a medication is in error and should be ignored. + */ + MEDICATIONADMINISTRATIONNULLIFICATION, + /** + * Indicates that a medication has been recorded against the patient's record. + */ + MEDICATIONADMINISTRATIONRECORDING, + /** + * Update a Medication Administration record. + */ + MEDICATIONADMINISTRATIONUPDATE, + /** + * Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use. + */ + ADMINNOTIFY, + /** + * Provide a diagnostic report, or update a previously provided diagnostic report. + */ + DIAGNOSTICREPORTPROVIDE, + /** + * Provide a simple observation or update a previously provided simple observation. + */ + OBSERVATIONPROVIDE, + /** + * Notification that two patient records actually identify the same patient. + */ + PATIENTLINK, + /** + * Notification that previous advice that two patient records concern the same patient is now considered incorrect. + */ + PATIENTUNLINK, + /** + * The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message. + */ + VALUESETEXPAND, + /** + * added to help the parsers + */ + NULL; + public static MessageEvent fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("CodeSystem-expand".equals(codeString)) + return CODESYSTEMEXPAND; + if ("MedicationAdministration-Complete".equals(codeString)) + return MEDICATIONADMINISTRATIONCOMPLETE; + if ("MedicationAdministration-Nullification".equals(codeString)) + return MEDICATIONADMINISTRATIONNULLIFICATION; + if ("MedicationAdministration-Recording".equals(codeString)) + return MEDICATIONADMINISTRATIONRECORDING; + if ("MedicationAdministration-Update".equals(codeString)) + return MEDICATIONADMINISTRATIONUPDATE; + if ("admin-notify".equals(codeString)) + return ADMINNOTIFY; + if ("diagnosticreport-provide".equals(codeString)) + return DIAGNOSTICREPORTPROVIDE; + if ("observation-provide".equals(codeString)) + return OBSERVATIONPROVIDE; + if ("patient-link".equals(codeString)) + return PATIENTLINK; + if ("patient-unlink".equals(codeString)) + return PATIENTUNLINK; + if ("valueset-expand".equals(codeString)) + return VALUESETEXPAND; + throw new FHIRException("Unknown MessageEvent code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CODESYSTEMEXPAND: return "CodeSystem-expand"; + case MEDICATIONADMINISTRATIONCOMPLETE: return "MedicationAdministration-Complete"; + case MEDICATIONADMINISTRATIONNULLIFICATION: return "MedicationAdministration-Nullification"; + case MEDICATIONADMINISTRATIONRECORDING: return "MedicationAdministration-Recording"; + case MEDICATIONADMINISTRATIONUPDATE: return "MedicationAdministration-Update"; + case ADMINNOTIFY: return "admin-notify"; + case DIAGNOSTICREPORTPROVIDE: return "diagnosticreport-provide"; + case OBSERVATIONPROVIDE: return "observation-provide"; + case PATIENTLINK: return "patient-link"; + case PATIENTUNLINK: return "patient-unlink"; + case VALUESETEXPAND: return "valueset-expand"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CODESYSTEMEXPAND: return "http://hl7.org/fhir/message-events"; + case MEDICATIONADMINISTRATIONCOMPLETE: return "http://hl7.org/fhir/message-events"; + case MEDICATIONADMINISTRATIONNULLIFICATION: return "http://hl7.org/fhir/message-events"; + case MEDICATIONADMINISTRATIONRECORDING: return "http://hl7.org/fhir/message-events"; + case MEDICATIONADMINISTRATIONUPDATE: return "http://hl7.org/fhir/message-events"; + case ADMINNOTIFY: return "http://hl7.org/fhir/message-events"; + case DIAGNOSTICREPORTPROVIDE: return "http://hl7.org/fhir/message-events"; + case OBSERVATIONPROVIDE: return "http://hl7.org/fhir/message-events"; + case PATIENTLINK: return "http://hl7.org/fhir/message-events"; + case PATIENTUNLINK: return "http://hl7.org/fhir/message-events"; + case VALUESETEXPAND: return "http://hl7.org/fhir/message-events"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CODESYSTEMEXPAND: return "The definition of a code system is used to create a simple collection of codes suitable for use for data entry or validation. An expanded code system will be returned, or an error message."; + case MEDICATIONADMINISTRATIONCOMPLETE: return "Change the status of a Medication Administration to show that it is complete."; + case MEDICATIONADMINISTRATIONNULLIFICATION: return "Someone wishes to record that the record of administration of a medication is in error and should be ignored."; + case MEDICATIONADMINISTRATIONRECORDING: return "Indicates that a medication has been recorded against the patient's record."; + case MEDICATIONADMINISTRATIONUPDATE: return "Update a Medication Administration record."; + case ADMINNOTIFY: return "Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use."; + case DIAGNOSTICREPORTPROVIDE: return "Provide a diagnostic report, or update a previously provided diagnostic report."; + case OBSERVATIONPROVIDE: return "Provide a simple observation or update a previously provided simple observation."; + case PATIENTLINK: return "Notification that two patient records actually identify the same patient."; + case PATIENTUNLINK: return "Notification that previous advice that two patient records concern the same patient is now considered incorrect."; + case VALUESETEXPAND: return "The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CODESYSTEMEXPAND: return "CodeSystem-expand"; + case MEDICATIONADMINISTRATIONCOMPLETE: return "MedicationAdministration-Complete"; + case MEDICATIONADMINISTRATIONNULLIFICATION: return "MedicationAdministration-Nullification"; + case MEDICATIONADMINISTRATIONRECORDING: return "MedicationAdministration-Recording"; + case MEDICATIONADMINISTRATIONUPDATE: return "MedicationAdministration-Update"; + case ADMINNOTIFY: return "admin-notify"; + case DIAGNOSTICREPORTPROVIDE: return "diagnosticreport-provide"; + case OBSERVATIONPROVIDE: return "observation-provide"; + case PATIENTLINK: return "patient-link"; + case PATIENTUNLINK: return "patient-unlink"; + case VALUESETEXPAND: return "valueset-expand"; + default: return "?"; + } + } + } + + public static class MessageEventEnumFactory implements EnumFactory { + public MessageEvent fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("CodeSystem-expand".equals(codeString)) + return MessageEvent.CODESYSTEMEXPAND; + if ("MedicationAdministration-Complete".equals(codeString)) + return MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE; + if ("MedicationAdministration-Nullification".equals(codeString)) + return MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION; + if ("MedicationAdministration-Recording".equals(codeString)) + return MessageEvent.MEDICATIONADMINISTRATIONRECORDING; + if ("MedicationAdministration-Update".equals(codeString)) + return MessageEvent.MEDICATIONADMINISTRATIONUPDATE; + if ("admin-notify".equals(codeString)) + return MessageEvent.ADMINNOTIFY; + if ("diagnosticreport-provide".equals(codeString)) + return MessageEvent.DIAGNOSTICREPORTPROVIDE; + if ("observation-provide".equals(codeString)) + return MessageEvent.OBSERVATIONPROVIDE; + if ("patient-link".equals(codeString)) + return MessageEvent.PATIENTLINK; + if ("patient-unlink".equals(codeString)) + return MessageEvent.PATIENTUNLINK; + if ("valueset-expand".equals(codeString)) + return MessageEvent.VALUESETEXPAND; + throw new IllegalArgumentException("Unknown MessageEvent code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("CodeSystem-expand".equals(codeString)) + return new Enumeration(this, MessageEvent.CODESYSTEMEXPAND); + if ("MedicationAdministration-Complete".equals(codeString)) + return new Enumeration(this, MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE); + if ("MedicationAdministration-Nullification".equals(codeString)) + return new Enumeration(this, MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION); + if ("MedicationAdministration-Recording".equals(codeString)) + return new Enumeration(this, MessageEvent.MEDICATIONADMINISTRATIONRECORDING); + if ("MedicationAdministration-Update".equals(codeString)) + return new Enumeration(this, MessageEvent.MEDICATIONADMINISTRATIONUPDATE); + if ("admin-notify".equals(codeString)) + return new Enumeration(this, MessageEvent.ADMINNOTIFY); + if ("diagnosticreport-provide".equals(codeString)) + return new Enumeration(this, MessageEvent.DIAGNOSTICREPORTPROVIDE); + if ("observation-provide".equals(codeString)) + return new Enumeration(this, MessageEvent.OBSERVATIONPROVIDE); + if ("patient-link".equals(codeString)) + return new Enumeration(this, MessageEvent.PATIENTLINK); + if ("patient-unlink".equals(codeString)) + return new Enumeration(this, MessageEvent.PATIENTUNLINK); + if ("valueset-expand".equals(codeString)) + return new Enumeration(this, MessageEvent.VALUESETEXPAND); + throw new FHIRException("Unknown MessageEvent code '"+codeString+"'"); + } + public String toCode(MessageEvent code) { + if (code == MessageEvent.CODESYSTEMEXPAND) + return "CodeSystem-expand"; + if (code == MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE) + return "MedicationAdministration-Complete"; + if (code == MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION) + return "MedicationAdministration-Nullification"; + if (code == MessageEvent.MEDICATIONADMINISTRATIONRECORDING) + return "MedicationAdministration-Recording"; + if (code == MessageEvent.MEDICATIONADMINISTRATIONUPDATE) + return "MedicationAdministration-Update"; + if (code == MessageEvent.ADMINNOTIFY) + return "admin-notify"; + if (code == MessageEvent.DIAGNOSTICREPORTPROVIDE) + return "diagnosticreport-provide"; + if (code == MessageEvent.OBSERVATIONPROVIDE) + return "observation-provide"; + if (code == MessageEvent.PATIENTLINK) + return "patient-link"; + if (code == MessageEvent.PATIENTUNLINK) + return "patient-unlink"; + if (code == MessageEvent.VALUESETEXPAND) + return "valueset-expand"; + return "?"; + } + public String toSystem(MessageEvent code) { + return code.getSystem(); + } + } + + public enum NoteType { + /** + * Display the note. + */ + DISPLAY, + /** + * Print the note on the form. + */ + PRINT, + /** + * Print the note for the operator. + */ + PRINTOPER, + /** + * added to help the parsers + */ + NULL; + public static NoteType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("display".equals(codeString)) + return DISPLAY; + if ("print".equals(codeString)) + return PRINT; + if ("printoper".equals(codeString)) + return PRINTOPER; + throw new FHIRException("Unknown NoteType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DISPLAY: return "display"; + case PRINT: return "print"; + case PRINTOPER: return "printoper"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DISPLAY: return "http://hl7.org/fhir/note-type"; + case PRINT: return "http://hl7.org/fhir/note-type"; + case PRINTOPER: return "http://hl7.org/fhir/note-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DISPLAY: return "Display the note."; + case PRINT: return "Print the note on the form."; + case PRINTOPER: return "Print the note for the operator."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DISPLAY: return "Display"; + case PRINT: return "Print (Form)"; + case PRINTOPER: return "Print (Operator)"; + default: return "?"; + } + } + } + + public static class NoteTypeEnumFactory implements EnumFactory { + public NoteType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("display".equals(codeString)) + return NoteType.DISPLAY; + if ("print".equals(codeString)) + return NoteType.PRINT; + if ("printoper".equals(codeString)) + return NoteType.PRINTOPER; + throw new IllegalArgumentException("Unknown NoteType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("display".equals(codeString)) + return new Enumeration(this, NoteType.DISPLAY); + if ("print".equals(codeString)) + return new Enumeration(this, NoteType.PRINT); + if ("printoper".equals(codeString)) + return new Enumeration(this, NoteType.PRINTOPER); + throw new FHIRException("Unknown NoteType code '"+codeString+"'"); + } + public String toCode(NoteType code) { + if (code == NoteType.DISPLAY) + return "display"; + if (code == NoteType.PRINT) + return "print"; + if (code == NoteType.PRINTOPER) + return "printoper"; + return "?"; + } + public String toSystem(NoteType code) { + return code.getSystem(); + } + } + + public enum RemittanceOutcome { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + public static RemittanceOutcome fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("error".equals(codeString)) + return ERROR; + throw new FHIRException("Unknown RemittanceOutcome code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return "http://hl7.org/fhir/remittance-outcome"; + case ERROR: return "http://hl7.org/fhir/remittance-outcome"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "Complete"; + case ERROR: return "Error"; + default: return "?"; + } + } + } + + public static class RemittanceOutcomeEnumFactory implements EnumFactory { + public RemittanceOutcome fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RemittanceOutcome.COMPLETE; + if ("error".equals(codeString)) + return RemittanceOutcome.ERROR; + throw new IllegalArgumentException("Unknown RemittanceOutcome code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return new Enumeration(this, RemittanceOutcome.COMPLETE); + if ("error".equals(codeString)) + return new Enumeration(this, RemittanceOutcome.ERROR); + throw new FHIRException("Unknown RemittanceOutcome code '"+codeString+"'"); + } + public String toCode(RemittanceOutcome code) { + if (code == RemittanceOutcome.COMPLETE) + return "complete"; + if (code == RemittanceOutcome.ERROR) + return "error"; + return "?"; + } + public String toSystem(RemittanceOutcome code) { + return code.getSystem(); + } + } + + public enum ResourceType { + /** + * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc. + */ + ACCOUNT, + /** + * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + */ + ALLERGYINTOLERANCE, + /** + * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). + */ + APPOINTMENT, + /** + * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. + */ + APPOINTMENTRESPONSE, + /** + * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + */ + AUDITEVENT, + /** + * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. + */ + BASIC, + /** + * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + */ + BINARY, + /** + * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + */ + BODYSITE, + /** + * A container for a collection of resources. + */ + BUNDLE, + /** + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. + */ + CAREPLAN, + /** + * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. + */ + CARETEAM, + /** + * 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. + */ + CLAIM, + /** + * This resource provides the adjudication details from the processing of a Claim resource. + */ + CLAIMRESPONSE, + /** + * 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. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + */ + CLINICALIMPRESSION, + /** + * A code system resource specifies a set of codes drawn from one or more code systems. + */ + CODESYSTEM, + /** + * 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. + */ + COMMUNICATION, + /** + * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + */ + COMMUNICATIONREQUEST, + /** + * A compartment definition that defines how resources are accessed on a server. + */ + COMPARTMENTDEFINITION, + /** + * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. + */ + COMPOSITION, + /** + * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + */ + CONCEPTMAP, + /** + * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary. + */ + CONDITION, + /** + * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. + */ + CONFORMANCE, + /** + * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + */ + CONTRACT, + /** + * Financial instrument which may be used to pay for or reimburse health care products and services. + */ + COVERAGE, + /** + * The formal description of a single piece of information that can be gathered and reported. + */ + DATAELEMENT, + /** + * This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events. + */ + DECISIONSUPPORTRULE, + /** + * The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking. + */ + DECISIONSUPPORTSERVICEMODULE, + /** + * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + */ + DETECTEDISSUE, + /** + * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. + */ + DEVICE, + /** + * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. + */ + DEVICECOMPONENT, + /** + * Describes a measurement, calculation or setting capability of a medical device. + */ + DEVICEMETRIC, + /** + * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. + */ + DEVICEUSEREQUEST, + /** + * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. + */ + DEVICEUSESTATEMENT, + /** + * A record of a request for a diagnostic investigation service to be performed. + */ + DIAGNOSTICORDER, + /** + * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. + */ + DIAGNOSTICREPORT, + /** + * A manifest that defines a set of documents. + */ + DOCUMENTMANIFEST, + /** + * A reference to a document . + */ + DOCUMENTREFERENCE, + /** + * A resource that includes narrative, extensions, and contained resources. + */ + DOMAINRESOURCE, + /** + * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + */ + ELIGIBILITYREQUEST, + /** + * This resource provides eligibility and plan details from the processing of an Eligibility resource. + */ + ELIGIBILITYRESPONSE, + /** + * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + */ + ENCOUNTER, + /** + * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. + */ + ENROLLMENTREQUEST, + /** + * This resource provides enrollment and plan details from the processing of an Enrollment resource. + */ + ENROLLMENTRESPONSE, + /** + * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + */ + EPISODEOFCARE, + /** + * Resource to define constraints on the Expansion of a FHIR ValueSet. + */ + EXPANSIONPROFILE, + /** + * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. + */ + EXPLANATIONOFBENEFIT, + /** + * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. + */ + FAMILYMEMBERHISTORY, + /** + * Prospective warnings of potential issues when providing care to the patient. + */ + FLAG, + /** + * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. + */ + GOAL, + /** + * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. + */ + GROUP, + /** + * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. + */ + GUIDANCERESPONSE, + /** + * The details of a healthcare service available at a location. + */ + HEALTHCARESERVICE, + /** + * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. + */ + IMAGINGEXCERPT, + /** + * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. + */ + IMAGINGOBJECTSELECTION, + /** + * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. + */ + IMAGINGSTUDY, + /** + * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. + */ + IMMUNIZATION, + /** + * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. + */ + IMMUNIZATIONRECOMMENDATION, + /** + * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts. + */ + IMPLEMENTATIONGUIDE, + /** + * The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library. + */ + LIBRARY, + /** + * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". + */ + LINKAGE, + /** + * A set of information summarized from a list of other resources. + */ + LIST, + /** + * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + */ + LOCATION, + /** + * The Measure resource provides the definition of a quality measure. + */ + MEASURE, + /** + * The MeasureReport resource contains the results of evaluating a measure. + */ + MEASUREREPORT, + /** + * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + */ + MEDIA, + /** + * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. + */ + MEDICATION, + /** + * Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + */ + MEDICATIONADMINISTRATION, + /** + * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. + */ + MEDICATIONDISPENSE, + /** + * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc. + */ + MEDICATIONORDER, + /** + * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. + */ + MEDICATIONSTATEMENT, + /** + * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + */ + MESSAGEHEADER, + /** + * The ModuleDefinition resource defines the data requirements for a quality artifact. + */ + MODULEDEFINITION, + /** + * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + */ + NAMINGSYSTEM, + /** + * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + */ + NUTRITIONORDER, + /** + * Measurements and simple assertions made about a patient, device or other subject. + */ + OBSERVATION, + /** + * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + */ + OPERATIONDEFINITION, + /** + * A collection of error, warning or information messages that result from a system action. + */ + OPERATIONOUTCOME, + /** + * A request to perform an action. + */ + ORDER, + /** + * A response to an order. + */ + ORDERRESPONSE, + /** + * This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support. + */ + ORDERSET, + /** + * 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. + */ + ORGANIZATION, + /** + * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. + */ + PARAMETERS, + /** + * Demographics and other administrative information about an individual or animal receiving care or other health-related services. + */ + PATIENT, + /** + * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. + */ + PAYMENTNOTICE, + /** + * This resource provides payment details and claim references supporting a bulk payment. + */ + PAYMENTRECONCILIATION, + /** + * Demographics and administrative information about a person independent of a specific health-related context. + */ + PERSON, + /** + * A person who is directly or indirectly involved in the provisioning of healthcare. + */ + PRACTITIONER, + /** + * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. + */ + PRACTITIONERROLE, + /** + * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. + */ + PROCEDURE, + /** + * A request for a procedure to be performed. May be a proposal or an order. + */ + PROCEDUREREQUEST, + /** + * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. + */ + PROCESSREQUEST, + /** + * This resource provides processing status, errors and notes from the processing of a resource. + */ + PROCESSRESPONSE, + /** + * A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points. + */ + PROTOCOL, + /** + * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. + */ + PROVENANCE, + /** + * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ + QUESTIONNAIRE, + /** + * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ + QUESTIONNAIRERESPONSE, + /** + * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. + */ + REFERRALREQUEST, + /** + * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. + */ + RELATEDPERSON, + /** + * This is the base resource type for everything. + */ + RESOURCE, + /** + * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + */ + RISKASSESSMENT, + /** + * A container for slot(s) of time that may be available for booking appointments. + */ + SCHEDULE, + /** + * A search parameter that defines a named search item that can be used to search/filter on a resource. + */ + SEARCHPARAMETER, + /** + * Variation and Sequence data. + */ + SEQUENCE, + /** + * A slot of time on a schedule that may be available for booking appointments. + */ + SLOT, + /** + * A sample to be used for analysis. + */ + SPECIMEN, + /** + * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + */ + STRUCTUREDEFINITION, + /** + * A Map of relationships between 2 structures that can be used to transform data. + */ + STRUCTUREMAP, + /** + * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. + */ + SUBSCRIPTION, + /** + * A homogeneous material with a definite composition. + */ + SUBSTANCE, + /** + * Record of delivery of what is supplied. + */ + SUPPLYDELIVERY, + /** + * A record of a request for a medication, substance or device used in the healthcare setting. + */ + SUPPLYREQUEST, + /** + * A task to be performed. + */ + TASK, + /** + * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + */ + TESTSCRIPT, + /** + * A value set specifies a set of codes drawn from one or more code systems. + */ + VALUESET, + /** + * An authorization for the supply of glasses and/or contact lenses to a patient. + */ + VISIONPRESCRIPTION, + /** + * added to help the parsers + */ + NULL; + public static ResourceType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("Account".equals(codeString)) + return ACCOUNT; + if ("AllergyIntolerance".equals(codeString)) + return ALLERGYINTOLERANCE; + if ("Appointment".equals(codeString)) + return APPOINTMENT; + if ("AppointmentResponse".equals(codeString)) + return APPOINTMENTRESPONSE; + if ("AuditEvent".equals(codeString)) + return AUDITEVENT; + if ("Basic".equals(codeString)) + return BASIC; + if ("Binary".equals(codeString)) + return BINARY; + if ("BodySite".equals(codeString)) + return BODYSITE; + if ("Bundle".equals(codeString)) + return BUNDLE; + if ("CarePlan".equals(codeString)) + return CAREPLAN; + if ("CareTeam".equals(codeString)) + return CARETEAM; + if ("Claim".equals(codeString)) + return CLAIM; + if ("ClaimResponse".equals(codeString)) + return CLAIMRESPONSE; + if ("ClinicalImpression".equals(codeString)) + return CLINICALIMPRESSION; + if ("CodeSystem".equals(codeString)) + return CODESYSTEM; + if ("Communication".equals(codeString)) + return COMMUNICATION; + if ("CommunicationRequest".equals(codeString)) + return COMMUNICATIONREQUEST; + if ("CompartmentDefinition".equals(codeString)) + return COMPARTMENTDEFINITION; + if ("Composition".equals(codeString)) + return COMPOSITION; + if ("ConceptMap".equals(codeString)) + return CONCEPTMAP; + if ("Condition".equals(codeString)) + return CONDITION; + if ("Conformance".equals(codeString)) + return CONFORMANCE; + if ("Contract".equals(codeString)) + return CONTRACT; + if ("Coverage".equals(codeString)) + return COVERAGE; + if ("DataElement".equals(codeString)) + return DATAELEMENT; + if ("DecisionSupportRule".equals(codeString)) + return DECISIONSUPPORTRULE; + if ("DecisionSupportServiceModule".equals(codeString)) + return DECISIONSUPPORTSERVICEMODULE; + if ("DetectedIssue".equals(codeString)) + return DETECTEDISSUE; + if ("Device".equals(codeString)) + return DEVICE; + if ("DeviceComponent".equals(codeString)) + return DEVICECOMPONENT; + if ("DeviceMetric".equals(codeString)) + return DEVICEMETRIC; + if ("DeviceUseRequest".equals(codeString)) + return DEVICEUSEREQUEST; + if ("DeviceUseStatement".equals(codeString)) + return DEVICEUSESTATEMENT; + if ("DiagnosticOrder".equals(codeString)) + return DIAGNOSTICORDER; + if ("DiagnosticReport".equals(codeString)) + return DIAGNOSTICREPORT; + if ("DocumentManifest".equals(codeString)) + return DOCUMENTMANIFEST; + if ("DocumentReference".equals(codeString)) + return DOCUMENTREFERENCE; + if ("DomainResource".equals(codeString)) + return DOMAINRESOURCE; + if ("EligibilityRequest".equals(codeString)) + return ELIGIBILITYREQUEST; + if ("EligibilityResponse".equals(codeString)) + return ELIGIBILITYRESPONSE; + if ("Encounter".equals(codeString)) + return ENCOUNTER; + if ("EnrollmentRequest".equals(codeString)) + return ENROLLMENTREQUEST; + if ("EnrollmentResponse".equals(codeString)) + return ENROLLMENTRESPONSE; + if ("EpisodeOfCare".equals(codeString)) + return EPISODEOFCARE; + if ("ExpansionProfile".equals(codeString)) + return EXPANSIONPROFILE; + if ("ExplanationOfBenefit".equals(codeString)) + return EXPLANATIONOFBENEFIT; + if ("FamilyMemberHistory".equals(codeString)) + return FAMILYMEMBERHISTORY; + if ("Flag".equals(codeString)) + return FLAG; + if ("Goal".equals(codeString)) + return GOAL; + if ("Group".equals(codeString)) + return GROUP; + if ("GuidanceResponse".equals(codeString)) + return GUIDANCERESPONSE; + if ("HealthcareService".equals(codeString)) + return HEALTHCARESERVICE; + if ("ImagingExcerpt".equals(codeString)) + return IMAGINGEXCERPT; + if ("ImagingObjectSelection".equals(codeString)) + return IMAGINGOBJECTSELECTION; + if ("ImagingStudy".equals(codeString)) + return IMAGINGSTUDY; + if ("Immunization".equals(codeString)) + return IMMUNIZATION; + if ("ImmunizationRecommendation".equals(codeString)) + return IMMUNIZATIONRECOMMENDATION; + if ("ImplementationGuide".equals(codeString)) + return IMPLEMENTATIONGUIDE; + if ("Library".equals(codeString)) + return LIBRARY; + if ("Linkage".equals(codeString)) + return LINKAGE; + if ("List".equals(codeString)) + return LIST; + if ("Location".equals(codeString)) + return LOCATION; + if ("Measure".equals(codeString)) + return MEASURE; + if ("MeasureReport".equals(codeString)) + return MEASUREREPORT; + if ("Media".equals(codeString)) + return MEDIA; + if ("Medication".equals(codeString)) + return MEDICATION; + if ("MedicationAdministration".equals(codeString)) + return MEDICATIONADMINISTRATION; + if ("MedicationDispense".equals(codeString)) + return MEDICATIONDISPENSE; + if ("MedicationOrder".equals(codeString)) + return MEDICATIONORDER; + if ("MedicationStatement".equals(codeString)) + return MEDICATIONSTATEMENT; + if ("MessageHeader".equals(codeString)) + return MESSAGEHEADER; + if ("ModuleDefinition".equals(codeString)) + return MODULEDEFINITION; + if ("NamingSystem".equals(codeString)) + return NAMINGSYSTEM; + if ("NutritionOrder".equals(codeString)) + return NUTRITIONORDER; + if ("Observation".equals(codeString)) + return OBSERVATION; + if ("OperationDefinition".equals(codeString)) + return OPERATIONDEFINITION; + if ("OperationOutcome".equals(codeString)) + return OPERATIONOUTCOME; + if ("Order".equals(codeString)) + return ORDER; + if ("OrderResponse".equals(codeString)) + return ORDERRESPONSE; + if ("OrderSet".equals(codeString)) + return ORDERSET; + if ("Organization".equals(codeString)) + return ORGANIZATION; + if ("Parameters".equals(codeString)) + return PARAMETERS; + if ("Patient".equals(codeString)) + return PATIENT; + if ("PaymentNotice".equals(codeString)) + return PAYMENTNOTICE; + if ("PaymentReconciliation".equals(codeString)) + return PAYMENTRECONCILIATION; + if ("Person".equals(codeString)) + return PERSON; + if ("Practitioner".equals(codeString)) + return PRACTITIONER; + if ("PractitionerRole".equals(codeString)) + return PRACTITIONERROLE; + if ("Procedure".equals(codeString)) + return PROCEDURE; + if ("ProcedureRequest".equals(codeString)) + return PROCEDUREREQUEST; + if ("ProcessRequest".equals(codeString)) + return PROCESSREQUEST; + if ("ProcessResponse".equals(codeString)) + return PROCESSRESPONSE; + if ("Protocol".equals(codeString)) + return PROTOCOL; + if ("Provenance".equals(codeString)) + return PROVENANCE; + if ("Questionnaire".equals(codeString)) + return QUESTIONNAIRE; + if ("QuestionnaireResponse".equals(codeString)) + return QUESTIONNAIRERESPONSE; + if ("ReferralRequest".equals(codeString)) + return REFERRALREQUEST; + if ("RelatedPerson".equals(codeString)) + return RELATEDPERSON; + if ("Resource".equals(codeString)) + return RESOURCE; + if ("RiskAssessment".equals(codeString)) + return RISKASSESSMENT; + if ("Schedule".equals(codeString)) + return SCHEDULE; + if ("SearchParameter".equals(codeString)) + return SEARCHPARAMETER; + if ("Sequence".equals(codeString)) + return SEQUENCE; + if ("Slot".equals(codeString)) + return SLOT; + if ("Specimen".equals(codeString)) + return SPECIMEN; + if ("StructureDefinition".equals(codeString)) + return STRUCTUREDEFINITION; + if ("StructureMap".equals(codeString)) + return STRUCTUREMAP; + if ("Subscription".equals(codeString)) + return SUBSCRIPTION; + if ("Substance".equals(codeString)) + return SUBSTANCE; + if ("SupplyDelivery".equals(codeString)) + return SUPPLYDELIVERY; + if ("SupplyRequest".equals(codeString)) + return SUPPLYREQUEST; + if ("Task".equals(codeString)) + return TASK; + if ("TestScript".equals(codeString)) + return TESTSCRIPT; + if ("ValueSet".equals(codeString)) + return VALUESET; + if ("VisionPrescription".equals(codeString)) + return VISIONPRESCRIPTION; + throw new FHIRException("Unknown ResourceType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACCOUNT: return "Account"; + case ALLERGYINTOLERANCE: return "AllergyIntolerance"; + case APPOINTMENT: return "Appointment"; + case APPOINTMENTRESPONSE: return "AppointmentResponse"; + case AUDITEVENT: return "AuditEvent"; + case BASIC: return "Basic"; + case BINARY: return "Binary"; + case BODYSITE: return "BodySite"; + case BUNDLE: return "Bundle"; + case CAREPLAN: return "CarePlan"; + case CARETEAM: return "CareTeam"; + case CLAIM: return "Claim"; + case CLAIMRESPONSE: return "ClaimResponse"; + case CLINICALIMPRESSION: return "ClinicalImpression"; + case CODESYSTEM: return "CodeSystem"; + case COMMUNICATION: return "Communication"; + case COMMUNICATIONREQUEST: return "CommunicationRequest"; + case COMPARTMENTDEFINITION: return "CompartmentDefinition"; + case COMPOSITION: return "Composition"; + case CONCEPTMAP: return "ConceptMap"; + case CONDITION: return "Condition"; + case CONFORMANCE: return "Conformance"; + case CONTRACT: return "Contract"; + case COVERAGE: return "Coverage"; + case DATAELEMENT: return "DataElement"; + case DECISIONSUPPORTRULE: return "DecisionSupportRule"; + case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; + case DETECTEDISSUE: return "DetectedIssue"; + case DEVICE: return "Device"; + case DEVICECOMPONENT: return "DeviceComponent"; + case DEVICEMETRIC: return "DeviceMetric"; + case DEVICEUSEREQUEST: return "DeviceUseRequest"; + case DEVICEUSESTATEMENT: return "DeviceUseStatement"; + case DIAGNOSTICORDER: return "DiagnosticOrder"; + case DIAGNOSTICREPORT: return "DiagnosticReport"; + case DOCUMENTMANIFEST: return "DocumentManifest"; + case DOCUMENTREFERENCE: return "DocumentReference"; + case DOMAINRESOURCE: return "DomainResource"; + case ELIGIBILITYREQUEST: return "EligibilityRequest"; + case ELIGIBILITYRESPONSE: return "EligibilityResponse"; + case ENCOUNTER: return "Encounter"; + case ENROLLMENTREQUEST: return "EnrollmentRequest"; + case ENROLLMENTRESPONSE: return "EnrollmentResponse"; + case EPISODEOFCARE: return "EpisodeOfCare"; + case EXPANSIONPROFILE: return "ExpansionProfile"; + case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; + case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; + case FLAG: return "Flag"; + case GOAL: return "Goal"; + case GROUP: return "Group"; + case GUIDANCERESPONSE: return "GuidanceResponse"; + case HEALTHCARESERVICE: return "HealthcareService"; + case IMAGINGEXCERPT: return "ImagingExcerpt"; + case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; + case IMAGINGSTUDY: return "ImagingStudy"; + case IMMUNIZATION: return "Immunization"; + case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; + case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; + case LIBRARY: return "Library"; + case LINKAGE: return "Linkage"; + case LIST: return "List"; + case LOCATION: return "Location"; + case MEASURE: return "Measure"; + case MEASUREREPORT: return "MeasureReport"; + case MEDIA: return "Media"; + case MEDICATION: return "Medication"; + case MEDICATIONADMINISTRATION: return "MedicationAdministration"; + case MEDICATIONDISPENSE: return "MedicationDispense"; + case MEDICATIONORDER: return "MedicationOrder"; + case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEHEADER: return "MessageHeader"; + case MODULEDEFINITION: return "ModuleDefinition"; + case NAMINGSYSTEM: return "NamingSystem"; + case NUTRITIONORDER: return "NutritionOrder"; + case OBSERVATION: return "Observation"; + case OPERATIONDEFINITION: return "OperationDefinition"; + case OPERATIONOUTCOME: return "OperationOutcome"; + case ORDER: return "Order"; + case ORDERRESPONSE: return "OrderResponse"; + case ORDERSET: return "OrderSet"; + case ORGANIZATION: return "Organization"; + case PARAMETERS: return "Parameters"; + case PATIENT: return "Patient"; + case PAYMENTNOTICE: return "PaymentNotice"; + case PAYMENTRECONCILIATION: return "PaymentReconciliation"; + case PERSON: return "Person"; + case PRACTITIONER: return "Practitioner"; + case PRACTITIONERROLE: return "PractitionerRole"; + case PROCEDURE: return "Procedure"; + case PROCEDUREREQUEST: return "ProcedureRequest"; + case PROCESSREQUEST: return "ProcessRequest"; + case PROCESSRESPONSE: return "ProcessResponse"; + case PROTOCOL: return "Protocol"; + case PROVENANCE: return "Provenance"; + case QUESTIONNAIRE: return "Questionnaire"; + case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; + case REFERRALREQUEST: return "ReferralRequest"; + case RELATEDPERSON: return "RelatedPerson"; + case RESOURCE: return "Resource"; + case RISKASSESSMENT: return "RiskAssessment"; + case SCHEDULE: return "Schedule"; + case SEARCHPARAMETER: return "SearchParameter"; + case SEQUENCE: return "Sequence"; + case SLOT: return "Slot"; + case SPECIMEN: return "Specimen"; + case STRUCTUREDEFINITION: return "StructureDefinition"; + case STRUCTUREMAP: return "StructureMap"; + case SUBSCRIPTION: return "Subscription"; + case SUBSTANCE: return "Substance"; + case SUPPLYDELIVERY: return "SupplyDelivery"; + case SUPPLYREQUEST: return "SupplyRequest"; + case TASK: return "Task"; + case TESTSCRIPT: return "TestScript"; + case VALUESET: return "ValueSet"; + case VISIONPRESCRIPTION: return "VisionPrescription"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACCOUNT: return "http://hl7.org/fhir/resource-types"; + case ALLERGYINTOLERANCE: return "http://hl7.org/fhir/resource-types"; + case APPOINTMENT: return "http://hl7.org/fhir/resource-types"; + case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; + case AUDITEVENT: return "http://hl7.org/fhir/resource-types"; + case BASIC: return "http://hl7.org/fhir/resource-types"; + case BINARY: return "http://hl7.org/fhir/resource-types"; + case BODYSITE: return "http://hl7.org/fhir/resource-types"; + case BUNDLE: return "http://hl7.org/fhir/resource-types"; + case CAREPLAN: return "http://hl7.org/fhir/resource-types"; + case CARETEAM: return "http://hl7.org/fhir/resource-types"; + case CLAIM: return "http://hl7.org/fhir/resource-types"; + case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types"; + case CLINICALIMPRESSION: return "http://hl7.org/fhir/resource-types"; + case CODESYSTEM: return "http://hl7.org/fhir/resource-types"; + case COMMUNICATION: return "http://hl7.org/fhir/resource-types"; + case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; + case COMPARTMENTDEFINITION: return "http://hl7.org/fhir/resource-types"; + case COMPOSITION: return "http://hl7.org/fhir/resource-types"; + case CONCEPTMAP: return "http://hl7.org/fhir/resource-types"; + case CONDITION: return "http://hl7.org/fhir/resource-types"; + case CONFORMANCE: return "http://hl7.org/fhir/resource-types"; + case CONTRACT: return "http://hl7.org/fhir/resource-types"; + case COVERAGE: return "http://hl7.org/fhir/resource-types"; + case DATAELEMENT: return "http://hl7.org/fhir/resource-types"; + case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/resource-types"; + case DECISIONSUPPORTSERVICEMODULE: return "http://hl7.org/fhir/resource-types"; + case DETECTEDISSUE: return "http://hl7.org/fhir/resource-types"; + case DEVICE: return "http://hl7.org/fhir/resource-types"; + case DEVICECOMPONENT: return "http://hl7.org/fhir/resource-types"; + case DEVICEMETRIC: return "http://hl7.org/fhir/resource-types"; + case DEVICEUSEREQUEST: return "http://hl7.org/fhir/resource-types"; + case DEVICEUSESTATEMENT: return "http://hl7.org/fhir/resource-types"; + case DIAGNOSTICORDER: return "http://hl7.org/fhir/resource-types"; + case DIAGNOSTICREPORT: return "http://hl7.org/fhir/resource-types"; + case DOCUMENTMANIFEST: return "http://hl7.org/fhir/resource-types"; + case DOCUMENTREFERENCE: return "http://hl7.org/fhir/resource-types"; + case DOMAINRESOURCE: return "http://hl7.org/fhir/resource-types"; + case ELIGIBILITYREQUEST: return "http://hl7.org/fhir/resource-types"; + case ELIGIBILITYRESPONSE: return "http://hl7.org/fhir/resource-types"; + case ENCOUNTER: return "http://hl7.org/fhir/resource-types"; + case ENROLLMENTREQUEST: return "http://hl7.org/fhir/resource-types"; + case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; + case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types"; + case EXPANSIONPROFILE: return "http://hl7.org/fhir/resource-types"; + case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types"; + case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types"; + case FLAG: return "http://hl7.org/fhir/resource-types"; + case GOAL: return "http://hl7.org/fhir/resource-types"; + case GROUP: return "http://hl7.org/fhir/resource-types"; + case GUIDANCERESPONSE: return "http://hl7.org/fhir/resource-types"; + case HEALTHCARESERVICE: return "http://hl7.org/fhir/resource-types"; + case IMAGINGEXCERPT: return "http://hl7.org/fhir/resource-types"; + case IMAGINGOBJECTSELECTION: return "http://hl7.org/fhir/resource-types"; + case IMAGINGSTUDY: return "http://hl7.org/fhir/resource-types"; + case IMMUNIZATION: return "http://hl7.org/fhir/resource-types"; + case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/resource-types"; + case IMPLEMENTATIONGUIDE: return "http://hl7.org/fhir/resource-types"; + case LIBRARY: return "http://hl7.org/fhir/resource-types"; + case LINKAGE: return "http://hl7.org/fhir/resource-types"; + case LIST: return "http://hl7.org/fhir/resource-types"; + case LOCATION: return "http://hl7.org/fhir/resource-types"; + case MEASURE: return "http://hl7.org/fhir/resource-types"; + case MEASUREREPORT: return "http://hl7.org/fhir/resource-types"; + case MEDIA: return "http://hl7.org/fhir/resource-types"; + case MEDICATION: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONADMINISTRATION: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONORDER: return "http://hl7.org/fhir/resource-types"; + case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; + case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; + case MODULEDEFINITION: return "http://hl7.org/fhir/resource-types"; + case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; + case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types"; + case OBSERVATION: return "http://hl7.org/fhir/resource-types"; + case OPERATIONDEFINITION: return "http://hl7.org/fhir/resource-types"; + case OPERATIONOUTCOME: return "http://hl7.org/fhir/resource-types"; + case ORDER: return "http://hl7.org/fhir/resource-types"; + case ORDERRESPONSE: return "http://hl7.org/fhir/resource-types"; + case ORDERSET: return "http://hl7.org/fhir/resource-types"; + case ORGANIZATION: return "http://hl7.org/fhir/resource-types"; + case PARAMETERS: return "http://hl7.org/fhir/resource-types"; + case PATIENT: return "http://hl7.org/fhir/resource-types"; + case PAYMENTNOTICE: return "http://hl7.org/fhir/resource-types"; + case PAYMENTRECONCILIATION: return "http://hl7.org/fhir/resource-types"; + case PERSON: return "http://hl7.org/fhir/resource-types"; + case PRACTITIONER: return "http://hl7.org/fhir/resource-types"; + case PRACTITIONERROLE: return "http://hl7.org/fhir/resource-types"; + case PROCEDURE: return "http://hl7.org/fhir/resource-types"; + case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types"; + case PROCESSREQUEST: return "http://hl7.org/fhir/resource-types"; + case PROCESSRESPONSE: return "http://hl7.org/fhir/resource-types"; + case PROTOCOL: return "http://hl7.org/fhir/resource-types"; + case PROVENANCE: return "http://hl7.org/fhir/resource-types"; + case QUESTIONNAIRE: return "http://hl7.org/fhir/resource-types"; + case QUESTIONNAIRERESPONSE: return "http://hl7.org/fhir/resource-types"; + case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; + case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; + case RESOURCE: return "http://hl7.org/fhir/resource-types"; + case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; + case SCHEDULE: return "http://hl7.org/fhir/resource-types"; + case SEARCHPARAMETER: return "http://hl7.org/fhir/resource-types"; + case SEQUENCE: return "http://hl7.org/fhir/resource-types"; + case SLOT: return "http://hl7.org/fhir/resource-types"; + case SPECIMEN: return "http://hl7.org/fhir/resource-types"; + case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types"; + case STRUCTUREMAP: return "http://hl7.org/fhir/resource-types"; + case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types"; + case SUBSTANCE: return "http://hl7.org/fhir/resource-types"; + case SUPPLYDELIVERY: return "http://hl7.org/fhir/resource-types"; + case SUPPLYREQUEST: return "http://hl7.org/fhir/resource-types"; + case TASK: return "http://hl7.org/fhir/resource-types"; + case TESTSCRIPT: return "http://hl7.org/fhir/resource-types"; + case VALUESET: return "http://hl7.org/fhir/resource-types"; + case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACCOUNT: return "A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc."; + case ALLERGYINTOLERANCE: return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance."; + case APPOINTMENT: return "A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s)."; + case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection."; + case AUDITEVENT: return "A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage."; + case BASIC: return "Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification."; + case BINARY: return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc."; + case BODYSITE: return "Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case."; + case BUNDLE: return "A container for a collection of resources."; + case CAREPLAN: return "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions."; + case CARETEAM: return "The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient."; + case CLAIM: return "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."; + case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource."; + case CLINICALIMPRESSION: return "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. This resource is called \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion with the recording of assessment tools such as Apgar score."; + case CODESYSTEM: return "A code system resource specifies a set of codes drawn from one or more code systems."; + case COMMUNICATION: return "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."; + case COMMUNICATIONREQUEST: return "A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition."; + case COMPARTMENTDEFINITION: return "A compartment definition that defines how resources are accessed on a server."; + case COMPOSITION: return "A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained."; + case CONCEPTMAP: return "A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models."; + case CONDITION: return "Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary."; + case CONFORMANCE: return "A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation."; + case CONTRACT: return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters."; + case COVERAGE: return "Financial instrument which may be used to pay for or reimburse health care products and services."; + case DATAELEMENT: return "The formal description of a single piece of information that can be gathered and reported."; + case DECISIONSUPPORTRULE: return "This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events."; + case DECISIONSUPPORTSERVICEMODULE: return "The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking."; + case DETECTEDISSUE: return "Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc."; + case DEVICE: return "This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc."; + case DEVICECOMPONENT: return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device."; + case DEVICEMETRIC: return "Describes a measurement, calculation or setting capability of a medical device."; + case DEVICEUSEREQUEST: return "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker."; + case DEVICEUSESTATEMENT: return "A record of a device being used by a patient where the record is the result of a report from the patient or another clinician."; + case DIAGNOSTICORDER: return "A record of a request for a diagnostic investigation service to be performed."; + case DIAGNOSTICREPORT: return "The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports."; + case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; + case DOCUMENTREFERENCE: return "A reference to a document ."; + case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; + case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; + case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; + case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."; + case ENROLLMENTREQUEST: return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage."; + case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource."; + case EPISODEOFCARE: return "An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time."; + case EXPANSIONPROFILE: return "Resource to define constraints on the Expansion of a FHIR ValueSet."; + case EXPLANATIONOFBENEFIT: return "This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided."; + case FAMILYMEMBERHISTORY: return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient."; + case FLAG: return "Prospective warnings of potential issues when providing care to the patient."; + case GOAL: return "Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc."; + case GROUP: return "Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization."; + case GUIDANCERESPONSE: return "A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken."; + case HEALTHCARESERVICE: return "The details of a healthcare service available at a location."; + case IMAGINGEXCERPT: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; + case IMAGINGOBJECTSELECTION: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; + case IMAGINGSTUDY: return "Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities."; + case IMMUNIZATION: return "Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed."; + case IMMUNIZATIONRECOMMENDATION: return "A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification."; + case IMPLEMENTATIONGUIDE: return "A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts."; + case LIBRARY: return "The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library."; + case LINKAGE: return "Identifies two or more records (resource instances) that are referring to the same real-world \"occurrence\"."; + case LIST: return "A set of information summarized from a list of other resources."; + case LOCATION: return "Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated."; + case MEASURE: return "The Measure resource provides the definition of a quality measure."; + case MEASUREREPORT: return "The MeasureReport resource contains the results of evaluating a measure."; + case MEDIA: return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference."; + case MEDICATION: return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication."; + case MEDICATIONADMINISTRATION: return "Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner."; + case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; + case MEDICATIONORDER: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationOrder\" rather than \"MedicationPrescription\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc."; + case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; + case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle."; + case MODULEDEFINITION: return "The ModuleDefinition resource defines the data requirements for a quality artifact."; + case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; + case NUTRITIONORDER: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; + case OBSERVATION: return "Measurements and simple assertions made about a patient, device or other subject."; + case OPERATIONDEFINITION: return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction)."; + case OPERATIONOUTCOME: return "A collection of error, warning or information messages that result from a system action."; + case ORDER: return "A request to perform an action."; + case ORDERRESPONSE: return "A response to an order."; + case ORDERSET: return "This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support."; + case ORGANIZATION: return "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."; + case PARAMETERS: return "This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it."; + case PATIENT: return "Demographics and other administrative information about an individual or animal receiving care or other health-related services."; + case PAYMENTNOTICE: return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references."; + case PAYMENTRECONCILIATION: return "This resource provides payment details and claim references supporting a bulk payment."; + case PERSON: return "Demographics and administrative information about a person independent of a specific health-related context."; + case PRACTITIONER: return "A person who is directly or indirectly involved in the provisioning of healthcare."; + case PRACTITIONERROLE: return "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time."; + case PROCEDURE: return "An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy."; + case PROCEDUREREQUEST: return "A request for a procedure to be performed. May be a proposal or an order."; + case PROCESSREQUEST: return "This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources."; + case PROCESSRESPONSE: return "This resource provides processing status, errors and notes from the processing of a resource."; + case PROTOCOL: return "A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points."; + case PROVENANCE: return "Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies."; + case QUESTIONNAIRE: return "A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; + case QUESTIONNAIRERESPONSE: return "A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; + case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; + case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process."; + case RESOURCE: return "This is the base resource type for everything."; + case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; + case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; + case SEARCHPARAMETER: return "A search parameter that defines a named search item that can be used to search/filter on a resource."; + case SEQUENCE: return "Variation and Sequence data."; + case SLOT: return "A slot of time on a schedule that may be available for booking appointments."; + case SPECIMEN: return "A sample to be used for analysis."; + case STRUCTUREDEFINITION: return "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types."; + case STRUCTUREMAP: return "A Map of relationships between 2 structures that can be used to transform data."; + case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action."; + case SUBSTANCE: return "A homogeneous material with a definite composition."; + case SUPPLYDELIVERY: return "Record of delivery of what is supplied."; + case SUPPLYREQUEST: return "A record of a request for a medication, substance or device used in the healthcare setting."; + case TASK: return "A task to be performed."; + case TESTSCRIPT: return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification."; + case VALUESET: return "A value set specifies a set of codes drawn from one or more code systems."; + case VISIONPRESCRIPTION: return "An authorization for the supply of glasses and/or contact lenses to a patient."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACCOUNT: return "Account"; + case ALLERGYINTOLERANCE: return "AllergyIntolerance"; + case APPOINTMENT: return "Appointment"; + case APPOINTMENTRESPONSE: return "AppointmentResponse"; + case AUDITEVENT: return "AuditEvent"; + case BASIC: return "Basic"; + case BINARY: return "Binary"; + case BODYSITE: return "BodySite"; + case BUNDLE: return "Bundle"; + case CAREPLAN: return "CarePlan"; + case CARETEAM: return "CareTeam"; + case CLAIM: return "Claim"; + case CLAIMRESPONSE: return "ClaimResponse"; + case CLINICALIMPRESSION: return "ClinicalImpression"; + case CODESYSTEM: return "CodeSystem"; + case COMMUNICATION: return "Communication"; + case COMMUNICATIONREQUEST: return "CommunicationRequest"; + case COMPARTMENTDEFINITION: return "CompartmentDefinition"; + case COMPOSITION: return "Composition"; + case CONCEPTMAP: return "ConceptMap"; + case CONDITION: return "Condition"; + case CONFORMANCE: return "Conformance"; + case CONTRACT: return "Contract"; + case COVERAGE: return "Coverage"; + case DATAELEMENT: return "DataElement"; + case DECISIONSUPPORTRULE: return "DecisionSupportRule"; + case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; + case DETECTEDISSUE: return "DetectedIssue"; + case DEVICE: return "Device"; + case DEVICECOMPONENT: return "DeviceComponent"; + case DEVICEMETRIC: return "DeviceMetric"; + case DEVICEUSEREQUEST: return "DeviceUseRequest"; + case DEVICEUSESTATEMENT: return "DeviceUseStatement"; + case DIAGNOSTICORDER: return "DiagnosticOrder"; + case DIAGNOSTICREPORT: return "DiagnosticReport"; + case DOCUMENTMANIFEST: return "DocumentManifest"; + case DOCUMENTREFERENCE: return "DocumentReference"; + case DOMAINRESOURCE: return "DomainResource"; + case ELIGIBILITYREQUEST: return "EligibilityRequest"; + case ELIGIBILITYRESPONSE: return "EligibilityResponse"; + case ENCOUNTER: return "Encounter"; + case ENROLLMENTREQUEST: return "EnrollmentRequest"; + case ENROLLMENTRESPONSE: return "EnrollmentResponse"; + case EPISODEOFCARE: return "EpisodeOfCare"; + case EXPANSIONPROFILE: return "ExpansionProfile"; + case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; + case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; + case FLAG: return "Flag"; + case GOAL: return "Goal"; + case GROUP: return "Group"; + case GUIDANCERESPONSE: return "GuidanceResponse"; + case HEALTHCARESERVICE: return "HealthcareService"; + case IMAGINGEXCERPT: return "ImagingExcerpt"; + case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; + case IMAGINGSTUDY: return "ImagingStudy"; + case IMMUNIZATION: return "Immunization"; + case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; + case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; + case LIBRARY: return "Library"; + case LINKAGE: return "Linkage"; + case LIST: return "List"; + case LOCATION: return "Location"; + case MEASURE: return "Measure"; + case MEASUREREPORT: return "MeasureReport"; + case MEDIA: return "Media"; + case MEDICATION: return "Medication"; + case MEDICATIONADMINISTRATION: return "MedicationAdministration"; + case MEDICATIONDISPENSE: return "MedicationDispense"; + case MEDICATIONORDER: return "MedicationOrder"; + case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEHEADER: return "MessageHeader"; + case MODULEDEFINITION: return "ModuleDefinition"; + case NAMINGSYSTEM: return "NamingSystem"; + case NUTRITIONORDER: return "NutritionOrder"; + case OBSERVATION: return "Observation"; + case OPERATIONDEFINITION: return "OperationDefinition"; + case OPERATIONOUTCOME: return "OperationOutcome"; + case ORDER: return "Order"; + case ORDERRESPONSE: return "OrderResponse"; + case ORDERSET: return "OrderSet"; + case ORGANIZATION: return "Organization"; + case PARAMETERS: return "Parameters"; + case PATIENT: return "Patient"; + case PAYMENTNOTICE: return "PaymentNotice"; + case PAYMENTRECONCILIATION: return "PaymentReconciliation"; + case PERSON: return "Person"; + case PRACTITIONER: return "Practitioner"; + case PRACTITIONERROLE: return "PractitionerRole"; + case PROCEDURE: return "Procedure"; + case PROCEDUREREQUEST: return "ProcedureRequest"; + case PROCESSREQUEST: return "ProcessRequest"; + case PROCESSRESPONSE: return "ProcessResponse"; + case PROTOCOL: return "Protocol"; + case PROVENANCE: return "Provenance"; + case QUESTIONNAIRE: return "Questionnaire"; + case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; + case REFERRALREQUEST: return "ReferralRequest"; + case RELATEDPERSON: return "RelatedPerson"; + case RESOURCE: return "Resource"; + case RISKASSESSMENT: return "RiskAssessment"; + case SCHEDULE: return "Schedule"; + case SEARCHPARAMETER: return "SearchParameter"; + case SEQUENCE: return "Sequence"; + case SLOT: return "Slot"; + case SPECIMEN: return "Specimen"; + case STRUCTUREDEFINITION: return "StructureDefinition"; + case STRUCTUREMAP: return "StructureMap"; + case SUBSCRIPTION: return "Subscription"; + case SUBSTANCE: return "Substance"; + case SUPPLYDELIVERY: return "SupplyDelivery"; + case SUPPLYREQUEST: return "SupplyRequest"; + case TASK: return "Task"; + case TESTSCRIPT: return "TestScript"; + case VALUESET: return "ValueSet"; + case VISIONPRESCRIPTION: return "VisionPrescription"; + default: return "?"; + } + } + } + + public static class ResourceTypeEnumFactory implements EnumFactory { + public ResourceType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("Account".equals(codeString)) + return ResourceType.ACCOUNT; + if ("AllergyIntolerance".equals(codeString)) + return ResourceType.ALLERGYINTOLERANCE; + if ("Appointment".equals(codeString)) + return ResourceType.APPOINTMENT; + if ("AppointmentResponse".equals(codeString)) + return ResourceType.APPOINTMENTRESPONSE; + if ("AuditEvent".equals(codeString)) + return ResourceType.AUDITEVENT; + if ("Basic".equals(codeString)) + return ResourceType.BASIC; + if ("Binary".equals(codeString)) + return ResourceType.BINARY; + if ("BodySite".equals(codeString)) + return ResourceType.BODYSITE; + if ("Bundle".equals(codeString)) + return ResourceType.BUNDLE; + if ("CarePlan".equals(codeString)) + return ResourceType.CAREPLAN; + if ("CareTeam".equals(codeString)) + return ResourceType.CARETEAM; + if ("Claim".equals(codeString)) + return ResourceType.CLAIM; + if ("ClaimResponse".equals(codeString)) + return ResourceType.CLAIMRESPONSE; + if ("ClinicalImpression".equals(codeString)) + return ResourceType.CLINICALIMPRESSION; + if ("CodeSystem".equals(codeString)) + return ResourceType.CODESYSTEM; + if ("Communication".equals(codeString)) + return ResourceType.COMMUNICATION; + if ("CommunicationRequest".equals(codeString)) + return ResourceType.COMMUNICATIONREQUEST; + if ("CompartmentDefinition".equals(codeString)) + return ResourceType.COMPARTMENTDEFINITION; + if ("Composition".equals(codeString)) + return ResourceType.COMPOSITION; + if ("ConceptMap".equals(codeString)) + return ResourceType.CONCEPTMAP; + if ("Condition".equals(codeString)) + return ResourceType.CONDITION; + if ("Conformance".equals(codeString)) + return ResourceType.CONFORMANCE; + if ("Contract".equals(codeString)) + return ResourceType.CONTRACT; + if ("Coverage".equals(codeString)) + return ResourceType.COVERAGE; + if ("DataElement".equals(codeString)) + return ResourceType.DATAELEMENT; + if ("DecisionSupportRule".equals(codeString)) + return ResourceType.DECISIONSUPPORTRULE; + if ("DecisionSupportServiceModule".equals(codeString)) + return ResourceType.DECISIONSUPPORTSERVICEMODULE; + if ("DetectedIssue".equals(codeString)) + return ResourceType.DETECTEDISSUE; + if ("Device".equals(codeString)) + return ResourceType.DEVICE; + if ("DeviceComponent".equals(codeString)) + return ResourceType.DEVICECOMPONENT; + if ("DeviceMetric".equals(codeString)) + return ResourceType.DEVICEMETRIC; + if ("DeviceUseRequest".equals(codeString)) + return ResourceType.DEVICEUSEREQUEST; + if ("DeviceUseStatement".equals(codeString)) + return ResourceType.DEVICEUSESTATEMENT; + if ("DiagnosticOrder".equals(codeString)) + return ResourceType.DIAGNOSTICORDER; + if ("DiagnosticReport".equals(codeString)) + return ResourceType.DIAGNOSTICREPORT; + if ("DocumentManifest".equals(codeString)) + return ResourceType.DOCUMENTMANIFEST; + if ("DocumentReference".equals(codeString)) + return ResourceType.DOCUMENTREFERENCE; + if ("DomainResource".equals(codeString)) + return ResourceType.DOMAINRESOURCE; + if ("EligibilityRequest".equals(codeString)) + return ResourceType.ELIGIBILITYREQUEST; + if ("EligibilityResponse".equals(codeString)) + return ResourceType.ELIGIBILITYRESPONSE; + if ("Encounter".equals(codeString)) + return ResourceType.ENCOUNTER; + if ("EnrollmentRequest".equals(codeString)) + return ResourceType.ENROLLMENTREQUEST; + if ("EnrollmentResponse".equals(codeString)) + return ResourceType.ENROLLMENTRESPONSE; + if ("EpisodeOfCare".equals(codeString)) + return ResourceType.EPISODEOFCARE; + if ("ExpansionProfile".equals(codeString)) + return ResourceType.EXPANSIONPROFILE; + if ("ExplanationOfBenefit".equals(codeString)) + return ResourceType.EXPLANATIONOFBENEFIT; + if ("FamilyMemberHistory".equals(codeString)) + return ResourceType.FAMILYMEMBERHISTORY; + if ("Flag".equals(codeString)) + return ResourceType.FLAG; + if ("Goal".equals(codeString)) + return ResourceType.GOAL; + if ("Group".equals(codeString)) + return ResourceType.GROUP; + if ("GuidanceResponse".equals(codeString)) + return ResourceType.GUIDANCERESPONSE; + if ("HealthcareService".equals(codeString)) + return ResourceType.HEALTHCARESERVICE; + if ("ImagingExcerpt".equals(codeString)) + return ResourceType.IMAGINGEXCERPT; + if ("ImagingObjectSelection".equals(codeString)) + return ResourceType.IMAGINGOBJECTSELECTION; + if ("ImagingStudy".equals(codeString)) + return ResourceType.IMAGINGSTUDY; + if ("Immunization".equals(codeString)) + return ResourceType.IMMUNIZATION; + if ("ImmunizationRecommendation".equals(codeString)) + return ResourceType.IMMUNIZATIONRECOMMENDATION; + if ("ImplementationGuide".equals(codeString)) + return ResourceType.IMPLEMENTATIONGUIDE; + if ("Library".equals(codeString)) + return ResourceType.LIBRARY; + if ("Linkage".equals(codeString)) + return ResourceType.LINKAGE; + if ("List".equals(codeString)) + return ResourceType.LIST; + if ("Location".equals(codeString)) + return ResourceType.LOCATION; + if ("Measure".equals(codeString)) + return ResourceType.MEASURE; + if ("MeasureReport".equals(codeString)) + return ResourceType.MEASUREREPORT; + if ("Media".equals(codeString)) + return ResourceType.MEDIA; + if ("Medication".equals(codeString)) + return ResourceType.MEDICATION; + if ("MedicationAdministration".equals(codeString)) + return ResourceType.MEDICATIONADMINISTRATION; + if ("MedicationDispense".equals(codeString)) + return ResourceType.MEDICATIONDISPENSE; + if ("MedicationOrder".equals(codeString)) + return ResourceType.MEDICATIONORDER; + if ("MedicationStatement".equals(codeString)) + return ResourceType.MEDICATIONSTATEMENT; + if ("MessageHeader".equals(codeString)) + return ResourceType.MESSAGEHEADER; + if ("ModuleDefinition".equals(codeString)) + return ResourceType.MODULEDEFINITION; + if ("NamingSystem".equals(codeString)) + return ResourceType.NAMINGSYSTEM; + if ("NutritionOrder".equals(codeString)) + return ResourceType.NUTRITIONORDER; + if ("Observation".equals(codeString)) + return ResourceType.OBSERVATION; + if ("OperationDefinition".equals(codeString)) + return ResourceType.OPERATIONDEFINITION; + if ("OperationOutcome".equals(codeString)) + return ResourceType.OPERATIONOUTCOME; + if ("Order".equals(codeString)) + return ResourceType.ORDER; + if ("OrderResponse".equals(codeString)) + return ResourceType.ORDERRESPONSE; + if ("OrderSet".equals(codeString)) + return ResourceType.ORDERSET; + if ("Organization".equals(codeString)) + return ResourceType.ORGANIZATION; + if ("Parameters".equals(codeString)) + return ResourceType.PARAMETERS; + if ("Patient".equals(codeString)) + return ResourceType.PATIENT; + if ("PaymentNotice".equals(codeString)) + return ResourceType.PAYMENTNOTICE; + if ("PaymentReconciliation".equals(codeString)) + return ResourceType.PAYMENTRECONCILIATION; + if ("Person".equals(codeString)) + return ResourceType.PERSON; + if ("Practitioner".equals(codeString)) + return ResourceType.PRACTITIONER; + if ("PractitionerRole".equals(codeString)) + return ResourceType.PRACTITIONERROLE; + if ("Procedure".equals(codeString)) + return ResourceType.PROCEDURE; + if ("ProcedureRequest".equals(codeString)) + return ResourceType.PROCEDUREREQUEST; + if ("ProcessRequest".equals(codeString)) + return ResourceType.PROCESSREQUEST; + if ("ProcessResponse".equals(codeString)) + return ResourceType.PROCESSRESPONSE; + if ("Protocol".equals(codeString)) + return ResourceType.PROTOCOL; + if ("Provenance".equals(codeString)) + return ResourceType.PROVENANCE; + if ("Questionnaire".equals(codeString)) + return ResourceType.QUESTIONNAIRE; + if ("QuestionnaireResponse".equals(codeString)) + return ResourceType.QUESTIONNAIRERESPONSE; + if ("ReferralRequest".equals(codeString)) + return ResourceType.REFERRALREQUEST; + if ("RelatedPerson".equals(codeString)) + return ResourceType.RELATEDPERSON; + if ("Resource".equals(codeString)) + return ResourceType.RESOURCE; + if ("RiskAssessment".equals(codeString)) + return ResourceType.RISKASSESSMENT; + if ("Schedule".equals(codeString)) + return ResourceType.SCHEDULE; + if ("SearchParameter".equals(codeString)) + return ResourceType.SEARCHPARAMETER; + if ("Sequence".equals(codeString)) + return ResourceType.SEQUENCE; + if ("Slot".equals(codeString)) + return ResourceType.SLOT; + if ("Specimen".equals(codeString)) + return ResourceType.SPECIMEN; + if ("StructureDefinition".equals(codeString)) + return ResourceType.STRUCTUREDEFINITION; + if ("StructureMap".equals(codeString)) + return ResourceType.STRUCTUREMAP; + if ("Subscription".equals(codeString)) + return ResourceType.SUBSCRIPTION; + if ("Substance".equals(codeString)) + return ResourceType.SUBSTANCE; + if ("SupplyDelivery".equals(codeString)) + return ResourceType.SUPPLYDELIVERY; + if ("SupplyRequest".equals(codeString)) + return ResourceType.SUPPLYREQUEST; + if ("Task".equals(codeString)) + return ResourceType.TASK; + if ("TestScript".equals(codeString)) + return ResourceType.TESTSCRIPT; + if ("ValueSet".equals(codeString)) + return ResourceType.VALUESET; + if ("VisionPrescription".equals(codeString)) + return ResourceType.VISIONPRESCRIPTION; + throw new IllegalArgumentException("Unknown ResourceType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("Account".equals(codeString)) + return new Enumeration(this, ResourceType.ACCOUNT); + if ("AllergyIntolerance".equals(codeString)) + return new Enumeration(this, ResourceType.ALLERGYINTOLERANCE); + if ("Appointment".equals(codeString)) + return new Enumeration(this, ResourceType.APPOINTMENT); + if ("AppointmentResponse".equals(codeString)) + return new Enumeration(this, ResourceType.APPOINTMENTRESPONSE); + if ("AuditEvent".equals(codeString)) + return new Enumeration(this, ResourceType.AUDITEVENT); + if ("Basic".equals(codeString)) + return new Enumeration(this, ResourceType.BASIC); + if ("Binary".equals(codeString)) + return new Enumeration(this, ResourceType.BINARY); + if ("BodySite".equals(codeString)) + return new Enumeration(this, ResourceType.BODYSITE); + if ("Bundle".equals(codeString)) + return new Enumeration(this, ResourceType.BUNDLE); + if ("CarePlan".equals(codeString)) + return new Enumeration(this, ResourceType.CAREPLAN); + if ("CareTeam".equals(codeString)) + return new Enumeration(this, ResourceType.CARETEAM); + if ("Claim".equals(codeString)) + return new Enumeration(this, ResourceType.CLAIM); + if ("ClaimResponse".equals(codeString)) + return new Enumeration(this, ResourceType.CLAIMRESPONSE); + if ("ClinicalImpression".equals(codeString)) + return new Enumeration(this, ResourceType.CLINICALIMPRESSION); + if ("CodeSystem".equals(codeString)) + return new Enumeration(this, ResourceType.CODESYSTEM); + if ("Communication".equals(codeString)) + return new Enumeration(this, ResourceType.COMMUNICATION); + if ("CommunicationRequest".equals(codeString)) + return new Enumeration(this, ResourceType.COMMUNICATIONREQUEST); + if ("CompartmentDefinition".equals(codeString)) + return new Enumeration(this, ResourceType.COMPARTMENTDEFINITION); + if ("Composition".equals(codeString)) + return new Enumeration(this, ResourceType.COMPOSITION); + if ("ConceptMap".equals(codeString)) + return new Enumeration(this, ResourceType.CONCEPTMAP); + if ("Condition".equals(codeString)) + return new Enumeration(this, ResourceType.CONDITION); + if ("Conformance".equals(codeString)) + return new Enumeration(this, ResourceType.CONFORMANCE); + if ("Contract".equals(codeString)) + return new Enumeration(this, ResourceType.CONTRACT); + if ("Coverage".equals(codeString)) + return new Enumeration(this, ResourceType.COVERAGE); + if ("DataElement".equals(codeString)) + return new Enumeration(this, ResourceType.DATAELEMENT); + if ("DecisionSupportRule".equals(codeString)) + return new Enumeration(this, ResourceType.DECISIONSUPPORTRULE); + if ("DecisionSupportServiceModule".equals(codeString)) + return new Enumeration(this, ResourceType.DECISIONSUPPORTSERVICEMODULE); + if ("DetectedIssue".equals(codeString)) + return new Enumeration(this, ResourceType.DETECTEDISSUE); + if ("Device".equals(codeString)) + return new Enumeration(this, ResourceType.DEVICE); + if ("DeviceComponent".equals(codeString)) + return new Enumeration(this, ResourceType.DEVICECOMPONENT); + if ("DeviceMetric".equals(codeString)) + return new Enumeration(this, ResourceType.DEVICEMETRIC); + if ("DeviceUseRequest".equals(codeString)) + return new Enumeration(this, ResourceType.DEVICEUSEREQUEST); + if ("DeviceUseStatement".equals(codeString)) + return new Enumeration(this, ResourceType.DEVICEUSESTATEMENT); + if ("DiagnosticOrder".equals(codeString)) + return new Enumeration(this, ResourceType.DIAGNOSTICORDER); + if ("DiagnosticReport".equals(codeString)) + return new Enumeration(this, ResourceType.DIAGNOSTICREPORT); + if ("DocumentManifest".equals(codeString)) + return new Enumeration(this, ResourceType.DOCUMENTMANIFEST); + if ("DocumentReference".equals(codeString)) + return new Enumeration(this, ResourceType.DOCUMENTREFERENCE); + if ("DomainResource".equals(codeString)) + return new Enumeration(this, ResourceType.DOMAINRESOURCE); + if ("EligibilityRequest".equals(codeString)) + return new Enumeration(this, ResourceType.ELIGIBILITYREQUEST); + if ("EligibilityResponse".equals(codeString)) + return new Enumeration(this, ResourceType.ELIGIBILITYRESPONSE); + if ("Encounter".equals(codeString)) + return new Enumeration(this, ResourceType.ENCOUNTER); + if ("EnrollmentRequest".equals(codeString)) + return new Enumeration(this, ResourceType.ENROLLMENTREQUEST); + if ("EnrollmentResponse".equals(codeString)) + return new Enumeration(this, ResourceType.ENROLLMENTRESPONSE); + if ("EpisodeOfCare".equals(codeString)) + return new Enumeration(this, ResourceType.EPISODEOFCARE); + if ("ExpansionProfile".equals(codeString)) + return new Enumeration(this, ResourceType.EXPANSIONPROFILE); + if ("ExplanationOfBenefit".equals(codeString)) + return new Enumeration(this, ResourceType.EXPLANATIONOFBENEFIT); + if ("FamilyMemberHistory".equals(codeString)) + return new Enumeration(this, ResourceType.FAMILYMEMBERHISTORY); + if ("Flag".equals(codeString)) + return new Enumeration(this, ResourceType.FLAG); + if ("Goal".equals(codeString)) + return new Enumeration(this, ResourceType.GOAL); + if ("Group".equals(codeString)) + return new Enumeration(this, ResourceType.GROUP); + if ("GuidanceResponse".equals(codeString)) + return new Enumeration(this, ResourceType.GUIDANCERESPONSE); + if ("HealthcareService".equals(codeString)) + return new Enumeration(this, ResourceType.HEALTHCARESERVICE); + if ("ImagingExcerpt".equals(codeString)) + return new Enumeration(this, ResourceType.IMAGINGEXCERPT); + if ("ImagingObjectSelection".equals(codeString)) + return new Enumeration(this, ResourceType.IMAGINGOBJECTSELECTION); + if ("ImagingStudy".equals(codeString)) + return new Enumeration(this, ResourceType.IMAGINGSTUDY); + if ("Immunization".equals(codeString)) + return new Enumeration(this, ResourceType.IMMUNIZATION); + if ("ImmunizationRecommendation".equals(codeString)) + return new Enumeration(this, ResourceType.IMMUNIZATIONRECOMMENDATION); + if ("ImplementationGuide".equals(codeString)) + return new Enumeration(this, ResourceType.IMPLEMENTATIONGUIDE); + if ("Library".equals(codeString)) + return new Enumeration(this, ResourceType.LIBRARY); + if ("Linkage".equals(codeString)) + return new Enumeration(this, ResourceType.LINKAGE); + if ("List".equals(codeString)) + return new Enumeration(this, ResourceType.LIST); + if ("Location".equals(codeString)) + return new Enumeration(this, ResourceType.LOCATION); + if ("Measure".equals(codeString)) + return new Enumeration(this, ResourceType.MEASURE); + if ("MeasureReport".equals(codeString)) + return new Enumeration(this, ResourceType.MEASUREREPORT); + if ("Media".equals(codeString)) + return new Enumeration(this, ResourceType.MEDIA); + if ("Medication".equals(codeString)) + return new Enumeration(this, ResourceType.MEDICATION); + if ("MedicationAdministration".equals(codeString)) + return new Enumeration(this, ResourceType.MEDICATIONADMINISTRATION); + if ("MedicationDispense".equals(codeString)) + return new Enumeration(this, ResourceType.MEDICATIONDISPENSE); + if ("MedicationOrder".equals(codeString)) + return new Enumeration(this, ResourceType.MEDICATIONORDER); + if ("MedicationStatement".equals(codeString)) + return new Enumeration(this, ResourceType.MEDICATIONSTATEMENT); + if ("MessageHeader".equals(codeString)) + return new Enumeration(this, ResourceType.MESSAGEHEADER); + if ("ModuleDefinition".equals(codeString)) + return new Enumeration(this, ResourceType.MODULEDEFINITION); + if ("NamingSystem".equals(codeString)) + return new Enumeration(this, ResourceType.NAMINGSYSTEM); + if ("NutritionOrder".equals(codeString)) + return new Enumeration(this, ResourceType.NUTRITIONORDER); + if ("Observation".equals(codeString)) + return new Enumeration(this, ResourceType.OBSERVATION); + if ("OperationDefinition".equals(codeString)) + return new Enumeration(this, ResourceType.OPERATIONDEFINITION); + if ("OperationOutcome".equals(codeString)) + return new Enumeration(this, ResourceType.OPERATIONOUTCOME); + if ("Order".equals(codeString)) + return new Enumeration(this, ResourceType.ORDER); + if ("OrderResponse".equals(codeString)) + return new Enumeration(this, ResourceType.ORDERRESPONSE); + if ("OrderSet".equals(codeString)) + return new Enumeration(this, ResourceType.ORDERSET); + if ("Organization".equals(codeString)) + return new Enumeration(this, ResourceType.ORGANIZATION); + if ("Parameters".equals(codeString)) + return new Enumeration(this, ResourceType.PARAMETERS); + if ("Patient".equals(codeString)) + return new Enumeration(this, ResourceType.PATIENT); + if ("PaymentNotice".equals(codeString)) + return new Enumeration(this, ResourceType.PAYMENTNOTICE); + if ("PaymentReconciliation".equals(codeString)) + return new Enumeration(this, ResourceType.PAYMENTRECONCILIATION); + if ("Person".equals(codeString)) + return new Enumeration(this, ResourceType.PERSON); + if ("Practitioner".equals(codeString)) + return new Enumeration(this, ResourceType.PRACTITIONER); + if ("PractitionerRole".equals(codeString)) + return new Enumeration(this, ResourceType.PRACTITIONERROLE); + if ("Procedure".equals(codeString)) + return new Enumeration(this, ResourceType.PROCEDURE); + if ("ProcedureRequest".equals(codeString)) + return new Enumeration(this, ResourceType.PROCEDUREREQUEST); + if ("ProcessRequest".equals(codeString)) + return new Enumeration(this, ResourceType.PROCESSREQUEST); + if ("ProcessResponse".equals(codeString)) + return new Enumeration(this, ResourceType.PROCESSRESPONSE); + if ("Protocol".equals(codeString)) + return new Enumeration(this, ResourceType.PROTOCOL); + if ("Provenance".equals(codeString)) + return new Enumeration(this, ResourceType.PROVENANCE); + if ("Questionnaire".equals(codeString)) + return new Enumeration(this, ResourceType.QUESTIONNAIRE); + if ("QuestionnaireResponse".equals(codeString)) + return new Enumeration(this, ResourceType.QUESTIONNAIRERESPONSE); + if ("ReferralRequest".equals(codeString)) + return new Enumeration(this, ResourceType.REFERRALREQUEST); + if ("RelatedPerson".equals(codeString)) + return new Enumeration(this, ResourceType.RELATEDPERSON); + if ("Resource".equals(codeString)) + return new Enumeration(this, ResourceType.RESOURCE); + if ("RiskAssessment".equals(codeString)) + return new Enumeration(this, ResourceType.RISKASSESSMENT); + if ("Schedule".equals(codeString)) + return new Enumeration(this, ResourceType.SCHEDULE); + if ("SearchParameter".equals(codeString)) + return new Enumeration(this, ResourceType.SEARCHPARAMETER); + if ("Sequence".equals(codeString)) + return new Enumeration(this, ResourceType.SEQUENCE); + if ("Slot".equals(codeString)) + return new Enumeration(this, ResourceType.SLOT); + if ("Specimen".equals(codeString)) + return new Enumeration(this, ResourceType.SPECIMEN); + if ("StructureDefinition".equals(codeString)) + return new Enumeration(this, ResourceType.STRUCTUREDEFINITION); + if ("StructureMap".equals(codeString)) + return new Enumeration(this, ResourceType.STRUCTUREMAP); + if ("Subscription".equals(codeString)) + return new Enumeration(this, ResourceType.SUBSCRIPTION); + if ("Substance".equals(codeString)) + return new Enumeration(this, ResourceType.SUBSTANCE); + if ("SupplyDelivery".equals(codeString)) + return new Enumeration(this, ResourceType.SUPPLYDELIVERY); + if ("SupplyRequest".equals(codeString)) + return new Enumeration(this, ResourceType.SUPPLYREQUEST); + if ("Task".equals(codeString)) + return new Enumeration(this, ResourceType.TASK); + if ("TestScript".equals(codeString)) + return new Enumeration(this, ResourceType.TESTSCRIPT); + if ("ValueSet".equals(codeString)) + return new Enumeration(this, ResourceType.VALUESET); + if ("VisionPrescription".equals(codeString)) + return new Enumeration(this, ResourceType.VISIONPRESCRIPTION); + throw new FHIRException("Unknown ResourceType code '"+codeString+"'"); + } + public String toCode(ResourceType code) { + if (code == ResourceType.ACCOUNT) + return "Account"; + if (code == ResourceType.ALLERGYINTOLERANCE) + return "AllergyIntolerance"; + if (code == ResourceType.APPOINTMENT) + return "Appointment"; + if (code == ResourceType.APPOINTMENTRESPONSE) + return "AppointmentResponse"; + if (code == ResourceType.AUDITEVENT) + return "AuditEvent"; + if (code == ResourceType.BASIC) + return "Basic"; + if (code == ResourceType.BINARY) + return "Binary"; + if (code == ResourceType.BODYSITE) + return "BodySite"; + if (code == ResourceType.BUNDLE) + return "Bundle"; + if (code == ResourceType.CAREPLAN) + return "CarePlan"; + if (code == ResourceType.CARETEAM) + return "CareTeam"; + if (code == ResourceType.CLAIM) + return "Claim"; + if (code == ResourceType.CLAIMRESPONSE) + return "ClaimResponse"; + if (code == ResourceType.CLINICALIMPRESSION) + return "ClinicalImpression"; + if (code == ResourceType.CODESYSTEM) + return "CodeSystem"; + if (code == ResourceType.COMMUNICATION) + return "Communication"; + if (code == ResourceType.COMMUNICATIONREQUEST) + return "CommunicationRequest"; + if (code == ResourceType.COMPARTMENTDEFINITION) + return "CompartmentDefinition"; + if (code == ResourceType.COMPOSITION) + return "Composition"; + if (code == ResourceType.CONCEPTMAP) + return "ConceptMap"; + if (code == ResourceType.CONDITION) + return "Condition"; + if (code == ResourceType.CONFORMANCE) + return "Conformance"; + if (code == ResourceType.CONTRACT) + return "Contract"; + if (code == ResourceType.COVERAGE) + return "Coverage"; + if (code == ResourceType.DATAELEMENT) + return "DataElement"; + if (code == ResourceType.DECISIONSUPPORTRULE) + return "DecisionSupportRule"; + if (code == ResourceType.DECISIONSUPPORTSERVICEMODULE) + return "DecisionSupportServiceModule"; + if (code == ResourceType.DETECTEDISSUE) + return "DetectedIssue"; + if (code == ResourceType.DEVICE) + return "Device"; + if (code == ResourceType.DEVICECOMPONENT) + return "DeviceComponent"; + if (code == ResourceType.DEVICEMETRIC) + return "DeviceMetric"; + if (code == ResourceType.DEVICEUSEREQUEST) + return "DeviceUseRequest"; + if (code == ResourceType.DEVICEUSESTATEMENT) + return "DeviceUseStatement"; + if (code == ResourceType.DIAGNOSTICORDER) + return "DiagnosticOrder"; + if (code == ResourceType.DIAGNOSTICREPORT) + return "DiagnosticReport"; + if (code == ResourceType.DOCUMENTMANIFEST) + return "DocumentManifest"; + if (code == ResourceType.DOCUMENTREFERENCE) + return "DocumentReference"; + if (code == ResourceType.DOMAINRESOURCE) + return "DomainResource"; + if (code == ResourceType.ELIGIBILITYREQUEST) + return "EligibilityRequest"; + if (code == ResourceType.ELIGIBILITYRESPONSE) + return "EligibilityResponse"; + if (code == ResourceType.ENCOUNTER) + return "Encounter"; + if (code == ResourceType.ENROLLMENTREQUEST) + return "EnrollmentRequest"; + if (code == ResourceType.ENROLLMENTRESPONSE) + return "EnrollmentResponse"; + if (code == ResourceType.EPISODEOFCARE) + return "EpisodeOfCare"; + if (code == ResourceType.EXPANSIONPROFILE) + return "ExpansionProfile"; + if (code == ResourceType.EXPLANATIONOFBENEFIT) + return "ExplanationOfBenefit"; + if (code == ResourceType.FAMILYMEMBERHISTORY) + return "FamilyMemberHistory"; + if (code == ResourceType.FLAG) + return "Flag"; + if (code == ResourceType.GOAL) + return "Goal"; + if (code == ResourceType.GROUP) + return "Group"; + if (code == ResourceType.GUIDANCERESPONSE) + return "GuidanceResponse"; + if (code == ResourceType.HEALTHCARESERVICE) + return "HealthcareService"; + if (code == ResourceType.IMAGINGEXCERPT) + return "ImagingExcerpt"; + if (code == ResourceType.IMAGINGOBJECTSELECTION) + return "ImagingObjectSelection"; + if (code == ResourceType.IMAGINGSTUDY) + return "ImagingStudy"; + if (code == ResourceType.IMMUNIZATION) + return "Immunization"; + if (code == ResourceType.IMMUNIZATIONRECOMMENDATION) + return "ImmunizationRecommendation"; + if (code == ResourceType.IMPLEMENTATIONGUIDE) + return "ImplementationGuide"; + if (code == ResourceType.LIBRARY) + return "Library"; + if (code == ResourceType.LINKAGE) + return "Linkage"; + if (code == ResourceType.LIST) + return "List"; + if (code == ResourceType.LOCATION) + return "Location"; + if (code == ResourceType.MEASURE) + return "Measure"; + if (code == ResourceType.MEASUREREPORT) + return "MeasureReport"; + if (code == ResourceType.MEDIA) + return "Media"; + if (code == ResourceType.MEDICATION) + return "Medication"; + if (code == ResourceType.MEDICATIONADMINISTRATION) + return "MedicationAdministration"; + if (code == ResourceType.MEDICATIONDISPENSE) + return "MedicationDispense"; + if (code == ResourceType.MEDICATIONORDER) + return "MedicationOrder"; + if (code == ResourceType.MEDICATIONSTATEMENT) + return "MedicationStatement"; + if (code == ResourceType.MESSAGEHEADER) + return "MessageHeader"; + if (code == ResourceType.MODULEDEFINITION) + return "ModuleDefinition"; + if (code == ResourceType.NAMINGSYSTEM) + return "NamingSystem"; + if (code == ResourceType.NUTRITIONORDER) + return "NutritionOrder"; + if (code == ResourceType.OBSERVATION) + return "Observation"; + if (code == ResourceType.OPERATIONDEFINITION) + return "OperationDefinition"; + if (code == ResourceType.OPERATIONOUTCOME) + return "OperationOutcome"; + if (code == ResourceType.ORDER) + return "Order"; + if (code == ResourceType.ORDERRESPONSE) + return "OrderResponse"; + if (code == ResourceType.ORDERSET) + return "OrderSet"; + if (code == ResourceType.ORGANIZATION) + return "Organization"; + if (code == ResourceType.PARAMETERS) + return "Parameters"; + if (code == ResourceType.PATIENT) + return "Patient"; + if (code == ResourceType.PAYMENTNOTICE) + return "PaymentNotice"; + if (code == ResourceType.PAYMENTRECONCILIATION) + return "PaymentReconciliation"; + if (code == ResourceType.PERSON) + return "Person"; + if (code == ResourceType.PRACTITIONER) + return "Practitioner"; + if (code == ResourceType.PRACTITIONERROLE) + return "PractitionerRole"; + if (code == ResourceType.PROCEDURE) + return "Procedure"; + if (code == ResourceType.PROCEDUREREQUEST) + return "ProcedureRequest"; + if (code == ResourceType.PROCESSREQUEST) + return "ProcessRequest"; + if (code == ResourceType.PROCESSRESPONSE) + return "ProcessResponse"; + if (code == ResourceType.PROTOCOL) + return "Protocol"; + if (code == ResourceType.PROVENANCE) + return "Provenance"; + if (code == ResourceType.QUESTIONNAIRE) + return "Questionnaire"; + if (code == ResourceType.QUESTIONNAIRERESPONSE) + return "QuestionnaireResponse"; + if (code == ResourceType.REFERRALREQUEST) + return "ReferralRequest"; + if (code == ResourceType.RELATEDPERSON) + return "RelatedPerson"; + if (code == ResourceType.RESOURCE) + return "Resource"; + if (code == ResourceType.RISKASSESSMENT) + return "RiskAssessment"; + if (code == ResourceType.SCHEDULE) + return "Schedule"; + if (code == ResourceType.SEARCHPARAMETER) + return "SearchParameter"; + if (code == ResourceType.SEQUENCE) + return "Sequence"; + if (code == ResourceType.SLOT) + return "Slot"; + if (code == ResourceType.SPECIMEN) + return "Specimen"; + if (code == ResourceType.STRUCTUREDEFINITION) + return "StructureDefinition"; + if (code == ResourceType.STRUCTUREMAP) + return "StructureMap"; + if (code == ResourceType.SUBSCRIPTION) + return "Subscription"; + if (code == ResourceType.SUBSTANCE) + return "Substance"; + if (code == ResourceType.SUPPLYDELIVERY) + return "SupplyDelivery"; + if (code == ResourceType.SUPPLYREQUEST) + return "SupplyRequest"; + if (code == ResourceType.TASK) + return "Task"; + if (code == ResourceType.TESTSCRIPT) + return "TestScript"; + if (code == ResourceType.VALUESET) + return "ValueSet"; + if (code == ResourceType.VISIONPRESCRIPTION) + return "VisionPrescription"; + return "?"; + } + public String toSystem(ResourceType code) { + return code.getSystem(); + } + } + + public enum SearchParamType { + /** + * Search parameter SHALL be a number (a whole number, or a decimal). + */ + NUMBER, + /** + * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. + */ + DATE, + /** + * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. + */ + STRING, + /** + * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. + */ + TOKEN, + /** + * A reference to another resource. + */ + REFERENCE, + /** + * A composite search parameter that combines a search on two values together. + */ + COMPOSITE, + /** + * A search parameter that searches on a quantity. + */ + QUANTITY, + /** + * A search parameter that searches on a URI (RFC 3986). + */ + URI, + /** + * added to help the parsers + */ + NULL; + public static SearchParamType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("number".equals(codeString)) + return NUMBER; + if ("date".equals(codeString)) + return DATE; + if ("string".equals(codeString)) + return STRING; + if ("token".equals(codeString)) + return TOKEN; + if ("reference".equals(codeString)) + return REFERENCE; + if ("composite".equals(codeString)) + return COMPOSITE; + if ("quantity".equals(codeString)) + return QUANTITY; + if ("uri".equals(codeString)) + return URI; + throw new FHIRException("Unknown SearchParamType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NUMBER: return "number"; + case DATE: return "date"; + case STRING: return "string"; + case TOKEN: return "token"; + case REFERENCE: return "reference"; + case COMPOSITE: return "composite"; + case QUANTITY: return "quantity"; + case URI: return "uri"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NUMBER: return "http://hl7.org/fhir/search-param-type"; + case DATE: return "http://hl7.org/fhir/search-param-type"; + case STRING: return "http://hl7.org/fhir/search-param-type"; + case TOKEN: return "http://hl7.org/fhir/search-param-type"; + case REFERENCE: return "http://hl7.org/fhir/search-param-type"; + case COMPOSITE: return "http://hl7.org/fhir/search-param-type"; + case QUANTITY: return "http://hl7.org/fhir/search-param-type"; + case URI: return "http://hl7.org/fhir/search-param-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; + case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; + case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; + case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a \"|\", depending on the modifier used."; + case REFERENCE: return "A reference to another resource."; + case COMPOSITE: return "A composite search parameter that combines a search on two values together."; + case QUANTITY: return "A search parameter that searches on a quantity."; + case URI: return "A search parameter that searches on a URI (RFC 3986)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NUMBER: return "Number"; + case DATE: return "Date/DateTime"; + case STRING: return "String"; + case TOKEN: return "Token"; + case REFERENCE: return "Reference"; + case COMPOSITE: return "Composite"; + case QUANTITY: return "Quantity"; + case URI: return "URI"; + default: return "?"; + } + } + } + + 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; + if ("number".equals(codeString)) + return SearchParamType.NUMBER; + if ("date".equals(codeString)) + return SearchParamType.DATE; + if ("string".equals(codeString)) + return SearchParamType.STRING; + if ("token".equals(codeString)) + return SearchParamType.TOKEN; + if ("reference".equals(codeString)) + return SearchParamType.REFERENCE; + if ("composite".equals(codeString)) + return SearchParamType.COMPOSITE; + if ("quantity".equals(codeString)) + return SearchParamType.QUANTITY; + if ("uri".equals(codeString)) + return SearchParamType.URI; + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("number".equals(codeString)) + return new Enumeration(this, SearchParamType.NUMBER); + if ("date".equals(codeString)) + return new Enumeration(this, SearchParamType.DATE); + if ("string".equals(codeString)) + return new Enumeration(this, SearchParamType.STRING); + if ("token".equals(codeString)) + return new Enumeration(this, SearchParamType.TOKEN); + if ("reference".equals(codeString)) + return new Enumeration(this, SearchParamType.REFERENCE); + if ("composite".equals(codeString)) + return new Enumeration(this, SearchParamType.COMPOSITE); + if ("quantity".equals(codeString)) + return new Enumeration(this, SearchParamType.QUANTITY); + if ("uri".equals(codeString)) + return new Enumeration(this, SearchParamType.URI); + throw new FHIRException("Unknown SearchParamType code '"+codeString+"'"); + } + public String toCode(SearchParamType code) { + if (code == SearchParamType.NUMBER) + return "number"; + if (code == SearchParamType.DATE) + return "date"; + if (code == SearchParamType.STRING) + return "string"; + if (code == SearchParamType.TOKEN) + return "token"; + if (code == SearchParamType.REFERENCE) + return "reference"; + if (code == SearchParamType.COMPOSITE) + return "composite"; + if (code == SearchParamType.QUANTITY) + return "quantity"; + if (code == SearchParamType.URI) + return "uri"; + return "?"; + } + public String toSystem(SearchParamType code) { + return code.getSystem(); + } + } + + public enum SpecialValues { + /** + * Boolean true. + */ + TRUE, + /** + * Boolean false. + */ + FALSE, + /** + * The content is greater than zero, but too small to be quantified. + */ + TRACE, + /** + * The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material. + */ + SUFFICIENT, + /** + * The value is no longer available. + */ + WITHDRAWN, + /** + * The are no known applicable values in this context. + */ + NILKNOWN, + /** + * added to help the parsers + */ + NULL; + public static SpecialValues fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("true".equals(codeString)) + return TRUE; + if ("false".equals(codeString)) + return FALSE; + if ("trace".equals(codeString)) + return TRACE; + if ("sufficient".equals(codeString)) + return SUFFICIENT; + if ("withdrawn".equals(codeString)) + return WITHDRAWN; + if ("nil-known".equals(codeString)) + return NILKNOWN; + throw new FHIRException("Unknown SpecialValues code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case TRUE: return "true"; + case FALSE: return "false"; + case TRACE: return "trace"; + case SUFFICIENT: return "sufficient"; + case WITHDRAWN: return "withdrawn"; + case NILKNOWN: return "nil-known"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case TRUE: return "http://hl7.org/fhir/special-values"; + case FALSE: return "http://hl7.org/fhir/special-values"; + case TRACE: return "http://hl7.org/fhir/special-values"; + case SUFFICIENT: return "http://hl7.org/fhir/special-values"; + case WITHDRAWN: return "http://hl7.org/fhir/special-values"; + case NILKNOWN: return "http://hl7.org/fhir/special-values"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case TRUE: return "Boolean true."; + case FALSE: return "Boolean false."; + case TRACE: return "The content is greater than zero, but too small to be quantified."; + case SUFFICIENT: return "The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material."; + case WITHDRAWN: return "The value is no longer available."; + case NILKNOWN: return "The are no known applicable values in this context."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case TRUE: return "true"; + case FALSE: return "false"; + case TRACE: return "Trace Amount Detected"; + case SUFFICIENT: return "Sufficient Quantity"; + case WITHDRAWN: return "Value Withdrawn"; + case NILKNOWN: return "Nil Known"; + default: return "?"; + } + } + } + + public static class SpecialValuesEnumFactory implements EnumFactory { + public SpecialValues fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("true".equals(codeString)) + return SpecialValues.TRUE; + if ("false".equals(codeString)) + return SpecialValues.FALSE; + if ("trace".equals(codeString)) + return SpecialValues.TRACE; + if ("sufficient".equals(codeString)) + return SpecialValues.SUFFICIENT; + if ("withdrawn".equals(codeString)) + return SpecialValues.WITHDRAWN; + if ("nil-known".equals(codeString)) + return SpecialValues.NILKNOWN; + throw new IllegalArgumentException("Unknown SpecialValues code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("true".equals(codeString)) + return new Enumeration(this, SpecialValues.TRUE); + if ("false".equals(codeString)) + return new Enumeration(this, SpecialValues.FALSE); + if ("trace".equals(codeString)) + return new Enumeration(this, SpecialValues.TRACE); + if ("sufficient".equals(codeString)) + return new Enumeration(this, SpecialValues.SUFFICIENT); + if ("withdrawn".equals(codeString)) + return new Enumeration(this, SpecialValues.WITHDRAWN); + if ("nil-known".equals(codeString)) + return new Enumeration(this, SpecialValues.NILKNOWN); + throw new FHIRException("Unknown SpecialValues code '"+codeString+"'"); + } + public String toCode(SpecialValues code) { + if (code == SpecialValues.TRUE) + return "true"; + if (code == SpecialValues.FALSE) + return "false"; + if (code == SpecialValues.TRACE) + return "trace"; + if (code == SpecialValues.SUFFICIENT) + return "sufficient"; + if (code == SpecialValues.WITHDRAWN) + return "withdrawn"; + if (code == SpecialValues.NILKNOWN) + return "nil-known"; + return "?"; + } + public String toSystem(SpecialValues code) { + return code.getSystem(); + } + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EpisodeOfCare.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EpisodeOfCare.java new file mode 100644 index 00000000000..d5afe101dd5 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/EpisodeOfCare.java @@ -0,0 +1,1500 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + */ +@ResourceDef(name="EpisodeOfCare", profile="http://hl7.org/fhir/Profile/EpisodeOfCare") +public class EpisodeOfCare extends DomainResource { + + public enum EpisodeOfCareStatus { + /** + * This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services. + */ + PLANNED, + /** + * This episode has been placed on a waitlist, pending the episode being made active (or cancelled). + */ + WAITLIST, + /** + * This episode of care is current. + */ + ACTIVE, + /** + * This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite). + */ + ONHOLD, + /** + * This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as "closed", "completed" or other similar terms. + */ + FINISHED, + /** + * The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static EpisodeOfCareStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("waitlist".equals(codeString)) + return WAITLIST; + if ("active".equals(codeString)) + return ACTIVE; + if ("onhold".equals(codeString)) + return ONHOLD; + if ("finished".equals(codeString)) + return FINISHED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new FHIRException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case WAITLIST: return "waitlist"; + case ACTIVE: return "active"; + case ONHOLD: return "onhold"; + case FINISHED: return "finished"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return "http://hl7.org/fhir/episode-of-care-status"; + case WAITLIST: return "http://hl7.org/fhir/episode-of-care-status"; + case ACTIVE: return "http://hl7.org/fhir/episode-of-care-status"; + case ONHOLD: return "http://hl7.org/fhir/episode-of-care-status"; + case FINISHED: return "http://hl7.org/fhir/episode-of-care-status"; + case CANCELLED: return "http://hl7.org/fhir/episode-of-care-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services."; + case WAITLIST: return "This episode has been placed on a waitlist, pending the episode being made active (or cancelled)."; + case ACTIVE: return "This episode of care is current."; + case ONHOLD: return "This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite)."; + case FINISHED: return "This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as \"closed\", \"completed\" or other similar terms."; + case CANCELLED: return "The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "Planned"; + case WAITLIST: return "Waitlist"; + case ACTIVE: return "Active"; + case ONHOLD: return "On Hold"; + case FINISHED: return "Finished"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class EpisodeOfCareStatusEnumFactory implements EnumFactory { + public EpisodeOfCareStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return EpisodeOfCareStatus.PLANNED; + if ("waitlist".equals(codeString)) + return EpisodeOfCareStatus.WAITLIST; + if ("active".equals(codeString)) + return EpisodeOfCareStatus.ACTIVE; + if ("onhold".equals(codeString)) + return EpisodeOfCareStatus.ONHOLD; + if ("finished".equals(codeString)) + return EpisodeOfCareStatus.FINISHED; + if ("cancelled".equals(codeString)) + return EpisodeOfCareStatus.CANCELLED; + throw new IllegalArgumentException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return new Enumeration(this, EpisodeOfCareStatus.PLANNED); + if ("waitlist".equals(codeString)) + return new Enumeration(this, EpisodeOfCareStatus.WAITLIST); + if ("active".equals(codeString)) + return new Enumeration(this, EpisodeOfCareStatus.ACTIVE); + if ("onhold".equals(codeString)) + return new Enumeration(this, EpisodeOfCareStatus.ONHOLD); + if ("finished".equals(codeString)) + return new Enumeration(this, EpisodeOfCareStatus.FINISHED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, EpisodeOfCareStatus.CANCELLED); + throw new FHIRException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); + } + public String toCode(EpisodeOfCareStatus code) { + if (code == EpisodeOfCareStatus.PLANNED) + return "planned"; + if (code == EpisodeOfCareStatus.WAITLIST) + return "waitlist"; + if (code == EpisodeOfCareStatus.ACTIVE) + return "active"; + if (code == EpisodeOfCareStatus.ONHOLD) + return "onhold"; + if (code == EpisodeOfCareStatus.FINISHED) + return "finished"; + if (code == EpisodeOfCareStatus.CANCELLED) + return "cancelled"; + return "?"; + } + public String toSystem(EpisodeOfCareStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class EpisodeOfCareStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * planned | waitlist | active | onhold | finished | cancelled. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) + protected Enumeration status; + + /** + * The period during this EpisodeOfCare that the specific status applied. + */ + @Child(name = "period", type = {Period.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Period for the status", formalDefinition="The period during this EpisodeOfCare that the specific status applied." ) + protected Period period; + + private static final long serialVersionUID = -1192432864L; + + /** + * Constructor + */ + public EpisodeOfCareStatusHistoryComponent() { + super(); + } + + /** + * Constructor + */ + public EpisodeOfCareStatusHistoryComponent(Enumeration status, Period period) { + super(); + this.status = status; + this.period = period; + } + + /** + * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). 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 EpisodeOfCareStatusHistoryComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); // bb + 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} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public EpisodeOfCareStatusHistoryComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | waitlist | active | onhold | finished | cancelled. + */ + public EpisodeOfCareStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | waitlist | active | onhold | finished | cancelled. + */ + public EpisodeOfCareStatusHistoryComponent setStatus(EpisodeOfCareStatus value) { + if (this.status == null) + this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (The period during this EpisodeOfCare that the specific status applied.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during this EpisodeOfCare that the specific status applied.) + */ + public EpisodeOfCareStatusHistoryComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "The period during this EpisodeOfCare that the specific status applied.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -892481550: // status + this.status = new EpisodeOfCareStatusEnumFactory().fromType(value); // Enumeration + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("status")) + this.status = new EpisodeOfCareStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.status"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public EpisodeOfCareStatusHistoryComponent copy() { + EpisodeOfCareStatusHistoryComponent dst = new EpisodeOfCareStatusHistoryComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EpisodeOfCareStatusHistoryComponent)) + return false; + EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other; + return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EpisodeOfCareStatusHistoryComponent)) + return false; + EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + public String fhirType() { + return "EpisodeOfCare.statusHistory"; + + } + + } + + /** + * Identifier(s) by which this EpisodeOfCare is known. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Identifier(s) for the EpisodeOfCare", formalDefinition="Identifier(s) by which this EpisodeOfCare is known." ) + protected List identifier; + + /** + * planned | waitlist | active | onhold | finished | cancelled. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) + protected Enumeration status; + + /** + * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource). + */ + @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Past list of status codes", formalDefinition="The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)." ) + protected List statusHistory; + + /** + * A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Type/class - e.g. specialist referral, disease management", formalDefinition="A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care." ) + protected List type; + + /** + * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for. + */ + @Child(name = "condition", type = {Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Conditions/problems/diagnoses this episode of care is for", formalDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for." ) + protected List condition; + /** + * The actual objects that are the target of the reference (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + protected List conditionTarget; + + + /** + * The patient that this EpisodeOfCare applies to. + */ + @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient for this episode of care", formalDefinition="The patient that this EpisodeOfCare applies to." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient that this EpisodeOfCare applies to.) + */ + protected Patient patientTarget; + + /** + * The organization that has assumed the specific responsibilities for the specified duration. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization that assumes care", formalDefinition="The organization that has assumed the specific responsibilities for the specified duration." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The organization that has assumed the specific responsibilities for the specified duration.) + */ + protected Organization managingOrganizationTarget; + + /** + * The interval during which the managing organization assumes the defined responsibility. + */ + @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Interval during responsibility is assumed", formalDefinition="The interval during which the managing organization assumes the defined responsibility." ) + protected Period period; + + /** + * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals. + */ + @Child(name = "referralRequest", type = {ReferralRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Originating Referral Request(s)", formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals." ) + protected List referralRequest; + /** + * The actual objects that are the target of the reference (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + protected List referralRequestTarget; + + + /** + * The practitioner that is the care manager/care co-ordinator for this patient. + */ + @Child(name = "careManager", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Care manager/care co-ordinator for the patient", formalDefinition="The practitioner that is the care manager/care co-ordinator for this patient." ) + protected Reference careManager; + + /** + * The actual object that is the target of the reference (The practitioner that is the care manager/care co-ordinator for this patient.) + */ + protected Practitioner careManagerTarget; + + /** + * The list of practitioners that may be facilitating this episode of care for specific purposes. + */ + @Child(name = "team", type = {CareTeam.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Other practitioners facilitating this episode of care", formalDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes." ) + protected List team; + /** + * The actual objects that are the target of the reference (The list of practitioners that may be facilitating this episode of care for specific purposes.) + */ + protected List teamTarget; + + + private static final long serialVersionUID = 922419354L; + + /** + * Constructor + */ + public EpisodeOfCare() { + super(); + } + + /** + * Constructor + */ + public EpisodeOfCare(Enumeration status, Reference patient) { + super(); + this.status = status; + this.patient = patient; + } + + /** + * @return {@link #identifier} (Identifier(s) by which this EpisodeOfCare is known.) + */ + 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(s) by which this EpisodeOfCare is known.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). 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 EpisodeOfCare.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); // bb + 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} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public EpisodeOfCare setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | waitlist | active | onhold | finished | cancelled. + */ + public EpisodeOfCareStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | waitlist | active | onhold | finished | cancelled. + */ + public EpisodeOfCare setStatus(EpisodeOfCareStatus value) { + if (this.status == null) + this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #statusHistory} (The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).) + */ + public List getStatusHistory() { + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + return this.statusHistory; + } + + public boolean hasStatusHistory() { + if (this.statusHistory == null) + return false; + for (EpisodeOfCareStatusHistoryComponent item : this.statusHistory) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #statusHistory} (The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).) + */ + // syntactic sugar + public EpisodeOfCareStatusHistoryComponent addStatusHistory() { //3 + EpisodeOfCareStatusHistoryComponent t = new EpisodeOfCareStatusHistoryComponent(); + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + this.statusHistory.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addStatusHistory(EpisodeOfCareStatusHistoryComponent t) { //3 + if (t == null) + return this; + if (this.statusHistory == null) + this.statusHistory = new ArrayList(); + this.statusHistory.add(t); + return this; + } + + /** + * @return {@link #type} (A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + 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 {@link #type} (A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Reference item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + // syntactic sugar + public Reference addCondition() { //3 + Reference t = new Reference(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addCondition(Reference t) { //3 + if (t == null) + return this; + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + /** + * @return {@link #condition} (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 list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + public List getConditionTarget() { + if (this.conditionTarget == null) + this.conditionTarget = new ArrayList(); + return this.conditionTarget; + } + + // syntactic sugar + /** + * @return {@link #condition} (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 list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) + */ + public Condition addConditionTarget() { + Condition r = new Condition(); + if (this.conditionTarget == null) + this.conditionTarget = new ArrayList(); + this.conditionTarget.add(r); + return r; + } + + /** + * @return {@link #patient} (The patient that this EpisodeOfCare applies to.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient that this EpisodeOfCare applies to.) + */ + public EpisodeOfCare 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 that this EpisodeOfCare applies to.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 that this EpisodeOfCare applies to.) + */ + public EpisodeOfCare setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) + */ + public EpisodeOfCare 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 has assumed the specific responsibilities for the specified duration.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + 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 has assumed the specific responsibilities for the specified duration.) + */ + public EpisodeOfCare setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #period} (The interval during which the managing organization assumes the defined responsibility.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The interval during which the managing organization assumes the defined responsibility.) + */ + public EpisodeOfCare setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + public List getReferralRequest() { + if (this.referralRequest == null) + this.referralRequest = new ArrayList(); + return this.referralRequest; + } + + public boolean hasReferralRequest() { + if (this.referralRequest == null) + return false; + for (Reference item : this.referralRequest) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + // syntactic sugar + public Reference addReferralRequest() { //3 + Reference t = new Reference(); + if (this.referralRequest == null) + this.referralRequest = new ArrayList(); + this.referralRequest.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addReferralRequest(Reference t) { //3 + if (t == null) + return this; + if (this.referralRequest == null) + this.referralRequest = new ArrayList(); + this.referralRequest.add(t); + return this; + } + + /** + * @return {@link #referralRequest} (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. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + public List getReferralRequestTarget() { + if (this.referralRequestTarget == null) + this.referralRequestTarget = new ArrayList(); + return this.referralRequestTarget; + } + + // syntactic sugar + /** + * @return {@link #referralRequest} (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. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) + */ + public ReferralRequest addReferralRequestTarget() { + ReferralRequest r = new ReferralRequest(); + if (this.referralRequestTarget == null) + this.referralRequestTarget = new ArrayList(); + this.referralRequestTarget.add(r); + return r; + } + + /** + * @return {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) + */ + public Reference getCareManager() { + if (this.careManager == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); + else if (Configuration.doAutoCreate()) + this.careManager = new Reference(); // cc + return this.careManager; + } + + public boolean hasCareManager() { + return this.careManager != null && !this.careManager.isEmpty(); + } + + /** + * @param value {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) + */ + public EpisodeOfCare setCareManager(Reference value) { + this.careManager = value; + return this; + } + + /** + * @return {@link #careManager} 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 that is the care manager/care co-ordinator for this patient.) + */ + public Practitioner getCareManagerTarget() { + if (this.careManagerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); + else if (Configuration.doAutoCreate()) + this.careManagerTarget = new Practitioner(); // aa + return this.careManagerTarget; + } + + /** + * @param value {@link #careManager} 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 that is the care manager/care co-ordinator for this patient.) + */ + public EpisodeOfCare setCareManagerTarget(Practitioner value) { + this.careManagerTarget = value; + return this; + } + + /** + * @return {@link #team} (The list of practitioners that may be facilitating this episode of care for specific purposes.) + */ + public List getTeam() { + if (this.team == null) + this.team = new ArrayList(); + return this.team; + } + + public boolean hasTeam() { + if (this.team == null) + return false; + for (Reference item : this.team) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #team} (The list of practitioners that may be facilitating this episode of care for specific purposes.) + */ + // syntactic sugar + public Reference addTeam() { //3 + Reference t = new Reference(); + if (this.team == null) + this.team = new ArrayList(); + this.team.add(t); + return t; + } + + // syntactic sugar + public EpisodeOfCare addTeam(Reference t) { //3 + if (t == null) + return this; + if (this.team == null) + this.team = new ArrayList(); + this.team.add(t); + return this; + } + + /** + * @return {@link #team} (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 list of practitioners that may be facilitating this episode of care for specific purposes.) + */ + public List getTeamTarget() { + if (this.teamTarget == null) + this.teamTarget = new ArrayList(); + return this.teamTarget; + } + + // syntactic sugar + /** + * @return {@link #team} (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 list of practitioners that may be facilitating this episode of care for specific purposes.) + */ + public CareTeam addTeamTarget() { + CareTeam r = new CareTeam(); + if (this.teamTarget == null) + this.teamTarget = new ArrayList(); + this.teamTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this EpisodeOfCare is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("statusHistory", "", "The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).", 0, java.lang.Integer.MAX_VALUE, statusHistory)); + childrenList.add(new Property("type", "CodeableConcept", "A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("condition", "Reference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient that this EpisodeOfCare applies to.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for the specified duration.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("referralRequest", "Reference(ReferralRequest)", "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.", 0, java.lang.Integer.MAX_VALUE, referralRequest)); + childrenList.add(new Property("careManager", "Reference(Practitioner)", "The practitioner that is the care manager/care co-ordinator for this patient.", 0, java.lang.Integer.MAX_VALUE, careManager)); + childrenList.add(new Property("team", "Reference(CareTeam)", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, team)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -986695614: /*statusHistory*/ return this.statusHistory == null ? new Base[0] : this.statusHistory.toArray(new Base[this.statusHistory.size()]); // EpisodeOfCareStatusHistoryComponent + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // Reference + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -310299598: /*referralRequest*/ return this.referralRequest == null ? new Base[0] : this.referralRequest.toArray(new Base[this.referralRequest.size()]); // Reference + case -1147746468: /*careManager*/ return this.careManager == null ? new Base[0] : new Base[] {this.careManager}; // Reference + case 3555933: /*team*/ return this.team == null ? new Base[0] : this.team.toArray(new Base[this.team.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new EpisodeOfCareStatusEnumFactory().fromType(value); // Enumeration + break; + case -986695614: // statusHistory + this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value); // EpisodeOfCareStatusHistoryComponent + break; + case 3575610: // type + this.getType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -861311717: // condition + this.getCondition().add(castToReference(value)); // Reference + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -2058947787: // managingOrganization + this.managingOrganization = castToReference(value); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -310299598: // referralRequest + this.getReferralRequest().add(castToReference(value)); // Reference + break; + case -1147746468: // careManager + this.careManager = castToReference(value); // Reference + break; + case 3555933: // team + this.getTeam().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new EpisodeOfCareStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("statusHistory")) + this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value); + else if (name.equals("type")) + this.getType().add(castToCodeableConcept(value)); + else if (name.equals("condition")) + this.getCondition().add(castToReference(value)); + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("managingOrganization")) + this.managingOrganization = castToReference(value); // Reference + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("referralRequest")) + this.getReferralRequest().add(castToReference(value)); + else if (name.equals("careManager")) + this.careManager = castToReference(value); // Reference + else if (name.equals("team")) + this.getTeam().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -986695614: return addStatusHistory(); // EpisodeOfCareStatusHistoryComponent + case 3575610: return addType(); // CodeableConcept + case -861311717: return addCondition(); // Reference + case -791418107: return getPatient(); // Reference + case -2058947787: return getManagingOrganization(); // Reference + case -991726143: return getPeriod(); // Period + case -310299598: return addReferralRequest(); // Reference + case -1147746468: return getCareManager(); // Reference + case 3555933: return addTeam(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.status"); + } + else if (name.equals("statusHistory")) { + return addStatusHistory(); + } + else if (name.equals("type")) { + return addType(); + } + else if (name.equals("condition")) { + return addCondition(); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("managingOrganization")) { + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("referralRequest")) { + return addReferralRequest(); + } + else if (name.equals("careManager")) { + this.careManager = new Reference(); + return this.careManager; + } + else if (name.equals("team")) { + return addTeam(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "EpisodeOfCare"; + + } + + public EpisodeOfCare copy() { + EpisodeOfCare dst = new EpisodeOfCare(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + if (statusHistory != null) { + dst.statusHistory = new ArrayList(); + for (EpisodeOfCareStatusHistoryComponent i : statusHistory) + dst.statusHistory.add(i.copy()); + }; + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Reference i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.period = period == null ? null : period.copy(); + if (referralRequest != null) { + dst.referralRequest = new ArrayList(); + for (Reference i : referralRequest) + dst.referralRequest.add(i.copy()); + }; + dst.careManager = careManager == null ? null : careManager.copy(); + if (team != null) { + dst.team = new ArrayList(); + for (Reference i : team) + dst.team.add(i.copy()); + }; + return dst; + } + + protected EpisodeOfCare typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof EpisodeOfCare)) + return false; + EpisodeOfCare o = (EpisodeOfCare) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) + && compareDeep(type, o.type, true) && compareDeep(condition, o.condition, true) && compareDeep(patient, o.patient, true) + && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(period, o.period, true) + && compareDeep(referralRequest, o.referralRequest, true) && compareDeep(careManager, o.careManager, true) + && compareDeep(team, o.team, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof EpisodeOfCare)) + return false; + EpisodeOfCare o = (EpisodeOfCare) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (statusHistory == null || statusHistory.isEmpty()) && (type == null || type.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (period == null || period.isEmpty()) && (referralRequest == null || referralRequest.isEmpty()) + && (careManager == null || careManager.isEmpty()) && (team == null || team.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EpisodeOfCare; + } + + /** + * Search parameter: organization + *

+ * Description: The organization that has assumed the specific responsibilities of this EpisodeOfCare
+ * Type: reference
+ * Path: EpisodeOfCare.managingOrganization
+ *

+ */ + @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: The organization that has assumed the specific responsibilities of this EpisodeOfCare
+ * Type: reference
+ * Path: EpisodeOfCare.managingOrganization
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EpisodeOfCare:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:organization").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: Patient for this episode of care
+ * Type: reference
+ * Path: EpisodeOfCare.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="EpisodeOfCare.patient", description="Patient for this episode of care", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Patient for this episode of care
+ * Type: reference
+ * Path: EpisodeOfCare.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EpisodeOfCare:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:patient").toLocked(); + + /** + * Search parameter: condition + *

+ * Description: Conditions/problems/diagnoses this episode of care is for
+ * Type: reference
+ * Path: EpisodeOfCare.condition
+ *

+ */ + @SearchParamDefinition(name="condition", path="EpisodeOfCare.condition", description="Conditions/problems/diagnoses this episode of care is for", type="reference" ) + public static final String SP_CONDITION = "condition"; + /** + * Fluent Client search parameter constant for condition + *

+ * Description: Conditions/problems/diagnoses this episode of care is for
+ * Type: reference
+ * Path: EpisodeOfCare.condition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EpisodeOfCare:condition". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:condition").toLocked(); + + /** + * Search parameter: status + *

+ * Description: The current status of the Episode of Care as provided (does not check the status history collection)
+ * Type: token
+ * Path: EpisodeOfCare.status
+ *

+ */ + @SearchParamDefinition(name="status", path="EpisodeOfCare.status", description="The current status of the Episode of Care as provided (does not check the status history collection)", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the Episode of Care as provided (does not check the status history collection)
+ * Type: token
+ * Path: EpisodeOfCare.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: care-manager + *

+ * Description: Care manager/care co-ordinator for the patient
+ * Type: reference
+ * Path: EpisodeOfCare.careManager
+ *

+ */ + @SearchParamDefinition(name="care-manager", path="EpisodeOfCare.careManager", description="Care manager/care co-ordinator for the patient", type="reference" ) + public static final String SP_CARE_MANAGER = "care-manager"; + /** + * Fluent Client search parameter constant for care-manager + *

+ * Description: Care manager/care co-ordinator for the patient
+ * Type: reference
+ * Path: EpisodeOfCare.careManager
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CARE_MANAGER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CARE_MANAGER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EpisodeOfCare:care-manager". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CARE_MANAGER = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:care-manager").toLocked(); + + /** + * Search parameter: type + *

+ * Description: Type/class - e.g. specialist referral, disease management
+ * Type: token
+ * Path: EpisodeOfCare.type
+ *

+ */ + @SearchParamDefinition(name="type", path="EpisodeOfCare.type", description="Type/class - e.g. specialist referral, disease management", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Type/class - e.g. specialist referral, disease management
+ * Type: token
+ * Path: EpisodeOfCare.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: date + *

+ * Description: The provided date search value falls within the episode of care's period
+ * Type: date
+ * Path: EpisodeOfCare.period
+ *

+ */ + @SearchParamDefinition(name="date", path="EpisodeOfCare.period", description="The provided date search value falls within the episode of care's period", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The provided date search value falls within the episode of care's period
+ * Type: date
+ * Path: EpisodeOfCare.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: incomingreferral + *

+ * Description: Incoming Referral Request
+ * Type: reference
+ * Path: EpisodeOfCare.referralRequest
+ *

+ */ + @SearchParamDefinition(name="incomingreferral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference" ) + public static final String SP_INCOMINGREFERRAL = "incomingreferral"; + /** + * Fluent Client search parameter constant for incomingreferral + *

+ * Description: Incoming Referral Request
+ * Type: reference
+ * Path: EpisodeOfCare.referralRequest
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INCOMINGREFERRAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INCOMINGREFERRAL); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EpisodeOfCare:incomingreferral". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INCOMINGREFERRAL = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:incomingreferral").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Identifier(s) for the EpisodeOfCare
+ * Type: token
+ * Path: EpisodeOfCare.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="EpisodeOfCare.identifier", description="Identifier(s) for the EpisodeOfCare", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Identifier(s) for the EpisodeOfCare
+ * Type: token
+ * Path: EpisodeOfCare.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExpansionProfile.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExpansionProfile.java new file mode 100644 index 00000000000..4c25513a80b --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExpansionProfile.java @@ -0,0 +1,3625 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Resource to define constraints on the Expansion of a FHIR ValueSet. + */ +@ResourceDef(name="ExpansionProfile", profile="http://hl7.org/fhir/Profile/ExpansionProfile") +public class ExpansionProfile extends DomainResource { + + @Block() + public static class ExpansionProfileContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the expansion profile. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the expansion profile." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public ExpansionProfileContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the expansion profile.). 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 ExpansionProfileContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ExpansionProfileContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the expansion profile. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the expansion profile. + */ + public ExpansionProfileContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ExpansionProfileContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the expansion profile.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public ExpansionProfileContactComponent copy() { + ExpansionProfileContactComponent dst = new ExpansionProfileContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ExpansionProfileContactComponent)) + return false; + ExpansionProfileContactComponent o = (ExpansionProfileContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ExpansionProfileContactComponent)) + return false; + ExpansionProfileContactComponent o = (ExpansionProfileContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "ExpansionProfile.contact"; + + } + + } + + @Block() + public static class ExpansionProfileCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code systems to be included in value set expansions. + */ + @Child(name = "include", type = {}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Code systems to be included", formalDefinition="Code systems to be included in value set expansions." ) + protected CodeSystemIncludeComponent include; + + /** + * Code systems to be excluded from value set expansions. + */ + @Child(name = "exclude", type = {}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Code systems to be excluded", formalDefinition="Code systems to be excluded from value set expansions." ) + protected CodeSystemExcludeComponent exclude; + + private static final long serialVersionUID = 340558624L; + + /** + * Constructor + */ + public ExpansionProfileCodeSystemComponent() { + super(); + } + + /** + * @return {@link #include} (Code systems to be included in value set expansions.) + */ + public CodeSystemIncludeComponent getInclude() { + if (this.include == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfileCodeSystemComponent.include"); + else if (Configuration.doAutoCreate()) + this.include = new CodeSystemIncludeComponent(); // cc + return this.include; + } + + public boolean hasInclude() { + return this.include != null && !this.include.isEmpty(); + } + + /** + * @param value {@link #include} (Code systems to be included in value set expansions.) + */ + public ExpansionProfileCodeSystemComponent setInclude(CodeSystemIncludeComponent value) { + this.include = value; + return this; + } + + /** + * @return {@link #exclude} (Code systems to be excluded from value set expansions.) + */ + public CodeSystemExcludeComponent getExclude() { + if (this.exclude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfileCodeSystemComponent.exclude"); + else if (Configuration.doAutoCreate()) + this.exclude = new CodeSystemExcludeComponent(); // cc + return this.exclude; + } + + public boolean hasExclude() { + return this.exclude != null && !this.exclude.isEmpty(); + } + + /** + * @param value {@link #exclude} (Code systems to be excluded from value set expansions.) + */ + public ExpansionProfileCodeSystemComponent setExclude(CodeSystemExcludeComponent value) { + this.exclude = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("include", "", "Code systems to be included in value set expansions.", 0, java.lang.Integer.MAX_VALUE, include)); + childrenList.add(new Property("exclude", "", "Code systems to be excluded from value set expansions.", 0, java.lang.Integer.MAX_VALUE, exclude)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1942574248: /*include*/ return this.include == null ? new Base[0] : new Base[] {this.include}; // CodeSystemIncludeComponent + case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : new Base[] {this.exclude}; // CodeSystemExcludeComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1942574248: // include + this.include = (CodeSystemIncludeComponent) value; // CodeSystemIncludeComponent + break; + case -1321148966: // exclude + this.exclude = (CodeSystemExcludeComponent) value; // CodeSystemExcludeComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("include")) + this.include = (CodeSystemIncludeComponent) value; // CodeSystemIncludeComponent + else if (name.equals("exclude")) + this.exclude = (CodeSystemExcludeComponent) value; // CodeSystemExcludeComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1942574248: return getInclude(); // CodeSystemIncludeComponent + case -1321148966: return getExclude(); // CodeSystemExcludeComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("include")) { + this.include = new CodeSystemIncludeComponent(); + return this.include; + } + else if (name.equals("exclude")) { + this.exclude = new CodeSystemExcludeComponent(); + return this.exclude; + } + else + return super.addChild(name); + } + + public ExpansionProfileCodeSystemComponent copy() { + ExpansionProfileCodeSystemComponent dst = new ExpansionProfileCodeSystemComponent(); + copyValues(dst); + dst.include = include == null ? null : include.copy(); + dst.exclude = exclude == null ? null : exclude.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ExpansionProfileCodeSystemComponent)) + return false; + ExpansionProfileCodeSystemComponent o = (ExpansionProfileCodeSystemComponent) other; + return compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ExpansionProfileCodeSystemComponent)) + return false; + ExpansionProfileCodeSystemComponent o = (ExpansionProfileCodeSystemComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) + ; + } + + public String fhirType() { + return "ExpansionProfile.codeSystem"; + + } + + } + + @Block() + public static class CodeSystemIncludeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A data group for each code system to be included. + */ + @Child(name = "codeSystem", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The code systems to be included", formalDefinition="A data group for each code system to be included." ) + protected List codeSystem; + + private static final long serialVersionUID = 1076909689L; + + /** + * Constructor + */ + public CodeSystemIncludeComponent() { + super(); + } + + /** + * @return {@link #codeSystem} (A data group for each code system to be included.) + */ + public List getCodeSystem() { + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + return this.codeSystem; + } + + public boolean hasCodeSystem() { + if (this.codeSystem == null) + return false; + for (CodeSystemIncludeCodeSystemComponent item : this.codeSystem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeSystem} (A data group for each code system to be included.) + */ + // syntactic sugar + public CodeSystemIncludeCodeSystemComponent addCodeSystem() { //3 + CodeSystemIncludeCodeSystemComponent t = new CodeSystemIncludeCodeSystemComponent(); + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return t; + } + + // syntactic sugar + public CodeSystemIncludeComponent addCodeSystem(CodeSystemIncludeCodeSystemComponent t) { //3 + if (t == null) + return this; + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("codeSystem", "", "A data group for each code system to be included.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // CodeSystemIncludeCodeSystemComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -916511108: // codeSystem + this.getCodeSystem().add((CodeSystemIncludeCodeSystemComponent) value); // CodeSystemIncludeCodeSystemComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("codeSystem")) + this.getCodeSystem().add((CodeSystemIncludeCodeSystemComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -916511108: return addCodeSystem(); // CodeSystemIncludeCodeSystemComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("codeSystem")) { + return addCodeSystem(); + } + else + return super.addChild(name); + } + + public CodeSystemIncludeComponent copy() { + CodeSystemIncludeComponent dst = new CodeSystemIncludeComponent(); + copyValues(dst); + if (codeSystem != null) { + dst.codeSystem = new ArrayList(); + for (CodeSystemIncludeCodeSystemComponent i : codeSystem) + dst.codeSystem.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeSystemIncludeComponent)) + return false; + CodeSystemIncludeComponent o = (CodeSystemIncludeComponent) other; + return compareDeep(codeSystem, o.codeSystem, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeSystemIncludeComponent)) + return false; + CodeSystemIncludeComponent o = (CodeSystemIncludeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()); + } + + public String fhirType() { + return "ExpansionProfile.codeSystem.include"; + + } + + } + + @Block() + public static class CodeSystemIncludeCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI which is the code system to be included. + */ + @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The specific code system to be included", formalDefinition="An absolute URI which is the code system to be included." ) + protected UriType system; + + /** + * The version of the code system from which codes in the expansion should be included. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system from which codes in the expansion should be included." ) + protected StringType version; + + private static final long serialVersionUID = 1145288774L; + + /** + * Constructor + */ + public CodeSystemIncludeCodeSystemComponent() { + super(); + } + + /** + * Constructor + */ + public CodeSystemIncludeCodeSystemComponent(UriType system) { + super(); + this.system = system; + } + + /** + * @return {@link #system} (An absolute URI which is the code system to be included.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystemIncludeCodeSystemComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI which is the code system to be included.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public CodeSystemIncludeCodeSystemComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI which is the code system to be included. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI which is the code system to be included. + */ + public CodeSystemIncludeCodeSystemComponent setSystem(String value) { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of the code system from which codes in the expansion should be included.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystemIncludeCodeSystemComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the code system from which codes in the expansion should be included.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public CodeSystemIncludeCodeSystemComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the code system from which codes in the expansion should be included. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the code system from which codes in the expansion should be included. + */ + public CodeSystemIncludeCodeSystemComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI which is the code system to be included.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of the code system from which codes in the expansion should be included.", 0, java.lang.Integer.MAX_VALUE, version)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.system"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.version"); + } + else + return super.addChild(name); + } + + public CodeSystemIncludeCodeSystemComponent copy() { + CodeSystemIncludeCodeSystemComponent dst = new CodeSystemIncludeCodeSystemComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeSystemIncludeCodeSystemComponent)) + return false; + CodeSystemIncludeCodeSystemComponent o = (CodeSystemIncludeCodeSystemComponent) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeSystemIncludeCodeSystemComponent)) + return false; + CodeSystemIncludeCodeSystemComponent o = (CodeSystemIncludeCodeSystemComponent) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + ; + } + + public String fhirType() { + return "ExpansionProfile.codeSystem.include.codeSystem"; + + } + + } + + @Block() + public static class CodeSystemExcludeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A data group for each code system to be excluded. + */ + @Child(name = "codeSystem", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The code systems to be excluded", formalDefinition="A data group for each code system to be excluded." ) + protected List codeSystem; + + private static final long serialVersionUID = 1960514347L; + + /** + * Constructor + */ + public CodeSystemExcludeComponent() { + super(); + } + + /** + * @return {@link #codeSystem} (A data group for each code system to be excluded.) + */ + public List getCodeSystem() { + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + return this.codeSystem; + } + + public boolean hasCodeSystem() { + if (this.codeSystem == null) + return false; + for (CodeSystemExcludeCodeSystemComponent item : this.codeSystem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeSystem} (A data group for each code system to be excluded.) + */ + // syntactic sugar + public CodeSystemExcludeCodeSystemComponent addCodeSystem() { //3 + CodeSystemExcludeCodeSystemComponent t = new CodeSystemExcludeCodeSystemComponent(); + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return t; + } + + // syntactic sugar + public CodeSystemExcludeComponent addCodeSystem(CodeSystemExcludeCodeSystemComponent t) { //3 + if (t == null) + return this; + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("codeSystem", "", "A data group for each code system to be excluded.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // CodeSystemExcludeCodeSystemComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -916511108: // codeSystem + this.getCodeSystem().add((CodeSystemExcludeCodeSystemComponent) value); // CodeSystemExcludeCodeSystemComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("codeSystem")) + this.getCodeSystem().add((CodeSystemExcludeCodeSystemComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -916511108: return addCodeSystem(); // CodeSystemExcludeCodeSystemComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("codeSystem")) { + return addCodeSystem(); + } + else + return super.addChild(name); + } + + public CodeSystemExcludeComponent copy() { + CodeSystemExcludeComponent dst = new CodeSystemExcludeComponent(); + copyValues(dst); + if (codeSystem != null) { + dst.codeSystem = new ArrayList(); + for (CodeSystemExcludeCodeSystemComponent i : codeSystem) + dst.codeSystem.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeSystemExcludeComponent)) + return false; + CodeSystemExcludeComponent o = (CodeSystemExcludeComponent) other; + return compareDeep(codeSystem, o.codeSystem, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeSystemExcludeComponent)) + return false; + CodeSystemExcludeComponent o = (CodeSystemExcludeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()); + } + + public String fhirType() { + return "ExpansionProfile.codeSystem.exclude"; + + } + + } + + @Block() + public static class CodeSystemExcludeCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI which is the code system to be excluded. + */ + @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The specific code system to be excluded", formalDefinition="An absolute URI which is the code system to be excluded." ) + protected UriType system; + + /** + * The version of the code system from which codes in the expansion should be excluded. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system from which codes in the expansion should be excluded." ) + protected StringType version; + + private static final long serialVersionUID = 1145288774L; + + /** + * Constructor + */ + public CodeSystemExcludeCodeSystemComponent() { + super(); + } + + /** + * Constructor + */ + public CodeSystemExcludeCodeSystemComponent(UriType system) { + super(); + this.system = system; + } + + /** + * @return {@link #system} (An absolute URI which is the code system to be excluded.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystemExcludeCodeSystemComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI which is the code system to be excluded.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public CodeSystemExcludeCodeSystemComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI which is the code system to be excluded. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI which is the code system to be excluded. + */ + public CodeSystemExcludeCodeSystemComponent setSystem(String value) { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of the code system from which codes in the expansion should be excluded.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeSystemExcludeCodeSystemComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the code system from which codes in the expansion should be excluded.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public CodeSystemExcludeCodeSystemComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the code system from which codes in the expansion should be excluded. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the code system from which codes in the expansion should be excluded. + */ + public CodeSystemExcludeCodeSystemComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI which is the code system to be excluded.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of the code system from which codes in the expansion should be excluded.", 0, java.lang.Integer.MAX_VALUE, version)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.system"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.version"); + } + else + return super.addChild(name); + } + + public CodeSystemExcludeCodeSystemComponent copy() { + CodeSystemExcludeCodeSystemComponent dst = new CodeSystemExcludeCodeSystemComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CodeSystemExcludeCodeSystemComponent)) + return false; + CodeSystemExcludeCodeSystemComponent o = (CodeSystemExcludeCodeSystemComponent) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CodeSystemExcludeCodeSystemComponent)) + return false; + CodeSystemExcludeCodeSystemComponent o = (CodeSystemExcludeCodeSystemComponent) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + ; + } + + public String fhirType() { + return "ExpansionProfile.codeSystem.exclude.codeSystem"; + + } + + } + + @Block() + public static class ExpansionProfileDesignationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Designations to be included. + */ + @Child(name = "include", type = {}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Designations to be included", formalDefinition="Designations to be included." ) + protected DesignationIncludeComponent include; + + /** + * Designations to be excluded. + */ + @Child(name = "exclude", type = {}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Designations to be excluded", formalDefinition="Designations to be excluded." ) + protected DesignationExcludeComponent exclude; + + private static final long serialVersionUID = -2080476436L; + + /** + * Constructor + */ + public ExpansionProfileDesignationComponent() { + super(); + } + + /** + * @return {@link #include} (Designations to be included.) + */ + public DesignationIncludeComponent getInclude() { + if (this.include == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfileDesignationComponent.include"); + else if (Configuration.doAutoCreate()) + this.include = new DesignationIncludeComponent(); // cc + return this.include; + } + + public boolean hasInclude() { + return this.include != null && !this.include.isEmpty(); + } + + /** + * @param value {@link #include} (Designations to be included.) + */ + public ExpansionProfileDesignationComponent setInclude(DesignationIncludeComponent value) { + this.include = value; + return this; + } + + /** + * @return {@link #exclude} (Designations to be excluded.) + */ + public DesignationExcludeComponent getExclude() { + if (this.exclude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfileDesignationComponent.exclude"); + else if (Configuration.doAutoCreate()) + this.exclude = new DesignationExcludeComponent(); // cc + return this.exclude; + } + + public boolean hasExclude() { + return this.exclude != null && !this.exclude.isEmpty(); + } + + /** + * @param value {@link #exclude} (Designations to be excluded.) + */ + public ExpansionProfileDesignationComponent setExclude(DesignationExcludeComponent value) { + this.exclude = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("include", "", "Designations to be included.", 0, java.lang.Integer.MAX_VALUE, include)); + childrenList.add(new Property("exclude", "", "Designations to be excluded.", 0, java.lang.Integer.MAX_VALUE, exclude)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1942574248: /*include*/ return this.include == null ? new Base[0] : new Base[] {this.include}; // DesignationIncludeComponent + case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : new Base[] {this.exclude}; // DesignationExcludeComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1942574248: // include + this.include = (DesignationIncludeComponent) value; // DesignationIncludeComponent + break; + case -1321148966: // exclude + this.exclude = (DesignationExcludeComponent) value; // DesignationExcludeComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("include")) + this.include = (DesignationIncludeComponent) value; // DesignationIncludeComponent + else if (name.equals("exclude")) + this.exclude = (DesignationExcludeComponent) value; // DesignationExcludeComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1942574248: return getInclude(); // DesignationIncludeComponent + case -1321148966: return getExclude(); // DesignationExcludeComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("include")) { + this.include = new DesignationIncludeComponent(); + return this.include; + } + else if (name.equals("exclude")) { + this.exclude = new DesignationExcludeComponent(); + return this.exclude; + } + else + return super.addChild(name); + } + + public ExpansionProfileDesignationComponent copy() { + ExpansionProfileDesignationComponent dst = new ExpansionProfileDesignationComponent(); + copyValues(dst); + dst.include = include == null ? null : include.copy(); + dst.exclude = exclude == null ? null : exclude.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ExpansionProfileDesignationComponent)) + return false; + ExpansionProfileDesignationComponent o = (ExpansionProfileDesignationComponent) other; + return compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ExpansionProfileDesignationComponent)) + return false; + ExpansionProfileDesignationComponent o = (ExpansionProfileDesignationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) + ; + } + + public String fhirType() { + return "ExpansionProfile.designation"; + + } + + } + + @Block() + public static class DesignationIncludeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A data group for each designation to be included. + */ + @Child(name = "designation", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The designation to be included", formalDefinition="A data group for each designation to be included." ) + protected List designation; + + private static final long serialVersionUID = -1989669274L; + + /** + * Constructor + */ + public DesignationIncludeComponent() { + super(); + } + + /** + * @return {@link #designation} (A data group for each designation to be included.) + */ + public List getDesignation() { + if (this.designation == null) + this.designation = new ArrayList(); + return this.designation; + } + + public boolean hasDesignation() { + if (this.designation == null) + return false; + for (DesignationIncludeDesignationComponent item : this.designation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #designation} (A data group for each designation to be included.) + */ + // syntactic sugar + public DesignationIncludeDesignationComponent addDesignation() { //3 + DesignationIncludeDesignationComponent t = new DesignationIncludeDesignationComponent(); + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return t; + } + + // syntactic sugar + public DesignationIncludeComponent addDesignation(DesignationIncludeDesignationComponent t) { //3 + if (t == null) + return this; + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("designation", "", "A data group for each designation to be included.", 0, java.lang.Integer.MAX_VALUE, designation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // DesignationIncludeDesignationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -900931593: // designation + this.getDesignation().add((DesignationIncludeDesignationComponent) value); // DesignationIncludeDesignationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("designation")) + this.getDesignation().add((DesignationIncludeDesignationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -900931593: return addDesignation(); // DesignationIncludeDesignationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("designation")) { + return addDesignation(); + } + else + return super.addChild(name); + } + + public DesignationIncludeComponent copy() { + DesignationIncludeComponent dst = new DesignationIncludeComponent(); + copyValues(dst); + if (designation != null) { + dst.designation = new ArrayList(); + for (DesignationIncludeDesignationComponent i : designation) + dst.designation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DesignationIncludeComponent)) + return false; + DesignationIncludeComponent o = (DesignationIncludeComponent) other; + return compareDeep(designation, o.designation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DesignationIncludeComponent)) + return false; + DesignationIncludeComponent o = (DesignationIncludeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (designation == null || designation.isEmpty()); + } + + public String fhirType() { + return "ExpansionProfile.designation.include"; + + } + + } + + @Block() + public static class DesignationIncludeDesignationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The language this designation is defined for. + */ + @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human language of the designation to be included", formalDefinition="The language this designation is defined for." ) + protected CodeType language; + + /** + * Designation uses for inclusion in the expansion. + */ + @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Designation use", formalDefinition="Designation uses for inclusion in the expansion." ) + protected Coding use; + + private static final long serialVersionUID = 242239292L; + + /** + * Constructor + */ + public DesignationIncludeDesignationComponent() { + super(); + } + + /** + * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DesignationIncludeDesignationComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public DesignationIncludeDesignationComponent setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The language this designation is defined for. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The language this designation is defined for. + */ + public DesignationIncludeDesignationComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (Designation uses for inclusion in the expansion.) + */ + public Coding getUse() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DesignationIncludeDesignationComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Coding(); // cc + return this.use; + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Designation uses for inclusion in the expansion.) + */ + public DesignationIncludeDesignationComponent setUse(Coding value) { + this.use = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("use", "Coding", "Designation uses for inclusion in the expansion.", 0, java.lang.Integer.MAX_VALUE, use)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1613589672: // language + this.language = castToCode(value); // CodeType + break; + case 116103: // use + this.use = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("language")) + this.language = castToCode(value); // CodeType + else if (name.equals("use")) + this.use = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType + case 116103: return getUse(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("language")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.language"); + } + else if (name.equals("use")) { + this.use = new Coding(); + return this.use; + } + else + return super.addChild(name); + } + + public DesignationIncludeDesignationComponent copy() { + DesignationIncludeDesignationComponent dst = new DesignationIncludeDesignationComponent(); + copyValues(dst); + dst.language = language == null ? null : language.copy(); + dst.use = use == null ? null : use.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DesignationIncludeDesignationComponent)) + return false; + DesignationIncludeDesignationComponent o = (DesignationIncludeDesignationComponent) other; + return compareDeep(language, o.language, true) && compareDeep(use, o.use, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DesignationIncludeDesignationComponent)) + return false; + DesignationIncludeDesignationComponent o = (DesignationIncludeDesignationComponent) other; + return compareValues(language, o.language, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) + ; + } + + public String fhirType() { + return "ExpansionProfile.designation.include.designation"; + + } + + } + + @Block() + public static class DesignationExcludeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A data group for each designation to be excluded. + */ + @Child(name = "designation", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The designation to be excluded", formalDefinition="A data group for each designation to be excluded." ) + protected List designation; + + private static final long serialVersionUID = 1045849752L; + + /** + * Constructor + */ + public DesignationExcludeComponent() { + super(); + } + + /** + * @return {@link #designation} (A data group for each designation to be excluded.) + */ + public List getDesignation() { + if (this.designation == null) + this.designation = new ArrayList(); + return this.designation; + } + + public boolean hasDesignation() { + if (this.designation == null) + return false; + for (DesignationExcludeDesignationComponent item : this.designation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #designation} (A data group for each designation to be excluded.) + */ + // syntactic sugar + public DesignationExcludeDesignationComponent addDesignation() { //3 + DesignationExcludeDesignationComponent t = new DesignationExcludeDesignationComponent(); + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return t; + } + + // syntactic sugar + public DesignationExcludeComponent addDesignation(DesignationExcludeDesignationComponent t) { //3 + if (t == null) + return this; + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("designation", "", "A data group for each designation to be excluded.", 0, java.lang.Integer.MAX_VALUE, designation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // DesignationExcludeDesignationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -900931593: // designation + this.getDesignation().add((DesignationExcludeDesignationComponent) value); // DesignationExcludeDesignationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("designation")) + this.getDesignation().add((DesignationExcludeDesignationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -900931593: return addDesignation(); // DesignationExcludeDesignationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("designation")) { + return addDesignation(); + } + else + return super.addChild(name); + } + + public DesignationExcludeComponent copy() { + DesignationExcludeComponent dst = new DesignationExcludeComponent(); + copyValues(dst); + if (designation != null) { + dst.designation = new ArrayList(); + for (DesignationExcludeDesignationComponent i : designation) + dst.designation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DesignationExcludeComponent)) + return false; + DesignationExcludeComponent o = (DesignationExcludeComponent) other; + return compareDeep(designation, o.designation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DesignationExcludeComponent)) + return false; + DesignationExcludeComponent o = (DesignationExcludeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (designation == null || designation.isEmpty()); + } + + public String fhirType() { + return "ExpansionProfile.designation.exclude"; + + } + + } + + @Block() + public static class DesignationExcludeDesignationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The language this designation is defined for. + */ + @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human language of the designation to be excluded", formalDefinition="The language this designation is defined for." ) + protected CodeType language; + + /** + * Designation uses for exclusion in the expansion. + */ + @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Designation use", formalDefinition="Designation uses for exclusion in the expansion." ) + protected Coding use; + + private static final long serialVersionUID = 242239292L; + + /** + * Constructor + */ + public DesignationExcludeDesignationComponent() { + super(); + } + + /** + * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DesignationExcludeDesignationComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public DesignationExcludeDesignationComponent setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The language this designation is defined for. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The language this designation is defined for. + */ + public DesignationExcludeDesignationComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (Designation uses for exclusion in the expansion.) + */ + public Coding getUse() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DesignationExcludeDesignationComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Coding(); // cc + return this.use; + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Designation uses for exclusion in the expansion.) + */ + public DesignationExcludeDesignationComponent setUse(Coding value) { + this.use = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("use", "Coding", "Designation uses for exclusion in the expansion.", 0, java.lang.Integer.MAX_VALUE, use)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1613589672: // language + this.language = castToCode(value); // CodeType + break; + case 116103: // use + this.use = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("language")) + this.language = castToCode(value); // CodeType + else if (name.equals("use")) + this.use = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType + case 116103: return getUse(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("language")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.language"); + } + else if (name.equals("use")) { + this.use = new Coding(); + return this.use; + } + else + return super.addChild(name); + } + + public DesignationExcludeDesignationComponent copy() { + DesignationExcludeDesignationComponent dst = new DesignationExcludeDesignationComponent(); + copyValues(dst); + dst.language = language == null ? null : language.copy(); + dst.use = use == null ? null : use.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DesignationExcludeDesignationComponent)) + return false; + DesignationExcludeDesignationComponent o = (DesignationExcludeDesignationComponent) other; + return compareDeep(language, o.language, true) && compareDeep(use, o.use, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DesignationExcludeDesignationComponent)) + return false; + DesignationExcludeDesignationComponent o = (DesignationExcludeDesignationComponent) other; + return compareValues(language, o.language, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) + ; + } + + public String fhirType() { + return "ExpansionProfile.designation.exclude.designation"; + + } + + } + + /** + * An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Globally unique logical identifier for expansion profile", formalDefinition="An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional identifier for the expansion profile (e.g. an Object Identifier)", formalDefinition="Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance." ) + protected Identifier identifier; + + /** + * Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical identifier for this version of the expansion profile", formalDefinition="Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance." ) + protected StringType version; + + /** + * A free text natural language name for the expansion profile. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this expansion profile", formalDefinition="A free text natural language name for the expansion profile." ) + protected StringType name; + + /** + * The status of the expansion profile. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the expansion profile." ) + protected Enumeration status; + + /** + * This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the expansion profile. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the expansion profile." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for given status", formalDefinition="The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes." ) + protected DateTimeType date; + + /** + * A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile. + */ + @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human language description of the expansion profile", formalDefinition="A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile." ) + protected StringType description; + + /** + * A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions). + */ + @Child(name = "codeSystem", type = {}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the expansion profile imposes code system contraints", formalDefinition="A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions)." ) + protected ExpansionProfileCodeSystemComponent codeSystem; + + /** + * Controls whether concept designations are to be included or excluded in value set expansions. + */ + @Child(name = "includeDesignations", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether the expansion should include concept designations", formalDefinition="Controls whether concept designations are to be included or excluded in value set expansions." ) + protected BooleanType includeDesignations; + + /** + * A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations. + */ + @Child(name = "designation", type = {}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the expansion profile imposes designation contraints", formalDefinition="A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations." ) + protected ExpansionProfileDesignationComponent designation; + + /** + * Controls whether the value set definition is included or excluded in value set expansions. + */ + @Child(name = "includeDefinition", type = {BooleanType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Include or exclude the value set definition in the expansion", formalDefinition="Controls whether the value set definition is included or excluded in value set expansions." ) + protected BooleanType includeDefinition; + + /** + * Controls whether inactive concepts are included or excluded in value set expansions. + */ + @Child(name = "includeInactive", type = {BooleanType.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Include or exclude inactive concepts in the expansion", formalDefinition="Controls whether inactive concepts are included or excluded in value set expansions." ) + protected BooleanType includeInactive; + + /** + * Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). + */ + @Child(name = "excludeNested", type = {BooleanType.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Include or exclude nested codes in the value set expansion", formalDefinition="Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains)." ) + protected BooleanType excludeNested; + + /** + * Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces. + */ + @Child(name = "excludeNotForUI", type = {BooleanType.class}, order=16, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Include or exclude codes which cannot be rendered in user interfaces in the value set expansion", formalDefinition="Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces." ) + protected BooleanType excludeNotForUI; + + /** + * Controls whether or not the value set expansion includes post coordinated codes. + */ + @Child(name = "excludePostCoordinated", type = {BooleanType.class}, order=17, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Include or exclude codes which are post coordinated expressions in the value set expansion", formalDefinition="Controls whether or not the value set expansion includes post coordinated codes." ) + protected BooleanType excludePostCoordinated; + + /** + * Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display. + */ + @Child(name = "displayLanguage", type = {CodeType.class}, order=18, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specify the language for the display element of codes in the value set expansion", formalDefinition="Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display." ) + protected CodeType displayLanguage; + + /** + * If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete. + */ + @Child(name = "limitedExpansion", type = {BooleanType.class}, order=19, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Controls behaviour of the value set expand operation when value sets are too large to be completely expanded", formalDefinition="If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete." ) + protected BooleanType limitedExpansion; + + private static final long serialVersionUID = -651123079L; + + /** + * Constructor + */ + public ExpansionProfile() { + super(); + } + + /** + * Constructor + */ + public ExpansionProfile(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ExpansionProfile setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published. + */ + public ExpansionProfile setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public ExpansionProfile setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #version} (Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ExpansionProfile setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance. + */ + public ExpansionProfile setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name for the expansion profile.). 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 ExpansionProfile.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name for the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ExpansionProfile setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name for the expansion profile. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name for the expansion profile. + */ + public ExpansionProfile setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the expansion profile.). 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 ExpansionProfile.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 expansion profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ExpansionProfile setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the expansion profile. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the expansion profile. + */ + public ExpansionProfile setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ExpansionProfile setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage. + */ + public ExpansionProfile setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ExpansionProfile setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the expansion profile. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the expansion profile. + */ + public ExpansionProfile setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ExpansionProfileContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ExpansionProfileContactComponent addContact() { //3 + ExpansionProfileContactComponent t = new ExpansionProfileContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public ExpansionProfile addContact(ExpansionProfileContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes.). 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 ExpansionProfile.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ExpansionProfile setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. + */ + public ExpansionProfile setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile.). 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 ExpansionProfile.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ExpansionProfile setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile. + */ + public ExpansionProfile 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 #codeSystem} (A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions).) + */ + public ExpansionProfileCodeSystemComponent getCodeSystem() { + if (this.codeSystem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.codeSystem"); + else if (Configuration.doAutoCreate()) + this.codeSystem = new ExpansionProfileCodeSystemComponent(); // cc + return this.codeSystem; + } + + public boolean hasCodeSystem() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + /** + * @param value {@link #codeSystem} (A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions).) + */ + public ExpansionProfile setCodeSystem(ExpansionProfileCodeSystemComponent value) { + this.codeSystem = value; + return this; + } + + /** + * @return {@link #includeDesignations} (Controls whether concept designations are to be included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeDesignations" gives direct access to the value + */ + public BooleanType getIncludeDesignationsElement() { + if (this.includeDesignations == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.includeDesignations"); + else if (Configuration.doAutoCreate()) + this.includeDesignations = new BooleanType(); // bb + return this.includeDesignations; + } + + public boolean hasIncludeDesignationsElement() { + return this.includeDesignations != null && !this.includeDesignations.isEmpty(); + } + + public boolean hasIncludeDesignations() { + return this.includeDesignations != null && !this.includeDesignations.isEmpty(); + } + + /** + * @param value {@link #includeDesignations} (Controls whether concept designations are to be included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeDesignations" gives direct access to the value + */ + public ExpansionProfile setIncludeDesignationsElement(BooleanType value) { + this.includeDesignations = value; + return this; + } + + /** + * @return Controls whether concept designations are to be included or excluded in value set expansions. + */ + public boolean getIncludeDesignations() { + return this.includeDesignations == null || this.includeDesignations.isEmpty() ? false : this.includeDesignations.getValue(); + } + + /** + * @param value Controls whether concept designations are to be included or excluded in value set expansions. + */ + public ExpansionProfile setIncludeDesignations(boolean value) { + if (this.includeDesignations == null) + this.includeDesignations = new BooleanType(); + this.includeDesignations.setValue(value); + return this; + } + + /** + * @return {@link #designation} (A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations.) + */ + public ExpansionProfileDesignationComponent getDesignation() { + if (this.designation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.designation"); + else if (Configuration.doAutoCreate()) + this.designation = new ExpansionProfileDesignationComponent(); // cc + return this.designation; + } + + public boolean hasDesignation() { + return this.designation != null && !this.designation.isEmpty(); + } + + /** + * @param value {@link #designation} (A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations.) + */ + public ExpansionProfile setDesignation(ExpansionProfileDesignationComponent value) { + this.designation = value; + return this; + } + + /** + * @return {@link #includeDefinition} (Controls whether the value set definition is included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeDefinition" gives direct access to the value + */ + public BooleanType getIncludeDefinitionElement() { + if (this.includeDefinition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.includeDefinition"); + else if (Configuration.doAutoCreate()) + this.includeDefinition = new BooleanType(); // bb + return this.includeDefinition; + } + + public boolean hasIncludeDefinitionElement() { + return this.includeDefinition != null && !this.includeDefinition.isEmpty(); + } + + public boolean hasIncludeDefinition() { + return this.includeDefinition != null && !this.includeDefinition.isEmpty(); + } + + /** + * @param value {@link #includeDefinition} (Controls whether the value set definition is included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeDefinition" gives direct access to the value + */ + public ExpansionProfile setIncludeDefinitionElement(BooleanType value) { + this.includeDefinition = value; + return this; + } + + /** + * @return Controls whether the value set definition is included or excluded in value set expansions. + */ + public boolean getIncludeDefinition() { + return this.includeDefinition == null || this.includeDefinition.isEmpty() ? false : this.includeDefinition.getValue(); + } + + /** + * @param value Controls whether the value set definition is included or excluded in value set expansions. + */ + public ExpansionProfile setIncludeDefinition(boolean value) { + if (this.includeDefinition == null) + this.includeDefinition = new BooleanType(); + this.includeDefinition.setValue(value); + return this; + } + + /** + * @return {@link #includeInactive} (Controls whether inactive concepts are included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeInactive" gives direct access to the value + */ + public BooleanType getIncludeInactiveElement() { + if (this.includeInactive == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.includeInactive"); + else if (Configuration.doAutoCreate()) + this.includeInactive = new BooleanType(); // bb + return this.includeInactive; + } + + public boolean hasIncludeInactiveElement() { + return this.includeInactive != null && !this.includeInactive.isEmpty(); + } + + public boolean hasIncludeInactive() { + return this.includeInactive != null && !this.includeInactive.isEmpty(); + } + + /** + * @param value {@link #includeInactive} (Controls whether inactive concepts are included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeInactive" gives direct access to the value + */ + public ExpansionProfile setIncludeInactiveElement(BooleanType value) { + this.includeInactive = value; + return this; + } + + /** + * @return Controls whether inactive concepts are included or excluded in value set expansions. + */ + public boolean getIncludeInactive() { + return this.includeInactive == null || this.includeInactive.isEmpty() ? false : this.includeInactive.getValue(); + } + + /** + * @param value Controls whether inactive concepts are included or excluded in value set expansions. + */ + public ExpansionProfile setIncludeInactive(boolean value) { + if (this.includeInactive == null) + this.includeInactive = new BooleanType(); + this.includeInactive.setValue(value); + return this; + } + + /** + * @return {@link #excludeNested} (Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).). This is the underlying object with id, value and extensions. The accessor "getExcludeNested" gives direct access to the value + */ + public BooleanType getExcludeNestedElement() { + if (this.excludeNested == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.excludeNested"); + else if (Configuration.doAutoCreate()) + this.excludeNested = new BooleanType(); // bb + return this.excludeNested; + } + + public boolean hasExcludeNestedElement() { + return this.excludeNested != null && !this.excludeNested.isEmpty(); + } + + public boolean hasExcludeNested() { + return this.excludeNested != null && !this.excludeNested.isEmpty(); + } + + /** + * @param value {@link #excludeNested} (Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).). This is the underlying object with id, value and extensions. The accessor "getExcludeNested" gives direct access to the value + */ + public ExpansionProfile setExcludeNestedElement(BooleanType value) { + this.excludeNested = value; + return this; + } + + /** + * @return Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). + */ + public boolean getExcludeNested() { + return this.excludeNested == null || this.excludeNested.isEmpty() ? false : this.excludeNested.getValue(); + } + + /** + * @param value Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). + */ + public ExpansionProfile setExcludeNested(boolean value) { + if (this.excludeNested == null) + this.excludeNested = new BooleanType(); + this.excludeNested.setValue(value); + return this; + } + + /** + * @return {@link #excludeNotForUI} (Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces.). This is the underlying object with id, value and extensions. The accessor "getExcludeNotForUI" gives direct access to the value + */ + public BooleanType getExcludeNotForUIElement() { + if (this.excludeNotForUI == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.excludeNotForUI"); + else if (Configuration.doAutoCreate()) + this.excludeNotForUI = new BooleanType(); // bb + return this.excludeNotForUI; + } + + public boolean hasExcludeNotForUIElement() { + return this.excludeNotForUI != null && !this.excludeNotForUI.isEmpty(); + } + + public boolean hasExcludeNotForUI() { + return this.excludeNotForUI != null && !this.excludeNotForUI.isEmpty(); + } + + /** + * @param value {@link #excludeNotForUI} (Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces.). This is the underlying object with id, value and extensions. The accessor "getExcludeNotForUI" gives direct access to the value + */ + public ExpansionProfile setExcludeNotForUIElement(BooleanType value) { + this.excludeNotForUI = value; + return this; + } + + /** + * @return Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces. + */ + public boolean getExcludeNotForUI() { + return this.excludeNotForUI == null || this.excludeNotForUI.isEmpty() ? false : this.excludeNotForUI.getValue(); + } + + /** + * @param value Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces. + */ + public ExpansionProfile setExcludeNotForUI(boolean value) { + if (this.excludeNotForUI == null) + this.excludeNotForUI = new BooleanType(); + this.excludeNotForUI.setValue(value); + return this; + } + + /** + * @return {@link #excludePostCoordinated} (Controls whether or not the value set expansion includes post coordinated codes.). This is the underlying object with id, value and extensions. The accessor "getExcludePostCoordinated" gives direct access to the value + */ + public BooleanType getExcludePostCoordinatedElement() { + if (this.excludePostCoordinated == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.excludePostCoordinated"); + else if (Configuration.doAutoCreate()) + this.excludePostCoordinated = new BooleanType(); // bb + return this.excludePostCoordinated; + } + + public boolean hasExcludePostCoordinatedElement() { + return this.excludePostCoordinated != null && !this.excludePostCoordinated.isEmpty(); + } + + public boolean hasExcludePostCoordinated() { + return this.excludePostCoordinated != null && !this.excludePostCoordinated.isEmpty(); + } + + /** + * @param value {@link #excludePostCoordinated} (Controls whether or not the value set expansion includes post coordinated codes.). This is the underlying object with id, value and extensions. The accessor "getExcludePostCoordinated" gives direct access to the value + */ + public ExpansionProfile setExcludePostCoordinatedElement(BooleanType value) { + this.excludePostCoordinated = value; + return this; + } + + /** + * @return Controls whether or not the value set expansion includes post coordinated codes. + */ + public boolean getExcludePostCoordinated() { + return this.excludePostCoordinated == null || this.excludePostCoordinated.isEmpty() ? false : this.excludePostCoordinated.getValue(); + } + + /** + * @param value Controls whether or not the value set expansion includes post coordinated codes. + */ + public ExpansionProfile setExcludePostCoordinated(boolean value) { + if (this.excludePostCoordinated == null) + this.excludePostCoordinated = new BooleanType(); + this.excludePostCoordinated.setValue(value); + return this; + } + + /** + * @return {@link #displayLanguage} (Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.). This is the underlying object with id, value and extensions. The accessor "getDisplayLanguage" gives direct access to the value + */ + public CodeType getDisplayLanguageElement() { + if (this.displayLanguage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.displayLanguage"); + else if (Configuration.doAutoCreate()) + this.displayLanguage = new CodeType(); // bb + return this.displayLanguage; + } + + public boolean hasDisplayLanguageElement() { + return this.displayLanguage != null && !this.displayLanguage.isEmpty(); + } + + public boolean hasDisplayLanguage() { + return this.displayLanguage != null && !this.displayLanguage.isEmpty(); + } + + /** + * @param value {@link #displayLanguage} (Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.). This is the underlying object with id, value and extensions. The accessor "getDisplayLanguage" gives direct access to the value + */ + public ExpansionProfile setDisplayLanguageElement(CodeType value) { + this.displayLanguage = value; + return this; + } + + /** + * @return Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display. + */ + public String getDisplayLanguage() { + return this.displayLanguage == null ? null : this.displayLanguage.getValue(); + } + + /** + * @param value Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display. + */ + public ExpansionProfile setDisplayLanguage(String value) { + if (Utilities.noString(value)) + this.displayLanguage = null; + else { + if (this.displayLanguage == null) + this.displayLanguage = new CodeType(); + this.displayLanguage.setValue(value); + } + return this; + } + + /** + * @return {@link #limitedExpansion} (If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete.). This is the underlying object with id, value and extensions. The accessor "getLimitedExpansion" gives direct access to the value + */ + public BooleanType getLimitedExpansionElement() { + if (this.limitedExpansion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExpansionProfile.limitedExpansion"); + else if (Configuration.doAutoCreate()) + this.limitedExpansion = new BooleanType(); // bb + return this.limitedExpansion; + } + + public boolean hasLimitedExpansionElement() { + return this.limitedExpansion != null && !this.limitedExpansion.isEmpty(); + } + + public boolean hasLimitedExpansion() { + return this.limitedExpansion != null && !this.limitedExpansion.isEmpty(); + } + + /** + * @param value {@link #limitedExpansion} (If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete.). This is the underlying object with id, value and extensions. The accessor "getLimitedExpansion" gives direct access to the value + */ + public ExpansionProfile setLimitedExpansionElement(BooleanType value) { + this.limitedExpansion = value; + return this; + } + + /** + * @return If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete. + */ + public boolean getLimitedExpansion() { + return this.limitedExpansion == null || this.limitedExpansion.isEmpty() ? false : this.limitedExpansion.getValue(); + } + + /** + * @param value If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete. + */ + public ExpansionProfile setLimitedExpansion(boolean value) { + if (this.limitedExpansion == null) + this.limitedExpansion = new BooleanType(); + this.limitedExpansion.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name for the expansion profile.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the expansion profile.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the expansion profile.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("codeSystem", "", "A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("includeDesignations", "boolean", "Controls whether concept designations are to be included or excluded in value set expansions.", 0, java.lang.Integer.MAX_VALUE, includeDesignations)); + childrenList.add(new Property("designation", "", "A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations.", 0, java.lang.Integer.MAX_VALUE, designation)); + childrenList.add(new Property("includeDefinition", "boolean", "Controls whether the value set definition is included or excluded in value set expansions.", 0, java.lang.Integer.MAX_VALUE, includeDefinition)); + childrenList.add(new Property("includeInactive", "boolean", "Controls whether inactive concepts are included or excluded in value set expansions.", 0, java.lang.Integer.MAX_VALUE, includeInactive)); + childrenList.add(new Property("excludeNested", "boolean", "Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).", 0, java.lang.Integer.MAX_VALUE, excludeNested)); + childrenList.add(new Property("excludeNotForUI", "boolean", "Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces.", 0, java.lang.Integer.MAX_VALUE, excludeNotForUI)); + childrenList.add(new Property("excludePostCoordinated", "boolean", "Controls whether or not the value set expansion includes post coordinated codes.", 0, java.lang.Integer.MAX_VALUE, excludePostCoordinated)); + childrenList.add(new Property("displayLanguage", "code", "Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.", 0, java.lang.Integer.MAX_VALUE, displayLanguage)); + childrenList.add(new Property("limitedExpansion", "boolean", "If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete.", 0, java.lang.Integer.MAX_VALUE, limitedExpansion)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ExpansionProfileContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : new Base[] {this.codeSystem}; // ExpansionProfileCodeSystemComponent + case 461507620: /*includeDesignations*/ return this.includeDesignations == null ? new Base[0] : new Base[] {this.includeDesignations}; // BooleanType + case -900931593: /*designation*/ return this.designation == null ? new Base[0] : new Base[] {this.designation}; // ExpansionProfileDesignationComponent + case 127972379: /*includeDefinition*/ return this.includeDefinition == null ? new Base[0] : new Base[] {this.includeDefinition}; // BooleanType + case 1634790707: /*includeInactive*/ return this.includeInactive == null ? new Base[0] : new Base[] {this.includeInactive}; // BooleanType + case 424992625: /*excludeNested*/ return this.excludeNested == null ? new Base[0] : new Base[] {this.excludeNested}; // BooleanType + case 667582980: /*excludeNotForUI*/ return this.excludeNotForUI == null ? new Base[0] : new Base[] {this.excludeNotForUI}; // BooleanType + case 563335154: /*excludePostCoordinated*/ return this.excludePostCoordinated == null ? new Base[0] : new Base[] {this.excludePostCoordinated}; // BooleanType + case 1486237242: /*displayLanguage*/ return this.displayLanguage == null ? new Base[0] : new Base[] {this.displayLanguage}; // CodeType + case 597771333: /*limitedExpansion*/ return this.limitedExpansion == null ? new Base[0] : new Base[] {this.limitedExpansion}; // BooleanType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((ExpansionProfileContactComponent) value); // ExpansionProfileContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -916511108: // codeSystem + this.codeSystem = (ExpansionProfileCodeSystemComponent) value; // ExpansionProfileCodeSystemComponent + break; + case 461507620: // includeDesignations + this.includeDesignations = castToBoolean(value); // BooleanType + break; + case -900931593: // designation + this.designation = (ExpansionProfileDesignationComponent) value; // ExpansionProfileDesignationComponent + break; + case 127972379: // includeDefinition + this.includeDefinition = castToBoolean(value); // BooleanType + break; + case 1634790707: // includeInactive + this.includeInactive = castToBoolean(value); // BooleanType + break; + case 424992625: // excludeNested + this.excludeNested = castToBoolean(value); // BooleanType + break; + case 667582980: // excludeNotForUI + this.excludeNotForUI = castToBoolean(value); // BooleanType + break; + case 563335154: // excludePostCoordinated + this.excludePostCoordinated = castToBoolean(value); // BooleanType + break; + case 1486237242: // displayLanguage + this.displayLanguage = castToCode(value); // CodeType + break; + case 597771333: // limitedExpansion + this.limitedExpansion = castToBoolean(value); // BooleanType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((ExpansionProfileContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("codeSystem")) + this.codeSystem = (ExpansionProfileCodeSystemComponent) value; // ExpansionProfileCodeSystemComponent + else if (name.equals("includeDesignations")) + this.includeDesignations = castToBoolean(value); // BooleanType + else if (name.equals("designation")) + this.designation = (ExpansionProfileDesignationComponent) value; // ExpansionProfileDesignationComponent + else if (name.equals("includeDefinition")) + this.includeDefinition = castToBoolean(value); // BooleanType + else if (name.equals("includeInactive")) + this.includeInactive = castToBoolean(value); // BooleanType + else if (name.equals("excludeNested")) + this.excludeNested = castToBoolean(value); // BooleanType + else if (name.equals("excludeNotForUI")) + this.excludeNotForUI = castToBoolean(value); // BooleanType + else if (name.equals("excludePostCoordinated")) + this.excludePostCoordinated = castToBoolean(value); // BooleanType + else if (name.equals("displayLanguage")) + this.displayLanguage = castToCode(value); // CodeType + else if (name.equals("limitedExpansion")) + this.limitedExpansion = castToBoolean(value); // BooleanType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return getIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // ExpansionProfileContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -916511108: return getCodeSystem(); // ExpansionProfileCodeSystemComponent + case 461507620: throw new FHIRException("Cannot make property includeDesignations as it is not a complex type"); // BooleanType + case -900931593: return getDesignation(); // ExpansionProfileDesignationComponent + case 127972379: throw new FHIRException("Cannot make property includeDefinition as it is not a complex type"); // BooleanType + case 1634790707: throw new FHIRException("Cannot make property includeInactive as it is not a complex type"); // BooleanType + case 424992625: throw new FHIRException("Cannot make property excludeNested as it is not a complex type"); // BooleanType + case 667582980: throw new FHIRException("Cannot make property excludeNotForUI as it is not a complex type"); // BooleanType + case 563335154: throw new FHIRException("Cannot make property excludePostCoordinated as it is not a complex type"); // BooleanType + case 1486237242: throw new FHIRException("Cannot make property displayLanguage as it is not a complex type"); // CodeType + case 597771333: throw new FHIRException("Cannot make property limitedExpansion as it is not a complex type"); // BooleanType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.url"); + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.description"); + } + else if (name.equals("codeSystem")) { + this.codeSystem = new ExpansionProfileCodeSystemComponent(); + return this.codeSystem; + } + else if (name.equals("includeDesignations")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.includeDesignations"); + } + else if (name.equals("designation")) { + this.designation = new ExpansionProfileDesignationComponent(); + return this.designation; + } + else if (name.equals("includeDefinition")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.includeDefinition"); + } + else if (name.equals("includeInactive")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.includeInactive"); + } + else if (name.equals("excludeNested")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.excludeNested"); + } + else if (name.equals("excludeNotForUI")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.excludeNotForUI"); + } + else if (name.equals("excludePostCoordinated")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.excludePostCoordinated"); + } + else if (name.equals("displayLanguage")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.displayLanguage"); + } + else if (name.equals("limitedExpansion")) { + throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.limitedExpansion"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ExpansionProfile"; + + } + + public ExpansionProfile copy() { + ExpansionProfile dst = new ExpansionProfile(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ExpansionProfileContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); + dst.includeDesignations = includeDesignations == null ? null : includeDesignations.copy(); + dst.designation = designation == null ? null : designation.copy(); + dst.includeDefinition = includeDefinition == null ? null : includeDefinition.copy(); + dst.includeInactive = includeInactive == null ? null : includeInactive.copy(); + dst.excludeNested = excludeNested == null ? null : excludeNested.copy(); + dst.excludeNotForUI = excludeNotForUI == null ? null : excludeNotForUI.copy(); + dst.excludePostCoordinated = excludePostCoordinated == null ? null : excludePostCoordinated.copy(); + dst.displayLanguage = displayLanguage == null ? null : displayLanguage.copy(); + dst.limitedExpansion = limitedExpansion == null ? null : limitedExpansion.copy(); + return dst; + } + + protected ExpansionProfile typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ExpansionProfile)) + return false; + ExpansionProfile o = (ExpansionProfile) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) + && compareDeep(description, o.description, true) && compareDeep(codeSystem, o.codeSystem, true) + && compareDeep(includeDesignations, o.includeDesignations, true) && compareDeep(designation, o.designation, true) + && compareDeep(includeDefinition, o.includeDefinition, true) && compareDeep(includeInactive, o.includeInactive, true) + && compareDeep(excludeNested, o.excludeNested, true) && compareDeep(excludeNotForUI, o.excludeNotForUI, true) + && compareDeep(excludePostCoordinated, o.excludePostCoordinated, true) && compareDeep(displayLanguage, o.displayLanguage, true) + && compareDeep(limitedExpansion, o.limitedExpansion, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ExpansionProfile)) + return false; + ExpansionProfile o = (ExpansionProfile) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(includeDesignations, o.includeDesignations, true) + && compareValues(includeDefinition, o.includeDefinition, true) && compareValues(includeInactive, o.includeInactive, true) + && compareValues(excludeNested, o.excludeNested, true) && compareValues(excludeNotForUI, o.excludeNotForUI, true) + && compareValues(excludePostCoordinated, o.excludePostCoordinated, true) && compareValues(displayLanguage, o.displayLanguage, true) + && compareValues(limitedExpansion, o.limitedExpansion, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) + && (codeSystem == null || codeSystem.isEmpty()) && (includeDesignations == null || includeDesignations.isEmpty()) + && (designation == null || designation.isEmpty()) && (includeDefinition == null || includeDefinition.isEmpty()) + && (includeInactive == null || includeInactive.isEmpty()) && (excludeNested == null || excludeNested.isEmpty()) + && (excludeNotForUI == null || excludeNotForUI.isEmpty()) && (excludePostCoordinated == null || excludePostCoordinated.isEmpty()) + && (displayLanguage == null || displayLanguage.isEmpty()) && (limitedExpansion == null || limitedExpansion.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ExpansionProfile; + } + + /** + * Search parameter: status + *

+ * Description: The status of the expansion profile
+ * Type: token
+ * Path: ExpansionProfile.status
+ *

+ */ + @SearchParamDefinition(name="status", path="ExpansionProfile.status", description="The status of the expansion profile", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The status of the expansion profile
+ * Type: token
+ * Path: ExpansionProfile.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the expansion profile
+ * Type: string
+ * Path: ExpansionProfile.description
+ *

+ */ + @SearchParamDefinition(name="description", path="ExpansionProfile.description", description="Text search in the description of the expansion profile", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the expansion profile
+ * Type: string
+ * Path: ExpansionProfile.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: The name of the expansion profile
+ * Type: string
+ * Path: ExpansionProfile.name
+ *

+ */ + @SearchParamDefinition(name="name", path="ExpansionProfile.name", description="The name of the expansion profile", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: The name of the expansion profile
+ * Type: string
+ * Path: ExpansionProfile.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: date + *

+ * Description: The expansion profile publication date
+ * Type: date
+ * Path: ExpansionProfile.date
+ *

+ */ + @SearchParamDefinition(name="date", path="ExpansionProfile.date", description="The expansion profile publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The expansion profile publication date
+ * Type: date
+ * Path: ExpansionProfile.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: The identifier for the expansion profile
+ * Type: token
+ * Path: ExpansionProfile.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ExpansionProfile.identifier", description="The identifier for the expansion profile", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier for the expansion profile
+ * Type: token
+ * Path: ExpansionProfile.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: url + *

+ * Description: The logical URL for the expansion profile
+ * Type: uri
+ * Path: ExpansionProfile.url
+ *

+ */ + @SearchParamDefinition(name="url", path="ExpansionProfile.url", description="The logical URL for the expansion profile", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: The logical URL for the expansion profile
+ * Type: uri
+ * Path: ExpansionProfile.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the expansion profile
+ * Type: string
+ * Path: ExpansionProfile.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="ExpansionProfile.publisher", description="Name of the publisher of the expansion profile", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the expansion profile
+ * Type: string
+ * Path: ExpansionProfile.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the expansion profile
+ * Type: token
+ * Path: ExpansionProfile.version
+ *

+ */ + @SearchParamDefinition(name="version", path="ExpansionProfile.version", description="The version identifier of the expansion profile", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the expansion profile
+ * Type: token
+ * Path: ExpansionProfile.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExplanationOfBenefit.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExplanationOfBenefit.java new file mode 100644 index 00000000000..b1a0d7dce32 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExplanationOfBenefit.java @@ -0,0 +1,11620 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. + */ +@ResourceDef(name="ExplanationOfBenefit", profile="http://hl7.org/fhir/Profile/ExplanationOfBenefit") +public class ExplanationOfBenefit extends DomainResource { + + @Block() + public static class RelatedClaimsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Other claims which are related to this claim such as prior claim versions or for related services. + */ + @Child(name = "claim", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference to the related claim", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) + protected Type claim; + + /** + * For example prior or umbrella. + */ + @Child(name = "relationship", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How the reference claim is related", formalDefinition="For example prior or umbrella." ) + protected Coding relationship; + + /** + * An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # . + */ + @Child(name = "reference", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Related file or case reference", formalDefinition="An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # ." ) + protected Identifier reference; + + private static final long serialVersionUID = -2033217402L; + + /** + * Constructor + */ + public RelatedClaimsComponent() { + super(); + } + + /** + * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public Type getClaim() { + return this.claim; + } + + /** + * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public Identifier getClaimIdentifier() throws FHIRException { + if (!(this.claim instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claim.getClass().getName()+" was encountered"); + return (Identifier) this.claim; + } + + public boolean hasClaimIdentifier() { + return this.claim instanceof Identifier; + } + + /** + * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public Reference getClaimReference() throws FHIRException { + if (!(this.claim instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claim.getClass().getName()+" was encountered"); + return (Reference) this.claim; + } + + public boolean hasClaimReference() { + return this.claim instanceof Reference; + } + + public boolean hasClaim() { + return this.claim != null && !this.claim.isEmpty(); + } + + /** + * @param value {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public RelatedClaimsComponent setClaim(Type value) { + this.claim = value; + return this; + } + + /** + * @return {@link #relationship} (For example prior or umbrella.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedClaimsComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (For example prior or umbrella.) + */ + public RelatedClaimsComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .) + */ + public Identifier getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedClaimsComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Identifier(); // cc + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .) + */ + public RelatedClaimsComponent setReference(Identifier value) { + this.reference = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("claim[x]", "Identifier|Reference(Claim)", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, claim)); + childrenList.add(new Property("relationship", "Coding", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("reference", "Identifier", "An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .", 0, java.lang.Integer.MAX_VALUE, reference)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Type + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Identifier + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 94742588: // claim + this.claim = (Type) value; // Type + break; + case -261851592: // relationship + this.relationship = castToCoding(value); // Coding + break; + case -925155509: // reference + this.reference = castToIdentifier(value); // Identifier + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("claim[x]")) + this.claim = (Type) value; // Type + else if (name.equals("relationship")) + this.relationship = castToCoding(value); // Coding + else if (name.equals("reference")) + this.reference = castToIdentifier(value); // Identifier + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 683016900: return getClaim(); // Type + case -261851592: return getRelationship(); // Coding + case -925155509: return getReference(); // Identifier + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("claimIdentifier")) { + this.claim = new Identifier(); + return this.claim; + } + else if (name.equals("claimReference")) { + this.claim = new Reference(); + return this.claim; + } + else if (name.equals("relationship")) { + this.relationship = new Coding(); + return this.relationship; + } + else if (name.equals("reference")) { + this.reference = new Identifier(); + return this.reference; + } + else + return super.addChild(name); + } + + public RelatedClaimsComponent copy() { + RelatedClaimsComponent dst = new RelatedClaimsComponent(); + copyValues(dst); + dst.claim = claim == null ? null : claim.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.reference = reference == null ? null : reference.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RelatedClaimsComponent)) + return false; + RelatedClaimsComponent o = (RelatedClaimsComponent) other; + return compareDeep(claim, o.claim, true) && compareDeep(relationship, o.relationship, true) && compareDeep(reference, o.reference, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RelatedClaimsComponent)) + return false; + RelatedClaimsComponent o = (RelatedClaimsComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (claim == null || claim.isEmpty()) && (relationship == null || relationship.isEmpty()) + && (reference == null || reference.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.related"; + + } + + } + + @Block() + public static class PayeeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Type of Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of party: Subscriber, Provider, other", formalDefinition="Type of Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name = "party", type = {Identifier.class, Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Party to receive the payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Type party; + + private static final long serialVersionUID = 1304353420L; + + /** + * Constructor + */ + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Type of 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(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Type getParty() { + return this.party; + } + + /** + * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Identifier getPartyIdentifier() throws FHIRException { + if (!(this.party instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.party.getClass().getName()+" was encountered"); + return (Identifier) this.party; + } + + public boolean hasPartyIdentifier() { + return this.party instanceof Identifier; + } + + /** + * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Reference getPartyReference() throws FHIRException { + if (!(this.party instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.party.getClass().getName()+" was encountered"); + return (Reference) this.party; + } + + public boolean hasPartyReference() { + return this.party instanceof Reference; + } + + public boolean hasParty() { + return this.party != null && !this.party.isEmpty(); + } + + /** + * @param value {@link #party} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setParty(Type value) { + this.party = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("party[x]", "Identifier|Reference(Practitioner|Organization|Patient|RelatedPerson)", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, party)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 106437350: // party + this.party = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("party[x]")) + this.party = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 1189320666: return getParty(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("partyIdentifier")) { + this.party = new Identifier(); + return this.party; + } + else if (name.equals("partyReference")) { + this.party = new Reference(); + return this.party; + } + else + return super.addChild(name); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.party = party == null ? null : party.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PayeeComponent)) + return false; + PayeeComponent o = (PayeeComponent) other; + return compareDeep(type, o.type, true) && compareDeep(party, o.party, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PayeeComponent)) + return false; + PayeeComponent o = (PayeeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty()) + ; + } + + public String fhirType() { + return "ExplanationOfBenefit.payee"; + + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Sequence of diagnosis which serves to order and provide a link. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number to covey order of diagnosis", formalDefinition="Sequence of diagnosis which serves to order and provide a link." ) + protected PositiveIntType sequence; + + /** + * The diagnosis. + */ + @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -795010186L; + + /** + * Constructor + */ + public DiagnosisComponent() { + super(); + } + + /** + * Constructor + */ + public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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 which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis which serves to order and provide a link. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis which serves to order and provide a link. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + 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(); // cc + 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", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 1196993265: // diagnosis + this.diagnosis = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("diagnosis")) + this.diagnosis = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 1196993265: return getDiagnosis(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); + } + else if (name.equals("diagnosis")) { + this.diagnosis = new Coding(); + return this.diagnosis; + } + else + return super.addChild(name); + } + + 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; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DiagnosisComponent)) + return false; + DiagnosisComponent o = (DiagnosisComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DiagnosisComponent)) + return false; + DiagnosisComponent o = (DiagnosisComponent) other; + return compareValues(sequence, o.sequence, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + public String fhirType() { + return "ExplanationOfBenefit.diagnosis"; + + } + + } + + @Block() + public static class ProcedureComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Sequence of procedures which serves to order and provide a link. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Procedure sequence for reference", formalDefinition="Sequence of procedures which serves to order and provide a link." ) + protected PositiveIntType sequence; + + /** + * Date and optionally time the procedure was performed . + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the procedure was performed", formalDefinition="Date and optionally time the procedure was performed ." ) + protected DateTimeType date; + + /** + * The procedure code. + */ + @Child(name = "procedure", type = {Coding.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient's list of procedures performed", formalDefinition="The procedure code." ) + protected Type procedure; + + private static final long serialVersionUID = 864307347L; + + /** + * Constructor + */ + public ProcedureComponent() { + super(); + } + + /** + * Constructor + */ + public ProcedureComponent(PositiveIntType sequence, Type procedure) { + super(); + this.sequence = sequence; + this.procedure = procedure; + } + + /** + * @return {@link #sequence} (Sequence of procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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 procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ProcedureComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of procedures which serves to order and provide a link. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value Sequence of procedures which serves to order and provide a link. + */ + public ProcedureComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #date} (Date and optionally time the procedure was performed .). 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 ProcedureComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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} (Date and optionally time the procedure was performed .). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ProcedureComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Date and optionally time the procedure was performed . + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Date and optionally time the procedure was performed . + */ + public ProcedureComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #procedure} (The procedure code.) + */ + public Type getProcedure() { + return this.procedure; + } + + /** + * @return {@link #procedure} (The procedure code.) + */ + public Coding getProcedureCoding() throws FHIRException { + if (!(this.procedure instanceof Coding)) + throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.procedure.getClass().getName()+" was encountered"); + return (Coding) this.procedure; + } + + public boolean hasProcedureCoding() { + return this.procedure instanceof Coding; + } + + /** + * @return {@link #procedure} (The procedure code.) + */ + public Reference getProcedureReference() throws FHIRException { + if (!(this.procedure instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.procedure.getClass().getName()+" was encountered"); + return (Reference) this.procedure; + } + + public boolean hasProcedureReference() { + return this.procedure instanceof Reference; + } + + public boolean hasProcedure() { + return this.procedure != null && !this.procedure.isEmpty(); + } + + /** + * @param value {@link #procedure} (The procedure code.) + */ + public ProcedureComponent setProcedure(Type value) { + this.procedure = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "Sequence of procedures which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("date", "dateTime", "Date and optionally time the procedure was performed .", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("procedure[x]", "Coding|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : new Base[] {this.procedure}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1095204141: // procedure + this.procedure = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("procedure[x]")) + this.procedure = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1640074445: return getProcedure(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.date"); + } + else if (name.equals("procedureCoding")) { + this.procedure = new Coding(); + return this.procedure; + } + else if (name.equals("procedureReference")) { + this.procedure = new Reference(); + return this.procedure; + } + else + return super.addChild(name); + } + + public ProcedureComponent copy() { + ProcedureComponent dst = new ProcedureComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.date = date == null ? null : date.copy(); + dst.procedure = procedure == null ? null : procedure.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureComponent)) + return false; + ProcedureComponent o = (ProcedureComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(date, o.date, true) && compareDeep(procedure, o.procedure, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureComponent)) + return false; + ProcedureComponent o = (ProcedureComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (date == null || date.isEmpty()) + && (procedure == null || procedure.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.procedure"; + + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Type coverage; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name = "preAuthRef", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preAuthRef; + + private static final long serialVersionUID = -21571213L; + + /** + * Constructor + */ + public CoverageComponent() { + super(); + } + + /** + * Constructor + */ + public CoverageComponent(Type coverage) { + super(); + this.coverage = coverage; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Type getCoverage() { + return this.coverage; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Identifier getCoverageIdentifier() throws FHIRException { + if (!(this.coverage instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered"); + return (Identifier) this.coverage; + } + + public boolean hasCoverageIdentifier() { + return this.coverage instanceof Identifier; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverageReference() throws FHIRException { + if (!(this.coverage instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered"); + return (Reference) this.coverage; + } + + public boolean hasCoverageReference() { + return this.coverage instanceof Reference; + } + + 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(Type value) { + this.coverage = 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("coverage[x]", "Identifier|Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type + case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -351767064: // coverage + this.coverage = (Type) value; // Type + break; + case 522246568: // preAuthRef + this.getPreAuthRef().add(castToString(value)); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("coverage[x]")) + this.coverage = (Type) value; // Type + else if (name.equals("preAuthRef")) + this.getPreAuthRef().add(castToString(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 227689880: return getCoverage(); // Type + case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("coverageIdentifier")) { + this.coverage = new Identifier(); + return this.coverage; + } + else if (name.equals("coverageReference")) { + this.coverage = new Reference(); + return this.coverage; + } + else if (name.equals("preAuthRef")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.preAuthRef"); + } + else + return super.addChild(name); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.coverage = coverage == null ? null : coverage.copy(); + if (preAuthRef != null) { + dst.preAuthRef = new ArrayList(); + for (StringType i : preAuthRef) + dst.preAuthRef.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareDeep(coverage, o.coverage, true) && compareDeep(preAuthRef, o.preAuthRef, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CoverageComponent)) + return false; + CoverageComponent o = (CoverageComponent) other; + return compareValues(preAuthRef, o.preAuthRef, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (coverage == null || coverage.isEmpty()) && (preAuthRef == null || preAuthRef.isEmpty()) + ; + } + + public String fhirType() { + return "ExplanationOfBenefit.coverage"; + + } + + } + + @Block() + public static class OnsetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The start or start and end dates for the treatable condition. + */ + @Child(name = "time", type = {DateType.class, Period.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Illness, injury or treatable condition date", formalDefinition="The start or start and end dates for the treatable condition." ) + protected Type time; + + /** + * Onset typifications eg. Start of pregnancy, start of illnes, etc. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Onset of what", formalDefinition="Onset typifications eg. Start of pregnancy, start of illnes, etc." ) + protected Coding type; + + private static final long serialVersionUID = -560173231L; + + /** + * Constructor + */ + public OnsetComponent() { + super(); + } + + /** + * @return {@link #time} (The start or start and end dates for the treatable condition.) + */ + public Type getTime() { + return this.time; + } + + /** + * @return {@link #time} (The start or start and end dates for the treatable condition.) + */ + public DateType getTimeDateType() throws FHIRException { + if (!(this.time instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.time.getClass().getName()+" was encountered"); + return (DateType) this.time; + } + + public boolean hasTimeDateType() { + return this.time instanceof DateType; + } + + /** + * @return {@link #time} (The start or start and end dates for the treatable condition.) + */ + public Period getTimePeriod() throws FHIRException { + if (!(this.time instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.time.getClass().getName()+" was encountered"); + return (Period) this.time; + } + + public boolean hasTimePeriod() { + return this.time instanceof Period; + } + + public boolean hasTime() { + return this.time != null && !this.time.isEmpty(); + } + + /** + * @param value {@link #time} (The start or start and end dates for the treatable condition.) + */ + public OnsetComponent setTime(Type value) { + this.time = value; + return this; + } + + /** + * @return {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OnsetComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.) + */ + public OnsetComponent setType(Coding value) { + this.type = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("time[x]", "date|Period", "The start or start and end dates for the treatable condition.", 0, java.lang.Integer.MAX_VALUE, time)); + childrenList.add(new Property("type", "Coding", "Onset typifications eg. Start of pregnancy, start of illnes, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // Type + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3560141: // time + this.time = (Type) value; // Type + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("time[x]")) + this.time = (Type) value; // Type + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1313930605: return getTime(); // Type + case 3575610: return getType(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("timeDate")) { + this.time = new DateType(); + return this.time; + } + else if (name.equals("timePeriod")) { + this.time = new Period(); + return this.time; + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else + return super.addChild(name); + } + + public OnsetComponent copy() { + OnsetComponent dst = new OnsetComponent(); + copyValues(dst); + dst.time = time == null ? null : time.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OnsetComponent)) + return false; + OnsetComponent o = (OnsetComponent) other; + return compareDeep(time, o.time, true) && compareDeep(type, o.type, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OnsetComponent)) + return false; + OnsetComponent o = (OnsetComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (time == null || time.isEmpty()) && (type == null || type.isEmpty()) + ; + } + + public String fhirType() { + return "ExplanationOfBenefit.onset"; + + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @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 = {Identifier.class, Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Type provider; + + /** + * The practitioner who is supervising the work of the servicing provider(s). + */ + @Child(name = "supervisor", type = {Identifier.class, Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Supervising Practitioner", formalDefinition="The practitioner who is supervising the work of the servicing provider(s)." ) + protected Type supervisor; + + /** + * The qualification which is applicable for this service. + */ + @Child(name = "providerQualification", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." ) + protected Coding providerQualification; + + /** + * Diagnosis applicable for this service or product line. + */ + @Child(name = "diagnosisLinkId", type = {PositiveIntType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Applicable diagnoses", 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=7, min=1, max=1, modifier=false, summary=true) + @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; + + /** + * Unusual circumstances which may influence adjudication. + */ + @Child(name = "serviceModifier", type = {Coding.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Service/Product modifiers", formalDefinition="Unusual circumstances which may influence adjudication." ) + protected List serviceModifier; + + /** + * 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=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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; + + /** + * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. + */ + @Child(name = "programCode", type = {Coding.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) + protected List programCode; + + /** + * The date or dates when the enclosed suite of services were performed or completed. + */ + @Child(name = "serviced", type = {DateType.class, Period.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) + protected Type serviced; + + /** + * Where the service was provided. + */ + @Child(name = "place", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Place of service", formalDefinition="Where the service was provided." ) + protected Coding place; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected SimpleQuantity 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=14, min=0, max=1, modifier=false, summary=true) + @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=15, min=0, max=1, modifier=false, summary=true) + @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=16, min=0, max=1, modifier=false, summary=true) + @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 addittional 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=17, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected List udi; + /** + * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) + */ + protected List udiTarget; + + + /** + * Physical service site on the patient (limb, tooth, etc). + */ + @Child(name = "bodySite", type = {Coding.class}, order=19, min=0, max=1, modifier=false, summary=true) + @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=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) + protected List subSite; + + /** + * A list of note references to the notes provided below. + */ + @Child(name = "noteNumber", type = {PositiveIntType.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) + protected List noteNumber; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * Second tier of goods and services. + */ + @Child(name = "detail", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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=24, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) + protected ProsthesisComponent prosthesis; + + private static final long serialVersionUID = 2037926144L; + + /** + * Constructor + */ + public ItemsComponent() { + super(); + } + + /** + * Constructor + */ + public ItemsComponent(PositiveIntType 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 PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + 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(); // cc + 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 Type getProvider() { + return this.provider; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Identifier getProviderIdentifier() throws FHIRException { + if (!(this.provider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Identifier) this.provider; + } + + public boolean hasProviderIdentifier() { + return this.provider instanceof Identifier; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProviderReference() throws FHIRException { + if (!(this.provider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Reference) this.provider; + } + + public boolean hasProviderReference() { + return this.provider instanceof Reference; + } + + 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(Type value) { + this.provider = value; + return this; + } + + /** + * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) + */ + public Type getSupervisor() { + return this.supervisor; + } + + /** + * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) + */ + public Identifier getSupervisorIdentifier() throws FHIRException { + if (!(this.supervisor instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.supervisor.getClass().getName()+" was encountered"); + return (Identifier) this.supervisor; + } + + public boolean hasSupervisorIdentifier() { + return this.supervisor instanceof Identifier; + } + + /** + * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) + */ + public Reference getSupervisorReference() throws FHIRException { + if (!(this.supervisor instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.supervisor.getClass().getName()+" was encountered"); + return (Reference) this.supervisor; + } + + public boolean hasSupervisorReference() { + return this.supervisor instanceof Reference; + } + + public boolean hasSupervisor() { + return this.supervisor != null && !this.supervisor.isEmpty(); + } + + /** + * @param value {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) + */ + public ItemsComponent setSupervisor(Type value) { + this.supervisor = value; + return this; + } + + /** + * @return {@link #providerQualification} (The qualification which is applicable for this service.) + */ + public Coding getProviderQualification() { + if (this.providerQualification == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.providerQualification"); + else if (Configuration.doAutoCreate()) + this.providerQualification = new Coding(); // cc + return this.providerQualification; + } + + public boolean hasProviderQualification() { + return this.providerQualification != null && !this.providerQualification.isEmpty(); + } + + /** + * @param value {@link #providerQualification} (The qualification which is applicable for this service.) + */ + public ItemsComponent setProviderQualification(Coding value) { + this.providerQualification = 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 (PositiveIntType item : this.diagnosisLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + // syntactic sugar + public PositiveIntType addDiagnosisLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + 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 + PositiveIntType t = new PositiveIntType(); + 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 (PositiveIntType v : this.diagnosisLinkId) + if (v.equals(value)) // positiveInt + 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(); // cc + 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 #serviceModifier} (Unusual circumstances which may influence adjudication.) + */ + public List getServiceModifier() { + if (this.serviceModifier == null) + this.serviceModifier = new ArrayList(); + return this.serviceModifier; + } + + public boolean hasServiceModifier() { + if (this.serviceModifier == null) + return false; + for (Coding item : this.serviceModifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceModifier} (Unusual circumstances which may influence adjudication.) + */ + // syntactic sugar + public Coding addServiceModifier() { //3 + Coding t = new Coding(); + if (this.serviceModifier == null) + this.serviceModifier = new ArrayList(); + this.serviceModifier.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addServiceModifier(Coding t) { //3 + if (t == null) + return this; + if (this.serviceModifier == null) + this.serviceModifier = new ArrayList(); + this.serviceModifier.add(t); + return this; + } + + /** + * @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; + } + + // syntactic sugar + public ItemsComponent addModifier(Coding t) { //3 + if (t == null) + return this; + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return this; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + public List getProgramCode() { + if (this.programCode == null) + this.programCode = new ArrayList(); + return this.programCode; + } + + public boolean hasProgramCode() { + if (this.programCode == null) + return false; + for (Coding item : this.programCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + // syntactic sugar + public Coding addProgramCode() { //3 + Coding t = new Coding(); + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addProgramCode(Coding t) { //3 + if (t == null) + return this; + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return this; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public Type getServiced() { + return this.serviced; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public DateType getServicedDateType() throws FHIRException { + if (!(this.serviced instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered"); + return (DateType) this.serviced; + } + + public boolean hasServicedDateType() { + return this.serviced instanceof DateType; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public Period getServicedPeriod() throws FHIRException { + if (!(this.serviced instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered"); + return (Period) this.serviced; + } + + public boolean hasServicedPeriod() { + return this.serviced instanceof Period; + } + + public boolean hasServiced() { + return this.serviced != null && !this.serviced.isEmpty(); + } + + /** + * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public ItemsComponent setServiced(Type value) { + this.serviced = value; + return this; + } + + /** + * @return {@link #place} (Where the service was provided.) + */ + public Coding getPlace() { + if (this.place == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.place"); + else if (Configuration.doAutoCreate()) + this.place = new Coding(); // cc + return this.place; + } + + public boolean hasPlace() { + return this.place != null && !this.place.isEmpty(); + } + + /** + * @param value {@link #place} (Where the service was provided.) + */ + public ItemsComponent setPlace(Coding value) { + this.place = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + 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(SimpleQuantity 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(); // cc + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @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(double value) { + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @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(double value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional 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(); // cc + 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 addittional 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 List getUdi() { + if (this.udi == null) + this.udi = new ArrayList(); + return this.udi; + } + + public boolean hasUdi() { + if (this.udi == null) + return false; + for (Reference item : this.udi) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + // syntactic sugar + public Reference addUdi() { //3 + Reference t = new Reference(); + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addUdi(Reference t) { //3 + if (t == null) + return this; + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return this; + } + + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public List getUdiTarget() { + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + return this.udiTarget; + } + + // syntactic sugar + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public Device addUdiTarget() { + Device r = new Device(); + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + this.udiTarget.add(r); + return r; + } + + /** + * @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(); // cc + 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; + } + + // syntactic sugar + public ItemsComponent addSubSite(Coding t) { //3 + if (t == null) + return this; + if (this.subSite == null) + this.subSite = new ArrayList(); + this.subSite.add(t); + return this; + } + + /** + * @return {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public List getNoteNumber() { + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + return this.noteNumber; + } + + public boolean hasNoteNumber() { + if (this.noteNumber == null) + return false; + for (PositiveIntType item : this.noteNumber) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #noteNumber} (A list of note references to the notes provided below.) + */ + // syntactic sugar + public PositiveIntType addNoteNumberElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + this.noteNumber.add(t); + return t; + } + + /** + * @param value {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public ItemsComponent addNoteNumber(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + this.noteNumber.add(t); + return this; + } + + /** + * @param value {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public boolean hasNoteNumber(int value) { + if (this.noteNumber == null) + return false; + for (PositiveIntType v : this.noteNumber) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (ItemAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public ItemAdjudicationComponent addAdjudication() { //3 + ItemAdjudicationComponent t = new ItemAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public ItemsComponent addAdjudication(ItemAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + /** + * @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; + } + + // syntactic sugar + public ItemsComponent addDetail(DetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) + */ + public ProsthesisComponent getProsthesis() { + if (this.prosthesis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.prosthesis"); + else if (Configuration.doAutoCreate()) + this.prosthesis = new ProsthesisComponent(); // cc + return this.prosthesis; + } + + public boolean hasProsthesis() { + return this.prosthesis != null && !this.prosthesis.isEmpty(); + } + + /** + * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) + */ + public ItemsComponent setProsthesis(ProsthesisComponent value) { + this.prosthesis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "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[x]", "Identifier|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("supervisor[x]", "Identifier|Reference(Practitioner)", "The practitioner who is supervising the work of the servicing provider(s).", 0, java.lang.Integer.MAX_VALUE, supervisor)); + childrenList.add(new Property("providerQualification", "Coding", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, providerQualification)); + childrenList.add(new Property("diagnosisLinkId", "positiveInt", "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("serviceModifier", "Coding", "Unusual circumstances which may influence adjudication.", 0, java.lang.Integer.MAX_VALUE, serviceModifier)); + 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("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); + childrenList.add(new Property("place", "Coding", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, place)); + childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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", "Reference(Device)", "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("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type + case -1697229976: /*supervisor*/ return this.supervisor == null ? new Base[0] : new Base[] {this.supervisor}; // Type + case -1240156290: /*providerQualification*/ return this.providerQualification == null ? new Base[0] : new Base[] {this.providerQualification}; // Coding + case -1659207418: /*diagnosisLinkId*/ return this.diagnosisLinkId == null ? new Base[0] : this.diagnosisLinkId.toArray(new Base[this.diagnosisLinkId.size()]); // PositiveIntType + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 615164076: /*serviceModifier*/ return this.serviceModifier == null ? new Base[0] : this.serviceModifier.toArray(new Base[this.serviceModifier.size()]); // Coding + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type + case 106748167: /*place*/ return this.place == null ? new Base[0] : new Base[] {this.place}; // Coding + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType + case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money + case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding + case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // Coding + case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // ItemAdjudicationComponent + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailComponent + case -2138744398: /*prosthesis*/ return this.prosthesis == null ? new Base[0] : new Base[] {this.prosthesis}; // ProsthesisComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case -987494927: // provider + this.provider = (Type) value; // Type + break; + case -1697229976: // supervisor + this.supervisor = (Type) value; // Type + break; + case -1240156290: // providerQualification + this.providerQualification = castToCoding(value); // Coding + break; + case -1659207418: // diagnosisLinkId + this.getDiagnosisLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 615164076: // serviceModifier + this.getServiceModifier().add(castToCoding(value)); // Coding + break; + case -615513385: // modifier + this.getModifier().add(castToCoding(value)); // Coding + break; + case 1010065041: // programCode + this.getProgramCode().add(castToCoding(value)); // Coding + break; + case 1379209295: // serviced + this.serviced = (Type) value; // Type + break; + case 106748167: // place + this.place = castToCoding(value); // Coding + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -486196699: // unitPrice + this.unitPrice = castToMoney(value); // Money + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case -982754077: // points + this.points = castToDecimal(value); // DecimalType + break; + case 108957: // net + this.net = castToMoney(value); // Money + break; + case 115642: // udi + this.getUdi().add(castToReference(value)); // Reference + break; + case 1702620169: // bodySite + this.bodySite = castToCoding(value); // Coding + break; + case -1868566105: // subSite + this.getSubSite().add(castToCoding(value)); // Coding + break; + case -1110033957: // noteNumber + this.getNoteNumber().add(castToPositiveInt(value)); // PositiveIntType + break; + case -231349275: // adjudication + this.getAdjudication().add((ItemAdjudicationComponent) value); // ItemAdjudicationComponent + break; + case -1335224239: // detail + this.getDetail().add((DetailComponent) value); // DetailComponent + break; + case -2138744398: // prosthesis + this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("provider[x]")) + this.provider = (Type) value; // Type + else if (name.equals("supervisor[x]")) + this.supervisor = (Type) value; // Type + else if (name.equals("providerQualification")) + this.providerQualification = castToCoding(value); // Coding + else if (name.equals("diagnosisLinkId")) + this.getDiagnosisLinkId().add(castToPositiveInt(value)); + else if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("serviceModifier")) + this.getServiceModifier().add(castToCoding(value)); + else if (name.equals("modifier")) + this.getModifier().add(castToCoding(value)); + else if (name.equals("programCode")) + this.getProgramCode().add(castToCoding(value)); + else if (name.equals("serviced[x]")) + this.serviced = (Type) value; // Type + else if (name.equals("place")) + this.place = castToCoding(value); // Coding + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("unitPrice")) + this.unitPrice = castToMoney(value); // Money + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("points")) + this.points = castToDecimal(value); // DecimalType + else if (name.equals("net")) + this.net = castToMoney(value); // Money + else if (name.equals("udi")) + this.getUdi().add(castToReference(value)); + else if (name.equals("bodySite")) + this.bodySite = castToCoding(value); // Coding + else if (name.equals("subSite")) + this.getSubSite().add(castToCoding(value)); + else if (name.equals("noteNumber")) + this.getNoteNumber().add(castToPositiveInt(value)); + else if (name.equals("adjudication")) + this.getAdjudication().add((ItemAdjudicationComponent) value); + else if (name.equals("detail")) + this.getDetail().add((DetailComponent) value); + else if (name.equals("prosthesis")) + this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 3575610: return getType(); // Coding + case 2064698607: return getProvider(); // Type + case -1823115240: return getSupervisor(); // Type + case -1240156290: return getProviderQualification(); // Coding + case -1659207418: throw new FHIRException("Cannot make property diagnosisLinkId as it is not a complex type"); // PositiveIntType + case 1984153269: return getService(); // Coding + case 615164076: return addServiceModifier(); // Coding + case -615513385: return addModifier(); // Coding + case 1010065041: return addProgramCode(); // Coding + case -1927922223: return getServiced(); // Type + case 106748167: return getPlace(); // Coding + case -1285004149: return getQuantity(); // SimpleQuantity + case -486196699: return getUnitPrice(); // Money + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType + case 108957: return getNet(); // Money + case 115642: return addUdi(); // Reference + case 1702620169: return getBodySite(); // Coding + case -1868566105: return addSubSite(); // Coding + case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType + case -231349275: return addAdjudication(); // ItemAdjudicationComponent + case -1335224239: return addDetail(); // DetailComponent + case -2138744398: return getProsthesis(); // ProsthesisComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("providerIdentifier")) { + this.provider = new Identifier(); + return this.provider; + } + else if (name.equals("providerReference")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("supervisorIdentifier")) { + this.supervisor = new Identifier(); + return this.supervisor; + } + else if (name.equals("supervisorReference")) { + this.supervisor = new Reference(); + return this.supervisor; + } + else if (name.equals("providerQualification")) { + this.providerQualification = new Coding(); + return this.providerQualification; + } + else if (name.equals("diagnosisLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.diagnosisLinkId"); + } + else if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("serviceModifier")) { + return addServiceModifier(); + } + else if (name.equals("modifier")) { + return addModifier(); + } + else if (name.equals("programCode")) { + return addProgramCode(); + } + else if (name.equals("servicedDate")) { + this.serviced = new DateType(); + return this.serviced; + } + else if (name.equals("servicedPeriod")) { + this.serviced = new Period(); + return this.serviced; + } + else if (name.equals("place")) { + this.place = new Coding(); + return this.place; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("unitPrice")) { + this.unitPrice = new Money(); + return this.unitPrice; + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); + } + else if (name.equals("points")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); + } + else if (name.equals("net")) { + this.net = new Money(); + return this.net; + } + else if (name.equals("udi")) { + return addUdi(); + } + else if (name.equals("bodySite")) { + this.bodySite = new Coding(); + return this.bodySite; + } + else if (name.equals("subSite")) { + return addSubSite(); + } + else if (name.equals("noteNumber")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.noteNumber"); + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else if (name.equals("detail")) { + return addDetail(); + } + else if (name.equals("prosthesis")) { + this.prosthesis = new ProsthesisComponent(); + return this.prosthesis; + } + else + return super.addChild(name); + } + + 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(); + dst.supervisor = supervisor == null ? null : supervisor.copy(); + dst.providerQualification = providerQualification == null ? null : providerQualification.copy(); + if (diagnosisLinkId != null) { + dst.diagnosisLinkId = new ArrayList(); + for (PositiveIntType i : diagnosisLinkId) + dst.diagnosisLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + if (serviceModifier != null) { + dst.serviceModifier = new ArrayList(); + for (Coding i : serviceModifier) + dst.serviceModifier.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (programCode != null) { + dst.programCode = new ArrayList(); + for (Coding i : programCode) + dst.programCode.add(i.copy()); + }; + dst.serviced = serviced == null ? null : serviced.copy(); + dst.place = place == null ? null : place.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(); + if (udi != null) { + dst.udi = new ArrayList(); + for (Reference i : udi) + dst.udi.add(i.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 (noteNumber != null) { + dst.noteNumber = new ArrayList(); + for (PositiveIntType i : noteNumber) + dst.noteNumber.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (ItemAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + dst.prosthesis = prosthesis == null ? null : prosthesis.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true) + && compareDeep(supervisor, o.supervisor, true) && compareDeep(providerQualification, o.providerQualification, true) + && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(service, o.service, true) + && compareDeep(serviceModifier, o.serviceModifier, true) && compareDeep(modifier, o.modifier, true) + && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) && compareDeep(place, o.place, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) + && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) && compareDeep(noteNumber, o.noteNumber, true) + && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true) && compareDeep(prosthesis, o.prosthesis, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) + && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) && compareValues(noteNumber, o.noteNumber, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (provider == null || provider.isEmpty()) && (supervisor == null || supervisor.isEmpty()) + && (providerQualification == null || providerQualification.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) + && (service == null || service.isEmpty()) && (serviceModifier == null || serviceModifier.isEmpty()) + && (modifier == null || modifier.isEmpty()) && (programCode == null || programCode.isEmpty()) + && (serviced == null || serviced.isEmpty()) && (place == null || place.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()) && (noteNumber == null || noteNumber.isEmpty()) + && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) + && (prosthesis == null || prosthesis.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.item"; + + } + + } + + @Block() + public static class ItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public ItemAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public ItemAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public ItemAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public ItemAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public ItemAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ItemAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public ItemAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public ItemAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public ItemAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); + } + else + return super.addChild(name); + } + + public ItemAdjudicationComponent copy() { + ItemAdjudicationComponent dst = new ItemAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemAdjudicationComponent)) + return false; + ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemAdjudicationComponent)) + return false; + ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.item.adjudication"; + + } + + } + + @Block() + public static class DetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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; + + /** + * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. + */ + @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) + protected List programCode; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected SimpleQuantity 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=6, min=0, max=1, modifier=false, summary=true) + @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=7, min=0, max=1, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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 addittional 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, modifier=false, summary=true) + @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected List udi; + /** + * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) + */ + protected List udiTarget; + + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * Third tier of goods and services. + */ + @Child(name = "subDetail", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -240637412L; + + /** + * Constructor + */ + public DetailComponent() { + super(); + } + + /** + * Constructor + */ + public DetailComponent(PositiveIntType 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 PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + 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(); // cc + 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(); // cc + 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 #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + public List getProgramCode() { + if (this.programCode == null) + this.programCode = new ArrayList(); + return this.programCode; + } + + public boolean hasProgramCode() { + if (this.programCode == null) + return false; + for (Coding item : this.programCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + // syntactic sugar + public Coding addProgramCode() { //3 + Coding t = new Coding(); + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return t; + } + + // syntactic sugar + public DetailComponent addProgramCode(Coding t) { //3 + if (t == null) + return this; + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + 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(SimpleQuantity 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(); // cc + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @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(double value) { + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @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(double value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional 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(); // cc + 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 addittional 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 List getUdi() { + if (this.udi == null) + this.udi = new ArrayList(); + return this.udi; + } + + public boolean hasUdi() { + if (this.udi == null) + return false; + for (Reference item : this.udi) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + // syntactic sugar + public Reference addUdi() { //3 + Reference t = new Reference(); + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return t; + } + + // syntactic sugar + public DetailComponent addUdi(Reference t) { //3 + if (t == null) + return this; + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return this; + } + + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public List getUdiTarget() { + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + return this.udiTarget; + } + + // syntactic sugar + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public Device addUdiTarget() { + Device r = new Device(); + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + this.udiTarget.add(r); + return r; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (DetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public DetailAdjudicationComponent addAdjudication() { //3 + DetailAdjudicationComponent t = new DetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public DetailComponent addAdjudication(DetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + 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; + } + + // syntactic sugar + public DetailComponent addSubDetail(SubDetailComponent t) { //3 + if (t == null) + return this; + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "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("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType + case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money + case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // DetailAdjudicationComponent + case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 1010065041: // programCode + this.getProgramCode().add(castToCoding(value)); // Coding + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -486196699: // unitPrice + this.unitPrice = castToMoney(value); // Money + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case -982754077: // points + this.points = castToDecimal(value); // DecimalType + break; + case 108957: // net + this.net = castToMoney(value); // Money + break; + case 115642: // udi + this.getUdi().add(castToReference(value)); // Reference + break; + case -231349275: // adjudication + this.getAdjudication().add((DetailAdjudicationComponent) value); // DetailAdjudicationComponent + break; + case -828829007: // subDetail + this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("programCode")) + this.getProgramCode().add(castToCoding(value)); + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("unitPrice")) + this.unitPrice = castToMoney(value); // Money + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("points")) + this.points = castToDecimal(value); // DecimalType + else if (name.equals("net")) + this.net = castToMoney(value); // Money + else if (name.equals("udi")) + this.getUdi().add(castToReference(value)); + else if (name.equals("adjudication")) + this.getAdjudication().add((DetailAdjudicationComponent) value); + else if (name.equals("subDetail")) + this.getSubDetail().add((SubDetailComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 3575610: return getType(); // Coding + case 1984153269: return getService(); // Coding + case 1010065041: return addProgramCode(); // Coding + case -1285004149: return getQuantity(); // SimpleQuantity + case -486196699: return getUnitPrice(); // Money + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType + case 108957: return getNet(); // Money + case 115642: return addUdi(); // Reference + case -231349275: return addAdjudication(); // DetailAdjudicationComponent + case -828829007: return addSubDetail(); // SubDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("programCode")) { + return addProgramCode(); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("unitPrice")) { + this.unitPrice = new Money(); + return this.unitPrice; + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); + } + else if (name.equals("points")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); + } + else if (name.equals("net")) { + this.net = new Money(); + return this.net; + } + else if (name.equals("udi")) { + return addUdi(); + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else if (name.equals("subDetail")) { + return addSubDetail(); + } + else + return super.addChild(name); + } + + 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(); + if (programCode != null) { + dst.programCode = new ArrayList(); + for (Coding i : programCode) + dst.programCode.add(i.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(); + if (udi != null) { + dst.udi = new ArrayList(); + for (Reference i : udi) + dst.udi.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (DetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetailComponent)) + return false; + DetailComponent o = (DetailComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) + && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) + && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) + && compareDeep(udi, o.udi, true) && compareDeep(adjudication, o.adjudication, true) && compareDeep(subDetail, o.subDetail, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetailComponent)) + return false; + DetailComponent o = (DetailComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (programCode == null || programCode.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()) && (adjudication == null || adjudication.isEmpty()) && (subDetail == null || subDetail.isEmpty()) + ; + } + + public String fhirType() { + return "ExplanationOfBenefit.item.detail"; + + } + + } + + @Block() + public static class DetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public DetailAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public DetailAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public DetailAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public DetailAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public DetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public DetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public DetailAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public DetailAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); + } + else + return super.addChild(name); + } + + public DetailAdjudicationComponent copy() { + DetailAdjudicationComponent dst = new DetailAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetailAdjudicationComponent)) + return false; + DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetailAdjudicationComponent)) + return false; + DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.item.detail.adjudication"; + + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected PositiveIntType sequence; + + /** + * The type of product or service. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addittional service or product or charge. + */ + @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addittional service or product or charge." ) + protected Coding service; + + /** + * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. + */ + @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) + protected List programCode; + + /** + * The number of repetitions of a service or product. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected SimpleQuantity quantity; + + /** + * The fee for an addittional service or product or charge. + */ + @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addittional 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=7, min=0, max=1, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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 addittional 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, modifier=false, summary=true) + @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected List udi; + /** + * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) + */ + protected List udiTarget; + + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="SubDetail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + private static final long serialVersionUID = -1690477905L; + + /** + * Constructor + */ + public SubDetailComponent() { + super(); + } + + /** + * Constructor + */ + public SubDetailComponent(PositiveIntType 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 PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + 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(); // cc + 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 addittional 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(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addittional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + public List getProgramCode() { + if (this.programCode == null) + this.programCode = new ArrayList(); + return this.programCode; + } + + public boolean hasProgramCode() { + if (this.programCode == null) + return false; + for (Coding item : this.programCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) + */ + // syntactic sugar + public Coding addProgramCode() { //3 + Coding t = new Coding(); + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return t; + } + + // syntactic sugar + public SubDetailComponent addProgramCode(Coding t) { //3 + if (t == null) + return this; + if (this.programCode == null) + this.programCode = new ArrayList(); + this.programCode.add(t); + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + 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(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addittional 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(); // cc + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addittional 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(); // bb + 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; + } + + /** + * @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(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @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(double value) { + 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(); // bb + 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; + } + + /** + * @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(long value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @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(double value) { + this.points = new DecimalType(); + this.points.setValue(value); + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addittional 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(); // cc + 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 addittional 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 List getUdi() { + if (this.udi == null) + this.udi = new ArrayList(); + return this.udi; + } + + public boolean hasUdi() { + if (this.udi == null) + return false; + for (Reference item : this.udi) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + // syntactic sugar + public Reference addUdi() { //3 + Reference t = new Reference(); + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return t; + } + + // syntactic sugar + public SubDetailComponent addUdi(Reference t) { //3 + if (t == null) + return this; + if (this.udi == null) + this.udi = new ArrayList(); + this.udi.add(t); + return this; + } + + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public List getUdiTarget() { + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + return this.udiTarget; + } + + // syntactic sugar + /** + * @return {@link #udi} (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. List of Unique Device Identifiers associated with this line item.) + */ + public Device addUdiTarget() { + Device r = new Device(); + if (this.udiTarget == null) + this.udiTarget = new ArrayList(); + this.udiTarget.add(r); + return r; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (SubDetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public SubDetailAdjudicationComponent addAdjudication() { //3 + SubDetailAdjudicationComponent t = new SubDetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public SubDetailComponent addAdjudication(SubDetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "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 addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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 addittional 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", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType + case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money + case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // SubDetailAdjudicationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 1010065041: // programCode + this.getProgramCode().add(castToCoding(value)); // Coding + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -486196699: // unitPrice + this.unitPrice = castToMoney(value); // Money + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case -982754077: // points + this.points = castToDecimal(value); // DecimalType + break; + case 108957: // net + this.net = castToMoney(value); // Money + break; + case 115642: // udi + this.getUdi().add(castToReference(value)); // Reference + break; + case -231349275: // adjudication + this.getAdjudication().add((SubDetailAdjudicationComponent) value); // SubDetailAdjudicationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("programCode")) + this.getProgramCode().add(castToCoding(value)); + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("unitPrice")) + this.unitPrice = castToMoney(value); // Money + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("points")) + this.points = castToDecimal(value); // DecimalType + else if (name.equals("net")) + this.net = castToMoney(value); // Money + else if (name.equals("udi")) + this.getUdi().add(castToReference(value)); + else if (name.equals("adjudication")) + this.getAdjudication().add((SubDetailAdjudicationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case 3575610: return getType(); // Coding + case 1984153269: return getService(); // Coding + case 1010065041: return addProgramCode(); // Coding + case -1285004149: return getQuantity(); // SimpleQuantity + case -486196699: return getUnitPrice(); // Money + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType + case 108957: return getNet(); // Money + case 115642: return addUdi(); // Reference + case -231349275: return addAdjudication(); // SubDetailAdjudicationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("programCode")) { + return addProgramCode(); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("unitPrice")) { + this.unitPrice = new Money(); + return this.unitPrice; + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); + } + else if (name.equals("points")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); + } + else if (name.equals("net")) { + this.net = new Money(); + return this.net; + } + else if (name.equals("udi")) { + return addUdi(); + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else + return super.addChild(name); + } + + 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(); + if (programCode != null) { + dst.programCode = new ArrayList(); + for (Coding i : programCode) + dst.programCode.add(i.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(); + if (udi != null) { + dst.udi = new ArrayList(); + for (Reference i : udi) + dst.udi.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (SubDetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) + && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) + && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) + && compareDeep(udi, o.udi, true) && compareDeep(adjudication, o.adjudication, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubDetailComponent)) + return false; + SubDetailComponent o = (SubDetailComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (programCode == null || programCode.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()) && (adjudication == null || adjudication.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.item.detail.subDetail"; + + } + + } + + @Block() + public static class SubDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public SubDetailAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public SubDetailAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public SubDetailAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public SubDetailAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public SubDetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SubDetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public SubDetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public SubDetailAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public SubDetailAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); + } + else + return super.addChild(name); + } + + public SubDetailAdjudicationComponent copy() { + SubDetailAdjudicationComponent dst = new SubDetailAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubDetailAdjudicationComponent)) + return false; + SubDetailAdjudicationComponent o = (SubDetailAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubDetailAdjudicationComponent)) + return false; + SubDetailAdjudicationComponent o = (SubDetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.item.detail.subDetail.adjudication"; + + } + + } + + @Block() + public static class ProsthesisComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates whether this is the initial placement of a fixed prosthesis. + */ + @Child(name = "initial", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Is this the initial service", formalDefinition="Indicates whether this is the initial placement of a fixed prosthesis." ) + protected BooleanType initial; + + /** + * Date of the initial placement. + */ + @Child(name = "priorDate", type = {DateType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." ) + protected DateType priorDate; + + /** + * Material of the prior denture or bridge prosthesis. (Oral). + */ + @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) + protected Coding priorMaterial; + + private static final long serialVersionUID = 1739349641L; + + /** + * Constructor + */ + public ProsthesisComponent() { + super(); + } + + /** + * @return {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value + */ + public BooleanType getInitialElement() { + if (this.initial == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.initial"); + else if (Configuration.doAutoCreate()) + this.initial = new BooleanType(); // bb + return this.initial; + } + + public boolean hasInitialElement() { + return this.initial != null && !this.initial.isEmpty(); + } + + public boolean hasInitial() { + return this.initial != null && !this.initial.isEmpty(); + } + + /** + * @param value {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value + */ + public ProsthesisComponent setInitialElement(BooleanType value) { + this.initial = value; + return this; + } + + /** + * @return Indicates whether this is the initial placement of a fixed prosthesis. + */ + public boolean getInitial() { + return this.initial == null || this.initial.isEmpty() ? false : this.initial.getValue(); + } + + /** + * @param value Indicates whether this is the initial placement of a fixed prosthesis. + */ + public ProsthesisComponent setInitial(boolean value) { + if (this.initial == null) + this.initial = new BooleanType(); + this.initial.setValue(value); + return this; + } + + /** + * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value + */ + public DateType getPriorDateElement() { + if (this.priorDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.priorDate"); + else if (Configuration.doAutoCreate()) + this.priorDate = new DateType(); // bb + return this.priorDate; + } + + public boolean hasPriorDateElement() { + return this.priorDate != null && !this.priorDate.isEmpty(); + } + + public boolean hasPriorDate() { + return this.priorDate != null && !this.priorDate.isEmpty(); + } + + /** + * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value + */ + public ProsthesisComponent setPriorDateElement(DateType value) { + this.priorDate = value; + return this; + } + + /** + * @return Date of the initial placement. + */ + public Date getPriorDate() { + return this.priorDate == null ? null : this.priorDate.getValue(); + } + + /** + * @param value Date of the initial placement. + */ + public ProsthesisComponent setPriorDate(Date value) { + if (value == null) + this.priorDate = null; + else { + if (this.priorDate == null) + this.priorDate = new DateType(); + this.priorDate.setValue(value); + } + return this; + } + + /** + * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) + */ + public Coding getPriorMaterial() { + if (this.priorMaterial == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); + else if (Configuration.doAutoCreate()) + this.priorMaterial = new Coding(); // cc + return this.priorMaterial; + } + + public boolean hasPriorMaterial() { + return this.priorMaterial != null && !this.priorMaterial.isEmpty(); + } + + /** + * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) + */ + public ProsthesisComponent setPriorMaterial(Coding value) { + this.priorMaterial = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial)); + childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); + childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // BooleanType + case -1770675816: /*priorDate*/ return this.priorDate == null ? new Base[0] : new Base[] {this.priorDate}; // DateType + case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1948342084: // initial + this.initial = castToBoolean(value); // BooleanType + break; + case -1770675816: // priorDate + this.priorDate = castToDate(value); // DateType + break; + case -532999663: // priorMaterial + this.priorMaterial = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("initial")) + this.initial = castToBoolean(value); // BooleanType + else if (name.equals("priorDate")) + this.priorDate = castToDate(value); // DateType + else if (name.equals("priorMaterial")) + this.priorMaterial = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1948342084: throw new FHIRException("Cannot make property initial as it is not a complex type"); // BooleanType + case -1770675816: throw new FHIRException("Cannot make property priorDate as it is not a complex type"); // DateType + case -532999663: return getPriorMaterial(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("initial")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.initial"); + } + else if (name.equals("priorDate")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.priorDate"); + } + else if (name.equals("priorMaterial")) { + this.priorMaterial = new Coding(); + return this.priorMaterial; + } + else + return super.addChild(name); + } + + public ProsthesisComponent copy() { + ProsthesisComponent dst = new ProsthesisComponent(); + copyValues(dst); + dst.initial = initial == null ? null : initial.copy(); + dst.priorDate = priorDate == null ? null : priorDate.copy(); + dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProsthesisComponent)) + return false; + ProsthesisComponent o = (ProsthesisComponent) other; + return compareDeep(initial, o.initial, true) && compareDeep(priorDate, o.priorDate, true) && compareDeep(priorMaterial, o.priorMaterial, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProsthesisComponent)) + return false; + ProsthesisComponent o = (ProsthesisComponent) other; + return compareValues(initial, o.initial, true) && compareValues(priorDate, o.priorDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty()) + && (priorMaterial == null || priorMaterial.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.item.prosthesis"; + + } + + } + + @Block() + public static class AddedItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * List of input service items which this service line is intended to replace. + */ + @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." ) + protected List sequenceLinkId; + + /** + * A code to indicate the Professional Service or Product supplied. + */ + @Child(name = "service", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The fee charged for the professional service or product.. + */ + @Child(name = "fee", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) + protected Money fee; + + /** + * A list of note references to the notes provided below. + */ + @Child(name = "noteNumberLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) + protected List noteNumberLinkId; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The second tier service adjudications for payor added services. + */ + @Child(name = "detail", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) + protected List detail; + + private static final long serialVersionUID = -1675935854L; + + /** + * Constructor + */ + public AddedItemComponent() { + super(); + } + + /** + * Constructor + */ + public AddedItemComponent(Coding service) { + super(); + this.service = service; + } + + /** + * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public List getSequenceLinkId() { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkId() { + if (this.sequenceLinkId == null) + return false; + for (PositiveIntType item : this.sequenceLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + // syntactic sugar + public PositiveIntType addSequenceLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + this.sequenceLinkId.add(t); + return t; + } + + /** + * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public AddedItemComponent addSequenceLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + this.sequenceLinkId.add(t); + return this; + } + + /** + * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public boolean hasSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + return false; + for (PositiveIntType v : this.sequenceLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #service} (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 AddedItemComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public AddedItemComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #fee} (The fee charged for the professional service or product..) + */ + public Money getFee() { + if (this.fee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemComponent.fee"); + else if (Configuration.doAutoCreate()) + this.fee = new Money(); // cc + return this.fee; + } + + public boolean hasFee() { + return this.fee != null && !this.fee.isEmpty(); + } + + /** + * @param value {@link #fee} (The fee charged for the professional service or product..) + */ + public AddedItemComponent setFee(Money value) { + this.fee = value; + return this; + } + + /** + * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public List getNoteNumberLinkId() { + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + return this.noteNumberLinkId; + } + + public boolean hasNoteNumberLinkId() { + if (this.noteNumberLinkId == null) + return false; + for (PositiveIntType item : this.noteNumberLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + // syntactic sugar + public PositiveIntType addNoteNumberLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + this.noteNumberLinkId.add(t); + return t; + } + + /** + * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public AddedItemComponent addNoteNumberLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + this.noteNumberLinkId.add(t); + return this; + } + + /** + * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public boolean hasNoteNumberLinkId(int value) { + if (this.noteNumberLinkId == null) + return false; + for (PositiveIntType v : this.noteNumberLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (AddedItemAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public AddedItemAdjudicationComponent addAdjudication() { //3 + AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public AddedItemComponent addAdjudication(AddedItemAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + /** + * @return {@link #detail} (The second tier service adjudications for payor added 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 (AddedItemsDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (The second tier service adjudications for payor added services.) + */ + // syntactic sugar + public AddedItemsDetailComponent addDetail() { //3 + AddedItemsDetailComponent t = new AddedItemsDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public AddedItemComponent addDetail(AddedItemsDetailComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); + childrenList.add(new Property("noteNumberLinkId", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : this.sequenceLinkId.toArray(new Base[this.sequenceLinkId.size()]); // PositiveIntType + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money + case -1859667856: /*noteNumberLinkId*/ return this.noteNumberLinkId == null ? new Base[0] : this.noteNumberLinkId.toArray(new Base[this.noteNumberLinkId.size()]); // PositiveIntType + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemAdjudicationComponent + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AddedItemsDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422298666: // sequenceLinkId + this.getSequenceLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 101254: // fee + this.fee = castToMoney(value); // Money + break; + case -1859667856: // noteNumberLinkId + this.getNoteNumberLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; + case -231349275: // adjudication + this.getAdjudication().add((AddedItemAdjudicationComponent) value); // AddedItemAdjudicationComponent + break; + case -1335224239: // detail + this.getDetail().add((AddedItemsDetailComponent) value); // AddedItemsDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequenceLinkId")) + this.getSequenceLinkId().add(castToPositiveInt(value)); + else if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("fee")) + this.fee = castToMoney(value); // Money + else if (name.equals("noteNumberLinkId")) + this.getNoteNumberLinkId().add(castToPositiveInt(value)); + else if (name.equals("adjudication")) + this.getAdjudication().add((AddedItemAdjudicationComponent) value); + else if (name.equals("detail")) + this.getDetail().add((AddedItemsDetailComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType + case 1984153269: return getService(); // Coding + case 101254: return getFee(); // Money + case -1859667856: throw new FHIRException("Cannot make property noteNumberLinkId as it is not a complex type"); // PositiveIntType + case -231349275: return addAdjudication(); // AddedItemAdjudicationComponent + case -1335224239: return addDetail(); // AddedItemsDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequenceLinkId"); + } + else if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("fee")) { + this.fee = new Money(); + return this.fee; + } + else if (name.equals("noteNumberLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.noteNumberLinkId"); + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else if (name.equals("detail")) { + return addDetail(); + } + else + return super.addChild(name); + } + + public AddedItemComponent copy() { + AddedItemComponent dst = new AddedItemComponent(); + copyValues(dst); + if (sequenceLinkId != null) { + dst.sequenceLinkId = new ArrayList(); + for (PositiveIntType i : sequenceLinkId) + dst.sequenceLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.fee = fee == null ? null : fee.copy(); + if (noteNumberLinkId != null) { + dst.noteNumberLinkId = new ArrayList(); + for (PositiveIntType i : noteNumberLinkId) + dst.noteNumberLinkId.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (AddedItemAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (AddedItemsDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemComponent)) + return false; + AddedItemComponent o = (AddedItemComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(service, o.service, true) + && compareDeep(fee, o.fee, true) && compareDeep(noteNumberLinkId, o.noteNumberLinkId, true) && compareDeep(adjudication, o.adjudication, true) + && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemComponent)) + return false; + AddedItemComponent o = (AddedItemComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumberLinkId, o.noteNumberLinkId, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty()) + && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty()) + && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + public String fhirType() { + return "ExplanationOfBenefit.addItem"; + + } + + } + + @Block() + public static class AddedItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public AddedItemAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public AddedItemAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public AddedItemAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public AddedItemAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public AddedItemAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AddedItemAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); + } + else + return super.addChild(name); + } + + public AddedItemAdjudicationComponent copy() { + AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemAdjudicationComponent)) + return false; + AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemAdjudicationComponent)) + return false; + AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.addItem.adjudication"; + + } + + } + + @Block() + public static class AddedItemsDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code to indicate the Professional Service or Product supplied. + */ + @Child(name = "service", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The fee charged for the professional service or product.. + */ + @Child(name = "fee", type = {Money.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) + protected Money fee; + + /** + * The adjudications results. + */ + @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + private static final long serialVersionUID = -2104242020L; + + /** + * Constructor + */ + public AddedItemsDetailComponent() { + super(); + } + + /** + * Constructor + */ + public AddedItemsDetailComponent(Coding service) { + super(); + this.service = service; + } + + /** + * @return {@link #service} (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 AddedItemsDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); // cc + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public AddedItemsDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #fee} (The fee charged for the professional service or product..) + */ + public Money getFee() { + if (this.fee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee"); + else if (Configuration.doAutoCreate()) + this.fee = new Money(); // cc + return this.fee; + } + + public boolean hasFee() { + return this.fee != null && !this.fee.isEmpty(); + } + + /** + * @param value {@link #fee} (The fee charged for the professional service or product..) + */ + public AddedItemsDetailComponent setFee(Money value) { + this.fee = value; + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (AddedItemDetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public AddedItemDetailAdjudicationComponent addAdjudication() { //3 + AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + // syntactic sugar + public AddedItemsDetailComponent addAdjudication(AddedItemDetailAdjudicationComponent t) { //3 + if (t == null) + return this; + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding + case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money + case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemDetailAdjudicationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1984153269: // service + this.service = castToCoding(value); // Coding + break; + case 101254: // fee + this.fee = castToMoney(value); // Money + break; + case -231349275: // adjudication + this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); // AddedItemDetailAdjudicationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("service")) + this.service = castToCoding(value); // Coding + else if (name.equals("fee")) + this.fee = castToMoney(value); // Money + else if (name.equals("adjudication")) + this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1984153269: return getService(); // Coding + case 101254: return getFee(); // Money + case -231349275: return addAdjudication(); // AddedItemDetailAdjudicationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("service")) { + this.service = new Coding(); + return this.service; + } + else if (name.equals("fee")) { + this.fee = new Money(); + return this.fee; + } + else if (name.equals("adjudication")) { + return addAdjudication(); + } + else + return super.addChild(name); + } + + public AddedItemsDetailComponent copy() { + AddedItemsDetailComponent dst = new AddedItemsDetailComponent(); + copyValues(dst); + dst.service = service == null ? null : service.copy(); + dst.fee = fee == null ? null : fee.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (AddedItemDetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemsDetailComponent)) + return false; + AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; + return compareDeep(service, o.service, true) && compareDeep(fee, o.fee, true) && compareDeep(adjudication, o.adjudication, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemsDetailComponent)) + return false; + AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty()) + && (adjudication == null || adjudication.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.addItem.detail"; + + } + + } + + @Block() + public static class AddedItemDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding category; + + /** + * Adjudication reason such as limit reached. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) + protected Coding reason; + + /** + * Monitory amount associated with the code. + */ + @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -1926987562L; + + /** + * Constructor + */ + public AddedItemDetailAdjudicationComponent() { + super(); + } + + /** + * Constructor + */ + public AddedItemDetailAdjudicationComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public AddedItemDetailAdjudicationComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #reason} (Adjudication reason such as limit reached.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Adjudication reason such as limit reached.) + */ + public AddedItemDetailAdjudicationComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public AddedItemDetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemDetailAdjudicationComponent setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemDetailAdjudicationComponent setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case -934964668: return getReason(); // Coding + case -1413853096: return getAmount(); // Money + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); + } + else + return super.addChild(name); + } + + public AddedItemDetailAdjudicationComponent copy() { + AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AddedItemDetailAdjudicationComponent)) + return false; + AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; + return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) + && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AddedItemDetailAdjudicationComponent)) + return false; + AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) + && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.addItem.detail.adjudication"; + + } + + } + + @Block() + public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The code identifying which tooth is missing. + */ + @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) + protected Coding tooth; + + /** + * Missing reason may be: E-extraction, O-other. + */ + @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason for missing", formalDefinition="Missing reason may be: E-extraction, O-other." ) + protected Coding reason; + + /** + * The date of the extraction either known from records or patient reported estimate. + */ + @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date of Extraction", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) + protected DateType extractionDate; + + private static final long serialVersionUID = 352913313L; + + /** + * Constructor + */ + public MissingTeethComponent() { + super(); + } + + /** + * Constructor + */ + public MissingTeethComponent(Coding tooth) { + super(); + this.tooth = tooth; + } + + /** + * @return {@link #tooth} (The code identifying which tooth is missing.) + */ + public Coding getTooth() { + if (this.tooth == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); + else if (Configuration.doAutoCreate()) + this.tooth = new Coding(); // cc + return this.tooth; + } + + public boolean hasTooth() { + return this.tooth != null && !this.tooth.isEmpty(); + } + + /** + * @param value {@link #tooth} (The code identifying which tooth is missing.) + */ + public MissingTeethComponent setTooth(Coding value) { + this.tooth = value; + return this; + } + + /** + * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) + */ + public MissingTeethComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value + */ + public DateType getExtractionDateElement() { + if (this.extractionDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate"); + else if (Configuration.doAutoCreate()) + this.extractionDate = new DateType(); // bb + return this.extractionDate; + } + + public boolean hasExtractionDateElement() { + return this.extractionDate != null && !this.extractionDate.isEmpty(); + } + + public boolean hasExtractionDate() { + return this.extractionDate != null && !this.extractionDate.isEmpty(); + } + + /** + * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value + */ + public MissingTeethComponent setExtractionDateElement(DateType value) { + this.extractionDate = value; + return this; + } + + /** + * @return The date of the extraction either known from records or patient reported estimate. + */ + 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(Date value) { + if (value == null) + this.extractionDate = null; + else { + if (this.extractionDate == null) + this.extractionDate = new DateType(); + this.extractionDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); + childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 110545608: /*tooth*/ return this.tooth == null ? new Base[0] : new Base[] {this.tooth}; // Coding + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case 580646965: /*extractionDate*/ return this.extractionDate == null ? new Base[0] : new Base[] {this.extractionDate}; // DateType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 110545608: // tooth + this.tooth = castToCoding(value); // Coding + break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; + case 580646965: // extractionDate + this.extractionDate = castToDate(value); // DateType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("tooth")) + this.tooth = castToCoding(value); // Coding + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding + else if (name.equals("extractionDate")) + this.extractionDate = castToDate(value); // DateType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 110545608: return getTooth(); // Coding + case -934964668: return getReason(); // Coding + case 580646965: throw new FHIRException("Cannot make property extractionDate as it is not a complex type"); // DateType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("tooth")) { + this.tooth = new Coding(); + return this.tooth; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } + else if (name.equals("extractionDate")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.extractionDate"); + } + else + return super.addChild(name); + } + + public MissingTeethComponent copy() { + MissingTeethComponent dst = new MissingTeethComponent(); + copyValues(dst); + dst.tooth = tooth == null ? null : tooth.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.extractionDate = extractionDate == null ? null : extractionDate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MissingTeethComponent)) + return false; + MissingTeethComponent o = (MissingTeethComponent) other; + return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MissingTeethComponent)) + return false; + MissingTeethComponent o = (MissingTeethComponent) other; + return compareValues(extractionDate, o.extractionDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty()) + && (extractionDate == null || extractionDate.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.missingTeeth"; + + } + + } + + @Block() + public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An integer associated with each note which may be referred to from each service line item. + */ + @Child(name = "number", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." ) + protected PositiveIntType number; + + /** + * The note purpose: Print/Display. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Note explanitory text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 1768923951L; + + /** + * Constructor + */ + public NotesComponent() { + super(); + } + + /** + * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public PositiveIntType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new PositiveIntType(); // bb + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public NotesComponent setNumberElement(PositiveIntType value) { + this.number = value; + return this; + } + + /** + * @return An integer associated with each note which may be referred to from each service line item. + */ + public int getNumber() { + return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); + } + + /** + * @param value An integer associated with each note which may be referred to from each service line item. + */ + public NotesComponent setNumber(int value) { + if (this.number == null) + this.number = new PositiveIntType(); + this.number.setValue(value); + return this; + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public NotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public NotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public NotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1034364087: // number + this.number = castToPositiveInt(value); // PositiveIntType + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("number")) + this.number = castToPositiveInt(value); // PositiveIntType + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("text")) + this.text = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // PositiveIntType + case 3575610: return getType(); // Coding + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("number")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.number"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.text"); + } + else + return super.addChild(name); + } + + public NotesComponent copy() { + NotesComponent dst = new NotesComponent(); + copyValues(dst); + dst.number = number == null ? null : number.copy(); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareDeep(number, o.number, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareValues(number, o.number, true) && compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty()) + && (text == null || text.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.note"; + + } + + } + + @Block() + public static class BenefitBalanceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Dental, Vision, Medical, Pharmacy, Rehab etc. + */ + @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) + protected Coding category; + + /** + * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. + */ + @Child(name = "subCategory", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) + protected Coding subCategory; + + /** + * Network designation. + */ + @Child(name = "network", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="In or out of network", formalDefinition="Network designation." ) + protected Coding network; + + /** + * Unit designation: individual or family. + */ + @Child(name = "unit", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Individual or family", formalDefinition="Unit designation: individual or family." ) + protected Coding unit; + + /** + * The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'. + */ + @Child(name = "term", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Annual or lifetime", formalDefinition="The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'." ) + protected Coding term; + + /** + * Benefits Used to date. + */ + @Child(name = "financial", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Benefit Summary", formalDefinition="Benefits Used to date." ) + protected List financial; + + private static final long serialVersionUID = 1708176773L; + + /** + * Constructor + */ + public BenefitBalanceComponent() { + super(); + } + + /** + * Constructor + */ + public BenefitBalanceComponent(Coding category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) + */ + public Coding getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitBalanceComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Coding(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) + */ + public BenefitBalanceComponent setCategory(Coding value) { + this.category = value; + return this; + } + + /** + * @return {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) + */ + public Coding getSubCategory() { + if (this.subCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitBalanceComponent.subCategory"); + else if (Configuration.doAutoCreate()) + this.subCategory = new Coding(); // cc + return this.subCategory; + } + + public boolean hasSubCategory() { + return this.subCategory != null && !this.subCategory.isEmpty(); + } + + /** + * @param value {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) + */ + public BenefitBalanceComponent setSubCategory(Coding value) { + this.subCategory = value; + return this; + } + + /** + * @return {@link #network} (Network designation.) + */ + public Coding getNetwork() { + if (this.network == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitBalanceComponent.network"); + else if (Configuration.doAutoCreate()) + this.network = new Coding(); // cc + return this.network; + } + + public boolean hasNetwork() { + return this.network != null && !this.network.isEmpty(); + } + + /** + * @param value {@link #network} (Network designation.) + */ + public BenefitBalanceComponent setNetwork(Coding value) { + this.network = value; + return this; + } + + /** + * @return {@link #unit} (Unit designation: individual or family.) + */ + public Coding getUnit() { + if (this.unit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitBalanceComponent.unit"); + else if (Configuration.doAutoCreate()) + this.unit = new Coding(); // cc + return this.unit; + } + + public boolean hasUnit() { + return this.unit != null && !this.unit.isEmpty(); + } + + /** + * @param value {@link #unit} (Unit designation: individual or family.) + */ + public BenefitBalanceComponent setUnit(Coding value) { + this.unit = value; + return this; + } + + /** + * @return {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) + */ + public Coding getTerm() { + if (this.term == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitBalanceComponent.term"); + else if (Configuration.doAutoCreate()) + this.term = new Coding(); // cc + return this.term; + } + + public boolean hasTerm() { + return this.term != null && !this.term.isEmpty(); + } + + /** + * @param value {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) + */ + public BenefitBalanceComponent setTerm(Coding value) { + this.term = value; + return this; + } + + /** + * @return {@link #financial} (Benefits Used to date.) + */ + public List getFinancial() { + if (this.financial == null) + this.financial = new ArrayList(); + return this.financial; + } + + public boolean hasFinancial() { + if (this.financial == null) + return false; + for (BenefitComponent item : this.financial) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #financial} (Benefits Used to date.) + */ + // syntactic sugar + public BenefitComponent addFinancial() { //3 + BenefitComponent t = new BenefitComponent(); + if (this.financial == null) + this.financial = new ArrayList(); + this.financial.add(t); + return t; + } + + // syntactic sugar + public BenefitBalanceComponent addFinancial(BenefitComponent t) { //3 + if (t == null) + return this; + if (this.financial == null) + this.financial = new ArrayList(); + this.financial.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("subCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, subCategory)); + childrenList.add(new Property("network", "Coding", "Network designation.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("unit", "Coding", "Unit designation: individual or family.", 0, java.lang.Integer.MAX_VALUE, unit)); + childrenList.add(new Property("term", "Coding", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("financial", "", "Benefits Used to date.", 0, java.lang.Integer.MAX_VALUE, financial)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding + case 1365024606: /*subCategory*/ return this.subCategory == null ? new Base[0] : new Base[] {this.subCategory}; // Coding + case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // Coding + case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // Coding + case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // Coding + case 357555337: /*financial*/ return this.financial == null ? new Base[0] : this.financial.toArray(new Base[this.financial.size()]); // BenefitComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = castToCoding(value); // Coding + break; + case 1365024606: // subCategory + this.subCategory = castToCoding(value); // Coding + break; + case 1843485230: // network + this.network = castToCoding(value); // Coding + break; + case 3594628: // unit + this.unit = castToCoding(value); // Coding + break; + case 3556460: // term + this.term = castToCoding(value); // Coding + break; + case 357555337: // financial + this.getFinancial().add((BenefitComponent) value); // BenefitComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = castToCoding(value); // Coding + else if (name.equals("subCategory")) + this.subCategory = castToCoding(value); // Coding + else if (name.equals("network")) + this.network = castToCoding(value); // Coding + else if (name.equals("unit")) + this.unit = castToCoding(value); // Coding + else if (name.equals("term")) + this.term = castToCoding(value); // Coding + else if (name.equals("financial")) + this.getFinancial().add((BenefitComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: return getCategory(); // Coding + case 1365024606: return getSubCategory(); // Coding + case 1843485230: return getNetwork(); // Coding + case 3594628: return getUnit(); // Coding + case 3556460: return getTerm(); // Coding + case 357555337: return addFinancial(); // BenefitComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + this.category = new Coding(); + return this.category; + } + else if (name.equals("subCategory")) { + this.subCategory = new Coding(); + return this.subCategory; + } + else if (name.equals("network")) { + this.network = new Coding(); + return this.network; + } + else if (name.equals("unit")) { + this.unit = new Coding(); + return this.unit; + } + else if (name.equals("term")) { + this.term = new Coding(); + return this.term; + } + else if (name.equals("financial")) { + return addFinancial(); + } + else + return super.addChild(name); + } + + public BenefitBalanceComponent copy() { + BenefitBalanceComponent dst = new BenefitBalanceComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.subCategory = subCategory == null ? null : subCategory.copy(); + dst.network = network == null ? null : network.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.term = term == null ? null : term.copy(); + if (financial != null) { + dst.financial = new ArrayList(); + for (BenefitComponent i : financial) + dst.financial.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BenefitBalanceComponent)) + return false; + BenefitBalanceComponent o = (BenefitBalanceComponent) other; + return compareDeep(category, o.category, true) && compareDeep(subCategory, o.subCategory, true) + && compareDeep(network, o.network, true) && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) + && compareDeep(financial, o.financial, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BenefitBalanceComponent)) + return false; + BenefitBalanceComponent o = (BenefitBalanceComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (subCategory == null || subCategory.isEmpty()) + && (network == null || network.isEmpty()) && (unit == null || unit.isEmpty()) && (term == null || term.isEmpty()) + && (financial == null || financial.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.benefitBalance"; + + } + + } + + @Block() + public static class BenefitComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Deductable, visits, benefit amount. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Deductable, visits, benefit amount", formalDefinition="Deductable, visits, benefit amount." ) + protected Coding type; + + /** + * Benefits allowed. + */ + @Child(name = "benefit", type = {UnsignedIntType.class, Money.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefits allowed", formalDefinition="Benefits allowed." ) + protected Type benefit; + + /** + * Benefits used. + */ + @Child(name = "benefitUsed", type = {UnsignedIntType.class, Money.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Benefits used", formalDefinition="Benefits used." ) + protected Type benefitUsed; + + private static final long serialVersionUID = 1742418909L; + + /** + * Constructor + */ + public BenefitComponent() { + super(); + } + + /** + * Constructor + */ + public BenefitComponent(Coding type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Deductable, visits, benefit amount.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Deductable, visits, benefit amount.) + */ + public BenefitComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #benefit} (Benefits allowed.) + */ + public Type getBenefit() { + return this.benefit; + } + + /** + * @return {@link #benefit} (Benefits allowed.) + */ + public UnsignedIntType getBenefitUnsignedIntType() throws FHIRException { + if (!(this.benefit instanceof UnsignedIntType)) + throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.benefit.getClass().getName()+" was encountered"); + return (UnsignedIntType) this.benefit; + } + + public boolean hasBenefitUnsignedIntType() { + return this.benefit instanceof UnsignedIntType; + } + + /** + * @return {@link #benefit} (Benefits allowed.) + */ + public Money getBenefitMoney() throws FHIRException { + if (!(this.benefit instanceof Money)) + throw new FHIRException("Type mismatch: the type Money was expected, but "+this.benefit.getClass().getName()+" was encountered"); + return (Money) this.benefit; + } + + public boolean hasBenefitMoney() { + return this.benefit instanceof Money; + } + + public boolean hasBenefit() { + return this.benefit != null && !this.benefit.isEmpty(); + } + + /** + * @param value {@link #benefit} (Benefits allowed.) + */ + public BenefitComponent setBenefit(Type value) { + this.benefit = value; + return this; + } + + /** + * @return {@link #benefitUsed} (Benefits used.) + */ + public Type getBenefitUsed() { + return this.benefitUsed; + } + + /** + * @return {@link #benefitUsed} (Benefits used.) + */ + public UnsignedIntType getBenefitUsedUnsignedIntType() throws FHIRException { + if (!(this.benefitUsed instanceof UnsignedIntType)) + throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.benefitUsed.getClass().getName()+" was encountered"); + return (UnsignedIntType) this.benefitUsed; + } + + public boolean hasBenefitUsedUnsignedIntType() { + return this.benefitUsed instanceof UnsignedIntType; + } + + /** + * @return {@link #benefitUsed} (Benefits used.) + */ + public Money getBenefitUsedMoney() throws FHIRException { + if (!(this.benefitUsed instanceof Money)) + throw new FHIRException("Type mismatch: the type Money was expected, but "+this.benefitUsed.getClass().getName()+" was encountered"); + return (Money) this.benefitUsed; + } + + public boolean hasBenefitUsedMoney() { + return this.benefitUsed instanceof Money; + } + + public boolean hasBenefitUsed() { + return this.benefitUsed != null && !this.benefitUsed.isEmpty(); + } + + /** + * @param value {@link #benefitUsed} (Benefits used.) + */ + public BenefitComponent setBenefitUsed(Type value) { + this.benefitUsed = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Deductable, visits, benefit amount.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("benefit[x]", "unsignedInt|Money", "Benefits allowed.", 0, java.lang.Integer.MAX_VALUE, benefit)); + childrenList.add(new Property("benefitUsed[x]", "unsignedInt|Money", "Benefits used.", 0, java.lang.Integer.MAX_VALUE, benefitUsed)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : new Base[] {this.benefit}; // Type + case -549981964: /*benefitUsed*/ return this.benefitUsed == null ? new Base[0] : new Base[] {this.benefitUsed}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case -222710633: // benefit + this.benefit = (Type) value; // Type + break; + case -549981964: // benefitUsed + this.benefitUsed = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("benefit[x]")) + this.benefit = (Type) value; // Type + else if (name.equals("benefitUsed[x]")) + this.benefitUsed = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 952095881: return getBenefit(); // Type + case 787635980: return getBenefitUsed(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("benefitUnsignedInt")) { + this.benefit = new UnsignedIntType(); + return this.benefit; + } + else if (name.equals("benefitMoney")) { + this.benefit = new Money(); + return this.benefit; + } + else if (name.equals("benefitUsedUnsignedInt")) { + this.benefitUsed = new UnsignedIntType(); + return this.benefitUsed; + } + else if (name.equals("benefitUsedMoney")) { + this.benefitUsed = new Money(); + return this.benefitUsed; + } + else + return super.addChild(name); + } + + public BenefitComponent copy() { + BenefitComponent dst = new BenefitComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.benefit = benefit == null ? null : benefit.copy(); + dst.benefitUsed = benefitUsed == null ? null : benefitUsed.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof BenefitComponent)) + return false; + BenefitComponent o = (BenefitComponent) other; + return compareDeep(type, o.type, true) && compareDeep(benefit, o.benefit, true) && compareDeep(benefitUsed, o.benefitUsed, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof BenefitComponent)) + return false; + BenefitComponent o = (BenefitComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (benefit == null || benefit.isEmpty()) + && (benefitUsed == null || benefitUsed.isEmpty()); + } + + public String fhirType() { + return "ExplanationOfBenefit.benefitBalance.financial"; + + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name = "claim", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Claim reference", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected Type claim; + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name = "claimResponse", type = {Identifier.class, ClaimResponse.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Claim response reference", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected Type claimResponse; + + /** + * A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType. + */ + @Child(name = "subType", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Finer grained claim type information", formalDefinition="A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType." ) + protected List subType; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @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=5, min=0, max=1, modifier=false, summary=true) + @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 EOB was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when the EOB was created." ) + protected DateTimeType created; + + /** + * The billable period for which charges are being submitted. + */ + @Child(name = "billablePeriod", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Period for charge submission", formalDefinition="The billable period for which charges are being submitted." ) + protected Period billablePeriod; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The provider which is responsible for the claim. + */ + @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible provider for the claim", formalDefinition="The provider which is responsible for the claim." ) + protected Type provider; + + /** + * The provider which is responsible for the claim. + */ + @Child(name = "organization", type = {Identifier.class, Organization.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization for the claim", formalDefinition="The provider which is responsible for the claim." ) + protected Type organization; + + /** + * Facility where the services were provided. + */ + @Child(name = "facility", type = {Identifier.class, Location.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Type facility; + + /** + * Other claims which are related to this claim such as prior claim versions or for related services. + */ + @Child(name = "related", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Related Claims which may be revelant to processing this claimn", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) + protected List related; + + /** + * Prescription to support the dispensing of Pharmacy or Vision products. + */ + @Child(name = "prescription", type = {Identifier.class, MedicationOrder.class, VisionPrescription.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) + protected Type prescription; + + /** + * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. + */ + @Child(name = "originalPrescription", type = {Identifier.class, MedicationOrder.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products." ) + protected Type originalPrescription; + + /** + * The party to be reimbursed for the services. + */ + @Child(name = "payee", type = {}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payee", formalDefinition="The party to be reimbursed for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name = "referral", type = {Identifier.class, ReferralRequest.class}, order=16, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Type referral; + + /** + * **Insert definition of Occurrence codes. + */ + @Child(name = "occurrenceCode", type = {Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Occurrence Codes", formalDefinition="**Insert definition of Occurrence codes." ) + protected List occurrenceCode; + + /** + * **Insert definition of Occurrence Span codes. + */ + @Child(name = "occurenceSpanCode", type = {Coding.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Occurrence Span Codes", formalDefinition="**Insert definition of Occurrence Span codes." ) + protected List occurenceSpanCode; + + /** + * **Insert definition of Value codes. + */ + @Child(name = "valueCode", type = {Coding.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Value Codes", formalDefinition="**Insert definition of Value codes." ) + protected List valueCode; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name = "diagnosis", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * Ordered list of patient procedures performed to support the adjudication. + */ + @Child(name = "procedure", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Procedures performed", formalDefinition="Ordered list of patient procedures performed to support the adjudication." ) + protected List procedure; + + /** + * List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication. + */ + @Child(name = "specialCondition", type = {Coding.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="List of special Conditions", formalDefinition="List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication." ) + protected List specialCondition; + + /** + * Patient Resource. + */ + @Child(name = "patient", type = {Identifier.class, Patient.class}, order=23, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Type patient; + + /** + * Precedence (primary, secondary, etc.). + */ + @Child(name = "precedence", type = {PositiveIntType.class}, order=24, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Precedence (primary, secondary, etc.)", formalDefinition="Precedence (primary, secondary, etc.)." ) + protected PositiveIntType precedence; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name = "coverage", type = {}, order=25, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected CoverageComponent coverage; + + /** + * Date of an accident which these services are addressing. + */ + @Child(name = "accidentDate", type = {DateType.class}, order=26, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the accident occurred", formalDefinition="Date of an accident which these services are addressing." ) + protected DateType accidentDate; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name = "accidentType", type = {Coding.class}, order=27, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The nature of the accident", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * Accident Place. + */ + @Child(name = "accidentLocation", type = {Address.class, Location.class}, order=28, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Accident Place", formalDefinition="Accident Place." ) + protected Type accidentLocation; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name = "interventionException", type = {Coding.class}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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; + + /** + * Period, start and last dates of aspects of the Condition or related services. + */ + @Child(name = "onset", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Condition related Onset related dates and codes", formalDefinition="Period, start and last dates of aspects of the Condition or related services." ) + protected List onset; + + /** + * The start and optional end dates of when the patient was precluded from working due to the treatable condition(s). + */ + @Child(name = "employmentImpacted", type = {Period.class}, order=31, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Period unable to work", formalDefinition="The start and optional end dates of when the patient was precluded from working due to the treatable condition(s)." ) + protected Period employmentImpacted; + + /** + * The start and optional end dates of when the patient was confined to a treatment center. + */ + @Child(name = "hospitalization", type = {Period.class}, order=32, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Period in hospital", formalDefinition="The start and optional end dates of when the patient was confined to a treatment center." ) + protected Period hospitalization; + + /** + * First tier of goods and services. + */ + @Child(name = "item", type = {}, order=33, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Goods and Services", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * The first tier service adjudications for payor added services. + */ + @Child(name = "addItem", type = {}, order=34, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) + protected List addItem; + + /** + * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. + */ + @Child(name = "missingTeeth", type = {}, order=35, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) + protected List missingTeeth; + + /** + * The total cost of the services reported. + */ + @Child(name = "totalCost", type = {Money.class}, order=36, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) + protected Money totalCost; + + /** + * The amount of deductable applied which was not allocated to any particular service line. + */ + @Child(name = "unallocDeductable", type = {Money.class}, order=37, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unallocated deductable", formalDefinition="The amount of deductable applied which was not allocated to any particular service line." ) + protected Money unallocDeductable; + + /** + * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable). + */ + @Child(name = "totalBenefit", type = {Money.class}, order=38, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable)." ) + protected Money totalBenefit; + + /** + * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. + */ + @Child(name = "paymentAdjustment", type = {Money.class}, order=39, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." ) + protected Money paymentAdjustment; + + /** + * Reason for the payment adjustment. + */ + @Child(name = "paymentAdjustmentReason", type = {Coding.class}, order=40, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) + protected Coding paymentAdjustmentReason; + + /** + * Estimated payment data. + */ + @Child(name = "paymentDate", type = {DateType.class}, order=41, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." ) + protected DateType paymentDate; + + /** + * Payable less any payment adjustment. + */ + @Child(name = "paymentAmount", type = {Money.class}, order=42, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." ) + protected Money paymentAmount; + + /** + * Payment identifer. + */ + @Child(name = "paymentRef", type = {Identifier.class}, order=43, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifer." ) + protected Identifier paymentRef; + + /** + * Status of funds reservation (For provider, for Patient, None). + */ + @Child(name = "reserved", type = {Coding.class}, order=44, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) + protected Coding reserved; + + /** + * The form to be used for printing the content. + */ + @Child(name = "form", type = {Coding.class}, order=45, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Note text. + */ + @Child(name = "note", type = {}, order=46, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) + protected List note; + + /** + * Balance by Benefit Category. + */ + @Child(name = "benefitBalance", type = {}, order=47, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Balance by Benefit Category", formalDefinition="Balance by Benefit Category." ) + protected List benefitBalance; + + private static final long serialVersionUID = 1781852561L; + + /** + * Constructor + */ + public ExplanationOfBenefit() { + super(); + } + + /** + * Constructor + */ + public ExplanationOfBenefit(Type patient, CoverageComponent coverage) { + super(); + this.patient = patient; + this.coverage = coverage; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + 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 Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Type getClaim() { + return this.claim; + } + + /** + * @return {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Identifier getClaimIdentifier() throws FHIRException { + if (!(this.claim instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claim.getClass().getName()+" was encountered"); + return (Identifier) this.claim; + } + + public boolean hasClaimIdentifier() { + return this.claim instanceof Identifier; + } + + /** + * @return {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Reference getClaimReference() throws FHIRException { + if (!(this.claim instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claim.getClass().getName()+" was encountered"); + return (Reference) this.claim; + } + + public boolean hasClaimReference() { + return this.claim instanceof Reference; + } + + public boolean hasClaim() { + return this.claim != null && !this.claim.isEmpty(); + } + + /** + * @param value {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public ExplanationOfBenefit setClaim(Type value) { + this.claim = value; + return this; + } + + /** + * @return {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Type getClaimResponse() { + return this.claimResponse; + } + + /** + * @return {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Identifier getClaimResponseIdentifier() throws FHIRException { + if (!(this.claimResponse instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claimResponse.getClass().getName()+" was encountered"); + return (Identifier) this.claimResponse; + } + + public boolean hasClaimResponseIdentifier() { + return this.claimResponse instanceof Identifier; + } + + /** + * @return {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Reference getClaimResponseReference() throws FHIRException { + if (!(this.claimResponse instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claimResponse.getClass().getName()+" was encountered"); + return (Reference) this.claimResponse; + } + + public boolean hasClaimResponseReference() { + return this.claimResponse instanceof Reference; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public ExplanationOfBenefit setClaimResponse(Type value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) + */ + public List getSubType() { + if (this.subType == null) + this.subType = new ArrayList(); + return this.subType; + } + + public boolean hasSubType() { + if (this.subType == null) + return false; + for (Coding item : this.subType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) + */ + // syntactic sugar + public Coding addSubType() { //3 + Coding t = new Coding(); + if (this.subType == null) + this.subType = new ArrayList(); + this.subType.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addSubType(Coding t) { //3 + if (t == null) + return this; + if (this.subType == null) + this.subType = new ArrayList(); + this.subType.add(t); + return this; + } + + /** + * @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 ExplanationOfBenefit.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + 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 ExplanationOfBenefit 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 ExplanationOfBenefit.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 ExplanationOfBenefit setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the EOB was created.). 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 ExplanationOfBenefit.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 EOB was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public ExplanationOfBenefit setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the EOB was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the EOB was created. + */ + public ExplanationOfBenefit 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 #billablePeriod} (The billable period for which charges are being submitted.) + */ + public Period getBillablePeriod() { + if (this.billablePeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.billablePeriod"); + else if (Configuration.doAutoCreate()) + this.billablePeriod = new Period(); // cc + return this.billablePeriod; + } + + public boolean hasBillablePeriod() { + return this.billablePeriod != null && !this.billablePeriod.isEmpty(); + } + + /** + * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.) + */ + public ExplanationOfBenefit setBillablePeriod(Period value) { + this.billablePeriod = value; + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ExplanationOfBenefit setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public ExplanationOfBenefit setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the claim.) + */ + public Type getProvider() { + return this.provider; + } + + /** + * @return {@link #provider} (The provider which is responsible for the claim.) + */ + public Identifier getProviderIdentifier() throws FHIRException { + if (!(this.provider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Identifier) this.provider; + } + + public boolean hasProviderIdentifier() { + return this.provider instanceof Identifier; + } + + /** + * @return {@link #provider} (The provider which is responsible for the claim.) + */ + public Reference getProviderReference() throws FHIRException { + if (!(this.provider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Reference) this.provider; + } + + public boolean hasProviderReference() { + return this.provider instanceof Reference; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the claim.) + */ + public ExplanationOfBenefit setProvider(Type value) { + this.provider = value; + return this; + } + + /** + * @return {@link #organization} (The provider which is responsible for the claim.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The provider which is responsible for the claim.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The provider which is responsible for the claim.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The provider which is responsible for the claim.) + */ + public ExplanationOfBenefit setOrganization(Type value) { + this.organization = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Type getFacility() { + return this.facility; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Identifier getFacilityIdentifier() throws FHIRException { + if (!(this.facility instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.facility.getClass().getName()+" was encountered"); + return (Identifier) this.facility; + } + + public boolean hasFacilityIdentifier() { + return this.facility instanceof Identifier; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacilityReference() throws FHIRException { + if (!(this.facility instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.facility.getClass().getName()+" was encountered"); + return (Reference) this.facility; + } + + public boolean hasFacilityReference() { + return this.facility instanceof Reference; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public ExplanationOfBenefit setFacility(Type value) { + this.facility = value; + return this; + } + + /** + * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (RelatedClaimsComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) + */ + // syntactic sugar + public RelatedClaimsComponent addRelated() { //3 + RelatedClaimsComponent t = new RelatedClaimsComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addRelated(RelatedClaimsComponent t) { //3 + if (t == null) + return this; + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return this; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Type getPrescription() { + return this.prescription; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Identifier getPrescriptionIdentifier() throws FHIRException { + if (!(this.prescription instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.prescription.getClass().getName()+" was encountered"); + return (Identifier) this.prescription; + } + + public boolean hasPrescriptionIdentifier() { + return this.prescription instanceof Identifier; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public Reference getPrescriptionReference() throws FHIRException { + if (!(this.prescription instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.prescription.getClass().getName()+" was encountered"); + return (Reference) this.prescription; + } + + public boolean hasPrescriptionReference() { + return this.prescription instanceof Reference; + } + + public boolean hasPrescription() { + return this.prescription != null && !this.prescription.isEmpty(); + } + + /** + * @param value {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + public ExplanationOfBenefit setPrescription(Type value) { + this.prescription = value; + return this; + } + + /** + * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Type getOriginalPrescription() { + return this.originalPrescription; + } + + /** + * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Identifier getOriginalPrescriptionIdentifier() throws FHIRException { + if (!(this.originalPrescription instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.originalPrescription.getClass().getName()+" was encountered"); + return (Identifier) this.originalPrescription; + } + + public boolean hasOriginalPrescriptionIdentifier() { + return this.originalPrescription instanceof Identifier; + } + + /** + * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Reference getOriginalPrescriptionReference() throws FHIRException { + if (!(this.originalPrescription instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.originalPrescription.getClass().getName()+" was encountered"); + return (Reference) this.originalPrescription; + } + + public boolean hasOriginalPrescriptionReference() { + return this.originalPrescription instanceof Reference; + } + + public boolean hasOriginalPrescription() { + return this.originalPrescription != null && !this.originalPrescription.isEmpty(); + } + + /** + * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + */ + public ExplanationOfBenefit setOriginalPrescription(Type value) { + this.originalPrescription = value; + return this; + } + + /** + * @return {@link #payee} (The party to be reimbursed for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); // cc + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (The party to be reimbursed for the services.) + */ + public ExplanationOfBenefit 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 Type getReferral() { + return this.referral; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Identifier getReferralIdentifier() throws FHIRException { + if (!(this.referral instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.referral.getClass().getName()+" was encountered"); + return (Identifier) this.referral; + } + + public boolean hasReferralIdentifier() { + return this.referral instanceof Identifier; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferralReference() throws FHIRException { + if (!(this.referral instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.referral.getClass().getName()+" was encountered"); + return (Reference) this.referral; + } + + public boolean hasReferralReference() { + return this.referral instanceof Reference; + } + + 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 ExplanationOfBenefit setReferral(Type value) { + this.referral = value; + return this; + } + + /** + * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.) + */ + public List getOccurrenceCode() { + if (this.occurrenceCode == null) + this.occurrenceCode = new ArrayList(); + return this.occurrenceCode; + } + + public boolean hasOccurrenceCode() { + if (this.occurrenceCode == null) + return false; + for (Coding item : this.occurrenceCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.) + */ + // syntactic sugar + public Coding addOccurrenceCode() { //3 + Coding t = new Coding(); + if (this.occurrenceCode == null) + this.occurrenceCode = new ArrayList(); + this.occurrenceCode.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addOccurrenceCode(Coding t) { //3 + if (t == null) + return this; + if (this.occurrenceCode == null) + this.occurrenceCode = new ArrayList(); + this.occurrenceCode.add(t); + return this; + } + + /** + * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.) + */ + public List getOccurenceSpanCode() { + if (this.occurenceSpanCode == null) + this.occurenceSpanCode = new ArrayList(); + return this.occurenceSpanCode; + } + + public boolean hasOccurenceSpanCode() { + if (this.occurenceSpanCode == null) + return false; + for (Coding item : this.occurenceSpanCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.) + */ + // syntactic sugar + public Coding addOccurenceSpanCode() { //3 + Coding t = new Coding(); + if (this.occurenceSpanCode == null) + this.occurenceSpanCode = new ArrayList(); + this.occurenceSpanCode.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addOccurenceSpanCode(Coding t) { //3 + if (t == null) + return this; + if (this.occurenceSpanCode == null) + this.occurenceSpanCode = new ArrayList(); + this.occurenceSpanCode.add(t); + return this; + } + + /** + * @return {@link #valueCode} (**Insert definition of Value codes.) + */ + public List getValueCode() { + if (this.valueCode == null) + this.valueCode = new ArrayList(); + return this.valueCode; + } + + public boolean hasValueCode() { + if (this.valueCode == null) + return false; + for (Coding item : this.valueCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valueCode} (**Insert definition of Value codes.) + */ + // syntactic sugar + public Coding addValueCode() { //3 + Coding t = new Coding(); + if (this.valueCode == null) + this.valueCode = new ArrayList(); + this.valueCode.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addValueCode(Coding t) { //3 + if (t == null) + return this; + if (this.valueCode == null) + this.valueCode = new ArrayList(); + this.valueCode.add(t); + 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; + } + + // syntactic sugar + public ExplanationOfBenefit addDiagnosis(DiagnosisComponent t) { //3 + if (t == null) + return this; + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return this; + } + + /** + * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.) + */ + public List getProcedure() { + if (this.procedure == null) + this.procedure = new ArrayList(); + return this.procedure; + } + + public boolean hasProcedure() { + if (this.procedure == null) + return false; + for (ProcedureComponent item : this.procedure) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.) + */ + // syntactic sugar + public ProcedureComponent addProcedure() { //3 + ProcedureComponent t = new ProcedureComponent(); + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addProcedure(ProcedureComponent t) { //3 + if (t == null) + return this; + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return this; + } + + /** + * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) + */ + public List getSpecialCondition() { + if (this.specialCondition == null) + this.specialCondition = new ArrayList(); + return this.specialCondition; + } + + public boolean hasSpecialCondition() { + if (this.specialCondition == null) + return false; + for (Coding item : this.specialCondition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) + */ + // syntactic sugar + public Coding addSpecialCondition() { //3 + Coding t = new Coding(); + if (this.specialCondition == null) + this.specialCondition = new ArrayList(); + this.specialCondition.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addSpecialCondition(Coding t) { //3 + if (t == null) + return this; + if (this.specialCondition == null) + this.specialCondition = new ArrayList(); + this.specialCondition.add(t); + return this; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Type getPatient() { + return this.patient; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Identifier getPatientIdentifier() throws FHIRException { + if (!(this.patient instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.patient.getClass().getName()+" was encountered"); + return (Identifier) this.patient; + } + + public boolean hasPatientIdentifier() { + return this.patient instanceof Identifier; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatientReference() throws FHIRException { + if (!(this.patient instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.patient.getClass().getName()+" was encountered"); + return (Reference) this.patient; + } + + public boolean hasPatientReference() { + return this.patient instanceof Reference; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public ExplanationOfBenefit setPatient(Type value) { + this.patient = value; + return this; + } + + /** + * @return {@link #precedence} (Precedence (primary, secondary, etc.).). This is the underlying object with id, value and extensions. The accessor "getPrecedence" gives direct access to the value + */ + public PositiveIntType getPrecedenceElement() { + if (this.precedence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.precedence"); + else if (Configuration.doAutoCreate()) + this.precedence = new PositiveIntType(); // bb + return this.precedence; + } + + public boolean hasPrecedenceElement() { + return this.precedence != null && !this.precedence.isEmpty(); + } + + public boolean hasPrecedence() { + return this.precedence != null && !this.precedence.isEmpty(); + } + + /** + * @param value {@link #precedence} (Precedence (primary, secondary, etc.).). This is the underlying object with id, value and extensions. The accessor "getPrecedence" gives direct access to the value + */ + public ExplanationOfBenefit setPrecedenceElement(PositiveIntType value) { + this.precedence = value; + return this; + } + + /** + * @return Precedence (primary, secondary, etc.). + */ + public int getPrecedence() { + return this.precedence == null || this.precedence.isEmpty() ? 0 : this.precedence.getValue(); + } + + /** + * @param value Precedence (primary, secondary, etc.). + */ + public ExplanationOfBenefit setPrecedence(int value) { + if (this.precedence == null) + this.precedence = new PositiveIntType(); + this.precedence.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public CoverageComponent getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new CoverageComponent(); // cc + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public ExplanationOfBenefit setCoverage(CoverageComponent value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value + */ + public DateType getAccidentDateElement() { + if (this.accidentDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.accidentDate"); + else if (Configuration.doAutoCreate()) + this.accidentDate = new DateType(); // bb + return this.accidentDate; + } + + public boolean hasAccidentDateElement() { + return this.accidentDate != null && !this.accidentDate.isEmpty(); + } + + public boolean hasAccidentDate() { + return this.accidentDate != null && !this.accidentDate.isEmpty(); + } + + /** + * @param value {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value + */ + public ExplanationOfBenefit setAccidentDateElement(DateType value) { + this.accidentDate = value; + return this; + } + + /** + * @return Date of an accident which these services are addressing. + */ + public Date getAccidentDate() { + return this.accidentDate == null ? null : this.accidentDate.getValue(); + } + + /** + * @param value Date of an accident which these services are addressing. + */ + public ExplanationOfBenefit setAccidentDate(Date value) { + if (value == null) + this.accidentDate = null; + else { + if (this.accidentDate == null) + this.accidentDate = new DateType(); + this.accidentDate.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 ExplanationOfBenefit.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); // cc + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public ExplanationOfBenefit setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #accidentLocation} (Accident Place.) + */ + public Type getAccidentLocation() { + return this.accidentLocation; + } + + /** + * @return {@link #accidentLocation} (Accident Place.) + */ + public Address getAccidentLocationAddress() throws FHIRException { + if (!(this.accidentLocation instanceof Address)) + throw new FHIRException("Type mismatch: the type Address was expected, but "+this.accidentLocation.getClass().getName()+" was encountered"); + return (Address) this.accidentLocation; + } + + public boolean hasAccidentLocationAddress() { + return this.accidentLocation instanceof Address; + } + + /** + * @return {@link #accidentLocation} (Accident Place.) + */ + public Reference getAccidentLocationReference() throws FHIRException { + if (!(this.accidentLocation instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.accidentLocation.getClass().getName()+" was encountered"); + return (Reference) this.accidentLocation; + } + + public boolean hasAccidentLocationReference() { + return this.accidentLocation instanceof Reference; + } + + public boolean hasAccidentLocation() { + return this.accidentLocation != null && !this.accidentLocation.isEmpty(); + } + + /** + * @param value {@link #accidentLocation} (Accident Place.) + */ + public ExplanationOfBenefit setAccidentLocation(Type value) { + this.accidentLocation = 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; + } + + // syntactic sugar + public ExplanationOfBenefit addInterventionException(Coding t) { //3 + if (t == null) + return this; + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return this; + } + + /** + * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.) + */ + public List getOnset() { + if (this.onset == null) + this.onset = new ArrayList(); + return this.onset; + } + + public boolean hasOnset() { + if (this.onset == null) + return false; + for (OnsetComponent item : this.onset) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.) + */ + // syntactic sugar + public OnsetComponent addOnset() { //3 + OnsetComponent t = new OnsetComponent(); + if (this.onset == null) + this.onset = new ArrayList(); + this.onset.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addOnset(OnsetComponent t) { //3 + if (t == null) + return this; + if (this.onset == null) + this.onset = new ArrayList(); + this.onset.add(t); + return this; + } + + /** + * @return {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).) + */ + public Period getEmploymentImpacted() { + if (this.employmentImpacted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.employmentImpacted"); + else if (Configuration.doAutoCreate()) + this.employmentImpacted = new Period(); // cc + return this.employmentImpacted; + } + + public boolean hasEmploymentImpacted() { + return this.employmentImpacted != null && !this.employmentImpacted.isEmpty(); + } + + /** + * @param value {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).) + */ + public ExplanationOfBenefit setEmploymentImpacted(Period value) { + this.employmentImpacted = value; + return this; + } + + /** + * @return {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.) + */ + public Period getHospitalization() { + if (this.hospitalization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.hospitalization"); + else if (Configuration.doAutoCreate()) + this.hospitalization = new Period(); // cc + return this.hospitalization; + } + + public boolean hasHospitalization() { + return this.hospitalization != null && !this.hospitalization.isEmpty(); + } + + /** + * @param value {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.) + */ + public ExplanationOfBenefit setHospitalization(Period value) { + this.hospitalization = value; + return this; + } + + /** + * @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; + } + + // syntactic sugar + public ExplanationOfBenefit addItem(ItemsComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #addItem} (The first tier service adjudications for payor added services.) + */ + public List getAddItem() { + if (this.addItem == null) + this.addItem = new ArrayList(); + return this.addItem; + } + + public boolean hasAddItem() { + if (this.addItem == null) + return false; + for (AddedItemComponent item : this.addItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #addItem} (The first tier service adjudications for payor added services.) + */ + // syntactic sugar + public AddedItemComponent addAddItem() { //3 + AddedItemComponent t = new AddedItemComponent(); + if (this.addItem == null) + this.addItem = new ArrayList(); + this.addItem.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addAddItem(AddedItemComponent t) { //3 + if (t == null) + return this; + if (this.addItem == null) + this.addItem = new ArrayList(); + this.addItem.add(t); + return this; + } + + /** + * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) + */ + public List getMissingTeeth() { + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + return this.missingTeeth; + } + + public boolean hasMissingTeeth() { + if (this.missingTeeth == null) + return false; + for (MissingTeethComponent item : this.missingTeeth) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) + */ + // syntactic sugar + public MissingTeethComponent addMissingTeeth() { //3 + MissingTeethComponent t = new MissingTeethComponent(); + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + this.missingTeeth.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addMissingTeeth(MissingTeethComponent t) { //3 + if (t == null) + return this; + if (this.missingTeeth == null) + this.missingTeeth = new ArrayList(); + this.missingTeeth.add(t); + return this; + } + + /** + * @return {@link #totalCost} (The total cost of the services reported.) + */ + public Money getTotalCost() { + if (this.totalCost == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.totalCost"); + else if (Configuration.doAutoCreate()) + this.totalCost = new Money(); // cc + return this.totalCost; + } + + public boolean hasTotalCost() { + return this.totalCost != null && !this.totalCost.isEmpty(); + } + + /** + * @param value {@link #totalCost} (The total cost of the services reported.) + */ + public ExplanationOfBenefit setTotalCost(Money value) { + this.totalCost = value; + return this; + } + + /** + * @return {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) + */ + public Money getUnallocDeductable() { + if (this.unallocDeductable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.unallocDeductable"); + else if (Configuration.doAutoCreate()) + this.unallocDeductable = new Money(); // cc + return this.unallocDeductable; + } + + public boolean hasUnallocDeductable() { + return this.unallocDeductable != null && !this.unallocDeductable.isEmpty(); + } + + /** + * @param value {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) + */ + public ExplanationOfBenefit setUnallocDeductable(Money value) { + this.unallocDeductable = value; + return this; + } + + /** + * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) + */ + public Money getTotalBenefit() { + if (this.totalBenefit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.totalBenefit"); + else if (Configuration.doAutoCreate()) + this.totalBenefit = new Money(); // cc + return this.totalBenefit; + } + + public boolean hasTotalBenefit() { + return this.totalBenefit != null && !this.totalBenefit.isEmpty(); + } + + /** + * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) + */ + public ExplanationOfBenefit setTotalBenefit(Money value) { + this.totalBenefit = value; + return this; + } + + /** + * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) + */ + public Money getPaymentAdjustment() { + if (this.paymentAdjustment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentAdjustment"); + else if (Configuration.doAutoCreate()) + this.paymentAdjustment = new Money(); // cc + return this.paymentAdjustment; + } + + public boolean hasPaymentAdjustment() { + return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty(); + } + + /** + * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) + */ + public ExplanationOfBenefit setPaymentAdjustment(Money value) { + this.paymentAdjustment = value; + return this; + } + + /** + * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) + */ + public Coding getPaymentAdjustmentReason() { + if (this.paymentAdjustmentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentAdjustmentReason"); + else if (Configuration.doAutoCreate()) + this.paymentAdjustmentReason = new Coding(); // cc + return this.paymentAdjustmentReason; + } + + public boolean hasPaymentAdjustmentReason() { + return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty(); + } + + /** + * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) + */ + public ExplanationOfBenefit setPaymentAdjustmentReason(Coding value) { + this.paymentAdjustmentReason = value; + return this; + } + + /** + * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value + */ + public DateType getPaymentDateElement() { + if (this.paymentDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentDate"); + else if (Configuration.doAutoCreate()) + this.paymentDate = new DateType(); // bb + return this.paymentDate; + } + + public boolean hasPaymentDateElement() { + return this.paymentDate != null && !this.paymentDate.isEmpty(); + } + + public boolean hasPaymentDate() { + return this.paymentDate != null && !this.paymentDate.isEmpty(); + } + + /** + * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value + */ + public ExplanationOfBenefit setPaymentDateElement(DateType value) { + this.paymentDate = value; + return this; + } + + /** + * @return Estimated payment data. + */ + public Date getPaymentDate() { + return this.paymentDate == null ? null : this.paymentDate.getValue(); + } + + /** + * @param value Estimated payment data. + */ + public ExplanationOfBenefit setPaymentDate(Date value) { + if (value == null) + this.paymentDate = null; + else { + if (this.paymentDate == null) + this.paymentDate = new DateType(); + this.paymentDate.setValue(value); + } + return this; + } + + /** + * @return {@link #paymentAmount} (Payable less any payment adjustment.) + */ + public Money getPaymentAmount() { + if (this.paymentAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentAmount"); + else if (Configuration.doAutoCreate()) + this.paymentAmount = new Money(); // cc + return this.paymentAmount; + } + + public boolean hasPaymentAmount() { + return this.paymentAmount != null && !this.paymentAmount.isEmpty(); + } + + /** + * @param value {@link #paymentAmount} (Payable less any payment adjustment.) + */ + public ExplanationOfBenefit setPaymentAmount(Money value) { + this.paymentAmount = value; + return this; + } + + /** + * @return {@link #paymentRef} (Payment identifer.) + */ + public Identifier getPaymentRef() { + if (this.paymentRef == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentRef"); + else if (Configuration.doAutoCreate()) + this.paymentRef = new Identifier(); // cc + return this.paymentRef; + } + + public boolean hasPaymentRef() { + return this.paymentRef != null && !this.paymentRef.isEmpty(); + } + + /** + * @param value {@link #paymentRef} (Payment identifer.) + */ + public ExplanationOfBenefit setPaymentRef(Identifier value) { + this.paymentRef = value; + return this; + } + + /** + * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) + */ + public Coding getReserved() { + if (this.reserved == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.reserved"); + else if (Configuration.doAutoCreate()) + this.reserved = new Coding(); // cc + return this.reserved; + } + + public boolean hasReserved() { + return this.reserved != null && !this.reserved.isEmpty(); + } + + /** + * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) + */ + public ExplanationOfBenefit setReserved(Coding value) { + this.reserved = value; + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public ExplanationOfBenefit setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #note} (Note text.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (NotesComponent item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Note text.) + */ + // syntactic sugar + public NotesComponent addNote() { //3 + NotesComponent t = new NotesComponent(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addNote(NotesComponent t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #benefitBalance} (Balance by Benefit Category.) + */ + public List getBenefitBalance() { + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + return this.benefitBalance; + } + + public boolean hasBenefitBalance() { + if (this.benefitBalance == null) + return false; + for (BenefitBalanceComponent item : this.benefitBalance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #benefitBalance} (Balance by Benefit Category.) + */ + // syntactic sugar + public BenefitBalanceComponent addBenefitBalance() { //3 + BenefitBalanceComponent t = new BenefitBalanceComponent(); + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + this.benefitBalance.add(t); + return t; + } + + // syntactic sugar + public ExplanationOfBenefit addBenefitBalance(BenefitBalanceComponent t) { //3 + if (t == null) + return this; + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + this.benefitBalance.add(t); + 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("claim[x]", "Identifier|Reference(Claim)", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, claim)); + childrenList.add(new Property("claimResponse[x]", "Identifier|Reference(ClaimResponse)", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + childrenList.add(new Property("subType", "Coding", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType)); + 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 EOB was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("billablePeriod", "Period", "The billable period for which charges are being submitted.", 0, java.lang.Integer.MAX_VALUE, billablePeriod)); + 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("provider[x]", "Identifier|Reference(Practitioner)", "The provider which is responsible for the claim.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The provider which is responsible for the claim.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("facility[x]", "Identifier|Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("related", "", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, related)); + childrenList.add(new Property("prescription[x]", "Identifier|Reference(MedicationOrder|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription)); + childrenList.add(new Property("originalPrescription[x]", "Identifier|Reference(MedicationOrder)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); + childrenList.add(new Property("payee", "", "The party to be reimbursed for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral[x]", "Identifier|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("occurrenceCode", "Coding", "**Insert definition of Occurrence codes.", 0, java.lang.Integer.MAX_VALUE, occurrenceCode)); + childrenList.add(new Property("occurenceSpanCode", "Coding", "**Insert definition of Occurrence Span codes.", 0, java.lang.Integer.MAX_VALUE, occurenceSpanCode)); + childrenList.add(new Property("valueCode", "Coding", "**Insert definition of Value codes.", 0, java.lang.Integer.MAX_VALUE, valueCode)); + 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("procedure", "", "Ordered list of patient procedures performed to support the adjudication.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("specialCondition", "Coding", "List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, specialCondition)); + childrenList.add(new Property("patient[x]", "Identifier|Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("precedence", "positiveInt", "Precedence (primary, secondary, etc.).", 0, java.lang.Integer.MAX_VALUE, precedence)); + 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("accidentDate", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, accidentDate)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("accidentLocation[x]", "Address|Reference(Location)", "Accident Place.", 0, java.lang.Integer.MAX_VALUE, accidentLocation)); + 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("onset", "", "Period, start and last dates of aspects of the Condition or related services.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("employmentImpacted", "Period", "The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).", 0, java.lang.Integer.MAX_VALUE, employmentImpacted)); + childrenList.add(new Property("hospitalization", "Period", "The start and optional end dates of when the patient was confined to a treatment center.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem)); + childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth)); + childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); + childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductable applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); + childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); + childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment)); + childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason)); + childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate)); + childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount)); + childrenList.add(new Property("paymentRef", "Identifier", "Payment identifer.", 0, java.lang.Integer.MAX_VALUE, paymentRef)); + childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("benefitBalance", "", "Balance by Benefit Category.", 0, java.lang.Integer.MAX_VALUE, benefitBalance)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Type + case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Type + case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // Coding + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -332066046: /*billablePeriod*/ return this.billablePeriod == null ? new Base[0] : new Base[] {this.billablePeriod}; // Period + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Type + case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // RelatedClaimsComponent + case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Type + case -1814015861: /*originalPrescription*/ return this.originalPrescription == null ? new Base[0] : new Base[] {this.originalPrescription}; // Type + case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // PayeeComponent + case -722568291: /*referral*/ return this.referral == null ? new Base[0] : new Base[] {this.referral}; // Type + case 1721744222: /*occurrenceCode*/ return this.occurrenceCode == null ? new Base[0] : this.occurrenceCode.toArray(new Base[this.occurrenceCode.size()]); // Coding + case -556690898: /*occurenceSpanCode*/ return this.occurenceSpanCode == null ? new Base[0] : this.occurenceSpanCode.toArray(new Base[this.occurenceSpanCode.size()]); // Coding + case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // Coding + case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent + case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // ProcedureComponent + case -481489822: /*specialCondition*/ return this.specialCondition == null ? new Base[0] : this.specialCondition.toArray(new Base[this.specialCondition.size()]); // Coding + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Type + case 159695370: /*precedence*/ return this.precedence == null ? new Base[0] : new Base[] {this.precedence}; // PositiveIntType + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // CoverageComponent + case -63170979: /*accidentDate*/ return this.accidentDate == null ? new Base[0] : new Base[] {this.accidentDate}; // DateType + case -62671383: /*accidentType*/ return this.accidentType == null ? new Base[0] : new Base[] {this.accidentType}; // Coding + case -1074014492: /*accidentLocation*/ return this.accidentLocation == null ? new Base[0] : new Base[] {this.accidentLocation}; // Type + case 1753076536: /*interventionException*/ return this.interventionException == null ? new Base[0] : this.interventionException.toArray(new Base[this.interventionException.size()]); // Coding + case 105901603: /*onset*/ return this.onset == null ? new Base[0] : this.onset.toArray(new Base[this.onset.size()]); // OnsetComponent + case 1051487345: /*employmentImpacted*/ return this.employmentImpacted == null ? new Base[0] : new Base[] {this.employmentImpacted}; // Period + case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // Period + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent + case -1148899500: /*addItem*/ return this.addItem == null ? new Base[0] : this.addItem.toArray(new Base[this.addItem.size()]); // AddedItemComponent + case -1157130302: /*missingTeeth*/ return this.missingTeeth == null ? new Base[0] : this.missingTeeth.toArray(new Base[this.missingTeeth.size()]); // MissingTeethComponent + case -577782479: /*totalCost*/ return this.totalCost == null ? new Base[0] : new Base[] {this.totalCost}; // Money + case 2096309753: /*unallocDeductable*/ return this.unallocDeductable == null ? new Base[0] : new Base[] {this.unallocDeductable}; // Money + case 332332211: /*totalBenefit*/ return this.totalBenefit == null ? new Base[0] : new Base[] {this.totalBenefit}; // Money + case 856402963: /*paymentAdjustment*/ return this.paymentAdjustment == null ? new Base[0] : new Base[] {this.paymentAdjustment}; // Money + case -1386508233: /*paymentAdjustmentReason*/ return this.paymentAdjustmentReason == null ? new Base[0] : new Base[] {this.paymentAdjustmentReason}; // Coding + case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateType + case 909332990: /*paymentAmount*/ return this.paymentAmount == null ? new Base[0] : new Base[] {this.paymentAmount}; // Money + case 1612875949: /*paymentRef*/ return this.paymentRef == null ? new Base[0] : new Base[] {this.paymentRef}; // Identifier + case -350385368: /*reserved*/ return this.reserved == null ? new Base[0] : new Base[] {this.reserved}; // Coding + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NotesComponent + case 596003397: /*benefitBalance*/ return this.benefitBalance == null ? new Base[0] : this.benefitBalance.toArray(new Base[this.benefitBalance.size()]); // BenefitBalanceComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 94742588: // claim + this.claim = (Type) value; // Type + break; + case 689513629: // claimResponse + this.claimResponse = (Type) value; // Type + break; + case -1868521062: // subType + this.getSubType().add(castToCoding(value)); // Coding + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case -332066046: // billablePeriod + this.billablePeriod = castToPeriod(value); // Period + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; + case -987494927: // provider + this.provider = (Type) value; // Type + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case 501116579: // facility + this.facility = (Type) value; // Type + break; + case 1090493483: // related + this.getRelated().add((RelatedClaimsComponent) value); // RelatedClaimsComponent + break; + case 460301338: // prescription + this.prescription = (Type) value; // Type + break; + case -1814015861: // originalPrescription + this.originalPrescription = (Type) value; // Type + break; + case 106443592: // payee + this.payee = (PayeeComponent) value; // PayeeComponent + break; + case -722568291: // referral + this.referral = (Type) value; // Type + break; + case 1721744222: // occurrenceCode + this.getOccurrenceCode().add(castToCoding(value)); // Coding + break; + case -556690898: // occurenceSpanCode + this.getOccurenceSpanCode().add(castToCoding(value)); // Coding + break; + case -766209282: // valueCode + this.getValueCode().add(castToCoding(value)); // Coding + break; + case 1196993265: // diagnosis + this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent + break; + case -1095204141: // procedure + this.getProcedure().add((ProcedureComponent) value); // ProcedureComponent + break; + case -481489822: // specialCondition + this.getSpecialCondition().add(castToCoding(value)); // Coding + break; + case -791418107: // patient + this.patient = (Type) value; // Type + break; + case 159695370: // precedence + this.precedence = castToPositiveInt(value); // PositiveIntType + break; + case -351767064: // coverage + this.coverage = (CoverageComponent) value; // CoverageComponent + break; + case -63170979: // accidentDate + this.accidentDate = castToDate(value); // DateType + break; + case -62671383: // accidentType + this.accidentType = castToCoding(value); // Coding + break; + case -1074014492: // accidentLocation + this.accidentLocation = (Type) value; // Type + break; + case 1753076536: // interventionException + this.getInterventionException().add(castToCoding(value)); // Coding + break; + case 105901603: // onset + this.getOnset().add((OnsetComponent) value); // OnsetComponent + break; + case 1051487345: // employmentImpacted + this.employmentImpacted = castToPeriod(value); // Period + break; + case 1057894634: // hospitalization + this.hospitalization = castToPeriod(value); // Period + break; + case 3242771: // item + this.getItem().add((ItemsComponent) value); // ItemsComponent + break; + case -1148899500: // addItem + this.getAddItem().add((AddedItemComponent) value); // AddedItemComponent + break; + case -1157130302: // missingTeeth + this.getMissingTeeth().add((MissingTeethComponent) value); // MissingTeethComponent + break; + case -577782479: // totalCost + this.totalCost = castToMoney(value); // Money + break; + case 2096309753: // unallocDeductable + this.unallocDeductable = castToMoney(value); // Money + break; + case 332332211: // totalBenefit + this.totalBenefit = castToMoney(value); // Money + break; + case 856402963: // paymentAdjustment + this.paymentAdjustment = castToMoney(value); // Money + break; + case -1386508233: // paymentAdjustmentReason + this.paymentAdjustmentReason = castToCoding(value); // Coding + break; + case -1540873516: // paymentDate + this.paymentDate = castToDate(value); // DateType + break; + case 909332990: // paymentAmount + this.paymentAmount = castToMoney(value); // Money + break; + case 1612875949: // paymentRef + this.paymentRef = castToIdentifier(value); // Identifier + break; + case -350385368: // reserved + this.reserved = castToCoding(value); // Coding + break; + case 3148996: // form + this.form = castToCoding(value); // Coding + break; + case 3387378: // note + this.getNote().add((NotesComponent) value); // NotesComponent + break; + case 596003397: // benefitBalance + this.getBenefitBalance().add((BenefitBalanceComponent) value); // BenefitBalanceComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("claim[x]")) + this.claim = (Type) value; // Type + else if (name.equals("claimResponse[x]")) + this.claimResponse = (Type) value; // Type + else if (name.equals("subType")) + this.getSubType().add(castToCoding(value)); + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("billablePeriod")) + this.billablePeriod = castToPeriod(value); // Period + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType + else if (name.equals("provider[x]")) + this.provider = (Type) value; // Type + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("facility[x]")) + this.facility = (Type) value; // Type + else if (name.equals("related")) + this.getRelated().add((RelatedClaimsComponent) value); + else if (name.equals("prescription[x]")) + this.prescription = (Type) value; // Type + else if (name.equals("originalPrescription[x]")) + this.originalPrescription = (Type) value; // Type + else if (name.equals("payee")) + this.payee = (PayeeComponent) value; // PayeeComponent + else if (name.equals("referral[x]")) + this.referral = (Type) value; // Type + else if (name.equals("occurrenceCode")) + this.getOccurrenceCode().add(castToCoding(value)); + else if (name.equals("occurenceSpanCode")) + this.getOccurenceSpanCode().add(castToCoding(value)); + else if (name.equals("valueCode")) + this.getValueCode().add(castToCoding(value)); + else if (name.equals("diagnosis")) + this.getDiagnosis().add((DiagnosisComponent) value); + else if (name.equals("procedure")) + this.getProcedure().add((ProcedureComponent) value); + else if (name.equals("specialCondition")) + this.getSpecialCondition().add(castToCoding(value)); + else if (name.equals("patient[x]")) + this.patient = (Type) value; // Type + else if (name.equals("precedence")) + this.precedence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("coverage")) + this.coverage = (CoverageComponent) value; // CoverageComponent + else if (name.equals("accidentDate")) + this.accidentDate = castToDate(value); // DateType + else if (name.equals("accidentType")) + this.accidentType = castToCoding(value); // Coding + else if (name.equals("accidentLocation[x]")) + this.accidentLocation = (Type) value; // Type + else if (name.equals("interventionException")) + this.getInterventionException().add(castToCoding(value)); + else if (name.equals("onset")) + this.getOnset().add((OnsetComponent) value); + else if (name.equals("employmentImpacted")) + this.employmentImpacted = castToPeriod(value); // Period + else if (name.equals("hospitalization")) + this.hospitalization = castToPeriod(value); // Period + else if (name.equals("item")) + this.getItem().add((ItemsComponent) value); + else if (name.equals("addItem")) + this.getAddItem().add((AddedItemComponent) value); + else if (name.equals("missingTeeth")) + this.getMissingTeeth().add((MissingTeethComponent) value); + else if (name.equals("totalCost")) + this.totalCost = castToMoney(value); // Money + else if (name.equals("unallocDeductable")) + this.unallocDeductable = castToMoney(value); // Money + else if (name.equals("totalBenefit")) + this.totalBenefit = castToMoney(value); // Money + else if (name.equals("paymentAdjustment")) + this.paymentAdjustment = castToMoney(value); // Money + else if (name.equals("paymentAdjustmentReason")) + this.paymentAdjustmentReason = castToCoding(value); // Coding + else if (name.equals("paymentDate")) + this.paymentDate = castToDate(value); // DateType + else if (name.equals("paymentAmount")) + this.paymentAmount = castToMoney(value); // Money + else if (name.equals("paymentRef")) + this.paymentRef = castToIdentifier(value); // Identifier + else if (name.equals("reserved")) + this.reserved = castToCoding(value); // Coding + else if (name.equals("form")) + this.form = castToCoding(value); // Coding + else if (name.equals("note")) + this.getNote().add((NotesComponent) value); + else if (name.equals("benefitBalance")) + this.getBenefitBalance().add((BenefitBalanceComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 683016900: return getClaim(); // Type + case -1527963965: return getClaimResponse(); // Type + case -1868521062: return addSubType(); // Coding + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -332066046: return getBillablePeriod(); // Period + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType + case 2064698607: return getProvider(); // Type + case 1326483053: return getOrganization(); // Type + case -542224643: return getFacility(); // Type + case 1090493483: return addRelated(); // RelatedClaimsComponent + case -993324506: return getPrescription(); // Type + case -2067905515: return getOriginalPrescription(); // Type + case 106443592: return getPayee(); // PayeeComponent + case 344221635: return getReferral(); // Type + case 1721744222: return addOccurrenceCode(); // Coding + case -556690898: return addOccurenceSpanCode(); // Coding + case -766209282: return addValueCode(); // Coding + case 1196993265: return addDiagnosis(); // DiagnosisComponent + case -1095204141: return addProcedure(); // ProcedureComponent + case -481489822: return addSpecialCondition(); // Coding + case -2061246629: return getPatient(); // Type + case 159695370: throw new FHIRException("Cannot make property precedence as it is not a complex type"); // PositiveIntType + case -351767064: return getCoverage(); // CoverageComponent + case -63170979: throw new FHIRException("Cannot make property accidentDate as it is not a complex type"); // DateType + case -62671383: return getAccidentType(); // Coding + case 1540715292: return getAccidentLocation(); // Type + case 1753076536: return addInterventionException(); // Coding + case 105901603: return addOnset(); // OnsetComponent + case 1051487345: return getEmploymentImpacted(); // Period + case 1057894634: return getHospitalization(); // Period + case 3242771: return addItem(); // ItemsComponent + case -1148899500: return addAddItem(); // AddedItemComponent + case -1157130302: return addMissingTeeth(); // MissingTeethComponent + case -577782479: return getTotalCost(); // Money + case 2096309753: return getUnallocDeductable(); // Money + case 332332211: return getTotalBenefit(); // Money + case 856402963: return getPaymentAdjustment(); // Money + case -1386508233: return getPaymentAdjustmentReason(); // Coding + case -1540873516: throw new FHIRException("Cannot make property paymentDate as it is not a complex type"); // DateType + case 909332990: return getPaymentAmount(); // Money + case 1612875949: return getPaymentRef(); // Identifier + case -350385368: return getReserved(); // Coding + case 3148996: return getForm(); // Coding + case 3387378: return addNote(); // NotesComponent + case 596003397: return addBenefitBalance(); // BenefitBalanceComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("claimIdentifier")) { + this.claim = new Identifier(); + return this.claim; + } + else if (name.equals("claimReference")) { + this.claim = new Reference(); + return this.claim; + } + else if (name.equals("claimResponseIdentifier")) { + this.claimResponse = new Identifier(); + return this.claimResponse; + } + else if (name.equals("claimResponseReference")) { + this.claimResponse = new Reference(); + return this.claimResponse; + } + else if (name.equals("subType")) { + return addSubType(); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.created"); + } + else if (name.equals("billablePeriod")) { + this.billablePeriod = new Period(); + return this.billablePeriod; + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.disposition"); + } + else if (name.equals("providerIdentifier")) { + this.provider = new Identifier(); + return this.provider; + } + else if (name.equals("providerReference")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("facilityIdentifier")) { + this.facility = new Identifier(); + return this.facility; + } + else if (name.equals("facilityReference")) { + this.facility = new Reference(); + return this.facility; + } + else if (name.equals("related")) { + return addRelated(); + } + else if (name.equals("prescriptionIdentifier")) { + this.prescription = new Identifier(); + return this.prescription; + } + else if (name.equals("prescriptionReference")) { + this.prescription = new Reference(); + return this.prescription; + } + else if (name.equals("originalPrescriptionIdentifier")) { + this.originalPrescription = new Identifier(); + return this.originalPrescription; + } + else if (name.equals("originalPrescriptionReference")) { + this.originalPrescription = new Reference(); + return this.originalPrescription; + } + else if (name.equals("payee")) { + this.payee = new PayeeComponent(); + return this.payee; + } + else if (name.equals("referralIdentifier")) { + this.referral = new Identifier(); + return this.referral; + } + else if (name.equals("referralReference")) { + this.referral = new Reference(); + return this.referral; + } + else if (name.equals("occurrenceCode")) { + return addOccurrenceCode(); + } + else if (name.equals("occurenceSpanCode")) { + return addOccurenceSpanCode(); + } + else if (name.equals("valueCode")) { + return addValueCode(); + } + else if (name.equals("diagnosis")) { + return addDiagnosis(); + } + else if (name.equals("procedure")) { + return addProcedure(); + } + else if (name.equals("specialCondition")) { + return addSpecialCondition(); + } + else if (name.equals("patientIdentifier")) { + this.patient = new Identifier(); + return this.patient; + } + else if (name.equals("patientReference")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("precedence")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.precedence"); + } + else if (name.equals("coverage")) { + this.coverage = new CoverageComponent(); + return this.coverage; + } + else if (name.equals("accidentDate")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.accidentDate"); + } + else if (name.equals("accidentType")) { + this.accidentType = new Coding(); + return this.accidentType; + } + else if (name.equals("accidentLocationAddress")) { + this.accidentLocation = new Address(); + return this.accidentLocation; + } + else if (name.equals("accidentLocationReference")) { + this.accidentLocation = new Reference(); + return this.accidentLocation; + } + else if (name.equals("interventionException")) { + return addInterventionException(); + } + else if (name.equals("onset")) { + return addOnset(); + } + else if (name.equals("employmentImpacted")) { + this.employmentImpacted = new Period(); + return this.employmentImpacted; + } + else if (name.equals("hospitalization")) { + this.hospitalization = new Period(); + return this.hospitalization; + } + else if (name.equals("item")) { + return addItem(); + } + else if (name.equals("addItem")) { + return addAddItem(); + } + else if (name.equals("missingTeeth")) { + return addMissingTeeth(); + } + else if (name.equals("totalCost")) { + this.totalCost = new Money(); + return this.totalCost; + } + else if (name.equals("unallocDeductable")) { + this.unallocDeductable = new Money(); + return this.unallocDeductable; + } + else if (name.equals("totalBenefit")) { + this.totalBenefit = new Money(); + return this.totalBenefit; + } + else if (name.equals("paymentAdjustment")) { + this.paymentAdjustment = new Money(); + return this.paymentAdjustment; + } + else if (name.equals("paymentAdjustmentReason")) { + this.paymentAdjustmentReason = new Coding(); + return this.paymentAdjustmentReason; + } + else if (name.equals("paymentDate")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.paymentDate"); + } + else if (name.equals("paymentAmount")) { + this.paymentAmount = new Money(); + return this.paymentAmount; + } + else if (name.equals("paymentRef")) { + this.paymentRef = new Identifier(); + return this.paymentRef; + } + else if (name.equals("reserved")) { + this.reserved = new Coding(); + return this.reserved; + } + else if (name.equals("form")) { + this.form = new Coding(); + return this.form; + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("benefitBalance")) { + return addBenefitBalance(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ExplanationOfBenefit"; + + } + + public ExplanationOfBenefit copy() { + ExplanationOfBenefit dst = new ExplanationOfBenefit(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.claim = claim == null ? null : claim.copy(); + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + if (subType != null) { + dst.subType = new ArrayList(); + for (Coding i : subType) + dst.subType.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.billablePeriod = billablePeriod == null ? null : billablePeriod.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.facility = facility == null ? null : facility.copy(); + if (related != null) { + dst.related = new ArrayList(); + for (RelatedClaimsComponent i : related) + dst.related.add(i.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 (occurrenceCode != null) { + dst.occurrenceCode = new ArrayList(); + for (Coding i : occurrenceCode) + dst.occurrenceCode.add(i.copy()); + }; + if (occurenceSpanCode != null) { + dst.occurenceSpanCode = new ArrayList(); + for (Coding i : occurenceSpanCode) + dst.occurenceSpanCode.add(i.copy()); + }; + if (valueCode != null) { + dst.valueCode = new ArrayList(); + for (Coding i : valueCode) + dst.valueCode.add(i.copy()); + }; + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (procedure != null) { + dst.procedure = new ArrayList(); + for (ProcedureComponent i : procedure) + dst.procedure.add(i.copy()); + }; + if (specialCondition != null) { + dst.specialCondition = new ArrayList(); + for (Coding i : specialCondition) + dst.specialCondition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.precedence = precedence == null ? null : precedence.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.accidentDate = accidentDate == null ? null : accidentDate.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + dst.accidentLocation = accidentLocation == null ? null : accidentLocation.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (onset != null) { + dst.onset = new ArrayList(); + for (OnsetComponent i : onset) + dst.onset.add(i.copy()); + }; + dst.employmentImpacted = employmentImpacted == null ? null : employmentImpacted.copy(); + dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (addItem != null) { + dst.addItem = new ArrayList(); + for (AddedItemComponent i : addItem) + dst.addItem.add(i.copy()); + }; + if (missingTeeth != null) { + dst.missingTeeth = new ArrayList(); + for (MissingTeethComponent i : missingTeeth) + dst.missingTeeth.add(i.copy()); + }; + dst.totalCost = totalCost == null ? null : totalCost.copy(); + dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); + dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); + dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy(); + dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy(); + dst.paymentDate = paymentDate == null ? null : paymentDate.copy(); + dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy(); + dst.paymentRef = paymentRef == null ? null : paymentRef.copy(); + dst.reserved = reserved == null ? null : reserved.copy(); + dst.form = form == null ? null : form.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (NotesComponent i : note) + dst.note.add(i.copy()); + }; + if (benefitBalance != null) { + dst.benefitBalance = new ArrayList(); + for (BenefitBalanceComponent i : benefitBalance) + dst.benefitBalance.add(i.copy()); + }; + return dst; + } + + protected ExplanationOfBenefit typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ExplanationOfBenefit)) + return false; + ExplanationOfBenefit o = (ExplanationOfBenefit) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(claim, o.claim, true) && compareDeep(claimResponse, o.claimResponse, true) + && compareDeep(subType, o.subType, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(billablePeriod, o.billablePeriod, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) + && compareDeep(facility, o.facility, true) && compareDeep(related, o.related, true) && compareDeep(prescription, o.prescription, true) + && compareDeep(originalPrescription, o.originalPrescription, true) && compareDeep(payee, o.payee, true) + && compareDeep(referral, o.referral, true) && compareDeep(occurrenceCode, o.occurrenceCode, true) + && compareDeep(occurenceSpanCode, o.occurenceSpanCode, true) && compareDeep(valueCode, o.valueCode, true) + && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(specialCondition, o.specialCondition, true) + && compareDeep(patient, o.patient, true) && compareDeep(precedence, o.precedence, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(accidentDate, o.accidentDate, true) && compareDeep(accidentType, o.accidentType, true) + && compareDeep(accidentLocation, o.accidentLocation, true) && compareDeep(interventionException, o.interventionException, true) + && compareDeep(onset, o.onset, true) && compareDeep(employmentImpacted, o.employmentImpacted, true) + && compareDeep(hospitalization, o.hospitalization, true) && compareDeep(item, o.item, true) && compareDeep(addItem, o.addItem, true) + && compareDeep(missingTeeth, o.missingTeeth, true) && compareDeep(totalCost, o.totalCost, true) + && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true) + && compareDeep(paymentAdjustment, o.paymentAdjustment, true) && compareDeep(paymentAdjustmentReason, o.paymentAdjustmentReason, true) + && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(paymentAmount, o.paymentAmount, true) + && compareDeep(paymentRef, o.paymentRef, true) && compareDeep(reserved, o.reserved, true) && compareDeep(form, o.form, true) + && compareDeep(note, o.note, true) && compareDeep(benefitBalance, o.benefitBalance, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ExplanationOfBenefit)) + return false; + ExplanationOfBenefit o = (ExplanationOfBenefit) other; + return compareValues(created, o.created, true) && compareValues(disposition, o.disposition, true) && compareValues(precedence, o.precedence, true) + && compareValues(accidentDate, o.accidentDate, true) && compareValues(paymentDate, o.paymentDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (claim == null || claim.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (subType == null || subType.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + && (created == null || created.isEmpty()) && (billablePeriod == null || billablePeriod.isEmpty()) + && (disposition == null || disposition.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (facility == null || facility.isEmpty()) + && (related == null || related.isEmpty()) && (prescription == null || prescription.isEmpty()) + && (originalPrescription == null || originalPrescription.isEmpty()) && (payee == null || payee.isEmpty()) + && (referral == null || referral.isEmpty()) && (occurrenceCode == null || occurrenceCode.isEmpty()) + && (occurenceSpanCode == null || occurenceSpanCode.isEmpty()) && (valueCode == null || valueCode.isEmpty()) + && (diagnosis == null || diagnosis.isEmpty()) && (procedure == null || procedure.isEmpty()) + && (specialCondition == null || specialCondition.isEmpty()) && (patient == null || patient.isEmpty()) + && (precedence == null || precedence.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (accidentDate == null || accidentDate.isEmpty()) && (accidentType == null || accidentType.isEmpty()) + && (accidentLocation == null || accidentLocation.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (onset == null || onset.isEmpty()) && (employmentImpacted == null || employmentImpacted.isEmpty()) + && (hospitalization == null || hospitalization.isEmpty()) && (item == null || item.isEmpty()) + && (addItem == null || addItem.isEmpty()) && (missingTeeth == null || missingTeeth.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()) + && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty()) + && (benefitBalance == null || benefitBalance.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ExplanationOfBenefit; + } + + /** + * Search parameter: patientidentifier + *

+ * Description: The reference to the patient
+ * Type: token
+ * Path: ExplanationOfBenefit.patientIdentifier
+ *

+ */ + @SearchParamDefinition(name="patientidentifier", path="ExplanationOfBenefit.patient.as(Identifier)", description="The reference to the patient", type="token" ) + public static final String SP_PATIENTIDENTIFIER = "patientidentifier"; + /** + * Fluent Client search parameter constant for patientidentifier + *

+ * Description: The reference to the patient
+ * Type: token
+ * Path: ExplanationOfBenefit.patientIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATIENTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATIENTIDENTIFIER); + + /** + * Search parameter: claimindentifier + *

+ * Description: The reference to the claim
+ * Type: token
+ * Path: ExplanationOfBenefit.claimIdentifier
+ *

+ */ + @SearchParamDefinition(name="claimindentifier", path="ExplanationOfBenefit.claim.as(Identifier)", description="The reference to the claim", type="token" ) + public static final String SP_CLAIMINDENTIFIER = "claimindentifier"; + /** + * Fluent Client search parameter constant for claimindentifier + *

+ * Description: The reference to the claim
+ * Type: token
+ * Path: ExplanationOfBenefit.claimIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLAIMINDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLAIMINDENTIFIER); + + /** + * Search parameter: facilityreference + *

+ * Description: Facility responsible for the goods and services
+ * Type: reference
+ * Path: ExplanationOfBenefit.facilityReference
+ *

+ */ + @SearchParamDefinition(name="facilityreference", path="ExplanationOfBenefit.facility.as(Reference)", description="Facility responsible for the goods and services", type="reference" ) + public static final String SP_FACILITYREFERENCE = "facilityreference"; + /** + * Fluent Client search parameter constant for facilityreference + *

+ * Description: Facility responsible for the goods and services
+ * Type: reference
+ * Path: ExplanationOfBenefit.facilityReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITYREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ExplanationOfBenefit:facilityreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITYREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:facilityreference").toLocked(); + + /** + * Search parameter: providerreference + *

+ * Description: The reference to the provider
+ * Type: reference
+ * Path: ExplanationOfBenefit.providerReference
+ *

+ */ + @SearchParamDefinition(name="providerreference", path="ExplanationOfBenefit.provider.as(Reference)", description="The reference to the provider", type="reference" ) + public static final String SP_PROVIDERREFERENCE = "providerreference"; + /** + * Fluent Client search parameter constant for providerreference + *

+ * Description: The reference to the provider
+ * Type: reference
+ * Path: ExplanationOfBenefit.providerReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ExplanationOfBenefit:providerreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:providerreference").toLocked(); + + /** + * Search parameter: facilityidentifier + *

+ * Description: Facility responsible for the goods and services
+ * Type: token
+ * Path: ExplanationOfBenefit.facilityIdentifier
+ *

+ */ + @SearchParamDefinition(name="facilityidentifier", path="ExplanationOfBenefit.facility.as(Identifier)", description="Facility responsible for the goods and services", type="token" ) + public static final String SP_FACILITYIDENTIFIER = "facilityidentifier"; + /** + * Fluent Client search parameter constant for facilityidentifier + *

+ * Description: Facility responsible for the goods and services
+ * Type: token
+ * Path: ExplanationOfBenefit.facilityIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITYIDENTIFIER); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The reference to the providing organization
+ * Type: token
+ * Path: ExplanationOfBenefit.organizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="ExplanationOfBenefit.organization.as(Identifier)", description="The reference to the providing organization", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The reference to the providing organization
+ * Type: token
+ * Path: ExplanationOfBenefit.organizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: patientreference + *

+ * Description: The reference to the patient
+ * Type: reference
+ * Path: ExplanationOfBenefit.patientReference
+ *

+ */ + @SearchParamDefinition(name="patientreference", path="ExplanationOfBenefit.patient.as(Reference)", description="The reference to the patient", type="reference" ) + public static final String SP_PATIENTREFERENCE = "patientreference"; + /** + * Fluent Client search parameter constant for patientreference + *

+ * Description: The reference to the patient
+ * Type: reference
+ * Path: ExplanationOfBenefit.patientReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENTREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ExplanationOfBenefit:patientreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENTREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:patientreference").toLocked(); + + /** + * Search parameter: created + *

+ * Description: The creation date for the EOB
+ * Type: date
+ * Path: ExplanationOfBenefit.created
+ *

+ */ + @SearchParamDefinition(name="created", path="ExplanationOfBenefit.created", description="The creation date for the EOB", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: The creation date for the EOB
+ * Type: date
+ * Path: ExplanationOfBenefit.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: organizationreference + *

+ * Description: The reference to the providing organization
+ * Type: reference
+ * Path: ExplanationOfBenefit.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="ExplanationOfBenefit.organization.as(Reference)", description="The reference to the providing organization", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The reference to the providing organization
+ * Type: reference
+ * Path: ExplanationOfBenefit.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ExplanationOfBenefit:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:organizationreference").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The business identifier of the Explanation of Benefit
+ * Type: token
+ * Path: ExplanationOfBenefit.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ExplanationOfBenefit.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier of the Explanation of Benefit
+ * Type: token
+ * Path: ExplanationOfBenefit.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: disposition + *

+ * Description: The contents of the disposition message
+ * Type: string
+ * Path: ExplanationOfBenefit.disposition
+ *

+ */ + @SearchParamDefinition(name="disposition", path="ExplanationOfBenefit.disposition", description="The contents of the disposition message", type="string" ) + public static final String SP_DISPOSITION = "disposition"; + /** + * Fluent Client search parameter constant for disposition + *

+ * Description: The contents of the disposition message
+ * Type: string
+ * Path: ExplanationOfBenefit.disposition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); + + /** + * Search parameter: provideridentifier + *

+ * Description: The reference to the provider
+ * Type: token
+ * Path: ExplanationOfBenefit.providerIdentifier
+ *

+ */ + @SearchParamDefinition(name="provideridentifier", path="ExplanationOfBenefit.provider.as(Identifier)", description="The reference to the provider", type="token" ) + public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; + /** + * Fluent Client search parameter constant for provideridentifier + *

+ * Description: The reference to the provider
+ * Type: token
+ * Path: ExplanationOfBenefit.providerIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); + + /** + * Search parameter: claimreference + *

+ * Description: The reference to the claim
+ * Type: reference
+ * Path: ExplanationOfBenefit.claimReference
+ *

+ */ + @SearchParamDefinition(name="claimreference", path="ExplanationOfBenefit.claim.as(Reference)", description="The reference to the claim", type="reference" ) + public static final String SP_CLAIMREFERENCE = "claimreference"; + /** + * Fluent Client search parameter constant for claimreference + *

+ * Description: The reference to the claim
+ * Type: reference
+ * Path: ExplanationOfBenefit.claimReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CLAIMREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CLAIMREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ExplanationOfBenefit:claimreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CLAIMREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:claimreference").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExpressionNode.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExpressionNode.java new file mode 100644 index 00000000000..f23451375d6 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExpressionNode.java @@ -0,0 +1,631 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.hl7.fhir.utilities.Utilities; + +public class ExpressionNode { + + public enum Kind { + Name, Function, Constant, Group + } + public static class SourceLocation { + private int line; + private int column; + public SourceLocation(int line, int column) { + super(); + this.line = line; + this.column = column; + } + public int getLine() { + return line; + } + public int getColumn() { + return column; + } + public void setLine(int line) { + this.line = line; + } + public void setColumn(int column) { + this.column = column; + } + + public String toString() { + return Integer.toString(line)+", "+Integer.toString(column); + } + } + public enum Function { + Custom, + + Empty, Not, Exists, SubsetOf, SupersetOf, IsDistinct, Distinct, Count, Where, Select, All, Repeat, Item /*implicit from name[]*/, As, Is, Single, + First, Last, Tail, Skip, Take, Iif, ToInteger, ToDecimal, ToString, Substring, StartsWith, EndsWith, Matches, ReplaceMatches, Contains, Replace, Length, + Children, Descendents, MemberOf, Trace, Today, Now, Resolve, Extension; + + public static Function fromCode(String name) { + if (name.equals("empty")) return Function.Empty; + if (name.equals("not")) return Function.Not; + if (name.equals("exists")) return Function.Exists; + if (name.equals("subsetOf")) return Function.SubsetOf; + if (name.equals("supersetOf")) return Function.SupersetOf; + if (name.equals("isDistinct")) return Function.IsDistinct; + if (name.equals("distinct")) return Function.Distinct; + if (name.equals("count")) return Function.Count; + if (name.equals("where")) return Function.Where; + if (name.equals("select")) return Function.Select; + if (name.equals("all")) return Function.All; + if (name.equals("repeat")) return Function.Repeat; + if (name.equals("item")) return Function.Item; + if (name.equals("as")) return Function.As; + if (name.equals("is")) return Function.Is; + if (name.equals("single")) return Function.Single; + if (name.equals("first")) return Function.First; + if (name.equals("last")) return Function.Last; + if (name.equals("tail")) return Function.Tail; + if (name.equals("skip")) return Function.Skip; + if (name.equals("take")) return Function.Take; + if (name.equals("iif")) return Function.Iif; + if (name.equals("toInteger")) return Function.ToInteger; + if (name.equals("toDecimal")) return Function.ToDecimal; + if (name.equals("toString")) return Function.ToString; + if (name.equals("substring")) return Function.Substring; + if (name.equals("startsWith")) return Function.StartsWith; + if (name.equals("endsWith")) return Function.EndsWith; + if (name.equals("matches")) return Function.Matches; + if (name.equals("replaceMatches")) return Function.ReplaceMatches; + if (name.equals("contains")) return Function.Contains; + if (name.equals("replace")) return Function.Replace; + if (name.equals("length")) return Function.Length; + if (name.equals("children")) return Function.Children; + if (name.equals("descendents")) return Function.Descendents; + if (name.equals("memberOf")) return Function.MemberOf; + if (name.equals("trace")) return Function.Trace; + if (name.equals("today")) return Function.Today; + if (name.equals("now")) return Function.Now; + if (name.equals("resolve")) return Function.Resolve; + if (name.equals("extension")) return Function.Extension; + return null; + } + public String toCode() { + switch (this) { + case Empty : return "empty"; + case Not : return "not"; + case Exists : return "exists"; + case SubsetOf : return "subsetOf"; + case SupersetOf : return "supersetOf"; + case IsDistinct : return "isDistinct"; + case Distinct : return "distinct"; + case Count : return "count"; + case Where : return "where"; + case Select : return "select"; + case All : return "all"; + case Repeat : return "repeat"; + case Item : return "item"; + case As : return "as"; + case Is : return "is"; + case Single : return "single"; + case First : return "first"; + case Last : return "last"; + case Tail : return "tail"; + case Skip : return "skip"; + case Take : return "take"; + case Iif : return "iif"; + case ToInteger : return "toInteger"; + case ToDecimal : return "toDecimal"; + case ToString : return "toString"; + case Substring : return "substring"; + case StartsWith : return "startsWith"; + case EndsWith : return "endsWith"; + case Matches : return "matches"; + case ReplaceMatches : return "replaceMatches"; + case Contains : return "contains"; + case Replace : return "replace"; + case Length : return "length"; + case Children : return "children"; + case Descendents : return "descendents"; + case MemberOf : return "memberOf"; + case Trace : return "trace"; + case Today : return "today"; + case Now : return "now"; + case Resolve : return "resolve"; + case Extension : return "extension"; + default: return "??"; + } + } + } + + public enum Operation { + Equals, Equivalent, NotEquals, NotEquivalent, LessThen, Greater, LessOrEqual, GreaterOrEqual, Is, As, Union, Or, And, Xor, Implies, + Times, DivideBy, Plus, Minus, Concatenate, Div, Mod, In, Contains; + + public static Operation fromCode(String name) { + if (Utilities.noString(name)) + return null; + if (name.equals("=")) + return Operation.Equals; + if (name.equals("~")) + return Operation.Equivalent; + if (name.equals("!=")) + return Operation.NotEquals; + if (name.equals("!~")) + return Operation.NotEquivalent; + if (name.equals(">")) + return Operation.Greater; + if (name.equals("<")) + return Operation.LessThen; + if (name.equals(">=")) + return Operation.GreaterOrEqual; + if (name.equals("<=")) + return Operation.LessOrEqual; + if (name.equals("|")) + return Operation.Union; + if (name.equals("or")) + return Operation.Or; + if (name.equals("and")) + return Operation.And; + if (name.equals("xor")) + return Operation.Xor; + if (name.equals("is")) + return Operation.Is; + if (name.equals("as")) + return Operation.As; + if (name.equals("*")) + return Operation.Times; + if (name.equals("/")) + return Operation.DivideBy; + if (name.equals("+")) + return Operation.Plus; + if (name.equals("-")) + return Operation.Minus; + if (name.equals("&")) + return Operation.Concatenate; + if (name.equals("implies")) + return Operation.Implies; + if (name.equals("div")) + return Operation.Div; + if (name.equals("mod")) + return Operation.Mod; + if (name.equals("in")) + return Operation.In; + if (name.equals("contains")) + return Operation.Contains; + return null; + + } + public String toCode() { + switch (this) { + case Equals : return "="; + case Equivalent : return "~"; + case NotEquals : return "!="; + case NotEquivalent : return "!~"; + case Greater : return ">"; + case LessThen : return "<"; + case GreaterOrEqual : return ">="; + case LessOrEqual : return "<="; + case Union : return "|"; + case Or : return "or"; + case And : return "and"; + case Xor : return "xor"; + case Times : return "*"; + case DivideBy : return "/"; + case Plus : return "+"; + case Minus : return "-"; + case Concatenate : return "&"; + case Implies : return "implies"; + case Is : return "is"; + case As : return "as"; + case Div : return "div"; + case Mod : return "mod"; + case In : return "in"; + case Contains : return "contains"; + default: return "??"; + } + } + } + + public enum CollectionStatus { + SINGLETON, ORDERED, UNORDERED + } + + public static class TypeDetails { + private Set types = new HashSet(); + private CollectionStatus collectionStatus; + public TypeDetails(CollectionStatus collectionStatus, String... names) { + super(); + this.collectionStatus = collectionStatus; + for (String n : names) + this.types.add(n); + } + public TypeDetails(CollectionStatus collectionStatus, Set names) { + super(); + this.collectionStatus = collectionStatus; + for (String n : names) + this.types.add(n); + } + public void addType(String n) { + this.types.add(n); + } + public void addTypes(Collection n) { + this.types.addAll(n); + } + public boolean hasType(String... tn) { + for (String t: tn) + if (types.contains(t)) + return true; + return false; + } + public void update(TypeDetails source) { + types.addAll(source.types); + if (collectionStatus == null) + collectionStatus = source.collectionStatus; + else if (source.collectionStatus == CollectionStatus.UNORDERED) + collectionStatus = source.collectionStatus; + else + collectionStatus = CollectionStatus.ORDERED; + } + public TypeDetails union(TypeDetails right) { + TypeDetails result = new TypeDetails(null); + if (right.collectionStatus == CollectionStatus.UNORDERED || collectionStatus == CollectionStatus.UNORDERED) + result.collectionStatus = CollectionStatus.UNORDERED; + else + result.collectionStatus = CollectionStatus.ORDERED; + result.types.addAll(types); + result.types.addAll(right.types); + return result; + } + + public boolean hasNoTypes() { + return types.isEmpty(); + } + public Set getTypes() { + return types; + } + public TypeDetails toSingleton() { + TypeDetails result = new TypeDetails(CollectionStatus.SINGLETON); + result.types.addAll(types); + return result; + } + public CollectionStatus getCollectionStatus() { + return collectionStatus; + } + public boolean hasType(Set tn) { + for (String t: tn) + if (types.contains(t)) + return true; + return false; + } + public String describe() { + return types.toString(); + } + public String getType() { + for (String t : types) + return t; + return null; + } + + } + + + //the expression will have one of either name or constant + private String uniqueId; + private Kind kind; + private String name; + private String constant; + private Function function; + private List parameters; // will be created if there is a function + private ExpressionNode inner; + private ExpressionNode group; + private Operation operation; + private boolean proximal; // a proximal operation is the first in the sequence of operations. This is significant when evaluating the outcomes + private ExpressionNode opNext; + private SourceLocation start; + private SourceLocation end; + private SourceLocation opStart; + private SourceLocation opEnd; + private TypeDetails types; + private TypeDetails opTypes; + + + public ExpressionNode(int uniqueId) { + super(); + this.uniqueId = Integer.toString(uniqueId); + } + + public String toString() { + StringBuilder b = new StringBuilder(); + switch (kind) { + case Name: + b.append(name); + break; + case Function: + if (function == Function.Item) + b.append("["); + else { + b.append(name); + b.append("("); + } + boolean first = true; + for (ExpressionNode n : parameters) { + if (first) + first = false; + else + b.append(", "); + b.append(n.toString()); + } + if (function == Function.Item) + b.append("]"); + else { + b.append(")"); + } + break; + case Constant: + b.append(Utilities.escapeJava(constant)); + break; + case Group: + b.append("("); + b.append(group.toString()); + b.append(")"); + } + if (inner != null) { + b.append("."); + b.append(inner.toString()); + } + if (operation != null) { + b.append(" "); + b.append(operation.toCode()); + b.append(" "); + b.append(opNext.toString()); + } + + return b.toString(); + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getConstant() { + return constant; + } + public void setConstant(String constant) { + this.constant = constant; + } + public Function getFunction() { + return function; + } + public void setFunction(Function function) { + this.function = function; + if (parameters == null) + parameters = new ArrayList(); + } + + public boolean isProximal() { + return proximal; + } + public void setProximal(boolean proximal) { + this.proximal = proximal; + } + public Operation getOperation() { + return operation; + } + public void setOperation(Operation operation) { + this.operation = operation; + } + public ExpressionNode getInner() { + return inner; + } + public void setInner(ExpressionNode value) { + this.inner = value; + } + public ExpressionNode getOpNext() { + return opNext; + } + public void setOpNext(ExpressionNode value) { + this.opNext = value; + } + public List getParameters() { + return parameters; + } + public boolean checkName() { + if (!name.startsWith("$")) + return true; + else + return name.equals("$this"); + } + + public Kind getKind() { + return kind; + } + + public void setKind(Kind kind) { + this.kind = kind; + } + + public ExpressionNode getGroup() { + return group; + } + + public void setGroup(ExpressionNode group) { + this.group = group; + } + + public SourceLocation getStart() { + return start; + } + + public void setStart(SourceLocation start) { + this.start = start; + } + + public SourceLocation getEnd() { + return end; + } + + public void setEnd(SourceLocation end) { + this.end = end; + } + + public SourceLocation getOpStart() { + return opStart; + } + + public void setOpStart(SourceLocation opStart) { + this.opStart = opStart; + } + + public SourceLocation getOpEnd() { + return opEnd; + } + + public void setOpEnd(SourceLocation opEnd) { + this.opEnd = opEnd; + } + + public String getUniqueId() { + return uniqueId; + } + + + public int parameterCount() { + if (parameters == null) + return 0; + else + return parameters.size(); + } + + public String Canonical() { + StringBuilder b = new StringBuilder(); + write(b); + return b.toString(); + } + + public String summary() { + switch (kind) { + case Name: return uniqueId+": "+name; + case Function: return uniqueId+": "+function.toString()+"()"; + case Constant: return uniqueId+": "+constant; + case Group: return uniqueId+": (Group)"; + } + return "??"; + } + + private void write(StringBuilder b) { + + switch (kind) { + case Name: + b.append(name); + break; + case Constant: + b.append(constant); + break; + case Function: + b.append(function.toCode()); + b.append('('); + boolean f = true; + for (ExpressionNode n : parameters) { + if (f) + f = false; + else + b.append(", "); + n.write(b); + } + b.append(')'); + + break; + case Group: + b.append('('); + group.write(b); + b.append(')'); + } + + if (inner != null) { + b.append('.'); + inner.write(b); + } + if (operation != null) { + b.append(' '); + b.append(operation.toCode()); + b.append(' '); + opNext.write(b); + } + } + + public String check() { + + switch (kind) { + case Name: + if (Utilities.noString(name)) + return "No Name provided @ "+location(); + break; + + case Function: + if (function == null) + return "No Function id provided @ "+location(); + for (ExpressionNode n : parameters) { + String msg = n.check(); + if (msg != null) + return msg; + } + + break; + + case Constant: + if (Utilities.noString(constant)) + return "No Constant provided @ "+location(); + break; + + case Group: + if (group == null) + return "No Group provided @ "+location(); + else { + String msg = group.check(); + if (msg != null) + return msg; + } + } + if (inner != null) { + String msg = inner.check(); + if (msg != null) + return msg; + } + if (operation == null) { + + if (opNext != null) + return "Next provided when it shouldn't be @ "+location(); + } + else { + if (opNext == null) + return "No Next provided @ "+location(); + else + opNext.check(); + } + return null; + + } + + private String location() { + return Integer.toString(start.line)+", "+Integer.toString(start.column); + } + + public TypeDetails getTypes() { + return types; + } + + public void setTypes(TypeDetails types) { + this.types = types; + } + + public TypeDetails getOpTypes() { + return opTypes; + } + + public void setOpTypes(TypeDetails opTypes) { + this.opTypes = opTypes; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Extension.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Extension.java new file mode 100644 index 00000000000..ac06bff2f06 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Extension.java @@ -0,0 +1,394 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseDatatype; +import org.hl7.fhir.instance.model.api.IBaseExtension; +import org.hl7.fhir.instance.model.api.IBaseHasExtensions; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * Optional Extensions Element - found in all resources. + */ +@DatatypeDef(name="Extension") +public class Extension extends BaseExtension implements IBaseExtension, IBaseHasExtensions { + + /** + * Source of the definition for the extension code - a logical name or a URL. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="identifies the meaning of the extension", formalDefinition="Source of the definition for the extension code - a logical name or a URL." ) + protected UriType url; + + /** + * Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list). + */ + @Child(name = "value", type = {}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Value of extension", formalDefinition="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." ) + protected org.hl7.fhir.dstu2016may.model.Type value; + + private static final long serialVersionUID = 1240831878L; + + /** + * Constructor + */ + public Extension() { + super(); + } + + /** + * Constructor + */ + public Extension(UriType url) { + super(); + this.url = url; + } + + /** + * Constructor + */ + public Extension(String theUrl) { + setUrl(theUrl); + } + + /** + * Constructor + */ + public Extension(String theUrl, IBaseDatatype theValue) { + setUrl(theUrl); + setValue(theValue); + } + + /** + * @return {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Extension.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Extension setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return Source of the definition for the extension code - a logical name or a URL. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value Source of the definition for the extension code - a logical name or a URL. + */ + public Extension setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) + */ + public org.hl7.fhir.dstu2016may.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) + */ + public Extension setValue(org.hl7.fhir.dstu2016may.model.Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "Source of the definition for the extension code - a logical name or a URL.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("value[x]", "*", "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu2016may.model.Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 111972721: // value + this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("value[x]")) + this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1410166417: return getValue(); // org.hl7.fhir.dstu2016may.model.Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Extension.url"); + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDecimal")) { + this.value = new DecimalType(); + return this.value; + } + else if (name.equals("valueBase64Binary")) { + this.value = new Base64BinaryType(); + return this.value; + } + else if (name.equals("valueInstant")) { + this.value = new InstantType(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueUri")) { + this.value = new UriType(); + return this.value; + } + else if (name.equals("valueDate")) { + this.value = new DateType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueCode")) { + this.value = new CodeType(); + return this.value; + } + else if (name.equals("valueOid")) { + this.value = new OidType(); + return this.value; + } + else if (name.equals("valueId")) { + this.value = new IdType(); + return this.value; + } + else if (name.equals("valueUnsignedInt")) { + this.value = new UnsignedIntType(); + return this.value; + } + else if (name.equals("valuePositiveInt")) { + this.value = new PositiveIntType(); + return this.value; + } + else if (name.equals("valueMarkdown")) { + this.value = new MarkdownType(); + return this.value; + } + else if (name.equals("valueAnnotation")) { + this.value = new Annotation(); + return this.value; + } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueIdentifier")) { + this.value = new Identifier(); + return this.value; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueCoding")) { + this.value = new Coding(); + return this.value; + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else if (name.equals("valueRatio")) { + this.value = new Ratio(); + return this.value; + } + else if (name.equals("valueSampledData")) { + this.value = new SampledData(); + return this.value; + } + else if (name.equals("valueSignature")) { + this.value = new Signature(); + return this.value; + } + else if (name.equals("valueHumanName")) { + this.value = new HumanName(); + return this.value; + } + else if (name.equals("valueAddress")) { + this.value = new Address(); + return this.value; + } + else if (name.equals("valueContactPoint")) { + this.value = new ContactPoint(); + return this.value; + } + else if (name.equals("valueTiming")) { + this.value = new Timing(); + return this.value; + } + else if (name.equals("valueReference")) { + this.value = new Reference(); + return this.value; + } + else if (name.equals("valueMeta")) { + this.value = new Meta(); + return this.value; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Extension"; + + } + + public Extension copy() { + Extension dst = new Extension(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + protected Extension typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Extension)) + return false; + Extension o = (Extension) other; + return compareDeep(url, o.url, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Extension)) + return false; + Extension o = (Extension) other; + return compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExtensionHelper.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExtensionHelper.java new file mode 100644 index 00000000000..624cbfd2637 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ExtensionHelper.java @@ -0,0 +1,148 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.exceptions.FHIRException; + +/** + * in a language with helper classes, this would be a helper class (at least, the base exgtension helpers would be) + * @author Grahame + * + */ +public class ExtensionHelper { + + + /** + * @param name the identity of the extension of interest + * @return true if the named extension is on this element. Will check modifier extensions too if appropriate + */ + public static boolean hasExtension(Element element, String name) { + if (element != null && element instanceof BackboneElement) + return hasExtension((BackboneElement) element, name); + + if (name == null || element == null || !element.hasExtension()) + return false; + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return true; + } + return false; + } + + /** + * @param name the identity of the extension of interest + * @return true if the named extension is on this element. Will check modifier extensions + */ + public static boolean hasExtension(BackboneElement element, String name) { + if (name == null || element == null || !(element.hasExtension() || element.hasModifierExtension())) + return false; + for (Extension e : element.getModifierExtension()) { + if (name.equals(e.getUrl())) + return true; + } + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return true; + } + return false; + } + + + /** + * @param name the identity of the extension of interest + * @return The extension, if on this element, else null. will check modifier extensions too, if appropriate + */ + public static Extension getExtension(Element element, String name) { + if (element != null && element instanceof BackboneElement) + return getExtension((BackboneElement) element, name); + + if (name == null || element == null || !element.hasExtension()) + return null; + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return e; + } + return null; + } + + /** + * @param name the identity of the extension of interest + * @return The extension, if on this element, else null. will check modifier extensions too + */ + public static Extension getExtension(BackboneElement element, String name) { + if (name == null || element == null || !element.hasExtension()) + return null; + for (Extension e : element.getModifierExtension()) { + if (name.equals(e.getUrl())) + return e; + } + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return e; + } + return null; + } + + /** + * set the value of an extension on the element. if value == null, make sure it doesn't exist + * + * @param element - the element to act on. Can also be a backbone element + * @param modifier - whether this is a modifier. Note that this is a definitional property of the extension; don't alternate + * @param uri - the identifier for the extension + * @param value - the value of the extension. Delete if this is null + * @throws Exception - if the modifier logic is incorrect + */ + public static void setExtension(Element element, boolean modifier, String uri, Type value) throws FHIRException { + if (value == null) { + // deleting the extension + if (element instanceof BackboneElement) + for (Extension e : ((BackboneElement) element).getModifierExtension()) { + if (uri.equals(e.getUrl())) + ((BackboneElement) element).getModifierExtension().remove(e); + } + for (Extension e : element.getExtension()) { + if (uri.equals(e.getUrl())) + element.getExtension().remove(e); + } + } else { + // it would probably be easier to delete and then create, but this would re-order the extensions + // not that order matters, but we'll preserve it anyway + boolean found = false; + if (element instanceof BackboneElement) + for (Extension e : ((BackboneElement) element).getModifierExtension()) { + if (uri.equals(e.getUrl())) { + if (!modifier) + throw new FHIRException("Error adding extension \""+uri+"\": found an existing modifier extension, and the extension is not marked as a modifier"); + e.setValue(value); + found = true; + } + } + for (Extension e : element.getExtension()) { + if (uri.equals(e.getUrl())) { + if (modifier) + throw new FHIRException("Error adding extension \""+uri+"\": found an existing extension, and the extension is marked as a modifier"); + e.setValue(value); + found = true; + } + } + if (!found) { + Extension ex = new Extension().setUrl(uri).setValue(value); + if (modifier) { + if (!(element instanceof BackboneElement)) + throw new FHIRException("Error adding extension \""+uri+"\": extension is marked as a modifier, but element is not a backbone element"); + ((BackboneElement) element).getModifierExtension().add(ex); + + } else { + element.getExtension().add(ex); + } + } + } + } + + public static boolean hasExtensions(Element element) { + if (element instanceof BackboneElement) + return element.hasExtension() || ((BackboneElement) element).hasModifierExtension(); + else + return element.hasExtension(); + } + + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Factory.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Factory.java new file mode 100644 index 00000000000..b7c22f6dce4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Factory.java @@ -0,0 +1,251 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.text.ParseException; +import java.util.UUID; + +import org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem; +import org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.xhtml.XhtmlParser; + +/* +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; + return new DateTimeType(value); + } + + public static DateType newDate(String value) throws ParseException { + if (value == null) + return null; + return new DateType(value); + } + + 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) { + if (!evenIfNull && (value == null || value.isEmpty())) + return null; + Extension e = new Extension(); + e.setUrl(uri); + e.setValue(value); + return e; + } + + public static CodeableConcept newCodeableConcept(String code, String system, String display) { + 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) { + Reference rr = new Reference(); + rr.setReference(url); + return rr; + } + + public static Narrative newNarrative(NarrativeStatus status, String html) throws IOException, FHIRException { + Narrative n = new Narrative(); + n.setStatus(status); + try { + n.setDiv(new XhtmlParser().parseFragment("
"+Utilities.escapeXml(html)+"
")); + } catch (org.hl7.fhir.exceptions.FHIRException e) { + throw new FHIRException(e.getMessage(), e); + } + return n; + } + + public static Coding makeCoding(String code) throws FHIRException { + 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 FHIRException("Unable to understand the code '"+code+"'. Use the format system|code(|display)"); + return c; + } + + public static Reference makeReference(String url, String text) { + Reference rr = new Reference(); + rr.setReference(url); + if (!Utilities.noString(text)) + rr.setDisplay(text); + return rr; + } + + public static String createUUID() { + return "urn:uuid:"+UUID.randomUUID().toString().toLowerCase(); + } + + public Type create(String name) throws FHIRException { + if (name.equals("boolean")) + return new BooleanType(); + else if (name.equals("integer")) + return new IntegerType(); + else if (name.equals("decimal")) + return new DecimalType(); + else if (name.equals("base64Binary")) + return new Base64BinaryType(); + else if (name.equals("instant")) + return new InstantType(); + else if (name.equals("string")) + return new StringType(); + else if (name.equals("uri")) + return new UriType(); + else if (name.equals("date")) + return new DateType(); + else if (name.equals("dateTime")) + return new DateTimeType(); + else if (name.equals("time")) + return new TimeType(); + else if (name.equals("code")) + return new CodeType(); + else if (name.equals("oid")) + return new OidType(); + else if (name.equals("id")) + return new IdType(); + else if (name.equals("unsignedInt")) + return new UnsignedIntType(); + else if (name.equals("positiveInt")) + return new PositiveIntType(); + else if (name.equals("markdown")) + return new MarkdownType(); + else if (name.equals("Annotation")) + return new Annotation(); + else if (name.equals("Attachment")) + return new Attachment(); + else if (name.equals("Identifier")) + return new Identifier(); + else if (name.equals("CodeableConcept")) + return new CodeableConcept(); + else if (name.equals("Coding")) + return new Coding(); + else if (name.equals("Quantity")) + return new Quantity(); + else if (name.equals("Range")) + return new Range(); + else if (name.equals("Period")) + return new Period(); + else if (name.equals("Ratio")) + return new Ratio(); + else if (name.equals("SampledData")) + return new SampledData(); + else if (name.equals("Signature")) + return new Signature(); + else if (name.equals("HumanName")) + return new HumanName(); + else if (name.equals("Address")) + return new Address(); + else if (name.equals("ContactPoint")) + return new ContactPoint(); + else if (name.equals("Timing")) + return new Timing(); + else if (name.equals("Reference")) + return new Reference(); + else if (name.equals("Meta")) + return new Meta(); + else + throw new FHIRException("Unknown data type name "+name); + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/FamilyMemberHistory.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/FamilyMemberHistory.java new file mode 100644 index 00000000000..d8de7ec04eb --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/FamilyMemberHistory.java @@ -0,0 +1,1589 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. + */ +@ResourceDef(name="FamilyMemberHistory", profile="http://hl7.org/fhir/Profile/FamilyMemberHistory") +public class FamilyMemberHistory extends DomainResource { + + public enum FamilyHistoryStatus { + /** + * Some health information is known and captured, but not complete - see notes for details. + */ + PARTIAL, + /** + * All relevant health information is known and captured. + */ + COMPLETED, + /** + * This instance should not have been part of this patient's medical record. + */ + ENTEREDINERROR, + /** + * Health information for this individual is unavailable/unknown. + */ + HEALTHUNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static FamilyHistoryStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("partial".equals(codeString)) + return PARTIAL; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("health-unknown".equals(codeString)) + return HEALTHUNKNOWN; + throw new FHIRException("Unknown FamilyHistoryStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PARTIAL: return "partial"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + case HEALTHUNKNOWN: return "health-unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PARTIAL: return "http://hl7.org/fhir/history-status"; + case COMPLETED: return "http://hl7.org/fhir/history-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/history-status"; + case HEALTHUNKNOWN: return "http://hl7.org/fhir/history-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PARTIAL: return "Some health information is known and captured, but not complete - see notes for details."; + case COMPLETED: return "All relevant health information is known and captured."; + case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record."; + case HEALTHUNKNOWN: return "Health information for this individual is unavailable/unknown."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PARTIAL: return "Partial"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in error"; + case HEALTHUNKNOWN: return "Health unknown"; + default: return "?"; + } + } + } + + public static class FamilyHistoryStatusEnumFactory implements EnumFactory { + public FamilyHistoryStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("partial".equals(codeString)) + return FamilyHistoryStatus.PARTIAL; + if ("completed".equals(codeString)) + return FamilyHistoryStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return FamilyHistoryStatus.ENTEREDINERROR; + if ("health-unknown".equals(codeString)) + return FamilyHistoryStatus.HEALTHUNKNOWN; + throw new IllegalArgumentException("Unknown FamilyHistoryStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("partial".equals(codeString)) + return new Enumeration(this, FamilyHistoryStatus.PARTIAL); + if ("completed".equals(codeString)) + return new Enumeration(this, FamilyHistoryStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, FamilyHistoryStatus.ENTEREDINERROR); + if ("health-unknown".equals(codeString)) + return new Enumeration(this, FamilyHistoryStatus.HEALTHUNKNOWN); + throw new FHIRException("Unknown FamilyHistoryStatus code '"+codeString+"'"); + } + public String toCode(FamilyHistoryStatus code) { + if (code == FamilyHistoryStatus.PARTIAL) + return "partial"; + if (code == FamilyHistoryStatus.COMPLETED) + return "completed"; + if (code == FamilyHistoryStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == FamilyHistoryStatus.HEALTHUNKNOWN) + return "health-unknown"; + return "?"; + } + public String toSystem(FamilyHistoryStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class FamilyMemberHistoryConditionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Condition suffered by relation", formalDefinition="The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system." ) + protected CodeableConcept code; + + /** + * Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. + */ + @Child(name = "outcome", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="deceased | permanent disability | etc.", formalDefinition="Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation." ) + protected CodeableConcept outcome; + + /** + * Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. + */ + @Child(name = "onset", type = {Age.class, Range.class, Period.class, StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="When condition first manifested", formalDefinition="Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence." ) + protected Type onset; + + /** + * An area where general notes can be placed about this specific condition. + */ + @Child(name = "note", type = {Annotation.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Extra information about condition", formalDefinition="An area where general notes can be placed about this specific condition." ) + protected Annotation note; + + private static final long serialVersionUID = -1221569121L; + + /** + * Constructor + */ + public FamilyMemberHistoryConditionComponent() { + super(); + } + + /** + * Constructor + */ + public FamilyMemberHistoryConditionComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) + */ + public FamilyMemberHistoryConditionComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) + */ + public FamilyMemberHistoryConditionComponent setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Type getOnset() { + return this.onset; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Age getOnsetAge() throws FHIRException { + if (!(this.onset instanceof Age)) + throw new FHIRException("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Age) this.onset; + } + + public boolean hasOnsetAge() { + return this.onset instanceof Age; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Range getOnsetRange() throws FHIRException { + if (!(this.onset instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Range) this.onset; + } + + public boolean hasOnsetRange() { + return this.onset instanceof Range; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Period getOnsetPeriod() throws FHIRException { + if (!(this.onset instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Period) this.onset; + } + + public boolean hasOnsetPeriod() { + return this.onset instanceof Period; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public StringType getOnsetStringType() throws FHIRException { + if (!(this.onset instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (StringType) this.onset; + } + + public boolean hasOnsetStringType() { + return this.onset instanceof StringType; + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public FamilyMemberHistoryConditionComponent setOnset(Type value) { + this.onset = value; + return this; + } + + /** + * @return {@link #note} (An area where general notes can be placed about this specific condition.) + */ + public Annotation getNote() { + if (this.note == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.note"); + else if (Configuration.doAutoCreate()) + this.note = new Annotation(); // cc + return this.note; + } + + public boolean hasNote() { + return this.note != null && !this.note.isEmpty(); + } + + /** + * @param value {@link #note} (An area where general notes can be placed about this specific condition.) + */ + public FamilyMemberHistoryConditionComponent setNote(Annotation value) { + this.note = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("outcome", "CodeableConcept", "Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("onset[x]", "Age|Range|Period|string", "Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("note", "Annotation", "An area where general notes can be placed about this specific condition.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept + case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // Type + case 3387378: /*note*/ return this.note == null ? new Base[0] : new Base[] {this.note}; // Annotation + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -1106507950: // outcome + this.outcome = castToCodeableConcept(value); // CodeableConcept + break; + case 105901603: // onset + this.onset = (Type) value; // Type + break; + case 3387378: // note + this.note = castToAnnotation(value); // Annotation + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("outcome")) + this.outcome = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("onset[x]")) + this.onset = (Type) value; // Type + else if (name.equals("note")) + this.note = castToAnnotation(value); // Annotation + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case -1106507950: return getOutcome(); // CodeableConcept + case -1886216323: return getOnset(); // Type + case 3387378: return getNote(); // Annotation + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("outcome")) { + this.outcome = new CodeableConcept(); + return this.outcome; + } + else if (name.equals("onsetAge")) { + this.onset = new Age(); + return this.onset; + } + else if (name.equals("onsetRange")) { + this.onset = new Range(); + return this.onset; + } + else if (name.equals("onsetPeriod")) { + this.onset = new Period(); + return this.onset; + } + else if (name.equals("onsetString")) { + this.onset = new StringType(); + return this.onset; + } + else if (name.equals("note")) { + this.note = new Annotation(); + return this.note; + } + else + return super.addChild(name); + } + + public FamilyMemberHistoryConditionComponent copy() { + FamilyMemberHistoryConditionComponent dst = new FamilyMemberHistoryConditionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.note = note == null ? null : note.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof FamilyMemberHistoryConditionComponent)) + return false; + FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(outcome, o.outcome, true) && compareDeep(onset, o.onset, true) + && compareDeep(note, o.note, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof FamilyMemberHistoryConditionComponent)) + return false; + FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (outcome == null || outcome.isEmpty()) + && (onset == null || onset.isEmpty()) && (note == null || note.isEmpty()); + } + + public String fhirType() { + return "FamilyMemberHistory.condition"; + + } + + } + + /** + * This records identifiers associated with this family member history record 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=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="External Id(s) for this record", formalDefinition="This records identifiers associated with this family member history record 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 person who this history concerns. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient history is about", formalDefinition="The person who this history concerns." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person who this history concerns.) + */ + protected Patient patientTarget; + + /** + * The date (and possibly time) when the family member history was taken. + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When history was captured/updated", formalDefinition="The date (and possibly time) when the family member history was taken." ) + protected DateTimeType date; + + /** + * A code specifying a state of a Family Member History record. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="partial | completed | entered-in-error | health-unknown", formalDefinition="A code specifying a state of a Family Member History record." ) + protected Enumeration status; + + /** + * This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair". + */ + @Child(name = "name", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The family member described", formalDefinition="This will either be a name or a description; e.g. \"Aunt Susan\", \"my cousin with the red hair\"." ) + protected StringType name; + + /** + * The type of relationship this person has to the patient (father, mother, brother etc.). + */ + @Child(name = "relationship", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Relationship to the subject", formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)." ) + protected CodeableConcept relationship; + + /** + * Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The actual or approximate date of birth of the relative. + */ + @Child(name = "born", type = {Period.class, DateType.class, StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="(approximate) date of birth", formalDefinition="The actual or approximate date of birth of the relative." ) + protected Type born; + + /** + * The actual or approximate age of the relative at the time the family member history is recorded. + */ + @Child(name = "age", type = {Age.class, Range.class, StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="(approximate) age", formalDefinition="The actual or approximate age of the relative at the time the family member history is recorded." ) + protected Type age; + + /** + * Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record. + */ + @Child(name = "deceased", type = {BooleanType.class, Age.class, Range.class, DateType.class, StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Dead? How old/when?", formalDefinition="Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record." ) + protected Type deceased; + + /** + * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. + */ + @Child(name = "note", type = {Annotation.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="General note about related person", formalDefinition="This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible." ) + protected Annotation note; + + /** + * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. + */ + @Child(name = "condition", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Condition that the related person had", formalDefinition="The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition." ) + protected List condition; + + private static final long serialVersionUID = -1799103041L; + + /** + * Constructor + */ + public FamilyMemberHistory() { + super(); + } + + /** + * Constructor + */ + public FamilyMemberHistory(Reference patient, Enumeration status, CodeableConcept relationship) { + super(); + this.patient = patient; + this.status = status; + this.relationship = relationship; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this family member history record 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} (This records identifiers associated with this family member history record 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; + } + + // syntactic sugar + public FamilyMemberHistory addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (The person who this history concerns.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person who this history concerns.) + */ + public FamilyMemberHistory 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 person who this history concerns.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 person who this history concerns.) + */ + public FamilyMemberHistory setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #date} (The date (and possibly time) when the family member history was taken.). 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 FamilyMemberHistory.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public FamilyMemberHistory setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and possibly time) when the family member history was taken. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and possibly time) when the family member history was taken. + */ + public FamilyMemberHistory setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (A code specifying a state of a Family Member History 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 FamilyMemberHistory.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new FamilyHistoryStatusEnumFactory()); // bb + 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} (A code specifying a state of a Family Member History record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public FamilyMemberHistory setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying a state of a Family Member History record. + */ + public FamilyHistoryStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying a state of a Family Member History record. + */ + public FamilyMemberHistory setStatus(FamilyHistoryStatus value) { + if (this.status == null) + this.status = new Enumeration(new FamilyHistoryStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #name} (This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".). 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 FamilyMemberHistory.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public FamilyMemberHistory setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair". + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair". + */ + public FamilyMemberHistory setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) + */ + public CodeableConcept getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new CodeableConcept(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) + */ + public FamilyMemberHistory setRelationship(CodeableConcept value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.). 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 FamilyMemberHistory.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + 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 - the gender that the relative is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public FamilyMemberHistory setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. + */ + public FamilyMemberHistory setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public Type getBorn() { + return this.born; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public Period getBornPeriod() throws FHIRException { + if (!(this.born instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.born.getClass().getName()+" was encountered"); + return (Period) this.born; + } + + public boolean hasBornPeriod() { + return this.born instanceof Period; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public DateType getBornDateType() throws FHIRException { + if (!(this.born instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.born.getClass().getName()+" was encountered"); + return (DateType) this.born; + } + + public boolean hasBornDateType() { + return this.born instanceof DateType; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public StringType getBornStringType() throws FHIRException { + if (!(this.born instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.born.getClass().getName()+" was encountered"); + return (StringType) this.born; + } + + public boolean hasBornStringType() { + return this.born instanceof StringType; + } + + public boolean hasBorn() { + return this.born != null && !this.born.isEmpty(); + } + + /** + * @param value {@link #born} (The actual or approximate date of birth of the relative.) + */ + public FamilyMemberHistory setBorn(Type value) { + this.born = value; + return this; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Type getAge() { + return this.age; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Age getAgeAge() throws FHIRException { + if (!(this.age instanceof Age)) + throw new FHIRException("Type mismatch: the type Age was expected, but "+this.age.getClass().getName()+" was encountered"); + return (Age) this.age; + } + + public boolean hasAgeAge() { + return this.age instanceof Age; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public Range getAgeRange() throws FHIRException { + if (!(this.age instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered"); + return (Range) this.age; + } + + public boolean hasAgeRange() { + return this.age instanceof Range; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public StringType getAgeStringType() throws FHIRException { + if (!(this.age instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.age.getClass().getName()+" was encountered"); + return (StringType) this.age; + } + + public boolean hasAgeStringType() { + return this.age instanceof StringType; + } + + public boolean hasAge() { + return this.age != null && !this.age.isEmpty(); + } + + /** + * @param value {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) + */ + public FamilyMemberHistory setAge(Type value) { + this.age = value; + return this; + } + + /** + * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) + */ + public Type getDeceased() { + return this.deceased; + } + + /** + * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) + */ + public BooleanType getDeceasedBooleanType() throws FHIRException { + if (!(this.deceased instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (BooleanType) this.deceased; + } + + public boolean hasDeceasedBooleanType() { + return this.deceased instanceof BooleanType; + } + + /** + * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) + */ + public Age getDeceasedAge() throws FHIRException { + if (!(this.deceased instanceof Age)) + throw new FHIRException("Type mismatch: the type Age was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (Age) this.deceased; + } + + public boolean hasDeceasedAge() { + return this.deceased instanceof Age; + } + + /** + * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) + */ + public Range getDeceasedRange() throws FHIRException { + if (!(this.deceased instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (Range) this.deceased; + } + + public boolean hasDeceasedRange() { + return this.deceased instanceof Range; + } + + /** + * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) + */ + public DateType getDeceasedDateType() throws FHIRException { + if (!(this.deceased instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (DateType) this.deceased; + } + + public boolean hasDeceasedDateType() { + return this.deceased instanceof DateType; + } + + /** + * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) + */ + public StringType getDeceasedStringType() throws FHIRException { + if (!(this.deceased instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (StringType) this.deceased; + } + + public boolean hasDeceasedStringType() { + return this.deceased instanceof StringType; + } + + public boolean hasDeceased() { + return this.deceased != null && !this.deceased.isEmpty(); + } + + /** + * @param value {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) + */ + public FamilyMemberHistory setDeceased(Type value) { + this.deceased = value; + return this; + } + + /** + * @return {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.) + */ + public Annotation getNote() { + if (this.note == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyMemberHistory.note"); + else if (Configuration.doAutoCreate()) + this.note = new Annotation(); // cc + return this.note; + } + + public boolean hasNote() { + return this.note != null && !this.note.isEmpty(); + } + + /** + * @param value {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.) + */ + public FamilyMemberHistory setNote(Annotation value) { + this.note = value; + return this; + } + + /** + * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (FamilyMemberHistoryConditionComponent item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) + */ + // syntactic sugar + public FamilyMemberHistoryConditionComponent addCondition() { //3 + FamilyMemberHistoryConditionComponent t = new FamilyMemberHistoryConditionComponent(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + // syntactic sugar + public FamilyMemberHistory addCondition(FamilyMemberHistoryConditionComponent t) { //3 + if (t == null) + return this; + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this family member history record 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("patient", "Reference(Patient)", "The person who this history concerns.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("date", "dateTime", "The date (and possibly time) when the family member history was taken.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("status", "code", "A code specifying a state of a Family Member History record.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("name", "string", "This will either be a name or a description; e.g. \"Aunt Susan\", \"my cousin with the red hair\".", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, java.lang.Integer.MAX_VALUE, born)); + childrenList.add(new Property("age[x]", "Age|Range|string", "The actual or approximate age of the relative at the time the family member history is recorded.", 0, java.lang.Integer.MAX_VALUE, age)); + childrenList.add(new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, java.lang.Integer.MAX_VALUE, deceased)); + childrenList.add(new Property("note", "Annotation", "This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("condition", "", "The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.", 0, java.lang.Integer.MAX_VALUE, condition)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept + case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration + case 3029833: /*born*/ return this.born == null ? new Base[0] : new Base[] {this.born}; // Type + case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Type + case 561497972: /*deceased*/ return this.deceased == null ? new Base[0] : new Base[] {this.deceased}; // Type + case 3387378: /*note*/ return this.note == null ? new Base[0] : new Base[] {this.note}; // Annotation + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // FamilyMemberHistoryConditionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -892481550: // status + this.status = new FamilyHistoryStatusEnumFactory().fromType(value); // Enumeration + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -261851592: // relationship + this.relationship = castToCodeableConcept(value); // CodeableConcept + break; + case -1249512767: // gender + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + break; + case 3029833: // born + this.born = (Type) value; // Type + break; + case 96511: // age + this.age = (Type) value; // Type + break; + case 561497972: // deceased + this.deceased = (Type) value; // Type + break; + case 3387378: // note + this.note = castToAnnotation(value); // Annotation + break; + case -861311717: // condition + this.getCondition().add((FamilyMemberHistoryConditionComponent) value); // FamilyMemberHistoryConditionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("status")) + this.status = new FamilyHistoryStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("relationship")) + this.relationship = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("gender")) + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + else if (name.equals("born[x]")) + this.born = (Type) value; // Type + else if (name.equals("age[x]")) + this.age = (Type) value; // Type + else if (name.equals("deceased[x]")) + this.deceased = (Type) value; // Type + else if (name.equals("note")) + this.note = castToAnnotation(value); // Annotation + else if (name.equals("condition")) + this.getCondition().add((FamilyMemberHistoryConditionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -791418107: return getPatient(); // Reference + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -261851592: return getRelationship(); // CodeableConcept + case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration + case 67532951: return getBorn(); // Type + case -1419716831: return getAge(); // Type + case -1311442804: return getDeceased(); // Type + case 3387378: return getNote(); // Annotation + case -861311717: return addCondition(); // FamilyMemberHistoryConditionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.date"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.status"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.name"); + } + else if (name.equals("relationship")) { + this.relationship = new CodeableConcept(); + return this.relationship; + } + else if (name.equals("gender")) { + throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.gender"); + } + else if (name.equals("bornPeriod")) { + this.born = new Period(); + return this.born; + } + else if (name.equals("bornDate")) { + this.born = new DateType(); + return this.born; + } + else if (name.equals("bornString")) { + this.born = new StringType(); + return this.born; + } + else if (name.equals("ageAge")) { + this.age = new Age(); + return this.age; + } + else if (name.equals("ageRange")) { + this.age = new Range(); + return this.age; + } + else if (name.equals("ageString")) { + this.age = new StringType(); + return this.age; + } + else if (name.equals("deceasedBoolean")) { + this.deceased = new BooleanType(); + return this.deceased; + } + else if (name.equals("deceasedAge")) { + this.deceased = new Age(); + return this.deceased; + } + else if (name.equals("deceasedRange")) { + this.deceased = new Range(); + return this.deceased; + } + else if (name.equals("deceasedDate")) { + this.deceased = new DateType(); + return this.deceased; + } + else if (name.equals("deceasedString")) { + this.deceased = new StringType(); + return this.deceased; + } + else if (name.equals("note")) { + this.note = new Annotation(); + return this.note; + } + else if (name.equals("condition")) { + return addCondition(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "FamilyMemberHistory"; + + } + + public FamilyMemberHistory copy() { + FamilyMemberHistory dst = new FamilyMemberHistory(); + 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.date = date == null ? null : date.copy(); + dst.status = status == null ? null : status.copy(); + dst.name = name == null ? null : name.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.gender = gender == null ? null : gender.copy(); + dst.born = born == null ? null : born.copy(); + dst.age = age == null ? null : age.copy(); + dst.deceased = deceased == null ? null : deceased.copy(); + dst.note = note == null ? null : note.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (FamilyMemberHistoryConditionComponent i : condition) + dst.condition.add(i.copy()); + }; + return dst; + } + + protected FamilyMemberHistory typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof FamilyMemberHistory)) + return false; + FamilyMemberHistory o = (FamilyMemberHistory) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(date, o.date, true) + && compareDeep(status, o.status, true) && compareDeep(name, o.name, true) && compareDeep(relationship, o.relationship, true) + && compareDeep(gender, o.gender, true) && compareDeep(born, o.born, true) && compareDeep(age, o.age, true) + && compareDeep(deceased, o.deceased, true) && compareDeep(note, o.note, true) && compareDeep(condition, o.condition, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof FamilyMemberHistory)) + return false; + FamilyMemberHistory o = (FamilyMemberHistory) other; + return compareValues(date, o.date, true) && compareValues(status, o.status, true) && compareValues(name, o.name, true) + && compareValues(gender, o.gender, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (date == null || date.isEmpty()) && (status == null || status.isEmpty()) && (name == null || name.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (gender == null || gender.isEmpty()) + && (born == null || born.isEmpty()) && (age == null || age.isEmpty()) && (deceased == null || deceased.isEmpty()) + && (note == null || note.isEmpty()) && (condition == null || condition.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.FamilyMemberHistory; + } + + /** + * Search parameter: relationship + *

+ * Description: A search by a relationship type
+ * Type: token
+ * Path: FamilyMemberHistory.relationship
+ *

+ */ + @SearchParamDefinition(name="relationship", path="FamilyMemberHistory.relationship", description="A search by a relationship type", type="token" ) + public static final String SP_RELATIONSHIP = "relationship"; + /** + * Fluent Client search parameter constant for relationship + *

+ * Description: A search by a relationship type
+ * Type: token
+ * Path: FamilyMemberHistory.relationship
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATIONSHIP = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATIONSHIP); + + /** + * Search parameter: patient + *

+ * Description: The identity of a subject to list family member history items for
+ * Type: reference
+ * Path: FamilyMemberHistory.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="FamilyMemberHistory.patient", description="The identity of a subject to list family member history items for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of a subject to list family member history items for
+ * Type: reference
+ * Path: FamilyMemberHistory.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "FamilyMemberHistory:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("FamilyMemberHistory:patient").toLocked(); + + /** + * Search parameter: gender + *

+ * Description: A search by a gender code of a family member
+ * Type: token
+ * Path: FamilyMemberHistory.gender
+ *

+ */ + @SearchParamDefinition(name="gender", path="FamilyMemberHistory.gender", description="A search by a gender code of a family member", type="token" ) + public static final String SP_GENDER = "gender"; + /** + * Fluent Client search parameter constant for gender + *

+ * Description: A search by a gender code of a family member
+ * Type: token
+ * Path: FamilyMemberHistory.gender
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); + + /** + * Search parameter: code + *

+ * Description: A search by a condition code
+ * Type: token
+ * Path: FamilyMemberHistory.condition.code
+ *

+ */ + @SearchParamDefinition(name="code", path="FamilyMemberHistory.condition.code", description="A search by a condition code", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: A search by a condition code
+ * Type: token
+ * Path: FamilyMemberHistory.condition.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: When history was captured/updated
+ * Type: date
+ * Path: FamilyMemberHistory.date
+ *

+ */ + @SearchParamDefinition(name="date", path="FamilyMemberHistory.date", description="When history was captured/updated", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When history was captured/updated
+ * Type: date
+ * Path: FamilyMemberHistory.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: A search by a record identifier
+ * Type: token
+ * Path: FamilyMemberHistory.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="FamilyMemberHistory.identifier", description="A search by a record identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A search by a record identifier
+ * Type: token
+ * Path: FamilyMemberHistory.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Flag.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Flag.java new file mode 100644 index 00000000000..1949e310292 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Flag.java @@ -0,0 +1,841 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Prospective warnings of potential issues when providing care to the patient. + */ +@ResourceDef(name="Flag", profile="http://hl7.org/fhir/Profile/Flag") +public class Flag extends DomainResource { + + public enum FlagStatus { + /** + * A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag. + */ + ACTIVE, + /** + * The flag does not need to be displayed any more. + */ + INACTIVE, + /** + * The flag was added in error, and should no longer be displayed. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static FlagStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("inactive".equals(codeString)) + return INACTIVE; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown FlagStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return "http://hl7.org/fhir/flag-status"; + case INACTIVE: return "http://hl7.org/fhir/flag-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/flag-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag."; + case INACTIVE: return "The flag does not need to be displayed any more."; + case ENTEREDINERROR: return "The flag was added in error, and should no longer be displayed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case INACTIVE: return "Inactive"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + public static class FlagStatusEnumFactory implements EnumFactory { + public FlagStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return FlagStatus.ACTIVE; + if ("inactive".equals(codeString)) + return FlagStatus.INACTIVE; + if ("entered-in-error".equals(codeString)) + return FlagStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown FlagStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return new Enumeration(this, FlagStatus.ACTIVE); + if ("inactive".equals(codeString)) + return new Enumeration(this, FlagStatus.INACTIVE); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, FlagStatus.ENTEREDINERROR); + throw new FHIRException("Unknown FlagStatus code '"+codeString+"'"); + } + public String toCode(FlagStatus code) { + if (code == FlagStatus.ACTIVE) + return "active"; + if (code == FlagStatus.INACTIVE) + return "inactive"; + if (code == FlagStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(FlagStatus code) { + return code.getSystem(); + } + } + + /** + * Identifier assigned to the flag for external use (outside the FHIR environment). + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the flag for external use (outside the FHIR environment)." ) + protected List identifier; + + /** + * Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context." ) + protected CodeableConcept category; + + /** + * Supports basic workflow. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="Supports basic workflow." ) + protected Enumeration status; + + /** + * The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time period when flag is active", formalDefinition="The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified." ) + protected Period period; + + /** + * The patient, location, group , organization , or practitioner this is about record this flag is associated with. + */ + @Child(name = "subject", type = {Patient.class, Location.class, Group.class, Organization.class, Practitioner.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who/What is flag about?", formalDefinition="The patient, location, group , organization , or practitioner this is about record this flag is associated with." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient, location, group , organization , or practitioner this is about record this flag is associated with.) + */ + protected Resource subjectTarget; + + /** + * This alert is only relevant during the encounter. + */ + @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Alert relevant during encounter", formalDefinition="This alert is only relevant during the encounter." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (This alert is only relevant during the encounter.) + */ + protected Encounter encounterTarget; + + /** + * The person, organization or device that created the flag. + */ + @Child(name = "author", type = {Device.class, Organization.class, Patient.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Flag creator", formalDefinition="The person, organization or device that created the flag." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (The person, organization or device that created the flag.) + */ + protected Resource authorTarget; + + /** + * The coded value or textual component of the flag to display to the user. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Partially deaf, Requires easy open caps, No permanent address, etc.", formalDefinition="The coded value or textual component of the flag to display to the user." ) + protected CodeableConcept code; + + private static final long serialVersionUID = 701147751L; + + /** + * Constructor + */ + public Flag() { + super(); + } + + /** + * Constructor + */ + public Flag(Enumeration status, Reference subject, CodeableConcept code) { + super(); + this.status = status; + this.subject = subject; + this.code = code; + } + + /** + * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).) + */ + 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 assigned to the flag for external use (outside the FHIR environment).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Flag addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.) + */ + public Flag setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #status} (Supports basic workflow.). 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 Flag.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new FlagStatusEnumFactory()); // bb + 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} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Flag setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Supports basic workflow. + */ + public FlagStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Supports basic workflow. + */ + public Flag setStatus(FlagStatus value) { + if (this.status == null) + this.status = new Enumeration(new FlagStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.) + */ + public Flag setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #subject} (The patient, location, group , organization , or practitioner this is about record this flag is associated with.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient, location, group , organization , or practitioner this is about record this flag is associated with.) + */ + public Flag 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, location, group , organization , or practitioner this is about record this flag is associated with.) + */ + public Resource getSubjectTarget() { + 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, location, group , organization , or practitioner this is about record this flag is associated with.) + */ + public Flag setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #encounter} (This alert is only relevant during the encounter.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (This alert is only relevant during the encounter.) + */ + public Flag 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. (This alert is only relevant during the encounter.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (This alert is only relevant during the encounter.) + */ + public Flag setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #author} (The person, organization or device that created the flag.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (The person, organization or device that created the flag.) + */ + public Flag setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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, organization or device that created the flag.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} 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, organization or device that created the flag.) + */ + public Flag setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #code} (The coded value or textual component of the flag to display to the user.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Flag.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The coded value or textual component of the flag to display to the user.) + */ + public Flag setCode(CodeableConcept value) { + this.code = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the flag for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("category", "CodeableConcept", "Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("status", "code", "Supports basic workflow.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("subject", "Reference(Patient|Location|Group|Organization|Practitioner)", "The patient, location, group , organization , or practitioner this is about record this flag is associated with.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "This alert is only relevant during the encounter.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("author", "Reference(Device|Organization|Patient|Practitioner)", "The person, organization or device that created the flag.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("code", "CodeableConcept", "The coded value or textual component of the flag to display to the user.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case -892481550: // status + this.status = new FlagStatusEnumFactory().fromType(value); // Enumeration + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("status")) + this.status = new FlagStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 50511102: return getCategory(); // CodeableConcept + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -991726143: return getPeriod(); // Period + case -1867885268: return getSubject(); // Reference + case 1524132147: return getEncounter(); // Reference + case -1406328437: return getAuthor(); // Reference + case 3059181: return getCode(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Flag.status"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Flag"; + + } + + public Flag copy() { + Flag dst = new Flag(); + 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.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.author = author == null ? null : author.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Flag typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Flag)) + return false; + Flag o = (Flag) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(status, o.status, true) + && compareDeep(period, o.period, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(author, o.author, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Flag)) + return false; + Flag o = (Flag) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (subject == null || subject.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (author == null || author.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Flag; + } + + /** + * Search parameter: author + *

+ * Description: Flag creator
+ * Type: reference
+ * Path: Flag.author
+ *

+ */ + @SearchParamDefinition(name="author", path="Flag.author", description="Flag creator", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: Flag creator
+ * Type: reference
+ * Path: Flag.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Flag:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Flag:author").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The identity of a subject to list flags for
+ * Type: reference
+ * Path: Flag.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Flag.subject", description="The identity of a subject to list flags for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of a subject to list flags for
+ * Type: reference
+ * Path: Flag.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Flag:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Flag:patient").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: The identity of a subject to list flags for
+ * Type: reference
+ * Path: Flag.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Flag.subject", description="The identity of a subject to list flags for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: The identity of a subject to list flags for
+ * Type: reference
+ * Path: Flag.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Flag:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Flag:subject").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Alert relevant during encounter
+ * Type: reference
+ * Path: Flag.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="Flag.encounter", description="Alert relevant during encounter", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Alert relevant during encounter
+ * Type: reference
+ * Path: Flag.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Flag:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Flag:encounter").toLocked(); + + /** + * Search parameter: date + *

+ * Description: Time period when flag is active
+ * Type: date
+ * Path: Flag.period
+ *

+ */ + @SearchParamDefinition(name="date", path="Flag.period", description="Time period when flag is active", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Time period when flag is active
+ * Type: date
+ * Path: Flag.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Goal.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Goal.java new file mode 100644 index 00000000000..4c74e20f3b0 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Goal.java @@ -0,0 +1,1532 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. + */ +@ResourceDef(name="Goal", profile="http://hl7.org/fhir/Profile/Goal") +public class Goal extends DomainResource { + + public enum GoalStatus { + /** + * A goal is proposed for this patient + */ + PROPOSED, + /** + * A goal is planned for this patient + */ + PLANNED, + /** + * A proposed goal was accepted + */ + ACCEPTED, + /** + * A proposed goal was rejected + */ + REJECTED, + /** + * 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 remains a long term objective but is no longer being actively pursued for a temporary period of time. + */ + ONHOLD, + /** + * The goal is no longer being sought + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static GoalStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("planned".equals(codeString)) + return PLANNED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("achieved".equals(codeString)) + return ACHIEVED; + if ("sustaining".equals(codeString)) + return SUSTAINING; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new FHIRException("Unknown GoalStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case PLANNED: return "planned"; + case ACCEPTED: return "accepted"; + case REJECTED: return "rejected"; + case INPROGRESS: return "in-progress"; + case ACHIEVED: return "achieved"; + case SUSTAINING: return "sustaining"; + case ONHOLD: return "on-hold"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return "http://hl7.org/fhir/goal-status"; + case PLANNED: return "http://hl7.org/fhir/goal-status"; + case ACCEPTED: return "http://hl7.org/fhir/goal-status"; + case REJECTED: return "http://hl7.org/fhir/goal-status"; + case INPROGRESS: return "http://hl7.org/fhir/goal-status"; + case ACHIEVED: return "http://hl7.org/fhir/goal-status"; + case SUSTAINING: return "http://hl7.org/fhir/goal-status"; + case ONHOLD: return "http://hl7.org/fhir/goal-status"; + case CANCELLED: return "http://hl7.org/fhir/goal-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "A goal is proposed for this patient"; + case PLANNED: return "A goal is planned for this patient"; + case ACCEPTED: return "A proposed goal was accepted"; + case REJECTED: return "A proposed goal was rejected"; + 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 ONHOLD: return "The goal remains a long term objective but is no longer being actively pursued for a temporary period of time."; + case CANCELLED: return "The goal is no longer being sought"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case PLANNED: return "Planned"; + case ACCEPTED: return "Accepted"; + case REJECTED: return "Rejected"; + case INPROGRESS: return "In Progress"; + case ACHIEVED: return "Achieved"; + case SUSTAINING: return "Sustaining"; + case ONHOLD: return "On Hold"; + 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 ("proposed".equals(codeString)) + return GoalStatus.PROPOSED; + if ("planned".equals(codeString)) + return GoalStatus.PLANNED; + if ("accepted".equals(codeString)) + return GoalStatus.ACCEPTED; + if ("rejected".equals(codeString)) + return GoalStatus.REJECTED; + if ("in-progress".equals(codeString)) + return GoalStatus.INPROGRESS; + if ("achieved".equals(codeString)) + return GoalStatus.ACHIEVED; + if ("sustaining".equals(codeString)) + return GoalStatus.SUSTAINING; + if ("on-hold".equals(codeString)) + return GoalStatus.ONHOLD; + if ("cancelled".equals(codeString)) + return GoalStatus.CANCELLED; + throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return new Enumeration(this, GoalStatus.PROPOSED); + if ("planned".equals(codeString)) + return new Enumeration(this, GoalStatus.PLANNED); + if ("accepted".equals(codeString)) + return new Enumeration(this, GoalStatus.ACCEPTED); + if ("rejected".equals(codeString)) + return new Enumeration(this, GoalStatus.REJECTED); + if ("in-progress".equals(codeString)) + return new Enumeration(this, GoalStatus.INPROGRESS); + if ("achieved".equals(codeString)) + return new Enumeration(this, GoalStatus.ACHIEVED); + if ("sustaining".equals(codeString)) + return new Enumeration(this, GoalStatus.SUSTAINING); + if ("on-hold".equals(codeString)) + return new Enumeration(this, GoalStatus.ONHOLD); + if ("cancelled".equals(codeString)) + return new Enumeration(this, GoalStatus.CANCELLED); + throw new FHIRException("Unknown GoalStatus code '"+codeString+"'"); + } + public String toCode(GoalStatus code) { + if (code == GoalStatus.PROPOSED) + return "proposed"; + if (code == GoalStatus.PLANNED) + return "planned"; + if (code == GoalStatus.ACCEPTED) + return "accepted"; + if (code == GoalStatus.REJECTED) + return "rejected"; + if (code == GoalStatus.INPROGRESS) + return "in-progress"; + if (code == GoalStatus.ACHIEVED) + return "achieved"; + if (code == GoalStatus.SUSTAINING) + return "sustaining"; + if (code == GoalStatus.ONHOLD) + return "on-hold"; + if (code == GoalStatus.CANCELLED) + return "cancelled"; + return "?"; + } + public String toSystem(GoalStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class GoalOutcomeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Details of what's changed (or not changed). + */ + @Child(name = "result", type = {CodeableConcept.class, Observation.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code or observation that resulted from goal", formalDefinition="Details of what's changed (or not changed)." ) + protected Type result; + + private static final long serialVersionUID = 1994317639L; + + /** + * Constructor + */ + public GoalOutcomeComponent() { + super(); + } + + /** + * @return {@link #result} (Details of what's changed (or not changed).) + */ + public Type getResult() { + return this.result; + } + + /** + * @return {@link #result} (Details of what's changed (or not changed).) + */ + public CodeableConcept getResultCodeableConcept() throws FHIRException { + if (!(this.result instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.result.getClass().getName()+" was encountered"); + return (CodeableConcept) this.result; + } + + public boolean hasResultCodeableConcept() { + return this.result instanceof CodeableConcept; + } + + /** + * @return {@link #result} (Details of what's changed (or not changed).) + */ + public Reference getResultReference() throws FHIRException { + if (!(this.result instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.result.getClass().getName()+" was encountered"); + return (Reference) this.result; + } + + public boolean hasResultReference() { + return this.result instanceof Reference; + } + + public boolean hasResult() { + return this.result != null && !this.result.isEmpty(); + } + + /** + * @param value {@link #result} (Details of what's changed (or not changed).) + */ + public GoalOutcomeComponent setResult(Type value) { + this.result = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("result[x]", "CodeableConcept|Reference(Observation)", "Details of what's changed (or not changed).", 0, java.lang.Integer.MAX_VALUE, result)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -934426595: // result + this.result = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("result[x]")) + this.result = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1819555005: return getResult(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("resultCodeableConcept")) { + this.result = new CodeableConcept(); + return this.result; + } + else if (name.equals("resultReference")) { + this.result = new Reference(); + return this.result; + } + else + return super.addChild(name); + } + + public GoalOutcomeComponent copy() { + GoalOutcomeComponent dst = new GoalOutcomeComponent(); + copyValues(dst); + dst.result = result == null ? null : result.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GoalOutcomeComponent)) + return false; + GoalOutcomeComponent o = (GoalOutcomeComponent) other; + return compareDeep(result, o.result, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GoalOutcomeComponent)) + return false; + GoalOutcomeComponent o = (GoalOutcomeComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (result == null || result.isEmpty()); + } + + public String fhirType() { + return "Goal.outcome"; + + } + + } + + /** + * This records identifiers associated with this care plan 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=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan 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; + + /** + * Identifies the patient, group or organization for whom the goal is being established. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Organization.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who this goal is intended for", formalDefinition="Identifies the patient, group or organization for whom the goal is being established." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Identifies the patient, group or organization for whom the goal is being established.) + */ + protected Resource subjectTarget; + + /** + * The date or event after which the goal should begin being pursued. + */ + @Child(name = "start", type = {DateType.class, CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When goal pursuit begins", formalDefinition="The date or event after which the goal should begin being pursued." ) + protected Type start; + + /** + * Indicates either the date or the duration after start by which the goal should be met. + */ + @Child(name = "target", type = {DateType.class, Duration.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reach goal on or before", formalDefinition="Indicates either the date or the duration after start by which the goal should be met." ) + protected Type target; + + /** + * Indicates a category the goal falls within. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="E.g. Treatment, dietary, behavioral, etc.", formalDefinition="Indicates a category the goal falls within." ) + protected List category; + + /** + * Human-readable description of a specific desired objective of care. + */ + @Child(name = "description", type = {StringType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of care." ) + protected StringType description; + + /** + * Indicates whether the goal has been reached and is still considered relevant. + */ + @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." ) + protected Enumeration status; + + /** + * Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. + */ + @Child(name = "statusDate", type = {DateType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When goal status took effect", formalDefinition="Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc." ) + protected DateType statusDate; + + /** + * Captures the reason for the current status. + */ + @Child(name = "statusReason", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reason for current status", formalDefinition="Captures the reason for the current status." ) + protected CodeableConcept statusReason; + + /** + * Indicates whose goal this is - patient goal, practitioner goal, etc. + */ + @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who's responsible for creating Goal?", formalDefinition="Indicates whose goal this is - patient goal, practitioner goal, etc." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + protected Resource authorTarget; + + /** + * Identifies the mutually agreed level of importance associated with reaching/sustaining the goal. + */ + @Child(name = "priority", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="high | medium |low", formalDefinition="Identifies the mutually agreed level of importance associated with reaching/sustaining the goal." ) + protected CodeableConcept priority; + + /** + * The identified conditions and other health record elements that are intended to be addressed by the goal. + */ + @Child(name = "addresses", type = {Condition.class, Observation.class, MedicationStatement.class, NutritionOrder.class, ProcedureRequest.class, RiskAssessment.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Issues addressed by this goal", formalDefinition="The identified conditions and other health record elements that are intended to be addressed by the goal." ) + protected List addresses; + /** + * The actual objects that are the target of the reference (The identified conditions and other health record elements that are intended to be addressed by the goal.) + */ + protected List addressesTarget; + + + /** + * Any comments related to the goal. + */ + @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." ) + protected List note; + + /** + * Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved. + */ + @Child(name = "outcome", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="What was end result of goal?", formalDefinition="Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved." ) + protected List outcome; + + private static final long serialVersionUID = 2029459056L; + + /** + * Constructor + */ + public Goal() { + super(); + } + + /** + * Constructor + */ + public Goal(StringType description, Enumeration status) { + super(); + this.description = description; + this.status = status; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan 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} (This records identifiers associated with this care plan 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; + } + + // syntactic sugar + public Goal addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (Identifies the patient, group or organization for whom the goal is being established.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Identifies the patient, group or organization for whom the goal is being established.) + */ + public Goal 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. (Identifies the patient, group or organization for whom the goal is being established.) + */ + public Resource getSubjectTarget() { + 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. (Identifies the patient, group or organization for whom the goal is being established.) + */ + public Goal setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #start} (The date or event after which the goal should begin being pursued.) + */ + public Type getStart() { + return this.start; + } + + /** + * @return {@link #start} (The date or event after which the goal should begin being pursued.) + */ + public DateType getStartDateType() throws FHIRException { + if (!(this.start instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.start.getClass().getName()+" was encountered"); + return (DateType) this.start; + } + + public boolean hasStartDateType() { + return this.start instanceof DateType; + } + + /** + * @return {@link #start} (The date or event after which the goal should begin being pursued.) + */ + public CodeableConcept getStartCodeableConcept() throws FHIRException { + if (!(this.start instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.start.getClass().getName()+" was encountered"); + return (CodeableConcept) this.start; + } + + public boolean hasStartCodeableConcept() { + return this.start instanceof CodeableConcept; + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (The date or event after which the goal should begin being pursued.) + */ + public Goal setStart(Type value) { + this.start = value; + return this; + } + + /** + * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.) + */ + public Type getTarget() { + return this.target; + } + + /** + * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.) + */ + public DateType getTargetDateType() throws FHIRException { + if (!(this.target instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.target.getClass().getName()+" was encountered"); + return (DateType) this.target; + } + + public boolean hasTargetDateType() { + return this.target instanceof DateType; + } + + /** + * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.) + */ + public Duration getTargetDuration() throws FHIRException { + if (!(this.target instanceof Duration)) + throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Duration) this.target; + } + + public boolean hasTargetDuration() { + return this.target instanceof Duration; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Indicates either the date or the duration after start by which the goal should be met.) + */ + public Goal setTarget(Type value) { + this.target = value; + return this; + } + + /** + * @return {@link #category} (Indicates a category the goal falls within.) + */ + public List getCategory() { + if (this.category == null) + this.category = new ArrayList(); + return this.category; + } + + public boolean hasCategory() { + if (this.category == null) + return false; + for (CodeableConcept item : this.category) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #category} (Indicates a category the goal falls within.) + */ + // syntactic sugar + public CodeableConcept addCategory() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return t; + } + + // syntactic sugar + public Goal addCategory(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return this; + } + + /** + * @return {@link #description} (Human-readable description of a specific desired objective of care.). 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(); // bb + 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 care.). 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 care. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of a specific desired objective of care. + */ + 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(new GoalStatusEnumFactory()); // bb + 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 (this.status == null) + this.status = new Enumeration(new GoalStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #statusDate} (Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value + */ + public DateType getStatusDateElement() { + if (this.statusDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.statusDate"); + else if (Configuration.doAutoCreate()) + this.statusDate = new DateType(); // bb + return this.statusDate; + } + + public boolean hasStatusDateElement() { + return this.statusDate != null && !this.statusDate.isEmpty(); + } + + public boolean hasStatusDate() { + return this.statusDate != null && !this.statusDate.isEmpty(); + } + + /** + * @param value {@link #statusDate} (Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value + */ + public Goal setStatusDateElement(DateType value) { + this.statusDate = value; + return this; + } + + /** + * @return Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. + */ + public Date getStatusDate() { + return this.statusDate == null ? null : this.statusDate.getValue(); + } + + /** + * @param value Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. + */ + public Goal setStatusDate(Date value) { + if (value == null) + this.statusDate = null; + else { + if (this.statusDate == null) + this.statusDate = new DateType(); + this.statusDate.setValue(value); + } + return this; + } + + /** + * @return {@link #statusReason} (Captures the reason for the current status.) + */ + public CodeableConcept getStatusReason() { + if (this.statusReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.statusReason"); + else if (Configuration.doAutoCreate()) + this.statusReason = new CodeableConcept(); // cc + return this.statusReason; + } + + public boolean hasStatusReason() { + return this.statusReason != null && !this.statusReason.isEmpty(); + } + + /** + * @param value {@link #statusReason} (Captures the reason for the current status.) + */ + public Goal setStatusReason(CodeableConcept value) { + this.statusReason = value; + return this; + } + + /** + * @return {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + public Goal setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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. (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} 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. (Indicates whose goal this is - patient goal, practitioner goal, etc.) + */ + public Goal setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #priority} (Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.) + */ + public Goal setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + /** + * @return {@link #addresses} (The identified conditions and other health record elements that are intended to be addressed by the goal.) + */ + public List getAddresses() { + if (this.addresses == null) + this.addresses = new ArrayList(); + return this.addresses; + } + + public boolean hasAddresses() { + if (this.addresses == null) + return false; + for (Reference item : this.addresses) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #addresses} (The identified conditions and other health record elements that are intended to be addressed by the goal.) + */ + // syntactic sugar + public Reference addAddresses() { //3 + Reference t = new Reference(); + if (this.addresses == null) + this.addresses = new ArrayList(); + this.addresses.add(t); + return t; + } + + // syntactic sugar + public Goal addAddresses(Reference t) { //3 + if (t == null) + return this; + if (this.addresses == null) + this.addresses = new ArrayList(); + this.addresses.add(t); + return this; + } + + /** + * @return {@link #addresses} (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 and other health record elements that are intended to be addressed by the goal.) + */ + public List getAddressesTarget() { + if (this.addressesTarget == null) + this.addressesTarget = new ArrayList(); + return this.addressesTarget; + } + + /** + * @return {@link #note} (Any comments related to the goal.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Any comments related to the goal.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public Goal addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.) + */ + public List getOutcome() { + if (this.outcome == null) + this.outcome = new ArrayList(); + return this.outcome; + } + + public boolean hasOutcome() { + if (this.outcome == null) + return false; + for (GoalOutcomeComponent item : this.outcome) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.) + */ + // syntactic sugar + public GoalOutcomeComponent addOutcome() { //3 + GoalOutcomeComponent t = new GoalOutcomeComponent(); + if (this.outcome == null) + this.outcome = new ArrayList(); + this.outcome.add(t); + return t; + } + + // syntactic sugar + public Goal addOutcome(GoalOutcomeComponent t) { //3 + if (t == null) + return this; + if (this.outcome == null) + this.outcome = new ArrayList(); + this.outcome.add(t); + 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 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("subject", "Reference(Patient|Group|Organization)", "Identifies the patient, group or organization for whom the goal is being established.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("start[x]", "date|CodeableConcept", "The date or event after which the goal should begin being pursued.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("target[x]", "date|Duration", "Indicates either the date or the duration after start by which the goal should be met.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("category", "CodeableConcept", "Indicates a category the goal falls within.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of care.", 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("statusDate", "date", "Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusDate)); + childrenList.add(new Property("statusReason", "CodeableConcept", "Captures the reason for the current status.", 0, java.lang.Integer.MAX_VALUE, statusReason)); + childrenList.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson)", "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("priority", "CodeableConcept", "Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("addresses", "Reference(Condition|Observation|MedicationStatement|NutritionOrder|ProcedureRequest|RiskAssessment)", "The identified conditions and other health record elements that are intended to be addressed by the goal.", 0, java.lang.Integer.MAX_VALUE, addresses)); + childrenList.add(new Property("note", "Annotation", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("outcome", "", "Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.", 0, java.lang.Integer.MAX_VALUE, outcome)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // Type + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type + case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateType + case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept + case 874544034: /*addresses*/ return this.addresses == null ? new Base[0] : this.addresses.toArray(new Base[this.addresses.size()]); // Reference + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : this.outcome.toArray(new Base[this.outcome.size()]); // GoalOutcomeComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 109757538: // start + this.start = (Type) value; // Type + break; + case -880905839: // target + this.target = (Type) value; // Type + break; + case 50511102: // category + this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -892481550: // status + this.status = new GoalStatusEnumFactory().fromType(value); // Enumeration + break; + case 247524032: // statusDate + this.statusDate = castToDate(value); // DateType + break; + case 2051346646: // statusReason + this.statusReason = castToCodeableConcept(value); // CodeableConcept + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case -1165461084: // priority + this.priority = castToCodeableConcept(value); // CodeableConcept + break; + case 874544034: // addresses + this.getAddresses().add(castToReference(value)); // Reference + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case -1106507950: // outcome + this.getOutcome().add((GoalOutcomeComponent) value); // GoalOutcomeComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("start[x]")) + this.start = (Type) value; // Type + else if (name.equals("target[x]")) + this.target = (Type) value; // Type + else if (name.equals("category")) + this.getCategory().add(castToCodeableConcept(value)); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("status")) + this.status = new GoalStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("statusDate")) + this.statusDate = castToDate(value); // DateType + else if (name.equals("statusReason")) + this.statusReason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("priority")) + this.priority = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("addresses")) + this.getAddresses().add(castToReference(value)); + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("outcome")) + this.getOutcome().add((GoalOutcomeComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1867885268: return getSubject(); // Reference + case 1316793566: return getStart(); // Type + case -815579825: return getTarget(); // Type + case 50511102: return addCategory(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 247524032: throw new FHIRException("Cannot make property statusDate as it is not a complex type"); // DateType + case 2051346646: return getStatusReason(); // CodeableConcept + case -1406328437: return getAuthor(); // Reference + case -1165461084: return getPriority(); // CodeableConcept + case 874544034: return addAddresses(); // Reference + case 3387378: return addNote(); // Annotation + case -1106507950: return addOutcome(); // GoalOutcomeComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("startDate")) { + this.start = new DateType(); + return this.start; + } + else if (name.equals("startCodeableConcept")) { + this.start = new CodeableConcept(); + return this.start; + } + else if (name.equals("targetDate")) { + this.target = new DateType(); + return this.target; + } + else if (name.equals("targetDuration")) { + this.target = new Duration(); + return this.target; + } + else if (name.equals("category")) { + return addCategory(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Goal.description"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Goal.status"); + } + else if (name.equals("statusDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Goal.statusDate"); + } + else if (name.equals("statusReason")) { + this.statusReason = new CodeableConcept(); + return this.statusReason; + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("priority")) { + this.priority = new CodeableConcept(); + return this.priority; + } + else if (name.equals("addresses")) { + return addAddresses(); + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("outcome")) { + return addOutcome(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Goal"; + + } + + 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.subject = subject == null ? null : subject.copy(); + dst.start = start == null ? null : start.copy(); + dst.target = target == null ? null : target.copy(); + if (category != null) { + dst.category = new ArrayList(); + for (CodeableConcept i : category) + dst.category.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.status = status == null ? null : status.copy(); + dst.statusDate = statusDate == null ? null : statusDate.copy(); + dst.statusReason = statusReason == null ? null : statusReason.copy(); + dst.author = author == null ? null : author.copy(); + dst.priority = priority == null ? null : priority.copy(); + if (addresses != null) { + dst.addresses = new ArrayList(); + for (Reference i : addresses) + dst.addresses.add(i.copy()); + }; + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + if (outcome != null) { + dst.outcome = new ArrayList(); + for (GoalOutcomeComponent i : outcome) + dst.outcome.add(i.copy()); + }; + return dst; + } + + protected Goal typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Goal)) + return false; + Goal o = (Goal) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(start, o.start, true) + && compareDeep(target, o.target, true) && compareDeep(category, o.category, true) && compareDeep(description, o.description, true) + && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true) && compareDeep(statusReason, o.statusReason, true) + && compareDeep(author, o.author, true) && compareDeep(priority, o.priority, true) && compareDeep(addresses, o.addresses, true) + && compareDeep(note, o.note, true) && compareDeep(outcome, o.outcome, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Goal)) + return false; + Goal o = (Goal) other; + return compareValues(description, o.description, true) && compareValues(status, o.status, true) && compareValues(statusDate, o.statusDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (start == null || start.isEmpty()) && (target == null || target.isEmpty()) && (category == null || category.isEmpty()) + && (description == null || description.isEmpty()) && (status == null || status.isEmpty()) + && (statusDate == null || statusDate.isEmpty()) && (statusReason == null || statusReason.isEmpty()) + && (author == null || author.isEmpty()) && (priority == null || priority.isEmpty()) && (addresses == null || addresses.isEmpty()) + && (note == null || note.isEmpty()) && (outcome == null || outcome.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Goal; + } + + /** + * Search parameter: targetdate + *

+ * Description: Reach goal on or before
+ * Type: date
+ * Path: Goal.targetDate
+ *

+ */ + @SearchParamDefinition(name="targetdate", path="Goal.target.as(Date)", description="Reach goal on or before", type="date" ) + public static final String SP_TARGETDATE = "targetdate"; + /** + * Fluent Client search parameter constant for targetdate + *

+ * Description: Reach goal on or before
+ * Type: date
+ * Path: Goal.targetDate
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam TARGETDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_TARGETDATE); + + /** + * Search parameter: category + *

+ * Description: E.g. Treatment, dietary, behavioral, etc.
+ * Type: token
+ * Path: Goal.category
+ *

+ */ + @SearchParamDefinition(name="category", path="Goal.category", description="E.g. Treatment, dietary, behavioral, etc.", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: E.g. Treatment, dietary, behavioral, etc.
+ * Type: token
+ * Path: Goal.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: patient + *

+ * Description: Who this goal is intended for
+ * Type: reference
+ * Path: Goal.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Goal.subject", description="Who this goal is intended for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who this goal is intended for
+ * Type: reference
+ * Path: Goal.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Goal:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Goal:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled
+ * Type: token
+ * Path: Goal.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Goal.status", description="proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled
+ * Type: token
+ * Path: Goal.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: Who this goal is intended for
+ * Type: reference
+ * Path: Goal.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Goal.subject", description="Who this goal is intended for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Who this goal is intended for
+ * Type: reference
+ * Path: Goal.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Goal:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Goal:subject").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: External Ids for this goal
+ * Type: token
+ * Path: Goal.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Goal.identifier", description="External Ids for this goal", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: External Ids for this goal
+ * Type: token
+ * Path: Goal.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Group.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Group.java new file mode 100644 index 00000000000..bfb4b411a0d --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Group.java @@ -0,0 +1,1681 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. + */ +@ResourceDef(name="Group", profile="http://hl7.org/fhir/Profile/Group") +public class Group extends DomainResource { + + public enum GroupType { + /** + * Group contains "person" Patient resources + */ + PERSON, + /** + * Group contains "animal" Patient resources + */ + ANIMAL, + /** + * Group contains healthcare practitioner resources + */ + PRACTITIONER, + /** + * Group contains Device resources + */ + DEVICE, + /** + * Group contains Medication resources + */ + MEDICATION, + /** + * Group contains Substance resources + */ + SUBSTANCE, + /** + * added to help the parsers + */ + NULL; + public static GroupType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("person".equals(codeString)) + return PERSON; + if ("animal".equals(codeString)) + return ANIMAL; + if ("practitioner".equals(codeString)) + return PRACTITIONER; + if ("device".equals(codeString)) + return DEVICE; + if ("medication".equals(codeString)) + return MEDICATION; + if ("substance".equals(codeString)) + return SUBSTANCE; + throw new FHIRException("Unknown GroupType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PERSON: return "person"; + case ANIMAL: return "animal"; + case PRACTITIONER: return "practitioner"; + case DEVICE: return "device"; + case MEDICATION: return "medication"; + case SUBSTANCE: return "substance"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PERSON: return "http://hl7.org/fhir/group-type"; + case ANIMAL: return "http://hl7.org/fhir/group-type"; + case PRACTITIONER: return "http://hl7.org/fhir/group-type"; + case DEVICE: return "http://hl7.org/fhir/group-type"; + case MEDICATION: return "http://hl7.org/fhir/group-type"; + case SUBSTANCE: return "http://hl7.org/fhir/group-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PERSON: return "Group contains \"person\" Patient resources"; + case ANIMAL: return "Group contains \"animal\" Patient resources"; + case PRACTITIONER: return "Group contains healthcare practitioner resources"; + case DEVICE: return "Group contains Device resources"; + case MEDICATION: return "Group contains Medication resources"; + case SUBSTANCE: return "Group contains Substance resources"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PERSON: return "Person"; + case ANIMAL: return "Animal"; + case PRACTITIONER: return "Practitioner"; + case DEVICE: return "Device"; + case MEDICATION: return "Medication"; + case SUBSTANCE: return "Substance"; + default: return "?"; + } + } + } + + 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; + if ("person".equals(codeString)) + return GroupType.PERSON; + if ("animal".equals(codeString)) + return GroupType.ANIMAL; + if ("practitioner".equals(codeString)) + return GroupType.PRACTITIONER; + if ("device".equals(codeString)) + return GroupType.DEVICE; + if ("medication".equals(codeString)) + return GroupType.MEDICATION; + if ("substance".equals(codeString)) + return GroupType.SUBSTANCE; + throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("person".equals(codeString)) + return new Enumeration(this, GroupType.PERSON); + if ("animal".equals(codeString)) + return new Enumeration(this, GroupType.ANIMAL); + if ("practitioner".equals(codeString)) + return new Enumeration(this, GroupType.PRACTITIONER); + if ("device".equals(codeString)) + return new Enumeration(this, GroupType.DEVICE); + if ("medication".equals(codeString)) + return new Enumeration(this, GroupType.MEDICATION); + if ("substance".equals(codeString)) + return new Enumeration(this, GroupType.SUBSTANCE); + throw new FHIRException("Unknown GroupType code '"+codeString+"'"); + } + public String toCode(GroupType code) { + if (code == GroupType.PERSON) + return "person"; + if (code == GroupType.ANIMAL) + return "animal"; + if (code == GroupType.PRACTITIONER) + return "practitioner"; + if (code == GroupType.DEVICE) + return "device"; + if (code == GroupType.MEDICATION) + return "medication"; + if (code == GroupType.SUBSTANCE) + return "substance"; + return "?"; + } + public String toSystem(GroupType code) { + return code.getSystem(); + } + } + + @Block() + public static class GroupCharacteristicComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code that identifies the kind of trait being asserted. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Kind of characteristic", formalDefinition="A code that identifies the kind of trait being asserted." ) + protected CodeableConcept code; + + /** + * The value of the trait that holds (or does not hold - see 'exclude') for members of the group. + */ + @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, Quantity.class, Range.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Value held by characteristic", formalDefinition="The value of the trait that holds (or does not hold - see 'exclude') for members of the group." ) + protected Type value; + + /** + * If true, indicates the characteristic is one that is NOT held by members of the group. + */ + @Child(name = "exclude", type = {BooleanType.class}, order=3, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="Group includes or excludes", formalDefinition="If true, indicates the characteristic is one that is NOT held by members of the group." ) + protected BooleanType exclude; + + /** + * The period over which the characteristic is tested; e.g. the patient had an operation during the month of June. + */ + @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Period over which characteristic is tested", formalDefinition="The period over which the characteristic is tested; e.g. the patient had an operation during the month of June." ) + protected Period period; + + private static final long serialVersionUID = -1000688967L; + + /** + * Constructor + */ + public GroupCharacteristicComponent() { + super(); + } + + /** + * Constructor + */ + public GroupCharacteristicComponent(CodeableConcept code, Type value, BooleanType exclude) { + super(); + this.code = code; + this.value = value; + this.exclude = exclude; + } + + /** + * @return {@link #code} (A code that identifies the kind of trait being asserted.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupCharacteristicComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code that identifies the kind of trait being asserted.) + */ + public GroupCharacteristicComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public CodeableConcept getValueCodeableConcept() throws FHIRException { + if (!(this.value instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + public boolean hasValueCodeableConcept() { + return this.value instanceof CodeableConcept; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public BooleanType getValueBooleanType() throws FHIRException { + if (!(this.value instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + public boolean hasValueBooleanType() { + return this.value instanceof BooleanType; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Quantity getValueQuantity() throws FHIRException { + if (!(this.value instanceof Quantity)) + throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + public boolean hasValueQuantity() { + return this.value instanceof Quantity; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Range getValueRange() throws FHIRException { + if (!(this.value instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Range) this.value; + } + + public boolean hasValueRange() { + return this.value instanceof Range; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public GroupCharacteristicComponent setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value + */ + public BooleanType getExcludeElement() { + if (this.exclude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupCharacteristicComponent.exclude"); + else if (Configuration.doAutoCreate()) + this.exclude = new BooleanType(); // bb + return this.exclude; + } + + public boolean hasExcludeElement() { + return this.exclude != null && !this.exclude.isEmpty(); + } + + public boolean hasExclude() { + return this.exclude != null && !this.exclude.isEmpty(); + } + + /** + * @param value {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value + */ + public GroupCharacteristicComponent setExcludeElement(BooleanType value) { + this.exclude = value; + return this; + } + + /** + * @return If true, indicates the characteristic is one that is NOT held by members of the group. + */ + public boolean getExclude() { + return this.exclude == null || this.exclude.isEmpty() ? false : this.exclude.getValue(); + } + + /** + * @param value If true, indicates the characteristic is one that is NOT held by members of the group. + */ + public GroupCharacteristicComponent setExclude(boolean value) { + if (this.exclude == null) + this.exclude = new BooleanType(); + this.exclude.setValue(value); + return this; + } + + /** + * @return {@link #period} (The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupCharacteristicComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.) + */ + public GroupCharacteristicComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A code that identifies the kind of trait being asserted.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("exclude", "boolean", "If true, indicates the characteristic is one that is NOT held by members of the group.", 0, java.lang.Integer.MAX_VALUE, exclude)); + childrenList.add(new Property("period", "Period", "The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : new Base[] {this.exclude}; // BooleanType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 111972721: // value + this.value = (Type) value; // Type + break; + case -1321148966: // exclude + this.exclude = castToBoolean(value); // BooleanType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("value[x]")) + this.value = (Type) value; // Type + else if (name.equals("exclude")) + this.exclude = castToBoolean(value); // BooleanType + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case -1410166417: return getValue(); // Type + case -1321148966: throw new FHIRException("Cannot make property exclude as it is not a complex type"); // BooleanType + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else if (name.equals("exclude")) { + throw new FHIRException("Cannot call addChild on a primitive type Group.exclude"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public GroupCharacteristicComponent copy() { + GroupCharacteristicComponent dst = new GroupCharacteristicComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + dst.exclude = exclude == null ? null : exclude.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GroupCharacteristicComponent)) + return false; + GroupCharacteristicComponent o = (GroupCharacteristicComponent) other; + return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(exclude, o.exclude, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GroupCharacteristicComponent)) + return false; + GroupCharacteristicComponent o = (GroupCharacteristicComponent) other; + return compareValues(exclude, o.exclude, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + && (exclude == null || exclude.isEmpty()) && (period == null || period.isEmpty()); + } + + public String fhirType() { + return "Group.characteristic"; + + } + + } + + @Block() + public static class GroupMemberComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A reference to the entity that is a member of the group. Must be consistent with Group.type. + */ + @Child(name = "entity", type = {Patient.class, Practitioner.class, Device.class, Medication.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reference to the group member", formalDefinition="A reference to the entity that is a member of the group. Must be consistent with Group.type." ) + protected Reference entity; + + /** + * The actual object that is the target of the reference (A reference to the entity that is a member of the group. Must be consistent with Group.type.) + */ + protected Resource entityTarget; + + /** + * The period that the member was in the group, if known. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Period member belonged to the group", formalDefinition="The period that the member was in the group, if known." ) + protected Period period; + + /** + * A flag to indicate that the member is no longer in the group, but previously may have been a member. + */ + @Child(name = "inactive", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If member is no longer in group", formalDefinition="A flag to indicate that the member is no longer in the group, but previously may have been a member." ) + protected BooleanType inactive; + + private static final long serialVersionUID = -333869055L; + + /** + * Constructor + */ + public GroupMemberComponent() { + super(); + } + + /** + * Constructor + */ + public GroupMemberComponent(Reference entity) { + super(); + this.entity = entity; + } + + /** + * @return {@link #entity} (A reference to the entity that is a member of the group. Must be consistent with Group.type.) + */ + public Reference getEntity() { + if (this.entity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupMemberComponent.entity"); + else if (Configuration.doAutoCreate()) + this.entity = new Reference(); // cc + return this.entity; + } + + public boolean hasEntity() { + return this.entity != null && !this.entity.isEmpty(); + } + + /** + * @param value {@link #entity} (A reference to the entity that is a member of the group. Must be consistent with Group.type.) + */ + public GroupMemberComponent setEntity(Reference value) { + this.entity = value; + return this; + } + + /** + * @return {@link #entity} 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 entity that is a member of the group. Must be consistent with Group.type.) + */ + public Resource getEntityTarget() { + return this.entityTarget; + } + + /** + * @param value {@link #entity} 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 entity that is a member of the group. Must be consistent with Group.type.) + */ + public GroupMemberComponent setEntityTarget(Resource value) { + this.entityTarget = value; + return this; + } + + /** + * @return {@link #period} (The period that the member was in the group, if known.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupMemberComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period that the member was in the group, if known.) + */ + public GroupMemberComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #inactive} (A flag to indicate that the member is no longer in the group, but previously may have been a member.). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value + */ + public BooleanType getInactiveElement() { + if (this.inactive == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupMemberComponent.inactive"); + else if (Configuration.doAutoCreate()) + this.inactive = new BooleanType(); // bb + return this.inactive; + } + + public boolean hasInactiveElement() { + return this.inactive != null && !this.inactive.isEmpty(); + } + + public boolean hasInactive() { + return this.inactive != null && !this.inactive.isEmpty(); + } + + /** + * @param value {@link #inactive} (A flag to indicate that the member is no longer in the group, but previously may have been a member.). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value + */ + public GroupMemberComponent setInactiveElement(BooleanType value) { + this.inactive = value; + return this; + } + + /** + * @return A flag to indicate that the member is no longer in the group, but previously may have been a member. + */ + public boolean getInactive() { + return this.inactive == null || this.inactive.isEmpty() ? false : this.inactive.getValue(); + } + + /** + * @param value A flag to indicate that the member is no longer in the group, but previously may have been a member. + */ + public GroupMemberComponent setInactive(boolean value) { + if (this.inactive == null) + this.inactive = new BooleanType(); + this.inactive.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("entity", "Reference(Patient|Practitioner|Device|Medication|Substance)", "A reference to the entity that is a member of the group. Must be consistent with Group.type.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("period", "Period", "The period that the member was in the group, if known.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("inactive", "boolean", "A flag to indicate that the member is no longer in the group, but previously may have been a member.", 0, java.lang.Integer.MAX_VALUE, inactive)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 24665195: /*inactive*/ return this.inactive == null ? new Base[0] : new Base[] {this.inactive}; // BooleanType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1298275357: // entity + this.entity = castToReference(value); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case 24665195: // inactive + this.inactive = castToBoolean(value); // BooleanType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("entity")) + this.entity = castToReference(value); // Reference + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("inactive")) + this.inactive = castToBoolean(value); // BooleanType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1298275357: return getEntity(); // Reference + case -991726143: return getPeriod(); // Period + case 24665195: throw new FHIRException("Cannot make property inactive as it is not a complex type"); // BooleanType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("entity")) { + this.entity = new Reference(); + return this.entity; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("inactive")) { + throw new FHIRException("Cannot call addChild on a primitive type Group.inactive"); + } + else + return super.addChild(name); + } + + public GroupMemberComponent copy() { + GroupMemberComponent dst = new GroupMemberComponent(); + copyValues(dst); + dst.entity = entity == null ? null : entity.copy(); + dst.period = period == null ? null : period.copy(); + dst.inactive = inactive == null ? null : inactive.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GroupMemberComponent)) + return false; + GroupMemberComponent o = (GroupMemberComponent) other; + return compareDeep(entity, o.entity, true) && compareDeep(period, o.period, true) && compareDeep(inactive, o.inactive, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GroupMemberComponent)) + return false; + GroupMemberComponent o = (GroupMemberComponent) other; + return compareValues(inactive, o.inactive, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (entity == null || entity.isEmpty()) && (period == null || period.isEmpty()) + && (inactive == null || inactive.isEmpty()); + } + + public String fhirType() { + return "Group.member"; + + } + + } + + /** + * A unique business identifier for this group. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique id", formalDefinition="A unique business identifier for this group." ) + protected List identifier; + + /** + * Identifies the broad classification of the kind of resources the group includes. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="person | animal | practitioner | device | medication | substance", formalDefinition="Identifies the broad classification of the kind of resources the group includes." ) + protected Enumeration type; + + /** + * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + @Child(name = "actual", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Descriptive or actual", formalDefinition="If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals." ) + protected BooleanType actual; + + /** + * Indicates whether the record for the group is available for use or is merely being retained for historical purposes. + */ + @Child(name = "active", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether this group's record is in active use", formalDefinition="Indicates whether the record for the group is available for use or is merely being retained for historical purposes." ) + protected BooleanType active; + + /** + * Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Kind of Group members", formalDefinition="Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc." ) + protected CodeableConcept code; + + /** + * A label assigned to the group for human identification and communication. + */ + @Child(name = "name", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Label for Group", formalDefinition="A label assigned to the group for human identification and communication." ) + protected StringType name; + + /** + * A count of the number of resource instances that are part of the group. + */ + @Child(name = "quantity", type = {UnsignedIntType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of members", formalDefinition="A count of the number of resource instances that are part of the group." ) + protected UnsignedIntType quantity; + + /** + * Identifies the traits shared by members of the group. + */ + @Child(name = "characteristic", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Trait of group members", formalDefinition="Identifies the traits shared by members of the group." ) + protected List characteristic; + + /** + * Identifies the resource instances that are members of the group. + */ + @Child(name = "member", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Who or what is in group", formalDefinition="Identifies the resource instances that are members of the group." ) + protected List member; + + private static final long serialVersionUID = -437086579L; + + /** + * Constructor + */ + public Group() { + super(); + } + + /** + * Constructor + */ + public Group(Enumeration type, BooleanType actual) { + super(); + this.type = type; + this.actual = actual; + } + + /** + * @return {@link #identifier} (A unique business identifier for this group.) + */ + 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} (A unique business identifier for this group.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Group addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #type} (Identifies the broad classification of the kind of resources the group includes.). 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 Group.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new GroupTypeEnumFactory()); // bb + 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} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Group setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identifies the broad classification of the kind of resources the group includes. + */ + public GroupType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identifies the broad classification of the kind of resources the group includes. + */ + public Group setType(GroupType value) { + if (this.type == null) + this.type = new Enumeration(new GroupTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value + */ + public BooleanType getActualElement() { + if (this.actual == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.actual"); + else if (Configuration.doAutoCreate()) + this.actual = new BooleanType(); // bb + return this.actual; + } + + public boolean hasActualElement() { + return this.actual != null && !this.actual.isEmpty(); + } + + public boolean hasActual() { + return this.actual != null && !this.actual.isEmpty(); + } + + /** + * @param value {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value + */ + public Group setActualElement(BooleanType value) { + this.actual = value; + return this; + } + + /** + * @return If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + public boolean getActual() { + return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue(); + } + + /** + * @param value If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + public Group setActual(boolean value) { + if (this.actual == null) + this.actual = new BooleanType(); + this.actual.setValue(value); + return this; + } + + /** + * @return {@link #active} (Indicates whether the record for the group is available for use or is merely being retained for historical purposes.). 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 Group.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); // bb + 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} (Indicates whether the record for the group is available for use or is merely being retained for historical purposes.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Group setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Indicates whether the record for the group is available for use or is merely being retained for historical purposes. + */ + public boolean getActive() { + return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Indicates whether the record for the group is available for use or is merely being retained for historical purposes. + */ + public Group setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + /** + * @return {@link #code} (Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.) + */ + public Group setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #name} (A label assigned to the group for human identification and communication.). 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 Group.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Group setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A label assigned to the group for human identification and communication. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A label assigned to the group for human identification and communication. + */ + public Group setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value + */ + public UnsignedIntType getQuantityElement() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new UnsignedIntType(); // bb + return this.quantity; + } + + public boolean hasQuantityElement() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value + */ + public Group setQuantityElement(UnsignedIntType value) { + this.quantity = value; + return this; + } + + /** + * @return A count of the number of resource instances that are part of the group. + */ + public int getQuantity() { + return this.quantity == null || this.quantity.isEmpty() ? 0 : this.quantity.getValue(); + } + + /** + * @param value A count of the number of resource instances that are part of the group. + */ + public Group setQuantity(int value) { + if (this.quantity == null) + this.quantity = new UnsignedIntType(); + this.quantity.setValue(value); + return this; + } + + /** + * @return {@link #characteristic} (Identifies the traits shared by members of the group.) + */ + public List getCharacteristic() { + if (this.characteristic == null) + this.characteristic = new ArrayList(); + return this.characteristic; + } + + public boolean hasCharacteristic() { + if (this.characteristic == null) + return false; + for (GroupCharacteristicComponent item : this.characteristic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #characteristic} (Identifies the traits shared by members of the group.) + */ + // syntactic sugar + public GroupCharacteristicComponent addCharacteristic() { //3 + GroupCharacteristicComponent t = new GroupCharacteristicComponent(); + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return t; + } + + // syntactic sugar + public Group addCharacteristic(GroupCharacteristicComponent t) { //3 + if (t == null) + return this; + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return this; + } + + /** + * @return {@link #member} (Identifies the resource instances that are members of the group.) + */ + public List getMember() { + if (this.member == null) + this.member = new ArrayList(); + return this.member; + } + + public boolean hasMember() { + if (this.member == null) + return false; + for (GroupMemberComponent item : this.member) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #member} (Identifies the resource instances that are members of the group.) + */ + // syntactic sugar + public GroupMemberComponent addMember() { //3 + GroupMemberComponent t = new GroupMemberComponent(); + if (this.member == null) + this.member = new ArrayList(); + this.member.add(t); + return t; + } + + // syntactic sugar + public Group addMember(GroupMemberComponent t) { //3 + if (t == null) + return this; + if (this.member == null) + this.member = new ArrayList(); + this.member.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("actual", "boolean", "If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.", 0, java.lang.Integer.MAX_VALUE, actual)); + childrenList.add(new Property("active", "boolean", "Indicates whether the record for the group is available for use or is merely being retained for historical purposes.", 0, java.lang.Integer.MAX_VALUE, active)); + childrenList.add(new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("quantity", "unsignedInt", "A count of the number of resource instances that are part of the group.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("characteristic", "", "Identifies the traits shared by members of the group.", 0, java.lang.Integer.MAX_VALUE, characteristic)); + childrenList.add(new Property("member", "", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType + case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // UnsignedIntType + case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // GroupCharacteristicComponent + case -1077769574: /*member*/ return this.member == null ? new Base[0] : this.member.toArray(new Base[this.member.size()]); // GroupMemberComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 3575610: // type + this.type = new GroupTypeEnumFactory().fromType(value); // Enumeration + break; + case -1422939762: // actual + this.actual = castToBoolean(value); // BooleanType + break; + case -1422950650: // active + this.active = castToBoolean(value); // BooleanType + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1285004149: // quantity + this.quantity = castToUnsignedInt(value); // UnsignedIntType + break; + case 366313883: // characteristic + this.getCharacteristic().add((GroupCharacteristicComponent) value); // GroupCharacteristicComponent + break; + case -1077769574: // member + this.getMember().add((GroupMemberComponent) value); // GroupMemberComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("type")) + this.type = new GroupTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("actual")) + this.actual = castToBoolean(value); // BooleanType + else if (name.equals("active")) + this.active = castToBoolean(value); // BooleanType + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("quantity")) + this.quantity = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("characteristic")) + this.getCharacteristic().add((GroupCharacteristicComponent) value); + else if (name.equals("member")) + this.getMember().add((GroupMemberComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -1422939762: throw new FHIRException("Cannot make property actual as it is not a complex type"); // BooleanType + case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType + case 3059181: return getCode(); // CodeableConcept + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1285004149: throw new FHIRException("Cannot make property quantity as it is not a complex type"); // UnsignedIntType + case 366313883: return addCharacteristic(); // GroupCharacteristicComponent + case -1077769574: return addMember(); // GroupMemberComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Group.type"); + } + else if (name.equals("actual")) { + throw new FHIRException("Cannot call addChild on a primitive type Group.actual"); + } + else if (name.equals("active")) { + throw new FHIRException("Cannot call addChild on a primitive type Group.active"); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Group.name"); + } + else if (name.equals("quantity")) { + throw new FHIRException("Cannot call addChild on a primitive type Group.quantity"); + } + else if (name.equals("characteristic")) { + return addCharacteristic(); + } + else if (name.equals("member")) { + return addMember(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Group"; + + } + + public Group copy() { + Group dst = new Group(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.actual = actual == null ? null : actual.copy(); + dst.active = active == null ? null : active.copy(); + dst.code = code == null ? null : code.copy(); + dst.name = name == null ? null : name.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + if (characteristic != null) { + dst.characteristic = new ArrayList(); + for (GroupCharacteristicComponent i : characteristic) + dst.characteristic.add(i.copy()); + }; + if (member != null) { + dst.member = new ArrayList(); + for (GroupMemberComponent i : member) + dst.member.add(i.copy()); + }; + return dst; + } + + protected Group typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Group)) + return false; + Group o = (Group) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(actual, o.actual, true) + && compareDeep(active, o.active, true) && compareDeep(code, o.code, true) && compareDeep(name, o.name, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(characteristic, o.characteristic, true) + && compareDeep(member, o.member, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Group)) + return false; + Group o = (Group) other; + return compareValues(type, o.type, true) && compareValues(actual, o.actual, true) && compareValues(active, o.active, true) + && compareValues(name, o.name, true) && compareValues(quantity, o.quantity, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (actual == null || actual.isEmpty()) && (active == null || active.isEmpty()) && (code == null || code.isEmpty()) + && (name == null || name.isEmpty()) && (quantity == null || quantity.isEmpty()) && (characteristic == null || characteristic.isEmpty()) + && (member == null || member.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Group; + } + + /** + * Search parameter: member + *

+ * Description: Reference to the group member
+ * Type: reference
+ * Path: Group.member.entity
+ *

+ */ + @SearchParamDefinition(name="member", path="Group.member.entity", description="Reference to the group member", type="reference" ) + public static final String SP_MEMBER = "member"; + /** + * Fluent Client search parameter constant for member + *

+ * Description: Reference to the group member
+ * Type: reference
+ * Path: Group.member.entity
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEMBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEMBER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Group:member". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_MEMBER = new ca.uhn.fhir.model.api.Include("Group:member").toLocked(); + + /** + * Search parameter: characteristic-value + *

+ * Description: A composite of both characteristic and value
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="characteristic-value", path="", description="A composite of both characteristic and value", type="composite", compositeOf={"characteristic", "value"} ) + public static final String SP_CHARACTERISTIC_VALUE = "characteristic-value"; + /** + * Fluent Client search parameter constant for characteristic-value + *

+ * Description: A composite of both characteristic and value
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CHARACTERISTIC_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CHARACTERISTIC_VALUE); + + /** + * Search parameter: value + *

+ * Description: Value held by characteristic
+ * Type: token
+ * Path: Group.characteristic.value[x]
+ *

+ */ + @SearchParamDefinition(name="value", path="Group.characteristic.value", description="Value held by characteristic", type="token" ) + public static final String SP_VALUE = "value"; + /** + * Fluent Client search parameter constant for value + *

+ * Description: Value held by characteristic
+ * Type: token
+ * Path: Group.characteristic.value[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VALUE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VALUE); + + /** + * Search parameter: actual + *

+ * Description: Descriptive or actual
+ * Type: token
+ * Path: Group.actual
+ *

+ */ + @SearchParamDefinition(name="actual", path="Group.actual", description="Descriptive or actual", type="token" ) + public static final String SP_ACTUAL = "actual"; + /** + * Fluent Client search parameter constant for actual + *

+ * Description: Descriptive or actual
+ * Type: token
+ * Path: Group.actual
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTUAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTUAL); + + /** + * Search parameter: exclude + *

+ * Description: Group includes or excludes
+ * Type: token
+ * Path: Group.characteristic.exclude
+ *

+ */ + @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="Group includes or excludes", type="token" ) + public static final String SP_EXCLUDE = "exclude"; + /** + * Fluent Client search parameter constant for exclude + *

+ * Description: Group includes or excludes
+ * Type: token
+ * Path: Group.characteristic.exclude
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXCLUDE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXCLUDE); + + /** + * Search parameter: code + *

+ * Description: The kind of resources contained
+ * Type: token
+ * Path: Group.code
+ *

+ */ + @SearchParamDefinition(name="code", path="Group.code", description="The kind of resources contained", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: The kind of resources contained
+ * Type: token
+ * Path: Group.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: characteristic + *

+ * Description: Kind of characteristic
+ * Type: token
+ * Path: Group.characteristic.code
+ *

+ */ + @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="Kind of characteristic", type="token" ) + public static final String SP_CHARACTERISTIC = "characteristic"; + /** + * Fluent Client search parameter constant for characteristic + *

+ * Description: Kind of characteristic
+ * Type: token
+ * Path: Group.characteristic.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC); + + /** + * Search parameter: type + *

+ * Description: The type of resources the group contains
+ * Type: token
+ * Path: Group.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Group.type", description="The type of resources the group contains", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The type of resources the group contains
+ * Type: token
+ * Path: Group.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: Unique id
+ * Type: token
+ * Path: Group.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Group.identifier", description="Unique id", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique id
+ * Type: token
+ * Path: Group.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/GuidanceResponse.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/GuidanceResponse.java new file mode 100644 index 00000000000..2e3cbaa3296 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/GuidanceResponse.java @@ -0,0 +1,2288 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +/** + * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. + */ +@ResourceDef(name="GuidanceResponse", profile="http://hl7.org/fhir/Profile/GuidanceResponse") +public class GuidanceResponse extends DomainResource { + + public enum GuidanceResponseStatus { + /** + * The request was processed successfully + */ + SUCCESS, + /** + * The request was processed successfully, but more data may result in a more complete evaluation + */ + DATAREQUESTED, + /** + * The request was processed, but more data is required to complete the evaluation + */ + DATAREQUIRED, + /** + * The request is currently being processed + */ + INPROGRESS, + /** + * The request was not processed successfully + */ + FAILURE, + /** + * added to help the parsers + */ + NULL; + public static GuidanceResponseStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("success".equals(codeString)) + return SUCCESS; + if ("data-requested".equals(codeString)) + return DATAREQUESTED; + if ("data-required".equals(codeString)) + return DATAREQUIRED; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("failure".equals(codeString)) + return FAILURE; + throw new FHIRException("Unknown GuidanceResponseStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case SUCCESS: return "success"; + case DATAREQUESTED: return "data-requested"; + case DATAREQUIRED: return "data-required"; + case INPROGRESS: return "in-progress"; + case FAILURE: return "failure"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SUCCESS: return "http://hl7.org/fhir/guidance-response-status"; + case DATAREQUESTED: return "http://hl7.org/fhir/guidance-response-status"; + case DATAREQUIRED: return "http://hl7.org/fhir/guidance-response-status"; + case INPROGRESS: return "http://hl7.org/fhir/guidance-response-status"; + case FAILURE: return "http://hl7.org/fhir/guidance-response-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SUCCESS: return "The request was processed successfully"; + case DATAREQUESTED: return "The request was processed successfully, but more data may result in a more complete evaluation"; + case DATAREQUIRED: return "The request was processed, but more data is required to complete the evaluation"; + case INPROGRESS: return "The request is currently being processed"; + case FAILURE: return "The request was not processed successfully"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SUCCESS: return "Success"; + case DATAREQUESTED: return "Data Requested"; + case DATAREQUIRED: return "Data Required"; + case INPROGRESS: return "In Progress"; + case FAILURE: return "Failure"; + default: return "?"; + } + } + } + + public static class GuidanceResponseStatusEnumFactory implements EnumFactory { + public GuidanceResponseStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("success".equals(codeString)) + return GuidanceResponseStatus.SUCCESS; + if ("data-requested".equals(codeString)) + return GuidanceResponseStatus.DATAREQUESTED; + if ("data-required".equals(codeString)) + return GuidanceResponseStatus.DATAREQUIRED; + if ("in-progress".equals(codeString)) + return GuidanceResponseStatus.INPROGRESS; + if ("failure".equals(codeString)) + return GuidanceResponseStatus.FAILURE; + throw new IllegalArgumentException("Unknown GuidanceResponseStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("success".equals(codeString)) + return new Enumeration(this, GuidanceResponseStatus.SUCCESS); + if ("data-requested".equals(codeString)) + return new Enumeration(this, GuidanceResponseStatus.DATAREQUESTED); + if ("data-required".equals(codeString)) + return new Enumeration(this, GuidanceResponseStatus.DATAREQUIRED); + if ("in-progress".equals(codeString)) + return new Enumeration(this, GuidanceResponseStatus.INPROGRESS); + if ("failure".equals(codeString)) + return new Enumeration(this, GuidanceResponseStatus.FAILURE); + throw new FHIRException("Unknown GuidanceResponseStatus code '"+codeString+"'"); + } + public String toCode(GuidanceResponseStatus code) { + if (code == GuidanceResponseStatus.SUCCESS) + return "success"; + if (code == GuidanceResponseStatus.DATAREQUESTED) + return "data-requested"; + if (code == GuidanceResponseStatus.DATAREQUIRED) + return "data-required"; + if (code == GuidanceResponseStatus.INPROGRESS) + return "in-progress"; + if (code == GuidanceResponseStatus.FAILURE) + return "failure"; + return "?"; + } + public String toSystem(GuidanceResponseStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class GuidanceResponseActionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique. + */ + @Child(name = "actionIdentifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique." ) + protected Identifier actionIdentifier; + + /** + * A user-visible label for the action. + */ + @Child(name = "label", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="User-visible label for the action (e.g. 1. or A.)", formalDefinition="A user-visible label for the action." ) + protected StringType label; + + /** + * The title of the action displayed to a user. + */ + @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="User-visible title", formalDefinition="The title of the action displayed to a user." ) + protected StringType title; + + /** + * A short description of the action used to provide a summary to display to the user. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Short description of the action", formalDefinition="A short description of the action used to provide a summary to display to the user." ) + protected StringType description; + + /** + * A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. + */ + @Child(name = "textEquivalent", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Static text equivalent of the action, used if the dynamic aspects cannot be interpreted by the receiving system", formalDefinition="A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically." ) + protected StringType textEquivalent; + + /** + * The concept represented by this action or its sub-actions. + */ + @Child(name = "concept", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The meaning of the action or its sub-actions", formalDefinition="The concept represented by this action or its sub-actions." ) + protected List concept; + + /** + * The evidence grade and the sources of evidence for this action. + */ + @Child(name = "supportingEvidence", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Evidence that supports taking the action", formalDefinition="The evidence grade and the sources of evidence for this action." ) + protected List supportingEvidence; + + /** + * A relationship to another action such as "before" or "30-60 minutes after start of". + */ + @Child(name = "relatedAction", type = {}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." ) + protected GuidanceResponseActionRelatedActionComponent relatedAction; + + /** + * Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. + */ + @Child(name = "documentation", type = {Attachment.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Supporting documentation for the intended performer of the action", formalDefinition="Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources." ) + protected List documentation; + + /** + * The participant in the action. + */ + @Child(name = "participant", type = {Patient.class, Person.class, Practitioner.class, RelatedPerson.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Participant", formalDefinition="The participant in the action." ) + protected List participant; + /** + * The actual objects that are the target of the reference (The participant in the action.) + */ + protected List participantTarget; + + + /** + * The type of action to perform (create, update, remove). + */ + @Child(name = "type", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." ) + protected CodeType type; + + /** + * A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment. + */ + @Child(name = "behavior", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Defines behaviors such as selection and grouping", formalDefinition="A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment." ) + protected List behavior; + + /** + * The resource that is the target of the action (e.g. CommunicationRequest). + */ + @Child(name = "resource", type = {}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The target of the action", formalDefinition="The resource that is the target of the action (e.g. CommunicationRequest)." ) + protected Reference resource; + + /** + * The actual object that is the target of the reference (The resource that is the target of the action (e.g. CommunicationRequest).) + */ + protected Resource resourceTarget; + + /** + * Sub actions. + */ + @Child(name = "action", type = {GuidanceResponseActionComponent.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Sub action", formalDefinition="Sub actions." ) + protected List action; + + private static final long serialVersionUID = -1602697381L; + + /** + * Constructor + */ + public GuidanceResponseActionComponent() { + super(); + } + + /** + * @return {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) + */ + public Identifier getActionIdentifier() { + if (this.actionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionComponent.actionIdentifier"); + else if (Configuration.doAutoCreate()) + this.actionIdentifier = new Identifier(); // cc + return this.actionIdentifier; + } + + public boolean hasActionIdentifier() { + return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); + } + + /** + * @param value {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) + */ + public GuidanceResponseActionComponent setActionIdentifier(Identifier value) { + this.actionIdentifier = value; + return this; + } + + /** + * @return {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public StringType getLabelElement() { + if (this.label == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionComponent.label"); + else if (Configuration.doAutoCreate()) + this.label = new StringType(); // bb + return this.label; + } + + public boolean hasLabelElement() { + return this.label != null && !this.label.isEmpty(); + } + + public boolean hasLabel() { + return this.label != null && !this.label.isEmpty(); + } + + /** + * @param value {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public GuidanceResponseActionComponent setLabelElement(StringType value) { + this.label = value; + return this; + } + + /** + * @return A user-visible label for the action. + */ + public String getLabel() { + return this.label == null ? null : this.label.getValue(); + } + + /** + * @param value A user-visible label for the action. + */ + public GuidanceResponseActionComponent setLabel(String value) { + if (Utilities.noString(value)) + this.label = null; + else { + if (this.label == null) + this.label = new StringType(); + this.label.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public GuidanceResponseActionComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The title of the action displayed to a user. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The title of the action displayed to a user. + */ + public GuidanceResponseActionComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A short description of the action used to provide a summary to display to the user.). 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 GuidanceResponseActionComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 short description of the action used to provide a summary to display to the user.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public GuidanceResponseActionComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A short description of the action used to provide a summary to display to the user. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A short description of the action used to provide a summary to display to the user. + */ + public GuidanceResponseActionComponent 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 #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value + */ + public StringType getTextEquivalentElement() { + if (this.textEquivalent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionComponent.textEquivalent"); + else if (Configuration.doAutoCreate()) + this.textEquivalent = new StringType(); // bb + return this.textEquivalent; + } + + public boolean hasTextEquivalentElement() { + return this.textEquivalent != null && !this.textEquivalent.isEmpty(); + } + + public boolean hasTextEquivalent() { + return this.textEquivalent != null && !this.textEquivalent.isEmpty(); + } + + /** + * @param value {@link #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value + */ + public GuidanceResponseActionComponent setTextEquivalentElement(StringType value) { + this.textEquivalent = value; + return this; + } + + /** + * @return A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. + */ + public String getTextEquivalent() { + return this.textEquivalent == null ? null : this.textEquivalent.getValue(); + } + + /** + * @param value A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. + */ + public GuidanceResponseActionComponent setTextEquivalent(String value) { + if (Utilities.noString(value)) + this.textEquivalent = null; + else { + if (this.textEquivalent == null) + this.textEquivalent = new StringType(); + this.textEquivalent.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (The concept represented by this action or its sub-actions.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (CodeableConcept item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (The concept represented by this action or its sub-actions.) + */ + // syntactic sugar + public CodeableConcept addConcept() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponseActionComponent addConcept(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + /** + * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) + */ + public List getSupportingEvidence() { + if (this.supportingEvidence == null) + this.supportingEvidence = new ArrayList(); + return this.supportingEvidence; + } + + public boolean hasSupportingEvidence() { + if (this.supportingEvidence == null) + return false; + for (Attachment item : this.supportingEvidence) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) + */ + // syntactic sugar + public Attachment addSupportingEvidence() { //3 + Attachment t = new Attachment(); + if (this.supportingEvidence == null) + this.supportingEvidence = new ArrayList(); + this.supportingEvidence.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponseActionComponent addSupportingEvidence(Attachment t) { //3 + if (t == null) + return this; + if (this.supportingEvidence == null) + this.supportingEvidence = new ArrayList(); + this.supportingEvidence.add(t); + return this; + } + + /** + * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) + */ + public GuidanceResponseActionRelatedActionComponent getRelatedAction() { + if (this.relatedAction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionComponent.relatedAction"); + else if (Configuration.doAutoCreate()) + this.relatedAction = new GuidanceResponseActionRelatedActionComponent(); // cc + return this.relatedAction; + } + + public boolean hasRelatedAction() { + return this.relatedAction != null && !this.relatedAction.isEmpty(); + } + + /** + * @param value {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) + */ + public GuidanceResponseActionComponent setRelatedAction(GuidanceResponseActionRelatedActionComponent value) { + this.relatedAction = value; + return this; + } + + /** + * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) + */ + public List getDocumentation() { + if (this.documentation == null) + this.documentation = new ArrayList(); + return this.documentation; + } + + public boolean hasDocumentation() { + if (this.documentation == null) + return false; + for (Attachment item : this.documentation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) + */ + // syntactic sugar + public Attachment addDocumentation() { //3 + Attachment t = new Attachment(); + if (this.documentation == null) + this.documentation = new ArrayList(); + this.documentation.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponseActionComponent addDocumentation(Attachment t) { //3 + if (t == null) + return this; + if (this.documentation == null) + this.documentation = new ArrayList(); + this.documentation.add(t); + return this; + } + + /** + * @return {@link #participant} (The participant in the action.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (Reference item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (The participant in the action.) + */ + // syntactic sugar + public Reference addParticipant() { //3 + Reference t = new Reference(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponseActionComponent addParticipant(Reference t) { //3 + if (t == null) + return this; + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return this; + } + + /** + * @return {@link #participant} (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 participant in the action.) + */ + public List getParticipantTarget() { + if (this.participantTarget == null) + this.participantTarget = new ArrayList(); + return this.participantTarget; + } + + /** + * @return {@link #type} (The type of action to perform (create, update, remove).). 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 GuidanceResponseActionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 of action to perform (create, update, remove).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public GuidanceResponseActionComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of action to perform (create, update, remove). + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of action to perform (create, update, remove). + */ + public GuidanceResponseActionComponent 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 #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) + */ + public List getBehavior() { + if (this.behavior == null) + this.behavior = new ArrayList(); + return this.behavior; + } + + public boolean hasBehavior() { + if (this.behavior == null) + return false; + for (GuidanceResponseActionBehaviorComponent item : this.behavior) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) + */ + // syntactic sugar + public GuidanceResponseActionBehaviorComponent addBehavior() { //3 + GuidanceResponseActionBehaviorComponent t = new GuidanceResponseActionBehaviorComponent(); + if (this.behavior == null) + this.behavior = new ArrayList(); + this.behavior.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponseActionComponent addBehavior(GuidanceResponseActionBehaviorComponent t) { //3 + if (t == null) + return this; + if (this.behavior == null) + this.behavior = new ArrayList(); + this.behavior.add(t); + return this; + } + + /** + * @return {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest).) + */ + public Reference getResource() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionComponent.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new Reference(); // cc + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest).) + */ + public GuidanceResponseActionComponent setResource(Reference value) { + this.resource = value; + return this; + } + + /** + * @return {@link #resource} 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 that is the target of the action (e.g. CommunicationRequest).) + */ + public Resource getResourceTarget() { + return this.resourceTarget; + } + + /** + * @param value {@link #resource} 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 that is the target of the action (e.g. CommunicationRequest).) + */ + public GuidanceResponseActionComponent setResourceTarget(Resource value) { + this.resourceTarget = value; + return this; + } + + /** + * @return {@link #action} (Sub actions.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (GuidanceResponseActionComponent item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Sub actions.) + */ + // syntactic sugar + public GuidanceResponseActionComponent addAction() { //3 + GuidanceResponseActionComponent t = new GuidanceResponseActionComponent(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponseActionComponent addAction(GuidanceResponseActionComponent t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("actionIdentifier", "Identifier", "A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); + childrenList.add(new Property("label", "string", "A user-visible label for the action.", 0, java.lang.Integer.MAX_VALUE, label)); + childrenList.add(new Property("title", "string", "The title of the action displayed to a user.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("description", "string", "A short description of the action used to provide a summary to display to the user.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("textEquivalent", "string", "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.", 0, java.lang.Integer.MAX_VALUE, textEquivalent)); + childrenList.add(new Property("concept", "CodeableConcept", "The concept represented by this action or its sub-actions.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("supportingEvidence", "Attachment", "The evidence grade and the sources of evidence for this action.", 0, java.lang.Integer.MAX_VALUE, supportingEvidence)); + childrenList.add(new Property("relatedAction", "", "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0, java.lang.Integer.MAX_VALUE, relatedAction)); + childrenList.add(new Property("documentation", "Attachment", "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("participant", "Reference(Patient|Person|Practitioner|RelatedPerson)", "The participant in the action.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("type", "code", "The type of action to perform (create, update, remove).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("behavior", "", "A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.", 0, java.lang.Integer.MAX_VALUE, behavior)); + childrenList.add(new Property("resource", "Reference(Any)", "The resource that is the target of the action (e.g. CommunicationRequest).", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("action", "@GuidanceResponse.action", "Sub actions.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier + case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -900391049: /*textEquivalent*/ return this.textEquivalent == null ? new Base[0] : new Base[] {this.textEquivalent}; // StringType + case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // CodeableConcept + case -1735429846: /*supportingEvidence*/ return this.supportingEvidence == null ? new Base[0] : this.supportingEvidence.toArray(new Base[this.supportingEvidence.size()]); // Attachment + case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : new Base[] {this.relatedAction}; // GuidanceResponseActionRelatedActionComponent + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // Attachment + case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case 1510912594: /*behavior*/ return this.behavior == null ? new Base[0] : this.behavior.toArray(new Base[this.behavior.size()]); // GuidanceResponseActionBehaviorComponent + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // GuidanceResponseActionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -889046145: // actionIdentifier + this.actionIdentifier = castToIdentifier(value); // Identifier + break; + case 102727412: // label + this.label = castToString(value); // StringType + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -900391049: // textEquivalent + this.textEquivalent = castToString(value); // StringType + break; + case 951024232: // concept + this.getConcept().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1735429846: // supportingEvidence + this.getSupportingEvidence().add(castToAttachment(value)); // Attachment + break; + case -384107967: // relatedAction + this.relatedAction = (GuidanceResponseActionRelatedActionComponent) value; // GuidanceResponseActionRelatedActionComponent + break; + case 1587405498: // documentation + this.getDocumentation().add(castToAttachment(value)); // Attachment + break; + case 767422259: // participant + this.getParticipant().add(castToReference(value)); // Reference + break; + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case 1510912594: // behavior + this.getBehavior().add((GuidanceResponseActionBehaviorComponent) value); // GuidanceResponseActionBehaviorComponent + break; + case -341064690: // resource + this.resource = castToReference(value); // Reference + break; + case -1422950858: // action + this.getAction().add((GuidanceResponseActionComponent) value); // GuidanceResponseActionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("actionIdentifier")) + this.actionIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("label")) + this.label = castToString(value); // StringType + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("textEquivalent")) + this.textEquivalent = castToString(value); // StringType + else if (name.equals("concept")) + this.getConcept().add(castToCodeableConcept(value)); + else if (name.equals("supportingEvidence")) + this.getSupportingEvidence().add(castToAttachment(value)); + else if (name.equals("relatedAction")) + this.relatedAction = (GuidanceResponseActionRelatedActionComponent) value; // GuidanceResponseActionRelatedActionComponent + else if (name.equals("documentation")) + this.getDocumentation().add(castToAttachment(value)); + else if (name.equals("participant")) + this.getParticipant().add(castToReference(value)); + else if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("behavior")) + this.getBehavior().add((GuidanceResponseActionBehaviorComponent) value); + else if (name.equals("resource")) + this.resource = castToReference(value); // Reference + else if (name.equals("action")) + this.getAction().add((GuidanceResponseActionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -889046145: return getActionIdentifier(); // Identifier + case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -900391049: throw new FHIRException("Cannot make property textEquivalent as it is not a complex type"); // StringType + case 951024232: return addConcept(); // CodeableConcept + case -1735429846: return addSupportingEvidence(); // Attachment + case -384107967: return getRelatedAction(); // GuidanceResponseActionRelatedActionComponent + case 1587405498: return addDocumentation(); // Attachment + case 767422259: return addParticipant(); // Reference + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case 1510912594: return addBehavior(); // GuidanceResponseActionBehaviorComponent + case -341064690: return getResource(); // Reference + case -1422950858: return addAction(); // GuidanceResponseActionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("actionIdentifier")) { + this.actionIdentifier = new Identifier(); + return this.actionIdentifier; + } + else if (name.equals("label")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.label"); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.title"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.description"); + } + else if (name.equals("textEquivalent")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.textEquivalent"); + } + else if (name.equals("concept")) { + return addConcept(); + } + else if (name.equals("supportingEvidence")) { + return addSupportingEvidence(); + } + else if (name.equals("relatedAction")) { + this.relatedAction = new GuidanceResponseActionRelatedActionComponent(); + return this.relatedAction; + } + else if (name.equals("documentation")) { + return addDocumentation(); + } + else if (name.equals("participant")) { + return addParticipant(); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.type"); + } + else if (name.equals("behavior")) { + return addBehavior(); + } + else if (name.equals("resource")) { + this.resource = new Reference(); + return this.resource; + } + else if (name.equals("action")) { + return addAction(); + } + else + return super.addChild(name); + } + + public GuidanceResponseActionComponent copy() { + GuidanceResponseActionComponent dst = new GuidanceResponseActionComponent(); + copyValues(dst); + dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); + dst.label = label == null ? null : label.copy(); + dst.title = title == null ? null : title.copy(); + dst.description = description == null ? null : description.copy(); + dst.textEquivalent = textEquivalent == null ? null : textEquivalent.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (CodeableConcept i : concept) + dst.concept.add(i.copy()); + }; + if (supportingEvidence != null) { + dst.supportingEvidence = new ArrayList(); + for (Attachment i : supportingEvidence) + dst.supportingEvidence.add(i.copy()); + }; + dst.relatedAction = relatedAction == null ? null : relatedAction.copy(); + if (documentation != null) { + dst.documentation = new ArrayList(); + for (Attachment i : documentation) + dst.documentation.add(i.copy()); + }; + if (participant != null) { + dst.participant = new ArrayList(); + for (Reference i : participant) + dst.participant.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (behavior != null) { + dst.behavior = new ArrayList(); + for (GuidanceResponseActionBehaviorComponent i : behavior) + dst.behavior.add(i.copy()); + }; + dst.resource = resource == null ? null : resource.copy(); + if (action != null) { + dst.action = new ArrayList(); + for (GuidanceResponseActionComponent i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GuidanceResponseActionComponent)) + return false; + GuidanceResponseActionComponent o = (GuidanceResponseActionComponent) other; + return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(label, o.label, true) + && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) && compareDeep(textEquivalent, o.textEquivalent, true) + && compareDeep(concept, o.concept, true) && compareDeep(supportingEvidence, o.supportingEvidence, true) + && compareDeep(relatedAction, o.relatedAction, true) && compareDeep(documentation, o.documentation, true) + && compareDeep(participant, o.participant, true) && compareDeep(type, o.type, true) && compareDeep(behavior, o.behavior, true) + && compareDeep(resource, o.resource, true) && compareDeep(action, o.action, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GuidanceResponseActionComponent)) + return false; + GuidanceResponseActionComponent o = (GuidanceResponseActionComponent) other; + return compareValues(label, o.label, true) && compareValues(title, o.title, true) && compareValues(description, o.description, true) + && compareValues(textEquivalent, o.textEquivalent, true) && compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (label == null || label.isEmpty()) + && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (textEquivalent == null || textEquivalent.isEmpty()) + && (concept == null || concept.isEmpty()) && (supportingEvidence == null || supportingEvidence.isEmpty()) + && (relatedAction == null || relatedAction.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (participant == null || participant.isEmpty()) && (type == null || type.isEmpty()) && (behavior == null || behavior.isEmpty()) + && (resource == null || resource.isEmpty()) && (action == null || action.isEmpty()); + } + + public String fhirType() { + return "GuidanceResponse.action"; + + } + + } + + @Block() + public static class GuidanceResponseActionRelatedActionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The unique identifier of the related action. + */ + @Child(name = "actionIdentifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Identifier of the related action", formalDefinition="The unique identifier of the related action." ) + protected Identifier actionIdentifier; + + /** + * The relationship of this action to the related action. + */ + @Child(name = "relationship", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="before | after", formalDefinition="The relationship of this action to the related action." ) + protected CodeType relationship; + + /** + * A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. + */ + @Child(name = "offset", type = {Duration.class, Range.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Time offset for the relationship", formalDefinition="A duration or range of durations to apply to the relationship. For example, 30-60 minutes before." ) + protected Type offset; + + /** + * An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. + */ + @Child(name = "anchor", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="start | end", formalDefinition="An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action." ) + protected CodeType anchor; + + private static final long serialVersionUID = -1200619014L; + + /** + * Constructor + */ + public GuidanceResponseActionRelatedActionComponent() { + super(); + } + + /** + * Constructor + */ + public GuidanceResponseActionRelatedActionComponent(Identifier actionIdentifier, CodeType relationship) { + super(); + this.actionIdentifier = actionIdentifier; + this.relationship = relationship; + } + + /** + * @return {@link #actionIdentifier} (The unique identifier of the related action.) + */ + public Identifier getActionIdentifier() { + if (this.actionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.actionIdentifier"); + else if (Configuration.doAutoCreate()) + this.actionIdentifier = new Identifier(); // cc + return this.actionIdentifier; + } + + public boolean hasActionIdentifier() { + return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); + } + + /** + * @param value {@link #actionIdentifier} (The unique identifier of the related action.) + */ + public GuidanceResponseActionRelatedActionComponent setActionIdentifier(Identifier value) { + this.actionIdentifier = value; + return this; + } + + /** + * @return {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value + */ + public CodeType getRelationshipElement() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new CodeType(); // bb + return this.relationship; + } + + public boolean hasRelationshipElement() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value + */ + public GuidanceResponseActionRelatedActionComponent setRelationshipElement(CodeType value) { + this.relationship = value; + return this; + } + + /** + * @return The relationship of this action to the related action. + */ + public String getRelationship() { + return this.relationship == null ? null : this.relationship.getValue(); + } + + /** + * @param value The relationship of this action to the related action. + */ + public GuidanceResponseActionRelatedActionComponent setRelationship(String value) { + if (this.relationship == null) + this.relationship = new CodeType(); + this.relationship.setValue(value); + return this; + } + + /** + * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) + */ + public Type getOffset() { + return this.offset; + } + + /** + * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) + */ + public Duration getOffsetDuration() throws FHIRException { + if (!(this.offset instanceof Duration)) + throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.offset.getClass().getName()+" was encountered"); + return (Duration) this.offset; + } + + public boolean hasOffsetDuration() { + return this.offset instanceof Duration; + } + + /** + * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) + */ + public Range getOffsetRange() throws FHIRException { + if (!(this.offset instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.offset.getClass().getName()+" was encountered"); + return (Range) this.offset; + } + + public boolean hasOffsetRange() { + return this.offset instanceof Range; + } + + public boolean hasOffset() { + return this.offset != null && !this.offset.isEmpty(); + } + + /** + * @param value {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) + */ + public GuidanceResponseActionRelatedActionComponent setOffset(Type value) { + this.offset = value; + return this; + } + + /** + * @return {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value + */ + public CodeType getAnchorElement() { + if (this.anchor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.anchor"); + else if (Configuration.doAutoCreate()) + this.anchor = new CodeType(); // bb + return this.anchor; + } + + public boolean hasAnchorElement() { + return this.anchor != null && !this.anchor.isEmpty(); + } + + public boolean hasAnchor() { + return this.anchor != null && !this.anchor.isEmpty(); + } + + /** + * @param value {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value + */ + public GuidanceResponseActionRelatedActionComponent setAnchorElement(CodeType value) { + this.anchor = value; + return this; + } + + /** + * @return An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. + */ + public String getAnchor() { + return this.anchor == null ? null : this.anchor.getValue(); + } + + /** + * @param value An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. + */ + public GuidanceResponseActionRelatedActionComponent setAnchor(String value) { + if (Utilities.noString(value)) + this.anchor = null; + else { + if (this.anchor == null) + this.anchor = new CodeType(); + this.anchor.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("actionIdentifier", "Identifier", "The unique identifier of the related action.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); + childrenList.add(new Property("relationship", "code", "The relationship of this action to the related action.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("offset[x]", "Duration|Range", "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, java.lang.Integer.MAX_VALUE, offset)); + childrenList.add(new Property("anchor", "code", "An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action.", 0, java.lang.Integer.MAX_VALUE, anchor)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeType + case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // Type + case -1413299531: /*anchor*/ return this.anchor == null ? new Base[0] : new Base[] {this.anchor}; // CodeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -889046145: // actionIdentifier + this.actionIdentifier = castToIdentifier(value); // Identifier + break; + case -261851592: // relationship + this.relationship = castToCode(value); // CodeType + break; + case -1019779949: // offset + this.offset = (Type) value; // Type + break; + case -1413299531: // anchor + this.anchor = castToCode(value); // CodeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("actionIdentifier")) + this.actionIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("relationship")) + this.relationship = castToCode(value); // CodeType + else if (name.equals("offset[x]")) + this.offset = (Type) value; // Type + else if (name.equals("anchor")) + this.anchor = castToCode(value); // CodeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -889046145: return getActionIdentifier(); // Identifier + case -261851592: throw new FHIRException("Cannot make property relationship as it is not a complex type"); // CodeType + case -1960684787: return getOffset(); // Type + case -1413299531: throw new FHIRException("Cannot make property anchor as it is not a complex type"); // CodeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("actionIdentifier")) { + this.actionIdentifier = new Identifier(); + return this.actionIdentifier; + } + else if (name.equals("relationship")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.relationship"); + } + else if (name.equals("offsetDuration")) { + this.offset = new Duration(); + return this.offset; + } + else if (name.equals("offsetRange")) { + this.offset = new Range(); + return this.offset; + } + else if (name.equals("anchor")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.anchor"); + } + else + return super.addChild(name); + } + + public GuidanceResponseActionRelatedActionComponent copy() { + GuidanceResponseActionRelatedActionComponent dst = new GuidanceResponseActionRelatedActionComponent(); + copyValues(dst); + dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.offset = offset == null ? null : offset.copy(); + dst.anchor = anchor == null ? null : anchor.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GuidanceResponseActionRelatedActionComponent)) + return false; + GuidanceResponseActionRelatedActionComponent o = (GuidanceResponseActionRelatedActionComponent) other; + return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(relationship, o.relationship, true) + && compareDeep(offset, o.offset, true) && compareDeep(anchor, o.anchor, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GuidanceResponseActionRelatedActionComponent)) + return false; + GuidanceResponseActionRelatedActionComponent o = (GuidanceResponseActionRelatedActionComponent) other; + return compareValues(relationship, o.relationship, true) && compareValues(anchor, o.anchor, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (relationship == null || relationship.isEmpty()) + && (offset == null || offset.isEmpty()) && (anchor == null || anchor.isEmpty()); + } + + public String fhirType() { + return "GuidanceResponse.action.relatedAction"; + + } + + } + + @Block() + public static class GuidanceResponseActionBehaviorComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of the behavior to be described, such as grouping, visual, or selection behaviors. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The type of behavior (grouping, precheck, selection, cardinality, etc)", formalDefinition="The type of the behavior to be described, such as grouping, visual, or selection behaviors." ) + protected Coding type; + + /** + * The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset. + */ + @Child(name = "value", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Specific behavior (e.g. required, at-most-one, single, etc)", formalDefinition="The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset." ) + protected Coding value; + + private static final long serialVersionUID = -1054119695L; + + /** + * Constructor + */ + public GuidanceResponseActionBehaviorComponent() { + super(); + } + + /** + * Constructor + */ + public GuidanceResponseActionBehaviorComponent(Coding type, Coding value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionBehaviorComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) + */ + public GuidanceResponseActionBehaviorComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) + */ + public Coding getValue() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponseActionBehaviorComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new Coding(); // cc + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) + */ + public GuidanceResponseActionBehaviorComponent setValue(Coding value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "The type of the behavior to be described, such as grouping, visual, or selection behaviors.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value", "Coding", "The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 111972721: // value + this.value = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("value")) + this.value = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 111972721: return getValue(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("value")) { + this.value = new Coding(); + return this.value; + } + else + return super.addChild(name); + } + + public GuidanceResponseActionBehaviorComponent copy() { + GuidanceResponseActionBehaviorComponent dst = new GuidanceResponseActionBehaviorComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GuidanceResponseActionBehaviorComponent)) + return false; + GuidanceResponseActionBehaviorComponent o = (GuidanceResponseActionBehaviorComponent) other; + return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GuidanceResponseActionBehaviorComponent)) + return false; + GuidanceResponseActionBehaviorComponent o = (GuidanceResponseActionBehaviorComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "GuidanceResponse.action.behavior"; + + } + + } + + /** + * The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. + */ + @Child(name = "requestId", type = {StringType.class}, order=0, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The id of the request associated with this response, if any", formalDefinition="The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario." ) + protected StringType requestId; + + /** + * A reference to the knowledge module that was invoked. + */ + @Child(name = "module", type = {DecisionSupportServiceModule.class, DecisionSupportRule.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="A reference to a knowledge module", formalDefinition="A reference to the knowledge module that was invoked." ) + protected Reference module; + + /** + * The actual object that is the target of the reference (A reference to the knowledge module that was invoked.) + */ + protected Resource moduleTarget; + + /** + * The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="success | data-requested | data-required | in-progress | failure", formalDefinition="The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information." ) + protected Enumeration status; + + /** + * Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element. + */ + @Child(name = "evaluationMessage", type = {OperationOutcome.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Messages resulting from the evaluation of the artifact or artifacts", formalDefinition="Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element." ) + protected List evaluationMessage; + /** + * The actual objects that are the target of the reference (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) + */ + protected List evaluationMessageTarget; + + + /** + * The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element. + */ + @Child(name = "outputParameters", type = {Parameters.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The output parameters of the evaluation, if any", formalDefinition="The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element." ) + protected Reference outputParameters; + + /** + * The actual object that is the target of the reference (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) + */ + protected Parameters outputParametersTarget; + + /** + * The actions, if any, produced by the evaluation of the artifact. + */ + @Child(name = "action", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Proposed actions, if any", formalDefinition="The actions, if any, produced by the evaluation of the artifact." ) + protected List action; + + /** + * If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data. + */ + @Child(name = "dataRequirement", type = {DataRequirement.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional required data", formalDefinition="If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data." ) + protected List dataRequirement; + + private static final long serialVersionUID = -918912174L; + + /** + * Constructor + */ + public GuidanceResponse() { + super(); + } + + /** + * Constructor + */ + public GuidanceResponse(Reference module, Enumeration status) { + super(); + this.module = module; + this.status = status; + } + + /** + * @return {@link #requestId} (The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.). This is the underlying object with id, value and extensions. The accessor "getRequestId" gives direct access to the value + */ + public StringType getRequestIdElement() { + if (this.requestId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponse.requestId"); + else if (Configuration.doAutoCreate()) + this.requestId = new StringType(); // bb + return this.requestId; + } + + public boolean hasRequestIdElement() { + return this.requestId != null && !this.requestId.isEmpty(); + } + + public boolean hasRequestId() { + return this.requestId != null && !this.requestId.isEmpty(); + } + + /** + * @param value {@link #requestId} (The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.). This is the underlying object with id, value and extensions. The accessor "getRequestId" gives direct access to the value + */ + public GuidanceResponse setRequestIdElement(StringType value) { + this.requestId = value; + return this; + } + + /** + * @return The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. + */ + public String getRequestId() { + return this.requestId == null ? null : this.requestId.getValue(); + } + + /** + * @param value The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. + */ + public GuidanceResponse setRequestId(String value) { + if (Utilities.noString(value)) + this.requestId = null; + else { + if (this.requestId == null) + this.requestId = new StringType(); + this.requestId.setValue(value); + } + return this; + } + + /** + * @return {@link #module} (A reference to the knowledge module that was invoked.) + */ + public Reference getModule() { + if (this.module == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponse.module"); + else if (Configuration.doAutoCreate()) + this.module = new Reference(); // cc + return this.module; + } + + public boolean hasModule() { + return this.module != null && !this.module.isEmpty(); + } + + /** + * @param value {@link #module} (A reference to the knowledge module that was invoked.) + */ + public GuidanceResponse setModule(Reference value) { + this.module = value; + return this; + } + + /** + * @return {@link #module} 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 knowledge module that was invoked.) + */ + public Resource getModuleTarget() { + return this.moduleTarget; + } + + /** + * @param value {@link #module} 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 knowledge module that was invoked.) + */ + public GuidanceResponse setModuleTarget(Resource value) { + this.moduleTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.). 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 GuidanceResponse.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new GuidanceResponseStatusEnumFactory()); // bb + 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 response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public GuidanceResponse setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. + */ + public GuidanceResponseStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. + */ + public GuidanceResponse setStatus(GuidanceResponseStatus value) { + if (this.status == null) + this.status = new Enumeration(new GuidanceResponseStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #evaluationMessage} (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) + */ + public List getEvaluationMessage() { + if (this.evaluationMessage == null) + this.evaluationMessage = new ArrayList(); + return this.evaluationMessage; + } + + public boolean hasEvaluationMessage() { + if (this.evaluationMessage == null) + return false; + for (Reference item : this.evaluationMessage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #evaluationMessage} (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) + */ + // syntactic sugar + public Reference addEvaluationMessage() { //3 + Reference t = new Reference(); + if (this.evaluationMessage == null) + this.evaluationMessage = new ArrayList(); + this.evaluationMessage.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponse addEvaluationMessage(Reference t) { //3 + if (t == null) + return this; + if (this.evaluationMessage == null) + this.evaluationMessage = new ArrayList(); + this.evaluationMessage.add(t); + return this; + } + + /** + * @return {@link #evaluationMessage} (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. Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) + */ + public List getEvaluationMessageTarget() { + if (this.evaluationMessageTarget == null) + this.evaluationMessageTarget = new ArrayList(); + return this.evaluationMessageTarget; + } + + // syntactic sugar + /** + * @return {@link #evaluationMessage} (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. Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) + */ + public OperationOutcome addEvaluationMessageTarget() { + OperationOutcome r = new OperationOutcome(); + if (this.evaluationMessageTarget == null) + this.evaluationMessageTarget = new ArrayList(); + this.evaluationMessageTarget.add(r); + return r; + } + + /** + * @return {@link #outputParameters} (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) + */ + public Reference getOutputParameters() { + if (this.outputParameters == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponse.outputParameters"); + else if (Configuration.doAutoCreate()) + this.outputParameters = new Reference(); // cc + return this.outputParameters; + } + + public boolean hasOutputParameters() { + return this.outputParameters != null && !this.outputParameters.isEmpty(); + } + + /** + * @param value {@link #outputParameters} (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) + */ + public GuidanceResponse setOutputParameters(Reference value) { + this.outputParameters = value; + return this; + } + + /** + * @return {@link #outputParameters} 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 output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) + */ + public Parameters getOutputParametersTarget() { + if (this.outputParametersTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuidanceResponse.outputParameters"); + else if (Configuration.doAutoCreate()) + this.outputParametersTarget = new Parameters(); // aa + return this.outputParametersTarget; + } + + /** + * @param value {@link #outputParameters} 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 output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) + */ + public GuidanceResponse setOutputParametersTarget(Parameters value) { + this.outputParametersTarget = value; + return this; + } + + /** + * @return {@link #action} (The actions, if any, produced by the evaluation of the artifact.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (GuidanceResponseActionComponent item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (The actions, if any, produced by the evaluation of the artifact.) + */ + // syntactic sugar + public GuidanceResponseActionComponent addAction() { //3 + GuidanceResponseActionComponent t = new GuidanceResponseActionComponent(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponse addAction(GuidanceResponseActionComponent t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + /** + * @return {@link #dataRequirement} (If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.) + */ + public List getDataRequirement() { + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + return this.dataRequirement; + } + + public boolean hasDataRequirement() { + if (this.dataRequirement == null) + return false; + for (DataRequirement item : this.dataRequirement) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dataRequirement} (If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.) + */ + // syntactic sugar + public DataRequirement addDataRequirement() { //3 + DataRequirement t = new DataRequirement(); + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + this.dataRequirement.add(t); + return t; + } + + // syntactic sugar + public GuidanceResponse addDataRequirement(DataRequirement t) { //3 + if (t == null) + return this; + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + this.dataRequirement.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("requestId", "string", "The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.", 0, java.lang.Integer.MAX_VALUE, requestId)); + childrenList.add(new Property("module", "Reference(DecisionSupportServiceModule|DecisionSupportRule)", "A reference to the knowledge module that was invoked.", 0, java.lang.Integer.MAX_VALUE, module)); + childrenList.add(new Property("status", "code", "The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("evaluationMessage", "Reference(OperationOutcome)", "Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.", 0, java.lang.Integer.MAX_VALUE, evaluationMessage)); + childrenList.add(new Property("outputParameters", "Reference(Parameters)", "The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.", 0, java.lang.Integer.MAX_VALUE, outputParameters)); + childrenList.add(new Property("action", "", "The actions, if any, produced by the evaluation of the artifact.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("dataRequirement", "DataRequirement", "If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.", 0, java.lang.Integer.MAX_VALUE, dataRequirement)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 693933066: /*requestId*/ return this.requestId == null ? new Base[0] : new Base[] {this.requestId}; // StringType + case -1068784020: /*module*/ return this.module == null ? new Base[0] : new Base[] {this.module}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1081619755: /*evaluationMessage*/ return this.evaluationMessage == null ? new Base[0] : this.evaluationMessage.toArray(new Base[this.evaluationMessage.size()]); // Reference + case 525609419: /*outputParameters*/ return this.outputParameters == null ? new Base[0] : new Base[] {this.outputParameters}; // Reference + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // GuidanceResponseActionComponent + case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 693933066: // requestId + this.requestId = castToString(value); // StringType + break; + case -1068784020: // module + this.module = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new GuidanceResponseStatusEnumFactory().fromType(value); // Enumeration + break; + case 1081619755: // evaluationMessage + this.getEvaluationMessage().add(castToReference(value)); // Reference + break; + case 525609419: // outputParameters + this.outputParameters = castToReference(value); // Reference + break; + case -1422950858: // action + this.getAction().add((GuidanceResponseActionComponent) value); // GuidanceResponseActionComponent + break; + case 629147193: // dataRequirement + this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("requestId")) + this.requestId = castToString(value); // StringType + else if (name.equals("module")) + this.module = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new GuidanceResponseStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("evaluationMessage")) + this.getEvaluationMessage().add(castToReference(value)); + else if (name.equals("outputParameters")) + this.outputParameters = castToReference(value); // Reference + else if (name.equals("action")) + this.getAction().add((GuidanceResponseActionComponent) value); + else if (name.equals("dataRequirement")) + this.getDataRequirement().add(castToDataRequirement(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 693933066: throw new FHIRException("Cannot make property requestId as it is not a complex type"); // StringType + case -1068784020: return getModule(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1081619755: return addEvaluationMessage(); // Reference + case 525609419: return getOutputParameters(); // Reference + case -1422950858: return addAction(); // GuidanceResponseActionComponent + case 629147193: return addDataRequirement(); // DataRequirement + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("requestId")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.requestId"); + } + else if (name.equals("module")) { + this.module = new Reference(); + return this.module; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.status"); + } + else if (name.equals("evaluationMessage")) { + return addEvaluationMessage(); + } + else if (name.equals("outputParameters")) { + this.outputParameters = new Reference(); + return this.outputParameters; + } + else if (name.equals("action")) { + return addAction(); + } + else if (name.equals("dataRequirement")) { + return addDataRequirement(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "GuidanceResponse"; + + } + + public GuidanceResponse copy() { + GuidanceResponse dst = new GuidanceResponse(); + copyValues(dst); + dst.requestId = requestId == null ? null : requestId.copy(); + dst.module = module == null ? null : module.copy(); + dst.status = status == null ? null : status.copy(); + if (evaluationMessage != null) { + dst.evaluationMessage = new ArrayList(); + for (Reference i : evaluationMessage) + dst.evaluationMessage.add(i.copy()); + }; + dst.outputParameters = outputParameters == null ? null : outputParameters.copy(); + if (action != null) { + dst.action = new ArrayList(); + for (GuidanceResponseActionComponent i : action) + dst.action.add(i.copy()); + }; + if (dataRequirement != null) { + dst.dataRequirement = new ArrayList(); + for (DataRequirement i : dataRequirement) + dst.dataRequirement.add(i.copy()); + }; + return dst; + } + + protected GuidanceResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GuidanceResponse)) + return false; + GuidanceResponse o = (GuidanceResponse) other; + return compareDeep(requestId, o.requestId, true) && compareDeep(module, o.module, true) && compareDeep(status, o.status, true) + && compareDeep(evaluationMessage, o.evaluationMessage, true) && compareDeep(outputParameters, o.outputParameters, true) + && compareDeep(action, o.action, true) && compareDeep(dataRequirement, o.dataRequirement, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GuidanceResponse)) + return false; + GuidanceResponse o = (GuidanceResponse) other; + return compareValues(requestId, o.requestId, true) && compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (requestId == null || requestId.isEmpty()) && (module == null || module.isEmpty()) + && (status == null || status.isEmpty()) && (evaluationMessage == null || evaluationMessage.isEmpty()) + && (outputParameters == null || outputParameters.isEmpty()) && (action == null || action.isEmpty()) + && (dataRequirement == null || dataRequirement.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.GuidanceResponse; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/HealthcareService.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/HealthcareService.java new file mode 100644 index 00000000000..4ffbeee5231 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/HealthcareService.java @@ -0,0 +1,2578 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The details of a healthcare service available at a location. + */ +@ResourceDef(name="HealthcareService", profile="http://hl7.org/fhir/Profile/HealthcareService") +public class HealthcareService extends DomainResource { + + public enum DaysOfWeek { + /** + * Monday + */ + MON, + /** + * Tuesday + */ + TUE, + /** + * Wednesday + */ + WED, + /** + * Thursday + */ + THU, + /** + * Friday + */ + FRI, + /** + * Saturday + */ + SAT, + /** + * Sunday + */ + SUN, + /** + * added to help the parsers + */ + NULL; + public static DaysOfWeek fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("mon".equals(codeString)) + return MON; + if ("tue".equals(codeString)) + return TUE; + if ("wed".equals(codeString)) + return WED; + if ("thu".equals(codeString)) + return THU; + if ("fri".equals(codeString)) + return FRI; + if ("sat".equals(codeString)) + return SAT; + if ("sun".equals(codeString)) + return SUN; + throw new FHIRException("Unknown DaysOfWeek code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MON: return "mon"; + case TUE: return "tue"; + case WED: return "wed"; + case THU: return "thu"; + case FRI: return "fri"; + case SAT: return "sat"; + case SUN: return "sun"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MON: return "http://hl7.org/fhir/days-of-week"; + case TUE: return "http://hl7.org/fhir/days-of-week"; + case WED: return "http://hl7.org/fhir/days-of-week"; + case THU: return "http://hl7.org/fhir/days-of-week"; + case FRI: return "http://hl7.org/fhir/days-of-week"; + case SAT: return "http://hl7.org/fhir/days-of-week"; + case SUN: return "http://hl7.org/fhir/days-of-week"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MON: return "Monday"; + case TUE: return "Tuesday"; + case WED: return "Wednesday"; + case THU: return "Thursday"; + case FRI: return "Friday"; + case SAT: return "Saturday"; + case SUN: return "Sunday"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MON: return "Monday"; + case TUE: return "Tuesday"; + case WED: return "Wednesday"; + case THU: return "Thursday"; + case FRI: return "Friday"; + case SAT: return "Saturday"; + case SUN: return "Sunday"; + default: return "?"; + } + } + } + + public static class DaysOfWeekEnumFactory implements EnumFactory { + public DaysOfWeek fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("mon".equals(codeString)) + return DaysOfWeek.MON; + if ("tue".equals(codeString)) + return DaysOfWeek.TUE; + if ("wed".equals(codeString)) + return DaysOfWeek.WED; + if ("thu".equals(codeString)) + return DaysOfWeek.THU; + if ("fri".equals(codeString)) + return DaysOfWeek.FRI; + if ("sat".equals(codeString)) + return DaysOfWeek.SAT; + if ("sun".equals(codeString)) + return DaysOfWeek.SUN; + throw new IllegalArgumentException("Unknown DaysOfWeek code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("mon".equals(codeString)) + return new Enumeration(this, DaysOfWeek.MON); + if ("tue".equals(codeString)) + return new Enumeration(this, DaysOfWeek.TUE); + if ("wed".equals(codeString)) + return new Enumeration(this, DaysOfWeek.WED); + if ("thu".equals(codeString)) + return new Enumeration(this, DaysOfWeek.THU); + if ("fri".equals(codeString)) + return new Enumeration(this, DaysOfWeek.FRI); + if ("sat".equals(codeString)) + return new Enumeration(this, DaysOfWeek.SAT); + if ("sun".equals(codeString)) + return new Enumeration(this, DaysOfWeek.SUN); + throw new FHIRException("Unknown DaysOfWeek code '"+codeString+"'"); + } + public String toCode(DaysOfWeek code) { + if (code == DaysOfWeek.MON) + return "mon"; + if (code == DaysOfWeek.TUE) + return "tue"; + if (code == DaysOfWeek.WED) + return "wed"; + if (code == DaysOfWeek.THU) + return "thu"; + if (code == DaysOfWeek.FRI) + return "fri"; + if (code == DaysOfWeek.SAT) + return "sat"; + if (code == DaysOfWeek.SUN) + return "sun"; + return "?"; + } + public String toSystem(DaysOfWeek code) { + return code.getSystem(); + } + } + + @Block() + public static class HealthcareServiceAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates which days of the week are available between the start and end Times. + */ + @Child(name = "daysOfWeek", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="mon | tue | wed | thu | fri | sat | sun", formalDefinition="Indicates which days of the week are available between the start and end Times." ) + protected List> daysOfWeek; + + /** + * Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + @Child(name = "allDay", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Always available? e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." ) + protected BooleanType allDay; + + /** + * The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + @Child(name = "availableStartTime", type = {TimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Opening time of day (ignored if allDay = true)", formalDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored." ) + protected TimeType availableStartTime; + + /** + * The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + @Child(name = "availableEndTime", type = {TimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Closing time of day (ignored if allDay = true)", formalDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored." ) + protected TimeType availableEndTime; + + private static final long serialVersionUID = -2139510127L; + + /** + * Constructor + */ + public HealthcareServiceAvailableTimeComponent() { + super(); + } + + /** + * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) + */ + public List> getDaysOfWeek() { + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList>(); + return this.daysOfWeek; + } + + public boolean hasDaysOfWeek() { + if (this.daysOfWeek == null) + return false; + for (Enumeration item : this.daysOfWeek) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) + */ + // syntactic sugar + public Enumeration addDaysOfWeekElement() {//2 + Enumeration t = new Enumeration(new DaysOfWeekEnumFactory()); + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList>(); + this.daysOfWeek.add(t); + return t; + } + + /** + * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) + */ + public HealthcareServiceAvailableTimeComponent addDaysOfWeek(DaysOfWeek value) { //1 + Enumeration t = new Enumeration(new DaysOfWeekEnumFactory()); + t.setValue(value); + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList>(); + this.daysOfWeek.add(t); + return this; + } + + /** + * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) + */ + public boolean hasDaysOfWeek(DaysOfWeek value) { + if (this.daysOfWeek == null) + return false; + for (Enumeration v : this.daysOfWeek) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value + */ + public BooleanType getAllDayElement() { + if (this.allDay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.allDay"); + else if (Configuration.doAutoCreate()) + this.allDay = new BooleanType(); // bb + return this.allDay; + } + + public boolean hasAllDayElement() { + return this.allDay != null && !this.allDay.isEmpty(); + } + + public boolean hasAllDay() { + return this.allDay != null && !this.allDay.isEmpty(); + } + + /** + * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAllDayElement(BooleanType value) { + this.allDay = value; + return this; + } + + /** + * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + public boolean getAllDay() { + return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue(); + } + + /** + * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + public HealthcareServiceAvailableTimeComponent setAllDay(boolean value) { + if (this.allDay == null) + this.allDay = new BooleanType(); + this.allDay.setValue(value); + return this; + } + + /** + * @return {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value + */ + public TimeType getAvailableStartTimeElement() { + if (this.availableStartTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableStartTime"); + else if (Configuration.doAutoCreate()) + this.availableStartTime = new TimeType(); // bb + return this.availableStartTime; + } + + public boolean hasAvailableStartTimeElement() { + return this.availableStartTime != null && !this.availableStartTime.isEmpty(); + } + + public boolean hasAvailableStartTime() { + return this.availableStartTime != null && !this.availableStartTime.isEmpty(); + } + + /** + * @param value {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAvailableStartTimeElement(TimeType value) { + this.availableStartTime = value; + return this; + } + + /** + * @return The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public String getAvailableStartTime() { + return this.availableStartTime == null ? null : this.availableStartTime.getValue(); + } + + /** + * @param value The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public HealthcareServiceAvailableTimeComponent setAvailableStartTime(String value) { + if (value == null) + this.availableStartTime = null; + else { + if (this.availableStartTime == null) + this.availableStartTime = new TimeType(); + this.availableStartTime.setValue(value); + } + return this; + } + + /** + * @return {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value + */ + public TimeType getAvailableEndTimeElement() { + if (this.availableEndTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableEndTime"); + else if (Configuration.doAutoCreate()) + this.availableEndTime = new TimeType(); // bb + return this.availableEndTime; + } + + public boolean hasAvailableEndTimeElement() { + return this.availableEndTime != null && !this.availableEndTime.isEmpty(); + } + + public boolean hasAvailableEndTime() { + return this.availableEndTime != null && !this.availableEndTime.isEmpty(); + } + + /** + * @param value {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAvailableEndTimeElement(TimeType value) { + this.availableEndTime = value; + return this; + } + + /** + * @return The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public String getAvailableEndTime() { + return this.availableEndTime == null ? null : this.availableEndTime.getValue(); + } + + /** + * @param value The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public HealthcareServiceAvailableTimeComponent setAvailableEndTime(String value) { + if (value == null) + this.availableEndTime = null; + else { + if (this.availableEndTime == null) + this.availableEndTime = new TimeType(); + this.availableEndTime.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("daysOfWeek", "code", "Indicates which days of the week are available between the start and end Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek)); + childrenList.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, java.lang.Integer.MAX_VALUE, allDay)); + childrenList.add(new Property("availableStartTime", "time", "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableStartTime)); + childrenList.add(new Property("availableEndTime", "time", "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableEndTime)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 68050338: /*daysOfWeek*/ return this.daysOfWeek == null ? new Base[0] : this.daysOfWeek.toArray(new Base[this.daysOfWeek.size()]); // Enumeration + case -1414913477: /*allDay*/ return this.allDay == null ? new Base[0] : new Base[] {this.allDay}; // BooleanType + case -1039453818: /*availableStartTime*/ return this.availableStartTime == null ? new Base[0] : new Base[] {this.availableStartTime}; // TimeType + case 101151551: /*availableEndTime*/ return this.availableEndTime == null ? new Base[0] : new Base[] {this.availableEndTime}; // TimeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 68050338: // daysOfWeek + this.getDaysOfWeek().add(new DaysOfWeekEnumFactory().fromType(value)); // Enumeration + break; + case -1414913477: // allDay + this.allDay = castToBoolean(value); // BooleanType + break; + case -1039453818: // availableStartTime + this.availableStartTime = castToTime(value); // TimeType + break; + case 101151551: // availableEndTime + this.availableEndTime = castToTime(value); // TimeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("daysOfWeek")) + this.getDaysOfWeek().add(new DaysOfWeekEnumFactory().fromType(value)); + else if (name.equals("allDay")) + this.allDay = castToBoolean(value); // BooleanType + else if (name.equals("availableStartTime")) + this.availableStartTime = castToTime(value); // TimeType + else if (name.equals("availableEndTime")) + this.availableEndTime = castToTime(value); // TimeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 68050338: throw new FHIRException("Cannot make property daysOfWeek as it is not a complex type"); // Enumeration + case -1414913477: throw new FHIRException("Cannot make property allDay as it is not a complex type"); // BooleanType + case -1039453818: throw new FHIRException("Cannot make property availableStartTime as it is not a complex type"); // TimeType + case 101151551: throw new FHIRException("Cannot make property availableEndTime as it is not a complex type"); // TimeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("daysOfWeek")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.daysOfWeek"); + } + else if (name.equals("allDay")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.allDay"); + } + else if (name.equals("availableStartTime")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.availableStartTime"); + } + else if (name.equals("availableEndTime")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.availableEndTime"); + } + else + return super.addChild(name); + } + + public HealthcareServiceAvailableTimeComponent copy() { + HealthcareServiceAvailableTimeComponent dst = new HealthcareServiceAvailableTimeComponent(); + copyValues(dst); + if (daysOfWeek != null) { + dst.daysOfWeek = new ArrayList>(); + for (Enumeration i : daysOfWeek) + dst.daysOfWeek.add(i.copy()); + }; + dst.allDay = allDay == null ? null : allDay.copy(); + dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy(); + dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof HealthcareServiceAvailableTimeComponent)) + return false; + HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other; + return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true) && compareDeep(availableStartTime, o.availableStartTime, true) + && compareDeep(availableEndTime, o.availableEndTime, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof HealthcareServiceAvailableTimeComponent)) + return false; + HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other; + return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true) && compareValues(availableStartTime, o.availableStartTime, true) + && compareValues(availableEndTime, o.availableEndTime, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty()) + && (availableStartTime == null || availableStartTime.isEmpty()) && (availableEndTime == null || availableEndTime.isEmpty()) + ; + } + + public String fhirType() { + return "HealthcareService.availableTime"; + + } + + } + + @Block() + public static class HealthcareServiceNotAvailableComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The reason that can be presented to the user as to why this time is not available. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reason presented to the user explaining why time not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." ) + protected StringType description; + + /** + * Service is not available (seasonally or for a public holiday) from this date. + */ + @Child(name = "during", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Service not availablefrom this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." ) + protected Period during; + + private static final long serialVersionUID = 310849929L; + + /** + * Constructor + */ + public HealthcareServiceNotAvailableComponent() { + super(); + } + + /** + * Constructor + */ + public HealthcareServiceNotAvailableComponent(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). 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 HealthcareServiceNotAvailableComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public HealthcareServiceNotAvailableComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The reason that can be presented to the user as to why this time is not available. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The reason that can be presented to the user as to why this time is not available. + */ + public HealthcareServiceNotAvailableComponent setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) + */ + public Period getDuring() { + if (this.during == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.during"); + else if (Configuration.doAutoCreate()) + this.during = new Period(); // cc + return this.during; + } + + public boolean hasDuring() { + return this.during != null && !this.during.isEmpty(); + } + + /** + * @param value {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) + */ + public HealthcareServiceNotAvailableComponent setDuring(Period value) { + this.during = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("during", "Period", "Service is not available (seasonally or for a public holiday) from this date.", 0, java.lang.Integer.MAX_VALUE, during)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1320499647: /*during*/ return this.during == null ? new Base[0] : new Base[] {this.during}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1320499647: // during + this.during = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("during")) + this.during = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1320499647: return getDuring(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.description"); + } + else if (name.equals("during")) { + this.during = new Period(); + return this.during; + } + else + return super.addChild(name); + } + + public HealthcareServiceNotAvailableComponent copy() { + HealthcareServiceNotAvailableComponent dst = new HealthcareServiceNotAvailableComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.during = during == null ? null : during.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof HealthcareServiceNotAvailableComponent)) + return false; + HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other; + return compareDeep(description, o.description, true) && compareDeep(during, o.during, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof HealthcareServiceNotAvailableComponent)) + return false; + HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (during == null || during.isEmpty()) + ; + } + + public String fhirType() { + return "HealthcareService.notAvailable"; + + } + + } + + /** + * External identifiers for this item. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External identifiers for this item", formalDefinition="External identifiers for this item." ) + protected List identifier; + + /** + * The organization that provides this healthcare service. + */ + @Child(name = "providedBy", type = {Organization.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization that provides this service", formalDefinition="The organization that provides this healthcare service." ) + protected Reference providedBy; + + /** + * The actual object that is the target of the reference (The organization that provides this healthcare service.) + */ + protected Organization providedByTarget; + + /** + * Identifies the broad category of service being performed or delivered. + */ + @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Broad category of service being performed or delivered", formalDefinition="Identifies the broad category of service being performed or delivered." ) + protected CodeableConcept serviceCategory; + + /** + * The specific type of service that may be delivered or performed. + */ + @Child(name = "serviceType", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Type of service that may be delivered or performed", formalDefinition="The specific type of service that may be delivered or performed." ) + protected List serviceType; + + /** + * Collection of specialties handled by the service site. This is more of a medical term. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Specialties handled by the HealthcareService", formalDefinition="Collection of specialties handled by the service site. This is more of a medical term." ) + protected List specialty; + + /** + * The location(s) where this healthcare service may be provided. + */ + @Child(name = "location", type = {Location.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Location(s) where service may be provided", formalDefinition="The location(s) where this healthcare service may be provided." ) + protected List location; + /** + * The actual objects that are the target of the reference (The location(s) where this healthcare service may be provided.) + */ + protected List locationTarget; + + + /** + * Further description of the service as it would be presented to a consumer while searching. + */ + @Child(name = "serviceName", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description of service as presented to a consumer while searching", formalDefinition="Further description of the service as it would be presented to a consumer while searching." ) + protected StringType serviceName; + + /** + * Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + @Child(name = "comment", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional description and/or any specific issues not covered elsewhere", formalDefinition="Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName." ) + protected StringType comment; + + /** + * Extra details about the service that can't be placed in the other fields. + */ + @Child(name = "extraDetails", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Extra details about the service that can't be placed in the other fields", formalDefinition="Extra details about the service that can't be placed in the other fields." ) + protected StringType extraDetails; + + /** + * If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list. + */ + @Child(name = "photo", type = {Attachment.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Facilitates quick identification of the service", formalDefinition="If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list." ) + protected Attachment photo; + + /** + * List of contacts related to this specific healthcare service. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contacts related to the healthcare service", formalDefinition="List of contacts related to this specific healthcare service." ) + protected List telecom; + + /** + * The location(s) that this service is available to (not where the service is provided). + */ + @Child(name = "coverageArea", type = {Location.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Location(s) service is inteded for/available to", formalDefinition="The location(s) that this service is available to (not where the service is provided)." ) + protected List coverageArea; + /** + * The actual objects that are the target of the reference (The location(s) that this service is available to (not where the service is provided).) + */ + protected List coverageAreaTarget; + + + /** + * The code(s) that detail the conditions under which the healthcare service is available/offered. + */ + @Child(name = "serviceProvisionCode", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Conditions under which service is available/offered", formalDefinition="The code(s) that detail the conditions under which the healthcare service is available/offered." ) + protected List serviceProvisionCode; + + /** + * Does this service have specific eligibility requirements that need to be met in order to use the service? + */ + @Child(name = "eligibility", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Specific eligibility requirements required to use the service", formalDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service?" ) + protected CodeableConcept eligibility; + + /** + * Describes the eligibility conditions for the service. + */ + @Child(name = "eligibilityNote", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Describes the eligibility conditions for the service", formalDefinition="Describes the eligibility conditions for the service." ) + protected StringType eligibilityNote; + + /** + * Program Names that can be used to categorize the service. + */ + @Child(name = "programName", type = {StringType.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Program Names that categorize the service", formalDefinition="Program Names that can be used to categorize the service." ) + protected List programName; + + /** + * Collection of characteristics (attributes). + */ + @Child(name = "characteristic", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Collection of characteristics (attributes)", formalDefinition="Collection of characteristics (attributes)." ) + protected List characteristic; + + /** + * Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required. + */ + @Child(name = "referralMethod", type = {CodeableConcept.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Ways that the service accepts referrals", formalDefinition="Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required." ) + protected List referralMethod; + + /** + * The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + @Child(name = "publicKey", type = {StringType.class}, order=18, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="PKI Public keys to support secure communications", formalDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available." ) + protected StringType publicKey; + + /** + * Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service. + */ + @Child(name = "appointmentRequired", type = {BooleanType.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If an appointment is required for access to this service", formalDefinition="Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service." ) + protected BooleanType appointmentRequired; + + /** + * A collection of times that the Service Site is available. + */ + @Child(name = "availableTime", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Times the Service Site is available", formalDefinition="A collection of times that the Service Site is available." ) + protected List availableTime; + + /** + * The HealthcareService is not available during this period of time due to the provided reason. + */ + @Child(name = "notAvailable", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Not available during this time due to provided reason", formalDefinition="The HealthcareService is not available during this period of time due to the provided reason." ) + protected List notAvailable; + + /** + * A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. + */ + @Child(name = "availabilityExceptions", type = {StringType.class}, order=22, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Description of availability exceptions", formalDefinition="A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times." ) + protected StringType availabilityExceptions; + + private static final long serialVersionUID = -874217100L; + + /** + * Constructor + */ + public HealthcareService() { + super(); + } + + /** + * @return {@link #identifier} (External identifiers for this item.) + */ + 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} (External identifiers for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #providedBy} (The organization that provides this healthcare service.) + */ + public Reference getProvidedBy() { + if (this.providedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.providedBy"); + else if (Configuration.doAutoCreate()) + this.providedBy = new Reference(); // cc + return this.providedBy; + } + + public boolean hasProvidedBy() { + return this.providedBy != null && !this.providedBy.isEmpty(); + } + + /** + * @param value {@link #providedBy} (The organization that provides this healthcare service.) + */ + public HealthcareService setProvidedBy(Reference value) { + this.providedBy = value; + return this; + } + + /** + * @return {@link #providedBy} 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 provides this healthcare service.) + */ + public Organization getProvidedByTarget() { + if (this.providedByTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.providedBy"); + else if (Configuration.doAutoCreate()) + this.providedByTarget = new Organization(); // aa + return this.providedByTarget; + } + + /** + * @param value {@link #providedBy} 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 provides this healthcare service.) + */ + public HealthcareService setProvidedByTarget(Organization value) { + this.providedByTarget = value; + return this; + } + + /** + * @return {@link #serviceCategory} (Identifies the broad category of service being performed or delivered.) + */ + public CodeableConcept getServiceCategory() { + if (this.serviceCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.serviceCategory"); + else if (Configuration.doAutoCreate()) + this.serviceCategory = new CodeableConcept(); // cc + return this.serviceCategory; + } + + public boolean hasServiceCategory() { + return this.serviceCategory != null && !this.serviceCategory.isEmpty(); + } + + /** + * @param value {@link #serviceCategory} (Identifies the broad category of service being performed or delivered.) + */ + public HealthcareService setServiceCategory(CodeableConcept value) { + this.serviceCategory = value; + return this; + } + + /** + * @return {@link #serviceType} (The specific type of service that may be delivered or performed.) + */ + public List getServiceType() { + if (this.serviceType == null) + this.serviceType = new ArrayList(); + return this.serviceType; + } + + public boolean hasServiceType() { + if (this.serviceType == null) + return false; + for (CodeableConcept item : this.serviceType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceType} (The specific type of service that may be delivered or performed.) + */ + // syntactic sugar + public CodeableConcept addServiceType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addServiceType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return this; + } + + /** + * @return {@link #specialty} (Collection of specialties handled by the service site. This is more of a medical term.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (Collection of specialties handled by the service site. This is more of a medical term.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addSpecialty(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return this; + } + + /** + * @return {@link #location} (The location(s) where this healthcare service may be provided.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (Reference item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (The location(s) where this healthcare service may be provided.) + */ + // syntactic sugar + public Reference addLocation() { //3 + Reference t = new Reference(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addLocation(Reference t) { //3 + if (t == null) + return this; + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @return {@link #location} (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 location(s) where this healthcare service may be provided.) + */ + public List getLocationTarget() { + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + return this.locationTarget; + } + + // syntactic sugar + /** + * @return {@link #location} (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 location(s) where this healthcare service may be provided.) + */ + public Location addLocationTarget() { + Location r = new Location(); + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + this.locationTarget.add(r); + return r; + } + + /** + * @return {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value + */ + public StringType getServiceNameElement() { + if (this.serviceName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.serviceName"); + else if (Configuration.doAutoCreate()) + this.serviceName = new StringType(); // bb + return this.serviceName; + } + + public boolean hasServiceNameElement() { + return this.serviceName != null && !this.serviceName.isEmpty(); + } + + public boolean hasServiceName() { + return this.serviceName != null && !this.serviceName.isEmpty(); + } + + /** + * @param value {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value + */ + public HealthcareService setServiceNameElement(StringType value) { + this.serviceName = value; + return this; + } + + /** + * @return Further description of the service as it would be presented to a consumer while searching. + */ + public String getServiceName() { + return this.serviceName == null ? null : this.serviceName.getValue(); + } + + /** + * @param value Further description of the service as it would be presented to a consumer while searching. + */ + public HealthcareService setServiceName(String value) { + if (Utilities.noString(value)) + this.serviceName = null; + else { + if (this.serviceName == null) + this.serviceName = new StringType(); + this.serviceName.setValue(value); + } + return this; + } + + /** + * @return {@link #comment} (Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public HealthcareService setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + public HealthcareService setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value + */ + public StringType getExtraDetailsElement() { + if (this.extraDetails == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.extraDetails"); + else if (Configuration.doAutoCreate()) + this.extraDetails = new StringType(); // bb + return this.extraDetails; + } + + public boolean hasExtraDetailsElement() { + return this.extraDetails != null && !this.extraDetails.isEmpty(); + } + + public boolean hasExtraDetails() { + return this.extraDetails != null && !this.extraDetails.isEmpty(); + } + + /** + * @param value {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value + */ + public HealthcareService setExtraDetailsElement(StringType value) { + this.extraDetails = value; + return this; + } + + /** + * @return Extra details about the service that can't be placed in the other fields. + */ + public String getExtraDetails() { + return this.extraDetails == null ? null : this.extraDetails.getValue(); + } + + /** + * @param value Extra details about the service that can't be placed in the other fields. + */ + public HealthcareService setExtraDetails(String value) { + if (Utilities.noString(value)) + this.extraDetails = null; + else { + if (this.extraDetails == null) + this.extraDetails = new StringType(); + this.extraDetails.setValue(value); + } + return this; + } + + /** + * @return {@link #photo} (If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.) + */ + public Attachment getPhoto() { + if (this.photo == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.photo"); + else if (Configuration.doAutoCreate()) + this.photo = new Attachment(); // cc + return this.photo; + } + + public boolean hasPhoto() { + return this.photo != null && !this.photo.isEmpty(); + } + + /** + * @param value {@link #photo} (If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.) + */ + public HealthcareService setPhoto(Attachment value) { + this.photo = value; + return this; + } + + /** + * @return {@link #telecom} (List of contacts related to this specific healthcare service.) + */ + 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} (List of contacts related to this specific healthcare service.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).) + */ + public List getCoverageArea() { + if (this.coverageArea == null) + this.coverageArea = new ArrayList(); + return this.coverageArea; + } + + public boolean hasCoverageArea() { + if (this.coverageArea == null) + return false; + for (Reference item : this.coverageArea) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).) + */ + // syntactic sugar + public Reference addCoverageArea() { //3 + Reference t = new Reference(); + if (this.coverageArea == null) + this.coverageArea = new ArrayList(); + this.coverageArea.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addCoverageArea(Reference t) { //3 + if (t == null) + return this; + if (this.coverageArea == null) + this.coverageArea = new ArrayList(); + this.coverageArea.add(t); + return this; + } + + /** + * @return {@link #coverageArea} (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 location(s) that this service is available to (not where the service is provided).) + */ + public List getCoverageAreaTarget() { + if (this.coverageAreaTarget == null) + this.coverageAreaTarget = new ArrayList(); + return this.coverageAreaTarget; + } + + // syntactic sugar + /** + * @return {@link #coverageArea} (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 location(s) that this service is available to (not where the service is provided).) + */ + public Location addCoverageAreaTarget() { + Location r = new Location(); + if (this.coverageAreaTarget == null) + this.coverageAreaTarget = new ArrayList(); + this.coverageAreaTarget.add(r); + return r; + } + + /** + * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.) + */ + public List getServiceProvisionCode() { + if (this.serviceProvisionCode == null) + this.serviceProvisionCode = new ArrayList(); + return this.serviceProvisionCode; + } + + public boolean hasServiceProvisionCode() { + if (this.serviceProvisionCode == null) + return false; + for (CodeableConcept item : this.serviceProvisionCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.) + */ + // syntactic sugar + public CodeableConcept addServiceProvisionCode() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceProvisionCode == null) + this.serviceProvisionCode = new ArrayList(); + this.serviceProvisionCode.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addServiceProvisionCode(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.serviceProvisionCode == null) + this.serviceProvisionCode = new ArrayList(); + this.serviceProvisionCode.add(t); + return this; + } + + /** + * @return {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service?) + */ + public CodeableConcept getEligibility() { + if (this.eligibility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.eligibility"); + else if (Configuration.doAutoCreate()) + this.eligibility = new CodeableConcept(); // cc + return this.eligibility; + } + + public boolean hasEligibility() { + return this.eligibility != null && !this.eligibility.isEmpty(); + } + + /** + * @param value {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service?) + */ + public HealthcareService setEligibility(CodeableConcept value) { + this.eligibility = value; + return this; + } + + /** + * @return {@link #eligibilityNote} (Describes the eligibility conditions for the service.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value + */ + public StringType getEligibilityNoteElement() { + if (this.eligibilityNote == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.eligibilityNote"); + else if (Configuration.doAutoCreate()) + this.eligibilityNote = new StringType(); // bb + return this.eligibilityNote; + } + + public boolean hasEligibilityNoteElement() { + return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); + } + + public boolean hasEligibilityNote() { + return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); + } + + /** + * @param value {@link #eligibilityNote} (Describes the eligibility conditions for the service.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value + */ + public HealthcareService setEligibilityNoteElement(StringType value) { + this.eligibilityNote = value; + return this; + } + + /** + * @return Describes the eligibility conditions for the service. + */ + public String getEligibilityNote() { + return this.eligibilityNote == null ? null : this.eligibilityNote.getValue(); + } + + /** + * @param value Describes the eligibility conditions for the service. + */ + public HealthcareService setEligibilityNote(String value) { + if (Utilities.noString(value)) + this.eligibilityNote = null; + else { + if (this.eligibilityNote == null) + this.eligibilityNote = new StringType(); + this.eligibilityNote.setValue(value); + } + return this; + } + + /** + * @return {@link #programName} (Program Names that can be used to categorize the service.) + */ + public List getProgramName() { + if (this.programName == null) + this.programName = new ArrayList(); + return this.programName; + } + + public boolean hasProgramName() { + if (this.programName == null) + return false; + for (StringType item : this.programName) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programName} (Program Names that can be used to categorize the service.) + */ + // syntactic sugar + public StringType addProgramNameElement() {//2 + StringType t = new StringType(); + if (this.programName == null) + this.programName = new ArrayList(); + this.programName.add(t); + return t; + } + + /** + * @param value {@link #programName} (Program Names that can be used to categorize the service.) + */ + public HealthcareService addProgramName(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.programName == null) + this.programName = new ArrayList(); + this.programName.add(t); + return this; + } + + /** + * @param value {@link #programName} (Program Names that can be used to categorize the service.) + */ + public boolean hasProgramName(String value) { + if (this.programName == null) + return false; + for (StringType v : this.programName) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #characteristic} (Collection of characteristics (attributes).) + */ + public List getCharacteristic() { + if (this.characteristic == null) + this.characteristic = new ArrayList(); + return this.characteristic; + } + + public boolean hasCharacteristic() { + if (this.characteristic == null) + return false; + for (CodeableConcept item : this.characteristic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #characteristic} (Collection of characteristics (attributes).) + */ + // syntactic sugar + public CodeableConcept addCharacteristic() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addCharacteristic(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return this; + } + + /** + * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.) + */ + public List getReferralMethod() { + if (this.referralMethod == null) + this.referralMethod = new ArrayList(); + return this.referralMethod; + } + + public boolean hasReferralMethod() { + if (this.referralMethod == null) + return false; + for (CodeableConcept item : this.referralMethod) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.) + */ + // syntactic sugar + public CodeableConcept addReferralMethod() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.referralMethod == null) + this.referralMethod = new ArrayList(); + this.referralMethod.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addReferralMethod(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.referralMethod == null) + this.referralMethod = new ArrayList(); + this.referralMethod.add(t); + return this; + } + + /** + * @return {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value + */ + public StringType getPublicKeyElement() { + if (this.publicKey == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.publicKey"); + else if (Configuration.doAutoCreate()) + this.publicKey = new StringType(); // bb + return this.publicKey; + } + + public boolean hasPublicKeyElement() { + return this.publicKey != null && !this.publicKey.isEmpty(); + } + + public boolean hasPublicKey() { + return this.publicKey != null && !this.publicKey.isEmpty(); + } + + /** + * @param value {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value + */ + public HealthcareService setPublicKeyElement(StringType value) { + this.publicKey = value; + return this; + } + + /** + * @return The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + public String getPublicKey() { + return this.publicKey == null ? null : this.publicKey.getValue(); + } + + /** + * @param value The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + public HealthcareService setPublicKey(String value) { + if (Utilities.noString(value)) + this.publicKey = null; + else { + if (this.publicKey == null) + this.publicKey = new StringType(); + this.publicKey.setValue(value); + } + return this; + } + + /** + * @return {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.). This is the underlying object with id, value and extensions. The accessor "getAppointmentRequired" gives direct access to the value + */ + public BooleanType getAppointmentRequiredElement() { + if (this.appointmentRequired == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.appointmentRequired"); + else if (Configuration.doAutoCreate()) + this.appointmentRequired = new BooleanType(); // bb + return this.appointmentRequired; + } + + public boolean hasAppointmentRequiredElement() { + return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); + } + + public boolean hasAppointmentRequired() { + return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); + } + + /** + * @param value {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.). This is the underlying object with id, value and extensions. The accessor "getAppointmentRequired" gives direct access to the value + */ + public HealthcareService setAppointmentRequiredElement(BooleanType value) { + this.appointmentRequired = value; + return this; + } + + /** + * @return Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service. + */ + public boolean getAppointmentRequired() { + return this.appointmentRequired == null || this.appointmentRequired.isEmpty() ? false : this.appointmentRequired.getValue(); + } + + /** + * @param value Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service. + */ + public HealthcareService setAppointmentRequired(boolean value) { + if (this.appointmentRequired == null) + this.appointmentRequired = new BooleanType(); + this.appointmentRequired.setValue(value); + return this; + } + + /** + * @return {@link #availableTime} (A collection of times that the Service Site is available.) + */ + public List getAvailableTime() { + if (this.availableTime == null) + this.availableTime = new ArrayList(); + return this.availableTime; + } + + public boolean hasAvailableTime() { + if (this.availableTime == null) + return false; + for (HealthcareServiceAvailableTimeComponent item : this.availableTime) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #availableTime} (A collection of times that the Service Site is available.) + */ + // syntactic sugar + public HealthcareServiceAvailableTimeComponent addAvailableTime() { //3 + HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent(); + if (this.availableTime == null) + this.availableTime = new ArrayList(); + this.availableTime.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addAvailableTime(HealthcareServiceAvailableTimeComponent t) { //3 + if (t == null) + return this; + if (this.availableTime == null) + this.availableTime = new ArrayList(); + this.availableTime.add(t); + return this; + } + + /** + * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) + */ + public List getNotAvailable() { + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + return this.notAvailable; + } + + public boolean hasNotAvailable() { + if (this.notAvailable == null) + return false; + for (HealthcareServiceNotAvailableComponent item : this.notAvailable) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) + */ + // syntactic sugar + public HealthcareServiceNotAvailableComponent addNotAvailable() { //3 + HealthcareServiceNotAvailableComponent t = new HealthcareServiceNotAvailableComponent(); + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + this.notAvailable.add(t); + return t; + } + + // syntactic sugar + public HealthcareService addNotAvailable(HealthcareServiceNotAvailableComponent t) { //3 + if (t == null) + return this; + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + this.notAvailable.add(t); + return this; + } + + /** + * @return {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value + */ + public StringType getAvailabilityExceptionsElement() { + if (this.availabilityExceptions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions"); + else if (Configuration.doAutoCreate()) + this.availabilityExceptions = new StringType(); // bb + return this.availabilityExceptions; + } + + public boolean hasAvailabilityExceptionsElement() { + return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); + } + + public boolean hasAvailabilityExceptions() { + return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); + } + + /** + * @param value {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value + */ + public HealthcareService setAvailabilityExceptionsElement(StringType value) { + this.availabilityExceptions = value; + return this; + } + + /** + * @return A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. + */ + public String getAvailabilityExceptions() { + return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue(); + } + + /** + * @param value A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. + */ + public HealthcareService setAvailabilityExceptions(String value) { + if (Utilities.noString(value)) + this.availabilityExceptions = null; + else { + if (this.availabilityExceptions == null) + this.availabilityExceptions = new StringType(); + this.availabilityExceptions.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifiers for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("providedBy", "Reference(Organization)", "The organization that provides this healthcare service.", 0, java.lang.Integer.MAX_VALUE, providedBy)); + childrenList.add(new Property("serviceCategory", "CodeableConcept", "Identifies the broad category of service being performed or delivered.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); + childrenList.add(new Property("serviceType", "CodeableConcept", "The specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, serviceType)); + childrenList.add(new Property("specialty", "CodeableConcept", "Collection of specialties handled by the service site. This is more of a medical term.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("location", "Reference(Location)", "The location(s) where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("serviceName", "string", "Further description of the service as it would be presented to a consumer while searching.", 0, java.lang.Integer.MAX_VALUE, serviceName)); + childrenList.add(new Property("comment", "string", "Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("extraDetails", "string", "Extra details about the service that can't be placed in the other fields.", 0, java.lang.Integer.MAX_VALUE, extraDetails)); + childrenList.add(new Property("photo", "Attachment", "If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("telecom", "ContactPoint", "List of contacts related to this specific healthcare service.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("coverageArea", "Reference(Location)", "The location(s) that this service is available to (not where the service is provided).", 0, java.lang.Integer.MAX_VALUE, coverageArea)); + childrenList.add(new Property("serviceProvisionCode", "CodeableConcept", "The code(s) that detail the conditions under which the healthcare service is available/offered.", 0, java.lang.Integer.MAX_VALUE, serviceProvisionCode)); + childrenList.add(new Property("eligibility", "CodeableConcept", "Does this service have specific eligibility requirements that need to be met in order to use the service?", 0, java.lang.Integer.MAX_VALUE, eligibility)); + childrenList.add(new Property("eligibilityNote", "string", "Describes the eligibility conditions for the service.", 0, java.lang.Integer.MAX_VALUE, eligibilityNote)); + childrenList.add(new Property("programName", "string", "Program Names that can be used to categorize the service.", 0, java.lang.Integer.MAX_VALUE, programName)); + childrenList.add(new Property("characteristic", "CodeableConcept", "Collection of characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic)); + childrenList.add(new Property("referralMethod", "CodeableConcept", "Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.", 0, java.lang.Integer.MAX_VALUE, referralMethod)); + childrenList.add(new Property("publicKey", "string", "The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.", 0, java.lang.Integer.MAX_VALUE, publicKey)); + childrenList.add(new Property("appointmentRequired", "boolean", "Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.", 0, java.lang.Integer.MAX_VALUE, appointmentRequired)); + childrenList.add(new Property("availableTime", "", "A collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); + childrenList.add(new Property("notAvailable", "", "The HealthcareService is not available during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable)); + childrenList.add(new Property("availabilityExceptions", "string", "A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 205136282: /*providedBy*/ return this.providedBy == null ? new Base[0] : new Base[] {this.providedBy}; // Reference + case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept + case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept + case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept + case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference + case -1928572192: /*serviceName*/ return this.serviceName == null ? new Base[0] : new Base[] {this.serviceName}; // StringType + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + case -1469168622: /*extraDetails*/ return this.extraDetails == null ? new Base[0] : new Base[] {this.extraDetails}; // StringType + case 106642994: /*photo*/ return this.photo == null ? new Base[0] : new Base[] {this.photo}; // Attachment + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1532328299: /*coverageArea*/ return this.coverageArea == null ? new Base[0] : this.coverageArea.toArray(new Base[this.coverageArea.size()]); // Reference + case 1504575405: /*serviceProvisionCode*/ return this.serviceProvisionCode == null ? new Base[0] : this.serviceProvisionCode.toArray(new Base[this.serviceProvisionCode.size()]); // CodeableConcept + case -930847859: /*eligibility*/ return this.eligibility == null ? new Base[0] : new Base[] {this.eligibility}; // CodeableConcept + case 1635973407: /*eligibilityNote*/ return this.eligibilityNote == null ? new Base[0] : new Base[] {this.eligibilityNote}; // StringType + case 1010379567: /*programName*/ return this.programName == null ? new Base[0] : this.programName.toArray(new Base[this.programName.size()]); // StringType + case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // CodeableConcept + case -2092740898: /*referralMethod*/ return this.referralMethod == null ? new Base[0] : this.referralMethod.toArray(new Base[this.referralMethod.size()]); // CodeableConcept + case 1446899510: /*publicKey*/ return this.publicKey == null ? new Base[0] : new Base[] {this.publicKey}; // StringType + case 427220062: /*appointmentRequired*/ return this.appointmentRequired == null ? new Base[0] : new Base[] {this.appointmentRequired}; // BooleanType + case 1873069366: /*availableTime*/ return this.availableTime == null ? new Base[0] : this.availableTime.toArray(new Base[this.availableTime.size()]); // HealthcareServiceAvailableTimeComponent + case -629572298: /*notAvailable*/ return this.notAvailable == null ? new Base[0] : this.notAvailable.toArray(new Base[this.notAvailable.size()]); // HealthcareServiceNotAvailableComponent + case -1149143617: /*availabilityExceptions*/ return this.availabilityExceptions == null ? new Base[0] : new Base[] {this.availabilityExceptions}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 205136282: // providedBy + this.providedBy = castToReference(value); // Reference + break; + case 1281188563: // serviceCategory + this.serviceCategory = castToCodeableConcept(value); // CodeableConcept + break; + case -1928370289: // serviceType + this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1694759682: // specialty + this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1901043637: // location + this.getLocation().add(castToReference(value)); // Reference + break; + case -1928572192: // serviceName + this.serviceName = castToString(value); // StringType + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + case -1469168622: // extraDetails + this.extraDetails = castToString(value); // StringType + break; + case 106642994: // photo + this.photo = castToAttachment(value); // Attachment + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1532328299: // coverageArea + this.getCoverageArea().add(castToReference(value)); // Reference + break; + case 1504575405: // serviceProvisionCode + this.getServiceProvisionCode().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -930847859: // eligibility + this.eligibility = castToCodeableConcept(value); // CodeableConcept + break; + case 1635973407: // eligibilityNote + this.eligibilityNote = castToString(value); // StringType + break; + case 1010379567: // programName + this.getProgramName().add(castToString(value)); // StringType + break; + case 366313883: // characteristic + this.getCharacteristic().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -2092740898: // referralMethod + this.getReferralMethod().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1446899510: // publicKey + this.publicKey = castToString(value); // StringType + break; + case 427220062: // appointmentRequired + this.appointmentRequired = castToBoolean(value); // BooleanType + break; + case 1873069366: // availableTime + this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value); // HealthcareServiceAvailableTimeComponent + break; + case -629572298: // notAvailable + this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value); // HealthcareServiceNotAvailableComponent + break; + case -1149143617: // availabilityExceptions + this.availabilityExceptions = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("providedBy")) + this.providedBy = castToReference(value); // Reference + else if (name.equals("serviceCategory")) + this.serviceCategory = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("serviceType")) + this.getServiceType().add(castToCodeableConcept(value)); + else if (name.equals("specialty")) + this.getSpecialty().add(castToCodeableConcept(value)); + else if (name.equals("location")) + this.getLocation().add(castToReference(value)); + else if (name.equals("serviceName")) + this.serviceName = castToString(value); // StringType + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else if (name.equals("extraDetails")) + this.extraDetails = castToString(value); // StringType + else if (name.equals("photo")) + this.photo = castToAttachment(value); // Attachment + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("coverageArea")) + this.getCoverageArea().add(castToReference(value)); + else if (name.equals("serviceProvisionCode")) + this.getServiceProvisionCode().add(castToCodeableConcept(value)); + else if (name.equals("eligibility")) + this.eligibility = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("eligibilityNote")) + this.eligibilityNote = castToString(value); // StringType + else if (name.equals("programName")) + this.getProgramName().add(castToString(value)); + else if (name.equals("characteristic")) + this.getCharacteristic().add(castToCodeableConcept(value)); + else if (name.equals("referralMethod")) + this.getReferralMethod().add(castToCodeableConcept(value)); + else if (name.equals("publicKey")) + this.publicKey = castToString(value); // StringType + else if (name.equals("appointmentRequired")) + this.appointmentRequired = castToBoolean(value); // BooleanType + else if (name.equals("availableTime")) + this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value); + else if (name.equals("notAvailable")) + this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value); + else if (name.equals("availabilityExceptions")) + this.availabilityExceptions = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 205136282: return getProvidedBy(); // Reference + case 1281188563: return getServiceCategory(); // CodeableConcept + case -1928370289: return addServiceType(); // CodeableConcept + case -1694759682: return addSpecialty(); // CodeableConcept + case 1901043637: return addLocation(); // Reference + case -1928572192: throw new FHIRException("Cannot make property serviceName as it is not a complex type"); // StringType + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + case -1469168622: throw new FHIRException("Cannot make property extraDetails as it is not a complex type"); // StringType + case 106642994: return getPhoto(); // Attachment + case -1429363305: return addTelecom(); // ContactPoint + case -1532328299: return addCoverageArea(); // Reference + case 1504575405: return addServiceProvisionCode(); // CodeableConcept + case -930847859: return getEligibility(); // CodeableConcept + case 1635973407: throw new FHIRException("Cannot make property eligibilityNote as it is not a complex type"); // StringType + case 1010379567: throw new FHIRException("Cannot make property programName as it is not a complex type"); // StringType + case 366313883: return addCharacteristic(); // CodeableConcept + case -2092740898: return addReferralMethod(); // CodeableConcept + case 1446899510: throw new FHIRException("Cannot make property publicKey as it is not a complex type"); // StringType + case 427220062: throw new FHIRException("Cannot make property appointmentRequired as it is not a complex type"); // BooleanType + case 1873069366: return addAvailableTime(); // HealthcareServiceAvailableTimeComponent + case -629572298: return addNotAvailable(); // HealthcareServiceNotAvailableComponent + case -1149143617: throw new FHIRException("Cannot make property availabilityExceptions as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("providedBy")) { + this.providedBy = new Reference(); + return this.providedBy; + } + else if (name.equals("serviceCategory")) { + this.serviceCategory = new CodeableConcept(); + return this.serviceCategory; + } + else if (name.equals("serviceType")) { + return addServiceType(); + } + else if (name.equals("specialty")) { + return addSpecialty(); + } + else if (name.equals("location")) { + return addLocation(); + } + else if (name.equals("serviceName")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.serviceName"); + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.comment"); + } + else if (name.equals("extraDetails")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.extraDetails"); + } + else if (name.equals("photo")) { + this.photo = new Attachment(); + return this.photo; + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("coverageArea")) { + return addCoverageArea(); + } + else if (name.equals("serviceProvisionCode")) { + return addServiceProvisionCode(); + } + else if (name.equals("eligibility")) { + this.eligibility = new CodeableConcept(); + return this.eligibility; + } + else if (name.equals("eligibilityNote")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.eligibilityNote"); + } + else if (name.equals("programName")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.programName"); + } + else if (name.equals("characteristic")) { + return addCharacteristic(); + } + else if (name.equals("referralMethod")) { + return addReferralMethod(); + } + else if (name.equals("publicKey")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.publicKey"); + } + else if (name.equals("appointmentRequired")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.appointmentRequired"); + } + else if (name.equals("availableTime")) { + return addAvailableTime(); + } + else if (name.equals("notAvailable")) { + return addNotAvailable(); + } + else if (name.equals("availabilityExceptions")) { + throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.availabilityExceptions"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "HealthcareService"; + + } + + public HealthcareService copy() { + HealthcareService dst = new HealthcareService(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.providedBy = providedBy == null ? null : providedBy.copy(); + dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); + if (serviceType != null) { + dst.serviceType = new ArrayList(); + for (CodeableConcept i : serviceType) + dst.serviceType.add(i.copy()); + }; + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + if (location != null) { + dst.location = new ArrayList(); + for (Reference i : location) + dst.location.add(i.copy()); + }; + dst.serviceName = serviceName == null ? null : serviceName.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.extraDetails = extraDetails == null ? null : extraDetails.copy(); + dst.photo = photo == null ? null : photo.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + if (coverageArea != null) { + dst.coverageArea = new ArrayList(); + for (Reference i : coverageArea) + dst.coverageArea.add(i.copy()); + }; + if (serviceProvisionCode != null) { + dst.serviceProvisionCode = new ArrayList(); + for (CodeableConcept i : serviceProvisionCode) + dst.serviceProvisionCode.add(i.copy()); + }; + dst.eligibility = eligibility == null ? null : eligibility.copy(); + dst.eligibilityNote = eligibilityNote == null ? null : eligibilityNote.copy(); + if (programName != null) { + dst.programName = new ArrayList(); + for (StringType i : programName) + dst.programName.add(i.copy()); + }; + if (characteristic != null) { + dst.characteristic = new ArrayList(); + for (CodeableConcept i : characteristic) + dst.characteristic.add(i.copy()); + }; + if (referralMethod != null) { + dst.referralMethod = new ArrayList(); + for (CodeableConcept i : referralMethod) + dst.referralMethod.add(i.copy()); + }; + dst.publicKey = publicKey == null ? null : publicKey.copy(); + dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy(); + if (availableTime != null) { + dst.availableTime = new ArrayList(); + for (HealthcareServiceAvailableTimeComponent i : availableTime) + dst.availableTime.add(i.copy()); + }; + if (notAvailable != null) { + dst.notAvailable = new ArrayList(); + for (HealthcareServiceNotAvailableComponent i : notAvailable) + dst.notAvailable.add(i.copy()); + }; + dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); + return dst; + } + + protected HealthcareService typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof HealthcareService)) + return false; + HealthcareService o = (HealthcareService) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(providedBy, o.providedBy, true) + && compareDeep(serviceCategory, o.serviceCategory, true) && compareDeep(serviceType, o.serviceType, true) + && compareDeep(specialty, o.specialty, true) && compareDeep(location, o.location, true) && compareDeep(serviceName, o.serviceName, true) + && compareDeep(comment, o.comment, true) && compareDeep(extraDetails, o.extraDetails, true) && compareDeep(photo, o.photo, true) + && compareDeep(telecom, o.telecom, true) && compareDeep(coverageArea, o.coverageArea, true) && compareDeep(serviceProvisionCode, o.serviceProvisionCode, true) + && compareDeep(eligibility, o.eligibility, true) && compareDeep(eligibilityNote, o.eligibilityNote, true) + && compareDeep(programName, o.programName, true) && compareDeep(characteristic, o.characteristic, true) + && compareDeep(referralMethod, o.referralMethod, true) && compareDeep(publicKey, o.publicKey, true) + && compareDeep(appointmentRequired, o.appointmentRequired, true) && compareDeep(availableTime, o.availableTime, true) + && compareDeep(notAvailable, o.notAvailable, true) && compareDeep(availabilityExceptions, o.availabilityExceptions, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof HealthcareService)) + return false; + HealthcareService o = (HealthcareService) other; + return compareValues(serviceName, o.serviceName, true) && compareValues(comment, o.comment, true) && compareValues(extraDetails, o.extraDetails, true) + && compareValues(eligibilityNote, o.eligibilityNote, true) && compareValues(programName, o.programName, true) + && compareValues(publicKey, o.publicKey, true) && compareValues(appointmentRequired, o.appointmentRequired, true) + && compareValues(availabilityExceptions, o.availabilityExceptions, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (providedBy == null || providedBy.isEmpty()) + && (serviceCategory == null || serviceCategory.isEmpty()) && (serviceType == null || serviceType.isEmpty()) + && (specialty == null || specialty.isEmpty()) && (location == null || location.isEmpty()) + && (serviceName == null || serviceName.isEmpty()) && (comment == null || comment.isEmpty()) + && (extraDetails == null || extraDetails.isEmpty()) && (photo == null || photo.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (coverageArea == null || coverageArea.isEmpty()) + && (serviceProvisionCode == null || serviceProvisionCode.isEmpty()) && (eligibility == null || eligibility.isEmpty()) + && (eligibilityNote == null || eligibilityNote.isEmpty()) && (programName == null || programName.isEmpty()) + && (characteristic == null || characteristic.isEmpty()) && (referralMethod == null || referralMethod.isEmpty()) + && (publicKey == null || publicKey.isEmpty()) && (appointmentRequired == null || appointmentRequired.isEmpty()) + && (availableTime == null || availableTime.isEmpty()) && (notAvailable == null || notAvailable.isEmpty()) + && (availabilityExceptions == null || availabilityExceptions.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.HealthcareService; + } + + /** + * Search parameter: servicecategory + *

+ * Description: Service Category of the Healthcare Service
+ * Type: token
+ * Path: HealthcareService.serviceCategory
+ *

+ */ + @SearchParamDefinition(name="servicecategory", path="HealthcareService.serviceCategory", description="Service Category of the Healthcare Service", type="token" ) + public static final String SP_SERVICECATEGORY = "servicecategory"; + /** + * Fluent Client search parameter constant for servicecategory + *

+ * Description: Service Category of the Healthcare Service
+ * Type: token
+ * Path: HealthcareService.serviceCategory
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICECATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICECATEGORY); + + /** + * Search parameter: organization + *

+ * Description: The organization that provides this Healthcare Service
+ * Type: reference
+ * Path: HealthcareService.providedBy
+ *

+ */ + @SearchParamDefinition(name="organization", path="HealthcareService.providedBy", description="The organization that provides this Healthcare Service", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: The organization that provides this Healthcare Service
+ * Type: reference
+ * Path: HealthcareService.providedBy
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "HealthcareService:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("HealthcareService:organization").toLocked(); + + /** + * Search parameter: servicetype + *

+ * Description: The type of service provided by this healthcare service
+ * Type: token
+ * Path: HealthcareService.serviceType
+ *

+ */ + @SearchParamDefinition(name="servicetype", path="HealthcareService.serviceType", description="The type of service provided by this healthcare service", type="token" ) + public static final String SP_SERVICETYPE = "servicetype"; + /** + * Fluent Client search parameter constant for servicetype + *

+ * Description: The type of service provided by this healthcare service
+ * Type: token
+ * Path: HealthcareService.serviceType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICETYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICETYPE); + + /** + * Search parameter: location + *

+ * Description: The location of the Healthcare Service
+ * Type: reference
+ * Path: HealthcareService.location
+ *

+ */ + @SearchParamDefinition(name="location", path="HealthcareService.location", description="The location of the Healthcare Service", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: The location of the Healthcare Service
+ * Type: reference
+ * Path: HealthcareService.location
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "HealthcareService:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("HealthcareService:location").toLocked(); + + /** + * Search parameter: name + *

+ * Description: A portion of the Healthcare service name
+ * Type: string
+ * Path: HealthcareService.serviceName
+ *

+ */ + @SearchParamDefinition(name="name", path="HealthcareService.serviceName", description="A portion of the Healthcare service name", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: A portion of the Healthcare service name
+ * Type: string
+ * Path: HealthcareService.serviceName
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: programname + *

+ * Description: One of the Program Names serviced by this HealthcareService
+ * Type: string
+ * Path: HealthcareService.programName
+ *

+ */ + @SearchParamDefinition(name="programname", path="HealthcareService.programName", description="One of the Program Names serviced by this HealthcareService", type="string" ) + public static final String SP_PROGRAMNAME = "programname"; + /** + * Fluent Client search parameter constant for programname + *

+ * Description: One of the Program Names serviced by this HealthcareService
+ * Type: string
+ * Path: HealthcareService.programName
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PROGRAMNAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PROGRAMNAME); + + /** + * Search parameter: characteristic + *

+ * Description: One of the HealthcareService's characteristics
+ * Type: token
+ * Path: HealthcareService.characteristic
+ *

+ */ + @SearchParamDefinition(name="characteristic", path="HealthcareService.characteristic", description="One of the HealthcareService's characteristics", type="token" ) + public static final String SP_CHARACTERISTIC = "characteristic"; + /** + * Fluent Client search parameter constant for characteristic + *

+ * Description: One of the HealthcareService's characteristics
+ * Type: token
+ * Path: HealthcareService.characteristic
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC); + + /** + * Search parameter: identifier + *

+ * Description: External identifiers for this item
+ * Type: token
+ * Path: HealthcareService.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="HealthcareService.identifier", description="External identifiers for this item", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: External identifiers for this item
+ * Type: token
+ * Path: HealthcareService.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/HumanName.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/HumanName.java new file mode 100644 index 00000000000..9b03f349d01 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/HumanName.java @@ -0,0 +1,954 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.util.DatatypeUtil; + +/** + * A human's name with the ability to identify parts and usage. + */ +@DatatypeDef(name = "HumanName") +public class HumanName extends Type implements ICompositeType { + + public enum NameUse { + /** + * Known as/conventional/the one you normally use + */ + USUAL, + /** + * The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". + */ + OFFICIAL, + /** + * A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations. + */ + TEMP, + /** + * A name that is used to address the person in an informal manner, but is not part of their formal or usual name + */ + NICKNAME, + /** + * Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons) + */ + ANONYMOUS, + /** + * This name is no longer in use (or was never correct, but retained for records) + */ + OLD, + /** + * A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of + * maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name + * be determined algorithmically. + */ + MAIDEN, + /** + * added to help the parsers + */ + NULL; + public static NameUse fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return USUAL; + if ("official".equals(codeString)) + return OFFICIAL; + if ("temp".equals(codeString)) + return TEMP; + if ("nickname".equals(codeString)) + return NICKNAME; + if ("anonymous".equals(codeString)) + return ANONYMOUS; + if ("old".equals(codeString)) + return OLD; + if ("maiden".equals(codeString)) + return MAIDEN; + throw new FHIRException("Unknown NameUse code '" + codeString + "'"); + } + + public String toCode() { + switch (this) { + case USUAL: + return "usual"; + case OFFICIAL: + return "official"; + case TEMP: + return "temp"; + case NICKNAME: + return "nickname"; + case ANONYMOUS: + return "anonymous"; + case OLD: + return "old"; + case MAIDEN: + return "maiden"; + default: + return "?"; + } + } + + public String getSystem() { + switch (this) { + case USUAL: + return "http://hl7.org/fhir/name-use"; + case OFFICIAL: + return "http://hl7.org/fhir/name-use"; + case TEMP: + return "http://hl7.org/fhir/name-use"; + case NICKNAME: + return "http://hl7.org/fhir/name-use"; + case ANONYMOUS: + return "http://hl7.org/fhir/name-use"; + case OLD: + return "http://hl7.org/fhir/name-use"; + case MAIDEN: + return "http://hl7.org/fhir/name-use"; + default: + return "?"; + } + } + + public String getDefinition() { + switch (this) { + case USUAL: + return "Known as/conventional/the one you normally use"; + case OFFICIAL: + return "The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called \"legal name\"."; + case TEMP: + return "A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations."; + case NICKNAME: + return "A name that is used to address the person in an informal manner, but is not part of their formal or usual name"; + case ANONYMOUS: + return "Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons)"; + case OLD: + return "This name is no longer in use (or was never correct, but retained for records)"; + case MAIDEN: + return "A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store \"maiden\" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically."; + default: + return "?"; + } + } + + public String getDisplay() { + switch (this) { + case USUAL: + return "Usual"; + case OFFICIAL: + return "Official"; + case TEMP: + return "Temp"; + case NICKNAME: + return "Nickname"; + case ANONYMOUS: + return "Anonymous"; + case OLD: + return "Old"; + case MAIDEN: + return "Maiden"; + default: + return "?"; + } + } + } + + 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; + if ("usual".equals(codeString)) + return NameUse.USUAL; + if ("official".equals(codeString)) + return NameUse.OFFICIAL; + if ("temp".equals(codeString)) + return NameUse.TEMP; + if ("nickname".equals(codeString)) + return NameUse.NICKNAME; + if ("anonymous".equals(codeString)) + return NameUse.ANONYMOUS; + if ("old".equals(codeString)) + return NameUse.OLD; + if ("maiden".equals(codeString)) + return NameUse.MAIDEN; + throw new IllegalArgumentException("Unknown NameUse code '" + codeString + "'"); + } + + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return new Enumeration(this, NameUse.USUAL); + if ("official".equals(codeString)) + return new Enumeration(this, NameUse.OFFICIAL); + if ("temp".equals(codeString)) + return new Enumeration(this, NameUse.TEMP); + if ("nickname".equals(codeString)) + return new Enumeration(this, NameUse.NICKNAME); + if ("anonymous".equals(codeString)) + return new Enumeration(this, NameUse.ANONYMOUS); + if ("old".equals(codeString)) + return new Enumeration(this, NameUse.OLD); + if ("maiden".equals(codeString)) + return new Enumeration(this, NameUse.MAIDEN); + throw new FHIRException("Unknown NameUse code '" + codeString + "'"); + } + + public String toCode(NameUse code) { + if (code == NameUse.USUAL) + return "usual"; + if (code == NameUse.OFFICIAL) + return "official"; + if (code == NameUse.TEMP) + return "temp"; + if (code == NameUse.NICKNAME) + return "nickname"; + if (code == NameUse.ANONYMOUS) + return "anonymous"; + if (code == NameUse.OLD) + return "old"; + if (code == NameUse.MAIDEN) + return "maiden"; + return "?"; + } + + public String toSystem(NameUse code) { + return code.getSystem(); + } + } + + /** + * Identifies the purpose for this name. + */ + @Child(name = "use", type = { CodeType.class }, order = 0, min = 0, max = 1, modifier = true, summary = true) + @Description(shortDefinition = "usual | official | temp | nickname | anonymous | old | maiden", formalDefinition = "Identifies the purpose for this name.") + protected Enumeration use; + + /** + * A full text representation of the name. + */ + @Child(name = "text", type = { StringType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true) + @Description(shortDefinition = "Text representation of the full name", formalDefinition = "A full text representation of the name.") + protected StringType text; + + /** + * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. + */ + @Child(name = "family", type = { StringType.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) + @Description(shortDefinition = "Family name (often called 'Surname')", formalDefinition = "The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.") + protected List family; + + /** + * Given name. + */ + @Child(name = "given", type = { StringType.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) + @Description(shortDefinition = "Given names (not always 'first'). Includes middle names", formalDefinition = "Given name.") + protected List given; + + /** + * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. + */ + @Child(name = "prefix", type = { StringType.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) + @Description(shortDefinition = "Parts that come before the name", formalDefinition = "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.") + protected List prefix; + + /** + * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. + */ + @Child(name = "suffix", type = { StringType.class }, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) + @Description(shortDefinition = "Parts that come after the name", formalDefinition = "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.") + protected List suffix; + + /** + * Indicates the period of time when this name was valid for the named person. + */ + @Child(name = "period", type = { Period.class }, order = 6, min = 0, max = 1, modifier = false, summary = true) + @Description(shortDefinition = "Time period when name was/is in use", formalDefinition = "Indicates the period of time when this name was valid for the named person.") + protected Period period; + + private static final long serialVersionUID = -210174642L; + + /** + * Constructor + */ + public HumanName() { + super(); + } + + /** + * @return {@link #use} (Identifies the purpose for this name.). 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 HumanName.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new NameUseEnumFactory()); // bb + 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} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public HumanName setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Identifies the purpose for this name. + */ + public NameUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value + * Identifies the purpose for this name. + */ + public HumanName setUse(NameUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new NameUseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value + * {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public HumanName setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A full text representation of the name. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value + * A full text representation of the name. + */ + public HumanName setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public List getFamily() { + if (this.family == null) + this.family = new ArrayList(); + return this.family; + } + + public boolean hasFamily() { + if (this.family == null) + return false; + for (StringType item : this.family) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + // syntactic sugar + public StringType addFamilyElement() {// 2 + StringType t = new StringType(); + if (this.family == null) + this.family = new ArrayList(); + this.family.add(t); + return t; + } + + /** + * @param value + * {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public HumanName addFamily(String value) { // 1 + StringType t = new StringType(); + t.setValue(value); + if (this.family == null) + this.family = new ArrayList(); + this.family.add(t); + return this; + } + + /** + * @param value + * {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public boolean hasFamily(String value) { + if (this.family == null) + return false; + for (StringType v : this.family) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #given} (Given name.) + */ + public List getGiven() { + if (this.given == null) + this.given = new ArrayList(); + return this.given; + } + + public boolean hasGiven() { + if (this.given == null) + return false; + for (StringType item : this.given) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #given} (Given name.) + */ + // syntactic sugar + public StringType addGivenElement() {// 2 + StringType t = new StringType(); + if (this.given == null) + this.given = new ArrayList(); + this.given.add(t); + return t; + } + + /** + * @param value + * {@link #given} (Given name.) + */ + public HumanName addGiven(String value) { // 1 + StringType t = new StringType(); + t.setValue(value); + if (this.given == null) + this.given = new ArrayList(); + this.given.add(t); + return this; + } + + /** + * @param value + * {@link #given} (Given name.) + */ + public boolean hasGiven(String value) { + if (this.given == null) + return false; + for (StringType v : this.given) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public List getPrefix() { + if (this.prefix == null) + this.prefix = new ArrayList(); + return this.prefix; + } + + public boolean hasPrefix() { + if (this.prefix == null) + return false; + for (StringType item : this.prefix) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + // syntactic sugar + public StringType addPrefixElement() {// 2 + StringType t = new StringType(); + if (this.prefix == null) + this.prefix = new ArrayList(); + this.prefix.add(t); + return t; + } + + /** + * @param value + * {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public HumanName addPrefix(String value) { // 1 + StringType t = new StringType(); + t.setValue(value); + if (this.prefix == null) + this.prefix = new ArrayList(); + this.prefix.add(t); + return this; + } + + /** + * @param value + * {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public boolean hasPrefix(String value) { + if (this.prefix == null) + return false; + for (StringType v : this.prefix) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public List getSuffix() { + if (this.suffix == null) + this.suffix = new ArrayList(); + return this.suffix; + } + + public boolean hasSuffix() { + if (this.suffix == null) + return false; + for (StringType item : this.suffix) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + // syntactic sugar + public StringType addSuffixElement() {// 2 + StringType t = new StringType(); + if (this.suffix == null) + this.suffix = new ArrayList(); + this.suffix.add(t); + return t; + } + + /** + * @param value + * {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public HumanName addSuffix(String value) { // 1 + StringType t = new StringType(); + t.setValue(value); + if (this.suffix == null) + this.suffix = new ArrayList(); + this.suffix.add(t); + return this; + } + + /** + * @param value + * {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public boolean hasSuffix(String value) { + if (this.suffix == null) + return false; + for (StringType v : this.suffix) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #period} (Indicates the period of time when this name was valid for the named person.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value + * {@link #period} (Indicates the period of time when this name was valid for the named person.) + */ + public HumanName setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * Returns all repetitions of {@link #getFamily() family name} as a space separated string + * + * @see DatatypeUtil#joinStringsSpaceSeparated(List) + */ + public String getFamilyAsSingleString() { + return joinStringsSpaceSeparated(getFamily()); + } + + /** + * Returns all repetitions of {@link #getGiven() given name} as a space separated string + * + * @see DatatypeUtil#joinStringsSpaceSeparated(List) + */ + public String getGivenAsSingleString() { + return joinStringsSpaceSeparated(getGiven()); + } + + /** + * Returns all repetitions of {@link #getPrefix() prefix name} as a space separated string + * + * @see DatatypeUtil#joinStringsSpaceSeparated(List) + */ + public String getPrefixAsSingleString() { + return joinStringsSpaceSeparated(getPrefix()); + } + + /** + * Returns all repetitions of {@link #getSuffix() suffix} as a space separated string + * + * @see DatatypeUtil#joinStringsSpaceSeparated(List) + */ + public String getSuffixAsSingleString() { + return joinStringsSpaceSeparated(getSuffix()); + } + + /** + * Returns all of the components of the name (prefix, given, family, suffix) as a single string with a single spaced + * string separating each part. + *

+ * If none of the parts are populated, returns the {@link #getTextElement() text} element value instead. + *

+ */ + public String getNameAsSingleString() { + List nameParts = new ArrayList(); + nameParts.addAll(getPrefix()); + nameParts.addAll(getGiven()); + nameParts.addAll(getFamily()); + nameParts.addAll(getSuffix()); + if (nameParts.size() > 0) { + return joinStringsSpaceSeparated(nameParts); + } else { + return getTextElement().getValue(); + } + } + + /** + * Joins a list of strings with a single space (' ') between each string + * + * TODO: replace with call to ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated when HAPI upgrades to 1.4 + */ + private static String joinStringsSpaceSeparated(List> theStrings) { + StringBuilder b = new StringBuilder(); + for (IPrimitiveType next : theStrings) { + if (next.isEmpty()) { + continue; + } + if (b.length() > 0) { + b.append(' '); + } + b.append(next.getValue()); + } + return b.toString(); + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "Identifies the purpose for this name.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("text", "string", "A full text representation of the name.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("family", "string", "The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.", 0, + java.lang.Integer.MAX_VALUE, family)); + childrenList.add(new Property("given", "string", "Given name.", 0, java.lang.Integer.MAX_VALUE, given)); + childrenList + .add(new Property("prefix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.", + 0, java.lang.Integer.MAX_VALUE, prefix)); + childrenList + .add(new Property("suffix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.", + 0, java.lang.Integer.MAX_VALUE, suffix)); + childrenList.add(new Property("period", "Period", "Indicates the period of time when this name was valid for the named person.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116103: + /* use */ return this.use == null ? new Base[0] : new Base[] { this.use }; // Enumeration + case 3556653: + /* text */ return this.text == null ? new Base[0] : new Base[] { this.text }; // StringType + case -1281860764: + /* family */ return this.family == null ? new Base[0] : this.family.toArray(new Base[this.family.size()]); // StringType + case 98367357: + /* given */ return this.given == null ? new Base[0] : this.given.toArray(new Base[this.given.size()]); // StringType + case -980110702: + /* prefix */ return this.prefix == null ? new Base[0] : this.prefix.toArray(new Base[this.prefix.size()]); // StringType + case -891422895: + /* suffix */ return this.suffix == null ? new Base[0] : this.suffix.toArray(new Base[this.suffix.size()]); // StringType + case -991726143: + /* period */ return this.period == null ? new Base[0] : new Base[] { this.period }; // Period + default: + return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116103: // use + this.use = new NameUseEnumFactory().fromType(value); // Enumeration + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + case -1281860764: // family + this.getFamily().add(castToString(value)); // StringType + break; + case 98367357: // given + this.getGiven().add(castToString(value)); // StringType + break; + case -980110702: // prefix + this.getPrefix().add(castToString(value)); // StringType + break; + case -891422895: // suffix + this.getSuffix().add(castToString(value)); // StringType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: + super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("use")) + this.use = new NameUseEnumFactory().fromType(value); // Enumeration + else if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("family")) + this.getFamily().add(castToString(value)); + else if (name.equals("given")) + this.getGiven().add(castToString(value)); + else if (name.equals("prefix")) + this.getPrefix().add(castToString(value)); + else if (name.equals("suffix")) + this.getSuffix().add(castToString(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116103: + throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration + case 3556653: + throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case -1281860764: + throw new FHIRException("Cannot make property family as it is not a complex type"); // StringType + case 98367357: + throw new FHIRException("Cannot make property given as it is not a complex type"); // StringType + case -980110702: + throw new FHIRException("Cannot make property prefix as it is not a complex type"); // StringType + case -891422895: + throw new FHIRException("Cannot make property suffix as it is not a complex type"); // StringType + case -991726143: + return getPeriod(); // Period + default: + return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type HumanName.use"); + } else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type HumanName.text"); + } else if (name.equals("family")) { + throw new FHIRException("Cannot call addChild on a primitive type HumanName.family"); + } else if (name.equals("given")) { + throw new FHIRException("Cannot call addChild on a primitive type HumanName.given"); + } else if (name.equals("prefix")) { + throw new FHIRException("Cannot call addChild on a primitive type HumanName.prefix"); + } else if (name.equals("suffix")) { + throw new FHIRException("Cannot call addChild on a primitive type HumanName.suffix"); + } else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } else + return super.addChild(name); + } + + public String fhirType() { + return "HumanName"; + + } + + public HumanName copy() { + HumanName dst = new HumanName(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.text = text == null ? null : text.copy(); + if (family != null) { + dst.family = new ArrayList(); + for (StringType i : family) + dst.family.add(i.copy()); + } + ; + if (given != null) { + dst.given = new ArrayList(); + for (StringType i : given) + dst.given.add(i.copy()); + } + ; + if (prefix != null) { + dst.prefix = new ArrayList(); + for (StringType i : prefix) + dst.prefix.add(i.copy()); + } + ; + if (suffix != null) { + dst.suffix = new ArrayList(); + for (StringType i : suffix) + dst.suffix.add(i.copy()); + } + ; + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected HumanName typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof HumanName)) + return false; + HumanName o = (HumanName) other; + return compareDeep(use, o.use, true) && compareDeep(text, o.text, true) && compareDeep(family, o.family, true) + && compareDeep(given, o.given, true) && compareDeep(prefix, o.prefix, true) && compareDeep(suffix, o.suffix, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof HumanName)) + return false; + HumanName o = (HumanName) other; + return compareValues(use, o.use, true) && compareValues(text, o.text, true) && compareValues(family, o.family, true) + && compareValues(given, o.given, true) && compareValues(prefix, o.prefix, true) && compareValues(suffix, o.suffix, true); + } + + public boolean isEmpty() { + boolean retVal = super.isEmpty(); + retVal &= (use == null || use.isEmpty()); + retVal &= (text == null || text.isEmpty()); + retVal &= (family == null || family.isEmpty()); + retVal &= (given == null || given.isEmpty()); + retVal &= (prefix == null || prefix.isEmpty()); + retVal &= (suffix == null || suffix.isEmpty()); + retVal &= (period == null || period.isEmpty()); + return retVal; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/IdType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/IdType.java new file mode 100644 index 00000000000..8204c31a3f5 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/IdType.java @@ -0,0 +1,764 @@ +package org.hl7.fhir.dstu2016may.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. + +*/ + +import static org.apache.commons.lang3.StringUtils.isBlank; +import static org.apache.commons.lang3.StringUtils.isNotBlank; + +import java.math.BigDecimal; +import java.util.UUID; + +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * This class represents the logical identity for a resource, or as much of that + * identity is known. In FHIR, every resource must have a "logical ID" which is + * defined by the FHIR specification as: + *

+ * A whole number in the range 0 to 2^64-1 (optionally represented in hex), + * a uuid, an oid, or any other combination of lowercase letters, numerals, "-" + * and ".", with a length limit of 36 characters + *

+ *

+ * This class contains that logical ID, and can optionally also contain a + * relative or absolute URL representing the resource identity. For example, the + * following are all valid values for IdType, and all might represent the same + * resource: + *

+ *
    + *
  • 123 (just a resource's ID)
  • + *
  • Patient/123 (a relative identity)
  • + *
  • http://example.com/Patient/123 (an absolute identity)
  • + *
  • + * http://example.com/Patient/123/_history/1 (an absolute identity with a version id) + *
  • + *
  • + * Patient/123/_history/1 (a relative identity with a version id) + *
  • + *
+ *

+ * In most situations, you only need to populate the resource's ID (e.g. + * 123) in resources you are constructing and the encoder will + * infer the rest from the context in which the object is being used. On the + * other hand, the parser will always try to populate the complete absolute + * identity on objects it creates as a convenience. + *

+ *

+ * Regex for ID: [a-z0-9\-\.]{1,36} + *

+ */ +@DatatypeDef(name = "id", profileOf=StringType.class) +public final class IdType extends UriType implements IPrimitiveType, IIdType { + /** + * This is the maximum length for the ID + */ + public static final int MAX_LENGTH = 64; // maximum length + + private static final long serialVersionUID = 2L; + private String myBaseUrl; + private boolean myHaveComponentParts; + private String myResourceType; + private String myUnqualifiedId; + private String myUnqualifiedVersionId; + + /** + * Create a new empty ID + */ + public IdType() { + super(); + } + + /** + * Create a new ID, using a BigDecimal input. Uses + * {@link BigDecimal#toPlainString()} to generate the string representation. + */ + public IdType(BigDecimal thePid) { + if (thePid != null) { + setValue(toPlainStringWithNpeThrowIfNeeded(thePid)); + } else { + setValue(null); + } + } + + /** + * Create a new ID using a long + */ + public IdType(long theId) { + setValue(Long.toString(theId)); + } + + /** + * Create a new ID using a string. This String may contain a simple ID (e.g. + * "1234") or it may contain a complete URL + * (http://example.com/fhir/Patient/1234). + * + *

+ * Description: A whole number in the range 0 to 2^64-1 (optionally + * represented in hex), a uuid, an oid, or any other combination of lowercase + * letters, numerals, "-" and ".", with a length limit of 36 characters. + *

+ *

+ * regex: [a-z0-9\-\.]{1,36} + *

+ */ + public IdType(String theValue) { + setValue(theValue); + } + + /** + * Constructor + * + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theIdPart + * The ID (e.g. "123") + */ + public IdType(String theResourceType, BigDecimal theIdPart) { + this(theResourceType, toPlainStringWithNpeThrowIfNeeded(theIdPart)); + } + + /** + * Constructor + * + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theIdPart + * The ID (e.g. "123") + */ + public IdType(String theResourceType, Long theIdPart) { + this(theResourceType, toPlainStringWithNpeThrowIfNeeded(theIdPart)); + } + + /** + * Constructor + * + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theId + * The ID (e.g. "123") + */ + public IdType(String theResourceType, String theId) { + this(theResourceType, theId, null); + } + + /** + * Constructor + * + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theId + * The ID (e.g. "123") + * @param theVersionId + * The version ID ("e.g. "456") + */ + public IdType(String theResourceType, String theId, String theVersionId) { + this(null, theResourceType, theId, theVersionId); + } + + /** + * Constructor + * + * @param theBaseUrl + * The server base URL (e.g. "http://example.com/fhir") + * @param theResourceType + * The resource type (e.g. "Patient") + * @param theId + * The ID (e.g. "123") + * @param theVersionId + * The version ID ("e.g. "456") + */ + public IdType(String theBaseUrl, String theResourceType, String theId, String theVersionId) { + myBaseUrl = theBaseUrl; + myResourceType = theResourceType; + myUnqualifiedId = theId; + myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionId, null); + myHaveComponentParts = true; + if (isBlank(myBaseUrl) && isBlank(myResourceType) && isBlank(myUnqualifiedId) && isBlank(myUnqualifiedVersionId)) { + myHaveComponentParts = false; + } + } + + /** + * Creates an ID based on a given URL + */ + public IdType(UriType theUrl) { + setValue(theUrl.getValueAsString()); + } + + public void applyTo(IBaseResource theResouce) { + if (theResouce == null) { + throw new NullPointerException("theResource can not be null"); + } else { + theResouce.setId(new IdType(getValue())); + } + } + + /** + * @deprecated Use {@link #getIdPartAsBigDecimal()} instead (this method was + * deprocated because its name is ambiguous) + */ + @Deprecated + public BigDecimal asBigDecimal() { + return getIdPartAsBigDecimal(); + } + + @Override + public IdType copy() { + return new IdType(getValue()); + } + + private String determineLocalPrefix(String theValue) { + if (theValue == null || theValue.isEmpty()) { + return null; + } + if (theValue.startsWith("#")) { + return "#"; + } + int lastPrefix = -1; + for (int i = 0; i < theValue.length(); i++) { + char nextChar = theValue.charAt(i); + if (nextChar == ':') { + lastPrefix = i; + } else if (!Character.isLetter(nextChar) || !Character.isLowerCase(nextChar)) { + break; + } + } + if (lastPrefix != -1) { + String candidate = theValue.substring(0, lastPrefix + 1); + if (candidate.startsWith("cid:") || candidate.startsWith("urn:")) { + return candidate; + } else { + return null; + } + } else { + return null; + } + } + + @Override + public boolean equals(Object theArg0) { + if (!(theArg0 instanceof IdType)) { + return false; + } + IdType id = (IdType) theArg0; + return StringUtils.equals(getValueAsString(), id.getValueAsString()); + } + + /** + * Returns true if this IdType matches the given IdType in terms of resource + * type and ID, but ignores the URL base + */ + @SuppressWarnings("deprecation") + public boolean equalsIgnoreBase(IdType theId) { + if (theId == null) { + return false; + } + if (theId.isEmpty()) { + return isEmpty(); + } + return ObjectUtils.equals(getResourceType(), theId.getResourceType()) + && ObjectUtils.equals(getIdPart(), theId.getIdPart()) + && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); + } + + /** + * Returns the portion of this resource ID which corresponds to the server + * base URL. For example given the resource ID + * http://example.com/fhir/Patient/123 the base URL would be + * http://example.com/fhir. + *

+ * This method may return null if the ID contains no base (e.g. "Patient/123") + *

+ */ + @Override + public String getBaseUrl() { + return myBaseUrl; + } + + /** + * Returns only the logical ID part of this ID. For example, given the ID + * "http://example,.com/fhir/Patient/123/_history/456", this method would + * return "123". + */ + @Override + public String getIdPart() { + return myUnqualifiedId; + } + + /** + * Returns the unqualified portion of this ID as a big decimal, or + * null if the value is null + * + * @throws NumberFormatException + * If the value is not a valid BigDecimal + */ + public BigDecimal getIdPartAsBigDecimal() { + String val = getIdPart(); + if (isBlank(val)) { + return null; + } + return new BigDecimal(val); + } + + /** + * Returns the unqualified portion of this ID as a {@link Long}, or + * null if the value is null + * + * @throws NumberFormatException + * If the value is not a valid Long + */ + @Override + public Long getIdPartAsLong() { + String val = getIdPart(); + if (isBlank(val)) { + return null; + } + return Long.parseLong(val); + } + + @Override + public String getResourceType() { + return myResourceType; + } + + /** + * Returns the value of this ID. Note that this value may be a fully qualified + * URL, a relative/partial URL, or a simple ID. Use {@link #getIdPart()} to + * get just the ID portion. + * + * @see #getIdPart() + */ + @Override + public String getValue() { + String retVal = super.getValue(); + if (retVal == null && myHaveComponentParts) { + + if (determineLocalPrefix(myBaseUrl) != null && myResourceType == null && myUnqualifiedVersionId == null) { + return myBaseUrl + myUnqualifiedId; + } + + StringBuilder b = new StringBuilder(); + if (isNotBlank(myBaseUrl)) { + b.append(myBaseUrl); + if (myBaseUrl.charAt(myBaseUrl.length() - 1) != '/') { + b.append('/'); + } + } + + if (isNotBlank(myResourceType)) { + b.append(myResourceType); + } + + if (b.length() > 0) { + b.append('/'); + } + + b.append(myUnqualifiedId); + if (isNotBlank(myUnqualifiedVersionId)) { + b.append('/'); + b.append("_history"); + b.append('/'); + b.append(myUnqualifiedVersionId); + } + retVal = b.toString(); + super.setValue(retVal); + } + return retVal; + } + + @Override + public String getValueAsString() { + return getValue(); + } + + @Override + public String getVersionIdPart() { + return myUnqualifiedVersionId; + } + + public Long getVersionIdPartAsLong() { + if (!hasVersionIdPart()) { + return null; + } else { + return Long.parseLong(getVersionIdPart()); + } + } + + /** + * Returns true if this ID has a base url + * + * @see #getBaseUrl() + */ + public boolean hasBaseUrl() { + return isNotBlank(myBaseUrl); + } + + @Override + public int hashCode() { + HashCodeBuilder b = new HashCodeBuilder(); + b.append(getValueAsString()); + return b.toHashCode(); + } + + @Override + public boolean hasIdPart() { + return isNotBlank(getIdPart()); + } + + @Override + public boolean hasResourceType() { + return isNotBlank(myResourceType); + } + + @Override + public boolean hasVersionIdPart() { + return isNotBlank(getVersionIdPart()); + } + + /** + * Returns true if this ID contains an absolute URL (in other + * words, a URL starting with "http://" or "https://" + */ + @Override + public boolean isAbsolute() { + if (StringUtils.isBlank(getValue())) { + return false; + } + return isUrlAbsolute(getValue()); + } + + @Override + public boolean isEmpty() { + return isBlank(getValue()); + } + + @Override + public boolean isIdPartValid() { + String id = getIdPart(); + if (StringUtils.isBlank(id)) { + return false; + } + if (id.length() > 64) { + return false; + } + for (int i = 0; i < id.length(); i++) { + char nextChar = id.charAt(i); + if (nextChar >= 'a' && nextChar <= 'z') { + continue; + } + if (nextChar >= 'A' && nextChar <= 'Z') { + continue; + } + if (nextChar >= '0' && nextChar <= '9') { + continue; + } + if (nextChar == '-' || nextChar == '.') { + continue; + } + return false; + } + return true; + } + + /** + * Returns true if the unqualified ID is a valid {@link Long} + * value (in other words, it consists only of digits) + */ + @Override + public boolean isIdPartValidLong() { + return isValidLong(getIdPart()); + } + + /** + * Returns true if the ID is a local reference (in other words, + * it begins with the '#' character) + */ + @Override + public boolean isLocal() { + return "#".equals(myBaseUrl); + } + + @Override + public boolean isVersionIdPartValidLong() { + return isValidLong(getVersionIdPart()); + } + + /** + * Set the value + * + *

+ * Description: A whole number in the range 0 to 2^64-1 (optionally + * represented in hex), a uuid, an oid, or any other combination of lowercase + * letters, numerals, "-" and ".", with a length limit of 36 characters. + *

+ *

+ * regex: [a-z0-9\-\.]{1,36} + *

+ */ + @Override + public IdType setValue(String theValue) { + // TODO: add validation + super.setValue(theValue); + myHaveComponentParts = false; + + String localPrefix = determineLocalPrefix(theValue); + + if (StringUtils.isBlank(theValue)) { + myBaseUrl = null; + super.setValue(null); + myUnqualifiedId = null; + myUnqualifiedVersionId = null; + myResourceType = null; + } else if (theValue.charAt(0) == '#' && theValue.length() > 1) { + super.setValue(theValue); + myBaseUrl = "#"; + myUnqualifiedId = theValue.substring(1); + myUnqualifiedVersionId = null; + myResourceType = null; + myHaveComponentParts = true; + } else if (localPrefix != null) { + myBaseUrl = localPrefix; + myUnqualifiedId = theValue.substring(localPrefix.length()); + } else { + int vidIndex = theValue.indexOf("/_history/"); + int idIndex; + if (vidIndex != -1) { + myUnqualifiedVersionId = theValue.substring(vidIndex + "/_history/".length()); + idIndex = theValue.lastIndexOf('/', vidIndex - 1); + myUnqualifiedId = theValue.substring(idIndex + 1, vidIndex); + } else { + idIndex = theValue.lastIndexOf('/'); + myUnqualifiedId = theValue.substring(idIndex + 1); + myUnqualifiedVersionId = null; + } + + myBaseUrl = null; + if (idIndex <= 0) { + myResourceType = null; + } else { + int typeIndex = theValue.lastIndexOf('/', idIndex - 1); + if (typeIndex == -1) { + myResourceType = theValue.substring(0, idIndex); + } else { + myResourceType = theValue.substring(typeIndex + 1, idIndex); + + if (typeIndex > 4) { + myBaseUrl = theValue.substring(0, typeIndex); + } + + } + } + + } + return this; + } + + /** + * Set the value + * + *

+ * Description: A whole number in the range 0 to 2^64-1 (optionally + * represented in hex), a uuid, an oid, or any other combination of lowercase + * letters, numerals, "-" and ".", with a length limit of 36 characters. + *

+ *

+ * regex: [a-z0-9\-\.]{1,36} + *

+ */ + @Override + public void setValueAsString(String theValue) { + setValue(theValue); + } + + @Override + public String toString() { + return getValue(); + } + + /** + * Returns a new IdType containing this IdType's values but with no server + * base URL if one is present in this IdType. For example, if this IdType + * contains the ID "http://foo/Patient/1", this method will return a new + * IdType containing ID "Patient/1". + */ + @Override + public IdType toUnqualified() { + return new IdType(getResourceType(), getIdPart(), getVersionIdPart()); + } + + @Override + public IdType toUnqualifiedVersionless() { + return new IdType(getResourceType(), getIdPart()); + } + + @Override + public IdType toVersionless() { + return new IdType(getBaseUrl(), getResourceType(), getIdPart(), null); + } + + @Override + public IdType withResourceType(String theResourceName) { + return new IdType(theResourceName, getIdPart(), getVersionIdPart()); + } + + /** + * Returns a view of this ID as a fully qualified URL, given a server base and + * resource name (which will only be used if the ID does not already contain + * those respective parts). Essentially, because IdType can contain either a + * complete URL or a partial one (or even jut a simple ID), this method may be + * used to translate into a complete URL. + * + * @param theServerBase + * The server base (e.g. "http://example.com/fhir") + * @param theResourceType + * The resource name (e.g. "Patient") + * @return A fully qualified URL for this ID (e.g. + * "http://example.com/fhir/Patient/1") + */ + @Override + public IdType withServerBase(String theServerBase, String theResourceType) { + return new IdType(theServerBase, theResourceType, getIdPart(), getVersionIdPart()); + } + + /** + * Creates a new instance of this ID which is identical, but refers to the + * specific version of this resource ID noted by theVersion. + * + * @param theVersion + * The actual version string, e.g. "1" + * @return A new instance of IdType which is identical, but refers to the + * specific version of this resource ID noted by theVersion. + */ + public IdType withVersion(String theVersion) { + Validate.notBlank(theVersion, "Version may not be null or empty"); + + String existingValue = getValue(); + + int i = existingValue.indexOf("_history"); + String value; + if (i > 1) { + value = existingValue.substring(0, i - 1); + } else { + value = existingValue; + } + + return new IdType(value + '/' + "_history" + '/' + theVersion); + } + + private static boolean isUrlAbsolute(String theValue) { + String value = theValue.toLowerCase(); + return value.startsWith("http://") || value.startsWith("https://"); + } + + private static boolean isValidLong(String id) { + if (StringUtils.isBlank(id)) { + return false; + } + for (int i = 0; i < id.length(); i++) { + if (Character.isDigit(id.charAt(i)) == false) { + return false; + } + } + return true; + } + + /** + * Construct a new ID with with form "urn:uuid:[UUID]" where [UUID] is a new, + * randomly created UUID generated by {@link UUID#randomUUID()} + */ + public static IdType newRandomUuid() { + return new IdType("urn:uuid:" + UUID.randomUUID().toString()); + } + + /** + * Retrieves the ID from the given resource instance + */ + public static IdType of(IBaseResource theResouce) { + if (theResouce == null) { + throw new NullPointerException("theResource can not be null"); + } else { + IIdType retVal = theResouce.getIdElement(); + if (retVal == null) { + return null; + } else if (retVal instanceof IdType) { + return (IdType) retVal; + } else { + return new IdType(retVal.getValue()); + } + } + } + + private static String toPlainStringWithNpeThrowIfNeeded(BigDecimal theIdPart) { + if (theIdPart == null) { + throw new NullPointerException("BigDecimal ID can not be null"); + } + return theIdPart.toPlainString(); + } + + private static String toPlainStringWithNpeThrowIfNeeded(Long theIdPart) { + if (theIdPart == null) { + throw new NullPointerException("Long ID can not be null"); + } + return theIdPart.toString(); + } + + public String fhirType() { + return "id"; + } + + public IIdType setParts(String theBaseUrl, String theResourceType, String theIdPart, String theVersionIdPart) { + if (isNotBlank(theVersionIdPart)) { + Validate.notBlank(theResourceType, "If theVersionIdPart is populated, theResourceType and theIdPart must be populated"); + Validate.notBlank(theIdPart, "If theVersionIdPart is populated, theResourceType and theIdPart must be populated"); + } + if (isNotBlank(theBaseUrl) && isNotBlank(theIdPart)) { + Validate.notBlank(theResourceType, "If theBaseUrl is populated and theIdPart is populated, theResourceType must be populated"); + } + + setValue(null); + + myBaseUrl = theBaseUrl; + myResourceType = theResourceType; + myUnqualifiedId = theIdPart; + myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionIdPart, null); + myHaveComponentParts = true; + + return this; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Identifier.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Identifier.java new file mode 100644 index 00000000000..cdcd981b462 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Identifier.java @@ -0,0 +1,623 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A technical identifier - identifies some entity uniquely and unambiguously. + */ +@DatatypeDef(name="Identifier") +public class Identifier extends Type implements ICompositeType { + + public enum IdentifierUse { + /** + * The identifier recommended for display and use in real-world interactions. + */ + USUAL, + /** + * The identifier considered to be most trusted for the identification of this item. + */ + OFFICIAL, + /** + * A temporary identifier. + */ + TEMP, + /** + * An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context. + */ + SECONDARY, + /** + * added to help the parsers + */ + NULL; + public static IdentifierUse fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return USUAL; + if ("official".equals(codeString)) + return OFFICIAL; + if ("temp".equals(codeString)) + return TEMP; + if ("secondary".equals(codeString)) + return SECONDARY; + throw new FHIRException("Unknown IdentifierUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case USUAL: return "usual"; + case OFFICIAL: return "official"; + case TEMP: return "temp"; + case SECONDARY: return "secondary"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case USUAL: return "http://hl7.org/fhir/identifier-use"; + case OFFICIAL: return "http://hl7.org/fhir/identifier-use"; + case TEMP: return "http://hl7.org/fhir/identifier-use"; + case SECONDARY: return "http://hl7.org/fhir/identifier-use"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case USUAL: return "The identifier recommended for display and use in real-world interactions."; + case OFFICIAL: return "The identifier considered to be most trusted for the identification of this item."; + case TEMP: return "A temporary identifier."; + case SECONDARY: return "An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case USUAL: return "Usual"; + case OFFICIAL: return "Official"; + case TEMP: return "Temp"; + case SECONDARY: return "Secondary"; + default: return "?"; + } + } + } + + 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; + if ("usual".equals(codeString)) + return IdentifierUse.USUAL; + if ("official".equals(codeString)) + return IdentifierUse.OFFICIAL; + if ("temp".equals(codeString)) + return IdentifierUse.TEMP; + if ("secondary".equals(codeString)) + return IdentifierUse.SECONDARY; + throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return new Enumeration(this, IdentifierUse.USUAL); + if ("official".equals(codeString)) + return new Enumeration(this, IdentifierUse.OFFICIAL); + if ("temp".equals(codeString)) + return new Enumeration(this, IdentifierUse.TEMP); + if ("secondary".equals(codeString)) + return new Enumeration(this, IdentifierUse.SECONDARY); + throw new FHIRException("Unknown IdentifierUse code '"+codeString+"'"); + } + public String toCode(IdentifierUse code) { + if (code == IdentifierUse.USUAL) + return "usual"; + if (code == IdentifierUse.OFFICIAL) + return "official"; + if (code == IdentifierUse.TEMP) + return "temp"; + if (code == IdentifierUse.SECONDARY) + return "secondary"; + return "?"; + } + public String toSystem(IdentifierUse code) { + return code.getSystem(); + } + } + + /** + * The purpose of this identifier. + */ + @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="usual | official | temp | secondary (If known)", formalDefinition="The purpose of this identifier." ) + protected Enumeration use; + + /** + * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description of identifier", formalDefinition="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." ) + protected CodeableConcept type; + + /** + * Establishes the namespace in which set of possible id values is unique. + */ + @Child(name = "system", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The namespace for the identifier", formalDefinition="Establishes the namespace in which set of possible id values is unique." ) + protected UriType system; + + /** + * The portion of the identifier typically relevant to the user and which is unique within the context of the system. + */ + @Child(name = "value", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The value that is unique", formalDefinition="The portion of the identifier typically relevant to the user and which is unique within the context of the system." ) + protected StringType value; + + /** + * Time period during which identifier is/was valid for use. + */ + @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time period when id is/was valid for use", formalDefinition="Time period during which identifier is/was valid for use." ) + protected Period period; + + /** + * Organization that issued/manages the identifier. + */ + @Child(name = "assigner", type = {Organization.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization that issued id (may be just text)", formalDefinition="Organization that issued/manages the identifier." ) + protected Reference assigner; + + /** + * The actual object that is the target of the reference (Organization that issued/manages the identifier.) + */ + protected Organization assignerTarget; + + private static final long serialVersionUID = -478840981L; + + /** + * Constructor + */ + public Identifier() { + super(); + } + + /** + * @return {@link #use} (The purpose of this identifier.). 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 Identifier.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new IdentifierUseEnumFactory()); // bb + 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} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Identifier setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return The purpose of this identifier. + */ + public IdentifierUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value The purpose of this identifier. + */ + public Identifier setUse(IdentifierUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new IdentifierUseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.) + */ + public Identifier setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Identifier setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return Establishes the namespace in which set of possible id values is unique. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value Establishes the namespace in which set of possible id values is unique. + */ + public Identifier setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #value} (The portion of the identifier typically relevant to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The portion of the identifier typically relevant to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Identifier setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The portion of the identifier typically relevant to the user and which is unique within the context of the system. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The portion of the identifier typically relevant to the user and which is unique within the context of the system. + */ + public Identifier setValue(String value) { + if (Utilities.noString(value)) + this.value = null; + else { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period during which identifier is/was valid for use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period during which identifier is/was valid for use.) + */ + public Identifier setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #assigner} (Organization that issued/manages the identifier.) + */ + public Reference getAssigner() { + if (this.assigner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.assigner"); + else if (Configuration.doAutoCreate()) + this.assigner = new Reference(); // cc + return this.assigner; + } + + public boolean hasAssigner() { + return this.assigner != null && !this.assigner.isEmpty(); + } + + /** + * @param value {@link #assigner} (Organization that issued/manages the identifier.) + */ + public Identifier setAssigner(Reference value) { + this.assigner = value; + return this; + } + + /** + * @return {@link #assigner} 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. (Organization that issued/manages the identifier.) + */ + public Organization getAssignerTarget() { + if (this.assignerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.assigner"); + else if (Configuration.doAutoCreate()) + this.assignerTarget = new Organization(); // aa + return this.assignerTarget; + } + + /** + * @param value {@link #assigner} 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. (Organization that issued/manages the identifier.) + */ + public Identifier setAssignerTarget(Organization value) { + this.assignerTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "The purpose of this identifier.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("type", "CodeableConcept", "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("system", "uri", "Establishes the namespace in which set of possible id values is unique.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("value", "string", "The portion of the identifier typically relevant to the user and which is unique within the context of the system.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("period", "Period", "Time period during which identifier is/was valid for use.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("assigner", "Reference(Organization)", "Organization that issued/manages the identifier.", 0, java.lang.Integer.MAX_VALUE, assigner)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -369881636: /*assigner*/ return this.assigner == null ? new Base[0] : new Base[] {this.assigner}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116103: // use + this.use = new IdentifierUseEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -369881636: // assigner + this.assigner = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("use")) + this.use = new IdentifierUseEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("value")) + this.value = castToString(value); // StringType + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("assigner")) + this.assigner = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration + case 3575610: return getType(); // CodeableConcept + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + case -991726143: return getPeriod(); // Period + case -369881636: return getAssigner(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type Identifier.use"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type Identifier.system"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type Identifier.value"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("assigner")) { + this.assigner = new Reference(); + return this.assigner; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Identifier"; + + } + + public Identifier copy() { + Identifier dst = new Identifier(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.type = type == null ? null : type.copy(); + dst.system = system == null ? null : system.copy(); + dst.value = value == null ? null : value.copy(); + dst.period = period == null ? null : period.copy(); + dst.assigner = assigner == null ? null : assigner.copy(); + return dst; + } + + protected Identifier typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Identifier)) + return false; + Identifier o = (Identifier) other; + return compareDeep(use, o.use, true) && compareDeep(type, o.type, true) && compareDeep(system, o.system, true) + && compareDeep(value, o.value, true) && compareDeep(period, o.period, true) && compareDeep(assigner, o.assigner, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Identifier)) + return false; + Identifier o = (Identifier) other; + return compareValues(use, o.use, true) && compareValues(system, o.system, true) && compareValues(value, o.value, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (use == null || use.isEmpty()) && (type == null || type.isEmpty()) + && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) && (period == null || period.isEmpty()) + && (assigner == null || assigner.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingExcerpt.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingExcerpt.java new file mode 100644 index 00000000000..b1e28de7fc0 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingExcerpt.java @@ -0,0 +1,3230 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. + */ +@ResourceDef(name="ImagingExcerpt", profile="http://hl7.org/fhir/Profile/ImagingExcerpt") +public class ImagingExcerpt extends DomainResource { + + public enum DWebType { + /** + * Web Access to DICOM Persistent Objects - RESTful Services + */ + WADORS, + /** + * Web Access to DICOM Persistent Objects - URI + */ + WADOURI, + /** + * IHE - Invoke Image Display Profile + */ + IID, + /** + * Web Access to DICOM Persistent Objects - Web Services + */ + WADOWS, + /** + * added to help the parsers + */ + NULL; + public static DWebType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("WADO-RS".equals(codeString)) + return WADORS; + if ("WADO-URI".equals(codeString)) + return WADOURI; + if ("IID".equals(codeString)) + return IID; + if ("WADO-WS".equals(codeString)) + return WADOWS; + throw new FHIRException("Unknown DWebType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case WADORS: return "WADO-RS"; + case WADOURI: return "WADO-URI"; + case IID: return "IID"; + case WADOWS: return "WADO-WS"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case WADORS: return "http://hl7.org/fhir/dWebType"; + case WADOURI: return "http://hl7.org/fhir/dWebType"; + case IID: return "http://hl7.org/fhir/dWebType"; + case WADOWS: return "http://hl7.org/fhir/dWebType"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case WADORS: return "Web Access to DICOM Persistent Objects - RESTful Services"; + case WADOURI: return "Web Access to DICOM Persistent Objects - URI"; + case IID: return "IHE - Invoke Image Display Profile"; + case WADOWS: return "Web Access to DICOM Persistent Objects - Web Services"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case WADORS: return "WADO-RS"; + case WADOURI: return "WADO-URI"; + case IID: return "IID"; + case WADOWS: return "WADO-WS"; + default: return "?"; + } + } + } + + public static class DWebTypeEnumFactory implements EnumFactory { + public DWebType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("WADO-RS".equals(codeString)) + return DWebType.WADORS; + if ("WADO-URI".equals(codeString)) + return DWebType.WADOURI; + if ("IID".equals(codeString)) + return DWebType.IID; + if ("WADO-WS".equals(codeString)) + return DWebType.WADOWS; + throw new IllegalArgumentException("Unknown DWebType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("WADO-RS".equals(codeString)) + return new Enumeration(this, DWebType.WADORS); + if ("WADO-URI".equals(codeString)) + return new Enumeration(this, DWebType.WADOURI); + if ("IID".equals(codeString)) + return new Enumeration(this, DWebType.IID); + if ("WADO-WS".equals(codeString)) + return new Enumeration(this, DWebType.WADOWS); + throw new FHIRException("Unknown DWebType code '"+codeString+"'"); + } + public String toCode(DWebType code) { + if (code == DWebType.WADORS) + return "WADO-RS"; + if (code == DWebType.WADOURI) + return "WADO-URI"; + if (code == DWebType.IID) + return "IID"; + if (code == DWebType.WADOWS) + return "WADO-WS"; + return "?"; + } + public String toSystem(DWebType code) { + return code.getSystem(); + } + } + + @Block() + public static class StudyComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Study instance UID of the SOP instances in the selection. + */ + @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Study instance UID", formalDefinition="Study instance UID of the SOP instances in the selection." ) + protected OidType uid; + + /** + * Reference to the Imaging Study in FHIR form. + */ + @Child(name = "imagingStudy", type = {ImagingStudy.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference to ImagingStudy", formalDefinition="Reference to the Imaging Study in FHIR form." ) + protected Reference imagingStudy; + + /** + * The actual object that is the target of the reference (Reference to the Imaging Study in FHIR form.) + */ + protected ImagingStudy imagingStudyTarget; + + /** + * Methods of accessing using DICOM web technologies. + */ + @Child(name = "dicom", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Dicom web access", formalDefinition="Methods of accessing using DICOM web technologies." ) + protected List dicom; + + /** + * A set of viewable reference images of various types. + */ + @Child(name = "viewable", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Viewable format", formalDefinition="A set of viewable reference images of various types." ) + protected List viewable; + + /** + * Series identity and locating information of the DICOM SOP instances in the selection. + */ + @Child(name = "series", type = {}, order=5, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Series identity of the selected instances", formalDefinition="Series identity and locating information of the DICOM SOP instances in the selection." ) + protected List series; + + private static final long serialVersionUID = 1674060080L; + + /** + * Constructor + */ + public StudyComponent() { + super(); + } + + /** + * Constructor + */ + public StudyComponent(OidType uid) { + super(); + this.uid = uid; + } + + /** + * @return {@link #uid} (Study instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Study instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public StudyComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Study instance UID of the SOP instances in the selection. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Study instance UID of the SOP instances in the selection. + */ + public StudyComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #imagingStudy} (Reference to the Imaging Study in FHIR form.) + */ + public Reference getImagingStudy() { + if (this.imagingStudy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.imagingStudy"); + else if (Configuration.doAutoCreate()) + this.imagingStudy = new Reference(); // cc + return this.imagingStudy; + } + + public boolean hasImagingStudy() { + return this.imagingStudy != null && !this.imagingStudy.isEmpty(); + } + + /** + * @param value {@link #imagingStudy} (Reference to the Imaging Study in FHIR form.) + */ + public StudyComponent setImagingStudy(Reference value) { + this.imagingStudy = value; + return this; + } + + /** + * @return {@link #imagingStudy} 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 Imaging Study in FHIR form.) + */ + public ImagingStudy getImagingStudyTarget() { + if (this.imagingStudyTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.imagingStudy"); + else if (Configuration.doAutoCreate()) + this.imagingStudyTarget = new ImagingStudy(); // aa + return this.imagingStudyTarget; + } + + /** + * @param value {@link #imagingStudy} 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 Imaging Study in FHIR form.) + */ + public StudyComponent setImagingStudyTarget(ImagingStudy value) { + this.imagingStudyTarget = value; + return this; + } + + /** + * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) + */ + public List getDicom() { + if (this.dicom == null) + this.dicom = new ArrayList(); + return this.dicom; + } + + public boolean hasDicom() { + if (this.dicom == null) + return false; + for (StudyDicomComponent item : this.dicom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) + */ + // syntactic sugar + public StudyDicomComponent addDicom() { //3 + StudyDicomComponent t = new StudyDicomComponent(); + if (this.dicom == null) + this.dicom = new ArrayList(); + this.dicom.add(t); + return t; + } + + // syntactic sugar + public StudyComponent addDicom(StudyDicomComponent t) { //3 + if (t == null) + return this; + if (this.dicom == null) + this.dicom = new ArrayList(); + this.dicom.add(t); + return this; + } + + /** + * @return {@link #viewable} (A set of viewable reference images of various types.) + */ + public List getViewable() { + if (this.viewable == null) + this.viewable = new ArrayList(); + return this.viewable; + } + + public boolean hasViewable() { + if (this.viewable == null) + return false; + for (StudyViewableComponent item : this.viewable) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #viewable} (A set of viewable reference images of various types.) + */ + // syntactic sugar + public StudyViewableComponent addViewable() { //3 + StudyViewableComponent t = new StudyViewableComponent(); + if (this.viewable == null) + this.viewable = new ArrayList(); + this.viewable.add(t); + return t; + } + + // syntactic sugar + public StudyComponent addViewable(StudyViewableComponent t) { //3 + if (t == null) + return this; + if (this.viewable == null) + this.viewable = new ArrayList(); + this.viewable.add(t); + return this; + } + + /** + * @return {@link #series} (Series identity and locating information of the DICOM SOP instances in the selection.) + */ + public List getSeries() { + if (this.series == null) + this.series = new ArrayList(); + return this.series; + } + + public boolean hasSeries() { + if (this.series == null) + return false; + for (SeriesComponent item : this.series) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #series} (Series identity and locating information of the DICOM SOP instances in the selection.) + */ + // syntactic sugar + public SeriesComponent addSeries() { //3 + SeriesComponent t = new SeriesComponent(); + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return t; + } + + // syntactic sugar + public StudyComponent addSeries(SeriesComponent t) { //3 + if (t == null) + return this; + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Study instance UID of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy)", "Reference to the Imaging Study in FHIR form.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); + childrenList.add(new Property("dicom", "", "Methods of accessing using DICOM web technologies.", 0, java.lang.Integer.MAX_VALUE, dicom)); + childrenList.add(new Property("viewable", "", "A set of viewable reference images of various types.", 0, java.lang.Integer.MAX_VALUE, viewable)); + childrenList.add(new Property("series", "", "Series identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case -814900911: /*imagingStudy*/ return this.imagingStudy == null ? new Base[0] : new Base[] {this.imagingStudy}; // Reference + case 95578844: /*dicom*/ return this.dicom == null ? new Base[0] : this.dicom.toArray(new Base[this.dicom.size()]); // StudyDicomComponent + case 1196225919: /*viewable*/ return this.viewable == null ? new Base[0] : this.viewable.toArray(new Base[this.viewable.size()]); // StudyViewableComponent + case -905838985: /*series*/ return this.series == null ? new Base[0] : this.series.toArray(new Base[this.series.size()]); // SeriesComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case -814900911: // imagingStudy + this.imagingStudy = castToReference(value); // Reference + break; + case 95578844: // dicom + this.getDicom().add((StudyDicomComponent) value); // StudyDicomComponent + break; + case 1196225919: // viewable + this.getViewable().add((StudyViewableComponent) value); // StudyViewableComponent + break; + case -905838985: // series + this.getSeries().add((SeriesComponent) value); // SeriesComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("imagingStudy")) + this.imagingStudy = castToReference(value); // Reference + else if (name.equals("dicom")) + this.getDicom().add((StudyDicomComponent) value); + else if (name.equals("viewable")) + this.getViewable().add((StudyViewableComponent) value); + else if (name.equals("series")) + this.getSeries().add((SeriesComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case -814900911: return getImagingStudy(); // Reference + case 95578844: return addDicom(); // StudyDicomComponent + case 1196225919: return addViewable(); // StudyViewableComponent + case -905838985: return addSeries(); // SeriesComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.uid"); + } + else if (name.equals("imagingStudy")) { + this.imagingStudy = new Reference(); + return this.imagingStudy; + } + else if (name.equals("dicom")) { + return addDicom(); + } + else if (name.equals("viewable")) { + return addViewable(); + } + else if (name.equals("series")) { + return addSeries(); + } + else + return super.addChild(name); + } + + public StudyComponent copy() { + StudyComponent dst = new StudyComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.imagingStudy = imagingStudy == null ? null : imagingStudy.copy(); + if (dicom != null) { + dst.dicom = new ArrayList(); + for (StudyDicomComponent i : dicom) + dst.dicom.add(i.copy()); + }; + if (viewable != null) { + dst.viewable = new ArrayList(); + for (StudyViewableComponent i : viewable) + dst.viewable.add(i.copy()); + }; + if (series != null) { + dst.series = new ArrayList(); + for (SeriesComponent i : series) + dst.series.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StudyComponent)) + return false; + StudyComponent o = (StudyComponent) other; + return compareDeep(uid, o.uid, true) && compareDeep(imagingStudy, o.imagingStudy, true) && compareDeep(dicom, o.dicom, true) + && compareDeep(viewable, o.viewable, true) && compareDeep(series, o.series, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StudyComponent)) + return false; + StudyComponent o = (StudyComponent) other; + return compareValues(uid, o.uid, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) + && (dicom == null || dicom.isEmpty()) && (viewable == null || viewable.isEmpty()) && (series == null || series.isEmpty()) + ; + } + + public String fhirType() { + return "ImagingExcerpt.study"; + + } + + } + + @Block() + public static class StudyDicomComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Access type for DICOM web. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="WADO-RS | WADO-URI | IID | WADO-WS", formalDefinition="Access type for DICOM web." ) + protected Enumeration type; + + /** + * The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Retrieve study URL", formalDefinition="The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol." ) + protected UriType url; + + private static final long serialVersionUID = 1661664416L; + + /** + * Constructor + */ + public StudyDicomComponent() { + super(); + } + + /** + * Constructor + */ + public StudyDicomComponent(Enumeration type, UriType url) { + super(); + this.type = type; + this.url = url; + } + + /** + * @return {@link #type} (Access type for DICOM web.). 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 StudyDicomComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new DWebTypeEnumFactory()); // bb + 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} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StudyDicomComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Access type for DICOM web. + */ + public DWebType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Access type for DICOM web. + */ + public StudyDicomComponent setType(DWebType value) { + if (this.type == null) + this.type = new Enumeration(new DWebTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyDicomComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StudyDicomComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + public StudyDicomComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Access type for DICOM web.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("url", "uri", "The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.type"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.url"); + } + else + return super.addChild(name); + } + + public StudyDicomComponent copy() { + StudyDicomComponent dst = new StudyDicomComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StudyDicomComponent)) + return false; + StudyDicomComponent o = (StudyDicomComponent) other; + return compareDeep(type, o.type, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StudyDicomComponent)) + return false; + StudyDicomComponent o = (StudyDicomComponent) other; + return compareValues(type, o.type, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + public String fhirType() { + return "ImagingExcerpt.study.dicom"; + + } + + } + + @Block() + public static class StudyViewableComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + @Child(name = "contentType", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) + protected CodeType contentType; + + /** + * Height of the image in pixels (photo/video). + */ + @Child(name = "height", type = {PositiveIntType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Height of the image in pixels (photo/video)", formalDefinition="Height of the image in pixels (photo/video)." ) + protected PositiveIntType height; + + /** + * Width of the image in pixels (photo/video). + */ + @Child(name = "width", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." ) + protected PositiveIntType width; + + /** + * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. + */ + @Child(name = "frames", type = {PositiveIntType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Number of frames if > 1 (photo)", formalDefinition="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif." ) + protected PositiveIntType frames; + + /** + * The duration of the recording in seconds - for audio and video. + */ + @Child(name = "duration", type = {UnsignedIntType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." ) + protected UnsignedIntType duration; + + /** + * The number of bytes of data that make up this attachment. + */ + @Child(name = "size", type = {UnsignedIntType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) + protected UnsignedIntType size; + + /** + * A label or set of text to display in place of the data. + */ + @Child(name = "title", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) + protected StringType title; + + /** + * A location where the data can be accessed. + */ + @Child(name = "url", type = {UriType.class}, order=8, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Uri where the data can be found", formalDefinition="A location where the data can be accessed." ) + protected UriType url; + + private static final long serialVersionUID = -2135689428L; + + /** + * Constructor + */ + public StudyViewableComponent() { + super(); + } + + /** + * Constructor + */ + public StudyViewableComponent(CodeType contentType, UriType url) { + super(); + this.contentType = contentType; + this.url = url; + } + + /** + * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public CodeType getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyViewableComponent.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new CodeType(); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public StudyViewableComponent setContentTypeElement(CodeType value) { + this.contentType = value; + return this; + } + + /** + * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + public String getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + public StudyViewableComponent setContentType(String value) { + if (this.contentType == null) + this.contentType = new CodeType(); + this.contentType.setValue(value); + return this; + } + + /** + * @return {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value + */ + public PositiveIntType getHeightElement() { + if (this.height == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyViewableComponent.height"); + else if (Configuration.doAutoCreate()) + this.height = new PositiveIntType(); // bb + return this.height; + } + + public boolean hasHeightElement() { + return this.height != null && !this.height.isEmpty(); + } + + public boolean hasHeight() { + return this.height != null && !this.height.isEmpty(); + } + + /** + * @param value {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value + */ + public StudyViewableComponent setHeightElement(PositiveIntType value) { + this.height = value; + return this; + } + + /** + * @return Height of the image in pixels (photo/video). + */ + public int getHeight() { + return this.height == null || this.height.isEmpty() ? 0 : this.height.getValue(); + } + + /** + * @param value Height of the image in pixels (photo/video). + */ + public StudyViewableComponent setHeight(int value) { + if (this.height == null) + this.height = new PositiveIntType(); + this.height.setValue(value); + return this; + } + + /** + * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value + */ + public PositiveIntType getWidthElement() { + if (this.width == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyViewableComponent.width"); + else if (Configuration.doAutoCreate()) + this.width = new PositiveIntType(); // bb + return this.width; + } + + public boolean hasWidthElement() { + return this.width != null && !this.width.isEmpty(); + } + + public boolean hasWidth() { + return this.width != null && !this.width.isEmpty(); + } + + /** + * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value + */ + public StudyViewableComponent setWidthElement(PositiveIntType value) { + this.width = value; + return this; + } + + /** + * @return Width of the image in pixels (photo/video). + */ + public int getWidth() { + return this.width == null || this.width.isEmpty() ? 0 : this.width.getValue(); + } + + /** + * @param value Width of the image in pixels (photo/video). + */ + public StudyViewableComponent setWidth(int value) { + if (this.width == null) + this.width = new PositiveIntType(); + this.width.setValue(value); + return this; + } + + /** + * @return {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value + */ + public PositiveIntType getFramesElement() { + if (this.frames == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyViewableComponent.frames"); + else if (Configuration.doAutoCreate()) + this.frames = new PositiveIntType(); // bb + return this.frames; + } + + public boolean hasFramesElement() { + return this.frames != null && !this.frames.isEmpty(); + } + + public boolean hasFrames() { + return this.frames != null && !this.frames.isEmpty(); + } + + /** + * @param value {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value + */ + public StudyViewableComponent setFramesElement(PositiveIntType value) { + this.frames = value; + return this; + } + + /** + * @return The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. + */ + public int getFrames() { + return this.frames == null || this.frames.isEmpty() ? 0 : this.frames.getValue(); + } + + /** + * @param value The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. + */ + public StudyViewableComponent setFrames(int value) { + if (this.frames == null) + this.frames = new PositiveIntType(); + this.frames.setValue(value); + return this; + } + + /** + * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public UnsignedIntType getDurationElement() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyViewableComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new UnsignedIntType(); // bb + return this.duration; + } + + public boolean hasDurationElement() { + return this.duration != null && !this.duration.isEmpty(); + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public StudyViewableComponent setDurationElement(UnsignedIntType value) { + this.duration = value; + return this; + } + + /** + * @return The duration of the recording in seconds - for audio and video. + */ + public int getDuration() { + return this.duration == null || this.duration.isEmpty() ? 0 : this.duration.getValue(); + } + + /** + * @param value The duration of the recording in seconds - for audio and video. + */ + public StudyViewableComponent setDuration(int value) { + if (this.duration == null) + this.duration = new UnsignedIntType(); + this.duration.setValue(value); + return this; + } + + /** + * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public UnsignedIntType getSizeElement() { + if (this.size == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyViewableComponent.size"); + else if (Configuration.doAutoCreate()) + this.size = new UnsignedIntType(); // bb + return this.size; + } + + public boolean hasSizeElement() { + return this.size != null && !this.size.isEmpty(); + } + + public boolean hasSize() { + return this.size != null && !this.size.isEmpty(); + } + + /** + * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public StudyViewableComponent setSizeElement(UnsignedIntType value) { + this.size = value; + return this; + } + + /** + * @return The number of bytes of data that make up this attachment. + */ + public int getSize() { + return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); + } + + /** + * @param value The number of bytes of data that make up this attachment. + */ + public StudyViewableComponent setSize(int value) { + if (this.size == null) + this.size = new UnsignedIntType(); + this.size.setValue(value); + return this; + } + + /** + * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyViewableComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StudyViewableComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A label or set of text to display in place of the data. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A label or set of text to display in place of the data. + */ + public StudyViewableComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (A location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyViewableComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (A location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StudyViewableComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return A location where the data can be accessed. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value A location where the data can be accessed. + */ + public StudyViewableComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("height", "positiveInt", "Height of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, height)); + childrenList.add(new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, width)); + childrenList.add(new Property("frames", "positiveInt", "The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif.", 0, java.lang.Integer.MAX_VALUE, frames)); + childrenList.add(new Property("duration", "unsignedInt", "The duration of the recording in seconds - for audio and video.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); + childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("url", "uri", "A location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType + case -1221029593: /*height*/ return this.height == null ? new Base[0] : new Base[] {this.height}; // PositiveIntType + case 113126854: /*width*/ return this.width == null ? new Base[0] : new Base[] {this.width}; // PositiveIntType + case -1266514778: /*frames*/ return this.frames == null ? new Base[0] : new Base[] {this.frames}; // PositiveIntType + case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // UnsignedIntType + case 3530753: /*size*/ return this.size == null ? new Base[0] : new Base[] {this.size}; // UnsignedIntType + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -389131437: // contentType + this.contentType = castToCode(value); // CodeType + break; + case -1221029593: // height + this.height = castToPositiveInt(value); // PositiveIntType + break; + case 113126854: // width + this.width = castToPositiveInt(value); // PositiveIntType + break; + case -1266514778: // frames + this.frames = castToPositiveInt(value); // PositiveIntType + break; + case -1992012396: // duration + this.duration = castToUnsignedInt(value); // UnsignedIntType + break; + case 3530753: // size + this.size = castToUnsignedInt(value); // UnsignedIntType + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("contentType")) + this.contentType = castToCode(value); // CodeType + else if (name.equals("height")) + this.height = castToPositiveInt(value); // PositiveIntType + else if (name.equals("width")) + this.width = castToPositiveInt(value); // PositiveIntType + else if (name.equals("frames")) + this.frames = castToPositiveInt(value); // PositiveIntType + else if (name.equals("duration")) + this.duration = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("size")) + this.size = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType + case -1221029593: throw new FHIRException("Cannot make property height as it is not a complex type"); // PositiveIntType + case 113126854: throw new FHIRException("Cannot make property width as it is not a complex type"); // PositiveIntType + case -1266514778: throw new FHIRException("Cannot make property frames as it is not a complex type"); // PositiveIntType + case -1992012396: throw new FHIRException("Cannot make property duration as it is not a complex type"); // UnsignedIntType + case 3530753: throw new FHIRException("Cannot make property size as it is not a complex type"); // UnsignedIntType + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("contentType")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.contentType"); + } + else if (name.equals("height")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.height"); + } + else if (name.equals("width")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.width"); + } + else if (name.equals("frames")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.frames"); + } + else if (name.equals("duration")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.duration"); + } + else if (name.equals("size")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.size"); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.title"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.url"); + } + else + return super.addChild(name); + } + + public StudyViewableComponent copy() { + StudyViewableComponent dst = new StudyViewableComponent(); + copyValues(dst); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.height = height == null ? null : height.copy(); + dst.width = width == null ? null : width.copy(); + dst.frames = frames == null ? null : frames.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.size = size == null ? null : size.copy(); + dst.title = title == null ? null : title.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StudyViewableComponent)) + return false; + StudyViewableComponent o = (StudyViewableComponent) other; + return compareDeep(contentType, o.contentType, true) && compareDeep(height, o.height, true) && compareDeep(width, o.width, true) + && compareDeep(frames, o.frames, true) && compareDeep(duration, o.duration, true) && compareDeep(size, o.size, true) + && compareDeep(title, o.title, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StudyViewableComponent)) + return false; + StudyViewableComponent o = (StudyViewableComponent) other; + return compareValues(contentType, o.contentType, true) && compareValues(height, o.height, true) && compareValues(width, o.width, true) + && compareValues(frames, o.frames, true) && compareValues(duration, o.duration, true) && compareValues(size, o.size, true) + && compareValues(title, o.title, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (height == null || height.isEmpty()) + && (width == null || width.isEmpty()) && (frames == null || frames.isEmpty()) && (duration == null || duration.isEmpty()) + && (size == null || size.isEmpty()) && (title == null || title.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + public String fhirType() { + return "ImagingExcerpt.study.viewable"; + + } + + } + + @Block() + public static class SeriesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Series instance UID of the SOP instances in the selection. + */ + @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Series instance UID", formalDefinition="Series instance UID of the SOP instances in the selection." ) + protected OidType uid; + + /** + * Methods of accessing using DICOM web technologies. + */ + @Child(name = "dicom", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Dicom web access", formalDefinition="Methods of accessing using DICOM web technologies." ) + protected List dicom; + + /** + * Identity and locating information of the selected DICOM SOP instances. + */ + @Child(name = "instance", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The selected instance", formalDefinition="Identity and locating information of the selected DICOM SOP instances." ) + protected List instance; + + private static final long serialVersionUID = 1845643577L; + + /** + * Constructor + */ + public SeriesComponent() { + super(); + } + + /** + * Constructor + */ + public SeriesComponent(OidType uid) { + super(); + this.uid = uid; + } + + /** + * @return {@link #uid} (Series instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Series instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public SeriesComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Series instance UID of the SOP instances in the selection. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Series instance UID of the SOP instances in the selection. + */ + public SeriesComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) + */ + public List getDicom() { + if (this.dicom == null) + this.dicom = new ArrayList(); + return this.dicom; + } + + public boolean hasDicom() { + if (this.dicom == null) + return false; + for (SeriesDicomComponent item : this.dicom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) + */ + // syntactic sugar + public SeriesDicomComponent addDicom() { //3 + SeriesDicomComponent t = new SeriesDicomComponent(); + if (this.dicom == null) + this.dicom = new ArrayList(); + this.dicom.add(t); + return t; + } + + // syntactic sugar + public SeriesComponent addDicom(SeriesDicomComponent t) { //3 + if (t == null) + return this; + if (this.dicom == null) + this.dicom = new ArrayList(); + this.dicom.add(t); + return this; + } + + /** + * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) + */ + public List getInstance() { + if (this.instance == null) + this.instance = new ArrayList(); + return this.instance; + } + + public boolean hasInstance() { + if (this.instance == null) + return false; + for (InstanceComponent item : this.instance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) + */ + // syntactic sugar + public InstanceComponent addInstance() { //3 + InstanceComponent t = new InstanceComponent(); + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return t; + } + + // syntactic sugar + public SeriesComponent addInstance(InstanceComponent t) { //3 + if (t == null) + return this; + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Series instance UID of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("dicom", "", "Methods of accessing using DICOM web technologies.", 0, java.lang.Integer.MAX_VALUE, dicom)); + childrenList.add(new Property("instance", "", "Identity and locating information of the selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case 95578844: /*dicom*/ return this.dicom == null ? new Base[0] : this.dicom.toArray(new Base[this.dicom.size()]); // SeriesDicomComponent + case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // InstanceComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case 95578844: // dicom + this.getDicom().add((SeriesDicomComponent) value); // SeriesDicomComponent + break; + case 555127957: // instance + this.getInstance().add((InstanceComponent) value); // InstanceComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("dicom")) + this.getDicom().add((SeriesDicomComponent) value); + else if (name.equals("instance")) + this.getInstance().add((InstanceComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case 95578844: return addDicom(); // SeriesDicomComponent + case 555127957: return addInstance(); // InstanceComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.uid"); + } + else if (name.equals("dicom")) { + return addDicom(); + } + else if (name.equals("instance")) { + return addInstance(); + } + else + return super.addChild(name); + } + + public SeriesComponent copy() { + SeriesComponent dst = new SeriesComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + if (dicom != null) { + dst.dicom = new ArrayList(); + for (SeriesDicomComponent i : dicom) + dst.dicom.add(i.copy()); + }; + if (instance != null) { + dst.instance = new ArrayList(); + for (InstanceComponent i : instance) + dst.instance.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SeriesComponent)) + return false; + SeriesComponent o = (SeriesComponent) other; + return compareDeep(uid, o.uid, true) && compareDeep(dicom, o.dicom, true) && compareDeep(instance, o.instance, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SeriesComponent)) + return false; + SeriesComponent o = (SeriesComponent) other; + return compareValues(uid, o.uid, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (dicom == null || dicom.isEmpty()) + && (instance == null || instance.isEmpty()); + } + + public String fhirType() { + return "ImagingExcerpt.study.series"; + + } + + } + + @Block() + public static class SeriesDicomComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Access type for DICOM web. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="WADO-RS | WADO-URI | IID | WADO-WS", formalDefinition="Access type for DICOM web." ) + protected Enumeration type; + + /** + * The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Retrieve study URL", formalDefinition="The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol." ) + protected UriType url; + + private static final long serialVersionUID = 1661664416L; + + /** + * Constructor + */ + public SeriesDicomComponent() { + super(); + } + + /** + * Constructor + */ + public SeriesDicomComponent(Enumeration type, UriType url) { + super(); + this.type = type; + this.url = url; + } + + /** + * @return {@link #type} (Access type for DICOM web.). 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 SeriesDicomComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new DWebTypeEnumFactory()); // bb + 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} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SeriesDicomComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Access type for DICOM web. + */ + public DWebType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Access type for DICOM web. + */ + public SeriesDicomComponent setType(DWebType value) { + if (this.type == null) + this.type = new Enumeration(new DWebTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesDicomComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SeriesDicomComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + public SeriesDicomComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Access type for DICOM web.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("url", "uri", "The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.type"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.url"); + } + else + return super.addChild(name); + } + + public SeriesDicomComponent copy() { + SeriesDicomComponent dst = new SeriesDicomComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SeriesDicomComponent)) + return false; + SeriesDicomComponent o = (SeriesDicomComponent) other; + return compareDeep(type, o.type, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SeriesDicomComponent)) + return false; + SeriesDicomComponent o = (SeriesDicomComponent) other; + return compareValues(type, o.type, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + public String fhirType() { + return "ImagingExcerpt.study.series.dicom"; + + } + + } + + @Block() + public static class InstanceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * SOP class UID of the selected instance. + */ + @Child(name = "sopClass", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="SOP class UID of instance", formalDefinition="SOP class UID of the selected instance." ) + protected OidType sopClass; + + /** + * SOP Instance UID of the selected instance. + */ + @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Selected instance UID", formalDefinition="SOP Instance UID of the selected instance." ) + protected OidType uid; + + /** + * Methods of accessing using DICOM web technologies. + */ + @Child(name = "dicom", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Dicom web access", formalDefinition="Methods of accessing using DICOM web technologies." ) + protected List dicom; + + /** + * The specific frame reference within a multi-frame object. + */ + @Child(name = "frameNumbers", type = {UnsignedIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Frame reference number", formalDefinition="The specific frame reference within a multi-frame object." ) + protected List frameNumbers; + + private static final long serialVersionUID = 1372440557L; + + /** + * Constructor + */ + public InstanceComponent() { + super(); + } + + /** + * Constructor + */ + public InstanceComponent(OidType sopClass, OidType uid) { + super(); + this.sopClass = sopClass; + this.uid = uid; + } + + /** + * @return {@link #sopClass} (SOP class UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public OidType getSopClassElement() { + if (this.sopClass == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.sopClass"); + else if (Configuration.doAutoCreate()) + this.sopClass = new OidType(); // bb + return this.sopClass; + } + + public boolean hasSopClassElement() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + public boolean hasSopClass() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + /** + * @param value {@link #sopClass} (SOP class UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public InstanceComponent setSopClassElement(OidType value) { + this.sopClass = value; + return this; + } + + /** + * @return SOP class UID of the selected instance. + */ + public String getSopClass() { + return this.sopClass == null ? null : this.sopClass.getValue(); + } + + /** + * @param value SOP class UID of the selected instance. + */ + public InstanceComponent setSopClass(String value) { + if (this.sopClass == null) + this.sopClass = new OidType(); + this.sopClass.setValue(value); + return this; + } + + /** + * @return {@link #uid} (SOP Instance UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (SOP Instance UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public InstanceComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return SOP Instance UID of the selected instance. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value SOP Instance UID of the selected instance. + */ + public InstanceComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) + */ + public List getDicom() { + if (this.dicom == null) + this.dicom = new ArrayList(); + return this.dicom; + } + + public boolean hasDicom() { + if (this.dicom == null) + return false; + for (InstanceDicomComponent item : this.dicom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) + */ + // syntactic sugar + public InstanceDicomComponent addDicom() { //3 + InstanceDicomComponent t = new InstanceDicomComponent(); + if (this.dicom == null) + this.dicom = new ArrayList(); + this.dicom.add(t); + return t; + } + + // syntactic sugar + public InstanceComponent addDicom(InstanceDicomComponent t) { //3 + if (t == null) + return this; + if (this.dicom == null) + this.dicom = new ArrayList(); + this.dicom.add(t); + return this; + } + + /** + * @return {@link #frameNumbers} (The specific frame reference within a multi-frame object.) + */ + public List getFrameNumbers() { + if (this.frameNumbers == null) + this.frameNumbers = new ArrayList(); + return this.frameNumbers; + } + + public boolean hasFrameNumbers() { + if (this.frameNumbers == null) + return false; + for (UnsignedIntType item : this.frameNumbers) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #frameNumbers} (The specific frame reference within a multi-frame object.) + */ + // syntactic sugar + public UnsignedIntType addFrameNumbersElement() {//2 + UnsignedIntType t = new UnsignedIntType(); + if (this.frameNumbers == null) + this.frameNumbers = new ArrayList(); + this.frameNumbers.add(t); + return t; + } + + /** + * @param value {@link #frameNumbers} (The specific frame reference within a multi-frame object.) + */ + public InstanceComponent addFrameNumbers(int value) { //1 + UnsignedIntType t = new UnsignedIntType(); + t.setValue(value); + if (this.frameNumbers == null) + this.frameNumbers = new ArrayList(); + this.frameNumbers.add(t); + return this; + } + + /** + * @param value {@link #frameNumbers} (The specific frame reference within a multi-frame object.) + */ + public boolean hasFrameNumbers(int value) { + if (this.frameNumbers == null) + return false; + for (UnsignedIntType v : this.frameNumbers) + if (v.equals(value)) // unsignedInt + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sopClass", "oid", "SOP class UID of the selected instance.", 0, java.lang.Integer.MAX_VALUE, sopClass)); + childrenList.add(new Property("uid", "oid", "SOP Instance UID of the selected instance.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("dicom", "", "Methods of accessing using DICOM web technologies.", 0, java.lang.Integer.MAX_VALUE, dicom)); + childrenList.add(new Property("frameNumbers", "unsignedInt", "The specific frame reference within a multi-frame object.", 0, java.lang.Integer.MAX_VALUE, frameNumbers)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1560041540: /*sopClass*/ return this.sopClass == null ? new Base[0] : new Base[] {this.sopClass}; // OidType + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case 95578844: /*dicom*/ return this.dicom == null ? new Base[0] : this.dicom.toArray(new Base[this.dicom.size()]); // InstanceDicomComponent + case -144148451: /*frameNumbers*/ return this.frameNumbers == null ? new Base[0] : this.frameNumbers.toArray(new Base[this.frameNumbers.size()]); // UnsignedIntType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1560041540: // sopClass + this.sopClass = castToOid(value); // OidType + break; + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case 95578844: // dicom + this.getDicom().add((InstanceDicomComponent) value); // InstanceDicomComponent + break; + case -144148451: // frameNumbers + this.getFrameNumbers().add(castToUnsignedInt(value)); // UnsignedIntType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sopClass")) + this.sopClass = castToOid(value); // OidType + else if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("dicom")) + this.getDicom().add((InstanceDicomComponent) value); + else if (name.equals("frameNumbers")) + this.getFrameNumbers().add(castToUnsignedInt(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1560041540: throw new FHIRException("Cannot make property sopClass as it is not a complex type"); // OidType + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case 95578844: return addDicom(); // InstanceDicomComponent + case -144148451: throw new FHIRException("Cannot make property frameNumbers as it is not a complex type"); // UnsignedIntType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sopClass")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.sopClass"); + } + else if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.uid"); + } + else if (name.equals("dicom")) { + return addDicom(); + } + else if (name.equals("frameNumbers")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.frameNumbers"); + } + else + return super.addChild(name); + } + + public InstanceComponent copy() { + InstanceComponent dst = new InstanceComponent(); + copyValues(dst); + dst.sopClass = sopClass == null ? null : sopClass.copy(); + dst.uid = uid == null ? null : uid.copy(); + if (dicom != null) { + dst.dicom = new ArrayList(); + for (InstanceDicomComponent i : dicom) + dst.dicom.add(i.copy()); + }; + if (frameNumbers != null) { + dst.frameNumbers = new ArrayList(); + for (UnsignedIntType i : frameNumbers) + dst.frameNumbers.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof InstanceComponent)) + return false; + InstanceComponent o = (InstanceComponent) other; + return compareDeep(sopClass, o.sopClass, true) && compareDeep(uid, o.uid, true) && compareDeep(dicom, o.dicom, true) + && compareDeep(frameNumbers, o.frameNumbers, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof InstanceComponent)) + return false; + InstanceComponent o = (InstanceComponent) other; + return compareValues(sopClass, o.sopClass, true) && compareValues(uid, o.uid, true) && compareValues(frameNumbers, o.frameNumbers, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sopClass == null || sopClass.isEmpty()) && (uid == null || uid.isEmpty()) + && (dicom == null || dicom.isEmpty()) && (frameNumbers == null || frameNumbers.isEmpty()) + ; + } + + public String fhirType() { + return "ImagingExcerpt.study.series.instance"; + + } + + } + + @Block() + public static class InstanceDicomComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Access type for DICOM web. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="WADO-RS | WADO-URI | IID | WADO-WS", formalDefinition="Access type for DICOM web." ) + protected Enumeration type; + + /** + * The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Retrieve study URL", formalDefinition="The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol." ) + protected UriType url; + + private static final long serialVersionUID = 1661664416L; + + /** + * Constructor + */ + public InstanceDicomComponent() { + super(); + } + + /** + * Constructor + */ + public InstanceDicomComponent(Enumeration type, UriType url) { + super(); + this.type = type; + this.url = url; + } + + /** + * @return {@link #type} (Access type for DICOM web.). 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 InstanceDicomComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new DWebTypeEnumFactory()); // bb + 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} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public InstanceDicomComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Access type for DICOM web. + */ + public DWebType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Access type for DICOM web. + */ + public InstanceDicomComponent setType(DWebType value) { + if (this.type == null) + this.type = new Enumeration(new DWebTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceDicomComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public InstanceDicomComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. + */ + public InstanceDicomComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Access type for DICOM web.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("url", "uri", "The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.type"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.url"); + } + else + return super.addChild(name); + } + + public InstanceDicomComponent copy() { + InstanceDicomComponent dst = new InstanceDicomComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof InstanceDicomComponent)) + return false; + InstanceDicomComponent o = (InstanceDicomComponent) other; + return compareDeep(type, o.type, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof InstanceDicomComponent)) + return false; + InstanceDicomComponent o = (InstanceDicomComponent) other; + return compareValues(type, o.type, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + public String fhirType() { + return "ImagingExcerpt.study.series.instance.dicom"; + + } + + } + + /** + * Unique identifier of the DICOM Key Object Selection (KOS) representation. + */ + @Child(name = "uid", type = {OidType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Instance UID", formalDefinition="Unique identifier of the DICOM Key Object Selection (KOS) representation." ) + protected OidType uid; + + /** + * A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient of the selected objects", formalDefinition="A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) + */ + protected Patient patientTarget; + + /** + * Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). + */ + @Child(name = "authoringTime", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time when the imaging object selection was created", formalDefinition="Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image)." ) + protected DateTimeType authoringTime; + + /** + * Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. + */ + @Child(name = "author", type = {Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Author (human or machine)", formalDefinition="Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + protected Resource authorTarget; + + /** + * The reason for, or significance of, the selection of objects referenced in the resource. + */ + @Child(name = "title", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason for selection", formalDefinition="The reason for, or significance of, the selection of objects referenced in the resource." ) + protected CodeableConcept title; + + /** + * Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description text", formalDefinition="Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection." ) + protected StringType description; + + /** + * Study identity and locating information of the DICOM SOP instances in the selection. + */ + @Child(name = "study", type = {}, order=6, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Study identity of the selected instances", formalDefinition="Study identity and locating information of the DICOM SOP instances in the selection." ) + protected List study; + + private static final long serialVersionUID = 1428713335L; + + /** + * Constructor + */ + public ImagingExcerpt() { + super(); + } + + /** + * Constructor + */ + public ImagingExcerpt(OidType uid, Reference patient, CodeableConcept title) { + super(); + this.uid = uid; + this.patient = patient; + this.title = title; + } + + /** + * @return {@link #uid} (Unique identifier of the DICOM Key Object Selection (KOS) representation.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingExcerpt.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Unique identifier of the DICOM Key Object Selection (KOS) representation.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingExcerpt setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Unique identifier of the DICOM Key Object Selection (KOS) representation. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Unique identifier of the DICOM Key Object Selection (KOS) representation. + */ + public ImagingExcerpt setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingExcerpt.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) + */ + public ImagingExcerpt 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. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingExcerpt.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) + */ + public ImagingExcerpt setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #authoringTime} (Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value + */ + public DateTimeType getAuthoringTimeElement() { + if (this.authoringTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingExcerpt.authoringTime"); + else if (Configuration.doAutoCreate()) + this.authoringTime = new DateTimeType(); // bb + return this.authoringTime; + } + + public boolean hasAuthoringTimeElement() { + return this.authoringTime != null && !this.authoringTime.isEmpty(); + } + + public boolean hasAuthoringTime() { + return this.authoringTime != null && !this.authoringTime.isEmpty(); + } + + /** + * @param value {@link #authoringTime} (Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value + */ + public ImagingExcerpt setAuthoringTimeElement(DateTimeType value) { + this.authoringTime = value; + return this; + } + + /** + * @return Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). + */ + public Date getAuthoringTime() { + return this.authoringTime == null ? null : this.authoringTime.getValue(); + } + + /** + * @param value Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). + */ + public ImagingExcerpt setAuthoringTime(Date value) { + if (value == null) + this.authoringTime = null; + else { + if (this.authoringTime == null) + this.authoringTime = new DateTimeType(); + this.authoringTime.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingExcerpt.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public ImagingExcerpt setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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. (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} 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. (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public ImagingExcerpt setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) + */ + public CodeableConcept getTitle() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingExcerpt.title"); + else if (Configuration.doAutoCreate()) + this.title = new CodeableConcept(); // cc + return this.title; + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) + */ + public ImagingExcerpt setTitle(CodeableConcept value) { + this.title = value; + return this; + } + + /** + * @return {@link #description} (Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). 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 ImagingExcerpt.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingExcerpt setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + public ImagingExcerpt 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 #study} (Study identity and locating information of the DICOM SOP instances in the selection.) + */ + public List getStudy() { + if (this.study == null) + this.study = new ArrayList(); + return this.study; + } + + public boolean hasStudy() { + if (this.study == null) + return false; + for (StudyComponent item : this.study) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) + */ + // syntactic sugar + public StudyComponent addStudy() { //3 + StudyComponent t = new StudyComponent(); + if (this.study == null) + this.study = new ArrayList(); + this.study.add(t); + return t; + } + + // syntactic sugar + public ImagingExcerpt addStudy(StudyComponent t) { //3 + if (t == null) + return this; + if (this.study == null) + this.study = new ArrayList(); + this.study.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Unique identifier of the DICOM Key Object Selection (KOS) representation.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("patient", "Reference(Patient)", "A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("authoringTime", "dateTime", "Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).", 0, java.lang.Integer.MAX_VALUE, authoringTime)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("title", "CodeableConcept", "The reason for, or significance of, the selection of objects referenced in the resource.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("description", "string", "Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("study", "", "Study identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, study)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1724532252: /*authoringTime*/ return this.authoringTime == null ? new Base[0] : new Base[] {this.authoringTime}; // DateTimeType + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 109776329: /*study*/ return this.study == null ? new Base[0] : this.study.toArray(new Base[this.study.size()]); // StudyComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1724532252: // authoringTime + this.authoringTime = castToDateTime(value); // DateTimeType + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case 110371416: // title + this.title = castToCodeableConcept(value); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 109776329: // study + this.getStudy().add((StudyComponent) value); // StudyComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("authoringTime")) + this.authoringTime = castToDateTime(value); // DateTimeType + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("title")) + this.title = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("study")) + this.getStudy().add((StudyComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case -791418107: return getPatient(); // Reference + case -1724532252: throw new FHIRException("Cannot make property authoringTime as it is not a complex type"); // DateTimeType + case -1406328437: return getAuthor(); // Reference + case 110371416: return getTitle(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 109776329: return addStudy(); // StudyComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.uid"); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("authoringTime")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.authoringTime"); + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("title")) { + this.title = new CodeableConcept(); + return this.title; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.description"); + } + else if (name.equals("study")) { + return addStudy(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ImagingExcerpt"; + + } + + public ImagingExcerpt copy() { + ImagingExcerpt dst = new ImagingExcerpt(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.authoringTime = authoringTime == null ? null : authoringTime.copy(); + dst.author = author == null ? null : author.copy(); + dst.title = title == null ? null : title.copy(); + dst.description = description == null ? null : description.copy(); + if (study != null) { + dst.study = new ArrayList(); + for (StudyComponent i : study) + dst.study.add(i.copy()); + }; + return dst; + } + + protected ImagingExcerpt typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingExcerpt)) + return false; + ImagingExcerpt o = (ImagingExcerpt) other; + return compareDeep(uid, o.uid, true) && compareDeep(patient, o.patient, true) && compareDeep(authoringTime, o.authoringTime, true) + && compareDeep(author, o.author, true) && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) + && compareDeep(study, o.study, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingExcerpt)) + return false; + ImagingExcerpt o = (ImagingExcerpt) other; + return compareValues(uid, o.uid, true) && compareValues(authoringTime, o.authoringTime, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (patient == null || patient.isEmpty()) + && (authoringTime == null || authoringTime.isEmpty()) && (author == null || author.isEmpty()) + && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (study == null || study.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImagingExcerpt; + } + + /** + * Search parameter: selected-study + *

+ * Description: Study selected in key DICOM object selection
+ * Type: uri
+ * Path: ImagingExcerpt.study.uid
+ *

+ */ + @SearchParamDefinition(name="selected-study", path="ImagingExcerpt.study.uid", description="Study selected in key DICOM object selection", type="uri" ) + public static final String SP_SELECTED_STUDY = "selected-study"; + /** + * Fluent Client search parameter constant for selected-study + *

+ * Description: Study selected in key DICOM object selection
+ * Type: uri
+ * Path: ImagingExcerpt.study.uid
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam SELECTED_STUDY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SELECTED_STUDY); + + /** + * Search parameter: author + *

+ * Description: Author of key DICOM object selection
+ * Type: reference
+ * Path: ImagingExcerpt.author
+ *

+ */ + @SearchParamDefinition(name="author", path="ImagingExcerpt.author", description="Author of key DICOM object selection", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: Author of key DICOM object selection
+ * Type: reference
+ * Path: ImagingExcerpt.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImagingExcerpt:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("ImagingExcerpt:author").toLocked(); + + /** + * Search parameter: title + *

+ * Description: Title of key DICOM object selection
+ * Type: token
+ * Path: ImagingExcerpt.title
+ *

+ */ + @SearchParamDefinition(name="title", path="ImagingExcerpt.title", description="Title of key DICOM object selection", type="token" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Title of key DICOM object selection
+ * Type: token
+ * Path: ImagingExcerpt.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TITLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TITLE); + + /** + * Search parameter: patient + *

+ * Description: Subject of key DICOM object selection
+ * Type: reference
+ * Path: ImagingExcerpt.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="ImagingExcerpt.patient", description="Subject of key DICOM object selection", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Subject of key DICOM object selection
+ * Type: reference
+ * Path: ImagingExcerpt.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImagingExcerpt:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImagingExcerpt:patient").toLocked(); + + /** + * Search parameter: authoring-time + *

+ * Description: Time of key DICOM object selection authoring
+ * Type: date
+ * Path: ImagingExcerpt.authoringTime
+ *

+ */ + @SearchParamDefinition(name="authoring-time", path="ImagingExcerpt.authoringTime", description="Time of key DICOM object selection authoring", type="date" ) + public static final String SP_AUTHORING_TIME = "authoring-time"; + /** + * Fluent Client search parameter constant for authoring-time + *

+ * Description: Time of key DICOM object selection authoring
+ * Type: date
+ * Path: ImagingExcerpt.authoringTime
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORING_TIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORING_TIME); + + /** + * Search parameter: identifier + *

+ * Description: UID of key DICOM object selection
+ * Type: uri
+ * Path: ImagingExcerpt.uid
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ImagingExcerpt.uid", description="UID of key DICOM object selection", type="uri" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: UID of key DICOM object selection
+ * Type: uri
+ * Path: ImagingExcerpt.uid
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingObjectSelection.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingObjectSelection.java new file mode 100644 index 00000000000..c2390befb4e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingObjectSelection.java @@ -0,0 +1,1984 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. + */ +@ResourceDef(name="ImagingObjectSelection", profile="http://hl7.org/fhir/Profile/ImagingObjectSelection") +public class ImagingObjectSelection extends DomainResource { + + @Block() + public static class StudyComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Study instance UID of the SOP instances in the selection. + */ + @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Study instance UID", formalDefinition="Study instance UID of the SOP instances in the selection." ) + protected OidType uid; + + /** + * WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Retrieve study URL", formalDefinition="WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection." ) + protected UriType url; + + /** + * Reference to the Imaging Study in FHIR form. + */ + @Child(name = "imagingStudy", type = {ImagingStudy.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference to ImagingStudy", formalDefinition="Reference to the Imaging Study in FHIR form." ) + protected Reference imagingStudy; + + /** + * The actual object that is the target of the reference (Reference to the Imaging Study in FHIR form.) + */ + protected ImagingStudy imagingStudyTarget; + + /** + * Series identity and locating information of the DICOM SOP instances in the selection. + */ + @Child(name = "series", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Series identity of the selected instances", formalDefinition="Series identity and locating information of the DICOM SOP instances in the selection." ) + protected List series; + + private static final long serialVersionUID = 341246743L; + + /** + * Constructor + */ + public StudyComponent() { + super(); + } + + /** + * Constructor + */ + public StudyComponent(OidType uid) { + super(); + this.uid = uid; + } + + /** + * @return {@link #uid} (Study instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Study instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public StudyComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Study instance UID of the SOP instances in the selection. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Study instance UID of the SOP instances in the selection. + */ + public StudyComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #url} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StudyComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + public StudyComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #imagingStudy} (Reference to the Imaging Study in FHIR form.) + */ + public Reference getImagingStudy() { + if (this.imagingStudy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.imagingStudy"); + else if (Configuration.doAutoCreate()) + this.imagingStudy = new Reference(); // cc + return this.imagingStudy; + } + + public boolean hasImagingStudy() { + return this.imagingStudy != null && !this.imagingStudy.isEmpty(); + } + + /** + * @param value {@link #imagingStudy} (Reference to the Imaging Study in FHIR form.) + */ + public StudyComponent setImagingStudy(Reference value) { + this.imagingStudy = value; + return this; + } + + /** + * @return {@link #imagingStudy} 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 Imaging Study in FHIR form.) + */ + public ImagingStudy getImagingStudyTarget() { + if (this.imagingStudyTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.imagingStudy"); + else if (Configuration.doAutoCreate()) + this.imagingStudyTarget = new ImagingStudy(); // aa + return this.imagingStudyTarget; + } + + /** + * @param value {@link #imagingStudy} 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 Imaging Study in FHIR form.) + */ + public StudyComponent setImagingStudyTarget(ImagingStudy value) { + this.imagingStudyTarget = value; + return this; + } + + /** + * @return {@link #series} (Series identity and locating information of the DICOM SOP instances in the selection.) + */ + public List getSeries() { + if (this.series == null) + this.series = new ArrayList(); + return this.series; + } + + public boolean hasSeries() { + if (this.series == null) + return false; + for (SeriesComponent item : this.series) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #series} (Series identity and locating information of the DICOM SOP instances in the selection.) + */ + // syntactic sugar + public SeriesComponent addSeries() { //3 + SeriesComponent t = new SeriesComponent(); + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return t; + } + + // syntactic sugar + public StudyComponent addSeries(SeriesComponent t) { //3 + if (t == null) + return this; + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Study instance UID of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy)", "Reference to the Imaging Study in FHIR form.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); + childrenList.add(new Property("series", "", "Series identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -814900911: /*imagingStudy*/ return this.imagingStudy == null ? new Base[0] : new Base[] {this.imagingStudy}; // Reference + case -905838985: /*series*/ return this.series == null ? new Base[0] : this.series.toArray(new Base[this.series.size()]); // SeriesComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -814900911: // imagingStudy + this.imagingStudy = castToReference(value); // Reference + break; + case -905838985: // series + this.getSeries().add((SeriesComponent) value); // SeriesComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("imagingStudy")) + this.imagingStudy = castToReference(value); // Reference + else if (name.equals("series")) + this.getSeries().add((SeriesComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -814900911: return getImagingStudy(); // Reference + case -905838985: return addSeries(); // SeriesComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.uid"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.url"); + } + else if (name.equals("imagingStudy")) { + this.imagingStudy = new Reference(); + return this.imagingStudy; + } + else if (name.equals("series")) { + return addSeries(); + } + else + return super.addChild(name); + } + + public StudyComponent copy() { + StudyComponent dst = new StudyComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.url = url == null ? null : url.copy(); + dst.imagingStudy = imagingStudy == null ? null : imagingStudy.copy(); + if (series != null) { + dst.series = new ArrayList(); + for (SeriesComponent i : series) + dst.series.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StudyComponent)) + return false; + StudyComponent o = (StudyComponent) other; + return compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) && compareDeep(imagingStudy, o.imagingStudy, true) + && compareDeep(series, o.series, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StudyComponent)) + return false; + StudyComponent o = (StudyComponent) other; + return compareValues(uid, o.uid, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (url == null || url.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) + && (series == null || series.isEmpty()); + } + + public String fhirType() { + return "ImagingObjectSelection.study"; + + } + + } + + @Block() + public static class SeriesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Series instance UID of the SOP instances in the selection. + */ + @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Series instance UID", formalDefinition="Series instance UID of the SOP instances in the selection." ) + protected OidType uid; + + /** + * WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Retrieve series URL", formalDefinition="WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection." ) + protected UriType url; + + /** + * Identity and locating information of the selected DICOM SOP instances. + */ + @Child(name = "instance", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The selected instance", formalDefinition="Identity and locating information of the selected DICOM SOP instances." ) + protected List instance; + + private static final long serialVersionUID = 229247770L; + + /** + * Constructor + */ + public SeriesComponent() { + super(); + } + + /** + * Constructor + */ + public SeriesComponent(OidType uid) { + super(); + this.uid = uid; + } + + /** + * @return {@link #uid} (Series instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Series instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public SeriesComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Series instance UID of the SOP instances in the selection. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Series instance UID of the SOP instances in the selection. + */ + public SeriesComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #url} (WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SeriesComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + public SeriesComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) + */ + public List getInstance() { + if (this.instance == null) + this.instance = new ArrayList(); + return this.instance; + } + + public boolean hasInstance() { + if (this.instance == null) + return false; + for (InstanceComponent item : this.instance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) + */ + // syntactic sugar + public InstanceComponent addInstance() { //3 + InstanceComponent t = new InstanceComponent(); + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return t; + } + + // syntactic sugar + public SeriesComponent addInstance(InstanceComponent t) { //3 + if (t == null) + return this; + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Series instance UID of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("instance", "", "Identity and locating information of the selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // InstanceComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 555127957: // instance + this.getInstance().add((InstanceComponent) value); // InstanceComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("instance")) + this.getInstance().add((InstanceComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 555127957: return addInstance(); // InstanceComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.uid"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.url"); + } + else if (name.equals("instance")) { + return addInstance(); + } + else + return super.addChild(name); + } + + public SeriesComponent copy() { + SeriesComponent dst = new SeriesComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.url = url == null ? null : url.copy(); + if (instance != null) { + dst.instance = new ArrayList(); + for (InstanceComponent i : instance) + dst.instance.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SeriesComponent)) + return false; + SeriesComponent o = (SeriesComponent) other; + return compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) && compareDeep(instance, o.instance, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SeriesComponent)) + return false; + SeriesComponent o = (SeriesComponent) other; + return compareValues(uid, o.uid, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (url == null || url.isEmpty()) && (instance == null || instance.isEmpty()) + ; + } + + public String fhirType() { + return "ImagingObjectSelection.study.series"; + + } + + } + + @Block() + public static class InstanceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * SOP class UID of the selected instance. + */ + @Child(name = "sopClass", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="SOP class UID of instance", formalDefinition="SOP class UID of the selected instance." ) + protected OidType sopClass; + + /** + * SOP Instance UID of the selected instance. + */ + @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Selected instance UID", formalDefinition="SOP Instance UID of the selected instance." ) + protected OidType uid; + + /** + * WADO-RS URL to retrieve the DICOM SOP Instance. + */ + @Child(name = "url", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Retrieve instance URL", formalDefinition="WADO-RS URL to retrieve the DICOM SOP Instance." ) + protected UriType url; + + /** + * Identity and location information of the frames in the selected instance. + */ + @Child(name = "frame", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The frame set", formalDefinition="Identity and location information of the frames in the selected instance." ) + protected List frame; + + private static final long serialVersionUID = -1609681911L; + + /** + * Constructor + */ + public InstanceComponent() { + super(); + } + + /** + * Constructor + */ + public InstanceComponent(OidType sopClass, OidType uid, UriType url) { + super(); + this.sopClass = sopClass; + this.uid = uid; + this.url = url; + } + + /** + * @return {@link #sopClass} (SOP class UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public OidType getSopClassElement() { + if (this.sopClass == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.sopClass"); + else if (Configuration.doAutoCreate()) + this.sopClass = new OidType(); // bb + return this.sopClass; + } + + public boolean hasSopClassElement() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + public boolean hasSopClass() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + /** + * @param value {@link #sopClass} (SOP class UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public InstanceComponent setSopClassElement(OidType value) { + this.sopClass = value; + return this; + } + + /** + * @return SOP class UID of the selected instance. + */ + public String getSopClass() { + return this.sopClass == null ? null : this.sopClass.getValue(); + } + + /** + * @param value SOP class UID of the selected instance. + */ + public InstanceComponent setSopClass(String value) { + if (this.sopClass == null) + this.sopClass = new OidType(); + this.sopClass.setValue(value); + return this; + } + + /** + * @return {@link #uid} (SOP Instance UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (SOP Instance UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public InstanceComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return SOP Instance UID of the selected instance. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value SOP Instance UID of the selected instance. + */ + public InstanceComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #url} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public InstanceComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the DICOM SOP Instance. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the DICOM SOP Instance. + */ + public InstanceComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #frame} (Identity and location information of the frames in the selected instance.) + */ + public List getFrame() { + if (this.frame == null) + this.frame = new ArrayList(); + return this.frame; + } + + public boolean hasFrame() { + if (this.frame == null) + return false; + for (FramesComponent item : this.frame) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #frame} (Identity and location information of the frames in the selected instance.) + */ + // syntactic sugar + public FramesComponent addFrame() { //3 + FramesComponent t = new FramesComponent(); + if (this.frame == null) + this.frame = new ArrayList(); + this.frame.add(t); + return t; + } + + // syntactic sugar + public InstanceComponent addFrame(FramesComponent t) { //3 + if (t == null) + return this; + if (this.frame == null) + this.frame = new ArrayList(); + this.frame.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sopClass", "oid", "SOP class UID of the selected instance.", 0, java.lang.Integer.MAX_VALUE, sopClass)); + childrenList.add(new Property("uid", "oid", "SOP Instance UID of the selected instance.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the DICOM SOP Instance.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("frame", "", "Identity and location information of the frames in the selected instance.", 0, java.lang.Integer.MAX_VALUE, frame)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1560041540: /*sopClass*/ return this.sopClass == null ? new Base[0] : new Base[] {this.sopClass}; // OidType + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 97692013: /*frame*/ return this.frame == null ? new Base[0] : this.frame.toArray(new Base[this.frame.size()]); // FramesComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1560041540: // sopClass + this.sopClass = castToOid(value); // OidType + break; + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 97692013: // frame + this.getFrame().add((FramesComponent) value); // FramesComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sopClass")) + this.sopClass = castToOid(value); // OidType + else if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("frame")) + this.getFrame().add((FramesComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1560041540: throw new FHIRException("Cannot make property sopClass as it is not a complex type"); // OidType + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 97692013: return addFrame(); // FramesComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sopClass")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.sopClass"); + } + else if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.uid"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.url"); + } + else if (name.equals("frame")) { + return addFrame(); + } + else + return super.addChild(name); + } + + public InstanceComponent copy() { + InstanceComponent dst = new InstanceComponent(); + copyValues(dst); + dst.sopClass = sopClass == null ? null : sopClass.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.url = url == null ? null : url.copy(); + if (frame != null) { + dst.frame = new ArrayList(); + for (FramesComponent i : frame) + dst.frame.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof InstanceComponent)) + return false; + InstanceComponent o = (InstanceComponent) other; + return compareDeep(sopClass, o.sopClass, true) && compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) + && compareDeep(frame, o.frame, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof InstanceComponent)) + return false; + InstanceComponent o = (InstanceComponent) other; + return compareValues(sopClass, o.sopClass, true) && compareValues(uid, o.uid, true) && compareValues(url, o.url, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (sopClass == null || sopClass.isEmpty()) && (uid == null || uid.isEmpty()) + && (url == null || url.isEmpty()) && (frame == null || frame.isEmpty()); + } + + public String fhirType() { + return "ImagingObjectSelection.study.series.instance"; + + } + + } + + @Block() + public static class FramesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The specific frame reference within a multi-frame object. + */ + @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Frame reference number", formalDefinition="The specific frame reference within a multi-frame object." ) + protected List number; + + /** + * WADO-RS URL to retrieve the DICOM frames. + */ + @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Retrieve frame URL", formalDefinition="WADO-RS URL to retrieve the DICOM frames." ) + protected UriType url; + + private static final long serialVersionUID = 236505178L; + + /** + * Constructor + */ + public FramesComponent() { + super(); + } + + /** + * Constructor + */ + public FramesComponent(UriType url) { + super(); + this.url = url; + } + + /** + * @return {@link #number} (The specific frame reference within a multi-frame object.) + */ + public List getNumber() { + if (this.number == null) + this.number = new ArrayList(); + return this.number; + } + + public boolean hasNumber() { + if (this.number == null) + return false; + for (UnsignedIntType item : this.number) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #number} (The specific frame reference within a multi-frame object.) + */ + // syntactic sugar + public UnsignedIntType addNumberElement() {//2 + UnsignedIntType t = new UnsignedIntType(); + if (this.number == null) + this.number = new ArrayList(); + this.number.add(t); + return t; + } + + /** + * @param value {@link #number} (The specific frame reference within a multi-frame object.) + */ + public FramesComponent addNumber(int value) { //1 + UnsignedIntType t = new UnsignedIntType(); + t.setValue(value); + if (this.number == null) + this.number = new ArrayList(); + this.number.add(t); + return this; + } + + /** + * @param value {@link #number} (The specific frame reference within a multi-frame object.) + */ + public boolean hasNumber(int value) { + if (this.number == null) + return false; + for (UnsignedIntType v : this.number) + if (v.equals(value)) // unsignedInt + return true; + return false; + } + + /** + * @return {@link #url} (WADO-RS URL to retrieve the DICOM frames.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FramesComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URL to retrieve the DICOM frames.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public FramesComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the DICOM frames. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the DICOM frames. + */ + public FramesComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "unsignedInt", "The specific frame reference within a multi-frame object.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the DICOM frames.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1034364087: /*number*/ return this.number == null ? new Base[0] : this.number.toArray(new Base[this.number.size()]); // UnsignedIntType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1034364087: // number + this.getNumber().add(castToUnsignedInt(value)); // UnsignedIntType + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("number")) + this.getNumber().add(castToUnsignedInt(value)); + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // UnsignedIntType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("number")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.number"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.url"); + } + else + return super.addChild(name); + } + + public FramesComponent copy() { + FramesComponent dst = new FramesComponent(); + copyValues(dst); + if (number != null) { + dst.number = new ArrayList(); + for (UnsignedIntType i : number) + dst.number.add(i.copy()); + }; + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof FramesComponent)) + return false; + FramesComponent o = (FramesComponent) other; + return compareDeep(number, o.number, true) && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof FramesComponent)) + return false; + FramesComponent o = (FramesComponent) other; + return compareValues(number, o.number, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + public String fhirType() { + return "ImagingObjectSelection.study.series.instance.frame"; + + } + + } + + /** + * Instance UID of the DICOM KOS SOP Instances represented in this resource. + */ + @Child(name = "uid", type = {OidType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Instance UID", formalDefinition="Instance UID of the DICOM KOS SOP Instances represented in this resource." ) + protected OidType uid; + + /** + * A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient of the selected objects", formalDefinition="A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) + */ + protected Patient patientTarget; + + /** + * Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). + */ + @Child(name = "authoringTime", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time when the imaging object selection was created", formalDefinition="Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image)." ) + protected DateTimeType authoringTime; + + /** + * Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. + */ + @Child(name = "author", type = {Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Author (human or machine)", formalDefinition="Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + protected Resource authorTarget; + + /** + * The reason for, or significance of, the selection of objects referenced in the resource. + */ + @Child(name = "title", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason for selection", formalDefinition="The reason for, or significance of, the selection of objects referenced in the resource." ) + protected CodeableConcept title; + + /** + * Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description text", formalDefinition="Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection." ) + protected StringType description; + + /** + * Study identity and locating information of the DICOM SOP instances in the selection. + */ + @Child(name = "study", type = {}, order=6, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Study identity of the selected instances", formalDefinition="Study identity and locating information of the DICOM SOP instances in the selection." ) + protected List study; + + private static final long serialVersionUID = 1428713335L; + + /** + * Constructor + */ + public ImagingObjectSelection() { + super(); + } + + /** + * Constructor + */ + public ImagingObjectSelection(OidType uid, Reference patient, CodeableConcept title) { + super(); + this.uid = uid; + this.patient = patient; + this.title = title; + } + + /** + * @return {@link #uid} (Instance UID of the DICOM KOS SOP Instances represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Instance UID of the DICOM KOS SOP Instances represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingObjectSelection setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Instance UID of the DICOM KOS SOP Instances represented in this resource. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Instance UID of the DICOM KOS SOP Instances represented in this resource. + */ + public ImagingObjectSelection setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) + */ + public ImagingObjectSelection 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. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) + */ + public ImagingObjectSelection setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #authoringTime} (Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value + */ + public DateTimeType getAuthoringTimeElement() { + if (this.authoringTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.authoringTime"); + else if (Configuration.doAutoCreate()) + this.authoringTime = new DateTimeType(); // bb + return this.authoringTime; + } + + public boolean hasAuthoringTimeElement() { + return this.authoringTime != null && !this.authoringTime.isEmpty(); + } + + public boolean hasAuthoringTime() { + return this.authoringTime != null && !this.authoringTime.isEmpty(); + } + + /** + * @param value {@link #authoringTime} (Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value + */ + public ImagingObjectSelection setAuthoringTimeElement(DateTimeType value) { + this.authoringTime = value; + return this; + } + + /** + * @return Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). + */ + public Date getAuthoringTime() { + return this.authoringTime == null ? null : this.authoringTime.getValue(); + } + + /** + * @param value Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). + */ + public ImagingObjectSelection setAuthoringTime(Date value) { + if (value == null) + this.authoringTime = null; + else { + if (this.authoringTime == null) + this.authoringTime = new DateTimeType(); + this.authoringTime.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public ImagingObjectSelection setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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. (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} 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. (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public ImagingObjectSelection setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) + */ + public CodeableConcept getTitle() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.title"); + else if (Configuration.doAutoCreate()) + this.title = new CodeableConcept(); // cc + return this.title; + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) + */ + public ImagingObjectSelection setTitle(CodeableConcept value) { + this.title = value; + return this; + } + + /** + * @return {@link #description} (Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). 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 ImagingObjectSelection.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingObjectSelection setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + public ImagingObjectSelection 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 #study} (Study identity and locating information of the DICOM SOP instances in the selection.) + */ + public List getStudy() { + if (this.study == null) + this.study = new ArrayList(); + return this.study; + } + + public boolean hasStudy() { + if (this.study == null) + return false; + for (StudyComponent item : this.study) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) + */ + // syntactic sugar + public StudyComponent addStudy() { //3 + StudyComponent t = new StudyComponent(); + if (this.study == null) + this.study = new ArrayList(); + this.study.add(t); + return t; + } + + // syntactic sugar + public ImagingObjectSelection addStudy(StudyComponent t) { //3 + if (t == null) + return this; + if (this.study == null) + this.study = new ArrayList(); + this.study.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Instance UID of the DICOM KOS SOP Instances represented in this resource.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("patient", "Reference(Patient)", "A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("authoringTime", "dateTime", "Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).", 0, java.lang.Integer.MAX_VALUE, authoringTime)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("title", "CodeableConcept", "The reason for, or significance of, the selection of objects referenced in the resource.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("description", "string", "Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("study", "", "Study identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, study)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1724532252: /*authoringTime*/ return this.authoringTime == null ? new Base[0] : new Base[] {this.authoringTime}; // DateTimeType + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 109776329: /*study*/ return this.study == null ? new Base[0] : this.study.toArray(new Base[this.study.size()]); // StudyComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1724532252: // authoringTime + this.authoringTime = castToDateTime(value); // DateTimeType + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case 110371416: // title + this.title = castToCodeableConcept(value); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 109776329: // study + this.getStudy().add((StudyComponent) value); // StudyComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("authoringTime")) + this.authoringTime = castToDateTime(value); // DateTimeType + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("title")) + this.title = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("study")) + this.getStudy().add((StudyComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case -791418107: return getPatient(); // Reference + case -1724532252: throw new FHIRException("Cannot make property authoringTime as it is not a complex type"); // DateTimeType + case -1406328437: return getAuthor(); // Reference + case 110371416: return getTitle(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 109776329: return addStudy(); // StudyComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.uid"); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("authoringTime")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.authoringTime"); + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("title")) { + this.title = new CodeableConcept(); + return this.title; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.description"); + } + else if (name.equals("study")) { + return addStudy(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ImagingObjectSelection"; + + } + + public ImagingObjectSelection copy() { + ImagingObjectSelection dst = new ImagingObjectSelection(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.authoringTime = authoringTime == null ? null : authoringTime.copy(); + dst.author = author == null ? null : author.copy(); + dst.title = title == null ? null : title.copy(); + dst.description = description == null ? null : description.copy(); + if (study != null) { + dst.study = new ArrayList(); + for (StudyComponent i : study) + dst.study.add(i.copy()); + }; + return dst; + } + + protected ImagingObjectSelection typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingObjectSelection)) + return false; + ImagingObjectSelection o = (ImagingObjectSelection) other; + return compareDeep(uid, o.uid, true) && compareDeep(patient, o.patient, true) && compareDeep(authoringTime, o.authoringTime, true) + && compareDeep(author, o.author, true) && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) + && compareDeep(study, o.study, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingObjectSelection)) + return false; + ImagingObjectSelection o = (ImagingObjectSelection) other; + return compareValues(uid, o.uid, true) && compareValues(authoringTime, o.authoringTime, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (patient == null || patient.isEmpty()) + && (authoringTime == null || authoringTime.isEmpty()) && (author == null || author.isEmpty()) + && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (study == null || study.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImagingObjectSelection; + } + + /** + * Search parameter: selected-study + *

+ * Description: Study selected in key DICOM object selection
+ * Type: uri
+ * Path: ImagingObjectSelection.study.uid
+ *

+ */ + @SearchParamDefinition(name="selected-study", path="ImagingObjectSelection.study.uid", description="Study selected in key DICOM object selection", type="uri" ) + public static final String SP_SELECTED_STUDY = "selected-study"; + /** + * Fluent Client search parameter constant for selected-study + *

+ * Description: Study selected in key DICOM object selection
+ * Type: uri
+ * Path: ImagingObjectSelection.study.uid
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam SELECTED_STUDY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SELECTED_STUDY); + + /** + * Search parameter: author + *

+ * Description: Author of key DICOM object selection
+ * Type: reference
+ * Path: ImagingObjectSelection.author
+ *

+ */ + @SearchParamDefinition(name="author", path="ImagingObjectSelection.author", description="Author of key DICOM object selection", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: Author of key DICOM object selection
+ * Type: reference
+ * Path: ImagingObjectSelection.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImagingObjectSelection:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("ImagingObjectSelection:author").toLocked(); + + /** + * Search parameter: title + *

+ * Description: Title of key DICOM object selection
+ * Type: token
+ * Path: ImagingObjectSelection.title
+ *

+ */ + @SearchParamDefinition(name="title", path="ImagingObjectSelection.title", description="Title of key DICOM object selection", type="token" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Title of key DICOM object selection
+ * Type: token
+ * Path: ImagingObjectSelection.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TITLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TITLE); + + /** + * Search parameter: patient + *

+ * Description: Subject of key DICOM object selection
+ * Type: reference
+ * Path: ImagingObjectSelection.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="ImagingObjectSelection.patient", description="Subject of key DICOM object selection", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Subject of key DICOM object selection
+ * Type: reference
+ * Path: ImagingObjectSelection.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImagingObjectSelection:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImagingObjectSelection:patient").toLocked(); + + /** + * Search parameter: authoring-time + *

+ * Description: Time of key DICOM object selection authoring
+ * Type: date
+ * Path: ImagingObjectSelection.authoringTime
+ *

+ */ + @SearchParamDefinition(name="authoring-time", path="ImagingObjectSelection.authoringTime", description="Time of key DICOM object selection authoring", type="date" ) + public static final String SP_AUTHORING_TIME = "authoring-time"; + /** + * Fluent Client search parameter constant for authoring-time + *

+ * Description: Time of key DICOM object selection authoring
+ * Type: date
+ * Path: ImagingObjectSelection.authoringTime
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORING_TIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORING_TIME); + + /** + * Search parameter: identifier + *

+ * Description: UID of key DICOM object selection
+ * Type: uri
+ * Path: ImagingObjectSelection.uid
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ImagingObjectSelection.uid", description="UID of key DICOM object selection", type="uri" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: UID of key DICOM object selection
+ * Type: uri
+ * Path: ImagingObjectSelection.uid
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingStudy.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingStudy.java new file mode 100644 index 00000000000..3108c58ee1a --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImagingStudy.java @@ -0,0 +1,2866 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. + */ +@ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/Profile/ImagingStudy") +public class ImagingStudy extends DomainResource { + + public enum InstanceAvailability { + /** + * null + */ + ONLINE, + /** + * null + */ + OFFLINE, + /** + * null + */ + NEARLINE, + /** + * null + */ + UNAVAILABLE, + /** + * added to help the parsers + */ + NULL; + public static InstanceAvailability fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("ONLINE".equals(codeString)) + return ONLINE; + if ("OFFLINE".equals(codeString)) + return OFFLINE; + if ("NEARLINE".equals(codeString)) + return NEARLINE; + if ("UNAVAILABLE".equals(codeString)) + return UNAVAILABLE; + throw new FHIRException("Unknown InstanceAvailability code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ONLINE: return "ONLINE"; + case OFFLINE: return "OFFLINE"; + case NEARLINE: return "NEARLINE"; + case UNAVAILABLE: return "UNAVAILABLE"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ONLINE: return "http://nema.org/dicom/dicm"; + case OFFLINE: return "http://nema.org/dicom/dicm"; + case NEARLINE: return "http://nema.org/dicom/dicm"; + case UNAVAILABLE: return "http://nema.org/dicom/dicm"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ONLINE: return ""; + case OFFLINE: return ""; + case NEARLINE: return ""; + case UNAVAILABLE: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ONLINE: return "ONLINE"; + case OFFLINE: return "OFFLINE"; + case NEARLINE: return "NEARLINE"; + case UNAVAILABLE: return "UNAVAILABLE"; + default: return "?"; + } + } + } + + 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; + if ("ONLINE".equals(codeString)) + return InstanceAvailability.ONLINE; + if ("OFFLINE".equals(codeString)) + return InstanceAvailability.OFFLINE; + if ("NEARLINE".equals(codeString)) + return InstanceAvailability.NEARLINE; + if ("UNAVAILABLE".equals(codeString)) + return InstanceAvailability.UNAVAILABLE; + throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("ONLINE".equals(codeString)) + return new Enumeration(this, InstanceAvailability.ONLINE); + if ("OFFLINE".equals(codeString)) + return new Enumeration(this, InstanceAvailability.OFFLINE); + if ("NEARLINE".equals(codeString)) + return new Enumeration(this, InstanceAvailability.NEARLINE); + if ("UNAVAILABLE".equals(codeString)) + return new Enumeration(this, InstanceAvailability.UNAVAILABLE); + throw new FHIRException("Unknown InstanceAvailability code '"+codeString+"'"); + } + public String toCode(InstanceAvailability code) { + if (code == InstanceAvailability.ONLINE) + return "ONLINE"; + if (code == InstanceAvailability.OFFLINE) + return "OFFLINE"; + if (code == InstanceAvailability.NEARLINE) + return "NEARLINE"; + if (code == InstanceAvailability.UNAVAILABLE) + return "UNAVAILABLE"; + return "?"; + } + public String toSystem(InstanceAvailability code) { + return code.getSystem(); + } + } + + @Block() + public static class ImagingStudySeriesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Formal identifier for this series. + */ + @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Formal identifier for this series", formalDefinition="Formal identifier for this series." ) + protected OidType uid; + + /** + * The Numeric identifier of this series in the study. + */ + @Child(name = "number", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Numeric identifier of this series", formalDefinition="The Numeric identifier of this series in the study." ) + protected UnsignedIntType number; + + /** + * The modality of this series sequence. + */ + @Child(name = "modality", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The modality of the instances in the series", formalDefinition="The modality of this series sequence." ) + protected Coding modality; + + /** + * A description of the series. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A short human readable summary of the series", formalDefinition="A description of the series." ) + protected StringType description; + + /** + * Number of SOP Instances in Series. + */ + @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of Series Related Instances", formalDefinition="Number of SOP Instances in Series." ) + protected UnsignedIntType numberOfInstances; + + /** + * Availability of series (online, offline or nearline). + */ + @Child(name = "availability", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE", formalDefinition="Availability of series (online, offline or nearline)." ) + protected Enumeration availability; + + /** + * URI/URL specifying the location of the referenced series using WADO-RS. + */ + @Child(name = "url", type = {UriType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Location of the referenced instance(s)", formalDefinition="URI/URL specifying the location of the referenced series using WADO-RS." ) + protected UriType url; + + /** + * Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT. + */ + @Child(name = "bodySite", type = {Coding.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Body part examined", formalDefinition="Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT." ) + protected Coding bodySite; + + /** + * Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code. + */ + @Child(name = "laterality", type = {Coding.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Body part laterality", formalDefinition="Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code." ) + protected Coding laterality; + + /** + * The date and time the series was started. + */ + @Child(name = "started", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the series started", formalDefinition="The date and time the series was started." ) + protected DateTimeType started; + + /** + * A single SOP Instance within the series, e.g. an image, or presentation state. + */ + @Child(name = "instance", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A single SOP instance from the series", formalDefinition="A single SOP Instance within the series, e.g. an image, or presentation state." ) + protected List instance; + + private static final long serialVersionUID = 42813749L; + + /** + * Constructor + */ + public ImagingStudySeriesComponent() { + super(); + } + + /** + * Constructor + */ + public ImagingStudySeriesComponent(OidType uid, Coding modality, UnsignedIntType numberOfInstances) { + super(); + this.uid = uid; + this.modality = modality; + this.numberOfInstances = numberOfInstances; + } + + /** + * @return {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudySeriesComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for this series. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for this series. + */ + public ImagingStudySeriesComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public UnsignedIntType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new UnsignedIntType(); // bb + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public ImagingStudySeriesComponent setNumberElement(UnsignedIntType value) { + this.number = value; + return this; + } + + /** + * @return The Numeric identifier of this series in the study. + */ + public int getNumber() { + return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); + } + + /** + * @param value The Numeric identifier of this series in the study. + */ + public ImagingStudySeriesComponent setNumber(int value) { + if (this.number == null) + this.number = new UnsignedIntType(); + this.number.setValue(value); + return this; + } + + /** + * @return {@link #modality} (The modality of this series sequence.) + */ + public Coding getModality() { + if (this.modality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.modality"); + else if (Configuration.doAutoCreate()) + this.modality = new Coding(); // cc + return this.modality; + } + + public boolean hasModality() { + return this.modality != null && !this.modality.isEmpty(); + } + + /** + * @param value {@link #modality} (The modality of this series sequence.) + */ + public ImagingStudySeriesComponent setModality(Coding value) { + this.modality = value; + return this; + } + + /** + * @return {@link #description} (A description of the series.). 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 ImagingStudySeriesComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingStudySeriesComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the series. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the series. + */ + public ImagingStudySeriesComponent 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 #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public UnsignedIntType getNumberOfInstancesElement() { + if (this.numberOfInstances == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.numberOfInstances"); + else if (Configuration.doAutoCreate()) + this.numberOfInstances = new UnsignedIntType(); // bb + return this.numberOfInstances; + } + + public boolean hasNumberOfInstancesElement() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + public boolean hasNumberOfInstances() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + /** + * @param value {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public ImagingStudySeriesComponent setNumberOfInstancesElement(UnsignedIntType value) { + this.numberOfInstances = value; + return this; + } + + /** + * @return Number of SOP Instances in Series. + */ + public int getNumberOfInstances() { + return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue(); + } + + /** + * @param value Number of SOP Instances in Series. + */ + public ImagingStudySeriesComponent setNumberOfInstances(int value) { + if (this.numberOfInstances == null) + this.numberOfInstances = new UnsignedIntType(); + this.numberOfInstances.setValue(value); + return this; + } + + /** + * @return {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public Enumeration getAvailabilityElement() { + if (this.availability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.availability"); + else if (Configuration.doAutoCreate()) + this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); // bb + return this.availability; + } + + public boolean hasAvailabilityElement() { + return this.availability != null && !this.availability.isEmpty(); + } + + public boolean hasAvailability() { + return this.availability != null && !this.availability.isEmpty(); + } + + /** + * @param value {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public ImagingStudySeriesComponent setAvailabilityElement(Enumeration value) { + this.availability = value; + return this; + } + + /** + * @return Availability of series (online, offline or nearline). + */ + public InstanceAvailability getAvailability() { + return this.availability == null ? null : this.availability.getValue(); + } + + /** + * @param value Availability of series (online, offline or nearline). + */ + public ImagingStudySeriesComponent setAvailability(InstanceAvailability value) { + if (value == null) + this.availability = null; + else { + if (this.availability == null) + this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); + this.availability.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (URI/URL specifying the location of the referenced series using WADO-RS.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (URI/URL specifying the location of the referenced series using WADO-RS.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ImagingStudySeriesComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return URI/URL specifying the location of the referenced series using WADO-RS. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value URI/URL specifying the location of the referenced series using WADO-RS. + */ + public ImagingStudySeriesComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); // cc + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.) + */ + public ImagingStudySeriesComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #laterality} (Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.) + */ + public Coding getLaterality() { + if (this.laterality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.laterality"); + else if (Configuration.doAutoCreate()) + this.laterality = new Coding(); // cc + return this.laterality; + } + + public boolean hasLaterality() { + return this.laterality != null && !this.laterality.isEmpty(); + } + + /** + * @param value {@link #laterality} (Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.) + */ + public ImagingStudySeriesComponent setLaterality(Coding value) { + this.laterality = value; + return this; + } + + /** + * @return {@link #started} (The date and time the series was started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value + */ + public DateTimeType getStartedElement() { + if (this.started == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.started"); + else if (Configuration.doAutoCreate()) + this.started = new DateTimeType(); // bb + return this.started; + } + + public boolean hasStartedElement() { + return this.started != null && !this.started.isEmpty(); + } + + public boolean hasStarted() { + return this.started != null && !this.started.isEmpty(); + } + + /** + * @param value {@link #started} (The date and time the series was started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value + */ + public ImagingStudySeriesComponent setStartedElement(DateTimeType value) { + this.started = value; + return this; + } + + /** + * @return The date and time the series was started. + */ + public Date getStarted() { + return this.started == null ? null : this.started.getValue(); + } + + /** + * @param value The date and time the series was started. + */ + public ImagingStudySeriesComponent setStarted(Date value) { + if (value == null) + this.started = null; + else { + if (this.started == null) + this.started = new DateTimeType(); + this.started.setValue(value); + } + return this; + } + + /** + * @return {@link #instance} (A single SOP Instance within the series, e.g. an image, or presentation state.) + */ + public List getInstance() { + if (this.instance == null) + this.instance = new ArrayList(); + return this.instance; + } + + public boolean hasInstance() { + if (this.instance == null) + return false; + for (ImagingStudySeriesInstanceComponent item : this.instance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #instance} (A single SOP Instance within the series, e.g. an image, or presentation state.) + */ + // syntactic sugar + public ImagingStudySeriesInstanceComponent addInstance() { //3 + ImagingStudySeriesInstanceComponent t = new ImagingStudySeriesInstanceComponent(); + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return t; + } + + // syntactic sugar + public ImagingStudySeriesComponent addInstance(ImagingStudySeriesInstanceComponent t) { //3 + if (t == null) + return this; + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Formal identifier for this series.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("number", "unsignedInt", "The Numeric identifier of this series in the study.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("modality", "Coding", "The modality of this series sequence.", 0, java.lang.Integer.MAX_VALUE, modality)); + childrenList.add(new Property("description", "string", "A description of the series.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Series.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); + childrenList.add(new Property("availability", "code", "Availability of series (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); + childrenList.add(new Property("url", "uri", "URI/URL specifying the location of the referenced series using WADO-RS.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("bodySite", "Coding", "Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("laterality", "Coding", "Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.", 0, java.lang.Integer.MAX_VALUE, laterality)); + childrenList.add(new Property("started", "dateTime", "The date and time the series was started.", 0, java.lang.Integer.MAX_VALUE, started)); + childrenList.add(new Property("instance", "", "A single SOP Instance within the series, e.g. an image, or presentation state.", 0, java.lang.Integer.MAX_VALUE, instance)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // UnsignedIntType + case -622722335: /*modality*/ return this.modality == null ? new Base[0] : new Base[] {this.modality}; // Coding + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1043544226: /*numberOfInstances*/ return this.numberOfInstances == null ? new Base[0] : new Base[] {this.numberOfInstances}; // UnsignedIntType + case 1997542747: /*availability*/ return this.availability == null ? new Base[0] : new Base[] {this.availability}; // Enumeration + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding + case -170291817: /*laterality*/ return this.laterality == null ? new Base[0] : new Base[] {this.laterality}; // Coding + case -1897185151: /*started*/ return this.started == null ? new Base[0] : new Base[] {this.started}; // DateTimeType + case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // ImagingStudySeriesInstanceComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case -1034364087: // number + this.number = castToUnsignedInt(value); // UnsignedIntType + break; + case -622722335: // modality + this.modality = castToCoding(value); // Coding + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1043544226: // numberOfInstances + this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType + break; + case 1997542747: // availability + this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 1702620169: // bodySite + this.bodySite = castToCoding(value); // Coding + break; + case -170291817: // laterality + this.laterality = castToCoding(value); // Coding + break; + case -1897185151: // started + this.started = castToDateTime(value); // DateTimeType + break; + case 555127957: // instance + this.getInstance().add((ImagingStudySeriesInstanceComponent) value); // ImagingStudySeriesInstanceComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("number")) + this.number = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("modality")) + this.modality = castToCoding(value); // Coding + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("numberOfInstances")) + this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("availability")) + this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("bodySite")) + this.bodySite = castToCoding(value); // Coding + else if (name.equals("laterality")) + this.laterality = castToCoding(value); // Coding + else if (name.equals("started")) + this.started = castToDateTime(value); // DateTimeType + else if (name.equals("instance")) + this.getInstance().add((ImagingStudySeriesInstanceComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // UnsignedIntType + case -622722335: return getModality(); // Coding + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1043544226: throw new FHIRException("Cannot make property numberOfInstances as it is not a complex type"); // UnsignedIntType + case 1997542747: throw new FHIRException("Cannot make property availability as it is not a complex type"); // Enumeration + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 1702620169: return getBodySite(); // Coding + case -170291817: return getLaterality(); // Coding + case -1897185151: throw new FHIRException("Cannot make property started as it is not a complex type"); // DateTimeType + case 555127957: return addInstance(); // ImagingStudySeriesInstanceComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid"); + } + else if (name.equals("number")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.number"); + } + else if (name.equals("modality")) { + this.modality = new Coding(); + return this.modality; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.description"); + } + else if (name.equals("numberOfInstances")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfInstances"); + } + else if (name.equals("availability")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.availability"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.url"); + } + else if (name.equals("bodySite")) { + this.bodySite = new Coding(); + return this.bodySite; + } + else if (name.equals("laterality")) { + this.laterality = new Coding(); + return this.laterality; + } + else if (name.equals("started")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.started"); + } + else if (name.equals("instance")) { + return addInstance(); + } + else + return super.addChild(name); + } + + public ImagingStudySeriesComponent copy() { + ImagingStudySeriesComponent dst = new ImagingStudySeriesComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.number = number == null ? null : number.copy(); + dst.modality = modality == null ? null : modality.copy(); + dst.description = description == null ? null : description.copy(); + dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); + dst.availability = availability == null ? null : availability.copy(); + dst.url = url == null ? null : url.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.laterality = laterality == null ? null : laterality.copy(); + dst.started = started == null ? null : started.copy(); + if (instance != null) { + dst.instance = new ArrayList(); + for (ImagingStudySeriesInstanceComponent i : instance) + dst.instance.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingStudySeriesComponent)) + return false; + ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other; + return compareDeep(uid, o.uid, true) && compareDeep(number, o.number, true) && compareDeep(modality, o.modality, true) + && compareDeep(description, o.description, true) && compareDeep(numberOfInstances, o.numberOfInstances, true) + && compareDeep(availability, o.availability, true) && compareDeep(url, o.url, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(laterality, o.laterality, true) && compareDeep(started, o.started, true) && compareDeep(instance, o.instance, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingStudySeriesComponent)) + return false; + ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other; + return compareValues(uid, o.uid, true) && compareValues(number, o.number, true) && compareValues(description, o.description, true) + && compareValues(numberOfInstances, o.numberOfInstances, true) && compareValues(availability, o.availability, true) + && compareValues(url, o.url, true) && compareValues(started, o.started, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (number == null || number.isEmpty()) + && (modality == null || modality.isEmpty()) && (description == null || description.isEmpty()) + && (numberOfInstances == null || numberOfInstances.isEmpty()) && (availability == null || availability.isEmpty()) + && (url == null || url.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (laterality == null || laterality.isEmpty()) + && (started == null || started.isEmpty()) && (instance == null || instance.isEmpty()); + } + + public String fhirType() { + return "ImagingStudy.series"; + + } + + } + + @Block() + public static class ImagingStudySeriesInstanceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Formal identifier for this image or other content. + */ + @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Formal identifier for this instance", formalDefinition="Formal identifier for this image or other content." ) + protected OidType uid; + + /** + * The number of instance in the series. + */ + @Child(name = "number", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The number of this instance in the series", formalDefinition="The number of instance in the series." ) + protected UnsignedIntType number; + + /** + * DICOM instance type. + */ + @Child(name = "sopClass", type = {OidType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="DICOM class type", formalDefinition="DICOM instance type." ) + protected OidType sopClass; + + /** + * A human-friendly SOP Class name. + */ + @Child(name = "type", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of instance (image etc.)", formalDefinition="A human-friendly SOP Class name." ) + protected StringType type; + + /** + * The description of the instance. + */ + @Child(name = "title", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description of instance", formalDefinition="The description of the instance." ) + protected StringType title; + + /** + * Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance. + */ + @Child(name = "content", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The instance payload, such as the image binary data or URL to it", formalDefinition="Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance." ) + protected List content; + + private static final long serialVersionUID = -693669901L; + + /** + * Constructor + */ + public ImagingStudySeriesInstanceComponent() { + super(); + } + + /** + * Constructor + */ + public ImagingStudySeriesInstanceComponent(OidType uid, OidType sopClass) { + super(); + this.uid = uid; + this.sopClass = sopClass; + } + + /** + * @return {@link #uid} (Formal identifier for this image or other content.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for this image or other content.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for this image or other content. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for this image or other content. + */ + public ImagingStudySeriesInstanceComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #number} (The number of instance in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public UnsignedIntType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new UnsignedIntType(); // bb + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (The number of instance in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setNumberElement(UnsignedIntType value) { + this.number = value; + return this; + } + + /** + * @return The number of instance in the series. + */ + public int getNumber() { + return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); + } + + /** + * @param value The number of instance in the series. + */ + public ImagingStudySeriesInstanceComponent setNumber(int value) { + if (this.number == null) + this.number = new UnsignedIntType(); + this.number.setValue(value); + return this; + } + + /** + * @return {@link #sopClass} (DICOM instance type.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public OidType getSopClassElement() { + if (this.sopClass == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.sopClass"); + else if (Configuration.doAutoCreate()) + this.sopClass = new OidType(); // bb + return this.sopClass; + } + + public boolean hasSopClassElement() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + public boolean hasSopClass() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + /** + * @param value {@link #sopClass} (DICOM instance type.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setSopClassElement(OidType value) { + this.sopClass = value; + return this; + } + + /** + * @return DICOM instance type. + */ + public String getSopClass() { + return this.sopClass == null ? null : this.sopClass.getValue(); + } + + /** + * @param value DICOM instance type. + */ + public ImagingStudySeriesInstanceComponent setSopClass(String value) { + if (this.sopClass == null) + this.sopClass = new OidType(); + this.sopClass.setValue(value); + return this; + } + + /** + * @return {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StringType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new StringType(); // bb + 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} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setTypeElement(StringType value) { + this.type = value; + return this; + } + + /** + * @return A human-friendly SOP Class name. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A human-friendly SOP Class name. + */ + public ImagingStudySeriesInstanceComponent setType(String value) { + if (Utilities.noString(value)) + this.type = null; + else { + if (this.type == null) + this.type = new StringType(); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The description of the instance. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The description of the instance. + */ + public ImagingStudySeriesInstanceComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #content} (Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (Attachment item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.) + */ + // syntactic sugar + public Attachment addContent() { //3 + Attachment t = new Attachment(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + // syntactic sugar + public ImagingStudySeriesInstanceComponent addContent(Attachment t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Formal identifier for this image or other content.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("number", "unsignedInt", "The number of instance in the series.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("sopClass", "oid", "DICOM instance type.", 0, java.lang.Integer.MAX_VALUE, sopClass)); + childrenList.add(new Property("type", "string", "A human-friendly SOP Class name.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("title", "string", "The description of the instance.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("content", "Attachment", "Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // UnsignedIntType + case 1560041540: /*sopClass*/ return this.sopClass == null ? new Base[0] : new Base[] {this.sopClass}; // OidType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // Attachment + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case -1034364087: // number + this.number = castToUnsignedInt(value); // UnsignedIntType + break; + case 1560041540: // sopClass + this.sopClass = castToOid(value); // OidType + break; + case 3575610: // type + this.type = castToString(value); // StringType + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case 951530617: // content + this.getContent().add(castToAttachment(value)); // Attachment + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("number")) + this.number = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("sopClass")) + this.sopClass = castToOid(value); // OidType + else if (name.equals("type")) + this.type = castToString(value); // StringType + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("content")) + this.getContent().add(castToAttachment(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // UnsignedIntType + case 1560041540: throw new FHIRException("Cannot make property sopClass as it is not a complex type"); // OidType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // StringType + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case 951530617: return addContent(); // Attachment + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid"); + } + else if (name.equals("number")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.number"); + } + else if (name.equals("sopClass")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.sopClass"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.type"); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.title"); + } + else if (name.equals("content")) { + return addContent(); + } + else + return super.addChild(name); + } + + public ImagingStudySeriesInstanceComponent copy() { + ImagingStudySeriesInstanceComponent dst = new ImagingStudySeriesInstanceComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.number = number == null ? null : number.copy(); + dst.sopClass = sopClass == null ? null : sopClass.copy(); + dst.type = type == null ? null : type.copy(); + dst.title = title == null ? null : title.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (Attachment i : content) + dst.content.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingStudySeriesInstanceComponent)) + return false; + ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other; + return compareDeep(uid, o.uid, true) && compareDeep(number, o.number, true) && compareDeep(sopClass, o.sopClass, true) + && compareDeep(type, o.type, true) && compareDeep(title, o.title, true) && compareDeep(content, o.content, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingStudySeriesInstanceComponent)) + return false; + ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other; + return compareValues(uid, o.uid, true) && compareValues(number, o.number, true) && compareValues(sopClass, o.sopClass, true) + && compareValues(type, o.type, true) && compareValues(title, o.title, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (number == null || number.isEmpty()) + && (sopClass == null || sopClass.isEmpty()) && (type == null || type.isEmpty()) && (title == null || title.isEmpty()) + && (content == null || content.isEmpty()); + } + + public String fhirType() { + return "ImagingStudy.series.instance"; + + } + + } + + /** + * Formal identifier for the study. + */ + @Child(name = "uid", type = {OidType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Formal identifier for the study", formalDefinition="Formal identifier for the study." ) + protected OidType uid; + + /** + * Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf). + */ + @Child(name = "accession", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Related workflow identifier (\"Accession Number\")", formalDefinition="Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf)." ) + protected Identifier accession; + + /** + * Other identifiers for the study. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Other identifiers for the study", formalDefinition="Other identifiers for the study." ) + protected List identifier; + + /** + * Availability of study (online, offline or nearline). + */ + @Child(name = "availability", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of study (online, offline or nearline)." ) + protected Enumeration availability; + + /** + * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). + */ + @Child(name = "modalityList", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="All series modality if actual acquisition modalities", formalDefinition="A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19)." ) + protected List modalityList; + + /** + * The patient imaged in the study. + */ + @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who the images are of", formalDefinition="The patient imaged in the study." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient imaged in the study.) + */ + protected Patient patientTarget; + + /** + * Date and Time the study started. + */ + @Child(name = "started", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the study was started", formalDefinition="Date and Time the study started." ) + protected DateTimeType started; + + /** + * A list of the diagnostic orders that resulted in this imaging study being performed. + */ + @Child(name = "order", type = {DiagnosticOrder.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Order(s) that caused this study to be performed", formalDefinition="A list of the diagnostic orders that resulted in this imaging study being performed." ) + protected List order; + /** + * The actual objects that are the target of the reference (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + protected List orderTarget; + + + /** + * The requesting/referring physician. + */ + @Child(name = "referrer", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Referring physician (0008,0090)", formalDefinition="The requesting/referring physician." ) + protected Reference referrer; + + /** + * The actual object that is the target of the reference (The requesting/referring physician.) + */ + protected Practitioner referrerTarget; + + /** + * Who read the study and interpreted the images or other content. + */ + @Child(name = "interpreter", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who interpreted images", formalDefinition="Who read the study and interpreted the images or other content." ) + protected Reference interpreter; + + /** + * The actual object that is the target of the reference (Who read the study and interpreted the images or other content.) + */ + protected Practitioner interpreterTarget; + + /** + * WADO-RS resource where Study is available. + */ + @Child(name = "url", type = {UriType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Retrieve URI", formalDefinition="WADO-RS resource where Study is available." ) + protected UriType url; + + /** + * Number of Series in Study. + */ + @Child(name = "numberOfSeries", type = {UnsignedIntType.class}, order=11, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of Study Related Series", formalDefinition="Number of Series in Study." ) + protected UnsignedIntType numberOfSeries; + + /** + * Number of SOP Instances in Study. + */ + @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=12, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of Study Related Instances", formalDefinition="Number of SOP Instances in Study." ) + protected UnsignedIntType numberOfInstances; + + /** + * Type of procedure performed. + */ + @Child(name = "procedure", type = {Procedure.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Type of procedure performed", formalDefinition="Type of procedure performed." ) + protected List procedure; + /** + * The actual objects that are the target of the reference (Type of procedure performed.) + */ + protected List procedureTarget; + + + /** + * Institution-generated description or classification of the Study performed. + */ + @Child(name = "description", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Institution-generated description", formalDefinition="Institution-generated description or classification of the Study performed." ) + protected StringType description; + + /** + * Each study has one or more series of images or other content. + */ + @Child(name = "series", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Each study has one or more series of instances", formalDefinition="Each study has one or more series of images or other content." ) + protected List series; + + private static final long serialVersionUID = 1998463596L; + + /** + * Constructor + */ + public ImagingStudy() { + super(); + } + + /** + * Constructor + */ + public ImagingStudy(OidType uid, Reference patient, UnsignedIntType numberOfSeries, UnsignedIntType numberOfInstances) { + super(); + this.uid = uid; + this.patient = patient; + this.numberOfSeries = numberOfSeries; + this.numberOfInstances = numberOfInstances; + } + + /** + * @return {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); // bb + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudy setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for the study. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for the study. + */ + public ImagingStudy setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #accession} (Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf).) + */ + public Identifier getAccession() { + if (this.accession == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.accession"); + else if (Configuration.doAutoCreate()) + this.accession = new Identifier(); // cc + return this.accession; + } + + public boolean hasAccession() { + return this.accession != null && !this.accession.isEmpty(); + } + + /** + * @param value {@link #accession} (Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf).) + */ + public ImagingStudy setAccession(Identifier value) { + this.accession = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers for the study.) + */ + 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} (Other identifiers for the study.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public Enumeration getAvailabilityElement() { + if (this.availability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.availability"); + else if (Configuration.doAutoCreate()) + this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); // bb + return this.availability; + } + + public boolean hasAvailabilityElement() { + return this.availability != null && !this.availability.isEmpty(); + } + + public boolean hasAvailability() { + return this.availability != null && !this.availability.isEmpty(); + } + + /** + * @param value {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public ImagingStudy setAvailabilityElement(Enumeration value) { + this.availability = value; + return this; + } + + /** + * @return Availability of study (online, offline or nearline). + */ + public InstanceAvailability getAvailability() { + return this.availability == null ? null : this.availability.getValue(); + } + + /** + * @param value Availability of study (online, offline or nearline). + */ + public ImagingStudy setAvailability(InstanceAvailability value) { + if (value == null) + this.availability = null; + else { + if (this.availability == null) + this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); + this.availability.setValue(value); + } + return this; + } + + /** + * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + public List getModalityList() { + if (this.modalityList == null) + this.modalityList = new ArrayList(); + return this.modalityList; + } + + public boolean hasModalityList() { + if (this.modalityList == null) + return false; + for (Coding item : this.modalityList) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + // syntactic sugar + public Coding addModalityList() { //3 + Coding t = new Coding(); + if (this.modalityList == null) + this.modalityList = new ArrayList(); + this.modalityList.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addModalityList(Coding t) { //3 + if (t == null) + return this; + if (this.modalityList == null) + this.modalityList = new ArrayList(); + this.modalityList.add(t); + return this; + } + + /** + * @return {@link #patient} (The patient imaged in the study.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient imaged in the study.) + */ + public ImagingStudy 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 imaged in the study.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 imaged in the study.) + */ + public ImagingStudy setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #started} (Date and Time the study started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value + */ + public DateTimeType getStartedElement() { + if (this.started == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.started"); + else if (Configuration.doAutoCreate()) + this.started = new DateTimeType(); // bb + return this.started; + } + + public boolean hasStartedElement() { + return this.started != null && !this.started.isEmpty(); + } + + public boolean hasStarted() { + return this.started != null && !this.started.isEmpty(); + } + + /** + * @param value {@link #started} (Date and Time the study started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value + */ + public ImagingStudy setStartedElement(DateTimeType value) { + this.started = value; + return this; + } + + /** + * @return Date and Time the study started. + */ + public Date getStarted() { + return this.started == null ? null : this.started.getValue(); + } + + /** + * @param value Date and Time the study started. + */ + public ImagingStudy setStarted(Date value) { + if (value == null) + this.started = null; + else { + if (this.started == null) + this.started = new DateTimeType(); + this.started.setValue(value); + } + return this; + } + + /** + * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public List getOrder() { + if (this.order == null) + this.order = new ArrayList(); + return this.order; + } + + public boolean hasOrder() { + if (this.order == null) + return false; + for (Reference item : this.order) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + // syntactic sugar + public Reference addOrder() { //3 + Reference t = new Reference(); + if (this.order == null) + this.order = new ArrayList(); + this.order.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addOrder(Reference t) { //3 + if (t == null) + return this; + if (this.order == null) + this.order = new ArrayList(); + this.order.add(t); + return this; + } + + /** + * @return {@link #order} (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 list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public List getOrderTarget() { + if (this.orderTarget == null) + this.orderTarget = new ArrayList(); + return this.orderTarget; + } + + // syntactic sugar + /** + * @return {@link #order} (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 list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public DiagnosticOrder addOrderTarget() { + DiagnosticOrder r = new DiagnosticOrder(); + if (this.orderTarget == null) + this.orderTarget = new ArrayList(); + this.orderTarget.add(r); + return r; + } + + /** + * @return {@link #referrer} (The requesting/referring physician.) + */ + public Reference getReferrer() { + if (this.referrer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.referrer"); + else if (Configuration.doAutoCreate()) + this.referrer = new Reference(); // cc + return this.referrer; + } + + public boolean hasReferrer() { + return this.referrer != null && !this.referrer.isEmpty(); + } + + /** + * @param value {@link #referrer} (The requesting/referring physician.) + */ + public ImagingStudy setReferrer(Reference value) { + this.referrer = value; + return this; + } + + /** + * @return {@link #referrer} 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 requesting/referring physician.) + */ + public Practitioner getReferrerTarget() { + if (this.referrerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.referrer"); + else if (Configuration.doAutoCreate()) + this.referrerTarget = new Practitioner(); // aa + return this.referrerTarget; + } + + /** + * @param value {@link #referrer} 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 requesting/referring physician.) + */ + public ImagingStudy setReferrerTarget(Practitioner value) { + this.referrerTarget = value; + return this; + } + + /** + * @return {@link #interpreter} (Who read the study and interpreted the images or other content.) + */ + public Reference getInterpreter() { + if (this.interpreter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.interpreter"); + else if (Configuration.doAutoCreate()) + this.interpreter = new Reference(); // cc + return this.interpreter; + } + + public boolean hasInterpreter() { + return this.interpreter != null && !this.interpreter.isEmpty(); + } + + /** + * @param value {@link #interpreter} (Who read the study and interpreted the images or other content.) + */ + public ImagingStudy setInterpreter(Reference value) { + this.interpreter = value; + return this; + } + + /** + * @return {@link #interpreter} 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. (Who read the study and interpreted the images or other content.) + */ + public Practitioner getInterpreterTarget() { + if (this.interpreterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.interpreter"); + else if (Configuration.doAutoCreate()) + this.interpreterTarget = new Practitioner(); // aa + return this.interpreterTarget; + } + + /** + * @param value {@link #interpreter} 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. (Who read the study and interpreted the images or other content.) + */ + public ImagingStudy setInterpreterTarget(Practitioner value) { + this.interpreterTarget = value; + return this; + } + + /** + * @return {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ImagingStudy setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS resource where Study is available. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS resource where Study is available. + */ + public ImagingStudy setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value + */ + public UnsignedIntType getNumberOfSeriesElement() { + if (this.numberOfSeries == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.numberOfSeries"); + else if (Configuration.doAutoCreate()) + this.numberOfSeries = new UnsignedIntType(); // bb + return this.numberOfSeries; + } + + public boolean hasNumberOfSeriesElement() { + return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); + } + + public boolean hasNumberOfSeries() { + return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); + } + + /** + * @param value {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value + */ + public ImagingStudy setNumberOfSeriesElement(UnsignedIntType value) { + this.numberOfSeries = value; + return this; + } + + /** + * @return Number of Series in Study. + */ + public int getNumberOfSeries() { + return this.numberOfSeries == null || this.numberOfSeries.isEmpty() ? 0 : this.numberOfSeries.getValue(); + } + + /** + * @param value Number of Series in Study. + */ + public ImagingStudy setNumberOfSeries(int value) { + if (this.numberOfSeries == null) + this.numberOfSeries = new UnsignedIntType(); + this.numberOfSeries.setValue(value); + return this; + } + + /** + * @return {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public UnsignedIntType getNumberOfInstancesElement() { + if (this.numberOfInstances == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.numberOfInstances"); + else if (Configuration.doAutoCreate()) + this.numberOfInstances = new UnsignedIntType(); // bb + return this.numberOfInstances; + } + + public boolean hasNumberOfInstancesElement() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + public boolean hasNumberOfInstances() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + /** + * @param value {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public ImagingStudy setNumberOfInstancesElement(UnsignedIntType value) { + this.numberOfInstances = value; + return this; + } + + /** + * @return Number of SOP Instances in Study. + */ + public int getNumberOfInstances() { + return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue(); + } + + /** + * @param value Number of SOP Instances in Study. + */ + public ImagingStudy setNumberOfInstances(int value) { + if (this.numberOfInstances == null) + this.numberOfInstances = new UnsignedIntType(); + this.numberOfInstances.setValue(value); + return this; + } + + /** + * @return {@link #procedure} (Type of procedure performed.) + */ + public List getProcedure() { + if (this.procedure == null) + this.procedure = new ArrayList(); + return this.procedure; + } + + public boolean hasProcedure() { + if (this.procedure == null) + return false; + for (Reference item : this.procedure) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #procedure} (Type of procedure performed.) + */ + // syntactic sugar + public Reference addProcedure() { //3 + Reference t = new Reference(); + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addProcedure(Reference t) { //3 + if (t == null) + return this; + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return this; + } + + /** + * @return {@link #procedure} (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. Type of procedure performed.) + */ + public List getProcedureTarget() { + if (this.procedureTarget == null) + this.procedureTarget = new ArrayList(); + return this.procedureTarget; + } + + // syntactic sugar + /** + * @return {@link #procedure} (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. Type of procedure performed.) + */ + public Procedure addProcedureTarget() { + Procedure r = new Procedure(); + if (this.procedureTarget == null) + this.procedureTarget = new ArrayList(); + this.procedureTarget.add(r); + return r; + } + + /** + * @return {@link #description} (Institution-generated description or classification of the Study performed.). 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 ImagingStudy.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Institution-generated description or classification of the Study performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingStudy setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Institution-generated description or classification of the Study performed. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Institution-generated description or classification of the Study performed. + */ + public ImagingStudy 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 #series} (Each study has one or more series of images or other content.) + */ + public List getSeries() { + if (this.series == null) + this.series = new ArrayList(); + return this.series; + } + + public boolean hasSeries() { + if (this.series == null) + return false; + for (ImagingStudySeriesComponent item : this.series) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #series} (Each study has one or more series of images or other content.) + */ + // syntactic sugar + public ImagingStudySeriesComponent addSeries() { //3 + ImagingStudySeriesComponent t = new ImagingStudySeriesComponent(); + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return t; + } + + // syntactic sugar + public ImagingStudy addSeries(ImagingStudySeriesComponent t) { //3 + if (t == null) + return this; + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Formal identifier for the study.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("accession", "Identifier", "Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf).", 0, java.lang.Integer.MAX_VALUE, accession)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers for the study.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("availability", "code", "Availability of study (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); + childrenList.add(new Property("modalityList", "Coding", "A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).", 0, java.lang.Integer.MAX_VALUE, modalityList)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient imaged in the study.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("started", "dateTime", "Date and Time the study started.", 0, java.lang.Integer.MAX_VALUE, started)); + childrenList.add(new Property("order", "Reference(DiagnosticOrder)", "A list of the diagnostic orders that resulted in this imaging study being performed.", 0, java.lang.Integer.MAX_VALUE, order)); + childrenList.add(new Property("referrer", "Reference(Practitioner)", "The requesting/referring physician.", 0, java.lang.Integer.MAX_VALUE, referrer)); + childrenList.add(new Property("interpreter", "Reference(Practitioner)", "Who read the study and interpreted the images or other content.", 0, java.lang.Integer.MAX_VALUE, interpreter)); + childrenList.add(new Property("url", "uri", "WADO-RS resource where Study is available.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("numberOfSeries", "unsignedInt", "Number of Series in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfSeries)); + childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); + childrenList.add(new Property("procedure", "Reference(Procedure)", "Type of procedure performed.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("description", "string", "Institution-generated description or classification of the Study performed.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("series", "", "Each study has one or more series of images or other content.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType + case -2115028956: /*accession*/ return this.accession == null ? new Base[0] : new Base[] {this.accession}; // Identifier + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1997542747: /*availability*/ return this.availability == null ? new Base[0] : new Base[] {this.availability}; // Enumeration + case -1030238433: /*modalityList*/ return this.modalityList == null ? new Base[0] : this.modalityList.toArray(new Base[this.modalityList.size()]); // Coding + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1897185151: /*started*/ return this.started == null ? new Base[0] : new Base[] {this.started}; // DateTimeType + case 106006350: /*order*/ return this.order == null ? new Base[0] : this.order.toArray(new Base[this.order.size()]); // Reference + case -722568161: /*referrer*/ return this.referrer == null ? new Base[0] : new Base[] {this.referrer}; // Reference + case -2008009094: /*interpreter*/ return this.interpreter == null ? new Base[0] : new Base[] {this.interpreter}; // Reference + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 1920000407: /*numberOfSeries*/ return this.numberOfSeries == null ? new Base[0] : new Base[] {this.numberOfSeries}; // UnsignedIntType + case -1043544226: /*numberOfInstances*/ return this.numberOfInstances == null ? new Base[0] : new Base[] {this.numberOfInstances}; // UnsignedIntType + case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // Reference + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -905838985: /*series*/ return this.series == null ? new Base[0] : this.series.toArray(new Base[this.series.size()]); // ImagingStudySeriesComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 115792: // uid + this.uid = castToOid(value); // OidType + break; + case -2115028956: // accession + this.accession = castToIdentifier(value); // Identifier + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1997542747: // availability + this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration + break; + case -1030238433: // modalityList + this.getModalityList().add(castToCoding(value)); // Coding + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1897185151: // started + this.started = castToDateTime(value); // DateTimeType + break; + case 106006350: // order + this.getOrder().add(castToReference(value)); // Reference + break; + case -722568161: // referrer + this.referrer = castToReference(value); // Reference + break; + case -2008009094: // interpreter + this.interpreter = castToReference(value); // Reference + break; + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 1920000407: // numberOfSeries + this.numberOfSeries = castToUnsignedInt(value); // UnsignedIntType + break; + case -1043544226: // numberOfInstances + this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType + break; + case -1095204141: // procedure + this.getProcedure().add(castToReference(value)); // Reference + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -905838985: // series + this.getSeries().add((ImagingStudySeriesComponent) value); // ImagingStudySeriesComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("uid")) + this.uid = castToOid(value); // OidType + else if (name.equals("accession")) + this.accession = castToIdentifier(value); // Identifier + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("availability")) + this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration + else if (name.equals("modalityList")) + this.getModalityList().add(castToCoding(value)); + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("started")) + this.started = castToDateTime(value); // DateTimeType + else if (name.equals("order")) + this.getOrder().add(castToReference(value)); + else if (name.equals("referrer")) + this.referrer = castToReference(value); // Reference + else if (name.equals("interpreter")) + this.interpreter = castToReference(value); // Reference + else if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("numberOfSeries")) + this.numberOfSeries = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("numberOfInstances")) + this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("procedure")) + this.getProcedure().add(castToReference(value)); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("series")) + this.getSeries().add((ImagingStudySeriesComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType + case -2115028956: return getAccession(); // Identifier + case -1618432855: return addIdentifier(); // Identifier + case 1997542747: throw new FHIRException("Cannot make property availability as it is not a complex type"); // Enumeration + case -1030238433: return addModalityList(); // Coding + case -791418107: return getPatient(); // Reference + case -1897185151: throw new FHIRException("Cannot make property started as it is not a complex type"); // DateTimeType + case 106006350: return addOrder(); // Reference + case -722568161: return getReferrer(); // Reference + case -2008009094: return getInterpreter(); // Reference + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 1920000407: throw new FHIRException("Cannot make property numberOfSeries as it is not a complex type"); // UnsignedIntType + case -1043544226: throw new FHIRException("Cannot make property numberOfInstances as it is not a complex type"); // UnsignedIntType + case -1095204141: return addProcedure(); // Reference + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -905838985: return addSeries(); // ImagingStudySeriesComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("uid")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid"); + } + else if (name.equals("accession")) { + this.accession = new Identifier(); + return this.accession; + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("availability")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.availability"); + } + else if (name.equals("modalityList")) { + return addModalityList(); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("started")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.started"); + } + else if (name.equals("order")) { + return addOrder(); + } + else if (name.equals("referrer")) { + this.referrer = new Reference(); + return this.referrer; + } + else if (name.equals("interpreter")) { + this.interpreter = new Reference(); + return this.interpreter; + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.url"); + } + else if (name.equals("numberOfSeries")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfSeries"); + } + else if (name.equals("numberOfInstances")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfInstances"); + } + else if (name.equals("procedure")) { + return addProcedure(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.description"); + } + else if (name.equals("series")) { + return addSeries(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ImagingStudy"; + + } + + public ImagingStudy copy() { + ImagingStudy dst = new ImagingStudy(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.accession = accession == null ? null : accession.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.availability = availability == null ? null : availability.copy(); + if (modalityList != null) { + dst.modalityList = new ArrayList(); + for (Coding i : modalityList) + dst.modalityList.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.started = started == null ? null : started.copy(); + if (order != null) { + dst.order = new ArrayList(); + for (Reference i : order) + dst.order.add(i.copy()); + }; + dst.referrer = referrer == null ? null : referrer.copy(); + dst.interpreter = interpreter == null ? null : interpreter.copy(); + dst.url = url == null ? null : url.copy(); + dst.numberOfSeries = numberOfSeries == null ? null : numberOfSeries.copy(); + dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); + if (procedure != null) { + dst.procedure = new ArrayList(); + for (Reference i : procedure) + dst.procedure.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (series != null) { + dst.series = new ArrayList(); + for (ImagingStudySeriesComponent i : series) + dst.series.add(i.copy()); + }; + return dst; + } + + protected ImagingStudy typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImagingStudy)) + return false; + ImagingStudy o = (ImagingStudy) other; + return compareDeep(uid, o.uid, true) && compareDeep(accession, o.accession, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(availability, o.availability, true) && compareDeep(modalityList, o.modalityList, true) + && compareDeep(patient, o.patient, true) && compareDeep(started, o.started, true) && compareDeep(order, o.order, true) + && compareDeep(referrer, o.referrer, true) && compareDeep(interpreter, o.interpreter, true) && compareDeep(url, o.url, true) + && compareDeep(numberOfSeries, o.numberOfSeries, true) && compareDeep(numberOfInstances, o.numberOfInstances, true) + && compareDeep(procedure, o.procedure, true) && compareDeep(description, o.description, true) && compareDeep(series, o.series, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImagingStudy)) + return false; + ImagingStudy o = (ImagingStudy) other; + return compareValues(uid, o.uid, true) && compareValues(availability, o.availability, true) && compareValues(started, o.started, true) + && compareValues(url, o.url, true) && compareValues(numberOfSeries, o.numberOfSeries, true) && compareValues(numberOfInstances, o.numberOfInstances, true) + && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (accession == null || accession.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (availability == null || availability.isEmpty()) + && (modalityList == null || modalityList.isEmpty()) && (patient == null || patient.isEmpty()) + && (started == null || started.isEmpty()) && (order == null || order.isEmpty()) && (referrer == null || referrer.isEmpty()) + && (interpreter == null || interpreter.isEmpty()) && (url == null || url.isEmpty()) && (numberOfSeries == null || numberOfSeries.isEmpty()) + && (numberOfInstances == null || numberOfInstances.isEmpty()) && (procedure == null || procedure.isEmpty()) + && (description == null || description.isEmpty()) && (series == null || series.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImagingStudy; + } + + /** + * Search parameter: uid + *

+ * Description: The instance unique identifier
+ * Type: uri
+ * Path: ImagingStudy.series.instance.uid
+ *

+ */ + @SearchParamDefinition(name="uid", path="ImagingStudy.series.instance.uid", description="The instance unique identifier", type="uri" ) + public static final String SP_UID = "uid"; + /** + * Fluent Client search parameter constant for uid + *

+ * Description: The instance unique identifier
+ * Type: uri
+ * Path: ImagingStudy.series.instance.uid
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam UID = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_UID); + + /** + * Search parameter: series + *

+ * Description: The identifier of the series of images
+ * Type: uri
+ * Path: ImagingStudy.series.uid
+ *

+ */ + @SearchParamDefinition(name="series", path="ImagingStudy.series.uid", description="The identifier of the series of images", type="uri" ) + public static final String SP_SERIES = "series"; + /** + * Fluent Client search parameter constant for series + *

+ * Description: The identifier of the series of images
+ * Type: uri
+ * Path: ImagingStudy.series.uid
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam SERIES = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SERIES); + + /** + * Search parameter: patient + *

+ * Description: Who the study is about
+ * Type: reference
+ * Path: ImagingStudy.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="ImagingStudy.patient", description="Who the study is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who the study is about
+ * Type: reference
+ * Path: ImagingStudy.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImagingStudy:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImagingStudy:patient").toLocked(); + + /** + * Search parameter: order + *

+ * Description: The order for the image
+ * Type: reference
+ * Path: ImagingStudy.order
+ *

+ */ + @SearchParamDefinition(name="order", path="ImagingStudy.order", description="The order for the image", type="reference" ) + public static final String SP_ORDER = "order"; + /** + * Fluent Client search parameter constant for order + *

+ * Description: The order for the image
+ * Type: reference
+ * Path: ImagingStudy.order
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORDER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImagingStudy:order". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORDER = new ca.uhn.fhir.model.api.Include("ImagingStudy:order").toLocked(); + + /** + * Search parameter: bodysite + *

+ * Description: The body site studied
+ * Type: token
+ * Path: ImagingStudy.series.bodySite
+ *

+ */ + @SearchParamDefinition(name="bodysite", path="ImagingStudy.series.bodySite", description="The body site studied", type="token" ) + public static final String SP_BODYSITE = "bodysite"; + /** + * Fluent Client search parameter constant for bodysite + *

+ * Description: The body site studied
+ * Type: token
+ * Path: ImagingStudy.series.bodySite
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODYSITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODYSITE); + + /** + * Search parameter: accession + *

+ * Description: The accession identifier for the study
+ * Type: token
+ * Path: ImagingStudy.accession
+ *

+ */ + @SearchParamDefinition(name="accession", path="ImagingStudy.accession", description="The accession identifier for the study", type="token" ) + public static final String SP_ACCESSION = "accession"; + /** + * Fluent Client search parameter constant for accession + *

+ * Description: The accession identifier for the study
+ * Type: token
+ * Path: ImagingStudy.accession
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACCESSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACCESSION); + + /** + * Search parameter: study + *

+ * Description: The study identifier for the image
+ * Type: uri
+ * Path: ImagingStudy.uid
+ *

+ */ + @SearchParamDefinition(name="study", path="ImagingStudy.uid", description="The study identifier for the image", type="uri" ) + public static final String SP_STUDY = "study"; + /** + * Fluent Client search parameter constant for study + *

+ * Description: The study identifier for the image
+ * Type: uri
+ * Path: ImagingStudy.uid
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam STUDY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_STUDY); + + /** + * Search parameter: modality + *

+ * Description: The modality of the series
+ * Type: token
+ * Path: ImagingStudy.series.modality
+ *

+ */ + @SearchParamDefinition(name="modality", path="ImagingStudy.series.modality", description="The modality of the series", type="token" ) + public static final String SP_MODALITY = "modality"; + /** + * Fluent Client search parameter constant for modality + *

+ * Description: The modality of the series
+ * Type: token
+ * Path: ImagingStudy.series.modality
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam MODALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MODALITY); + + /** + * Search parameter: started + *

+ * Description: When the study was started
+ * Type: date
+ * Path: ImagingStudy.started
+ *

+ */ + @SearchParamDefinition(name="started", path="ImagingStudy.started", description="When the study was started", type="date" ) + public static final String SP_STARTED = "started"; + /** + * Fluent Client search parameter constant for started + *

+ * Description: When the study was started
+ * Type: date
+ * Path: ImagingStudy.started
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam STARTED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_STARTED); + + /** + * Search parameter: identifier + *

+ * Description: Other identifiers for the Study
+ * Type: token
+ * Path: ImagingStudy.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ImagingStudy.identifier", description="Other identifiers for the Study", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Other identifiers for the Study
+ * Type: token
+ * Path: ImagingStudy.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: dicom-class + *

+ * Description: The type of the instance
+ * Type: uri
+ * Path: ImagingStudy.series.instance.sopClass
+ *

+ */ + @SearchParamDefinition(name="dicom-class", path="ImagingStudy.series.instance.sopClass", description="The type of the instance", type="uri" ) + public static final String SP_DICOM_CLASS = "dicom-class"; + /** + * Fluent Client search parameter constant for dicom-class + *

+ * Description: The type of the instance
+ * Type: uri
+ * Path: ImagingStudy.series.instance.sopClass
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam DICOM_CLASS = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DICOM_CLASS); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Immunization.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Immunization.java new file mode 100644 index 00000000000..c4c672f72c1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Immunization.java @@ -0,0 +1,2910 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. + */ +@ResourceDef(name="Immunization", profile="http://hl7.org/fhir/Profile/Immunization") +public class Immunization extends DomainResource { + + @Block() + public static class ImmunizationExplanationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Reasons why a vaccine was administered. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Why immunization occurred", formalDefinition="Reasons why a vaccine was administered." ) + protected List reason; + + /** + * Reason why a vaccine was not administered. + */ + @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Why immunization did not occur", formalDefinition="Reason why a vaccine was not administered." ) + protected List reasonNotGiven; + + private static final long serialVersionUID = -539821866L; + + /** + * Constructor + */ + public ImmunizationExplanationComponent() { + super(); + } + + /** + * @return {@link #reason} (Reasons why a vaccine was administered.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (Reasons why a vaccine was administered.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public ImmunizationExplanationComponent addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #reasonNotGiven} (Reason why a vaccine was not administered.) + */ + public List getReasonNotGiven() { + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + return this.reasonNotGiven; + } + + public boolean hasReasonNotGiven() { + if (this.reasonNotGiven == null) + return false; + for (CodeableConcept item : this.reasonNotGiven) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotGiven} (Reason why a vaccine was not administered.) + */ + // syntactic sugar + public CodeableConcept addReasonNotGiven() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return t; + } + + // syntactic sugar + public ImmunizationExplanationComponent addReasonNotGiven(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("reason", "CodeableConcept", "Reasons why a vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "Reason why a vaccine was not administered.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept + case 2101123790: /*reasonNotGiven*/ return this.reasonNotGiven == null ? new Base[0] : this.reasonNotGiven.toArray(new Base[this.reasonNotGiven.size()]); // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -934964668: // reason + this.getReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 2101123790: // reasonNotGiven + this.getReasonNotGiven().add(castToCodeableConcept(value)); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("reason")) + this.getReason().add(castToCodeableConcept(value)); + else if (name.equals("reasonNotGiven")) + this.getReasonNotGiven().add(castToCodeableConcept(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -934964668: return addReason(); // CodeableConcept + case 2101123790: return addReasonNotGiven(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("reason")) { + return addReason(); + } + else if (name.equals("reasonNotGiven")) { + return addReasonNotGiven(); + } + else + return super.addChild(name); + } + + public ImmunizationExplanationComponent copy() { + ImmunizationExplanationComponent dst = new ImmunizationExplanationComponent(); + copyValues(dst); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (reasonNotGiven != null) { + dst.reasonNotGiven = new ArrayList(); + for (CodeableConcept i : reasonNotGiven) + dst.reasonNotGiven.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationExplanationComponent)) + return false; + ImmunizationExplanationComponent o = (ImmunizationExplanationComponent) other; + return compareDeep(reason, o.reason, true) && compareDeep(reasonNotGiven, o.reasonNotGiven, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationExplanationComponent)) + return false; + ImmunizationExplanationComponent o = (ImmunizationExplanationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (reason == null || reason.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) + ; + } + + public String fhirType() { + return "Immunization.explanation"; + + } + + } + + @Block() + public static class ImmunizationReactionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Date of reaction to the immunization. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="When reaction started", formalDefinition="Date of reaction to the immunization." ) + protected DateTimeType date; + + /** + * Details of the reaction. + */ + @Child(name = "detail", type = {Observation.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Additional information on reaction", formalDefinition="Details of the reaction." ) + protected Reference detail; + + /** + * The actual object that is the target of the reference (Details of the reaction.) + */ + protected Observation detailTarget; + + /** + * Self-reported indicator. + */ + @Child(name = "reported", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Indicates self-reported reaction", formalDefinition="Self-reported indicator." ) + protected BooleanType reported; + + private static final long serialVersionUID = -1297668556L; + + /** + * Constructor + */ + public ImmunizationReactionComponent() { + super(); + } + + /** + * @return {@link #date} (Date of reaction to the immunization.). 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 ImmunizationReactionComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ImmunizationReactionComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Date of reaction to the immunization. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Date of reaction to the immunization. + */ + public ImmunizationReactionComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #detail} (Details of the reaction.) + */ + public Reference getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new Reference(); // cc + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (Details of the reaction.) + */ + public ImmunizationReactionComponent 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. (Details of the reaction.) + */ + public Observation getDetailTarget() { + if (this.detailTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detailTarget = new Observation(); // aa + 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. (Details of the reaction.) + */ + public ImmunizationReactionComponent setDetailTarget(Observation value) { + this.detailTarget = value; + return this; + } + + /** + * @return {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public BooleanType getReportedElement() { + if (this.reported == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.reported"); + else if (Configuration.doAutoCreate()) + this.reported = new BooleanType(); // bb + return this.reported; + } + + public boolean hasReportedElement() { + return this.reported != null && !this.reported.isEmpty(); + } + + public boolean hasReported() { + return this.reported != null && !this.reported.isEmpty(); + } + + /** + * @param value {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public ImmunizationReactionComponent setReportedElement(BooleanType value) { + this.reported = value; + return this; + } + + /** + * @return Self-reported indicator. + */ + public boolean getReported() { + return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); + } + + /** + * @param value Self-reported indicator. + */ + public ImmunizationReactionComponent setReported(boolean value) { + if (this.reported == null) + this.reported = new BooleanType(); + this.reported.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("date", "dateTime", "Date of reaction to the immunization.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("detail", "Reference(Observation)", "Details of the reaction.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("reported", "boolean", "Self-reported indicator.", 0, java.lang.Integer.MAX_VALUE, reported)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // Reference + case -427039533: /*reported*/ return this.reported == null ? new Base[0] : new Base[] {this.reported}; // BooleanType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1335224239: // detail + this.detail = castToReference(value); // Reference + break; + case -427039533: // reported + this.reported = castToBoolean(value); // BooleanType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("detail")) + this.detail = castToReference(value); // Reference + else if (name.equals("reported")) + this.reported = castToBoolean(value); // BooleanType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1335224239: return getDetail(); // Reference + case -427039533: throw new FHIRException("Cannot make property reported as it is not a complex type"); // BooleanType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.date"); + } + else if (name.equals("detail")) { + this.detail = new Reference(); + return this.detail; + } + else if (name.equals("reported")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.reported"); + } + else + return super.addChild(name); + } + + public ImmunizationReactionComponent copy() { + ImmunizationReactionComponent dst = new ImmunizationReactionComponent(); + copyValues(dst); + dst.date = date == null ? null : date.copy(); + dst.detail = detail == null ? null : detail.copy(); + dst.reported = reported == null ? null : reported.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationReactionComponent)) + return false; + ImmunizationReactionComponent o = (ImmunizationReactionComponent) other; + return compareDeep(date, o.date, true) && compareDeep(detail, o.detail, true) && compareDeep(reported, o.reported, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationReactionComponent)) + return false; + ImmunizationReactionComponent o = (ImmunizationReactionComponent) other; + return compareValues(date, o.date, true) && compareValues(reported, o.reported, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (date == null || date.isEmpty()) && (detail == null || detail.isEmpty()) + && (reported == null || reported.isEmpty()); + } + + public String fhirType() { + return "Immunization.reaction"; + + } + + } + + @Block() + public static class ImmunizationVaccinationProtocolComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Nominal position in a series. + */ + @Child(name = "doseSequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Dose number within series", formalDefinition="Nominal position in a series." ) + protected PositiveIntType doseSequence; + + /** + * Contains the description about the protocol under which the vaccine was administered. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Details of vaccine protocol", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) + protected StringType description; + + /** + * Indicates the authority who published the protocol. E.g. ACIP. + */ + @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol. E.g. ACIP." ) + protected Reference authority; + + /** + * The actual object that is the target of the reference (Indicates the authority who published the protocol. E.g. ACIP.) + */ + protected Organization authorityTarget; + + /** + * One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + @Child(name = "series", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of vaccine series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) + protected StringType series; + + /** + * The recommended number of doses to achieve immunity. + */ + @Child(name = "seriesDoses", type = {PositiveIntType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Recommended number of doses for immunity", formalDefinition="The recommended number of doses to achieve immunity." ) + protected PositiveIntType seriesDoses; + + /** + * The targeted disease. + */ + @Child(name = "targetDisease", type = {CodeableConcept.class}, order=6, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Disease immunized against", formalDefinition="The targeted disease." ) + protected List targetDisease; + + /** + * Indicates if the immunization event should "count" against the protocol. + */ + @Child(name = "doseStatus", type = {CodeableConcept.class}, order=7, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Indicates if dose counts towards immunity", formalDefinition="Indicates if the immunization event should \"count\" against the protocol." ) + protected CodeableConcept doseStatus; + + /** + * Provides an explanation as to why an immunization event should or should not count against the protocol. + */ + @Child(name = "doseStatusReason", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why dose does (not) count", formalDefinition="Provides an explanation as to why an immunization event should or should not count against the protocol." ) + protected CodeableConcept doseStatusReason; + + private static final long serialVersionUID = 386814037L; + + /** + * Constructor + */ + public ImmunizationVaccinationProtocolComponent() { + super(); + } + + /** + * Constructor + */ + public ImmunizationVaccinationProtocolComponent(PositiveIntType doseSequence, CodeableConcept doseStatus) { + super(); + this.doseSequence = doseSequence; + this.doseStatus = doseStatus; + } + + /** + * @return {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public PositiveIntType getDoseSequenceElement() { + if (this.doseSequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseSequence"); + else if (Configuration.doAutoCreate()) + this.doseSequence = new PositiveIntType(); // bb + return this.doseSequence; + } + + public boolean hasDoseSequenceElement() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + public boolean hasDoseSequence() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + /** + * @param value {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setDoseSequenceElement(PositiveIntType value) { + this.doseSequence = value; + return this; + } + + /** + * @return Nominal position in a series. + */ + public int getDoseSequence() { + return this.doseSequence == null || this.doseSequence.isEmpty() ? 0 : this.doseSequence.getValue(); + } + + /** + * @param value Nominal position in a series. + */ + public ImmunizationVaccinationProtocolComponent setDoseSequence(int value) { + if (this.doseSequence == null) + this.doseSequence = new PositiveIntType(); + this.doseSequence.setValue(value); + return this; + } + + /** + * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). 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 ImmunizationVaccinationProtocolComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Contains the description about the protocol under which the vaccine was administered. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Contains the description about the protocol under which the vaccine was administered. + */ + public ImmunizationVaccinationProtocolComponent 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 #authority} (Indicates the authority who published the protocol. E.g. ACIP.) + */ + public Reference getAuthority() { + if (this.authority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authority = new Reference(); // cc + return this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (Indicates the authority who published the protocol. E.g. ACIP.) + */ + public ImmunizationVaccinationProtocolComponent setAuthority(Reference value) { + this.authority = value; + return this; + } + + /** + * @return {@link #authority} 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. (Indicates the authority who published the protocol. E.g. ACIP.) + */ + public Organization getAuthorityTarget() { + if (this.authorityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authorityTarget = new Organization(); // aa + return this.authorityTarget; + } + + /** + * @param value {@link #authority} 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. (Indicates the authority who published the protocol. E.g. ACIP.) + */ + public ImmunizationVaccinationProtocolComponent setAuthorityTarget(Organization value) { + this.authorityTarget = value; + return this; + } + + /** + * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public StringType getSeriesElement() { + if (this.series == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.series"); + else if (Configuration.doAutoCreate()) + this.series = new StringType(); // bb + return this.series; + } + + public boolean hasSeriesElement() { + return this.series != null && !this.series.isEmpty(); + } + + public boolean hasSeries() { + return this.series != null && !this.series.isEmpty(); + } + + /** + * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setSeriesElement(StringType value) { + this.series = value; + return this; + } + + /** + * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public String getSeries() { + return this.series == null ? null : this.series.getValue(); + } + + /** + * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public ImmunizationVaccinationProtocolComponent setSeries(String value) { + if (Utilities.noString(value)) + this.series = null; + else { + if (this.series == null) + this.series = new StringType(); + this.series.setValue(value); + } + return this; + } + + /** + * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value + */ + public PositiveIntType getSeriesDosesElement() { + if (this.seriesDoses == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.seriesDoses"); + else if (Configuration.doAutoCreate()) + this.seriesDoses = new PositiveIntType(); // bb + return this.seriesDoses; + } + + public boolean hasSeriesDosesElement() { + return this.seriesDoses != null && !this.seriesDoses.isEmpty(); + } + + public boolean hasSeriesDoses() { + return this.seriesDoses != null && !this.seriesDoses.isEmpty(); + } + + /** + * @param value {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setSeriesDosesElement(PositiveIntType value) { + this.seriesDoses = value; + return this; + } + + /** + * @return The recommended number of doses to achieve immunity. + */ + public int getSeriesDoses() { + return this.seriesDoses == null || this.seriesDoses.isEmpty() ? 0 : this.seriesDoses.getValue(); + } + + /** + * @param value The recommended number of doses to achieve immunity. + */ + public ImmunizationVaccinationProtocolComponent setSeriesDoses(int value) { + if (this.seriesDoses == null) + this.seriesDoses = new PositiveIntType(); + this.seriesDoses.setValue(value); + return this; + } + + /** + * @return {@link #targetDisease} (The targeted disease.) + */ + public List getTargetDisease() { + if (this.targetDisease == null) + this.targetDisease = new ArrayList(); + return this.targetDisease; + } + + public boolean hasTargetDisease() { + if (this.targetDisease == null) + return false; + for (CodeableConcept item : this.targetDisease) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #targetDisease} (The targeted disease.) + */ + // syntactic sugar + public CodeableConcept addTargetDisease() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.targetDisease == null) + this.targetDisease = new ArrayList(); + this.targetDisease.add(t); + return t; + } + + // syntactic sugar + public ImmunizationVaccinationProtocolComponent addTargetDisease(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.targetDisease == null) + this.targetDisease = new ArrayList(); + this.targetDisease.add(t); + return this; + } + + /** + * @return {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) + */ + public CodeableConcept getDoseStatus() { + if (this.doseStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatus"); + else if (Configuration.doAutoCreate()) + this.doseStatus = new CodeableConcept(); // cc + return this.doseStatus; + } + + public boolean hasDoseStatus() { + return this.doseStatus != null && !this.doseStatus.isEmpty(); + } + + /** + * @param value {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) + */ + public ImmunizationVaccinationProtocolComponent setDoseStatus(CodeableConcept value) { + this.doseStatus = value; + return this; + } + + /** + * @return {@link #doseStatusReason} (Provides an explanation as to why an immunization event should or should not count against the protocol.) + */ + public CodeableConcept getDoseStatusReason() { + if (this.doseStatusReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatusReason"); + else if (Configuration.doAutoCreate()) + this.doseStatusReason = new CodeableConcept(); // cc + return this.doseStatusReason; + } + + public boolean hasDoseStatusReason() { + return this.doseStatusReason != null && !this.doseStatusReason.isEmpty(); + } + + /** + * @param value {@link #doseStatusReason} (Provides an explanation as to why an immunization event should or should not count against the protocol.) + */ + public ImmunizationVaccinationProtocolComponent setDoseStatusReason(CodeableConcept value) { + this.doseStatusReason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("doseSequence", "positiveInt", "Nominal position in a series.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); + childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol. E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); + childrenList.add(new Property("seriesDoses", "positiveInt", "The recommended number of doses to achieve immunity.", 0, java.lang.Integer.MAX_VALUE, seriesDoses)); + childrenList.add(new Property("targetDisease", "CodeableConcept", "The targeted disease.", 0, java.lang.Integer.MAX_VALUE, targetDisease)); + childrenList.add(new Property("doseStatus", "CodeableConcept", "Indicates if the immunization event should \"count\" against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatus)); + childrenList.add(new Property("doseStatusReason", "CodeableConcept", "Provides an explanation as to why an immunization event should or should not count against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatusReason)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 550933246: /*doseSequence*/ return this.doseSequence == null ? new Base[0] : new Base[] {this.doseSequence}; // PositiveIntType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : new Base[] {this.authority}; // Reference + case -905838985: /*series*/ return this.series == null ? new Base[0] : new Base[] {this.series}; // StringType + case -1936727105: /*seriesDoses*/ return this.seriesDoses == null ? new Base[0] : new Base[] {this.seriesDoses}; // PositiveIntType + case -319593813: /*targetDisease*/ return this.targetDisease == null ? new Base[0] : this.targetDisease.toArray(new Base[this.targetDisease.size()]); // CodeableConcept + case -745826705: /*doseStatus*/ return this.doseStatus == null ? new Base[0] : new Base[] {this.doseStatus}; // CodeableConcept + case 662783379: /*doseStatusReason*/ return this.doseStatusReason == null ? new Base[0] : new Base[] {this.doseStatusReason}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 550933246: // doseSequence + this.doseSequence = castToPositiveInt(value); // PositiveIntType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 1475610435: // authority + this.authority = castToReference(value); // Reference + break; + case -905838985: // series + this.series = castToString(value); // StringType + break; + case -1936727105: // seriesDoses + this.seriesDoses = castToPositiveInt(value); // PositiveIntType + break; + case -319593813: // targetDisease + this.getTargetDisease().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -745826705: // doseStatus + this.doseStatus = castToCodeableConcept(value); // CodeableConcept + break; + case 662783379: // doseStatusReason + this.doseStatusReason = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("doseSequence")) + this.doseSequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("authority")) + this.authority = castToReference(value); // Reference + else if (name.equals("series")) + this.series = castToString(value); // StringType + else if (name.equals("seriesDoses")) + this.seriesDoses = castToPositiveInt(value); // PositiveIntType + else if (name.equals("targetDisease")) + this.getTargetDisease().add(castToCodeableConcept(value)); + else if (name.equals("doseStatus")) + this.doseStatus = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("doseStatusReason")) + this.doseStatusReason = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 550933246: throw new FHIRException("Cannot make property doseSequence as it is not a complex type"); // PositiveIntType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 1475610435: return getAuthority(); // Reference + case -905838985: throw new FHIRException("Cannot make property series as it is not a complex type"); // StringType + case -1936727105: throw new FHIRException("Cannot make property seriesDoses as it is not a complex type"); // PositiveIntType + case -319593813: return addTargetDisease(); // CodeableConcept + case -745826705: return getDoseStatus(); // CodeableConcept + case 662783379: return getDoseStatusReason(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("doseSequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.doseSequence"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.description"); + } + else if (name.equals("authority")) { + this.authority = new Reference(); + return this.authority; + } + else if (name.equals("series")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.series"); + } + else if (name.equals("seriesDoses")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.seriesDoses"); + } + else if (name.equals("targetDisease")) { + return addTargetDisease(); + } + else if (name.equals("doseStatus")) { + this.doseStatus = new CodeableConcept(); + return this.doseStatus; + } + else if (name.equals("doseStatusReason")) { + this.doseStatusReason = new CodeableConcept(); + return this.doseStatusReason; + } + else + return super.addChild(name); + } + + public ImmunizationVaccinationProtocolComponent copy() { + ImmunizationVaccinationProtocolComponent dst = new ImmunizationVaccinationProtocolComponent(); + copyValues(dst); + dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); + dst.description = description == null ? null : description.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.series = series == null ? null : series.copy(); + dst.seriesDoses = seriesDoses == null ? null : seriesDoses.copy(); + if (targetDisease != null) { + dst.targetDisease = new ArrayList(); + for (CodeableConcept i : targetDisease) + dst.targetDisease.add(i.copy()); + }; + dst.doseStatus = doseStatus == null ? null : doseStatus.copy(); + dst.doseStatusReason = doseStatusReason == null ? null : doseStatusReason.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationVaccinationProtocolComponent)) + return false; + ImmunizationVaccinationProtocolComponent o = (ImmunizationVaccinationProtocolComponent) other; + return compareDeep(doseSequence, o.doseSequence, true) && compareDeep(description, o.description, true) + && compareDeep(authority, o.authority, true) && compareDeep(series, o.series, true) && compareDeep(seriesDoses, o.seriesDoses, true) + && compareDeep(targetDisease, o.targetDisease, true) && compareDeep(doseStatus, o.doseStatus, true) + && compareDeep(doseStatusReason, o.doseStatusReason, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationVaccinationProtocolComponent)) + return false; + ImmunizationVaccinationProtocolComponent o = (ImmunizationVaccinationProtocolComponent) other; + return compareValues(doseSequence, o.doseSequence, true) && compareValues(description, o.description, true) + && compareValues(series, o.series, true) && compareValues(seriesDoses, o.seriesDoses, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) + && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()) && (seriesDoses == null || seriesDoses.isEmpty()) + && (targetDisease == null || targetDisease.isEmpty()) && (doseStatus == null || doseStatus.isEmpty()) + && (doseStatusReason == null || doseStatusReason.isEmpty()); + } + + public String fhirType() { + return "Immunization.vaccinationProtocol"; + + } + + } + + /** + * A unique identifier assigned to this immunization record. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this immunization record." ) + protected List identifier; + + /** + * Indicates the current status of the vaccination event. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="Indicates the current status of the vaccination event." ) + protected CodeType status; + + /** + * Date vaccine administered or was to be administered. + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Vaccination administration date", formalDefinition="Date vaccine administered or was to be administered." ) + protected DateTimeType date; + + /** + * Vaccine that was administered or was to be administered. + */ + @Child(name = "vaccineCode", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Vaccine product administered", formalDefinition="Vaccine that was administered or was to be administered." ) + protected CodeableConcept vaccineCode; + + /** + * The patient who either received or did not receive the immunization. + */ + @Child(name = "patient", type = {Patient.class}, order=4, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who was immunized", formalDefinition="The patient who either received or did not receive the immunization." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient who either received or did not receive the immunization.) + */ + protected Patient patientTarget; + + /** + * Indicates if the vaccination was or was not given. + */ + @Child(name = "wasNotGiven", type = {BooleanType.class}, order=5, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="Flag for whether immunization was given", formalDefinition="Indicates if the vaccination was or was not given." ) + protected BooleanType wasNotGiven; + + /** + * True if this administration was reported rather than directly administered. + */ + @Child(name = "reported", type = {BooleanType.class}, order=6, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Indicates a self-reported record", formalDefinition="True if this administration was reported rather than directly administered." ) + protected BooleanType reported; + + /** + * Clinician who administered the vaccine. + */ + @Child(name = "performer", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who administered vaccine", formalDefinition="Clinician who administered the vaccine." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (Clinician who administered the vaccine.) + */ + protected Practitioner performerTarget; + + /** + * Clinician who ordered the vaccination. + */ + @Child(name = "requester", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who ordered vaccination", formalDefinition="Clinician who ordered the vaccination." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (Clinician who ordered the vaccination.) + */ + protected Practitioner requesterTarget; + + /** + * The visit or admission or other contact between patient and health care provider the immunization was performed as part of. + */ + @Child(name = "encounter", type = {Encounter.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission or other contact between patient and health care provider the immunization was performed as part of." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + protected Encounter encounterTarget; + + /** + * Name of vaccine manufacturer. + */ + @Child(name = "manufacturer", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Vaccine manufacturer", formalDefinition="Name of vaccine manufacturer." ) + protected Reference manufacturer; + + /** + * The actual object that is the target of the reference (Name of vaccine manufacturer.) + */ + protected Organization manufacturerTarget; + + /** + * The service delivery location where the vaccine administration occurred. + */ + @Child(name = "location", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Where vaccination occurred", formalDefinition="The service delivery location where the vaccine administration occurred." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The service delivery location where the vaccine administration occurred.) + */ + protected Location locationTarget; + + /** + * Lot number of the vaccine product. + */ + @Child(name = "lotNumber", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Vaccine lot number", formalDefinition="Lot number of the vaccine product." ) + protected StringType lotNumber; + + /** + * Date vaccine batch expires. + */ + @Child(name = "expirationDate", type = {DateType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Vaccine expiration date", formalDefinition="Date vaccine batch expires." ) + protected DateType expirationDate; + + /** + * Body site where vaccine was administered. + */ + @Child(name = "site", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Body site vaccine was administered", formalDefinition="Body site where vaccine was administered." ) + protected CodeableConcept site; + + /** + * The path by which the vaccine product is taken into the body. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="How vaccine entered body", formalDefinition="The path by which the vaccine product is taken into the body." ) + protected CodeableConcept route; + + /** + * The quantity of vaccine product that was administered. + */ + @Child(name = "doseQuantity", type = {SimpleQuantity.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Amount of vaccine administered", formalDefinition="The quantity of vaccine product that was administered." ) + protected SimpleQuantity doseQuantity; + + /** + * Extra information about the immunization that is not conveyed by the other attributes. + */ + @Child(name = "note", type = {Annotation.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Vaccination notes", formalDefinition="Extra information about the immunization that is not conveyed by the other attributes." ) + protected List note; + + /** + * Reasons why a vaccine was or was not administered. + */ + @Child(name = "explanation", type = {}, order=18, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Administration/non-administration reasons", formalDefinition="Reasons why a vaccine was or was not administered." ) + protected ImmunizationExplanationComponent explanation; + + /** + * Categorical data indicating that an adverse event is associated in time to an immunization. + */ + @Child(name = "reaction", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Details of a reaction that follows immunization", formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization." ) + protected List reaction; + + /** + * Contains information about the protocol(s) under which the vaccine was administered. + */ + @Child(name = "vaccinationProtocol", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="What protocol was followed", formalDefinition="Contains information about the protocol(s) under which the vaccine was administered." ) + protected List vaccinationProtocol; + + private static final long serialVersionUID = 898786200L; + + /** + * Constructor + */ + public Immunization() { + super(); + } + + /** + * Constructor + */ + public Immunization(CodeType status, CodeableConcept vaccineCode, Reference patient, BooleanType wasNotGiven, BooleanType reported) { + super(); + this.status = status; + this.vaccineCode = vaccineCode; + this.patient = patient; + this.wasNotGiven = wasNotGiven; + this.reported = reported; + } + + /** + * @return {@link #identifier} (A unique identifier assigned to this immunization record.) + */ + 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} (A unique identifier assigned to this immunization record.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Immunization addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (Indicates the current status of the vaccination event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CodeType getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.status"); + else if (Configuration.doAutoCreate()) + this.status = new CodeType(); // bb + 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 the current status of the vaccination event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Immunization setStatusElement(CodeType value) { + this.status = value; + return this; + } + + /** + * @return Indicates the current status of the vaccination event. + */ + public String getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates the current status of the vaccination event. + */ + public Immunization setStatus(String value) { + if (this.status == null) + this.status = new CodeType(); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #date} (Date vaccine administered or was to be administered.). 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 Immunization.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Immunization setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Date vaccine administered or was to be administered. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Date vaccine administered or was to be administered. + */ + public Immunization setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #vaccineCode} (Vaccine that was administered or was to be administered.) + */ + public CodeableConcept getVaccineCode() { + if (this.vaccineCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.vaccineCode"); + else if (Configuration.doAutoCreate()) + this.vaccineCode = new CodeableConcept(); // cc + return this.vaccineCode; + } + + public boolean hasVaccineCode() { + return this.vaccineCode != null && !this.vaccineCode.isEmpty(); + } + + /** + * @param value {@link #vaccineCode} (Vaccine that was administered or was to be administered.) + */ + public Immunization setVaccineCode(CodeableConcept value) { + this.vaccineCode = value; + return this; + } + + /** + * @return {@link #patient} (The patient who either received or did not receive the immunization.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient who either received or did not receive the immunization.) + */ + public Immunization 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 who either received or did not receive the immunization.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 who either received or did not receive the immunization.) + */ + public Immunization setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #wasNotGiven} (Indicates if the vaccination was or was not given.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public BooleanType getWasNotGivenElement() { + if (this.wasNotGiven == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.wasNotGiven"); + else if (Configuration.doAutoCreate()) + this.wasNotGiven = new BooleanType(); // bb + return this.wasNotGiven; + } + + public boolean hasWasNotGivenElement() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + public boolean hasWasNotGiven() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + /** + * @param value {@link #wasNotGiven} (Indicates if the vaccination was or was not given.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public Immunization setWasNotGivenElement(BooleanType value) { + this.wasNotGiven = value; + return this; + } + + /** + * @return Indicates if the vaccination was or was not given. + */ + public boolean getWasNotGiven() { + return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); + } + + /** + * @param value Indicates if the vaccination was or was not given. + */ + public Immunization setWasNotGiven(boolean value) { + if (this.wasNotGiven == null) + this.wasNotGiven = new BooleanType(); + this.wasNotGiven.setValue(value); + return this; + } + + /** + * @return {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public BooleanType getReportedElement() { + if (this.reported == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.reported"); + else if (Configuration.doAutoCreate()) + this.reported = new BooleanType(); // bb + return this.reported; + } + + public boolean hasReportedElement() { + return this.reported != null && !this.reported.isEmpty(); + } + + public boolean hasReported() { + return this.reported != null && !this.reported.isEmpty(); + } + + /** + * @param value {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public Immunization setReportedElement(BooleanType value) { + this.reported = value; + return this; + } + + /** + * @return True if this administration was reported rather than directly administered. + */ + public boolean getReported() { + return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); + } + + /** + * @param value True if this administration was reported rather than directly administered. + */ + public Immunization setReported(boolean value) { + if (this.reported == null) + this.reported = new BooleanType(); + this.reported.setValue(value); + return this; + } + + /** + * @return {@link #performer} (Clinician who administered the vaccine.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (Clinician who administered the vaccine.) + */ + public Immunization setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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. (Clinician who administered the vaccine.) + */ + public Practitioner getPerformerTarget() { + if (this.performerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.performer"); + else if (Configuration.doAutoCreate()) + this.performerTarget = new Practitioner(); // aa + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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. (Clinician who administered the vaccine.) + */ + public Immunization setPerformerTarget(Practitioner value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #requester} (Clinician who ordered the vaccination.) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); // cc + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (Clinician who ordered the vaccination.) + */ + public Immunization setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} 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. (Clinician who ordered the vaccination.) + */ + public Practitioner getRequesterTarget() { + if (this.requesterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.requester"); + else if (Configuration.doAutoCreate()) + this.requesterTarget = new Practitioner(); // aa + return this.requesterTarget; + } + + /** + * @param value {@link #requester} 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. (Clinician who ordered the vaccination.) + */ + public Immunization setRequesterTarget(Practitioner value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + public Immunization 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 visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 visit or admission or other contact between patient and health care provider the immunization was performed as part of.) + */ + public Immunization setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #manufacturer} (Name of vaccine manufacturer.) + */ + public Reference getManufacturer() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new Reference(); // cc + return this.manufacturer; + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (Name of vaccine manufacturer.) + */ + public Immunization setManufacturer(Reference value) { + this.manufacturer = value; + return this; + } + + /** + * @return {@link #manufacturer} 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. (Name of vaccine manufacturer.) + */ + public Organization getManufacturerTarget() { + if (this.manufacturerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturerTarget = new Organization(); // aa + return this.manufacturerTarget; + } + + /** + * @param value {@link #manufacturer} 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. (Name of vaccine manufacturer.) + */ + public Immunization setManufacturerTarget(Organization value) { + this.manufacturerTarget = value; + return this; + } + + /** + * @return {@link #location} (The service delivery location where the vaccine administration occurred.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The service delivery location where the vaccine administration occurred.) + */ + public Immunization 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. (The service delivery location where the vaccine administration occurred.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + 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. (The service delivery location where the vaccine administration occurred.) + */ + public Immunization setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public StringType getLotNumberElement() { + if (this.lotNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.lotNumber"); + else if (Configuration.doAutoCreate()) + this.lotNumber = new StringType(); // bb + return this.lotNumber; + } + + public boolean hasLotNumberElement() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + public boolean hasLotNumber() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + /** + * @param value {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public Immunization setLotNumberElement(StringType value) { + this.lotNumber = value; + return this; + } + + /** + * @return Lot number of the vaccine product. + */ + public String getLotNumber() { + return this.lotNumber == null ? null : this.lotNumber.getValue(); + } + + /** + * @param value Lot number of the vaccine product. + */ + public Immunization setLotNumber(String value) { + if (Utilities.noString(value)) + this.lotNumber = null; + else { + if (this.lotNumber == null) + this.lotNumber = new StringType(); + this.lotNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public DateType getExpirationDateElement() { + if (this.expirationDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.expirationDate"); + else if (Configuration.doAutoCreate()) + this.expirationDate = new DateType(); // bb + return this.expirationDate; + } + + public boolean hasExpirationDateElement() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + public boolean hasExpirationDate() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + /** + * @param value {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public Immunization setExpirationDateElement(DateType value) { + this.expirationDate = value; + return this; + } + + /** + * @return Date vaccine batch expires. + */ + public Date getExpirationDate() { + return this.expirationDate == null ? null : this.expirationDate.getValue(); + } + + /** + * @param value Date vaccine batch expires. + */ + public Immunization setExpirationDate(Date value) { + if (value == null) + this.expirationDate = null; + else { + if (this.expirationDate == null) + this.expirationDate = new DateType(); + this.expirationDate.setValue(value); + } + return this; + } + + /** + * @return {@link #site} (Body site where vaccine was administered.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); // cc + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Body site where vaccine was administered.) + */ + public Immunization setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (The path by which the vaccine product is taken into the body.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (The path by which the vaccine product is taken into the body.) + */ + public Immunization setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #doseQuantity} (The quantity of vaccine product that was administered.) + */ + public SimpleQuantity getDoseQuantity() { + if (this.doseQuantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.doseQuantity"); + else if (Configuration.doAutoCreate()) + this.doseQuantity = new SimpleQuantity(); // cc + return this.doseQuantity; + } + + public boolean hasDoseQuantity() { + return this.doseQuantity != null && !this.doseQuantity.isEmpty(); + } + + /** + * @param value {@link #doseQuantity} (The quantity of vaccine product that was administered.) + */ + public Immunization setDoseQuantity(SimpleQuantity value) { + this.doseQuantity = value; + return this; + } + + /** + * @return {@link #note} (Extra information about the immunization that is not conveyed by the other attributes.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Extra information about the immunization that is not conveyed by the other attributes.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public Immunization addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #explanation} (Reasons why a vaccine was or was not administered.) + */ + public ImmunizationExplanationComponent getExplanation() { + if (this.explanation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.explanation"); + else if (Configuration.doAutoCreate()) + this.explanation = new ImmunizationExplanationComponent(); // cc + return this.explanation; + } + + public boolean hasExplanation() { + return this.explanation != null && !this.explanation.isEmpty(); + } + + /** + * @param value {@link #explanation} (Reasons why a vaccine was or was not administered.) + */ + public Immunization setExplanation(ImmunizationExplanationComponent value) { + this.explanation = value; + return this; + } + + /** + * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) + */ + public List getReaction() { + if (this.reaction == null) + this.reaction = new ArrayList(); + return this.reaction; + } + + public boolean hasReaction() { + if (this.reaction == null) + return false; + for (ImmunizationReactionComponent item : this.reaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) + */ + // syntactic sugar + public ImmunizationReactionComponent addReaction() { //3 + ImmunizationReactionComponent t = new ImmunizationReactionComponent(); + if (this.reaction == null) + this.reaction = new ArrayList(); + this.reaction.add(t); + return t; + } + + // syntactic sugar + public Immunization addReaction(ImmunizationReactionComponent t) { //3 + if (t == null) + return this; + if (this.reaction == null) + this.reaction = new ArrayList(); + this.reaction.add(t); + return this; + } + + /** + * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) + */ + public List getVaccinationProtocol() { + if (this.vaccinationProtocol == null) + this.vaccinationProtocol = new ArrayList(); + return this.vaccinationProtocol; + } + + public boolean hasVaccinationProtocol() { + if (this.vaccinationProtocol == null) + return false; + for (ImmunizationVaccinationProtocolComponent item : this.vaccinationProtocol) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) + */ + // syntactic sugar + public ImmunizationVaccinationProtocolComponent addVaccinationProtocol() { //3 + ImmunizationVaccinationProtocolComponent t = new ImmunizationVaccinationProtocolComponent(); + if (this.vaccinationProtocol == null) + this.vaccinationProtocol = new ArrayList(); + this.vaccinationProtocol.add(t); + return t; + } + + // syntactic sugar + public Immunization addVaccinationProtocol(ImmunizationVaccinationProtocolComponent t) { //3 + if (t == null) + return this; + if (this.vaccinationProtocol == null) + this.vaccinationProtocol = new ArrayList(); + this.vaccinationProtocol.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this immunization record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Indicates the current status of the vaccination event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("date", "dateTime", "Date vaccine administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("vaccineCode", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, vaccineCode)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient who either received or did not receive the immunization.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("wasNotGiven", "boolean", "Indicates if the vaccination was or was not given.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); + childrenList.add(new Property("reported", "boolean", "True if this administration was reported rather than directly administered.", 0, java.lang.Integer.MAX_VALUE, reported)); + childrenList.add(new Property("performer", "Reference(Practitioner)", "Clinician who administered the vaccine.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("requester", "Reference(Practitioner)", "Clinician who ordered the vaccination.", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission or other contact between patient and health care provider the immunization was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("manufacturer", "Reference(Organization)", "Name of vaccine manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("location", "Reference(Location)", "The service delivery location where the vaccine administration occurred.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("lotNumber", "string", "Lot number of the vaccine product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); + childrenList.add(new Property("expirationDate", "date", "Date vaccine batch expires.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); + childrenList.add(new Property("site", "CodeableConcept", "Body site where vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "The path by which the vaccine product is taken into the body.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("doseQuantity", "SimpleQuantity", "The quantity of vaccine product that was administered.", 0, java.lang.Integer.MAX_VALUE, doseQuantity)); + childrenList.add(new Property("note", "Annotation", "Extra information about the immunization that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("explanation", "", "Reasons why a vaccine was or was not administered.", 0, java.lang.Integer.MAX_VALUE, explanation)); + childrenList.add(new Property("reaction", "", "Categorical data indicating that an adverse event is associated in time to an immunization.", 0, java.lang.Integer.MAX_VALUE, reaction)); + childrenList.add(new Property("vaccinationProtocol", "", "Contains information about the protocol(s) under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, vaccinationProtocol)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 664556354: /*vaccineCode*/ return this.vaccineCode == null ? new Base[0] : new Base[] {this.vaccineCode}; // CodeableConcept + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1050911117: /*wasNotGiven*/ return this.wasNotGiven == null ? new Base[0] : new Base[] {this.wasNotGiven}; // BooleanType + case -427039533: /*reported*/ return this.reported == null ? new Base[0] : new Base[] {this.reported}; // BooleanType + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference + case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // Reference + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference + case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType + case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateType + case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // CodeableConcept + case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept + case -2083618872: /*doseQuantity*/ return this.doseQuantity == null ? new Base[0] : new Base[] {this.doseQuantity}; // SimpleQuantity + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case -1105867239: /*explanation*/ return this.explanation == null ? new Base[0] : new Base[] {this.explanation}; // ImmunizationExplanationComponent + case -867509719: /*reaction*/ return this.reaction == null ? new Base[0] : this.reaction.toArray(new Base[this.reaction.size()]); // ImmunizationReactionComponent + case -179633155: /*vaccinationProtocol*/ return this.vaccinationProtocol == null ? new Base[0] : this.vaccinationProtocol.toArray(new Base[this.vaccinationProtocol.size()]); // ImmunizationVaccinationProtocolComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = castToCode(value); // CodeType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 664556354: // vaccineCode + this.vaccineCode = castToCodeableConcept(value); // CodeableConcept + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1050911117: // wasNotGiven + this.wasNotGiven = castToBoolean(value); // BooleanType + break; + case -427039533: // reported + this.reported = castToBoolean(value); // BooleanType + break; + case 481140686: // performer + this.performer = castToReference(value); // Reference + break; + case 693933948: // requester + this.requester = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -1969347631: // manufacturer + this.manufacturer = castToReference(value); // Reference + break; + case 1901043637: // location + this.location = castToReference(value); // Reference + break; + case 462547450: // lotNumber + this.lotNumber = castToString(value); // StringType + break; + case -668811523: // expirationDate + this.expirationDate = castToDate(value); // DateType + break; + case 3530567: // site + this.site = castToCodeableConcept(value); // CodeableConcept + break; + case 108704329: // route + this.route = castToCodeableConcept(value); // CodeableConcept + break; + case -2083618872: // doseQuantity + this.doseQuantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case -1105867239: // explanation + this.explanation = (ImmunizationExplanationComponent) value; // ImmunizationExplanationComponent + break; + case -867509719: // reaction + this.getReaction().add((ImmunizationReactionComponent) value); // ImmunizationReactionComponent + break; + case -179633155: // vaccinationProtocol + this.getVaccinationProtocol().add((ImmunizationVaccinationProtocolComponent) value); // ImmunizationVaccinationProtocolComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = castToCode(value); // CodeType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("vaccineCode")) + this.vaccineCode = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("wasNotGiven")) + this.wasNotGiven = castToBoolean(value); // BooleanType + else if (name.equals("reported")) + this.reported = castToBoolean(value); // BooleanType + else if (name.equals("performer")) + this.performer = castToReference(value); // Reference + else if (name.equals("requester")) + this.requester = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("manufacturer")) + this.manufacturer = castToReference(value); // Reference + else if (name.equals("location")) + this.location = castToReference(value); // Reference + else if (name.equals("lotNumber")) + this.lotNumber = castToString(value); // StringType + else if (name.equals("expirationDate")) + this.expirationDate = castToDate(value); // DateType + else if (name.equals("site")) + this.site = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("route")) + this.route = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("doseQuantity")) + this.doseQuantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("explanation")) + this.explanation = (ImmunizationExplanationComponent) value; // ImmunizationExplanationComponent + else if (name.equals("reaction")) + this.getReaction().add((ImmunizationReactionComponent) value); + else if (name.equals("vaccinationProtocol")) + this.getVaccinationProtocol().add((ImmunizationVaccinationProtocolComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // CodeType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 664556354: return getVaccineCode(); // CodeableConcept + case -791418107: return getPatient(); // Reference + case -1050911117: throw new FHIRException("Cannot make property wasNotGiven as it is not a complex type"); // BooleanType + case -427039533: throw new FHIRException("Cannot make property reported as it is not a complex type"); // BooleanType + case 481140686: return getPerformer(); // Reference + case 693933948: return getRequester(); // Reference + case 1524132147: return getEncounter(); // Reference + case -1969347631: return getManufacturer(); // Reference + case 1901043637: return getLocation(); // Reference + case 462547450: throw new FHIRException("Cannot make property lotNumber as it is not a complex type"); // StringType + case -668811523: throw new FHIRException("Cannot make property expirationDate as it is not a complex type"); // DateType + case 3530567: return getSite(); // CodeableConcept + case 108704329: return getRoute(); // CodeableConcept + case -2083618872: return getDoseQuantity(); // SimpleQuantity + case 3387378: return addNote(); // Annotation + case -1105867239: return getExplanation(); // ImmunizationExplanationComponent + case -867509719: return addReaction(); // ImmunizationReactionComponent + case -179633155: return addVaccinationProtocol(); // ImmunizationVaccinationProtocolComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.status"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.date"); + } + else if (name.equals("vaccineCode")) { + this.vaccineCode = new CodeableConcept(); + return this.vaccineCode; + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("wasNotGiven")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.wasNotGiven"); + } + else if (name.equals("reported")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.reported"); + } + else if (name.equals("performer")) { + this.performer = new Reference(); + return this.performer; + } + else if (name.equals("requester")) { + this.requester = new Reference(); + return this.requester; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("manufacturer")) { + this.manufacturer = new Reference(); + return this.manufacturer; + } + else if (name.equals("location")) { + this.location = new Reference(); + return this.location; + } + else if (name.equals("lotNumber")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.lotNumber"); + } + else if (name.equals("expirationDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.expirationDate"); + } + else if (name.equals("site")) { + this.site = new CodeableConcept(); + return this.site; + } + else if (name.equals("route")) { + this.route = new CodeableConcept(); + return this.route; + } + else if (name.equals("doseQuantity")) { + this.doseQuantity = new SimpleQuantity(); + return this.doseQuantity; + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("explanation")) { + this.explanation = new ImmunizationExplanationComponent(); + return this.explanation; + } + else if (name.equals("reaction")) { + return addReaction(); + } + else if (name.equals("vaccinationProtocol")) { + return addVaccinationProtocol(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Immunization"; + + } + + public Immunization copy() { + Immunization dst = new Immunization(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.vaccineCode = vaccineCode == null ? null : vaccineCode.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); + dst.reported = reported == null ? null : reported.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.requester = requester == null ? null : requester.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.location = location == null ? null : location.copy(); + dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); + dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + dst.explanation = explanation == null ? null : explanation.copy(); + if (reaction != null) { + dst.reaction = new ArrayList(); + for (ImmunizationReactionComponent i : reaction) + dst.reaction.add(i.copy()); + }; + if (vaccinationProtocol != null) { + dst.vaccinationProtocol = new ArrayList(); + for (ImmunizationVaccinationProtocolComponent i : vaccinationProtocol) + dst.vaccinationProtocol.add(i.copy()); + }; + return dst; + } + + protected Immunization typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Immunization)) + return false; + Immunization o = (Immunization) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) + && compareDeep(vaccineCode, o.vaccineCode, true) && compareDeep(patient, o.patient, true) && compareDeep(wasNotGiven, o.wasNotGiven, true) + && compareDeep(reported, o.reported, true) && compareDeep(performer, o.performer, true) && compareDeep(requester, o.requester, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(manufacturer, o.manufacturer, true) + && compareDeep(location, o.location, true) && compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true) + && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) && compareDeep(doseQuantity, o.doseQuantity, true) + && compareDeep(note, o.note, true) && compareDeep(explanation, o.explanation, true) && compareDeep(reaction, o.reaction, true) + && compareDeep(vaccinationProtocol, o.vaccinationProtocol, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Immunization)) + return false; + Immunization o = (Immunization) other; + return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(wasNotGiven, o.wasNotGiven, true) + && compareValues(reported, o.reported, true) && compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (date == null || date.isEmpty()) && (vaccineCode == null || vaccineCode.isEmpty()) && (patient == null || patient.isEmpty()) + && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reported == null || reported.isEmpty()) + && (performer == null || performer.isEmpty()) && (requester == null || requester.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) + && (location == null || location.isEmpty()) && (lotNumber == null || lotNumber.isEmpty()) + && (expirationDate == null || expirationDate.isEmpty()) && (site == null || site.isEmpty()) + && (route == null || route.isEmpty()) && (doseQuantity == null || doseQuantity.isEmpty()) + && (note == null || note.isEmpty()) && (explanation == null || explanation.isEmpty()) && (reaction == null || reaction.isEmpty()) + && (vaccinationProtocol == null || vaccinationProtocol.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Immunization; + } + + /** + * Search parameter: reaction + *

+ * Description: Additional information on reaction
+ * Type: reference
+ * Path: Immunization.reaction.detail
+ *

+ */ + @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference" ) + public static final String SP_REACTION = "reaction"; + /** + * Fluent Client search parameter constant for reaction + *

+ * Description: Additional information on reaction
+ * Type: reference
+ * Path: Immunization.reaction.detail
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REACTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REACTION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Immunization:reaction". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REACTION = new ca.uhn.fhir.model.api.Include("Immunization:reaction").toLocked(); + + /** + * Search parameter: requester + *

+ * Description: The practitioner who ordered the vaccination
+ * Type: reference
+ * Path: Immunization.requester
+ *

+ */ + @SearchParamDefinition(name="requester", path="Immunization.requester", description="The practitioner who ordered the vaccination", type="reference" ) + public static final String SP_REQUESTER = "requester"; + /** + * Fluent Client search parameter constant for requester + *

+ * Description: The practitioner who ordered the vaccination
+ * Type: reference
+ * Path: Immunization.requester
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Immunization:requester". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("Immunization:requester").toLocked(); + + /** + * Search parameter: dose-sequence + *

+ * Description: Dose number within series
+ * Type: number
+ * Path: Immunization.vaccinationProtocol.doseSequence
+ *

+ */ + @SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="Dose number within series", type="number" ) + public static final String SP_DOSE_SEQUENCE = "dose-sequence"; + /** + * Fluent Client search parameter constant for dose-sequence + *

+ * Description: Dose number within series
+ * Type: number
+ * Path: Immunization.vaccinationProtocol.doseSequence
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.NumberClientParam DOSE_SEQUENCE = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_DOSE_SEQUENCE); + + /** + * Search parameter: status + *

+ * Description: Immunization event status
+ * Type: token
+ * Path: Immunization.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Immunization.status", description="Immunization event status", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Immunization event status
+ * Type: token
+ * Path: Immunization.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: location + *

+ * Description: The service delivery location or facility in which the vaccine was / was to be administered
+ * Type: reference
+ * Path: Immunization.location
+ *

+ */ + @SearchParamDefinition(name="location", path="Immunization.location", description="The service delivery location or facility in which the vaccine was / was to be administered", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: The service delivery location or facility in which the vaccine was / was to be administered
+ * Type: reference
+ * Path: Immunization.location
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Immunization:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Immunization:location").toLocked(); + + /** + * Search parameter: reason + *

+ * Description: Why immunization occurred
+ * Type: token
+ * Path: Immunization.explanation.reason
+ *

+ */ + @SearchParamDefinition(name="reason", path="Immunization.explanation.reason", description="Why immunization occurred", type="token" ) + public static final String SP_REASON = "reason"; + /** + * Fluent Client search parameter constant for reason + *

+ * Description: Why immunization occurred
+ * Type: token
+ * Path: Immunization.explanation.reason
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON); + + /** + * Search parameter: reaction-date + *

+ * Description: When reaction started
+ * Type: date
+ * Path: Immunization.reaction.date
+ *

+ */ + @SearchParamDefinition(name="reaction-date", path="Immunization.reaction.date", description="When reaction started", type="date" ) + public static final String SP_REACTION_DATE = "reaction-date"; + /** + * Fluent Client search parameter constant for reaction-date + *

+ * Description: When reaction started
+ * Type: date
+ * Path: Immunization.reaction.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam REACTION_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_REACTION_DATE); + + /** + * Search parameter: notgiven + *

+ * Description: Administrations which were not given
+ * Type: token
+ * Path: Immunization.wasNotGiven
+ *

+ */ + @SearchParamDefinition(name="notgiven", path="Immunization.wasNotGiven", description="Administrations which were not given", type="token" ) + public static final String SP_NOTGIVEN = "notgiven"; + /** + * Fluent Client search parameter constant for notgiven + *

+ * Description: Administrations which were not given
+ * Type: token
+ * Path: Immunization.wasNotGiven
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam NOTGIVEN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NOTGIVEN); + + /** + * Search parameter: date + *

+ * Description: Vaccination (non)-Administration Date
+ * Type: date
+ * Path: Immunization.date
+ *

+ */ + @SearchParamDefinition(name="date", path="Immunization.date", description="Vaccination (non)-Administration Date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Vaccination (non)-Administration Date
+ * Type: date
+ * Path: Immunization.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: reason-not-given + *

+ * Description: Explanation of reason vaccination was not administered
+ * Type: token
+ * Path: Immunization.explanation.reasonNotGiven
+ *

+ */ + @SearchParamDefinition(name="reason-not-given", path="Immunization.explanation.reasonNotGiven", description="Explanation of reason vaccination was not administered", type="token" ) + public static final String SP_REASON_NOT_GIVEN = "reason-not-given"; + /** + * Fluent Client search parameter constant for reason-not-given + *

+ * Description: Explanation of reason vaccination was not administered
+ * Type: token
+ * Path: Immunization.explanation.reasonNotGiven
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_NOT_GIVEN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON_NOT_GIVEN); + + /** + * Search parameter: vaccine-code + *

+ * Description: Vaccine Product Administered
+ * Type: token
+ * Path: Immunization.vaccineCode
+ *

+ */ + @SearchParamDefinition(name="vaccine-code", path="Immunization.vaccineCode", description="Vaccine Product Administered", type="token" ) + public static final String SP_VACCINE_CODE = "vaccine-code"; + /** + * Fluent Client search parameter constant for vaccine-code + *

+ * Description: Vaccine Product Administered
+ * Type: token
+ * Path: Immunization.vaccineCode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VACCINE_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VACCINE_CODE); + + /** + * Search parameter: patient + *

+ * Description: The patient for the vaccination record
+ * Type: reference
+ * Path: Immunization.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="Immunization.patient", description="The patient for the vaccination record", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The patient for the vaccination record
+ * Type: reference
+ * Path: Immunization.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Immunization:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Immunization:patient").toLocked(); + + /** + * Search parameter: lot-number + *

+ * Description: Vaccine Lot Number
+ * Type: string
+ * Path: Immunization.lotNumber
+ *

+ */ + @SearchParamDefinition(name="lot-number", path="Immunization.lotNumber", description="Vaccine Lot Number", type="string" ) + public static final String SP_LOT_NUMBER = "lot-number"; + /** + * Fluent Client search parameter constant for lot-number + *

+ * Description: Vaccine Lot Number
+ * Type: string
+ * Path: Immunization.lotNumber
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam LOT_NUMBER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_LOT_NUMBER); + + /** + * Search parameter: manufacturer + *

+ * Description: Vaccine Manufacturer
+ * Type: reference
+ * Path: Immunization.manufacturer
+ *

+ */ + @SearchParamDefinition(name="manufacturer", path="Immunization.manufacturer", description="Vaccine Manufacturer", type="reference" ) + public static final String SP_MANUFACTURER = "manufacturer"; + /** + * Fluent Client search parameter constant for manufacturer + *

+ * Description: Vaccine Manufacturer
+ * Type: reference
+ * Path: Immunization.manufacturer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANUFACTURER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Immunization:manufacturer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_MANUFACTURER = new ca.uhn.fhir.model.api.Include("Immunization:manufacturer").toLocked(); + + /** + * Search parameter: performer + *

+ * Description: The practitioner who administered the vaccination
+ * Type: reference
+ * Path: Immunization.performer
+ *

+ */ + @SearchParamDefinition(name="performer", path="Immunization.performer", description="The practitioner who administered the vaccination", type="reference" ) + public static final String SP_PERFORMER = "performer"; + /** + * Fluent Client search parameter constant for performer + *

+ * Description: The practitioner who administered the vaccination
+ * Type: reference
+ * Path: Immunization.performer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Immunization:performer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Immunization:performer").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Business identifier
+ * Type: token
+ * Path: Immunization.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Immunization.identifier", description="Business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Business identifier
+ * Type: token
+ * Path: Immunization.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImmunizationRecommendation.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImmunizationRecommendation.java new file mode 100644 index 00000000000..0dc07500a24 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImmunizationRecommendation.java @@ -0,0 +1,1710 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. + */ +@ResourceDef(name="ImmunizationRecommendation", profile="http://hl7.org/fhir/Profile/ImmunizationRecommendation") +public class ImmunizationRecommendation extends DomainResource { + + @Block() + public static class ImmunizationRecommendationRecommendationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The date the immunization recommendation was created. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date recommendation created", formalDefinition="The date the immunization recommendation was created." ) + protected DateTimeType date; + + /** + * Vaccine that pertains to the recommendation. + */ + @Child(name = "vaccineCode", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Vaccine recommendation applies to", formalDefinition="Vaccine that pertains to the recommendation." ) + protected CodeableConcept vaccineCode; + + /** + * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + @Child(name = "doseNumber", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Recommended dose number", formalDefinition="This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose)." ) + protected PositiveIntType doseNumber; + + /** + * Vaccine administration status. + */ + @Child(name = "forecastStatus", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Vaccine administration status", formalDefinition="Vaccine administration status." ) + protected CodeableConcept forecastStatus; + + /** + * Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. + */ + @Child(name = "dateCriterion", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Dates governing proposed immunization", formalDefinition="Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc." ) + protected List dateCriterion; + + /** + * Contains information about the protocol under which the vaccine was administered. + */ + @Child(name = "protocol", type = {}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Protocol used by recommendation", formalDefinition="Contains information about the protocol under which the vaccine was administered." ) + protected ImmunizationRecommendationRecommendationProtocolComponent protocol; + + /** + * Immunization event history that supports the status and recommendation. + */ + @Child(name = "supportingImmunization", type = {Immunization.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Past immunizations supporting recommendation", formalDefinition="Immunization event history that supports the status and recommendation." ) + protected List supportingImmunization; + /** + * The actual objects that are the target of the reference (Immunization event history that supports the status and recommendation.) + */ + protected List supportingImmunizationTarget; + + + /** + * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. + */ + @Child(name = "supportingPatientInformation", type = {Observation.class, AllergyIntolerance.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Patient observations supporting recommendation", formalDefinition="Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information." ) + protected List supportingPatientInformation; + /** + * The actual objects that are the target of the reference (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + protected List supportingPatientInformationTarget; + + + private static final long serialVersionUID = 1501347482L; + + /** + * Constructor + */ + public ImmunizationRecommendationRecommendationComponent() { + super(); + } + + /** + * Constructor + */ + public ImmunizationRecommendationRecommendationComponent(DateTimeType date, CodeableConcept vaccineCode, CodeableConcept forecastStatus) { + super(); + this.date = date; + this.vaccineCode = vaccineCode; + this.forecastStatus = forecastStatus; + } + + /** + * @return {@link #date} (The date the immunization recommendation was created.). 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 ImmunizationRecommendationRecommendationComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date the immunization recommendation was created. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date the immunization recommendation was created. + */ + public ImmunizationRecommendationRecommendationComponent setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #vaccineCode} (Vaccine that pertains to the recommendation.) + */ + public CodeableConcept getVaccineCode() { + if (this.vaccineCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.vaccineCode"); + else if (Configuration.doAutoCreate()) + this.vaccineCode = new CodeableConcept(); // cc + return this.vaccineCode; + } + + public boolean hasVaccineCode() { + return this.vaccineCode != null && !this.vaccineCode.isEmpty(); + } + + /** + * @param value {@link #vaccineCode} (Vaccine that pertains to the recommendation.) + */ + public ImmunizationRecommendationRecommendationComponent setVaccineCode(CodeableConcept value) { + this.vaccineCode = value; + return this; + } + + /** + * @return {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value + */ + public PositiveIntType getDoseNumberElement() { + if (this.doseNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.doseNumber"); + else if (Configuration.doAutoCreate()) + this.doseNumber = new PositiveIntType(); // bb + return this.doseNumber; + } + + public boolean hasDoseNumberElement() { + return this.doseNumber != null && !this.doseNumber.isEmpty(); + } + + public boolean hasDoseNumber() { + return this.doseNumber != null && !this.doseNumber.isEmpty(); + } + + /** + * @param value {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationComponent setDoseNumberElement(PositiveIntType value) { + this.doseNumber = value; + return this; + } + + /** + * @return This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + public int getDoseNumber() { + return this.doseNumber == null || this.doseNumber.isEmpty() ? 0 : this.doseNumber.getValue(); + } + + /** + * @param value This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + public ImmunizationRecommendationRecommendationComponent setDoseNumber(int value) { + if (this.doseNumber == null) + this.doseNumber = new PositiveIntType(); + this.doseNumber.setValue(value); + return this; + } + + /** + * @return {@link #forecastStatus} (Vaccine administration status.) + */ + public CodeableConcept getForecastStatus() { + if (this.forecastStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.forecastStatus"); + else if (Configuration.doAutoCreate()) + this.forecastStatus = new CodeableConcept(); // cc + return this.forecastStatus; + } + + public boolean hasForecastStatus() { + return this.forecastStatus != null && !this.forecastStatus.isEmpty(); + } + + /** + * @param value {@link #forecastStatus} (Vaccine administration status.) + */ + public ImmunizationRecommendationRecommendationComponent setForecastStatus(CodeableConcept value) { + this.forecastStatus = value; + return this; + } + + /** + * @return {@link #dateCriterion} (Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc.) + */ + public List getDateCriterion() { + if (this.dateCriterion == null) + this.dateCriterion = new ArrayList(); + return this.dateCriterion; + } + + public boolean hasDateCriterion() { + if (this.dateCriterion == null) + return false; + for (ImmunizationRecommendationRecommendationDateCriterionComponent item : this.dateCriterion) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dateCriterion} (Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc.) + */ + // syntactic sugar + public ImmunizationRecommendationRecommendationDateCriterionComponent addDateCriterion() { //3 + ImmunizationRecommendationRecommendationDateCriterionComponent t = new ImmunizationRecommendationRecommendationDateCriterionComponent(); + if (this.dateCriterion == null) + this.dateCriterion = new ArrayList(); + this.dateCriterion.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addDateCriterion(ImmunizationRecommendationRecommendationDateCriterionComponent t) { //3 + if (t == null) + return this; + if (this.dateCriterion == null) + this.dateCriterion = new ArrayList(); + this.dateCriterion.add(t); + return this; + } + + /** + * @return {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent getProtocol() { + if (this.protocol == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.protocol"); + else if (Configuration.doAutoCreate()) + this.protocol = new ImmunizationRecommendationRecommendationProtocolComponent(); // cc + return this.protocol; + } + + public boolean hasProtocol() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + /** + * @param value {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) + */ + public ImmunizationRecommendationRecommendationComponent setProtocol(ImmunizationRecommendationRecommendationProtocolComponent value) { + this.protocol = value; + return this; + } + + /** + * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) + */ + public List getSupportingImmunization() { + if (this.supportingImmunization == null) + this.supportingImmunization = new ArrayList(); + return this.supportingImmunization; + } + + public boolean hasSupportingImmunization() { + if (this.supportingImmunization == null) + return false; + for (Reference item : this.supportingImmunization) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) + */ + // syntactic sugar + public Reference addSupportingImmunization() { //3 + Reference t = new Reference(); + if (this.supportingImmunization == null) + this.supportingImmunization = new ArrayList(); + this.supportingImmunization.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addSupportingImmunization(Reference t) { //3 + if (t == null) + return this; + if (this.supportingImmunization == null) + this.supportingImmunization = new ArrayList(); + this.supportingImmunization.add(t); + return this; + } + + /** + * @return {@link #supportingImmunization} (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. Immunization event history that supports the status and recommendation.) + */ + public List getSupportingImmunizationTarget() { + if (this.supportingImmunizationTarget == null) + this.supportingImmunizationTarget = new ArrayList(); + return this.supportingImmunizationTarget; + } + + // syntactic sugar + /** + * @return {@link #supportingImmunization} (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. Immunization event history that supports the status and recommendation.) + */ + public Immunization addSupportingImmunizationTarget() { + Immunization r = new Immunization(); + if (this.supportingImmunizationTarget == null) + this.supportingImmunizationTarget = new ArrayList(); + this.supportingImmunizationTarget.add(r); + return r; + } + + /** + * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + public List getSupportingPatientInformation() { + if (this.supportingPatientInformation == null) + this.supportingPatientInformation = new ArrayList(); + return this.supportingPatientInformation; + } + + public boolean hasSupportingPatientInformation() { + if (this.supportingPatientInformation == null) + return false; + for (Reference item : this.supportingPatientInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + // syntactic sugar + public Reference addSupportingPatientInformation() { //3 + Reference t = new Reference(); + if (this.supportingPatientInformation == null) + this.supportingPatientInformation = new ArrayList(); + this.supportingPatientInformation.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addSupportingPatientInformation(Reference t) { //3 + if (t == null) + return this; + if (this.supportingPatientInformation == null) + this.supportingPatientInformation = new ArrayList(); + this.supportingPatientInformation.add(t); + return this; + } + + /** + * @return {@link #supportingPatientInformation} (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. Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + public List getSupportingPatientInformationTarget() { + if (this.supportingPatientInformationTarget == null) + this.supportingPatientInformationTarget = new ArrayList(); + return this.supportingPatientInformationTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("date", "dateTime", "The date the immunization recommendation was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("vaccineCode", "CodeableConcept", "Vaccine that pertains to the recommendation.", 0, java.lang.Integer.MAX_VALUE, vaccineCode)); + childrenList.add(new Property("doseNumber", "positiveInt", "This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).", 0, java.lang.Integer.MAX_VALUE, doseNumber)); + childrenList.add(new Property("forecastStatus", "CodeableConcept", "Vaccine administration status.", 0, java.lang.Integer.MAX_VALUE, forecastStatus)); + childrenList.add(new Property("dateCriterion", "", "Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc.", 0, java.lang.Integer.MAX_VALUE, dateCriterion)); + childrenList.add(new Property("protocol", "", "Contains information about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("supportingImmunization", "Reference(Immunization)", "Immunization event history that supports the status and recommendation.", 0, java.lang.Integer.MAX_VALUE, supportingImmunization)); + childrenList.add(new Property("supportingPatientInformation", "Reference(Observation|AllergyIntolerance)", "Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.", 0, java.lang.Integer.MAX_VALUE, supportingPatientInformation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 664556354: /*vaccineCode*/ return this.vaccineCode == null ? new Base[0] : new Base[] {this.vaccineCode}; // CodeableConcept + case -887709242: /*doseNumber*/ return this.doseNumber == null ? new Base[0] : new Base[] {this.doseNumber}; // PositiveIntType + case 1904598477: /*forecastStatus*/ return this.forecastStatus == null ? new Base[0] : new Base[] {this.forecastStatus}; // CodeableConcept + case 2087518867: /*dateCriterion*/ return this.dateCriterion == null ? new Base[0] : this.dateCriterion.toArray(new Base[this.dateCriterion.size()]); // ImmunizationRecommendationRecommendationDateCriterionComponent + case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // ImmunizationRecommendationRecommendationProtocolComponent + case 1171592021: /*supportingImmunization*/ return this.supportingImmunization == null ? new Base[0] : this.supportingImmunization.toArray(new Base[this.supportingImmunization.size()]); // Reference + case -1234160646: /*supportingPatientInformation*/ return this.supportingPatientInformation == null ? new Base[0] : this.supportingPatientInformation.toArray(new Base[this.supportingPatientInformation.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 664556354: // vaccineCode + this.vaccineCode = castToCodeableConcept(value); // CodeableConcept + break; + case -887709242: // doseNumber + this.doseNumber = castToPositiveInt(value); // PositiveIntType + break; + case 1904598477: // forecastStatus + this.forecastStatus = castToCodeableConcept(value); // CodeableConcept + break; + case 2087518867: // dateCriterion + this.getDateCriterion().add((ImmunizationRecommendationRecommendationDateCriterionComponent) value); // ImmunizationRecommendationRecommendationDateCriterionComponent + break; + case -989163880: // protocol + this.protocol = (ImmunizationRecommendationRecommendationProtocolComponent) value; // ImmunizationRecommendationRecommendationProtocolComponent + break; + case 1171592021: // supportingImmunization + this.getSupportingImmunization().add(castToReference(value)); // Reference + break; + case -1234160646: // supportingPatientInformation + this.getSupportingPatientInformation().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("vaccineCode")) + this.vaccineCode = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("doseNumber")) + this.doseNumber = castToPositiveInt(value); // PositiveIntType + else if (name.equals("forecastStatus")) + this.forecastStatus = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("dateCriterion")) + this.getDateCriterion().add((ImmunizationRecommendationRecommendationDateCriterionComponent) value); + else if (name.equals("protocol")) + this.protocol = (ImmunizationRecommendationRecommendationProtocolComponent) value; // ImmunizationRecommendationRecommendationProtocolComponent + else if (name.equals("supportingImmunization")) + this.getSupportingImmunization().add(castToReference(value)); + else if (name.equals("supportingPatientInformation")) + this.getSupportingPatientInformation().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 664556354: return getVaccineCode(); // CodeableConcept + case -887709242: throw new FHIRException("Cannot make property doseNumber as it is not a complex type"); // PositiveIntType + case 1904598477: return getForecastStatus(); // CodeableConcept + case 2087518867: return addDateCriterion(); // ImmunizationRecommendationRecommendationDateCriterionComponent + case -989163880: return getProtocol(); // ImmunizationRecommendationRecommendationProtocolComponent + case 1171592021: return addSupportingImmunization(); // Reference + case -1234160646: return addSupportingPatientInformation(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.date"); + } + else if (name.equals("vaccineCode")) { + this.vaccineCode = new CodeableConcept(); + return this.vaccineCode; + } + else if (name.equals("doseNumber")) { + throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.doseNumber"); + } + else if (name.equals("forecastStatus")) { + this.forecastStatus = new CodeableConcept(); + return this.forecastStatus; + } + else if (name.equals("dateCriterion")) { + return addDateCriterion(); + } + else if (name.equals("protocol")) { + this.protocol = new ImmunizationRecommendationRecommendationProtocolComponent(); + return this.protocol; + } + else if (name.equals("supportingImmunization")) { + return addSupportingImmunization(); + } + else if (name.equals("supportingPatientInformation")) { + return addSupportingPatientInformation(); + } + else + return super.addChild(name); + } + + public ImmunizationRecommendationRecommendationComponent copy() { + ImmunizationRecommendationRecommendationComponent dst = new ImmunizationRecommendationRecommendationComponent(); + copyValues(dst); + dst.date = date == null ? null : date.copy(); + dst.vaccineCode = vaccineCode == null ? null : vaccineCode.copy(); + dst.doseNumber = doseNumber == null ? null : doseNumber.copy(); + dst.forecastStatus = forecastStatus == null ? null : forecastStatus.copy(); + if (dateCriterion != null) { + dst.dateCriterion = new ArrayList(); + for (ImmunizationRecommendationRecommendationDateCriterionComponent i : dateCriterion) + dst.dateCriterion.add(i.copy()); + }; + dst.protocol = protocol == null ? null : protocol.copy(); + if (supportingImmunization != null) { + dst.supportingImmunization = new ArrayList(); + for (Reference i : supportingImmunization) + dst.supportingImmunization.add(i.copy()); + }; + if (supportingPatientInformation != null) { + dst.supportingPatientInformation = new ArrayList(); + for (Reference i : supportingPatientInformation) + dst.supportingPatientInformation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationComponent)) + return false; + ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other; + return compareDeep(date, o.date, true) && compareDeep(vaccineCode, o.vaccineCode, true) && compareDeep(doseNumber, o.doseNumber, true) + && compareDeep(forecastStatus, o.forecastStatus, true) && compareDeep(dateCriterion, o.dateCriterion, true) + && compareDeep(protocol, o.protocol, true) && compareDeep(supportingImmunization, o.supportingImmunization, true) + && compareDeep(supportingPatientInformation, o.supportingPatientInformation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationComponent)) + return false; + ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other; + return compareValues(date, o.date, true) && compareValues(doseNumber, o.doseNumber, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (date == null || date.isEmpty()) && (vaccineCode == null || vaccineCode.isEmpty()) + && (doseNumber == null || doseNumber.isEmpty()) && (forecastStatus == null || forecastStatus.isEmpty()) + && (dateCriterion == null || dateCriterion.isEmpty()) && (protocol == null || protocol.isEmpty()) + && (supportingImmunization == null || supportingImmunization.isEmpty()) && (supportingPatientInformation == null || supportingPatientInformation.isEmpty()) + ; + } + + public String fhirType() { + return "ImmunizationRecommendation.recommendation"; + + } + + } + + @Block() + public static class ImmunizationRecommendationRecommendationDateCriterionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Date classification of recommendation. For example, earliest date to give, latest date to give, etc. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Type of date", formalDefinition="Date classification of recommendation. For example, earliest date to give, latest date to give, etc." ) + protected CodeableConcept code; + + /** + * The date whose meaning is specified by dateCriterion.code. + */ + @Child(name = "value", type = {DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Recommended date", formalDefinition="The date whose meaning is specified by dateCriterion.code." ) + protected DateTimeType value; + + private static final long serialVersionUID = 1036994566L; + + /** + * Constructor + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent() { + super(); + } + + /** + * Constructor + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent(CodeableConcept code, DateTimeType value) { + super(); + this.code = code; + this.value = value; + } + + /** + * @return {@link #code} (Date classification of recommendation. For example, earliest date to give, latest date to give, etc.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Date classification of recommendation. For example, earliest date to give, latest date to give, etc.) + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #value} (The date whose meaning is specified by dateCriterion.code.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DateTimeType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DateTimeType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The date whose meaning is specified by dateCriterion.code.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setValueElement(DateTimeType value) { + this.value = value; + return this; + } + + /** + * @return The date whose meaning is specified by dateCriterion.code. + */ + public Date getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The date whose meaning is specified by dateCriterion.code. + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) { + if (this.value == null) + this.value = new DateTimeType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Date classification of recommendation. For example, earliest date to give, latest date to give, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value", "dateTime", "The date whose meaning is specified by dateCriterion.code.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DateTimeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 111972721: // value + this.value = castToDateTime(value); // DateTimeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("value")) + this.value = castToDateTime(value); // DateTimeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DateTimeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.value"); + } + else + return super.addChild(name); + } + + public ImmunizationRecommendationRecommendationDateCriterionComponent copy() { + ImmunizationRecommendationRecommendationDateCriterionComponent dst = new ImmunizationRecommendationRecommendationDateCriterionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationDateCriterionComponent)) + return false; + ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other; + return compareDeep(code, o.code, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationDateCriterionComponent)) + return false; + ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other; + return compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "ImmunizationRecommendation.recommendation.dateCriterion"; + + } + + } + + @Block() + public static class ImmunizationRecommendationRecommendationProtocolComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + @Child(name = "doseSequence", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Dose number within sequence", formalDefinition="Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol." ) + protected IntegerType doseSequence; + + /** + * Contains the description about the protocol under which the vaccine was administered. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Protocol details", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) + protected StringType description; + + /** + * Indicates the authority who published the protocol. For example, ACIP. + */ + @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol. For example, ACIP." ) + protected Reference authority; + + /** + * The actual object that is the target of the reference (Indicates the authority who published the protocol. For example, ACIP.) + */ + protected Organization authorityTarget; + + /** + * One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + @Child(name = "series", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of vaccination series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) + protected StringType series; + + private static final long serialVersionUID = -512702014L; + + /** + * Constructor + */ + public ImmunizationRecommendationRecommendationProtocolComponent() { + super(); + } + + /** + * @return {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public IntegerType getDoseSequenceElement() { + if (this.doseSequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.doseSequence"); + else if (Configuration.doAutoCreate()) + this.doseSequence = new IntegerType(); // bb + return this.doseSequence; + } + + public boolean hasDoseSequenceElement() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + public boolean hasDoseSequence() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + /** + * @param value {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequenceElement(IntegerType value) { + this.doseSequence = value; + return this; + } + + /** + * @return Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + public int getDoseSequence() { + return this.doseSequence == null || this.doseSequence.isEmpty() ? 0 : this.doseSequence.getValue(); + } + + /** + * @param value Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequence(int value) { + if (this.doseSequence == null) + this.doseSequence = new IntegerType(); + this.doseSequence.setValue(value); + return this; + } + + /** + * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). 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 ImmunizationRecommendationRecommendationProtocolComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Contains the description about the protocol under which the vaccine was administered. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Contains the description about the protocol under which the vaccine was administered. + */ + public ImmunizationRecommendationRecommendationProtocolComponent 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 #authority} (Indicates the authority who published the protocol. For example, ACIP.) + */ + public Reference getAuthority() { + if (this.authority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authority = new Reference(); // cc + return this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (Indicates the authority who published the protocol. For example, ACIP.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent setAuthority(Reference value) { + this.authority = value; + return this; + } + + /** + * @return {@link #authority} 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. (Indicates the authority who published the protocol. For example, ACIP.) + */ + public Organization getAuthorityTarget() { + if (this.authorityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authorityTarget = new Organization(); // aa + return this.authorityTarget; + } + + /** + * @param value {@link #authority} 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. (Indicates the authority who published the protocol. For example, ACIP.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent setAuthorityTarget(Organization value) { + this.authorityTarget = value; + return this; + } + + /** + * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public StringType getSeriesElement() { + if (this.series == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.series"); + else if (Configuration.doAutoCreate()) + this.series = new StringType(); // bb + return this.series; + } + + public boolean hasSeriesElement() { + return this.series != null && !this.series.isEmpty(); + } + + public boolean hasSeries() { + return this.series != null && !this.series.isEmpty(); + } + + /** + * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setSeriesElement(StringType value) { + this.series = value; + return this; + } + + /** + * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public String getSeries() { + return this.series == null ? null : this.series.getValue(); + } + + /** + * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public ImmunizationRecommendationRecommendationProtocolComponent setSeries(String value) { + if (Utilities.noString(value)) + this.series = null; + else { + if (this.series == null) + this.series = new StringType(); + this.series.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("doseSequence", "integer", "Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); + childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol. For example, ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 550933246: /*doseSequence*/ return this.doseSequence == null ? new Base[0] : new Base[] {this.doseSequence}; // IntegerType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : new Base[] {this.authority}; // Reference + case -905838985: /*series*/ return this.series == null ? new Base[0] : new Base[] {this.series}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 550933246: // doseSequence + this.doseSequence = castToInteger(value); // IntegerType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 1475610435: // authority + this.authority = castToReference(value); // Reference + break; + case -905838985: // series + this.series = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("doseSequence")) + this.doseSequence = castToInteger(value); // IntegerType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("authority")) + this.authority = castToReference(value); // Reference + else if (name.equals("series")) + this.series = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 550933246: throw new FHIRException("Cannot make property doseSequence as it is not a complex type"); // IntegerType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 1475610435: return getAuthority(); // Reference + case -905838985: throw new FHIRException("Cannot make property series as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("doseSequence")) { + throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.doseSequence"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.description"); + } + else if (name.equals("authority")) { + this.authority = new Reference(); + return this.authority; + } + else if (name.equals("series")) { + throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.series"); + } + else + return super.addChild(name); + } + + public ImmunizationRecommendationRecommendationProtocolComponent copy() { + ImmunizationRecommendationRecommendationProtocolComponent dst = new ImmunizationRecommendationRecommendationProtocolComponent(); + copyValues(dst); + dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); + dst.description = description == null ? null : description.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.series = series == null ? null : series.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationProtocolComponent)) + return false; + ImmunizationRecommendationRecommendationProtocolComponent o = (ImmunizationRecommendationRecommendationProtocolComponent) other; + return compareDeep(doseSequence, o.doseSequence, true) && compareDeep(description, o.description, true) + && compareDeep(authority, o.authority, true) && compareDeep(series, o.series, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationRecommendationRecommendationProtocolComponent)) + return false; + ImmunizationRecommendationRecommendationProtocolComponent o = (ImmunizationRecommendationRecommendationProtocolComponent) other; + return compareValues(doseSequence, o.doseSequence, true) && compareValues(description, o.description, true) + && compareValues(series, o.series, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) + && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()); + } + + public String fhirType() { + return "ImmunizationRecommendation.recommendation.protocol"; + + } + + } + + /** + * A unique identifier assigned to this particular recommendation record. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this particular recommendation record." ) + protected List identifier; + + /** + * The patient for whom the recommendations are for. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who this profile is for", formalDefinition="The patient for whom the recommendations are for." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient for whom the recommendations are for.) + */ + protected Patient patientTarget; + + /** + * Vaccine administration recommendations. + */ + @Child(name = "recommendation", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Vaccine administration recommendations", formalDefinition="Vaccine administration recommendations." ) + protected List recommendation; + + private static final long serialVersionUID = 641058495L; + + /** + * Constructor + */ + public ImmunizationRecommendation() { + super(); + } + + /** + * Constructor + */ + public ImmunizationRecommendation(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) + */ + 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} (A unique identifier assigned to this particular recommendation record.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendation addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (The patient for whom the recommendations are for.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendation.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient for whom the recommendations are for.) + */ + public ImmunizationRecommendation 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 for whom the recommendations are for.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendation.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 for whom the recommendations are for.) + */ + public ImmunizationRecommendation setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #recommendation} (Vaccine administration recommendations.) + */ + public List getRecommendation() { + if (this.recommendation == null) + this.recommendation = new ArrayList(); + return this.recommendation; + } + + public boolean hasRecommendation() { + if (this.recommendation == null) + return false; + for (ImmunizationRecommendationRecommendationComponent item : this.recommendation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #recommendation} (Vaccine administration recommendations.) + */ + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addRecommendation() { //3 + ImmunizationRecommendationRecommendationComponent t = new ImmunizationRecommendationRecommendationComponent(); + if (this.recommendation == null) + this.recommendation = new ArrayList(); + this.recommendation.add(t); + return t; + } + + // syntactic sugar + public ImmunizationRecommendation addRecommendation(ImmunizationRecommendationRecommendationComponent t) { //3 + if (t == null) + return this; + if (this.recommendation == null) + this.recommendation = new ArrayList(); + this.recommendation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this particular recommendation record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient for whom the recommendations are for.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("recommendation", "", "Vaccine administration recommendations.", 0, java.lang.Integer.MAX_VALUE, recommendation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1028636743: /*recommendation*/ return this.recommendation == null ? new Base[0] : this.recommendation.toArray(new Base[this.recommendation.size()]); // ImmunizationRecommendationRecommendationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1028636743: // recommendation + this.getRecommendation().add((ImmunizationRecommendationRecommendationComponent) value); // ImmunizationRecommendationRecommendationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("recommendation")) + this.getRecommendation().add((ImmunizationRecommendationRecommendationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -791418107: return getPatient(); // Reference + case -1028636743: return addRecommendation(); // ImmunizationRecommendationRecommendationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("recommendation")) { + return addRecommendation(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ImmunizationRecommendation"; + + } + + public ImmunizationRecommendation copy() { + ImmunizationRecommendation dst = new ImmunizationRecommendation(); + 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 (recommendation != null) { + dst.recommendation = new ArrayList(); + for (ImmunizationRecommendationRecommendationComponent i : recommendation) + dst.recommendation.add(i.copy()); + }; + return dst; + } + + protected ImmunizationRecommendation typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImmunizationRecommendation)) + return false; + ImmunizationRecommendation o = (ImmunizationRecommendation) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(recommendation, o.recommendation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImmunizationRecommendation)) + return false; + ImmunizationRecommendation o = (ImmunizationRecommendation) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (recommendation == null || recommendation.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImmunizationRecommendation; + } + + /** + * Search parameter: information + *

+ * Description: Patient observations supporting recommendation
+ * Type: reference
+ * Path: ImmunizationRecommendation.recommendation.supportingPatientInformation
+ *

+ */ + @SearchParamDefinition(name="information", path="ImmunizationRecommendation.recommendation.supportingPatientInformation", description="Patient observations supporting recommendation", type="reference" ) + public static final String SP_INFORMATION = "information"; + /** + * Fluent Client search parameter constant for information + *

+ * Description: Patient observations supporting recommendation
+ * Type: reference
+ * Path: ImmunizationRecommendation.recommendation.supportingPatientInformation
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INFORMATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INFORMATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImmunizationRecommendation:information". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INFORMATION = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:information").toLocked(); + + /** + * Search parameter: dose-sequence + *

+ * Description: Dose number within sequence
+ * Type: number
+ * Path: ImmunizationRecommendation.recommendation.protocol.doseSequence
+ *

+ */ + @SearchParamDefinition(name="dose-sequence", path="ImmunizationRecommendation.recommendation.protocol.doseSequence", description="Dose number within sequence", type="number" ) + public static final String SP_DOSE_SEQUENCE = "dose-sequence"; + /** + * Fluent Client search parameter constant for dose-sequence + *

+ * Description: Dose number within sequence
+ * Type: number
+ * Path: ImmunizationRecommendation.recommendation.protocol.doseSequence
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.NumberClientParam DOSE_SEQUENCE = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_DOSE_SEQUENCE); + + /** + * Search parameter: patient + *

+ * Description: Who this profile is for
+ * Type: reference
+ * Path: ImmunizationRecommendation.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="ImmunizationRecommendation.patient", description="Who this profile is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who this profile is for
+ * Type: reference
+ * Path: ImmunizationRecommendation.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImmunizationRecommendation:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:patient").toLocked(); + + /** + * Search parameter: support + *

+ * Description: Past immunizations supporting recommendation
+ * Type: reference
+ * Path: ImmunizationRecommendation.recommendation.supportingImmunization
+ *

+ */ + @SearchParamDefinition(name="support", path="ImmunizationRecommendation.recommendation.supportingImmunization", description="Past immunizations supporting recommendation", type="reference" ) + public static final String SP_SUPPORT = "support"; + /** + * Fluent Client search parameter constant for support + *

+ * Description: Past immunizations supporting recommendation
+ * Type: reference
+ * Path: ImmunizationRecommendation.recommendation.supportingImmunization
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPORT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPORT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImmunizationRecommendation:support". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPORT = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:support").toLocked(); + + /** + * Search parameter: vaccine-type + *

+ * Description: Vaccine recommendation applies to
+ * Type: token
+ * Path: ImmunizationRecommendation.recommendation.vaccineCode
+ *

+ */ + @SearchParamDefinition(name="vaccine-type", path="ImmunizationRecommendation.recommendation.vaccineCode", description="Vaccine recommendation applies to", type="token" ) + public static final String SP_VACCINE_TYPE = "vaccine-type"; + /** + * Fluent Client search parameter constant for vaccine-type + *

+ * Description: Vaccine recommendation applies to
+ * Type: token
+ * Path: ImmunizationRecommendation.recommendation.vaccineCode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VACCINE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VACCINE_TYPE); + + /** + * Search parameter: status + *

+ * Description: Vaccine administration status
+ * Type: token
+ * Path: ImmunizationRecommendation.recommendation.forecastStatus
+ *

+ */ + @SearchParamDefinition(name="status", path="ImmunizationRecommendation.recommendation.forecastStatus", description="Vaccine administration status", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Vaccine administration status
+ * Type: token
+ * Path: ImmunizationRecommendation.recommendation.forecastStatus
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: dose-number + *

+ * Description: Recommended dose number
+ * Type: number
+ * Path: ImmunizationRecommendation.recommendation.doseNumber
+ *

+ */ + @SearchParamDefinition(name="dose-number", path="ImmunizationRecommendation.recommendation.doseNumber", description="Recommended dose number", type="number" ) + public static final String SP_DOSE_NUMBER = "dose-number"; + /** + * Fluent Client search parameter constant for dose-number + *

+ * Description: Recommended dose number
+ * Type: number
+ * Path: ImmunizationRecommendation.recommendation.doseNumber
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.NumberClientParam DOSE_NUMBER = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_DOSE_NUMBER); + + /** + * Search parameter: date + *

+ * Description: Date recommendation created
+ * Type: date
+ * Path: ImmunizationRecommendation.recommendation.date
+ *

+ */ + @SearchParamDefinition(name="date", path="ImmunizationRecommendation.recommendation.date", description="Date recommendation created", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Date recommendation created
+ * Type: date
+ * Path: ImmunizationRecommendation.recommendation.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Business identifier
+ * Type: token
+ * Path: ImmunizationRecommendation.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ImmunizationRecommendation.identifier", description="Business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Business identifier
+ * Type: token
+ * Path: ImmunizationRecommendation.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImplementationGuide.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImplementationGuide.java new file mode 100644 index 00000000000..baf216d9807 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ImplementationGuide.java @@ -0,0 +1,3830 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts. + */ +@ResourceDef(name="ImplementationGuide", profile="http://hl7.org/fhir/Profile/ImplementationGuide") +public class ImplementationGuide extends DomainResource { + + public enum GuideDependencyType { + /** + * The guide is referred to by URL. + */ + REFERENCE, + /** + * The guide is embedded in this guide when published. + */ + INCLUSION, + /** + * added to help the parsers + */ + NULL; + public static GuideDependencyType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("reference".equals(codeString)) + return REFERENCE; + if ("inclusion".equals(codeString)) + return INCLUSION; + throw new FHIRException("Unknown GuideDependencyType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REFERENCE: return "reference"; + case INCLUSION: return "inclusion"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REFERENCE: return "http://hl7.org/fhir/guide-dependency-type"; + case INCLUSION: return "http://hl7.org/fhir/guide-dependency-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REFERENCE: return "The guide is referred to by URL."; + case INCLUSION: return "The guide is embedded in this guide when published."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REFERENCE: return "Reference"; + case INCLUSION: return "Inclusion"; + default: return "?"; + } + } + } + + public static class GuideDependencyTypeEnumFactory implements EnumFactory { + public GuideDependencyType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("reference".equals(codeString)) + return GuideDependencyType.REFERENCE; + if ("inclusion".equals(codeString)) + return GuideDependencyType.INCLUSION; + throw new IllegalArgumentException("Unknown GuideDependencyType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("reference".equals(codeString)) + return new Enumeration(this, GuideDependencyType.REFERENCE); + if ("inclusion".equals(codeString)) + return new Enumeration(this, GuideDependencyType.INCLUSION); + throw new FHIRException("Unknown GuideDependencyType code '"+codeString+"'"); + } + public String toCode(GuideDependencyType code) { + if (code == GuideDependencyType.REFERENCE) + return "reference"; + if (code == GuideDependencyType.INCLUSION) + return "inclusion"; + return "?"; + } + public String toSystem(GuideDependencyType code) { + return code.getSystem(); + } + } + + public enum GuidePageKind { + /** + * This is a page of content that is included in the implementation guide. It has no particular function. + */ + PAGE, + /** + * This is a page that represents a human readable rendering of an example. + */ + EXAMPLE, + /** + * This is a page that represents a list of resources of one or more types. + */ + LIST, + /** + * This is a page showing where an included guide is injected. + */ + INCLUDE, + /** + * This is a page that lists the resources of a given type, and also creates pages for all the listed types as other pages in the section. + */ + DIRECTORY, + /** + * This is a page that creates the listed resources as a dictionary. + */ + DICTIONARY, + /** + * This is a generated page that contains the table of contents. + */ + TOC, + /** + * This is a page that represents a presented resource. This is typically used for generated conformance resource presentations. + */ + RESOURCE, + /** + * added to help the parsers + */ + NULL; + public static GuidePageKind fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("page".equals(codeString)) + return PAGE; + if ("example".equals(codeString)) + return EXAMPLE; + if ("list".equals(codeString)) + return LIST; + if ("include".equals(codeString)) + return INCLUDE; + if ("directory".equals(codeString)) + return DIRECTORY; + if ("dictionary".equals(codeString)) + return DICTIONARY; + if ("toc".equals(codeString)) + return TOC; + if ("resource".equals(codeString)) + return RESOURCE; + throw new FHIRException("Unknown GuidePageKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PAGE: return "page"; + case EXAMPLE: return "example"; + case LIST: return "list"; + case INCLUDE: return "include"; + case DIRECTORY: return "directory"; + case DICTIONARY: return "dictionary"; + case TOC: return "toc"; + case RESOURCE: return "resource"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PAGE: return "http://hl7.org/fhir/guide-page-kind"; + case EXAMPLE: return "http://hl7.org/fhir/guide-page-kind"; + case LIST: return "http://hl7.org/fhir/guide-page-kind"; + case INCLUDE: return "http://hl7.org/fhir/guide-page-kind"; + case DIRECTORY: return "http://hl7.org/fhir/guide-page-kind"; + case DICTIONARY: return "http://hl7.org/fhir/guide-page-kind"; + case TOC: return "http://hl7.org/fhir/guide-page-kind"; + case RESOURCE: return "http://hl7.org/fhir/guide-page-kind"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PAGE: return "This is a page of content that is included in the implementation guide. It has no particular function."; + case EXAMPLE: return "This is a page that represents a human readable rendering of an example."; + case LIST: return "This is a page that represents a list of resources of one or more types."; + case INCLUDE: return "This is a page showing where an included guide is injected."; + case DIRECTORY: return "This is a page that lists the resources of a given type, and also creates pages for all the listed types as other pages in the section."; + case DICTIONARY: return "This is a page that creates the listed resources as a dictionary."; + case TOC: return "This is a generated page that contains the table of contents."; + case RESOURCE: return "This is a page that represents a presented resource. This is typically used for generated conformance resource presentations."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PAGE: return "Page"; + case EXAMPLE: return "Example"; + case LIST: return "List"; + case INCLUDE: return "Include"; + case DIRECTORY: return "Directory"; + case DICTIONARY: return "Dictionary"; + case TOC: return "Table Of Contents"; + case RESOURCE: return "Resource"; + default: return "?"; + } + } + } + + public static class GuidePageKindEnumFactory implements EnumFactory { + public GuidePageKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("page".equals(codeString)) + return GuidePageKind.PAGE; + if ("example".equals(codeString)) + return GuidePageKind.EXAMPLE; + if ("list".equals(codeString)) + return GuidePageKind.LIST; + if ("include".equals(codeString)) + return GuidePageKind.INCLUDE; + if ("directory".equals(codeString)) + return GuidePageKind.DIRECTORY; + if ("dictionary".equals(codeString)) + return GuidePageKind.DICTIONARY; + if ("toc".equals(codeString)) + return GuidePageKind.TOC; + if ("resource".equals(codeString)) + return GuidePageKind.RESOURCE; + throw new IllegalArgumentException("Unknown GuidePageKind code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("page".equals(codeString)) + return new Enumeration(this, GuidePageKind.PAGE); + if ("example".equals(codeString)) + return new Enumeration(this, GuidePageKind.EXAMPLE); + if ("list".equals(codeString)) + return new Enumeration(this, GuidePageKind.LIST); + if ("include".equals(codeString)) + return new Enumeration(this, GuidePageKind.INCLUDE); + if ("directory".equals(codeString)) + return new Enumeration(this, GuidePageKind.DIRECTORY); + if ("dictionary".equals(codeString)) + return new Enumeration(this, GuidePageKind.DICTIONARY); + if ("toc".equals(codeString)) + return new Enumeration(this, GuidePageKind.TOC); + if ("resource".equals(codeString)) + return new Enumeration(this, GuidePageKind.RESOURCE); + throw new FHIRException("Unknown GuidePageKind code '"+codeString+"'"); + } + public String toCode(GuidePageKind code) { + if (code == GuidePageKind.PAGE) + return "page"; + if (code == GuidePageKind.EXAMPLE) + return "example"; + if (code == GuidePageKind.LIST) + return "list"; + if (code == GuidePageKind.INCLUDE) + return "include"; + if (code == GuidePageKind.DIRECTORY) + return "directory"; + if (code == GuidePageKind.DICTIONARY) + return "dictionary"; + if (code == GuidePageKind.TOC) + return "toc"; + if (code == GuidePageKind.RESOURCE) + return "resource"; + return "?"; + } + public String toSystem(GuidePageKind code) { + return code.getSystem(); + } + } + + @Block() + public static class ImplementationGuideContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the implementation guide. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the implementation guide." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public ImplementationGuideContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the implementation guide.). 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 ImplementationGuideContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ImplementationGuideContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the implementation guide. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the implementation guide. + */ + public ImplementationGuideContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ImplementationGuideContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the implementation guide.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public ImplementationGuideContactComponent copy() { + ImplementationGuideContactComponent dst = new ImplementationGuideContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImplementationGuideContactComponent)) + return false; + ImplementationGuideContactComponent o = (ImplementationGuideContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImplementationGuideContactComponent)) + return false; + ImplementationGuideContactComponent o = (ImplementationGuideContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "ImplementationGuide.contact"; + + } + + } + + @Block() + public static class ImplementationGuideDependencyComponent extends BackboneElement implements IBaseBackboneElement { + /** + * How the dependency is represented when the guide is published. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="reference | inclusion", formalDefinition="How the dependency is represented when the guide is published." ) + protected Enumeration type; + + /** + * Where the dependency is located. + */ + @Child(name = "uri", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where to find dependency", formalDefinition="Where the dependency is located." ) + protected UriType uri; + + private static final long serialVersionUID = 162447098L; + + /** + * Constructor + */ + public ImplementationGuideDependencyComponent() { + super(); + } + + /** + * Constructor + */ + public ImplementationGuideDependencyComponent(Enumeration type, UriType uri) { + super(); + this.type = type; + this.uri = uri; + } + + /** + * @return {@link #type} (How the dependency is represented when the guide is published.). 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 ImplementationGuideDependencyComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new GuideDependencyTypeEnumFactory()); // bb + 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} (How the dependency is represented when the guide is published.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ImplementationGuideDependencyComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return How the dependency is represented when the guide is published. + */ + public GuideDependencyType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value How the dependency is represented when the guide is published. + */ + public ImplementationGuideDependencyComponent setType(GuideDependencyType value) { + if (this.type == null) + this.type = new Enumeration(new GuideDependencyTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #uri} (Where the dependency is located.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuideDependencyComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); // bb + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (Where the dependency is located.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public ImplementationGuideDependencyComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return Where the dependency is located. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value Where the dependency is located. + */ + public ImplementationGuideDependencyComponent setUri(String value) { + if (this.uri == null) + this.uri = new UriType(); + this.uri.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "How the dependency is represented when the guide is published.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("uri", "uri", "Where the dependency is located.", 0, java.lang.Integer.MAX_VALUE, uri)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new GuideDependencyTypeEnumFactory().fromType(value); // Enumeration + break; + case 116076: // uri + this.uri = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new GuideDependencyTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("uri")) + this.uri = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 116076: throw new FHIRException("Cannot make property uri as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type"); + } + else if (name.equals("uri")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.uri"); + } + else + return super.addChild(name); + } + + public ImplementationGuideDependencyComponent copy() { + ImplementationGuideDependencyComponent dst = new ImplementationGuideDependencyComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.uri = uri == null ? null : uri.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImplementationGuideDependencyComponent)) + return false; + ImplementationGuideDependencyComponent o = (ImplementationGuideDependencyComponent) other; + return compareDeep(type, o.type, true) && compareDeep(uri, o.uri, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImplementationGuideDependencyComponent)) + return false; + ImplementationGuideDependencyComponent o = (ImplementationGuideDependencyComponent) other; + return compareValues(type, o.type, true) && compareValues(uri, o.uri, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (uri == null || uri.isEmpty()) + ; + } + + public String fhirType() { + return "ImplementationGuide.dependency"; + + } + + } + + @Block() + public static class ImplementationGuidePackageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name for the group, as used in page.package. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name used .page.package", formalDefinition="The name for the group, as used in page.package." ) + protected StringType name; + + /** + * Human readable text describing the package. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Human readable text describing the package", formalDefinition="Human readable text describing the package." ) + protected StringType description; + + /** + * A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. + */ + @Child(name = "resource", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Resource in the implementation guide", formalDefinition="A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource." ) + protected List resource; + + private static final long serialVersionUID = -701846580L; + + /** + * Constructor + */ + public ImplementationGuidePackageComponent() { + super(); + } + + /** + * Constructor + */ + public ImplementationGuidePackageComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (The name for the group, as used in page.package.). 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 ImplementationGuidePackageComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 for the group, as used in page.package.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ImplementationGuidePackageComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name for the group, as used in page.package. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name for the group, as used in page.package. + */ + public ImplementationGuidePackageComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #description} (Human readable text describing the package.). 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 ImplementationGuidePackageComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 text describing the package.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImplementationGuidePackageComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human readable text describing the package. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human readable text describing the package. + */ + public ImplementationGuidePackageComponent 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 #resource} (A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.) + */ + public List getResource() { + if (this.resource == null) + this.resource = new ArrayList(); + return this.resource; + } + + public boolean hasResource() { + if (this.resource == null) + return false; + for (ImplementationGuidePackageResourceComponent item : this.resource) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #resource} (A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.) + */ + // syntactic sugar + public ImplementationGuidePackageResourceComponent addResource() { //3 + ImplementationGuidePackageResourceComponent t = new ImplementationGuidePackageResourceComponent(); + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return t; + } + + // syntactic sugar + public ImplementationGuidePackageComponent addResource(ImplementationGuidePackageResourceComponent t) { //3 + if (t == null) + return this; + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name for the group, as used in page.package.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Human readable text describing the package.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("resource", "", "A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.", 0, java.lang.Integer.MAX_VALUE, resource)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // ImplementationGuidePackageResourceComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -341064690: // resource + this.getResource().add((ImplementationGuidePackageResourceComponent) value); // ImplementationGuidePackageResourceComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("resource")) + this.getResource().add((ImplementationGuidePackageResourceComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -341064690: return addResource(); // ImplementationGuidePackageResourceComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description"); + } + else if (name.equals("resource")) { + return addResource(); + } + else + return super.addChild(name); + } + + public ImplementationGuidePackageComponent copy() { + ImplementationGuidePackageComponent dst = new ImplementationGuidePackageComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + if (resource != null) { + dst.resource = new ArrayList(); + for (ImplementationGuidePackageResourceComponent i : resource) + dst.resource.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImplementationGuidePackageComponent)) + return false; + ImplementationGuidePackageComponent o = (ImplementationGuidePackageComponent) other; + return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(resource, o.resource, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImplementationGuidePackageComponent)) + return false; + ImplementationGuidePackageComponent o = (ImplementationGuidePackageComponent) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) + && (resource == null || resource.isEmpty()); + } + + public String fhirType() { + return "ImplementationGuide.package"; + + } + + } + + @Block() + public static class ImplementationGuidePackageResourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide. + */ + @Child(name = "example", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="If not an example, has it's normal meaning", formalDefinition="Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide." ) + protected BooleanType example; + + /** + * A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name). + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human Name for the resource", formalDefinition="A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name)." ) + protected StringType name; + + /** + * A description of the reason that a resource has been included in the implementation guide. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reason why included in guide", formalDefinition="A description of the reason that a resource has been included in the implementation guide." ) + protected StringType description; + + /** + * A short code that may be used to identify the resource throughout the implementation guide. + */ + @Child(name = "acronym", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Short code to identify the resource", formalDefinition="A short code that may be used to identify the resource throughout the implementation guide." ) + protected StringType acronym; + + /** + * Where this resource is found. + */ + @Child(name = "source", type = {UriType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Location of the resource", formalDefinition="Where this resource is found." ) + protected Type source; + + /** + * Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions. + */ + @Child(name = "exampleFor", type = {StructureDefinition.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Resource this is an example of (if applicable)", formalDefinition="Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions." ) + protected Reference exampleFor; + + /** + * The actual object that is the target of the reference (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) + */ + protected StructureDefinition exampleForTarget; + + private static final long serialVersionUID = 2085404852L; + + /** + * Constructor + */ + public ImplementationGuidePackageResourceComponent() { + super(); + } + + /** + * Constructor + */ + public ImplementationGuidePackageResourceComponent(BooleanType example, Type source) { + super(); + this.example = example; + this.source = source; + } + + /** + * @return {@link #example} (Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.). This is the underlying object with id, value and extensions. The accessor "getExample" gives direct access to the value + */ + public BooleanType getExampleElement() { + if (this.example == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.example"); + else if (Configuration.doAutoCreate()) + this.example = new BooleanType(); // bb + return this.example; + } + + public boolean hasExampleElement() { + return this.example != null && !this.example.isEmpty(); + } + + public boolean hasExample() { + return this.example != null && !this.example.isEmpty(); + } + + /** + * @param value {@link #example} (Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.). This is the underlying object with id, value and extensions. The accessor "getExample" gives direct access to the value + */ + public ImplementationGuidePackageResourceComponent setExampleElement(BooleanType value) { + this.example = value; + return this; + } + + /** + * @return Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide. + */ + public boolean getExample() { + return this.example == null || this.example.isEmpty() ? false : this.example.getValue(); + } + + /** + * @param value Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide. + */ + public ImplementationGuidePackageResourceComponent setExample(boolean value) { + if (this.example == null) + this.example = new BooleanType(); + this.example.setValue(value); + return this; + } + + /** + * @return {@link #name} (A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).). 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 ImplementationGuidePackageResourceComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ImplementationGuidePackageResourceComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name). + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name). + */ + public ImplementationGuidePackageResourceComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A description of the reason that a resource has been included in the implementation guide.). 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 ImplementationGuidePackageResourceComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of the reason that a resource has been included in the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImplementationGuidePackageResourceComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the reason that a resource has been included in the implementation guide. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the reason that a resource has been included in the implementation guide. + */ + public ImplementationGuidePackageResourceComponent 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 #acronym} (A short code that may be used to identify the resource throughout the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getAcronym" gives direct access to the value + */ + public StringType getAcronymElement() { + if (this.acronym == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.acronym"); + else if (Configuration.doAutoCreate()) + this.acronym = new StringType(); // bb + return this.acronym; + } + + public boolean hasAcronymElement() { + return this.acronym != null && !this.acronym.isEmpty(); + } + + public boolean hasAcronym() { + return this.acronym != null && !this.acronym.isEmpty(); + } + + /** + * @param value {@link #acronym} (A short code that may be used to identify the resource throughout the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getAcronym" gives direct access to the value + */ + public ImplementationGuidePackageResourceComponent setAcronymElement(StringType value) { + this.acronym = value; + return this; + } + + /** + * @return A short code that may be used to identify the resource throughout the implementation guide. + */ + public String getAcronym() { + return this.acronym == null ? null : this.acronym.getValue(); + } + + /** + * @param value A short code that may be used to identify the resource throughout the implementation guide. + */ + public ImplementationGuidePackageResourceComponent setAcronym(String value) { + if (Utilities.noString(value)) + this.acronym = null; + else { + if (this.acronym == null) + this.acronym = new StringType(); + this.acronym.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (Where this resource is found.) + */ + public Type getSource() { + return this.source; + } + + /** + * @return {@link #source} (Where this resource is found.) + */ + public UriType getSourceUriType() throws FHIRException { + if (!(this.source instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered"); + return (UriType) this.source; + } + + public boolean hasSourceUriType() { + return this.source instanceof UriType; + } + + /** + * @return {@link #source} (Where this resource is found.) + */ + public Reference getSourceReference() throws FHIRException { + if (!(this.source instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered"); + return (Reference) this.source; + } + + public boolean hasSourceReference() { + return this.source instanceof Reference; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Where this resource is found.) + */ + public ImplementationGuidePackageResourceComponent setSource(Type value) { + this.source = value; + return this; + } + + /** + * @return {@link #exampleFor} (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) + */ + public Reference getExampleFor() { + if (this.exampleFor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.exampleFor"); + else if (Configuration.doAutoCreate()) + this.exampleFor = new Reference(); // cc + return this.exampleFor; + } + + public boolean hasExampleFor() { + return this.exampleFor != null && !this.exampleFor.isEmpty(); + } + + /** + * @param value {@link #exampleFor} (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) + */ + public ImplementationGuidePackageResourceComponent setExampleFor(Reference value) { + this.exampleFor = value; + return this; + } + + /** + * @return {@link #exampleFor} 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. (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) + */ + public StructureDefinition getExampleForTarget() { + if (this.exampleForTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.exampleFor"); + else if (Configuration.doAutoCreate()) + this.exampleForTarget = new StructureDefinition(); // aa + return this.exampleForTarget; + } + + /** + * @param value {@link #exampleFor} 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. (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) + */ + public ImplementationGuidePackageResourceComponent setExampleForTarget(StructureDefinition value) { + this.exampleForTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("example", "boolean", "Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.", 0, java.lang.Integer.MAX_VALUE, example)); + childrenList.add(new Property("name", "string", "A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "A description of the reason that a resource has been included in the implementation guide.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("acronym", "string", "A short code that may be used to identify the resource throughout the implementation guide.", 0, java.lang.Integer.MAX_VALUE, acronym)); + childrenList.add(new Property("source[x]", "uri|Reference(Any)", "Where this resource is found.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("exampleFor", "Reference(StructureDefinition)", "Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.", 0, java.lang.Integer.MAX_VALUE, exampleFor)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1322970774: /*example*/ return this.example == null ? new Base[0] : new Base[] {this.example}; // BooleanType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1163472445: /*acronym*/ return this.acronym == null ? new Base[0] : new Base[] {this.acronym}; // StringType + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Type + case -2002349313: /*exampleFor*/ return this.exampleFor == null ? new Base[0] : new Base[] {this.exampleFor}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1322970774: // example + this.example = castToBoolean(value); // BooleanType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1163472445: // acronym + this.acronym = castToString(value); // StringType + break; + case -896505829: // source + this.source = (Type) value; // Type + break; + case -2002349313: // exampleFor + this.exampleFor = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("example")) + this.example = castToBoolean(value); // BooleanType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("acronym")) + this.acronym = castToString(value); // StringType + else if (name.equals("source[x]")) + this.source = (Type) value; // Type + else if (name.equals("exampleFor")) + this.exampleFor = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1322970774: throw new FHIRException("Cannot make property example as it is not a complex type"); // BooleanType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1163472445: throw new FHIRException("Cannot make property acronym as it is not a complex type"); // StringType + case -1698413947: return getSource(); // Type + case -2002349313: return getExampleFor(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("example")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.example"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description"); + } + else if (name.equals("acronym")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.acronym"); + } + else if (name.equals("sourceUri")) { + this.source = new UriType(); + return this.source; + } + else if (name.equals("sourceReference")) { + this.source = new Reference(); + return this.source; + } + else if (name.equals("exampleFor")) { + this.exampleFor = new Reference(); + return this.exampleFor; + } + else + return super.addChild(name); + } + + public ImplementationGuidePackageResourceComponent copy() { + ImplementationGuidePackageResourceComponent dst = new ImplementationGuidePackageResourceComponent(); + copyValues(dst); + dst.example = example == null ? null : example.copy(); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.acronym = acronym == null ? null : acronym.copy(); + dst.source = source == null ? null : source.copy(); + dst.exampleFor = exampleFor == null ? null : exampleFor.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImplementationGuidePackageResourceComponent)) + return false; + ImplementationGuidePackageResourceComponent o = (ImplementationGuidePackageResourceComponent) other; + return compareDeep(example, o.example, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) + && compareDeep(acronym, o.acronym, true) && compareDeep(source, o.source, true) && compareDeep(exampleFor, o.exampleFor, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImplementationGuidePackageResourceComponent)) + return false; + ImplementationGuidePackageResourceComponent o = (ImplementationGuidePackageResourceComponent) other; + return compareValues(example, o.example, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true) + && compareValues(acronym, o.acronym, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (example == null || example.isEmpty()) && (name == null || name.isEmpty()) + && (description == null || description.isEmpty()) && (acronym == null || acronym.isEmpty()) + && (source == null || source.isEmpty()) && (exampleFor == null || exampleFor.isEmpty()); + } + + public String fhirType() { + return "ImplementationGuide.package.resource"; + + } + + } + + @Block() + public static class ImplementationGuideGlobalComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of resource that all instances must conform to. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type this profiles applies to", formalDefinition="The type of resource that all instances must conform to." ) + protected CodeType type; + + /** + * A reference to the profile that all instances must conform to. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Profile that all resources must conform to", formalDefinition="A reference to the profile that all instances must conform to." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A reference to the profile that all instances must conform to.) + */ + protected StructureDefinition profileTarget; + + private static final long serialVersionUID = 2011731959L; + + /** + * Constructor + */ + public ImplementationGuideGlobalComponent() { + super(); + } + + /** + * Constructor + */ + public ImplementationGuideGlobalComponent(CodeType type, Reference profile) { + super(); + this.type = type; + this.profile = profile; + } + + /** + * @return {@link #type} (The type of resource that all instances must conform to.). 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 ImplementationGuideGlobalComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 of resource that all instances must conform to.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ImplementationGuideGlobalComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of resource that all instances must conform to. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of resource that all instances must conform to. + */ + public ImplementationGuideGlobalComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (A reference to the profile that all instances must conform to.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuideGlobalComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A reference to the profile that all instances must conform to.) + */ + public ImplementationGuideGlobalComponent 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 reference to the profile that all instances must conform to.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuideGlobalComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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 reference to the profile that all instances must conform to.) + */ + public ImplementationGuideGlobalComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of resource that all instances must conform to.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A reference to the profile that all instances must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case -309425751: return getProfile(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else + return super.addChild(name); + } + + public ImplementationGuideGlobalComponent copy() { + ImplementationGuideGlobalComponent dst = new ImplementationGuideGlobalComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImplementationGuideGlobalComponent)) + return false; + ImplementationGuideGlobalComponent o = (ImplementationGuideGlobalComponent) other; + return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImplementationGuideGlobalComponent)) + return false; + ImplementationGuideGlobalComponent o = (ImplementationGuideGlobalComponent) other; + return compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) + ; + } + + public String fhirType() { + return "ImplementationGuide.global"; + + } + + } + + @Block() + public static class ImplementationGuidePageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The source address for the page. + */ + @Child(name = "source", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where to find that page", formalDefinition="The source address for the page." ) + protected UriType source; + + /** + * A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Short name shown for navigational assistance", formalDefinition="A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc." ) + protected StringType name; + + /** + * The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest. + */ + @Child(name = "kind", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="page | example | list | include | directory | dictionary | toc | resource", formalDefinition="The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest." ) + protected Enumeration kind; + + /** + * For constructed pages, what kind of resources to include in the list. + */ + @Child(name = "type", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Kind of resource to include in the list", formalDefinition="For constructed pages, what kind of resources to include in the list." ) + protected List type; + + /** + * For constructed pages, a list of packages to include in the page (or else empty for everything). + */ + @Child(name = "package", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Name of package to include", formalDefinition="For constructed pages, a list of packages to include in the page (or else empty for everything)." ) + protected List package_; + + /** + * The format of the page. + */ + @Child(name = "format", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Format of the page (e.g. html, markdown, etc.)", formalDefinition="The format of the page." ) + protected CodeType format; + + /** + * Nested Pages/Sections under this page. + */ + @Child(name = "page", type = {ImplementationGuidePageComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Nested Pages / Sections", formalDefinition="Nested Pages/Sections under this page." ) + protected List page; + + private static final long serialVersionUID = -1620890043L; + + /** + * Constructor + */ + public ImplementationGuidePageComponent() { + super(); + } + + /** + * Constructor + */ + public ImplementationGuidePageComponent(UriType source, StringType name, Enumeration kind) { + super(); + this.source = source; + this.name = name; + this.kind = kind; + } + + /** + * @return {@link #source} (The source address for the page.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public UriType getSourceElement() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuidePageComponent.source"); + else if (Configuration.doAutoCreate()) + this.source = new UriType(); // bb + return this.source; + } + + public boolean hasSourceElement() { + return this.source != null && !this.source.isEmpty(); + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The source address for the page.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public ImplementationGuidePageComponent setSourceElement(UriType value) { + this.source = value; + return this; + } + + /** + * @return The source address for the page. + */ + public String getSource() { + return this.source == null ? null : this.source.getValue(); + } + + /** + * @param value The source address for the page. + */ + public ImplementationGuidePageComponent setSource(String value) { + if (this.source == null) + this.source = new UriType(); + this.source.setValue(value); + return this; + } + + /** + * @return {@link #name} (A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc.). 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 ImplementationGuidePageComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ImplementationGuidePageComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc. + */ + public ImplementationGuidePageComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #kind} (The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuidePageComponent.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new GuidePageKindEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public ImplementationGuidePageComponent setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest. + */ + public GuidePageKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest. + */ + public ImplementationGuidePageComponent setKind(GuidePageKind value) { + if (this.kind == null) + this.kind = new Enumeration(new GuidePageKindEnumFactory()); + this.kind.setValue(value); + return this; + } + + /** + * @return {@link #type} (For constructed pages, what kind of resources to include in the list.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeType item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (For constructed pages, what kind of resources to include in the list.) + */ + // syntactic sugar + public CodeType addTypeElement() {//2 + CodeType t = new CodeType(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @param value {@link #type} (For constructed pages, what kind of resources to include in the list.) + */ + public ImplementationGuidePageComponent addType(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @param value {@link #type} (For constructed pages, what kind of resources to include in the list.) + */ + public boolean hasType(String value) { + if (this.type == null) + return false; + for (CodeType v : this.type) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).) + */ + public List getPackage() { + if (this.package_ == null) + this.package_ = new ArrayList(); + return this.package_; + } + + public boolean hasPackage() { + if (this.package_ == null) + return false; + for (StringType item : this.package_) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).) + */ + // syntactic sugar + public StringType addPackageElement() {//2 + StringType t = new StringType(); + if (this.package_ == null) + this.package_ = new ArrayList(); + this.package_.add(t); + return t; + } + + /** + * @param value {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).) + */ + public ImplementationGuidePageComponent addPackage(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.package_ == null) + this.package_ = new ArrayList(); + this.package_.add(t); + return this; + } + + /** + * @param value {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).) + */ + public boolean hasPackage(String value) { + if (this.package_ == null) + return false; + for (StringType v : this.package_) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #format} (The format of the page.). This is the underlying object with id, value and extensions. The accessor "getFormat" gives direct access to the value + */ + public CodeType getFormatElement() { + if (this.format == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuidePageComponent.format"); + else if (Configuration.doAutoCreate()) + this.format = new CodeType(); // bb + return this.format; + } + + public boolean hasFormatElement() { + return this.format != null && !this.format.isEmpty(); + } + + public boolean hasFormat() { + return this.format != null && !this.format.isEmpty(); + } + + /** + * @param value {@link #format} (The format of the page.). This is the underlying object with id, value and extensions. The accessor "getFormat" gives direct access to the value + */ + public ImplementationGuidePageComponent setFormatElement(CodeType value) { + this.format = value; + return this; + } + + /** + * @return The format of the page. + */ + public String getFormat() { + return this.format == null ? null : this.format.getValue(); + } + + /** + * @param value The format of the page. + */ + public ImplementationGuidePageComponent setFormat(String value) { + if (Utilities.noString(value)) + this.format = null; + else { + if (this.format == null) + this.format = new CodeType(); + this.format.setValue(value); + } + return this; + } + + /** + * @return {@link #page} (Nested Pages/Sections under this page.) + */ + public List getPage() { + if (this.page == null) + this.page = new ArrayList(); + return this.page; + } + + public boolean hasPage() { + if (this.page == null) + return false; + for (ImplementationGuidePageComponent item : this.page) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #page} (Nested Pages/Sections under this page.) + */ + // syntactic sugar + public ImplementationGuidePageComponent addPage() { //3 + ImplementationGuidePageComponent t = new ImplementationGuidePageComponent(); + if (this.page == null) + this.page = new ArrayList(); + this.page.add(t); + return t; + } + + // syntactic sugar + public ImplementationGuidePageComponent addPage(ImplementationGuidePageComponent t) { //3 + if (t == null) + return this; + if (this.page == null) + this.page = new ArrayList(); + this.page.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("source", "uri", "The source address for the page.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("name", "string", "A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("kind", "code", "The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("type", "code", "For constructed pages, what kind of resources to include in the list.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("package", "string", "For constructed pages, a list of packages to include in the page (or else empty for everything).", 0, java.lang.Integer.MAX_VALUE, package_)); + childrenList.add(new Property("format", "code", "The format of the page.", 0, java.lang.Integer.MAX_VALUE, format)); + childrenList.add(new Property("page", "@ImplementationGuide.page", "Nested Pages/Sections under this page.", 0, java.lang.Integer.MAX_VALUE, page)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // UriType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeType + case -807062458: /*package*/ return this.package_ == null ? new Base[0] : this.package_.toArray(new Base[this.package_.size()]); // StringType + case -1268779017: /*format*/ return this.format == null ? new Base[0] : new Base[] {this.format}; // CodeType + case 3433103: /*page*/ return this.page == null ? new Base[0] : this.page.toArray(new Base[this.page.size()]); // ImplementationGuidePageComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -896505829: // source + this.source = castToUri(value); // UriType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 3292052: // kind + this.kind = new GuidePageKindEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.getType().add(castToCode(value)); // CodeType + break; + case -807062458: // package + this.getPackage().add(castToString(value)); // StringType + break; + case -1268779017: // format + this.format = castToCode(value); // CodeType + break; + case 3433103: // page + this.getPage().add((ImplementationGuidePageComponent) value); // ImplementationGuidePageComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("source")) + this.source = castToUri(value); // UriType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("kind")) + this.kind = new GuidePageKindEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.getType().add(castToCode(value)); + else if (name.equals("package")) + this.getPackage().add(castToString(value)); + else if (name.equals("format")) + this.format = castToCode(value); // CodeType + else if (name.equals("page")) + this.getPage().add((ImplementationGuidePageComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -896505829: throw new FHIRException("Cannot make property source as it is not a complex type"); // UriType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case -807062458: throw new FHIRException("Cannot make property package as it is not a complex type"); // StringType + case -1268779017: throw new FHIRException("Cannot make property format as it is not a complex type"); // CodeType + case 3433103: return addPage(); // ImplementationGuidePageComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("source")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.source"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); + } + else if (name.equals("kind")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.kind"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type"); + } + else if (name.equals("package")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.package"); + } + else if (name.equals("format")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.format"); + } + else if (name.equals("page")) { + return addPage(); + } + else + return super.addChild(name); + } + + public ImplementationGuidePageComponent copy() { + ImplementationGuidePageComponent dst = new ImplementationGuidePageComponent(); + copyValues(dst); + dst.source = source == null ? null : source.copy(); + dst.name = name == null ? null : name.copy(); + dst.kind = kind == null ? null : kind.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (CodeType i : type) + dst.type.add(i.copy()); + }; + if (package_ != null) { + dst.package_ = new ArrayList(); + for (StringType i : package_) + dst.package_.add(i.copy()); + }; + dst.format = format == null ? null : format.copy(); + if (page != null) { + dst.page = new ArrayList(); + for (ImplementationGuidePageComponent i : page) + dst.page.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImplementationGuidePageComponent)) + return false; + ImplementationGuidePageComponent o = (ImplementationGuidePageComponent) other; + return compareDeep(source, o.source, true) && compareDeep(name, o.name, true) && compareDeep(kind, o.kind, true) + && compareDeep(type, o.type, true) && compareDeep(package_, o.package_, true) && compareDeep(format, o.format, true) + && compareDeep(page, o.page, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImplementationGuidePageComponent)) + return false; + ImplementationGuidePageComponent o = (ImplementationGuidePageComponent) other; + return compareValues(source, o.source, true) && compareValues(name, o.name, true) && compareValues(kind, o.kind, true) + && compareValues(type, o.type, true) && compareValues(package_, o.package_, true) && compareValues(format, o.format, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (source == null || source.isEmpty()) && (name == null || name.isEmpty()) + && (kind == null || kind.isEmpty()) && (type == null || type.isEmpty()) && (package_ == null || package_.isEmpty()) + && (format == null || format.isEmpty()) && (page == null || page.isEmpty()); + } + + public String fhirType() { + return "ImplementationGuide.page"; + + } + + } + + /** + * An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Absolute URL used to reference this Implementation Guide", formalDefinition="An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published." ) + protected UriType url; + + /** + * The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical id for this version of the Implementation Guide", formalDefinition="The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually." ) + protected StringType version; + + /** + * A free text natural language name identifying the Implementation Guide. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this Implementation Guide", formalDefinition="A free text natural language name identifying the Implementation Guide." ) + protected StringType name; + + /** + * The status of the Implementation Guide. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the Implementation Guide." ) + protected Enumeration status; + + /** + * This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the implementation guide. + */ + @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the implementation guide." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for this version of the Implementation Guide", formalDefinition="The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes." ) + protected DateTimeType date; + + /** + * A free text natural language description of the Implementation Guide and its use. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Natural language description of the Implementation Guide", formalDefinition="A free text natural language description of the Implementation Guide and its use." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The implementation guide is intended to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined." ) + protected List useContext; + + /** + * A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + @Child(name = "copyright", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) + protected StringType copyright; + + /** + * The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. + */ + @Child(name = "fhirVersion", type = {IdType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="FHIR Version this Implementation Guide targets", formalDefinition="The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version." ) + protected IdType fhirVersion; + + /** + * Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides. + */ + @Child(name = "dependency", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Another Implementation guide this depends on", formalDefinition="Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides." ) + protected List dependency; + + /** + * A logical group of resources. Logical groups can be used when building pages. + */ + @Child(name = "package", type = {}, order=13, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Group of resources as used in .page.package", formalDefinition="A logical group of resources. Logical groups can be used when building pages." ) + protected List package_; + + /** + * A set of profiles that all resources covered by this implementation guide must conform to. + */ + @Child(name = "global", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Profiles that apply globally", formalDefinition="A set of profiles that all resources covered by this implementation guide must conform to." ) + protected List global; + + /** + * A binary file that is included in the implementation guide when it is published. + */ + @Child(name = "binary", type = {UriType.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Image, css, script, etc.", formalDefinition="A binary file that is included in the implementation guide when it is published." ) + protected List binary; + + /** + * A page / section in the implementation guide. The root page is the implementation guide home page. + */ + @Child(name = "page", type = {}, order=16, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Page/Section in the Guide", formalDefinition="A page / section in the implementation guide. The root page is the implementation guide home page." ) + protected ImplementationGuidePageComponent page; + + private static final long serialVersionUID = 1150122415L; + + /** + * Constructor + */ + public ImplementationGuide() { + super(); + } + + /** + * Constructor + */ + public ImplementationGuide(UriType url, StringType name, Enumeration status, ImplementationGuidePageComponent page) { + super(); + this.url = url; + this.name = name; + this.status = status; + this.page = page; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuide.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ImplementationGuide setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. + */ + public ImplementationGuide setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuide.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ImplementationGuide setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually. + */ + public ImplementationGuide setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the Implementation Guide.). 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 ImplementationGuide.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name identifying the Implementation Guide.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ImplementationGuide setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the Implementation Guide. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the Implementation Guide. + */ + public ImplementationGuide setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of the Implementation Guide.). 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 ImplementationGuide.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 Implementation Guide.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ImplementationGuide setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the Implementation Guide. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the Implementation Guide. + */ + public ImplementationGuide setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuide.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ImplementationGuide setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public ImplementationGuide setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuide.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ImplementationGuide setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the implementation guide. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the implementation guide. + */ + public ImplementationGuide setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ImplementationGuideContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ImplementationGuideContactComponent addContact() { //3 + ImplementationGuideContactComponent t = new ImplementationGuideContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public ImplementationGuide addContact(ImplementationGuideContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.). 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 ImplementationGuide.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ImplementationGuide setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes. + */ + public ImplementationGuide setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the Implementation Guide and its use.). 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 ImplementationGuide.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the Implementation Guide and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImplementationGuide setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the Implementation Guide and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the Implementation Guide and its use. + */ + public ImplementationGuide 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public ImplementationGuide addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuide.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public ImplementationGuide setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public ImplementationGuide setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public IdType getFhirVersionElement() { + if (this.fhirVersion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuide.fhirVersion"); + else if (Configuration.doAutoCreate()) + this.fhirVersion = new IdType(); // bb + return this.fhirVersion; + } + + public boolean hasFhirVersionElement() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + public boolean hasFhirVersion() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + /** + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public ImplementationGuide setFhirVersionElement(IdType value) { + this.fhirVersion = value; + return this; + } + + /** + * @return The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. + */ + public String getFhirVersion() { + return this.fhirVersion == null ? null : this.fhirVersion.getValue(); + } + + /** + * @param value The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. + */ + public ImplementationGuide setFhirVersion(String value) { + if (Utilities.noString(value)) + this.fhirVersion = null; + else { + if (this.fhirVersion == null) + this.fhirVersion = new IdType(); + this.fhirVersion.setValue(value); + } + return this; + } + + /** + * @return {@link #dependency} (Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.) + */ + public List getDependency() { + if (this.dependency == null) + this.dependency = new ArrayList(); + return this.dependency; + } + + public boolean hasDependency() { + if (this.dependency == null) + return false; + for (ImplementationGuideDependencyComponent item : this.dependency) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dependency} (Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.) + */ + // syntactic sugar + public ImplementationGuideDependencyComponent addDependency() { //3 + ImplementationGuideDependencyComponent t = new ImplementationGuideDependencyComponent(); + if (this.dependency == null) + this.dependency = new ArrayList(); + this.dependency.add(t); + return t; + } + + // syntactic sugar + public ImplementationGuide addDependency(ImplementationGuideDependencyComponent t) { //3 + if (t == null) + return this; + if (this.dependency == null) + this.dependency = new ArrayList(); + this.dependency.add(t); + return this; + } + + /** + * @return {@link #package_} (A logical group of resources. Logical groups can be used when building pages.) + */ + public List getPackage() { + if (this.package_ == null) + this.package_ = new ArrayList(); + return this.package_; + } + + public boolean hasPackage() { + if (this.package_ == null) + return false; + for (ImplementationGuidePackageComponent item : this.package_) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #package_} (A logical group of resources. Logical groups can be used when building pages.) + */ + // syntactic sugar + public ImplementationGuidePackageComponent addPackage() { //3 + ImplementationGuidePackageComponent t = new ImplementationGuidePackageComponent(); + if (this.package_ == null) + this.package_ = new ArrayList(); + this.package_.add(t); + return t; + } + + // syntactic sugar + public ImplementationGuide addPackage(ImplementationGuidePackageComponent t) { //3 + if (t == null) + return this; + if (this.package_ == null) + this.package_ = new ArrayList(); + this.package_.add(t); + return this; + } + + /** + * @return {@link #global} (A set of profiles that all resources covered by this implementation guide must conform to.) + */ + public List getGlobal() { + if (this.global == null) + this.global = new ArrayList(); + return this.global; + } + + public boolean hasGlobal() { + if (this.global == null) + return false; + for (ImplementationGuideGlobalComponent item : this.global) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #global} (A set of profiles that all resources covered by this implementation guide must conform to.) + */ + // syntactic sugar + public ImplementationGuideGlobalComponent addGlobal() { //3 + ImplementationGuideGlobalComponent t = new ImplementationGuideGlobalComponent(); + if (this.global == null) + this.global = new ArrayList(); + this.global.add(t); + return t; + } + + // syntactic sugar + public ImplementationGuide addGlobal(ImplementationGuideGlobalComponent t) { //3 + if (t == null) + return this; + if (this.global == null) + this.global = new ArrayList(); + this.global.add(t); + return this; + } + + /** + * @return {@link #binary} (A binary file that is included in the implementation guide when it is published.) + */ + public List getBinary() { + if (this.binary == null) + this.binary = new ArrayList(); + return this.binary; + } + + public boolean hasBinary() { + if (this.binary == null) + return false; + for (UriType item : this.binary) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #binary} (A binary file that is included in the implementation guide when it is published.) + */ + // syntactic sugar + public UriType addBinaryElement() {//2 + UriType t = new UriType(); + if (this.binary == null) + this.binary = new ArrayList(); + this.binary.add(t); + return t; + } + + /** + * @param value {@link #binary} (A binary file that is included in the implementation guide when it is published.) + */ + public ImplementationGuide addBinary(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.binary == null) + this.binary = new ArrayList(); + this.binary.add(t); + return this; + } + + /** + * @param value {@link #binary} (A binary file that is included in the implementation guide when it is published.) + */ + public boolean hasBinary(String value) { + if (this.binary == null) + return false; + for (UriType v : this.binary) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #page} (A page / section in the implementation guide. The root page is the implementation guide home page.) + */ + public ImplementationGuidePageComponent getPage() { + if (this.page == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImplementationGuide.page"); + else if (Configuration.doAutoCreate()) + this.page = new ImplementationGuidePageComponent(); // cc + return this.page; + } + + public boolean hasPage() { + return this.page != null && !this.page.isEmpty(); + } + + /** + * @param value {@link #page} (A page / section in the implementation guide. The root page is the implementation guide home page.) + */ + public ImplementationGuide setPage(ImplementationGuidePageComponent value) { + this.page = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the Implementation Guide.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the Implementation Guide.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the implementation guide.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A free text natural language description of the Implementation Guide and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("dependency", "", "Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.", 0, java.lang.Integer.MAX_VALUE, dependency)); + childrenList.add(new Property("package", "", "A logical group of resources. Logical groups can be used when building pages.", 0, java.lang.Integer.MAX_VALUE, package_)); + childrenList.add(new Property("global", "", "A set of profiles that all resources covered by this implementation guide must conform to.", 0, java.lang.Integer.MAX_VALUE, global)); + childrenList.add(new Property("binary", "uri", "A binary file that is included in the implementation guide when it is published.", 0, java.lang.Integer.MAX_VALUE, binary)); + childrenList.add(new Property("page", "", "A page / section in the implementation guide. The root page is the implementation guide home page.", 0, java.lang.Integer.MAX_VALUE, page)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ImplementationGuideContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType + case -26291381: /*dependency*/ return this.dependency == null ? new Base[0] : this.dependency.toArray(new Base[this.dependency.size()]); // ImplementationGuideDependencyComponent + case -807062458: /*package*/ return this.package_ == null ? new Base[0] : this.package_.toArray(new Base[this.package_.size()]); // ImplementationGuidePackageComponent + case -1243020381: /*global*/ return this.global == null ? new Base[0] : this.global.toArray(new Base[this.global.size()]); // ImplementationGuideGlobalComponent + case -1388966911: /*binary*/ return this.binary == null ? new Base[0] : this.binary.toArray(new Base[this.binary.size()]); // UriType + case 3433103: /*page*/ return this.page == null ? new Base[0] : new Base[] {this.page}; // ImplementationGuidePageComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((ImplementationGuideContactComponent) value); // ImplementationGuideContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case 461006061: // fhirVersion + this.fhirVersion = castToId(value); // IdType + break; + case -26291381: // dependency + this.getDependency().add((ImplementationGuideDependencyComponent) value); // ImplementationGuideDependencyComponent + break; + case -807062458: // package + this.getPackage().add((ImplementationGuidePackageComponent) value); // ImplementationGuidePackageComponent + break; + case -1243020381: // global + this.getGlobal().add((ImplementationGuideGlobalComponent) value); // ImplementationGuideGlobalComponent + break; + case -1388966911: // binary + this.getBinary().add(castToUri(value)); // UriType + break; + case 3433103: // page + this.page = (ImplementationGuidePageComponent) value; // ImplementationGuidePageComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((ImplementationGuideContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("fhirVersion")) + this.fhirVersion = castToId(value); // IdType + else if (name.equals("dependency")) + this.getDependency().add((ImplementationGuideDependencyComponent) value); + else if (name.equals("package")) + this.getPackage().add((ImplementationGuidePackageComponent) value); + else if (name.equals("global")) + this.getGlobal().add((ImplementationGuideGlobalComponent) value); + else if (name.equals("binary")) + this.getBinary().add(castToUri(value)); + else if (name.equals("page")) + this.page = (ImplementationGuidePageComponent) value; // ImplementationGuidePageComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // ImplementationGuideContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case 461006061: throw new FHIRException("Cannot make property fhirVersion as it is not a complex type"); // IdType + case -26291381: return addDependency(); // ImplementationGuideDependencyComponent + case -807062458: return addPackage(); // ImplementationGuidePackageComponent + case -1243020381: return addGlobal(); // ImplementationGuideGlobalComponent + case -1388966911: throw new FHIRException("Cannot make property binary as it is not a complex type"); // UriType + case 3433103: return getPage(); // ImplementationGuidePageComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.url"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.copyright"); + } + else if (name.equals("fhirVersion")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.fhirVersion"); + } + else if (name.equals("dependency")) { + return addDependency(); + } + else if (name.equals("package")) { + return addPackage(); + } + else if (name.equals("global")) { + return addGlobal(); + } + else if (name.equals("binary")) { + throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.binary"); + } + else if (name.equals("page")) { + this.page = new ImplementationGuidePageComponent(); + return this.page; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ImplementationGuide"; + + } + + public ImplementationGuide copy() { + ImplementationGuide dst = new ImplementationGuide(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ImplementationGuideContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.copyright = copyright == null ? null : copyright.copy(); + dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); + if (dependency != null) { + dst.dependency = new ArrayList(); + for (ImplementationGuideDependencyComponent i : dependency) + dst.dependency.add(i.copy()); + }; + if (package_ != null) { + dst.package_ = new ArrayList(); + for (ImplementationGuidePackageComponent i : package_) + dst.package_.add(i.copy()); + }; + if (global != null) { + dst.global = new ArrayList(); + for (ImplementationGuideGlobalComponent i : global) + dst.global.add(i.copy()); + }; + if (binary != null) { + dst.binary = new ArrayList(); + for (UriType i : binary) + dst.binary.add(i.copy()); + }; + dst.page = page == null ? null : page.copy(); + return dst; + } + + protected ImplementationGuide typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ImplementationGuide)) + return false; + ImplementationGuide o = (ImplementationGuide) other; + return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) + && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) + && compareDeep(useContext, o.useContext, true) && compareDeep(copyright, o.copyright, true) && compareDeep(fhirVersion, o.fhirVersion, true) + && compareDeep(dependency, o.dependency, true) && compareDeep(package_, o.package_, true) && compareDeep(global, o.global, true) + && compareDeep(binary, o.binary, true) && compareDeep(page, o.page, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ImplementationGuide)) + return false; + ImplementationGuide o = (ImplementationGuide) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(copyright, o.copyright, true) + && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(binary, o.binary, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) + && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) + && (dependency == null || dependency.isEmpty()) && (package_ == null || package_.isEmpty()) + && (global == null || global.isEmpty()) && (binary == null || binary.isEmpty()) && (page == null || page.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImplementationGuide; + } + + /** + * Search parameter: dependency + *

+ * Description: Where to find dependency
+ * Type: uri
+ * Path: ImplementationGuide.dependency.uri
+ *

+ */ + @SearchParamDefinition(name="dependency", path="ImplementationGuide.dependency.uri", description="Where to find dependency", type="uri" ) + public static final String SP_DEPENDENCY = "dependency"; + /** + * Fluent Client search parameter constant for dependency + *

+ * Description: Where to find dependency
+ * Type: uri
+ * Path: ImplementationGuide.dependency.uri
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam DEPENDENCY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DEPENDENCY); + + /** + * Search parameter: status + *

+ * Description: The current status of the implementation guide
+ * Type: token
+ * Path: ImplementationGuide.status
+ *

+ */ + @SearchParamDefinition(name="status", path="ImplementationGuide.status", description="The current status of the implementation guide", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the implementation guide
+ * Type: token
+ * Path: ImplementationGuide.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the implementation guide
+ * Type: string
+ * Path: ImplementationGuide.description
+ *

+ */ + @SearchParamDefinition(name="description", path="ImplementationGuide.description", description="Text search in the description of the implementation guide", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the implementation guide
+ * Type: string
+ * Path: ImplementationGuide.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: Name of the implementation guide
+ * Type: string
+ * Path: ImplementationGuide.name
+ *

+ */ + @SearchParamDefinition(name="name", path="ImplementationGuide.name", description="Name of the implementation guide", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the implementation guide
+ * Type: string
+ * Path: ImplementationGuide.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: resource + *

+ * Description: Location of the resource
+ * Type: reference
+ * Path: ImplementationGuide.package.resource.source[x]
+ *

+ */ + @SearchParamDefinition(name="resource", path="ImplementationGuide.package.resource.source", description="Location of the resource", type="reference" ) + public static final String SP_RESOURCE = "resource"; + /** + * Fluent Client search parameter constant for resource + *

+ * Description: Location of the resource
+ * Type: reference
+ * Path: ImplementationGuide.package.resource.source[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ImplementationGuide:resource". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RESOURCE = new ca.uhn.fhir.model.api.Include("ImplementationGuide:resource").toLocked(); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the structure
+ * Type: token
+ * Path: ImplementationGuide.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="ImplementationGuide.useContext", description="A use context assigned to the structure", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the structure
+ * Type: token
+ * Path: ImplementationGuide.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: experimental + *

+ * Description: If for testing purposes, not real usage
+ * Type: token
+ * Path: ImplementationGuide.experimental
+ *

+ */ + @SearchParamDefinition(name="experimental", path="ImplementationGuide.experimental", description="If for testing purposes, not real usage", type="token" ) + public static final String SP_EXPERIMENTAL = "experimental"; + /** + * Fluent Client search parameter constant for experimental + *

+ * Description: If for testing purposes, not real usage
+ * Type: token
+ * Path: ImplementationGuide.experimental
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL); + + /** + * Search parameter: date + *

+ * Description: The implementation guide publication date
+ * Type: date
+ * Path: ImplementationGuide.date
+ *

+ */ + @SearchParamDefinition(name="date", path="ImplementationGuide.date", description="The implementation guide publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The implementation guide publication date
+ * Type: date
+ * Path: ImplementationGuide.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: url + *

+ * Description: Absolute URL used to reference this Implementation Guide
+ * Type: uri
+ * Path: ImplementationGuide.url
+ *

+ */ + @SearchParamDefinition(name="url", path="ImplementationGuide.url", description="Absolute URL used to reference this Implementation Guide", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: Absolute URL used to reference this Implementation Guide
+ * Type: uri
+ * Path: ImplementationGuide.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the implementation guide
+ * Type: string
+ * Path: ImplementationGuide.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="ImplementationGuide.publisher", description="Name of the publisher of the implementation guide", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the implementation guide
+ * Type: string
+ * Path: ImplementationGuide.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the implementation guide
+ * Type: token
+ * Path: ImplementationGuide.version
+ *

+ */ + @SearchParamDefinition(name="version", path="ImplementationGuide.version", description="The version identifier of the implementation guide", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the implementation guide
+ * Type: token
+ * Path: ImplementationGuide.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/InstantType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/InstantType.java new file mode 100644 index 00000000000..3f81c8d260b --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/InstantType.java @@ -0,0 +1,223 @@ +/* +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. + +*/ +/** + * + */ +package org.hl7.fhir.dstu2016may.model; + +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import java.util.zip.DataFormatException; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Represents a FHIR instant datatype. Valid precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ +@DatatypeDef(name="instant") +public class InstantType extends BaseDateTimeType { + + private static final long serialVersionUID = 3L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI; + + /** + * Constructor which creates an InstantDt with no timne value. Note + * that unlike the default constructor for the Java {@link Date} or + * {@link Calendar} objects, this constructor does not initialize the object + * with the current time. + * + * @see #withCurrentTime() to create a new object that has been initialized + * with the current time. + */ + public InstantType() { + super(); + } + + /** + * Create a new DateTimeDt + */ + public InstantType(Calendar theCalendar) { + super(theCalendar.getTime(), DEFAULT_PRECISION, theCalendar.getTimeZone()); + } + + /** + * Create a new instance using the given date, precision level, and time zone + * + * @throws DataFormatException + * If the specified precision is not allowed for this type + */ + public InstantType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { + super(theDate, thePrecision, theTimezone); + } + + + /** + * Create a new DateTimeDt using an existing value. Use this constructor with caution, + * as it may create more precision than warranted (since for example it is possible to pass in + * a DateTime with only a year, and this constructor will convert to an InstantDt with + * milliseconds precision). + */ + public InstantType(BaseDateTimeType theDateTime) { + // Do not call super(foo) here, we don't want to trigger a DataFormatException + setValue(theDateTime.getValue()); + setPrecision(DEFAULT_PRECISION); + setTimeZone(theDateTime.getTimeZone()); + } + + /** + * Create a new DateTimeDt with the given date/time and {@link TemporalPrecisionEnum#MILLI} precision + */ + public InstantType(Date theDate) { + super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); + } + + /** + * Constructor which accepts a date value and a precision value. Valid + * precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ + public InstantType(Date theDate, TemporalPrecisionEnum thePrecision) { + setValue(theDate); + setPrecision(thePrecision); + setTimeZone(TimeZone.getDefault()); + } + + /** + * Create a new InstantDt from a string value + * + * @param theString + * The string representation of the string. Must be in a valid + * format according to the FHIR specification + * @throws DataFormatException + */ + public InstantType(String theString) { + super(theString); + } + + /** + * Invokes {@link Date#after(Date)} on the contained Date against the given + * date + * + * @throws NullPointerException + * If the {@link #getValue() contained Date} is null + */ + public boolean after(Date theDate) { + return getValue().after(theDate); + } + + /** + * Invokes {@link Date#before(Date)} on the contained Date against the given + * date + * + * @throws NullPointerException + * If the {@link #getValue() contained Date} is null + */ + public boolean before(Date theDate) { + return getValue().before(theDate); + } + + /** + * Sets the value of this instant to the current time (from the system + * clock) and the local/default timezone (as retrieved using + * {@link TimeZone#getDefault()}. This TimeZone is generally obtained from + * the underlying OS. + */ + public void setToCurrentTimeInLocalTimeZone() { + setValue(new Date()); + setTimeZone(TimeZone.getDefault()); + } + + @Override + boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { + switch (thePrecision) { + case SECOND: + case MILLI: + return true; + default: + return false; + } + } + + /** + * Factory method which creates a new InstantDt with millisecond precision and initializes it with the + * current time and the system local timezone. + */ + public static InstantType withCurrentTime() { + return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); + } + + /** + * Returns the default precision for this datatype + * + * @see #DEFAULT_PRECISION + */ + @Override + protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { + return DEFAULT_PRECISION; + } + + + @Override + public InstantType copy() { + return new InstantType(getValueAsString()); + } + + /** + * 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; + } + + public String fhirType() { + return "instant"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/IntegerType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/IntegerType.java new file mode 100644 index 00000000000..2756466996c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/IntegerType.java @@ -0,0 +1,110 @@ +/* +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. + + */ +/** + * + */ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.instance.model.api.IBaseIntegerDatatype; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "integer" in FHIR: A signed 32-bit integer + */ +@DatatypeDef(name = "integer") +public class IntegerType extends PrimitiveType implements IBaseIntegerDatatype { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public IntegerType() { + // nothing + } + + /** + * Constructor + */ + public IntegerType(int theInteger) { + setValue(theInteger); + } + + /** + * Constructor + * + * @param theIntegerAsString + * A string representation of an integer + * @throws IllegalArgumentException + * If the string is not a valid integer representation + */ + 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()); + } + } + + @Override + protected Integer parse(String theValue) { + try { + return Integer.parseInt(theValue); + } catch (NumberFormatException e) { + throw new IllegalArgumentException(e); + } + } + + @Override + protected String encode(Integer theValue) { + return Integer.toString(theValue); + } + + @Override + public IntegerType copy() { + return new IntegerType(getValue()); + } + + public String fhirType() { + return "integer"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Library.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Library.java new file mode 100644 index 00000000000..a99bbff83f0 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Library.java @@ -0,0 +1,2090 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library. + */ +@ResourceDef(name="Library", profile="http://hl7.org/fhir/Profile/Library") +public class Library extends DomainResource { + + @Block() + public static class LibraryModelComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name element defines the local name of the model as used within the library. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the model", formalDefinition="The name element defines the local name of the model as used within the library." ) + protected StringType name; + + /** + * The identifier element specifies the global, non-version-specific identifier for the model. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The identifier of the model", formalDefinition="The identifier element specifies the global, non-version-specific identifier for the model." ) + protected StringType identifier; + + /** + * The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The version of the model, if any", formalDefinition="The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied." ) + protected StringType version; + + private static final long serialVersionUID = -862601139L; + + /** + * Constructor + */ + public LibraryModelComponent() { + super(); + } + + /** + * Constructor + */ + public LibraryModelComponent(StringType identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #name} (The name element defines the local name of the model as used within the library.). 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 LibraryModelComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 element defines the local name of the model as used within the library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public LibraryModelComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name element defines the local name of the model as used within the library. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name element defines the local name of the model as used within the library. + */ + public LibraryModelComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the model.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LibraryModelComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + 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} (The identifier element specifies the global, non-version-specific identifier for the model.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public LibraryModelComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier element specifies the global, non-version-specific identifier for the model. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier element specifies the global, non-version-specific identifier for the model. + */ + public LibraryModelComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LibraryModelComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public LibraryModelComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied. + */ + public LibraryModelComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name element defines the local name of the model as used within the library.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("identifier", "string", "The identifier element specifies the global, non-version-specific identifier for the model.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied.", 0, java.lang.Integer.MAX_VALUE, version)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.name"); + } + else if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.identifier"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.version"); + } + else + return super.addChild(name); + } + + public LibraryModelComponent copy() { + LibraryModelComponent dst = new LibraryModelComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LibraryModelComponent)) + return false; + LibraryModelComponent o = (LibraryModelComponent) other; + return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LibraryModelComponent)) + return false; + LibraryModelComponent o = (LibraryModelComponent) other; + return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()); + } + + public String fhirType() { + return "Library.model"; + + } + + } + + @Block() + public static class LibraryLibraryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name element defines the local name of the referenced library. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the library", formalDefinition="The name element defines the local name of the referenced library." ) + protected StringType name; + + /** + * The identifier element specifies the global, non-version-specific identifier for the library. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The identifier of the library", formalDefinition="The identifier element specifies the global, non-version-specific identifier for the library." ) + protected StringType identifier; + + /** + * The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The version of the library, if any", formalDefinition="The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied." ) + protected StringType version; + + /** + * The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document. + */ + @Child(name = "document", type = {Attachment.class, ModuleDefinition.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The content of the library", formalDefinition="The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document." ) + protected Type document; + + private static final long serialVersionUID = 1633488790L; + + /** + * Constructor + */ + public LibraryLibraryComponent() { + super(); + } + + /** + * Constructor + */ + public LibraryLibraryComponent(StringType identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #name} (The name element defines the local name of the referenced library.). 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 LibraryLibraryComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 element defines the local name of the referenced library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public LibraryLibraryComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name element defines the local name of the referenced library. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name element defines the local name of the referenced library. + */ + public LibraryLibraryComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the library.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LibraryLibraryComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + 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} (The identifier element specifies the global, non-version-specific identifier for the library.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public LibraryLibraryComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier element specifies the global, non-version-specific identifier for the library. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier element specifies the global, non-version-specific identifier for the library. + */ + public LibraryLibraryComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LibraryLibraryComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public LibraryLibraryComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied. + */ + public LibraryLibraryComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #document} (The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) + */ + public Type getDocument() { + return this.document; + } + + /** + * @return {@link #document} (The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) + */ + public Attachment getDocumentAttachment() throws FHIRException { + if (!(this.document instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.document.getClass().getName()+" was encountered"); + return (Attachment) this.document; + } + + public boolean hasDocumentAttachment() { + return this.document instanceof Attachment; + } + + /** + * @return {@link #document} (The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) + */ + public Reference getDocumentReference() throws FHIRException { + if (!(this.document instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.document.getClass().getName()+" was encountered"); + return (Reference) this.document; + } + + public boolean hasDocumentReference() { + return this.document instanceof Reference; + } + + public boolean hasDocument() { + return this.document != null && !this.document.isEmpty(); + } + + /** + * @param value {@link #document} (The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) + */ + public LibraryLibraryComponent setDocument(Type value) { + this.document = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name element defines the local name of the referenced library.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("identifier", "string", "The identifier element specifies the global, non-version-specific identifier for the library.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("document[x]", "Attachment|Reference(ModuleDefinition)", "The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.", 0, java.lang.Integer.MAX_VALUE, document)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 861720859: // document + this.document = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("document[x]")) + this.document = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 506673541: return getDocument(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.name"); + } + else if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.identifier"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.version"); + } + else if (name.equals("documentAttachment")) { + this.document = new Attachment(); + return this.document; + } + else if (name.equals("documentReference")) { + this.document = new Reference(); + return this.document; + } + else + return super.addChild(name); + } + + public LibraryLibraryComponent copy() { + LibraryLibraryComponent dst = new LibraryLibraryComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.document = document == null ? null : document.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LibraryLibraryComponent)) + return false; + LibraryLibraryComponent o = (LibraryLibraryComponent) other; + return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(document, o.document, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LibraryLibraryComponent)) + return false; + LibraryLibraryComponent o = (LibraryLibraryComponent) other; + return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (document == null || document.isEmpty()); + } + + public String fhirType() { + return "Library.library"; + + } + + } + + @Block() + public static class LibraryCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the code system", formalDefinition="The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition." ) + protected StringType name; + + /** + * The identifier element specifies the global, non-version-specific identifier for the code system. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The identifier of the code system", formalDefinition="The identifier element specifies the global, non-version-specific identifier for the code system." ) + protected StringType identifier; + + /** + * The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The version of the code system, if any", formalDefinition="The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied." ) + protected StringType version; + + private static final long serialVersionUID = -862601139L; + + /** + * Constructor + */ + public LibraryCodeSystemComponent() { + super(); + } + + /** + * Constructor + */ + public LibraryCodeSystemComponent(StringType identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #name} (The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set 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 LibraryCodeSystemComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public LibraryCodeSystemComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition. + */ + public LibraryCodeSystemComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the code system.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LibraryCodeSystemComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + 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} (The identifier element specifies the global, non-version-specific identifier for the code system.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public LibraryCodeSystemComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier element specifies the global, non-version-specific identifier for the code system. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier element specifies the global, non-version-specific identifier for the code system. + */ + public LibraryCodeSystemComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LibraryCodeSystemComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public LibraryCodeSystemComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied. + */ + public LibraryCodeSystemComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("identifier", "string", "The identifier element specifies the global, non-version-specific identifier for the code system.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied.", 0, java.lang.Integer.MAX_VALUE, version)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.name"); + } + else if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.identifier"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.version"); + } + else + return super.addChild(name); + } + + public LibraryCodeSystemComponent copy() { + LibraryCodeSystemComponent dst = new LibraryCodeSystemComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LibraryCodeSystemComponent)) + return false; + LibraryCodeSystemComponent o = (LibraryCodeSystemComponent) other; + return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LibraryCodeSystemComponent)) + return false; + LibraryCodeSystemComponent o = (LibraryCodeSystemComponent) other; + return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()); + } + + public String fhirType() { + return "Library.codeSystem"; + + } + + } + + @Block() + public static class LibraryValueSetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name element specifies the local name of the value set used within the library. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the value set", formalDefinition="The name element specifies the local name of the value set used within the library." ) + protected StringType name; + + /** + * The identifier element specifies the global, non-version-specific identifier for the value set. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The identifier of the value set", formalDefinition="The identifier element specifies the global, non-version-specific identifier for the value set." ) + protected StringType identifier; + + /** + * The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The version of the value set", formalDefinition="The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied." ) + protected StringType version; + + /** + * The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version. + */ + @Child(name = "codeSystem", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The code system binding for this value set definition", formalDefinition="The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version." ) + protected List codeSystem; + + private static final long serialVersionUID = 338950096L; + + /** + * Constructor + */ + public LibraryValueSetComponent() { + super(); + } + + /** + * Constructor + */ + public LibraryValueSetComponent(StringType identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #name} (The name element specifies the local name of the value set used within the library.). 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 LibraryValueSetComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 element specifies the local name of the value set used within the library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public LibraryValueSetComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name element specifies the local name of the value set used within the library. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name element specifies the local name of the value set used within the library. + */ + public LibraryValueSetComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the value set.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LibraryValueSetComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + 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} (The identifier element specifies the global, non-version-specific identifier for the value set.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public LibraryValueSetComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier element specifies the global, non-version-specific identifier for the value set. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier element specifies the global, non-version-specific identifier for the value set. + */ + public LibraryValueSetComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LibraryValueSetComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public LibraryValueSetComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied. + */ + public LibraryValueSetComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #codeSystem} (The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.) + */ + public List getCodeSystem() { + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + return this.codeSystem; + } + + public boolean hasCodeSystem() { + if (this.codeSystem == null) + return false; + for (StringType item : this.codeSystem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeSystem} (The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.) + */ + // syntactic sugar + public StringType addCodeSystemElement() {//2 + StringType t = new StringType(); + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return t; + } + + /** + * @param value {@link #codeSystem} (The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.) + */ + public LibraryValueSetComponent addCodeSystem(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return this; + } + + /** + * @param value {@link #codeSystem} (The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.) + */ + public boolean hasCodeSystem(String value) { + if (this.codeSystem == null) + return false; + for (StringType v : this.codeSystem) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name element specifies the local name of the value set used within the library.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("identifier", "string", "The identifier element specifies the global, non-version-specific identifier for the value set.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("codeSystem", "string", "The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case -916511108: // codeSystem + this.getCodeSystem().add(castToString(value)); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("codeSystem")) + this.getCodeSystem().add(castToString(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case -916511108: throw new FHIRException("Cannot make property codeSystem as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.name"); + } + else if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.identifier"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.version"); + } + else if (name.equals("codeSystem")) { + throw new FHIRException("Cannot call addChild on a primitive type Library.codeSystem"); + } + else + return super.addChild(name); + } + + public LibraryValueSetComponent copy() { + LibraryValueSetComponent dst = new LibraryValueSetComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + if (codeSystem != null) { + dst.codeSystem = new ArrayList(); + for (StringType i : codeSystem) + dst.codeSystem.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LibraryValueSetComponent)) + return false; + LibraryValueSetComponent o = (LibraryValueSetComponent) other; + return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(codeSystem, o.codeSystem, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LibraryValueSetComponent)) + return false; + LibraryValueSetComponent o = (LibraryValueSetComponent) other; + return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) + && compareValues(codeSystem, o.codeSystem, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) + ; + } + + public String fhirType() { + return "Library.valueSet"; + + } + + } + + /** + * The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence. + */ + @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The metadata information for the library", formalDefinition="The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence." ) + protected ModuleMetadata moduleMetadata; + + /** + * A model element describes the model and version used by the library. + */ + @Child(name = "model", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A model used by the library", formalDefinition="A model element describes the model and version used by the library." ) + protected List model; + + /** + * A library element describes a library referenced by this library. + */ + @Child(name = "library", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A library referenced by this library", formalDefinition="A library element describes a library referenced by this library." ) + protected List library; + + /** + * A code system definition used within the library. + */ + @Child(name = "codeSystem", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A code system used by the library", formalDefinition="A code system definition used within the library." ) + protected List codeSystem; + + /** + * A value set definition referenced by the library. + */ + @Child(name = "valueSet", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A value set used by the library", formalDefinition="A value set definition referenced by the library." ) + protected List valueSet; + + /** + * The parameter element defines parameters used by the library. + */ + @Child(name = "parameter", type = {ParameterDefinition.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Parameters defined by the library", formalDefinition="The parameter element defines parameters used by the library." ) + protected List parameter; + + /** + * The dataRequirement element specifies a data requirement used by some expression within the library. + */ + @Child(name = "dataRequirement", type = {DataRequirement.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Data requirements of the library", formalDefinition="The dataRequirement element specifies a data requirement used by some expression within the library." ) + protected List dataRequirement; + + /** + * The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document. + */ + @Child(name = "document", type = {Attachment.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The content of the library", formalDefinition="The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document." ) + protected Attachment document; + + private static final long serialVersionUID = 36997599L; + + /** + * Constructor + */ + public Library() { + super(); + } + + /** + * Constructor + */ + public Library(Attachment document) { + super(); + this.document = document; + } + + /** + * @return {@link #moduleMetadata} (The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence.) + */ + public ModuleMetadata getModuleMetadata() { + if (this.moduleMetadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Library.moduleMetadata"); + else if (Configuration.doAutoCreate()) + this.moduleMetadata = new ModuleMetadata(); // cc + return this.moduleMetadata; + } + + public boolean hasModuleMetadata() { + return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); + } + + /** + * @param value {@link #moduleMetadata} (The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence.) + */ + public Library setModuleMetadata(ModuleMetadata value) { + this.moduleMetadata = value; + return this; + } + + /** + * @return {@link #model} (A model element describes the model and version used by the library.) + */ + public List getModel() { + if (this.model == null) + this.model = new ArrayList(); + return this.model; + } + + public boolean hasModel() { + if (this.model == null) + return false; + for (LibraryModelComponent item : this.model) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #model} (A model element describes the model and version used by the library.) + */ + // syntactic sugar + public LibraryModelComponent addModel() { //3 + LibraryModelComponent t = new LibraryModelComponent(); + if (this.model == null) + this.model = new ArrayList(); + this.model.add(t); + return t; + } + + // syntactic sugar + public Library addModel(LibraryModelComponent t) { //3 + if (t == null) + return this; + if (this.model == null) + this.model = new ArrayList(); + this.model.add(t); + return this; + } + + /** + * @return {@link #library} (A library element describes a library referenced by this library.) + */ + public List getLibrary() { + if (this.library == null) + this.library = new ArrayList(); + return this.library; + } + + public boolean hasLibrary() { + if (this.library == null) + return false; + for (LibraryLibraryComponent item : this.library) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #library} (A library element describes a library referenced by this library.) + */ + // syntactic sugar + public LibraryLibraryComponent addLibrary() { //3 + LibraryLibraryComponent t = new LibraryLibraryComponent(); + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return t; + } + + // syntactic sugar + public Library addLibrary(LibraryLibraryComponent t) { //3 + if (t == null) + return this; + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return this; + } + + /** + * @return {@link #codeSystem} (A code system definition used within the library.) + */ + public List getCodeSystem() { + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + return this.codeSystem; + } + + public boolean hasCodeSystem() { + if (this.codeSystem == null) + return false; + for (LibraryCodeSystemComponent item : this.codeSystem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeSystem} (A code system definition used within the library.) + */ + // syntactic sugar + public LibraryCodeSystemComponent addCodeSystem() { //3 + LibraryCodeSystemComponent t = new LibraryCodeSystemComponent(); + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return t; + } + + // syntactic sugar + public Library addCodeSystem(LibraryCodeSystemComponent t) { //3 + if (t == null) + return this; + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return this; + } + + /** + * @return {@link #valueSet} (A value set definition referenced by the library.) + */ + public List getValueSet() { + if (this.valueSet == null) + this.valueSet = new ArrayList(); + return this.valueSet; + } + + public boolean hasValueSet() { + if (this.valueSet == null) + return false; + for (LibraryValueSetComponent item : this.valueSet) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valueSet} (A value set definition referenced by the library.) + */ + // syntactic sugar + public LibraryValueSetComponent addValueSet() { //3 + LibraryValueSetComponent t = new LibraryValueSetComponent(); + if (this.valueSet == null) + this.valueSet = new ArrayList(); + this.valueSet.add(t); + return t; + } + + // syntactic sugar + public Library addValueSet(LibraryValueSetComponent t) { //3 + if (t == null) + return this; + if (this.valueSet == null) + this.valueSet = new ArrayList(); + this.valueSet.add(t); + return this; + } + + /** + * @return {@link #parameter} (The parameter element defines parameters used by the library.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (ParameterDefinition item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (The parameter element defines parameters used by the library.) + */ + // syntactic sugar + public ParameterDefinition addParameter() { //3 + ParameterDefinition t = new ParameterDefinition(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public Library addParameter(ParameterDefinition t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + /** + * @return {@link #dataRequirement} (The dataRequirement element specifies a data requirement used by some expression within the library.) + */ + public List getDataRequirement() { + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + return this.dataRequirement; + } + + public boolean hasDataRequirement() { + if (this.dataRequirement == null) + return false; + for (DataRequirement item : this.dataRequirement) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dataRequirement} (The dataRequirement element specifies a data requirement used by some expression within the library.) + */ + // syntactic sugar + public DataRequirement addDataRequirement() { //3 + DataRequirement t = new DataRequirement(); + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + this.dataRequirement.add(t); + return t; + } + + // syntactic sugar + public Library addDataRequirement(DataRequirement t) { //3 + if (t == null) + return this; + if (this.dataRequirement == null) + this.dataRequirement = new ArrayList(); + this.dataRequirement.add(t); + return this; + } + + /** + * @return {@link #document} (The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) + */ + public Attachment getDocument() { + if (this.document == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Library.document"); + else if (Configuration.doAutoCreate()) + this.document = new Attachment(); // cc + return this.document; + } + + public boolean hasDocument() { + return this.document != null && !this.document.isEmpty(); + } + + /** + * @param value {@link #document} (The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) + */ + public Library setDocument(Attachment value) { + this.document = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); + childrenList.add(new Property("model", "", "A model element describes the model and version used by the library.", 0, java.lang.Integer.MAX_VALUE, model)); + childrenList.add(new Property("library", "", "A library element describes a library referenced by this library.", 0, java.lang.Integer.MAX_VALUE, library)); + childrenList.add(new Property("codeSystem", "", "A code system definition used within the library.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("valueSet", "", "A value set definition referenced by the library.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + childrenList.add(new Property("parameter", "ParameterDefinition", "The parameter element defines parameters used by the library.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("dataRequirement", "DataRequirement", "The dataRequirement element specifies a data requirement used by some expression within the library.", 0, java.lang.Integer.MAX_VALUE, dataRequirement)); + childrenList.add(new Property("document", "Attachment", "The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.", 0, java.lang.Integer.MAX_VALUE, document)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata + case 104069929: /*model*/ return this.model == null ? new Base[0] : this.model.toArray(new Base[this.model.size()]); // LibraryModelComponent + case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // LibraryLibraryComponent + case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // LibraryCodeSystemComponent + case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : this.valueSet.toArray(new Base[this.valueSet.size()]); // LibraryValueSetComponent + case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParameterDefinition + case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement + case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Attachment + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 455891387: // moduleMetadata + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + break; + case 104069929: // model + this.getModel().add((LibraryModelComponent) value); // LibraryModelComponent + break; + case 166208699: // library + this.getLibrary().add((LibraryLibraryComponent) value); // LibraryLibraryComponent + break; + case -916511108: // codeSystem + this.getCodeSystem().add((LibraryCodeSystemComponent) value); // LibraryCodeSystemComponent + break; + case -1410174671: // valueSet + this.getValueSet().add((LibraryValueSetComponent) value); // LibraryValueSetComponent + break; + case 1954460585: // parameter + this.getParameter().add(castToParameterDefinition(value)); // ParameterDefinition + break; + case 629147193: // dataRequirement + this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement + break; + case 861720859: // document + this.document = castToAttachment(value); // Attachment + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("moduleMetadata")) + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + else if (name.equals("model")) + this.getModel().add((LibraryModelComponent) value); + else if (name.equals("library")) + this.getLibrary().add((LibraryLibraryComponent) value); + else if (name.equals("codeSystem")) + this.getCodeSystem().add((LibraryCodeSystemComponent) value); + else if (name.equals("valueSet")) + this.getValueSet().add((LibraryValueSetComponent) value); + else if (name.equals("parameter")) + this.getParameter().add(castToParameterDefinition(value)); + else if (name.equals("dataRequirement")) + this.getDataRequirement().add(castToDataRequirement(value)); + else if (name.equals("document")) + this.document = castToAttachment(value); // Attachment + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 455891387: return getModuleMetadata(); // ModuleMetadata + case 104069929: return addModel(); // LibraryModelComponent + case 166208699: return addLibrary(); // LibraryLibraryComponent + case -916511108: return addCodeSystem(); // LibraryCodeSystemComponent + case -1410174671: return addValueSet(); // LibraryValueSetComponent + case 1954460585: return addParameter(); // ParameterDefinition + case 629147193: return addDataRequirement(); // DataRequirement + case 861720859: return getDocument(); // Attachment + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("moduleMetadata")) { + this.moduleMetadata = new ModuleMetadata(); + return this.moduleMetadata; + } + else if (name.equals("model")) { + return addModel(); + } + else if (name.equals("library")) { + return addLibrary(); + } + else if (name.equals("codeSystem")) { + return addCodeSystem(); + } + else if (name.equals("valueSet")) { + return addValueSet(); + } + else if (name.equals("parameter")) { + return addParameter(); + } + else if (name.equals("dataRequirement")) { + return addDataRequirement(); + } + else if (name.equals("document")) { + this.document = new Attachment(); + return this.document; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Library"; + + } + + public Library copy() { + Library dst = new Library(); + copyValues(dst); + dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); + if (model != null) { + dst.model = new ArrayList(); + for (LibraryModelComponent i : model) + dst.model.add(i.copy()); + }; + if (library != null) { + dst.library = new ArrayList(); + for (LibraryLibraryComponent i : library) + dst.library.add(i.copy()); + }; + if (codeSystem != null) { + dst.codeSystem = new ArrayList(); + for (LibraryCodeSystemComponent i : codeSystem) + dst.codeSystem.add(i.copy()); + }; + if (valueSet != null) { + dst.valueSet = new ArrayList(); + for (LibraryValueSetComponent i : valueSet) + dst.valueSet.add(i.copy()); + }; + if (parameter != null) { + dst.parameter = new ArrayList(); + for (ParameterDefinition i : parameter) + dst.parameter.add(i.copy()); + }; + if (dataRequirement != null) { + dst.dataRequirement = new ArrayList(); + for (DataRequirement i : dataRequirement) + dst.dataRequirement.add(i.copy()); + }; + dst.document = document == null ? null : document.copy(); + return dst; + } + + protected Library typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Library)) + return false; + Library o = (Library) other; + return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(model, o.model, true) + && compareDeep(library, o.library, true) && compareDeep(codeSystem, o.codeSystem, true) && compareDeep(valueSet, o.valueSet, true) + && compareDeep(parameter, o.parameter, true) && compareDeep(dataRequirement, o.dataRequirement, true) + && compareDeep(document, o.document, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Library)) + return false; + Library o = (Library) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (model == null || model.isEmpty()) + && (library == null || library.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) + && (valueSet == null || valueSet.isEmpty()) && (parameter == null || parameter.isEmpty()) + && (dataRequirement == null || dataRequirement.isEmpty()) && (document == null || document.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Library; + } + + /** + * Search parameter: topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: Library.moduleMetadata.topic
+ *

+ */ + @SearchParamDefinition(name="topic", path="Library.moduleMetadata.topic", description="Topics associated with the module", type="token" ) + public static final String SP_TOPIC = "topic"; + /** + * Fluent Client search parameter constant for topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: Library.moduleMetadata.topic
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); + + /** + * Search parameter: title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: Library.moduleMetadata.title
+ *

+ */ + @SearchParamDefinition(name="title", path="Library.moduleMetadata.title", description="Text search against the title", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: Library.moduleMetadata.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: Library.moduleMetadata.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Library.moduleMetadata.status", description="Status of the module", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: Library.moduleMetadata.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: Library.moduleMetadata.description
+ *

+ */ + @SearchParamDefinition(name="description", path="Library.moduleMetadata.description", description="Text search against the description", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: Library.moduleMetadata.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: Library.moduleMetadata.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Library.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: Library.moduleMetadata.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: Library.moduleMetadata.version
+ *

+ */ + @SearchParamDefinition(name="version", path="Library.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: Library.moduleMetadata.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Linkage.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Linkage.java new file mode 100644 index 00000000000..5d8938b6143 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Linkage.java @@ -0,0 +1,660 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". + */ +@ResourceDef(name="Linkage", profile="http://hl7.org/fhir/Profile/Linkage") +public class Linkage extends DomainResource { + + public enum LinkageType { + /** + * The record represents the "source of truth" (from the perspective of this Linkage resource) for the underlying event/condition/etc. + */ + SOURCE, + /** + * The record represents the alternative view of the underlying event/condition/etc. The record may still be actively maintained, even though it is not considered to be the source of truth. + */ + ALTERNATE, + /** + * The record represents an obsolete record of the underlyng event/condition/etc. It is not expected to be actively maintained. + */ + HISTORICAL, + /** + * added to help the parsers + */ + NULL; + public static LinkageType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return SOURCE; + if ("alternate".equals(codeString)) + return ALTERNATE; + if ("historical".equals(codeString)) + return HISTORICAL; + throw new FHIRException("Unknown LinkageType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case SOURCE: return "source"; + case ALTERNATE: return "alternate"; + case HISTORICAL: return "historical"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SOURCE: return "http://hl7.org/fhir/linkage-type"; + case ALTERNATE: return "http://hl7.org/fhir/linkage-type"; + case HISTORICAL: return "http://hl7.org/fhir/linkage-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SOURCE: return "The record represents the \"source of truth\" (from the perspective of this Linkage resource) for the underlying event/condition/etc."; + case ALTERNATE: return "The record represents the alternative view of the underlying event/condition/etc. The record may still be actively maintained, even though it is not considered to be the source of truth."; + case HISTORICAL: return "The record represents an obsolete record of the underlyng event/condition/etc. It is not expected to be actively maintained."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SOURCE: return "Source of truth"; + case ALTERNATE: return "Alternate record"; + case HISTORICAL: return "Historical/obsolete record"; + default: return "?"; + } + } + } + + public static class LinkageTypeEnumFactory implements EnumFactory { + public LinkageType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return LinkageType.SOURCE; + if ("alternate".equals(codeString)) + return LinkageType.ALTERNATE; + if ("historical".equals(codeString)) + return LinkageType.HISTORICAL; + throw new IllegalArgumentException("Unknown LinkageType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return new Enumeration(this, LinkageType.SOURCE); + if ("alternate".equals(codeString)) + return new Enumeration(this, LinkageType.ALTERNATE); + if ("historical".equals(codeString)) + return new Enumeration(this, LinkageType.HISTORICAL); + throw new FHIRException("Unknown LinkageType code '"+codeString+"'"); + } + public String toCode(LinkageType code) { + if (code == LinkageType.SOURCE) + return "source"; + if (code == LinkageType.ALTERNATE) + return "alternate"; + if (code == LinkageType.HISTORICAL) + return "historical"; + return "?"; + } + public String toSystem(LinkageType code) { + return code.getSystem(); + } + } + + @Block() + public static class LinkageItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="source | alternate | historical", formalDefinition="Distinguishes which item is \"source of truth\" (if any) and which items are no longer considered to be current representations." ) + protected Enumeration type; + + /** + * The resource instance being linked as part of the group. + */ + @Child(name = "resource", type = {Reference.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource being linked", formalDefinition="The resource instance being linked as part of the group." ) + protected Reference resource; + + private static final long serialVersionUID = 527428511L; + + /** + * Constructor + */ + public LinkageItemComponent() { + super(); + } + + /** + * Constructor + */ + public LinkageItemComponent(Enumeration type, Reference resource) { + super(); + this.type = type; + this.resource = resource; + } + + /** + * @return {@link #type} (Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations.). 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 LinkageItemComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new LinkageTypeEnumFactory()); // bb + 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} (Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public LinkageItemComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations. + */ + public LinkageType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations. + */ + public LinkageItemComponent setType(LinkageType value) { + if (this.type == null) + this.type = new Enumeration(new LinkageTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #resource} (The resource instance being linked as part of the group.) + */ + public Reference getResource() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LinkageItemComponent.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new Reference(); // cc + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The resource instance being linked as part of the group.) + */ + public LinkageItemComponent setResource(Reference value) { + this.resource = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Distinguishes which item is \"source of truth\" (if any) and which items are no longer considered to be current representations.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("resource", "Reference", "The resource instance being linked as part of the group.", 0, java.lang.Integer.MAX_VALUE, resource)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new LinkageTypeEnumFactory().fromType(value); // Enumeration + break; + case -341064690: // resource + this.resource = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new LinkageTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("resource")) + this.resource = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -341064690: return getResource(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Linkage.type"); + } + else if (name.equals("resource")) { + this.resource = new Reference(); + return this.resource; + } + else + return super.addChild(name); + } + + public LinkageItemComponent copy() { + LinkageItemComponent dst = new LinkageItemComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.resource = resource == null ? null : resource.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LinkageItemComponent)) + return false; + LinkageItemComponent o = (LinkageItemComponent) other; + return compareDeep(type, o.type, true) && compareDeep(resource, o.resource, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LinkageItemComponent)) + return false; + LinkageItemComponent o = (LinkageItemComponent) other; + return compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (resource == null || resource.isEmpty()) + ; + } + + public String fhirType() { + return "Linkage.item"; + + } + + } + + /** + * Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage. + */ + @Child(name = "author", type = {Practitioner.class, Organization.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who is responsible for linkages", formalDefinition="Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) + */ + protected Resource authorTarget; + + /** + * Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items. + */ + @Child(name = "item", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Item to be linked", formalDefinition="Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items." ) + protected List item; + + private static final long serialVersionUID = 371266420L; + + /** + * Constructor + */ + public Linkage() { + super(); + } + + /** + * @return {@link #author} (Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Linkage.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) + */ + public Linkage setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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 user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} 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 user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) + */ + public Linkage setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #item} (Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (LinkageItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items.) + */ + // syntactic sugar + public LinkageItemComponent addItem() { //3 + LinkageItemComponent t = new LinkageItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public Linkage addItem(LinkageItemComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("author", "Reference(Practitioner|Organization)", "Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("item", "", "Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // LinkageItemComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case 3242771: // item + this.getItem().add((LinkageItemComponent) value); // LinkageItemComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("item")) + this.getItem().add((LinkageItemComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1406328437: return getAuthor(); // Reference + case 3242771: return addItem(); // LinkageItemComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("item")) { + return addItem(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Linkage"; + + } + + public Linkage copy() { + Linkage dst = new Linkage(); + copyValues(dst); + dst.author = author == null ? null : author.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (LinkageItemComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + protected Linkage typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Linkage)) + return false; + Linkage o = (Linkage) other; + return compareDeep(author, o.author, true) && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Linkage)) + return false; + Linkage o = (Linkage) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (author == null || author.isEmpty()) && (item == null || item.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Linkage; + } + + /** + * Search parameter: author + *

+ * Description: Author of the Linkage
+ * Type: reference
+ * Path: Linkage.author
+ *

+ */ + @SearchParamDefinition(name="author", path="Linkage.author", description="Author of the Linkage", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: Author of the Linkage
+ * Type: reference
+ * Path: Linkage.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Linkage:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Linkage:author").toLocked(); + + /** + * Search parameter: source + *

+ * Description: Matches on any item in the Linkage with a type of 'source'
+ * Type: reference
+ * Path: Linkage.item.resource
+ *

+ */ + @SearchParamDefinition(name="source", path="Linkage.item.resource", description="Matches on any item in the Linkage with a type of 'source'", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: Matches on any item in the Linkage with a type of 'source'
+ * Type: reference
+ * Path: Linkage.item.resource
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Linkage:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("Linkage:source").toLocked(); + + /** + * Search parameter: item + *

+ * Description: Matches on any item in the Linkage
+ * Type: reference
+ * Path: Linkage.item.resource
+ *

+ */ + @SearchParamDefinition(name="item", path="Linkage.item.resource", description="Matches on any item in the Linkage", type="reference" ) + public static final String SP_ITEM = "item"; + /** + * Fluent Client search parameter constant for item + *

+ * Description: Matches on any item in the Linkage
+ * Type: reference
+ * Path: Linkage.item.resource
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ITEM); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Linkage:item". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ITEM = new ca.uhn.fhir.model.api.Include("Linkage:item").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ListResource.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ListResource.java new file mode 100644 index 00000000000..6d2febe1179 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ListResource.java @@ -0,0 +1,1761 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A set of information summarized from a list of other resources. + */ +@ResourceDef(name="List", profile="http://hl7.org/fhir/Profile/ListResource") +public class ListResource extends DomainResource { + + public enum ListStatus { + /** + * The list is considered to be an active part of the patient's record. + */ + CURRENT, + /** + * The list is "old" and should no longer be considered accurate or relevant. + */ + RETIRED, + /** + * The list was never accurate. It is retained for medico-legal purposes only. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static ListStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return CURRENT; + if ("retired".equals(codeString)) + return RETIRED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown ListStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CURRENT: return "current"; + case RETIRED: return "retired"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CURRENT: return "http://hl7.org/fhir/list-status"; + case RETIRED: return "http://hl7.org/fhir/list-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/list-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CURRENT: return "The list is considered to be an active part of the patient's record."; + case RETIRED: return "The list is \"old\" and should no longer be considered accurate or relevant."; + case ENTEREDINERROR: return "The list was never accurate. It is retained for medico-legal purposes only."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CURRENT: return "Current"; + case RETIRED: return "Retired"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + } + + public static class ListStatusEnumFactory implements EnumFactory { + public ListStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return ListStatus.CURRENT; + if ("retired".equals(codeString)) + return ListStatus.RETIRED; + if ("entered-in-error".equals(codeString)) + return ListStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ListStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return new Enumeration(this, ListStatus.CURRENT); + if ("retired".equals(codeString)) + return new Enumeration(this, ListStatus.RETIRED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, ListStatus.ENTEREDINERROR); + throw new FHIRException("Unknown ListStatus code '"+codeString+"'"); + } + public String toCode(ListStatus code) { + if (code == ListStatus.CURRENT) + return "current"; + if (code == ListStatus.RETIRED) + return "retired"; + if (code == ListStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(ListStatus code) { + return code.getSystem(); + } + } + + public enum ListMode { + /** + * This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes + */ + WORKING, + /** + * This list was prepared as a snapshot. It should not be assumed to be current + */ + SNAPSHOT, + /** + * A list that indicates where changes have been made or recommended + */ + CHANGES, + /** + * added to help the parsers + */ + NULL; + public static ListMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("working".equals(codeString)) + return WORKING; + if ("snapshot".equals(codeString)) + return SNAPSHOT; + if ("changes".equals(codeString)) + return CHANGES; + throw new FHIRException("Unknown ListMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case WORKING: return "working"; + case SNAPSHOT: return "snapshot"; + case CHANGES: return "changes"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case WORKING: return "http://hl7.org/fhir/list-mode"; + case SNAPSHOT: return "http://hl7.org/fhir/list-mode"; + case CHANGES: return "http://hl7.org/fhir/list-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case WORKING: return "This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes"; + case SNAPSHOT: return "This list was prepared as a snapshot. It should not be assumed to be current"; + case CHANGES: return "A list that indicates where changes have been made or recommended"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case WORKING: return "Working List"; + case SNAPSHOT: return "Snapshot List"; + case CHANGES: return "Change List"; + default: return "?"; + } + } + } + + 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; + if ("working".equals(codeString)) + return ListMode.WORKING; + if ("snapshot".equals(codeString)) + return ListMode.SNAPSHOT; + if ("changes".equals(codeString)) + return ListMode.CHANGES; + throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("working".equals(codeString)) + return new Enumeration(this, ListMode.WORKING); + if ("snapshot".equals(codeString)) + return new Enumeration(this, ListMode.SNAPSHOT); + if ("changes".equals(codeString)) + return new Enumeration(this, ListMode.CHANGES); + throw new FHIRException("Unknown ListMode code '"+codeString+"'"); + } + public String toCode(ListMode code) { + if (code == ListMode.WORKING) + return "working"; + if (code == ListMode.SNAPSHOT) + return "snapshot"; + if (code == ListMode.CHANGES) + return "changes"; + return "?"; + } + public String toSystem(ListMode code) { + return code.getSystem(); + } + } + + @Block() + public static class ListEntryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The flag allows the system constructing the list to indicate the role and significance of the item in the list. + */ + @Child(name = "flag", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Status/Workflow information about this item", formalDefinition="The flag allows the system constructing the list to indicate the role and significance of the item in the list." ) + protected CodeableConcept flag; + + /** + * True if this item is marked as deleted in the list. + */ + @Child(name = "deleted", type = {BooleanType.class}, order=2, min=0, max=1, modifier=true, summary=false) + @Description(shortDefinition="If this item is actually marked as deleted", formalDefinition="True if this item is marked as deleted in the list." ) + protected BooleanType deleted; + + /** + * When this item was added to the list. + */ + @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="When item added to list", formalDefinition="When this item was added to the list." ) + protected DateTimeType date; + + /** + * A reference to the actual resource from which data was derived. + */ + @Child(name = "item", type = {}, order=4, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Actual entry", formalDefinition="A reference to the actual resource from which data was derived." ) + protected Reference item; + + /** + * The actual object that is the target of the reference (A reference to the actual resource from which data was derived.) + */ + protected Resource itemTarget; + + private static final long serialVersionUID = -758164425L; + + /** + * Constructor + */ + public ListEntryComponent() { + super(); + } + + /** + * Constructor + */ + public ListEntryComponent(Reference item) { + super(); + this.item = item; + } + + /** + * @return {@link #flag} (The flag allows the system constructing the list to indicate the role and significance of the item in the list.) + */ + public CodeableConcept getFlag() { + if (this.flag == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.flag"); + else if (Configuration.doAutoCreate()) + this.flag = new CodeableConcept(); // cc + return this.flag; + } + + public boolean hasFlag() { + return this.flag != null && !this.flag.isEmpty(); + } + + /** + * @param value {@link #flag} (The flag allows the system constructing the list to indicate the role and significance of the item in the list.) + */ + public ListEntryComponent setFlag(CodeableConcept value) { + this.flag = value; + return this; + } + + /** + * @return {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value + */ + public BooleanType getDeletedElement() { + if (this.deleted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.deleted"); + else if (Configuration.doAutoCreate()) + this.deleted = new BooleanType(); // bb + return this.deleted; + } + + public boolean hasDeletedElement() { + return this.deleted != null && !this.deleted.isEmpty(); + } + + public boolean hasDeleted() { + return this.deleted != null && !this.deleted.isEmpty(); + } + + /** + * @param value {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value + */ + public ListEntryComponent setDeletedElement(BooleanType value) { + this.deleted = value; + return this; + } + + /** + * @return True if this item is marked as deleted in the list. + */ + public boolean getDeleted() { + return this.deleted == null || this.deleted.isEmpty() ? false : this.deleted.getValue(); + } + + /** + * @param value True if this item is marked as deleted in the list. + */ + public ListEntryComponent setDeleted(boolean value) { + if (this.deleted == null) + this.deleted = new BooleanType(); + this.deleted.setValue(value); + return this; + } + + /** + * @return {@link #date} (When this item was added to the list.). 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 ListEntryComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ListEntryComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return When this item was added to the list. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value When this item was added to the list. + */ + public ListEntryComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #item} (A reference to the actual resource from which data was derived.) + */ + public Reference getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new Reference(); // cc + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (A reference to the actual resource from which data was derived.) + */ + public ListEntryComponent setItem(Reference value) { + this.item = value; + return this; + } + + /** + * @return {@link #item} 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 actual resource from which data was derived.) + */ + public Resource getItemTarget() { + return this.itemTarget; + } + + /** + * @param value {@link #item} 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 actual resource from which data was derived.) + */ + public ListEntryComponent setItemTarget(Resource value) { + this.itemTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("flag", "CodeableConcept", "The flag allows the system constructing the list to indicate the role and significance of the item in the list.", 0, java.lang.Integer.MAX_VALUE, flag)); + childrenList.add(new Property("deleted", "boolean", "True if this item is marked as deleted in the list.", 0, java.lang.Integer.MAX_VALUE, deleted)); + childrenList.add(new Property("date", "dateTime", "When this item was added to the list.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("item", "Reference(Any)", "A reference to the actual resource from which data was derived.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3145580: /*flag*/ return this.flag == null ? new Base[0] : new Base[] {this.flag}; // CodeableConcept + case 1550463001: /*deleted*/ return this.deleted == null ? new Base[0] : new Base[] {this.deleted}; // BooleanType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3145580: // flag + this.flag = castToCodeableConcept(value); // CodeableConcept + break; + case 1550463001: // deleted + this.deleted = castToBoolean(value); // BooleanType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 3242771: // item + this.item = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("flag")) + this.flag = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("deleted")) + this.deleted = castToBoolean(value); // BooleanType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("item")) + this.item = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3145580: return getFlag(); // CodeableConcept + case 1550463001: throw new FHIRException("Cannot make property deleted as it is not a complex type"); // BooleanType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 3242771: return getItem(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("flag")) { + this.flag = new CodeableConcept(); + return this.flag; + } + else if (name.equals("deleted")) { + throw new FHIRException("Cannot call addChild on a primitive type ListResource.deleted"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ListResource.date"); + } + else if (name.equals("item")) { + this.item = new Reference(); + return this.item; + } + else + return super.addChild(name); + } + + public ListEntryComponent copy() { + ListEntryComponent dst = new ListEntryComponent(); + copyValues(dst); + dst.flag = flag == null ? null : flag.copy(); + dst.deleted = deleted == null ? null : deleted.copy(); + dst.date = date == null ? null : date.copy(); + dst.item = item == null ? null : item.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ListEntryComponent)) + return false; + ListEntryComponent o = (ListEntryComponent) other; + return compareDeep(flag, o.flag, true) && compareDeep(deleted, o.deleted, true) && compareDeep(date, o.date, true) + && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ListEntryComponent)) + return false; + ListEntryComponent o = (ListEntryComponent) other; + return compareValues(deleted, o.deleted, true) && compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (flag == null || flag.isEmpty()) && (deleted == null || deleted.isEmpty()) + && (date == null || date.isEmpty()) && (item == null || item.isEmpty()); + } + + public String fhirType() { + return "List.entry"; + + } + + } + + /** + * Identifier for the List assigned for business purposes outside the context of FHIR. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier for the List assigned for business purposes outside the context of FHIR." ) + protected List identifier; + + /** + * Indicates the current state of this list. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="current | retired | entered-in-error", formalDefinition="Indicates the current state of this list." ) + protected Enumeration status; + + /** + * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + @Child(name = "mode", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="working | snapshot | changes", formalDefinition="How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted." ) + protected Enumeration mode; + + /** + * A label for the list assigned by the author. + */ + @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Descriptive name for the list", formalDefinition="A label for the list assigned by the author." ) + protected StringType title; + + /** + * This code defines the purpose of the list - why it was created. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="What the purpose of this list is", formalDefinition="This code defines the purpose of the list - why it was created." ) + protected CodeableConcept code; + + /** + * The common subject (or patient) of the resources that are in the list, if there is one. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If all resources have the same subject", formalDefinition="The common subject (or patient) of the resources that are in the list, if there is one." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + protected Resource subjectTarget; + + /** + * The encounter that is the context in which this list was created. + */ + @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Context in which list created", formalDefinition="The encounter that is the context in which this list was created." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter that is the context in which this list was created.) + */ + protected Encounter encounterTarget; + + /** + * The date that the list was prepared. + */ + @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the list was prepared", formalDefinition="The date that the list was prepared." ) + protected DateTimeType date; + + /** + * The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list. + */ + @Child(name = "source", type = {Practitioner.class, Patient.class, Device.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who and/or what defined the list contents (aka Author)", formalDefinition="The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) + */ + protected Resource sourceTarget; + + /** + * What order applies to the items in the list. + */ + @Child(name = "orderedBy", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="What order the list has", formalDefinition="What order applies to the items in the list." ) + protected CodeableConcept orderedBy; + + /** + * Comments that apply to the overall list. + */ + @Child(name = "note", type = {Annotation.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Comments about the list", formalDefinition="Comments that apply to the overall list." ) + protected List note; + + /** + * Entries in this list. + */ + @Child(name = "entry", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Entries in the list", formalDefinition="Entries in this list." ) + protected List entry; + + /** + * If the list is empty, why the list is empty. + */ + @Child(name = "emptyReason", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why list is empty", formalDefinition="If the list is empty, why the list is empty." ) + protected CodeableConcept emptyReason; + + private static final long serialVersionUID = 2071342704L; + + /** + * Constructor + */ + public ListResource() { + super(); + } + + /** + * Constructor + */ + public ListResource(Enumeration status, Enumeration mode) { + super(); + this.status = status; + this.mode = mode; + } + + /** + * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) + */ + 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 the List assigned for business purposes outside the context of FHIR.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ListResource addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (Indicates the current state of this list.). 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 ListResource.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ListStatusEnumFactory()); // bb + 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 the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ListResource setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates the current state of this list. + */ + public ListStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates the current state of this list. + */ + public ListResource setStatus(ListStatus value) { + if (this.status == null) + this.status = new Enumeration(new ListStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). 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 ListResource.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new ListModeEnumFactory()); // bb + 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} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ListResource setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + public ListMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + public ListResource setMode(ListMode value) { + if (this.mode == null) + this.mode = new Enumeration(new ListModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListResource.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public ListResource setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A label for the list assigned by the author. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A label for the list assigned by the author. + */ + public ListResource setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (This code defines the purpose of the list - why it was created.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListResource.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (This code defines the purpose of the list - why it was created.) + */ + public ListResource setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListResource.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + public ListResource 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 common subject (or patient) of the resources that are in the list, if there is one.) + */ + public Resource getSubjectTarget() { + 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 common subject (or patient) of the resources that are in the list, if there is one.) + */ + public ListResource setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The encounter that is the context in which this list was created.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListResource.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter that is the context in which this list was created.) + */ + public ListResource 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 that is the context in which this list was created.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListResource.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 that is the context in which this list was created.) + */ + public ListResource setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #date} (The date that the list was prepared.). 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 ListResource.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ListResource setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the list was prepared. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the list was prepared. + */ + public ListResource setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListResource.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) + */ + public ListResource 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. (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) + */ + public Resource getSourceTarget() { + 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. (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) + */ + public ListResource setSourceTarget(Resource value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #orderedBy} (What order applies to the items in the list.) + */ + public CodeableConcept getOrderedBy() { + if (this.orderedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListResource.orderedBy"); + else if (Configuration.doAutoCreate()) + this.orderedBy = new CodeableConcept(); // cc + return this.orderedBy; + } + + public boolean hasOrderedBy() { + return this.orderedBy != null && !this.orderedBy.isEmpty(); + } + + /** + * @param value {@link #orderedBy} (What order applies to the items in the list.) + */ + public ListResource setOrderedBy(CodeableConcept value) { + this.orderedBy = value; + return this; + } + + /** + * @return {@link #note} (Comments that apply to the overall list.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Comments that apply to the overall list.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public ListResource addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #entry} (Entries in this list.) + */ + public List getEntry() { + if (this.entry == null) + this.entry = new ArrayList(); + return this.entry; + } + + public boolean hasEntry() { + if (this.entry == null) + return false; + for (ListEntryComponent item : this.entry) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entry} (Entries in this list.) + */ + // syntactic sugar + public ListEntryComponent addEntry() { //3 + ListEntryComponent t = new ListEntryComponent(); + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return t; + } + + // syntactic sugar + public ListResource addEntry(ListEntryComponent t) { //3 + if (t == null) + return this; + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return this; + } + + /** + * @return {@link #emptyReason} (If the list is empty, why the list is empty.) + */ + public CodeableConcept getEmptyReason() { + if (this.emptyReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListResource.emptyReason"); + else if (Configuration.doAutoCreate()) + this.emptyReason = new CodeableConcept(); // cc + return this.emptyReason; + } + + public boolean hasEmptyReason() { + return this.emptyReason != null && !this.emptyReason.isEmpty(); + } + + /** + * @param value {@link #emptyReason} (If the list is empty, why the list is empty.) + */ + public ListResource setEmptyReason(CodeableConcept value) { + this.emptyReason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for the List assigned for business purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Indicates the current state of this list.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("mode", "code", "How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("title", "string", "A label for the list assigned by the author.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("code", "CodeableConcept", "This code defines the purpose of the list - why it was created.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The common subject (or patient) of the resources that are in the list, if there is one.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter that is the context in which this list was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("date", "dateTime", "The date that the list was prepared.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("source", "Reference(Practitioner|Patient|Device)", "The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("orderedBy", "CodeableConcept", "What order applies to the items in the list.", 0, java.lang.Integer.MAX_VALUE, orderedBy)); + childrenList.add(new Property("note", "Annotation", "Comments that apply to the overall list.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("entry", "", "Entries in this list.", 0, java.lang.Integer.MAX_VALUE, entry)); + childrenList.add(new Property("emptyReason", "CodeableConcept", "If the list is empty, why the list is empty.", 0, java.lang.Integer.MAX_VALUE, emptyReason)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference + case -391079516: /*orderedBy*/ return this.orderedBy == null ? new Base[0] : new Base[] {this.orderedBy}; // CodeableConcept + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // ListEntryComponent + case 1140135409: /*emptyReason*/ return this.emptyReason == null ? new Base[0] : new Base[] {this.emptyReason}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new ListStatusEnumFactory().fromType(value); // Enumeration + break; + case 3357091: // mode + this.mode = new ListModeEnumFactory().fromType(value); // Enumeration + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -896505829: // source + this.source = castToReference(value); // Reference + break; + case -391079516: // orderedBy + this.orderedBy = castToCodeableConcept(value); // CodeableConcept + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case 96667762: // entry + this.getEntry().add((ListEntryComponent) value); // ListEntryComponent + break; + case 1140135409: // emptyReason + this.emptyReason = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new ListStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("mode")) + this.mode = new ListModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("source")) + this.source = castToReference(value); // Reference + else if (name.equals("orderedBy")) + this.orderedBy = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("entry")) + this.getEntry().add((ListEntryComponent) value); + else if (name.equals("emptyReason")) + this.emptyReason = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case 3059181: return getCode(); // CodeableConcept + case -1867885268: return getSubject(); // Reference + case 1524132147: return getEncounter(); // Reference + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -896505829: return getSource(); // Reference + case -391079516: return getOrderedBy(); // CodeableConcept + case 3387378: return addNote(); // Annotation + case 96667762: return addEntry(); // ListEntryComponent + case 1140135409: return getEmptyReason(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ListResource.status"); + } + else if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type ListResource.mode"); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type ListResource.title"); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ListResource.date"); + } + else if (name.equals("source")) { + this.source = new Reference(); + return this.source; + } + else if (name.equals("orderedBy")) { + this.orderedBy = new CodeableConcept(); + return this.orderedBy; + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("entry")) { + return addEntry(); + } + else if (name.equals("emptyReason")) { + this.emptyReason = new CodeableConcept(); + return this.emptyReason; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "List"; + + } + + public ListResource copy() { + ListResource dst = new ListResource(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.title = title == null ? null : title.copy(); + dst.code = code == null ? null : code.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.date = date == null ? null : date.copy(); + dst.source = source == null ? null : source.copy(); + dst.orderedBy = orderedBy == null ? null : orderedBy.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + if (entry != null) { + dst.entry = new ArrayList(); + for (ListEntryComponent i : entry) + dst.entry.add(i.copy()); + }; + dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); + return dst; + } + + protected ListResource typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ListResource)) + return false; + ListResource o = (ListResource) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(mode, o.mode, true) + && compareDeep(title, o.title, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(date, o.date, true) && compareDeep(source, o.source, true) + && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(note, o.note, true) && compareDeep(entry, o.entry, true) + && compareDeep(emptyReason, o.emptyReason, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ListResource)) + return false; + ListResource o = (ListResource) other; + return compareValues(status, o.status, true) && compareValues(mode, o.mode, true) && compareValues(title, o.title, true) + && compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (mode == null || mode.isEmpty()) && (title == null || title.isEmpty()) && (code == null || code.isEmpty()) + && (subject == null || subject.isEmpty()) && (encounter == null || encounter.isEmpty()) && (date == null || date.isEmpty()) + && (source == null || source.isEmpty()) && (orderedBy == null || orderedBy.isEmpty()) && (note == null || note.isEmpty()) + && (entry == null || entry.isEmpty()) && (emptyReason == null || emptyReason.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.List; + } + + /** + * Search parameter: title + *

+ * Description: Descriptive name for the list
+ * Type: string
+ * Path: List.title
+ *

+ */ + @SearchParamDefinition(name="title", path="List.title", description="Descriptive name for the list", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Descriptive name for the list
+ * Type: string
+ * Path: List.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: patient + *

+ * Description: If all resources have the same subject
+ * Type: reference
+ * Path: List.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="List.subject", description="If all resources have the same subject", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: If all resources have the same subject
+ * Type: reference
+ * Path: List.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ListResource:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ListResource:patient").toLocked(); + + /** + * Search parameter: source + *

+ * Description: Who and/or what defined the list contents (aka Author)
+ * Type: reference
+ * Path: List.source
+ *

+ */ + @SearchParamDefinition(name="source", path="List.source", description="Who and/or what defined the list contents (aka Author)", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: Who and/or what defined the list contents (aka Author)
+ * Type: reference
+ * Path: List.source
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ListResource:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("ListResource:source").toLocked(); + + /** + * Search parameter: status + *

+ * Description: current | retired | entered-in-error
+ * Type: token
+ * Path: List.status
+ *

+ */ + @SearchParamDefinition(name="status", path="List.status", description="current | retired | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: current | retired | entered-in-error
+ * Type: token
+ * Path: List.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: If all resources have the same subject
+ * Type: reference
+ * Path: List.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="List.subject", description="If all resources have the same subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: If all resources have the same subject
+ * Type: reference
+ * Path: List.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ListResource:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ListResource:subject").toLocked(); + + /** + * Search parameter: item + *

+ * Description: Actual entry
+ * Type: reference
+ * Path: List.entry.item
+ *

+ */ + @SearchParamDefinition(name="item", path="List.entry.item", description="Actual entry", type="reference" ) + public static final String SP_ITEM = "item"; + /** + * Fluent Client search parameter constant for item + *

+ * Description: Actual entry
+ * Type: reference
+ * Path: List.entry.item
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ITEM); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ListResource:item". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ITEM = new ca.uhn.fhir.model.api.Include("ListResource:item").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Context in which list created
+ * Type: reference
+ * Path: List.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="List.encounter", description="Context in which list created", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Context in which list created
+ * Type: reference
+ * Path: List.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ListResource:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("ListResource:encounter").toLocked(); + + /** + * Search parameter: code + *

+ * Description: What the purpose of this list is
+ * Type: token
+ * Path: List.code
+ *

+ */ + @SearchParamDefinition(name="code", path="List.code", description="What the purpose of this list is", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: What the purpose of this list is
+ * Type: token
+ * Path: List.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: notes + *

+ * Description: The annotation - text content
+ * Type: string
+ * Path: List.note.text
+ *

+ */ + @SearchParamDefinition(name="notes", path="List.note.text", description="The annotation - text content", type="string" ) + public static final String SP_NOTES = "notes"; + /** + * Fluent Client search parameter constant for notes + *

+ * Description: The annotation - text content
+ * Type: string
+ * Path: List.note.text
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NOTES = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NOTES); + + /** + * Search parameter: date + *

+ * Description: When the list was prepared
+ * Type: date
+ * Path: List.date
+ *

+ */ + @SearchParamDefinition(name="date", path="List.date", description="When the list was prepared", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When the list was prepared
+ * Type: date
+ * Path: List.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: empty-reason + *

+ * Description: Why list is empty
+ * Type: token
+ * Path: List.emptyReason
+ *

+ */ + @SearchParamDefinition(name="empty-reason", path="List.emptyReason", description="Why list is empty", type="token" ) + public static final String SP_EMPTY_REASON = "empty-reason"; + /** + * Fluent Client search parameter constant for empty-reason + *

+ * Description: Why list is empty
+ * Type: token
+ * Path: List.emptyReason
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMPTY_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMPTY_REASON); + + /** + * Search parameter: identifier + *

+ * Description: Business identifier
+ * Type: token
+ * Path: List.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="List.identifier", description="Business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Business identifier
+ * Type: token
+ * Path: List.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Location.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Location.java new file mode 100644 index 00000000000..fc8db6c6daf --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Location.java @@ -0,0 +1,1702 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + */ +@ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location") +public class Location extends DomainResource { + + public enum LocationStatus { + /** + * The location is operational. + */ + ACTIVE, + /** + * The location is temporarily closed. + */ + SUSPENDED, + /** + * The location is no longer used. + */ + INACTIVE, + /** + * added to help the parsers + */ + NULL; + public static LocationStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("inactive".equals(codeString)) + return INACTIVE; + throw new FHIRException("Unknown LocationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case SUSPENDED: return "suspended"; + case INACTIVE: return "inactive"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return "http://hl7.org/fhir/location-status"; + case SUSPENDED: return "http://hl7.org/fhir/location-status"; + case INACTIVE: return "http://hl7.org/fhir/location-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The location is operational."; + case SUSPENDED: return "The location is temporarily closed."; + case INACTIVE: return "The location is no longer used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case SUSPENDED: return "Suspended"; + case INACTIVE: return "Inactive"; + default: return "?"; + } + } + } + + 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; + if ("active".equals(codeString)) + return LocationStatus.ACTIVE; + if ("suspended".equals(codeString)) + return LocationStatus.SUSPENDED; + if ("inactive".equals(codeString)) + return LocationStatus.INACTIVE; + throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return new Enumeration(this, LocationStatus.ACTIVE); + if ("suspended".equals(codeString)) + return new Enumeration(this, LocationStatus.SUSPENDED); + if ("inactive".equals(codeString)) + return new Enumeration(this, LocationStatus.INACTIVE); + throw new FHIRException("Unknown LocationStatus code '"+codeString+"'"); + } + public String toCode(LocationStatus code) { + if (code == LocationStatus.ACTIVE) + return "active"; + if (code == LocationStatus.SUSPENDED) + return "suspended"; + if (code == LocationStatus.INACTIVE) + return "inactive"; + return "?"; + } + public String toSystem(LocationStatus code) { + return code.getSystem(); + } + } + + public enum LocationMode { + /** + * The Location resource represents a specific instance of a location (e.g. Operating Theatre 1A). + */ + INSTANCE, + /** + * The Location represents a class of locations (e.g. Any Operating Theatre) although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc.). + */ + KIND, + /** + * added to help the parsers + */ + NULL; + public static LocationMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("instance".equals(codeString)) + return INSTANCE; + if ("kind".equals(codeString)) + return KIND; + throw new FHIRException("Unknown LocationMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INSTANCE: return "instance"; + case KIND: return "kind"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INSTANCE: return "http://hl7.org/fhir/location-mode"; + case KIND: return "http://hl7.org/fhir/location-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INSTANCE: return "The Location resource represents a specific instance of a location (e.g. Operating Theatre 1A)."; + case KIND: return "The Location represents a class of locations (e.g. Any Operating Theatre) although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc.)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INSTANCE: return "Instance"; + case KIND: return "Kind"; + default: return "?"; + } + } + } + + 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; + if ("instance".equals(codeString)) + return LocationMode.INSTANCE; + if ("kind".equals(codeString)) + return LocationMode.KIND; + throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("instance".equals(codeString)) + return new Enumeration(this, LocationMode.INSTANCE); + if ("kind".equals(codeString)) + return new Enumeration(this, LocationMode.KIND); + throw new FHIRException("Unknown LocationMode code '"+codeString+"'"); + } + public String toCode(LocationMode code) { + if (code == LocationMode.INSTANCE) + return "instance"; + if (code == LocationMode.KIND) + return "kind"; + return "?"; + } + public String toSystem(LocationMode code) { + return code.getSystem(); + } + } + + @Block() + public static class LocationPositionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + @Child(name = "longitude", type = {DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Longitude with WGS84 datum", formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)." ) + protected DecimalType longitude; + + /** + * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + @Child(name = "latitude", type = {DecimalType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Latitude with WGS84 datum", formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)." ) + protected DecimalType latitude; + + /** + * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + @Child(name = "altitude", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Altitude with WGS84 datum", formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)." ) + protected DecimalType altitude; + + private static final long serialVersionUID = -74276134L; + + /** + * Constructor + */ + public LocationPositionComponent() { + super(); + } + + /** + * Constructor + */ + public LocationPositionComponent(DecimalType longitude, DecimalType latitude) { + super(); + this.longitude = longitude; + this.latitude = latitude; + } + + /** + * @return {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value + */ + public DecimalType getLongitudeElement() { + if (this.longitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.longitude"); + else if (Configuration.doAutoCreate()) + this.longitude = new DecimalType(); // bb + return this.longitude; + } + + public boolean hasLongitudeElement() { + return this.longitude != null && !this.longitude.isEmpty(); + } + + public boolean hasLongitude() { + return this.longitude != null && !this.longitude.isEmpty(); + } + + /** + * @param value {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value + */ + public LocationPositionComponent setLongitudeElement(DecimalType value) { + this.longitude = value; + return this; + } + + /** + * @return Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + public BigDecimal getLongitude() { + return this.longitude == null ? null : this.longitude.getValue(); + } + + /** + * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + public LocationPositionComponent setLongitude(BigDecimal value) { + if (this.longitude == null) + this.longitude = new DecimalType(); + this.longitude.setValue(value); + return this; + } + + /** + * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + public LocationPositionComponent setLongitude(long value) { + this.longitude = new DecimalType(); + this.longitude.setValue(value); + return this; + } + + /** + * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + public LocationPositionComponent setLongitude(double value) { + this.longitude = new DecimalType(); + this.longitude.setValue(value); + return this; + } + + /** + * @return {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value + */ + public DecimalType getLatitudeElement() { + if (this.latitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.latitude"); + else if (Configuration.doAutoCreate()) + this.latitude = new DecimalType(); // bb + return this.latitude; + } + + public boolean hasLatitudeElement() { + return this.latitude != null && !this.latitude.isEmpty(); + } + + public boolean hasLatitude() { + return this.latitude != null && !this.latitude.isEmpty(); + } + + /** + * @param value {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value + */ + public LocationPositionComponent setLatitudeElement(DecimalType value) { + this.latitude = value; + return this; + } + + /** + * @return Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + public BigDecimal getLatitude() { + return this.latitude == null ? null : this.latitude.getValue(); + } + + /** + * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + public LocationPositionComponent setLatitude(BigDecimal value) { + if (this.latitude == null) + this.latitude = new DecimalType(); + this.latitude.setValue(value); + return this; + } + + /** + * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + public LocationPositionComponent setLatitude(long value) { + this.latitude = new DecimalType(); + this.latitude.setValue(value); + return this; + } + + /** + * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + public LocationPositionComponent setLatitude(double value) { + this.latitude = new DecimalType(); + this.latitude.setValue(value); + return this; + } + + /** + * @return {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value + */ + public DecimalType getAltitudeElement() { + if (this.altitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.altitude"); + else if (Configuration.doAutoCreate()) + this.altitude = new DecimalType(); // bb + return this.altitude; + } + + public boolean hasAltitudeElement() { + return this.altitude != null && !this.altitude.isEmpty(); + } + + public boolean hasAltitude() { + return this.altitude != null && !this.altitude.isEmpty(); + } + + /** + * @param value {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value + */ + public LocationPositionComponent setAltitudeElement(DecimalType value) { + this.altitude = value; + return this; + } + + /** + * @return Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + public BigDecimal getAltitude() { + return this.altitude == null ? null : this.altitude.getValue(); + } + + /** + * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + public LocationPositionComponent setAltitude(BigDecimal value) { + if (value == null) + this.altitude = null; + else { + if (this.altitude == null) + this.altitude = new DecimalType(); + this.altitude.setValue(value); + } + return this; + } + + /** + * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + public LocationPositionComponent setAltitude(long value) { + this.altitude = new DecimalType(); + this.altitude.setValue(value); + return this; + } + + /** + * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + public LocationPositionComponent setAltitude(double value) { + this.altitude = new DecimalType(); + this.altitude.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("longitude", "decimal", "Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, longitude)); + childrenList.add(new Property("latitude", "decimal", "Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, latitude)); + childrenList.add(new Property("altitude", "decimal", "Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, altitude)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 137365935: /*longitude*/ return this.longitude == null ? new Base[0] : new Base[] {this.longitude}; // DecimalType + case -1439978388: /*latitude*/ return this.latitude == null ? new Base[0] : new Base[] {this.latitude}; // DecimalType + case 2036550306: /*altitude*/ return this.altitude == null ? new Base[0] : new Base[] {this.altitude}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 137365935: // longitude + this.longitude = castToDecimal(value); // DecimalType + break; + case -1439978388: // latitude + this.latitude = castToDecimal(value); // DecimalType + break; + case 2036550306: // altitude + this.altitude = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("longitude")) + this.longitude = castToDecimal(value); // DecimalType + else if (name.equals("latitude")) + this.latitude = castToDecimal(value); // DecimalType + else if (name.equals("altitude")) + this.altitude = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 137365935: throw new FHIRException("Cannot make property longitude as it is not a complex type"); // DecimalType + case -1439978388: throw new FHIRException("Cannot make property latitude as it is not a complex type"); // DecimalType + case 2036550306: throw new FHIRException("Cannot make property altitude as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("longitude")) { + throw new FHIRException("Cannot call addChild on a primitive type Location.longitude"); + } + else if (name.equals("latitude")) { + throw new FHIRException("Cannot call addChild on a primitive type Location.latitude"); + } + else if (name.equals("altitude")) { + throw new FHIRException("Cannot call addChild on a primitive type Location.altitude"); + } + else + return super.addChild(name); + } + + public LocationPositionComponent copy() { + LocationPositionComponent dst = new LocationPositionComponent(); + copyValues(dst); + dst.longitude = longitude == null ? null : longitude.copy(); + dst.latitude = latitude == null ? null : latitude.copy(); + dst.altitude = altitude == null ? null : altitude.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof LocationPositionComponent)) + return false; + LocationPositionComponent o = (LocationPositionComponent) other; + return compareDeep(longitude, o.longitude, true) && compareDeep(latitude, o.latitude, true) && compareDeep(altitude, o.altitude, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof LocationPositionComponent)) + return false; + LocationPositionComponent o = (LocationPositionComponent) other; + return compareValues(longitude, o.longitude, true) && compareValues(latitude, o.latitude, true) && compareValues(altitude, o.altitude, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (longitude == null || longitude.isEmpty()) && (latitude == null || latitude.isEmpty()) + && (altitude == null || altitude.isEmpty()); + } + + public String fhirType() { + return "Location.position"; + + } + + } + + /** + * Unique code or number identifying the location to its users. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique code or number identifying the location to its users", formalDefinition="Unique code or number identifying the location to its users." ) + protected List identifier; + + /** + * active | suspended | inactive. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | suspended | inactive", formalDefinition="active | suspended | inactive." ) + protected Enumeration status; + + /** + * Name of the location as used by humans. Does not need to be unique. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the location as used by humans", formalDefinition="Name of the location as used by humans. Does not need to be unique." ) + protected StringType name; + + /** + * Description of the Location, which helps in finding or referencing the place. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional details about the location that could be displayed as further information to identify the location beyond its name", formalDefinition="Description of the Location, which helps in finding or referencing the place." ) + protected StringType description; + + /** + * Indicates whether a resource instance represents a specific location or a class of locations. + */ + @Child(name = "mode", type = {CodeType.class}, order=4, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="instance | kind", formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations." ) + protected Enumeration mode; + + /** + * Indicates the type of function performed at the location. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of function performed", formalDefinition="Indicates the type of function performed at the location." ) + protected CodeableConcept type; + + /** + * The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contact details of the location", formalDefinition="The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites." ) + protected List telecom; + + /** + * Physical location. + */ + @Child(name = "address", type = {Address.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Physical location", formalDefinition="Physical location." ) + protected Address address; + + /** + * Physical form of the location, e.g. building, room, vehicle, road. + */ + @Child(name = "physicalType", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Physical form of the location", formalDefinition="Physical form of the location, e.g. building, room, vehicle, road." ) + protected CodeableConcept physicalType; + + /** + * The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML). + */ + @Child(name = "position", type = {}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The absolute geographic location", formalDefinition="The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML)." ) + protected LocationPositionComponent position; + + /** + * The organization responsible for the provisioning and upkeep of the location. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization responsible for provisioning and upkeep", formalDefinition="The organization responsible for the provisioning and upkeep of the location." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The organization responsible for the provisioning and upkeep of the location.) + */ + protected Organization managingOrganizationTarget; + + /** + * Another Location which this Location is physically part of. + */ + @Child(name = "partOf", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Another Location this one is physically part of", formalDefinition="Another Location which this Location is physically part of." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (Another Location which this Location is physically part of.) + */ + protected Location partOfTarget; + + private static final long serialVersionUID = -2100435761L; + + /** + * Constructor + */ + public Location() { + super(); + } + + /** + * @return {@link #identifier} (Unique code or number identifying the location to its users.) + */ + 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} (Unique code or number identifying the location to its users.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Location addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (active | suspended | inactive.). 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 Location.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new LocationStatusEnumFactory()); // bb + 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} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Location setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return active | suspended | inactive. + */ + public LocationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value active | suspended | inactive. + */ + public Location setStatus(LocationStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new LocationStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (Name of the location as used by humans. Does not need to be unique.). 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 Location.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Location setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name of the location as used by humans. Does not need to be unique. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name of the location as used by humans. Does not need to be unique. + */ + public Location setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Description of the Location, which helps in finding or referencing the place.). 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 Location.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Location setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Description of the Location, which helps in finding or referencing the place. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Description of the Location, which helps in finding or referencing the place. + */ + public Location 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 #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). 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 Location.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new LocationModeEnumFactory()); // bb + 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} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Location setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Indicates whether a resource instance represents a specific location or a class of locations. + */ + public LocationMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Indicates whether a resource instance represents a specific location or a class of locations. + */ + public Location setMode(LocationMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(new LocationModeEnumFactory()); + this.mode.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Indicates the type of function performed at the location.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of function performed at the location.) + */ + public Location setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) + */ + 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} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Location addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (Physical location.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); // cc + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Physical location.) + */ + public Location setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) + */ + public CodeableConcept getPhysicalType() { + if (this.physicalType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.physicalType"); + else if (Configuration.doAutoCreate()) + this.physicalType = new CodeableConcept(); // cc + return this.physicalType; + } + + public boolean hasPhysicalType() { + return this.physicalType != null && !this.physicalType.isEmpty(); + } + + /** + * @param value {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) + */ + public Location setPhysicalType(CodeableConcept value) { + this.physicalType = value; + return this; + } + + /** + * @return {@link #position} (The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).) + */ + public LocationPositionComponent getPosition() { + if (this.position == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.position"); + else if (Configuration.doAutoCreate()) + this.position = new LocationPositionComponent(); // cc + return this.position; + } + + public boolean hasPosition() { + return this.position != null && !this.position.isEmpty(); + } + + /** + * @param value {@link #position} (The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).) + */ + public Location setPosition(LocationPositionComponent value) { + this.position = value; + return this; + } + + /** + * @return {@link #managingOrganization} (The organization responsible for the provisioning and upkeep of the location.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The organization responsible for the provisioning and upkeep of the location.) + */ + public Location 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 responsible for the provisioning and upkeep of the location.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + 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 responsible for the provisioning and upkeep of the location.) + */ + public Location setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #partOf} (Another Location which this Location is physically part of.) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); // cc + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (Another Location which this Location is physically part of.) + */ + public Location setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} 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. (Another Location which this Location is physically part of.) + */ + public Location getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Location(); // aa + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} 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. (Another Location which this Location is physically part of.) + */ + public Location setPartOfTarget(Location value) { + this.partOfTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique code or number identifying the location to its users.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("name", "string", "Name of the location as used by humans. Does not need to be unique.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Description of the Location, which helps in finding or referencing the place.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("mode", "code", "Indicates whether a resource instance represents a specific location or a class of locations.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of function performed at the location.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("telecom", "ContactPoint", "The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Physical location.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("physicalType", "CodeableConcept", "Physical form of the location, e.g. building, room, vehicle, road.", 0, java.lang.Integer.MAX_VALUE, physicalType)); + childrenList.add(new Property("position", "", "The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).", 0, java.lang.Integer.MAX_VALUE, position)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization responsible for the provisioning and upkeep of the location.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("partOf", "Reference(Location)", "Another Location which this Location is physically part of.", 0, java.lang.Integer.MAX_VALUE, partOf)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address + case -1474715471: /*physicalType*/ return this.physicalType == null ? new Base[0] : new Base[] {this.physicalType}; // CodeableConcept + case 747804969: /*position*/ return this.position == null ? new Base[0] : new Base[] {this.position}; // LocationPositionComponent + case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference + case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : new Base[] {this.partOf}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new LocationStatusEnumFactory().fromType(value); // Enumeration + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 3357091: // mode + this.mode = new LocationModeEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1147692044: // address + this.address = castToAddress(value); // Address + break; + case -1474715471: // physicalType + this.physicalType = castToCodeableConcept(value); // CodeableConcept + break; + case 747804969: // position + this.position = (LocationPositionComponent) value; // LocationPositionComponent + break; + case -2058947787: // managingOrganization + this.managingOrganization = castToReference(value); // Reference + break; + case -995410646: // partOf + this.partOf = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new LocationStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("mode")) + this.mode = new LocationModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("address")) + this.address = castToAddress(value); // Address + else if (name.equals("physicalType")) + this.physicalType = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("position")) + this.position = (LocationPositionComponent) value; // LocationPositionComponent + else if (name.equals("managingOrganization")) + this.managingOrganization = castToReference(value); // Reference + else if (name.equals("partOf")) + this.partOf = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 3575610: return getType(); // CodeableConcept + case -1429363305: return addTelecom(); // ContactPoint + case -1147692044: return getAddress(); // Address + case -1474715471: return getPhysicalType(); // CodeableConcept + case 747804969: return getPosition(); // LocationPositionComponent + case -2058947787: return getManagingOrganization(); // Reference + case -995410646: return getPartOf(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Location.status"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Location.name"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Location.description"); + } + else if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type Location.mode"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("address")) { + this.address = new Address(); + return this.address; + } + else if (name.equals("physicalType")) { + this.physicalType = new CodeableConcept(); + return this.physicalType; + } + else if (name.equals("position")) { + this.position = new LocationPositionComponent(); + return this.position; + } + else if (name.equals("managingOrganization")) { + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + else if (name.equals("partOf")) { + this.partOf = new Reference(); + return this.partOf; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Location"; + + } + + public Location copy() { + Location dst = new Location(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.type = type == null ? null : type.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + dst.physicalType = physicalType == null ? null : physicalType.copy(); + dst.position = position == null ? null : position.copy(); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.partOf = partOf == null ? null : partOf.copy(); + return dst; + } + + protected Location typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Location)) + return false; + Location o = (Location) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(name, o.name, true) + && compareDeep(description, o.description, true) && compareDeep(mode, o.mode, true) && compareDeep(type, o.type, true) + && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) && compareDeep(physicalType, o.physicalType, true) + && compareDeep(position, o.position, true) && compareDeep(managingOrganization, o.managingOrganization, true) + && compareDeep(partOf, o.partOf, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Location)) + return false; + Location o = (Location) other; + return compareValues(status, o.status, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true) + && compareValues(mode, o.mode, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) && (mode == null || mode.isEmpty()) + && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) + && (physicalType == null || physicalType.isEmpty()) && (position == null || position.isEmpty()) + && (managingOrganization == null || managingOrganization.isEmpty()) && (partOf == null || partOf.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Location; + } + + /** + * Search parameter: organization + *

+ * Description: Searches for locations that are managed by the provided organization
+ * Type: reference
+ * Path: Location.managingOrganization
+ *

+ */ + @SearchParamDefinition(name="organization", path="Location.managingOrganization", description="Searches for locations that are managed by the provided organization", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: Searches for locations that are managed by the provided organization
+ * Type: reference
+ * Path: Location.managingOrganization
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Location:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Location:organization").toLocked(); + + /** + * Search parameter: address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Location.address.state
+ *

+ */ + @SearchParamDefinition(name="address-state", path="Location.address.state", description="A state specified in an address", type="string" ) + public static final String SP_ADDRESS_STATE = "address-state"; + /** + * Fluent Client search parameter constant for address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Location.address.state
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); + + /** + * Search parameter: address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Location.address.city
+ *

+ */ + @SearchParamDefinition(name="address-city", path="Location.address.city", description="A city specified in an address", type="string" ) + public static final String SP_ADDRESS_CITY = "address-city"; + /** + * Fluent Client search parameter constant for address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Location.address.city
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); + + /** + * Search parameter: near + *

+ * Description: The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)
+ * Type: token
+ * Path: Location.position
+ *

+ */ + @SearchParamDefinition(name="near", path="Location.position", description="The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type="token" ) + public static final String SP_NEAR = "near"; + /** + * Fluent Client search parameter constant for near + *

+ * Description: The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)
+ * Type: token
+ * Path: Location.position
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam NEAR = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NEAR); + + /** + * Search parameter: partof + *

+ * Description: The location of which this location is a part
+ * Type: reference
+ * Path: Location.partOf
+ *

+ */ + @SearchParamDefinition(name="partof", path="Location.partOf", description="The location of which this location is a part", type="reference" ) + public static final String SP_PARTOF = "partof"; + /** + * Fluent Client search parameter constant for partof + *

+ * Description: The location of which this location is a part
+ * Type: reference
+ * Path: Location.partOf
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Location:partof". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("Location:partof").toLocked(); + + /** + * Search parameter: status + *

+ * Description: Searches for locations with a specific kind of status
+ * Type: token
+ * Path: Location.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Location.status", description="Searches for locations with a specific kind of status", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Searches for locations with a specific kind of status
+ * Type: token
+ * Path: Location.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: address + *

+ * Description: A (part of the) address of the location
+ * Type: string
+ * Path: Location.address
+ *

+ */ + @SearchParamDefinition(name="address", path="Location.address", description="A (part of the) address of the location", type="string" ) + public static final String SP_ADDRESS = "address"; + /** + * Fluent Client search parameter constant for address + *

+ * Description: A (part of the) address of the location
+ * Type: string
+ * Path: Location.address
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); + + /** + * Search parameter: address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Location.address.use
+ *

+ */ + @SearchParamDefinition(name="address-use", path="Location.address.use", description="A use code specified in an address", type="token" ) + public static final String SP_ADDRESS_USE = "address-use"; + /** + * Fluent Client search parameter constant for address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Location.address.use
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); + + /** + * Search parameter: name + *

+ * Description: A (portion of the) name of the location
+ * Type: string
+ * Path: Location.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Location.name", description="A (portion of the) name of the location", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: A (portion of the) name of the location
+ * Type: string
+ * Path: Location.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Location.address.country
+ *

+ */ + @SearchParamDefinition(name="address-country", path="Location.address.country", description="A country specified in an address", type="string" ) + public static final String SP_ADDRESS_COUNTRY = "address-country"; + /** + * Fluent Client search parameter constant for address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Location.address.country
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + + /** + * Search parameter: near-distance + *

+ * Description: A distance quantity to limit the near search to locations within a specific distance
+ * Type: token
+ * Path: Location.position
+ *

+ */ + @SearchParamDefinition(name="near-distance", path="Location.position", description="A distance quantity to limit the near search to locations within a specific distance", type="token" ) + public static final String SP_NEAR_DISTANCE = "near-distance"; + /** + * Fluent Client search parameter constant for near-distance + *

+ * Description: A distance quantity to limit the near search to locations within a specific distance
+ * Type: token
+ * Path: Location.position
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam NEAR_DISTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NEAR_DISTANCE); + + /** + * Search parameter: type + *

+ * Description: A code for the type of location
+ * Type: token
+ * Path: Location.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Location.type", description="A code for the type of location", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: A code for the type of location
+ * Type: token
+ * Path: Location.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: Unique code or number identifying the location to its users
+ * Type: token
+ * Path: Location.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Location.identifier", description="Unique code or number identifying the location to its users", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique code or number identifying the location to its users
+ * Type: token
+ * Path: Location.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: address-postalcode + *

+ * Description: A postal code specified in an address
+ * Type: string
+ * Path: Location.address.postalCode
+ *

+ */ + @SearchParamDefinition(name="address-postalcode", path="Location.address.postalCode", description="A postal code specified in an address", type="string" ) + public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; + /** + * Fluent Client search parameter constant for address-postalcode + *

+ * Description: A postal code specified in an address
+ * Type: string
+ * Path: Location.address.postalCode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MarkdownType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MarkdownType.java new file mode 100644 index 00000000000..a70353a1c50 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MarkdownType.java @@ -0,0 +1,76 @@ +/* +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. + + */ +package org.hl7.fhir.dstu2016may.model; + +import static org.apache.commons.lang3.StringUtils.defaultString; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "code" in FHIR, when not bound to an enumerated list of codes + */ +@DatatypeDef(name="markdown", profileOf=StringType.class) +public class MarkdownType extends StringType implements Comparable { + + private static final long serialVersionUID = 3L; + + public MarkdownType() { + super(); + } + + public MarkdownType(String theCode) { + setValue(theCode); + } + + public int compareTo(MarkdownType theCode) { + if (theCode == null) { + return 1; + } + return defaultString(getValue()).compareTo(defaultString(theCode.getValue())); + } + + @Override + protected String parse(String theValue) { + return theValue.trim(); + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public MarkdownType copy() { + return new MarkdownType(getValue()); + } + + public String fhirType() { + return "markdown"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Measure.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Measure.java new file mode 100644 index 00000000000..72e4946a20e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Measure.java @@ -0,0 +1,3240 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The Measure resource provides the definition of a quality measure. + */ +@ResourceDef(name="Measure", profile="http://hl7.org/fhir/Profile/Measure") +public class Measure extends DomainResource { + + public enum MeasureScoring { + /** + * The measure score is defined using a proportion + */ + PROPORTION, + /** + * The measure score is defined using a ratio + */ + RATIO, + /** + * The score is defined by a calculation of some quantity + */ + CONTINUOUSVARIABLE, + /** + * The measure is a cohort definition + */ + COHORT, + /** + * added to help the parsers + */ + NULL; + public static MeasureScoring fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proportion".equals(codeString)) + return PROPORTION; + if ("ratio".equals(codeString)) + return RATIO; + if ("continuous-variable".equals(codeString)) + return CONTINUOUSVARIABLE; + if ("cohort".equals(codeString)) + return COHORT; + throw new FHIRException("Unknown MeasureScoring code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPORTION: return "proportion"; + case RATIO: return "ratio"; + case CONTINUOUSVARIABLE: return "continuous-variable"; + case COHORT: return "cohort"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPORTION: return "http://hl7.org/fhir/measure-scoring"; + case RATIO: return "http://hl7.org/fhir/measure-scoring"; + case CONTINUOUSVARIABLE: return "http://hl7.org/fhir/measure-scoring"; + case COHORT: return "http://hl7.org/fhir/measure-scoring"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPORTION: return "The measure score is defined using a proportion"; + case RATIO: return "The measure score is defined using a ratio"; + case CONTINUOUSVARIABLE: return "The score is defined by a calculation of some quantity"; + case COHORT: return "The measure is a cohort definition"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPORTION: return "Proportion"; + case RATIO: return "Ratio"; + case CONTINUOUSVARIABLE: return "Continuous Variable"; + case COHORT: return "Cohort"; + default: return "?"; + } + } + } + + public static class MeasureScoringEnumFactory implements EnumFactory { + public MeasureScoring fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proportion".equals(codeString)) + return MeasureScoring.PROPORTION; + if ("ratio".equals(codeString)) + return MeasureScoring.RATIO; + if ("continuous-variable".equals(codeString)) + return MeasureScoring.CONTINUOUSVARIABLE; + if ("cohort".equals(codeString)) + return MeasureScoring.COHORT; + throw new IllegalArgumentException("Unknown MeasureScoring code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proportion".equals(codeString)) + return new Enumeration(this, MeasureScoring.PROPORTION); + if ("ratio".equals(codeString)) + return new Enumeration(this, MeasureScoring.RATIO); + if ("continuous-variable".equals(codeString)) + return new Enumeration(this, MeasureScoring.CONTINUOUSVARIABLE); + if ("cohort".equals(codeString)) + return new Enumeration(this, MeasureScoring.COHORT); + throw new FHIRException("Unknown MeasureScoring code '"+codeString+"'"); + } + public String toCode(MeasureScoring code) { + if (code == MeasureScoring.PROPORTION) + return "proportion"; + if (code == MeasureScoring.RATIO) + return "ratio"; + if (code == MeasureScoring.CONTINUOUSVARIABLE) + return "continuous-variable"; + if (code == MeasureScoring.COHORT) + return "cohort"; + return "?"; + } + public String toSystem(MeasureScoring code) { + return code.getSystem(); + } + } + + public enum MeasureType { + /** + * The measure is a process measure + */ + PROCESS, + /** + * The measure is an outcome measure + */ + OUTCOME, + /** + * added to help the parsers + */ + NULL; + public static MeasureType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("process".equals(codeString)) + return PROCESS; + if ("outcome".equals(codeString)) + return OUTCOME; + throw new FHIRException("Unknown MeasureType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROCESS: return "process"; + case OUTCOME: return "outcome"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROCESS: return "http://hl7.org/fhir/measure-type"; + case OUTCOME: return "http://hl7.org/fhir/measure-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROCESS: return "The measure is a process measure"; + case OUTCOME: return "The measure is an outcome measure"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROCESS: return "Process"; + case OUTCOME: return "Outcome"; + default: return "?"; + } + } + } + + public static class MeasureTypeEnumFactory implements EnumFactory { + public MeasureType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("process".equals(codeString)) + return MeasureType.PROCESS; + if ("outcome".equals(codeString)) + return MeasureType.OUTCOME; + throw new IllegalArgumentException("Unknown MeasureType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("process".equals(codeString)) + return new Enumeration(this, MeasureType.PROCESS); + if ("outcome".equals(codeString)) + return new Enumeration(this, MeasureType.OUTCOME); + throw new FHIRException("Unknown MeasureType code '"+codeString+"'"); + } + public String toCode(MeasureType code) { + if (code == MeasureType.PROCESS) + return "process"; + if (code == MeasureType.OUTCOME) + return "outcome"; + return "?"; + } + public String toSystem(MeasureType code) { + return code.getSystem(); + } + } + + public enum MeasurePopulationType { + /** + * The initial population for the measure + */ + INITIALPOPULATION, + /** + * The numerator for the measure + */ + NUMERATOR, + /** + * The numerator exclusion for the measure + */ + NUMERATOREXCLUSION, + /** + * The denominator for the measure + */ + DENOMINATOR, + /** + * The denominator exclusion for the measure + */ + DENOMINATOREXCLUSION, + /** + * The denominator exception for the measure + */ + DENOMINATOREXCEPTION, + /** + * The measure population for the measure + */ + MEASUREPOPULATION, + /** + * The measure population exclusion for the measure + */ + MEASUREPOPULATIONEXCLUSION, + /** + * The measure score for the measure + */ + MEASURESCORE, + /** + * added to help the parsers + */ + NULL; + public static MeasurePopulationType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("initial-population".equals(codeString)) + return INITIALPOPULATION; + if ("numerator".equals(codeString)) + return NUMERATOR; + if ("numerator-exclusion".equals(codeString)) + return NUMERATOREXCLUSION; + if ("denominator".equals(codeString)) + return DENOMINATOR; + if ("denominator-exclusion".equals(codeString)) + return DENOMINATOREXCLUSION; + if ("denominator-exception".equals(codeString)) + return DENOMINATOREXCEPTION; + if ("measure-population".equals(codeString)) + return MEASUREPOPULATION; + if ("measure-population-exclusion".equals(codeString)) + return MEASUREPOPULATIONEXCLUSION; + if ("measure-score".equals(codeString)) + return MEASURESCORE; + throw new FHIRException("Unknown MeasurePopulationType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INITIALPOPULATION: return "initial-population"; + case NUMERATOR: return "numerator"; + case NUMERATOREXCLUSION: return "numerator-exclusion"; + case DENOMINATOR: return "denominator"; + case DENOMINATOREXCLUSION: return "denominator-exclusion"; + case DENOMINATOREXCEPTION: return "denominator-exception"; + case MEASUREPOPULATION: return "measure-population"; + case MEASUREPOPULATIONEXCLUSION: return "measure-population-exclusion"; + case MEASURESCORE: return "measure-score"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INITIALPOPULATION: return "http://hl7.org/fhir/measure-population"; + case NUMERATOR: return "http://hl7.org/fhir/measure-population"; + case NUMERATOREXCLUSION: return "http://hl7.org/fhir/measure-population"; + case DENOMINATOR: return "http://hl7.org/fhir/measure-population"; + case DENOMINATOREXCLUSION: return "http://hl7.org/fhir/measure-population"; + case DENOMINATOREXCEPTION: return "http://hl7.org/fhir/measure-population"; + case MEASUREPOPULATION: return "http://hl7.org/fhir/measure-population"; + case MEASUREPOPULATIONEXCLUSION: return "http://hl7.org/fhir/measure-population"; + case MEASURESCORE: return "http://hl7.org/fhir/measure-population"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INITIALPOPULATION: return "The initial population for the measure"; + case NUMERATOR: return "The numerator for the measure"; + case NUMERATOREXCLUSION: return "The numerator exclusion for the measure"; + case DENOMINATOR: return "The denominator for the measure"; + case DENOMINATOREXCLUSION: return "The denominator exclusion for the measure"; + case DENOMINATOREXCEPTION: return "The denominator exception for the measure"; + case MEASUREPOPULATION: return "The measure population for the measure"; + case MEASUREPOPULATIONEXCLUSION: return "The measure population exclusion for the measure"; + case MEASURESCORE: return "The measure score for the measure"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INITIALPOPULATION: return "Initial Population"; + case NUMERATOR: return "Numerator"; + case NUMERATOREXCLUSION: return "Numerator Exclusion"; + case DENOMINATOR: return "Denominator"; + case DENOMINATOREXCLUSION: return "Denominator Exclusion"; + case DENOMINATOREXCEPTION: return "Denominator Exception"; + case MEASUREPOPULATION: return "Measure Population"; + case MEASUREPOPULATIONEXCLUSION: return "Measure Population Exclusion"; + case MEASURESCORE: return "Measure Score"; + default: return "?"; + } + } + } + + public static class MeasurePopulationTypeEnumFactory implements EnumFactory { + public MeasurePopulationType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("initial-population".equals(codeString)) + return MeasurePopulationType.INITIALPOPULATION; + if ("numerator".equals(codeString)) + return MeasurePopulationType.NUMERATOR; + if ("numerator-exclusion".equals(codeString)) + return MeasurePopulationType.NUMERATOREXCLUSION; + if ("denominator".equals(codeString)) + return MeasurePopulationType.DENOMINATOR; + if ("denominator-exclusion".equals(codeString)) + return MeasurePopulationType.DENOMINATOREXCLUSION; + if ("denominator-exception".equals(codeString)) + return MeasurePopulationType.DENOMINATOREXCEPTION; + if ("measure-population".equals(codeString)) + return MeasurePopulationType.MEASUREPOPULATION; + if ("measure-population-exclusion".equals(codeString)) + return MeasurePopulationType.MEASUREPOPULATIONEXCLUSION; + if ("measure-score".equals(codeString)) + return MeasurePopulationType.MEASURESCORE; + throw new IllegalArgumentException("Unknown MeasurePopulationType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("initial-population".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.INITIALPOPULATION); + if ("numerator".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.NUMERATOR); + if ("numerator-exclusion".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.NUMERATOREXCLUSION); + if ("denominator".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.DENOMINATOR); + if ("denominator-exclusion".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.DENOMINATOREXCLUSION); + if ("denominator-exception".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.DENOMINATOREXCEPTION); + if ("measure-population".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.MEASUREPOPULATION); + if ("measure-population-exclusion".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.MEASUREPOPULATIONEXCLUSION); + if ("measure-score".equals(codeString)) + return new Enumeration(this, MeasurePopulationType.MEASURESCORE); + throw new FHIRException("Unknown MeasurePopulationType code '"+codeString+"'"); + } + public String toCode(MeasurePopulationType code) { + if (code == MeasurePopulationType.INITIALPOPULATION) + return "initial-population"; + if (code == MeasurePopulationType.NUMERATOR) + return "numerator"; + if (code == MeasurePopulationType.NUMERATOREXCLUSION) + return "numerator-exclusion"; + if (code == MeasurePopulationType.DENOMINATOR) + return "denominator"; + if (code == MeasurePopulationType.DENOMINATOREXCLUSION) + return "denominator-exclusion"; + if (code == MeasurePopulationType.DENOMINATOREXCEPTION) + return "denominator-exception"; + if (code == MeasurePopulationType.MEASUREPOPULATION) + return "measure-population"; + if (code == MeasurePopulationType.MEASUREPOPULATIONEXCLUSION) + return "measure-population-exclusion"; + if (code == MeasurePopulationType.MEASURESCORE) + return "measure-score"; + return "?"; + } + public String toSystem(MeasurePopulationType code) { + return code.getSystem(); + } + } + + public enum MeasureDataUsage { + /** + * The data is intended to be provided as additional information alongside the measure results + */ + SUPPLEMENTALDATA, + /** + * The data is intended to be used to calculate and apply a risk adjustment model for the measure + */ + RISKADJUSTMENTFACTOR, + /** + * added to help the parsers + */ + NULL; + public static MeasureDataUsage fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("supplemental-data".equals(codeString)) + return SUPPLEMENTALDATA; + if ("risk-adjustment-factor".equals(codeString)) + return RISKADJUSTMENTFACTOR; + throw new FHIRException("Unknown MeasureDataUsage code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case SUPPLEMENTALDATA: return "supplemental-data"; + case RISKADJUSTMENTFACTOR: return "risk-adjustment-factor"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SUPPLEMENTALDATA: return "http://hl7.org/fhir/measure-data-usage"; + case RISKADJUSTMENTFACTOR: return "http://hl7.org/fhir/measure-data-usage"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SUPPLEMENTALDATA: return "The data is intended to be provided as additional information alongside the measure results"; + case RISKADJUSTMENTFACTOR: return "The data is intended to be used to calculate and apply a risk adjustment model for the measure"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SUPPLEMENTALDATA: return "Supplemental Data"; + case RISKADJUSTMENTFACTOR: return "Risk Adjustment Factor"; + default: return "?"; + } + } + } + + public static class MeasureDataUsageEnumFactory implements EnumFactory { + public MeasureDataUsage fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("supplemental-data".equals(codeString)) + return MeasureDataUsage.SUPPLEMENTALDATA; + if ("risk-adjustment-factor".equals(codeString)) + return MeasureDataUsage.RISKADJUSTMENTFACTOR; + throw new IllegalArgumentException("Unknown MeasureDataUsage code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("supplemental-data".equals(codeString)) + return new Enumeration(this, MeasureDataUsage.SUPPLEMENTALDATA); + if ("risk-adjustment-factor".equals(codeString)) + return new Enumeration(this, MeasureDataUsage.RISKADJUSTMENTFACTOR); + throw new FHIRException("Unknown MeasureDataUsage code '"+codeString+"'"); + } + public String toCode(MeasureDataUsage code) { + if (code == MeasureDataUsage.SUPPLEMENTALDATA) + return "supplemental-data"; + if (code == MeasureDataUsage.RISKADJUSTMENTFACTOR) + return "risk-adjustment-factor"; + return "?"; + } + public String toSystem(MeasureDataUsage code) { + return code.getSystem(); + } + } + + @Block() + public static class MeasureGroupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A unique identifier for the group. This identifier will used to report data for the group in the measure report. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the group. This identifier will used to report data for the group in the measure report." ) + protected Identifier identifier; + + /** + * Optional name or short description of this group. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Short name", formalDefinition="Optional name or short description of this group." ) + protected StringType name; + + /** + * The human readable description of this population group. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Summary description", formalDefinition="The human readable description of this population group." ) + protected StringType description; + + /** + * A population criteria for the measure. + */ + @Child(name = "population", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Population criteria", formalDefinition="A population criteria for the measure." ) + protected List population; + + /** + * The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path. + */ + @Child(name = "stratifier", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Stratifier criteria for the measure", formalDefinition="The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path." ) + protected List stratifier; + + private static final long serialVersionUID = 1287622059L; + + /** + * Constructor + */ + public MeasureGroupComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureGroupComponent(Identifier identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #identifier} (A unique identifier for the group. This identifier will used to report data for the group in the measure report.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureGroupComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A unique identifier for the group. This identifier will used to report data for the group in the measure report.) + */ + public MeasureGroupComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #name} (Optional name or short description of this group.). 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 MeasureGroupComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Optional name or short description of this group.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MeasureGroupComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Optional name or short description of this group. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Optional name or short description of this group. + */ + public MeasureGroupComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (The human readable description of this population group.). 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 MeasureGroupComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (The human readable description of this population group.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public MeasureGroupComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The human readable description of this population group. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The human readable description of this population group. + */ + public MeasureGroupComponent 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 #population} (A population criteria for the measure.) + */ + public List getPopulation() { + if (this.population == null) + this.population = new ArrayList(); + return this.population; + } + + public boolean hasPopulation() { + if (this.population == null) + return false; + for (MeasureGroupPopulationComponent item : this.population) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #population} (A population criteria for the measure.) + */ + // syntactic sugar + public MeasureGroupPopulationComponent addPopulation() { //3 + MeasureGroupPopulationComponent t = new MeasureGroupPopulationComponent(); + if (this.population == null) + this.population = new ArrayList(); + this.population.add(t); + return t; + } + + // syntactic sugar + public MeasureGroupComponent addPopulation(MeasureGroupPopulationComponent t) { //3 + if (t == null) + return this; + if (this.population == null) + this.population = new ArrayList(); + this.population.add(t); + return this; + } + + /** + * @return {@link #stratifier} (The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path.) + */ + public List getStratifier() { + if (this.stratifier == null) + this.stratifier = new ArrayList(); + return this.stratifier; + } + + public boolean hasStratifier() { + if (this.stratifier == null) + return false; + for (MeasureGroupStratifierComponent item : this.stratifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #stratifier} (The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path.) + */ + // syntactic sugar + public MeasureGroupStratifierComponent addStratifier() { //3 + MeasureGroupStratifierComponent t = new MeasureGroupStratifierComponent(); + if (this.stratifier == null) + this.stratifier = new ArrayList(); + this.stratifier.add(t); + return t; + } + + // syntactic sugar + public MeasureGroupComponent addStratifier(MeasureGroupStratifierComponent t) { //3 + if (t == null) + return this; + if (this.stratifier == null) + this.stratifier = new ArrayList(); + this.stratifier.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the group. This identifier will used to report data for the group in the measure report.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "string", "Optional name or short description of this group.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "The human readable description of this population group.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("population", "", "A population criteria for the measure.", 0, java.lang.Integer.MAX_VALUE, population)); + childrenList.add(new Property("stratifier", "", "The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path.", 0, java.lang.Integer.MAX_VALUE, stratifier)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MeasureGroupPopulationComponent + case 90983669: /*stratifier*/ return this.stratifier == null ? new Base[0] : this.stratifier.toArray(new Base[this.stratifier.size()]); // MeasureGroupStratifierComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -2023558323: // population + this.getPopulation().add((MeasureGroupPopulationComponent) value); // MeasureGroupPopulationComponent + break; + case 90983669: // stratifier + this.getStratifier().add((MeasureGroupStratifierComponent) value); // MeasureGroupStratifierComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("population")) + this.getPopulation().add((MeasureGroupPopulationComponent) value); + else if (name.equals("stratifier")) + this.getStratifier().add((MeasureGroupStratifierComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -2023558323: return addPopulation(); // MeasureGroupPopulationComponent + case 90983669: return addStratifier(); // MeasureGroupStratifierComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.name"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.description"); + } + else if (name.equals("population")) { + return addPopulation(); + } + else if (name.equals("stratifier")) { + return addStratifier(); + } + else + return super.addChild(name); + } + + public MeasureGroupComponent copy() { + MeasureGroupComponent dst = new MeasureGroupComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + if (population != null) { + dst.population = new ArrayList(); + for (MeasureGroupPopulationComponent i : population) + dst.population.add(i.copy()); + }; + if (stratifier != null) { + dst.stratifier = new ArrayList(); + for (MeasureGroupStratifierComponent i : stratifier) + dst.stratifier.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureGroupComponent)) + return false; + MeasureGroupComponent o = (MeasureGroupComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) + && compareDeep(population, o.population, true) && compareDeep(stratifier, o.stratifier, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureGroupComponent)) + return false; + MeasureGroupComponent o = (MeasureGroupComponent) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (description == null || description.isEmpty()) && (population == null || population.isEmpty()) + && (stratifier == null || stratifier.isEmpty()); + } + + public String fhirType() { + return "Measure.group"; + + } + + } + + @Block() + public static class MeasureGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of population criteria. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score", formalDefinition="The type of population criteria." ) + protected Enumeration type; + + /** + * A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report. + */ + @Child(name = "identifier", type = {Identifier.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report." ) + protected Identifier identifier; + + /** + * Optional name or short description of this population. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Short name", formalDefinition="Optional name or short description of this population." ) + protected StringType name; + + /** + * The human readable description of this population criteria. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The human readable description of this population criteria", formalDefinition="The human readable description of this population criteria." ) + protected StringType description; + + /** + * The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria. + */ + @Child(name = "criteria", type = {StringType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria", formalDefinition="The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria." ) + protected StringType criteria; + + private static final long serialVersionUID = 1158202275L; + + /** + * Constructor + */ + public MeasureGroupPopulationComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureGroupPopulationComponent(Enumeration type, Identifier identifier, StringType criteria) { + super(); + this.type = type; + this.identifier = identifier; + this.criteria = criteria; + } + + /** + * @return {@link #type} (The type of population criteria.). 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 MeasureGroupPopulationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new MeasurePopulationTypeEnumFactory()); // bb + 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 of population criteria.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public MeasureGroupPopulationComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of population criteria. + */ + public MeasurePopulationType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of population criteria. + */ + public MeasureGroupPopulationComponent setType(MeasurePopulationType value) { + if (this.type == null) + this.type = new Enumeration(new MeasurePopulationTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureGroupPopulationComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report.) + */ + public MeasureGroupPopulationComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #name} (Optional name or short description of this population.). 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 MeasureGroupPopulationComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Optional name or short description of this population.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MeasureGroupPopulationComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Optional name or short description of this population. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Optional name or short description of this population. + */ + public MeasureGroupPopulationComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (The human readable description of this population criteria.). 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 MeasureGroupPopulationComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (The human readable description of this population criteria.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public MeasureGroupPopulationComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The human readable description of this population criteria. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The human readable description of this population criteria. + */ + public MeasureGroupPopulationComponent 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 #criteria} (The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public StringType getCriteriaElement() { + if (this.criteria == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureGroupPopulationComponent.criteria"); + else if (Configuration.doAutoCreate()) + this.criteria = new StringType(); // bb + return this.criteria; + } + + public boolean hasCriteriaElement() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + public boolean hasCriteria() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + /** + * @param value {@link #criteria} (The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public MeasureGroupPopulationComponent setCriteriaElement(StringType value) { + this.criteria = value; + return this; + } + + /** + * @return The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria. + */ + public String getCriteria() { + return this.criteria == null ? null : this.criteria.getValue(); + } + + /** + * @param value The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria. + */ + public MeasureGroupPopulationComponent setCriteria(String value) { + if (this.criteria == null) + this.criteria = new StringType(); + this.criteria.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of population criteria.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "string", "Optional name or short description of this population.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "The human readable description of this population criteria.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("criteria", "string", "The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria.", 0, java.lang.Integer.MAX_VALUE, criteria)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 1952046943: /*criteria*/ return this.criteria == null ? new Base[0] : new Base[] {this.criteria}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new MeasurePopulationTypeEnumFactory().fromType(value); // Enumeration + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 1952046943: // criteria + this.criteria = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new MeasurePopulationTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("criteria")) + this.criteria = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -1618432855: return getIdentifier(); // Identifier + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 1952046943: throw new FHIRException("Cannot make property criteria as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.type"); + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.name"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.description"); + } + else if (name.equals("criteria")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.criteria"); + } + else + return super.addChild(name); + } + + public MeasureGroupPopulationComponent copy() { + MeasureGroupPopulationComponent dst = new MeasureGroupPopulationComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.criteria = criteria == null ? null : criteria.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureGroupPopulationComponent)) + return false; + MeasureGroupPopulationComponent o = (MeasureGroupPopulationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) + && compareDeep(description, o.description, true) && compareDeep(criteria, o.criteria, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureGroupPopulationComponent)) + return false; + MeasureGroupPopulationComponent o = (MeasureGroupPopulationComponent) other; + return compareValues(type, o.type, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true) + && compareValues(criteria, o.criteria, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) && (criteria == null || criteria.isEmpty()) + ; + } + + public String fhirType() { + return "Measure.group.population"; + + } + + } + + @Block() + public static class MeasureGroupStratifierComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The identifier for the stratifier used to coordinate the reported data back to this stratifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The identifier for the stratifier used to coordinate the reported data back to this stratifier", formalDefinition="The identifier for the stratifier used to coordinate the reported data back to this stratifier." ) + protected Identifier identifier; + + /** + * The criteria for the stratifier. This must be the name of an expression defined within a referenced library. + */ + @Child(name = "criteria", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Stratifier criteria", formalDefinition="The criteria for the stratifier. This must be the name of an expression defined within a referenced library." ) + protected StringType criteria; + + /** + * The path to an element that defines the stratifier, specified as a valid FHIR resource path. + */ + @Child(name = "path", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Path to the stratifier", formalDefinition="The path to an element that defines the stratifier, specified as a valid FHIR resource path." ) + protected StringType path; + + private static final long serialVersionUID = -196134448L; + + /** + * Constructor + */ + public MeasureGroupStratifierComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureGroupStratifierComponent(Identifier identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #identifier} (The identifier for the stratifier used to coordinate the reported data back to this stratifier.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureGroupStratifierComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier for the stratifier used to coordinate the reported data back to this stratifier.) + */ + public MeasureGroupStratifierComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #criteria} (The criteria for the stratifier. This must be the name of an expression defined within a referenced library.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public StringType getCriteriaElement() { + if (this.criteria == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureGroupStratifierComponent.criteria"); + else if (Configuration.doAutoCreate()) + this.criteria = new StringType(); // bb + return this.criteria; + } + + public boolean hasCriteriaElement() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + public boolean hasCriteria() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + /** + * @param value {@link #criteria} (The criteria for the stratifier. This must be the name of an expression defined within a referenced library.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public MeasureGroupStratifierComponent setCriteriaElement(StringType value) { + this.criteria = value; + return this; + } + + /** + * @return The criteria for the stratifier. This must be the name of an expression defined within a referenced library. + */ + public String getCriteria() { + return this.criteria == null ? null : this.criteria.getValue(); + } + + /** + * @param value The criteria for the stratifier. This must be the name of an expression defined within a referenced library. + */ + public MeasureGroupStratifierComponent setCriteria(String value) { + if (Utilities.noString(value)) + this.criteria = null; + else { + if (this.criteria == null) + this.criteria = new StringType(); + this.criteria.setValue(value); + } + return this; + } + + /** + * @return {@link #path} (The path to an element that defines the stratifier, specified as a valid FHIR resource path.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureGroupStratifierComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The path to an element that defines the stratifier, specified as a valid FHIR resource path.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public MeasureGroupStratifierComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The path to an element that defines the stratifier, specified as a valid FHIR resource path. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The path to an element that defines the stratifier, specified as a valid FHIR resource path. + */ + public MeasureGroupStratifierComponent setPath(String value) { + if (Utilities.noString(value)) + this.path = null; + else { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The identifier for the stratifier used to coordinate the reported data back to this stratifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("criteria", "string", "The criteria for the stratifier. This must be the name of an expression defined within a referenced library.", 0, java.lang.Integer.MAX_VALUE, criteria)); + childrenList.add(new Property("path", "string", "The path to an element that defines the stratifier, specified as a valid FHIR resource path.", 0, java.lang.Integer.MAX_VALUE, path)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 1952046943: /*criteria*/ return this.criteria == null ? new Base[0] : new Base[] {this.criteria}; // StringType + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 1952046943: // criteria + this.criteria = castToString(value); // StringType + break; + case 3433509: // path + this.path = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("criteria")) + this.criteria = castToString(value); // StringType + else if (name.equals("path")) + this.path = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 1952046943: throw new FHIRException("Cannot make property criteria as it is not a complex type"); // StringType + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("criteria")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.criteria"); + } + else if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.path"); + } + else + return super.addChild(name); + } + + public MeasureGroupStratifierComponent copy() { + MeasureGroupStratifierComponent dst = new MeasureGroupStratifierComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.criteria = criteria == null ? null : criteria.copy(); + dst.path = path == null ? null : path.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureGroupStratifierComponent)) + return false; + MeasureGroupStratifierComponent o = (MeasureGroupStratifierComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(criteria, o.criteria, true) && compareDeep(path, o.path, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureGroupStratifierComponent)) + return false; + MeasureGroupStratifierComponent o = (MeasureGroupStratifierComponent) other; + return compareValues(criteria, o.criteria, true) && compareValues(path, o.path, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (criteria == null || criteria.isEmpty()) + && (path == null || path.isEmpty()); + } + + public String fhirType() { + return "Measure.group.stratifier"; + + } + + } + + @Block() + public static class MeasureSupplementalDataComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier for the supplemental data. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier, unique within the measure", formalDefinition="An identifier for the supplemental data." ) + protected Identifier identifier; + + /** + * An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation. + */ + @Child(name = "usage", type = {CodeType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="supplemental-data | risk-adjustment-factor", formalDefinition="An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation." ) + protected List> usage; + + /** + * The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element. + */ + @Child(name = "criteria", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Supplemental data criteria", formalDefinition="The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element." ) + protected StringType criteria; + + /** + * The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path. + */ + @Child(name = "path", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Path to the supplemental data element", formalDefinition="The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path." ) + protected StringType path; + + private static final long serialVersionUID = 1666728717L; + + /** + * Constructor + */ + public MeasureSupplementalDataComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureSupplementalDataComponent(Identifier identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #identifier} (An identifier for the supplemental data.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureSupplementalDataComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (An identifier for the supplemental data.) + */ + public MeasureSupplementalDataComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #usage} (An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.) + */ + public List> getUsage() { + if (this.usage == null) + this.usage = new ArrayList>(); + return this.usage; + } + + public boolean hasUsage() { + if (this.usage == null) + return false; + for (Enumeration item : this.usage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #usage} (An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.) + */ + // syntactic sugar + public Enumeration addUsageElement() {//2 + Enumeration t = new Enumeration(new MeasureDataUsageEnumFactory()); + if (this.usage == null) + this.usage = new ArrayList>(); + this.usage.add(t); + return t; + } + + /** + * @param value {@link #usage} (An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.) + */ + public MeasureSupplementalDataComponent addUsage(MeasureDataUsage value) { //1 + Enumeration t = new Enumeration(new MeasureDataUsageEnumFactory()); + t.setValue(value); + if (this.usage == null) + this.usage = new ArrayList>(); + this.usage.add(t); + return this; + } + + /** + * @param value {@link #usage} (An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.) + */ + public boolean hasUsage(MeasureDataUsage value) { + if (this.usage == null) + return false; + for (Enumeration v : this.usage) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #criteria} (The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public StringType getCriteriaElement() { + if (this.criteria == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureSupplementalDataComponent.criteria"); + else if (Configuration.doAutoCreate()) + this.criteria = new StringType(); // bb + return this.criteria; + } + + public boolean hasCriteriaElement() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + public boolean hasCriteria() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + /** + * @param value {@link #criteria} (The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public MeasureSupplementalDataComponent setCriteriaElement(StringType value) { + this.criteria = value; + return this; + } + + /** + * @return The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element. + */ + public String getCriteria() { + return this.criteria == null ? null : this.criteria.getValue(); + } + + /** + * @param value The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element. + */ + public MeasureSupplementalDataComponent setCriteria(String value) { + if (Utilities.noString(value)) + this.criteria = null; + else { + if (this.criteria == null) + this.criteria = new StringType(); + this.criteria.setValue(value); + } + return this; + } + + /** + * @return {@link #path} (The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureSupplementalDataComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public MeasureSupplementalDataComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path. + */ + public MeasureSupplementalDataComponent setPath(String value) { + if (Utilities.noString(value)) + this.path = null; + else { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier for the supplemental data.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("usage", "code", "An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.", 0, java.lang.Integer.MAX_VALUE, usage)); + childrenList.add(new Property("criteria", "string", "The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.", 0, java.lang.Integer.MAX_VALUE, criteria)); + childrenList.add(new Property("path", "string", "The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.", 0, java.lang.Integer.MAX_VALUE, path)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 111574433: /*usage*/ return this.usage == null ? new Base[0] : this.usage.toArray(new Base[this.usage.size()]); // Enumeration + case 1952046943: /*criteria*/ return this.criteria == null ? new Base[0] : new Base[] {this.criteria}; // StringType + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 111574433: // usage + this.getUsage().add(new MeasureDataUsageEnumFactory().fromType(value)); // Enumeration + break; + case 1952046943: // criteria + this.criteria = castToString(value); // StringType + break; + case 3433509: // path + this.path = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("usage")) + this.getUsage().add(new MeasureDataUsageEnumFactory().fromType(value)); + else if (name.equals("criteria")) + this.criteria = castToString(value); // StringType + else if (name.equals("path")) + this.path = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 111574433: throw new FHIRException("Cannot make property usage as it is not a complex type"); // Enumeration + case 1952046943: throw new FHIRException("Cannot make property criteria as it is not a complex type"); // StringType + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("usage")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.usage"); + } + else if (name.equals("criteria")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.criteria"); + } + else if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.path"); + } + else + return super.addChild(name); + } + + public MeasureSupplementalDataComponent copy() { + MeasureSupplementalDataComponent dst = new MeasureSupplementalDataComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + if (usage != null) { + dst.usage = new ArrayList>(); + for (Enumeration i : usage) + dst.usage.add(i.copy()); + }; + dst.criteria = criteria == null ? null : criteria.copy(); + dst.path = path == null ? null : path.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureSupplementalDataComponent)) + return false; + MeasureSupplementalDataComponent o = (MeasureSupplementalDataComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(usage, o.usage, true) && compareDeep(criteria, o.criteria, true) + && compareDeep(path, o.path, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureSupplementalDataComponent)) + return false; + MeasureSupplementalDataComponent o = (MeasureSupplementalDataComponent) other; + return compareValues(usage, o.usage, true) && compareValues(criteria, o.criteria, true) && compareValues(path, o.path, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (usage == null || usage.isEmpty()) + && (criteria == null || criteria.isEmpty()) && (path == null || path.isEmpty()); + } + + public String fhirType() { + return "Measure.supplementalData"; + + } + + } + + /** + * The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence. + */ + @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Metadata for the measure", formalDefinition="The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence." ) + protected ModuleMetadata moduleMetadata; + + /** + * A reference to a Library resource containing the formal logic used by the measure. + */ + @Child(name = "library", type = {Library.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Logic used by the measure", formalDefinition="A reference to a Library resource containing the formal logic used by the measure." ) + protected List library; + /** + * The actual objects that are the target of the reference (A reference to a Library resource containing the formal logic used by the measure.) + */ + protected List libraryTarget; + + + /** + * A disclaimer for the use of the measure. + */ + @Child(name = "disclaimer", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Disclaimer for the measure", formalDefinition="A disclaimer for the use of the measure." ) + protected MarkdownType disclaimer; + + /** + * The measure scoring type, e.g. proportion, CV. + */ + @Child(name = "scoring", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="proportion | ratio | continuous-variable | cohort", formalDefinition="The measure scoring type, e.g. proportion, CV." ) + protected Enumeration scoring; + + /** + * The measure type, e.g. process, outcome. + */ + @Child(name = "type", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="process | outcome", formalDefinition="The measure type, e.g. process, outcome." ) + protected List> type; + + /** + * A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. + */ + @Child(name = "riskAdjustment", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How is risk adjustment applied for this measure", formalDefinition="A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results." ) + protected StringType riskAdjustment; + + /** + * A description of the rate aggregation for the measure. + */ + @Child(name = "rateAggregation", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How is rate aggregation performed for this measure", formalDefinition="A description of the rate aggregation for the measure." ) + protected StringType rateAggregation; + + /** + * The rationale for the measure. + */ + @Child(name = "rationale", type = {MarkdownType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why does this measure exist", formalDefinition="The rationale for the measure." ) + protected MarkdownType rationale; + + /** + * The clinical recommendation statement for the measure. + */ + @Child(name = "clinicalRecommendationStatement", type = {MarkdownType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Clinical recommendation", formalDefinition="The clinical recommendation statement for the measure." ) + protected MarkdownType clinicalRecommendationStatement; + + /** + * Improvement notation for the measure, e.g. higher score indicates better quality. + */ + @Child(name = "improvementNotation", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Improvement notation for the measure, e.g. higher score indicates better quality", formalDefinition="Improvement notation for the measure, e.g. higher score indicates better quality." ) + protected StringType improvementNotation; + + /** + * A narrative description of the complete measure calculation. + */ + @Child(name = "definition", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A natural language definition of the measure", formalDefinition="A narrative description of the complete measure calculation." ) + protected MarkdownType definition; + + /** + * Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. + */ + @Child(name = "guidance", type = {MarkdownType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The guidance for the measure", formalDefinition="Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure." ) + protected MarkdownType guidance; + + /** + * The measure set, e.g. Preventive Care and Screening. + */ + @Child(name = "set", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The measure set, e.g. Preventive Care and Screening", formalDefinition="The measure set, e.g. Preventive Care and Screening." ) + protected StringType set; + + /** + * A group of population criteria for the measure. + */ + @Child(name = "group", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Population criteria group", formalDefinition="A group of population criteria for the measure." ) + protected List group; + + /** + * The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path. + */ + @Child(name = "supplementalData", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Supplemental data", formalDefinition="The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path." ) + protected List supplementalData; + + private static final long serialVersionUID = -1000974672L; + + /** + * Constructor + */ + public Measure() { + super(); + } + + /** + * @return {@link #moduleMetadata} (The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence.) + */ + public ModuleMetadata getModuleMetadata() { + if (this.moduleMetadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.moduleMetadata"); + else if (Configuration.doAutoCreate()) + this.moduleMetadata = new ModuleMetadata(); // cc + return this.moduleMetadata; + } + + public boolean hasModuleMetadata() { + return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); + } + + /** + * @param value {@link #moduleMetadata} (The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence.) + */ + public Measure setModuleMetadata(ModuleMetadata value) { + this.moduleMetadata = value; + return this; + } + + /** + * @return {@link #library} (A reference to a Library resource containing the formal logic used by the measure.) + */ + public List getLibrary() { + if (this.library == null) + this.library = new ArrayList(); + return this.library; + } + + public boolean hasLibrary() { + if (this.library == null) + return false; + for (Reference item : this.library) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #library} (A reference to a Library resource containing the formal logic used by the measure.) + */ + // syntactic sugar + public Reference addLibrary() { //3 + Reference t = new Reference(); + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return t; + } + + // syntactic sugar + public Measure addLibrary(Reference t) { //3 + if (t == null) + return this; + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return this; + } + + /** + * @return {@link #library} (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 reference to a Library resource containing the formal logic used by the measure.) + */ + public List getLibraryTarget() { + if (this.libraryTarget == null) + this.libraryTarget = new ArrayList(); + return this.libraryTarget; + } + + // syntactic sugar + /** + * @return {@link #library} (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 reference to a Library resource containing the formal logic used by the measure.) + */ + public Library addLibraryTarget() { + Library r = new Library(); + if (this.libraryTarget == null) + this.libraryTarget = new ArrayList(); + this.libraryTarget.add(r); + return r; + } + + /** + * @return {@link #disclaimer} (A disclaimer for the use of the measure.). This is the underlying object with id, value and extensions. The accessor "getDisclaimer" gives direct access to the value + */ + public MarkdownType getDisclaimerElement() { + if (this.disclaimer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.disclaimer"); + else if (Configuration.doAutoCreate()) + this.disclaimer = new MarkdownType(); // bb + return this.disclaimer; + } + + public boolean hasDisclaimerElement() { + return this.disclaimer != null && !this.disclaimer.isEmpty(); + } + + public boolean hasDisclaimer() { + return this.disclaimer != null && !this.disclaimer.isEmpty(); + } + + /** + * @param value {@link #disclaimer} (A disclaimer for the use of the measure.). This is the underlying object with id, value and extensions. The accessor "getDisclaimer" gives direct access to the value + */ + public Measure setDisclaimerElement(MarkdownType value) { + this.disclaimer = value; + return this; + } + + /** + * @return A disclaimer for the use of the measure. + */ + public String getDisclaimer() { + return this.disclaimer == null ? null : this.disclaimer.getValue(); + } + + /** + * @param value A disclaimer for the use of the measure. + */ + public Measure setDisclaimer(String value) { + if (value == null) + this.disclaimer = null; + else { + if (this.disclaimer == null) + this.disclaimer = new MarkdownType(); + this.disclaimer.setValue(value); + } + return this; + } + + /** + * @return {@link #scoring} (The measure scoring type, e.g. proportion, CV.). This is the underlying object with id, value and extensions. The accessor "getScoring" gives direct access to the value + */ + public Enumeration getScoringElement() { + if (this.scoring == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.scoring"); + else if (Configuration.doAutoCreate()) + this.scoring = new Enumeration(new MeasureScoringEnumFactory()); // bb + return this.scoring; + } + + public boolean hasScoringElement() { + return this.scoring != null && !this.scoring.isEmpty(); + } + + public boolean hasScoring() { + return this.scoring != null && !this.scoring.isEmpty(); + } + + /** + * @param value {@link #scoring} (The measure scoring type, e.g. proportion, CV.). This is the underlying object with id, value and extensions. The accessor "getScoring" gives direct access to the value + */ + public Measure setScoringElement(Enumeration value) { + this.scoring = value; + return this; + } + + /** + * @return The measure scoring type, e.g. proportion, CV. + */ + public MeasureScoring getScoring() { + return this.scoring == null ? null : this.scoring.getValue(); + } + + /** + * @param value The measure scoring type, e.g. proportion, CV. + */ + public Measure setScoring(MeasureScoring value) { + if (value == null) + this.scoring = null; + else { + if (this.scoring == null) + this.scoring = new Enumeration(new MeasureScoringEnumFactory()); + this.scoring.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The measure type, e.g. process, outcome.) + */ + public List> getType() { + if (this.type == null) + this.type = new ArrayList>(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (Enumeration item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (The measure type, e.g. process, outcome.) + */ + // syntactic sugar + public Enumeration addTypeElement() {//2 + Enumeration t = new Enumeration(new MeasureTypeEnumFactory()); + if (this.type == null) + this.type = new ArrayList>(); + this.type.add(t); + return t; + } + + /** + * @param value {@link #type} (The measure type, e.g. process, outcome.) + */ + public Measure addType(MeasureType value) { //1 + Enumeration t = new Enumeration(new MeasureTypeEnumFactory()); + t.setValue(value); + if (this.type == null) + this.type = new ArrayList>(); + this.type.add(t); + return this; + } + + /** + * @param value {@link #type} (The measure type, e.g. process, outcome.) + */ + public boolean hasType(MeasureType value) { + if (this.type == null) + return false; + for (Enumeration v : this.type) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #riskAdjustment} (A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.). This is the underlying object with id, value and extensions. The accessor "getRiskAdjustment" gives direct access to the value + */ + public StringType getRiskAdjustmentElement() { + if (this.riskAdjustment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.riskAdjustment"); + else if (Configuration.doAutoCreate()) + this.riskAdjustment = new StringType(); // bb + return this.riskAdjustment; + } + + public boolean hasRiskAdjustmentElement() { + return this.riskAdjustment != null && !this.riskAdjustment.isEmpty(); + } + + public boolean hasRiskAdjustment() { + return this.riskAdjustment != null && !this.riskAdjustment.isEmpty(); + } + + /** + * @param value {@link #riskAdjustment} (A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.). This is the underlying object with id, value and extensions. The accessor "getRiskAdjustment" gives direct access to the value + */ + public Measure setRiskAdjustmentElement(StringType value) { + this.riskAdjustment = value; + return this; + } + + /** + * @return A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. + */ + public String getRiskAdjustment() { + return this.riskAdjustment == null ? null : this.riskAdjustment.getValue(); + } + + /** + * @param value A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. + */ + public Measure setRiskAdjustment(String value) { + if (Utilities.noString(value)) + this.riskAdjustment = null; + else { + if (this.riskAdjustment == null) + this.riskAdjustment = new StringType(); + this.riskAdjustment.setValue(value); + } + return this; + } + + /** + * @return {@link #rateAggregation} (A description of the rate aggregation for the measure.). This is the underlying object with id, value and extensions. The accessor "getRateAggregation" gives direct access to the value + */ + public StringType getRateAggregationElement() { + if (this.rateAggregation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.rateAggregation"); + else if (Configuration.doAutoCreate()) + this.rateAggregation = new StringType(); // bb + return this.rateAggregation; + } + + public boolean hasRateAggregationElement() { + return this.rateAggregation != null && !this.rateAggregation.isEmpty(); + } + + public boolean hasRateAggregation() { + return this.rateAggregation != null && !this.rateAggregation.isEmpty(); + } + + /** + * @param value {@link #rateAggregation} (A description of the rate aggregation for the measure.). This is the underlying object with id, value and extensions. The accessor "getRateAggregation" gives direct access to the value + */ + public Measure setRateAggregationElement(StringType value) { + this.rateAggregation = value; + return this; + } + + /** + * @return A description of the rate aggregation for the measure. + */ + public String getRateAggregation() { + return this.rateAggregation == null ? null : this.rateAggregation.getValue(); + } + + /** + * @param value A description of the rate aggregation for the measure. + */ + public Measure setRateAggregation(String value) { + if (Utilities.noString(value)) + this.rateAggregation = null; + else { + if (this.rateAggregation == null) + this.rateAggregation = new StringType(); + this.rateAggregation.setValue(value); + } + return this; + } + + /** + * @return {@link #rationale} (The rationale for the measure.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value + */ + public MarkdownType getRationaleElement() { + if (this.rationale == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.rationale"); + else if (Configuration.doAutoCreate()) + this.rationale = new MarkdownType(); // bb + return this.rationale; + } + + public boolean hasRationaleElement() { + return this.rationale != null && !this.rationale.isEmpty(); + } + + public boolean hasRationale() { + return this.rationale != null && !this.rationale.isEmpty(); + } + + /** + * @param value {@link #rationale} (The rationale for the measure.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value + */ + public Measure setRationaleElement(MarkdownType value) { + this.rationale = value; + return this; + } + + /** + * @return The rationale for the measure. + */ + public String getRationale() { + return this.rationale == null ? null : this.rationale.getValue(); + } + + /** + * @param value The rationale for the measure. + */ + public Measure setRationale(String value) { + if (value == null) + this.rationale = null; + else { + if (this.rationale == null) + this.rationale = new MarkdownType(); + this.rationale.setValue(value); + } + return this; + } + + /** + * @return {@link #clinicalRecommendationStatement} (The clinical recommendation statement for the measure.). This is the underlying object with id, value and extensions. The accessor "getClinicalRecommendationStatement" gives direct access to the value + */ + public MarkdownType getClinicalRecommendationStatementElement() { + if (this.clinicalRecommendationStatement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.clinicalRecommendationStatement"); + else if (Configuration.doAutoCreate()) + this.clinicalRecommendationStatement = new MarkdownType(); // bb + return this.clinicalRecommendationStatement; + } + + public boolean hasClinicalRecommendationStatementElement() { + return this.clinicalRecommendationStatement != null && !this.clinicalRecommendationStatement.isEmpty(); + } + + public boolean hasClinicalRecommendationStatement() { + return this.clinicalRecommendationStatement != null && !this.clinicalRecommendationStatement.isEmpty(); + } + + /** + * @param value {@link #clinicalRecommendationStatement} (The clinical recommendation statement for the measure.). This is the underlying object with id, value and extensions. The accessor "getClinicalRecommendationStatement" gives direct access to the value + */ + public Measure setClinicalRecommendationStatementElement(MarkdownType value) { + this.clinicalRecommendationStatement = value; + return this; + } + + /** + * @return The clinical recommendation statement for the measure. + */ + public String getClinicalRecommendationStatement() { + return this.clinicalRecommendationStatement == null ? null : this.clinicalRecommendationStatement.getValue(); + } + + /** + * @param value The clinical recommendation statement for the measure. + */ + public Measure setClinicalRecommendationStatement(String value) { + if (value == null) + this.clinicalRecommendationStatement = null; + else { + if (this.clinicalRecommendationStatement == null) + this.clinicalRecommendationStatement = new MarkdownType(); + this.clinicalRecommendationStatement.setValue(value); + } + return this; + } + + /** + * @return {@link #improvementNotation} (Improvement notation for the measure, e.g. higher score indicates better quality.). This is the underlying object with id, value and extensions. The accessor "getImprovementNotation" gives direct access to the value + */ + public StringType getImprovementNotationElement() { + if (this.improvementNotation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.improvementNotation"); + else if (Configuration.doAutoCreate()) + this.improvementNotation = new StringType(); // bb + return this.improvementNotation; + } + + public boolean hasImprovementNotationElement() { + return this.improvementNotation != null && !this.improvementNotation.isEmpty(); + } + + public boolean hasImprovementNotation() { + return this.improvementNotation != null && !this.improvementNotation.isEmpty(); + } + + /** + * @param value {@link #improvementNotation} (Improvement notation for the measure, e.g. higher score indicates better quality.). This is the underlying object with id, value and extensions. The accessor "getImprovementNotation" gives direct access to the value + */ + public Measure setImprovementNotationElement(StringType value) { + this.improvementNotation = value; + return this; + } + + /** + * @return Improvement notation for the measure, e.g. higher score indicates better quality. + */ + public String getImprovementNotation() { + return this.improvementNotation == null ? null : this.improvementNotation.getValue(); + } + + /** + * @param value Improvement notation for the measure, e.g. higher score indicates better quality. + */ + public Measure setImprovementNotation(String value) { + if (Utilities.noString(value)) + this.improvementNotation = null; + else { + if (this.improvementNotation == null) + this.improvementNotation = new StringType(); + this.improvementNotation.setValue(value); + } + return this; + } + + /** + * @return {@link #definition} (A narrative description of the complete measure calculation.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public MarkdownType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new MarkdownType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (A narrative description of the complete measure calculation.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public Measure setDefinitionElement(MarkdownType value) { + this.definition = value; + return this; + } + + /** + * @return A narrative description of the complete measure calculation. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value A narrative description of the complete measure calculation. + */ + public Measure setDefinition(String value) { + if (value == null) + this.definition = null; + else { + if (this.definition == null) + this.definition = new MarkdownType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #guidance} (Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.). This is the underlying object with id, value and extensions. The accessor "getGuidance" gives direct access to the value + */ + public MarkdownType getGuidanceElement() { + if (this.guidance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.guidance"); + else if (Configuration.doAutoCreate()) + this.guidance = new MarkdownType(); // bb + return this.guidance; + } + + public boolean hasGuidanceElement() { + return this.guidance != null && !this.guidance.isEmpty(); + } + + public boolean hasGuidance() { + return this.guidance != null && !this.guidance.isEmpty(); + } + + /** + * @param value {@link #guidance} (Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.). This is the underlying object with id, value and extensions. The accessor "getGuidance" gives direct access to the value + */ + public Measure setGuidanceElement(MarkdownType value) { + this.guidance = value; + return this; + } + + /** + * @return Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. + */ + public String getGuidance() { + return this.guidance == null ? null : this.guidance.getValue(); + } + + /** + * @param value Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. + */ + public Measure setGuidance(String value) { + if (value == null) + this.guidance = null; + else { + if (this.guidance == null) + this.guidance = new MarkdownType(); + this.guidance.setValue(value); + } + return this; + } + + /** + * @return {@link #set} (The measure set, e.g. Preventive Care and Screening.). This is the underlying object with id, value and extensions. The accessor "getSet" gives direct access to the value + */ + public StringType getSetElement() { + if (this.set == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.set"); + else if (Configuration.doAutoCreate()) + this.set = new StringType(); // bb + return this.set; + } + + public boolean hasSetElement() { + return this.set != null && !this.set.isEmpty(); + } + + public boolean hasSet() { + return this.set != null && !this.set.isEmpty(); + } + + /** + * @param value {@link #set} (The measure set, e.g. Preventive Care and Screening.). This is the underlying object with id, value and extensions. The accessor "getSet" gives direct access to the value + */ + public Measure setSetElement(StringType value) { + this.set = value; + return this; + } + + /** + * @return The measure set, e.g. Preventive Care and Screening. + */ + public String getSet() { + return this.set == null ? null : this.set.getValue(); + } + + /** + * @param value The measure set, e.g. Preventive Care and Screening. + */ + public Measure setSet(String value) { + if (Utilities.noString(value)) + this.set = null; + else { + if (this.set == null) + this.set = new StringType(); + this.set.setValue(value); + } + return this; + } + + /** + * @return {@link #group} (A group of population criteria for the measure.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (MeasureGroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (A group of population criteria for the measure.) + */ + // syntactic sugar + public MeasureGroupComponent addGroup() { //3 + MeasureGroupComponent t = new MeasureGroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public Measure addGroup(MeasureGroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + /** + * @return {@link #supplementalData} (The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.) + */ + public List getSupplementalData() { + if (this.supplementalData == null) + this.supplementalData = new ArrayList(); + return this.supplementalData; + } + + public boolean hasSupplementalData() { + if (this.supplementalData == null) + return false; + for (MeasureSupplementalDataComponent item : this.supplementalData) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supplementalData} (The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.) + */ + // syntactic sugar + public MeasureSupplementalDataComponent addSupplementalData() { //3 + MeasureSupplementalDataComponent t = new MeasureSupplementalDataComponent(); + if (this.supplementalData == null) + this.supplementalData = new ArrayList(); + this.supplementalData.add(t); + return t; + } + + // syntactic sugar + public Measure addSupplementalData(MeasureSupplementalDataComponent t) { //3 + if (t == null) + return this; + if (this.supplementalData == null) + this.supplementalData = new ArrayList(); + this.supplementalData.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); + childrenList.add(new Property("library", "Reference(Library)", "A reference to a Library resource containing the formal logic used by the measure.", 0, java.lang.Integer.MAX_VALUE, library)); + childrenList.add(new Property("disclaimer", "markdown", "A disclaimer for the use of the measure.", 0, java.lang.Integer.MAX_VALUE, disclaimer)); + childrenList.add(new Property("scoring", "code", "The measure scoring type, e.g. proportion, CV.", 0, java.lang.Integer.MAX_VALUE, scoring)); + childrenList.add(new Property("type", "code", "The measure type, e.g. process, outcome.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("riskAdjustment", "string", "A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.", 0, java.lang.Integer.MAX_VALUE, riskAdjustment)); + childrenList.add(new Property("rateAggregation", "string", "A description of the rate aggregation for the measure.", 0, java.lang.Integer.MAX_VALUE, rateAggregation)); + childrenList.add(new Property("rationale", "markdown", "The rationale for the measure.", 0, java.lang.Integer.MAX_VALUE, rationale)); + childrenList.add(new Property("clinicalRecommendationStatement", "markdown", "The clinical recommendation statement for the measure.", 0, java.lang.Integer.MAX_VALUE, clinicalRecommendationStatement)); + childrenList.add(new Property("improvementNotation", "string", "Improvement notation for the measure, e.g. higher score indicates better quality.", 0, java.lang.Integer.MAX_VALUE, improvementNotation)); + childrenList.add(new Property("definition", "markdown", "A narrative description of the complete measure calculation.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("guidance", "markdown", "Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.", 0, java.lang.Integer.MAX_VALUE, guidance)); + childrenList.add(new Property("set", "string", "The measure set, e.g. Preventive Care and Screening.", 0, java.lang.Integer.MAX_VALUE, set)); + childrenList.add(new Property("group", "", "A group of population criteria for the measure.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("supplementalData", "", "The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.", 0, java.lang.Integer.MAX_VALUE, supplementalData)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata + case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // Reference + case 432371099: /*disclaimer*/ return this.disclaimer == null ? new Base[0] : new Base[] {this.disclaimer}; // MarkdownType + case 1924005583: /*scoring*/ return this.scoring == null ? new Base[0] : new Base[] {this.scoring}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Enumeration + case 93273500: /*riskAdjustment*/ return this.riskAdjustment == null ? new Base[0] : new Base[] {this.riskAdjustment}; // StringType + case 1254503906: /*rateAggregation*/ return this.rateAggregation == null ? new Base[0] : new Base[] {this.rateAggregation}; // StringType + case 345689335: /*rationale*/ return this.rationale == null ? new Base[0] : new Base[] {this.rationale}; // MarkdownType + case -18631389: /*clinicalRecommendationStatement*/ return this.clinicalRecommendationStatement == null ? new Base[0] : new Base[] {this.clinicalRecommendationStatement}; // MarkdownType + case -2085456136: /*improvementNotation*/ return this.improvementNotation == null ? new Base[0] : new Base[] {this.improvementNotation}; // StringType + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // MarkdownType + case -1314002088: /*guidance*/ return this.guidance == null ? new Base[0] : new Base[] {this.guidance}; // MarkdownType + case 113762: /*set*/ return this.set == null ? new Base[0] : new Base[] {this.set}; // StringType + case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureGroupComponent + case 1447496814: /*supplementalData*/ return this.supplementalData == null ? new Base[0] : this.supplementalData.toArray(new Base[this.supplementalData.size()]); // MeasureSupplementalDataComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 455891387: // moduleMetadata + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + break; + case 166208699: // library + this.getLibrary().add(castToReference(value)); // Reference + break; + case 432371099: // disclaimer + this.disclaimer = castToMarkdown(value); // MarkdownType + break; + case 1924005583: // scoring + this.scoring = new MeasureScoringEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.getType().add(new MeasureTypeEnumFactory().fromType(value)); // Enumeration + break; + case 93273500: // riskAdjustment + this.riskAdjustment = castToString(value); // StringType + break; + case 1254503906: // rateAggregation + this.rateAggregation = castToString(value); // StringType + break; + case 345689335: // rationale + this.rationale = castToMarkdown(value); // MarkdownType + break; + case -18631389: // clinicalRecommendationStatement + this.clinicalRecommendationStatement = castToMarkdown(value); // MarkdownType + break; + case -2085456136: // improvementNotation + this.improvementNotation = castToString(value); // StringType + break; + case -1014418093: // definition + this.definition = castToMarkdown(value); // MarkdownType + break; + case -1314002088: // guidance + this.guidance = castToMarkdown(value); // MarkdownType + break; + case 113762: // set + this.set = castToString(value); // StringType + break; + case 98629247: // group + this.getGroup().add((MeasureGroupComponent) value); // MeasureGroupComponent + break; + case 1447496814: // supplementalData + this.getSupplementalData().add((MeasureSupplementalDataComponent) value); // MeasureSupplementalDataComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("moduleMetadata")) + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + else if (name.equals("library")) + this.getLibrary().add(castToReference(value)); + else if (name.equals("disclaimer")) + this.disclaimer = castToMarkdown(value); // MarkdownType + else if (name.equals("scoring")) + this.scoring = new MeasureScoringEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.getType().add(new MeasureTypeEnumFactory().fromType(value)); + else if (name.equals("riskAdjustment")) + this.riskAdjustment = castToString(value); // StringType + else if (name.equals("rateAggregation")) + this.rateAggregation = castToString(value); // StringType + else if (name.equals("rationale")) + this.rationale = castToMarkdown(value); // MarkdownType + else if (name.equals("clinicalRecommendationStatement")) + this.clinicalRecommendationStatement = castToMarkdown(value); // MarkdownType + else if (name.equals("improvementNotation")) + this.improvementNotation = castToString(value); // StringType + else if (name.equals("definition")) + this.definition = castToMarkdown(value); // MarkdownType + else if (name.equals("guidance")) + this.guidance = castToMarkdown(value); // MarkdownType + else if (name.equals("set")) + this.set = castToString(value); // StringType + else if (name.equals("group")) + this.getGroup().add((MeasureGroupComponent) value); + else if (name.equals("supplementalData")) + this.getSupplementalData().add((MeasureSupplementalDataComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 455891387: return getModuleMetadata(); // ModuleMetadata + case 166208699: return addLibrary(); // Reference + case 432371099: throw new FHIRException("Cannot make property disclaimer as it is not a complex type"); // MarkdownType + case 1924005583: throw new FHIRException("Cannot make property scoring as it is not a complex type"); // Enumeration + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 93273500: throw new FHIRException("Cannot make property riskAdjustment as it is not a complex type"); // StringType + case 1254503906: throw new FHIRException("Cannot make property rateAggregation as it is not a complex type"); // StringType + case 345689335: throw new FHIRException("Cannot make property rationale as it is not a complex type"); // MarkdownType + case -18631389: throw new FHIRException("Cannot make property clinicalRecommendationStatement as it is not a complex type"); // MarkdownType + case -2085456136: throw new FHIRException("Cannot make property improvementNotation as it is not a complex type"); // StringType + case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // MarkdownType + case -1314002088: throw new FHIRException("Cannot make property guidance as it is not a complex type"); // MarkdownType + case 113762: throw new FHIRException("Cannot make property set as it is not a complex type"); // StringType + case 98629247: return addGroup(); // MeasureGroupComponent + case 1447496814: return addSupplementalData(); // MeasureSupplementalDataComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("moduleMetadata")) { + this.moduleMetadata = new ModuleMetadata(); + return this.moduleMetadata; + } + else if (name.equals("library")) { + return addLibrary(); + } + else if (name.equals("disclaimer")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.disclaimer"); + } + else if (name.equals("scoring")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.scoring"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.type"); + } + else if (name.equals("riskAdjustment")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.riskAdjustment"); + } + else if (name.equals("rateAggregation")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.rateAggregation"); + } + else if (name.equals("rationale")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.rationale"); + } + else if (name.equals("clinicalRecommendationStatement")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.clinicalRecommendationStatement"); + } + else if (name.equals("improvementNotation")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.improvementNotation"); + } + else if (name.equals("definition")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.definition"); + } + else if (name.equals("guidance")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.guidance"); + } + else if (name.equals("set")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.set"); + } + else if (name.equals("group")) { + return addGroup(); + } + else if (name.equals("supplementalData")) { + return addSupplementalData(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Measure"; + + } + + public Measure copy() { + Measure dst = new Measure(); + copyValues(dst); + dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); + if (library != null) { + dst.library = new ArrayList(); + for (Reference i : library) + dst.library.add(i.copy()); + }; + dst.disclaimer = disclaimer == null ? null : disclaimer.copy(); + dst.scoring = scoring == null ? null : scoring.copy(); + if (type != null) { + dst.type = new ArrayList>(); + for (Enumeration i : type) + dst.type.add(i.copy()); + }; + dst.riskAdjustment = riskAdjustment == null ? null : riskAdjustment.copy(); + dst.rateAggregation = rateAggregation == null ? null : rateAggregation.copy(); + dst.rationale = rationale == null ? null : rationale.copy(); + dst.clinicalRecommendationStatement = clinicalRecommendationStatement == null ? null : clinicalRecommendationStatement.copy(); + dst.improvementNotation = improvementNotation == null ? null : improvementNotation.copy(); + dst.definition = definition == null ? null : definition.copy(); + dst.guidance = guidance == null ? null : guidance.copy(); + dst.set = set == null ? null : set.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (MeasureGroupComponent i : group) + dst.group.add(i.copy()); + }; + if (supplementalData != null) { + dst.supplementalData = new ArrayList(); + for (MeasureSupplementalDataComponent i : supplementalData) + dst.supplementalData.add(i.copy()); + }; + return dst; + } + + protected Measure typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Measure)) + return false; + Measure o = (Measure) other; + return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(library, o.library, true) + && compareDeep(disclaimer, o.disclaimer, true) && compareDeep(scoring, o.scoring, true) && compareDeep(type, o.type, true) + && compareDeep(riskAdjustment, o.riskAdjustment, true) && compareDeep(rateAggregation, o.rateAggregation, true) + && compareDeep(rationale, o.rationale, true) && compareDeep(clinicalRecommendationStatement, o.clinicalRecommendationStatement, true) + && compareDeep(improvementNotation, o.improvementNotation, true) && compareDeep(definition, o.definition, true) + && compareDeep(guidance, o.guidance, true) && compareDeep(set, o.set, true) && compareDeep(group, o.group, true) + && compareDeep(supplementalData, o.supplementalData, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Measure)) + return false; + Measure o = (Measure) other; + return compareValues(disclaimer, o.disclaimer, true) && compareValues(scoring, o.scoring, true) && compareValues(type, o.type, true) + && compareValues(riskAdjustment, o.riskAdjustment, true) && compareValues(rateAggregation, o.rateAggregation, true) + && compareValues(rationale, o.rationale, true) && compareValues(clinicalRecommendationStatement, o.clinicalRecommendationStatement, true) + && compareValues(improvementNotation, o.improvementNotation, true) && compareValues(definition, o.definition, true) + && compareValues(guidance, o.guidance, true) && compareValues(set, o.set, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (library == null || library.isEmpty()) + && (disclaimer == null || disclaimer.isEmpty()) && (scoring == null || scoring.isEmpty()) + && (type == null || type.isEmpty()) && (riskAdjustment == null || riskAdjustment.isEmpty()) + && (rateAggregation == null || rateAggregation.isEmpty()) && (rationale == null || rationale.isEmpty()) + && (clinicalRecommendationStatement == null || clinicalRecommendationStatement.isEmpty()) + && (improvementNotation == null || improvementNotation.isEmpty()) && (definition == null || definition.isEmpty()) + && (guidance == null || guidance.isEmpty()) && (set == null || set.isEmpty()) && (group == null || group.isEmpty()) + && (supplementalData == null || supplementalData.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Measure; + } + + /** + * Search parameter: topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: Measure.moduleMetadata.topic
+ *

+ */ + @SearchParamDefinition(name="topic", path="Measure.moduleMetadata.topic", description="Topics associated with the module", type="token" ) + public static final String SP_TOPIC = "topic"; + /** + * Fluent Client search parameter constant for topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: Measure.moduleMetadata.topic
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); + + /** + * Search parameter: title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: Measure.moduleMetadata.title
+ *

+ */ + @SearchParamDefinition(name="title", path="Measure.moduleMetadata.title", description="Text search against the title", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: Measure.moduleMetadata.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: Measure.moduleMetadata.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Measure.moduleMetadata.status", description="Status of the module", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: Measure.moduleMetadata.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: Measure.moduleMetadata.description
+ *

+ */ + @SearchParamDefinition(name="description", path="Measure.moduleMetadata.description", description="Text search against the description", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: Measure.moduleMetadata.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: Measure.moduleMetadata.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Measure.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: Measure.moduleMetadata.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: Measure.moduleMetadata.version
+ *

+ */ + @SearchParamDefinition(name="version", path="Measure.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: Measure.moduleMetadata.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MeasureReport.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MeasureReport.java new file mode 100644 index 00000000000..c9d2227f9ea --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MeasureReport.java @@ -0,0 +1,3001 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The MeasureReport resource contains the results of evaluating a measure. + */ +@ResourceDef(name="MeasureReport", profile="http://hl7.org/fhir/Profile/MeasureReport") +public class MeasureReport extends DomainResource { + + public enum MeasureReportType { + /** + * An individual report that provides information on the performance for a given measure with respect to a single patient + */ + INDIVIDUAL, + /** + * A patient list report that includes a listing of patients that satisfied each population criteria in the measure + */ + PATIENTLIST, + /** + * A summary report that returns the number of patients in each population criteria for the measure + */ + SUMMARY, + /** + * added to help the parsers + */ + NULL; + public static MeasureReportType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("individual".equals(codeString)) + return INDIVIDUAL; + if ("patient-list".equals(codeString)) + return PATIENTLIST; + if ("summary".equals(codeString)) + return SUMMARY; + throw new FHIRException("Unknown MeasureReportType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INDIVIDUAL: return "individual"; + case PATIENTLIST: return "patient-list"; + case SUMMARY: return "summary"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INDIVIDUAL: return "http://hl7.org/fhir/measure-report-type"; + case PATIENTLIST: return "http://hl7.org/fhir/measure-report-type"; + case SUMMARY: return "http://hl7.org/fhir/measure-report-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INDIVIDUAL: return "An individual report that provides information on the performance for a given measure with respect to a single patient"; + case PATIENTLIST: return "A patient list report that includes a listing of patients that satisfied each population criteria in the measure"; + case SUMMARY: return "A summary report that returns the number of patients in each population criteria for the measure"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INDIVIDUAL: return "Individual"; + case PATIENTLIST: return "Patient List"; + case SUMMARY: return "Summary"; + default: return "?"; + } + } + } + + public static class MeasureReportTypeEnumFactory implements EnumFactory { + public MeasureReportType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("individual".equals(codeString)) + return MeasureReportType.INDIVIDUAL; + if ("patient-list".equals(codeString)) + return MeasureReportType.PATIENTLIST; + if ("summary".equals(codeString)) + return MeasureReportType.SUMMARY; + throw new IllegalArgumentException("Unknown MeasureReportType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("individual".equals(codeString)) + return new Enumeration(this, MeasureReportType.INDIVIDUAL); + if ("patient-list".equals(codeString)) + return new Enumeration(this, MeasureReportType.PATIENTLIST); + if ("summary".equals(codeString)) + return new Enumeration(this, MeasureReportType.SUMMARY); + throw new FHIRException("Unknown MeasureReportType code '"+codeString+"'"); + } + public String toCode(MeasureReportType code) { + if (code == MeasureReportType.INDIVIDUAL) + return "individual"; + if (code == MeasureReportType.PATIENTLIST) + return "patient-list"; + if (code == MeasureReportType.SUMMARY) + return "summary"; + return "?"; + } + public String toSystem(MeasureReportType code) { + return code.getSystem(); + } + } + + public enum MeasureReportStatus { + /** + * The report is complete and ready for use + */ + COMPLETE, + /** + * The report is currently being generated + */ + PENDING, + /** + * An error occurred attempting to generate the report + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + public static MeasureReportStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("pending".equals(codeString)) + return PENDING; + if ("error".equals(codeString)) + return ERROR; + throw new FHIRException("Unknown MeasureReportStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PENDING: return "pending"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return "http://hl7.org/fhir/measure-report-status"; + case PENDING: return "http://hl7.org/fhir/measure-report-status"; + case ERROR: return "http://hl7.org/fhir/measure-report-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The report is complete and ready for use"; + case PENDING: return "The report is currently being generated"; + case ERROR: return "An error occurred attempting to generate the report"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "Complete"; + case PENDING: return "Pending"; + case ERROR: return "Error"; + default: return "?"; + } + } + } + + public static class MeasureReportStatusEnumFactory implements EnumFactory { + public MeasureReportStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return MeasureReportStatus.COMPLETE; + if ("pending".equals(codeString)) + return MeasureReportStatus.PENDING; + if ("error".equals(codeString)) + return MeasureReportStatus.ERROR; + throw new IllegalArgumentException("Unknown MeasureReportStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return new Enumeration(this, MeasureReportStatus.COMPLETE); + if ("pending".equals(codeString)) + return new Enumeration(this, MeasureReportStatus.PENDING); + if ("error".equals(codeString)) + return new Enumeration(this, MeasureReportStatus.ERROR); + throw new FHIRException("Unknown MeasureReportStatus code '"+codeString+"'"); + } + public String toCode(MeasureReportStatus code) { + if (code == MeasureReportStatus.COMPLETE) + return "complete"; + if (code == MeasureReportStatus.PENDING) + return "pending"; + if (code == MeasureReportStatus.ERROR) + return "error"; + return "?"; + } + public String toSystem(MeasureReportStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class MeasureReportGroupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The identifier of the population group as defined in the measure definition. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier of the population group being reported", formalDefinition="The identifier of the population group as defined in the measure definition." ) + protected Identifier identifier; + + /** + * The populations that make up the population group, one for each type of population appropriate for the measure. + */ + @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The populations in the group", formalDefinition="The populations that make up the population group, one for each type of population appropriate for the measure." ) + protected List population; + + /** + * The measure score. + */ + @Child(name = "measureScore", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The measure score", formalDefinition="The measure score." ) + protected DecimalType measureScore; + + /** + * When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure. + */ + @Child(name = "stratifier", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Stratification results", formalDefinition="When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure." ) + protected List stratifier; + + /** + * Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations. + */ + @Child(name = "supplementalData", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Supplemental data elements for the measure", formalDefinition="Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations." ) + protected List supplementalData; + + private static final long serialVersionUID = -832029515L; + + /** + * Constructor + */ + public MeasureReportGroupComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureReportGroupComponent(Identifier identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #identifier} (The identifier of the population group as defined in the measure definition.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier of the population group as defined in the measure definition.) + */ + public MeasureReportGroupComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #population} (The populations that make up the population group, one for each type of population appropriate for the measure.) + */ + public List getPopulation() { + if (this.population == null) + this.population = new ArrayList(); + return this.population; + } + + public boolean hasPopulation() { + if (this.population == null) + return false; + for (MeasureReportGroupPopulationComponent item : this.population) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #population} (The populations that make up the population group, one for each type of population appropriate for the measure.) + */ + // syntactic sugar + public MeasureReportGroupPopulationComponent addPopulation() { //3 + MeasureReportGroupPopulationComponent t = new MeasureReportGroupPopulationComponent(); + if (this.population == null) + this.population = new ArrayList(); + this.population.add(t); + return t; + } + + // syntactic sugar + public MeasureReportGroupComponent addPopulation(MeasureReportGroupPopulationComponent t) { //3 + if (t == null) + return this; + if (this.population == null) + this.population = new ArrayList(); + this.population.add(t); + return this; + } + + /** + * @return {@link #measureScore} (The measure score.). This is the underlying object with id, value and extensions. The accessor "getMeasureScore" gives direct access to the value + */ + public DecimalType getMeasureScoreElement() { + if (this.measureScore == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupComponent.measureScore"); + else if (Configuration.doAutoCreate()) + this.measureScore = new DecimalType(); // bb + return this.measureScore; + } + + public boolean hasMeasureScoreElement() { + return this.measureScore != null && !this.measureScore.isEmpty(); + } + + public boolean hasMeasureScore() { + return this.measureScore != null && !this.measureScore.isEmpty(); + } + + /** + * @param value {@link #measureScore} (The measure score.). This is the underlying object with id, value and extensions. The accessor "getMeasureScore" gives direct access to the value + */ + public MeasureReportGroupComponent setMeasureScoreElement(DecimalType value) { + this.measureScore = value; + return this; + } + + /** + * @return The measure score. + */ + public BigDecimal getMeasureScore() { + return this.measureScore == null ? null : this.measureScore.getValue(); + } + + /** + * @param value The measure score. + */ + public MeasureReportGroupComponent setMeasureScore(BigDecimal value) { + if (value == null) + this.measureScore = null; + else { + if (this.measureScore == null) + this.measureScore = new DecimalType(); + this.measureScore.setValue(value); + } + return this; + } + + /** + * @param value The measure score. + */ + public MeasureReportGroupComponent setMeasureScore(long value) { + this.measureScore = new DecimalType(); + this.measureScore.setValue(value); + return this; + } + + /** + * @param value The measure score. + */ + public MeasureReportGroupComponent setMeasureScore(double value) { + this.measureScore = new DecimalType(); + this.measureScore.setValue(value); + return this; + } + + /** + * @return {@link #stratifier} (When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.) + */ + public List getStratifier() { + if (this.stratifier == null) + this.stratifier = new ArrayList(); + return this.stratifier; + } + + public boolean hasStratifier() { + if (this.stratifier == null) + return false; + for (MeasureReportGroupStratifierComponent item : this.stratifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #stratifier} (When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.) + */ + // syntactic sugar + public MeasureReportGroupStratifierComponent addStratifier() { //3 + MeasureReportGroupStratifierComponent t = new MeasureReportGroupStratifierComponent(); + if (this.stratifier == null) + this.stratifier = new ArrayList(); + this.stratifier.add(t); + return t; + } + + // syntactic sugar + public MeasureReportGroupComponent addStratifier(MeasureReportGroupStratifierComponent t) { //3 + if (t == null) + return this; + if (this.stratifier == null) + this.stratifier = new ArrayList(); + this.stratifier.add(t); + return this; + } + + /** + * @return {@link #supplementalData} (Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations.) + */ + public List getSupplementalData() { + if (this.supplementalData == null) + this.supplementalData = new ArrayList(); + return this.supplementalData; + } + + public boolean hasSupplementalData() { + if (this.supplementalData == null) + return false; + for (MeasureReportGroupSupplementalDataComponent item : this.supplementalData) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supplementalData} (Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations.) + */ + // syntactic sugar + public MeasureReportGroupSupplementalDataComponent addSupplementalData() { //3 + MeasureReportGroupSupplementalDataComponent t = new MeasureReportGroupSupplementalDataComponent(); + if (this.supplementalData == null) + this.supplementalData = new ArrayList(); + this.supplementalData.add(t); + return t; + } + + // syntactic sugar + public MeasureReportGroupComponent addSupplementalData(MeasureReportGroupSupplementalDataComponent t) { //3 + if (t == null) + return this; + if (this.supplementalData == null) + this.supplementalData = new ArrayList(); + this.supplementalData.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The identifier of the population group as defined in the measure definition.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("population", "", "The populations that make up the population group, one for each type of population appropriate for the measure.", 0, java.lang.Integer.MAX_VALUE, population)); + childrenList.add(new Property("measureScore", "decimal", "The measure score.", 0, java.lang.Integer.MAX_VALUE, measureScore)); + childrenList.add(new Property("stratifier", "", "When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.", 0, java.lang.Integer.MAX_VALUE, stratifier)); + childrenList.add(new Property("supplementalData", "", "Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations.", 0, java.lang.Integer.MAX_VALUE, supplementalData)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MeasureReportGroupPopulationComponent + case -386313260: /*measureScore*/ return this.measureScore == null ? new Base[0] : new Base[] {this.measureScore}; // DecimalType + case 90983669: /*stratifier*/ return this.stratifier == null ? new Base[0] : this.stratifier.toArray(new Base[this.stratifier.size()]); // MeasureReportGroupStratifierComponent + case 1447496814: /*supplementalData*/ return this.supplementalData == null ? new Base[0] : this.supplementalData.toArray(new Base[this.supplementalData.size()]); // MeasureReportGroupSupplementalDataComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -2023558323: // population + this.getPopulation().add((MeasureReportGroupPopulationComponent) value); // MeasureReportGroupPopulationComponent + break; + case -386313260: // measureScore + this.measureScore = castToDecimal(value); // DecimalType + break; + case 90983669: // stratifier + this.getStratifier().add((MeasureReportGroupStratifierComponent) value); // MeasureReportGroupStratifierComponent + break; + case 1447496814: // supplementalData + this.getSupplementalData().add((MeasureReportGroupSupplementalDataComponent) value); // MeasureReportGroupSupplementalDataComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("population")) + this.getPopulation().add((MeasureReportGroupPopulationComponent) value); + else if (name.equals("measureScore")) + this.measureScore = castToDecimal(value); // DecimalType + else if (name.equals("stratifier")) + this.getStratifier().add((MeasureReportGroupStratifierComponent) value); + else if (name.equals("supplementalData")) + this.getSupplementalData().add((MeasureReportGroupSupplementalDataComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -2023558323: return addPopulation(); // MeasureReportGroupPopulationComponent + case -386313260: throw new FHIRException("Cannot make property measureScore as it is not a complex type"); // DecimalType + case 90983669: return addStratifier(); // MeasureReportGroupStratifierComponent + case 1447496814: return addSupplementalData(); // MeasureReportGroupSupplementalDataComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("population")) { + return addPopulation(); + } + else if (name.equals("measureScore")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.measureScore"); + } + else if (name.equals("stratifier")) { + return addStratifier(); + } + else if (name.equals("supplementalData")) { + return addSupplementalData(); + } + else + return super.addChild(name); + } + + public MeasureReportGroupComponent copy() { + MeasureReportGroupComponent dst = new MeasureReportGroupComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + if (population != null) { + dst.population = new ArrayList(); + for (MeasureReportGroupPopulationComponent i : population) + dst.population.add(i.copy()); + }; + dst.measureScore = measureScore == null ? null : measureScore.copy(); + if (stratifier != null) { + dst.stratifier = new ArrayList(); + for (MeasureReportGroupStratifierComponent i : stratifier) + dst.stratifier.add(i.copy()); + }; + if (supplementalData != null) { + dst.supplementalData = new ArrayList(); + for (MeasureReportGroupSupplementalDataComponent i : supplementalData) + dst.supplementalData.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureReportGroupComponent)) + return false; + MeasureReportGroupComponent o = (MeasureReportGroupComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(population, o.population, true) + && compareDeep(measureScore, o.measureScore, true) && compareDeep(stratifier, o.stratifier, true) + && compareDeep(supplementalData, o.supplementalData, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureReportGroupComponent)) + return false; + MeasureReportGroupComponent o = (MeasureReportGroupComponent) other; + return compareValues(measureScore, o.measureScore, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (population == null || population.isEmpty()) + && (measureScore == null || measureScore.isEmpty()) && (stratifier == null || stratifier.isEmpty()) + && (supplementalData == null || supplementalData.isEmpty()); + } + + public String fhirType() { + return "MeasureReport.group"; + + } + + } + + @Block() + public static class MeasureReportGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of the population. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score", formalDefinition="The type of the population." ) + protected CodeType type; + + /** + * The number of members of the population. + */ + @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population." ) + protected IntegerType count; + + /** + * This element refers to a List of patient level MeasureReport resources, one for each patient in this population. + */ + @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population." ) + protected Reference patients; + + /** + * The actual object that is the target of the reference (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + protected ListResource patientsTarget; + + private static final long serialVersionUID = 407500224L; + + /** + * Constructor + */ + public MeasureReportGroupPopulationComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureReportGroupPopulationComponent(CodeType type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The type of the population.). 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 MeasureReportGroupPopulationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 of the population.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public MeasureReportGroupPopulationComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of the population. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the population. + */ + public MeasureReportGroupPopulationComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #count} (The number of members of the population.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public IntegerType getCountElement() { + if (this.count == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.count"); + else if (Configuration.doAutoCreate()) + this.count = new IntegerType(); // bb + return this.count; + } + + public boolean hasCountElement() { + return this.count != null && !this.count.isEmpty(); + } + + public boolean hasCount() { + return this.count != null && !this.count.isEmpty(); + } + + /** + * @param value {@link #count} (The number of members of the population.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public MeasureReportGroupPopulationComponent setCountElement(IntegerType value) { + this.count = value; + return this; + } + + /** + * @return The number of members of the population. + */ + public int getCount() { + return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); + } + + /** + * @param value The number of members of the population. + */ + public MeasureReportGroupPopulationComponent setCount(int value) { + if (this.count == null) + this.count = new IntegerType(); + this.count.setValue(value); + return this; + } + + /** + * @return {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + public Reference getPatients() { + if (this.patients == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.patients"); + else if (Configuration.doAutoCreate()) + this.patients = new Reference(); // cc + return this.patients; + } + + public boolean hasPatients() { + return this.patients != null && !this.patients.isEmpty(); + } + + /** + * @param value {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + public MeasureReportGroupPopulationComponent setPatients(Reference value) { + this.patients = value; + return this; + } + + /** + * @return {@link #patients} 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. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + public ListResource getPatientsTarget() { + if (this.patientsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.patients"); + else if (Configuration.doAutoCreate()) + this.patientsTarget = new ListResource(); // aa + return this.patientsTarget; + } + + /** + * @param value {@link #patients} 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. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + public MeasureReportGroupPopulationComponent setPatientsTarget(ListResource value) { + this.patientsTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of the population.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("count", "integer", "The number of members of the population.", 0, java.lang.Integer.MAX_VALUE, count)); + childrenList.add(new Property("patients", "Reference(List)", "This element refers to a List of patient level MeasureReport resources, one for each patient in this population.", 0, java.lang.Integer.MAX_VALUE, patients)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType + case 1235842574: /*patients*/ return this.patients == null ? new Base[0] : new Base[] {this.patients}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case 94851343: // count + this.count = castToInteger(value); // IntegerType + break; + case 1235842574: // patients + this.patients = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("count")) + this.count = castToInteger(value); // IntegerType + else if (name.equals("patients")) + this.patients = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType + case 1235842574: return getPatients(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.type"); + } + else if (name.equals("count")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.count"); + } + else if (name.equals("patients")) { + this.patients = new Reference(); + return this.patients; + } + else + return super.addChild(name); + } + + public MeasureReportGroupPopulationComponent copy() { + MeasureReportGroupPopulationComponent dst = new MeasureReportGroupPopulationComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.count = count == null ? null : count.copy(); + dst.patients = patients == null ? null : patients.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureReportGroupPopulationComponent)) + return false; + MeasureReportGroupPopulationComponent o = (MeasureReportGroupPopulationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(count, o.count, true) && compareDeep(patients, o.patients, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureReportGroupPopulationComponent)) + return false; + MeasureReportGroupPopulationComponent o = (MeasureReportGroupPopulationComponent) other; + return compareValues(type, o.type, true) && compareValues(count, o.count, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (count == null || count.isEmpty()) + && (patients == null || patients.isEmpty()); + } + + public String fhirType() { + return "MeasureReport.group.population"; + + } + + } + + @Block() + public static class MeasureReportGroupStratifierComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The identifier of this stratifier, as defined in the measure definition. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier of the stratifier", formalDefinition="The identifier of this stratifier, as defined in the measure definition." ) + protected Identifier identifier; + + /** + * This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value. + */ + @Child(name = "group", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Stratum results, one for each unique value in the stratifier", formalDefinition="This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value." ) + protected List group; + + private static final long serialVersionUID = -229867715L; + + /** + * Constructor + */ + public MeasureReportGroupStratifierComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureReportGroupStratifierComponent(Identifier identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #identifier} (The identifier of this stratifier, as defined in the measure definition.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupStratifierComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier of this stratifier, as defined in the measure definition.) + */ + public MeasureReportGroupStratifierComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #group} (This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (MeasureReportGroupStratifierGroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.) + */ + // syntactic sugar + public MeasureReportGroupStratifierGroupComponent addGroup() { //3 + MeasureReportGroupStratifierGroupComponent t = new MeasureReportGroupStratifierGroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public MeasureReportGroupStratifierComponent addGroup(MeasureReportGroupStratifierGroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The identifier of this stratifier, as defined in the measure definition.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("group", "", "This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureReportGroupStratifierGroupComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 98629247: // group + this.getGroup().add((MeasureReportGroupStratifierGroupComponent) value); // MeasureReportGroupStratifierGroupComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("group")) + this.getGroup().add((MeasureReportGroupStratifierGroupComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 98629247: return addGroup(); // MeasureReportGroupStratifierGroupComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("group")) { + return addGroup(); + } + else + return super.addChild(name); + } + + public MeasureReportGroupStratifierComponent copy() { + MeasureReportGroupStratifierComponent dst = new MeasureReportGroupStratifierComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (MeasureReportGroupStratifierGroupComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureReportGroupStratifierComponent)) + return false; + MeasureReportGroupStratifierComponent o = (MeasureReportGroupStratifierComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(group, o.group, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureReportGroupStratifierComponent)) + return false; + MeasureReportGroupStratifierComponent o = (MeasureReportGroupStratifierComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) + ; + } + + public String fhirType() { + return "MeasureReport.group.stratifier"; + + } + + } + + @Block() + public static class MeasureReportGroupStratifierGroupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. + */ + @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The stratum value, e.g. male", formalDefinition="The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique." ) + protected StringType value; + + /** + * The populations that make up the stratum, one for each type of population appropriate to the measure. + */ + @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Population results in this stratum", formalDefinition="The populations that make up the stratum, one for each type of population appropriate to the measure." ) + protected List population; + + /** + * The measure score for this stratum. + */ + @Child(name = "measureScore", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The measure score", formalDefinition="The measure score for this stratum." ) + protected DecimalType measureScore; + + private static final long serialVersionUID = -1663404087L; + + /** + * Constructor + */ + public MeasureReportGroupStratifierGroupComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureReportGroupStratifierGroupComponent(StringType value) { + super(); + this.value = value; + } + + /** + * @return {@link #value} (The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public MeasureReportGroupStratifierGroupComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. + */ + public MeasureReportGroupStratifierGroupComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + /** + * @return {@link #population} (The populations that make up the stratum, one for each type of population appropriate to the measure.) + */ + public List getPopulation() { + if (this.population == null) + this.population = new ArrayList(); + return this.population; + } + + public boolean hasPopulation() { + if (this.population == null) + return false; + for (MeasureReportGroupStratifierGroupPopulationComponent item : this.population) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #population} (The populations that make up the stratum, one for each type of population appropriate to the measure.) + */ + // syntactic sugar + public MeasureReportGroupStratifierGroupPopulationComponent addPopulation() { //3 + MeasureReportGroupStratifierGroupPopulationComponent t = new MeasureReportGroupStratifierGroupPopulationComponent(); + if (this.population == null) + this.population = new ArrayList(); + this.population.add(t); + return t; + } + + // syntactic sugar + public MeasureReportGroupStratifierGroupComponent addPopulation(MeasureReportGroupStratifierGroupPopulationComponent t) { //3 + if (t == null) + return this; + if (this.population == null) + this.population = new ArrayList(); + this.population.add(t); + return this; + } + + /** + * @return {@link #measureScore} (The measure score for this stratum.). This is the underlying object with id, value and extensions. The accessor "getMeasureScore" gives direct access to the value + */ + public DecimalType getMeasureScoreElement() { + if (this.measureScore == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupComponent.measureScore"); + else if (Configuration.doAutoCreate()) + this.measureScore = new DecimalType(); // bb + return this.measureScore; + } + + public boolean hasMeasureScoreElement() { + return this.measureScore != null && !this.measureScore.isEmpty(); + } + + public boolean hasMeasureScore() { + return this.measureScore != null && !this.measureScore.isEmpty(); + } + + /** + * @param value {@link #measureScore} (The measure score for this stratum.). This is the underlying object with id, value and extensions. The accessor "getMeasureScore" gives direct access to the value + */ + public MeasureReportGroupStratifierGroupComponent setMeasureScoreElement(DecimalType value) { + this.measureScore = value; + return this; + } + + /** + * @return The measure score for this stratum. + */ + public BigDecimal getMeasureScore() { + return this.measureScore == null ? null : this.measureScore.getValue(); + } + + /** + * @param value The measure score for this stratum. + */ + public MeasureReportGroupStratifierGroupComponent setMeasureScore(BigDecimal value) { + if (value == null) + this.measureScore = null; + else { + if (this.measureScore == null) + this.measureScore = new DecimalType(); + this.measureScore.setValue(value); + } + return this; + } + + /** + * @param value The measure score for this stratum. + */ + public MeasureReportGroupStratifierGroupComponent setMeasureScore(long value) { + this.measureScore = new DecimalType(); + this.measureScore.setValue(value); + return this; + } + + /** + * @param value The measure score for this stratum. + */ + public MeasureReportGroupStratifierGroupComponent setMeasureScore(double value) { + this.measureScore = new DecimalType(); + this.measureScore.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value", "string", "The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("population", "", "The populations that make up the stratum, one for each type of population appropriate to the measure.", 0, java.lang.Integer.MAX_VALUE, population)); + childrenList.add(new Property("measureScore", "decimal", "The measure score for this stratum.", 0, java.lang.Integer.MAX_VALUE, measureScore)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MeasureReportGroupStratifierGroupPopulationComponent + case -386313260: /*measureScore*/ return this.measureScore == null ? new Base[0] : new Base[] {this.measureScore}; // DecimalType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 111972721: // value + this.value = castToString(value); // StringType + break; + case -2023558323: // population + this.getPopulation().add((MeasureReportGroupStratifierGroupPopulationComponent) value); // MeasureReportGroupStratifierGroupPopulationComponent + break; + case -386313260: // measureScore + this.measureScore = castToDecimal(value); // DecimalType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("value")) + this.value = castToString(value); // StringType + else if (name.equals("population")) + this.getPopulation().add((MeasureReportGroupStratifierGroupPopulationComponent) value); + else if (name.equals("measureScore")) + this.measureScore = castToDecimal(value); // DecimalType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + case -2023558323: return addPopulation(); // MeasureReportGroupStratifierGroupPopulationComponent + case -386313260: throw new FHIRException("Cannot make property measureScore as it is not a complex type"); // DecimalType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.value"); + } + else if (name.equals("population")) { + return addPopulation(); + } + else if (name.equals("measureScore")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.measureScore"); + } + else + return super.addChild(name); + } + + public MeasureReportGroupStratifierGroupComponent copy() { + MeasureReportGroupStratifierGroupComponent dst = new MeasureReportGroupStratifierGroupComponent(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + if (population != null) { + dst.population = new ArrayList(); + for (MeasureReportGroupStratifierGroupPopulationComponent i : population) + dst.population.add(i.copy()); + }; + dst.measureScore = measureScore == null ? null : measureScore.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureReportGroupStratifierGroupComponent)) + return false; + MeasureReportGroupStratifierGroupComponent o = (MeasureReportGroupStratifierGroupComponent) other; + return compareDeep(value, o.value, true) && compareDeep(population, o.population, true) && compareDeep(measureScore, o.measureScore, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureReportGroupStratifierGroupComponent)) + return false; + MeasureReportGroupStratifierGroupComponent o = (MeasureReportGroupStratifierGroupComponent) other; + return compareValues(value, o.value, true) && compareValues(measureScore, o.measureScore, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (population == null || population.isEmpty()) + && (measureScore == null || measureScore.isEmpty()); + } + + public String fhirType() { + return "MeasureReport.group.stratifier.group"; + + } + + } + + @Block() + public static class MeasureReportGroupStratifierGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of the population. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score", formalDefinition="The type of the population." ) + protected CodeType type; + + /** + * The number of members of the population in this stratum. + */ + @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population in this stratum." ) + protected IntegerType count; + + /** + * This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum. + */ + @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum." ) + protected Reference patients; + + /** + * The actual object that is the target of the reference (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) + */ + protected ListResource patientsTarget; + + private static final long serialVersionUID = 407500224L; + + /** + * Constructor + */ + public MeasureReportGroupStratifierGroupPopulationComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureReportGroupStratifierGroupPopulationComponent(CodeType type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The type of the population.). 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 MeasureReportGroupStratifierGroupPopulationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 of the population.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public MeasureReportGroupStratifierGroupPopulationComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of the population. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the population. + */ + public MeasureReportGroupStratifierGroupPopulationComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #count} (The number of members of the population in this stratum.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public IntegerType getCountElement() { + if (this.count == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupPopulationComponent.count"); + else if (Configuration.doAutoCreate()) + this.count = new IntegerType(); // bb + return this.count; + } + + public boolean hasCountElement() { + return this.count != null && !this.count.isEmpty(); + } + + public boolean hasCount() { + return this.count != null && !this.count.isEmpty(); + } + + /** + * @param value {@link #count} (The number of members of the population in this stratum.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public MeasureReportGroupStratifierGroupPopulationComponent setCountElement(IntegerType value) { + this.count = value; + return this; + } + + /** + * @return The number of members of the population in this stratum. + */ + public int getCount() { + return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); + } + + /** + * @param value The number of members of the population in this stratum. + */ + public MeasureReportGroupStratifierGroupPopulationComponent setCount(int value) { + if (this.count == null) + this.count = new IntegerType(); + this.count.setValue(value); + return this; + } + + /** + * @return {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) + */ + public Reference getPatients() { + if (this.patients == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupPopulationComponent.patients"); + else if (Configuration.doAutoCreate()) + this.patients = new Reference(); // cc + return this.patients; + } + + public boolean hasPatients() { + return this.patients != null && !this.patients.isEmpty(); + } + + /** + * @param value {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) + */ + public MeasureReportGroupStratifierGroupPopulationComponent setPatients(Reference value) { + this.patients = value; + return this; + } + + /** + * @return {@link #patients} 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. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) + */ + public ListResource getPatientsTarget() { + if (this.patientsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupPopulationComponent.patients"); + else if (Configuration.doAutoCreate()) + this.patientsTarget = new ListResource(); // aa + return this.patientsTarget; + } + + /** + * @param value {@link #patients} 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. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) + */ + public MeasureReportGroupStratifierGroupPopulationComponent setPatientsTarget(ListResource value) { + this.patientsTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of the population.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("count", "integer", "The number of members of the population in this stratum.", 0, java.lang.Integer.MAX_VALUE, count)); + childrenList.add(new Property("patients", "Reference(List)", "This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.", 0, java.lang.Integer.MAX_VALUE, patients)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType + case 1235842574: /*patients*/ return this.patients == null ? new Base[0] : new Base[] {this.patients}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case 94851343: // count + this.count = castToInteger(value); // IntegerType + break; + case 1235842574: // patients + this.patients = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("count")) + this.count = castToInteger(value); // IntegerType + else if (name.equals("patients")) + this.patients = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType + case 1235842574: return getPatients(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.type"); + } + else if (name.equals("count")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.count"); + } + else if (name.equals("patients")) { + this.patients = new Reference(); + return this.patients; + } + else + return super.addChild(name); + } + + public MeasureReportGroupStratifierGroupPopulationComponent copy() { + MeasureReportGroupStratifierGroupPopulationComponent dst = new MeasureReportGroupStratifierGroupPopulationComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.count = count == null ? null : count.copy(); + dst.patients = patients == null ? null : patients.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureReportGroupStratifierGroupPopulationComponent)) + return false; + MeasureReportGroupStratifierGroupPopulationComponent o = (MeasureReportGroupStratifierGroupPopulationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(count, o.count, true) && compareDeep(patients, o.patients, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureReportGroupStratifierGroupPopulationComponent)) + return false; + MeasureReportGroupStratifierGroupPopulationComponent o = (MeasureReportGroupStratifierGroupPopulationComponent) other; + return compareValues(type, o.type, true) && compareValues(count, o.count, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (count == null || count.isEmpty()) + && (patients == null || patients.isEmpty()); + } + + public String fhirType() { + return "MeasureReport.group.stratifier.group.population"; + + } + + } + + @Block() + public static class MeasureReportGroupSupplementalDataComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The identifier of the supplemental data element as defined in the measure. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier of the supplemental data element", formalDefinition="The identifier of the supplemental data element as defined in the measure." ) + protected Identifier identifier; + + /** + * This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value. + */ + @Child(name = "group", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Supplemental data results, one for each unique supplemental data value", formalDefinition="This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value." ) + protected List group; + + private static final long serialVersionUID = -1254392714L; + + /** + * Constructor + */ + public MeasureReportGroupSupplementalDataComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureReportGroupSupplementalDataComponent(Identifier identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #identifier} (The identifier of the supplemental data element as defined in the measure.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier of the supplemental data element as defined in the measure.) + */ + public MeasureReportGroupSupplementalDataComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #group} (This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (MeasureReportGroupSupplementalDataGroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value.) + */ + // syntactic sugar + public MeasureReportGroupSupplementalDataGroupComponent addGroup() { //3 + MeasureReportGroupSupplementalDataGroupComponent t = new MeasureReportGroupSupplementalDataGroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public MeasureReportGroupSupplementalDataComponent addGroup(MeasureReportGroupSupplementalDataGroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The identifier of the supplemental data element as defined in the measure.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("group", "", "This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureReportGroupSupplementalDataGroupComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 98629247: // group + this.getGroup().add((MeasureReportGroupSupplementalDataGroupComponent) value); // MeasureReportGroupSupplementalDataGroupComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("group")) + this.getGroup().add((MeasureReportGroupSupplementalDataGroupComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 98629247: return addGroup(); // MeasureReportGroupSupplementalDataGroupComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("group")) { + return addGroup(); + } + else + return super.addChild(name); + } + + public MeasureReportGroupSupplementalDataComponent copy() { + MeasureReportGroupSupplementalDataComponent dst = new MeasureReportGroupSupplementalDataComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (MeasureReportGroupSupplementalDataGroupComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureReportGroupSupplementalDataComponent)) + return false; + MeasureReportGroupSupplementalDataComponent o = (MeasureReportGroupSupplementalDataComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(group, o.group, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureReportGroupSupplementalDataComponent)) + return false; + MeasureReportGroupSupplementalDataComponent o = (MeasureReportGroupSupplementalDataComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) + ; + } + + public String fhirType() { + return "MeasureReport.group.supplementalData"; + + } + + } + + @Block() + public static class MeasureReportGroupSupplementalDataGroupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique. + */ + @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The data value, e.g. male", formalDefinition="The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique." ) + protected StringType value; + + /** + * The number of members in the supplemental data group. + */ + @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of members in the group", formalDefinition="The number of members in the supplemental data group." ) + protected IntegerType count; + + /** + * This element refers to a List of patient level MeasureReport resources, one for each patient in this population. + */ + @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population." ) + protected Reference patients; + + /** + * The actual object that is the target of the reference (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + protected ListResource patientsTarget; + + private static final long serialVersionUID = 1011446829L; + + /** + * Constructor + */ + public MeasureReportGroupSupplementalDataGroupComponent() { + super(); + } + + /** + * Constructor + */ + public MeasureReportGroupSupplementalDataGroupComponent(StringType value) { + super(); + this.value = value; + } + + /** + * @return {@link #value} (The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataGroupComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public MeasureReportGroupSupplementalDataGroupComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique. + */ + public MeasureReportGroupSupplementalDataGroupComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + /** + * @return {@link #count} (The number of members in the supplemental data group.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public IntegerType getCountElement() { + if (this.count == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataGroupComponent.count"); + else if (Configuration.doAutoCreate()) + this.count = new IntegerType(); // bb + return this.count; + } + + public boolean hasCountElement() { + return this.count != null && !this.count.isEmpty(); + } + + public boolean hasCount() { + return this.count != null && !this.count.isEmpty(); + } + + /** + * @param value {@link #count} (The number of members in the supplemental data group.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public MeasureReportGroupSupplementalDataGroupComponent setCountElement(IntegerType value) { + this.count = value; + return this; + } + + /** + * @return The number of members in the supplemental data group. + */ + public int getCount() { + return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); + } + + /** + * @param value The number of members in the supplemental data group. + */ + public MeasureReportGroupSupplementalDataGroupComponent setCount(int value) { + if (this.count == null) + this.count = new IntegerType(); + this.count.setValue(value); + return this; + } + + /** + * @return {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + public Reference getPatients() { + if (this.patients == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataGroupComponent.patients"); + else if (Configuration.doAutoCreate()) + this.patients = new Reference(); // cc + return this.patients; + } + + public boolean hasPatients() { + return this.patients != null && !this.patients.isEmpty(); + } + + /** + * @param value {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + public MeasureReportGroupSupplementalDataGroupComponent setPatients(Reference value) { + this.patients = value; + return this; + } + + /** + * @return {@link #patients} 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. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + public ListResource getPatientsTarget() { + if (this.patientsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataGroupComponent.patients"); + else if (Configuration.doAutoCreate()) + this.patientsTarget = new ListResource(); // aa + return this.patientsTarget; + } + + /** + * @param value {@link #patients} 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. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) + */ + public MeasureReportGroupSupplementalDataGroupComponent setPatientsTarget(ListResource value) { + this.patientsTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value", "string", "The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("count", "integer", "The number of members in the supplemental data group.", 0, java.lang.Integer.MAX_VALUE, count)); + childrenList.add(new Property("patients", "Reference(List)", "This element refers to a List of patient level MeasureReport resources, one for each patient in this population.", 0, java.lang.Integer.MAX_VALUE, patients)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType + case 1235842574: /*patients*/ return this.patients == null ? new Base[0] : new Base[] {this.patients}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 111972721: // value + this.value = castToString(value); // StringType + break; + case 94851343: // count + this.count = castToInteger(value); // IntegerType + break; + case 1235842574: // patients + this.patients = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("value")) + this.value = castToString(value); // StringType + else if (name.equals("count")) + this.count = castToInteger(value); // IntegerType + else if (name.equals("patients")) + this.patients = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType + case 1235842574: return getPatients(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.value"); + } + else if (name.equals("count")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.count"); + } + else if (name.equals("patients")) { + this.patients = new Reference(); + return this.patients; + } + else + return super.addChild(name); + } + + public MeasureReportGroupSupplementalDataGroupComponent copy() { + MeasureReportGroupSupplementalDataGroupComponent dst = new MeasureReportGroupSupplementalDataGroupComponent(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.count = count == null ? null : count.copy(); + dst.patients = patients == null ? null : patients.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureReportGroupSupplementalDataGroupComponent)) + return false; + MeasureReportGroupSupplementalDataGroupComponent o = (MeasureReportGroupSupplementalDataGroupComponent) other; + return compareDeep(value, o.value, true) && compareDeep(count, o.count, true) && compareDeep(patients, o.patients, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureReportGroupSupplementalDataGroupComponent)) + return false; + MeasureReportGroupSupplementalDataGroupComponent o = (MeasureReportGroupSupplementalDataGroupComponent) other; + return compareValues(value, o.value, true) && compareValues(count, o.count, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (count == null || count.isEmpty()) + && (patients == null || patients.isEmpty()); + } + + public String fhirType() { + return "MeasureReport.group.supplementalData.group"; + + } + + } + + /** + * A reference to the Measure that was evaluated to produce this report. + */ + @Child(name = "measure", type = {Measure.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Measure that was evaluated", formalDefinition="A reference to the Measure that was evaluated to produce this report." ) + protected Reference measure; + + /** + * The actual object that is the target of the reference (A reference to the Measure that was evaluated to produce this report.) + */ + protected Measure measureTarget; + + /** + * The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="individual | patient-list | summary", formalDefinition="The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure." ) + protected Enumeration type; + + /** + * Optional Patient if the report was requested for a single patient. + */ + @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Optional Patient", formalDefinition="Optional Patient if the report was requested for a single patient." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Optional Patient if the report was requested for a single patient.) + */ + protected Patient patientTarget; + + /** + * The reporting period for which the report was calculated. + */ + @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reporting period", formalDefinition="The reporting period for which the report was calculated." ) + protected Period period; + + /** + * The report status. No data will be available until the report status is complete. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="complete | pending | error", formalDefinition="The report status. No data will be available until the report status is complete." ) + protected Enumeration status; + + /** + * The date this measure report was generated. + */ + @Child(name = "date", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date the report was generated", formalDefinition="The date this measure report was generated." ) + protected DateTimeType date; + + /** + * Reporting Organization. + */ + @Child(name = "reportingOrganization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reporting Organization", formalDefinition="Reporting Organization." ) + protected Reference reportingOrganization; + + /** + * The actual object that is the target of the reference (Reporting Organization.) + */ + protected Organization reportingOrganizationTarget; + + /** + * The results of the calculation, one for each population group in the measure. + */ + @Child(name = "group", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Measure results for each group", formalDefinition="The results of the calculation, one for each population group in the measure." ) + protected List group; + + /** + * A reference to a Bundle containing the Resources that were used in the evaluation of this report. + */ + @Child(name = "evaluatedResources", type = {Bundle.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Evaluated Resources", formalDefinition="A reference to a Bundle containing the Resources that were used in the evaluation of this report." ) + protected Reference evaluatedResources; + + /** + * The actual object that is the target of the reference (A reference to a Bundle containing the Resources that were used in the evaluation of this report.) + */ + protected Bundle evaluatedResourcesTarget; + + private static final long serialVersionUID = -891268298L; + + /** + * Constructor + */ + public MeasureReport() { + super(); + } + + /** + * Constructor + */ + public MeasureReport(Reference measure, Enumeration type, Period period, Enumeration status) { + super(); + this.measure = measure; + this.type = type; + this.period = period; + this.status = status; + } + + /** + * @return {@link #measure} (A reference to the Measure that was evaluated to produce this report.) + */ + public Reference getMeasure() { + if (this.measure == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.measure"); + else if (Configuration.doAutoCreate()) + this.measure = new Reference(); // cc + return this.measure; + } + + public boolean hasMeasure() { + return this.measure != null && !this.measure.isEmpty(); + } + + /** + * @param value {@link #measure} (A reference to the Measure that was evaluated to produce this report.) + */ + public MeasureReport setMeasure(Reference value) { + this.measure = value; + return this; + } + + /** + * @return {@link #measure} 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 Measure that was evaluated to produce this report.) + */ + public Measure getMeasureTarget() { + if (this.measureTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.measure"); + else if (Configuration.doAutoCreate()) + this.measureTarget = new Measure(); // aa + return this.measureTarget; + } + + /** + * @param value {@link #measure} 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 Measure that was evaluated to produce this report.) + */ + public MeasureReport setMeasureTarget(Measure value) { + this.measureTarget = value; + return this; + } + + /** + * @return {@link #type} (The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure.). 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 MeasureReport.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new MeasureReportTypeEnumFactory()); // bb + 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 of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public MeasureReport setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure. + */ + public MeasureReportType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure. + */ + public MeasureReport setType(MeasureReportType value) { + if (this.type == null) + this.type = new Enumeration(new MeasureReportTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #patient} (Optional Patient if the report was requested for a single patient.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Optional Patient if the report was requested for a single patient.) + */ + public MeasureReport 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. (Optional Patient if the report was requested for a single patient.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (Optional Patient if the report was requested for a single patient.) + */ + public MeasureReport setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #period} (The reporting period for which the report was calculated.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The reporting period for which the report was calculated.) + */ + public MeasureReport setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #status} (The report status. No data will be available until the report status is complete.). 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 MeasureReport.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MeasureReportStatusEnumFactory()); // bb + 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 report status. No data will be available until the report status is complete.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MeasureReport setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The report status. No data will be available until the report status is complete. + */ + public MeasureReportStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The report status. No data will be available until the report status is complete. + */ + public MeasureReport setStatus(MeasureReportStatus value) { + if (this.status == null) + this.status = new Enumeration(new MeasureReportStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date this measure report was generated.). 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 MeasureReport.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date this measure report was generated.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public MeasureReport setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date this measure report was generated. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date this measure report was generated. + */ + public MeasureReport setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #reportingOrganization} (Reporting Organization.) + */ + public Reference getReportingOrganization() { + if (this.reportingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.reportingOrganization"); + else if (Configuration.doAutoCreate()) + this.reportingOrganization = new Reference(); // cc + return this.reportingOrganization; + } + + public boolean hasReportingOrganization() { + return this.reportingOrganization != null && !this.reportingOrganization.isEmpty(); + } + + /** + * @param value {@link #reportingOrganization} (Reporting Organization.) + */ + public MeasureReport setReportingOrganization(Reference value) { + this.reportingOrganization = value; + return this; + } + + /** + * @return {@link #reportingOrganization} 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. (Reporting Organization.) + */ + public Organization getReportingOrganizationTarget() { + if (this.reportingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.reportingOrganization"); + else if (Configuration.doAutoCreate()) + this.reportingOrganizationTarget = new Organization(); // aa + return this.reportingOrganizationTarget; + } + + /** + * @param value {@link #reportingOrganization} 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. (Reporting Organization.) + */ + public MeasureReport setReportingOrganizationTarget(Organization value) { + this.reportingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #group} (The results of the calculation, one for each population group in the measure.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (MeasureReportGroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (The results of the calculation, one for each population group in the measure.) + */ + // syntactic sugar + public MeasureReportGroupComponent addGroup() { //3 + MeasureReportGroupComponent t = new MeasureReportGroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public MeasureReport addGroup(MeasureReportGroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + /** + * @return {@link #evaluatedResources} (A reference to a Bundle containing the Resources that were used in the evaluation of this report.) + */ + public Reference getEvaluatedResources() { + if (this.evaluatedResources == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.evaluatedResources"); + else if (Configuration.doAutoCreate()) + this.evaluatedResources = new Reference(); // cc + return this.evaluatedResources; + } + + public boolean hasEvaluatedResources() { + return this.evaluatedResources != null && !this.evaluatedResources.isEmpty(); + } + + /** + * @param value {@link #evaluatedResources} (A reference to a Bundle containing the Resources that were used in the evaluation of this report.) + */ + public MeasureReport setEvaluatedResources(Reference value) { + this.evaluatedResources = value; + return this; + } + + /** + * @return {@link #evaluatedResources} 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 Bundle containing the Resources that were used in the evaluation of this report.) + */ + public Bundle getEvaluatedResourcesTarget() { + if (this.evaluatedResourcesTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MeasureReport.evaluatedResources"); + else if (Configuration.doAutoCreate()) + this.evaluatedResourcesTarget = new Bundle(); // aa + return this.evaluatedResourcesTarget; + } + + /** + * @param value {@link #evaluatedResources} 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 Bundle containing the Resources that were used in the evaluation of this report.) + */ + public MeasureReport setEvaluatedResourcesTarget(Bundle value) { + this.evaluatedResourcesTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("measure", "Reference(Measure)", "A reference to the Measure that was evaluated to produce this report.", 0, java.lang.Integer.MAX_VALUE, measure)); + childrenList.add(new Property("type", "code", "The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("patient", "Reference(Patient)", "Optional Patient if the report was requested for a single patient.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("period", "Period", "The reporting period for which the report was calculated.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("status", "code", "The report status. No data will be available until the report status is complete.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("date", "dateTime", "The date this measure report was generated.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("reportingOrganization", "Reference(Organization)", "Reporting Organization.", 0, java.lang.Integer.MAX_VALUE, reportingOrganization)); + childrenList.add(new Property("group", "", "The results of the calculation, one for each population group in the measure.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("evaluatedResources", "Reference(Bundle)", "A reference to a Bundle containing the Resources that were used in the evaluation of this report.", 0, java.lang.Integer.MAX_VALUE, evaluatedResources)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 938321246: /*measure*/ return this.measure == null ? new Base[0] : new Base[] {this.measure}; // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -2053950847: /*reportingOrganization*/ return this.reportingOrganization == null ? new Base[0] : new Base[] {this.reportingOrganization}; // Reference + case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureReportGroupComponent + case 1599836026: /*evaluatedResources*/ return this.evaluatedResources == null ? new Base[0] : new Base[] {this.evaluatedResources}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 938321246: // measure + this.measure = castToReference(value); // Reference + break; + case 3575610: // type + this.type = new MeasureReportTypeEnumFactory().fromType(value); // Enumeration + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -892481550: // status + this.status = new MeasureReportStatusEnumFactory().fromType(value); // Enumeration + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -2053950847: // reportingOrganization + this.reportingOrganization = castToReference(value); // Reference + break; + case 98629247: // group + this.getGroup().add((MeasureReportGroupComponent) value); // MeasureReportGroupComponent + break; + case 1599836026: // evaluatedResources + this.evaluatedResources = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("measure")) + this.measure = castToReference(value); // Reference + else if (name.equals("type")) + this.type = new MeasureReportTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("status")) + this.status = new MeasureReportStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("reportingOrganization")) + this.reportingOrganization = castToReference(value); // Reference + else if (name.equals("group")) + this.getGroup().add((MeasureReportGroupComponent) value); + else if (name.equals("evaluatedResources")) + this.evaluatedResources = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 938321246: return getMeasure(); // Reference + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -791418107: return getPatient(); // Reference + case -991726143: return getPeriod(); // Period + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -2053950847: return getReportingOrganization(); // Reference + case 98629247: return addGroup(); // MeasureReportGroupComponent + case 1599836026: return getEvaluatedResources(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("measure")) { + this.measure = new Reference(); + return this.measure; + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.type"); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.status"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.date"); + } + else if (name.equals("reportingOrganization")) { + this.reportingOrganization = new Reference(); + return this.reportingOrganization; + } + else if (name.equals("group")) { + return addGroup(); + } + else if (name.equals("evaluatedResources")) { + this.evaluatedResources = new Reference(); + return this.evaluatedResources; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "MeasureReport"; + + } + + public MeasureReport copy() { + MeasureReport dst = new MeasureReport(); + copyValues(dst); + dst.measure = measure == null ? null : measure.copy(); + dst.type = type == null ? null : type.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.period = period == null ? null : period.copy(); + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.reportingOrganization = reportingOrganization == null ? null : reportingOrganization.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (MeasureReportGroupComponent i : group) + dst.group.add(i.copy()); + }; + dst.evaluatedResources = evaluatedResources == null ? null : evaluatedResources.copy(); + return dst; + } + + protected MeasureReport typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MeasureReport)) + return false; + MeasureReport o = (MeasureReport) other; + return compareDeep(measure, o.measure, true) && compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) + && compareDeep(period, o.period, true) && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) + && compareDeep(reportingOrganization, o.reportingOrganization, true) && compareDeep(group, o.group, true) + && compareDeep(evaluatedResources, o.evaluatedResources, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MeasureReport)) + return false; + MeasureReport o = (MeasureReport) other; + return compareValues(type, o.type, true) && compareValues(status, o.status, true) && compareValues(date, o.date, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (measure == null || measure.isEmpty()) && (type == null || type.isEmpty()) + && (patient == null || patient.isEmpty()) && (period == null || period.isEmpty()) && (status == null || status.isEmpty()) + && (date == null || date.isEmpty()) && (reportingOrganization == null || reportingOrganization.isEmpty()) + && (group == null || group.isEmpty()) && (evaluatedResources == null || evaluatedResources.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MeasureReport; + } + + /** + * Search parameter: patient + *

+ * Description: The identity of a patient to search for individual measure report results for
+ * Type: reference
+ * Path: MeasureReport.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="MeasureReport.patient", description="The identity of a patient to search for individual measure report results for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of a patient to search for individual measure report results for
+ * Type: reference
+ * Path: MeasureReport.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MeasureReport:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MeasureReport:patient").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Media.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Media.java new file mode 100644 index 00000000000..7d5ea189087 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Media.java @@ -0,0 +1,1160 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + */ +@ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media") +public class Media extends DomainResource { + + public enum DigitalMediaType { + /** + * The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents + */ + PHOTO, + /** + * The media consists of a series of frames that capture a moving image + */ + VIDEO, + /** + * The media consists of a sound recording + */ + AUDIO, + /** + * added to help the parsers + */ + NULL; + public static DigitalMediaType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("photo".equals(codeString)) + return PHOTO; + if ("video".equals(codeString)) + return VIDEO; + if ("audio".equals(codeString)) + return AUDIO; + throw new FHIRException("Unknown DigitalMediaType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PHOTO: return "photo"; + case VIDEO: return "video"; + case AUDIO: return "audio"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PHOTO: return "http://hl7.org/fhir/digital-media-type"; + case VIDEO: return "http://hl7.org/fhir/digital-media-type"; + case AUDIO: return "http://hl7.org/fhir/digital-media-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PHOTO: return "The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents"; + case VIDEO: return "The media consists of a series of frames that capture a moving image"; + case AUDIO: return "The media consists of a sound recording"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PHOTO: return "Photo"; + case VIDEO: return "Video"; + case AUDIO: return "Audio"; + default: return "?"; + } + } + } + + public static class DigitalMediaTypeEnumFactory implements EnumFactory { + public DigitalMediaType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("photo".equals(codeString)) + return DigitalMediaType.PHOTO; + if ("video".equals(codeString)) + return DigitalMediaType.VIDEO; + if ("audio".equals(codeString)) + return DigitalMediaType.AUDIO; + throw new IllegalArgumentException("Unknown DigitalMediaType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("photo".equals(codeString)) + return new Enumeration(this, DigitalMediaType.PHOTO); + if ("video".equals(codeString)) + return new Enumeration(this, DigitalMediaType.VIDEO); + if ("audio".equals(codeString)) + return new Enumeration(this, DigitalMediaType.AUDIO); + throw new FHIRException("Unknown DigitalMediaType code '"+codeString+"'"); + } + public String toCode(DigitalMediaType code) { + if (code == DigitalMediaType.PHOTO) + return "photo"; + if (code == DigitalMediaType.VIDEO) + return "video"; + if (code == DigitalMediaType.AUDIO) + return "audio"; + return "?"; + } + public String toSystem(DigitalMediaType code) { + return code.getSystem(); + } + } + + /** + * Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Identifier(s) for the image", formalDefinition="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers." ) + protected List identifier; + + /** + * Whether the media is a photo (still image), an audio recording, or a video recording. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="photo | video | audio", formalDefinition="Whether the media is a photo (still image), an audio recording, or a video recording." ) + protected Enumeration type; + + /** + * Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality. + */ + @Child(name = "subtype", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The type of acquisition equipment/process", formalDefinition="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality." ) + protected CodeableConcept subtype; + + /** + * The name of the imaging view e.g. Lateral or Antero-posterior (AP). + */ + @Child(name = "view", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Imaging view, e.g. Lateral or Antero-posterior", formalDefinition="The name of the imaging view e.g. Lateral or Antero-posterior (AP)." ) + protected CodeableConcept view; + + /** + * Who/What this Media is a record of. + */ + @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class, Specimen.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who/What this Media is a record of", formalDefinition="Who/What this Media is a record of." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who/What this Media is a record of.) + */ + protected Resource subjectTarget; + + /** + * The person who administered the collection of the image. + */ + @Child(name = "operator", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The person who generated the image", formalDefinition="The person who administered the collection of the image." ) + protected Reference operator; + + /** + * The actual object that is the target of the reference (The person who administered the collection of the image.) + */ + protected Practitioner operatorTarget; + + /** + * The name of the device / manufacturer of the device that was used to make the recording. + */ + @Child(name = "deviceName", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the device/manufacturer", formalDefinition="The name of the device / manufacturer of the device that was used to make the recording." ) + protected StringType deviceName; + + /** + * Height of the image in pixels (photo/video). + */ + @Child(name = "height", type = {PositiveIntType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Height of the image in pixels (photo/video)", formalDefinition="Height of the image in pixels (photo/video)." ) + protected PositiveIntType height; + + /** + * Width of the image in pixels (photo/video). + */ + @Child(name = "width", type = {PositiveIntType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." ) + protected PositiveIntType width; + + /** + * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + @Child(name = "frames", type = {PositiveIntType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of frames if > 1 (photo)", formalDefinition="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required." ) + protected PositiveIntType frames; + + /** + * The duration of the recording in seconds - for audio and video. + */ + @Child(name = "duration", type = {UnsignedIntType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." ) + protected UnsignedIntType duration; + + /** + * The actual content of the media - inline or by direct reference to the media source file. + */ + @Child(name = "content", type = {Attachment.class}, order=11, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." ) + protected Attachment content; + + private static final long serialVersionUID = -2144305643L; + + /** + * Constructor + */ + public Media() { + super(); + } + + /** + * Constructor + */ + public Media(Enumeration type, Attachment content) { + super(); + this.type = type; + this.content = content; + } + + /** + * @return {@link #identifier} (Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) + */ + 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 the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Media addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). 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 Media.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new DigitalMediaTypeEnumFactory()); // bb + 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} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Media setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Whether the media is a photo (still image), an audio recording, or a video recording. + */ + public DigitalMediaType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Whether the media is a photo (still image), an audio recording, or a video recording. + */ + public Media setType(DigitalMediaType value) { + if (this.type == null) + this.type = new Enumeration(new DigitalMediaTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) + */ + public CodeableConcept getSubtype() { + if (this.subtype == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.subtype"); + else if (Configuration.doAutoCreate()) + this.subtype = new CodeableConcept(); // cc + return this.subtype; + } + + public boolean hasSubtype() { + return this.subtype != null && !this.subtype.isEmpty(); + } + + /** + * @param value {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) + */ + public Media setSubtype(CodeableConcept value) { + this.subtype = value; + return this; + } + + /** + * @return {@link #view} (The name of the imaging view e.g. Lateral or Antero-posterior (AP).) + */ + public CodeableConcept getView() { + if (this.view == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.view"); + else if (Configuration.doAutoCreate()) + this.view = new CodeableConcept(); // cc + return this.view; + } + + public boolean hasView() { + return this.view != null && !this.view.isEmpty(); + } + + /** + * @param value {@link #view} (The name of the imaging view e.g. Lateral or Antero-posterior (AP).) + */ + public Media setView(CodeableConcept value) { + this.view = value; + return this; + } + + /** + * @return {@link #subject} (Who/What this Media is a record of.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Who/What this Media is a record of.) + */ + public Media 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. (Who/What this Media is a record of.) + */ + public Resource getSubjectTarget() { + 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. (Who/What this Media is a record of.) + */ + public Media setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #operator} (The person who administered the collection of the image.) + */ + public Reference getOperator() { + if (this.operator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.operator"); + else if (Configuration.doAutoCreate()) + this.operator = new Reference(); // cc + return this.operator; + } + + public boolean hasOperator() { + return this.operator != null && !this.operator.isEmpty(); + } + + /** + * @param value {@link #operator} (The person who administered the collection of the image.) + */ + public Media setOperator(Reference value) { + this.operator = value; + return this; + } + + /** + * @return {@link #operator} 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 who administered the collection of the image.) + */ + public Practitioner getOperatorTarget() { + if (this.operatorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.operator"); + else if (Configuration.doAutoCreate()) + this.operatorTarget = new Practitioner(); // aa + return this.operatorTarget; + } + + /** + * @param value {@link #operator} 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 who administered the collection of the image.) + */ + public Media setOperatorTarget(Practitioner value) { + this.operatorTarget = value; + return this; + } + + /** + * @return {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value + */ + public StringType getDeviceNameElement() { + if (this.deviceName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.deviceName"); + else if (Configuration.doAutoCreate()) + this.deviceName = new StringType(); // bb + return this.deviceName; + } + + public boolean hasDeviceNameElement() { + return this.deviceName != null && !this.deviceName.isEmpty(); + } + + public boolean hasDeviceName() { + return this.deviceName != null && !this.deviceName.isEmpty(); + } + + /** + * @param value {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value + */ + public Media setDeviceNameElement(StringType value) { + this.deviceName = value; + return this; + } + + /** + * @return The name of the device / manufacturer of the device that was used to make the recording. + */ + public String getDeviceName() { + return this.deviceName == null ? null : this.deviceName.getValue(); + } + + /** + * @param value The name of the device / manufacturer of the device that was used to make the recording. + */ + public Media setDeviceName(String value) { + if (Utilities.noString(value)) + this.deviceName = null; + else { + if (this.deviceName == null) + this.deviceName = new StringType(); + this.deviceName.setValue(value); + } + return this; + } + + /** + * @return {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value + */ + public PositiveIntType getHeightElement() { + if (this.height == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.height"); + else if (Configuration.doAutoCreate()) + this.height = new PositiveIntType(); // bb + return this.height; + } + + public boolean hasHeightElement() { + return this.height != null && !this.height.isEmpty(); + } + + public boolean hasHeight() { + return this.height != null && !this.height.isEmpty(); + } + + /** + * @param value {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value + */ + public Media setHeightElement(PositiveIntType value) { + this.height = value; + return this; + } + + /** + * @return Height of the image in pixels (photo/video). + */ + public int getHeight() { + return this.height == null || this.height.isEmpty() ? 0 : this.height.getValue(); + } + + /** + * @param value Height of the image in pixels (photo/video). + */ + public Media setHeight(int value) { + if (this.height == null) + this.height = new PositiveIntType(); + this.height.setValue(value); + return this; + } + + /** + * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value + */ + public PositiveIntType getWidthElement() { + if (this.width == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.width"); + else if (Configuration.doAutoCreate()) + this.width = new PositiveIntType(); // bb + return this.width; + } + + public boolean hasWidthElement() { + return this.width != null && !this.width.isEmpty(); + } + + public boolean hasWidth() { + return this.width != null && !this.width.isEmpty(); + } + + /** + * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value + */ + public Media setWidthElement(PositiveIntType value) { + this.width = value; + return this; + } + + /** + * @return Width of the image in pixels (photo/video). + */ + public int getWidth() { + return this.width == null || this.width.isEmpty() ? 0 : this.width.getValue(); + } + + /** + * @param value Width of the image in pixels (photo/video). + */ + public Media setWidth(int value) { + if (this.width == null) + this.width = new PositiveIntType(); + this.width.setValue(value); + return this; + } + + /** + * @return {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value + */ + public PositiveIntType getFramesElement() { + if (this.frames == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.frames"); + else if (Configuration.doAutoCreate()) + this.frames = new PositiveIntType(); // bb + return this.frames; + } + + public boolean hasFramesElement() { + return this.frames != null && !this.frames.isEmpty(); + } + + public boolean hasFrames() { + return this.frames != null && !this.frames.isEmpty(); + } + + /** + * @param value {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value + */ + public Media setFramesElement(PositiveIntType value) { + this.frames = value; + return this; + } + + /** + * @return The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + public int getFrames() { + return this.frames == null || this.frames.isEmpty() ? 0 : this.frames.getValue(); + } + + /** + * @param value The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + public Media setFrames(int value) { + if (this.frames == null) + this.frames = new PositiveIntType(); + this.frames.setValue(value); + return this; + } + + /** + * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public UnsignedIntType getDurationElement() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new UnsignedIntType(); // bb + return this.duration; + } + + public boolean hasDurationElement() { + return this.duration != null && !this.duration.isEmpty(); + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public Media setDurationElement(UnsignedIntType value) { + this.duration = value; + return this; + } + + /** + * @return The duration of the recording in seconds - for audio and video. + */ + public int getDuration() { + return this.duration == null || this.duration.isEmpty() ? 0 : this.duration.getValue(); + } + + /** + * @param value The duration of the recording in seconds - for audio and video. + */ + public Media setDuration(int value) { + if (this.duration == null) + this.duration = new UnsignedIntType(); + this.duration.setValue(value); + return this; + } + + /** + * @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) + */ + public Attachment getContent() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.content"); + else if (Configuration.doAutoCreate()) + this.content = new Attachment(); // cc + return this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) + */ + public Media setContent(Attachment value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "code", "Whether the media is a photo (still image), an audio recording, or a video recording.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subtype", "CodeableConcept", "Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("view", "CodeableConcept", "The name of the imaging view e.g. Lateral or Antero-posterior (AP).", 0, java.lang.Integer.MAX_VALUE, view)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Specimen)", "Who/What this Media is a record of.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("operator", "Reference(Practitioner)", "The person who administered the collection of the image.", 0, java.lang.Integer.MAX_VALUE, operator)); + childrenList.add(new Property("deviceName", "string", "The name of the device / manufacturer of the device that was used to make the recording.", 0, java.lang.Integer.MAX_VALUE, deviceName)); + childrenList.add(new Property("height", "positiveInt", "Height of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, height)); + childrenList.add(new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, width)); + childrenList.add(new Property("frames", "positiveInt", "The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.", 0, java.lang.Integer.MAX_VALUE, frames)); + childrenList.add(new Property("duration", "unsignedInt", "The duration of the recording in seconds - for audio and video.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("content", "Attachment", "The actual content of the media - inline or by direct reference to the media source file.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : new Base[] {this.subtype}; // CodeableConcept + case 3619493: /*view*/ return this.view == null ? new Base[0] : new Base[] {this.view}; // CodeableConcept + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -500553564: /*operator*/ return this.operator == null ? new Base[0] : new Base[] {this.operator}; // Reference + case 780988929: /*deviceName*/ return this.deviceName == null ? new Base[0] : new Base[] {this.deviceName}; // StringType + case -1221029593: /*height*/ return this.height == null ? new Base[0] : new Base[] {this.height}; // PositiveIntType + case 113126854: /*width*/ return this.width == null ? new Base[0] : new Base[] {this.width}; // PositiveIntType + case -1266514778: /*frames*/ return this.frames == null ? new Base[0] : new Base[] {this.frames}; // PositiveIntType + case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // UnsignedIntType + case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Attachment + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 3575610: // type + this.type = new DigitalMediaTypeEnumFactory().fromType(value); // Enumeration + break; + case -1867567750: // subtype + this.subtype = castToCodeableConcept(value); // CodeableConcept + break; + case 3619493: // view + this.view = castToCodeableConcept(value); // CodeableConcept + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -500553564: // operator + this.operator = castToReference(value); // Reference + break; + case 780988929: // deviceName + this.deviceName = castToString(value); // StringType + break; + case -1221029593: // height + this.height = castToPositiveInt(value); // PositiveIntType + break; + case 113126854: // width + this.width = castToPositiveInt(value); // PositiveIntType + break; + case -1266514778: // frames + this.frames = castToPositiveInt(value); // PositiveIntType + break; + case -1992012396: // duration + this.duration = castToUnsignedInt(value); // UnsignedIntType + break; + case 951530617: // content + this.content = castToAttachment(value); // Attachment + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("type")) + this.type = new DigitalMediaTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("subtype")) + this.subtype = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("view")) + this.view = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("operator")) + this.operator = castToReference(value); // Reference + else if (name.equals("deviceName")) + this.deviceName = castToString(value); // StringType + else if (name.equals("height")) + this.height = castToPositiveInt(value); // PositiveIntType + else if (name.equals("width")) + this.width = castToPositiveInt(value); // PositiveIntType + else if (name.equals("frames")) + this.frames = castToPositiveInt(value); // PositiveIntType + else if (name.equals("duration")) + this.duration = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("content")) + this.content = castToAttachment(value); // Attachment + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -1867567750: return getSubtype(); // CodeableConcept + case 3619493: return getView(); // CodeableConcept + case -1867885268: return getSubject(); // Reference + case -500553564: return getOperator(); // Reference + case 780988929: throw new FHIRException("Cannot make property deviceName as it is not a complex type"); // StringType + case -1221029593: throw new FHIRException("Cannot make property height as it is not a complex type"); // PositiveIntType + case 113126854: throw new FHIRException("Cannot make property width as it is not a complex type"); // PositiveIntType + case -1266514778: throw new FHIRException("Cannot make property frames as it is not a complex type"); // PositiveIntType + case -1992012396: throw new FHIRException("Cannot make property duration as it is not a complex type"); // UnsignedIntType + case 951530617: return getContent(); // Attachment + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Media.type"); + } + else if (name.equals("subtype")) { + this.subtype = new CodeableConcept(); + return this.subtype; + } + else if (name.equals("view")) { + this.view = new CodeableConcept(); + return this.view; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("operator")) { + this.operator = new Reference(); + return this.operator; + } + else if (name.equals("deviceName")) { + throw new FHIRException("Cannot call addChild on a primitive type Media.deviceName"); + } + else if (name.equals("height")) { + throw new FHIRException("Cannot call addChild on a primitive type Media.height"); + } + else if (name.equals("width")) { + throw new FHIRException("Cannot call addChild on a primitive type Media.width"); + } + else if (name.equals("frames")) { + throw new FHIRException("Cannot call addChild on a primitive type Media.frames"); + } + else if (name.equals("duration")) { + throw new FHIRException("Cannot call addChild on a primitive type Media.duration"); + } + else if (name.equals("content")) { + this.content = new Attachment(); + return this.content; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Media"; + + } + + public Media copy() { + Media dst = new Media(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.subtype = subtype == null ? null : subtype.copy(); + dst.view = view == null ? null : view.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.operator = operator == null ? null : operator.copy(); + dst.deviceName = deviceName == null ? null : deviceName.copy(); + dst.height = height == null ? null : height.copy(); + dst.width = width == null ? null : width.copy(); + dst.frames = frames == null ? null : frames.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.content = content == null ? null : content.copy(); + return dst; + } + + protected Media typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Media)) + return false; + Media o = (Media) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) + && compareDeep(view, o.view, true) && compareDeep(subject, o.subject, true) && compareDeep(operator, o.operator, true) + && compareDeep(deviceName, o.deviceName, true) && compareDeep(height, o.height, true) && compareDeep(width, o.width, true) + && compareDeep(frames, o.frames, true) && compareDeep(duration, o.duration, true) && compareDeep(content, o.content, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Media)) + return false; + Media o = (Media) other; + return compareValues(type, o.type, true) && compareValues(deviceName, o.deviceName, true) && compareValues(height, o.height, true) + && compareValues(width, o.width, true) && compareValues(frames, o.frames, true) && compareValues(duration, o.duration, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (subtype == null || subtype.isEmpty()) && (view == null || view.isEmpty()) && (subject == null || subject.isEmpty()) + && (operator == null || operator.isEmpty()) && (deviceName == null || deviceName.isEmpty()) + && (height == null || height.isEmpty()) && (width == null || width.isEmpty()) && (frames == null || frames.isEmpty()) + && (duration == null || duration.isEmpty()) && (content == null || content.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Media; + } + + /** + * Search parameter: patient + *

+ * Description: Who/What this Media is a record of
+ * Type: reference
+ * Path: Media.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who/What this Media is a record of
+ * Type: reference
+ * Path: Media.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Media:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Media:patient").toLocked(); + + /** + * Search parameter: created + *

+ * Description: Date attachment was first created
+ * Type: date
+ * Path: Media.content.creation
+ *

+ */ + @SearchParamDefinition(name="created", path="Media.content.creation", description="Date attachment was first created", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: Date attachment was first created
+ * Type: date
+ * Path: Media.content.creation
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: subject + *

+ * Description: Who/What this Media is a record of
+ * Type: reference
+ * Path: Media.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Who/What this Media is a record of
+ * Type: reference
+ * Path: Media.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Media:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Media:subject").toLocked(); + + /** + * Search parameter: subtype + *

+ * Description: The type of acquisition equipment/process
+ * Type: token
+ * Path: Media.subtype
+ *

+ */ + @SearchParamDefinition(name="subtype", path="Media.subtype", description="The type of acquisition equipment/process", type="token" ) + public static final String SP_SUBTYPE = "subtype"; + /** + * Fluent Client search parameter constant for subtype + *

+ * Description: The type of acquisition equipment/process
+ * Type: token
+ * Path: Media.subtype
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBTYPE); + + /** + * Search parameter: view + *

+ * Description: Imaging view, e.g. Lateral or Antero-posterior
+ * Type: token
+ * Path: Media.view
+ *

+ */ + @SearchParamDefinition(name="view", path="Media.view", description="Imaging view, e.g. Lateral or Antero-posterior", type="token" ) + public static final String SP_VIEW = "view"; + /** + * Fluent Client search parameter constant for view + *

+ * Description: Imaging view, e.g. Lateral or Antero-posterior
+ * Type: token
+ * Path: Media.view
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VIEW = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VIEW); + + /** + * Search parameter: type + *

+ * Description: photo | video | audio
+ * Type: token
+ * Path: Media.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Media.type", description="photo | video | audio", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: photo | video | audio
+ * Type: token
+ * Path: Media.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: Identifier(s) for the image
+ * Type: token
+ * Path: Media.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Media.identifier", description="Identifier(s) for the image", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Identifier(s) for the image
+ * Type: token
+ * Path: Media.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: operator + *

+ * Description: The person who generated the image
+ * Type: reference
+ * Path: Media.operator
+ *

+ */ + @SearchParamDefinition(name="operator", path="Media.operator", description="The person who generated the image", type="reference" ) + public static final String SP_OPERATOR = "operator"; + /** + * Fluent Client search parameter constant for operator + *

+ * Description: The person who generated the image
+ * Type: reference
+ * Path: Media.operator
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OPERATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OPERATOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Media:operator". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_OPERATOR = new ca.uhn.fhir.model.api.Include("Media:operator").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Medication.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Medication.java new file mode 100644 index 00000000000..ee2edf9cef5 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Medication.java @@ -0,0 +1,1696 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. + */ +@ResourceDef(name="Medication", profile="http://hl7.org/fhir/Profile/Medication") +public class Medication extends DomainResource { + + @Block() + public static class MedicationProductComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes the form of the item. Powder; tablets; carton. + */ + @Child(name = "form", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="powder | tablets | carton +", formalDefinition="Describes the form of the item. Powder; tablets; carton." ) + protected CodeableConcept form; + + /** + * Identifies a particular constituent of interest in the product. + */ + @Child(name = "ingredient", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Active or inactive ingredient", formalDefinition="Identifies a particular constituent of interest in the product." ) + protected List ingredient; + + /** + * Information about a group of medication produced or packaged from one production run. + */ + @Child(name = "batch", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="Information about a group of medication produced or packaged from one production run." ) + protected List batch; + + private static final long serialVersionUID = 1132853671L; + + /** + * Constructor + */ + public MedicationProductComponent() { + super(); + } + + /** + * @return {@link #form} (Describes the form of the item. Powder; tablets; carton.) + */ + public CodeableConcept getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductComponent.form"); + else if (Configuration.doAutoCreate()) + this.form = new CodeableConcept(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (Describes the form of the item. Powder; tablets; carton.) + */ + public MedicationProductComponent setForm(CodeableConcept value) { + this.form = value; + return this; + } + + /** + * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) + */ + public List getIngredient() { + if (this.ingredient == null) + this.ingredient = new ArrayList(); + return this.ingredient; + } + + public boolean hasIngredient() { + if (this.ingredient == null) + return false; + for (MedicationProductIngredientComponent item : this.ingredient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) + */ + // syntactic sugar + public MedicationProductIngredientComponent addIngredient() { //3 + MedicationProductIngredientComponent t = new MedicationProductIngredientComponent(); + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return t; + } + + // syntactic sugar + public MedicationProductComponent addIngredient(MedicationProductIngredientComponent t) { //3 + if (t == null) + return this; + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return this; + } + + /** + * @return {@link #batch} (Information about a group of medication produced or packaged from one production run.) + */ + public List getBatch() { + if (this.batch == null) + this.batch = new ArrayList(); + return this.batch; + } + + public boolean hasBatch() { + if (this.batch == null) + return false; + for (MedicationProductBatchComponent item : this.batch) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #batch} (Information about a group of medication produced or packaged from one production run.) + */ + // syntactic sugar + public MedicationProductBatchComponent addBatch() { //3 + MedicationProductBatchComponent t = new MedicationProductBatchComponent(); + if (this.batch == null) + this.batch = new ArrayList(); + this.batch.add(t); + return t; + } + + // syntactic sugar + public MedicationProductComponent addBatch(MedicationProductBatchComponent t) { //3 + if (t == null) + return this; + if (this.batch == null) + this.batch = new ArrayList(); + this.batch.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("form", "CodeableConcept", "Describes the form of the item. Powder; tablets; carton.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient)); + childrenList.add(new Property("batch", "", "Information about a group of medication produced or packaged from one production run.", 0, java.lang.Integer.MAX_VALUE, batch)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept + case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // MedicationProductIngredientComponent + case 93509434: /*batch*/ return this.batch == null ? new Base[0] : this.batch.toArray(new Base[this.batch.size()]); // MedicationProductBatchComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3148996: // form + this.form = castToCodeableConcept(value); // CodeableConcept + break; + case -206409263: // ingredient + this.getIngredient().add((MedicationProductIngredientComponent) value); // MedicationProductIngredientComponent + break; + case 93509434: // batch + this.getBatch().add((MedicationProductBatchComponent) value); // MedicationProductBatchComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("form")) + this.form = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("ingredient")) + this.getIngredient().add((MedicationProductIngredientComponent) value); + else if (name.equals("batch")) + this.getBatch().add((MedicationProductBatchComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3148996: return getForm(); // CodeableConcept + case -206409263: return addIngredient(); // MedicationProductIngredientComponent + case 93509434: return addBatch(); // MedicationProductBatchComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("form")) { + this.form = new CodeableConcept(); + return this.form; + } + else if (name.equals("ingredient")) { + return addIngredient(); + } + else if (name.equals("batch")) { + return addBatch(); + } + else + return super.addChild(name); + } + + public MedicationProductComponent copy() { + MedicationProductComponent dst = new MedicationProductComponent(); + copyValues(dst); + dst.form = form == null ? null : form.copy(); + if (ingredient != null) { + dst.ingredient = new ArrayList(); + for (MedicationProductIngredientComponent i : ingredient) + dst.ingredient.add(i.copy()); + }; + if (batch != null) { + dst.batch = new ArrayList(); + for (MedicationProductBatchComponent i : batch) + dst.batch.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationProductComponent)) + return false; + MedicationProductComponent o = (MedicationProductComponent) other; + return compareDeep(form, o.form, true) && compareDeep(ingredient, o.ingredient, true) && compareDeep(batch, o.batch, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationProductComponent)) + return false; + MedicationProductComponent o = (MedicationProductComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (form == null || form.isEmpty()) && (ingredient == null || ingredient.isEmpty()) + && (batch == null || batch.isEmpty()); + } + + public String fhirType() { + return "Medication.product"; + + } + + } + + @Block() + public static class MedicationProductIngredientComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The actual ingredient - either a substance (simple ingredient) or another medication. + */ + @Child(name = "item", type = {CodeableConcept.class, Substance.class, Medication.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The product contained", formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication." ) + protected Type item; + + /** + * Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet. + */ + @Child(name = "amount", type = {Ratio.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Quantity of ingredient present", formalDefinition="Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet." ) + protected Ratio amount; + + private static final long serialVersionUID = -651644952L; + + /** + * Constructor + */ + public MedicationProductIngredientComponent() { + super(); + } + + /** + * Constructor + */ + public MedicationProductIngredientComponent(Type item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public Type getItem() { + return this.item; + } + + /** + * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public CodeableConcept getItemCodeableConcept() throws FHIRException { + if (!(this.item instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered"); + return (CodeableConcept) this.item; + } + + public boolean hasItemCodeableConcept() { + return this.item instanceof CodeableConcept; + } + + /** + * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public Reference getItemReference() throws FHIRException { + if (!(this.item instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered"); + return (Reference) this.item; + } + + public boolean hasItemReference() { + return this.item instanceof Reference; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public MedicationProductIngredientComponent setItem(Type value) { + this.item = value; + return this; + } + + /** + * @return {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet.) + */ + public Ratio getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductIngredientComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Ratio(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet.) + */ + public MedicationProductIngredientComponent setAmount(Ratio value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item[x]", "CodeableConcept|Reference(Substance|Medication)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("amount", "Ratio", "Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Type + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Ratio + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3242771: // item + this.item = (Type) value; // Type + break; + case -1413853096: // amount + this.amount = castToRatio(value); // Ratio + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("item[x]")) + this.item = (Type) value; // Type + else if (name.equals("amount")) + this.amount = castToRatio(value); // Ratio + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 2116201613: return getItem(); // Type + case -1413853096: return getAmount(); // Ratio + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("itemCodeableConcept")) { + this.item = new CodeableConcept(); + return this.item; + } + else if (name.equals("itemReference")) { + this.item = new Reference(); + return this.item; + } + else if (name.equals("amount")) { + this.amount = new Ratio(); + return this.amount; + } + else + return super.addChild(name); + } + + public MedicationProductIngredientComponent copy() { + MedicationProductIngredientComponent dst = new MedicationProductIngredientComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationProductIngredientComponent)) + return false; + MedicationProductIngredientComponent o = (MedicationProductIngredientComponent) other; + return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationProductIngredientComponent)) + return false; + MedicationProductIngredientComponent o = (MedicationProductIngredientComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + public String fhirType() { + return "Medication.product.ingredient"; + + } + + } + + @Block() + public static class MedicationProductBatchComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The assigned lot number of a batch of the specified product. + */ + @Child(name = "lotNumber", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The assigned lot number of a batch of the specified product." ) + protected StringType lotNumber; + + /** + * When this specific batch of product will expire. + */ + @Child(name = "expirationDate", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="When this specific batch of product will expire." ) + protected DateTimeType expirationDate; + + private static final long serialVersionUID = 1982738755L; + + /** + * Constructor + */ + public MedicationProductBatchComponent() { + super(); + } + + /** + * @return {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public StringType getLotNumberElement() { + if (this.lotNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductBatchComponent.lotNumber"); + else if (Configuration.doAutoCreate()) + this.lotNumber = new StringType(); // bb + return this.lotNumber; + } + + public boolean hasLotNumberElement() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + public boolean hasLotNumber() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + /** + * @param value {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public MedicationProductBatchComponent setLotNumberElement(StringType value) { + this.lotNumber = value; + return this; + } + + /** + * @return The assigned lot number of a batch of the specified product. + */ + public String getLotNumber() { + return this.lotNumber == null ? null : this.lotNumber.getValue(); + } + + /** + * @param value The assigned lot number of a batch of the specified product. + */ + public MedicationProductBatchComponent setLotNumber(String value) { + if (Utilities.noString(value)) + this.lotNumber = null; + else { + if (this.lotNumber == null) + this.lotNumber = new StringType(); + this.lotNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public DateTimeType getExpirationDateElement() { + if (this.expirationDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductBatchComponent.expirationDate"); + else if (Configuration.doAutoCreate()) + this.expirationDate = new DateTimeType(); // bb + return this.expirationDate; + } + + public boolean hasExpirationDateElement() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + public boolean hasExpirationDate() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + /** + * @param value {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public MedicationProductBatchComponent setExpirationDateElement(DateTimeType value) { + this.expirationDate = value; + return this; + } + + /** + * @return When this specific batch of product will expire. + */ + public Date getExpirationDate() { + return this.expirationDate == null ? null : this.expirationDate.getValue(); + } + + /** + * @param value When this specific batch of product will expire. + */ + public MedicationProductBatchComponent setExpirationDate(Date value) { + if (value == null) + this.expirationDate = null; + else { + if (this.expirationDate == null) + this.expirationDate = new DateTimeType(); + this.expirationDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("lotNumber", "string", "The assigned lot number of a batch of the specified product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); + childrenList.add(new Property("expirationDate", "dateTime", "When this specific batch of product will expire.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType + case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateTimeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 462547450: // lotNumber + this.lotNumber = castToString(value); // StringType + break; + case -668811523: // expirationDate + this.expirationDate = castToDateTime(value); // DateTimeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("lotNumber")) + this.lotNumber = castToString(value); // StringType + else if (name.equals("expirationDate")) + this.expirationDate = castToDateTime(value); // DateTimeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 462547450: throw new FHIRException("Cannot make property lotNumber as it is not a complex type"); // StringType + case -668811523: throw new FHIRException("Cannot make property expirationDate as it is not a complex type"); // DateTimeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("lotNumber")) { + throw new FHIRException("Cannot call addChild on a primitive type Medication.lotNumber"); + } + else if (name.equals("expirationDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Medication.expirationDate"); + } + else + return super.addChild(name); + } + + public MedicationProductBatchComponent copy() { + MedicationProductBatchComponent dst = new MedicationProductBatchComponent(); + copyValues(dst); + dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); + dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationProductBatchComponent)) + return false; + MedicationProductBatchComponent o = (MedicationProductBatchComponent) other; + return compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationProductBatchComponent)) + return false; + MedicationProductBatchComponent o = (MedicationProductBatchComponent) other; + return compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (lotNumber == null || lotNumber.isEmpty()) && (expirationDate == null || expirationDate.isEmpty()) + ; + } + + public String fhirType() { + return "Medication.product.batch"; + + } + + } + + @Block() + public static class MedicationPackageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of container that this package comes as. + */ + @Child(name = "container", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="E.g. box, vial, blister-pack", formalDefinition="The kind of container that this package comes as." ) + protected CodeableConcept container; + + /** + * A set of components that go to make up the described item. + */ + @Child(name = "content", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="What is in the package", formalDefinition="A set of components that go to make up the described item." ) + protected List content; + + private static final long serialVersionUID = 503772472L; + + /** + * Constructor + */ + public MedicationPackageComponent() { + super(); + } + + /** + * @return {@link #container} (The kind of container that this package comes as.) + */ + public CodeableConcept getContainer() { + if (this.container == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageComponent.container"); + else if (Configuration.doAutoCreate()) + this.container = new CodeableConcept(); // cc + return this.container; + } + + public boolean hasContainer() { + return this.container != null && !this.container.isEmpty(); + } + + /** + * @param value {@link #container} (The kind of container that this package comes as.) + */ + public MedicationPackageComponent setContainer(CodeableConcept value) { + this.container = value; + return this; + } + + /** + * @return {@link #content} (A set of components that go to make up the described item.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (MedicationPackageContentComponent item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (A set of components that go to make up the described item.) + */ + // syntactic sugar + public MedicationPackageContentComponent addContent() { //3 + MedicationPackageContentComponent t = new MedicationPackageContentComponent(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + // syntactic sugar + public MedicationPackageComponent addContent(MedicationPackageContentComponent t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("container", "CodeableConcept", "The kind of container that this package comes as.", 0, java.lang.Integer.MAX_VALUE, container)); + childrenList.add(new Property("content", "", "A set of components that go to make up the described item.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -410956671: /*container*/ return this.container == null ? new Base[0] : new Base[] {this.container}; // CodeableConcept + case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // MedicationPackageContentComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -410956671: // container + this.container = castToCodeableConcept(value); // CodeableConcept + break; + case 951530617: // content + this.getContent().add((MedicationPackageContentComponent) value); // MedicationPackageContentComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("container")) + this.container = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("content")) + this.getContent().add((MedicationPackageContentComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -410956671: return getContainer(); // CodeableConcept + case 951530617: return addContent(); // MedicationPackageContentComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("container")) { + this.container = new CodeableConcept(); + return this.container; + } + else if (name.equals("content")) { + return addContent(); + } + else + return super.addChild(name); + } + + public MedicationPackageComponent copy() { + MedicationPackageComponent dst = new MedicationPackageComponent(); + copyValues(dst); + dst.container = container == null ? null : container.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (MedicationPackageContentComponent i : content) + dst.content.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationPackageComponent)) + return false; + MedicationPackageComponent o = (MedicationPackageComponent) other; + return compareDeep(container, o.container, true) && compareDeep(content, o.content, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationPackageComponent)) + return false; + MedicationPackageComponent o = (MedicationPackageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (container == null || container.isEmpty()) && (content == null || content.isEmpty()) + ; + } + + public String fhirType() { + return "Medication.package"; + + } + + } + + @Block() + public static class MedicationPackageContentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies one of the items in the package. + */ + @Child(name = "item", type = {CodeableConcept.class, Medication.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The item in the package", formalDefinition="Identifies one of the items in the package." ) + protected Type item; + + /** + * The amount of the product that is in the package. + */ + @Child(name = "amount", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Quantity present in the package", formalDefinition="The amount of the product that is in the package." ) + protected SimpleQuantity amount; + + private static final long serialVersionUID = 1669610080L; + + /** + * Constructor + */ + public MedicationPackageContentComponent() { + super(); + } + + /** + * Constructor + */ + public MedicationPackageContentComponent(Type item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Identifies one of the items in the package.) + */ + public Type getItem() { + return this.item; + } + + /** + * @return {@link #item} (Identifies one of the items in the package.) + */ + public CodeableConcept getItemCodeableConcept() throws FHIRException { + if (!(this.item instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered"); + return (CodeableConcept) this.item; + } + + public boolean hasItemCodeableConcept() { + return this.item instanceof CodeableConcept; + } + + /** + * @return {@link #item} (Identifies one of the items in the package.) + */ + public Reference getItemReference() throws FHIRException { + if (!(this.item instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered"); + return (Reference) this.item; + } + + public boolean hasItemReference() { + return this.item instanceof Reference; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Identifies one of the items in the package.) + */ + public MedicationPackageContentComponent setItem(Type value) { + this.item = value; + return this; + } + + /** + * @return {@link #amount} (The amount of the product that is in the package.) + */ + public SimpleQuantity getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageContentComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new SimpleQuantity(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (The amount of the product that is in the package.) + */ + public MedicationPackageContentComponent setAmount(SimpleQuantity value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item[x]", "CodeableConcept|Reference(Medication)", "Identifies one of the items in the package.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("amount", "SimpleQuantity", "The amount of the product that is in the package.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Type + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SimpleQuantity + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3242771: // item + this.item = (Type) value; // Type + break; + case -1413853096: // amount + this.amount = castToSimpleQuantity(value); // SimpleQuantity + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("item[x]")) + this.item = (Type) value; // Type + else if (name.equals("amount")) + this.amount = castToSimpleQuantity(value); // SimpleQuantity + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 2116201613: return getItem(); // Type + case -1413853096: return getAmount(); // SimpleQuantity + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("itemCodeableConcept")) { + this.item = new CodeableConcept(); + return this.item; + } + else if (name.equals("itemReference")) { + this.item = new Reference(); + return this.item; + } + else if (name.equals("amount")) { + this.amount = new SimpleQuantity(); + return this.amount; + } + else + return super.addChild(name); + } + + public MedicationPackageContentComponent copy() { + MedicationPackageContentComponent dst = new MedicationPackageContentComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationPackageContentComponent)) + return false; + MedicationPackageContentComponent o = (MedicationPackageContentComponent) other; + return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationPackageContentComponent)) + return false; + MedicationPackageContentComponent o = (MedicationPackageContentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + public String fhirType() { + return "Medication.package.content"; + + } + + } + + /** + * A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Codes that identify this medication", formalDefinition="A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems." ) + protected CodeableConcept code; + + /** + * Set to true if the item is attributable to a specific manufacturer. + */ + @Child(name = "isBrand", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="True if a brand", formalDefinition="Set to true if the item is attributable to a specific manufacturer." ) + protected BooleanType isBrand; + + /** + * Describes the details of the manufacturer. + */ + @Child(name = "manufacturer", type = {Organization.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Manufacturer of the item", formalDefinition="Describes the details of the manufacturer." ) + protected Reference manufacturer; + + /** + * The actual object that is the target of the reference (Describes the details of the manufacturer.) + */ + protected Organization manufacturerTarget; + + /** + * Information that only applies to products (not packages). + */ + @Child(name = "product", type = {}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Administrable medication details", formalDefinition="Information that only applies to products (not packages)." ) + protected MedicationProductComponent product; + + /** + * Information that only applies to packages (not products). + */ + @Child(name = "package", type = {}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Details about packaged medications", formalDefinition="Information that only applies to packages (not products)." ) + protected MedicationPackageComponent package_; + + private static final long serialVersionUID = 859308699L; + + /** + * Constructor + */ + public Medication() { + super(); + } + + /** + * @return {@link #code} (A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.) + */ + public Medication setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer.). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value + */ + public BooleanType getIsBrandElement() { + if (this.isBrand == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.isBrand"); + else if (Configuration.doAutoCreate()) + this.isBrand = new BooleanType(); // bb + return this.isBrand; + } + + public boolean hasIsBrandElement() { + return this.isBrand != null && !this.isBrand.isEmpty(); + } + + public boolean hasIsBrand() { + return this.isBrand != null && !this.isBrand.isEmpty(); + } + + /** + * @param value {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer.). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value + */ + public Medication setIsBrandElement(BooleanType value) { + this.isBrand = value; + return this; + } + + /** + * @return Set to true if the item is attributable to a specific manufacturer. + */ + public boolean getIsBrand() { + return this.isBrand == null || this.isBrand.isEmpty() ? false : this.isBrand.getValue(); + } + + /** + * @param value Set to true if the item is attributable to a specific manufacturer. + */ + public Medication setIsBrand(boolean value) { + if (this.isBrand == null) + this.isBrand = new BooleanType(); + this.isBrand.setValue(value); + return this; + } + + /** + * @return {@link #manufacturer} (Describes the details of the manufacturer.) + */ + public Reference getManufacturer() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new Reference(); // cc + return this.manufacturer; + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (Describes the details of the manufacturer.) + */ + public Medication setManufacturer(Reference value) { + this.manufacturer = value; + return this; + } + + /** + * @return {@link #manufacturer} 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 details of the manufacturer.) + */ + public Organization getManufacturerTarget() { + if (this.manufacturerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturerTarget = new Organization(); // aa + return this.manufacturerTarget; + } + + /** + * @param value {@link #manufacturer} 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 details of the manufacturer.) + */ + public Medication setManufacturerTarget(Organization value) { + this.manufacturerTarget = value; + return this; + } + + /** + * @return {@link #product} (Information that only applies to products (not packages).) + */ + public MedicationProductComponent getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.product"); + else if (Configuration.doAutoCreate()) + this.product = new MedicationProductComponent(); // cc + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Information that only applies to products (not packages).) + */ + public Medication setProduct(MedicationProductComponent value) { + this.product = value; + return this; + } + + /** + * @return {@link #package_} (Information that only applies to packages (not products).) + */ + public MedicationPackageComponent getPackage() { + if (this.package_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.package_"); + else if (Configuration.doAutoCreate()) + this.package_ = new MedicationPackageComponent(); // cc + return this.package_; + } + + public boolean hasPackage() { + return this.package_ != null && !this.package_.isEmpty(); + } + + /** + * @param value {@link #package_} (Information that only applies to packages (not products).) + */ + public Medication setPackage(MedicationPackageComponent value) { + this.package_ = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("isBrand", "boolean", "Set to true if the item is attributable to a specific manufacturer.", 0, java.lang.Integer.MAX_VALUE, isBrand)); + childrenList.add(new Property("manufacturer", "Reference(Organization)", "Describes the details of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("product", "", "Information that only applies to products (not packages).", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("package", "", "Information that only applies to packages (not products).", 0, java.lang.Integer.MAX_VALUE, package_)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 2055403645: /*isBrand*/ return this.isBrand == null ? new Base[0] : new Base[] {this.isBrand}; // BooleanType + case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // Reference + case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // MedicationProductComponent + case -807062458: /*package*/ return this.package_ == null ? new Base[0] : new Base[] {this.package_}; // MedicationPackageComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 2055403645: // isBrand + this.isBrand = castToBoolean(value); // BooleanType + break; + case -1969347631: // manufacturer + this.manufacturer = castToReference(value); // Reference + break; + case -309474065: // product + this.product = (MedicationProductComponent) value; // MedicationProductComponent + break; + case -807062458: // package + this.package_ = (MedicationPackageComponent) value; // MedicationPackageComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("isBrand")) + this.isBrand = castToBoolean(value); // BooleanType + else if (name.equals("manufacturer")) + this.manufacturer = castToReference(value); // Reference + else if (name.equals("product")) + this.product = (MedicationProductComponent) value; // MedicationProductComponent + else if (name.equals("package")) + this.package_ = (MedicationPackageComponent) value; // MedicationPackageComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case 2055403645: throw new FHIRException("Cannot make property isBrand as it is not a complex type"); // BooleanType + case -1969347631: return getManufacturer(); // Reference + case -309474065: return getProduct(); // MedicationProductComponent + case -807062458: return getPackage(); // MedicationPackageComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("isBrand")) { + throw new FHIRException("Cannot call addChild on a primitive type Medication.isBrand"); + } + else if (name.equals("manufacturer")) { + this.manufacturer = new Reference(); + return this.manufacturer; + } + else if (name.equals("product")) { + this.product = new MedicationProductComponent(); + return this.product; + } + else if (name.equals("package")) { + this.package_ = new MedicationPackageComponent(); + return this.package_; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Medication"; + + } + + public Medication copy() { + Medication dst = new Medication(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.isBrand = isBrand == null ? null : isBrand.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.product = product == null ? null : product.copy(); + dst.package_ = package_ == null ? null : package_.copy(); + return dst; + } + + protected Medication typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Medication)) + return false; + Medication o = (Medication) other; + return compareDeep(code, o.code, true) && compareDeep(isBrand, o.isBrand, true) && compareDeep(manufacturer, o.manufacturer, true) + && compareDeep(product, o.product, true) && compareDeep(package_, o.package_, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Medication)) + return false; + Medication o = (Medication) other; + return compareValues(isBrand, o.isBrand, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (isBrand == null || isBrand.isEmpty()) + && (manufacturer == null || manufacturer.isEmpty()) && (product == null || product.isEmpty()) + && (package_ == null || package_.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Medication; + } + + /** + * Search parameter: form + *

+ * Description: powder | tablets | carton +
+ * Type: token
+ * Path: Medication.product.form
+ *

+ */ + @SearchParamDefinition(name="form", path="Medication.product.form", description="powder | tablets | carton +", type="token" ) + public static final String SP_FORM = "form"; + /** + * Fluent Client search parameter constant for form + *

+ * Description: powder | tablets | carton +
+ * Type: token
+ * Path: Medication.product.form
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORM); + + /** + * Search parameter: container + *

+ * Description: E.g. box, vial, blister-pack
+ * Type: token
+ * Path: Medication.package.container
+ *

+ */ + @SearchParamDefinition(name="container", path="Medication.package.container", description="E.g. box, vial, blister-pack", type="token" ) + public static final String SP_CONTAINER = "container"; + /** + * Fluent Client search parameter constant for container + *

+ * Description: E.g. box, vial, blister-pack
+ * Type: token
+ * Path: Medication.package.container
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER); + + /** + * Search parameter: manufacturer + *

+ * Description: Manufacturer of the item
+ * Type: reference
+ * Path: Medication.manufacturer
+ *

+ */ + @SearchParamDefinition(name="manufacturer", path="Medication.manufacturer", description="Manufacturer of the item", type="reference" ) + public static final String SP_MANUFACTURER = "manufacturer"; + /** + * Fluent Client search parameter constant for manufacturer + *

+ * Description: Manufacturer of the item
+ * Type: reference
+ * Path: Medication.manufacturer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANUFACTURER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Medication:manufacturer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_MANUFACTURER = new ca.uhn.fhir.model.api.Include("Medication:manufacturer").toLocked(); + + /** + * Search parameter: package-item-code + *

+ * Description: The item in the package
+ * Type: token
+ * Path: Medication.package.content.itemCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="package-item-code", path="Medication.package.content.item.as(CodeableConcept)", description="The item in the package", type="token" ) + public static final String SP_PACKAGE_ITEM_CODE = "package-item-code"; + /** + * Fluent Client search parameter constant for package-item-code + *

+ * Description: The item in the package
+ * Type: token
+ * Path: Medication.package.content.itemCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PACKAGE_ITEM_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PACKAGE_ITEM_CODE); + + /** + * Search parameter: ingredient + *

+ * Description: The product contained
+ * Type: reference
+ * Path: Medication.product.ingredient.itemReference
+ *

+ */ + @SearchParamDefinition(name="ingredient", path="Medication.product.ingredient.item.as(Reference)", description="The product contained", type="reference" ) + public static final String SP_INGREDIENT = "ingredient"; + /** + * Fluent Client search parameter constant for ingredient + *

+ * Description: The product contained
+ * Type: reference
+ * Path: Medication.product.ingredient.itemReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INGREDIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INGREDIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Medication:ingredient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INGREDIENT = new ca.uhn.fhir.model.api.Include("Medication:ingredient").toLocked(); + + /** + * Search parameter: package-item + *

+ * Description: The item in the package
+ * Type: reference
+ * Path: Medication.package.content.itemReference
+ *

+ */ + @SearchParamDefinition(name="package-item", path="Medication.package.content.item.as(Reference)", description="The item in the package", type="reference" ) + public static final String SP_PACKAGE_ITEM = "package-item"; + /** + * Fluent Client search parameter constant for package-item + *

+ * Description: The item in the package
+ * Type: reference
+ * Path: Medication.package.content.itemReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PACKAGE_ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PACKAGE_ITEM); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Medication:package-item". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PACKAGE_ITEM = new ca.uhn.fhir.model.api.Include("Medication:package-item").toLocked(); + + /** + * Search parameter: code + *

+ * Description: Codes that identify this medication
+ * Type: token
+ * Path: Medication.code
+ *

+ */ + @SearchParamDefinition(name="code", path="Medication.code", description="Codes that identify this medication", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Codes that identify this medication
+ * Type: token
+ * Path: Medication.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: ingredient-code + *

+ * Description: The product contained
+ * Type: token
+ * Path: Medication.product.ingredient.itemCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="ingredient-code", path="Medication.product.ingredient.item.as(CodeableConcept)", description="The product contained", type="token" ) + public static final String SP_INGREDIENT_CODE = "ingredient-code"; + /** + * Fluent Client search parameter constant for ingredient-code + *

+ * Description: The product contained
+ * Type: token
+ * Path: Medication.product.ingredient.itemCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam INGREDIENT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INGREDIENT_CODE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationAdministration.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationAdministration.java new file mode 100644 index 00000000000..e09b4107802 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationAdministration.java @@ -0,0 +1,1911 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + */ +@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/Profile/MedicationAdministration") +public class MedicationAdministration extends DomainResource { + + public enum MedicationAdministrationStatus { + /** + * The administration has started but has not yet completed. + */ + INPROGRESS, + /** + * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the administration have occurred. + */ + COMPLETED, + /** + * The administration was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * Actions implied by the administration have been permanently halted, before all of them occurred. + */ + STOPPED, + /** + * added to help the parsers + */ + NULL; + public static MedicationAdministrationStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + throw new FHIRException("Unknown MedicationAdministrationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + case STOPPED: return "stopped"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return "http://hl7.org/fhir/medication-admin-status"; + case ONHOLD: return "http://hl7.org/fhir/medication-admin-status"; + case COMPLETED: return "http://hl7.org/fhir/medication-admin-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/medication-admin-status"; + case STOPPED: return "http://hl7.org/fhir/medication-admin-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The administration has started but has not yet completed."; + case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called \"suspended\"."; + case COMPLETED: return "All actions that are implied by the administration have occurred."; + case ENTEREDINERROR: return "The administration was entered in error and therefore nullified."; + case STOPPED: return "Actions implied by the administration have been permanently halted, before all of them occurred."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case ONHOLD: return "On Hold"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in Error"; + case STOPPED: return "Stopped"; + default: return "?"; + } + } + } + + public static class MedicationAdministrationStatusEnumFactory implements EnumFactory { + public MedicationAdministrationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return MedicationAdministrationStatus.INPROGRESS; + if ("on-hold".equals(codeString)) + return MedicationAdministrationStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationAdministrationStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return MedicationAdministrationStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationAdministrationStatus.STOPPED; + throw new IllegalArgumentException("Unknown MedicationAdministrationStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return new Enumeration(this, MedicationAdministrationStatus.INPROGRESS); + if ("on-hold".equals(codeString)) + return new Enumeration(this, MedicationAdministrationStatus.ONHOLD); + if ("completed".equals(codeString)) + return new Enumeration(this, MedicationAdministrationStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, MedicationAdministrationStatus.ENTEREDINERROR); + if ("stopped".equals(codeString)) + return new Enumeration(this, MedicationAdministrationStatus.STOPPED); + throw new FHIRException("Unknown MedicationAdministrationStatus code '"+codeString+"'"); + } + public String toCode(MedicationAdministrationStatus code) { + if (code == MedicationAdministrationStatus.INPROGRESS) + return "in-progress"; + if (code == MedicationAdministrationStatus.ONHOLD) + return "on-hold"; + if (code == MedicationAdministrationStatus.COMPLETED) + return "completed"; + if (code == MedicationAdministrationStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == MedicationAdministrationStatus.STOPPED) + return "stopped"; + return "?"; + } + public String toSystem(MedicationAdministrationStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class MedicationAdministrationDosageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Free text dosage instructions e.g. SIG", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) + protected StringType text; + + /** + * A coded specification of the anatomic site where the medication first entered the body. For example, "left arm". + */ + @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Body site administered to", formalDefinition="A coded specification of the anatomic site where the medication first entered the body. For example, \"left arm\"." ) + protected Type site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Path of substance into body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc." ) + protected CodeableConcept route; + + /** + * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How drug was administered", formalDefinition="A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV." ) + protected CodeableConcept method; + + /** + * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection." ) + protected SimpleQuantity quantity; + + /** + * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. + */ + @Child(name = "rate", type = {Ratio.class, Range.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) + protected Type rate; + + private static final long serialVersionUID = -1772198879L; + + /** + * Constructor + */ + public MedicationAdministrationDosageComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationAdministrationDosageComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public MedicationAdministrationDosageComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) + */ + public Type getSite() { + return this.site; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) + */ + public CodeableConcept getSiteCodeableConcept() throws FHIRException { + if (!(this.site instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); + return (CodeableConcept) this.site; + } + + public boolean hasSiteCodeableConcept() { + return this.site instanceof CodeableConcept; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) + */ + public Reference getSiteReference() throws FHIRException { + if (!(this.site instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); + return (Reference) this.site; + } + + public boolean hasSiteReference() { + return this.site instanceof Reference; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) + */ + public MedicationAdministrationDosageComponent setSite(Type value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc.) + */ + public MedicationAdministrationDosageComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.) + */ + public MedicationAdministrationDosageComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) + */ + public MedicationAdministrationDosageComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Type getRate() { + return this.rate; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Ratio getRateRatio() throws FHIRException { + if (!(this.rate instanceof Ratio)) + throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Ratio) this.rate; + } + + public boolean hasRateRatio() { + return this.rate instanceof Ratio; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Range getRateRange() throws FHIRException { + if (!(this.rate instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Range) this.rate; + } + + public boolean hasRateRange() { + return this.rate instanceof Range; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public MedicationAdministrationDosageComponent setRate(Type value) { + this.rate = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of the anatomic site where the medication first entered the body. For example, \"left arm\".", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate[x]", "Ratio|Range", "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type + case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3556653: // text + this.text = castToString(value); // StringType + break; + case 3530567: // site + this.site = (Type) value; // Type + break; + case 108704329: // route + this.route = castToCodeableConcept(value); // CodeableConcept + break; + case -1077554975: // method + this.method = castToCodeableConcept(value); // CodeableConcept + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case 3493088: // rate + this.rate = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("site[x]")) + this.site = (Type) value; // Type + else if (name.equals("route")) + this.route = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("method")) + this.method = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("rate[x]")) + this.rate = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case 2099997657: return getSite(); // Type + case 108704329: return getRoute(); // CodeableConcept + case -1077554975: return getMethod(); // CodeableConcept + case -1285004149: return getQuantity(); // SimpleQuantity + case 983460768: return getRate(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.text"); + } + else if (name.equals("siteCodeableConcept")) { + this.site = new CodeableConcept(); + return this.site; + } + else if (name.equals("siteReference")) { + this.site = new Reference(); + return this.site; + } + else if (name.equals("route")) { + this.route = new CodeableConcept(); + return this.route; + } + else if (name.equals("method")) { + this.method = new CodeableConcept(); + return this.method; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("rateRatio")) { + this.rate = new Ratio(); + return this.rate; + } + else if (name.equals("rateRange")) { + this.rate = new Range(); + return this.rate; + } + else + return super.addChild(name); + } + + public MedicationAdministrationDosageComponent copy() { + MedicationAdministrationDosageComponent dst = new MedicationAdministrationDosageComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationAdministrationDosageComponent)) + return false; + MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other; + return compareDeep(text, o.text, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) + && compareDeep(method, o.method, true) && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationAdministrationDosageComponent)) + return false; + MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (site == null || site.isEmpty()) + && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (rate == null || rate.isEmpty()); + } + + public String fhirType() { + return "MedicationAdministration.dosage"; + + } + + } + + /** + * External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External identifier", formalDefinition="External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) + protected List identifier; + + /** + * Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way." ) + protected Enumeration status; + + /** + * Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What was administered", formalDefinition="Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * The person or animal receiving the medication. + */ + @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who received medication", formalDefinition="The person or animal receiving the medication." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person or animal receiving the medication.) + */ + protected Patient patientTarget; + + /** + * The visit, admission or other contact between patient and health care provider the medication administration was performed as part of. + */ + @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit, admission or other contact between patient and health care provider the medication administration was performed as part of." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) + */ + protected Encounter encounterTarget; + + /** + * A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. + */ + @Child(name = "effectiveTime", type = {DateTimeType.class, Period.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Start and end time of administration", formalDefinition="A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate." ) + protected Type effectiveTime; + + /** + * The individual who was responsible for giving the medication to the patient. + */ + @Child(name = "practitioner", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who administered substance", formalDefinition="The individual who was responsible for giving the medication to the patient." ) + protected Reference practitioner; + + /** + * The actual object that is the target of the reference (The individual who was responsible for giving the medication to the patient.) + */ + protected Resource practitionerTarget; + + /** + * The original request, instruction or authority to perform the administration. + */ + @Child(name = "prescription", type = {MedicationOrder.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Order administration performed against", formalDefinition="The original request, instruction or authority to perform the administration." ) + protected Reference prescription; + + /** + * The actual object that is the target of the reference (The original request, instruction or authority to perform the administration.) + */ + protected MedicationOrder prescriptionTarget; + + /** + * Set this to true if the record is saying that the medication was NOT administered. + */ + @Child(name = "wasNotGiven", type = {BooleanType.class}, order=8, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="True if medication not administered", formalDefinition="Set this to true if the record is saying that the medication was NOT administered." ) + protected BooleanType wasNotGiven; + + /** + * A code indicating why the administration was not performed. + */ + @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Reason administration not performed", formalDefinition="A code indicating why the administration was not performed." ) + protected List reasonNotGiven; + + /** + * A code indicating why the medication was given. + */ + @Child(name = "reasonGiven", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Reason administration performed", formalDefinition="A code indicating why the medication was given." ) + protected List reasonGiven; + + /** + * The device used in administering the medication to the patient. For example, a particular infusion pump. + */ + @Child(name = "device", type = {Device.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Device used to administer", formalDefinition="The device used in administering the medication to the patient. For example, a particular infusion pump." ) + protected List device; + /** + * The actual objects that are the target of the reference (The device used in administering the medication to the patient. For example, a particular infusion pump.) + */ + protected List deviceTarget; + + + /** + * Extra information about the medication administration that is not conveyed by the other attributes. + */ + @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Information about the administration", formalDefinition="Extra information about the medication administration that is not conveyed by the other attributes." ) + protected List note; + + /** + * Describes the medication dosage information details e.g. dose, rate, site, route, etc. + */ + @Child(name = "dosage", type = {}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Details of how medication was taken", formalDefinition="Describes the medication dosage information details e.g. dose, rate, site, route, etc." ) + protected MedicationAdministrationDosageComponent dosage; + + private static final long serialVersionUID = 1357790003L; + + /** + * Constructor + */ + public MedicationAdministration() { + super(); + } + + /** + * Constructor + */ + public MedicationAdministration(Enumeration status, Type medication, Reference patient, Type effectiveTime) { + super(); + this.status = status; + this.medication = medication; + this.patient = patient; + this.effectiveTime = effectiveTime; + } + + /** + * @return {@link #identifier} (External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + 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} (External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). 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 MedicationAdministration.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MedicationAdministrationStatusEnumFactory()); // bb + 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} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationAdministration setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + public MedicationAdministrationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + public MedicationAdministration setStatus(MedicationAdministrationStatus value) { + if (this.status == null) + this.status = new Enumeration(new MedicationAdministrationStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws FHIRException { + if (!(this.medication instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + public boolean hasMedicationCodeableConcept() { + return this.medication instanceof CodeableConcept; + } + + /** + * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws FHIRException { + if (!(this.medication instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedicationReference() { + return this.medication instanceof Reference; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationAdministration setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #patient} (The person or animal receiving the medication.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person or animal receiving the medication.) + */ + public MedicationAdministration 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 person or animal receiving the medication.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 person or animal receiving the medication.) + */ + public MedicationAdministration setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public MedicationAdministration 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 visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public MedicationAdministration setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + */ + public Type getEffectiveTime() { + return this.effectiveTime; + } + + /** + * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + */ + public DateTimeType getEffectiveTimeDateTimeType() throws FHIRException { + if (!(this.effectiveTime instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); + return (DateTimeType) this.effectiveTime; + } + + public boolean hasEffectiveTimeDateTimeType() { + return this.effectiveTime instanceof DateTimeType; + } + + /** + * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + */ + public Period getEffectiveTimePeriod() throws FHIRException { + if (!(this.effectiveTime instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); + return (Period) this.effectiveTime; + } + + public boolean hasEffectiveTimePeriod() { + return this.effectiveTime instanceof Period; + } + + public boolean hasEffectiveTime() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + /** + * @param value {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + */ + public MedicationAdministration setEffectiveTime(Type value) { + this.effectiveTime = value; + return this; + } + + /** + * @return {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) + */ + public Reference getPractitioner() { + if (this.practitioner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); + else if (Configuration.doAutoCreate()) + this.practitioner = new Reference(); // cc + return this.practitioner; + } + + public boolean hasPractitioner() { + return this.practitioner != null && !this.practitioner.isEmpty(); + } + + /** + * @param value {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) + */ + public MedicationAdministration setPractitioner(Reference value) { + this.practitioner = value; + return this; + } + + /** + * @return {@link #practitioner} 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 individual who was responsible for giving the medication to the patient.) + */ + public Resource getPractitionerTarget() { + return this.practitionerTarget; + } + + /** + * @param value {@link #practitioner} 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 individual who was responsible for giving the medication to the patient.) + */ + public MedicationAdministration setPractitionerTarget(Resource value) { + this.practitionerTarget = value; + return this; + } + + /** + * @return {@link #prescription} (The original request, instruction or authority to perform the administration.) + */ + public Reference getPrescription() { + if (this.prescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.prescription"); + else if (Configuration.doAutoCreate()) + this.prescription = new Reference(); // cc + return this.prescription; + } + + public boolean hasPrescription() { + return this.prescription != null && !this.prescription.isEmpty(); + } + + /** + * @param value {@link #prescription} (The original request, instruction or authority to perform the administration.) + */ + public MedicationAdministration 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. (The original request, instruction or authority to perform the administration.) + */ + public MedicationOrder getPrescriptionTarget() { + if (this.prescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.prescription"); + else if (Configuration.doAutoCreate()) + this.prescriptionTarget = new MedicationOrder(); // aa + 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. (The original request, instruction or authority to perform the administration.) + */ + public MedicationAdministration setPrescriptionTarget(MedicationOrder value) { + this.prescriptionTarget = value; + return this; + } + + /** + * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public BooleanType getWasNotGivenElement() { + if (this.wasNotGiven == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.wasNotGiven"); + else if (Configuration.doAutoCreate()) + this.wasNotGiven = new BooleanType(); // bb + return this.wasNotGiven; + } + + public boolean hasWasNotGivenElement() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + public boolean hasWasNotGiven() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + /** + * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public MedicationAdministration setWasNotGivenElement(BooleanType value) { + this.wasNotGiven = value; + return this; + } + + /** + * @return Set this to true if the record is saying that the medication was NOT administered. + */ + public boolean getWasNotGiven() { + return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); + } + + /** + * @param value Set this to true if the record is saying that the medication was NOT administered. + */ + public MedicationAdministration setWasNotGiven(boolean value) { + if (this.wasNotGiven == null) + this.wasNotGiven = new BooleanType(); + this.wasNotGiven.setValue(value); + return this; + } + + /** + * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) + */ + public List getReasonNotGiven() { + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + return this.reasonNotGiven; + } + + public boolean hasReasonNotGiven() { + if (this.reasonNotGiven == null) + return false; + for (CodeableConcept item : this.reasonNotGiven) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) + */ + // syntactic sugar + public CodeableConcept addReasonNotGiven() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addReasonNotGiven(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return this; + } + + /** + * @return {@link #reasonGiven} (A code indicating why the medication was given.) + */ + public List getReasonGiven() { + if (this.reasonGiven == null) + this.reasonGiven = new ArrayList(); + return this.reasonGiven; + } + + public boolean hasReasonGiven() { + if (this.reasonGiven == null) + return false; + for (CodeableConcept item : this.reasonGiven) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonGiven} (A code indicating why the medication was given.) + */ + // syntactic sugar + public CodeableConcept addReasonGiven() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonGiven == null) + this.reasonGiven = new ArrayList(); + this.reasonGiven.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addReasonGiven(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonGiven == null) + this.reasonGiven = new ArrayList(); + this.reasonGiven.add(t); + return this; + } + + /** + * @return {@link #device} (The device used in administering the medication to the patient. For example, a particular infusion pump.) + */ + public List getDevice() { + if (this.device == null) + this.device = new ArrayList(); + return this.device; + } + + public boolean hasDevice() { + if (this.device == null) + return false; + for (Reference item : this.device) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #device} (The device used in administering the medication to the patient. For example, a particular infusion pump.) + */ + // syntactic sugar + public Reference addDevice() { //3 + Reference t = new Reference(); + if (this.device == null) + this.device = new ArrayList(); + this.device.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addDevice(Reference t) { //3 + if (t == null) + return this; + if (this.device == null) + this.device = new ArrayList(); + this.device.add(t); + return this; + } + + /** + * @return {@link #device} (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 device used in administering the medication to the patient. For example, a particular infusion pump.) + */ + public List getDeviceTarget() { + if (this.deviceTarget == null) + this.deviceTarget = new ArrayList(); + return this.deviceTarget; + } + + // syntactic sugar + /** + * @return {@link #device} (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 device used in administering the medication to the patient. For example, a particular infusion pump.) + */ + public Device addDeviceTarget() { + Device r = new Device(); + if (this.deviceTarget == null) + this.deviceTarget = new ArrayList(); + this.deviceTarget.add(r); + return r; + } + + /** + * @return {@link #note} (Extra information about the medication administration that is not conveyed by the other attributes.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Extra information about the medication administration that is not conveyed by the other attributes.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public MedicationAdministration addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #dosage} (Describes the medication dosage information details e.g. dose, rate, site, route, etc.) + */ + public MedicationAdministrationDosageComponent getDosage() { + if (this.dosage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.dosage"); + else if (Configuration.doAutoCreate()) + this.dosage = new MedicationAdministrationDosageComponent(); // cc + return this.dosage; + } + + public boolean hasDosage() { + return this.dosage != null && !this.dosage.isEmpty(); + } + + /** + * @param value {@link #dosage} (Describes the medication dosage information details e.g. dose, rate, site, route, etc.) + */ + public MedicationAdministration setDosage(MedicationAdministrationDosageComponent value) { + this.dosage = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal receiving the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("effectiveTime[x]", "dateTime|Period", "A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); + childrenList.add(new Property("practitioner", "Reference(Practitioner|Patient|RelatedPerson)", "The individual who was responsible for giving the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, practitioner)); + childrenList.add(new Property("prescription", "Reference(MedicationOrder)", "The original request, instruction or authority to perform the administration.", 0, java.lang.Integer.MAX_VALUE, prescription)); + childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT administered.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); + childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); + childrenList.add(new Property("reasonGiven", "CodeableConcept", "A code indicating why the medication was given.", 0, java.lang.Integer.MAX_VALUE, reasonGiven)); + childrenList.add(new Property("device", "Reference(Device)", "The device used in administering the medication to the patient. For example, a particular infusion pump.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("note", "Annotation", "Extra information about the medication administration that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("dosage", "", "Describes the medication dosage information details e.g. dose, rate, site, route, etc.", 0, java.lang.Integer.MAX_VALUE, dosage)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // Type + case 574573338: /*practitioner*/ return this.practitioner == null ? new Base[0] : new Base[] {this.practitioner}; // Reference + case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Reference + case -1050911117: /*wasNotGiven*/ return this.wasNotGiven == null ? new Base[0] : new Base[] {this.wasNotGiven}; // BooleanType + case 2101123790: /*reasonNotGiven*/ return this.reasonNotGiven == null ? new Base[0] : this.reasonNotGiven.toArray(new Base[this.reasonNotGiven.size()]); // CodeableConcept + case 914964377: /*reasonGiven*/ return this.reasonGiven == null ? new Base[0] : this.reasonGiven.toArray(new Base[this.reasonGiven.size()]); // CodeableConcept + case -1335157162: /*device*/ return this.device == null ? new Base[0] : this.device.toArray(new Base[this.device.size()]); // Reference + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case -1326018889: /*dosage*/ return this.dosage == null ? new Base[0] : new Base[] {this.dosage}; // MedicationAdministrationDosageComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new MedicationAdministrationStatusEnumFactory().fromType(value); // Enumeration + break; + case 1998965455: // medication + this.medication = (Type) value; // Type + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -929905388: // effectiveTime + this.effectiveTime = (Type) value; // Type + break; + case 574573338: // practitioner + this.practitioner = castToReference(value); // Reference + break; + case 460301338: // prescription + this.prescription = castToReference(value); // Reference + break; + case -1050911117: // wasNotGiven + this.wasNotGiven = castToBoolean(value); // BooleanType + break; + case 2101123790: // reasonNotGiven + this.getReasonNotGiven().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 914964377: // reasonGiven + this.getReasonGiven().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1335157162: // device + this.getDevice().add(castToReference(value)); // Reference + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case -1326018889: // dosage + this.dosage = (MedicationAdministrationDosageComponent) value; // MedicationAdministrationDosageComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new MedicationAdministrationStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("medication[x]")) + this.medication = (Type) value; // Type + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("effectiveTime[x]")) + this.effectiveTime = (Type) value; // Type + else if (name.equals("practitioner")) + this.practitioner = castToReference(value); // Reference + else if (name.equals("prescription")) + this.prescription = castToReference(value); // Reference + else if (name.equals("wasNotGiven")) + this.wasNotGiven = castToBoolean(value); // BooleanType + else if (name.equals("reasonNotGiven")) + this.getReasonNotGiven().add(castToCodeableConcept(value)); + else if (name.equals("reasonGiven")) + this.getReasonGiven().add(castToCodeableConcept(value)); + else if (name.equals("device")) + this.getDevice().add(castToReference(value)); + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("dosage")) + this.dosage = (MedicationAdministrationDosageComponent) value; // MedicationAdministrationDosageComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1458402129: return getMedication(); // Type + case -791418107: return getPatient(); // Reference + case 1524132147: return getEncounter(); // Reference + case -272263444: return getEffectiveTime(); // Type + case 574573338: return getPractitioner(); // Reference + case 460301338: return getPrescription(); // Reference + case -1050911117: throw new FHIRException("Cannot make property wasNotGiven as it is not a complex type"); // BooleanType + case 2101123790: return addReasonNotGiven(); // CodeableConcept + case 914964377: return addReasonGiven(); // CodeableConcept + case -1335157162: return addDevice(); // Reference + case 3387378: return addNote(); // Annotation + case -1326018889: return getDosage(); // MedicationAdministrationDosageComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.status"); + } + else if (name.equals("medicationCodeableConcept")) { + this.medication = new CodeableConcept(); + return this.medication; + } + else if (name.equals("medicationReference")) { + this.medication = new Reference(); + return this.medication; + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("effectiveTimeDateTime")) { + this.effectiveTime = new DateTimeType(); + return this.effectiveTime; + } + else if (name.equals("effectiveTimePeriod")) { + this.effectiveTime = new Period(); + return this.effectiveTime; + } + else if (name.equals("practitioner")) { + this.practitioner = new Reference(); + return this.practitioner; + } + else if (name.equals("prescription")) { + this.prescription = new Reference(); + return this.prescription; + } + else if (name.equals("wasNotGiven")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.wasNotGiven"); + } + else if (name.equals("reasonNotGiven")) { + return addReasonNotGiven(); + } + else if (name.equals("reasonGiven")) { + return addReasonGiven(); + } + else if (name.equals("device")) { + return addDevice(); + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("dosage")) { + this.dosage = new MedicationAdministrationDosageComponent(); + return this.dosage; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "MedicationAdministration"; + + } + + public MedicationAdministration copy() { + MedicationAdministration dst = new MedicationAdministration(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.medication = medication == null ? null : medication.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); + dst.practitioner = practitioner == null ? null : practitioner.copy(); + dst.prescription = prescription == null ? null : prescription.copy(); + dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); + if (reasonNotGiven != null) { + dst.reasonNotGiven = new ArrayList(); + for (CodeableConcept i : reasonNotGiven) + dst.reasonNotGiven.add(i.copy()); + }; + if (reasonGiven != null) { + dst.reasonGiven = new ArrayList(); + for (CodeableConcept i : reasonGiven) + dst.reasonGiven.add(i.copy()); + }; + if (device != null) { + dst.device = new ArrayList(); + for (Reference i : device) + dst.device.add(i.copy()); + }; + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + dst.dosage = dosage == null ? null : dosage.copy(); + return dst; + } + + protected MedicationAdministration typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationAdministration)) + return false; + MedicationAdministration o = (MedicationAdministration) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) + && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) && compareDeep(effectiveTime, o.effectiveTime, true) + && compareDeep(practitioner, o.practitioner, true) && compareDeep(prescription, o.prescription, true) + && compareDeep(wasNotGiven, o.wasNotGiven, true) && compareDeep(reasonNotGiven, o.reasonNotGiven, true) + && compareDeep(reasonGiven, o.reasonGiven, true) && compareDeep(device, o.device, true) && compareDeep(note, o.note, true) + && compareDeep(dosage, o.dosage, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationAdministration)) + return false; + MedicationAdministration o = (MedicationAdministration) other; + return compareValues(status, o.status, true) && compareValues(wasNotGiven, o.wasNotGiven, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (medication == null || medication.isEmpty()) && (patient == null || patient.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (effectiveTime == null || effectiveTime.isEmpty()) + && (practitioner == null || practitioner.isEmpty()) && (prescription == null || prescription.isEmpty()) + && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) + && (reasonGiven == null || reasonGiven.isEmpty()) && (device == null || device.isEmpty()) + && (note == null || note.isEmpty()) && (dosage == null || dosage.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationAdministration; + } + + /** + * Search parameter: medication + *

+ * Description: Return administrations of this medication resource
+ * Type: reference
+ * Path: MedicationAdministration.medicationReference
+ *

+ */ + @SearchParamDefinition(name="medication", path="MedicationAdministration.medication.as(Reference)", description="Return administrations of this medication resource", type="reference" ) + public static final String SP_MEDICATION = "medication"; + /** + * Fluent Client search parameter constant for medication + *

+ * Description: Return administrations of this medication resource
+ * Type: reference
+ * Path: MedicationAdministration.medicationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationAdministration:medication". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationAdministration:medication").toLocked(); + + /** + * Search parameter: effectivetime + *

+ * Description: Date administration happened (or did not happen)
+ * Type: date
+ * Path: MedicationAdministration.effectiveTime[x]
+ *

+ */ + @SearchParamDefinition(name="effectivetime", path="MedicationAdministration.effectiveTime", description="Date administration happened (or did not happen)", type="date" ) + public static final String SP_EFFECTIVETIME = "effectivetime"; + /** + * Fluent Client search parameter constant for effectivetime + *

+ * Description: Date administration happened (or did not happen)
+ * Type: date
+ * Path: MedicationAdministration.effectiveTime[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVETIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVETIME); + + /** + * Search parameter: patient + *

+ * Description: The identity of a patient to list administrations for
+ * Type: reference
+ * Path: MedicationAdministration.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="MedicationAdministration.patient", description="The identity of a patient to list administrations for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of a patient to list administrations for
+ * Type: reference
+ * Path: MedicationAdministration.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationAdministration:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationAdministration:patient").toLocked(); + + /** + * Search parameter: practitioner + *

+ * Description: Who administered substance
+ * Type: reference
+ * Path: MedicationAdministration.practitioner
+ *

+ */ + @SearchParamDefinition(name="practitioner", path="MedicationAdministration.practitioner", description="Who administered substance", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + /** + * Fluent Client search parameter constant for practitioner + *

+ * Description: Who administered substance
+ * Type: reference
+ * Path: MedicationAdministration.practitioner
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationAdministration:practitioner". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("MedicationAdministration:practitioner").toLocked(); + + /** + * Search parameter: status + *

+ * Description: MedicationAdministration event status (for example one of active/paused/completed/nullified)
+ * Type: token
+ * Path: MedicationAdministration.status
+ *

+ */ + @SearchParamDefinition(name="status", path="MedicationAdministration.status", description="MedicationAdministration event status (for example one of active/paused/completed/nullified)", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: MedicationAdministration event status (for example one of active/paused/completed/nullified)
+ * Type: token
+ * Path: MedicationAdministration.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: prescription + *

+ * Description: The identity of a prescription to list administrations from
+ * Type: reference
+ * Path: MedicationAdministration.prescription
+ *

+ */ + @SearchParamDefinition(name="prescription", path="MedicationAdministration.prescription", description="The identity of a prescription to list administrations from", type="reference" ) + public static final String SP_PRESCRIPTION = "prescription"; + /** + * Fluent Client search parameter constant for prescription + *

+ * Description: The identity of a prescription to list administrations from
+ * Type: reference
+ * Path: MedicationAdministration.prescription
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIPTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIPTION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationAdministration:prescription". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIPTION = new ca.uhn.fhir.model.api.Include("MedicationAdministration:prescription").toLocked(); + + /** + * Search parameter: device + *

+ * Description: Return administrations with this administration device identity
+ * Type: reference
+ * Path: MedicationAdministration.device
+ *

+ */ + @SearchParamDefinition(name="device", path="MedicationAdministration.device", description="Return administrations with this administration device identity", type="reference" ) + public static final String SP_DEVICE = "device"; + /** + * Fluent Client search parameter constant for device + *

+ * Description: Return administrations with this administration device identity
+ * Type: reference
+ * Path: MedicationAdministration.device
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationAdministration:device". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("MedicationAdministration:device").toLocked(); + + /** + * Search parameter: code + *

+ * Description: Return administrations of this medication code
+ * Type: token
+ * Path: MedicationAdministration.medicationCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="code", path="MedicationAdministration.medication.as(CodeableConcept)", description="Return administrations of this medication code", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Return administrations of this medication code
+ * Type: token
+ * Path: MedicationAdministration.medicationCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: encounter + *

+ * Description: Return administrations that share this encounter
+ * Type: reference
+ * Path: MedicationAdministration.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="MedicationAdministration.encounter", description="Return administrations that share this encounter", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Return administrations that share this encounter
+ * Type: reference
+ * Path: MedicationAdministration.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationAdministration:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("MedicationAdministration:encounter").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Return administrations with this external identifier
+ * Type: token
+ * Path: MedicationAdministration.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="MedicationAdministration.identifier", description="Return administrations with this external identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Return administrations with this external identifier
+ * Type: token
+ * Path: MedicationAdministration.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: wasnotgiven + *

+ * Description: Administrations that were not made
+ * Type: token
+ * Path: MedicationAdministration.wasNotGiven
+ *

+ */ + @SearchParamDefinition(name="wasnotgiven", path="MedicationAdministration.wasNotGiven", description="Administrations that were not made", type="token" ) + public static final String SP_WASNOTGIVEN = "wasnotgiven"; + /** + * Fluent Client search parameter constant for wasnotgiven + *

+ * Description: Administrations that were not made
+ * Type: token
+ * Path: MedicationAdministration.wasNotGiven
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam WASNOTGIVEN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_WASNOTGIVEN); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationDispense.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationDispense.java new file mode 100644 index 00000000000..59fcec37eea --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationDispense.java @@ -0,0 +1,2561 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. + */ +@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/Profile/MedicationDispense") +public class MedicationDispense extends DomainResource { + + public enum MedicationDispenseStatus { + /** + * The dispense has started but has not yet completed. + */ + INPROGRESS, + /** + * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended" + */ + ONHOLD, + /** + * All actions that are implied by the dispense have occurred. + */ + COMPLETED, + /** + * The dispense was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * Actions implied by the dispense have been permanently halted, before all of them occurred. + */ + STOPPED, + /** + * added to help the parsers + */ + NULL; + public static MedicationDispenseStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + throw new FHIRException("Unknown MedicationDispenseStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + case STOPPED: return "stopped"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return "http://hl7.org/fhir/medication-dispense-status"; + case ONHOLD: return "http://hl7.org/fhir/medication-dispense-status"; + case COMPLETED: return "http://hl7.org/fhir/medication-dispense-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/medication-dispense-status"; + case STOPPED: return "http://hl7.org/fhir/medication-dispense-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The dispense has started but has not yet completed."; + case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called \"suspended\""; + case COMPLETED: return "All actions that are implied by the dispense have occurred."; + case ENTEREDINERROR: return "The dispense was entered in error and therefore nullified."; + case STOPPED: return "Actions implied by the dispense have been permanently halted, before all of them occurred."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case ONHOLD: return "On Hold"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in-Error"; + case STOPPED: return "Stopped"; + default: return "?"; + } + } + } + + 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; + if ("in-progress".equals(codeString)) + return MedicationDispenseStatus.INPROGRESS; + if ("on-hold".equals(codeString)) + return MedicationDispenseStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationDispenseStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return MedicationDispenseStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationDispenseStatus.STOPPED; + throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return new Enumeration(this, MedicationDispenseStatus.INPROGRESS); + if ("on-hold".equals(codeString)) + return new Enumeration(this, MedicationDispenseStatus.ONHOLD); + if ("completed".equals(codeString)) + return new Enumeration(this, MedicationDispenseStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, MedicationDispenseStatus.ENTEREDINERROR); + if ("stopped".equals(codeString)) + return new Enumeration(this, MedicationDispenseStatus.STOPPED); + throw new FHIRException("Unknown MedicationDispenseStatus code '"+codeString+"'"); + } + public String toCode(MedicationDispenseStatus code) { + if (code == MedicationDispenseStatus.INPROGRESS) + return "in-progress"; + if (code == MedicationDispenseStatus.ONHOLD) + return "on-hold"; + if (code == MedicationDispenseStatus.COMPLETED) + return "completed"; + if (code == MedicationDispenseStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == MedicationDispenseStatus.STOPPED) + return "stopped"; + return "?"; + } + public String toSystem(MedicationDispenseStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class MedicationDispenseDosageInstructionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Free text dosage instructions e.g. SIG", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) + protected StringType text; + + /** + * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. + */ + @Child(name = "additionalInstructions", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="E.g. \"Take with food\"", formalDefinition="Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded." ) + protected CodeableConcept additionalInstructions; + + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example, "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "timing", type = {Timing.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example, \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"." ) + protected Timing timing; + + /** + * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule. + */ + @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Take \"as needed\" f(or x)", formalDefinition="Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). \n\nSpecifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first enters the body. + */ + @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) + protected Type site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) + protected CodeableConcept route; + + /** + * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is intended to be or was introduced into or on the body." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name = "dose", type = {Range.class, SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Type dose; + + /** + * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. + */ + @Child(name = "rate", type = {Ratio.class, Range.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) + protected Type rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. + */ + @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = -1470136646L; + + /** + * Constructor + */ + public MedicationDispenseDosageInstructionComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationDispenseDosageInstructionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + */ + public MedicationDispenseDosageInstructionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public CodeableConcept getAdditionalInstructions() { + if (this.additionalInstructions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.additionalInstructions"); + else if (Configuration.doAutoCreate()) + this.additionalInstructions = new CodeableConcept(); // cc + return this.additionalInstructions; + } + + public boolean hasAdditionalInstructions() { + return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); + } + + /** + * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public MedicationDispenseDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { + this.additionalInstructions = value; + return this; + } + + /** + * @return {@link #timing} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example, "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getTiming() { + if (this.timing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.timing"); + else if (Configuration.doAutoCreate()) + this.timing = new Timing(); // cc + return this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example, "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationDispenseDosageInstructionComponent setTiming(Timing value) { + this.timing = value; + return this; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) + */ + public BooleanType getAsNeededBooleanType() throws FHIRException { + if (!(this.asNeeded instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + public boolean hasAsNeededBooleanType() { + return this.asNeeded instanceof BooleanType; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeededCodeableConcept() { + return this.asNeeded instanceof CodeableConcept; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) + */ + public MedicationDispenseDosageInstructionComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public Type getSite() { + return this.site; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSiteCodeableConcept() throws FHIRException { + if (!(this.site instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); + return (CodeableConcept) this.site; + } + + public boolean hasSiteCodeableConcept() { + return this.site instanceof CodeableConcept; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public Reference getSiteReference() throws FHIRException { + if (!(this.site instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); + return (Reference) this.site; + } + + public boolean hasSiteReference() { + return this.site instanceof Reference; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public MedicationDispenseDosageInstructionComponent setSite(Type value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public MedicationDispenseDosageInstructionComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.) + */ + public MedicationDispenseDosageInstructionComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Type getDose() { + return this.dose; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Range getDoseRange() throws FHIRException { + if (!(this.dose instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.dose.getClass().getName()+" was encountered"); + return (Range) this.dose; + } + + public boolean hasDoseRange() { + return this.dose instanceof Range; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public SimpleQuantity getDoseSimpleQuantity() throws FHIRException { + if (!(this.dose instanceof SimpleQuantity)) + throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.dose.getClass().getName()+" was encountered"); + return (SimpleQuantity) this.dose; + } + + public boolean hasDoseSimpleQuantity() { + return this.dose instanceof SimpleQuantity; + } + + public boolean hasDose() { + return this.dose != null && !this.dose.isEmpty(); + } + + /** + * @param value {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationDispenseDosageInstructionComponent setDose(Type value) { + this.dose = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Type getRate() { + return this.rate; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Ratio getRateRatio() throws FHIRException { + if (!(this.rate instanceof Ratio)) + throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Ratio) this.rate; + } + + public boolean hasRateRatio() { + return this.rate instanceof Ratio; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Range getRateRange() throws FHIRException { + if (!(this.rate instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Range) this.rate; + } + + public boolean hasRateRange() { + return this.rate instanceof Range; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public MedicationDispenseDosageInstructionComponent setRate(Type value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); // cc + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) + */ + public MedicationDispenseDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); + childrenList.add(new Property("timing", "Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example, \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). \n\nSpecifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("dose[x]", "Range|SimpleQuantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, dose)); + childrenList.add(new Property("rate[x]", "Ratio|Range", "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + case -1206718612: /*additionalInstructions*/ return this.additionalInstructions == null ? new Base[0] : new Base[] {this.additionalInstructions}; // CodeableConcept + case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Timing + case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type + case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type + case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept + case 3089437: /*dose*/ return this.dose == null ? new Base[0] : new Base[] {this.dose}; // Type + case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type + case 1506263709: /*maxDosePerPeriod*/ return this.maxDosePerPeriod == null ? new Base[0] : new Base[] {this.maxDosePerPeriod}; // Ratio + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3556653: // text + this.text = castToString(value); // StringType + break; + case -1206718612: // additionalInstructions + this.additionalInstructions = castToCodeableConcept(value); // CodeableConcept + break; + case -873664438: // timing + this.timing = castToTiming(value); // Timing + break; + case -1432923513: // asNeeded + this.asNeeded = (Type) value; // Type + break; + case 3530567: // site + this.site = (Type) value; // Type + break; + case 108704329: // route + this.route = castToCodeableConcept(value); // CodeableConcept + break; + case -1077554975: // method + this.method = castToCodeableConcept(value); // CodeableConcept + break; + case 3089437: // dose + this.dose = (Type) value; // Type + break; + case 3493088: // rate + this.rate = (Type) value; // Type + break; + case 1506263709: // maxDosePerPeriod + this.maxDosePerPeriod = castToRatio(value); // Ratio + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("additionalInstructions")) + this.additionalInstructions = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("timing")) + this.timing = castToTiming(value); // Timing + else if (name.equals("asNeeded[x]")) + this.asNeeded = (Type) value; // Type + else if (name.equals("site[x]")) + this.site = (Type) value; // Type + else if (name.equals("route")) + this.route = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("method")) + this.method = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("dose[x]")) + this.dose = (Type) value; // Type + else if (name.equals("rate[x]")) + this.rate = (Type) value; // Type + else if (name.equals("maxDosePerPeriod")) + this.maxDosePerPeriod = castToRatio(value); // Ratio + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case -1206718612: return getAdditionalInstructions(); // CodeableConcept + case -873664438: return getTiming(); // Timing + case -544329575: return getAsNeeded(); // Type + case 2099997657: return getSite(); // Type + case 108704329: return getRoute(); // CodeableConcept + case -1077554975: return getMethod(); // CodeableConcept + case 1843195715: return getDose(); // Type + case 983460768: return getRate(); // Type + case 1506263709: return getMaxDosePerPeriod(); // Ratio + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.text"); + } + else if (name.equals("additionalInstructions")) { + this.additionalInstructions = new CodeableConcept(); + return this.additionalInstructions; + } + else if (name.equals("timing")) { + this.timing = new Timing(); + return this.timing; + } + else if (name.equals("asNeededBoolean")) { + this.asNeeded = new BooleanType(); + return this.asNeeded; + } + else if (name.equals("asNeededCodeableConcept")) { + this.asNeeded = new CodeableConcept(); + return this.asNeeded; + } + else if (name.equals("siteCodeableConcept")) { + this.site = new CodeableConcept(); + return this.site; + } + else if (name.equals("siteReference")) { + this.site = new Reference(); + return this.site; + } + else if (name.equals("route")) { + this.route = new CodeableConcept(); + return this.route; + } + else if (name.equals("method")) { + this.method = new CodeableConcept(); + return this.method; + } + else if (name.equals("doseRange")) { + this.dose = new Range(); + return this.dose; + } + else if (name.equals("doseSimpleQuantity")) { + this.dose = new SimpleQuantity(); + return this.dose; + } + else if (name.equals("rateRatio")) { + this.rate = new Ratio(); + return this.rate; + } + else if (name.equals("rateRange")) { + this.rate = new Range(); + return this.rate; + } + else if (name.equals("maxDosePerPeriod")) { + this.maxDosePerPeriod = new Ratio(); + return this.maxDosePerPeriod; + } + else + return super.addChild(name); + } + + public MedicationDispenseDosageInstructionComponent copy() { + MedicationDispenseDosageInstructionComponent dst = new MedicationDispenseDosageInstructionComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); + dst.timing = timing == null ? null : timing.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.dose = dose == null ? null : dose.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationDispenseDosageInstructionComponent)) + return false; + MedicationDispenseDosageInstructionComponent o = (MedicationDispenseDosageInstructionComponent) other; + return compareDeep(text, o.text, true) && compareDeep(additionalInstructions, o.additionalInstructions, true) + && compareDeep(timing, o.timing, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(site, o.site, true) + && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) + && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationDispenseDosageInstructionComponent)) + return false; + MedicationDispenseDosageInstructionComponent o = (MedicationDispenseDosageInstructionComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) + && (timing == null || timing.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) + && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (dose == null || dose.isEmpty()) + && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) + ; + } + + public String fhirType() { + return "MedicationDispense.dosageInstruction"; + + } + + } + + @Block() + public static class MedicationDispenseSubstitutionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code signifying whether a different drug was dispensed from what was prescribed. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Code signifying whether a different drug was dispensed from what was prescribed", formalDefinition="A code signifying whether a different drug was dispensed from what was prescribed." ) + protected CodeableConcept type; + + /** + * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Why was substitution made", formalDefinition="Indicates the reason for the substitution of (or lack of substitution) from what was prescribed." ) + protected List reason; + + /** + * The person or organization that has primary responsibility for the substitution. + */ + @Child(name = "responsibleParty", type = {Practitioner.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who is responsible for the substitution", formalDefinition="The person or organization that has primary responsibility for the substitution." ) + protected List responsibleParty; + /** + * The actual objects that are the target of the reference (The person or organization that has primary responsibility for the substitution.) + */ + protected List responsiblePartyTarget; + + + private static final long serialVersionUID = 1218245830L; + + /** + * Constructor + */ + public MedicationDispenseSubstitutionComponent() { + super(); + } + + /** + * Constructor + */ + public MedicationDispenseSubstitutionComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) + */ + public MedicationDispenseSubstitutionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public MedicationDispenseSubstitutionComponent addReason(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) + */ + public List getResponsibleParty() { + if (this.responsibleParty == null) + this.responsibleParty = new ArrayList(); + return this.responsibleParty; + } + + public boolean hasResponsibleParty() { + if (this.responsibleParty == null) + return false; + for (Reference item : this.responsibleParty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) + */ + // syntactic sugar + public Reference addResponsibleParty() { //3 + Reference t = new Reference(); + if (this.responsibleParty == null) + this.responsibleParty = new ArrayList(); + this.responsibleParty.add(t); + return t; + } + + // syntactic sugar + public MedicationDispenseSubstitutionComponent addResponsibleParty(Reference t) { //3 + if (t == null) + return this; + if (this.responsibleParty == null) + this.responsibleParty = new ArrayList(); + this.responsibleParty.add(t); + return this; + } + + /** + * @return {@link #responsibleParty} (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 person or organization that has primary responsibility for the substitution.) + */ + public List getResponsiblePartyTarget() { + if (this.responsiblePartyTarget == null) + this.responsiblePartyTarget = new ArrayList(); + return this.responsiblePartyTarget; + } + + // syntactic sugar + /** + * @return {@link #responsibleParty} (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 person or organization that has primary responsibility for the substitution.) + */ + public Practitioner addResponsiblePartyTarget() { + Practitioner r = new Practitioner(); + if (this.responsiblePartyTarget == null) + this.responsiblePartyTarget = new ArrayList(); + this.responsiblePartyTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug was dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("responsibleParty", "Reference(Practitioner)", "The person or organization that has primary responsibility for the substitution.", 0, java.lang.Integer.MAX_VALUE, responsibleParty)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept + case 1511509392: /*responsibleParty*/ return this.responsibleParty == null ? new Base[0] : this.responsibleParty.toArray(new Base[this.responsibleParty.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -934964668: // reason + this.getReason().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1511509392: // responsibleParty + this.getResponsibleParty().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("reason")) + this.getReason().add(castToCodeableConcept(value)); + else if (name.equals("responsibleParty")) + this.getResponsibleParty().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // CodeableConcept + case -934964668: return addReason(); // CodeableConcept + case 1511509392: return addResponsibleParty(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("reason")) { + return addReason(); + } + else if (name.equals("responsibleParty")) { + return addResponsibleParty(); + } + else + return super.addChild(name); + } + + public MedicationDispenseSubstitutionComponent copy() { + MedicationDispenseSubstitutionComponent dst = new MedicationDispenseSubstitutionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (responsibleParty != null) { + dst.responsibleParty = new ArrayList(); + for (Reference i : responsibleParty) + dst.responsibleParty.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationDispenseSubstitutionComponent)) + return false; + MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other; + return compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true) && compareDeep(responsibleParty, o.responsibleParty, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationDispenseSubstitutionComponent)) + return false; + MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) + && (responsibleParty == null || responsibleParty.isEmpty()); + } + + public String fhirType() { + return "MedicationDispense.substitution"; + + } + + } + + /** + * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR." ) + protected Identifier identifier; + + /** + * A code specifying the state of the set of dispense events. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="A code specifying the state of the set of dispense events." ) + protected Enumeration status; + + /** + * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What medication was supplied", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * A link to a resource representing the person to whom the medication will be given. + */ + @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who the dispense is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) + */ + protected Patient patientTarget; + + /** + * The individual responsible for dispensing the medication. + */ + @Child(name = "dispenser", type = {Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Practitioner responsible for dispensing medication", formalDefinition="The individual responsible for dispensing the medication." ) + protected Reference dispenser; + + /** + * The actual object that is the target of the reference (The individual responsible for dispensing the medication.) + */ + protected Practitioner dispenserTarget; + + /** + * Indicates the medication order that is being dispensed against. + */ + @Child(name = "authorizingPrescription", type = {MedicationOrder.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Medication order that authorizes the dispense", formalDefinition="Indicates the medication order that is being dispensed against." ) + protected List authorizingPrescription; + /** + * The actual objects that are the target of the reference (Indicates the medication order that is being dispensed against.) + */ + protected List authorizingPrescriptionTarget; + + + /** + * Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Trial fill, partial fill, emergency fill, etc.", formalDefinition="Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) + protected CodeableConcept type; + + /** + * The amount of medication that has been dispensed. Includes unit of measure. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of medication that has been dispensed. Includes unit of measure." ) + protected SimpleQuantity quantity; + + /** + * The amount of medication expressed as a timing amount. + */ + @Child(name = "daysSupply", type = {SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount of medication expressed as a timing amount", formalDefinition="The amount of medication expressed as a timing amount." ) + protected SimpleQuantity daysSupply; + + /** + * The time when the dispensed product was packaged and reviewed. + */ + @Child(name = "whenPrepared", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Dispense processing time", formalDefinition="The time when the dispensed product was packaged and reviewed." ) + protected DateTimeType whenPrepared; + + /** + * The time the dispensed product was provided to the patient or their representative. + */ + @Child(name = "whenHandedOver", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When product was given out", formalDefinition="The time the dispensed product was provided to the patient or their representative." ) + protected DateTimeType whenHandedOver; + + /** + * Identification of the facility/location where the medication was shipped to, as part of the dispense event. + */ + @Child(name = "destination", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where the medication was sent", formalDefinition="Identification of the facility/location where the medication was shipped to, as part of the dispense event." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + protected Location destinationTarget; + + /** + * Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional. + */ + @Child(name = "receiver", type = {Patient.class, Practitioner.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who collected the medication", formalDefinition="Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional." ) + protected List receiver; + /** + * The actual objects that are the target of the reference (Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.) + */ + protected List receiverTarget; + + + /** + * Extra information about the dispense that could not be conveyed in the other attributes. + */ + @Child(name = "note", type = {Annotation.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Information about the dispense", formalDefinition="Extra information about the dispense that could not be conveyed in the other attributes." ) + protected List note; + + /** + * Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed. + */ + @Child(name = "dosageInstruction", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Medicine administration instructions to the patient/caregiver", formalDefinition="Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed." ) + protected List dosageInstruction; + + /** + * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why. + */ + @Child(name = "substitution", type = {}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Deals with substitution of one medicine for another", formalDefinition="Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why." ) + protected MedicationDispenseSubstitutionComponent substitution; + + private static final long serialVersionUID = -634238241L; + + /** + * Constructor + */ + public MedicationDispense() { + super(); + } + + /** + * Constructor + */ + public MedicationDispense(Type medication) { + super(); + this.medication = medication; + } + + /** + * @return {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) + */ + public MedicationDispense setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the set of dispense events.). 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 MedicationDispense.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MedicationDispenseStatusEnumFactory()); // bb + 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} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationDispense setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the set of dispense events. + */ + public MedicationDispenseStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the set of dispense events. + */ + public MedicationDispense setStatus(MedicationDispenseStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new MedicationDispenseStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws FHIRException { + if (!(this.medication instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + public boolean hasMedicationCodeableConcept() { + return this.medication instanceof CodeableConcept; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws FHIRException { + if (!(this.medication instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedicationReference() { + return this.medication instanceof Reference; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationDispense setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationDispense 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. (A link to a resource representing the person to whom the medication will be given.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationDispense setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #dispenser} (The individual responsible for dispensing the medication.) + */ + public Reference getDispenser() { + if (this.dispenser == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.dispenser"); + else if (Configuration.doAutoCreate()) + this.dispenser = new Reference(); // cc + return this.dispenser; + } + + public boolean hasDispenser() { + return this.dispenser != null && !this.dispenser.isEmpty(); + } + + /** + * @param value {@link #dispenser} (The individual responsible for dispensing the medication.) + */ + public MedicationDispense setDispenser(Reference value) { + this.dispenser = value; + return this; + } + + /** + * @return {@link #dispenser} 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 individual responsible for dispensing the medication.) + */ + public Practitioner getDispenserTarget() { + if (this.dispenserTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.dispenser"); + else if (Configuration.doAutoCreate()) + this.dispenserTarget = new Practitioner(); // aa + return this.dispenserTarget; + } + + /** + * @param value {@link #dispenser} 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 individual responsible for dispensing the medication.) + */ + public MedicationDispense setDispenserTarget(Practitioner value) { + this.dispenserTarget = value; + return this; + } + + /** + * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) + */ + public List getAuthorizingPrescription() { + if (this.authorizingPrescription == null) + this.authorizingPrescription = new ArrayList(); + return this.authorizingPrescription; + } + + public boolean hasAuthorizingPrescription() { + if (this.authorizingPrescription == null) + return false; + for (Reference item : this.authorizingPrescription) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) + */ + // syntactic sugar + public Reference addAuthorizingPrescription() { //3 + Reference t = new Reference(); + if (this.authorizingPrescription == null) + this.authorizingPrescription = new ArrayList(); + this.authorizingPrescription.add(t); + return t; + } + + // syntactic sugar + public MedicationDispense addAuthorizingPrescription(Reference t) { //3 + if (t == null) + return this; + if (this.authorizingPrescription == null) + this.authorizingPrescription = new ArrayList(); + this.authorizingPrescription.add(t); + return this; + } + + /** + * @return {@link #authorizingPrescription} (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. Indicates the medication order that is being dispensed against.) + */ + public List getAuthorizingPrescriptionTarget() { + if (this.authorizingPrescriptionTarget == null) + this.authorizingPrescriptionTarget = new ArrayList(); + return this.authorizingPrescriptionTarget; + } + + // syntactic sugar + /** + * @return {@link #authorizingPrescription} (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. Indicates the medication order that is being dispensed against.) + */ + public MedicationOrder addAuthorizingPrescriptionTarget() { + MedicationOrder r = new MedicationOrder(); + if (this.authorizingPrescriptionTarget == null) + this.authorizingPrescriptionTarget = new ArrayList(); + this.authorizingPrescriptionTarget.add(r); + return r; + } + + /** + * @return {@link #type} (Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public MedicationDispense setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) + */ + public MedicationDispense setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #daysSupply} (The amount of medication expressed as a timing amount.) + */ + public SimpleQuantity getDaysSupply() { + if (this.daysSupply == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.daysSupply"); + else if (Configuration.doAutoCreate()) + this.daysSupply = new SimpleQuantity(); // cc + return this.daysSupply; + } + + public boolean hasDaysSupply() { + return this.daysSupply != null && !this.daysSupply.isEmpty(); + } + + /** + * @param value {@link #daysSupply} (The amount of medication expressed as a timing amount.) + */ + public MedicationDispense setDaysSupply(SimpleQuantity value) { + this.daysSupply = value; + return this; + } + + /** + * @return {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value + */ + public DateTimeType getWhenPreparedElement() { + if (this.whenPrepared == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.whenPrepared"); + else if (Configuration.doAutoCreate()) + this.whenPrepared = new DateTimeType(); // bb + return this.whenPrepared; + } + + public boolean hasWhenPreparedElement() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + public boolean hasWhenPrepared() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + /** + * @param value {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value + */ + public MedicationDispense setWhenPreparedElement(DateTimeType value) { + this.whenPrepared = value; + return this; + } + + /** + * @return The time when the dispensed product was packaged and reviewed. + */ + public Date getWhenPrepared() { + return this.whenPrepared == null ? null : this.whenPrepared.getValue(); + } + + /** + * @param value The time when the dispensed product was packaged and reviewed. + */ + public MedicationDispense setWhenPrepared(Date value) { + if (value == null) + this.whenPrepared = null; + else { + if (this.whenPrepared == null) + this.whenPrepared = new DateTimeType(); + this.whenPrepared.setValue(value); + } + return this; + } + + /** + * @return {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value + */ + public DateTimeType getWhenHandedOverElement() { + if (this.whenHandedOver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.whenHandedOver"); + else if (Configuration.doAutoCreate()) + this.whenHandedOver = new DateTimeType(); // bb + return this.whenHandedOver; + } + + public boolean hasWhenHandedOverElement() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + public boolean hasWhenHandedOver() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + /** + * @param value {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value + */ + public MedicationDispense setWhenHandedOverElement(DateTimeType value) { + this.whenHandedOver = value; + return this; + } + + /** + * @return The time the dispensed product was provided to the patient or their representative. + */ + 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 MedicationDispense setWhenHandedOver(Date value) { + if (value == null) + this.whenHandedOver = null; + else { + if (this.whenHandedOver == null) + this.whenHandedOver = new DateTimeType(); + this.whenHandedOver.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); // cc + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public MedicationDispense setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} 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. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); // aa + return this.destinationTarget; + } + + /** + * @param value {@link #destination} 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. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public MedicationDispense setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.) + */ + public List getReceiver() { + if (this.receiver == null) + this.receiver = new ArrayList(); + return this.receiver; + } + + public boolean hasReceiver() { + if (this.receiver == null) + return false; + for (Reference item : this.receiver) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.) + */ + // syntactic sugar + public Reference addReceiver() { //3 + Reference t = new Reference(); + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return t; + } + + // syntactic sugar + public MedicationDispense addReceiver(Reference t) { //3 + if (t == null) + return this; + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return this; + } + + /** + * @return {@link #receiver} (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 person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.) + */ + public List getReceiverTarget() { + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + return this.receiverTarget; + } + + /** + * @return {@link #note} (Extra information about the dispense that could not be conveyed in the other attributes.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Extra information about the dispense that could not be conveyed in the other attributes.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public MedicationDispense addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed.) + */ + public List getDosageInstruction() { + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + return this.dosageInstruction; + } + + public boolean hasDosageInstruction() { + if (this.dosageInstruction == null) + return false; + for (MedicationDispenseDosageInstructionComponent item : this.dosageInstruction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed.) + */ + // syntactic sugar + public MedicationDispenseDosageInstructionComponent addDosageInstruction() { //3 + MedicationDispenseDosageInstructionComponent t = new MedicationDispenseDosageInstructionComponent(); + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return t; + } + + // syntactic sugar + public MedicationDispense addDosageInstruction(MedicationDispenseDosageInstructionComponent t) { //3 + if (t == null) + return this; + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return this; + } + + /** + * @return {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why.) + */ + public MedicationDispenseSubstitutionComponent getSubstitution() { + if (this.substitution == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.substitution"); + else if (Configuration.doAutoCreate()) + this.substitution = new MedicationDispenseSubstitutionComponent(); // cc + return this.substitution; + } + + public boolean hasSubstitution() { + return this.substitution != null && !this.substitution.isEmpty(); + } + + /** + * @param value {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why.) + */ + public MedicationDispense setSubstitution(MedicationDispenseSubstitutionComponent value) { + this.substitution = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("dispenser", "Reference(Practitioner)", "The individual responsible for dispensing the medication.", 0, java.lang.Integer.MAX_VALUE, dispenser)); + childrenList.add(new Property("authorizingPrescription", "Reference(MedicationOrder)", "Indicates the medication order that is being dispensed against.", 0, java.lang.Integer.MAX_VALUE, authorizingPrescription)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of medication that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("daysSupply", "SimpleQuantity", "The amount of medication expressed as a timing amount.", 0, java.lang.Integer.MAX_VALUE, daysSupply)); + childrenList.add(new Property("whenPrepared", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); + childrenList.add(new Property("whenHandedOver", "dateTime", "The time the dispensed product was provided to the patient or their representative.", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); + childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the medication was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("receiver", "Reference(Patient|Practitioner)", "Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.", 0, java.lang.Integer.MAX_VALUE, receiver)); + childrenList.add(new Property("note", "Annotation", "Extra information about the dispense that could not be conveyed in the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); + childrenList.add(new Property("substitution", "", "Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why.", 0, java.lang.Integer.MAX_VALUE, substitution)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 241511093: /*dispenser*/ return this.dispenser == null ? new Base[0] : new Base[] {this.dispenser}; // Reference + case -1237557856: /*authorizingPrescription*/ return this.authorizingPrescription == null ? new Base[0] : this.authorizingPrescription.toArray(new Base[this.authorizingPrescription.size()]); // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case 197175334: /*daysSupply*/ return this.daysSupply == null ? new Base[0] : new Base[] {this.daysSupply}; // SimpleQuantity + case -562837097: /*whenPrepared*/ return this.whenPrepared == null ? new Base[0] : new Base[] {this.whenPrepared}; // DateTimeType + case -940241380: /*whenHandedOver*/ return this.whenHandedOver == null ? new Base[0] : new Base[] {this.whenHandedOver}; // DateTimeType + case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference + case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : this.receiver.toArray(new Base[this.receiver.size()]); // Reference + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case -1201373865: /*dosageInstruction*/ return this.dosageInstruction == null ? new Base[0] : this.dosageInstruction.toArray(new Base[this.dosageInstruction.size()]); // MedicationDispenseDosageInstructionComponent + case 826147581: /*substitution*/ return this.substitution == null ? new Base[0] : new Base[] {this.substitution}; // MedicationDispenseSubstitutionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -892481550: // status + this.status = new MedicationDispenseStatusEnumFactory().fromType(value); // Enumeration + break; + case 1998965455: // medication + this.medication = (Type) value; // Type + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 241511093: // dispenser + this.dispenser = castToReference(value); // Reference + break; + case -1237557856: // authorizingPrescription + this.getAuthorizingPrescription().add(castToReference(value)); // Reference + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case 197175334: // daysSupply + this.daysSupply = castToSimpleQuantity(value); // SimpleQuantity + break; + case -562837097: // whenPrepared + this.whenPrepared = castToDateTime(value); // DateTimeType + break; + case -940241380: // whenHandedOver + this.whenHandedOver = castToDateTime(value); // DateTimeType + break; + case -1429847026: // destination + this.destination = castToReference(value); // Reference + break; + case -808719889: // receiver + this.getReceiver().add(castToReference(value)); // Reference + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case -1201373865: // dosageInstruction + this.getDosageInstruction().add((MedicationDispenseDosageInstructionComponent) value); // MedicationDispenseDosageInstructionComponent + break; + case 826147581: // substitution + this.substitution = (MedicationDispenseSubstitutionComponent) value; // MedicationDispenseSubstitutionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("status")) + this.status = new MedicationDispenseStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("medication[x]")) + this.medication = (Type) value; // Type + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("dispenser")) + this.dispenser = castToReference(value); // Reference + else if (name.equals("authorizingPrescription")) + this.getAuthorizingPrescription().add(castToReference(value)); + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("daysSupply")) + this.daysSupply = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("whenPrepared")) + this.whenPrepared = castToDateTime(value); // DateTimeType + else if (name.equals("whenHandedOver")) + this.whenHandedOver = castToDateTime(value); // DateTimeType + else if (name.equals("destination")) + this.destination = castToReference(value); // Reference + else if (name.equals("receiver")) + this.getReceiver().add(castToReference(value)); + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("dosageInstruction")) + this.getDosageInstruction().add((MedicationDispenseDosageInstructionComponent) value); + else if (name.equals("substitution")) + this.substitution = (MedicationDispenseSubstitutionComponent) value; // MedicationDispenseSubstitutionComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1458402129: return getMedication(); // Type + case -791418107: return getPatient(); // Reference + case 241511093: return getDispenser(); // Reference + case -1237557856: return addAuthorizingPrescription(); // Reference + case 3575610: return getType(); // CodeableConcept + case -1285004149: return getQuantity(); // SimpleQuantity + case 197175334: return getDaysSupply(); // SimpleQuantity + case -562837097: throw new FHIRException("Cannot make property whenPrepared as it is not a complex type"); // DateTimeType + case -940241380: throw new FHIRException("Cannot make property whenHandedOver as it is not a complex type"); // DateTimeType + case -1429847026: return getDestination(); // Reference + case -808719889: return addReceiver(); // Reference + case 3387378: return addNote(); // Annotation + case -1201373865: return addDosageInstruction(); // MedicationDispenseDosageInstructionComponent + case 826147581: return getSubstitution(); // MedicationDispenseSubstitutionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.status"); + } + else if (name.equals("medicationCodeableConcept")) { + this.medication = new CodeableConcept(); + return this.medication; + } + else if (name.equals("medicationReference")) { + this.medication = new Reference(); + return this.medication; + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("dispenser")) { + this.dispenser = new Reference(); + return this.dispenser; + } + else if (name.equals("authorizingPrescription")) { + return addAuthorizingPrescription(); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("daysSupply")) { + this.daysSupply = new SimpleQuantity(); + return this.daysSupply; + } + else if (name.equals("whenPrepared")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.whenPrepared"); + } + else if (name.equals("whenHandedOver")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.whenHandedOver"); + } + else if (name.equals("destination")) { + this.destination = new Reference(); + return this.destination; + } + else if (name.equals("receiver")) { + return addReceiver(); + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("dosageInstruction")) { + return addDosageInstruction(); + } + else if (name.equals("substitution")) { + this.substitution = new MedicationDispenseSubstitutionComponent(); + return this.substitution; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "MedicationDispense"; + + } + + public MedicationDispense copy() { + MedicationDispense dst = new MedicationDispense(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.medication = medication == null ? null : medication.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.dispenser = dispenser == null ? null : dispenser.copy(); + if (authorizingPrescription != null) { + dst.authorizingPrescription = new ArrayList(); + for (Reference i : authorizingPrescription) + dst.authorizingPrescription.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.daysSupply = daysSupply == null ? null : daysSupply.copy(); + dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); + dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (receiver != null) { + dst.receiver = new ArrayList(); + for (Reference i : receiver) + dst.receiver.add(i.copy()); + }; + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + if (dosageInstruction != null) { + dst.dosageInstruction = new ArrayList(); + for (MedicationDispenseDosageInstructionComponent i : dosageInstruction) + dst.dosageInstruction.add(i.copy()); + }; + dst.substitution = substitution == null ? null : substitution.copy(); + return dst; + } + + protected MedicationDispense typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationDispense)) + return false; + MedicationDispense o = (MedicationDispense) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) + && compareDeep(patient, o.patient, true) && compareDeep(dispenser, o.dispenser, true) && compareDeep(authorizingPrescription, o.authorizingPrescription, true) + && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(daysSupply, o.daysSupply, true) + && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(whenHandedOver, o.whenHandedOver, true) + && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true) && compareDeep(note, o.note, true) + && compareDeep(dosageInstruction, o.dosageInstruction, true) && compareDeep(substitution, o.substitution, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationDispense)) + return false; + MedicationDispense o = (MedicationDispense) other; + return compareValues(status, o.status, true) && compareValues(whenPrepared, o.whenPrepared, true) && compareValues(whenHandedOver, o.whenHandedOver, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (medication == null || medication.isEmpty()) && (patient == null || patient.isEmpty()) + && (dispenser == null || dispenser.isEmpty()) && (authorizingPrescription == null || authorizingPrescription.isEmpty()) + && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (daysSupply == null || daysSupply.isEmpty()) + && (whenPrepared == null || whenPrepared.isEmpty()) && (whenHandedOver == null || whenHandedOver.isEmpty()) + && (destination == null || destination.isEmpty()) && (receiver == null || receiver.isEmpty()) + && (note == null || note.isEmpty()) && (dosageInstruction == null || dosageInstruction.isEmpty()) + && (substitution == null || substitution.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationDispense; + } + + /** + * Search parameter: medication + *

+ * Description: Return dispenses of this medicine resource
+ * Type: reference
+ * Path: MedicationDispense.medicationReference
+ *

+ */ + @SearchParamDefinition(name="medication", path="MedicationDispense.medication.as(Reference)", description="Return dispenses of this medicine resource", type="reference" ) + public static final String SP_MEDICATION = "medication"; + /** + * Fluent Client search parameter constant for medication + *

+ * Description: Return dispenses of this medicine resource
+ * Type: reference
+ * Path: MedicationDispense.medicationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationDispense:medication". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationDispense:medication").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The identity of a patient to list dispenses for
+ * Type: reference
+ * Path: MedicationDispense.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="MedicationDispense.patient", description="The identity of a patient to list dispenses for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of a patient to list dispenses for
+ * Type: reference
+ * Path: MedicationDispense.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationDispense:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationDispense:patient").toLocked(); + + /** + * Search parameter: receiver + *

+ * Description: Who collected the medication
+ * Type: reference
+ * Path: MedicationDispense.receiver
+ *

+ */ + @SearchParamDefinition(name="receiver", path="MedicationDispense.receiver", description="Who collected the medication", type="reference" ) + public static final String SP_RECEIVER = "receiver"; + /** + * Fluent Client search parameter constant for receiver + *

+ * Description: Who collected the medication
+ * Type: reference
+ * Path: MedicationDispense.receiver
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationDispense:receiver". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("MedicationDispense:receiver").toLocked(); + + /** + * Search parameter: status + *

+ * Description: Status of the dispense
+ * Type: token
+ * Path: MedicationDispense.status
+ *

+ */ + @SearchParamDefinition(name="status", path="MedicationDispense.status", description="Status of the dispense", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the dispense
+ * Type: token
+ * Path: MedicationDispense.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: prescription + *

+ * Description: The identity of a prescription to list dispenses from
+ * Type: reference
+ * Path: MedicationDispense.authorizingPrescription
+ *

+ */ + @SearchParamDefinition(name="prescription", path="MedicationDispense.authorizingPrescription", description="The identity of a prescription to list dispenses from", type="reference" ) + public static final String SP_PRESCRIPTION = "prescription"; + /** + * Fluent Client search parameter constant for prescription + *

+ * Description: The identity of a prescription to list dispenses from
+ * Type: reference
+ * Path: MedicationDispense.authorizingPrescription
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIPTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIPTION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationDispense:prescription". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIPTION = new ca.uhn.fhir.model.api.Include("MedicationDispense:prescription").toLocked(); + + /** + * Search parameter: responsibleparty + *

+ * Description: Return all dispenses with the specified responsible party
+ * Type: reference
+ * Path: MedicationDispense.substitution.responsibleParty
+ *

+ */ + @SearchParamDefinition(name="responsibleparty", path="MedicationDispense.substitution.responsibleParty", description="Return all dispenses with the specified responsible party", type="reference" ) + public static final String SP_RESPONSIBLEPARTY = "responsibleparty"; + /** + * Fluent Client search parameter constant for responsibleparty + *

+ * Description: Return all dispenses with the specified responsible party
+ * Type: reference
+ * Path: MedicationDispense.substitution.responsibleParty
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSIBLEPARTY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSIBLEPARTY); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationDispense:responsibleparty". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSIBLEPARTY = new ca.uhn.fhir.model.api.Include("MedicationDispense:responsibleparty").toLocked(); + + /** + * Search parameter: dispenser + *

+ * Description: Return all dispenses performed by a specific individual
+ * Type: reference
+ * Path: MedicationDispense.dispenser
+ *

+ */ + @SearchParamDefinition(name="dispenser", path="MedicationDispense.dispenser", description="Return all dispenses performed by a specific individual", type="reference" ) + public static final String SP_DISPENSER = "dispenser"; + /** + * Fluent Client search parameter constant for dispenser + *

+ * Description: Return all dispenses performed by a specific individual
+ * Type: reference
+ * Path: MedicationDispense.dispenser
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DISPENSER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DISPENSER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationDispense:dispenser". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DISPENSER = new ca.uhn.fhir.model.api.Include("MedicationDispense:dispenser").toLocked(); + + /** + * Search parameter: code + *

+ * Description: Return dispenses of this medicine code
+ * Type: token
+ * Path: MedicationDispense.medicationCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="code", path="MedicationDispense.medication.as(CodeableConcept)", description="Return dispenses of this medicine code", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Return dispenses of this medicine code
+ * Type: token
+ * Path: MedicationDispense.medicationCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: type + *

+ * Description: Return all dispenses of a specific type
+ * Type: token
+ * Path: MedicationDispense.type
+ *

+ */ + @SearchParamDefinition(name="type", path="MedicationDispense.type", description="Return all dispenses of a specific type", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Return all dispenses of a specific type
+ * Type: token
+ * Path: MedicationDispense.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: Return dispenses with this external identifier
+ * Type: token
+ * Path: MedicationDispense.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="MedicationDispense.identifier", description="Return dispenses with this external identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Return dispenses with this external identifier
+ * Type: token
+ * Path: MedicationDispense.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: whenprepared + *

+ * Description: Date when medication prepared
+ * Type: date
+ * Path: MedicationDispense.whenPrepared
+ *

+ */ + @SearchParamDefinition(name="whenprepared", path="MedicationDispense.whenPrepared", description="Date when medication prepared", type="date" ) + public static final String SP_WHENPREPARED = "whenprepared"; + /** + * Fluent Client search parameter constant for whenprepared + *

+ * Description: Date when medication prepared
+ * Type: date
+ * Path: MedicationDispense.whenPrepared
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam WHENPREPARED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_WHENPREPARED); + + /** + * Search parameter: whenhandedover + *

+ * Description: Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)
+ * Type: date
+ * Path: MedicationDispense.whenHandedOver
+ *

+ */ + @SearchParamDefinition(name="whenhandedover", path="MedicationDispense.whenHandedOver", description="Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)", type="date" ) + public static final String SP_WHENHANDEDOVER = "whenhandedover"; + /** + * Fluent Client search parameter constant for whenhandedover + *

+ * Description: Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)
+ * Type: date
+ * Path: MedicationDispense.whenHandedOver
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam WHENHANDEDOVER = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_WHENHANDEDOVER); + + /** + * Search parameter: destination + *

+ * Description: Return dispenses that should be sent to a specific destination
+ * Type: reference
+ * Path: MedicationDispense.destination
+ *

+ */ + @SearchParamDefinition(name="destination", path="MedicationDispense.destination", description="Return dispenses that should be sent to a specific destination", type="reference" ) + public static final String SP_DESTINATION = "destination"; + /** + * Fluent Client search parameter constant for destination + *

+ * Description: Return dispenses that should be sent to a specific destination
+ * Type: reference
+ * Path: MedicationDispense.destination
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DESTINATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DESTINATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationDispense:destination". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DESTINATION = new ca.uhn.fhir.model.api.Include("MedicationDispense:destination").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationOrder.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationOrder.java new file mode 100644 index 00000000000..26044d9026e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationOrder.java @@ -0,0 +1,2744 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc. + */ +@ResourceDef(name="MedicationOrder", profile="http://hl7.org/fhir/Profile/MedicationOrder") +public class MedicationOrder extends DomainResource { + + public enum MedicationOrderStatus { + /** + * The prescription is 'actionable', but not all actions that are implied by it have occurred yet. + */ + ACTIVE, + /** + * Actions implied by the prescription are to be temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the prescription have occurred. + */ + COMPLETED, + /** + * The prescription was entered in error. + */ + ENTEREDINERROR, + /** + * Actions implied by the prescription are to be permanently halted, before all of them occurred. + */ + STOPPED, + /** + * The prescription is not yet 'actionable', i.e. it is a work in progress, requires sign-off or verification, and needs to be run through decision support process. + */ + DRAFT, + /** + * added to help the parsers + */ + NULL; + public static MedicationOrderStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + if ("draft".equals(codeString)) + return DRAFT; + throw new FHIRException("Unknown MedicationOrderStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + case STOPPED: return "stopped"; + case DRAFT: return "draft"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return "http://hl7.org/fhir/medication-order-status"; + case ONHOLD: return "http://hl7.org/fhir/medication-order-status"; + case COMPLETED: return "http://hl7.org/fhir/medication-order-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/medication-order-status"; + case STOPPED: return "http://hl7.org/fhir/medication-order-status"; + case DRAFT: return "http://hl7.org/fhir/medication-order-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The prescription is 'actionable', but not all actions that are implied by it have occurred yet."; + case ONHOLD: return "Actions implied by the prescription are to be temporarily halted, but are expected to continue later. May also be called \"suspended\"."; + case COMPLETED: return "All actions that are implied by the prescription have occurred."; + case ENTEREDINERROR: return "The prescription was entered in error."; + case STOPPED: return "Actions implied by the prescription are to be permanently halted, before all of them occurred."; + case DRAFT: return "The prescription is not yet 'actionable', i.e. it is a work in progress, requires sign-off or verification, and needs to be run through decision support process."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case ONHOLD: return "On Hold"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered In Error"; + case STOPPED: return "Stopped"; + case DRAFT: return "Draft"; + default: return "?"; + } + } + } + + public static class MedicationOrderStatusEnumFactory implements EnumFactory { + public MedicationOrderStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return MedicationOrderStatus.ACTIVE; + if ("on-hold".equals(codeString)) + return MedicationOrderStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationOrderStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return MedicationOrderStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationOrderStatus.STOPPED; + if ("draft".equals(codeString)) + return MedicationOrderStatus.DRAFT; + throw new IllegalArgumentException("Unknown MedicationOrderStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return new Enumeration(this, MedicationOrderStatus.ACTIVE); + if ("on-hold".equals(codeString)) + return new Enumeration(this, MedicationOrderStatus.ONHOLD); + if ("completed".equals(codeString)) + return new Enumeration(this, MedicationOrderStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, MedicationOrderStatus.ENTEREDINERROR); + if ("stopped".equals(codeString)) + return new Enumeration(this, MedicationOrderStatus.STOPPED); + if ("draft".equals(codeString)) + return new Enumeration(this, MedicationOrderStatus.DRAFT); + throw new FHIRException("Unknown MedicationOrderStatus code '"+codeString+"'"); + } + public String toCode(MedicationOrderStatus code) { + if (code == MedicationOrderStatus.ACTIVE) + return "active"; + if (code == MedicationOrderStatus.ONHOLD) + return "on-hold"; + if (code == MedicationOrderStatus.COMPLETED) + return "completed"; + if (code == MedicationOrderStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == MedicationOrderStatus.STOPPED) + return "stopped"; + if (code == MedicationOrderStatus.DRAFT) + return "draft"; + return "?"; + } + public String toSystem(MedicationOrderStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class MedicationOrderDosageInstructionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Free text dosage instructions e.g. SIG", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing." ) + protected StringType text; + + /** + * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. + */ + @Child(name = "additionalInstructions", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Supplemental instructions - e.g. \"with meals\"", formalDefinition="Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded." ) + protected CodeableConcept additionalInstructions; + + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example: "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "timing", type = {Timing.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example: \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"." ) + protected Timing timing; + + /** + * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + */ + @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Take \"as needed\" (for x)", formalDefinition="Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept)." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first enters the body. + */ + @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) + protected Type site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body." ) + protected CodeableConcept route; + + /** + * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name = "dose", type = {Range.class, SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Type dose; + + /** + * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. + */ + @Child(name = "rate", type = {Ratio.class, Range.class, SimpleQuantity.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) + protected Type rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours. + */ + @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = -1470136646L; + + /** + * Constructor + */ + public MedicationOrderDosageInstructionComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationOrderDosageInstructionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing. + */ + public MedicationOrderDosageInstructionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public CodeableConcept getAdditionalInstructions() { + if (this.additionalInstructions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.additionalInstructions"); + else if (Configuration.doAutoCreate()) + this.additionalInstructions = new CodeableConcept(); // cc + return this.additionalInstructions; + } + + public boolean hasAdditionalInstructions() { + return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); + } + + /** + * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public MedicationOrderDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { + this.additionalInstructions = value; + return this; + } + + /** + * @return {@link #timing} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example: "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getTiming() { + if (this.timing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.timing"); + else if (Configuration.doAutoCreate()) + this.timing = new Timing(); // cc + return this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example: "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationOrderDosageInstructionComponent setTiming(Timing value) { + this.timing = value; + return this; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).) + */ + public BooleanType getAsNeededBooleanType() throws FHIRException { + if (!(this.asNeeded instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + public boolean hasAsNeededBooleanType() { + return this.asNeeded instanceof BooleanType; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).) + */ + public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeededCodeableConcept() { + return this.asNeeded instanceof CodeableConcept; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).) + */ + public MedicationOrderDosageInstructionComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public Type getSite() { + return this.site; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSiteCodeableConcept() throws FHIRException { + if (!(this.site instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); + return (CodeableConcept) this.site; + } + + public boolean hasSiteCodeableConcept() { + return this.site instanceof CodeableConcept; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public Reference getSiteReference() throws FHIRException { + if (!(this.site instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); + return (Reference) this.site; + } + + public boolean hasSiteReference() { + return this.site instanceof Reference; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public MedicationOrderDosageInstructionComponent setSite(Type value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.) + */ + public MedicationOrderDosageInstructionComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV.) + */ + public MedicationOrderDosageInstructionComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Type getDose() { + return this.dose; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public Range getDoseRange() throws FHIRException { + if (!(this.dose instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.dose.getClass().getName()+" was encountered"); + return (Range) this.dose; + } + + public boolean hasDoseRange() { + return this.dose instanceof Range; + } + + /** + * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public SimpleQuantity getDoseSimpleQuantity() throws FHIRException { + if (!(this.dose instanceof SimpleQuantity)) + throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.dose.getClass().getName()+" was encountered"); + return (SimpleQuantity) this.dose; + } + + public boolean hasDoseSimpleQuantity() { + return this.dose instanceof SimpleQuantity; + } + + public boolean hasDose() { + return this.dose != null && !this.dose.isEmpty(); + } + + /** + * @param value {@link #dose} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationOrderDosageInstructionComponent setDose(Type value) { + this.dose = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Type getRate() { + return this.rate; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Ratio getRateRatio() throws FHIRException { + if (!(this.rate instanceof Ratio)) + throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Ratio) this.rate; + } + + public boolean hasRateRatio() { + return this.rate instanceof Ratio; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Range getRateRange() throws FHIRException { + if (!(this.rate instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Range) this.rate; + } + + public boolean hasRateRange() { + return this.rate instanceof Range; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public SimpleQuantity getRateSimpleQuantity() throws FHIRException { + if (!(this.rate instanceof SimpleQuantity)) + throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (SimpleQuantity) this.rate; + } + + public boolean hasRateSimpleQuantity() { + return this.rate instanceof SimpleQuantity; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public MedicationOrderDosageInstructionComponent setRate(Type value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); // cc + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.) + */ + public MedicationOrderDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); + childrenList.add(new Property("timing", "Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example: \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("dose[x]", "Range|SimpleQuantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, dose)); + childrenList.add(new Property("rate[x]", "Ratio|Range|SimpleQuantity", "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + case -1206718612: /*additionalInstructions*/ return this.additionalInstructions == null ? new Base[0] : new Base[] {this.additionalInstructions}; // CodeableConcept + case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Timing + case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type + case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type + case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept + case 3089437: /*dose*/ return this.dose == null ? new Base[0] : new Base[] {this.dose}; // Type + case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type + case 1506263709: /*maxDosePerPeriod*/ return this.maxDosePerPeriod == null ? new Base[0] : new Base[] {this.maxDosePerPeriod}; // Ratio + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3556653: // text + this.text = castToString(value); // StringType + break; + case -1206718612: // additionalInstructions + this.additionalInstructions = castToCodeableConcept(value); // CodeableConcept + break; + case -873664438: // timing + this.timing = castToTiming(value); // Timing + break; + case -1432923513: // asNeeded + this.asNeeded = (Type) value; // Type + break; + case 3530567: // site + this.site = (Type) value; // Type + break; + case 108704329: // route + this.route = castToCodeableConcept(value); // CodeableConcept + break; + case -1077554975: // method + this.method = castToCodeableConcept(value); // CodeableConcept + break; + case 3089437: // dose + this.dose = (Type) value; // Type + break; + case 3493088: // rate + this.rate = (Type) value; // Type + break; + case 1506263709: // maxDosePerPeriod + this.maxDosePerPeriod = castToRatio(value); // Ratio + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("additionalInstructions")) + this.additionalInstructions = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("timing")) + this.timing = castToTiming(value); // Timing + else if (name.equals("asNeeded[x]")) + this.asNeeded = (Type) value; // Type + else if (name.equals("site[x]")) + this.site = (Type) value; // Type + else if (name.equals("route")) + this.route = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("method")) + this.method = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("dose[x]")) + this.dose = (Type) value; // Type + else if (name.equals("rate[x]")) + this.rate = (Type) value; // Type + else if (name.equals("maxDosePerPeriod")) + this.maxDosePerPeriod = castToRatio(value); // Ratio + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case -1206718612: return getAdditionalInstructions(); // CodeableConcept + case -873664438: return getTiming(); // Timing + case -544329575: return getAsNeeded(); // Type + case 2099997657: return getSite(); // Type + case 108704329: return getRoute(); // CodeableConcept + case -1077554975: return getMethod(); // CodeableConcept + case 1843195715: return getDose(); // Type + case 983460768: return getRate(); // Type + case 1506263709: return getMaxDosePerPeriod(); // Ratio + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.text"); + } + else if (name.equals("additionalInstructions")) { + this.additionalInstructions = new CodeableConcept(); + return this.additionalInstructions; + } + else if (name.equals("timing")) { + this.timing = new Timing(); + return this.timing; + } + else if (name.equals("asNeededBoolean")) { + this.asNeeded = new BooleanType(); + return this.asNeeded; + } + else if (name.equals("asNeededCodeableConcept")) { + this.asNeeded = new CodeableConcept(); + return this.asNeeded; + } + else if (name.equals("siteCodeableConcept")) { + this.site = new CodeableConcept(); + return this.site; + } + else if (name.equals("siteReference")) { + this.site = new Reference(); + return this.site; + } + else if (name.equals("route")) { + this.route = new CodeableConcept(); + return this.route; + } + else if (name.equals("method")) { + this.method = new CodeableConcept(); + return this.method; + } + else if (name.equals("doseRange")) { + this.dose = new Range(); + return this.dose; + } + else if (name.equals("doseSimpleQuantity")) { + this.dose = new SimpleQuantity(); + return this.dose; + } + else if (name.equals("rateRatio")) { + this.rate = new Ratio(); + return this.rate; + } + else if (name.equals("rateRange")) { + this.rate = new Range(); + return this.rate; + } + else if (name.equals("rateSimpleQuantity")) { + this.rate = new SimpleQuantity(); + return this.rate; + } + else if (name.equals("maxDosePerPeriod")) { + this.maxDosePerPeriod = new Ratio(); + return this.maxDosePerPeriod; + } + else + return super.addChild(name); + } + + public MedicationOrderDosageInstructionComponent copy() { + MedicationOrderDosageInstructionComponent dst = new MedicationOrderDosageInstructionComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); + dst.timing = timing == null ? null : timing.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.dose = dose == null ? null : dose.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationOrderDosageInstructionComponent)) + return false; + MedicationOrderDosageInstructionComponent o = (MedicationOrderDosageInstructionComponent) other; + return compareDeep(text, o.text, true) && compareDeep(additionalInstructions, o.additionalInstructions, true) + && compareDeep(timing, o.timing, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(site, o.site, true) + && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) + && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationOrderDosageInstructionComponent)) + return false; + MedicationOrderDosageInstructionComponent o = (MedicationOrderDosageInstructionComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) + && (timing == null || timing.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) + && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (dose == null || dose.isEmpty()) + && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) + ; + } + + public String fhirType() { + return "MedicationOrder.dosageInstruction"; + + } + + } + + @Block() + public static class MedicationOrderDispenseRequestComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * This indicates the validity period of a prescription (stale dating the Prescription). + */ + @Child(name = "validityPeriod", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time period supply is authorized for", formalDefinition="This indicates the validity period of a prescription (stale dating the Prescription)." ) + protected Period validityPeriod; + + /** + * An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. + */ + @Child(name = "numberOfRepeatsAllowed", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of refills authorized", formalDefinition="An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus \"3 repeats\", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets." ) + protected PositiveIntType numberOfRepeatsAllowed; + + /** + * The amount that is to be dispensed for one fill. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount of medication to supply per dispense", formalDefinition="The amount that is to be dispensed for one fill." ) + protected SimpleQuantity quantity; + + /** + * Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. + */ + @Child(name = "expectedSupplyDuration", type = {Duration.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of days supply per dispense", formalDefinition="Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last." ) + protected Duration expectedSupplyDuration; + + private static final long serialVersionUID = -1690502728L; + + /** + * Constructor + */ + public MedicationOrderDispenseRequestComponent() { + super(); + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws FHIRException { + if (!(this.medication instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + public boolean hasMedicationCodeableConcept() { + return this.medication instanceof CodeableConcept; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws FHIRException { + if (!(this.medication instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedicationReference() { + return this.medication instanceof Reference; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationOrderDispenseRequestComponent setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #validityPeriod} (This indicates the validity period of a prescription (stale dating the Prescription).) + */ + public Period getValidityPeriod() { + if (this.validityPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDispenseRequestComponent.validityPeriod"); + else if (Configuration.doAutoCreate()) + this.validityPeriod = new Period(); // cc + return this.validityPeriod; + } + + public boolean hasValidityPeriod() { + return this.validityPeriod != null && !this.validityPeriod.isEmpty(); + } + + /** + * @param value {@link #validityPeriod} (This indicates the validity period of a prescription (stale dating the Prescription).) + */ + public MedicationOrderDispenseRequestComponent setValidityPeriod(Period value) { + this.validityPeriod = value; + return this; + } + + /** + * @return {@link #numberOfRepeatsAllowed} (An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value + */ + public PositiveIntType getNumberOfRepeatsAllowedElement() { + if (this.numberOfRepeatsAllowed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDispenseRequestComponent.numberOfRepeatsAllowed"); + else if (Configuration.doAutoCreate()) + this.numberOfRepeatsAllowed = new PositiveIntType(); // bb + return this.numberOfRepeatsAllowed; + } + + public boolean hasNumberOfRepeatsAllowedElement() { + return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); + } + + public boolean hasNumberOfRepeatsAllowed() { + return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); + } + + /** + * @param value {@link #numberOfRepeatsAllowed} (An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value + */ + public MedicationOrderDispenseRequestComponent setNumberOfRepeatsAllowedElement(PositiveIntType value) { + this.numberOfRepeatsAllowed = value; + return this; + } + + /** + * @return An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. + */ + public int getNumberOfRepeatsAllowed() { + return this.numberOfRepeatsAllowed == null || this.numberOfRepeatsAllowed.isEmpty() ? 0 : this.numberOfRepeatsAllowed.getValue(); + } + + /** + * @param value An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. + */ + public MedicationOrderDispenseRequestComponent setNumberOfRepeatsAllowed(int value) { + if (this.numberOfRepeatsAllowed == null) + this.numberOfRepeatsAllowed = new PositiveIntType(); + this.numberOfRepeatsAllowed.setValue(value); + return this; + } + + /** + * @return {@link #quantity} (The amount that is to be dispensed for one fill.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDispenseRequestComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount that is to be dispensed for one fill.) + */ + public MedicationOrderDispenseRequestComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #expectedSupplyDuration} (Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.) + */ + public Duration getExpectedSupplyDuration() { + if (this.expectedSupplyDuration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderDispenseRequestComponent.expectedSupplyDuration"); + else if (Configuration.doAutoCreate()) + this.expectedSupplyDuration = new Duration(); // cc + return this.expectedSupplyDuration; + } + + public boolean hasExpectedSupplyDuration() { + return this.expectedSupplyDuration != null && !this.expectedSupplyDuration.isEmpty(); + } + + /** + * @param value {@link #expectedSupplyDuration} (Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.) + */ + public MedicationOrderDispenseRequestComponent setExpectedSupplyDuration(Duration value) { + this.expectedSupplyDuration = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("validityPeriod", "Period", "This indicates the validity period of a prescription (stale dating the Prescription).", 0, java.lang.Integer.MAX_VALUE, validityPeriod)); + childrenList.add(new Property("numberOfRepeatsAllowed", "positiveInt", "An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus \"3 repeats\", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.", 0, java.lang.Integer.MAX_VALUE, numberOfRepeatsAllowed)); + childrenList.add(new Property("quantity", "SimpleQuantity", "The amount that is to be dispensed for one fill.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("expectedSupplyDuration", "Duration", "Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.", 0, java.lang.Integer.MAX_VALUE, expectedSupplyDuration)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type + case -1434195053: /*validityPeriod*/ return this.validityPeriod == null ? new Base[0] : new Base[] {this.validityPeriod}; // Period + case -239736976: /*numberOfRepeatsAllowed*/ return this.numberOfRepeatsAllowed == null ? new Base[0] : new Base[] {this.numberOfRepeatsAllowed}; // PositiveIntType + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -1910182789: /*expectedSupplyDuration*/ return this.expectedSupplyDuration == null ? new Base[0] : new Base[] {this.expectedSupplyDuration}; // Duration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1998965455: // medication + this.medication = (Type) value; // Type + break; + case -1434195053: // validityPeriod + this.validityPeriod = castToPeriod(value); // Period + break; + case -239736976: // numberOfRepeatsAllowed + this.numberOfRepeatsAllowed = castToPositiveInt(value); // PositiveIntType + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -1910182789: // expectedSupplyDuration + this.expectedSupplyDuration = castToDuration(value); // Duration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("medication[x]")) + this.medication = (Type) value; // Type + else if (name.equals("validityPeriod")) + this.validityPeriod = castToPeriod(value); // Period + else if (name.equals("numberOfRepeatsAllowed")) + this.numberOfRepeatsAllowed = castToPositiveInt(value); // PositiveIntType + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("expectedSupplyDuration")) + this.expectedSupplyDuration = castToDuration(value); // Duration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1458402129: return getMedication(); // Type + case -1434195053: return getValidityPeriod(); // Period + case -239736976: throw new FHIRException("Cannot make property numberOfRepeatsAllowed as it is not a complex type"); // PositiveIntType + case -1285004149: return getQuantity(); // SimpleQuantity + case -1910182789: return getExpectedSupplyDuration(); // Duration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("medicationCodeableConcept")) { + this.medication = new CodeableConcept(); + return this.medication; + } + else if (name.equals("medicationReference")) { + this.medication = new Reference(); + return this.medication; + } + else if (name.equals("validityPeriod")) { + this.validityPeriod = new Period(); + return this.validityPeriod; + } + else if (name.equals("numberOfRepeatsAllowed")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.numberOfRepeatsAllowed"); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("expectedSupplyDuration")) { + this.expectedSupplyDuration = new Duration(); + return this.expectedSupplyDuration; + } + else + return super.addChild(name); + } + + public MedicationOrderDispenseRequestComponent copy() { + MedicationOrderDispenseRequestComponent dst = new MedicationOrderDispenseRequestComponent(); + copyValues(dst); + dst.medication = medication == null ? null : medication.copy(); + dst.validityPeriod = validityPeriod == null ? null : validityPeriod.copy(); + dst.numberOfRepeatsAllowed = numberOfRepeatsAllowed == null ? null : numberOfRepeatsAllowed.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.expectedSupplyDuration = expectedSupplyDuration == null ? null : expectedSupplyDuration.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationOrderDispenseRequestComponent)) + return false; + MedicationOrderDispenseRequestComponent o = (MedicationOrderDispenseRequestComponent) other; + return compareDeep(medication, o.medication, true) && compareDeep(validityPeriod, o.validityPeriod, true) + && compareDeep(numberOfRepeatsAllowed, o.numberOfRepeatsAllowed, true) && compareDeep(quantity, o.quantity, true) + && compareDeep(expectedSupplyDuration, o.expectedSupplyDuration, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationOrderDispenseRequestComponent)) + return false; + MedicationOrderDispenseRequestComponent o = (MedicationOrderDispenseRequestComponent) other; + return compareValues(numberOfRepeatsAllowed, o.numberOfRepeatsAllowed, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (medication == null || medication.isEmpty()) && (validityPeriod == null || validityPeriod.isEmpty()) + && (numberOfRepeatsAllowed == null || numberOfRepeatsAllowed.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (expectedSupplyDuration == null || expectedSupplyDuration.isEmpty()); + } + + public String fhirType() { + return "MedicationOrder.dispenseRequest"; + + } + + } + + @Block() + public static class MedicationOrderSubstitutionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code signifying whether a different drug should be dispensed from what was prescribed. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="generic | formulary +", formalDefinition="A code signifying whether a different drug should be dispensed from what was prescribed." ) + protected CodeableConcept type; + + /** + * Indicates the reason for the substitution, or why substitution must or must not be performed. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why should (not) substitution be made", formalDefinition="Indicates the reason for the substitution, or why substitution must or must not be performed." ) + protected CodeableConcept reason; + + private static final long serialVersionUID = 1693602518L; + + /** + * Constructor + */ + public MedicationOrderSubstitutionComponent() { + super(); + } + + /** + * Constructor + */ + public MedicationOrderSubstitutionComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderSubstitutionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) + */ + public MedicationOrderSubstitutionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrderSubstitutionComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) + */ + public MedicationOrderSubstitutionComponent setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug should be dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution, or why substitution must or must not be performed.", 0, java.lang.Integer.MAX_VALUE, reason)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -934964668: // reason + this.reason = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("reason")) + this.reason = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // CodeableConcept + case -934964668: return getReason(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("reason")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else + return super.addChild(name); + } + + public MedicationOrderSubstitutionComponent copy() { + MedicationOrderSubstitutionComponent dst = new MedicationOrderSubstitutionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.reason = reason == null ? null : reason.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationOrderSubstitutionComponent)) + return false; + MedicationOrderSubstitutionComponent o = (MedicationOrderSubstitutionComponent) other; + return compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationOrderSubstitutionComponent)) + return false; + MedicationOrderSubstitutionComponent o = (MedicationOrderSubstitutionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) + ; + } + + public String fhirType() { + return "MedicationOrder.substitution"; + + } + + } + + /** + * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an entire workflow process where records have to be tracked through an entire system. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External identifier", formalDefinition="External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an entire workflow process where records have to be tracked through an entire system." ) + protected List identifier; + + /** + * A code specifying the state of the order. Generally this will be active or completed state. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | on-hold | completed | entered-in-error | stopped | draft", formalDefinition="A code specifying the state of the order. Generally this will be active or completed state." ) + protected Enumeration status; + + /** + * Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Medication to be taken", formalDefinition="Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * A link to a resource representing the person to whom the medication will be given. + */ + @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) + */ + protected Patient patientTarget; + + /** + * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. + */ + @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Created during encounter/admission/stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + protected Encounter encounterTarget; + + /** + * The date (and perhaps time) when the prescription was written. + */ + @Child(name = "dateWritten", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) + protected DateTimeType dateWritten; + + /** + * The healthcare professional responsible for authorizing the prescription. + */ + @Child(name = "prescriber", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who ordered the medication(s)", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) + protected Reference prescriber; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) + */ + protected Practitioner prescriberTarget; + + /** + * Can be the reason or the indication for writing the prescription. + */ + @Child(name = "reasonCode", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) + protected List reasonCode; + + /** + * Condition that supports why the prescription is being written. + */ + @Child(name = "reasonReference", type = {Condition.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Condition that supports why the prescription is being written", formalDefinition="Condition that supports why the prescription is being written." ) + protected List reasonReference; + /** + * The actual objects that are the target of the reference (Condition that supports why the prescription is being written.) + */ + protected List reasonReferenceTarget; + + + /** + * The date (and perhaps time) when the prescription was stopped. + */ + @Child(name = "dateEnded", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When prescription was stopped", formalDefinition="The date (and perhaps time) when the prescription was stopped." ) + protected DateTimeType dateEnded; + + /** + * The reason why the prescription was stopped, if it was. + */ + @Child(name = "reasonEnded", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why prescription was stopped", formalDefinition="The reason why the prescription was stopped, if it was." ) + protected CodeableConcept reasonEnded; + + /** + * Extra information about the prescription that could not be conveyed by the other attributes. + */ + @Child(name = "note", type = {Annotation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Information about the prescription", formalDefinition="Extra information about the prescription that could not be conveyed by the other attributes." ) + protected List note; + + /** + * Indicates how the medication is to be used by the patient. + */ + @Child(name = "dosageInstruction", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="How medication should be taken", formalDefinition="Indicates how the medication is to be used by the patient." ) + protected List dosageInstruction; + + /** + * Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department. + */ + @Child(name = "dispenseRequest", type = {}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Medication supply authorization", formalDefinition="Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department." ) + protected MedicationOrderDispenseRequestComponent dispenseRequest; + + /** + * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. + */ + @Child(name = "substitution", type = {}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Any restrictions on medication substitution", formalDefinition="Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done." ) + protected MedicationOrderSubstitutionComponent substitution; + + /** + * A link to a resource representing an earlier order or prescription that this order supersedes. + */ + @Child(name = "priorPrescription", type = {MedicationOrder.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An order/prescription that this supersedes", formalDefinition="A link to a resource representing an earlier order or prescription that this order supersedes." ) + protected Reference priorPrescription; + + /** + * The actual object that is the target of the reference (A link to a resource representing an earlier order or prescription that this order supersedes.) + */ + protected MedicationOrder priorPrescriptionTarget; + + private static final long serialVersionUID = -1031457736L; + + /** + * Constructor + */ + public MedicationOrder() { + super(); + } + + /** + * Constructor + */ + public MedicationOrder(Type medication) { + super(); + this.medication = medication; + } + + /** + * @return {@link #identifier} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an entire workflow process where records have to be tracked through an entire system.) + */ + 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} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an entire workflow process where records have to be tracked through an entire system.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public MedicationOrder addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). 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 MedicationOrder.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MedicationOrderStatusEnumFactory()); // bb + 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} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationOrder setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the order. Generally this will be active or completed state. + */ + public MedicationOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the order. Generally this will be active or completed state. + */ + public MedicationOrder setStatus(MedicationOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new MedicationOrderStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws FHIRException { + if (!(this.medication instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + public boolean hasMedicationCodeableConcept() { + return this.medication instanceof CodeableConcept; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws FHIRException { + if (!(this.medication instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedicationReference() { + return this.medication instanceof Reference; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationOrder setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationOrder 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. (A link to a resource representing the person to whom the medication will be given.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationOrder setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public MedicationOrder 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public MedicationOrder setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public DateTimeType getDateWrittenElement() { + if (this.dateWritten == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.dateWritten"); + else if (Configuration.doAutoCreate()) + this.dateWritten = new DateTimeType(); // bb + return this.dateWritten; + } + + public boolean hasDateWrittenElement() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + public boolean hasDateWritten() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + /** + * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public MedicationOrder setDateWrittenElement(DateTimeType value) { + this.dateWritten = value; + return this; + } + + /** + * @return The date (and perhaps time) when the prescription was written. + */ + public Date getDateWritten() { + return this.dateWritten == null ? null : this.dateWritten.getValue(); + } + + /** + * @param value The date (and perhaps time) when the prescription was written. + */ + public MedicationOrder setDateWritten(Date value) { + if (value == null) + this.dateWritten = null; + else { + if (this.dateWritten == null) + this.dateWritten = new DateTimeType(); + this.dateWritten.setValue(value); + } + return this; + } + + /** + * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public Reference getPrescriber() { + if (this.prescriber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriber = new Reference(); // cc + return this.prescriber; + } + + public boolean hasPrescriber() { + return this.prescriber != null && !this.prescriber.isEmpty(); + } + + /** + * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public MedicationOrder setPrescriber(Reference value) { + this.prescriber = value; + return this; + } + + /** + * @return {@link #prescriber} 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 healthcare professional responsible for authorizing the prescription.) + */ + public Practitioner getPrescriberTarget() { + if (this.prescriberTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriberTarget = new Practitioner(); // aa + return this.prescriberTarget; + } + + /** + * @param value {@link #prescriber} 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 healthcare professional responsible for authorizing the prescription.) + */ + public MedicationOrder setPrescriberTarget(Practitioner value) { + this.prescriberTarget = value; + return this; + } + + /** + * @return {@link #reasonCode} (Can be the reason or the indication for writing the prescription.) + */ + public List getReasonCode() { + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + return this.reasonCode; + } + + public boolean hasReasonCode() { + if (this.reasonCode == null) + return false; + for (CodeableConcept item : this.reasonCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonCode} (Can be the reason or the indication for writing the prescription.) + */ + // syntactic sugar + public CodeableConcept addReasonCode() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + this.reasonCode.add(t); + return t; + } + + // syntactic sugar + public MedicationOrder addReasonCode(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + this.reasonCode.add(t); + return this; + } + + /** + * @return {@link #reasonReference} (Condition that supports why the prescription is being written.) + */ + public List getReasonReference() { + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + return this.reasonReference; + } + + public boolean hasReasonReference() { + if (this.reasonReference == null) + return false; + for (Reference item : this.reasonReference) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonReference} (Condition that supports why the prescription is being written.) + */ + // syntactic sugar + public Reference addReasonReference() { //3 + Reference t = new Reference(); + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + this.reasonReference.add(t); + return t; + } + + // syntactic sugar + public MedicationOrder addReasonReference(Reference t) { //3 + if (t == null) + return this; + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + this.reasonReference.add(t); + return this; + } + + /** + * @return {@link #reasonReference} (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. Condition that supports why the prescription is being written.) + */ + public List getReasonReferenceTarget() { + if (this.reasonReferenceTarget == null) + this.reasonReferenceTarget = new ArrayList(); + return this.reasonReferenceTarget; + } + + // syntactic sugar + /** + * @return {@link #reasonReference} (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. Condition that supports why the prescription is being written.) + */ + public Condition addReasonReferenceTarget() { + Condition r = new Condition(); + if (this.reasonReferenceTarget == null) + this.reasonReferenceTarget = new ArrayList(); + this.reasonReferenceTarget.add(r); + return r; + } + + /** + * @return {@link #dateEnded} (The date (and perhaps time) when the prescription was stopped.). This is the underlying object with id, value and extensions. The accessor "getDateEnded" gives direct access to the value + */ + public DateTimeType getDateEndedElement() { + if (this.dateEnded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.dateEnded"); + else if (Configuration.doAutoCreate()) + this.dateEnded = new DateTimeType(); // bb + return this.dateEnded; + } + + public boolean hasDateEndedElement() { + return this.dateEnded != null && !this.dateEnded.isEmpty(); + } + + public boolean hasDateEnded() { + return this.dateEnded != null && !this.dateEnded.isEmpty(); + } + + /** + * @param value {@link #dateEnded} (The date (and perhaps time) when the prescription was stopped.). This is the underlying object with id, value and extensions. The accessor "getDateEnded" gives direct access to the value + */ + public MedicationOrder setDateEndedElement(DateTimeType value) { + this.dateEnded = value; + return this; + } + + /** + * @return The date (and perhaps time) when the prescription was stopped. + */ + public Date getDateEnded() { + return this.dateEnded == null ? null : this.dateEnded.getValue(); + } + + /** + * @param value The date (and perhaps time) when the prescription was stopped. + */ + public MedicationOrder setDateEnded(Date value) { + if (value == null) + this.dateEnded = null; + else { + if (this.dateEnded == null) + this.dateEnded = new DateTimeType(); + this.dateEnded.setValue(value); + } + return this; + } + + /** + * @return {@link #reasonEnded} (The reason why the prescription was stopped, if it was.) + */ + public CodeableConcept getReasonEnded() { + if (this.reasonEnded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.reasonEnded"); + else if (Configuration.doAutoCreate()) + this.reasonEnded = new CodeableConcept(); // cc + return this.reasonEnded; + } + + public boolean hasReasonEnded() { + return this.reasonEnded != null && !this.reasonEnded.isEmpty(); + } + + /** + * @param value {@link #reasonEnded} (The reason why the prescription was stopped, if it was.) + */ + public MedicationOrder setReasonEnded(CodeableConcept value) { + this.reasonEnded = value; + return this; + } + + /** + * @return {@link #note} (Extra information about the prescription that could not be conveyed by the other attributes.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Extra information about the prescription that could not be conveyed by the other attributes.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public MedicationOrder addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) + */ + public List getDosageInstruction() { + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + return this.dosageInstruction; + } + + public boolean hasDosageInstruction() { + if (this.dosageInstruction == null) + return false; + for (MedicationOrderDosageInstructionComponent item : this.dosageInstruction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) + */ + // syntactic sugar + public MedicationOrderDosageInstructionComponent addDosageInstruction() { //3 + MedicationOrderDosageInstructionComponent t = new MedicationOrderDosageInstructionComponent(); + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return t; + } + + // syntactic sugar + public MedicationOrder addDosageInstruction(MedicationOrderDosageInstructionComponent t) { //3 + if (t == null) + return this; + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return this; + } + + /** + * @return {@link #dispenseRequest} (Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.) + */ + public MedicationOrderDispenseRequestComponent getDispenseRequest() { + if (this.dispenseRequest == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.dispenseRequest"); + else if (Configuration.doAutoCreate()) + this.dispenseRequest = new MedicationOrderDispenseRequestComponent(); // cc + return this.dispenseRequest; + } + + public boolean hasDispenseRequest() { + return this.dispenseRequest != null && !this.dispenseRequest.isEmpty(); + } + + /** + * @param value {@link #dispenseRequest} (Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.) + */ + public MedicationOrder setDispenseRequest(MedicationOrderDispenseRequestComponent value) { + this.dispenseRequest = value; + return this; + } + + /** + * @return {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) + */ + public MedicationOrderSubstitutionComponent getSubstitution() { + if (this.substitution == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.substitution"); + else if (Configuration.doAutoCreate()) + this.substitution = new MedicationOrderSubstitutionComponent(); // cc + return this.substitution; + } + + public boolean hasSubstitution() { + return this.substitution != null && !this.substitution.isEmpty(); + } + + /** + * @param value {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) + */ + public MedicationOrder setSubstitution(MedicationOrderSubstitutionComponent value) { + this.substitution = value; + return this; + } + + /** + * @return {@link #priorPrescription} (A link to a resource representing an earlier order or prescription that this order supersedes.) + */ + public Reference getPriorPrescription() { + if (this.priorPrescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.priorPrescription"); + else if (Configuration.doAutoCreate()) + this.priorPrescription = new Reference(); // cc + return this.priorPrescription; + } + + public boolean hasPriorPrescription() { + return this.priorPrescription != null && !this.priorPrescription.isEmpty(); + } + + /** + * @param value {@link #priorPrescription} (A link to a resource representing an earlier order or prescription that this order supersedes.) + */ + public MedicationOrder setPriorPrescription(Reference value) { + this.priorPrescription = value; + return this; + } + + /** + * @return {@link #priorPrescription} 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 link to a resource representing an earlier order or prescription that this order supersedes.) + */ + public MedicationOrder getPriorPrescriptionTarget() { + if (this.priorPrescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationOrder.priorPrescription"); + else if (Configuration.doAutoCreate()) + this.priorPrescriptionTarget = new MedicationOrder(); // aa + return this.priorPrescriptionTarget; + } + + /** + * @param value {@link #priorPrescription} 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 link to a resource representing an earlier order or prescription that this order supersedes.) + */ + public MedicationOrder setPriorPrescriptionTarget(MedicationOrder value) { + this.priorPrescriptionTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an entire workflow process where records have to be tracked through an entire system.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the order. Generally this will be active or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); + childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); + childrenList.add(new Property("reasonCode", "CodeableConcept", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reasonCode)); + childrenList.add(new Property("reasonReference", "Reference(Condition)", "Condition that supports why the prescription is being written.", 0, java.lang.Integer.MAX_VALUE, reasonReference)); + childrenList.add(new Property("dateEnded", "dateTime", "The date (and perhaps time) when the prescription was stopped.", 0, java.lang.Integer.MAX_VALUE, dateEnded)); + childrenList.add(new Property("reasonEnded", "CodeableConcept", "The reason why the prescription was stopped, if it was.", 0, java.lang.Integer.MAX_VALUE, reasonEnded)); + childrenList.add(new Property("note", "Annotation", "Extra information about the prescription that could not be conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); + childrenList.add(new Property("dispenseRequest", "", "Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.", 0, java.lang.Integer.MAX_VALUE, dispenseRequest)); + childrenList.add(new Property("substitution", "", "Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.", 0, java.lang.Integer.MAX_VALUE, substitution)); + childrenList.add(new Property("priorPrescription", "Reference(MedicationOrder)", "A link to a resource representing an earlier order or prescription that this order supersedes.", 0, java.lang.Integer.MAX_VALUE, priorPrescription)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -1496880759: /*dateWritten*/ return this.dateWritten == null ? new Base[0] : new Base[] {this.dateWritten}; // DateTimeType + case 1430631077: /*prescriber*/ return this.prescriber == null ? new Base[0] : new Base[] {this.prescriber}; // Reference + case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept + case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference + case -273053780: /*dateEnded*/ return this.dateEnded == null ? new Base[0] : new Base[] {this.dateEnded}; // DateTimeType + case 913248982: /*reasonEnded*/ return this.reasonEnded == null ? new Base[0] : new Base[] {this.reasonEnded}; // CodeableConcept + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case -1201373865: /*dosageInstruction*/ return this.dosageInstruction == null ? new Base[0] : this.dosageInstruction.toArray(new Base[this.dosageInstruction.size()]); // MedicationOrderDosageInstructionComponent + case 824620658: /*dispenseRequest*/ return this.dispenseRequest == null ? new Base[0] : new Base[] {this.dispenseRequest}; // MedicationOrderDispenseRequestComponent + case 826147581: /*substitution*/ return this.substitution == null ? new Base[0] : new Base[] {this.substitution}; // MedicationOrderSubstitutionComponent + case -486355964: /*priorPrescription*/ return this.priorPrescription == null ? new Base[0] : new Base[] {this.priorPrescription}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new MedicationOrderStatusEnumFactory().fromType(value); // Enumeration + break; + case 1998965455: // medication + this.medication = (Type) value; // Type + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -1496880759: // dateWritten + this.dateWritten = castToDateTime(value); // DateTimeType + break; + case 1430631077: // prescriber + this.prescriber = castToReference(value); // Reference + break; + case 722137681: // reasonCode + this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1146218137: // reasonReference + this.getReasonReference().add(castToReference(value)); // Reference + break; + case -273053780: // dateEnded + this.dateEnded = castToDateTime(value); // DateTimeType + break; + case 913248982: // reasonEnded + this.reasonEnded = castToCodeableConcept(value); // CodeableConcept + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case -1201373865: // dosageInstruction + this.getDosageInstruction().add((MedicationOrderDosageInstructionComponent) value); // MedicationOrderDosageInstructionComponent + break; + case 824620658: // dispenseRequest + this.dispenseRequest = (MedicationOrderDispenseRequestComponent) value; // MedicationOrderDispenseRequestComponent + break; + case 826147581: // substitution + this.substitution = (MedicationOrderSubstitutionComponent) value; // MedicationOrderSubstitutionComponent + break; + case -486355964: // priorPrescription + this.priorPrescription = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new MedicationOrderStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("medication[x]")) + this.medication = (Type) value; // Type + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("dateWritten")) + this.dateWritten = castToDateTime(value); // DateTimeType + else if (name.equals("prescriber")) + this.prescriber = castToReference(value); // Reference + else if (name.equals("reasonCode")) + this.getReasonCode().add(castToCodeableConcept(value)); + else if (name.equals("reasonReference")) + this.getReasonReference().add(castToReference(value)); + else if (name.equals("dateEnded")) + this.dateEnded = castToDateTime(value); // DateTimeType + else if (name.equals("reasonEnded")) + this.reasonEnded = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("dosageInstruction")) + this.getDosageInstruction().add((MedicationOrderDosageInstructionComponent) value); + else if (name.equals("dispenseRequest")) + this.dispenseRequest = (MedicationOrderDispenseRequestComponent) value; // MedicationOrderDispenseRequestComponent + else if (name.equals("substitution")) + this.substitution = (MedicationOrderSubstitutionComponent) value; // MedicationOrderSubstitutionComponent + else if (name.equals("priorPrescription")) + this.priorPrescription = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1458402129: return getMedication(); // Type + case -791418107: return getPatient(); // Reference + case 1524132147: return getEncounter(); // Reference + case -1496880759: throw new FHIRException("Cannot make property dateWritten as it is not a complex type"); // DateTimeType + case 1430631077: return getPrescriber(); // Reference + case 722137681: return addReasonCode(); // CodeableConcept + case -1146218137: return addReasonReference(); // Reference + case -273053780: throw new FHIRException("Cannot make property dateEnded as it is not a complex type"); // DateTimeType + case 913248982: return getReasonEnded(); // CodeableConcept + case 3387378: return addNote(); // Annotation + case -1201373865: return addDosageInstruction(); // MedicationOrderDosageInstructionComponent + case 824620658: return getDispenseRequest(); // MedicationOrderDispenseRequestComponent + case 826147581: return getSubstitution(); // MedicationOrderSubstitutionComponent + case -486355964: return getPriorPrescription(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.status"); + } + else if (name.equals("medicationCodeableConcept")) { + this.medication = new CodeableConcept(); + return this.medication; + } + else if (name.equals("medicationReference")) { + this.medication = new Reference(); + return this.medication; + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("dateWritten")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.dateWritten"); + } + else if (name.equals("prescriber")) { + this.prescriber = new Reference(); + return this.prescriber; + } + else if (name.equals("reasonCode")) { + return addReasonCode(); + } + else if (name.equals("reasonReference")) { + return addReasonReference(); + } + else if (name.equals("dateEnded")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.dateEnded"); + } + else if (name.equals("reasonEnded")) { + this.reasonEnded = new CodeableConcept(); + return this.reasonEnded; + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("dosageInstruction")) { + return addDosageInstruction(); + } + else if (name.equals("dispenseRequest")) { + this.dispenseRequest = new MedicationOrderDispenseRequestComponent(); + return this.dispenseRequest; + } + else if (name.equals("substitution")) { + this.substitution = new MedicationOrderSubstitutionComponent(); + return this.substitution; + } + else if (name.equals("priorPrescription")) { + this.priorPrescription = new Reference(); + return this.priorPrescription; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "MedicationOrder"; + + } + + public MedicationOrder copy() { + MedicationOrder dst = new MedicationOrder(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.medication = medication == null ? null : medication.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); + dst.prescriber = prescriber == null ? null : prescriber.copy(); + if (reasonCode != null) { + dst.reasonCode = new ArrayList(); + for (CodeableConcept i : reasonCode) + dst.reasonCode.add(i.copy()); + }; + if (reasonReference != null) { + dst.reasonReference = new ArrayList(); + for (Reference i : reasonReference) + dst.reasonReference.add(i.copy()); + }; + dst.dateEnded = dateEnded == null ? null : dateEnded.copy(); + dst.reasonEnded = reasonEnded == null ? null : reasonEnded.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + if (dosageInstruction != null) { + dst.dosageInstruction = new ArrayList(); + for (MedicationOrderDosageInstructionComponent i : dosageInstruction) + dst.dosageInstruction.add(i.copy()); + }; + dst.dispenseRequest = dispenseRequest == null ? null : dispenseRequest.copy(); + dst.substitution = substitution == null ? null : substitution.copy(); + dst.priorPrescription = priorPrescription == null ? null : priorPrescription.copy(); + return dst; + } + + protected MedicationOrder typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationOrder)) + return false; + MedicationOrder o = (MedicationOrder) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) + && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) && compareDeep(dateWritten, o.dateWritten, true) + && compareDeep(prescriber, o.prescriber, true) && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true) + && compareDeep(dateEnded, o.dateEnded, true) && compareDeep(reasonEnded, o.reasonEnded, true) && compareDeep(note, o.note, true) + && compareDeep(dosageInstruction, o.dosageInstruction, true) && compareDeep(dispenseRequest, o.dispenseRequest, true) + && compareDeep(substitution, o.substitution, true) && compareDeep(priorPrescription, o.priorPrescription, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationOrder)) + return false; + MedicationOrder o = (MedicationOrder) other; + return compareValues(status, o.status, true) && compareValues(dateWritten, o.dateWritten, true) && compareValues(dateEnded, o.dateEnded, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (medication == null || medication.isEmpty()) && (patient == null || patient.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) + && (prescriber == null || prescriber.isEmpty()) && (reasonCode == null || reasonCode.isEmpty()) + && (reasonReference == null || reasonReference.isEmpty()) && (dateEnded == null || dateEnded.isEmpty()) + && (reasonEnded == null || reasonEnded.isEmpty()) && (note == null || note.isEmpty()) && (dosageInstruction == null || dosageInstruction.isEmpty()) + && (dispenseRequest == null || dispenseRequest.isEmpty()) && (substitution == null || substitution.isEmpty()) + && (priorPrescription == null || priorPrescription.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationOrder; + } + + /** + * Search parameter: medication + *

+ * Description: Return administrations of this medication reference
+ * Type: reference
+ * Path: MedicationOrder.medicationReference
+ *

+ */ + @SearchParamDefinition(name="medication", path="MedicationOrder.medication.as(Reference)", description="Return administrations of this medication reference", type="reference" ) + public static final String SP_MEDICATION = "medication"; + /** + * Fluent Client search parameter constant for medication + *

+ * Description: Return administrations of this medication reference
+ * Type: reference
+ * Path: MedicationOrder.medicationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationOrder:medication". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationOrder:medication").toLocked(); + + /** + * Search parameter: datewritten + *

+ * Description: Return prescriptions written on this date
+ * Type: date
+ * Path: MedicationOrder.dateWritten
+ *

+ */ + @SearchParamDefinition(name="datewritten", path="MedicationOrder.dateWritten", description="Return prescriptions written on this date", type="date" ) + public static final String SP_DATEWRITTEN = "datewritten"; + /** + * Fluent Client search parameter constant for datewritten + *

+ * Description: Return prescriptions written on this date
+ * Type: date
+ * Path: MedicationOrder.dateWritten
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATEWRITTEN = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATEWRITTEN); + + /** + * Search parameter: patient + *

+ * Description: The identity of a patient to list orders for
+ * Type: reference
+ * Path: MedicationOrder.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="MedicationOrder.patient", description="The identity of a patient to list orders for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of a patient to list orders for
+ * Type: reference
+ * Path: MedicationOrder.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationOrder:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationOrder:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: Status of the prescription
+ * Type: token
+ * Path: MedicationOrder.status
+ *

+ */ + @SearchParamDefinition(name="status", path="MedicationOrder.status", description="Status of the prescription", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the prescription
+ * Type: token
+ * Path: MedicationOrder.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: prescriber + *

+ * Description: Who ordered the medication(s)
+ * Type: reference
+ * Path: MedicationOrder.prescriber
+ *

+ */ + @SearchParamDefinition(name="prescriber", path="MedicationOrder.prescriber", description="Who ordered the medication(s)", type="reference" ) + public static final String SP_PRESCRIBER = "prescriber"; + /** + * Fluent Client search parameter constant for prescriber + *

+ * Description: Who ordered the medication(s)
+ * Type: reference
+ * Path: MedicationOrder.prescriber
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIBER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationOrder:prescriber". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIBER = new ca.uhn.fhir.model.api.Include("MedicationOrder:prescriber").toLocked(); + + /** + * Search parameter: code + *

+ * Description: Return administrations of this medication code
+ * Type: token
+ * Path: MedicationOrder.medicationCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="code", path="MedicationOrder.medication.as(CodeableConcept)", description="Return administrations of this medication code", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Return administrations of this medication code
+ * Type: token
+ * Path: MedicationOrder.medicationCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: encounter + *

+ * Description: Return prescriptions with this encounter identifier
+ * Type: reference
+ * Path: MedicationOrder.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="MedicationOrder.encounter", description="Return prescriptions with this encounter identifier", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Return prescriptions with this encounter identifier
+ * Type: reference
+ * Path: MedicationOrder.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationOrder:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("MedicationOrder:encounter").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Return prescriptions with this external identifier
+ * Type: token
+ * Path: MedicationOrder.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="MedicationOrder.identifier", description="Return prescriptions with this external identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Return prescriptions with this external identifier
+ * Type: token
+ * Path: MedicationOrder.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationStatement.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationStatement.java new file mode 100644 index 00000000000..93eefc07919 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MedicationStatement.java @@ -0,0 +1,1935 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. + */ +@ResourceDef(name="MedicationStatement", profile="http://hl7.org/fhir/Profile/MedicationStatement") +public class MedicationStatement extends DomainResource { + + public enum MedicationStatementStatus { + /** + * The medication is still being taken. + */ + ACTIVE, + /** + * The medication is no longer being taken. + */ + COMPLETED, + /** + * The statement was entered in error. + */ + ENTEREDINERROR, + /** + * The medication may be taken at some time in the future. + */ + INTENDED, + /** + * added to help the parsers + */ + NULL; + public static MedicationStatementStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("intended".equals(codeString)) + return INTENDED; + throw new FHIRException("Unknown MedicationStatementStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + case INTENDED: return "intended"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return "http://hl7.org/fhir/medication-statement-status"; + case COMPLETED: return "http://hl7.org/fhir/medication-statement-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/medication-statement-status"; + case INTENDED: return "http://hl7.org/fhir/medication-statement-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The medication is still being taken."; + case COMPLETED: return "The medication is no longer being taken."; + case ENTEREDINERROR: return "The statement was entered in error."; + case INTENDED: return "The medication may be taken at some time in the future."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in Error"; + case INTENDED: return "Intended"; + default: return "?"; + } + } + } + + public static class MedicationStatementStatusEnumFactory implements EnumFactory { + public MedicationStatementStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return MedicationStatementStatus.ACTIVE; + if ("completed".equals(codeString)) + return MedicationStatementStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return MedicationStatementStatus.ENTEREDINERROR; + if ("intended".equals(codeString)) + return MedicationStatementStatus.INTENDED; + throw new IllegalArgumentException("Unknown MedicationStatementStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return new Enumeration(this, MedicationStatementStatus.ACTIVE); + if ("completed".equals(codeString)) + return new Enumeration(this, MedicationStatementStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, MedicationStatementStatus.ENTEREDINERROR); + if ("intended".equals(codeString)) + return new Enumeration(this, MedicationStatementStatus.INTENDED); + throw new FHIRException("Unknown MedicationStatementStatus code '"+codeString+"'"); + } + public String toCode(MedicationStatementStatus code) { + if (code == MedicationStatementStatus.ACTIVE) + return "active"; + if (code == MedicationStatementStatus.COMPLETED) + return "completed"; + if (code == MedicationStatementStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == MedicationStatementStatus.INTENDED) + return "intended"; + return "?"; + } + public String toSystem(MedicationStatementStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class MedicationStatementDosageComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans. + */ + @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Free text dosage instructions as reported by the information source", formalDefinition="Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans." ) + protected StringType text; + + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "timing", type = {Timing.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When/how often was medication taken", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"." ) + protected Timing timing; + + /** + * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule. + */ + @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Take \"as needed\" (for x)", formalDefinition="Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). \n\nSpecifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule." ) + protected Type asNeeded; + + /** + * A coded specification of or a reference to the anatomic site where the medication first enters the body. + */ + @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where (on body) medication is/was administered", formalDefinition="A coded specification of or a reference to the anatomic site where the medication first enters the body." ) + protected Type site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. + */ + @Child(name = "route", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How the medication entered the body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) + protected CodeableConcept route; + + /** + * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Technique used to administer medication", formalDefinition="A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name = "quantity", type = {SimpleQuantity.class, Range.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Type quantity; + + /** + * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. + */ + @Child(name = "rate", type = {Ratio.class, Range.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) + protected Type rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours. + */ + @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Maximum dose that was consumed per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = 246880733L; + + /** + * Constructor + */ + public MedicationStatementDosageComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationStatementDosageComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans. + */ + public MedicationStatementDosageComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #timing} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getTiming() { + if (this.timing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.timing"); + else if (Configuration.doAutoCreate()) + this.timing = new Timing(); // cc + return this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationStatementDosageComponent setTiming(Timing value) { + this.timing = value; + return this; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) + */ + public BooleanType getAsNeededBooleanType() throws FHIRException { + if (!(this.asNeeded instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + public boolean hasAsNeededBooleanType() { + return this.asNeeded instanceof BooleanType; + } + + /** + * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeededCodeableConcept() { + return this.asNeeded instanceof CodeableConcept; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). + +Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) + */ + public MedicationStatementDosageComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of or a reference to the anatomic site where the medication first enters the body.) + */ + public Type getSite() { + return this.site; + } + + /** + * @return {@link #site} (A coded specification of or a reference to the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSiteCodeableConcept() throws FHIRException { + if (!(this.site instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); + return (CodeableConcept) this.site; + } + + public boolean hasSiteCodeableConcept() { + return this.site instanceof CodeableConcept; + } + + /** + * @return {@link #site} (A coded specification of or a reference to the anatomic site where the medication first enters the body.) + */ + public Reference getSiteReference() throws FHIRException { + if (!(this.site instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); + return (Reference) this.site; + } + + public boolean hasSiteReference() { + return this.site instanceof Reference; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of or a reference to the anatomic site where the medication first enters the body.) + */ + public MedicationStatementDosageComponent setSite(Type value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); // cc + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public MedicationStatementDosageComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.) + */ + public MedicationStatementDosageComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public Type getQuantity() { + return this.quantity; + } + + /** + * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public SimpleQuantity getQuantitySimpleQuantity() throws FHIRException { + if (!(this.quantity instanceof SimpleQuantity)) + throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.quantity.getClass().getName()+" was encountered"); + return (SimpleQuantity) this.quantity; + } + + public boolean hasQuantitySimpleQuantity() { + return this.quantity instanceof SimpleQuantity; + } + + /** + * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public Range getQuantityRange() throws FHIRException { + if (!(this.quantity instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.quantity.getClass().getName()+" was encountered"); + return (Range) this.quantity; + } + + public boolean hasQuantityRange() { + return this.quantity instanceof Range; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationStatementDosageComponent setQuantity(Type value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Type getRate() { + return this.rate; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Ratio getRateRatio() throws FHIRException { + if (!(this.rate instanceof Ratio)) + throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Ratio) this.rate; + } + + public boolean hasRateRatio() { + return this.rate instanceof Ratio; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public Range getRateRange() throws FHIRException { + if (!(this.rate instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Range) this.rate; + } + + public boolean hasRateRange() { + return this.rate instanceof Range; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) + */ + public MedicationStatementDosageComponent setRate(Type value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); // cc + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.) + */ + public MedicationStatementDosageComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("timing", "Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). \n\nSpecifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of or a reference to the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("quantity[x]", "SimpleQuantity|Range", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate[x]", "Ratio|Range", "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Timing + case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type + case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type + case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Type + case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type + case 1506263709: /*maxDosePerPeriod*/ return this.maxDosePerPeriod == null ? new Base[0] : new Base[] {this.maxDosePerPeriod}; // Ratio + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3556653: // text + this.text = castToString(value); // StringType + break; + case -873664438: // timing + this.timing = castToTiming(value); // Timing + break; + case -1432923513: // asNeeded + this.asNeeded = (Type) value; // Type + break; + case 3530567: // site + this.site = (Type) value; // Type + break; + case 108704329: // route + this.route = castToCodeableConcept(value); // CodeableConcept + break; + case -1077554975: // method + this.method = castToCodeableConcept(value); // CodeableConcept + break; + case -1285004149: // quantity + this.quantity = (Type) value; // Type + break; + case 3493088: // rate + this.rate = (Type) value; // Type + break; + case 1506263709: // maxDosePerPeriod + this.maxDosePerPeriod = castToRatio(value); // Ratio + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("timing")) + this.timing = castToTiming(value); // Timing + else if (name.equals("asNeeded[x]")) + this.asNeeded = (Type) value; // Type + else if (name.equals("site[x]")) + this.site = (Type) value; // Type + else if (name.equals("route")) + this.route = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("method")) + this.method = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("quantity[x]")) + this.quantity = (Type) value; // Type + else if (name.equals("rate[x]")) + this.rate = (Type) value; // Type + else if (name.equals("maxDosePerPeriod")) + this.maxDosePerPeriod = castToRatio(value); // Ratio + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case -873664438: return getTiming(); // Timing + case -544329575: return getAsNeeded(); // Type + case 2099997657: return getSite(); // Type + case 108704329: return getRoute(); // CodeableConcept + case -1077554975: return getMethod(); // CodeableConcept + case -515002347: return getQuantity(); // Type + case 983460768: return getRate(); // Type + case 1506263709: return getMaxDosePerPeriod(); // Ratio + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationStatement.text"); + } + else if (name.equals("timing")) { + this.timing = new Timing(); + return this.timing; + } + else if (name.equals("asNeededBoolean")) { + this.asNeeded = new BooleanType(); + return this.asNeeded; + } + else if (name.equals("asNeededCodeableConcept")) { + this.asNeeded = new CodeableConcept(); + return this.asNeeded; + } + else if (name.equals("siteCodeableConcept")) { + this.site = new CodeableConcept(); + return this.site; + } + else if (name.equals("siteReference")) { + this.site = new Reference(); + return this.site; + } + else if (name.equals("route")) { + this.route = new CodeableConcept(); + return this.route; + } + else if (name.equals("method")) { + this.method = new CodeableConcept(); + return this.method; + } + else if (name.equals("quantitySimpleQuantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("quantityRange")) { + this.quantity = new Range(); + return this.quantity; + } + else if (name.equals("rateRatio")) { + this.rate = new Ratio(); + return this.rate; + } + else if (name.equals("rateRange")) { + this.rate = new Range(); + return this.rate; + } + else if (name.equals("maxDosePerPeriod")) { + this.maxDosePerPeriod = new Ratio(); + return this.maxDosePerPeriod; + } + else + return super.addChild(name); + } + + public MedicationStatementDosageComponent copy() { + MedicationStatementDosageComponent dst = new MedicationStatementDosageComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.timing = timing == null ? null : timing.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationStatementDosageComponent)) + return false; + MedicationStatementDosageComponent o = (MedicationStatementDosageComponent) other; + return compareDeep(text, o.text, true) && compareDeep(timing, o.timing, true) && compareDeep(asNeeded, o.asNeeded, true) + && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationStatementDosageComponent)) + return false; + MedicationStatementDosageComponent o = (MedicationStatementDosageComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (timing == null || timing.isEmpty()) + && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) + && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) + && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()); + } + + public String fhirType() { + return "MedicationStatement.dosage"; + + } + + } + + /** + * External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External identifier", formalDefinition="External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) + protected List identifier; + + /** + * A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | completed | entered-in-error | intended", formalDefinition="A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed." ) + protected Enumeration status; + + /** + * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What medication was taken", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Type medication; + + /** + * The person or animal who is/was taking the medication. + */ + @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who is/was taking the medication", formalDefinition="The person or animal who is/was taking the medication." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person or animal who is/was taking the medication.) + */ + protected Patient patientTarget; + + /** + * The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true). + */ + @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Over what period was medication consumed?", formalDefinition="The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true)." ) + protected Type effective; + + /** + * The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder. + */ + @Child(name = "informationSource", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Person who provided the information about the taking of this medication", formalDefinition="The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder." ) + protected Reference informationSource; + + /** + * The actual object that is the target of the reference (The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) + */ + protected Resource informationSourceTarget; + + /** + * Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement. + */ + @Child(name = "supportingInformation", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Additional supporting information", formalDefinition="Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement." ) + protected List supportingInformation; + /** + * The actual objects that are the target of the reference (Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.) + */ + protected List supportingInformationTarget; + + + /** + * The date when the medication statement was asserted by the information source. + */ + @Child(name = "dateAsserted", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the statement was asserted?", formalDefinition="The date when the medication statement was asserted by the information source." ) + protected DateTimeType dateAsserted; + + /** + * Set this to true if the record is saying that the medication was NOT taken. + */ + @Child(name = "wasNotTaken", type = {BooleanType.class}, order=8, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="True if medication is/was not being taken", formalDefinition="Set this to true if the record is saying that the medication was NOT taken." ) + protected BooleanType wasNotTaken; + + /** + * A code indicating why the medication was not taken. + */ + @Child(name = "reasonNotTaken", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="True if asserting medication was not given", formalDefinition="A code indicating why the medication was not taken." ) + protected List reasonNotTaken; + + /** + * A reason for why the medication is being/was taken. + */ + @Child(name = "reasonForUse", type = {CodeableConcept.class, Condition.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="A reason for why the medication is being/was taken." ) + protected Type reasonForUse; + + /** + * Provides extra information about the medication statement that is not conveyed by the other attributes. + */ + @Child(name = "note", type = {Annotation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Further information about the statement", formalDefinition="Provides extra information about the medication statement that is not conveyed by the other attributes." ) + protected List note; + + /** + * Indicates how the medication is/was used by the patient. + */ + @Child(name = "dosage", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) + protected List dosage; + + private static final long serialVersionUID = -425948910L; + + /** + * Constructor + */ + public MedicationStatement() { + super(); + } + + /** + * Constructor + */ + public MedicationStatement(Enumeration status, Type medication, Reference patient) { + super(); + this.status = status; + this.medication = medication; + this.patient = patient; + } + + /** + * @return {@link #identifier} (External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + 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} (External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public MedicationStatement addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.). 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 MedicationStatement.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new MedicationStatementStatusEnumFactory()); // bb + 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} (A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationStatement setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed. + */ + public MedicationStatementStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed. + */ + public MedicationStatement setStatus(MedicationStatementStatus value) { + if (this.status == null) + this.status = new Enumeration(new MedicationStatementStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Type getMedication() { + return this.medication; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public CodeableConcept getMedicationCodeableConcept() throws FHIRException { + if (!(this.medication instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (CodeableConcept) this.medication; + } + + public boolean hasMedicationCodeableConcept() { + return this.medication instanceof CodeableConcept; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedicationReference() throws FHIRException { + if (!(this.medication instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); + return (Reference) this.medication; + } + + public boolean hasMedicationReference() { + return this.medication instanceof Reference; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationStatement setMedication(Type value) { + this.medication = value; + return this; + } + + /** + * @return {@link #patient} (The person or animal who is/was taking the medication.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person or animal who is/was taking the medication.) + */ + public MedicationStatement 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 person or animal who is/was taking the medication.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 person or animal who is/was taking the medication.) + */ + public MedicationStatement setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).) + */ + public Type getEffective() { + return this.effective; + } + + /** + * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).) + */ + public DateTimeType getEffectiveDateTimeType() throws FHIRException { + if (!(this.effective instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (DateTimeType) this.effective; + } + + public boolean hasEffectiveDateTimeType() { + return this.effective instanceof DateTimeType; + } + + /** + * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).) + */ + public Period getEffectivePeriod() throws FHIRException { + if (!(this.effective instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (Period) this.effective; + } + + public boolean hasEffectivePeriod() { + return this.effective instanceof Period; + } + + public boolean hasEffective() { + return this.effective != null && !this.effective.isEmpty(); + } + + /** + * @param value {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).) + */ + public MedicationStatement setEffective(Type value) { + this.effective = value; + return this; + } + + /** + * @return {@link #informationSource} (The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) + */ + public Reference getInformationSource() { + if (this.informationSource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.informationSource"); + else if (Configuration.doAutoCreate()) + this.informationSource = new Reference(); // cc + return this.informationSource; + } + + public boolean hasInformationSource() { + return this.informationSource != null && !this.informationSource.isEmpty(); + } + + /** + * @param value {@link #informationSource} (The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) + */ + public MedicationStatement setInformationSource(Reference value) { + this.informationSource = value; + return this; + } + + /** + * @return {@link #informationSource} 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 who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) + */ + public Resource getInformationSourceTarget() { + return this.informationSourceTarget; + } + + /** + * @param value {@link #informationSource} 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 who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) + */ + public MedicationStatement setInformationSourceTarget(Resource value) { + this.informationSourceTarget = value; + return this; + } + + /** + * @return {@link #supportingInformation} (Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.) + */ + public List getSupportingInformation() { + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + return this.supportingInformation; + } + + public boolean hasSupportingInformation() { + if (this.supportingInformation == null) + return false; + for (Reference item : this.supportingInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingInformation} (Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.) + */ + // syntactic sugar + public Reference addSupportingInformation() { //3 + Reference t = new Reference(); + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return t; + } + + // syntactic sugar + public MedicationStatement addSupportingInformation(Reference t) { //3 + if (t == null) + return this; + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return this; + } + + /** + * @return {@link #supportingInformation} (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. Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.) + */ + public List getSupportingInformationTarget() { + if (this.supportingInformationTarget == null) + this.supportingInformationTarget = new ArrayList(); + return this.supportingInformationTarget; + } + + /** + * @return {@link #dateAsserted} (The date when the medication statement was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value + */ + public DateTimeType getDateAssertedElement() { + if (this.dateAsserted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.dateAsserted"); + else if (Configuration.doAutoCreate()) + this.dateAsserted = new DateTimeType(); // bb + return this.dateAsserted; + } + + public boolean hasDateAssertedElement() { + return this.dateAsserted != null && !this.dateAsserted.isEmpty(); + } + + public boolean hasDateAsserted() { + return this.dateAsserted != null && !this.dateAsserted.isEmpty(); + } + + /** + * @param value {@link #dateAsserted} (The date when the medication statement was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value + */ + public MedicationStatement setDateAssertedElement(DateTimeType value) { + this.dateAsserted = value; + return this; + } + + /** + * @return The date when the medication statement was asserted by the information source. + */ + public Date getDateAsserted() { + return this.dateAsserted == null ? null : this.dateAsserted.getValue(); + } + + /** + * @param value The date when the medication statement was asserted by the information source. + */ + public MedicationStatement setDateAsserted(Date value) { + if (value == null) + this.dateAsserted = null; + else { + if (this.dateAsserted == null) + this.dateAsserted = new DateTimeType(); + this.dateAsserted.setValue(value); + } + return this; + } + + /** + * @return {@link #wasNotTaken} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotTaken" gives direct access to the value + */ + public BooleanType getWasNotTakenElement() { + if (this.wasNotTaken == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.wasNotTaken"); + else if (Configuration.doAutoCreate()) + this.wasNotTaken = new BooleanType(); // bb + return this.wasNotTaken; + } + + public boolean hasWasNotTakenElement() { + return this.wasNotTaken != null && !this.wasNotTaken.isEmpty(); + } + + public boolean hasWasNotTaken() { + return this.wasNotTaken != null && !this.wasNotTaken.isEmpty(); + } + + /** + * @param value {@link #wasNotTaken} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotTaken" gives direct access to the value + */ + public MedicationStatement setWasNotTakenElement(BooleanType value) { + this.wasNotTaken = value; + return this; + } + + /** + * @return Set this to true if the record is saying that the medication was NOT taken. + */ + public boolean getWasNotTaken() { + return this.wasNotTaken == null || this.wasNotTaken.isEmpty() ? false : this.wasNotTaken.getValue(); + } + + /** + * @param value Set this to true if the record is saying that the medication was NOT taken. + */ + public MedicationStatement setWasNotTaken(boolean value) { + if (this.wasNotTaken == null) + this.wasNotTaken = new BooleanType(); + this.wasNotTaken.setValue(value); + return this; + } + + /** + * @return {@link #reasonNotTaken} (A code indicating why the medication was not taken.) + */ + public List getReasonNotTaken() { + if (this.reasonNotTaken == null) + this.reasonNotTaken = new ArrayList(); + return this.reasonNotTaken; + } + + public boolean hasReasonNotTaken() { + if (this.reasonNotTaken == null) + return false; + for (CodeableConcept item : this.reasonNotTaken) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotTaken} (A code indicating why the medication was not taken.) + */ + // syntactic sugar + public CodeableConcept addReasonNotTaken() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotTaken == null) + this.reasonNotTaken = new ArrayList(); + this.reasonNotTaken.add(t); + return t; + } + + // syntactic sugar + public MedicationStatement addReasonNotTaken(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonNotTaken == null) + this.reasonNotTaken = new ArrayList(); + this.reasonNotTaken.add(t); + return this; + } + + /** + * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) + */ + public Type getReasonForUse() { + return this.reasonForUse; + } + + /** + * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) + */ + public CodeableConcept getReasonForUseCodeableConcept() throws FHIRException { + if (!(this.reasonForUse instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reasonForUse.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reasonForUse; + } + + public boolean hasReasonForUseCodeableConcept() { + return this.reasonForUse instanceof CodeableConcept; + } + + /** + * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) + */ + public Reference getReasonForUseReference() throws FHIRException { + if (!(this.reasonForUse instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reasonForUse.getClass().getName()+" was encountered"); + return (Reference) this.reasonForUse; + } + + public boolean hasReasonForUseReference() { + return this.reasonForUse instanceof Reference; + } + + public boolean hasReasonForUse() { + return this.reasonForUse != null && !this.reasonForUse.isEmpty(); + } + + /** + * @param value {@link #reasonForUse} (A reason for why the medication is being/was taken.) + */ + public MedicationStatement setReasonForUse(Type value) { + this.reasonForUse = value; + return this; + } + + /** + * @return {@link #note} (Provides extra information about the medication statement that is not conveyed by the other attributes.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Provides extra information about the medication statement that is not conveyed by the other attributes.) + */ + // syntactic sugar + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public MedicationStatement addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) + */ + public List getDosage() { + if (this.dosage == null) + this.dosage = new ArrayList(); + return this.dosage; + } + + public boolean hasDosage() { + if (this.dosage == null) + return false; + for (MedicationStatementDosageComponent item : this.dosage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) + */ + // syntactic sugar + public MedicationStatementDosageComponent addDosage() { //3 + MedicationStatementDosageComponent t = new MedicationStatementDosageComponent(); + if (this.dosage == null) + this.dosage = new ArrayList(); + this.dosage.add(t); + return t; + } + + // syntactic sugar + public MedicationStatement addDosage(MedicationStatementDosageComponent t) { //3 + if (t == null) + return this; + if (this.dosage == null) + this.dosage = new ArrayList(); + this.dosage.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal who is/was taking the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("effective[x]", "dateTime|Period", "The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).", 0, java.lang.Integer.MAX_VALUE, effective)); + childrenList.add(new Property("informationSource", "Reference(Patient|Practitioner|RelatedPerson)", "The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.", 0, java.lang.Integer.MAX_VALUE, informationSource)); + childrenList.add(new Property("supportingInformation", "Reference(Any)", "Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); + childrenList.add(new Property("dateAsserted", "dateTime", "The date when the medication statement was asserted by the information source.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); + childrenList.add(new Property("wasNotTaken", "boolean", "Set this to true if the record is saying that the medication was NOT taken.", 0, java.lang.Integer.MAX_VALUE, wasNotTaken)); + childrenList.add(new Property("reasonNotTaken", "CodeableConcept", "A code indicating why the medication was not taken.", 0, java.lang.Integer.MAX_VALUE, reasonNotTaken)); + childrenList.add(new Property("reasonForUse[x]", "CodeableConcept|Reference(Condition)", "A reason for why the medication is being/was taken.", 0, java.lang.Integer.MAX_VALUE, reasonForUse)); + childrenList.add(new Property("note", "Annotation", "Provides extra information about the medication statement that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("dosage", "", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type + case -2123220889: /*informationSource*/ return this.informationSource == null ? new Base[0] : new Base[] {this.informationSource}; // Reference + case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference + case -1980855245: /*dateAsserted*/ return this.dateAsserted == null ? new Base[0] : new Base[] {this.dateAsserted}; // DateTimeType + case -1039154243: /*wasNotTaken*/ return this.wasNotTaken == null ? new Base[0] : new Base[] {this.wasNotTaken}; // BooleanType + case 2112880664: /*reasonNotTaken*/ return this.reasonNotTaken == null ? new Base[0] : this.reasonNotTaken.toArray(new Base[this.reasonNotTaken.size()]); // CodeableConcept + case -1724097694: /*reasonForUse*/ return this.reasonForUse == null ? new Base[0] : new Base[] {this.reasonForUse}; // Type + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case -1326018889: /*dosage*/ return this.dosage == null ? new Base[0] : this.dosage.toArray(new Base[this.dosage.size()]); // MedicationStatementDosageComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new MedicationStatementStatusEnumFactory().fromType(value); // Enumeration + break; + case 1998965455: // medication + this.medication = (Type) value; // Type + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -1468651097: // effective + this.effective = (Type) value; // Type + break; + case -2123220889: // informationSource + this.informationSource = castToReference(value); // Reference + break; + case -1248768647: // supportingInformation + this.getSupportingInformation().add(castToReference(value)); // Reference + break; + case -1980855245: // dateAsserted + this.dateAsserted = castToDateTime(value); // DateTimeType + break; + case -1039154243: // wasNotTaken + this.wasNotTaken = castToBoolean(value); // BooleanType + break; + case 2112880664: // reasonNotTaken + this.getReasonNotTaken().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1724097694: // reasonForUse + this.reasonForUse = (Type) value; // Type + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case -1326018889: // dosage + this.getDosage().add((MedicationStatementDosageComponent) value); // MedicationStatementDosageComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new MedicationStatementStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("medication[x]")) + this.medication = (Type) value; // Type + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("effective[x]")) + this.effective = (Type) value; // Type + else if (name.equals("informationSource")) + this.informationSource = castToReference(value); // Reference + else if (name.equals("supportingInformation")) + this.getSupportingInformation().add(castToReference(value)); + else if (name.equals("dateAsserted")) + this.dateAsserted = castToDateTime(value); // DateTimeType + else if (name.equals("wasNotTaken")) + this.wasNotTaken = castToBoolean(value); // BooleanType + else if (name.equals("reasonNotTaken")) + this.getReasonNotTaken().add(castToCodeableConcept(value)); + else if (name.equals("reasonForUse[x]")) + this.reasonForUse = (Type) value; // Type + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("dosage")) + this.getDosage().add((MedicationStatementDosageComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 1458402129: return getMedication(); // Type + case -791418107: return getPatient(); // Reference + case 247104889: return getEffective(); // Type + case -2123220889: return getInformationSource(); // Reference + case -1248768647: return addSupportingInformation(); // Reference + case -1980855245: throw new FHIRException("Cannot make property dateAsserted as it is not a complex type"); // DateTimeType + case -1039154243: throw new FHIRException("Cannot make property wasNotTaken as it is not a complex type"); // BooleanType + case 2112880664: return addReasonNotTaken(); // CodeableConcept + case 919582174: return getReasonForUse(); // Type + case 3387378: return addNote(); // Annotation + case -1326018889: return addDosage(); // MedicationStatementDosageComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationStatement.status"); + } + else if (name.equals("medicationCodeableConcept")) { + this.medication = new CodeableConcept(); + return this.medication; + } + else if (name.equals("medicationReference")) { + this.medication = new Reference(); + return this.medication; + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("effectiveDateTime")) { + this.effective = new DateTimeType(); + return this.effective; + } + else if (name.equals("effectivePeriod")) { + this.effective = new Period(); + return this.effective; + } + else if (name.equals("informationSource")) { + this.informationSource = new Reference(); + return this.informationSource; + } + else if (name.equals("supportingInformation")) { + return addSupportingInformation(); + } + else if (name.equals("dateAsserted")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationStatement.dateAsserted"); + } + else if (name.equals("wasNotTaken")) { + throw new FHIRException("Cannot call addChild on a primitive type MedicationStatement.wasNotTaken"); + } + else if (name.equals("reasonNotTaken")) { + return addReasonNotTaken(); + } + else if (name.equals("reasonForUseCodeableConcept")) { + this.reasonForUse = new CodeableConcept(); + return this.reasonForUse; + } + else if (name.equals("reasonForUseReference")) { + this.reasonForUse = new Reference(); + return this.reasonForUse; + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("dosage")) { + return addDosage(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "MedicationStatement"; + + } + + public MedicationStatement copy() { + MedicationStatement dst = new MedicationStatement(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.medication = medication == null ? null : medication.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.effective = effective == null ? null : effective.copy(); + dst.informationSource = informationSource == null ? null : informationSource.copy(); + if (supportingInformation != null) { + dst.supportingInformation = new ArrayList(); + for (Reference i : supportingInformation) + dst.supportingInformation.add(i.copy()); + }; + dst.dateAsserted = dateAsserted == null ? null : dateAsserted.copy(); + dst.wasNotTaken = wasNotTaken == null ? null : wasNotTaken.copy(); + if (reasonNotTaken != null) { + dst.reasonNotTaken = new ArrayList(); + for (CodeableConcept i : reasonNotTaken) + dst.reasonNotTaken.add(i.copy()); + }; + dst.reasonForUse = reasonForUse == null ? null : reasonForUse.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + if (dosage != null) { + dst.dosage = new ArrayList(); + for (MedicationStatementDosageComponent i : dosage) + dst.dosage.add(i.copy()); + }; + return dst; + } + + protected MedicationStatement typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MedicationStatement)) + return false; + MedicationStatement o = (MedicationStatement) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) + && compareDeep(patient, o.patient, true) && compareDeep(effective, o.effective, true) && compareDeep(informationSource, o.informationSource, true) + && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(dateAsserted, o.dateAsserted, true) + && compareDeep(wasNotTaken, o.wasNotTaken, true) && compareDeep(reasonNotTaken, o.reasonNotTaken, true) + && compareDeep(reasonForUse, o.reasonForUse, true) && compareDeep(note, o.note, true) && compareDeep(dosage, o.dosage, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MedicationStatement)) + return false; + MedicationStatement o = (MedicationStatement) other; + return compareValues(status, o.status, true) && compareValues(dateAsserted, o.dateAsserted, true) && compareValues(wasNotTaken, o.wasNotTaken, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (medication == null || medication.isEmpty()) && (patient == null || patient.isEmpty()) + && (effective == null || effective.isEmpty()) && (informationSource == null || informationSource.isEmpty()) + && (supportingInformation == null || supportingInformation.isEmpty()) && (dateAsserted == null || dateAsserted.isEmpty()) + && (wasNotTaken == null || wasNotTaken.isEmpty()) && (reasonNotTaken == null || reasonNotTaken.isEmpty()) + && (reasonForUse == null || reasonForUse.isEmpty()) && (note == null || note.isEmpty()) && (dosage == null || dosage.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationStatement; + } + + /** + * Search parameter: medication + *

+ * Description: Return administrations of this medication reference
+ * Type: reference
+ * Path: MedicationStatement.medicationReference
+ *

+ */ + @SearchParamDefinition(name="medication", path="MedicationStatement.medication.as(Reference)", description="Return administrations of this medication reference", type="reference" ) + public static final String SP_MEDICATION = "medication"; + /** + * Fluent Client search parameter constant for medication + *

+ * Description: Return administrations of this medication reference
+ * Type: reference
+ * Path: MedicationStatement.medicationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationStatement:medication". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationStatement:medication").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The identity of a patient to list statements for
+ * Type: reference
+ * Path: MedicationStatement.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list statements for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of a patient to list statements for
+ * Type: reference
+ * Path: MedicationStatement.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationStatement:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationStatement:patient").toLocked(); + + /** + * Search parameter: source + *

+ * Description: Who the information in the statement came from
+ * Type: reference
+ * Path: MedicationStatement.informationSource
+ *

+ */ + @SearchParamDefinition(name="source", path="MedicationStatement.informationSource", description="Who the information in the statement came from", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: Who the information in the statement came from
+ * Type: reference
+ * Path: MedicationStatement.informationSource
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MedicationStatement:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("MedicationStatement:source").toLocked(); + + /** + * Search parameter: status + *

+ * Description: Return statements that match the given status
+ * Type: token
+ * Path: MedicationStatement.status
+ *

+ */ + @SearchParamDefinition(name="status", path="MedicationStatement.status", description="Return statements that match the given status", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Return statements that match the given status
+ * Type: token
+ * Path: MedicationStatement.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: code + *

+ * Description: Return administrations of this medication code
+ * Type: token
+ * Path: MedicationStatement.medicationCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="code", path="MedicationStatement.medication.as(CodeableConcept)", description="Return administrations of this medication code", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Return administrations of this medication code
+ * Type: token
+ * Path: MedicationStatement.medicationCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: identifier + *

+ * Description: Return statements with this external identifier
+ * Type: token
+ * Path: MedicationStatement.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="MedicationStatement.identifier", description="Return statements with this external identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Return statements with this external identifier
+ * Type: token
+ * Path: MedicationStatement.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: effective + *

+ * Description: Date when patient was taking (or not taking) the medication
+ * Type: date
+ * Path: MedicationStatement.effective[x]
+ *

+ */ + @SearchParamDefinition(name="effective", path="MedicationStatement.effective", description="Date when patient was taking (or not taking) the medication", type="date" ) + public static final String SP_EFFECTIVE = "effective"; + /** + * Fluent Client search parameter constant for effective + *

+ * Description: Date when patient was taking (or not taking) the medication
+ * Type: date
+ * Path: MedicationStatement.effective[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MessageHeader.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MessageHeader.java new file mode 100644 index 00000000000..12da302dd3d --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/MessageHeader.java @@ -0,0 +1,2236 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + */ +@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/Profile/MessageHeader") +public class MessageHeader extends DomainResource { + + public enum ResponseType { + /** + * The message was accepted and processed without error. + */ + OK, + /** + * Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required. + */ + TRANSIENTERROR, + /** + * The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe the issue. + */ + FATALERROR, + /** + * added to help the parsers + */ + NULL; + public static ResponseType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return OK; + if ("transient-error".equals(codeString)) + return TRANSIENTERROR; + if ("fatal-error".equals(codeString)) + return FATALERROR; + throw new FHIRException("Unknown ResponseType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OK: return "ok"; + case TRANSIENTERROR: return "transient-error"; + case FATALERROR: return "fatal-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OK: return "http://hl7.org/fhir/response-code"; + case TRANSIENTERROR: return "http://hl7.org/fhir/response-code"; + case FATALERROR: return "http://hl7.org/fhir/response-code"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OK: return "The message was accepted and processed without error."; + case TRANSIENTERROR: return "Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required."; + case FATALERROR: return "The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe the issue."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OK: return "OK"; + case TRANSIENTERROR: return "Transient Error"; + case FATALERROR: return "Fatal Error"; + default: return "?"; + } + } + } + + public static class ResponseTypeEnumFactory implements EnumFactory { + public ResponseType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return ResponseType.OK; + if ("transient-error".equals(codeString)) + return ResponseType.TRANSIENTERROR; + if ("fatal-error".equals(codeString)) + return ResponseType.FATALERROR; + throw new IllegalArgumentException("Unknown ResponseType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return new Enumeration(this, ResponseType.OK); + if ("transient-error".equals(codeString)) + return new Enumeration(this, ResponseType.TRANSIENTERROR); + if ("fatal-error".equals(codeString)) + return new Enumeration(this, ResponseType.FATALERROR); + throw new FHIRException("Unknown ResponseType code '"+codeString+"'"); + } + public String toCode(ResponseType code) { + if (code == ResponseType.OK) + return "ok"; + if (code == ResponseType.TRANSIENTERROR) + return "transient-error"; + if (code == ResponseType.FATALERROR) + return "fatal-error"; + return "?"; + } + public String toSystem(ResponseType code) { + return code.getSystem(); + } + } + + @Block() + public static class MessageHeaderResponseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The id of the message that this message is a response to. + */ + @Child(name = "identifier", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Id of original message", formalDefinition="The id of the message that this message is a response to." ) + protected IdType identifier; + + /** + * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + @Child(name = "code", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="ok | transient-error | fatal-error", formalDefinition="Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not." ) + protected Enumeration code; + + /** + * Full details of any issues found in the message. + */ + @Child(name = "details", type = {OperationOutcome.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specific list of hints/warnings/errors", formalDefinition="Full details of any issues found in the message." ) + protected Reference details; + + /** + * The actual object that is the target of the reference (Full details of any issues found in the message.) + */ + protected OperationOutcome detailsTarget; + + private static final long serialVersionUID = -1008716838L; + + /** + * Constructor + */ + public MessageHeaderResponseComponent() { + super(); + } + + /** + * Constructor + */ + public MessageHeaderResponseComponent(IdType identifier, Enumeration code) { + super(); + this.identifier = identifier; + this.code = code; + } + + /** + * @return {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public IdType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new IdType(); // bb + 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} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public MessageHeaderResponseComponent setIdentifierElement(IdType value) { + this.identifier = value; + return this; + } + + /** + * @return The id of the message that this message is a response to. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The id of the message that this message is a response to. + */ + public MessageHeaderResponseComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new IdType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new ResponseTypeEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public MessageHeaderResponseComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + public ResponseType getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + public MessageHeaderResponseComponent setCode(ResponseType value) { + if (this.code == null) + this.code = new Enumeration(new ResponseTypeEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #details} (Full details of any issues found in the message.) + */ + public Reference getDetails() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new Reference(); // cc + return this.details; + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (Full details of any issues found in the message.) + */ + public MessageHeaderResponseComponent setDetails(Reference value) { + this.details = value; + return this; + } + + /** + * @return {@link #details} 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. (Full details of any issues found in the message.) + */ + public OperationOutcome getDetailsTarget() { + if (this.detailsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); + else if (Configuration.doAutoCreate()) + this.detailsTarget = new OperationOutcome(); // aa + return this.detailsTarget; + } + + /** + * @param value {@link #details} 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. (Full details of any issues found in the message.) + */ + public MessageHeaderResponseComponent setDetailsTarget(OperationOutcome value) { + this.detailsTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "id", "The id of the message that this message is a response to.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "code", "Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("details", "Reference(OperationOutcome)", "Full details of any issues found in the message.", 0, java.lang.Integer.MAX_VALUE, details)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // IdType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration + case 1557721666: /*details*/ return this.details == null ? new Base[0] : new Base[] {this.details}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToId(value); // IdType + break; + case 3059181: // code + this.code = new ResponseTypeEnumFactory().fromType(value); // Enumeration + break; + case 1557721666: // details + this.details = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToId(value); // IdType + else if (name.equals("code")) + this.code = new ResponseTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("details")) + this.details = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // IdType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration + case 1557721666: return getDetails(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.identifier"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.code"); + } + else if (name.equals("details")) { + this.details = new Reference(); + return this.details; + } + else + return super.addChild(name); + } + + public MessageHeaderResponseComponent copy() { + MessageHeaderResponseComponent dst = new MessageHeaderResponseComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.code = code == null ? null : code.copy(); + dst.details = details == null ? null : details.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageHeaderResponseComponent)) + return false; + MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageHeaderResponseComponent)) + return false; + MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other; + return compareValues(identifier, o.identifier, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (details == null || details.isEmpty()); + } + + public String fhirType() { + return "MessageHeader.response"; + + } + + } + + @Block() + public static class MessageSourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Human-readable name for the source system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the source system." ) + protected StringType name; + + /** + * May include configuration or other information useful in debugging. + */ + @Child(name = "software", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of software running the system", formalDefinition="May include configuration or other information useful in debugging." ) + protected StringType software; + + /** + * Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Version of software running", formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands." ) + protected StringType version; + + /** + * An e-mail, phone, website or other contact point to use to resolve issues with message communications. + */ + @Child(name = "contact", type = {ContactPoint.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human contact for problems", formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications." ) + protected ContactPoint contact; + + /** + * Identifies the routing target to send acknowledgements to. + */ + @Child(name = "endpoint", type = {UriType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Actual message source address or id", formalDefinition="Identifies the routing target to send acknowledgements to." ) + protected UriType endpoint; + + private static final long serialVersionUID = -115878196L; + + /** + * Constructor + */ + public MessageSourceComponent() { + super(); + } + + /** + * Constructor + */ + public MessageSourceComponent(UriType endpoint) { + super(); + this.endpoint = endpoint; + } + + /** + * @return {@link #name} (Human-readable name for the source system.). 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 MessageSourceComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MessageSourceComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-readable name for the source system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-readable name for the source system. + */ + public MessageSourceComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value + */ + public StringType getSoftwareElement() { + if (this.software == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.software"); + else if (Configuration.doAutoCreate()) + this.software = new StringType(); // bb + return this.software; + } + + public boolean hasSoftwareElement() { + return this.software != null && !this.software.isEmpty(); + } + + public boolean hasSoftware() { + return this.software != null && !this.software.isEmpty(); + } + + /** + * @param value {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value + */ + public MessageSourceComponent setSoftwareElement(StringType value) { + this.software = value; + return this; + } + + /** + * @return May include configuration or other information useful in debugging. + */ + public String getSoftware() { + return this.software == null ? null : this.software.getValue(); + } + + /** + * @param value May include configuration or other information useful in debugging. + */ + public MessageSourceComponent setSoftware(String value) { + if (Utilities.noString(value)) + this.software = null; + else { + if (this.software == null) + this.software = new StringType(); + this.software.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public MessageSourceComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + public MessageSourceComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) + */ + public ContactPoint getContact() { + if (this.contact == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.contact"); + else if (Configuration.doAutoCreate()) + this.contact = new ContactPoint(); // cc + return this.contact; + } + + public boolean hasContact() { + return this.contact != null && !this.contact.isEmpty(); + } + + /** + * @param value {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) + */ + public MessageSourceComponent setContact(ContactPoint value) { + this.contact = value; + return this; + } + + /** + * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); // bb + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public MessageSourceComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return Identifies the routing target to send acknowledgements to. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value Identifies the routing target to send acknowledgements to. + */ + public MessageSourceComponent setEndpoint(String value) { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Human-readable name for the source system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("software", "string", "May include configuration or other information useful in debugging.", 0, java.lang.Integer.MAX_VALUE, software)); + childrenList.add(new Property("version", "string", "Can convey versions of multiple systems in situations where a message passes through multiple hands.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("contact", "ContactPoint", "An e-mail, phone, website or other contact point to use to resolve issues with message communications.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("endpoint", "uri", "Identifies the routing target to send acknowledgements to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 1319330215: /*software*/ return this.software == null ? new Base[0] : new Base[] {this.software}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : new Base[] {this.contact}; // ContactPoint + case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : new Base[] {this.endpoint}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 1319330215: // software + this.software = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 951526432: // contact + this.contact = castToContactPoint(value); // ContactPoint + break; + case 1741102485: // endpoint + this.endpoint = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("software")) + this.software = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("contact")) + this.contact = castToContactPoint(value); // ContactPoint + else if (name.equals("endpoint")) + this.endpoint = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 1319330215: throw new FHIRException("Cannot make property software as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 951526432: return getContact(); // ContactPoint + case 1741102485: throw new FHIRException("Cannot make property endpoint as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.name"); + } + else if (name.equals("software")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.software"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.version"); + } + else if (name.equals("contact")) { + this.contact = new ContactPoint(); + return this.contact; + } + else if (name.equals("endpoint")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.endpoint"); + } + else + return super.addChild(name); + } + + public MessageSourceComponent copy() { + MessageSourceComponent dst = new MessageSourceComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.software = software == null ? null : software.copy(); + dst.version = version == null ? null : version.copy(); + dst.contact = contact == null ? null : contact.copy(); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageSourceComponent)) + return false; + MessageSourceComponent o = (MessageSourceComponent) other; + return compareDeep(name, o.name, true) && compareDeep(software, o.software, true) && compareDeep(version, o.version, true) + && compareDeep(contact, o.contact, true) && compareDeep(endpoint, o.endpoint, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageSourceComponent)) + return false; + MessageSourceComponent o = (MessageSourceComponent) other; + return compareValues(name, o.name, true) && compareValues(software, o.software, true) && compareValues(version, o.version, true) + && compareValues(endpoint, o.endpoint, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (software == null || software.isEmpty()) + && (version == null || version.isEmpty()) && (contact == null || contact.isEmpty()) && (endpoint == null || endpoint.isEmpty()) + ; + } + + public String fhirType() { + return "MessageHeader.source"; + + } + + } + + @Block() + public static class MessageDestinationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Human-readable name for the target system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the target system." ) + protected StringType name; + + /** + * Identifies the target end system in situations where the initial message transmission is to an intermediary system. + */ + @Child(name = "target", type = {Device.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Particular delivery destination within the destination", formalDefinition="Identifies the target end system in situations where the initial message transmission is to an intermediary system." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + protected Device targetTarget; + + /** + * Indicates where the message should be routed to. + */ + @Child(name = "endpoint", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Actual destination address or id", formalDefinition="Indicates where the message should be routed to." ) + protected UriType endpoint; + + private static final long serialVersionUID = -2097633309L; + + /** + * Constructor + */ + public MessageDestinationComponent() { + super(); + } + + /** + * Constructor + */ + public MessageDestinationComponent(UriType endpoint) { + super(); + this.endpoint = endpoint; + } + + /** + * @return {@link #name} (Human-readable name for the target system.). 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 MessageDestinationComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MessageDestinationComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-readable name for the target system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-readable name for the target system. + */ + public MessageDestinationComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public MessageDestinationComponent 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. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public Device getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Device(); // aa + 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. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public MessageDestinationComponent setTargetTarget(Device value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); // bb + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public MessageDestinationComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return Indicates where the message should be routed to. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value Indicates where the message should be routed to. + */ + public MessageDestinationComponent setEndpoint(String value) { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Human-readable name for the target system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("target", "Reference(Device)", "Identifies the target end system in situations where the initial message transmission is to an intermediary system.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("endpoint", "uri", "Indicates where the message should be routed to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference + case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : new Base[] {this.endpoint}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -880905839: // target + this.target = castToReference(value); // Reference + break; + case 1741102485: // endpoint + this.endpoint = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("target")) + this.target = castToReference(value); // Reference + else if (name.equals("endpoint")) + this.endpoint = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -880905839: return getTarget(); // Reference + case 1741102485: throw new FHIRException("Cannot make property endpoint as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.name"); + } + else if (name.equals("target")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("endpoint")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.endpoint"); + } + else + return super.addChild(name); + } + + public MessageDestinationComponent copy() { + MessageDestinationComponent dst = new MessageDestinationComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.target = target == null ? null : target.copy(); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageDestinationComponent)) + return false; + MessageDestinationComponent o = (MessageDestinationComponent) other; + return compareDeep(name, o.name, true) && compareDeep(target, o.target, true) && compareDeep(endpoint, o.endpoint, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageDestinationComponent)) + return false; + MessageDestinationComponent o = (MessageDestinationComponent) other; + return compareValues(name, o.name, true) && compareValues(endpoint, o.endpoint, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (target == null || target.isEmpty()) + && (endpoint == null || endpoint.isEmpty()); + } + + public String fhirType() { + return "MessageHeader.destination"; + + } + + } + + /** + * The time that the message was sent. + */ + @Child(name = "timestamp", type = {InstantType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Time that the message was sent", formalDefinition="The time that the message was sent." ) + protected InstantType timestamp; + + /** + * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-events". + */ + @Child(name = "event", type = {Coding.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="Code for the event this message represents", formalDefinition="Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value \"http://hl7.org/fhir/message-events\"." ) + protected Coding event; + + /** + * Information about the message that this message is a response to. Only present if this message is a response. + */ + @Child(name = "response", type = {}, order=2, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="If this is a reply to prior message", formalDefinition="Information about the message that this message is a response to. Only present if this message is a response." ) + protected MessageHeaderResponseComponent response; + + /** + * The source application from which this message originated. + */ + @Child(name = "source", type = {}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Message Source Application", formalDefinition="The source application from which this message originated." ) + protected MessageSourceComponent source; + + /** + * The destination application which the message is intended for. + */ + @Child(name = "destination", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Message Destination Application(s)", formalDefinition="The destination application which the message is intended for." ) + protected List destination; + + /** + * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions. + */ + @Child(name = "enterer", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The source of the data entry", formalDefinition="The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + protected Practitioner entererTarget; + + /** + * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions. + */ + @Child(name = "author", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The source of the decision", formalDefinition="The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + protected Practitioner authorTarget; + + /** + * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. + */ + @Child(name = "receiver", type = {Practitioner.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Intended \"real-world\" recipient for the data", formalDefinition="Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient." ) + protected Reference receiver; + + /** + * The actual object that is the target of the reference (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + protected Resource receiverTarget; + + /** + * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party. + */ + @Child(name = "responsible", type = {Practitioner.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Final responsibility for event", formalDefinition="The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party." ) + protected Reference responsible; + + /** + * The actual object that is the target of the reference (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + protected Resource responsibleTarget; + + /** + * Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Cause of event", formalDefinition="Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message." ) + protected CodeableConcept reason; + + /** + * The actual data of the message - a reference to the root/focus class of the event. + */ + @Child(name = "data", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The actual content of the message", formalDefinition="The actual data of the message - a reference to the root/focus class of the event." ) + protected List data; + /** + * The actual objects that are the target of the reference (The actual data of the message - a reference to the root/focus class of the event.) + */ + protected List dataTarget; + + + private static final long serialVersionUID = 1429728517L; + + /** + * Constructor + */ + public MessageHeader() { + super(); + } + + /** + * Constructor + */ + public MessageHeader(InstantType timestamp, Coding event, MessageSourceComponent source) { + super(); + this.timestamp = timestamp; + this.event = event; + this.source = source; + } + + /** + * @return {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public InstantType getTimestampElement() { + if (this.timestamp == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.timestamp"); + else if (Configuration.doAutoCreate()) + this.timestamp = new InstantType(); // bb + return this.timestamp; + } + + public boolean hasTimestampElement() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + public boolean hasTimestamp() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + /** + * @param value {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public MessageHeader setTimestampElement(InstantType value) { + this.timestamp = value; + return this; + } + + /** + * @return The time that the message was sent. + */ + public Date getTimestamp() { + return this.timestamp == null ? null : this.timestamp.getValue(); + } + + /** + * @param value The time that the message was sent. + */ + public MessageHeader setTimestamp(Date value) { + if (this.timestamp == null) + this.timestamp = new InstantType(); + this.timestamp.setValue(value); + return this; + } + + /** + * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-events".) + */ + public Coding getEvent() { + if (this.event == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.event"); + else if (Configuration.doAutoCreate()) + this.event = new Coding(); // cc + return this.event; + } + + public boolean hasEvent() { + return this.event != null && !this.event.isEmpty(); + } + + /** + * @param value {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-events".) + */ + public MessageHeader setEvent(Coding value) { + this.event = value; + return this; + } + + /** + * @return {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) + */ + public MessageHeaderResponseComponent getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.response"); + else if (Configuration.doAutoCreate()) + this.response = new MessageHeaderResponseComponent(); // cc + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) + */ + public MessageHeader setResponse(MessageHeaderResponseComponent value) { + this.response = value; + return this; + } + + /** + * @return {@link #source} (The source application from which this message originated.) + */ + public MessageSourceComponent getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.source"); + else if (Configuration.doAutoCreate()) + this.source = new MessageSourceComponent(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The source application from which this message originated.) + */ + public MessageHeader setSource(MessageSourceComponent value) { + this.source = value; + return this; + } + + /** + * @return {@link #destination} (The destination application which the message is intended for.) + */ + public List getDestination() { + if (this.destination == null) + this.destination = new ArrayList(); + return this.destination; + } + + public boolean hasDestination() { + if (this.destination == null) + return false; + for (MessageDestinationComponent item : this.destination) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #destination} (The destination application which the message is intended for.) + */ + // syntactic sugar + public MessageDestinationComponent addDestination() { //3 + MessageDestinationComponent t = new MessageDestinationComponent(); + if (this.destination == null) + this.destination = new ArrayList(); + this.destination.add(t); + return t; + } + + // syntactic sugar + public MessageHeader addDestination(MessageDestinationComponent t) { //3 + if (t == null) + return this; + if (this.destination == null) + this.destination = new ArrayList(); + this.destination.add(t); + return this; + } + + /** + * @return {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); // cc + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public MessageHeader 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. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); // aa + 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. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public MessageHeader setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public MessageHeader setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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 logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public Practitioner getAuthorTarget() { + if (this.authorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.author"); + else if (Configuration.doAutoCreate()) + this.authorTarget = new Practitioner(); // aa + return this.authorTarget; + } + + /** + * @param value {@link #author} 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 logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public MessageHeader setAuthorTarget(Practitioner value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public Reference getReceiver() { + if (this.receiver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.receiver"); + else if (Configuration.doAutoCreate()) + this.receiver = new Reference(); // cc + return this.receiver; + } + + public boolean hasReceiver() { + return this.receiver != null && !this.receiver.isEmpty(); + } + + /** + * @param value {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public MessageHeader setReceiver(Reference value) { + this.receiver = value; + return this; + } + + /** + * @return {@link #receiver} 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. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public Resource getReceiverTarget() { + return this.receiverTarget; + } + + /** + * @param value {@link #receiver} 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. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public MessageHeader setReceiverTarget(Resource value) { + this.receiverTarget = value; + return this; + } + + /** + * @return {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public Reference getResponsible() { + if (this.responsible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.responsible"); + else if (Configuration.doAutoCreate()) + this.responsible = new Reference(); // cc + return this.responsible; + } + + public boolean hasResponsible() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + /** + * @param value {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public MessageHeader setResponsible(Reference value) { + this.responsible = value; + return this; + } + + /** + * @return {@link #responsible} 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 or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public Resource getResponsibleTarget() { + return this.responsibleTarget; + } + + /** + * @param value {@link #responsible} 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 or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public MessageHeader setResponsibleTarget(Resource value) { + this.responsibleTarget = value; + return this; + } + + /** + * @return {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message.) + */ + public MessageHeader setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) + */ + public List getData() { + if (this.data == null) + this.data = new ArrayList(); + return this.data; + } + + public boolean hasData() { + if (this.data == null) + return false; + for (Reference item : this.data) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) + */ + // syntactic sugar + public Reference addData() { //3 + Reference t = new Reference(); + if (this.data == null) + this.data = new ArrayList(); + this.data.add(t); + return t; + } + + // syntactic sugar + public MessageHeader addData(Reference t) { //3 + if (t == null) + return this; + if (this.data == null) + this.data = new ArrayList(); + this.data.add(t); + return this; + } + + /** + * @return {@link #data} (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 actual data of the message - a reference to the root/focus class of the event.) + */ + public List getDataTarget() { + if (this.dataTarget == null) + this.dataTarget = new ArrayList(); + return this.dataTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("timestamp", "instant", "The time that the message was sent.", 0, java.lang.Integer.MAX_VALUE, timestamp)); + childrenList.add(new Property("event", "Coding", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value \"http://hl7.org/fhir/message-events\".", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("response", "", "Information about the message that this message is a response to. Only present if this message is a response.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("source", "", "The source application from which this message originated.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("destination", "", "The destination application which the message is intended for.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("author", "Reference(Practitioner)", "The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("receiver", "Reference(Practitioner|Organization)", "Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.", 0, java.lang.Integer.MAX_VALUE, receiver)); + childrenList.add(new Property("responsible", "Reference(Practitioner|Organization)", "The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.", 0, java.lang.Integer.MAX_VALUE, responsible)); + childrenList.add(new Property("reason", "CodeableConcept", "Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("data", "Reference(Any)", "The actual data of the message - a reference to the root/focus class of the event.", 0, java.lang.Integer.MAX_VALUE, data)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 55126294: /*timestamp*/ return this.timestamp == null ? new Base[0] : new Base[] {this.timestamp}; // InstantType + case 96891546: /*event*/ return this.event == null ? new Base[0] : new Base[] {this.event}; // Coding + case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // MessageHeaderResponseComponent + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // MessageSourceComponent + case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : this.destination.toArray(new Base[this.destination.size()]); // MessageDestinationComponent + case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : new Base[] {this.receiver}; // Reference + case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // Reference + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept + case 3076010: /*data*/ return this.data == null ? new Base[0] : this.data.toArray(new Base[this.data.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 55126294: // timestamp + this.timestamp = castToInstant(value); // InstantType + break; + case 96891546: // event + this.event = castToCoding(value); // Coding + break; + case -340323263: // response + this.response = (MessageHeaderResponseComponent) value; // MessageHeaderResponseComponent + break; + case -896505829: // source + this.source = (MessageSourceComponent) value; // MessageSourceComponent + break; + case -1429847026: // destination + this.getDestination().add((MessageDestinationComponent) value); // MessageDestinationComponent + break; + case -1591951995: // enterer + this.enterer = castToReference(value); // Reference + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case -808719889: // receiver + this.receiver = castToReference(value); // Reference + break; + case 1847674614: // responsible + this.responsible = castToReference(value); // Reference + break; + case -934964668: // reason + this.reason = castToCodeableConcept(value); // CodeableConcept + break; + case 3076010: // data + this.getData().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("timestamp")) + this.timestamp = castToInstant(value); // InstantType + else if (name.equals("event")) + this.event = castToCoding(value); // Coding + else if (name.equals("response")) + this.response = (MessageHeaderResponseComponent) value; // MessageHeaderResponseComponent + else if (name.equals("source")) + this.source = (MessageSourceComponent) value; // MessageSourceComponent + else if (name.equals("destination")) + this.getDestination().add((MessageDestinationComponent) value); + else if (name.equals("enterer")) + this.enterer = castToReference(value); // Reference + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("receiver")) + this.receiver = castToReference(value); // Reference + else if (name.equals("responsible")) + this.responsible = castToReference(value); // Reference + else if (name.equals("reason")) + this.reason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("data")) + this.getData().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 55126294: throw new FHIRException("Cannot make property timestamp as it is not a complex type"); // InstantType + case 96891546: return getEvent(); // Coding + case -340323263: return getResponse(); // MessageHeaderResponseComponent + case -896505829: return getSource(); // MessageSourceComponent + case -1429847026: return addDestination(); // MessageDestinationComponent + case -1591951995: return getEnterer(); // Reference + case -1406328437: return getAuthor(); // Reference + case -808719889: return getReceiver(); // Reference + case 1847674614: return getResponsible(); // Reference + case -934964668: return getReason(); // CodeableConcept + case 3076010: return addData(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("timestamp")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.timestamp"); + } + else if (name.equals("event")) { + this.event = new Coding(); + return this.event; + } + else if (name.equals("response")) { + this.response = new MessageHeaderResponseComponent(); + return this.response; + } + else if (name.equals("source")) { + this.source = new MessageSourceComponent(); + return this.source; + } + else if (name.equals("destination")) { + return addDestination(); + } + else if (name.equals("enterer")) { + this.enterer = new Reference(); + return this.enterer; + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("receiver")) { + this.receiver = new Reference(); + return this.receiver; + } + else if (name.equals("responsible")) { + this.responsible = new Reference(); + return this.responsible; + } + else if (name.equals("reason")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else if (name.equals("data")) { + return addData(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "MessageHeader"; + + } + + public MessageHeader copy() { + MessageHeader dst = new MessageHeader(); + copyValues(dst); + dst.timestamp = timestamp == null ? null : timestamp.copy(); + dst.event = event == null ? null : event.copy(); + dst.response = response == null ? null : response.copy(); + dst.source = source == null ? null : source.copy(); + if (destination != null) { + dst.destination = new ArrayList(); + for (MessageDestinationComponent i : destination) + dst.destination.add(i.copy()); + }; + dst.enterer = enterer == null ? null : enterer.copy(); + dst.author = author == null ? null : author.copy(); + dst.receiver = receiver == null ? null : receiver.copy(); + dst.responsible = responsible == null ? null : responsible.copy(); + dst.reason = reason == null ? null : reason.copy(); + if (data != null) { + dst.data = new ArrayList(); + for (Reference i : data) + dst.data.add(i.copy()); + }; + return dst; + } + + protected MessageHeader typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageHeader)) + return false; + MessageHeader o = (MessageHeader) other; + return compareDeep(timestamp, o.timestamp, true) && compareDeep(event, o.event, true) && compareDeep(response, o.response, true) + && compareDeep(source, o.source, true) && compareDeep(destination, o.destination, true) && compareDeep(enterer, o.enterer, true) + && compareDeep(author, o.author, true) && compareDeep(receiver, o.receiver, true) && compareDeep(responsible, o.responsible, true) + && compareDeep(reason, o.reason, true) && compareDeep(data, o.data, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageHeader)) + return false; + MessageHeader o = (MessageHeader) other; + return compareValues(timestamp, o.timestamp, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (timestamp == null || timestamp.isEmpty()) && (event == null || event.isEmpty()) + && (response == null || response.isEmpty()) && (source == null || source.isEmpty()) && (destination == null || destination.isEmpty()) + && (enterer == null || enterer.isEmpty()) && (author == null || author.isEmpty()) && (receiver == null || receiver.isEmpty()) + && (responsible == null || responsible.isEmpty()) && (reason == null || reason.isEmpty()) + && (data == null || data.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MessageHeader; + } + + /** + * Search parameter: destination-uri + *

+ * Description: Actual destination address or id
+ * Type: uri
+ * Path: MessageHeader.destination.endpoint
+ *

+ */ + @SearchParamDefinition(name="destination-uri", path="MessageHeader.destination.endpoint", description="Actual destination address or id", type="uri" ) + public static final String SP_DESTINATION_URI = "destination-uri"; + /** + * Fluent Client search parameter constant for destination-uri + *

+ * Description: Actual destination address or id
+ * Type: uri
+ * Path: MessageHeader.destination.endpoint
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam DESTINATION_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DESTINATION_URI); + + /** + * Search parameter: receiver + *

+ * Description: Intended "real-world" recipient for the data
+ * Type: reference
+ * Path: MessageHeader.receiver
+ *

+ */ + @SearchParamDefinition(name="receiver", path="MessageHeader.receiver", description="Intended \"real-world\" recipient for the data", type="reference" ) + public static final String SP_RECEIVER = "receiver"; + /** + * Fluent Client search parameter constant for receiver + *

+ * Description: Intended "real-world" recipient for the data
+ * Type: reference
+ * Path: MessageHeader.receiver
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MessageHeader:receiver". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("MessageHeader:receiver").toLocked(); + + /** + * Search parameter: responsible + *

+ * Description: Final responsibility for event
+ * Type: reference
+ * Path: MessageHeader.responsible
+ *

+ */ + @SearchParamDefinition(name="responsible", path="MessageHeader.responsible", description="Final responsibility for event", type="reference" ) + public static final String SP_RESPONSIBLE = "responsible"; + /** + * Fluent Client search parameter constant for responsible + *

+ * Description: Final responsibility for event
+ * Type: reference
+ * Path: MessageHeader.responsible
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSIBLE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSIBLE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MessageHeader:responsible". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSIBLE = new ca.uhn.fhir.model.api.Include("MessageHeader:responsible").toLocked(); + + /** + * Search parameter: data + *

+ * Description: The actual content of the message
+ * Type: reference
+ * Path: MessageHeader.data
+ *

+ */ + @SearchParamDefinition(name="data", path="MessageHeader.data", description="The actual content of the message", type="reference" ) + public static final String SP_DATA = "data"; + /** + * Fluent Client search parameter constant for data + *

+ * Description: The actual content of the message
+ * Type: reference
+ * Path: MessageHeader.data
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DATA = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DATA); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MessageHeader:data". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DATA = new ca.uhn.fhir.model.api.Include("MessageHeader:data").toLocked(); + + /** + * Search parameter: code + *

+ * Description: ok | transient-error | fatal-error
+ * Type: token
+ * Path: MessageHeader.response.code
+ *

+ */ + @SearchParamDefinition(name="code", path="MessageHeader.response.code", description="ok | transient-error | fatal-error", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: ok | transient-error | fatal-error
+ * Type: token
+ * Path: MessageHeader.response.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: response-id + *

+ * Description: Id of original message
+ * Type: token
+ * Path: MessageHeader.response.identifier
+ *

+ */ + @SearchParamDefinition(name="response-id", path="MessageHeader.response.identifier", description="Id of original message", type="token" ) + public static final String SP_RESPONSE_ID = "response-id"; + /** + * Fluent Client search parameter constant for response-id + *

+ * Description: Id of original message
+ * Type: token
+ * Path: MessageHeader.response.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESPONSE_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESPONSE_ID); + + /** + * Search parameter: destination + *

+ * Description: Name of system
+ * Type: string
+ * Path: MessageHeader.destination.name
+ *

+ */ + @SearchParamDefinition(name="destination", path="MessageHeader.destination.name", description="Name of system", type="string" ) + public static final String SP_DESTINATION = "destination"; + /** + * Fluent Client search parameter constant for destination + *

+ * Description: Name of system
+ * Type: string
+ * Path: MessageHeader.destination.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESTINATION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESTINATION); + + /** + * Search parameter: timestamp + *

+ * Description: Time that the message was sent
+ * Type: date
+ * Path: MessageHeader.timestamp
+ *

+ */ + @SearchParamDefinition(name="timestamp", path="MessageHeader.timestamp", description="Time that the message was sent", type="date" ) + public static final String SP_TIMESTAMP = "timestamp"; + /** + * Fluent Client search parameter constant for timestamp + *

+ * Description: Time that the message was sent
+ * Type: date
+ * Path: MessageHeader.timestamp
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam TIMESTAMP = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_TIMESTAMP); + + /** + * Search parameter: author + *

+ * Description: The source of the decision
+ * Type: reference
+ * Path: MessageHeader.author
+ *

+ */ + @SearchParamDefinition(name="author", path="MessageHeader.author", description="The source of the decision", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: The source of the decision
+ * Type: reference
+ * Path: MessageHeader.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MessageHeader:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("MessageHeader:author").toLocked(); + + /** + * Search parameter: source-uri + *

+ * Description: Actual message source address or id
+ * Type: uri
+ * Path: MessageHeader.source.endpoint
+ *

+ */ + @SearchParamDefinition(name="source-uri", path="MessageHeader.source.endpoint", description="Actual message source address or id", type="uri" ) + public static final String SP_SOURCE_URI = "source-uri"; + /** + * Fluent Client search parameter constant for source-uri + *

+ * Description: Actual message source address or id
+ * Type: uri
+ * Path: MessageHeader.source.endpoint
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam SOURCE_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SOURCE_URI); + + /** + * Search parameter: source + *

+ * Description: Name of system
+ * Type: string
+ * Path: MessageHeader.source.name
+ *

+ */ + @SearchParamDefinition(name="source", path="MessageHeader.source.name", description="Name of system", type="string" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: Name of system
+ * Type: string
+ * Path: MessageHeader.source.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam SOURCE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SOURCE); + + /** + * Search parameter: enterer + *

+ * Description: The source of the data entry
+ * Type: reference
+ * Path: MessageHeader.enterer
+ *

+ */ + @SearchParamDefinition(name="enterer", path="MessageHeader.enterer", description="The source of the data entry", type="reference" ) + public static final String SP_ENTERER = "enterer"; + /** + * Fluent Client search parameter constant for enterer + *

+ * Description: The source of the data entry
+ * Type: reference
+ * Path: MessageHeader.enterer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTERER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MessageHeader:enterer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTERER = new ca.uhn.fhir.model.api.Include("MessageHeader:enterer").toLocked(); + + /** + * Search parameter: event + *

+ * Description: Code for the event this message represents
+ * Type: token
+ * Path: MessageHeader.event
+ *

+ */ + @SearchParamDefinition(name="event", path="MessageHeader.event", description="Code for the event this message represents", type="token" ) + public static final String SP_EVENT = "event"; + /** + * Fluent Client search parameter constant for event + *

+ * Description: Code for the event this message represents
+ * Type: token
+ * Path: MessageHeader.event
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT); + + /** + * Search parameter: target + *

+ * Description: Particular delivery destination within the destination
+ * Type: reference
+ * Path: MessageHeader.destination.target
+ *

+ */ + @SearchParamDefinition(name="target", path="MessageHeader.destination.target", description="Particular delivery destination within the destination", type="reference" ) + public static final String SP_TARGET = "target"; + /** + * Fluent Client search parameter constant for target + *

+ * Description: Particular delivery destination within the destination
+ * Type: reference
+ * Path: MessageHeader.destination.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "MessageHeader:target". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("MessageHeader:target").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Meta.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Meta.java new file mode 100644 index 00000000000..b7a8636b61d --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Meta.java @@ -0,0 +1,533 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseMetaType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + */ +@DatatypeDef(name="Meta") +public class Meta extends Type implements IBaseMetaType { + + /** + * The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted. + */ + @Child(name = "versionId", type = {IdType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Version specific identifier", formalDefinition="The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted." ) + protected IdType versionId; + + /** + * When the resource last changed - e.g. when the version changed. + */ + @Child(name = "lastUpdated", type = {InstantType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the resource version last changed", formalDefinition="When the resource last changed - e.g. when the version changed." ) + protected InstantType lastUpdated; + + /** + * A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. + */ + @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]." ) + protected List profile; + + /** + * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. + */ + @Child(name = "security", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Security Labels applied to this resource", formalDefinition="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure." ) + protected List security; + + /** + * Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. + */ + @Child(name = "tag", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Tags applied to this resource", formalDefinition="Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource." ) + protected List tag; + + private static final long serialVersionUID = 867134915L; + + /** + * Constructor + */ + public Meta() { + super(); + } + + /** + * @return {@link #versionId} (The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value + */ + public IdType getVersionIdElement() { + if (this.versionId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Meta.versionId"); + else if (Configuration.doAutoCreate()) + this.versionId = new IdType(); // bb + return this.versionId; + } + + public boolean hasVersionIdElement() { + return this.versionId != null && !this.versionId.isEmpty(); + } + + public boolean hasVersionId() { + return this.versionId != null && !this.versionId.isEmpty(); + } + + /** + * @param value {@link #versionId} (The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value + */ + public Meta setVersionIdElement(IdType value) { + this.versionId = value; + return this; + } + + /** + * @return The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted. + */ + public String getVersionId() { + return this.versionId == null ? null : this.versionId.getValue(); + } + + /** + * @param value The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted. + */ + public Meta setVersionId(String value) { + if (Utilities.noString(value)) + this.versionId = null; + else { + if (this.versionId == null) + this.versionId = new IdType(); + this.versionId.setValue(value); + } + return this; + } + + /** + * @return {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value + */ + public InstantType getLastUpdatedElement() { + if (this.lastUpdated == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Meta.lastUpdated"); + else if (Configuration.doAutoCreate()) + this.lastUpdated = new InstantType(); // bb + return this.lastUpdated; + } + + public boolean hasLastUpdatedElement() { + return this.lastUpdated != null && !this.lastUpdated.isEmpty(); + } + + public boolean hasLastUpdated() { + return this.lastUpdated != null && !this.lastUpdated.isEmpty(); + } + + /** + * @param value {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value + */ + public Meta setLastUpdatedElement(InstantType value) { + this.lastUpdated = value; + return this; + } + + /** + * @return When the resource last changed - e.g. when the version changed. + */ + 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 Meta setLastUpdated(Date value) { + if (value == null) + this.lastUpdated = null; + else { + if (this.lastUpdated == null) + this.lastUpdated = new InstantType(); + this.lastUpdated.setValue(value); + } + return this; + } + + /** + * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + */ + public List getProfile() { + if (this.profile == null) + this.profile = new ArrayList(); + return this.profile; + } + + public boolean hasProfile() { + if (this.profile == null) + return false; + for (UriType item : this.profile) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + */ + // syntactic sugar + public UriType addProfileElement() {//2 + UriType t = new UriType(); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return t; + } + + /** + * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + */ + public Meta addProfile(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return this; + } + + /** + * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + */ + public boolean hasProfile(String value) { + if (this.profile == null) + return false; + for (UriType v : this.profile) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) + */ + public List getSecurity() { + if (this.security == null) + this.security = new ArrayList(); + return this.security; + } + + public boolean hasSecurity() { + if (this.security == null) + return false; + for (Coding item : this.security) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) + */ + // syntactic sugar + public Coding addSecurity() { //3 + Coding t = new Coding(); + if (this.security == null) + this.security = new ArrayList(); + this.security.add(t); + return t; + } + + // syntactic sugar + public Meta addSecurity(Coding t) { //3 + if (t == null) + return this; + if (this.security == null) + this.security = new ArrayList(); + this.security.add(t); + return this; + } + + /** + * @return {@link #tag} (Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) + */ + public List getTag() { + if (this.tag == null) + this.tag = new ArrayList(); + return this.tag; + } + + public boolean hasTag() { + if (this.tag == null) + return false; + for (Coding item : this.tag) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #tag} (Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) + */ + // syntactic sugar + public Coding addTag() { //3 + Coding t = new Coding(); + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return t; + } + + // syntactic sugar + public Meta addTag(Coding t) { //3 + if (t == null) + return this; + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return this; + } + + /** + * Convenience method which adds a tag + * + * @param theSystem The code system + * @param theCode The code + * @param theDisplay The display name + * @return Returns a reference to this for easy chaining + */ + public Meta addTag(String theSystem, String theCode, String theDisplay) { + addTag().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay); + return this; + } + /** + * Convenience method which adds a security tag + * + * @param theSystem The code system + * @param theCode The code + * @param theDisplay The display name + * @return Returns a reference to this for easy chaining + */ + public Meta addSecurity(String theSystem, String theCode, String theDisplay) { + addSecurity().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay); + return this; + } + /** + * Returns the first tag (if any) that has the given system and code, or returns + * null if none + */ + public Coding getTag(String theSystem, String theCode) { + for (Coding next : getTag()) { + if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) { + return next; + } + } + return null; + } + + /** + * Returns the first security label (if any) that has the given system and code, or returns + * null if none + */ + public Coding getSecurity(String theSystem, String theCode) { + for (Coding next : getTag()) { + if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) { + return next; + } + } + return null; + } + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.", 0, java.lang.Integer.MAX_VALUE, versionId)); + childrenList.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, java.lang.Integer.MAX_VALUE, lastUpdated)); + childrenList.add(new Property("profile", "uri", "A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security)); + childrenList.add(new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1407102957: /*versionId*/ return this.versionId == null ? new Base[0] : new Base[] {this.versionId}; // IdType + case 1649733957: /*lastUpdated*/ return this.lastUpdated == null ? new Base[0] : new Base[] {this.lastUpdated}; // InstantType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // UriType + case 949122880: /*security*/ return this.security == null ? new Base[0] : this.security.toArray(new Base[this.security.size()]); // Coding + case 114586: /*tag*/ return this.tag == null ? new Base[0] : this.tag.toArray(new Base[this.tag.size()]); // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1407102957: // versionId + this.versionId = castToId(value); // IdType + break; + case 1649733957: // lastUpdated + this.lastUpdated = castToInstant(value); // InstantType + break; + case -309425751: // profile + this.getProfile().add(castToUri(value)); // UriType + break; + case 949122880: // security + this.getSecurity().add(castToCoding(value)); // Coding + break; + case 114586: // tag + this.getTag().add(castToCoding(value)); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("versionId")) + this.versionId = castToId(value); // IdType + else if (name.equals("lastUpdated")) + this.lastUpdated = castToInstant(value); // InstantType + else if (name.equals("profile")) + this.getProfile().add(castToUri(value)); + else if (name.equals("security")) + this.getSecurity().add(castToCoding(value)); + else if (name.equals("tag")) + this.getTag().add(castToCoding(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1407102957: throw new FHIRException("Cannot make property versionId as it is not a complex type"); // IdType + case 1649733957: throw new FHIRException("Cannot make property lastUpdated as it is not a complex type"); // InstantType + case -309425751: throw new FHIRException("Cannot make property profile as it is not a complex type"); // UriType + case 949122880: return addSecurity(); // Coding + case 114586: return addTag(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("versionId")) { + throw new FHIRException("Cannot call addChild on a primitive type Meta.versionId"); + } + else if (name.equals("lastUpdated")) { + throw new FHIRException("Cannot call addChild on a primitive type Meta.lastUpdated"); + } + else if (name.equals("profile")) { + throw new FHIRException("Cannot call addChild on a primitive type Meta.profile"); + } + else if (name.equals("security")) { + return addSecurity(); + } + else if (name.equals("tag")) { + return addTag(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Meta"; + + } + + public Meta copy() { + Meta dst = new Meta(); + copyValues(dst); + dst.versionId = versionId == null ? null : versionId.copy(); + dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy(); + if (profile != null) { + dst.profile = new ArrayList(); + for (UriType i : profile) + dst.profile.add(i.copy()); + }; + if (security != null) { + dst.security = new ArrayList(); + for (Coding i : security) + dst.security.add(i.copy()); + }; + if (tag != null) { + dst.tag = new ArrayList(); + for (Coding i : tag) + dst.tag.add(i.copy()); + }; + return dst; + } + + protected Meta typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Meta)) + return false; + Meta o = (Meta) other; + return compareDeep(versionId, o.versionId, true) && compareDeep(lastUpdated, o.lastUpdated, true) + && compareDeep(profile, o.profile, true) && compareDeep(security, o.security, true) && compareDeep(tag, o.tag, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Meta)) + return false; + Meta o = (Meta) other; + return compareValues(versionId, o.versionId, true) && compareValues(lastUpdated, o.lastUpdated, true) + && compareValues(profile, o.profile, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (versionId == null || versionId.isEmpty()) && (lastUpdated == null || lastUpdated.isEmpty()) + && (profile == null || profile.isEmpty()) && (security == null || security.isEmpty()) && (tag == null || tag.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ModuleDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ModuleDefinition.java new file mode 100644 index 00000000000..5d9b5edfcb4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ModuleDefinition.java @@ -0,0 +1,3382 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +/** + * The ModuleDefinition resource defines the data requirements for a quality artifact. + */ +@ResourceDef(name="ModuleDefinition", profile="http://hl7.org/fhir/Profile/ModuleDefinition") +public class ModuleDefinition extends DomainResource { + + @Block() + public static class ModuleDefinitionModelComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the model. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The name of the model." ) + protected StringType name; + + /** + * The identifier of the model. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The identifier of the model." ) + protected StringType identifier; + + /** + * The version of the model. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The version of the model." ) + protected StringType version; + + private static final long serialVersionUID = -862601139L; + + /** + * Constructor + */ + public ModuleDefinitionModelComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleDefinitionModelComponent(StringType identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #name} (The name of the model.). 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 ModuleDefinitionModelComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 model.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleDefinitionModelComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the model. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the model. + */ + public ModuleDefinitionModelComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (The identifier of the model.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionModelComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + 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} (The identifier of the model.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public ModuleDefinitionModelComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier of the model. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier of the model. + */ + public ModuleDefinitionModelComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of the model.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionModelComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the model.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ModuleDefinitionModelComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the model. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the model. + */ + public ModuleDefinitionModelComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the model.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("identifier", "string", "The identifier of the model.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version of the model.", 0, java.lang.Integer.MAX_VALUE, version)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); + } + else if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.identifier"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); + } + else + return super.addChild(name); + } + + public ModuleDefinitionModelComponent copy() { + ModuleDefinitionModelComponent dst = new ModuleDefinitionModelComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinitionModelComponent)) + return false; + ModuleDefinitionModelComponent o = (ModuleDefinitionModelComponent) other; + return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinitionModelComponent)) + return false; + ModuleDefinitionModelComponent o = (ModuleDefinitionModelComponent) other; + return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()); + } + + public String fhirType() { + return "ModuleDefinition.model"; + + } + + } + + @Block() + public static class ModuleDefinitionLibraryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The local name for the library reference. If no local name is provided, the name of the referenced library is assumed. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The local name for the library", formalDefinition="The local name for the library reference. If no local name is provided, the name of the referenced library is assumed." ) + protected StringType name; + + /** + * The identifier of the library. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The identifier of the library." ) + protected StringType identifier; + + /** + * The version of the library. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The version of the library." ) + protected StringType version; + + /** + * A reference to the library. + */ + @Child(name = "document", type = {Attachment.class, ModuleDefinition.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="A reference to the library." ) + protected Type document; + + private static final long serialVersionUID = 1633488790L; + + /** + * Constructor + */ + public ModuleDefinitionLibraryComponent() { + super(); + } + + /** + * @return {@link #name} (The local name for the library reference. If no local name is provided, the name of the referenced library is assumed.). 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 ModuleDefinitionLibraryComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 local name for the library reference. If no local name is provided, the name of the referenced library is assumed.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleDefinitionLibraryComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The local name for the library reference. If no local name is provided, the name of the referenced library is assumed. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The local name for the library reference. If no local name is provided, the name of the referenced library is assumed. + */ + public ModuleDefinitionLibraryComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (The identifier of the library.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionLibraryComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + 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} (The identifier of the library.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public ModuleDefinitionLibraryComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier of the library. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier of the library. + */ + public ModuleDefinitionLibraryComponent setIdentifier(String value) { + if (Utilities.noString(value)) + this.identifier = null; + else { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The version of the library.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionLibraryComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the library.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ModuleDefinitionLibraryComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the library. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the library. + */ + public ModuleDefinitionLibraryComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #document} (A reference to the library.) + */ + public Type getDocument() { + return this.document; + } + + /** + * @return {@link #document} (A reference to the library.) + */ + public Attachment getDocumentAttachment() throws FHIRException { + if (!(this.document instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.document.getClass().getName()+" was encountered"); + return (Attachment) this.document; + } + + public boolean hasDocumentAttachment() { + return this.document instanceof Attachment; + } + + /** + * @return {@link #document} (A reference to the library.) + */ + public Reference getDocumentReference() throws FHIRException { + if (!(this.document instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.document.getClass().getName()+" was encountered"); + return (Reference) this.document; + } + + public boolean hasDocumentReference() { + return this.document instanceof Reference; + } + + public boolean hasDocument() { + return this.document != null && !this.document.isEmpty(); + } + + /** + * @param value {@link #document} (A reference to the library.) + */ + public ModuleDefinitionLibraryComponent setDocument(Type value) { + this.document = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The local name for the library reference. If no local name is provided, the name of the referenced library is assumed.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("identifier", "string", "The identifier of the library.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version of the library.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("document[x]", "Attachment|Reference(ModuleDefinition)", "A reference to the library.", 0, java.lang.Integer.MAX_VALUE, document)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 861720859: // document + this.document = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("document[x]")) + this.document = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 506673541: return getDocument(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); + } + else if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.identifier"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); + } + else if (name.equals("documentAttachment")) { + this.document = new Attachment(); + return this.document; + } + else if (name.equals("documentReference")) { + this.document = new Reference(); + return this.document; + } + else + return super.addChild(name); + } + + public ModuleDefinitionLibraryComponent copy() { + ModuleDefinitionLibraryComponent dst = new ModuleDefinitionLibraryComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.document = document == null ? null : document.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinitionLibraryComponent)) + return false; + ModuleDefinitionLibraryComponent o = (ModuleDefinitionLibraryComponent) other; + return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(document, o.document, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinitionLibraryComponent)) + return false; + ModuleDefinitionLibraryComponent o = (ModuleDefinitionLibraryComponent) other; + return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (document == null || document.isEmpty()); + } + + public String fhirType() { + return "ModuleDefinition.library"; + + } + + } + + @Block() + public static class ModuleDefinitionCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The local name for the code system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The local name for the code system." ) + protected StringType name; + + /** + * The code system uri. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The code system uri." ) + protected StringType identifier; + + /** + * The code system version, if any. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The code system version, if any." ) + protected StringType version; + + private static final long serialVersionUID = -862601139L; + + /** + * Constructor + */ + public ModuleDefinitionCodeSystemComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleDefinitionCodeSystemComponent(StringType name, StringType identifier) { + super(); + this.name = name; + this.identifier = identifier; + } + + /** + * @return {@link #name} (The local name for the code system.). 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 ModuleDefinitionCodeSystemComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 local name for the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleDefinitionCodeSystemComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The local name for the code system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The local name for the code system. + */ + public ModuleDefinitionCodeSystemComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (The code system uri.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionCodeSystemComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + 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} (The code system uri.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public ModuleDefinitionCodeSystemComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The code system uri. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The code system uri. + */ + public ModuleDefinitionCodeSystemComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #version} (The code system version, if any.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionCodeSystemComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The code system version, if any.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ModuleDefinitionCodeSystemComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The code system version, if any. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The code system version, if any. + */ + public ModuleDefinitionCodeSystemComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The local name for the code system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("identifier", "string", "The code system uri.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The code system version, if any.", 0, java.lang.Integer.MAX_VALUE, version)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); + } + else if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.identifier"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); + } + else + return super.addChild(name); + } + + public ModuleDefinitionCodeSystemComponent copy() { + ModuleDefinitionCodeSystemComponent dst = new ModuleDefinitionCodeSystemComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinitionCodeSystemComponent)) + return false; + ModuleDefinitionCodeSystemComponent o = (ModuleDefinitionCodeSystemComponent) other; + return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinitionCodeSystemComponent)) + return false; + ModuleDefinitionCodeSystemComponent o = (ModuleDefinitionCodeSystemComponent) other; + return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()); + } + + public String fhirType() { + return "ModuleDefinition.codeSystem"; + + } + + } + + @Block() + public static class ModuleDefinitionValueSetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The local name for the value set. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The local name for the value set." ) + protected StringType name; + + /** + * The value set uri. + */ + @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The value set uri." ) + protected StringType identifier; + + /** + * The version of the value set, if any. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The version of the value set, if any." ) + protected StringType version; + + /** + * The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library. + */ + @Child(name = "codeSystem", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library." ) + protected List codeSystem; + + private static final long serialVersionUID = 338950096L; + + /** + * Constructor + */ + public ModuleDefinitionValueSetComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleDefinitionValueSetComponent(StringType name, StringType identifier) { + super(); + this.name = name; + this.identifier = identifier; + } + + /** + * @return {@link #name} (The local name for the value set.). 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 ModuleDefinitionValueSetComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 local name for the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleDefinitionValueSetComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The local name for the value set. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The local name for the value set. + */ + public ModuleDefinitionValueSetComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (The value set uri.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionValueSetComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); // bb + 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} (The value set uri.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public ModuleDefinitionValueSetComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The value set uri. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The value set uri. + */ + public ModuleDefinitionValueSetComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of the value set, if any.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionValueSetComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the value set, if any.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ModuleDefinitionValueSetComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the value set, if any. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the value set, if any. + */ + public ModuleDefinitionValueSetComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #codeSystem} (The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.) + */ + public List getCodeSystem() { + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + return this.codeSystem; + } + + public boolean hasCodeSystem() { + if (this.codeSystem == null) + return false; + for (StringType item : this.codeSystem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeSystem} (The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.) + */ + // syntactic sugar + public StringType addCodeSystemElement() {//2 + StringType t = new StringType(); + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return t; + } + + /** + * @param value {@link #codeSystem} (The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.) + */ + public ModuleDefinitionValueSetComponent addCodeSystem(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return this; + } + + /** + * @param value {@link #codeSystem} (The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.) + */ + public boolean hasCodeSystem(String value) { + if (this.codeSystem == null) + return false; + for (StringType v : this.codeSystem) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The local name for the value set.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("identifier", "string", "The value set uri.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version of the value set, if any.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("codeSystem", "string", "The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1618432855: // identifier + this.identifier = castToString(value); // StringType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case -916511108: // codeSystem + this.getCodeSystem().add(castToString(value)); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("identifier")) + this.identifier = castToString(value); // StringType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("codeSystem")) + this.getCodeSystem().add(castToString(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case -916511108: throw new FHIRException("Cannot make property codeSystem as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); + } + else if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.identifier"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); + } + else if (name.equals("codeSystem")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.codeSystem"); + } + else + return super.addChild(name); + } + + public ModuleDefinitionValueSetComponent copy() { + ModuleDefinitionValueSetComponent dst = new ModuleDefinitionValueSetComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + if (codeSystem != null) { + dst.codeSystem = new ArrayList(); + for (StringType i : codeSystem) + dst.codeSystem.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinitionValueSetComponent)) + return false; + ModuleDefinitionValueSetComponent o = (ModuleDefinitionValueSetComponent) other; + return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(codeSystem, o.codeSystem, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinitionValueSetComponent)) + return false; + ModuleDefinitionValueSetComponent o = (ModuleDefinitionValueSetComponent) other; + return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) + && compareValues(codeSystem, o.codeSystem, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) + ; + } + + public String fhirType() { + return "ModuleDefinition.valueSet"; + + } + + } + + @Block() + public static class ModuleDefinitionParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the parameter. + */ + @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The name of the parameter." ) + protected CodeType name; + + /** + * Whether the parameter is input or output for the module. + */ + @Child(name = "use", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="Whether the parameter is input or output for the module." ) + protected CodeType use; + + /** + * A brief description of the parameter. + */ + @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="A brief description of the parameter." ) + protected StringType documentation; + + /** + * The type of the parameter. + */ + @Child(name = "type", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The type of the parameter." ) + protected CodeType type; + + /** + * The profile of the parameter, if any. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="The profile of the parameter, if any." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (The profile of the parameter, if any.) + */ + protected StructureDefinition profileTarget; + + private static final long serialVersionUID = 1572548838L; + + /** + * Constructor + */ + public ModuleDefinitionParameterComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleDefinitionParameterComponent(CodeType name, CodeType use, CodeType type) { + super(); + this.name = name; + this.use = use; + this.type = type; + } + + /** + * @return {@link #name} (The name of 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 ModuleDefinitionParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeType(); // bb + 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.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleDefinitionParameterComponent setNameElement(CodeType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter. + */ + public ModuleDefinitionParameterComponent setName(String value) { + if (this.name == null) + this.name = new CodeType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public CodeType getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new CodeType(); // bb + 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} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public ModuleDefinitionParameterComponent setUseElement(CodeType value) { + this.use = value; + return this; + } + + /** + * @return Whether the parameter is input or output for the module. + */ + public String getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Whether the parameter is input or output for the module. + */ + public ModuleDefinitionParameterComponent setUse(String value) { + if (this.use == null) + this.use = new CodeType(); + this.use.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (A brief description of the 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 ModuleDefinitionParameterComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (A brief description of the parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ModuleDefinitionParameterComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return A brief description of the parameter. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value A brief description of the parameter. + */ + public ModuleDefinitionParameterComponent 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 of the 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 ModuleDefinitionParameterComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ModuleDefinitionParameterComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of the parameter. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the parameter. + */ + public ModuleDefinitionParameterComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (The profile of the parameter, if any.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (The profile of the parameter, if any.) + */ + public ModuleDefinitionParameterComponent 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. (The profile of the parameter, if any.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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. (The profile of the parameter, if any.) + */ + public ModuleDefinitionParameterComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "code", "The name of the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("use", "code", "Whether the parameter is input or output for the module.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("documentation", "string", "A brief description of the parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("type", "code", "The type of the parameter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "The profile of the parameter, if any.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // CodeType + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // CodeType + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToCode(value); // CodeType + break; + case 116103: // use + this.use = castToCode(value); // CodeType + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToCode(value); // CodeType + else if (name.equals("use")) + this.use = castToCode(value); // CodeType + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // CodeType + case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // CodeType + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case -309425751: return getProfile(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); + } + else if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.use"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.documentation"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.type"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else + return super.addChild(name); + } + + public ModuleDefinitionParameterComponent copy() { + ModuleDefinitionParameterComponent dst = new ModuleDefinitionParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.use = use == null ? null : use.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinitionParameterComponent)) + return false; + ModuleDefinitionParameterComponent o = (ModuleDefinitionParameterComponent) other; + return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(documentation, o.documentation, true) + && compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinitionParameterComponent)) + return false; + ModuleDefinitionParameterComponent o = (ModuleDefinitionParameterComponent) other; + return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(documentation, o.documentation, true) + && compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty()) + && (documentation == null || documentation.isEmpty()) && (type == null || type.isEmpty()) + && (profile == null || profile.isEmpty()); + } + + public String fhirType() { + return "ModuleDefinition.parameter"; + + } + + } + + @Block() + public static class ModuleDefinitionDataComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The type of the required data", formalDefinition="The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile." ) + protected CodeType type; + + /** + * The profile of the required data, specified as the uri of the profile definition. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The profile of the required data", formalDefinition="The profile of the required data, specified as the uri of the profile definition." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (The profile of the required data, specified as the uri of the profile definition.) + */ + protected StructureDefinition profileTarget; + + /** + * Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. + */ + @Child(name = "mustSupport", type = {StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Indicates that specific structure elements are referenced by the knowledge module", formalDefinition="Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available." ) + protected List mustSupport; + + /** + * Code filters for the required data, if any. + */ + @Child(name = "codeFilter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="Code filters for the required data, if any." ) + protected List codeFilter; + + /** + * Date filters for the required data, if any. + */ + @Child(name = "dateFilter", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="Date filters for the required data, if any." ) + protected List dateFilter; + + private static final long serialVersionUID = -777236908L; + + /** + * Constructor + */ + public ModuleDefinitionDataComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleDefinitionDataComponent(CodeType type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.). 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 ModuleDefinitionDataComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ModuleDefinitionDataComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. + */ + public ModuleDefinitionDataComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionDataComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) + */ + public ModuleDefinitionDataComponent 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. (The profile of the required data, specified as the uri of the profile definition.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionDataComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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. (The profile of the required data, specified as the uri of the profile definition.) + */ + public ModuleDefinitionDataComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) + */ + public List getMustSupport() { + if (this.mustSupport == null) + this.mustSupport = new ArrayList(); + return this.mustSupport; + } + + public boolean hasMustSupport() { + if (this.mustSupport == null) + return false; + for (StringType item : this.mustSupport) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) + */ + // syntactic sugar + public StringType addMustSupportElement() {//2 + StringType t = new StringType(); + if (this.mustSupport == null) + this.mustSupport = new ArrayList(); + this.mustSupport.add(t); + return t; + } + + /** + * @param value {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) + */ + public ModuleDefinitionDataComponent addMustSupport(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.mustSupport == null) + this.mustSupport = new ArrayList(); + this.mustSupport.add(t); + return this; + } + + /** + * @param value {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) + */ + public boolean hasMustSupport(String value) { + if (this.mustSupport == null) + return false; + for (StringType v : this.mustSupport) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #codeFilter} (Code filters for the required data, if any.) + */ + public List getCodeFilter() { + if (this.codeFilter == null) + this.codeFilter = new ArrayList(); + return this.codeFilter; + } + + public boolean hasCodeFilter() { + if (this.codeFilter == null) + return false; + for (ModuleDefinitionDataCodeFilterComponent item : this.codeFilter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeFilter} (Code filters for the required data, if any.) + */ + // syntactic sugar + public ModuleDefinitionDataCodeFilterComponent addCodeFilter() { //3 + ModuleDefinitionDataCodeFilterComponent t = new ModuleDefinitionDataCodeFilterComponent(); + if (this.codeFilter == null) + this.codeFilter = new ArrayList(); + this.codeFilter.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinitionDataComponent addCodeFilter(ModuleDefinitionDataCodeFilterComponent t) { //3 + if (t == null) + return this; + if (this.codeFilter == null) + this.codeFilter = new ArrayList(); + this.codeFilter.add(t); + return this; + } + + /** + * @return {@link #dateFilter} (Date filters for the required data, if any.) + */ + public List getDateFilter() { + if (this.dateFilter == null) + this.dateFilter = new ArrayList(); + return this.dateFilter; + } + + public boolean hasDateFilter() { + if (this.dateFilter == null) + return false; + for (ModuleDefinitionDataDateFilterComponent item : this.dateFilter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dateFilter} (Date filters for the required data, if any.) + */ + // syntactic sugar + public ModuleDefinitionDataDateFilterComponent addDateFilter() { //3 + ModuleDefinitionDataDateFilterComponent t = new ModuleDefinitionDataDateFilterComponent(); + if (this.dateFilter == null) + this.dateFilter = new ArrayList(); + this.dateFilter.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinitionDataComponent addDateFilter(ModuleDefinitionDataDateFilterComponent t) { //3 + if (t == null) + return this; + if (this.dateFilter == null) + this.dateFilter = new ArrayList(); + this.dateFilter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "The profile of the required data, specified as the uri of the profile definition.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("mustSupport", "string", "Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); + childrenList.add(new Property("codeFilter", "", "Code filters for the required data, if any.", 0, java.lang.Integer.MAX_VALUE, codeFilter)); + childrenList.add(new Property("dateFilter", "", "Date filters for the required data, if any.", 0, java.lang.Integer.MAX_VALUE, dateFilter)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : this.mustSupport.toArray(new Base[this.mustSupport.size()]); // StringType + case -1303674939: /*codeFilter*/ return this.codeFilter == null ? new Base[0] : this.codeFilter.toArray(new Base[this.codeFilter.size()]); // ModuleDefinitionDataCodeFilterComponent + case 149531846: /*dateFilter*/ return this.dateFilter == null ? new Base[0] : this.dateFilter.toArray(new Base[this.dateFilter.size()]); // ModuleDefinitionDataDateFilterComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + case -1402857082: // mustSupport + this.getMustSupport().add(castToString(value)); // StringType + break; + case -1303674939: // codeFilter + this.getCodeFilter().add((ModuleDefinitionDataCodeFilterComponent) value); // ModuleDefinitionDataCodeFilterComponent + break; + case 149531846: // dateFilter + this.getDateFilter().add((ModuleDefinitionDataDateFilterComponent) value); // ModuleDefinitionDataDateFilterComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else if (name.equals("mustSupport")) + this.getMustSupport().add(castToString(value)); + else if (name.equals("codeFilter")) + this.getCodeFilter().add((ModuleDefinitionDataCodeFilterComponent) value); + else if (name.equals("dateFilter")) + this.getDateFilter().add((ModuleDefinitionDataDateFilterComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case -309425751: return getProfile(); // Reference + case -1402857082: throw new FHIRException("Cannot make property mustSupport as it is not a complex type"); // StringType + case -1303674939: return addCodeFilter(); // ModuleDefinitionDataCodeFilterComponent + case 149531846: return addDateFilter(); // ModuleDefinitionDataDateFilterComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.type"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else if (name.equals("mustSupport")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.mustSupport"); + } + else if (name.equals("codeFilter")) { + return addCodeFilter(); + } + else if (name.equals("dateFilter")) { + return addDateFilter(); + } + else + return super.addChild(name); + } + + public ModuleDefinitionDataComponent copy() { + ModuleDefinitionDataComponent dst = new ModuleDefinitionDataComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + if (mustSupport != null) { + dst.mustSupport = new ArrayList(); + for (StringType i : mustSupport) + dst.mustSupport.add(i.copy()); + }; + if (codeFilter != null) { + dst.codeFilter = new ArrayList(); + for (ModuleDefinitionDataCodeFilterComponent i : codeFilter) + dst.codeFilter.add(i.copy()); + }; + if (dateFilter != null) { + dst.dateFilter = new ArrayList(); + for (ModuleDefinitionDataDateFilterComponent i : dateFilter) + dst.dateFilter.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinitionDataComponent)) + return false; + ModuleDefinitionDataComponent o = (ModuleDefinitionDataComponent) other; + return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(mustSupport, o.mustSupport, true) + && compareDeep(codeFilter, o.codeFilter, true) && compareDeep(dateFilter, o.dateFilter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinitionDataComponent)) + return false; + ModuleDefinitionDataComponent o = (ModuleDefinitionDataComponent) other; + return compareValues(type, o.type, true) && compareValues(mustSupport, o.mustSupport, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) + && (mustSupport == null || mustSupport.isEmpty()) && (codeFilter == null || codeFilter.isEmpty()) + && (dateFilter == null || dateFilter.isEmpty()); + } + + public String fhirType() { + return "ModuleDefinition.data"; + + } + + } + + @Block() + public static class ModuleDefinitionDataCodeFilterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. + */ + @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The code-valued attribute of the filter", formalDefinition="The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept." ) + protected StringType path; + + /** + * The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset. + */ + @Child(name = "valueSet", type = {StringType.class, ValueSet.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The valueset for the code filter", formalDefinition="The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset." ) + protected Type valueSet; + + /** + * The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts. + */ + @Child(name = "codeableConcept", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The codeableConcepts for the filter", formalDefinition="The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts." ) + protected List codeableConcept; + + private static final long serialVersionUID = -666343535L; + + /** + * Constructor + */ + public ModuleDefinitionDataCodeFilterComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleDefinitionDataCodeFilterComponent(StringType path) { + super(); + this.path = path; + } + + /** + * @return {@link #path} (The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionDataCodeFilterComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public ModuleDefinitionDataCodeFilterComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. + */ + public ModuleDefinitionDataCodeFilterComponent setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #valueSet} (The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) + */ + public Type getValueSet() { + return this.valueSet; + } + + /** + * @return {@link #valueSet} (The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) + */ + public StringType getValueSetStringType() throws FHIRException { + if (!(this.valueSet instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (StringType) this.valueSet; + } + + public boolean hasValueSetStringType() { + return this.valueSet instanceof StringType; + } + + /** + * @return {@link #valueSet} (The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) + */ + public Reference getValueSetReference() throws FHIRException { + if (!(this.valueSet instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (Reference) this.valueSet; + } + + public boolean hasValueSetReference() { + return this.valueSet instanceof Reference; + } + + public boolean hasValueSet() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + /** + * @param value {@link #valueSet} (The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) + */ + public ModuleDefinitionDataCodeFilterComponent setValueSet(Type value) { + this.valueSet = value; + return this; + } + + /** + * @return {@link #codeableConcept} (The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts.) + */ + public List getCodeableConcept() { + if (this.codeableConcept == null) + this.codeableConcept = new ArrayList(); + return this.codeableConcept; + } + + public boolean hasCodeableConcept() { + if (this.codeableConcept == null) + return false; + for (CodeableConcept item : this.codeableConcept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeableConcept} (The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts.) + */ + // syntactic sugar + public CodeableConcept addCodeableConcept() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.codeableConcept == null) + this.codeableConcept = new ArrayList(); + this.codeableConcept.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinitionDataCodeFilterComponent addCodeableConcept(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.codeableConcept == null) + this.codeableConcept = new ArrayList(); + this.codeableConcept.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("valueSet[x]", "string|Reference(ValueSet)", "The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + childrenList.add(new Property("codeableConcept", "CodeableConcept", "The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts.", 0, java.lang.Integer.MAX_VALUE, codeableConcept)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type + case -156504159: /*codeableConcept*/ return this.codeableConcept == null ? new Base[0] : this.codeableConcept.toArray(new Base[this.codeableConcept.size()]); // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3433509: // path + this.path = castToString(value); // StringType + break; + case -1410174671: // valueSet + this.valueSet = (Type) value; // Type + break; + case -156504159: // codeableConcept + this.getCodeableConcept().add(castToCodeableConcept(value)); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("valueSet[x]")) + this.valueSet = (Type) value; // Type + else if (name.equals("codeableConcept")) + this.getCodeableConcept().add(castToCodeableConcept(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case -1438410321: return getValueSet(); // Type + case -156504159: return addCodeableConcept(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.path"); + } + else if (name.equals("valueSetString")) { + this.valueSet = new StringType(); + return this.valueSet; + } + else if (name.equals("valueSetReference")) { + this.valueSet = new Reference(); + return this.valueSet; + } + else if (name.equals("codeableConcept")) { + return addCodeableConcept(); + } + else + return super.addChild(name); + } + + public ModuleDefinitionDataCodeFilterComponent copy() { + ModuleDefinitionDataCodeFilterComponent dst = new ModuleDefinitionDataCodeFilterComponent(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + dst.valueSet = valueSet == null ? null : valueSet.copy(); + if (codeableConcept != null) { + dst.codeableConcept = new ArrayList(); + for (CodeableConcept i : codeableConcept) + dst.codeableConcept.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinitionDataCodeFilterComponent)) + return false; + ModuleDefinitionDataCodeFilterComponent o = (ModuleDefinitionDataCodeFilterComponent) other; + return compareDeep(path, o.path, true) && compareDeep(valueSet, o.valueSet, true) && compareDeep(codeableConcept, o.codeableConcept, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinitionDataCodeFilterComponent)) + return false; + ModuleDefinitionDataCodeFilterComponent o = (ModuleDefinitionDataCodeFilterComponent) other; + return compareValues(path, o.path, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (valueSet == null || valueSet.isEmpty()) + && (codeableConcept == null || codeableConcept.isEmpty()); + } + + public String fhirType() { + return "ModuleDefinition.data.codeFilter"; + + } + + } + + @Block() + public static class ModuleDefinitionDataDateFilterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. + */ + @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The date-valued attribute of the filter", formalDefinition="The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing." ) + protected StringType path; + + /** + * The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. + */ + @Child(name = "value", type = {DateTimeType.class, Period.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The value of the filter, as a Period or dateTime value", formalDefinition="The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime." ) + protected Type value; + + private static final long serialVersionUID = 1791957163L; + + /** + * Constructor + */ + public ModuleDefinitionDataDateFilterComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleDefinitionDataDateFilterComponent(StringType path) { + super(); + this.path = path; + } + + /** + * @return {@link #path} (The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinitionDataDateFilterComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public ModuleDefinitionDataDateFilterComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. + */ + public ModuleDefinitionDataDateFilterComponent setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) + */ + public DateTimeType getValueDateTimeType() throws FHIRException { + if (!(this.value instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + public boolean hasValueDateTimeType() { + return this.value instanceof DateTimeType; + } + + /** + * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) + */ + public Period getValuePeriod() throws FHIRException { + if (!(this.value instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Period) this.value; + } + + public boolean hasValuePeriod() { + return this.value instanceof Period; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) + */ + public ModuleDefinitionDataDateFilterComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("value[x]", "dateTime|Period", "The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3433509: // path + this.path = castToString(value); // StringType + break; + case 111972721: // value + this.value = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("value[x]")) + this.value = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case -1410166417: return getValue(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.path"); + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else + return super.addChild(name); + } + + public ModuleDefinitionDataDateFilterComponent copy() { + ModuleDefinitionDataDateFilterComponent dst = new ModuleDefinitionDataDateFilterComponent(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinitionDataDateFilterComponent)) + return false; + ModuleDefinitionDataDateFilterComponent o = (ModuleDefinitionDataDateFilterComponent) other; + return compareDeep(path, o.path, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinitionDataDateFilterComponent)) + return false; + ModuleDefinitionDataDateFilterComponent o = (ModuleDefinitionDataDateFilterComponent) other; + return compareValues(path, o.path, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "ModuleDefinition.data.dateFilter"; + + } + + } + + /** + * A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Logical identifier", formalDefinition="A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact." ) + protected List identifier; + + /** + * The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The version of the module, if any", formalDefinition="The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification." ) + protected StringType version; + + /** + * A model reference used by the content. + */ + @Child(name = "model", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="A model reference used by the content." ) + protected List model; + + /** + * A library referenced by the module. The reference must consist of either an id, or a document reference. + */ + @Child(name = "library", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A library referenced by the module", formalDefinition="A library referenced by the module. The reference must consist of either an id, or a document reference." ) + protected List library; + + /** + * A code system definition used within the knowledge module. + */ + @Child(name = "codeSystem", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="A code system definition used within the knowledge module." ) + protected List codeSystem; + + /** + * A value set definition used by the knowledge module. + */ + @Child(name = "valueSet", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="A value set definition used by the knowledge module." ) + protected List valueSet; + + /** + * Parameters to the module. + */ + @Child(name = "parameter", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="", formalDefinition="Parameters to the module." ) + protected List parameter; + + /** + * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. + */ + @Child(name = "data", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Describes a required data item", formalDefinition="Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data." ) + protected List data; + + private static final long serialVersionUID = -1288058693L; + + /** + * Constructor + */ + public ModuleDefinition() { + super(); + } + + /** + * @return {@link #identifier} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.) + */ + 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} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinition addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleDefinition.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ModuleDefinition setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. + */ + public ModuleDefinition setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #model} (A model reference used by the content.) + */ + public List getModel() { + if (this.model == null) + this.model = new ArrayList(); + return this.model; + } + + public boolean hasModel() { + if (this.model == null) + return false; + for (ModuleDefinitionModelComponent item : this.model) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #model} (A model reference used by the content.) + */ + // syntactic sugar + public ModuleDefinitionModelComponent addModel() { //3 + ModuleDefinitionModelComponent t = new ModuleDefinitionModelComponent(); + if (this.model == null) + this.model = new ArrayList(); + this.model.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinition addModel(ModuleDefinitionModelComponent t) { //3 + if (t == null) + return this; + if (this.model == null) + this.model = new ArrayList(); + this.model.add(t); + return this; + } + + /** + * @return {@link #library} (A library referenced by the module. The reference must consist of either an id, or a document reference.) + */ + public List getLibrary() { + if (this.library == null) + this.library = new ArrayList(); + return this.library; + } + + public boolean hasLibrary() { + if (this.library == null) + return false; + for (ModuleDefinitionLibraryComponent item : this.library) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #library} (A library referenced by the module. The reference must consist of either an id, or a document reference.) + */ + // syntactic sugar + public ModuleDefinitionLibraryComponent addLibrary() { //3 + ModuleDefinitionLibraryComponent t = new ModuleDefinitionLibraryComponent(); + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinition addLibrary(ModuleDefinitionLibraryComponent t) { //3 + if (t == null) + return this; + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return this; + } + + /** + * @return {@link #codeSystem} (A code system definition used within the knowledge module.) + */ + public List getCodeSystem() { + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + return this.codeSystem; + } + + public boolean hasCodeSystem() { + if (this.codeSystem == null) + return false; + for (ModuleDefinitionCodeSystemComponent item : this.codeSystem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codeSystem} (A code system definition used within the knowledge module.) + */ + // syntactic sugar + public ModuleDefinitionCodeSystemComponent addCodeSystem() { //3 + ModuleDefinitionCodeSystemComponent t = new ModuleDefinitionCodeSystemComponent(); + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinition addCodeSystem(ModuleDefinitionCodeSystemComponent t) { //3 + if (t == null) + return this; + if (this.codeSystem == null) + this.codeSystem = new ArrayList(); + this.codeSystem.add(t); + return this; + } + + /** + * @return {@link #valueSet} (A value set definition used by the knowledge module.) + */ + public List getValueSet() { + if (this.valueSet == null) + this.valueSet = new ArrayList(); + return this.valueSet; + } + + public boolean hasValueSet() { + if (this.valueSet == null) + return false; + for (ModuleDefinitionValueSetComponent item : this.valueSet) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #valueSet} (A value set definition used by the knowledge module.) + */ + // syntactic sugar + public ModuleDefinitionValueSetComponent addValueSet() { //3 + ModuleDefinitionValueSetComponent t = new ModuleDefinitionValueSetComponent(); + if (this.valueSet == null) + this.valueSet = new ArrayList(); + this.valueSet.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinition addValueSet(ModuleDefinitionValueSetComponent t) { //3 + if (t == null) + return this; + if (this.valueSet == null) + this.valueSet = new ArrayList(); + this.valueSet.add(t); + return this; + } + + /** + * @return {@link #parameter} (Parameters to the module.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (ModuleDefinitionParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (Parameters to the module.) + */ + // syntactic sugar + public ModuleDefinitionParameterComponent addParameter() { //3 + ModuleDefinitionParameterComponent t = new ModuleDefinitionParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinition addParameter(ModuleDefinitionParameterComponent t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + /** + * @return {@link #data} (Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data.) + */ + public List getData() { + if (this.data == null) + this.data = new ArrayList(); + return this.data; + } + + public boolean hasData() { + if (this.data == null) + return false; + for (ModuleDefinitionDataComponent item : this.data) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #data} (Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data.) + */ + // syntactic sugar + public ModuleDefinitionDataComponent addData() { //3 + ModuleDefinitionDataComponent t = new ModuleDefinitionDataComponent(); + if (this.data == null) + this.data = new ArrayList(); + this.data.add(t); + return t; + } + + // syntactic sugar + public ModuleDefinition addData(ModuleDefinitionDataComponent t) { //3 + if (t == null) + return this; + if (this.data == null) + this.data = new ArrayList(); + this.data.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("model", "", "A model reference used by the content.", 0, java.lang.Integer.MAX_VALUE, model)); + childrenList.add(new Property("library", "", "A library referenced by the module. The reference must consist of either an id, or a document reference.", 0, java.lang.Integer.MAX_VALUE, library)); + childrenList.add(new Property("codeSystem", "", "A code system definition used within the knowledge module.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("valueSet", "", "A value set definition used by the knowledge module.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + childrenList.add(new Property("parameter", "", "Parameters to the module.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("data", "", "Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data.", 0, java.lang.Integer.MAX_VALUE, data)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 104069929: /*model*/ return this.model == null ? new Base[0] : this.model.toArray(new Base[this.model.size()]); // ModuleDefinitionModelComponent + case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // ModuleDefinitionLibraryComponent + case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // ModuleDefinitionCodeSystemComponent + case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : this.valueSet.toArray(new Base[this.valueSet.size()]); // ModuleDefinitionValueSetComponent + case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ModuleDefinitionParameterComponent + case 3076010: /*data*/ return this.data == null ? new Base[0] : this.data.toArray(new Base[this.data.size()]); // ModuleDefinitionDataComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 104069929: // model + this.getModel().add((ModuleDefinitionModelComponent) value); // ModuleDefinitionModelComponent + break; + case 166208699: // library + this.getLibrary().add((ModuleDefinitionLibraryComponent) value); // ModuleDefinitionLibraryComponent + break; + case -916511108: // codeSystem + this.getCodeSystem().add((ModuleDefinitionCodeSystemComponent) value); // ModuleDefinitionCodeSystemComponent + break; + case -1410174671: // valueSet + this.getValueSet().add((ModuleDefinitionValueSetComponent) value); // ModuleDefinitionValueSetComponent + break; + case 1954460585: // parameter + this.getParameter().add((ModuleDefinitionParameterComponent) value); // ModuleDefinitionParameterComponent + break; + case 3076010: // data + this.getData().add((ModuleDefinitionDataComponent) value); // ModuleDefinitionDataComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("model")) + this.getModel().add((ModuleDefinitionModelComponent) value); + else if (name.equals("library")) + this.getLibrary().add((ModuleDefinitionLibraryComponent) value); + else if (name.equals("codeSystem")) + this.getCodeSystem().add((ModuleDefinitionCodeSystemComponent) value); + else if (name.equals("valueSet")) + this.getValueSet().add((ModuleDefinitionValueSetComponent) value); + else if (name.equals("parameter")) + this.getParameter().add((ModuleDefinitionParameterComponent) value); + else if (name.equals("data")) + this.getData().add((ModuleDefinitionDataComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 104069929: return addModel(); // ModuleDefinitionModelComponent + case 166208699: return addLibrary(); // ModuleDefinitionLibraryComponent + case -916511108: return addCodeSystem(); // ModuleDefinitionCodeSystemComponent + case -1410174671: return addValueSet(); // ModuleDefinitionValueSetComponent + case 1954460585: return addParameter(); // ModuleDefinitionParameterComponent + case 3076010: return addData(); // ModuleDefinitionDataComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); + } + else if (name.equals("model")) { + return addModel(); + } + else if (name.equals("library")) { + return addLibrary(); + } + else if (name.equals("codeSystem")) { + return addCodeSystem(); + } + else if (name.equals("valueSet")) { + return addValueSet(); + } + else if (name.equals("parameter")) { + return addParameter(); + } + else if (name.equals("data")) { + return addData(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ModuleDefinition"; + + } + + public ModuleDefinition copy() { + ModuleDefinition dst = new ModuleDefinition(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + if (model != null) { + dst.model = new ArrayList(); + for (ModuleDefinitionModelComponent i : model) + dst.model.add(i.copy()); + }; + if (library != null) { + dst.library = new ArrayList(); + for (ModuleDefinitionLibraryComponent i : library) + dst.library.add(i.copy()); + }; + if (codeSystem != null) { + dst.codeSystem = new ArrayList(); + for (ModuleDefinitionCodeSystemComponent i : codeSystem) + dst.codeSystem.add(i.copy()); + }; + if (valueSet != null) { + dst.valueSet = new ArrayList(); + for (ModuleDefinitionValueSetComponent i : valueSet) + dst.valueSet.add(i.copy()); + }; + if (parameter != null) { + dst.parameter = new ArrayList(); + for (ModuleDefinitionParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + if (data != null) { + dst.data = new ArrayList(); + for (ModuleDefinitionDataComponent i : data) + dst.data.add(i.copy()); + }; + return dst; + } + + protected ModuleDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleDefinition)) + return false; + ModuleDefinition o = (ModuleDefinition) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) && compareDeep(model, o.model, true) + && compareDeep(library, o.library, true) && compareDeep(codeSystem, o.codeSystem, true) && compareDeep(valueSet, o.valueSet, true) + && compareDeep(parameter, o.parameter, true) && compareDeep(data, o.data, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleDefinition)) + return false; + ModuleDefinition o = (ModuleDefinition) other; + return compareValues(version, o.version, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) + && (model == null || model.isEmpty()) && (library == null || library.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) + && (valueSet == null || valueSet.isEmpty()) && (parameter == null || parameter.isEmpty()) + && (data == null || data.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ModuleDefinition; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ModuleMetadata.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ModuleMetadata.java new file mode 100644 index 00000000000..ec59c15fbba --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ModuleMetadata.java @@ -0,0 +1,3227 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information. + */ +@DatatypeDef(name="ModuleMetadata") +public class ModuleMetadata extends Type implements ICompositeType { + + public enum ModuleMetadataType { + /** + * The resource is a description of a knowledge module + */ + MODULE, + /** + * The resource is a shareable library of formalized knowledge + */ + LIBRARY, + /** + * An Event-Condition-Action Rule Artifact + */ + DECISIONSUPPORTRULE, + /** + * A Documentation Template Artifact + */ + DOCUMENTATIONTEMPLATE, + /** + * An Order Set Artifact + */ + ORDERSET, + /** + * added to help the parsers + */ + NULL; + public static ModuleMetadataType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("module".equals(codeString)) + return MODULE; + if ("library".equals(codeString)) + return LIBRARY; + if ("decision-support-rule".equals(codeString)) + return DECISIONSUPPORTRULE; + if ("documentation-template".equals(codeString)) + return DOCUMENTATIONTEMPLATE; + if ("order-set".equals(codeString)) + return ORDERSET; + throw new FHIRException("Unknown ModuleMetadataType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MODULE: return "module"; + case LIBRARY: return "library"; + case DECISIONSUPPORTRULE: return "decision-support-rule"; + case DOCUMENTATIONTEMPLATE: return "documentation-template"; + case ORDERSET: return "order-set"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MODULE: return "http://hl7.org/fhir/module-metadata-type"; + case LIBRARY: return "http://hl7.org/fhir/module-metadata-type"; + case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/module-metadata-type"; + case DOCUMENTATIONTEMPLATE: return "http://hl7.org/fhir/module-metadata-type"; + case ORDERSET: return "http://hl7.org/fhir/module-metadata-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MODULE: return "The resource is a description of a knowledge module"; + case LIBRARY: return "The resource is a shareable library of formalized knowledge"; + case DECISIONSUPPORTRULE: return "An Event-Condition-Action Rule Artifact"; + case DOCUMENTATIONTEMPLATE: return "A Documentation Template Artifact"; + case ORDERSET: return "An Order Set Artifact"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MODULE: return "Module"; + case LIBRARY: return "Library"; + case DECISIONSUPPORTRULE: return "Decision Support Rule"; + case DOCUMENTATIONTEMPLATE: return "Documentation Template"; + case ORDERSET: return "Order Set"; + default: return "?"; + } + } + } + + public static class ModuleMetadataTypeEnumFactory implements EnumFactory { + public ModuleMetadataType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("module".equals(codeString)) + return ModuleMetadataType.MODULE; + if ("library".equals(codeString)) + return ModuleMetadataType.LIBRARY; + if ("decision-support-rule".equals(codeString)) + return ModuleMetadataType.DECISIONSUPPORTRULE; + if ("documentation-template".equals(codeString)) + return ModuleMetadataType.DOCUMENTATIONTEMPLATE; + if ("order-set".equals(codeString)) + return ModuleMetadataType.ORDERSET; + throw new IllegalArgumentException("Unknown ModuleMetadataType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("module".equals(codeString)) + return new Enumeration(this, ModuleMetadataType.MODULE); + if ("library".equals(codeString)) + return new Enumeration(this, ModuleMetadataType.LIBRARY); + if ("decision-support-rule".equals(codeString)) + return new Enumeration(this, ModuleMetadataType.DECISIONSUPPORTRULE); + if ("documentation-template".equals(codeString)) + return new Enumeration(this, ModuleMetadataType.DOCUMENTATIONTEMPLATE); + if ("order-set".equals(codeString)) + return new Enumeration(this, ModuleMetadataType.ORDERSET); + throw new FHIRException("Unknown ModuleMetadataType code '"+codeString+"'"); + } + public String toCode(ModuleMetadataType code) { + if (code == ModuleMetadataType.MODULE) + return "module"; + if (code == ModuleMetadataType.LIBRARY) + return "library"; + if (code == ModuleMetadataType.DECISIONSUPPORTRULE) + return "decision-support-rule"; + if (code == ModuleMetadataType.DOCUMENTATIONTEMPLATE) + return "documentation-template"; + if (code == ModuleMetadataType.ORDERSET) + return "order-set"; + return "?"; + } + public String toSystem(ModuleMetadataType code) { + return code.getSystem(); + } + } + + public enum ModuleMetadataStatus { + /** + * The module is in draft state + */ + DRAFT, + /** + * The module is active + */ + ACTIVE, + /** + * The module is inactive, either rejected before publication, or retired after publication + */ + INACTIVE, + /** + * added to help the parsers + */ + NULL; + public static ModuleMetadataStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("inactive".equals(codeString)) + return INACTIVE; + throw new FHIRException("Unknown ModuleMetadataStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return "http://hl7.org/fhir/module-metadata-status"; + case ACTIVE: return "http://hl7.org/fhir/module-metadata-status"; + case INACTIVE: return "http://hl7.org/fhir/module-metadata-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "The module is in draft state"; + case ACTIVE: return "The module is active"; + case INACTIVE: return "The module is inactive, either rejected before publication, or retired after publication"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case ACTIVE: return "Active"; + case INACTIVE: return "Inactive"; + default: return "?"; + } + } + } + + public static class ModuleMetadataStatusEnumFactory implements EnumFactory { + public ModuleMetadataStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ModuleMetadataStatus.DRAFT; + if ("active".equals(codeString)) + return ModuleMetadataStatus.ACTIVE; + if ("inactive".equals(codeString)) + return ModuleMetadataStatus.INACTIVE; + throw new IllegalArgumentException("Unknown ModuleMetadataStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return new Enumeration(this, ModuleMetadataStatus.DRAFT); + if ("active".equals(codeString)) + return new Enumeration(this, ModuleMetadataStatus.ACTIVE); + if ("inactive".equals(codeString)) + return new Enumeration(this, ModuleMetadataStatus.INACTIVE); + throw new FHIRException("Unknown ModuleMetadataStatus code '"+codeString+"'"); + } + public String toCode(ModuleMetadataStatus code) { + if (code == ModuleMetadataStatus.DRAFT) + return "draft"; + if (code == ModuleMetadataStatus.ACTIVE) + return "active"; + if (code == ModuleMetadataStatus.INACTIVE) + return "inactive"; + return "?"; + } + public String toSystem(ModuleMetadataStatus code) { + return code.getSystem(); + } + } + + public enum ModuleMetadataContributorType { + /** + * An author of the content of the module + */ + AUTHOR, + /** + * An editor of the content of the module + */ + EDITOR, + /** + * A reviewer of the content of the module + */ + REVIEWER, + /** + * An endorser of the content of the module + */ + ENDORSER, + /** + * added to help the parsers + */ + NULL; + public static ModuleMetadataContributorType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("author".equals(codeString)) + return AUTHOR; + if ("editor".equals(codeString)) + return EDITOR; + if ("reviewer".equals(codeString)) + return REVIEWER; + if ("endorser".equals(codeString)) + return ENDORSER; + throw new FHIRException("Unknown ModuleMetadataContributorType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case AUTHOR: return "author"; + case EDITOR: return "editor"; + case REVIEWER: return "reviewer"; + case ENDORSER: return "endorser"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AUTHOR: return "http://hl7.org/fhir/module-metadata-contributor"; + case EDITOR: return "http://hl7.org/fhir/module-metadata-contributor"; + case REVIEWER: return "http://hl7.org/fhir/module-metadata-contributor"; + case ENDORSER: return "http://hl7.org/fhir/module-metadata-contributor"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AUTHOR: return "An author of the content of the module"; + case EDITOR: return "An editor of the content of the module"; + case REVIEWER: return "A reviewer of the content of the module"; + case ENDORSER: return "An endorser of the content of the module"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AUTHOR: return "Author"; + case EDITOR: return "Editor"; + case REVIEWER: return "Reviewer"; + case ENDORSER: return "Endorser"; + default: return "?"; + } + } + } + + public static class ModuleMetadataContributorTypeEnumFactory implements EnumFactory { + public ModuleMetadataContributorType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("author".equals(codeString)) + return ModuleMetadataContributorType.AUTHOR; + if ("editor".equals(codeString)) + return ModuleMetadataContributorType.EDITOR; + if ("reviewer".equals(codeString)) + return ModuleMetadataContributorType.REVIEWER; + if ("endorser".equals(codeString)) + return ModuleMetadataContributorType.ENDORSER; + throw new IllegalArgumentException("Unknown ModuleMetadataContributorType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("author".equals(codeString)) + return new Enumeration(this, ModuleMetadataContributorType.AUTHOR); + if ("editor".equals(codeString)) + return new Enumeration(this, ModuleMetadataContributorType.EDITOR); + if ("reviewer".equals(codeString)) + return new Enumeration(this, ModuleMetadataContributorType.REVIEWER); + if ("endorser".equals(codeString)) + return new Enumeration(this, ModuleMetadataContributorType.ENDORSER); + throw new FHIRException("Unknown ModuleMetadataContributorType code '"+codeString+"'"); + } + public String toCode(ModuleMetadataContributorType code) { + if (code == ModuleMetadataContributorType.AUTHOR) + return "author"; + if (code == ModuleMetadataContributorType.EDITOR) + return "editor"; + if (code == ModuleMetadataContributorType.REVIEWER) + return "reviewer"; + if (code == ModuleMetadataContributorType.ENDORSER) + return "endorser"; + return "?"; + } + public String toSystem(ModuleMetadataContributorType code) { + return code.getSystem(); + } + } + + public enum ModuleMetadataResourceType { + /** + * Additional documentation for the module. This would include additional instructions on usage as well additional information on clinical context or appropriateness + */ + DOCUMENTATION, + /** + * A summary of the justification for the artifact including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the module available to the consumer of interventions or results produced by the artifact + */ + JUSTIFICATION, + /** + * Bibliographic citation for papers, references, or other relevant material for the module. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this module + */ + CITATION, + /** + * The previous version of the module + */ + PREDECESSOR, + /** + * The next version of the module + */ + SUCCESSOR, + /** + * The module is derived from the resource. This is intended to capture the relationship when a particular module is based on the content of another module, but is modified to capture either a different set of overall requirements, or a more specific set of requirements such as those involved in a particular institution or clinical setting + */ + DERIVEDFROM, + /** + * added to help the parsers + */ + NULL; + public static ModuleMetadataResourceType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("documentation".equals(codeString)) + return DOCUMENTATION; + if ("justification".equals(codeString)) + return JUSTIFICATION; + if ("citation".equals(codeString)) + return CITATION; + if ("predecessor".equals(codeString)) + return PREDECESSOR; + if ("successor".equals(codeString)) + return SUCCESSOR; + if ("derived-from".equals(codeString)) + return DERIVEDFROM; + throw new FHIRException("Unknown ModuleMetadataResourceType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DOCUMENTATION: return "documentation"; + case JUSTIFICATION: return "justification"; + case CITATION: return "citation"; + case PREDECESSOR: return "predecessor"; + case SUCCESSOR: return "successor"; + case DERIVEDFROM: return "derived-from"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DOCUMENTATION: return "http://hl7.org/fhir/module-metadata-resource-type"; + case JUSTIFICATION: return "http://hl7.org/fhir/module-metadata-resource-type"; + case CITATION: return "http://hl7.org/fhir/module-metadata-resource-type"; + case PREDECESSOR: return "http://hl7.org/fhir/module-metadata-resource-type"; + case SUCCESSOR: return "http://hl7.org/fhir/module-metadata-resource-type"; + case DERIVEDFROM: return "http://hl7.org/fhir/module-metadata-resource-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DOCUMENTATION: return "Additional documentation for the module. This would include additional instructions on usage as well additional information on clinical context or appropriateness"; + case JUSTIFICATION: return "A summary of the justification for the artifact including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the module available to the consumer of interventions or results produced by the artifact"; + case CITATION: return "Bibliographic citation for papers, references, or other relevant material for the module. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this module"; + case PREDECESSOR: return "The previous version of the module"; + case SUCCESSOR: return "The next version of the module"; + case DERIVEDFROM: return "The module is derived from the resource. This is intended to capture the relationship when a particular module is based on the content of another module, but is modified to capture either a different set of overall requirements, or a more specific set of requirements such as those involved in a particular institution or clinical setting"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DOCUMENTATION: return "Documentation"; + case JUSTIFICATION: return "Justification"; + case CITATION: return "Citation"; + case PREDECESSOR: return "Predecessor"; + case SUCCESSOR: return "Successor"; + case DERIVEDFROM: return "Derived From"; + default: return "?"; + } + } + } + + public static class ModuleMetadataResourceTypeEnumFactory implements EnumFactory { + public ModuleMetadataResourceType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("documentation".equals(codeString)) + return ModuleMetadataResourceType.DOCUMENTATION; + if ("justification".equals(codeString)) + return ModuleMetadataResourceType.JUSTIFICATION; + if ("citation".equals(codeString)) + return ModuleMetadataResourceType.CITATION; + if ("predecessor".equals(codeString)) + return ModuleMetadataResourceType.PREDECESSOR; + if ("successor".equals(codeString)) + return ModuleMetadataResourceType.SUCCESSOR; + if ("derived-from".equals(codeString)) + return ModuleMetadataResourceType.DERIVEDFROM; + throw new IllegalArgumentException("Unknown ModuleMetadataResourceType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("documentation".equals(codeString)) + return new Enumeration(this, ModuleMetadataResourceType.DOCUMENTATION); + if ("justification".equals(codeString)) + return new Enumeration(this, ModuleMetadataResourceType.JUSTIFICATION); + if ("citation".equals(codeString)) + return new Enumeration(this, ModuleMetadataResourceType.CITATION); + if ("predecessor".equals(codeString)) + return new Enumeration(this, ModuleMetadataResourceType.PREDECESSOR); + if ("successor".equals(codeString)) + return new Enumeration(this, ModuleMetadataResourceType.SUCCESSOR); + if ("derived-from".equals(codeString)) + return new Enumeration(this, ModuleMetadataResourceType.DERIVEDFROM); + throw new FHIRException("Unknown ModuleMetadataResourceType code '"+codeString+"'"); + } + public String toCode(ModuleMetadataResourceType code) { + if (code == ModuleMetadataResourceType.DOCUMENTATION) + return "documentation"; + if (code == ModuleMetadataResourceType.JUSTIFICATION) + return "justification"; + if (code == ModuleMetadataResourceType.CITATION) + return "citation"; + if (code == ModuleMetadataResourceType.PREDECESSOR) + return "predecessor"; + if (code == ModuleMetadataResourceType.SUCCESSOR) + return "successor"; + if (code == ModuleMetadataResourceType.DERIVEDFROM) + return "derived-from"; + return "?"; + } + public String toSystem(ModuleMetadataResourceType code) { + return code.getSystem(); + } + } + + @Block() + public static class ModuleMetadataCoverageComponent extends Element implements IBaseDatatypeElement { + /** + * Specifies the focus of the coverage attribute. + */ + @Child(name = "focus", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="patient-gender | patient-age-group | clinical-focus | target-user | workflow-setting | workflow-task | clinical-venue | jurisdiction", formalDefinition="Specifies the focus of the coverage attribute." ) + protected Coding focus; + + /** + * Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus. + */ + @Child(name = "value", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Value of the coverage attribute", formalDefinition="Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus." ) + protected CodeableConcept value; + + private static final long serialVersionUID = 65126300L; + + /** + * Constructor + */ + public ModuleMetadataCoverageComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleMetadataCoverageComponent(Coding focus, CodeableConcept value) { + super(); + this.focus = focus; + this.value = value; + } + + /** + * @return {@link #focus} (Specifies the focus of the coverage attribute.) + */ + public Coding getFocus() { + if (this.focus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadataCoverageComponent.focus"); + else if (Configuration.doAutoCreate()) + this.focus = new Coding(); // cc + return this.focus; + } + + public boolean hasFocus() { + return this.focus != null && !this.focus.isEmpty(); + } + + /** + * @param value {@link #focus} (Specifies the focus of the coverage attribute.) + */ + public ModuleMetadataCoverageComponent setFocus(Coding value) { + this.focus = value; + return this; + } + + /** + * @return {@link #value} (Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.) + */ + public CodeableConcept getValue() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadataCoverageComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new CodeableConcept(); // cc + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.) + */ + public ModuleMetadataCoverageComponent setValue(CodeableConcept value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("focus", "Coding", "Specifies the focus of the coverage attribute.", 0, java.lang.Integer.MAX_VALUE, focus)); + childrenList.add(new Property("value", "CodeableConcept", "Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // Coding + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 97604824: // focus + this.focus = castToCoding(value); // Coding + break; + case 111972721: // value + this.value = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("focus")) + this.focus = castToCoding(value); // Coding + else if (name.equals("value")) + this.value = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 97604824: return getFocus(); // Coding + case 111972721: return getValue(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("focus")) { + this.focus = new Coding(); + return this.focus; + } + else if (name.equals("value")) { + this.value = new CodeableConcept(); + return this.value; + } + else + return super.addChild(name); + } + + public ModuleMetadataCoverageComponent copy() { + ModuleMetadataCoverageComponent dst = new ModuleMetadataCoverageComponent(); + copyValues(dst); + dst.focus = focus == null ? null : focus.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleMetadataCoverageComponent)) + return false; + ModuleMetadataCoverageComponent o = (ModuleMetadataCoverageComponent) other; + return compareDeep(focus, o.focus, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleMetadataCoverageComponent)) + return false; + ModuleMetadataCoverageComponent o = (ModuleMetadataCoverageComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (focus == null || focus.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "ModuleMetadata.coverage"; + + } + + } + + @Block() + public static class ModuleMetadataContributorComponent extends Element implements IBaseDatatypeElement { + /** + * The type of contributor. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="author | editor | reviewer | endorser", formalDefinition="The type of contributor." ) + protected Enumeration type; + + /** + * The name of the individual or organization responsible for the contribution. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of the contributor", formalDefinition="The name of the individual or organization responsible for the contribution." ) + protected StringType name; + + /** + * Contacts to assist a user in finding and communicating with the contributor. + */ + @Child(name = "contact", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contact details of the contributor", formalDefinition="Contacts to assist a user in finding and communicating with the contributor." ) + protected List contact; + + private static final long serialVersionUID = 1033333886L; + + /** + * Constructor + */ + public ModuleMetadataContributorComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleMetadataContributorComponent(Enumeration type, StringType name) { + super(); + this.type = type; + this.name = name; + } + + /** + * @return {@link #type} (The type of contributor.). 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 ModuleMetadataContributorComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ModuleMetadataContributorTypeEnumFactory()); // bb + 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 of contributor.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ModuleMetadataContributorComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of contributor. + */ + public ModuleMetadataContributorType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of contributor. + */ + public ModuleMetadataContributorComponent setType(ModuleMetadataContributorType value) { + if (this.type == null) + this.type = new Enumeration(new ModuleMetadataContributorTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #name} (The name of the individual or organization responsible for the contribution.). 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 ModuleMetadataContributorComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 individual or organization responsible for the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleMetadataContributorComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the individual or organization responsible for the contribution. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the individual or organization responsible for the contribution. + */ + public ModuleMetadataContributorComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the contributor.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ModuleMetadataContributorContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the contributor.) + */ + // syntactic sugar + public ModuleMetadataContributorContactComponent addContact() { //3 + ModuleMetadataContributorContactComponent t = new ModuleMetadataContributorContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadataContributorComponent addContact(ModuleMetadataContributorContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of contributor.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("name", "string", "The name of the individual or organization responsible for the contribution.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the contributor.", 0, java.lang.Integer.MAX_VALUE, contact)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ModuleMetadataContributorContactComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new ModuleMetadataContributorTypeEnumFactory().fromType(value); // Enumeration + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((ModuleMetadataContributorContactComponent) value); // ModuleMetadataContributorContactComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new ModuleMetadataContributorTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((ModuleMetadataContributorContactComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 951526432: return addContact(); // ModuleMetadataContributorContactComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name"); + } + else if (name.equals("contact")) { + return addContact(); + } + else + return super.addChild(name); + } + + public ModuleMetadataContributorComponent copy() { + ModuleMetadataContributorComponent dst = new ModuleMetadataContributorComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.name = name == null ? null : name.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ModuleMetadataContributorContactComponent i : contact) + dst.contact.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleMetadataContributorComponent)) + return false; + ModuleMetadataContributorComponent o = (ModuleMetadataContributorComponent) other; + return compareDeep(type, o.type, true) && compareDeep(name, o.name, true) && compareDeep(contact, o.contact, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleMetadataContributorComponent)) + return false; + ModuleMetadataContributorComponent o = (ModuleMetadataContributorComponent) other; + return compareValues(type, o.type, true) && compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) + && (contact == null || contact.isEmpty()); + } + + public String fhirType() { + return "ModuleMetadata.contributor"; + + } + + } + + @Block() + public static class ModuleMetadataContributorContactComponent extends Element implements IBaseDatatypeElement { + /** + * The name of an individual to contact regarding the contribution. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the contribution." ) + protected StringType name; + + /** + * Contact details for the individual (if a name was provided) or the contributor. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contact details for an individual or contributor", formalDefinition="Contact details for the individual (if a name was provided) or the contributor." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public ModuleMetadataContributorContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the contribution.). 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 ModuleMetadataContributorContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleMetadataContributorContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the contribution. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the contribution. + */ + public ModuleMetadataContributorContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the contributor.) + */ + 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} (Contact details for the individual (if a name was provided) or the contributor.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadataContributorContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the contribution.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for the individual (if a name was provided) or the contributor.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public ModuleMetadataContributorContactComponent copy() { + ModuleMetadataContributorContactComponent dst = new ModuleMetadataContributorContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleMetadataContributorContactComponent)) + return false; + ModuleMetadataContributorContactComponent o = (ModuleMetadataContributorContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleMetadataContributorContactComponent)) + return false; + ModuleMetadataContributorContactComponent o = (ModuleMetadataContributorContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "ModuleMetadata.contributor.contact"; + + } + + } + + @Block() + public static class ModuleMetadataContactComponent extends Element implements IBaseDatatypeElement { + /** + * The name of an individual to contact regarding the module. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the module." ) + protected StringType name; + + /** + * Contact details for the individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contact details for an individual or publisher", formalDefinition="Contact details for the individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public ModuleMetadataContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the module.). 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 ModuleMetadataContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the module.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleMetadataContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the module. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the module. + */ + public ModuleMetadataContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for the individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadataContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the module.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for the individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public ModuleMetadataContactComponent copy() { + ModuleMetadataContactComponent dst = new ModuleMetadataContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleMetadataContactComponent)) + return false; + ModuleMetadataContactComponent o = (ModuleMetadataContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleMetadataContactComponent)) + return false; + ModuleMetadataContactComponent o = (ModuleMetadataContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "ModuleMetadata.contact"; + + } + + } + + @Block() + public static class ModuleMetadataRelatedResourceComponent extends Element implements IBaseDatatypeElement { + /** + * The type of related resource. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="documentation | justification | citation | predecessor | successor | derived-from", formalDefinition="The type of related resource." ) + protected Enumeration type; + + /** + * The document being referenced, represented as an attachment. This is exclusive with the resource element. + */ + @Child(name = "document", type = {Attachment.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The related document", formalDefinition="The document being referenced, represented as an attachment. This is exclusive with the resource element." ) + protected Attachment document; + + /** + * The related resource, such as a library, value set, profile, or other module. + */ + @Child(name = "resource", type = {}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The related resource", formalDefinition="The related resource, such as a library, value set, profile, or other module." ) + protected Reference resource; + + /** + * The actual object that is the target of the reference (The related resource, such as a library, value set, profile, or other module.) + */ + protected Resource resourceTarget; + + private static final long serialVersionUID = -1400982664L; + + /** + * Constructor + */ + public ModuleMetadataRelatedResourceComponent() { + super(); + } + + /** + * Constructor + */ + public ModuleMetadataRelatedResourceComponent(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The type of related resource.). 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 ModuleMetadataRelatedResourceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ModuleMetadataResourceTypeEnumFactory()); // bb + 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 of related resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ModuleMetadataRelatedResourceComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of related resource. + */ + public ModuleMetadataResourceType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of related resource. + */ + public ModuleMetadataRelatedResourceComponent setType(ModuleMetadataResourceType value) { + if (this.type == null) + this.type = new Enumeration(new ModuleMetadataResourceTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.) + */ + public Attachment getDocument() { + if (this.document == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadataRelatedResourceComponent.document"); + else if (Configuration.doAutoCreate()) + this.document = new Attachment(); // cc + return this.document; + } + + public boolean hasDocument() { + return this.document != null && !this.document.isEmpty(); + } + + /** + * @param value {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.) + */ + public ModuleMetadataRelatedResourceComponent setDocument(Attachment value) { + this.document = value; + return this; + } + + /** + * @return {@link #resource} (The related resource, such as a library, value set, profile, or other module.) + */ + public Reference getResource() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadataRelatedResourceComponent.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new Reference(); // cc + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The related resource, such as a library, value set, profile, or other module.) + */ + public ModuleMetadataRelatedResourceComponent setResource(Reference value) { + this.resource = value; + return this; + } + + /** + * @return {@link #resource} 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 related resource, such as a library, value set, profile, or other module.) + */ + public Resource getResourceTarget() { + return this.resourceTarget; + } + + /** + * @param value {@link #resource} 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 related resource, such as a library, value set, profile, or other module.) + */ + public ModuleMetadataRelatedResourceComponent setResourceTarget(Resource value) { + this.resourceTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of related resource.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("document", "Attachment", "The document being referenced, represented as an attachment. This is exclusive with the resource element.", 0, java.lang.Integer.MAX_VALUE, document)); + childrenList.add(new Property("resource", "Reference(Any)", "The related resource, such as a library, value set, profile, or other module.", 0, java.lang.Integer.MAX_VALUE, resource)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Attachment + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new ModuleMetadataResourceTypeEnumFactory().fromType(value); // Enumeration + break; + case 861720859: // document + this.document = castToAttachment(value); // Attachment + break; + case -341064690: // resource + this.resource = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new ModuleMetadataResourceTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("document")) + this.document = castToAttachment(value); // Attachment + else if (name.equals("resource")) + this.resource = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 861720859: return getDocument(); // Attachment + case -341064690: return getResource(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type"); + } + else if (name.equals("document")) { + this.document = new Attachment(); + return this.document; + } + else if (name.equals("resource")) { + this.resource = new Reference(); + return this.resource; + } + else + return super.addChild(name); + } + + public ModuleMetadataRelatedResourceComponent copy() { + ModuleMetadataRelatedResourceComponent dst = new ModuleMetadataRelatedResourceComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.document = document == null ? null : document.copy(); + dst.resource = resource == null ? null : resource.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleMetadataRelatedResourceComponent)) + return false; + ModuleMetadataRelatedResourceComponent o = (ModuleMetadataRelatedResourceComponent) other; + return compareDeep(type, o.type, true) && compareDeep(document, o.document, true) && compareDeep(resource, o.resource, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleMetadataRelatedResourceComponent)) + return false; + ModuleMetadataRelatedResourceComponent o = (ModuleMetadataRelatedResourceComponent) other; + return compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (document == null || document.isEmpty()) + && (resource == null || resource.isEmpty()); + } + + public String fhirType() { + return "ModuleMetadata.relatedResource"; + + } + + } + + /** + * An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical URL to reference this module", formalDefinition="An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published." ) + protected UriType url; + + /** + * A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Logical identifier(s) for the module", formalDefinition="A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact." ) + protected List identifier; + + /** + * The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The version of the module, if any", formalDefinition="The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact." ) + protected StringType version; + + /** + * A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A machine-friendly name for the module", formalDefinition="A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation." ) + protected StringType name; + + /** + * A short, descriptive, user-friendly title for the module. + */ + @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A user-friendly title for the module", formalDefinition="A short, descriptive, user-friendly title for the module." ) + protected StringType title; + + /** + * Identifies the type of knowledge module, such as a rule, library, documentation template, or measure. + */ + @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="module | library | decision-support-rule | documentation-template | order-set", formalDefinition="Identifies the type of knowledge module, such as a rule, library, documentation template, or measure." ) + protected Enumeration type; + + /** + * The status of the module. + */ + @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | inactive", formalDefinition="The status of the module." ) + protected Enumeration status; + + /** + * Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=7, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments." ) + protected BooleanType experimental; + + /** + * A free text natural language description of the module from the consumer's perspective. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Natural language description of the module", formalDefinition="A free text natural language description of the module from the consumer's perspective." ) + protected StringType description; + + /** + * A brief description of the purpose of the module. + */ + @Child(name = "purpose", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Describes the purpose of the module", formalDefinition="A brief description of the purpose of the module." ) + protected StringType purpose; + + /** + * A detailed description of how the module is used from a clinical perspective. + */ + @Child(name = "usage", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Describes the clinical usage of the module", formalDefinition="A detailed description of how the module is used from a clinical perspective." ) + protected StringType usage; + + /** + * The date on which the module was published. + */ + @Child(name = "publicationDate", type = {DateType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Publication date for this version of the module", formalDefinition="The date on which the module was published." ) + protected DateType publicationDate; + + /** + * The date on which the module content was last reviewed. + */ + @Child(name = "lastReviewDate", type = {DateType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Last review date for the module", formalDefinition="The date on which the module content was last reviewed." ) + protected DateType lastReviewDate; + + /** + * The period during which the module content is effective. + */ + @Child(name = "effectivePeriod", type = {Period.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The effective date range for the module", formalDefinition="The period during which the module content is effective." ) + protected Period effectivePeriod; + + /** + * Specifies various attributes of the patient population for whom and/or environment of care in which the knowledge module is applicable. + */ + @Child(name = "coverage", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Describes the context of use for this module", formalDefinition="Specifies various attributes of the patient population for whom and/or environment of care in which the knowledge module is applicable." ) + protected List coverage; + + /** + * Clinical topics related to the content of the module. + */ + @Child(name = "topic", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Descriptional topics for the module", formalDefinition="Clinical topics related to the content of the module." ) + protected List topic; + + /** + * A contributor to the content of the module, including authors, editors, reviewers, and endorsers. + */ + @Child(name = "contributor", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A content contributor", formalDefinition="A contributor to the content of the module, including authors, editors, reviewers, and endorsers." ) + protected List contributor; + + /** + * The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts. + */ + @Child(name = "publisher", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module. + */ + @Child(name = "copyright", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module." ) + protected StringType copyright; + + /** + * Related resources such as additional documentation, justification, or bibliographic references. + */ + @Child(name = "relatedResource", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Related resources for the module", formalDefinition="Related resources such as additional documentation, justification, or bibliographic references." ) + protected List relatedResource; + + private static final long serialVersionUID = 1528493169L; + + /** + * Constructor + */ + public ModuleMetadata() { + super(); + } + + /** + * Constructor + */ + public ModuleMetadata(Enumeration type, Enumeration status) { + super(); + this.type = type; + this.status = status; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ModuleMetadata setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published. + */ + public ModuleMetadata setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.) + */ + 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} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadata addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ModuleMetadata setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact. + */ + public ModuleMetadata setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.). 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 ModuleMetadata.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ModuleMetadata setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation. + */ + public ModuleMetadata setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (A short, descriptive, user-friendly title for the module.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A short, descriptive, user-friendly title for the module.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public ModuleMetadata setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A short, descriptive, user-friendly title for the module. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A short, descriptive, user-friendly title for the module. + */ + public ModuleMetadata setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.). 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 ModuleMetadata.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ModuleMetadataTypeEnumFactory()); // bb + 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} (Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ModuleMetadata setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identifies the type of knowledge module, such as a rule, library, documentation template, or measure. + */ + public ModuleMetadataType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identifies the type of knowledge module, such as a rule, library, documentation template, or measure. + */ + public ModuleMetadata setType(ModuleMetadataType value) { + if (this.type == null) + this.type = new Enumeration(new ModuleMetadataTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of the module.). 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 ModuleMetadata.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ModuleMetadataStatusEnumFactory()); // bb + 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 module.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ModuleMetadata setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the module. + */ + public ModuleMetadataStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the module. + */ + public ModuleMetadata setStatus(ModuleMetadataStatus value) { + if (this.status == null) + this.status = new Enumeration(new ModuleMetadataStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ModuleMetadata setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments. + */ + public ModuleMetadata setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the module from the consumer's perspective.). 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 ModuleMetadata.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the module from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ModuleMetadata setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the module from the consumer's perspective. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the module from the consumer's perspective. + */ + public ModuleMetadata 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 #purpose} (A brief description of the purpose of the module.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value + */ + public StringType getPurposeElement() { + if (this.purpose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.purpose"); + else if (Configuration.doAutoCreate()) + this.purpose = new StringType(); // bb + return this.purpose; + } + + public boolean hasPurposeElement() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + public boolean hasPurpose() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + /** + * @param value {@link #purpose} (A brief description of the purpose of the module.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value + */ + public ModuleMetadata setPurposeElement(StringType value) { + this.purpose = value; + return this; + } + + /** + * @return A brief description of the purpose of the module. + */ + public String getPurpose() { + return this.purpose == null ? null : this.purpose.getValue(); + } + + /** + * @param value A brief description of the purpose of the module. + */ + public ModuleMetadata setPurpose(String value) { + if (Utilities.noString(value)) + this.purpose = null; + else { + if (this.purpose == null) + this.purpose = new StringType(); + this.purpose.setValue(value); + } + return this; + } + + /** + * @return {@link #usage} (A detailed description of how the module is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value + */ + public StringType getUsageElement() { + if (this.usage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.usage"); + else if (Configuration.doAutoCreate()) + this.usage = new StringType(); // bb + return this.usage; + } + + public boolean hasUsageElement() { + return this.usage != null && !this.usage.isEmpty(); + } + + public boolean hasUsage() { + return this.usage != null && !this.usage.isEmpty(); + } + + /** + * @param value {@link #usage} (A detailed description of how the module is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value + */ + public ModuleMetadata setUsageElement(StringType value) { + this.usage = value; + return this; + } + + /** + * @return A detailed description of how the module is used from a clinical perspective. + */ + public String getUsage() { + return this.usage == null ? null : this.usage.getValue(); + } + + /** + * @param value A detailed description of how the module is used from a clinical perspective. + */ + public ModuleMetadata setUsage(String value) { + if (Utilities.noString(value)) + this.usage = null; + else { + if (this.usage == null) + this.usage = new StringType(); + this.usage.setValue(value); + } + return this; + } + + /** + * @return {@link #publicationDate} (The date on which the module was published.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value + */ + public DateType getPublicationDateElement() { + if (this.publicationDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.publicationDate"); + else if (Configuration.doAutoCreate()) + this.publicationDate = new DateType(); // bb + return this.publicationDate; + } + + public boolean hasPublicationDateElement() { + return this.publicationDate != null && !this.publicationDate.isEmpty(); + } + + public boolean hasPublicationDate() { + return this.publicationDate != null && !this.publicationDate.isEmpty(); + } + + /** + * @param value {@link #publicationDate} (The date on which the module was published.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value + */ + public ModuleMetadata setPublicationDateElement(DateType value) { + this.publicationDate = value; + return this; + } + + /** + * @return The date on which the module was published. + */ + public Date getPublicationDate() { + return this.publicationDate == null ? null : this.publicationDate.getValue(); + } + + /** + * @param value The date on which the module was published. + */ + public ModuleMetadata setPublicationDate(Date value) { + if (value == null) + this.publicationDate = null; + else { + if (this.publicationDate == null) + this.publicationDate = new DateType(); + this.publicationDate.setValue(value); + } + return this; + } + + /** + * @return {@link #lastReviewDate} (The date on which the module content was last reviewed.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value + */ + public DateType getLastReviewDateElement() { + if (this.lastReviewDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.lastReviewDate"); + else if (Configuration.doAutoCreate()) + this.lastReviewDate = new DateType(); // bb + return this.lastReviewDate; + } + + public boolean hasLastReviewDateElement() { + return this.lastReviewDate != null && !this.lastReviewDate.isEmpty(); + } + + public boolean hasLastReviewDate() { + return this.lastReviewDate != null && !this.lastReviewDate.isEmpty(); + } + + /** + * @param value {@link #lastReviewDate} (The date on which the module content was last reviewed.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value + */ + public ModuleMetadata setLastReviewDateElement(DateType value) { + this.lastReviewDate = value; + return this; + } + + /** + * @return The date on which the module content was last reviewed. + */ + public Date getLastReviewDate() { + return this.lastReviewDate == null ? null : this.lastReviewDate.getValue(); + } + + /** + * @param value The date on which the module content was last reviewed. + */ + public ModuleMetadata setLastReviewDate(Date value) { + if (value == null) + this.lastReviewDate = null; + else { + if (this.lastReviewDate == null) + this.lastReviewDate = new DateType(); + this.lastReviewDate.setValue(value); + } + return this; + } + + /** + * @return {@link #effectivePeriod} (The period during which the module content is effective.) + */ + public Period getEffectivePeriod() { + if (this.effectivePeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.effectivePeriod"); + else if (Configuration.doAutoCreate()) + this.effectivePeriod = new Period(); // cc + return this.effectivePeriod; + } + + public boolean hasEffectivePeriod() { + return this.effectivePeriod != null && !this.effectivePeriod.isEmpty(); + } + + /** + * @param value {@link #effectivePeriod} (The period during which the module content is effective.) + */ + public ModuleMetadata setEffectivePeriod(Period value) { + this.effectivePeriod = value; + return this; + } + + /** + * @return {@link #coverage} (Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (ModuleMetadataCoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.) + */ + // syntactic sugar + public ModuleMetadataCoverageComponent addCoverage() { //3 + ModuleMetadataCoverageComponent t = new ModuleMetadataCoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadata addCoverage(ModuleMetadataCoverageComponent t) { //3 + if (t == null) + return this; + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return this; + } + + /** + * @return {@link #topic} (Clinical topics related to the content of the module.) + */ + public List getTopic() { + if (this.topic == null) + this.topic = new ArrayList(); + return this.topic; + } + + public boolean hasTopic() { + if (this.topic == null) + return false; + for (CodeableConcept item : this.topic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #topic} (Clinical topics related to the content of the module.) + */ + // syntactic sugar + public CodeableConcept addTopic() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.topic == null) + this.topic = new ArrayList(); + this.topic.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadata addTopic(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.topic == null) + this.topic = new ArrayList(); + this.topic.add(t); + return this; + } + + /** + * @return {@link #contributor} (A contributor to the content of the module, including authors, editors, reviewers, and endorsers.) + */ + public List getContributor() { + if (this.contributor == null) + this.contributor = new ArrayList(); + return this.contributor; + } + + public boolean hasContributor() { + if (this.contributor == null) + return false; + for (ModuleMetadataContributorComponent item : this.contributor) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contributor} (A contributor to the content of the module, including authors, editors, reviewers, and endorsers.) + */ + // syntactic sugar + public ModuleMetadataContributorComponent addContributor() { //3 + ModuleMetadataContributorComponent t = new ModuleMetadataContributorComponent(); + if (this.contributor == null) + this.contributor = new ArrayList(); + this.contributor.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadata addContributor(ModuleMetadataContributorComponent t) { //3 + if (t == null) + return this; + if (this.contributor == null) + this.contributor = new ArrayList(); + this.contributor.add(t); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ModuleMetadata setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts. + */ + public ModuleMetadata setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ModuleMetadataContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ModuleMetadataContactComponent addContact() { //3 + ModuleMetadataContactComponent t = new ModuleMetadataContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadata addContact(ModuleMetadataContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ModuleMetadata.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public ModuleMetadata setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module. + */ + public ModuleMetadata setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #relatedResource} (Related resources such as additional documentation, justification, or bibliographic references.) + */ + public List getRelatedResource() { + if (this.relatedResource == null) + this.relatedResource = new ArrayList(); + return this.relatedResource; + } + + public boolean hasRelatedResource() { + if (this.relatedResource == null) + return false; + for (ModuleMetadataRelatedResourceComponent item : this.relatedResource) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relatedResource} (Related resources such as additional documentation, justification, or bibliographic references.) + */ + // syntactic sugar + public ModuleMetadataRelatedResourceComponent addRelatedResource() { //3 + ModuleMetadataRelatedResourceComponent t = new ModuleMetadataRelatedResourceComponent(); + if (this.relatedResource == null) + this.relatedResource = new ArrayList(); + this.relatedResource.add(t); + return t; + } + + // syntactic sugar + public ModuleMetadata addRelatedResource(ModuleMetadataRelatedResourceComponent t) { //3 + if (t == null) + return this; + if (this.relatedResource == null) + this.relatedResource = new ArrayList(); + this.relatedResource.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("title", "string", "A short, descriptive, user-friendly title for the module.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("type", "code", "Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("status", "code", "The status of the module.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("description", "string", "A free text natural language description of the module from the consumer's perspective.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("purpose", "string", "A brief description of the purpose of the module.", 0, java.lang.Integer.MAX_VALUE, purpose)); + childrenList.add(new Property("usage", "string", "A detailed description of how the module is used from a clinical perspective.", 0, java.lang.Integer.MAX_VALUE, usage)); + childrenList.add(new Property("publicationDate", "date", "The date on which the module was published.", 0, java.lang.Integer.MAX_VALUE, publicationDate)); + childrenList.add(new Property("lastReviewDate", "date", "The date on which the module content was last reviewed.", 0, java.lang.Integer.MAX_VALUE, lastReviewDate)); + childrenList.add(new Property("effectivePeriod", "Period", "The period during which the module content is effective.", 0, java.lang.Integer.MAX_VALUE, effectivePeriod)); + childrenList.add(new Property("coverage", "", "Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("topic", "CodeableConcept", "Clinical topics related to the content of the module.", 0, java.lang.Integer.MAX_VALUE, topic)); + childrenList.add(new Property("contributor", "", "A contributor to the content of the module, including authors, editors, reviewers, and endorsers.", 0, java.lang.Integer.MAX_VALUE, contributor)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("relatedResource", "", "Related resources such as additional documentation, justification, or bibliographic references.", 0, java.lang.Integer.MAX_VALUE, relatedResource)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // StringType + case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType + case 1470566394: /*publicationDate*/ return this.publicationDate == null ? new Base[0] : new Base[] {this.publicationDate}; // DateType + case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType + case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // ModuleMetadataCoverageComponent + case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // CodeableConcept + case -1895276325: /*contributor*/ return this.contributor == null ? new Base[0] : this.contributor.toArray(new Base[this.contributor.size()]); // ModuleMetadataContributorComponent + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ModuleMetadataContactComponent + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case 1554540889: /*relatedResource*/ return this.relatedResource == null ? new Base[0] : this.relatedResource.toArray(new Base[this.relatedResource.size()]); // ModuleMetadataRelatedResourceComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case 3575610: // type + this.type = new ModuleMetadataTypeEnumFactory().fromType(value); // Enumeration + break; + case -892481550: // status + this.status = new ModuleMetadataStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -220463842: // purpose + this.purpose = castToString(value); // StringType + break; + case 111574433: // usage + this.usage = castToString(value); // StringType + break; + case 1470566394: // publicationDate + this.publicationDate = castToDate(value); // DateType + break; + case -1687512484: // lastReviewDate + this.lastReviewDate = castToDate(value); // DateType + break; + case -403934648: // effectivePeriod + this.effectivePeriod = castToPeriod(value); // Period + break; + case -351767064: // coverage + this.getCoverage().add((ModuleMetadataCoverageComponent) value); // ModuleMetadataCoverageComponent + break; + case 110546223: // topic + this.getTopic().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1895276325: // contributor + this.getContributor().add((ModuleMetadataContributorComponent) value); // ModuleMetadataContributorComponent + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((ModuleMetadataContactComponent) value); // ModuleMetadataContactComponent + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case 1554540889: // relatedResource + this.getRelatedResource().add((ModuleMetadataRelatedResourceComponent) value); // ModuleMetadataRelatedResourceComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("type")) + this.type = new ModuleMetadataTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("status")) + this.status = new ModuleMetadataStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("purpose")) + this.purpose = castToString(value); // StringType + else if (name.equals("usage")) + this.usage = castToString(value); // StringType + else if (name.equals("publicationDate")) + this.publicationDate = castToDate(value); // DateType + else if (name.equals("lastReviewDate")) + this.lastReviewDate = castToDate(value); // DateType + else if (name.equals("effectivePeriod")) + this.effectivePeriod = castToPeriod(value); // Period + else if (name.equals("coverage")) + this.getCoverage().add((ModuleMetadataCoverageComponent) value); + else if (name.equals("topic")) + this.getTopic().add(castToCodeableConcept(value)); + else if (name.equals("contributor")) + this.getContributor().add((ModuleMetadataContributorComponent) value); + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((ModuleMetadataContactComponent) value); + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("relatedResource")) + this.getRelatedResource().add((ModuleMetadataRelatedResourceComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return addIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -220463842: throw new FHIRException("Cannot make property purpose as it is not a complex type"); // StringType + case 111574433: throw new FHIRException("Cannot make property usage as it is not a complex type"); // StringType + case 1470566394: throw new FHIRException("Cannot make property publicationDate as it is not a complex type"); // DateType + case -1687512484: throw new FHIRException("Cannot make property lastReviewDate as it is not a complex type"); // DateType + case -403934648: return getEffectivePeriod(); // Period + case -351767064: return addCoverage(); // ModuleMetadataCoverageComponent + case 110546223: return addTopic(); // CodeableConcept + case -1895276325: return addContributor(); // ModuleMetadataContributorComponent + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // ModuleMetadataContactComponent + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case 1554540889: return addRelatedResource(); // ModuleMetadataRelatedResourceComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.url"); + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name"); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.title"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.experimental"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.description"); + } + else if (name.equals("purpose")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.purpose"); + } + else if (name.equals("usage")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.usage"); + } + else if (name.equals("publicationDate")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.publicationDate"); + } + else if (name.equals("lastReviewDate")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.lastReviewDate"); + } + else if (name.equals("effectivePeriod")) { + this.effectivePeriod = new Period(); + return this.effectivePeriod; + } + else if (name.equals("coverage")) { + return addCoverage(); + } + else if (name.equals("topic")) { + return addTopic(); + } + else if (name.equals("contributor")) { + return addContributor(); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.copyright"); + } + else if (name.equals("relatedResource")) { + return addRelatedResource(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ModuleMetadata"; + + } + + public ModuleMetadata copy() { + ModuleMetadata dst = new ModuleMetadata(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.title = title == null ? null : title.copy(); + dst.type = type == null ? null : type.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.description = description == null ? null : description.copy(); + dst.purpose = purpose == null ? null : purpose.copy(); + dst.usage = usage == null ? null : usage.copy(); + dst.publicationDate = publicationDate == null ? null : publicationDate.copy(); + dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy(); + dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (ModuleMetadataCoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (topic != null) { + dst.topic = new ArrayList(); + for (CodeableConcept i : topic) + dst.topic.add(i.copy()); + }; + if (contributor != null) { + dst.contributor = new ArrayList(); + for (ModuleMetadataContributorComponent i : contributor) + dst.contributor.add(i.copy()); + }; + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ModuleMetadataContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.copyright = copyright == null ? null : copyright.copy(); + if (relatedResource != null) { + dst.relatedResource = new ArrayList(); + for (ModuleMetadataRelatedResourceComponent i : relatedResource) + dst.relatedResource.add(i.copy()); + }; + return dst; + } + + protected ModuleMetadata typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ModuleMetadata)) + return false; + ModuleMetadata o = (ModuleMetadata) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(title, o.title, true) && compareDeep(type, o.type, true) + && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(description, o.description, true) + && compareDeep(purpose, o.purpose, true) && compareDeep(usage, o.usage, true) && compareDeep(publicationDate, o.publicationDate, true) + && compareDeep(lastReviewDate, o.lastReviewDate, true) && compareDeep(effectivePeriod, o.effectivePeriod, true) + && compareDeep(coverage, o.coverage, true) && compareDeep(topic, o.topic, true) && compareDeep(contributor, o.contributor, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(relatedResource, o.relatedResource, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ModuleMetadata)) + return false; + ModuleMetadata o = (ModuleMetadata) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(title, o.title, true) && compareValues(type, o.type, true) && compareValues(status, o.status, true) + && compareValues(experimental, o.experimental, true) && compareValues(description, o.description, true) + && compareValues(purpose, o.purpose, true) && compareValues(usage, o.usage, true) && compareValues(publicationDate, o.publicationDate, true) + && compareValues(lastReviewDate, o.lastReviewDate, true) && compareValues(publisher, o.publisher, true) + && compareValues(copyright, o.copyright, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (title == null || title.isEmpty()) + && (type == null || type.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (description == null || description.isEmpty()) && (purpose == null || purpose.isEmpty()) + && (usage == null || usage.isEmpty()) && (publicationDate == null || publicationDate.isEmpty()) + && (lastReviewDate == null || lastReviewDate.isEmpty()) && (effectivePeriod == null || effectivePeriod.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (topic == null || topic.isEmpty()) && (contributor == null || contributor.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (copyright == null || copyright.isEmpty()) + && (relatedResource == null || relatedResource.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Money.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Money.java new file mode 100644 index 00000000000..fb29324e494 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Money.java @@ -0,0 +1,88 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Money", profileOf=Quantity.class) +public class Money extends Quantity { + + private static final long serialVersionUID = 1069574054L; + + public Money copy() { + Money dst = new Money(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Money typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Money)) + return false; + Money o = (Money) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Money)) + return false; + Money o = (Money) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/NamingSystem.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/NamingSystem.java new file mode 100644 index 00000000000..c5e287ffbc5 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/NamingSystem.java @@ -0,0 +1,2065 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + */ +@ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem") +public class NamingSystem extends DomainResource { + + public enum NamingSystemType { + /** + * The naming system is used to define concepts and symbols to represent those concepts; e.g. UCUM, LOINC, NDC code, local lab codes, etc. + */ + CODESYSTEM, + /** + * The naming system is used to manage identifiers (e.g. license numbers, order numbers, etc.). + */ + IDENTIFIER, + /** + * The naming system is used as the root for other identifiers and naming systems. + */ + ROOT, + /** + * added to help the parsers + */ + NULL; + public static NamingSystemType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("codesystem".equals(codeString)) + return CODESYSTEM; + if ("identifier".equals(codeString)) + return IDENTIFIER; + if ("root".equals(codeString)) + return ROOT; + throw new FHIRException("Unknown NamingSystemType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CODESYSTEM: return "codesystem"; + case IDENTIFIER: return "identifier"; + case ROOT: return "root"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CODESYSTEM: return "http://hl7.org/fhir/namingsystem-type"; + case IDENTIFIER: return "http://hl7.org/fhir/namingsystem-type"; + case ROOT: return "http://hl7.org/fhir/namingsystem-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CODESYSTEM: return "The naming system is used to define concepts and symbols to represent those concepts; e.g. UCUM, LOINC, NDC code, local lab codes, etc."; + case IDENTIFIER: return "The naming system is used to manage identifiers (e.g. license numbers, order numbers, etc.)."; + case ROOT: return "The naming system is used as the root for other identifiers and naming systems."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CODESYSTEM: return "Code System"; + case IDENTIFIER: return "Identifier"; + case ROOT: return "Root"; + default: return "?"; + } + } + } + + 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; + if ("codesystem".equals(codeString)) + return NamingSystemType.CODESYSTEM; + if ("identifier".equals(codeString)) + return NamingSystemType.IDENTIFIER; + if ("root".equals(codeString)) + return NamingSystemType.ROOT; + throw new IllegalArgumentException("Unknown NamingSystemType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("codesystem".equals(codeString)) + return new Enumeration(this, NamingSystemType.CODESYSTEM); + if ("identifier".equals(codeString)) + return new Enumeration(this, NamingSystemType.IDENTIFIER); + if ("root".equals(codeString)) + return new Enumeration(this, NamingSystemType.ROOT); + throw new FHIRException("Unknown NamingSystemType code '"+codeString+"'"); + } + public String toCode(NamingSystemType code) { + if (code == NamingSystemType.CODESYSTEM) + return "codesystem"; + if (code == NamingSystemType.IDENTIFIER) + return "identifier"; + if (code == NamingSystemType.ROOT) + return "root"; + return "?"; + } + public String toSystem(NamingSystemType code) { + return code.getSystem(); + } + } + + public enum NamingSystemIdentifierType { + /** + * An ISO object identifier; e.g. 1.2.3.4.5. + */ + OID, + /** + * A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11. + */ + UUID, + /** + * A uniform resource identifier (ideally a URL - uniform resource locator); e.g. http://unitsofmeasure.org. + */ + URI, + /** + * Some other type of unique identifier; e.g. HL7-assigned reserved string such as LN for LOINC. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static NamingSystemIdentifierType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("oid".equals(codeString)) + return OID; + if ("uuid".equals(codeString)) + return UUID; + if ("uri".equals(codeString)) + return URI; + if ("other".equals(codeString)) + return OTHER; + throw new FHIRException("Unknown NamingSystemIdentifierType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OID: return "oid"; + case UUID: return "uuid"; + case URI: return "uri"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OID: return "http://hl7.org/fhir/namingsystem-identifier-type"; + case UUID: return "http://hl7.org/fhir/namingsystem-identifier-type"; + case URI: return "http://hl7.org/fhir/namingsystem-identifier-type"; + case OTHER: return "http://hl7.org/fhir/namingsystem-identifier-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OID: return "An ISO object identifier; e.g. 1.2.3.4.5."; + case UUID: return "A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11."; + case URI: return "A uniform resource identifier (ideally a URL - uniform resource locator); e.g. http://unitsofmeasure.org."; + case OTHER: return "Some other type of unique identifier; e.g. HL7-assigned reserved string such as LN for LOINC."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OID: return "OID"; + case UUID: return "UUID"; + case URI: return "URI"; + case OTHER: return "Other"; + default: return "?"; + } + } + } + + 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; + if ("oid".equals(codeString)) + return NamingSystemIdentifierType.OID; + if ("uuid".equals(codeString)) + return NamingSystemIdentifierType.UUID; + if ("uri".equals(codeString)) + return NamingSystemIdentifierType.URI; + if ("other".equals(codeString)) + return NamingSystemIdentifierType.OTHER; + throw new IllegalArgumentException("Unknown NamingSystemIdentifierType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("oid".equals(codeString)) + return new Enumeration(this, NamingSystemIdentifierType.OID); + if ("uuid".equals(codeString)) + return new Enumeration(this, NamingSystemIdentifierType.UUID); + if ("uri".equals(codeString)) + return new Enumeration(this, NamingSystemIdentifierType.URI); + if ("other".equals(codeString)) + return new Enumeration(this, NamingSystemIdentifierType.OTHER); + throw new FHIRException("Unknown NamingSystemIdentifierType code '"+codeString+"'"); + } + public String toCode(NamingSystemIdentifierType code) { + if (code == NamingSystemIdentifierType.OID) + return "oid"; + if (code == NamingSystemIdentifierType.UUID) + return "uuid"; + if (code == NamingSystemIdentifierType.URI) + return "uri"; + if (code == NamingSystemIdentifierType.OTHER) + return "other"; + return "?"; + } + public String toSystem(NamingSystemIdentifierType code) { + return code.getSystem(); + } + } + + @Block() + public static class NamingSystemContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the naming system. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the naming system." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public NamingSystemContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the naming system.). 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 NamingSystemContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the naming system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public NamingSystemContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the naming system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the naming system. + */ + public NamingSystemContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public NamingSystemContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the naming system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public NamingSystemContactComponent copy() { + NamingSystemContactComponent dst = new NamingSystemContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NamingSystemContactComponent)) + return false; + NamingSystemContactComponent o = (NamingSystemContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NamingSystemContactComponent)) + return false; + NamingSystemContactComponent o = (NamingSystemContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "NamingSystem.contact"; + + } + + } + + @Block() + public static class NamingSystemUniqueIdComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the unique identifier scheme used for this particular identifier. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="oid | uuid | uri | other", formalDefinition="Identifies the unique identifier scheme used for this particular identifier." ) + protected Enumeration type; + + /** + * The string that should be sent over the wire to identify the code system or identifier system. + */ + @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The unique identifier", formalDefinition="The string that should be sent over the wire to identify the code system or identifier system." ) + protected StringType value; + + /** + * Indicates whether this identifier is the "preferred" identifier of this type. + */ + @Child(name = "preferred", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Is this the id that should be used for this type", formalDefinition="Indicates whether this identifier is the \"preferred\" identifier of this type." ) + protected BooleanType preferred; + + /** + * Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic. + */ + @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="When is identifier valid?", formalDefinition="Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic." ) + protected Period period; + + private static final long serialVersionUID = -193711840L; + + /** + * Constructor + */ + public NamingSystemUniqueIdComponent() { + super(); + } + + /** + * Constructor + */ + public NamingSystemUniqueIdComponent(Enumeration type, StringType value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). 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 NamingSystemUniqueIdComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new NamingSystemIdentifierTypeEnumFactory()); // bb + 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} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identifies the unique identifier scheme used for this particular identifier. + */ + public NamingSystemIdentifierType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identifies the unique identifier scheme used for this particular identifier. + */ + public NamingSystemUniqueIdComponent setType(NamingSystemIdentifierType value) { + if (this.type == null) + this.type = new Enumeration(new NamingSystemIdentifierTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The string that should be sent over the wire to identify the code system or identifier system. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The string that should be sent over the wire to identify the code system or identifier system. + */ + public NamingSystemUniqueIdComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + /** + * @return {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public BooleanType getPreferredElement() { + if (this.preferred == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.preferred"); + else if (Configuration.doAutoCreate()) + this.preferred = new BooleanType(); // bb + return this.preferred; + } + + public boolean hasPreferredElement() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + public boolean hasPreferred() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + /** + * @param value {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setPreferredElement(BooleanType value) { + this.preferred = value; + return this; + } + + /** + * @return Indicates whether this identifier is the "preferred" identifier of this type. + */ + public boolean getPreferred() { + return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); + } + + /** + * @param value Indicates whether this identifier is the "preferred" identifier of this type. + */ + public NamingSystemUniqueIdComponent setPreferred(boolean value) { + if (this.preferred == null) + this.preferred = new BooleanType(); + this.preferred.setValue(value); + return this; + } + + /** + * @return {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic.) + */ + public NamingSystemUniqueIdComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Identifies the unique identifier scheme used for this particular identifier.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value", "string", "The string that should be sent over the wire to identify the code system or identifier system.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("preferred", "boolean", "Indicates whether this identifier is the \"preferred\" identifier of this type.", 0, java.lang.Integer.MAX_VALUE, preferred)); + childrenList.add(new Property("period", "Period", "Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + case -1294005119: /*preferred*/ return this.preferred == null ? new Base[0] : new Base[] {this.preferred}; // BooleanType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new NamingSystemIdentifierTypeEnumFactory().fromType(value); // Enumeration + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + case -1294005119: // preferred + this.preferred = castToBoolean(value); // BooleanType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new NamingSystemIdentifierTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("value")) + this.value = castToString(value); // StringType + else if (name.equals("preferred")) + this.preferred = castToBoolean(value); // BooleanType + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + case -1294005119: throw new FHIRException("Cannot make property preferred as it is not a complex type"); // BooleanType + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.type"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.value"); + } + else if (name.equals("preferred")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.preferred"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public NamingSystemUniqueIdComponent copy() { + NamingSystemUniqueIdComponent dst = new NamingSystemUniqueIdComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + dst.preferred = preferred == null ? null : preferred.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NamingSystemUniqueIdComponent)) + return false; + NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other; + return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(preferred, o.preferred, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NamingSystemUniqueIdComponent)) + return false; + NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other; + return compareValues(type, o.type, true) && compareValues(value, o.value, true) && compareValues(preferred, o.preferred, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + && (preferred == null || preferred.isEmpty()) && (period == null || period.isEmpty()); + } + + public String fhirType() { + return "NamingSystem.uniqueId"; + + } + + } + + /** + * The descriptive name of this particular identifier type or code system. + */ + @Child(name = "name", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Human-readable label", formalDefinition="The descriptive name of this particular identifier type or code system." ) + protected StringType name; + + /** + * Indicates whether the naming system is "ready for use" or not. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="draft | active | retired", formalDefinition="Indicates whether the naming system is \"ready for use\" or not." ) + protected Enumeration status; + + /** + * Indicates the purpose for the naming system - what kinds of things does it make unique? + */ + @Child(name = "kind", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="codesystem | identifier | root", formalDefinition="Indicates the purpose for the naming system - what kinds of things does it make unique?" ) + protected Enumeration kind; + + /** + * The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes." ) + protected DateTimeType date; + + /** + * The name of the individual or organization that published the naming system. + */ + @Child(name = "publisher", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the naming system." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + @Child(name = "responsible", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who maintains system namespace?", formalDefinition="The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision." ) + protected StringType responsible; + + /** + * Categorizes a naming system for easier search by grouping related naming systems. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="e.g. driver, provider, patient, bank etc.", formalDefinition="Categorizes a naming system for easier search by grouping related naming systems." ) + protected CodeableConcept type; + + /** + * Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="What does naming system identify?", formalDefinition="Details about what the namespace identifies including scope, granularity, version labeling, etc." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems." ) + protected List useContext; + + /** + * Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + @Child(name = "usage", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="How/where is it used", formalDefinition="Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc." ) + protected StringType usage; + + /** + * Indicates how the system may be identified when referenced in electronic exchange. + */ + @Child(name = "uniqueId", type = {}, order=11, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Unique identifiers used for system", formalDefinition="Indicates how the system may be identified when referenced in electronic exchange." ) + protected List uniqueId; + + /** + * For naming systems that are retired, indicates the naming system that should be used in their place (if any). + */ + @Child(name = "replacedBy", type = {NamingSystem.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use this instead", formalDefinition="For naming systems that are retired, indicates the naming system that should be used in their place (if any)." ) + protected Reference replacedBy; + + /** + * The actual object that is the target of the reference (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) + */ + protected NamingSystem replacedByTarget; + + private static final long serialVersionUID = -1633030631L; + + /** + * Constructor + */ + public NamingSystem() { + super(); + } + + /** + * Constructor + */ + public NamingSystem(StringType name, Enumeration status, Enumeration kind, DateTimeType date) { + super(); + this.name = name; + this.status = status; + this.kind = kind; + this.date = date; + } + + /** + * @return {@link #name} (The descriptive name of this particular identifier type or code system.). 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 NamingSystem.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public NamingSystem setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The descriptive name of this particular identifier type or code system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The descriptive name of this particular identifier type or code system. + */ + public NamingSystem setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #status} (Indicates whether the naming system is "ready for use" or not.). 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 NamingSystem.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 naming system is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public NamingSystem setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the naming system is "ready for use" or not. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the naming system is "ready for use" or not. + */ + public NamingSystem setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #kind} (Indicates the purpose for the naming system - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new NamingSystemTypeEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Indicates the purpose for the naming system - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public NamingSystem setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return Indicates the purpose for the naming system - what kinds of things does it make unique? + */ + public NamingSystemType getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value Indicates the purpose for the naming system - what kinds of things does it make unique? + */ + public NamingSystem setKind(NamingSystemType value) { + if (this.kind == null) + this.kind = new Enumeration(new NamingSystemTypeEnumFactory()); + this.kind.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes.). 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 NamingSystem.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public NamingSystem setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes. + */ + public NamingSystem setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public NamingSystem setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the naming system. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the naming system. + */ + public NamingSystem setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (NamingSystemContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public NamingSystemContactComponent addContact() { //3 + NamingSystemContactComponent t = new NamingSystemContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public NamingSystem addContact(NamingSystemContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public StringType getResponsibleElement() { + if (this.responsible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.responsible"); + else if (Configuration.doAutoCreate()) + this.responsible = new StringType(); // bb + return this.responsible; + } + + public boolean hasResponsibleElement() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + public boolean hasResponsible() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + /** + * @param value {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public NamingSystem setResponsibleElement(StringType value) { + this.responsible = value; + return this; + } + + /** + * @return The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + public String getResponsible() { + return this.responsible == null ? null : this.responsible.getValue(); + } + + /** + * @param value The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + public NamingSystem setResponsible(String value) { + if (Utilities.noString(value)) + this.responsible = null; + else { + if (this.responsible == null) + this.responsible = new StringType(); + this.responsible.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Categorizes a naming system for easier search by grouping related naming systems.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Categorizes a naming system for easier search by grouping related naming systems.) + */ + public NamingSystem setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). 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 NamingSystem.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public NamingSystem setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + public NamingSystem 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public NamingSystem addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value + */ + public StringType getUsageElement() { + if (this.usage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.usage"); + else if (Configuration.doAutoCreate()) + this.usage = new StringType(); // bb + return this.usage; + } + + public boolean hasUsageElement() { + return this.usage != null && !this.usage.isEmpty(); + } + + public boolean hasUsage() { + return this.usage != null && !this.usage.isEmpty(); + } + + /** + * @param value {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value + */ + public NamingSystem setUsageElement(StringType value) { + this.usage = value; + return this; + } + + /** + * @return Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + public String getUsage() { + return this.usage == null ? null : this.usage.getValue(); + } + + /** + * @param value Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + public NamingSystem setUsage(String value) { + if (Utilities.noString(value)) + this.usage = null; + else { + if (this.usage == null) + this.usage = new StringType(); + this.usage.setValue(value); + } + return this; + } + + /** + * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) + */ + public List getUniqueId() { + if (this.uniqueId == null) + this.uniqueId = new ArrayList(); + return this.uniqueId; + } + + public boolean hasUniqueId() { + if (this.uniqueId == null) + return false; + for (NamingSystemUniqueIdComponent item : this.uniqueId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) + */ + // syntactic sugar + public NamingSystemUniqueIdComponent addUniqueId() { //3 + NamingSystemUniqueIdComponent t = new NamingSystemUniqueIdComponent(); + if (this.uniqueId == null) + this.uniqueId = new ArrayList(); + this.uniqueId.add(t); + return t; + } + + // syntactic sugar + public NamingSystem addUniqueId(NamingSystemUniqueIdComponent t) { //3 + if (t == null) + return this; + if (this.uniqueId == null) + this.uniqueId = new ArrayList(); + this.uniqueId.add(t); + return this; + } + + /** + * @return {@link #replacedBy} (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) + */ + public Reference getReplacedBy() { + if (this.replacedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.replacedBy"); + else if (Configuration.doAutoCreate()) + this.replacedBy = new Reference(); // cc + return this.replacedBy; + } + + public boolean hasReplacedBy() { + return this.replacedBy != null && !this.replacedBy.isEmpty(); + } + + /** + * @param value {@link #replacedBy} (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) + */ + public NamingSystem setReplacedBy(Reference value) { + this.replacedBy = value; + return this; + } + + /** + * @return {@link #replacedBy} 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. (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) + */ + public NamingSystem getReplacedByTarget() { + if (this.replacedByTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.replacedBy"); + else if (Configuration.doAutoCreate()) + this.replacedByTarget = new NamingSystem(); // aa + return this.replacedByTarget; + } + + /** + * @param value {@link #replacedBy} 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. (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) + */ + public NamingSystem setReplacedByTarget(NamingSystem value) { + this.replacedByTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The descriptive name of this particular identifier type or code system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "Indicates whether the naming system is \"ready for use\" or not.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("kind", "code", "Indicates the purpose for the naming system - what kinds of things does it make unique?", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the naming system.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("responsible", "string", "The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.", 0, java.lang.Integer.MAX_VALUE, responsible)); + childrenList.add(new Property("type", "CodeableConcept", "Categorizes a naming system for easier search by grouping related naming systems.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("description", "string", "Details about what the namespace identifies including scope, granularity, version labeling, etc.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("usage", "string", "Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.", 0, java.lang.Integer.MAX_VALUE, usage)); + childrenList.add(new Property("uniqueId", "", "Indicates how the system may be identified when referenced in electronic exchange.", 0, java.lang.Integer.MAX_VALUE, uniqueId)); + childrenList.add(new Property("replacedBy", "Reference(NamingSystem)", "For naming systems that are retired, indicates the naming system that should be used in their place (if any).", 0, java.lang.Integer.MAX_VALUE, replacedBy)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // NamingSystemContactComponent + case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType + case -294460212: /*uniqueId*/ return this.uniqueId == null ? new Base[0] : this.uniqueId.toArray(new Base[this.uniqueId.size()]); // NamingSystemUniqueIdComponent + case -1233035097: /*replacedBy*/ return this.replacedBy == null ? new Base[0] : new Base[] {this.replacedBy}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case 3292052: // kind + this.kind = new NamingSystemTypeEnumFactory().fromType(value); // Enumeration + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((NamingSystemContactComponent) value); // NamingSystemContactComponent + break; + case 1847674614: // responsible + this.responsible = castToString(value); // StringType + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 111574433: // usage + this.usage = castToString(value); // StringType + break; + case -294460212: // uniqueId + this.getUniqueId().add((NamingSystemUniqueIdComponent) value); // NamingSystemUniqueIdComponent + break; + case -1233035097: // replacedBy + this.replacedBy = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("kind")) + this.kind = new NamingSystemTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((NamingSystemContactComponent) value); + else if (name.equals("responsible")) + this.responsible = castToString(value); // StringType + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("usage")) + this.usage = castToString(value); // StringType + else if (name.equals("uniqueId")) + this.getUniqueId().add((NamingSystemUniqueIdComponent) value); + else if (name.equals("replacedBy")) + this.replacedBy = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // NamingSystemContactComponent + case 1847674614: throw new FHIRException("Cannot make property responsible as it is not a complex type"); // StringType + case 3575610: return getType(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case 111574433: throw new FHIRException("Cannot make property usage as it is not a complex type"); // StringType + case -294460212: return addUniqueId(); // NamingSystemUniqueIdComponent + case -1233035097: return getReplacedBy(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.status"); + } + else if (name.equals("kind")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.kind"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.date"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("responsible")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.responsible"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("usage")) { + throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.usage"); + } + else if (name.equals("uniqueId")) { + return addUniqueId(); + } + else if (name.equals("replacedBy")) { + this.replacedBy = new Reference(); + return this.replacedBy; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "NamingSystem"; + + } + + public NamingSystem copy() { + NamingSystem dst = new NamingSystem(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.kind = kind == null ? null : kind.copy(); + dst.date = date == null ? null : date.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (NamingSystemContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.responsible = responsible == null ? null : responsible.copy(); + dst.type = type == null ? null : type.copy(); + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.usage = usage == null ? null : usage.copy(); + if (uniqueId != null) { + dst.uniqueId = new ArrayList(); + for (NamingSystemUniqueIdComponent i : uniqueId) + dst.uniqueId.add(i.copy()); + }; + dst.replacedBy = replacedBy == null ? null : replacedBy.copy(); + return dst; + } + + protected NamingSystem typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NamingSystem)) + return false; + NamingSystem o = (NamingSystem) other; + return compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(kind, o.kind, true) + && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) + && compareDeep(responsible, o.responsible, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true) + && compareDeep(useContext, o.useContext, true) && compareDeep(usage, o.usage, true) && compareDeep(uniqueId, o.uniqueId, true) + && compareDeep(replacedBy, o.replacedBy, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NamingSystem)) + return false; + NamingSystem o = (NamingSystem) other; + return compareValues(name, o.name, true) && compareValues(status, o.status, true) && compareValues(kind, o.kind, true) + && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(responsible, o.responsible, true) + && compareValues(description, o.description, true) && compareValues(usage, o.usage, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) + && (kind == null || kind.isEmpty()) && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (responsible == null || responsible.isEmpty()) + && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (usage == null || usage.isEmpty()) && (uniqueId == null || uniqueId.isEmpty()) && (replacedBy == null || replacedBy.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.NamingSystem; + } + + /** + * Search parameter: responsible + *

+ * Description: Who maintains system namespace?
+ * Type: string
+ * Path: NamingSystem.responsible
+ *

+ */ + @SearchParamDefinition(name="responsible", path="NamingSystem.responsible", description="Who maintains system namespace?", type="string" ) + public static final String SP_RESPONSIBLE = "responsible"; + /** + * Fluent Client search parameter constant for responsible + *

+ * Description: Who maintains system namespace?
+ * Type: string
+ * Path: NamingSystem.responsible
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam RESPONSIBLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_RESPONSIBLE); + + /** + * Search parameter: status + *

+ * Description: draft | active | retired
+ * Type: token
+ * Path: NamingSystem.status
+ *

+ */ + @SearchParamDefinition(name="status", path="NamingSystem.status", description="draft | active | retired", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: draft | active | retired
+ * Type: token
+ * Path: NamingSystem.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: type + *

+ * Description: e.g. driver, provider, patient, bank etc.
+ * Type: token
+ * Path: NamingSystem.type
+ *

+ */ + @SearchParamDefinition(name="type", path="NamingSystem.type", description="e.g. driver, provider, patient, bank etc.", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: e.g. driver, provider, patient, bank etc.
+ * Type: token
+ * Path: NamingSystem.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: date + *

+ * Description: Publication Date(/time)
+ * Type: date
+ * Path: NamingSystem.date
+ *

+ */ + @SearchParamDefinition(name="date", path="NamingSystem.date", description="Publication Date(/time)", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Publication Date(/time)
+ * Type: date
+ * Path: NamingSystem.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: period + *

+ * Description: When is identifier valid?
+ * Type: date
+ * Path: NamingSystem.uniqueId.period
+ *

+ */ + @SearchParamDefinition(name="period", path="NamingSystem.uniqueId.period", description="When is identifier valid?", type="date" ) + public static final String SP_PERIOD = "period"; + /** + * Fluent Client search parameter constant for period + *

+ * Description: When is identifier valid?
+ * Type: date
+ * Path: NamingSystem.uniqueId.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); + + /** + * Search parameter: contact + *

+ * Description: Name of an individual to contact
+ * Type: string
+ * Path: NamingSystem.contact.name
+ *

+ */ + @SearchParamDefinition(name="contact", path="NamingSystem.contact.name", description="Name of an individual to contact", type="string" ) + public static final String SP_CONTACT = "contact"; + /** + * Fluent Client search parameter constant for contact + *

+ * Description: Name of an individual to contact
+ * Type: string
+ * Path: NamingSystem.contact.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam CONTACT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_CONTACT); + + /** + * Search parameter: kind + *

+ * Description: codesystem | identifier | root
+ * Type: token
+ * Path: NamingSystem.kind
+ *

+ */ + @SearchParamDefinition(name="kind", path="NamingSystem.kind", description="codesystem | identifier | root", type="token" ) + public static final String SP_KIND = "kind"; + /** + * Fluent Client search parameter constant for kind + *

+ * Description: codesystem | identifier | root
+ * Type: token
+ * Path: NamingSystem.kind
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher (Organization or individual)
+ * Type: string
+ * Path: NamingSystem.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="NamingSystem.publisher", description="Name of the publisher (Organization or individual)", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher (Organization or individual)
+ * Type: string
+ * Path: NamingSystem.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: id-type + *

+ * Description: oid | uuid | uri | other
+ * Type: token
+ * Path: NamingSystem.uniqueId.type
+ *

+ */ + @SearchParamDefinition(name="id-type", path="NamingSystem.uniqueId.type", description="oid | uuid | uri | other", type="token" ) + public static final String SP_ID_TYPE = "id-type"; + /** + * Fluent Client search parameter constant for id-type + *

+ * Description: oid | uuid | uri | other
+ * Type: token
+ * Path: NamingSystem.uniqueId.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ID_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ID_TYPE); + + /** + * Search parameter: name + *

+ * Description: Human-readable label
+ * Type: string
+ * Path: NamingSystem.name
+ *

+ */ + @SearchParamDefinition(name="name", path="NamingSystem.name", description="Human-readable label", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Human-readable label
+ * Type: string
+ * Path: NamingSystem.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: Content intends to support these contexts
+ * Type: token
+ * Path: NamingSystem.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="NamingSystem.useContext", description="Content intends to support these contexts", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: Content intends to support these contexts
+ * Type: token
+ * Path: NamingSystem.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: value + *

+ * Description: The unique identifier
+ * Type: string
+ * Path: NamingSystem.uniqueId.value
+ *

+ */ + @SearchParamDefinition(name="value", path="NamingSystem.uniqueId.value", description="The unique identifier", type="string" ) + public static final String SP_VALUE = "value"; + /** + * Fluent Client search parameter constant for value + *

+ * Description: The unique identifier
+ * Type: string
+ * Path: NamingSystem.uniqueId.value
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VALUE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VALUE); + + /** + * Search parameter: telecom + *

+ * Description: Contact details for individual or publisher
+ * Type: token
+ * Path: NamingSystem.contact.telecom
+ *

+ */ + @SearchParamDefinition(name="telecom", path="NamingSystem.contact.telecom", description="Contact details for individual or publisher", type="token" ) + public static final String SP_TELECOM = "telecom"; + /** + * Fluent Client search parameter constant for telecom + *

+ * Description: Contact details for individual or publisher
+ * Type: token
+ * Path: NamingSystem.contact.telecom
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); + + /** + * Search parameter: replaced-by + *

+ * Description: Use this instead
+ * Type: reference
+ * Path: NamingSystem.replacedBy
+ *

+ */ + @SearchParamDefinition(name="replaced-by", path="NamingSystem.replacedBy", description="Use this instead", type="reference" ) + public static final String SP_REPLACED_BY = "replaced-by"; + /** + * Fluent Client search parameter constant for replaced-by + *

+ * Description: Use this instead
+ * Type: reference
+ * Path: NamingSystem.replacedBy
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPLACED_BY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPLACED_BY); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "NamingSystem:replaced-by". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REPLACED_BY = new ca.uhn.fhir.model.api.Include("NamingSystem:replaced-by").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Narrative.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Narrative.java new file mode 100644 index 00000000000..fffd6906a30 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Narrative.java @@ -0,0 +1,363 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.INarrative; +import org.hl7.fhir.utilities.xhtml.XhtmlNode; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A human-readable formatted text, including images. + */ +@DatatypeDef(name="Narrative") +public class Narrative extends BaseNarrative implements INarrative { + + public enum NarrativeStatus { + /** + * The contents of the narrative are entirely generated from the structured data in the content. + */ + GENERATED, + /** + * The contents of the narrative are entirely generated from the structured data in the content and some of the content is generated from extensions + */ + EXTENSIONS, + /** + * The contents of the narrative contain additional information not found in the structured data + */ + ADDITIONAL, + /** + * The contents of the narrative are some equivalent of "No human-readable text provided in this case" + */ + EMPTY, + /** + * added to help the parsers + */ + NULL; + public static NarrativeStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("generated".equals(codeString)) + return GENERATED; + if ("extensions".equals(codeString)) + return EXTENSIONS; + if ("additional".equals(codeString)) + return ADDITIONAL; + if ("empty".equals(codeString)) + return EMPTY; + throw new FHIRException("Unknown NarrativeStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case GENERATED: return "generated"; + case EXTENSIONS: return "extensions"; + case ADDITIONAL: return "additional"; + case EMPTY: return "empty"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case GENERATED: return "http://hl7.org/fhir/narrative-status"; + case EXTENSIONS: return "http://hl7.org/fhir/narrative-status"; + case ADDITIONAL: return "http://hl7.org/fhir/narrative-status"; + case EMPTY: return "http://hl7.org/fhir/narrative-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case GENERATED: return "The contents of the narrative are entirely generated from the structured data in the content."; + case EXTENSIONS: return "The contents of the narrative are entirely generated from the structured data in the content and some of the content is generated from extensions"; + case ADDITIONAL: return "The contents of the narrative contain additional information not found in the structured data"; + case EMPTY: return "The contents of the narrative are some equivalent of \"No human-readable text provided in this case\""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case GENERATED: return "Generated"; + case EXTENSIONS: return "Extensions"; + case ADDITIONAL: return "Additional"; + case EMPTY: return "Empty"; + default: return "?"; + } + } + } + + 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; + if ("generated".equals(codeString)) + return NarrativeStatus.GENERATED; + if ("extensions".equals(codeString)) + return NarrativeStatus.EXTENSIONS; + if ("additional".equals(codeString)) + return NarrativeStatus.ADDITIONAL; + if ("empty".equals(codeString)) + return NarrativeStatus.EMPTY; + throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("generated".equals(codeString)) + return new Enumeration(this, NarrativeStatus.GENERATED); + if ("extensions".equals(codeString)) + return new Enumeration(this, NarrativeStatus.EXTENSIONS); + if ("additional".equals(codeString)) + return new Enumeration(this, NarrativeStatus.ADDITIONAL); + if ("empty".equals(codeString)) + return new Enumeration(this, NarrativeStatus.EMPTY); + throw new FHIRException("Unknown NarrativeStatus code '"+codeString+"'"); + } + public String toCode(NarrativeStatus code) { + if (code == NarrativeStatus.GENERATED) + return "generated"; + if (code == NarrativeStatus.EXTENSIONS) + return "extensions"; + if (code == NarrativeStatus.ADDITIONAL) + return "additional"; + if (code == NarrativeStatus.EMPTY) + return "empty"; + return "?"; + } + public String toSystem(NarrativeStatus code) { + return code.getSystem(); + } + } + + /** + * The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + */ + @Child(name = "status", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="generated | extensions | additional | empty", formalDefinition="The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data." ) + protected Enumeration status; + + /** + * The actual narrative content, a stripped down version of XHTML. + */ + @Child(name = "div", type = {}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Limited xhtml content", formalDefinition="The actual narrative content, a stripped down version of XHTML." ) + protected XhtmlNode div; + + private static final long serialVersionUID = 1463852859L; + + /** + * Constructor + */ + public Narrative() { + super(); + } + + /** + * Constructor + */ + public Narrative(Enumeration status, XhtmlNode div) { + super(); + this.status = status; + this.div = div; + } + + /** + * @return {@link #status} (The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). 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 Narrative.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new NarrativeStatusEnumFactory()); // bb + 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 narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Narrative setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + */ + public NarrativeStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + */ + public Narrative setStatus(NarrativeStatus value) { + if (this.status == null) + this.status = new Enumeration(new NarrativeStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #div} (The actual narrative content, a stripped down version of XHTML.) + */ + public XhtmlNode getDiv() { + if (this.div == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Narrative.div"); + else if (Configuration.doAutoCreate()) + this.div = new XhtmlNode(); // cc + return this.div; + } + + public boolean hasDiv() { + return this.div != null && !this.div.isEmpty(); + } + + /** + * @param value {@link #div} (The actual narrative content, a stripped down version of XHTML.) + */ + public Narrative setDiv(XhtmlNode value) { + this.div = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.", 0, java.lang.Integer.MAX_VALUE, status)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -892481550: // status + this.status = new NarrativeStatusEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("status")) + this.status = new NarrativeStatusEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Narrative.status"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Narrative"; + + } + + public Narrative copy() { + Narrative dst = new Narrative(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.div = div == null ? null : div.copy(); + return dst; + } + + protected Narrative typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Narrative)) + return false; + Narrative o = (Narrative) other; + return compareDeep(status, o.status, true) && compareDeep(div, o.div, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Narrative)) + return false; + Narrative o = (Narrative) other; + return compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (div == null || div.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/NutritionOrder.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/NutritionOrder.java new file mode 100644 index 00000000000..da384519ed1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/NutritionOrder.java @@ -0,0 +1,3390 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + */ +@ResourceDef(name="NutritionOrder", profile="http://hl7.org/fhir/Profile/NutritionOrder") +public class NutritionOrder extends DomainResource { + + public enum NutritionOrderStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request is in preliminary form prior to being sent. + */ + DRAFT, + /** + * The request has been planned. + */ + PLANNED, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The request is 'actionable', but not all actions that are implied by it have occurred yet. + */ + ACTIVE, + /** + * Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit). + */ + COMPLETED, + /** + * The request has been withdrawn and is no longer actionable. + */ + CANCELLED, + /** + * The request was entered in error and voided. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static NutritionOrderStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("draft".equals(codeString)) + return DRAFT; + if ("planned".equals(codeString)) + return PLANNED; + if ("requested".equals(codeString)) + return REQUESTED; + if ("active".equals(codeString)) + return ACTIVE; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown NutritionOrderStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case DRAFT: return "draft"; + case PLANNED: return "planned"; + case REQUESTED: return "requested"; + case ACTIVE: return "active"; + case ONHOLD: return "on-hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return "http://hl7.org/fhir/nutrition-order-status"; + case DRAFT: return "http://hl7.org/fhir/nutrition-order-status"; + case PLANNED: return "http://hl7.org/fhir/nutrition-order-status"; + case REQUESTED: return "http://hl7.org/fhir/nutrition-order-status"; + case ACTIVE: return "http://hl7.org/fhir/nutrition-order-status"; + case ONHOLD: return "http://hl7.org/fhir/nutrition-order-status"; + case COMPLETED: return "http://hl7.org/fhir/nutrition-order-status"; + case CANCELLED: return "http://hl7.org/fhir/nutrition-order-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/nutrition-order-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case DRAFT: return "The request is in preliminary form prior to being sent."; + case PLANNED: return "The request has been planned."; + case REQUESTED: return "The request has been placed."; + case ACTIVE: return "The request is 'actionable', but not all actions that are implied by it have occurred yet."; + case ONHOLD: return "Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called \"suspended\"."; + case COMPLETED: return "All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit)."; + case CANCELLED: return "The request has been withdrawn and is no longer actionable."; + case ENTEREDINERROR: return "The request was entered in error and voided."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case DRAFT: return "Draft"; + case PLANNED: return "Planned"; + case REQUESTED: return "Requested"; + case ACTIVE: return "Active"; + case ONHOLD: return "On-Hold"; + case COMPLETED: return "Completed"; + case CANCELLED: return "Cancelled"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + 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; + if ("proposed".equals(codeString)) + return NutritionOrderStatus.PROPOSED; + if ("draft".equals(codeString)) + return NutritionOrderStatus.DRAFT; + if ("planned".equals(codeString)) + return NutritionOrderStatus.PLANNED; + if ("requested".equals(codeString)) + return NutritionOrderStatus.REQUESTED; + if ("active".equals(codeString)) + return NutritionOrderStatus.ACTIVE; + if ("on-hold".equals(codeString)) + return NutritionOrderStatus.ONHOLD; + if ("completed".equals(codeString)) + return NutritionOrderStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return NutritionOrderStatus.CANCELLED; + if ("entered-in-error".equals(codeString)) + return NutritionOrderStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.PROPOSED); + if ("draft".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.DRAFT); + if ("planned".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.PLANNED); + if ("requested".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.REQUESTED); + if ("active".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.ACTIVE); + if ("on-hold".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.ONHOLD); + if ("completed".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.COMPLETED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.CANCELLED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, NutritionOrderStatus.ENTEREDINERROR); + throw new FHIRException("Unknown NutritionOrderStatus code '"+codeString+"'"); + } + public String toCode(NutritionOrderStatus code) { + if (code == NutritionOrderStatus.PROPOSED) + return "proposed"; + if (code == NutritionOrderStatus.DRAFT) + return "draft"; + if (code == NutritionOrderStatus.PLANNED) + return "planned"; + if (code == NutritionOrderStatus.REQUESTED) + return "requested"; + if (code == NutritionOrderStatus.ACTIVE) + return "active"; + if (code == NutritionOrderStatus.ONHOLD) + return "on-hold"; + if (code == NutritionOrderStatus.COMPLETED) + return "completed"; + if (code == NutritionOrderStatus.CANCELLED) + return "cancelled"; + if (code == NutritionOrderStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(NutritionOrderStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class NutritionOrderOralDietComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Type of oral diet or diet restrictions that describe what can be consumed orally", formalDefinition="The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet." ) + protected List type; + + /** + * The time period and frequency at which the diet should be given. + */ + @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Scheduled frequency of diet", formalDefinition="The time period and frequency at which the diet should be given." ) + protected List schedule; + + /** + * Class that defines the quantity and type of nutrient modifications required for the oral diet. + */ + @Child(name = "nutrient", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Required nutrient modifications", formalDefinition="Class that defines the quantity and type of nutrient modifications required for the oral diet." ) + protected List nutrient; + + /** + * Class that describes any texture modifications required for the patient to safely consume various types of solid foods. + */ + @Child(name = "texture", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Required texture modifications", formalDefinition="Class that describes any texture modifications required for the patient to safely consume various types of solid foods." ) + protected List texture; + + /** + * The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. + */ + @Child(name = "fluidConsistencyType", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The required consistency of fluids and liquids provided to the patient", formalDefinition="The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient." ) + protected List fluidConsistencyType; + + /** + * Free text or additional instructions or information pertaining to the oral diet. + */ + @Child(name = "instruction", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Instructions or additional information about the oral diet", formalDefinition="Free text or additional instructions or information pertaining to the oral diet." ) + protected StringType instruction; + + private static final long serialVersionUID = 973058412L; + + /** + * Constructor + */ + public NutritionOrderOralDietComponent() { + super(); + } + + /** + * @return {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + 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 {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #schedule} (The time period and frequency at which the diet should be given.) + */ + public List getSchedule() { + if (this.schedule == null) + this.schedule = new ArrayList(); + return this.schedule; + } + + public boolean hasSchedule() { + if (this.schedule == null) + return false; + for (Timing item : this.schedule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #schedule} (The time period and frequency at which the diet should be given.) + */ + // syntactic sugar + public Timing addSchedule() { //3 + Timing t = new Timing(); + if (this.schedule == null) + this.schedule = new ArrayList(); + this.schedule.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addSchedule(Timing t) { //3 + if (t == null) + return this; + if (this.schedule == null) + this.schedule = new ArrayList(); + this.schedule.add(t); + return this; + } + + /** + * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications required for the oral diet.) + */ + public List getNutrient() { + if (this.nutrient == null) + this.nutrient = new ArrayList(); + return this.nutrient; + } + + public boolean hasNutrient() { + if (this.nutrient == null) + return false; + for (NutritionOrderOralDietNutrientComponent item : this.nutrient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications required for the oral diet.) + */ + // syntactic sugar + public NutritionOrderOralDietNutrientComponent addNutrient() { //3 + NutritionOrderOralDietNutrientComponent t = new NutritionOrderOralDietNutrientComponent(); + if (this.nutrient == null) + this.nutrient = new ArrayList(); + this.nutrient.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addNutrient(NutritionOrderOralDietNutrientComponent t) { //3 + if (t == null) + return this; + if (this.nutrient == null) + this.nutrient = new ArrayList(); + this.nutrient.add(t); + return this; + } + + /** + * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) + */ + public List getTexture() { + if (this.texture == null) + this.texture = new ArrayList(); + return this.texture; + } + + public boolean hasTexture() { + if (this.texture == null) + return false; + for (NutritionOrderOralDietTextureComponent item : this.texture) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) + */ + // syntactic sugar + public NutritionOrderOralDietTextureComponent addTexture() { //3 + NutritionOrderOralDietTextureComponent t = new NutritionOrderOralDietTextureComponent(); + if (this.texture == null) + this.texture = new ArrayList(); + this.texture.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addTexture(NutritionOrderOralDietTextureComponent t) { //3 + if (t == null) + return this; + if (this.texture == null) + this.texture = new ArrayList(); + this.texture.add(t); + return this; + } + + /** + * @return {@link #fluidConsistencyType} (The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) + */ + public List getFluidConsistencyType() { + if (this.fluidConsistencyType == null) + this.fluidConsistencyType = new ArrayList(); + return this.fluidConsistencyType; + } + + public boolean hasFluidConsistencyType() { + if (this.fluidConsistencyType == null) + return false; + for (CodeableConcept item : this.fluidConsistencyType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #fluidConsistencyType} (The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) + */ + // syntactic sugar + public CodeableConcept addFluidConsistencyType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.fluidConsistencyType == null) + this.fluidConsistencyType = new ArrayList(); + this.fluidConsistencyType.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderOralDietComponent addFluidConsistencyType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.fluidConsistencyType == null) + this.fluidConsistencyType = new ArrayList(); + this.fluidConsistencyType.add(t); + return this; + } + + /** + * @return {@link #instruction} (Free text or 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 getInstructionElement() { + if (this.instruction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietComponent.instruction"); + else if (Configuration.doAutoCreate()) + this.instruction = new StringType(); // bb + return this.instruction; + } + + public boolean hasInstructionElement() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + public boolean hasInstruction() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + /** + * @param value {@link #instruction} (Free text or 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 NutritionOrderOralDietComponent setInstructionElement(StringType value) { + this.instruction = value; + return this; + } + + /** + * @return Free text or additional instructions or information pertaining to the oral diet. + */ + public String getInstruction() { + return this.instruction == null ? null : this.instruction.getValue(); + } + + /** + * @param value Free text or additional instructions or information pertaining to the oral diet. + */ + public NutritionOrderOralDietComponent setInstruction(String value) { + if (Utilities.noString(value)) + this.instruction = null; + else { + 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("type", "CodeableConcept", "The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the diet should be given.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("nutrient", "", "Class that defines the quantity and type of nutrient modifications required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrient)); + 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", "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("instruction", "string", "Free text or additional instructions or information pertaining to the oral diet.", 0, java.lang.Integer.MAX_VALUE, instruction)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept + case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : this.schedule.toArray(new Base[this.schedule.size()]); // Timing + case -1671151641: /*nutrient*/ return this.nutrient == null ? new Base[0] : this.nutrient.toArray(new Base[this.nutrient.size()]); // NutritionOrderOralDietNutrientComponent + case -1417816805: /*texture*/ return this.texture == null ? new Base[0] : this.texture.toArray(new Base[this.texture.size()]); // NutritionOrderOralDietTextureComponent + case -525105592: /*fluidConsistencyType*/ return this.fluidConsistencyType == null ? new Base[0] : this.fluidConsistencyType.toArray(new Base[this.fluidConsistencyType.size()]); // CodeableConcept + case 301526158: /*instruction*/ return this.instruction == null ? new Base[0] : new Base[] {this.instruction}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.getType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -697920873: // schedule + this.getSchedule().add(castToTiming(value)); // Timing + break; + case -1671151641: // nutrient + this.getNutrient().add((NutritionOrderOralDietNutrientComponent) value); // NutritionOrderOralDietNutrientComponent + break; + case -1417816805: // texture + this.getTexture().add((NutritionOrderOralDietTextureComponent) value); // NutritionOrderOralDietTextureComponent + break; + case -525105592: // fluidConsistencyType + this.getFluidConsistencyType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 301526158: // instruction + this.instruction = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.getType().add(castToCodeableConcept(value)); + else if (name.equals("schedule")) + this.getSchedule().add(castToTiming(value)); + else if (name.equals("nutrient")) + this.getNutrient().add((NutritionOrderOralDietNutrientComponent) value); + else if (name.equals("texture")) + this.getTexture().add((NutritionOrderOralDietTextureComponent) value); + else if (name.equals("fluidConsistencyType")) + this.getFluidConsistencyType().add(castToCodeableConcept(value)); + else if (name.equals("instruction")) + this.instruction = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return addType(); // CodeableConcept + case -697920873: return addSchedule(); // Timing + case -1671151641: return addNutrient(); // NutritionOrderOralDietNutrientComponent + case -1417816805: return addTexture(); // NutritionOrderOralDietTextureComponent + case -525105592: return addFluidConsistencyType(); // CodeableConcept + case 301526158: throw new FHIRException("Cannot make property instruction as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + return addType(); + } + else if (name.equals("schedule")) { + return addSchedule(); + } + else if (name.equals("nutrient")) { + return addNutrient(); + } + else if (name.equals("texture")) { + return addTexture(); + } + else if (name.equals("fluidConsistencyType")) { + return addFluidConsistencyType(); + } + else if (name.equals("instruction")) { + throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.instruction"); + } + else + return super.addChild(name); + } + + public NutritionOrderOralDietComponent copy() { + NutritionOrderOralDietComponent dst = new NutritionOrderOralDietComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + if (schedule != null) { + dst.schedule = new ArrayList(); + for (Timing i : schedule) + dst.schedule.add(i.copy()); + }; + if (nutrient != null) { + dst.nutrient = new ArrayList(); + for (NutritionOrderOralDietNutrientComponent i : nutrient) + dst.nutrient.add(i.copy()); + }; + if (texture != null) { + dst.texture = new ArrayList(); + for (NutritionOrderOralDietTextureComponent i : texture) + dst.texture.add(i.copy()); + }; + if (fluidConsistencyType != null) { + dst.fluidConsistencyType = new ArrayList(); + for (CodeableConcept i : fluidConsistencyType) + dst.fluidConsistencyType.add(i.copy()); + }; + dst.instruction = instruction == null ? null : instruction.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderOralDietComponent)) + return false; + NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other; + return compareDeep(type, o.type, true) && compareDeep(schedule, o.schedule, true) && compareDeep(nutrient, o.nutrient, true) + && compareDeep(texture, o.texture, true) && compareDeep(fluidConsistencyType, o.fluidConsistencyType, true) + && compareDeep(instruction, o.instruction, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderOralDietComponent)) + return false; + NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other; + return compareValues(instruction, o.instruction, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (schedule == null || schedule.isEmpty()) + && (nutrient == null || nutrient.isEmpty()) && (texture == null || texture.isEmpty()) && (fluidConsistencyType == null || fluidConsistencyType.isEmpty()) + && (instruction == null || instruction.isEmpty()); + } + + public String fhirType() { + return "NutritionOrder.oralDiet"; + + } + + } + + @Block() + public static class NutritionOrderOralDietNutrientComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The nutrient that is being modified such as carbohydrate or sodium. + */ + @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Type of nutrient that is being modified", formalDefinition="The nutrient that is being modified such as carbohydrate or sodium." ) + protected CodeableConcept modifier; + + /** + * The quantity of the specified nutrient to include in diet. + */ + @Child(name = "amount", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Quantity of the specified nutrient", formalDefinition="The quantity of the specified nutrient to include in diet." ) + protected SimpleQuantity amount; + + private static final long serialVersionUID = 465107295L; + + /** + * Constructor + */ + public NutritionOrderOralDietNutrientComponent() { + super(); + } + + /** + * @return {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.) + */ + public CodeableConcept getModifier() { + if (this.modifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.modifier"); + else if (Configuration.doAutoCreate()) + this.modifier = new CodeableConcept(); // cc + return this.modifier; + } + + public boolean hasModifier() { + return this.modifier != null && !this.modifier.isEmpty(); + } + + /** + * @param value {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.) + */ + public NutritionOrderOralDietNutrientComponent setModifier(CodeableConcept value) { + this.modifier = value; + return this; + } + + /** + * @return {@link #amount} (The quantity of the specified nutrient to include in diet.) + */ + public SimpleQuantity getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new SimpleQuantity(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (The quantity of the specified nutrient to include in diet.) + */ + public NutritionOrderOralDietNutrientComponent setAmount(SimpleQuantity value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("modifier", "CodeableConcept", "The nutrient that is being modified such as carbohydrate or sodium.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("amount", "SimpleQuantity", "The quantity of the specified nutrient to include in diet.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : new Base[] {this.modifier}; // CodeableConcept + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SimpleQuantity + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -615513385: // modifier + this.modifier = castToCodeableConcept(value); // CodeableConcept + break; + case -1413853096: // amount + this.amount = castToSimpleQuantity(value); // SimpleQuantity + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("modifier")) + this.modifier = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("amount")) + this.amount = castToSimpleQuantity(value); // SimpleQuantity + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -615513385: return getModifier(); // CodeableConcept + case -1413853096: return getAmount(); // SimpleQuantity + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("modifier")) { + this.modifier = new CodeableConcept(); + return this.modifier; + } + else if (name.equals("amount")) { + this.amount = new SimpleQuantity(); + return this.amount; + } + else + return super.addChild(name); + } + + public NutritionOrderOralDietNutrientComponent copy() { + NutritionOrderOralDietNutrientComponent dst = new NutritionOrderOralDietNutrientComponent(); + copyValues(dst); + dst.modifier = modifier == null ? null : modifier.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderOralDietNutrientComponent)) + return false; + NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other; + return compareDeep(modifier, o.modifier, true) && compareDeep(amount, o.amount, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderOralDietNutrientComponent)) + return false; + NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + public String fhirType() { + return "NutritionOrder.oralDiet.nutrient"; + + } + + } + + @Block() + public static class NutritionOrderOralDietTextureComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed. + */ + @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code to indicate how to alter the texture of the foods, e.g. pureed", formalDefinition="Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed." ) + protected CodeableConcept modifier; + + /** + * The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types. + */ + @Child(name = "foodType", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Concepts that are used to identify an entity that is ingested for nutritional purposes", formalDefinition="The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types." ) + protected CodeableConcept foodType; + + private static final long serialVersionUID = -56402817L; + + /** + * Constructor + */ + public NutritionOrderOralDietTextureComponent() { + super(); + } + + /** + * @return {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.) + */ + public CodeableConcept getModifier() { + if (this.modifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.modifier"); + else if (Configuration.doAutoCreate()) + this.modifier = new CodeableConcept(); // cc + return this.modifier; + } + + public boolean hasModifier() { + return this.modifier != null && !this.modifier.isEmpty(); + } + + /** + * @param value {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.) + */ + public NutritionOrderOralDietTextureComponent setModifier(CodeableConcept value) { + this.modifier = value; + return this; + } + + /** + * @return {@link #foodType} (The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types.) + */ + public CodeableConcept getFoodType() { + if (this.foodType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.foodType"); + else if (Configuration.doAutoCreate()) + this.foodType = new CodeableConcept(); // cc + return this.foodType; + } + + public boolean hasFoodType() { + return this.foodType != null && !this.foodType.isEmpty(); + } + + /** + * @param value {@link #foodType} (The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types.) + */ + public NutritionOrderOralDietTextureComponent setFoodType(CodeableConcept value) { + this.foodType = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("modifier", "CodeableConcept", "Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("foodType", "CodeableConcept", "The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types.", 0, java.lang.Integer.MAX_VALUE, foodType)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : new Base[] {this.modifier}; // CodeableConcept + case 379498680: /*foodType*/ return this.foodType == null ? new Base[0] : new Base[] {this.foodType}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -615513385: // modifier + this.modifier = castToCodeableConcept(value); // CodeableConcept + break; + case 379498680: // foodType + this.foodType = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("modifier")) + this.modifier = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("foodType")) + this.foodType = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -615513385: return getModifier(); // CodeableConcept + case 379498680: return getFoodType(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("modifier")) { + this.modifier = new CodeableConcept(); + return this.modifier; + } + else if (name.equals("foodType")) { + this.foodType = new CodeableConcept(); + return this.foodType; + } + else + return super.addChild(name); + } + + public NutritionOrderOralDietTextureComponent copy() { + NutritionOrderOralDietTextureComponent dst = new NutritionOrderOralDietTextureComponent(); + copyValues(dst); + dst.modifier = modifier == null ? null : modifier.copy(); + dst.foodType = foodType == null ? null : foodType.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderOralDietTextureComponent)) + return false; + NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other; + return compareDeep(modifier, o.modifier, true) && compareDeep(foodType, o.foodType, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderOralDietTextureComponent)) + return false; + NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (foodType == null || foodType.isEmpty()) + ; + } + + public String fhirType() { + return "NutritionOrder.oralDiet.texture"; + + } + + } + + @Block() + public static class NutritionOrderSupplementComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of supplement product requested", formalDefinition="The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement." ) + protected CodeableConcept type; + + /** + * The product or brand name of the nutritional supplement such as "Acme Protein Shake". + */ + @Child(name = "productName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Product or brand name of the nutritional supplement", formalDefinition="The product or brand name of the nutritional supplement such as \"Acme Protein Shake\"." ) + protected StringType productName; + + /** + * The time period and frequency at which the supplement(s) should be given. + */ + @Child(name = "schedule", type = {Timing.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Scheduled frequency of supplement", formalDefinition="The time period and frequency at which the supplement(s) should be given." ) + protected List schedule; + + /** + * The amount of the nutritional supplement to be given. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Amount of the nutritional supplement", formalDefinition="The amount of the nutritional supplement to be given." ) + protected SimpleQuantity quantity; + + /** + * Free text or additional instructions or information pertaining to the oral supplement. + */ + @Child(name = "instruction", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Instructions or additional information about the oral supplement", formalDefinition="Free text or additional instructions or information pertaining to the oral supplement." ) + protected StringType instruction; + + private static final long serialVersionUID = 297545236L; + + /** + * Constructor + */ + public NutritionOrderSupplementComponent() { + super(); + } + + /** + * @return {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.) + */ + public NutritionOrderSupplementComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value + */ + public StringType getProductNameElement() { + if (this.productName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.productName"); + else if (Configuration.doAutoCreate()) + this.productName = new StringType(); // bb + return this.productName; + } + + public boolean hasProductNameElement() { + return this.productName != null && !this.productName.isEmpty(); + } + + public boolean hasProductName() { + return this.productName != null && !this.productName.isEmpty(); + } + + /** + * @param value {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value + */ + public NutritionOrderSupplementComponent setProductNameElement(StringType value) { + this.productName = value; + return this; + } + + /** + * @return The product or brand name of the nutritional supplement such as "Acme Protein Shake". + */ + public String getProductName() { + return this.productName == null ? null : this.productName.getValue(); + } + + /** + * @param value The product or brand name of the nutritional supplement such as "Acme Protein Shake". + */ + public NutritionOrderSupplementComponent setProductName(String value) { + if (Utilities.noString(value)) + this.productName = null; + else { + if (this.productName == null) + this.productName = new StringType(); + this.productName.setValue(value); + } + return this; + } + + /** + * @return {@link #schedule} (The time period and frequency at which the supplement(s) should be given.) + */ + public List getSchedule() { + if (this.schedule == null) + this.schedule = new ArrayList(); + return this.schedule; + } + + public boolean hasSchedule() { + if (this.schedule == null) + return false; + for (Timing item : this.schedule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #schedule} (The time period and frequency at which the supplement(s) should be given.) + */ + // syntactic sugar + public Timing addSchedule() { //3 + Timing t = new Timing(); + if (this.schedule == null) + this.schedule = new ArrayList(); + this.schedule.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderSupplementComponent addSchedule(Timing t) { //3 + if (t == null) + return this; + if (this.schedule == null) + this.schedule = new ArrayList(); + this.schedule.add(t); + return this; + } + + /** + * @return {@link #quantity} (The amount of the nutritional supplement to be given.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the nutritional supplement to be given.) + */ + public NutritionOrderSupplementComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value + */ + public StringType getInstructionElement() { + if (this.instruction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.instruction"); + else if (Configuration.doAutoCreate()) + this.instruction = new StringType(); // bb + return this.instruction; + } + + public boolean hasInstructionElement() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + public boolean hasInstruction() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + /** + * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value + */ + public NutritionOrderSupplementComponent setInstructionElement(StringType value) { + this.instruction = value; + return this; + } + + /** + * @return Free text or additional instructions or information pertaining to the oral supplement. + */ + public String getInstruction() { + return this.instruction == null ? null : this.instruction.getValue(); + } + + /** + * @param value Free text or additional instructions or information pertaining to the oral supplement. + */ + public NutritionOrderSupplementComponent setInstruction(String value) { + if (Utilities.noString(value)) + this.instruction = null; + else { + 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("type", "CodeableConcept", "The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("productName", "string", "The product or brand name of the nutritional supplement such as \"Acme Protein Shake\".", 0, java.lang.Integer.MAX_VALUE, productName)); + childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the supplement(s) should be given.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of the nutritional supplement to be given.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral supplement.", 0, java.lang.Integer.MAX_VALUE, instruction)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1491817446: /*productName*/ return this.productName == null ? new Base[0] : new Base[] {this.productName}; // StringType + case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : this.schedule.toArray(new Base[this.schedule.size()]); // Timing + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case 301526158: /*instruction*/ return this.instruction == null ? new Base[0] : new Base[] {this.instruction}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1491817446: // productName + this.productName = castToString(value); // StringType + break; + case -697920873: // schedule + this.getSchedule().add(castToTiming(value)); // Timing + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case 301526158: // instruction + this.instruction = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("productName")) + this.productName = castToString(value); // StringType + else if (name.equals("schedule")) + this.getSchedule().add(castToTiming(value)); + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("instruction")) + this.instruction = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // CodeableConcept + case -1491817446: throw new FHIRException("Cannot make property productName as it is not a complex type"); // StringType + case -697920873: return addSchedule(); // Timing + case -1285004149: return getQuantity(); // SimpleQuantity + case 301526158: throw new FHIRException("Cannot make property instruction as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("productName")) { + throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.productName"); + } + else if (name.equals("schedule")) { + return addSchedule(); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("instruction")) { + throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.instruction"); + } + else + return super.addChild(name); + } + + public NutritionOrderSupplementComponent copy() { + NutritionOrderSupplementComponent dst = new NutritionOrderSupplementComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.productName = productName == null ? null : productName.copy(); + if (schedule != null) { + dst.schedule = new ArrayList(); + for (Timing i : schedule) + dst.schedule.add(i.copy()); + }; + dst.quantity = quantity == null ? null : quantity.copy(); + dst.instruction = instruction == null ? null : instruction.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderSupplementComponent)) + return false; + NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other; + return compareDeep(type, o.type, true) && compareDeep(productName, o.productName, true) && compareDeep(schedule, o.schedule, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(instruction, o.instruction, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderSupplementComponent)) + return false; + NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other; + return compareValues(productName, o.productName, true) && compareValues(instruction, o.instruction, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (productName == null || productName.isEmpty()) + && (schedule == null || schedule.isEmpty()) && (quantity == null || quantity.isEmpty()) && (instruction == null || instruction.isEmpty()) + ; + } + + public String fhirType() { + return "NutritionOrder.supplement"; + + } + + } + + @Block() + public static class NutritionOrderEnteralFormulaComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula. + */ + @Child(name = "baseFormulaType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula." ) + protected CodeableConcept baseFormulaType; + + /** + * The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". + */ + @Child(name = "baseFormulaProductName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @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 such as \"ACME Adult Standard Formula\"." ) + protected StringType baseFormulaProductName; + + /** + * 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=3, min=0, max=1, modifier=false, summary=false) + @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 = "additiveProductName", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @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 additiveProductName; + + /** + * 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 that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL. + */ + @Child(name = "caloricDensity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=false) + @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 that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL." ) + protected SimpleQuantity caloricDensity; + + /** + * The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube. + */ + @Child(name = "routeofAdministration", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="How the formula should enter the patient's gastrointestinal tract", formalDefinition="The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube." ) + protected CodeableConcept routeofAdministration; + + /** + * Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. + */ + @Child(name = "administration", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Formula feeding instruction as structured data", formalDefinition="Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours." ) + protected List administration; + + /** + * 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 = {SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=false) + @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 SimpleQuantity maxVolumeToDeliver; + + /** + * Free text formula administration, feeding instructions or additional instructions or information. + */ + @Child(name = "administrationInstruction", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Formula feeding instructions expressed as text", formalDefinition="Free text formula administration, feeding instructions or additional instructions or information." ) + protected StringType administrationInstruction; + + private static final long serialVersionUID = 292116061L; + + /** + * Constructor + */ + public NutritionOrderEnteralFormulaComponent() { + super(); + } + + /** + * @return {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.) + */ + public CodeableConcept getBaseFormulaType() { + if (this.baseFormulaType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaType"); + else if (Configuration.doAutoCreate()) + this.baseFormulaType = new CodeableConcept(); // cc + return this.baseFormulaType; + } + + public boolean hasBaseFormulaType() { + return this.baseFormulaType != null && !this.baseFormulaType.isEmpty(); + } + + /** + * @param value {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.) + */ + public NutritionOrderEnteralFormulaComponent setBaseFormulaType(CodeableConcept value) { + this.baseFormulaType = value; + return this; + } + + /** + * @return {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value + */ + public StringType getBaseFormulaProductNameElement() { + if (this.baseFormulaProductName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaProductName"); + else if (Configuration.doAutoCreate()) + this.baseFormulaProductName = new StringType(); // bb + return this.baseFormulaProductName; + } + + public boolean hasBaseFormulaProductNameElement() { + return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty(); + } + + public boolean hasBaseFormulaProductName() { + return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty(); + } + + /** + * @param value {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value + */ + public NutritionOrderEnteralFormulaComponent setBaseFormulaProductNameElement(StringType value) { + this.baseFormulaProductName = value; + return this; + } + + /** + * @return The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". + */ + public String getBaseFormulaProductName() { + return this.baseFormulaProductName == null ? null : this.baseFormulaProductName.getValue(); + } + + /** + * @param value The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". + */ + public NutritionOrderEnteralFormulaComponent setBaseFormulaProductName(String value) { + if (Utilities.noString(value)) + this.baseFormulaProductName = null; + else { + if (this.baseFormulaProductName == null) + this.baseFormulaProductName = new StringType(); + this.baseFormulaProductName.setValue(value); + } + 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 NutritionOrderEnteralFormulaComponent.additiveType"); + else if (Configuration.doAutoCreate()) + this.additiveType = new CodeableConcept(); // cc + 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 NutritionOrderEnteralFormulaComponent setAdditiveType(CodeableConcept value) { + this.additiveType = value; + return this; + } + + /** + * @return {@link #additiveProductName} (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 "getAdditiveProductName" gives direct access to the value + */ + public StringType getAdditiveProductNameElement() { + if (this.additiveProductName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveProductName"); + else if (Configuration.doAutoCreate()) + this.additiveProductName = new StringType(); // bb + return this.additiveProductName; + } + + public boolean hasAdditiveProductNameElement() { + return this.additiveProductName != null && !this.additiveProductName.isEmpty(); + } + + public boolean hasAdditiveProductName() { + return this.additiveProductName != null && !this.additiveProductName.isEmpty(); + } + + /** + * @param value {@link #additiveProductName} (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 "getAdditiveProductName" gives direct access to the value + */ + public NutritionOrderEnteralFormulaComponent setAdditiveProductNameElement(StringType value) { + this.additiveProductName = value; + return this; + } + + /** + * @return The product or brand name of the type of modular component to be added to the formula. + */ + public String getAdditiveProductName() { + return this.additiveProductName == null ? null : this.additiveProductName.getValue(); + } + + /** + * @param value The product or brand name of the type of modular component to be added to the formula. + */ + public NutritionOrderEnteralFormulaComponent setAdditiveProductName(String value) { + if (Utilities.noString(value)) + this.additiveProductName = null; + else { + if (this.additiveProductName == null) + this.additiveProductName = new StringType(); + this.additiveProductName.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 that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) + */ + public SimpleQuantity getCaloricDensity() { + if (this.caloricDensity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.caloricDensity"); + else if (Configuration.doAutoCreate()) + this.caloricDensity = new SimpleQuantity(); // cc + 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 that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) + */ + public NutritionOrderEnteralFormulaComponent setCaloricDensity(SimpleQuantity value) { + this.caloricDensity = value; + return this; + } + + /** + * @return {@link #routeofAdministration} (The route or physiological path of administration into the patient's gastrointestinal 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 NutritionOrderEnteralFormulaComponent.routeofAdministration"); + else if (Configuration.doAutoCreate()) + this.routeofAdministration = new CodeableConcept(); // cc + return this.routeofAdministration; + } + + public boolean hasRouteofAdministration() { + return this.routeofAdministration != null && !this.routeofAdministration.isEmpty(); + } + + /** + * @param value {@link #routeofAdministration} (The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube.) + */ + public NutritionOrderEnteralFormulaComponent setRouteofAdministration(CodeableConcept value) { + this.routeofAdministration = value; + return this; + } + + /** + * @return {@link #administration} (Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.) + */ + public List getAdministration() { + if (this.administration == null) + this.administration = new ArrayList(); + return this.administration; + } + + public boolean hasAdministration() { + if (this.administration == null) + return false; + for (NutritionOrderEnteralFormulaAdministrationComponent item : this.administration) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #administration} (Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.) + */ + // syntactic sugar + public NutritionOrderEnteralFormulaAdministrationComponent addAdministration() { //3 + NutritionOrderEnteralFormulaAdministrationComponent t = new NutritionOrderEnteralFormulaAdministrationComponent(); + if (this.administration == null) + this.administration = new ArrayList(); + this.administration.add(t); + return t; + } + + // syntactic sugar + public NutritionOrderEnteralFormulaComponent addAdministration(NutritionOrderEnteralFormulaAdministrationComponent t) { //3 + if (t == null) + return this; + if (this.administration == null) + this.administration = new ArrayList(); + this.administration.add(t); + 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 SimpleQuantity getMaxVolumeToDeliver() { + if (this.maxVolumeToDeliver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.maxVolumeToDeliver"); + else if (Configuration.doAutoCreate()) + this.maxVolumeToDeliver = new SimpleQuantity(); // cc + 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 NutritionOrderEnteralFormulaComponent setMaxVolumeToDeliver(SimpleQuantity value) { + this.maxVolumeToDeliver = value; + return this; + } + + /** + * @return {@link #administrationInstruction} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstruction" gives direct access to the value + */ + public StringType getAdministrationInstructionElement() { + if (this.administrationInstruction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.administrationInstruction"); + else if (Configuration.doAutoCreate()) + this.administrationInstruction = new StringType(); // bb + return this.administrationInstruction; + } + + public boolean hasAdministrationInstructionElement() { + return this.administrationInstruction != null && !this.administrationInstruction.isEmpty(); + } + + public boolean hasAdministrationInstruction() { + return this.administrationInstruction != null && !this.administrationInstruction.isEmpty(); + } + + /** + * @param value {@link #administrationInstruction} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstruction" gives direct access to the value + */ + public NutritionOrderEnteralFormulaComponent setAdministrationInstructionElement(StringType value) { + this.administrationInstruction = value; + return this; + } + + /** + * @return Free text formula administration, feeding instructions or additional instructions or information. + */ + public String getAdministrationInstruction() { + return this.administrationInstruction == null ? null : this.administrationInstruction.getValue(); + } + + /** + * @param value Free text formula administration, feeding instructions or additional instructions or information. + */ + public NutritionOrderEnteralFormulaComponent setAdministrationInstruction(String value) { + if (Utilities.noString(value)) + this.administrationInstruction = null; + else { + if (this.administrationInstruction == null) + this.administrationInstruction = new StringType(); + this.administrationInstruction.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("baseFormulaType", "CodeableConcept", "The type of enteral or infant formula 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("baseFormulaProductName", "string", "The product or brand name of the enteral or infant formula product such as \"ACME Adult Standard Formula\".", 0, java.lang.Integer.MAX_VALUE, baseFormulaProductName)); + 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("additiveProductName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, java.lang.Integer.MAX_VALUE, additiveProductName)); + childrenList.add(new Property("caloricDensity", "SimpleQuantity", "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 that 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", "The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube.", 0, java.lang.Integer.MAX_VALUE, routeofAdministration)); + childrenList.add(new Property("administration", "", "Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.", 0, java.lang.Integer.MAX_VALUE, administration)); + childrenList.add(new Property("maxVolumeToDeliver", "SimpleQuantity", "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)); + childrenList.add(new Property("administrationInstruction", "string", "Free text formula administration, feeding instructions or additional instructions or information.", 0, java.lang.Integer.MAX_VALUE, administrationInstruction)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -138930641: /*baseFormulaType*/ return this.baseFormulaType == null ? new Base[0] : new Base[] {this.baseFormulaType}; // CodeableConcept + case -1267705979: /*baseFormulaProductName*/ return this.baseFormulaProductName == null ? new Base[0] : new Base[] {this.baseFormulaProductName}; // StringType + case -470746842: /*additiveType*/ return this.additiveType == null ? new Base[0] : new Base[] {this.additiveType}; // CodeableConcept + case 488079534: /*additiveProductName*/ return this.additiveProductName == null ? new Base[0] : new Base[] {this.additiveProductName}; // StringType + case 186983261: /*caloricDensity*/ return this.caloricDensity == null ? new Base[0] : new Base[] {this.caloricDensity}; // SimpleQuantity + case -1710107042: /*routeofAdministration*/ return this.routeofAdministration == null ? new Base[0] : new Base[] {this.routeofAdministration}; // CodeableConcept + case 1255702622: /*administration*/ return this.administration == null ? new Base[0] : this.administration.toArray(new Base[this.administration.size()]); // NutritionOrderEnteralFormulaAdministrationComponent + case 2017924652: /*maxVolumeToDeliver*/ return this.maxVolumeToDeliver == null ? new Base[0] : new Base[] {this.maxVolumeToDeliver}; // SimpleQuantity + case 427085136: /*administrationInstruction*/ return this.administrationInstruction == null ? new Base[0] : new Base[] {this.administrationInstruction}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -138930641: // baseFormulaType + this.baseFormulaType = castToCodeableConcept(value); // CodeableConcept + break; + case -1267705979: // baseFormulaProductName + this.baseFormulaProductName = castToString(value); // StringType + break; + case -470746842: // additiveType + this.additiveType = castToCodeableConcept(value); // CodeableConcept + break; + case 488079534: // additiveProductName + this.additiveProductName = castToString(value); // StringType + break; + case 186983261: // caloricDensity + this.caloricDensity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -1710107042: // routeofAdministration + this.routeofAdministration = castToCodeableConcept(value); // CodeableConcept + break; + case 1255702622: // administration + this.getAdministration().add((NutritionOrderEnteralFormulaAdministrationComponent) value); // NutritionOrderEnteralFormulaAdministrationComponent + break; + case 2017924652: // maxVolumeToDeliver + this.maxVolumeToDeliver = castToSimpleQuantity(value); // SimpleQuantity + break; + case 427085136: // administrationInstruction + this.administrationInstruction = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("baseFormulaType")) + this.baseFormulaType = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("baseFormulaProductName")) + this.baseFormulaProductName = castToString(value); // StringType + else if (name.equals("additiveType")) + this.additiveType = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("additiveProductName")) + this.additiveProductName = castToString(value); // StringType + else if (name.equals("caloricDensity")) + this.caloricDensity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("routeofAdministration")) + this.routeofAdministration = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("administration")) + this.getAdministration().add((NutritionOrderEnteralFormulaAdministrationComponent) value); + else if (name.equals("maxVolumeToDeliver")) + this.maxVolumeToDeliver = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("administrationInstruction")) + this.administrationInstruction = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -138930641: return getBaseFormulaType(); // CodeableConcept + case -1267705979: throw new FHIRException("Cannot make property baseFormulaProductName as it is not a complex type"); // StringType + case -470746842: return getAdditiveType(); // CodeableConcept + case 488079534: throw new FHIRException("Cannot make property additiveProductName as it is not a complex type"); // StringType + case 186983261: return getCaloricDensity(); // SimpleQuantity + case -1710107042: return getRouteofAdministration(); // CodeableConcept + case 1255702622: return addAdministration(); // NutritionOrderEnteralFormulaAdministrationComponent + case 2017924652: return getMaxVolumeToDeliver(); // SimpleQuantity + case 427085136: throw new FHIRException("Cannot make property administrationInstruction as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("baseFormulaType")) { + this.baseFormulaType = new CodeableConcept(); + return this.baseFormulaType; + } + else if (name.equals("baseFormulaProductName")) { + throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.baseFormulaProductName"); + } + else if (name.equals("additiveType")) { + this.additiveType = new CodeableConcept(); + return this.additiveType; + } + else if (name.equals("additiveProductName")) { + throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.additiveProductName"); + } + else if (name.equals("caloricDensity")) { + this.caloricDensity = new SimpleQuantity(); + return this.caloricDensity; + } + else if (name.equals("routeofAdministration")) { + this.routeofAdministration = new CodeableConcept(); + return this.routeofAdministration; + } + else if (name.equals("administration")) { + return addAdministration(); + } + else if (name.equals("maxVolumeToDeliver")) { + this.maxVolumeToDeliver = new SimpleQuantity(); + return this.maxVolumeToDeliver; + } + else if (name.equals("administrationInstruction")) { + throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.administrationInstruction"); + } + else + return super.addChild(name); + } + + public NutritionOrderEnteralFormulaComponent copy() { + NutritionOrderEnteralFormulaComponent dst = new NutritionOrderEnteralFormulaComponent(); + copyValues(dst); + dst.baseFormulaType = baseFormulaType == null ? null : baseFormulaType.copy(); + dst.baseFormulaProductName = baseFormulaProductName == null ? null : baseFormulaProductName.copy(); + dst.additiveType = additiveType == null ? null : additiveType.copy(); + dst.additiveProductName = additiveProductName == null ? null : additiveProductName.copy(); + dst.caloricDensity = caloricDensity == null ? null : caloricDensity.copy(); + dst.routeofAdministration = routeofAdministration == null ? null : routeofAdministration.copy(); + if (administration != null) { + dst.administration = new ArrayList(); + for (NutritionOrderEnteralFormulaAdministrationComponent i : administration) + dst.administration.add(i.copy()); + }; + dst.maxVolumeToDeliver = maxVolumeToDeliver == null ? null : maxVolumeToDeliver.copy(); + dst.administrationInstruction = administrationInstruction == null ? null : administrationInstruction.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderEnteralFormulaComponent)) + return false; + NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other; + return compareDeep(baseFormulaType, o.baseFormulaType, true) && compareDeep(baseFormulaProductName, o.baseFormulaProductName, true) + && compareDeep(additiveType, o.additiveType, true) && compareDeep(additiveProductName, o.additiveProductName, true) + && compareDeep(caloricDensity, o.caloricDensity, true) && compareDeep(routeofAdministration, o.routeofAdministration, true) + && compareDeep(administration, o.administration, true) && compareDeep(maxVolumeToDeliver, o.maxVolumeToDeliver, true) + && compareDeep(administrationInstruction, o.administrationInstruction, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderEnteralFormulaComponent)) + return false; + NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other; + return compareValues(baseFormulaProductName, o.baseFormulaProductName, true) && compareValues(additiveProductName, o.additiveProductName, true) + && compareValues(administrationInstruction, o.administrationInstruction, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (baseFormulaType == null || baseFormulaType.isEmpty()) && (baseFormulaProductName == null || baseFormulaProductName.isEmpty()) + && (additiveType == null || additiveType.isEmpty()) && (additiveProductName == null || additiveProductName.isEmpty()) + && (caloricDensity == null || caloricDensity.isEmpty()) && (routeofAdministration == null || routeofAdministration.isEmpty()) + && (administration == null || administration.isEmpty()) && (maxVolumeToDeliver == null || maxVolumeToDeliver.isEmpty()) + && (administrationInstruction == null || administrationInstruction.isEmpty()); + } + + public String fhirType() { + return "NutritionOrder.enteralFormula"; + + } + + } + + @Block() + public static class NutritionOrderEnteralFormulaAdministrationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The time period and frequency at which the enteral formula should be delivered to the patient. + */ + @Child(name = "schedule", type = {Timing.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Scheduled frequency of enteral feeding", formalDefinition="The time period and frequency at which the enteral formula should be delivered to the patient." ) + protected Timing schedule; + + /** + * The volume of formula to provide to the patient per the specified administration schedule. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The volume of formula to provide", formalDefinition="The volume of formula to provide to the patient per the specified administration schedule." ) + protected SimpleQuantity quantity; + + /** + * The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule. + */ + @Child(name = "rate", type = {SimpleQuantity.class, Ratio.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Speed with which the formula is provided per period of time", formalDefinition="The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule." ) + protected Type rate; + + private static final long serialVersionUID = 1895031997L; + + /** + * Constructor + */ + public NutritionOrderEnteralFormulaAdministrationComponent() { + super(); + } + + /** + * @return {@link #schedule} (The time period and frequency at which the enteral formula should be delivered to the patient.) + */ + public Timing getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaAdministrationComponent.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Timing(); // cc + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (The time period and frequency at which the enteral formula should be delivered to the patient.) + */ + public NutritionOrderEnteralFormulaAdministrationComponent setSchedule(Timing value) { + this.schedule = value; + return this; + } + + /** + * @return {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaAdministrationComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + 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 NutritionOrderEnteralFormulaAdministrationComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.) + */ + public Type getRate() { + return this.rate; + } + + /** + * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.) + */ + public SimpleQuantity getRateSimpleQuantity() throws FHIRException { + if (!(this.rate instanceof SimpleQuantity)) + throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (SimpleQuantity) this.rate; + } + + public boolean hasRateSimpleQuantity() { + return this.rate instanceof SimpleQuantity; + } + + /** + * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.) + */ + public Ratio getRateRatio() throws FHIRException { + if (!(this.rate instanceof Ratio)) + throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); + return (Ratio) this.rate; + } + + public boolean hasRateRatio() { + return this.rate instanceof Ratio; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.) + */ + public NutritionOrderEnteralFormulaAdministrationComponent setRate(Type value) { + this.rate = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the enteral formula should be delivered to the patient.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("quantity", "SimpleQuantity", "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[x]", "SimpleQuantity|Ratio", "The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.", 0, java.lang.Integer.MAX_VALUE, rate)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Timing + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -697920873: // schedule + this.schedule = castToTiming(value); // Timing + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case 3493088: // rate + this.rate = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("schedule")) + this.schedule = castToTiming(value); // Timing + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("rate[x]")) + this.rate = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -697920873: return getSchedule(); // Timing + case -1285004149: return getQuantity(); // SimpleQuantity + case 983460768: return getRate(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("schedule")) { + this.schedule = new Timing(); + return this.schedule; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("rateSimpleQuantity")) { + this.rate = new SimpleQuantity(); + return this.rate; + } + else if (name.equals("rateRatio")) { + this.rate = new Ratio(); + return this.rate; + } + else + return super.addChild(name); + } + + public NutritionOrderEnteralFormulaAdministrationComponent copy() { + NutritionOrderEnteralFormulaAdministrationComponent dst = new NutritionOrderEnteralFormulaAdministrationComponent(); + copyValues(dst); + dst.schedule = schedule == null ? null : schedule.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrderEnteralFormulaAdministrationComponent)) + return false; + NutritionOrderEnteralFormulaAdministrationComponent o = (NutritionOrderEnteralFormulaAdministrationComponent) other; + return compareDeep(schedule, o.schedule, true) && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrderEnteralFormulaAdministrationComponent)) + return false; + NutritionOrderEnteralFormulaAdministrationComponent o = (NutritionOrderEnteralFormulaAdministrationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (schedule == null || schedule.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (rate == null || rate.isEmpty()); + } + + public String fhirType() { + return "NutritionOrder.enteralFormula.administration"; + + } + + } + + /** + * Identifiers assigned to this order by the order sender or by the order receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order sender or by the order receiver." ) + protected List identifier; + + /** + * The workflow status of the nutrition order/request. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposed | draft | planned | requested | active | on-hold | completed | cancelled | entered-in-error", formalDefinition="The workflow status of the nutrition order/request." ) + protected Enumeration status; + + /** + * The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. + */ + @Child(name = "patient", type = {Patient.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The person who requires the diet, formula or nutritional supplement", formalDefinition="The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + protected Patient patientTarget; + + /** + * An encounter that provides additional information about the healthcare context in which this request is made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The encounter associated with this nutrition order", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * The date and time that this nutrition order was requested. + */ + @Child(name = "dateTime", type = {DateTimeType.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date and time the nutrition order was requested", formalDefinition="The date and time that this nutrition order was requested." ) + protected DateTimeType dateTime; + + /** + * The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. + */ + @Child(name = "orderer", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who ordered the diet, formula or nutritional supplement", formalDefinition="The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + protected Practitioner ordererTarget; + + /** + * A link to a record of allergies or intolerances which should be included in the nutrition order. + */ + @Child(name = "allergyIntolerance", type = {AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="List of the patient's food and nutrition-related allergies and intolerances", formalDefinition="A link to a record of allergies or intolerances which should be included in the nutrition order." ) + protected List allergyIntolerance; + /** + * The actual objects that are the target of the reference (A link to a record of allergies or intolerances which should be included in the nutrition order.) + */ + protected List allergyIntoleranceTarget; + + + /** + * This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. + */ + @Child(name = "foodPreferenceModifier", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Order-specific modifier about the type of food that should be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) + protected List foodPreferenceModifier; + + /** + * This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. + */ + @Child(name = "excludeFoodModifier", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Order-specific modifier about the type of food that should not be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) + protected List excludeFoodModifier; + + /** + * Diet given orally in contrast to enteral (tube) feeding. + */ + @Child(name = "oralDiet", type = {}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Oral diet components", formalDefinition="Diet given orally in contrast to enteral (tube) feeding." ) + protected NutritionOrderOralDietComponent oralDiet; + + /** + * Oral nutritional products given in order to add further nutritional value to the patient's diet. + */ + @Child(name = "supplement", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Supplement components", formalDefinition="Oral nutritional products given in order to add further nutritional value to the patient's diet." ) + protected List supplement; + + /** + * Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. + */ + @Child(name = "enteralFormula", type = {}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Enteral formula components", formalDefinition="Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity." ) + protected NutritionOrderEnteralFormulaComponent enteralFormula; + + private static final long serialVersionUID = 1429947433L; + + /** + * Constructor + */ + public NutritionOrder() { + super(); + } + + /** + * Constructor + */ + public NutritionOrder(Reference patient, DateTimeType dateTime) { + super(); + this.patient = patient; + this.dateTime = dateTime; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) + */ + 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 assigned to this order by the order sender or by the order receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (The workflow status of the nutrition order/request.). 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 NutritionOrder.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new NutritionOrderStatusEnumFactory()); // bb + 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 workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public NutritionOrder setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The workflow status of the nutrition order/request. + */ + public NutritionOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The workflow status of the nutrition order/request. + */ + public NutritionOrder setStatus(NutritionOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new NutritionOrderStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public NutritionOrder 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 person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public NutritionOrder setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public NutritionOrder 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. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public NutritionOrder setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); // bb + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public NutritionOrder setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date and time that this nutrition order was requested. + */ + 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(Date value) { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + return this; + } + + /** + * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); // cc + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public NutritionOrder setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} 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 that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public Practitioner getOrdererTarget() { + if (this.ordererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.ordererTarget = new Practitioner(); // aa + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} 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 that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public NutritionOrder setOrdererTarget(Practitioner value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #allergyIntolerance} (A link to a record of allergies or intolerances which should be included in the nutrition order.) + */ + public List getAllergyIntolerance() { + if (this.allergyIntolerance == null) + this.allergyIntolerance = new ArrayList(); + return this.allergyIntolerance; + } + + public boolean hasAllergyIntolerance() { + if (this.allergyIntolerance == null) + return false; + for (Reference item : this.allergyIntolerance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #allergyIntolerance} (A link to a record of allergies or intolerances which should be included in the nutrition order.) + */ + // syntactic sugar + public Reference addAllergyIntolerance() { //3 + Reference t = new Reference(); + if (this.allergyIntolerance == null) + this.allergyIntolerance = new ArrayList(); + this.allergyIntolerance.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addAllergyIntolerance(Reference t) { //3 + if (t == null) + return this; + if (this.allergyIntolerance == null) + this.allergyIntolerance = new ArrayList(); + this.allergyIntolerance.add(t); + return this; + } + + /** + * @return {@link #allergyIntolerance} (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 link to a record of allergies or intolerances which should be included in the nutrition order.) + */ + public List getAllergyIntoleranceTarget() { + if (this.allergyIntoleranceTarget == null) + this.allergyIntoleranceTarget = new ArrayList(); + return this.allergyIntoleranceTarget; + } + + // syntactic sugar + /** + * @return {@link #allergyIntolerance} (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 link to a record of allergies or intolerances which should be included in the nutrition order.) + */ + public AllergyIntolerance addAllergyIntoleranceTarget() { + AllergyIntolerance r = new AllergyIntolerance(); + if (this.allergyIntoleranceTarget == null) + this.allergyIntoleranceTarget = new ArrayList(); + this.allergyIntoleranceTarget.add(r); + return r; + } + + /** + * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + public List getFoodPreferenceModifier() { + if (this.foodPreferenceModifier == null) + this.foodPreferenceModifier = new ArrayList(); + return this.foodPreferenceModifier; + } + + public boolean hasFoodPreferenceModifier() { + if (this.foodPreferenceModifier == null) + return false; + for (CodeableConcept item : this.foodPreferenceModifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + // syntactic sugar + public CodeableConcept addFoodPreferenceModifier() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.foodPreferenceModifier == null) + this.foodPreferenceModifier = new ArrayList(); + this.foodPreferenceModifier.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addFoodPreferenceModifier(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.foodPreferenceModifier == null) + this.foodPreferenceModifier = new ArrayList(); + this.foodPreferenceModifier.add(t); + return this; + } + + /** + * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + public List getExcludeFoodModifier() { + if (this.excludeFoodModifier == null) + this.excludeFoodModifier = new ArrayList(); + return this.excludeFoodModifier; + } + + public boolean hasExcludeFoodModifier() { + if (this.excludeFoodModifier == null) + return false; + for (CodeableConcept item : this.excludeFoodModifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + // syntactic sugar + public CodeableConcept addExcludeFoodModifier() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.excludeFoodModifier == null) + this.excludeFoodModifier = new ArrayList(); + this.excludeFoodModifier.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addExcludeFoodModifier(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.excludeFoodModifier == null) + this.excludeFoodModifier = new ArrayList(); + this.excludeFoodModifier.add(t); + return this; + } + + /** + * @return {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.) + */ + public NutritionOrderOralDietComponent getOralDiet() { + if (this.oralDiet == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.oralDiet"); + else if (Configuration.doAutoCreate()) + this.oralDiet = new NutritionOrderOralDietComponent(); // cc + return this.oralDiet; + } + + public boolean hasOralDiet() { + return this.oralDiet != null && !this.oralDiet.isEmpty(); + } + + /** + * @param value {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.) + */ + public NutritionOrder setOralDiet(NutritionOrderOralDietComponent value) { + this.oralDiet = value; + return this; + } + + /** + * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.) + */ + public List getSupplement() { + if (this.supplement == null) + this.supplement = new ArrayList(); + return this.supplement; + } + + public boolean hasSupplement() { + if (this.supplement == null) + return false; + for (NutritionOrderSupplementComponent item : this.supplement) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.) + */ + // syntactic sugar + public NutritionOrderSupplementComponent addSupplement() { //3 + NutritionOrderSupplementComponent t = new NutritionOrderSupplementComponent(); + if (this.supplement == null) + this.supplement = new ArrayList(); + this.supplement.add(t); + return t; + } + + // syntactic sugar + public NutritionOrder addSupplement(NutritionOrderSupplementComponent t) { //3 + if (t == null) + return this; + if (this.supplement == null) + this.supplement = new ArrayList(); + this.supplement.add(t); + return this; + } + + /** + * @return {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.) + */ + public NutritionOrderEnteralFormulaComponent getEnteralFormula() { + if (this.enteralFormula == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.enteralFormula"); + else if (Configuration.doAutoCreate()) + this.enteralFormula = new NutritionOrderEnteralFormulaComponent(); // cc + return this.enteralFormula; + } + + public boolean hasEnteralFormula() { + return this.enteralFormula != null && !this.enteralFormula.isEmpty(); + } + + /** + * @param value {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.) + */ + public NutritionOrder setEnteralFormula(NutritionOrderEnteralFormulaComponent value) { + this.enteralFormula = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order sender or by the order receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "The workflow status of the nutrition order/request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("dateTime", "dateTime", "The date and time that this nutrition order was requested.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("allergyIntolerance", "Reference(AllergyIntolerance)", "A link to a record of allergies or intolerances which should be included in the nutrition order.", 0, java.lang.Integer.MAX_VALUE, allergyIntolerance)); + childrenList.add(new Property("foodPreferenceModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, foodPreferenceModifier)); + childrenList.add(new Property("excludeFoodModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, excludeFoodModifier)); + childrenList.add(new Property("oralDiet", "", "Diet given orally in contrast to enteral (tube) feeding.", 0, java.lang.Integer.MAX_VALUE, oralDiet)); + childrenList.add(new Property("supplement", "", "Oral nutritional products given in order to add further nutritional value to the patient's diet.", 0, java.lang.Integer.MAX_VALUE, supplement)); + childrenList.add(new Property("enteralFormula", "", "Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.", 0, java.lang.Integer.MAX_VALUE, enteralFormula)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 1792749467: /*dateTime*/ return this.dateTime == null ? new Base[0] : new Base[] {this.dateTime}; // DateTimeType + case -1207109509: /*orderer*/ return this.orderer == null ? new Base[0] : new Base[] {this.orderer}; // Reference + case -120164120: /*allergyIntolerance*/ return this.allergyIntolerance == null ? new Base[0] : this.allergyIntolerance.toArray(new Base[this.allergyIntolerance.size()]); // Reference + case 659473872: /*foodPreferenceModifier*/ return this.foodPreferenceModifier == null ? new Base[0] : this.foodPreferenceModifier.toArray(new Base[this.foodPreferenceModifier.size()]); // CodeableConcept + case 1760260175: /*excludeFoodModifier*/ return this.excludeFoodModifier == null ? new Base[0] : this.excludeFoodModifier.toArray(new Base[this.excludeFoodModifier.size()]); // CodeableConcept + case 1153521250: /*oralDiet*/ return this.oralDiet == null ? new Base[0] : new Base[] {this.oralDiet}; // NutritionOrderOralDietComponent + case -711993159: /*supplement*/ return this.supplement == null ? new Base[0] : this.supplement.toArray(new Base[this.supplement.size()]); // NutritionOrderSupplementComponent + case -671083805: /*enteralFormula*/ return this.enteralFormula == null ? new Base[0] : new Base[] {this.enteralFormula}; // NutritionOrderEnteralFormulaComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new NutritionOrderStatusEnumFactory().fromType(value); // Enumeration + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 1792749467: // dateTime + this.dateTime = castToDateTime(value); // DateTimeType + break; + case -1207109509: // orderer + this.orderer = castToReference(value); // Reference + break; + case -120164120: // allergyIntolerance + this.getAllergyIntolerance().add(castToReference(value)); // Reference + break; + case 659473872: // foodPreferenceModifier + this.getFoodPreferenceModifier().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1760260175: // excludeFoodModifier + this.getExcludeFoodModifier().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1153521250: // oralDiet + this.oralDiet = (NutritionOrderOralDietComponent) value; // NutritionOrderOralDietComponent + break; + case -711993159: // supplement + this.getSupplement().add((NutritionOrderSupplementComponent) value); // NutritionOrderSupplementComponent + break; + case -671083805: // enteralFormula + this.enteralFormula = (NutritionOrderEnteralFormulaComponent) value; // NutritionOrderEnteralFormulaComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new NutritionOrderStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("dateTime")) + this.dateTime = castToDateTime(value); // DateTimeType + else if (name.equals("orderer")) + this.orderer = castToReference(value); // Reference + else if (name.equals("allergyIntolerance")) + this.getAllergyIntolerance().add(castToReference(value)); + else if (name.equals("foodPreferenceModifier")) + this.getFoodPreferenceModifier().add(castToCodeableConcept(value)); + else if (name.equals("excludeFoodModifier")) + this.getExcludeFoodModifier().add(castToCodeableConcept(value)); + else if (name.equals("oralDiet")) + this.oralDiet = (NutritionOrderOralDietComponent) value; // NutritionOrderOralDietComponent + else if (name.equals("supplement")) + this.getSupplement().add((NutritionOrderSupplementComponent) value); + else if (name.equals("enteralFormula")) + this.enteralFormula = (NutritionOrderEnteralFormulaComponent) value; // NutritionOrderEnteralFormulaComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -791418107: return getPatient(); // Reference + case 1524132147: return getEncounter(); // Reference + case 1792749467: throw new FHIRException("Cannot make property dateTime as it is not a complex type"); // DateTimeType + case -1207109509: return getOrderer(); // Reference + case -120164120: return addAllergyIntolerance(); // Reference + case 659473872: return addFoodPreferenceModifier(); // CodeableConcept + case 1760260175: return addExcludeFoodModifier(); // CodeableConcept + case 1153521250: return getOralDiet(); // NutritionOrderOralDietComponent + case -711993159: return addSupplement(); // NutritionOrderSupplementComponent + case -671083805: return getEnteralFormula(); // NutritionOrderEnteralFormulaComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.status"); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("dateTime")) { + throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.dateTime"); + } + else if (name.equals("orderer")) { + this.orderer = new Reference(); + return this.orderer; + } + else if (name.equals("allergyIntolerance")) { + return addAllergyIntolerance(); + } + else if (name.equals("foodPreferenceModifier")) { + return addFoodPreferenceModifier(); + } + else if (name.equals("excludeFoodModifier")) { + return addExcludeFoodModifier(); + } + else if (name.equals("oralDiet")) { + this.oralDiet = new NutritionOrderOralDietComponent(); + return this.oralDiet; + } + else if (name.equals("supplement")) { + return addSupplement(); + } + else if (name.equals("enteralFormula")) { + this.enteralFormula = new NutritionOrderEnteralFormulaComponent(); + return this.enteralFormula; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "NutritionOrder"; + + } + + public NutritionOrder copy() { + NutritionOrder dst = new NutritionOrder(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + if (allergyIntolerance != null) { + dst.allergyIntolerance = new ArrayList(); + for (Reference i : allergyIntolerance) + dst.allergyIntolerance.add(i.copy()); + }; + if (foodPreferenceModifier != null) { + dst.foodPreferenceModifier = new ArrayList(); + for (CodeableConcept i : foodPreferenceModifier) + dst.foodPreferenceModifier.add(i.copy()); + }; + if (excludeFoodModifier != null) { + dst.excludeFoodModifier = new ArrayList(); + for (CodeableConcept i : excludeFoodModifier) + dst.excludeFoodModifier.add(i.copy()); + }; + dst.oralDiet = oralDiet == null ? null : oralDiet.copy(); + if (supplement != null) { + dst.supplement = new ArrayList(); + for (NutritionOrderSupplementComponent i : supplement) + dst.supplement.add(i.copy()); + }; + dst.enteralFormula = enteralFormula == null ? null : enteralFormula.copy(); + return dst; + } + + protected NutritionOrder typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NutritionOrder)) + return false; + NutritionOrder o = (NutritionOrder) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(dateTime, o.dateTime, true) && compareDeep(orderer, o.orderer, true) + && compareDeep(allergyIntolerance, o.allergyIntolerance, true) && compareDeep(foodPreferenceModifier, o.foodPreferenceModifier, true) + && compareDeep(excludeFoodModifier, o.excludeFoodModifier, true) && compareDeep(oralDiet, o.oralDiet, true) + && compareDeep(supplement, o.supplement, true) && compareDeep(enteralFormula, o.enteralFormula, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NutritionOrder)) + return false; + NutritionOrder o = (NutritionOrder) other; + return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (patient == null || patient.isEmpty()) && (encounter == null || encounter.isEmpty()) && (dateTime == null || dateTime.isEmpty()) + && (orderer == null || orderer.isEmpty()) && (allergyIntolerance == null || allergyIntolerance.isEmpty()) + && (foodPreferenceModifier == null || foodPreferenceModifier.isEmpty()) && (excludeFoodModifier == null || excludeFoodModifier.isEmpty()) + && (oralDiet == null || oralDiet.isEmpty()) && (supplement == null || supplement.isEmpty()) + && (enteralFormula == null || enteralFormula.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.NutritionOrder; + } + + /** + * Search parameter: patient + *

+ * Description: The identity of the person who requires the diet, formula or nutritional supplement
+ * Type: reference
+ * Path: NutritionOrder.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="NutritionOrder.patient", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of the person who requires the diet, formula or nutritional supplement
+ * Type: reference
+ * Path: NutritionOrder.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "NutritionOrder:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("NutritionOrder:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: Status of the nutrition order.
+ * Type: token
+ * Path: NutritionOrder.status
+ *

+ */ + @SearchParamDefinition(name="status", path="NutritionOrder.status", description="Status of the nutrition order.", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the nutrition order.
+ * Type: token
+ * Path: NutritionOrder.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: supplement + *

+ * Description: Type of supplement product requested
+ * Type: token
+ * Path: NutritionOrder.supplement.type
+ *

+ */ + @SearchParamDefinition(name="supplement", path="NutritionOrder.supplement.type", description="Type of supplement product requested", type="token" ) + public static final String SP_SUPPLEMENT = "supplement"; + /** + * Fluent Client search parameter constant for supplement + *

+ * Description: Type of supplement product requested
+ * Type: token
+ * Path: NutritionOrder.supplement.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUPPLEMENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUPPLEMENT); + + /** + * Search parameter: oraldiet + *

+ * Description: Type of diet that can be consumed orally (i.e., take via the mouth).
+ * Type: token
+ * Path: NutritionOrder.oralDiet.type
+ *

+ */ + @SearchParamDefinition(name="oraldiet", path="NutritionOrder.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"; + /** + * Fluent Client search parameter constant for oraldiet + *

+ * Description: Type of diet that can be consumed orally (i.e., take via the mouth).
+ * Type: token
+ * Path: NutritionOrder.oralDiet.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORALDIET = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORALDIET); + + /** + * Search parameter: provider + *

+ * Description: The identify of the provider who placed the nutrition order
+ * Type: reference
+ * Path: NutritionOrder.orderer
+ *

+ */ + @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"; + /** + * Fluent Client search parameter constant for provider + *

+ * Description: The identify of the provider who placed the nutrition order
+ * Type: reference
+ * Path: NutritionOrder.orderer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "NutritionOrder:provider". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDER = new ca.uhn.fhir.model.api.Include("NutritionOrder:provider").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Return nutrition orders with this encounter identifier
+ * Type: reference
+ * Path: NutritionOrder.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="NutritionOrder.encounter", description="Return nutrition orders with this encounter identifier", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Return nutrition orders with this encounter identifier
+ * Type: reference
+ * Path: NutritionOrder.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "NutritionOrder:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("NutritionOrder:encounter").toLocked(); + + /** + * Search parameter: datetime + *

+ * Description: Return nutrition orders requested on this date
+ * Type: date
+ * Path: NutritionOrder.dateTime
+ *

+ */ + @SearchParamDefinition(name="datetime", path="NutritionOrder.dateTime", description="Return nutrition orders requested on this date", type="date" ) + public static final String SP_DATETIME = "datetime"; + /** + * Fluent Client search parameter constant for datetime + *

+ * Description: Return nutrition orders requested on this date
+ * Type: date
+ * Path: NutritionOrder.dateTime
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATETIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATETIME); + + /** + * Search parameter: additive + *

+ * Description: Type of module component to add to the feeding
+ * Type: token
+ * Path: NutritionOrder.enteralFormula.additiveType
+ *

+ */ + @SearchParamDefinition(name="additive", path="NutritionOrder.enteralFormula.additiveType", description="Type of module component to add to the feeding", type="token" ) + public static final String SP_ADDITIVE = "additive"; + /** + * Fluent Client search parameter constant for additive + *

+ * Description: Type of module component to add to the feeding
+ * Type: token
+ * Path: NutritionOrder.enteralFormula.additiveType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDITIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDITIVE); + + /** + * Search parameter: identifier + *

+ * Description: Return nutrition orders with this external identifier
+ * Type: token
+ * Path: NutritionOrder.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="NutritionOrder.identifier", description="Return nutrition orders with this external identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Return nutrition orders with this external identifier
+ * Type: token
+ * Path: NutritionOrder.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: formula + *

+ * Description: Type of enteral or infant formula
+ * Type: token
+ * Path: NutritionOrder.enteralFormula.baseFormulaType
+ *

+ */ + @SearchParamDefinition(name="formula", path="NutritionOrder.enteralFormula.baseFormulaType", description="Type of enteral or infant formula", type="token" ) + public static final String SP_FORMULA = "formula"; + /** + * Fluent Client search parameter constant for formula + *

+ * Description: Type of enteral or infant formula
+ * Type: token
+ * Path: NutritionOrder.enteralFormula.baseFormulaType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMULA = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMULA); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Observation.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Observation.java new file mode 100644 index 00000000000..bd5dc8693ff --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Observation.java @@ -0,0 +1,3523 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Measurements and simple assertions made about a patient, device or other subject. + */ +@ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation") +public class Observation extends DomainResource { + + public enum ObservationStatus { + /** + * The existence of the observation is registered, but there is no result yet available. + */ + REGISTERED, + /** + * This is an initial or interim observation: data may be incomplete or unverified. + */ + PRELIMINARY, + /** + * The observation is complete and verified by an authorized person (who may be the same person who entered the observation based on policy). + */ + FINAL, + /** + * The observation has been modified subsequent to being Final, and is complete and verified by an authorized person. + */ + AMENDED, + /** + * The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). + */ + CANCELLED, + /** + * The observation has been withdrawn following previous final release. + */ + ENTEREDINERROR, + /** + * The observation status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static ObservationStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return REGISTERED; + if ("preliminary".equals(codeString)) + return PRELIMINARY; + if ("final".equals(codeString)) + return FINAL; + if ("amended".equals(codeString)) + return AMENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new FHIRException("Unknown ObservationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REGISTERED: return "registered"; + case PRELIMINARY: return "preliminary"; + case FINAL: return "final"; + case AMENDED: return "amended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered-in-error"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REGISTERED: return "http://hl7.org/fhir/observation-status"; + case PRELIMINARY: return "http://hl7.org/fhir/observation-status"; + case FINAL: return "http://hl7.org/fhir/observation-status"; + case AMENDED: return "http://hl7.org/fhir/observation-status"; + case CANCELLED: return "http://hl7.org/fhir/observation-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/observation-status"; + case UNKNOWN: return "http://hl7.org/fhir/observation-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REGISTERED: return "The existence of the observation is registered, but there is no result yet available."; + case PRELIMINARY: return "This is an initial or interim observation: data may be incomplete or unverified."; + case FINAL: return "The observation is complete and verified by an authorized person (who may be the same person who entered the observation based on policy)."; + case AMENDED: return "The observation has been modified subsequent to being Final, and is complete and verified by an authorized person."; + case CANCELLED: return "The observation is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\")."; + case ENTEREDINERROR: return "The observation has been withdrawn following previous final release."; + case UNKNOWN: return "The observation status is unknown. Note that \"unknown\" is a value of last resort and every attempt should be made to provide a meaningful value other than \"unknown\"."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REGISTERED: return "Registered"; + case PRELIMINARY: return "Preliminary"; + case FINAL: return "Final"; + case AMENDED: return "Amended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "Entered in Error"; + case UNKNOWN: return "Unknown Status"; + default: return "?"; + } + } + } + + 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; + if ("registered".equals(codeString)) + return ObservationStatus.REGISTERED; + if ("preliminary".equals(codeString)) + return ObservationStatus.PRELIMINARY; + if ("final".equals(codeString)) + return ObservationStatus.FINAL; + if ("amended".equals(codeString)) + return ObservationStatus.AMENDED; + if ("cancelled".equals(codeString)) + return ObservationStatus.CANCELLED; + if ("entered-in-error".equals(codeString)) + return ObservationStatus.ENTEREDINERROR; + if ("unknown".equals(codeString)) + return ObservationStatus.UNKNOWN; + throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return new Enumeration(this, ObservationStatus.REGISTERED); + if ("preliminary".equals(codeString)) + return new Enumeration(this, ObservationStatus.PRELIMINARY); + if ("final".equals(codeString)) + return new Enumeration(this, ObservationStatus.FINAL); + if ("amended".equals(codeString)) + return new Enumeration(this, ObservationStatus.AMENDED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, ObservationStatus.CANCELLED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, ObservationStatus.ENTEREDINERROR); + if ("unknown".equals(codeString)) + return new Enumeration(this, ObservationStatus.UNKNOWN); + throw new FHIRException("Unknown ObservationStatus code '"+codeString+"'"); + } + public String toCode(ObservationStatus code) { + if (code == ObservationStatus.REGISTERED) + return "registered"; + if (code == ObservationStatus.PRELIMINARY) + return "preliminary"; + if (code == ObservationStatus.FINAL) + return "final"; + if (code == ObservationStatus.AMENDED) + return "amended"; + if (code == ObservationStatus.CANCELLED) + return "cancelled"; + if (code == ObservationStatus.ENTEREDINERROR) + return "entered-in-error"; + if (code == ObservationStatus.UNKNOWN) + return "unknown"; + return "?"; + } + public String toSystem(ObservationStatus code) { + return code.getSystem(); + } + } + + public enum ObservationRelationshipType { + /** + * This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. + */ + HASMEMBER, + /** + * The target resource (Observation or QuestionnaireResponse) is part of the information from which this observation value is derived. (e.g. calculated anion gap, Apgar score) NOTE: "derived-from" is only logical choice when referencing QuestionnaireResponse. + */ + DERIVEDFROM, + /** + * This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). + */ + SEQUELTO, + /** + * This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. + */ + REPLACES, + /** + * The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipemia measure target from a plasma measure). + */ + QUALIFIEDBY, + /** + * The value of the target observation interferes (degrades quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value). + */ + INTERFEREDBY, + /** + * added to help the parsers + */ + NULL; + public static ObservationRelationshipType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("has-member".equals(codeString)) + return HASMEMBER; + if ("derived-from".equals(codeString)) + return DERIVEDFROM; + if ("sequel-to".equals(codeString)) + return SEQUELTO; + if ("replaces".equals(codeString)) + return REPLACES; + if ("qualified-by".equals(codeString)) + return QUALIFIEDBY; + if ("interfered-by".equals(codeString)) + return INTERFEREDBY; + throw new FHIRException("Unknown ObservationRelationshipType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HASMEMBER: return "has-member"; + case DERIVEDFROM: return "derived-from"; + case SEQUELTO: return "sequel-to"; + case REPLACES: return "replaces"; + case QUALIFIEDBY: return "qualified-by"; + case INTERFEREDBY: return "interfered-by"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HASMEMBER: return "http://hl7.org/fhir/observation-relationshiptypes"; + case DERIVEDFROM: return "http://hl7.org/fhir/observation-relationshiptypes"; + case SEQUELTO: return "http://hl7.org/fhir/observation-relationshiptypes"; + case REPLACES: return "http://hl7.org/fhir/observation-relationshiptypes"; + case QUALIFIEDBY: return "http://hl7.org/fhir/observation-relationshiptypes"; + case INTERFEREDBY: return "http://hl7.org/fhir/observation-relationshiptypes"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HASMEMBER: return "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group."; + case DERIVEDFROM: return "The target resource (Observation or QuestionnaireResponse) is part of the information from which this observation value is derived. (e.g. calculated anion gap, Apgar score) NOTE: \"derived-from\" is only logical choice when referencing QuestionnaireResponse."; + case SEQUELTO: return "This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test)."; + case REPLACES: return "This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete."; + case QUALIFIEDBY: return "The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipemia measure target from a plasma measure)."; + case INTERFEREDBY: return "The value of the target observation interferes (degrades quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HASMEMBER: return "Has Member"; + case DERIVEDFROM: return "Derived From"; + case SEQUELTO: return "Sequel To"; + case REPLACES: return "Replaces"; + case QUALIFIEDBY: return "Qualified By"; + case INTERFEREDBY: return "Interfered By"; + default: return "?"; + } + } + } + + public static class ObservationRelationshipTypeEnumFactory implements EnumFactory { + public ObservationRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("has-member".equals(codeString)) + return ObservationRelationshipType.HASMEMBER; + if ("derived-from".equals(codeString)) + return ObservationRelationshipType.DERIVEDFROM; + if ("sequel-to".equals(codeString)) + return ObservationRelationshipType.SEQUELTO; + if ("replaces".equals(codeString)) + return ObservationRelationshipType.REPLACES; + if ("qualified-by".equals(codeString)) + return ObservationRelationshipType.QUALIFIEDBY; + if ("interfered-by".equals(codeString)) + return ObservationRelationshipType.INTERFEREDBY; + throw new IllegalArgumentException("Unknown ObservationRelationshipType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("has-member".equals(codeString)) + return new Enumeration(this, ObservationRelationshipType.HASMEMBER); + if ("derived-from".equals(codeString)) + return new Enumeration(this, ObservationRelationshipType.DERIVEDFROM); + if ("sequel-to".equals(codeString)) + return new Enumeration(this, ObservationRelationshipType.SEQUELTO); + if ("replaces".equals(codeString)) + return new Enumeration(this, ObservationRelationshipType.REPLACES); + if ("qualified-by".equals(codeString)) + return new Enumeration(this, ObservationRelationshipType.QUALIFIEDBY); + if ("interfered-by".equals(codeString)) + return new Enumeration(this, ObservationRelationshipType.INTERFEREDBY); + throw new FHIRException("Unknown ObservationRelationshipType code '"+codeString+"'"); + } + public String toCode(ObservationRelationshipType code) { + if (code == ObservationRelationshipType.HASMEMBER) + return "has-member"; + if (code == ObservationRelationshipType.DERIVEDFROM) + return "derived-from"; + if (code == ObservationRelationshipType.SEQUELTO) + return "sequel-to"; + if (code == ObservationRelationshipType.REPLACES) + return "replaces"; + if (code == ObservationRelationshipType.QUALIFIEDBY) + return "qualified-by"; + if (code == ObservationRelationshipType.INTERFEREDBY) + return "interfered-by"; + return "?"; + } + public String toSystem(ObservationRelationshipType code) { + return code.getSystem(); + } + } + + @Block() + public static class ObservationReferenceRangeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3). + */ + @Child(name = "low", type = {SimpleQuantity.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Low Range, if relevant", formalDefinition="The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3)." ) + protected SimpleQuantity low; + + /** + * The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3). + */ + @Child(name = "high", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="High Range, if relevant", formalDefinition="The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3)." ) + protected SimpleQuantity high; + + /** + * Code for the meaning of the reference range. + */ + @Child(name = "meaning", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Indicates the meaning/use of this range of this range", formalDefinition="Code for the meaning of the reference range." ) + protected CodeableConcept meaning; + + /** + * The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. + */ + @Child(name = "age", type = {Range.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Applicable age range, if relevant", formalDefinition="The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so." ) + protected Range age; + + /** + * Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + @Child(name = "text", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Text based reference range in an observation", formalDefinition="Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of 'normals'." ) + protected StringType text; + + private static final long serialVersionUID = -238694788L; + + /** + * Constructor + */ + public ObservationReferenceRangeComponent() { + super(); + } + + /** + * @return {@link #low} (The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).) + */ + public SimpleQuantity getLow() { + if (this.low == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.low"); + else if (Configuration.doAutoCreate()) + this.low = new SimpleQuantity(); // cc + return this.low; + } + + public boolean hasLow() { + return this.low != null && !this.low.isEmpty(); + } + + /** + * @param value {@link #low} (The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).) + */ + public ObservationReferenceRangeComponent setLow(SimpleQuantity value) { + this.low = value; + return this; + } + + /** + * @return {@link #high} (The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).) + */ + public SimpleQuantity getHigh() { + if (this.high == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.high"); + else if (Configuration.doAutoCreate()) + this.high = new SimpleQuantity(); // cc + return this.high; + } + + public boolean hasHigh() { + return this.high != null && !this.high.isEmpty(); + } + + /** + * @param value {@link #high} (The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).) + */ + public ObservationReferenceRangeComponent setHigh(SimpleQuantity value) { + this.high = value; + return this; + } + + /** + * @return {@link #meaning} (Code for the meaning of the reference range.) + */ + public CodeableConcept getMeaning() { + if (this.meaning == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.meaning"); + else if (Configuration.doAutoCreate()) + this.meaning = new CodeableConcept(); // cc + return this.meaning; + } + + public boolean hasMeaning() { + return this.meaning != null && !this.meaning.isEmpty(); + } + + /** + * @param value {@link #meaning} (Code for the meaning of the reference range.) + */ + public ObservationReferenceRangeComponent setMeaning(CodeableConcept value) { + this.meaning = value; + return this; + } + + /** + * @return {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) + */ + public Range getAge() { + if (this.age == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.age"); + else if (Configuration.doAutoCreate()) + this.age = new Range(); // cc + return this.age; + } + + public boolean hasAge() { + return this.age != null && !this.age.isEmpty(); + } + + /** + * @param value {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) + */ + public ObservationReferenceRangeComponent setAge(Range value) { + this.age = value; + return this; + } + + /** + * @return {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public ObservationReferenceRangeComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + public ObservationReferenceRangeComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("low", "SimpleQuantity", "The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).", 0, java.lang.Integer.MAX_VALUE, low)); + childrenList.add(new Property("high", "SimpleQuantity", "The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).", 0, java.lang.Integer.MAX_VALUE, high)); + childrenList.add(new Property("meaning", "CodeableConcept", "Code for the meaning of the reference range.", 0, java.lang.Integer.MAX_VALUE, meaning)); + childrenList.add(new Property("age", "Range", "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 0, java.lang.Integer.MAX_VALUE, age)); + childrenList.add(new Property("text", "string", "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of 'normals'.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 107348: /*low*/ return this.low == null ? new Base[0] : new Base[] {this.low}; // SimpleQuantity + case 3202466: /*high*/ return this.high == null ? new Base[0] : new Base[] {this.high}; // SimpleQuantity + case 938160637: /*meaning*/ return this.meaning == null ? new Base[0] : new Base[] {this.meaning}; // CodeableConcept + case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Range + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 107348: // low + this.low = castToSimpleQuantity(value); // SimpleQuantity + break; + case 3202466: // high + this.high = castToSimpleQuantity(value); // SimpleQuantity + break; + case 938160637: // meaning + this.meaning = castToCodeableConcept(value); // CodeableConcept + break; + case 96511: // age + this.age = castToRange(value); // Range + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("low")) + this.low = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("high")) + this.high = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("meaning")) + this.meaning = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("age")) + this.age = castToRange(value); // Range + else if (name.equals("text")) + this.text = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 107348: return getLow(); // SimpleQuantity + case 3202466: return getHigh(); // SimpleQuantity + case 938160637: return getMeaning(); // CodeableConcept + case 96511: return getAge(); // Range + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("low")) { + this.low = new SimpleQuantity(); + return this.low; + } + else if (name.equals("high")) { + this.high = new SimpleQuantity(); + return this.high; + } + else if (name.equals("meaning")) { + this.meaning = new CodeableConcept(); + return this.meaning; + } + else if (name.equals("age")) { + this.age = new Range(); + return this.age; + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type Observation.text"); + } + else + return super.addChild(name); + } + + public ObservationReferenceRangeComponent copy() { + ObservationReferenceRangeComponent dst = new ObservationReferenceRangeComponent(); + copyValues(dst); + dst.low = low == null ? null : low.copy(); + dst.high = high == null ? null : high.copy(); + dst.meaning = meaning == null ? null : meaning.copy(); + dst.age = age == null ? null : age.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ObservationReferenceRangeComponent)) + return false; + ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other; + return compareDeep(low, o.low, true) && compareDeep(high, o.high, true) && compareDeep(meaning, o.meaning, true) + && compareDeep(age, o.age, true) && compareDeep(text, o.text, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ObservationReferenceRangeComponent)) + return false; + ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) + && (meaning == null || meaning.isEmpty()) && (age == null || age.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + public String fhirType() { + return "Observation.referenceRange"; + + } + + } + + @Block() + public static class ObservationRelatedComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code specifying the kind of relationship that exists with the target resource. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", formalDefinition="A code specifying the kind of relationship that exists with the target resource." ) + protected Enumeration type; + + /** + * A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation. + */ + @Child(name = "target", type = {Observation.class, QuestionnaireResponse.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Resource that is related to this one", formalDefinition="A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) + */ + protected Resource targetTarget; + + private static final long serialVersionUID = 1541802577L; + + /** + * Constructor + */ + public ObservationRelatedComponent() { + super(); + } + + /** + * Constructor + */ + public ObservationRelatedComponent(Reference target) { + super(); + this.target = target; + } + + /** + * @return {@link #type} (A code specifying the kind of relationship that exists with the target resource.). 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 ObservationRelatedComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ObservationRelationshipTypeEnumFactory()); // bb + 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} (A code specifying the kind of relationship that exists with the target resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ObservationRelatedComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return A code specifying the kind of relationship that exists with the target resource. + */ + public ObservationRelationshipType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A code specifying the kind of relationship that exists with the target resource. + */ + public ObservationRelatedComponent setType(ObservationRelationshipType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(new ObservationRelationshipTypeEnumFactory()); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) + */ + public ObservationRelatedComponent 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. (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) + */ + public Resource getTargetTarget() { + 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. (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) + */ + public ObservationRelatedComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "A code specifying the kind of relationship that exists with the target resource.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("target", "Reference(Observation|QuestionnaireResponse)", "A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new ObservationRelationshipTypeEnumFactory().fromType(value); // Enumeration + break; + case -880905839: // target + this.target = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new ObservationRelationshipTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("target")) + this.target = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -880905839: return getTarget(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Observation.type"); + } + else if (name.equals("target")) { + this.target = new Reference(); + return this.target; + } + else + return super.addChild(name); + } + + public ObservationRelatedComponent copy() { + ObservationRelatedComponent dst = new ObservationRelatedComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ObservationRelatedComponent)) + return false; + ObservationRelatedComponent o = (ObservationRelatedComponent) other; + return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ObservationRelatedComponent)) + return false; + ObservationRelatedComponent o = (ObservationRelatedComponent) other; + return compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + public String fhirType() { + return "Observation.related"; + + } + + } + + @Block() + public static class ObservationComponentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Describes what was observed. Sometimes this is called the observation "code". + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of component observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation \"code\"." ) + protected CodeableConcept code; + + /** + * The information determined as a result of making the observation, if the information has a simple value. + */ + @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, Range.class, Ratio.class, SampledData.class, Attachment.class, TimeType.class, DateTimeType.class, Period.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Actual component result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) + protected Type value; + + /** + * Provides a reason why the expected value in the element Observation.value[x] is missing. + */ + @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why the component result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) + protected CodeableConcept dataAbsentReason; + + /** + * Guidance on how to interpret the value by comparison to a normal or recommended range. + */ + @Child(name = "referenceRange", type = {ObservationReferenceRangeComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Provides guide for interpretation of component result", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) + protected List referenceRange; + + private static final long serialVersionUID = 946602904L; + + /** + * Constructor + */ + public ObservationComponentComponent() { + super(); + } + + /** + * Constructor + */ + public ObservationComponentComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "code".) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationComponentComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "code".) + */ + public ObservationComponentComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Quantity getValueQuantity() throws FHIRException { + if (!(this.value instanceof Quantity)) + throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + public boolean hasValueQuantity() { + return this.value instanceof Quantity; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public CodeableConcept getValueCodeableConcept() throws FHIRException { + if (!(this.value instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + public boolean hasValueCodeableConcept() { + return this.value instanceof CodeableConcept; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public StringType getValueStringType() throws FHIRException { + if (!(this.value instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + public boolean hasValueStringType() { + return this.value instanceof StringType; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Range getValueRange() throws FHIRException { + if (!(this.value instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Range) this.value; + } + + public boolean hasValueRange() { + return this.value instanceof Range; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Ratio getValueRatio() throws FHIRException { + if (!(this.value instanceof Ratio)) + throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Ratio) this.value; + } + + public boolean hasValueRatio() { + return this.value instanceof Ratio; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public SampledData getValueSampledData() throws FHIRException { + if (!(this.value instanceof SampledData)) + throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); + return (SampledData) this.value; + } + + public boolean hasValueSampledData() { + return this.value instanceof SampledData; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Attachment getValueAttachment() throws FHIRException { + if (!(this.value instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + public boolean hasValueAttachment() { + return this.value instanceof Attachment; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public TimeType getValueTimeType() throws FHIRException { + if (!(this.value instanceof TimeType)) + throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + public boolean hasValueTimeType() { + return this.value instanceof TimeType; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public DateTimeType getValueDateTimeType() throws FHIRException { + if (!(this.value instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + public boolean hasValueDateTimeType() { + return this.value instanceof DateTimeType; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Period getValuePeriod() throws FHIRException { + if (!(this.value instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Period) this.value; + } + + public boolean hasValuePeriod() { + return this.value instanceof Period; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public ObservationComponentComponent setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) + */ + public CodeableConcept getDataAbsentReason() { + if (this.dataAbsentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationComponentComponent.dataAbsentReason"); + else if (Configuration.doAutoCreate()) + this.dataAbsentReason = new CodeableConcept(); // cc + return this.dataAbsentReason; + } + + public boolean hasDataAbsentReason() { + return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); + } + + /** + * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) + */ + public ObservationComponentComponent setDataAbsentReason(CodeableConcept value) { + this.dataAbsentReason = value; + return this; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + public List getReferenceRange() { + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + return this.referenceRange; + } + + public boolean hasReferenceRange() { + if (this.referenceRange == null) + return false; + for (ObservationReferenceRangeComponent item : this.referenceRange) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + // syntactic sugar + public ObservationReferenceRangeComponent addReferenceRange() { //3 + ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return t; + } + + // syntactic sugar + public ObservationComponentComponent addReferenceRange(ObservationReferenceRangeComponent t) { //3 + if (t == null) + return this; + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation \"code\".", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|string|Range|Ratio|SampledData|Attachment|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); + childrenList.add(new Property("referenceRange", "@Observation.referenceRange", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + case 1034315687: /*dataAbsentReason*/ return this.dataAbsentReason == null ? new Base[0] : new Base[] {this.dataAbsentReason}; // CodeableConcept + case -1912545102: /*referenceRange*/ return this.referenceRange == null ? new Base[0] : this.referenceRange.toArray(new Base[this.referenceRange.size()]); // ObservationReferenceRangeComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 111972721: // value + this.value = (Type) value; // Type + break; + case 1034315687: // dataAbsentReason + this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept + break; + case -1912545102: // referenceRange + this.getReferenceRange().add((ObservationReferenceRangeComponent) value); // ObservationReferenceRangeComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("value[x]")) + this.value = (Type) value; // Type + else if (name.equals("dataAbsentReason")) + this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("referenceRange")) + this.getReferenceRange().add((ObservationReferenceRangeComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case -1410166417: return getValue(); // Type + case 1034315687: return getDataAbsentReason(); // CodeableConcept + case -1912545102: return addReferenceRange(); // ObservationReferenceRangeComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else if (name.equals("valueRatio")) { + this.value = new Ratio(); + return this.value; + } + else if (name.equals("valueSampledData")) { + this.value = new SampledData(); + return this.value; + } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else if (name.equals("dataAbsentReason")) { + this.dataAbsentReason = new CodeableConcept(); + return this.dataAbsentReason; + } + else if (name.equals("referenceRange")) { + return addReferenceRange(); + } + else + return super.addChild(name); + } + + public ObservationComponentComponent copy() { + ObservationComponentComponent dst = new ObservationComponentComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); + if (referenceRange != null) { + dst.referenceRange = new ArrayList(); + for (ObservationReferenceRangeComponent i : referenceRange) + dst.referenceRange.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ObservationComponentComponent)) + return false; + ObservationComponentComponent o = (ObservationComponentComponent) other; + return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(dataAbsentReason, o.dataAbsentReason, true) + && compareDeep(referenceRange, o.referenceRange, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ObservationComponentComponent)) + return false; + ObservationComponentComponent o = (ObservationComponentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + && (dataAbsentReason == null || dataAbsentReason.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) + ; + } + + public String fhirType() { + return "Observation.component"; + + } + + } + + /** + * A unique identifier for the simple observation instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Unique Id for this particular observation", formalDefinition="A unique identifier for the simple observation instance." ) + protected List identifier; + + /** + * The status of the result value. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="registered | preliminary | final | amended +", formalDefinition="The status of the result value." ) + protected Enumeration status; + + /** + * A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Classification of type of observation", formalDefinition="A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes." ) + protected CodeableConcept category; + + /** + * Describes what was observed. Sometimes this is called the observation "name". + */ + @Child(name = "code", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation \"name\"." ) + protected CodeableConcept code; + + /** + * The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) + */ + protected Resource subjectTarget; + + /** + * The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made. + */ + @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Healthcare event during which this observation is made", formalDefinition="The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) + */ + protected Encounter encounterTarget; + + /** + * The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself. + */ + @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Clinically relevant time/time-period for observation", formalDefinition="The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself." ) + protected Type effective; + + /** + * The date and time this observation was made available to providers, typically after the results have been reviewed and verified. + */ + @Child(name = "issued", type = {InstantType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date/Time this was made available", formalDefinition="The date and time this observation was made available to providers, typically after the results have been reviewed and verified." ) + protected InstantType issued; + + /** + * Who was responsible for asserting the observed value as "true". + */ + @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who is responsible for the observation", formalDefinition="Who was responsible for asserting the observed value as \"true\"." ) + protected List performer; + /** + * The actual objects that are the target of the reference (Who was responsible for asserting the observed value as "true".) + */ + protected List performerTarget; + + + /** + * The information determined as a result of making the observation, if the information has a simple value. + */ + @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, Range.class, Ratio.class, SampledData.class, Attachment.class, TimeType.class, DateTimeType.class, Period.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) + protected Type value; + + /** + * Provides a reason why the expected value in the element Observation.value[x] is missing. + */ + @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why the result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) + protected CodeableConcept dataAbsentReason; + + /** + * The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag. + */ + @Child(name = "interpretation", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="High, low, normal, etc.", formalDefinition="The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag." ) + protected CodeableConcept interpretation; + + /** + * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + @Child(name = "comment", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Comments about result", formalDefinition="May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result." ) + protected StringType comment; + + /** + * Indicates the site on the subject's body where the observation was made (i.e. the target site). + */ + @Child(name = "bodySite", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Observed body part", formalDefinition="Indicates the site on the subject's body where the observation was made (i.e. the target site)." ) + protected CodeableConcept bodySite; + + /** + * Indicates the mechanism used to perform the observation. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="How it was done", formalDefinition="Indicates the mechanism used to perform the observation." ) + protected CodeableConcept method; + + /** + * The specimen that was used when this observation was made. + */ + @Child(name = "specimen", type = {Specimen.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Specimen used for this observation", formalDefinition="The specimen that was used when this observation was made." ) + protected Reference specimen; + + /** + * The actual object that is the target of the reference (The specimen that was used when this observation was made.) + */ + protected Specimen specimenTarget; + + /** + * The device used to generate the observation data. + */ + @Child(name = "device", type = {Device.class, DeviceMetric.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="(Measurement) Device", formalDefinition="The device used to generate the observation data." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The device used to generate the observation data.) + */ + protected Resource deviceTarget; + + /** + * Guidance on how to interpret the value by comparison to a normal or recommended range. + */ + @Child(name = "referenceRange", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Provides guide for interpretation", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) + protected List referenceRange; + + /** + * A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code. + */ + @Child(name = "related", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Resource related to this observation", formalDefinition="A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code." ) + protected List related; + + /** + * Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations. + */ + @Child(name = "component", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Component results", formalDefinition="Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations." ) + protected List component; + + private static final long serialVersionUID = -1812700333L; + + /** + * Constructor + */ + public Observation() { + super(); + } + + /** + * Constructor + */ + public Observation(Enumeration status, CodeableConcept code) { + super(); + this.status = status; + this.code = code; + } + + /** + * @return {@link #identifier} (A unique identifier for the simple observation instance.) + */ + 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} (A unique identifier for the simple observation instance.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Observation addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #status} (The status of the result value.). 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 Observation.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ObservationStatusEnumFactory()); // bb + 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 result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Observation setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the result value. + */ + public ObservationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the result value. + */ + public Observation setStatus(ObservationStatus value) { + if (this.status == null) + this.status = new Enumeration(new ObservationStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #category} (A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes.) + */ + public Observation setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "name".) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "name".) + */ + public Observation setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) + */ + public Observation 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, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) + */ + public Resource getSubjectTarget() { + 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, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) + */ + public Observation setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) + */ + public Observation 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 healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) + */ + public Observation setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Type getEffective() { + return this.effective; + } + + /** + * @return {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public DateTimeType getEffectiveDateTimeType() throws FHIRException { + if (!(this.effective instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (DateTimeType) this.effective; + } + + public boolean hasEffectiveDateTimeType() { + return this.effective instanceof DateTimeType; + } + + /** + * @return {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Period getEffectivePeriod() throws FHIRException { + if (!(this.effective instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (Period) this.effective; + } + + public boolean hasEffectivePeriod() { + return this.effective instanceof Period; + } + + public boolean hasEffective() { + return this.effective != null && !this.effective.isEmpty(); + } + + /** + * @param value {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Observation setEffective(Type value) { + this.effective = value; + return this; + } + + /** + * @return {@link #issued} (The date and time this observation was made available to providers, typically after the results have been reviewed and verified.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public InstantType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new InstantType(); // bb + 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} (The date and time this observation was made available to providers, typically after the results have been reviewed and verified.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public Observation setIssuedElement(InstantType value) { + this.issued = value; + return this; + } + + /** + * @return The date and time this observation was made available to providers, typically after the results have been reviewed and verified. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value The date and time this observation was made available to providers, typically after the results have been reviewed and verified. + */ + public Observation setIssued(Date value) { + if (value == null) + this.issued = null; + else { + if (this.issued == null) + this.issued = new InstantType(); + this.issued.setValue(value); + } + return this; + } + + /** + * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) + */ + 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} (Who was responsible for asserting the observed value as "true".) + */ + // syntactic sugar + public Reference addPerformer() { //3 + Reference t = new Reference(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + // syntactic sugar + public Observation addPerformer(Reference t) { //3 + if (t == null) + return this; + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return this; + } + + /** + * @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. Who was responsible for asserting the observed value as "true".) + */ + public List getPerformerTarget() { + if (this.performerTarget == null) + this.performerTarget = new ArrayList(); + return this.performerTarget; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Quantity getValueQuantity() throws FHIRException { + if (!(this.value instanceof Quantity)) + throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + public boolean hasValueQuantity() { + return this.value instanceof Quantity; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public CodeableConcept getValueCodeableConcept() throws FHIRException { + if (!(this.value instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + public boolean hasValueCodeableConcept() { + return this.value instanceof CodeableConcept; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public StringType getValueStringType() throws FHIRException { + if (!(this.value instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + public boolean hasValueStringType() { + return this.value instanceof StringType; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Range getValueRange() throws FHIRException { + if (!(this.value instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Range) this.value; + } + + public boolean hasValueRange() { + return this.value instanceof Range; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Ratio getValueRatio() throws FHIRException { + if (!(this.value instanceof Ratio)) + throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Ratio) this.value; + } + + public boolean hasValueRatio() { + return this.value instanceof Ratio; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public SampledData getValueSampledData() throws FHIRException { + if (!(this.value instanceof SampledData)) + throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); + return (SampledData) this.value; + } + + public boolean hasValueSampledData() { + return this.value instanceof SampledData; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Attachment getValueAttachment() throws FHIRException { + if (!(this.value instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + public boolean hasValueAttachment() { + return this.value instanceof Attachment; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public TimeType getValueTimeType() throws FHIRException { + if (!(this.value instanceof TimeType)) + throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + public boolean hasValueTimeType() { + return this.value instanceof TimeType; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public DateTimeType getValueDateTimeType() throws FHIRException { + if (!(this.value instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + public boolean hasValueDateTimeType() { + return this.value instanceof DateTimeType; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Period getValuePeriod() throws FHIRException { + if (!(this.value instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Period) this.value; + } + + public boolean hasValuePeriod() { + return this.value instanceof Period; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Observation setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) + */ + public CodeableConcept getDataAbsentReason() { + if (this.dataAbsentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.dataAbsentReason"); + else if (Configuration.doAutoCreate()) + this.dataAbsentReason = new CodeableConcept(); // cc + return this.dataAbsentReason; + } + + public boolean hasDataAbsentReason() { + return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); + } + + /** + * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) + */ + public Observation setDataAbsentReason(CodeableConcept value) { + this.dataAbsentReason = value; + return this; + } + + /** + * @return {@link #interpretation} (The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.) + */ + public CodeableConcept getInterpretation() { + if (this.interpretation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.interpretation"); + else if (Configuration.doAutoCreate()) + this.interpretation = new CodeableConcept(); // cc + return this.interpretation; + } + + public boolean hasInterpretation() { + return this.interpretation != null && !this.interpretation.isEmpty(); + } + + /** + * @param value {@link #interpretation} (The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.) + */ + public Observation setInterpretation(CodeableConcept value) { + this.interpretation = value; + return this; + } + + /** + * @return {@link #comment} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Observation setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + public Observation setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made (i.e. the target site).) + */ + public CodeableConcept getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new CodeableConcept(); // cc + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Indicates the site on the subject's body where the observation was made (i.e. the target site).) + */ + public Observation setBodySite(CodeableConcept value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #method} (Indicates the mechanism used to perform the observation.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (Indicates the mechanism used to perform the observation.) + */ + public Observation setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #specimen} (The specimen that was used when this observation was made.) + */ + public Reference getSpecimen() { + if (this.specimen == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.specimen"); + else if (Configuration.doAutoCreate()) + this.specimen = new Reference(); // cc + return this.specimen; + } + + public boolean hasSpecimen() { + return this.specimen != null && !this.specimen.isEmpty(); + } + + /** + * @param value {@link #specimen} (The specimen that was used when this observation was made.) + */ + public Observation setSpecimen(Reference value) { + this.specimen = value; + return this; + } + + /** + * @return {@link #specimen} 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 specimen that was used when this observation was made.) + */ + public Specimen getSpecimenTarget() { + if (this.specimenTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.specimen"); + else if (Configuration.doAutoCreate()) + this.specimenTarget = new Specimen(); // aa + return this.specimenTarget; + } + + /** + * @param value {@link #specimen} 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 specimen that was used when this observation was made.) + */ + public Observation setSpecimenTarget(Specimen value) { + this.specimenTarget = value; + return this; + } + + /** + * @return {@link #device} (The device used to generate the observation data.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); // cc + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The device used to generate the observation data.) + */ + public Observation setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} 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 device used to generate the observation data.) + */ + public Resource getDeviceTarget() { + return this.deviceTarget; + } + + /** + * @param value {@link #device} 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 device used to generate the observation data.) + */ + public Observation setDeviceTarget(Resource value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + public List getReferenceRange() { + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + return this.referenceRange; + } + + public boolean hasReferenceRange() { + if (this.referenceRange == null) + return false; + for (ObservationReferenceRangeComponent item : this.referenceRange) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + // syntactic sugar + public ObservationReferenceRangeComponent addReferenceRange() { //3 + ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return t; + } + + // syntactic sugar + public Observation addReferenceRange(ObservationReferenceRangeComponent t) { //3 + if (t == null) + return this; + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return this; + } + + /** + * @return {@link #related} (A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (ObservationRelatedComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code.) + */ + // syntactic sugar + public ObservationRelatedComponent addRelated() { //3 + ObservationRelatedComponent t = new ObservationRelatedComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + // syntactic sugar + public Observation addRelated(ObservationRelatedComponent t) { //3 + if (t == null) + return this; + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return this; + } + + /** + * @return {@link #component} (Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.) + */ + public List getComponent() { + if (this.component == null) + this.component = new ArrayList(); + return this.component; + } + + public boolean hasComponent() { + if (this.component == null) + return false; + for (ObservationComponentComponent item : this.component) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #component} (Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.) + */ + // syntactic sugar + public ObservationComponentComponent addComponent() { //3 + ObservationComponentComponent t = new ObservationComponentComponent(); + if (this.component == null) + this.component = new ArrayList(); + this.component.add(t); + return t; + } + + // syntactic sugar + public Observation addComponent(ObservationComponentComponent t) { //3 + if (t == null) + return this; + if (this.component == null) + this.component = new ArrayList(); + this.component.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the simple observation instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "The status of the result value.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation \"name\".", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("effective[x]", "dateTime|Period", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, effective)); + childrenList.add(new Property("issued", "instant", "The date and time this observation was made available to providers, typically after the results have been reviewed and verified.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "Who was responsible for asserting the observed value as \"true\".", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|string|Range|Ratio|SampledData|Attachment|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); + childrenList.add(new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.", 0, java.lang.Integer.MAX_VALUE, interpretation)); + childrenList.add(new Property("comment", "string", "May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the observation was made (i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("method", "CodeableConcept", "Indicates the mechanism used to perform the observation.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "The specimen that was used when this observation was made.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("device", "Reference(Device|DeviceMetric)", "The device used to generate the observation data.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("referenceRange", "", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); + childrenList.add(new Property("related", "", "A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code.", 0, java.lang.Integer.MAX_VALUE, related)); + childrenList.add(new Property("component", "", "Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.", 0, java.lang.Integer.MAX_VALUE, component)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type + case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + case 1034315687: /*dataAbsentReason*/ return this.dataAbsentReason == null ? new Base[0] : new Base[] {this.dataAbsentReason}; // CodeableConcept + case -297950712: /*interpretation*/ return this.interpretation == null ? new Base[0] : new Base[] {this.interpretation}; // CodeableConcept + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept + case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference + case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference + case -1912545102: /*referenceRange*/ return this.referenceRange == null ? new Base[0] : this.referenceRange.toArray(new Base[this.referenceRange.size()]); // ObservationReferenceRangeComponent + case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // ObservationRelatedComponent + case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // ObservationComponentComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -892481550: // status + this.status = new ObservationStatusEnumFactory().fromType(value); // Enumeration + break; + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -1468651097: // effective + this.effective = (Type) value; // Type + break; + case -1179159893: // issued + this.issued = castToInstant(value); // InstantType + break; + case 481140686: // performer + this.getPerformer().add(castToReference(value)); // Reference + break; + case 111972721: // value + this.value = (Type) value; // Type + break; + case 1034315687: // dataAbsentReason + this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept + break; + case -297950712: // interpretation + this.interpretation = castToCodeableConcept(value); // CodeableConcept + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + case 1702620169: // bodySite + this.bodySite = castToCodeableConcept(value); // CodeableConcept + break; + case -1077554975: // method + this.method = castToCodeableConcept(value); // CodeableConcept + break; + case -2132868344: // specimen + this.specimen = castToReference(value); // Reference + break; + case -1335157162: // device + this.device = castToReference(value); // Reference + break; + case -1912545102: // referenceRange + this.getReferenceRange().add((ObservationReferenceRangeComponent) value); // ObservationReferenceRangeComponent + break; + case 1090493483: // related + this.getRelated().add((ObservationRelatedComponent) value); // ObservationRelatedComponent + break; + case -1399907075: // component + this.getComponent().add((ObservationComponentComponent) value); // ObservationComponentComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) + this.status = new ObservationStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("effective[x]")) + this.effective = (Type) value; // Type + else if (name.equals("issued")) + this.issued = castToInstant(value); // InstantType + else if (name.equals("performer")) + this.getPerformer().add(castToReference(value)); + else if (name.equals("value[x]")) + this.value = (Type) value; // Type + else if (name.equals("dataAbsentReason")) + this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("interpretation")) + this.interpretation = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else if (name.equals("bodySite")) + this.bodySite = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("method")) + this.method = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("specimen")) + this.specimen = castToReference(value); // Reference + else if (name.equals("device")) + this.device = castToReference(value); // Reference + else if (name.equals("referenceRange")) + this.getReferenceRange().add((ObservationReferenceRangeComponent) value); + else if (name.equals("related")) + this.getRelated().add((ObservationRelatedComponent) value); + else if (name.equals("component")) + this.getComponent().add((ObservationComponentComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 50511102: return getCategory(); // CodeableConcept + case 3059181: return getCode(); // CodeableConcept + case -1867885268: return getSubject(); // Reference + case 1524132147: return getEncounter(); // Reference + case 247104889: return getEffective(); // Type + case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // InstantType + case 481140686: return addPerformer(); // Reference + case -1410166417: return getValue(); // Type + case 1034315687: return getDataAbsentReason(); // CodeableConcept + case -297950712: return getInterpretation(); // CodeableConcept + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + case 1702620169: return getBodySite(); // CodeableConcept + case -1077554975: return getMethod(); // CodeableConcept + case -2132868344: return getSpecimen(); // Reference + case -1335157162: return getDevice(); // Reference + case -1912545102: return addReferenceRange(); // ObservationReferenceRangeComponent + case 1090493483: return addRelated(); // ObservationRelatedComponent + case -1399907075: return addComponent(); // ObservationComponentComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Observation.status"); + } + else if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("effectiveDateTime")) { + this.effective = new DateTimeType(); + return this.effective; + } + else if (name.equals("effectivePeriod")) { + this.effective = new Period(); + return this.effective; + } + else if (name.equals("issued")) { + throw new FHIRException("Cannot call addChild on a primitive type Observation.issued"); + } + else if (name.equals("performer")) { + return addPerformer(); + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else if (name.equals("valueRatio")) { + this.value = new Ratio(); + return this.value; + } + else if (name.equals("valueSampledData")) { + this.value = new SampledData(); + return this.value; + } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else if (name.equals("dataAbsentReason")) { + this.dataAbsentReason = new CodeableConcept(); + return this.dataAbsentReason; + } + else if (name.equals("interpretation")) { + this.interpretation = new CodeableConcept(); + return this.interpretation; + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type Observation.comment"); + } + else if (name.equals("bodySite")) { + this.bodySite = new CodeableConcept(); + return this.bodySite; + } + else if (name.equals("method")) { + this.method = new CodeableConcept(); + return this.method; + } + else if (name.equals("specimen")) { + this.specimen = new Reference(); + return this.specimen; + } + else if (name.equals("device")) { + this.device = new Reference(); + return this.device; + } + else if (name.equals("referenceRange")) { + return addReferenceRange(); + } + else if (name.equals("related")) { + return addRelated(); + } + else if (name.equals("component")) { + return addComponent(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Observation"; + + } + + public Observation copy() { + Observation dst = new Observation(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.effective = effective == null ? null : effective.copy(); + dst.issued = issued == null ? null : issued.copy(); + if (performer != null) { + dst.performer = new ArrayList(); + for (Reference i : performer) + dst.performer.add(i.copy()); + }; + dst.value = value == null ? null : value.copy(); + dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); + dst.interpretation = interpretation == null ? null : interpretation.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.method = method == null ? null : method.copy(); + dst.specimen = specimen == null ? null : specimen.copy(); + dst.device = device == null ? null : device.copy(); + if (referenceRange != null) { + dst.referenceRange = new ArrayList(); + for (ObservationReferenceRangeComponent i : referenceRange) + dst.referenceRange.add(i.copy()); + }; + if (related != null) { + dst.related = new ArrayList(); + for (ObservationRelatedComponent i : related) + dst.related.add(i.copy()); + }; + if (component != null) { + dst.component = new ArrayList(); + for (ObservationComponentComponent i : component) + dst.component.add(i.copy()); + }; + return dst; + } + + protected Observation typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Observation)) + return false; + Observation o = (Observation) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) + && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(effective, o.effective, true) && compareDeep(issued, o.issued, true) && compareDeep(performer, o.performer, true) + && compareDeep(value, o.value, true) && compareDeep(dataAbsentReason, o.dataAbsentReason, true) + && compareDeep(interpretation, o.interpretation, true) && compareDeep(comment, o.comment, true) + && compareDeep(bodySite, o.bodySite, true) && compareDeep(method, o.method, true) && compareDeep(specimen, o.specimen, true) + && compareDeep(device, o.device, true) && compareDeep(referenceRange, o.referenceRange, true) && compareDeep(related, o.related, true) + && compareDeep(component, o.component, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Observation)) + return false; + Observation o = (Observation) other; + return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(comment, o.comment, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) && (subject == null || subject.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (effective == null || effective.isEmpty()) + && (issued == null || issued.isEmpty()) && (performer == null || performer.isEmpty()) && (value == null || value.isEmpty()) + && (dataAbsentReason == null || dataAbsentReason.isEmpty()) && (interpretation == null || interpretation.isEmpty()) + && (comment == null || comment.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (method == null || method.isEmpty()) + && (specimen == null || specimen.isEmpty()) && (device == null || device.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) + && (related == null || related.isEmpty()) && (component == null || component.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Observation; + } + + /** + * Search parameter: subject + *

+ * Description: The subject that the observation is about
+ * Type: reference
+ * Path: Observation.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Observation.subject", description="The subject that the observation is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: The subject that the observation is about
+ * Type: reference
+ * Path: Observation.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Observation:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Observation:subject").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Healthcare event related to the observation
+ * Type: reference
+ * Path: Observation.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="Observation.encounter", description="Healthcare event related to the observation", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Healthcare event related to the observation
+ * Type: reference
+ * Path: Observation.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Observation:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Observation:encounter").toLocked(); + + /** + * Search parameter: date + *

+ * Description: Obtained date/time. If the obtained element is a period, a date that falls in the period
+ * Type: date
+ * Path: Observation.effective[x]
+ *

+ */ + @SearchParamDefinition(name="date", path="Observation.effective", description="Obtained date/time. If the obtained element is a period, a date that falls in the period", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Obtained date/time. If the obtained element is a period, a date that falls in the period
+ * Type: date
+ * Path: Observation.effective[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: component-value-quantity + *

+ * Description: The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)
+ * Type: quantity
+ * Path: Observation.component.valueQuantity
+ *

+ */ + @SearchParamDefinition(name="component-value-quantity", path="Observation.component.value.as(Quantity)", description="The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" ) + public static final String SP_COMPONENT_VALUE_QUANTITY = "component-value-quantity"; + /** + * Fluent Client search parameter constant for component-value-quantity + *

+ * Description: The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)
+ * Type: quantity
+ * Path: Observation.component.valueQuantity
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.QuantityClientParam COMPONENT_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_COMPONENT_VALUE_QUANTITY); + + /** + * Search parameter: related + *

+ * Description: Related Observations - search on related-type and related-target together
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="related", path="", description="Related Observations - search on related-type and related-target together", type="composite", compositeOf={"related-target", "related-type"} ) + public static final String SP_RELATED = "related"; + /** + * Fluent Client search parameter constant for related + *

+ * Description: Related Observations - search on related-type and related-target together
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam RELATED = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_RELATED); + + /** + * Search parameter: patient + *

+ * Description: The subject that the observation is about (if patient)
+ * Type: reference
+ * Path: Observation.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Observation.subject", description="The subject that the observation is about (if patient)", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The subject that the observation is about (if patient)
+ * Type: reference
+ * Path: Observation.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Observation:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Observation:patient").toLocked(); + + /** + * Search parameter: specimen + *

+ * Description: Specimen used for this observation
+ * Type: reference
+ * Path: Observation.specimen
+ *

+ */ + @SearchParamDefinition(name="specimen", path="Observation.specimen", description="Specimen used for this observation", type="reference" ) + public static final String SP_SPECIMEN = "specimen"; + /** + * Fluent Client search parameter constant for specimen + *

+ * Description: Specimen used for this observation
+ * Type: reference
+ * Path: Observation.specimen
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Observation:specimen". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("Observation:specimen").toLocked(); + + /** + * Search parameter: component-value-concept + *

+ * Description: The value of the component observation, if the value is a CodeableConcept
+ * Type: token
+ * Path: Observation.component.valueCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="component-value-concept", path="Observation.component.value.as(CodeableConcept)", description="The value of the component observation, if the value is a CodeableConcept", type="token" ) + public static final String SP_COMPONENT_VALUE_CONCEPT = "component-value-concept"; + /** + * Fluent Client search parameter constant for component-value-concept + *

+ * Description: The value of the component observation, if the value is a CodeableConcept
+ * Type: token
+ * Path: Observation.component.valueCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_VALUE_CONCEPT); + + /** + * Search parameter: component-code-value-quantity + *

+ * Description: Both component code and one of the component value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="component-code-value-quantity", path="", description="Both component code and one of the component value parameters", type="composite", compositeOf={"component-code", "value-quantity"} ) + public static final String SP_COMPONENT_CODE_VALUE_QUANTITY = "component-code-value-quantity"; + /** + * Fluent Client search parameter constant for component-code-value-quantity + *

+ * Description: Both component code and one of the component value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COMPONENT_CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COMPONENT_CODE_VALUE_QUANTITY); + + /** + * Search parameter: component-code-value-date + *

+ * Description: Both component code and one of the component value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="component-code-value-date", path="", description="Both component code and one of the component value parameters", type="composite", compositeOf={"component-code", "value-date"} ) + public static final String SP_COMPONENT_CODE_VALUE_DATE = "component-code-value-date"; + /** + * Fluent Client search parameter constant for component-code-value-date + *

+ * Description: Both component code and one of the component value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COMPONENT_CODE_VALUE_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COMPONENT_CODE_VALUE_DATE); + + /** + * Search parameter: component-code-value-string + *

+ * Description: Both component code and one of the component value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="component-code-value-string", path="", description="Both component code and one of the component value parameters", type="composite", compositeOf={"component-code", "value-string"} ) + public static final String SP_COMPONENT_CODE_VALUE_STRING = "component-code-value-string"; + /** + * Fluent Client search parameter constant for component-code-value-string + *

+ * Description: Both component code and one of the component value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COMPONENT_CODE_VALUE_STRING = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COMPONENT_CODE_VALUE_STRING); + + /** + * Search parameter: component-code-value-concept + *

+ * Description: Both component code and one of the component value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="component-code-value-concept", path="", description="Both component code and one of the component value parameters", type="composite", compositeOf={"component-code", "value-concept"} ) + public static final String SP_COMPONENT_CODE_VALUE_CONCEPT = "component-code-value-concept"; + /** + * Fluent Client search parameter constant for component-code-value-concept + *

+ * Description: Both component code and one of the component value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COMPONENT_CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COMPONENT_CODE_VALUE_CONCEPT); + + /** + * Search parameter: value-quantity + *

+ * Description: The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)
+ * Type: quantity
+ * Path: Observation.valueQuantity
+ *

+ */ + @SearchParamDefinition(name="value-quantity", path="Observation.value.as(Quantity)", description="The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" ) + public static final String SP_VALUE_QUANTITY = "value-quantity"; + /** + * Fluent Client search parameter constant for value-quantity + *

+ * Description: The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)
+ * Type: quantity
+ * Path: Observation.valueQuantity
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.QuantityClientParam VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_VALUE_QUANTITY); + + /** + * Search parameter: value-date + *

+ * Description: The value of the observation, if the value is a date or period of time
+ * Type: date
+ * Path: Observation.valueDateTime, Observation.valuePeriod
+ *

+ */ + @SearchParamDefinition(name="value-date", path="Observation.value.as(DateTime) | Observation.value.as(Period)", description="The value of the observation, if the value is a date or period of time", type="date" ) + public static final String SP_VALUE_DATE = "value-date"; + /** + * Fluent Client search parameter constant for value-date + *

+ * Description: The value of the observation, if the value is a date or period of time
+ * Type: date
+ * Path: Observation.valueDateTime, Observation.valuePeriod
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam VALUE_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_VALUE_DATE); + + /** + * Search parameter: value-string + *

+ * Description: The value of the observation, if the value is a string, and also searches in CodeableConcept.text
+ * Type: string
+ * Path: Observation.valueString
+ *

+ */ + @SearchParamDefinition(name="value-string", path="Observation.value.as(String)", description="The value of the observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) + public static final String SP_VALUE_STRING = "value-string"; + /** + * Fluent Client search parameter constant for value-string + *

+ * Description: The value of the observation, if the value is a string, and also searches in CodeableConcept.text
+ * Type: string
+ * Path: Observation.valueString
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VALUE_STRING = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VALUE_STRING); + + /** + * Search parameter: component-code + *

+ * Description: The component code of the observation type
+ * Type: token
+ * Path: Observation.component.code
+ *

+ */ + @SearchParamDefinition(name="component-code", path="Observation.component.code", description="The component code of the observation type", type="token" ) + public static final String SP_COMPONENT_CODE = "component-code"; + /** + * Fluent Client search parameter constant for component-code + *

+ * Description: The component code of the observation type
+ * Type: token
+ * Path: Observation.component.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_CODE); + + /** + * Search parameter: status + *

+ * Description: The status of the observation
+ * Type: token
+ * Path: Observation.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Observation.status", description="The status of the observation", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The status of the observation
+ * Type: token
+ * Path: Observation.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: value-concept + *

+ * Description: The value of the observation, if the value is a CodeableConcept
+ * Type: token
+ * Path: Observation.valueCodeableConcept
+ *

+ */ + @SearchParamDefinition(name="value-concept", path="Observation.value.as(CodeableConcept)", description="The value of the observation, if the value is a CodeableConcept", type="token" ) + public static final String SP_VALUE_CONCEPT = "value-concept"; + /** + * Fluent Client search parameter constant for value-concept + *

+ * Description: The value of the observation, if the value is a CodeableConcept
+ * Type: token
+ * Path: Observation.valueCodeableConcept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VALUE_CONCEPT); + + /** + * Search parameter: code + *

+ * Description: The code of the observation type
+ * Type: token
+ * Path: Observation.code
+ *

+ */ + @SearchParamDefinition(name="code", path="Observation.code", description="The code of the observation type", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: The code of the observation type
+ * Type: token
+ * Path: Observation.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: related-target + *

+ * Description: Resource that is related to this one
+ * Type: reference
+ * Path: Observation.related.target
+ *

+ */ + @SearchParamDefinition(name="related-target", path="Observation.related.target", description="Resource that is related to this one", type="reference" ) + public static final String SP_RELATED_TARGET = "related-target"; + /** + * Fluent Client search parameter constant for related-target + *

+ * Description: Resource that is related to this one
+ * Type: reference
+ * Path: Observation.related.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATED_TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATED_TARGET); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Observation:related-target". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATED_TARGET = new ca.uhn.fhir.model.api.Include("Observation:related-target").toLocked(); + + /** + * Search parameter: data-absent-reason + *

+ * Description: The reason why the expected value in the element Observation.value[x] is missing.
+ * Type: token
+ * Path: Observation.dataAbsentReason
+ *

+ */ + @SearchParamDefinition(name="data-absent-reason", path="Observation.dataAbsentReason", description="The reason why the expected value in the element Observation.value[x] is missing.", type="token" ) + public static final String SP_DATA_ABSENT_REASON = "data-absent-reason"; + /** + * Fluent Client search parameter constant for data-absent-reason + *

+ * Description: The reason why the expected value in the element Observation.value[x] is missing.
+ * Type: token
+ * Path: Observation.dataAbsentReason
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam DATA_ABSENT_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DATA_ABSENT_REASON); + + /** + * Search parameter: category + *

+ * Description: The classification of the type of observation
+ * Type: token
+ * Path: Observation.category
+ *

+ */ + @SearchParamDefinition(name="category", path="Observation.category", description="The classification of the type of observation", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: The classification of the type of observation
+ * Type: token
+ * Path: Observation.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: component-data-absent-reason + *

+ * Description: The reason why the expected value in the element Observation.component.value[x] is missing.
+ * Type: token
+ * Path: Observation.component.dataAbsentReason
+ *

+ */ + @SearchParamDefinition(name="component-data-absent-reason", path="Observation.component.dataAbsentReason", description="The reason why the expected value in the element Observation.component.value[x] is missing.", type="token" ) + public static final String SP_COMPONENT_DATA_ABSENT_REASON = "component-data-absent-reason"; + /** + * Fluent Client search parameter constant for component-data-absent-reason + *

+ * Description: The reason why the expected value in the element Observation.component.value[x] is missing.
+ * Type: token
+ * Path: Observation.component.dataAbsentReason
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_DATA_ABSENT_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_DATA_ABSENT_REASON); + + /** + * Search parameter: device + *

+ * Description: The Device that generated the observation data.
+ * Type: reference
+ * Path: Observation.device
+ *

+ */ + @SearchParamDefinition(name="device", path="Observation.device", description="The Device that generated the observation data.", type="reference" ) + public static final String SP_DEVICE = "device"; + /** + * Fluent Client search parameter constant for device + *

+ * Description: The Device that generated the observation data.
+ * Type: reference
+ * Path: Observation.device
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Observation:device". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("Observation:device").toLocked(); + + /** + * Search parameter: related-type + *

+ * Description: has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by
+ * Type: token
+ * Path: Observation.related.type
+ *

+ */ + @SearchParamDefinition(name="related-type", path="Observation.related.type", description="has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", type="token" ) + public static final String SP_RELATED_TYPE = "related-type"; + /** + * Fluent Client search parameter constant for related-type + *

+ * Description: has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by
+ * Type: token
+ * Path: Observation.related.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATED_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATED_TYPE); + + /** + * Search parameter: performer + *

+ * Description: Who performed the observation
+ * Type: reference
+ * Path: Observation.performer
+ *

+ */ + @SearchParamDefinition(name="performer", path="Observation.performer", description="Who performed the observation", type="reference" ) + public static final String SP_PERFORMER = "performer"; + /** + * Fluent Client search parameter constant for performer + *

+ * Description: Who performed the observation
+ * Type: reference
+ * Path: Observation.performer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Observation:performer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Observation:performer").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The unique id for a particular observation
+ * Type: token
+ * Path: Observation.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Observation.identifier", description="The unique id for a particular observation", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The unique id for a particular observation
+ * Type: token
+ * Path: Observation.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: code-value-quantity + *

+ * Description: Both code and one of the value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="code-value-quantity", path="", description="Both code and one of the value parameters", type="composite", compositeOf={"code", "value-quantity"} ) + public static final String SP_CODE_VALUE_QUANTITY = "code-value-quantity"; + /** + * Fluent Client search parameter constant for code-value-quantity + *

+ * Description: Both code and one of the value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_QUANTITY); + + /** + * Search parameter: code-value-date + *

+ * Description: Both code and one of the value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="code-value-date", path="", description="Both code and one of the value parameters", type="composite", compositeOf={"code", "value-date"} ) + public static final String SP_CODE_VALUE_DATE = "code-value-date"; + /** + * Fluent Client search parameter constant for code-value-date + *

+ * Description: Both code and one of the value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_DATE); + + /** + * Search parameter: code-value-string + *

+ * Description: Both code and one of the value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="code-value-string", path="", description="Both code and one of the value parameters", type="composite", compositeOf={"code", "value-string"} ) + public static final String SP_CODE_VALUE_STRING = "code-value-string"; + /** + * Fluent Client search parameter constant for code-value-string + *

+ * Description: Both code and one of the value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_STRING = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_STRING); + + /** + * Search parameter: code-value-concept + *

+ * Description: Both code and one of the value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="code-value-concept", path="", description="Both code and one of the value parameters", type="composite", compositeOf={"code", "value-concept"} ) + public static final String SP_CODE_VALUE_CONCEPT = "code-value-concept"; + /** + * Fluent Client search parameter constant for code-value-concept + *

+ * Description: Both code and one of the value parameters
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_CONCEPT); + + /** + * Search parameter: component-value-string + *

+ * Description: The value of the component observation, if the value is a string, and also searches in CodeableConcept.text
+ * Type: string
+ * Path: Observation.component.valueString
+ *

+ */ + @SearchParamDefinition(name="component-value-string", path="Observation.component.value.as(String)", description="The value of the component observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) + public static final String SP_COMPONENT_VALUE_STRING = "component-value-string"; + /** + * Fluent Client search parameter constant for component-value-string + *

+ * Description: The value of the component observation, if the value is a string, and also searches in CodeableConcept.text
+ * Type: string
+ * Path: Observation.component.valueString
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam COMPONENT_VALUE_STRING = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_COMPONENT_VALUE_STRING); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OidType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OidType.java new file mode 100644 index 00000000000..89fdda65a98 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OidType.java @@ -0,0 +1,75 @@ +/* +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. + + */ +package org.hl7.fhir.dstu2016may.model; + +import java.net.URI; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "oid" in FHIR: an OID represented as urn:oid:0.1.2.3.4... + */ +@DatatypeDef(name="oid", profileOf=UriType.class) +public class OidType extends UriType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public OidType() { + super(); + } + + /** + * Constructor + */ + public OidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public OidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public OidType copy() { + return new OidType(getValue()); + } + + public String fhirType() { + return "oid"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OperationDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OperationDefinition.java new file mode 100644 index 00000000000..175e2992bc0 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OperationDefinition.java @@ -0,0 +1,3169 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength; +import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrengthEnumFactory; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType; +import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + */ +@ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition") +public class OperationDefinition extends DomainResource { + + public enum OperationKind { + /** + * This operation is invoked as an operation. + */ + OPERATION, + /** + * This operation is a named query, invoked using the search mechanism. + */ + QUERY, + /** + * added to help the parsers + */ + NULL; + public static OperationKind fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("operation".equals(codeString)) + return OPERATION; + if ("query".equals(codeString)) + return QUERY; + throw new FHIRException("Unknown OperationKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OPERATION: return "operation"; + case QUERY: return "query"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OPERATION: return "http://hl7.org/fhir/operation-kind"; + case QUERY: return "http://hl7.org/fhir/operation-kind"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OPERATION: return "This operation is invoked as an operation."; + case QUERY: return "This operation is a named query, invoked using the search mechanism."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OPERATION: return "Operation"; + case QUERY: return "Query"; + default: return "?"; + } + } + } + + 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; + if ("operation".equals(codeString)) + return OperationKind.OPERATION; + if ("query".equals(codeString)) + return OperationKind.QUERY; + throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("operation".equals(codeString)) + return new Enumeration(this, OperationKind.OPERATION); + if ("query".equals(codeString)) + return new Enumeration(this, OperationKind.QUERY); + throw new FHIRException("Unknown OperationKind code '"+codeString+"'"); + } + public String toCode(OperationKind code) { + if (code == OperationKind.OPERATION) + return "operation"; + if (code == OperationKind.QUERY) + return "query"; + return "?"; + } + public String toSystem(OperationKind code) { + return code.getSystem(); + } + } + + public enum OperationParameterUse { + /** + * This is an input parameter. + */ + IN, + /** + * This is an output parameter. + */ + OUT, + /** + * added to help the parsers + */ + NULL; + public static OperationParameterUse fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in".equals(codeString)) + return IN; + if ("out".equals(codeString)) + return OUT; + throw new FHIRException("Unknown OperationParameterUse code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case IN: return "in"; + case OUT: return "out"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case IN: return "http://hl7.org/fhir/operation-parameter-use"; + case OUT: return "http://hl7.org/fhir/operation-parameter-use"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case IN: return "This is an input parameter."; + case OUT: return "This is an output parameter."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case IN: return "In"; + case OUT: return "Out"; + default: return "?"; + } + } + } + + 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; + if ("in".equals(codeString)) + return OperationParameterUse.IN; + if ("out".equals(codeString)) + return OperationParameterUse.OUT; + throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("in".equals(codeString)) + return new Enumeration(this, OperationParameterUse.IN); + if ("out".equals(codeString)) + return new Enumeration(this, OperationParameterUse.OUT); + throw new FHIRException("Unknown OperationParameterUse code '"+codeString+"'"); + } + public String toCode(OperationParameterUse code) { + if (code == OperationParameterUse.IN) + return "in"; + if (code == OperationParameterUse.OUT) + return "out"; + return "?"; + } + public String toSystem(OperationParameterUse code) { + return code.getSystem(); + } + } + + @Block() + public static class OperationDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the operation definition. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the operation definition." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public OperationDefinitionContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding 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 OperationDefinitionContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public OperationDefinitionContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the operation definition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the operation definition. + */ + public OperationDefinitionContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public OperationDefinitionContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the operation definition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public OperationDefinitionContactComponent copy() { + OperationDefinitionContactComponent dst = new OperationDefinitionContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationDefinitionContactComponent)) + return false; + OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationDefinitionContactComponent)) + return false; + OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "OperationDefinition.contact"; + + } + + } + + @Block() + public static class OperationDefinitionParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of used to identify the parameter. + */ + @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name in Parameters.parameter.name or in URL", formalDefinition="The name of used to identify the parameter." ) + protected CodeType name; + + /** + * Whether this is an input or an output parameter. + */ + @Child(name = "use", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="in | out", formalDefinition="Whether this is an input or an output parameter." ) + protected Enumeration use; + + /** + * The minimum number of times this parameter SHALL appear in the request or response. + */ + @Child(name = "min", type = {IntegerType.class}, order=3, min=1, max=1, modifier=false, summary=false) + @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=4, min=1, max=1, modifier=false, summary=false) + @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=5, min=0, max=1, modifier=false, summary=false) + @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=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="What type this parameter has", formalDefinition="The type for this parameter." ) + protected CodeType type; + + /** + * How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. + */ + @Child(name = "searchType", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'." ) + protected Enumeration searchType; + + /** + * A profile the specifies the rules that this parameter must conform to. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=8, min=0, max=1, modifier=false, summary=false) + @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 StructureDefinition profileTarget; + + /** + * Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). + */ + @Child(name = "binding", type = {}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this parameter is coded (code, Coding, CodeableConcept)." ) + protected OperationDefinitionParameterBindingComponent binding; + + /** + * The parts of a Tuple Parameter. + */ + @Child(name = "part", type = {OperationDefinitionParameterComponent.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Parts of a Tuple Parameter", formalDefinition="The parts of a Tuple Parameter." ) + protected List part; + + private static final long serialVersionUID = -885506257L; + + /** + * Constructor + */ + public OperationDefinitionParameterComponent() { + super(); + } + + /** + * Constructor + */ + public OperationDefinitionParameterComponent(CodeType name, Enumeration use, IntegerType min, StringType max) { + super(); + this.name = name; + this.use = use; + this.min = min; + this.max = max; + } + + /** + * @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 OperationDefinitionParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeType(); // bb + 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent setName(String value) { + if (this.name == null) + this.name = new CodeType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #use} (Whether this is an input or an output parameter.). 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 OperationDefinitionParameterComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(new OperationParameterUseEnumFactory()); // bb + 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} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public OperationDefinitionParameterComponent setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Whether this is an input or an output parameter. + */ + public OperationParameterUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Whether this is an input or an output parameter. + */ + public OperationDefinitionParameterComponent setUse(OperationParameterUse value) { + if (this.use == null) + this.use = new Enumeration(new OperationParameterUseEnumFactory()); + this.use.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 OperationDefinitionParameterComponent.min"); + else if (Configuration.doAutoCreate()) + this.min = new IntegerType(); // bb + 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 OperationDefinitionParameterComponent 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 || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value The minimum number of times this parameter SHALL appear in the request or response. + */ + public OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 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 #searchType} (How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.). This is the underlying object with id, value and extensions. The accessor "getSearchType" gives direct access to the value + */ + public Enumeration getSearchTypeElement() { + if (this.searchType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.searchType"); + else if (Configuration.doAutoCreate()) + this.searchType = new Enumeration(new SearchParamTypeEnumFactory()); // bb + return this.searchType; + } + + public boolean hasSearchTypeElement() { + return this.searchType != null && !this.searchType.isEmpty(); + } + + public boolean hasSearchType() { + return this.searchType != null && !this.searchType.isEmpty(); + } + + /** + * @param value {@link #searchType} (How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.). This is the underlying object with id, value and extensions. The accessor "getSearchType" gives direct access to the value + */ + public OperationDefinitionParameterComponent setSearchTypeElement(Enumeration value) { + this.searchType = value; + return this; + } + + /** + * @return How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. + */ + public SearchParamType getSearchType() { + return this.searchType == null ? null : this.searchType.getValue(); + } + + /** + * @param value How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. + */ + public OperationDefinitionParameterComponent setSearchType(SearchParamType value) { + if (value == null) + this.searchType = null; + else { + if (this.searchType == null) + this.searchType = new Enumeration(new SearchParamTypeEnumFactory()); + this.searchType.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 OperationDefinitionParameterComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + 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 OperationDefinitionParameterComponent 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 StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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 OperationDefinitionParameterComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #binding} (Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).) + */ + public OperationDefinitionParameterBindingComponent getBinding() { + if (this.binding == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.binding"); + else if (Configuration.doAutoCreate()) + this.binding = new OperationDefinitionParameterBindingComponent(); // cc + return this.binding; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).) + */ + public OperationDefinitionParameterComponent setBinding(OperationDefinitionParameterBindingComponent value) { + this.binding = value; + 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 (OperationDefinitionParameterComponent item : this.part) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #part} (The parts of a Tuple Parameter.) + */ + // syntactic sugar + public OperationDefinitionParameterComponent addPart() { //3 + OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent(); + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return t; + } + + // syntactic sugar + public OperationDefinitionParameterComponent addPart(OperationDefinitionParameterComponent t) { //3 + if (t == null) + return this; + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + 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("use", "code", "Whether this is an input or an output parameter.", 0, java.lang.Integer.MAX_VALUE, use)); + 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("searchType", "code", "How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.", 0, java.lang.Integer.MAX_VALUE, searchType)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("binding", "", "Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, binding)); + childrenList.add(new Property("part", "@OperationDefinition.parameter", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // CodeType + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration + case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType + case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case -710454014: /*searchType*/ return this.searchType == null ? new Base[0] : new Base[] {this.searchType}; // Enumeration + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // OperationDefinitionParameterBindingComponent + case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // OperationDefinitionParameterComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToCode(value); // CodeType + break; + case 116103: // use + this.use = new OperationParameterUseEnumFactory().fromType(value); // Enumeration + break; + case 108114: // min + this.min = castToInteger(value); // IntegerType + break; + case 107876: // max + this.max = castToString(value); // StringType + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case -710454014: // searchType + this.searchType = new SearchParamTypeEnumFactory().fromType(value); // Enumeration + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + case -108220795: // binding + this.binding = (OperationDefinitionParameterBindingComponent) value; // OperationDefinitionParameterBindingComponent + break; + case 3433459: // part + this.getPart().add((OperationDefinitionParameterComponent) value); // OperationDefinitionParameterComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToCode(value); // CodeType + else if (name.equals("use")) + this.use = new OperationParameterUseEnumFactory().fromType(value); // Enumeration + else if (name.equals("min")) + this.min = castToInteger(value); // IntegerType + else if (name.equals("max")) + this.max = castToString(value); // StringType + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("searchType")) + this.searchType = new SearchParamTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else if (name.equals("binding")) + this.binding = (OperationDefinitionParameterBindingComponent) value; // OperationDefinitionParameterBindingComponent + else if (name.equals("part")) + this.getPart().add((OperationDefinitionParameterComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // CodeType + case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration + case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType + case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case -710454014: throw new FHIRException("Cannot make property searchType as it is not a complex type"); // Enumeration + case -309425751: return getProfile(); // Reference + case -108220795: return getBinding(); // OperationDefinitionParameterBindingComponent + case 3433459: return addPart(); // OperationDefinitionParameterComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name"); + } + else if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.use"); + } + else if (name.equals("min")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.min"); + } + else if (name.equals("max")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.max"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.documentation"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.type"); + } + else if (name.equals("searchType")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.searchType"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else if (name.equals("binding")) { + this.binding = new OperationDefinitionParameterBindingComponent(); + return this.binding; + } + else if (name.equals("part")) { + return addPart(); + } + else + return super.addChild(name); + } + + public OperationDefinitionParameterComponent copy() { + OperationDefinitionParameterComponent dst = new OperationDefinitionParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.use = use == null ? null : use.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.searchType = searchType == null ? null : searchType.copy(); + dst.profile = profile == null ? null : profile.copy(); + dst.binding = binding == null ? null : binding.copy(); + if (part != null) { + dst.part = new ArrayList(); + for (OperationDefinitionParameterComponent i : part) + dst.part.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationDefinitionParameterComponent)) + return false; + OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other; + return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true) + && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) + && compareDeep(searchType, o.searchType, true) && compareDeep(profile, o.profile, true) && compareDeep(binding, o.binding, true) + && compareDeep(part, o.part, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationDefinitionParameterComponent)) + return false; + OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other; + return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true) + && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true) + && compareValues(searchType, o.searchType, true); + } + + 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()) && (searchType == null || searchType.isEmpty()) && (profile == null || profile.isEmpty()) + && (binding == null || binding.isEmpty()) && (part == null || part.isEmpty()); + } + + public String fhirType() { + return "OperationDefinition.parameter"; + + } + + } + + @Block() + public static class OperationDefinitionParameterBindingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + @Child(name = "strength", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="required | extensible | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances." ) + protected Enumeration strength; + + /** + * Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. + */ + @Child(name = "valueSet", type = {UriType.class, ValueSet.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used." ) + protected Type valueSet; + + private static final long serialVersionUID = 857140521L; + + /** + * Constructor + */ + public OperationDefinitionParameterBindingComponent() { + super(); + } + + /** + * Constructor + */ + public OperationDefinitionParameterBindingComponent(Enumeration strength, Type valueSet) { + super(); + this.strength = strength; + this.valueSet = valueSet; + } + + /** + * @return {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value + */ + public Enumeration getStrengthElement() { + if (this.strength == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterBindingComponent.strength"); + else if (Configuration.doAutoCreate()) + this.strength = new Enumeration(new BindingStrengthEnumFactory()); // bb + return this.strength; + } + + public boolean hasStrengthElement() { + return this.strength != null && !this.strength.isEmpty(); + } + + public boolean hasStrength() { + return this.strength != null && !this.strength.isEmpty(); + } + + /** + * @param value {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value + */ + public OperationDefinitionParameterBindingComponent setStrengthElement(Enumeration value) { + this.strength = value; + return this; + } + + /** + * @return Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + public BindingStrength getStrength() { + return this.strength == null ? null : this.strength.getValue(); + } + + /** + * @param value Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + */ + public OperationDefinitionParameterBindingComponent setStrength(BindingStrength value) { + if (this.strength == null) + this.strength = new Enumeration(new BindingStrengthEnumFactory()); + this.strength.setValue(value); + return this; + } + + /** + * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public Type getValueSet() { + return this.valueSet; + } + + /** + * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public UriType getValueSetUriType() throws FHIRException { + if (!(this.valueSet instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (UriType) this.valueSet; + } + + public boolean hasValueSetUriType() { + return this.valueSet instanceof UriType; + } + + /** + * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public Reference getValueSetReference() throws FHIRException { + if (!(this.valueSet instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); + return (Reference) this.valueSet; + } + + public boolean hasValueSetReference() { + return this.valueSet instanceof Reference; + } + + public boolean hasValueSet() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + /** + * @param value {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) + */ + public OperationDefinitionParameterBindingComponent setValueSet(Type value) { + this.valueSet = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("strength", "code", "Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.", 0, java.lang.Integer.MAX_VALUE, strength)); + childrenList.add(new Property("valueSet[x]", "uri|Reference(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Enumeration + case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1791316033: // strength + this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration + break; + case -1410174671: // valueSet + this.valueSet = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("strength")) + this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration + else if (name.equals("valueSet[x]")) + this.valueSet = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1791316033: throw new FHIRException("Cannot make property strength as it is not a complex type"); // Enumeration + case -1438410321: return getValueSet(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("strength")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.strength"); + } + else if (name.equals("valueSetUri")) { + this.valueSet = new UriType(); + return this.valueSet; + } + else if (name.equals("valueSetReference")) { + this.valueSet = new Reference(); + return this.valueSet; + } + else + return super.addChild(name); + } + + public OperationDefinitionParameterBindingComponent copy() { + OperationDefinitionParameterBindingComponent dst = new OperationDefinitionParameterBindingComponent(); + copyValues(dst); + dst.strength = strength == null ? null : strength.copy(); + dst.valueSet = valueSet == null ? null : valueSet.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationDefinitionParameterBindingComponent)) + return false; + OperationDefinitionParameterBindingComponent o = (OperationDefinitionParameterBindingComponent) other; + return compareDeep(strength, o.strength, true) && compareDeep(valueSet, o.valueSet, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationDefinitionParameterBindingComponent)) + return false; + OperationDefinitionParameterBindingComponent o = (OperationDefinitionParameterBindingComponent) other; + return compareValues(strength, o.strength, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (strength == null || strength.isEmpty()) && (valueSet == null || valueSet.isEmpty()) + ; + } + + public String fhirType() { + return "OperationDefinition.parameter.binding"; + + } + + } + + /** + * An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Logical URL to reference this operation definition", formalDefinition="An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published." ) + protected UriType url; + + /** + * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Logical id for this version of the operation definition", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name identifying the operation. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Informal name for this operation", formalDefinition="A free text natural language name identifying the operation." ) + protected StringType name; + + /** + * The status of the profile. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." ) + protected Enumeration status; + + /** + * Whether this is an operation or a named query. + */ + @Child(name = "kind", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="operation | query", formalDefinition="Whether this is an operation or a named query." ) + protected Enumeration kind; + + /** + * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Date for this version of the operation definition", formalDefinition="The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes." ) + protected DateTimeType date; + + /** + * The name of the individual or organization that published the operation definition. + */ + @Child(name = "publisher", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the operation definition." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * A free text natural language description of the profile and its use. + */ + @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Natural language description of the operation", formalDefinition="A free text natural language description of the profile and its use." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions." ) + protected List useContext; + + /** + * Explains why this operation definition is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why this resource has been created", formalDefinition="Explains why this operation definition is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. + */ + @Child(name = "idempotent", type = {BooleanType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether content is unchanged by the operation", formalDefinition="Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST." ) + protected BooleanType idempotent; + + /** + * The name used to invoke the operation. + */ + @Child(name = "code", type = {CodeType.class}, order=13, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name used to invoke the operation", formalDefinition="The name used to invoke the operation." ) + protected CodeType code; + + /** + * Additional information about how to use this operation or named query. + */ + @Child(name = "comment", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Additional information about use", formalDefinition="Additional information about how to use this operation or named query." ) + protected StringType comment; + + /** + * Indicates that this operation definition is a constraining profile on the base. + */ + @Child(name = "base", type = {OperationDefinition.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Marks this as a profile of the base", formalDefinition="Indicates that this operation definition is a constraining profile on the base." ) + protected Reference base; + + /** + * The actual object that is the target of the reference (Indicates that this operation definition is a constraining profile on the base.) + */ + protected OperationDefinition baseTarget; + + /** + * 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). + */ + @Child(name = "system", type = {BooleanType.class}, order=16, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Invoke at the system level?", formalDefinition="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)." ) + protected BooleanType system; + + /** + * 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). + */ + @Child(name = "type", type = {CodeType.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Invoke at resource level for these type", formalDefinition="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)." ) + protected List type; + + /** + * Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + @Child(name = "instance", type = {BooleanType.class}, order=18, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Invoke on an instance?", formalDefinition="Indicates whether this operation can be invoked on a particular instance of one of the given types." ) + protected BooleanType instance; + + /** + * The parameters for the operation/query. + */ + @Child(name = "parameter", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Parameters for the operation/query", formalDefinition="The parameters for the operation/query." ) + protected List parameter; + + private static final long serialVersionUID = 1780846105L; + + /** + * Constructor + */ + public OperationDefinition() { + super(); + } + + /** + * Constructor + */ + public OperationDefinition(StringType name, Enumeration status, Enumeration kind, CodeType code, BooleanType system, BooleanType instance) { + super(); + this.name = name; + this.status = status; + this.kind = kind; + this.code = code; + this.system = system; + this.instance = instance; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public OperationDefinition setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published. + */ + public OperationDefinition setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public OperationDefinition setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public OperationDefinition setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the operation.). 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 OperationDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name identifying the operation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public OperationDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the operation. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the operation. + */ + public OperationDefinition setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of the profile.). 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 OperationDefinition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public OperationDefinition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the profile. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the profile. + */ + public OperationDefinition setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #kind} (Whether this is an operation or a named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new OperationKindEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Whether this is an operation or a named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public OperationDefinition setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return Whether this is an operation or a named query. + */ + public OperationKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value Whether this is an operation or a named query. + */ + public OperationDefinition setKind(OperationKind value) { + if (this.kind == null) + this.kind = new Enumeration(new OperationKindEnumFactory()); + this.kind.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public OperationDefinition setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public OperationDefinition setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.). 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 OperationDefinition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public OperationDefinition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes. + */ + public OperationDefinition setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the operation definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the operation definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public OperationDefinition setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the operation definition. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the operation definition. + */ + public OperationDefinition setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (OperationDefinitionContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public OperationDefinitionContactComponent addContact() { //3 + OperationDefinitionContactComponent t = new OperationDefinitionContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public OperationDefinition addContact(OperationDefinitionContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the profile and its use.). 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 OperationDefinition.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public OperationDefinition setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the profile and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the profile and its use. + */ + public OperationDefinition 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public OperationDefinition addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public OperationDefinition setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this operation definition is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this operation definition is needed and why it's been constrained as it has. + */ + public OperationDefinition setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #idempotent} (Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.). This is the underlying object with id, value and extensions. The accessor "getIdempotent" gives direct access to the value + */ + public BooleanType getIdempotentElement() { + if (this.idempotent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.idempotent"); + else if (Configuration.doAutoCreate()) + this.idempotent = new BooleanType(); // bb + return this.idempotent; + } + + public boolean hasIdempotentElement() { + return this.idempotent != null && !this.idempotent.isEmpty(); + } + + public boolean hasIdempotent() { + return this.idempotent != null && !this.idempotent.isEmpty(); + } + + /** + * @param value {@link #idempotent} (Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.). This is the underlying object with id, value and extensions. The accessor "getIdempotent" gives direct access to the value + */ + public OperationDefinition setIdempotentElement(BooleanType value) { + this.idempotent = value; + return this; + } + + /** + * @return Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. + */ + public boolean getIdempotent() { + return this.idempotent == null || this.idempotent.isEmpty() ? false : this.idempotent.getValue(); + } + + /** + * @param value Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. + */ + public OperationDefinition setIdempotent(boolean value) { + if (this.idempotent == null) + this.idempotent = new BooleanType(); + this.idempotent.setValue(value); + return this; + } + + /** + * @return {@link #code} (The name used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The name used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public OperationDefinition setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return The name used to invoke the operation. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The name used to invoke the operation. + */ + public OperationDefinition setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #comment} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public OperationDefinition setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional information about how to use this operation or named query. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional information about how to use this operation or named query. + */ + public OperationDefinition setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #base} (Indicates that this operation definition is a constraining profile on the base.) + */ + public Reference getBase() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.base"); + else if (Configuration.doAutoCreate()) + this.base = new Reference(); // cc + return this.base; + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition setBase(Reference value) { + this.base = value; + return this; + } + + /** + * @return {@link #base} 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. (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition getBaseTarget() { + if (this.baseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.base"); + else if (Configuration.doAutoCreate()) + this.baseTarget = new OperationDefinition(); // aa + return this.baseTarget; + } + + /** + * @param value {@link #base} 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. (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition setBaseTarget(OperationDefinition value) { + this.baseTarget = value; + return this; + } + + /** + * @return {@link #system} (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).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public BooleanType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.system"); + else if (Configuration.doAutoCreate()) + this.system = new BooleanType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (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).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public OperationDefinition setSystemElement(BooleanType value) { + this.system = value; + return this; + } + + /** + * @return 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). + */ + public boolean getSystem() { + return this.system == null || this.system.isEmpty() ? false : this.system.getValue(); + } + + /** + * @param value 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). + */ + public OperationDefinition setSystem(boolean value) { + if (this.system == null) + this.system = new BooleanType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #type} (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).) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeType item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (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).) + */ + // syntactic sugar + public CodeType addTypeElement() {//2 + CodeType t = new CodeType(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @param value {@link #type} (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).) + */ + public OperationDefinition addType(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @param value {@link #type} (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).) + */ + public boolean hasType(String value) { + if (this.type == null) + return false; + for (CodeType v : this.type) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value + */ + public BooleanType getInstanceElement() { + if (this.instance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.instance"); + else if (Configuration.doAutoCreate()) + this.instance = new BooleanType(); // bb + return this.instance; + } + + public boolean hasInstanceElement() { + return this.instance != null && !this.instance.isEmpty(); + } + + public boolean hasInstance() { + return this.instance != null && !this.instance.isEmpty(); + } + + /** + * @param value {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value + */ + public OperationDefinition setInstanceElement(BooleanType value) { + this.instance = value; + return this; + } + + /** + * @return Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + public boolean getInstance() { + return this.instance == null || this.instance.isEmpty() ? false : this.instance.getValue(); + } + + /** + * @param value Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + public OperationDefinition setInstance(boolean value) { + if (this.instance == null) + this.instance = new BooleanType(); + this.instance.setValue(value); + return this; + } + + /** + * @return {@link #parameter} (The parameters for the operation/query.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (OperationDefinitionParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (The parameters for the operation/query.) + */ + // syntactic sugar + public OperationDefinitionParameterComponent addParameter() { //3 + OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public OperationDefinition addParameter(OperationDefinitionParameterComponent t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the operation.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("kind", "code", "Whether this is an operation or a named query.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("experimental", "boolean", "This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the operation definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("requirements", "string", "Explains why this operation definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("idempotent", "boolean", "Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.", 0, java.lang.Integer.MAX_VALUE, idempotent)); + childrenList.add(new Property("code", "code", "The name used to invoke the operation.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("comment", "string", "Additional information about how to use this operation or named query.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("base", "Reference(OperationDefinition)", "Indicates that this operation definition is a constraining profile on the base.", 0, java.lang.Integer.MAX_VALUE, base)); + 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", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // OperationDefinitionContactComponent + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1680468793: /*idempotent*/ return this.idempotent == null ? new Base[0] : new Base[] {this.idempotent}; // BooleanType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // Reference + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // BooleanType + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeType + case 555127957: /*instance*/ return this.instance == null ? new Base[0] : new Base[] {this.instance}; // BooleanType + case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // OperationDefinitionParameterComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case 3292052: // kind + this.kind = new OperationKindEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((OperationDefinitionContactComponent) value); // OperationDefinitionContactComponent + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1680468793: // idempotent + this.idempotent = castToBoolean(value); // BooleanType + break; + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + case 3016401: // base + this.base = castToReference(value); // Reference + break; + case -887328209: // system + this.system = castToBoolean(value); // BooleanType + break; + case 3575610: // type + this.getType().add(castToCode(value)); // CodeType + break; + case 555127957: // instance + this.instance = castToBoolean(value); // BooleanType + break; + case 1954460585: // parameter + this.getParameter().add((OperationDefinitionParameterComponent) value); // OperationDefinitionParameterComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("kind")) + this.kind = new OperationKindEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((OperationDefinitionContactComponent) value); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("idempotent")) + this.idempotent = castToBoolean(value); // BooleanType + else if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else if (name.equals("base")) + this.base = castToReference(value); // Reference + else if (name.equals("system")) + this.system = castToBoolean(value); // BooleanType + else if (name.equals("type")) + this.getType().add(castToCode(value)); + else if (name.equals("instance")) + this.instance = castToBoolean(value); // BooleanType + else if (name.equals("parameter")) + this.getParameter().add((OperationDefinitionParameterComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // OperationDefinitionContactComponent + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1680468793: throw new FHIRException("Cannot make property idempotent as it is not a complex type"); // BooleanType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + case 3016401: return getBase(); // Reference + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // BooleanType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case 555127957: throw new FHIRException("Cannot make property instance as it is not a complex type"); // BooleanType + case 1954460585: return addParameter(); // OperationDefinitionParameterComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.url"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.status"); + } + else if (name.equals("kind")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.kind"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.experimental"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.date"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.requirements"); + } + else if (name.equals("idempotent")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.idempotent"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.code"); + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.comment"); + } + else if (name.equals("base")) { + this.base = new Reference(); + return this.base; + } + else if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.system"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.type"); + } + else if (name.equals("instance")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.instance"); + } + else if (name.equals("parameter")) { + return addParameter(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "OperationDefinition"; + + } + + public OperationDefinition copy() { + OperationDefinition dst = new OperationDefinition(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.kind = kind == null ? null : kind.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (OperationDefinitionContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.idempotent = idempotent == null ? null : idempotent.copy(); + dst.code = code == null ? null : code.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.base = base == null ? null : base.copy(); + dst.system = system == null ? null : system.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (CodeType i : type) + dst.type.add(i.copy()); + }; + dst.instance = instance == null ? null : instance.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (OperationDefinitionParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + return dst; + } + + protected OperationDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationDefinition)) + return false; + OperationDefinition o = (OperationDefinition) other; + return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) + && compareDeep(status, o.status, true) && compareDeep(kind, o.kind, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) + && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(idempotent, o.idempotent, true) + && compareDeep(code, o.code, true) && compareDeep(comment, o.comment, true) && compareDeep(base, o.base, true) + && compareDeep(system, o.system, true) && compareDeep(type, o.type, true) && compareDeep(instance, o.instance, true) + && compareDeep(parameter, o.parameter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationDefinition)) + return false; + OperationDefinition o = (OperationDefinition) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(kind, o.kind, true) && compareValues(experimental, o.experimental, true) + && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) + && compareValues(requirements, o.requirements, true) && compareValues(idempotent, o.idempotent, true) + && compareValues(code, o.code, true) && compareValues(comment, o.comment, true) && compareValues(system, o.system, true) + && compareValues(type, o.type, true) && compareValues(instance, o.instance, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (kind == null || kind.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (description == null || description.isEmpty()) + && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (idempotent == null || idempotent.isEmpty()) && (code == null || code.isEmpty()) && (comment == null || comment.isEmpty()) + && (base == null || base.isEmpty()) && (system == null || system.isEmpty()) && (type == null || type.isEmpty()) + && (instance == null || instance.isEmpty()) && (parameter == null || parameter.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OperationDefinition; + } + + /** + * Search parameter: status + *

+ * Description: draft | active | retired
+ * Type: token
+ * Path: OperationDefinition.status
+ *

+ */ + @SearchParamDefinition(name="status", path="OperationDefinition.status", description="draft | active | retired", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: draft | active | retired
+ * Type: token
+ * Path: OperationDefinition.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: paramprofile + *

+ * Description: Profile on the type
+ * Type: reference
+ * Path: OperationDefinition.parameter.profile
+ *

+ */ + @SearchParamDefinition(name="paramprofile", path="OperationDefinition.parameter.profile", description="Profile on the type", type="reference" ) + public static final String SP_PARAMPROFILE = "paramprofile"; + /** + * Fluent Client search parameter constant for paramprofile + *

+ * Description: Profile on the type
+ * Type: reference
+ * Path: OperationDefinition.parameter.profile
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARAMPROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARAMPROFILE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "OperationDefinition:paramprofile". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARAMPROFILE = new ca.uhn.fhir.model.api.Include("OperationDefinition:paramprofile").toLocked(); + + /** + * Search parameter: code + *

+ * Description: Name used to invoke the operation
+ * Type: token
+ * Path: OperationDefinition.code
+ *

+ */ + @SearchParamDefinition(name="code", path="OperationDefinition.code", description="Name used to invoke the operation", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Name used to invoke the operation
+ * Type: token
+ * Path: OperationDefinition.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: Date for this version of the operation definition
+ * Type: date
+ * Path: OperationDefinition.date
+ *

+ */ + @SearchParamDefinition(name="date", path="OperationDefinition.date", description="Date for this version of the operation definition", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Date for this version of the operation definition
+ * Type: date
+ * Path: OperationDefinition.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: type + *

+ * Description: Invoke at resource level for these type
+ * Type: token
+ * Path: OperationDefinition.type
+ *

+ */ + @SearchParamDefinition(name="type", path="OperationDefinition.type", description="Invoke at resource level for these type", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Invoke at resource level for these type
+ * Type: token
+ * Path: OperationDefinition.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: url + *

+ * Description: Logical URL to reference this operation definition
+ * Type: uri
+ * Path: OperationDefinition.url
+ *

+ */ + @SearchParamDefinition(name="url", path="OperationDefinition.url", description="Logical URL to reference this operation definition", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: Logical URL to reference this operation definition
+ * Type: uri
+ * Path: OperationDefinition.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: kind + *

+ * Description: operation | query
+ * Type: token
+ * Path: OperationDefinition.kind
+ *

+ */ + @SearchParamDefinition(name="kind", path="OperationDefinition.kind", description="operation | query", type="token" ) + public static final String SP_KIND = "kind"; + /** + * Fluent Client search parameter constant for kind + *

+ * Description: operation | query
+ * Type: token
+ * Path: OperationDefinition.kind
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND); + + /** + * Search parameter: version + *

+ * Description: Logical id for this version of the operation definition
+ * Type: token
+ * Path: OperationDefinition.version
+ *

+ */ + @SearchParamDefinition(name="version", path="OperationDefinition.version", description="Logical id for this version of the operation definition", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: Logical id for this version of the operation definition
+ * Type: token
+ * Path: OperationDefinition.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher (Organization or individual)
+ * Type: string
+ * Path: OperationDefinition.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="OperationDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher (Organization or individual)
+ * Type: string
+ * Path: OperationDefinition.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: system + *

+ * Description: Invoke at the system level?
+ * Type: token
+ * Path: OperationDefinition.system
+ *

+ */ + @SearchParamDefinition(name="system", path="OperationDefinition.system", description="Invoke at the system level?", type="token" ) + public static final String SP_SYSTEM = "system"; + /** + * Fluent Client search parameter constant for system + *

+ * Description: Invoke at the system level?
+ * Type: token
+ * Path: OperationDefinition.system
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SYSTEM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SYSTEM); + + /** + * Search parameter: name + *

+ * Description: Informal name for this operation
+ * Type: string
+ * Path: OperationDefinition.name
+ *

+ */ + @SearchParamDefinition(name="name", path="OperationDefinition.name", description="Informal name for this operation", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Informal name for this operation
+ * Type: string
+ * Path: OperationDefinition.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the operation definition
+ * Type: token
+ * Path: OperationDefinition.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="OperationDefinition.useContext", description="A use context assigned to the operation definition", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the operation definition
+ * Type: token
+ * Path: OperationDefinition.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: base + *

+ * Description: Marks this as a profile of the base
+ * Type: reference
+ * Path: OperationDefinition.base
+ *

+ */ + @SearchParamDefinition(name="base", path="OperationDefinition.base", description="Marks this as a profile of the base", type="reference" ) + public static final String SP_BASE = "base"; + /** + * Fluent Client search parameter constant for base + *

+ * Description: Marks this as a profile of the base
+ * Type: reference
+ * Path: OperationDefinition.base
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "OperationDefinition:base". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_BASE = new ca.uhn.fhir.model.api.Include("OperationDefinition:base").toLocked(); + + /** + * Search parameter: instance + *

+ * Description: Invoke on an instance?
+ * Type: token
+ * Path: OperationDefinition.instance
+ *

+ */ + @SearchParamDefinition(name="instance", path="OperationDefinition.instance", description="Invoke on an instance?", type="token" ) + public static final String SP_INSTANCE = "instance"; + /** + * Fluent Client search parameter constant for instance + *

+ * Description: Invoke on an instance?
+ * Type: token
+ * Path: OperationDefinition.instance
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam INSTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INSTANCE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OperationOutcome.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OperationOutcome.java new file mode 100644 index 00000000000..f301fabee3c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OperationOutcome.java @@ -0,0 +1,1344 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +/** + * A collection of error, warning or information messages that result from a system action. + */ +@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome") +public class OperationOutcome extends DomainResource implements IBaseOperationOutcome { + + public enum IssueSeverity { + /** + * The issue caused the action to fail, and no further checking could be performed. + */ + FATAL, + /** + * The issue is sufficiently important to cause the action to fail. + */ + ERROR, + /** + * The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired. + */ + WARNING, + /** + * The issue has no relation to the degree of success of the action. + */ + INFORMATION, + /** + * added to help the parsers + */ + NULL; + public static IssueSeverity fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("fatal".equals(codeString)) + return FATAL; + if ("error".equals(codeString)) + return ERROR; + if ("warning".equals(codeString)) + return WARNING; + if ("information".equals(codeString)) + return INFORMATION; + throw new FHIRException("Unknown IssueSeverity code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case FATAL: return "fatal"; + case ERROR: return "error"; + case WARNING: return "warning"; + case INFORMATION: return "information"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case FATAL: return "http://hl7.org/fhir/issue-severity"; + case ERROR: return "http://hl7.org/fhir/issue-severity"; + case WARNING: return "http://hl7.org/fhir/issue-severity"; + case INFORMATION: return "http://hl7.org/fhir/issue-severity"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case FATAL: return "The issue caused the action to fail, and no further checking could be performed."; + case ERROR: return "The issue is sufficiently important to cause the action to fail."; + case WARNING: return "The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired."; + case INFORMATION: return "The issue has no relation to the degree of success of the action."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case FATAL: return "Fatal"; + case ERROR: return "Error"; + case WARNING: return "Warning"; + case INFORMATION: return "Information"; + default: return "?"; + } + } + } + + 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; + if ("fatal".equals(codeString)) + return IssueSeverity.FATAL; + if ("error".equals(codeString)) + return IssueSeverity.ERROR; + if ("warning".equals(codeString)) + return IssueSeverity.WARNING; + if ("information".equals(codeString)) + return IssueSeverity.INFORMATION; + throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("fatal".equals(codeString)) + return new Enumeration(this, IssueSeverity.FATAL); + if ("error".equals(codeString)) + return new Enumeration(this, IssueSeverity.ERROR); + if ("warning".equals(codeString)) + return new Enumeration(this, IssueSeverity.WARNING); + if ("information".equals(codeString)) + return new Enumeration(this, IssueSeverity.INFORMATION); + throw new FHIRException("Unknown IssueSeverity code '"+codeString+"'"); + } + public String toCode(IssueSeverity code) { + if (code == IssueSeverity.FATAL) + return "fatal"; + if (code == IssueSeverity.ERROR) + return "error"; + if (code == IssueSeverity.WARNING) + return "warning"; + if (code == IssueSeverity.INFORMATION) + return "information"; + return "?"; + } + public String toSystem(IssueSeverity code) { + return code.getSystem(); + } + } + + public enum IssueType { + /** + * Content invalid against the specification or a profile. + */ + INVALID, + /** + * A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax. + */ + STRUCTURE, + /** + * A required element is missing. + */ + REQUIRED, + /** + * An element value is invalid. + */ + VALUE, + /** + * A content validation rule failed - e.g. a schematron rule. + */ + INVARIANT, + /** + * An authentication/authorization/permissions issue of some kind. + */ + SECURITY, + /** + * The client needs to initiate an authentication process. + */ + LOGIN, + /** + * The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable). + */ + UNKNOWN, + /** + * User session expired; a login may be required. + */ + EXPIRED, + /** + * The user does not have the rights to perform this action. + */ + FORBIDDEN, + /** + * Some information was not or may not have been returned due to business rules, consent or privacy rules, or access permission constraints. This information may be accessible through alternate processes. + */ + SUPPRESSED, + /** + * Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged. + */ + PROCESSING, + /** + * The resource or profile is not supported. + */ + NOTSUPPORTED, + /** + * An attempt was made to create a duplicate record. + */ + DUPLICATE, + /** + * The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture. + */ + NOTFOUND, + /** + * Provided content is too long (typically, this is a denial of service protection type of error). + */ + TOOLONG, + /** + * The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code. + */ + CODEINVALID, + /** + * An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized. + */ + EXTENSION, + /** + * The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT. + */ + TOOCOSTLY, + /** + * The content/operation failed to pass some business rule, and so could not proceed. + */ + BUSINESSRULE, + /** + * Content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further into the application architecture.) + */ + CONFLICT, + /** + * Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete. + */ + INCOMPLETE, + /** + * Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved. + */ + TRANSIENT, + /** + * A resource/record locking failure (usually in an underlying database). + */ + LOCKERROR, + /** + * The persistent store is unavailable; e.g. the database is down for maintenance or similar action. + */ + NOSTORE, + /** + * An unexpected internal error has occurred. + */ + EXCEPTION, + /** + * An internal timeout has occurred. + */ + TIMEOUT, + /** + * The system is not prepared to handle this request due to load management. + */ + THROTTLED, + /** + * A message unrelated to the processing success of the completed operation (examples of the latter include things like reminders of password expiry, system maintenance times, etc.). + */ + INFORMATIONAL, + /** + * added to help the parsers + */ + NULL; + public static IssueType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("invalid".equals(codeString)) + return INVALID; + if ("structure".equals(codeString)) + return STRUCTURE; + if ("required".equals(codeString)) + return REQUIRED; + if ("value".equals(codeString)) + return VALUE; + if ("invariant".equals(codeString)) + return INVARIANT; + if ("security".equals(codeString)) + return SECURITY; + if ("login".equals(codeString)) + return LOGIN; + if ("unknown".equals(codeString)) + return UNKNOWN; + if ("expired".equals(codeString)) + return EXPIRED; + if ("forbidden".equals(codeString)) + return FORBIDDEN; + if ("suppressed".equals(codeString)) + return SUPPRESSED; + if ("processing".equals(codeString)) + return PROCESSING; + if ("not-supported".equals(codeString)) + return NOTSUPPORTED; + if ("duplicate".equals(codeString)) + return DUPLICATE; + if ("not-found".equals(codeString)) + return NOTFOUND; + if ("too-long".equals(codeString)) + return TOOLONG; + if ("code-invalid".equals(codeString)) + return CODEINVALID; + if ("extension".equals(codeString)) + return EXTENSION; + if ("too-costly".equals(codeString)) + return TOOCOSTLY; + if ("business-rule".equals(codeString)) + return BUSINESSRULE; + if ("conflict".equals(codeString)) + return CONFLICT; + if ("incomplete".equals(codeString)) + return INCOMPLETE; + if ("transient".equals(codeString)) + return TRANSIENT; + if ("lock-error".equals(codeString)) + return LOCKERROR; + if ("no-store".equals(codeString)) + return NOSTORE; + if ("exception".equals(codeString)) + return EXCEPTION; + if ("timeout".equals(codeString)) + return TIMEOUT; + if ("throttled".equals(codeString)) + return THROTTLED; + if ("informational".equals(codeString)) + return INFORMATIONAL; + throw new FHIRException("Unknown IssueType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INVALID: return "invalid"; + case STRUCTURE: return "structure"; + case REQUIRED: return "required"; + case VALUE: return "value"; + case INVARIANT: return "invariant"; + case SECURITY: return "security"; + case LOGIN: return "login"; + case UNKNOWN: return "unknown"; + case EXPIRED: return "expired"; + case FORBIDDEN: return "forbidden"; + case SUPPRESSED: return "suppressed"; + case PROCESSING: return "processing"; + case NOTSUPPORTED: return "not-supported"; + case DUPLICATE: return "duplicate"; + case NOTFOUND: return "not-found"; + case TOOLONG: return "too-long"; + case CODEINVALID: return "code-invalid"; + case EXTENSION: return "extension"; + case TOOCOSTLY: return "too-costly"; + case BUSINESSRULE: return "business-rule"; + case CONFLICT: return "conflict"; + case INCOMPLETE: return "incomplete"; + case TRANSIENT: return "transient"; + case LOCKERROR: return "lock-error"; + case NOSTORE: return "no-store"; + case EXCEPTION: return "exception"; + case TIMEOUT: return "timeout"; + case THROTTLED: return "throttled"; + case INFORMATIONAL: return "informational"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INVALID: return "http://hl7.org/fhir/issue-type"; + case STRUCTURE: return "http://hl7.org/fhir/issue-type"; + case REQUIRED: return "http://hl7.org/fhir/issue-type"; + case VALUE: return "http://hl7.org/fhir/issue-type"; + case INVARIANT: return "http://hl7.org/fhir/issue-type"; + case SECURITY: return "http://hl7.org/fhir/issue-type"; + case LOGIN: return "http://hl7.org/fhir/issue-type"; + case UNKNOWN: return "http://hl7.org/fhir/issue-type"; + case EXPIRED: return "http://hl7.org/fhir/issue-type"; + case FORBIDDEN: return "http://hl7.org/fhir/issue-type"; + case SUPPRESSED: return "http://hl7.org/fhir/issue-type"; + case PROCESSING: return "http://hl7.org/fhir/issue-type"; + case NOTSUPPORTED: return "http://hl7.org/fhir/issue-type"; + case DUPLICATE: return "http://hl7.org/fhir/issue-type"; + case NOTFOUND: return "http://hl7.org/fhir/issue-type"; + case TOOLONG: return "http://hl7.org/fhir/issue-type"; + case CODEINVALID: return "http://hl7.org/fhir/issue-type"; + case EXTENSION: return "http://hl7.org/fhir/issue-type"; + case TOOCOSTLY: return "http://hl7.org/fhir/issue-type"; + case BUSINESSRULE: return "http://hl7.org/fhir/issue-type"; + case CONFLICT: return "http://hl7.org/fhir/issue-type"; + case INCOMPLETE: return "http://hl7.org/fhir/issue-type"; + case TRANSIENT: return "http://hl7.org/fhir/issue-type"; + case LOCKERROR: return "http://hl7.org/fhir/issue-type"; + case NOSTORE: return "http://hl7.org/fhir/issue-type"; + case EXCEPTION: return "http://hl7.org/fhir/issue-type"; + case TIMEOUT: return "http://hl7.org/fhir/issue-type"; + case THROTTLED: return "http://hl7.org/fhir/issue-type"; + case INFORMATIONAL: return "http://hl7.org/fhir/issue-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INVALID: return "Content invalid against the specification or a profile."; + case STRUCTURE: return "A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax."; + case REQUIRED: return "A required element is missing."; + case VALUE: return "An element value is invalid."; + case INVARIANT: return "A content validation rule failed - e.g. a schematron rule."; + case SECURITY: return "An authentication/authorization/permissions issue of some kind."; + case LOGIN: return "The client needs to initiate an authentication process."; + case UNKNOWN: return "The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable)."; + case EXPIRED: return "User session expired; a login may be required."; + case FORBIDDEN: return "The user does not have the rights to perform this action."; + case SUPPRESSED: return "Some information was not or may not have been returned due to business rules, consent or privacy rules, or access permission constraints. This information may be accessible through alternate processes."; + case PROCESSING: return "Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged."; + case NOTSUPPORTED: return "The resource or profile is not supported."; + case DUPLICATE: return "An attempt was made to create a duplicate record."; + case NOTFOUND: return "The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture."; + case TOOLONG: return "Provided content is too long (typically, this is a denial of service protection type of error)."; + case CODEINVALID: return "The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code."; + case EXTENSION: return "An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized."; + case TOOCOSTLY: return "The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT."; + case BUSINESSRULE: return "The content/operation failed to pass some business rule, and so could not proceed."; + case CONFLICT: return "Content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further into the application architecture.)"; + case INCOMPLETE: return "Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete."; + case TRANSIENT: return "Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved."; + case LOCKERROR: return "A resource/record locking failure (usually in an underlying database)."; + case NOSTORE: return "The persistent store is unavailable; e.g. the database is down for maintenance or similar action."; + case EXCEPTION: return "An unexpected internal error has occurred."; + case TIMEOUT: return "An internal timeout has occurred."; + case THROTTLED: return "The system is not prepared to handle this request due to load management."; + case INFORMATIONAL: return "A message unrelated to the processing success of the completed operation (examples of the latter include things like reminders of password expiry, system maintenance times, etc.)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INVALID: return "Invalid Content"; + case STRUCTURE: return "Structural Issue"; + case REQUIRED: return "Required element missing"; + case VALUE: return "Element value invalid"; + case INVARIANT: return "Validation rule failed"; + case SECURITY: return "Security Problem"; + case LOGIN: return "Login Required"; + case UNKNOWN: return "Unknown User"; + case EXPIRED: return "Session Expired"; + case FORBIDDEN: return "Forbidden"; + case SUPPRESSED: return "Information Suppressed"; + case PROCESSING: return "Processing Failure"; + case NOTSUPPORTED: return "Content not supported"; + case DUPLICATE: return "Duplicate"; + case NOTFOUND: return "Not Found"; + case TOOLONG: return "Content Too Long"; + case CODEINVALID: return "Invalid Code"; + case EXTENSION: return "Unacceptable Extension"; + case TOOCOSTLY: return "Operation Too Costly"; + case BUSINESSRULE: return "Business Rule Violation"; + case CONFLICT: return "Edit Version Conflict"; + case INCOMPLETE: return "Incomplete Results"; + case TRANSIENT: return "Transient Issue"; + case LOCKERROR: return "Lock Error"; + case NOSTORE: return "No Store Available"; + case EXCEPTION: return "Exception"; + case TIMEOUT: return "Timeout"; + case THROTTLED: return "Throttled"; + case INFORMATIONAL: return "Informational Note"; + default: return "?"; + } + } + } + + public static class IssueTypeEnumFactory implements EnumFactory { + public IssueType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("invalid".equals(codeString)) + return IssueType.INVALID; + if ("structure".equals(codeString)) + return IssueType.STRUCTURE; + if ("required".equals(codeString)) + return IssueType.REQUIRED; + if ("value".equals(codeString)) + return IssueType.VALUE; + if ("invariant".equals(codeString)) + return IssueType.INVARIANT; + if ("security".equals(codeString)) + return IssueType.SECURITY; + if ("login".equals(codeString)) + return IssueType.LOGIN; + if ("unknown".equals(codeString)) + return IssueType.UNKNOWN; + if ("expired".equals(codeString)) + return IssueType.EXPIRED; + if ("forbidden".equals(codeString)) + return IssueType.FORBIDDEN; + if ("suppressed".equals(codeString)) + return IssueType.SUPPRESSED; + if ("processing".equals(codeString)) + return IssueType.PROCESSING; + if ("not-supported".equals(codeString)) + return IssueType.NOTSUPPORTED; + if ("duplicate".equals(codeString)) + return IssueType.DUPLICATE; + if ("not-found".equals(codeString)) + return IssueType.NOTFOUND; + if ("too-long".equals(codeString)) + return IssueType.TOOLONG; + if ("code-invalid".equals(codeString)) + return IssueType.CODEINVALID; + if ("extension".equals(codeString)) + return IssueType.EXTENSION; + if ("too-costly".equals(codeString)) + return IssueType.TOOCOSTLY; + if ("business-rule".equals(codeString)) + return IssueType.BUSINESSRULE; + if ("conflict".equals(codeString)) + return IssueType.CONFLICT; + if ("incomplete".equals(codeString)) + return IssueType.INCOMPLETE; + if ("transient".equals(codeString)) + return IssueType.TRANSIENT; + if ("lock-error".equals(codeString)) + return IssueType.LOCKERROR; + if ("no-store".equals(codeString)) + return IssueType.NOSTORE; + if ("exception".equals(codeString)) + return IssueType.EXCEPTION; + if ("timeout".equals(codeString)) + return IssueType.TIMEOUT; + if ("throttled".equals(codeString)) + return IssueType.THROTTLED; + if ("informational".equals(codeString)) + return IssueType.INFORMATIONAL; + throw new IllegalArgumentException("Unknown IssueType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("invalid".equals(codeString)) + return new Enumeration(this, IssueType.INVALID); + if ("structure".equals(codeString)) + return new Enumeration(this, IssueType.STRUCTURE); + if ("required".equals(codeString)) + return new Enumeration(this, IssueType.REQUIRED); + if ("value".equals(codeString)) + return new Enumeration(this, IssueType.VALUE); + if ("invariant".equals(codeString)) + return new Enumeration(this, IssueType.INVARIANT); + if ("security".equals(codeString)) + return new Enumeration(this, IssueType.SECURITY); + if ("login".equals(codeString)) + return new Enumeration(this, IssueType.LOGIN); + if ("unknown".equals(codeString)) + return new Enumeration(this, IssueType.UNKNOWN); + if ("expired".equals(codeString)) + return new Enumeration(this, IssueType.EXPIRED); + if ("forbidden".equals(codeString)) + return new Enumeration(this, IssueType.FORBIDDEN); + if ("suppressed".equals(codeString)) + return new Enumeration(this, IssueType.SUPPRESSED); + if ("processing".equals(codeString)) + return new Enumeration(this, IssueType.PROCESSING); + if ("not-supported".equals(codeString)) + return new Enumeration(this, IssueType.NOTSUPPORTED); + if ("duplicate".equals(codeString)) + return new Enumeration(this, IssueType.DUPLICATE); + if ("not-found".equals(codeString)) + return new Enumeration(this, IssueType.NOTFOUND); + if ("too-long".equals(codeString)) + return new Enumeration(this, IssueType.TOOLONG); + if ("code-invalid".equals(codeString)) + return new Enumeration(this, IssueType.CODEINVALID); + if ("extension".equals(codeString)) + return new Enumeration(this, IssueType.EXTENSION); + if ("too-costly".equals(codeString)) + return new Enumeration(this, IssueType.TOOCOSTLY); + if ("business-rule".equals(codeString)) + return new Enumeration(this, IssueType.BUSINESSRULE); + if ("conflict".equals(codeString)) + return new Enumeration(this, IssueType.CONFLICT); + if ("incomplete".equals(codeString)) + return new Enumeration(this, IssueType.INCOMPLETE); + if ("transient".equals(codeString)) + return new Enumeration(this, IssueType.TRANSIENT); + if ("lock-error".equals(codeString)) + return new Enumeration(this, IssueType.LOCKERROR); + if ("no-store".equals(codeString)) + return new Enumeration(this, IssueType.NOSTORE); + if ("exception".equals(codeString)) + return new Enumeration(this, IssueType.EXCEPTION); + if ("timeout".equals(codeString)) + return new Enumeration(this, IssueType.TIMEOUT); + if ("throttled".equals(codeString)) + return new Enumeration(this, IssueType.THROTTLED); + if ("informational".equals(codeString)) + return new Enumeration(this, IssueType.INFORMATIONAL); + throw new FHIRException("Unknown IssueType code '"+codeString+"'"); + } + public String toCode(IssueType code) { + if (code == IssueType.INVALID) + return "invalid"; + if (code == IssueType.STRUCTURE) + return "structure"; + if (code == IssueType.REQUIRED) + return "required"; + if (code == IssueType.VALUE) + return "value"; + if (code == IssueType.INVARIANT) + return "invariant"; + if (code == IssueType.SECURITY) + return "security"; + if (code == IssueType.LOGIN) + return "login"; + if (code == IssueType.UNKNOWN) + return "unknown"; + if (code == IssueType.EXPIRED) + return "expired"; + if (code == IssueType.FORBIDDEN) + return "forbidden"; + if (code == IssueType.SUPPRESSED) + return "suppressed"; + if (code == IssueType.PROCESSING) + return "processing"; + if (code == IssueType.NOTSUPPORTED) + return "not-supported"; + if (code == IssueType.DUPLICATE) + return "duplicate"; + if (code == IssueType.NOTFOUND) + return "not-found"; + if (code == IssueType.TOOLONG) + return "too-long"; + if (code == IssueType.CODEINVALID) + return "code-invalid"; + if (code == IssueType.EXTENSION) + return "extension"; + if (code == IssueType.TOOCOSTLY) + return "too-costly"; + if (code == IssueType.BUSINESSRULE) + return "business-rule"; + if (code == IssueType.CONFLICT) + return "conflict"; + if (code == IssueType.INCOMPLETE) + return "incomplete"; + if (code == IssueType.TRANSIENT) + return "transient"; + if (code == IssueType.LOCKERROR) + return "lock-error"; + if (code == IssueType.NOSTORE) + return "no-store"; + if (code == IssueType.EXCEPTION) + return "exception"; + if (code == IssueType.TIMEOUT) + return "timeout"; + if (code == IssueType.THROTTLED) + return "throttled"; + if (code == IssueType.INFORMATIONAL) + return "informational"; + return "?"; + } + public String toSystem(IssueType code) { + return code.getSystem(); + } + } + + @Block() + public static class OperationOutcomeIssueComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates whether the issue indicates a variation from successful processing. + */ + @Child(name = "severity", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="fatal | error | warning | information", formalDefinition="Indicates whether the issue indicates a variation from successful processing." ) + protected Enumeration severity; + + /** + * Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. + */ + @Child(name = "code", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Error or warning code", formalDefinition="Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element." ) + protected Enumeration code; + + /** + * Additional details about the error. This may be a text description of the error, or a system code that identifies the error. + */ + @Child(name = "details", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional details about the error", formalDefinition="Additional details about the error. This may be a text description of the error, or a system code that identifies the error." ) + protected CodeableConcept details; + + /** + * Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. + */ + @Child(name = "diagnostics", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional diagnostic information about the issue", formalDefinition="Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue." ) + protected StringType diagnostics; + + /** + * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. + */ + @Child(name = "location", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="XPath of element(s) related to issue", formalDefinition="A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised." ) + protected List location; + + /** + * A simple FluentPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. + */ + @Child(name = "expression", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="FluentPath of element(s) related to issue", formalDefinition="A simple FluentPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised." ) + protected List expression; + + private static final long serialVersionUID = -1681095438L; + + /** + * Constructor + */ + public OperationOutcomeIssueComponent() { + super(); + } + + /** + * Constructor + */ + public OperationOutcomeIssueComponent(Enumeration severity, Enumeration code) { + super(); + this.severity = severity; + this.code = code; + } + + /** + * @return {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(new IssueSeverityEnumFactory()); // bb + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public OperationOutcomeIssueComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Indicates whether the issue indicates a variation from successful processing. + */ + public IssueSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Indicates whether the issue indicates a variation from successful processing. + */ + public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) { + if (this.severity == null) + this.severity = new Enumeration(new IssueSeverityEnumFactory()); + this.severity.setValue(value); + return this; + } + + /** + * @return {@link #code} (Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(new IssueTypeEnumFactory()); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public OperationOutcomeIssueComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. + */ + public IssueType getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. + */ + public OperationOutcomeIssueComponent setCode(IssueType value) { + if (this.code == null) + this.code = new Enumeration(new IssueTypeEnumFactory()); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #details} (Additional details about the error. This may be a text description of the error, or a system code that identifies the error.) + */ + public CodeableConcept getDetails() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new CodeableConcept(); // cc + return this.details; + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (Additional details about the error. This may be a text description of the error, or a system code that identifies the error.) + */ + public OperationOutcomeIssueComponent setDetails(CodeableConcept value) { + this.details = value; + return this; + } + + /** + * @return {@link #diagnostics} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDiagnostics" gives direct access to the value + */ + public StringType getDiagnosticsElement() { + if (this.diagnostics == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.diagnostics"); + else if (Configuration.doAutoCreate()) + this.diagnostics = new StringType(); // bb + return this.diagnostics; + } + + public boolean hasDiagnosticsElement() { + return this.diagnostics != null && !this.diagnostics.isEmpty(); + } + + public boolean hasDiagnostics() { + return this.diagnostics != null && !this.diagnostics.isEmpty(); + } + + /** + * @param value {@link #diagnostics} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDiagnostics" gives direct access to the value + */ + public OperationOutcomeIssueComponent setDiagnosticsElement(StringType value) { + this.diagnostics = value; + return this; + } + + /** + * @return Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. + */ + public String getDiagnostics() { + return this.diagnostics == null ? null : this.diagnostics.getValue(); + } + + /** + * @param value Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. + */ + public OperationOutcomeIssueComponent setDiagnostics(String value) { + if (Utilities.noString(value)) + this.diagnostics = null; + else { + if (this.diagnostics == null) + this.diagnostics = new StringType(); + this.diagnostics.setValue(value); + } + return this; + } + + /** + * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (StringType item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + // syntactic sugar + public StringType addLocationElement() {//2 + StringType t = new StringType(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + /** + * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public OperationOutcomeIssueComponent addLocation(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public boolean hasLocation(String value) { + if (this.location == null) + return false; + for (StringType v : this.location) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #expression} (A simple FluentPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public List getExpression() { + if (this.expression == null) + this.expression = new ArrayList(); + return this.expression; + } + + public boolean hasExpression() { + if (this.expression == null) + return false; + for (StringType item : this.expression) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #expression} (A simple FluentPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + // syntactic sugar + public StringType addExpressionElement() {//2 + StringType t = new StringType(); + if (this.expression == null) + this.expression = new ArrayList(); + this.expression.add(t); + return t; + } + + /** + * @param value {@link #expression} (A simple FluentPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public OperationOutcomeIssueComponent addExpression(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.expression == null) + this.expression = new ArrayList(); + this.expression.add(t); + return this; + } + + /** + * @param value {@link #expression} (A simple FluentPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public boolean hasExpression(String value) { + if (this.expression == null) + return false; + for (StringType v : this.expression) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("severity", "code", "Indicates whether the issue indicates a variation from successful processing.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("code", "code", "Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("details", "CodeableConcept", "Additional details about the error. This may be a text description of the error, or a system code that identifies the error.", 0, java.lang.Integer.MAX_VALUE, details)); + childrenList.add(new Property("diagnostics", "string", "Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.", 0, java.lang.Integer.MAX_VALUE, diagnostics)); + childrenList.add(new Property("location", "string", "A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("expression", "string", "A simple FluentPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.", 0, java.lang.Integer.MAX_VALUE, expression)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration + case 1557721666: /*details*/ return this.details == null ? new Base[0] : new Base[] {this.details}; // CodeableConcept + case -740386388: /*diagnostics*/ return this.diagnostics == null ? new Base[0] : new Base[] {this.diagnostics}; // StringType + case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // StringType + case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : this.expression.toArray(new Base[this.expression.size()]); // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1478300413: // severity + this.severity = new IssueSeverityEnumFactory().fromType(value); // Enumeration + break; + case 3059181: // code + this.code = new IssueTypeEnumFactory().fromType(value); // Enumeration + break; + case 1557721666: // details + this.details = castToCodeableConcept(value); // CodeableConcept + break; + case -740386388: // diagnostics + this.diagnostics = castToString(value); // StringType + break; + case 1901043637: // location + this.getLocation().add(castToString(value)); // StringType + break; + case -1795452264: // expression + this.getExpression().add(castToString(value)); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("severity")) + this.severity = new IssueSeverityEnumFactory().fromType(value); // Enumeration + else if (name.equals("code")) + this.code = new IssueTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("details")) + this.details = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("diagnostics")) + this.diagnostics = castToString(value); // StringType + else if (name.equals("location")) + this.getLocation().add(castToString(value)); + else if (name.equals("expression")) + this.getExpression().add(castToString(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1478300413: throw new FHIRException("Cannot make property severity as it is not a complex type"); // Enumeration + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration + case 1557721666: return getDetails(); // CodeableConcept + case -740386388: throw new FHIRException("Cannot make property diagnostics as it is not a complex type"); // StringType + case 1901043637: throw new FHIRException("Cannot make property location as it is not a complex type"); // StringType + case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("severity")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.severity"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.code"); + } + else if (name.equals("details")) { + this.details = new CodeableConcept(); + return this.details; + } + else if (name.equals("diagnostics")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.diagnostics"); + } + else if (name.equals("location")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.location"); + } + else if (name.equals("expression")) { + throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.expression"); + } + else + return super.addChild(name); + } + + public OperationOutcomeIssueComponent copy() { + OperationOutcomeIssueComponent dst = new OperationOutcomeIssueComponent(); + copyValues(dst); + dst.severity = severity == null ? null : severity.copy(); + dst.code = code == null ? null : code.copy(); + dst.details = details == null ? null : details.copy(); + dst.diagnostics = diagnostics == null ? null : diagnostics.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (StringType i : location) + dst.location.add(i.copy()); + }; + if (expression != null) { + dst.expression = new ArrayList(); + for (StringType i : expression) + dst.expression.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationOutcomeIssueComponent)) + return false; + OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other; + return compareDeep(severity, o.severity, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) + && compareDeep(diagnostics, o.diagnostics, true) && compareDeep(location, o.location, true) && compareDeep(expression, o.expression, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationOutcomeIssueComponent)) + return false; + OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other; + return compareValues(severity, o.severity, true) && compareValues(code, o.code, true) && compareValues(diagnostics, o.diagnostics, true) + && compareValues(location, o.location, true) && compareValues(expression, o.expression, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (severity == null || severity.isEmpty()) && (code == null || code.isEmpty()) + && (details == null || details.isEmpty()) && (diagnostics == null || diagnostics.isEmpty()) + && (location == null || location.isEmpty()) && (expression == null || expression.isEmpty()) + ; + } + + public String fhirType() { + return "OperationOutcome.issue"; + + } + + } + + /** + * An error, warning or information message that results from a system action. + */ + @Child(name = "issue", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A single issue associated with the action", formalDefinition="An error, warning or information message that results from a system action." ) + protected List issue; + + private static final long serialVersionUID = -152150052L; + + /** + * Constructor + */ + public OperationOutcome() { + super(); + } + + /** + * @return {@link #issue} (An error, warning or information message that results from a system action.) + */ + public List getIssue() { + if (this.issue == null) + this.issue = new ArrayList(); + return this.issue; + } + + public boolean hasIssue() { + if (this.issue == null) + return false; + for (OperationOutcomeIssueComponent item : this.issue) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #issue} (An error, warning or information message that results from a system action.) + */ + // syntactic sugar + public OperationOutcomeIssueComponent addIssue() { //3 + OperationOutcomeIssueComponent t = new OperationOutcomeIssueComponent(); + if (this.issue == null) + this.issue = new ArrayList(); + this.issue.add(t); + return t; + } + + // syntactic sugar + public OperationOutcome addIssue(OperationOutcomeIssueComponent t) { //3 + if (t == null) + return this; + if (this.issue == null) + this.issue = new ArrayList(); + this.issue.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("issue", "", "An error, warning or information message that results from a system action.", 0, java.lang.Integer.MAX_VALUE, issue)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 100509913: /*issue*/ return this.issue == null ? new Base[0] : this.issue.toArray(new Base[this.issue.size()]); // OperationOutcomeIssueComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 100509913: // issue + this.getIssue().add((OperationOutcomeIssueComponent) value); // OperationOutcomeIssueComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("issue")) + this.getIssue().add((OperationOutcomeIssueComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 100509913: return addIssue(); // OperationOutcomeIssueComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("issue")) { + return addIssue(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "OperationOutcome"; + + } + + public OperationOutcome copy() { + OperationOutcome dst = new OperationOutcome(); + copyValues(dst); + if (issue != null) { + dst.issue = new ArrayList(); + for (OperationOutcomeIssueComponent i : issue) + dst.issue.add(i.copy()); + }; + return dst; + } + + protected OperationOutcome typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OperationOutcome)) + return false; + OperationOutcome o = (OperationOutcome) other; + return compareDeep(issue, o.issue, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OperationOutcome)) + return false; + OperationOutcome o = (OperationOutcome) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (issue == null || issue.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OperationOutcome; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Order.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Order.java new file mode 100644 index 00000000000..ab1a9ef99af --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Order.java @@ -0,0 +1,1051 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A request to perform an action. + */ +@ResourceDef(name="Order", profile="http://hl7.org/fhir/Profile/Order") +public class Order extends DomainResource { + + @Block() + public static class OrderWhenComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code specifies when request should be done. The code may simply be a priority code. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Code specifies when request should be done. The code may simply be a priority code", formalDefinition="Code specifies when request should be done. The code may simply be a priority code." ) + protected CodeableConcept code; + + /** + * A formal schedule. + */ + @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A formal schedule", formalDefinition="A formal schedule." ) + protected Timing schedule; + + private static final long serialVersionUID = 307115287L; + + /** + * Constructor + */ + public OrderWhenComponent() { + super(); + } + + /** + * @return {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderWhenComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) + */ + public OrderWhenComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #schedule} (A formal schedule.) + */ + public Timing getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderWhenComponent.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Timing(); // cc + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (A formal schedule.) + */ + public OrderWhenComponent setSchedule(Timing value) { + this.schedule = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Code specifies when request should be done. The code may simply be a priority code.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("schedule", "Timing", "A formal schedule.", 0, java.lang.Integer.MAX_VALUE, schedule)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Timing + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -697920873: // schedule + this.schedule = castToTiming(value); // Timing + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("schedule")) + this.schedule = castToTiming(value); // Timing + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case -697920873: return getSchedule(); // Timing + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("schedule")) { + this.schedule = new Timing(); + return this.schedule; + } + else + return super.addChild(name); + } + + public OrderWhenComponent copy() { + OrderWhenComponent dst = new OrderWhenComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OrderWhenComponent)) + return false; + OrderWhenComponent o = (OrderWhenComponent) other; + return compareDeep(code, o.code, true) && compareDeep(schedule, o.schedule, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OrderWhenComponent)) + return false; + OrderWhenComponent o = (OrderWhenComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (schedule == null || schedule.isEmpty()) + ; + } + + public String fhirType() { + return "Order.when"; + + } + + } + + /** + * Identifiers assigned to this order by the orderer or by the receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) + protected List identifier; + + /** + * When the order was made. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the order was made", formalDefinition="When the order was made." ) + protected DateTimeType date; + + /** + * Patient this order is about. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Substance.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient this order is about", formalDefinition="Patient this order is about." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Patient this order is about.) + */ + protected Resource subjectTarget; + + /** + * Who initiated the order. + */ + @Child(name = "source", type = {Practitioner.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who initiated the order", formalDefinition="Who initiated the order." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (Who initiated the order.) + */ + protected Resource sourceTarget; + + /** + * Who is intended to fulfill the order. + */ + @Child(name = "target", type = {Organization.class, Device.class, Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who is intended to fulfill the order", formalDefinition="Who is intended to fulfill the order." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Who is intended to fulfill the order.) + */ + protected Resource targetTarget; + + /** + * Text - why the order was made. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Text - why the order was made", formalDefinition="Text - why the order was made." ) + protected Type reason; + + /** + * When order should be fulfilled. + */ + @Child(name = "when", type = {}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When order should be fulfilled", formalDefinition="When order should be fulfilled." ) + protected OrderWhenComponent when; + + /** + * What action is being ordered. + */ + @Child(name = "detail", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="What action is being ordered", formalDefinition="What action is being ordered." ) + protected List detail; + /** + * The actual objects that are the target of the reference (What action is being ordered.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = -1392311096L; + + /** + * Constructor + */ + public Order() { + super(); + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) + */ + 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 assigned to this order by the orderer or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Order addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #date} (When the order was made.). 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 Order.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Order setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return When the order was made. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value When the order was made. + */ + public Order setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (Patient this order is about.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Patient this order is about.) + */ + public Order 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. (Patient this order is about.) + */ + public Resource getSubjectTarget() { + 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. (Patient this order is about.) + */ + public Order setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #source} (Who initiated the order.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Who initiated the order.) + */ + public Order 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. (Who initiated the order.) + */ + public Resource getSourceTarget() { + 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. (Who initiated the order.) + */ + public Order setSourceTarget(Resource value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #target} (Who is intended to fulfill the order.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Who is intended to fulfill the order.) + */ + public Order 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. (Who is intended to fulfill the order.) + */ + public Resource getTargetTarget() { + 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. (Who is intended to fulfill the order.) + */ + public Order setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public CodeableConcept getReasonCodeableConcept() throws FHIRException { + if (!(this.reason instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + public boolean hasReasonCodeableConcept() { + return this.reason instanceof CodeableConcept; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public Reference getReasonReference() throws FHIRException { + if (!(this.reason instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReasonReference() { + return this.reason instanceof Reference; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Text - why the order was made.) + */ + public Order setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #when} (When order should be fulfilled.) + */ + public OrderWhenComponent getWhen() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.when"); + else if (Configuration.doAutoCreate()) + this.when = new OrderWhenComponent(); // cc + return this.when; + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (When order should be fulfilled.) + */ + public Order setWhen(OrderWhenComponent value) { + this.when = value; + return this; + } + + /** + * @return {@link #detail} (What action is being ordered.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (What action is being ordered.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public Order addDetail(Reference t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #detail} (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. What action is being ordered.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("date", "dateTime", "When the order was made.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Patient this order is about.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("source", "Reference(Practitioner|Organization)", "Who initiated the order.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target", "Reference(Organization|Device|Practitioner)", "Who is intended to fulfill the order.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Any)", "Text - why the order was made.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("when", "", "When order should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("detail", "Reference(Any)", "What action is being ordered.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type + case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // OrderWhenComponent + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -896505829: // source + this.source = castToReference(value); // Reference + break; + case -880905839: // target + this.target = castToReference(value); // Reference + break; + case -934964668: // reason + this.reason = (Type) value; // Type + break; + case 3648314: // when + this.when = (OrderWhenComponent) value; // OrderWhenComponent + break; + case -1335224239: // detail + this.getDetail().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("source")) + this.source = castToReference(value); // Reference + else if (name.equals("target")) + this.target = castToReference(value); // Reference + else if (name.equals("reason[x]")) + this.reason = (Type) value; // Type + else if (name.equals("when")) + this.when = (OrderWhenComponent) value; // OrderWhenComponent + else if (name.equals("detail")) + this.getDetail().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1867885268: return getSubject(); // Reference + case -896505829: return getSource(); // Reference + case -880905839: return getTarget(); // Reference + case -669418564: return getReason(); // Type + case 3648314: return getWhen(); // OrderWhenComponent + case -1335224239: return addDetail(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type Order.date"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("source")) { + this.source = new Reference(); + return this.source; + } + else if (name.equals("target")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("reasonCodeableConcept")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else if (name.equals("reasonReference")) { + this.reason = new Reference(); + return this.reason; + } + else if (name.equals("when")) { + this.when = new OrderWhenComponent(); + return this.when; + } + else if (name.equals("detail")) { + return addDetail(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Order"; + + } + + public Order copy() { + Order dst = new Order(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.when = when == null ? null : when.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + protected Order typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Order)) + return false; + Order o = (Order) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(subject, o.subject, true) + && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) && compareDeep(reason, o.reason, true) + && compareDeep(when, o.when, true) && compareDeep(detail, o.detail, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Order)) + return false; + Order o = (Order) other; + return compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) + && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) + && (reason == null || reason.isEmpty()) && (when == null || when.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Order; + } + + /** + * Search parameter: detail + *

+ * Description: What action is being ordered
+ * Type: reference
+ * Path: Order.detail
+ *

+ */ + @SearchParamDefinition(name="detail", path="Order.detail", description="What action is being ordered", type="reference" ) + public static final String SP_DETAIL = "detail"; + /** + * Fluent Client search parameter constant for detail + *

+ * Description: What action is being ordered
+ * Type: reference
+ * Path: Order.detail
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DETAIL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DETAIL); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Order:detail". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DETAIL = new ca.uhn.fhir.model.api.Include("Order:detail").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: Patient this order is about
+ * Type: reference
+ * Path: Order.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Order.subject", description="Patient this order is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Patient this order is about
+ * Type: reference
+ * Path: Order.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Order:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Order:patient").toLocked(); + + /** + * Search parameter: source + *

+ * Description: Who initiated the order
+ * Type: reference
+ * Path: Order.source
+ *

+ */ + @SearchParamDefinition(name="source", path="Order.source", description="Who initiated the order", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: Who initiated the order
+ * Type: reference
+ * Path: Order.source
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Order:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("Order:source").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: Patient this order is about
+ * Type: reference
+ * Path: Order.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Order.subject", description="Patient this order is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Patient this order is about
+ * Type: reference
+ * Path: Order.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Order:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Order:subject").toLocked(); + + /** + * Search parameter: when + *

+ * Description: A formal schedule
+ * Type: date
+ * Path: Order.when.schedule
+ *

+ */ + @SearchParamDefinition(name="when", path="Order.when.schedule", description="A formal schedule", type="date" ) + public static final String SP_WHEN = "when"; + /** + * Fluent Client search parameter constant for when + *

+ * Description: A formal schedule
+ * Type: date
+ * Path: Order.when.schedule
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam WHEN = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_WHEN); + + /** + * Search parameter: target + *

+ * Description: Who is intended to fulfill the order
+ * Type: reference
+ * Path: Order.target
+ *

+ */ + @SearchParamDefinition(name="target", path="Order.target", description="Who is intended to fulfill the order", type="reference" ) + public static final String SP_TARGET = "target"; + /** + * Fluent Client search parameter constant for target + *

+ * Description: Who is intended to fulfill the order
+ * Type: reference
+ * Path: Order.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Order:target". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("Order:target").toLocked(); + + /** + * Search parameter: when_code + *

+ * Description: Code specifies when request should be done. The code may simply be a priority code
+ * Type: token
+ * Path: Order.when.code
+ *

+ */ + @SearchParamDefinition(name="when_code", path="Order.when.code", description="Code specifies when request should be done. The code may simply be a priority code", type="token" ) + public static final String SP_WHENCODE = "when_code"; + /** + * Fluent Client search parameter constant for when_code + *

+ * Description: Code specifies when request should be done. The code may simply be a priority code
+ * Type: token
+ * Path: Order.when.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam WHENCODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_WHENCODE); + + /** + * Search parameter: date + *

+ * Description: When the order was made
+ * Type: date
+ * Path: Order.date
+ *

+ */ + @SearchParamDefinition(name="date", path="Order.date", description="When the order was made", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When the order was made
+ * Type: date
+ * Path: Order.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Instance id from source, target, and/or others
+ * Type: token
+ * Path: Order.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Order.identifier", description="Instance id from source, target, and/or others", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Instance id from source, target, and/or others
+ * Type: token
+ * Path: Order.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OrderResponse.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OrderResponse.java new file mode 100644 index 00000000000..babbea39369 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OrderResponse.java @@ -0,0 +1,970 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A response to an order. + */ +@ResourceDef(name="OrderResponse", profile="http://hl7.org/fhir/Profile/OrderResponse") +public class OrderResponse extends DomainResource { + + public enum OrderStatus { + /** + * The order is known, but no processing has occurred at this time + */ + PENDING, + /** + * The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review) + */ + REVIEW, + /** + * The order was rejected because of a workflow/business logic reason + */ + REJECTED, + /** + * The order was unable to be processed because of a technical error (i.e. unexpected error) + */ + ERROR, + /** + * The order has been accepted, and work is in progress. + */ + ACCEPTED, + /** + * Processing the order was halted at the initiators request. + */ + CANCELLED, + /** + * The order has been cancelled and replaced by another. + */ + REPLACED, + /** + * Processing the order was stopped because of some workflow/business logic reason. + */ + ABORTED, + /** + * The order has been completed. + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + public static OrderStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return PENDING; + if ("review".equals(codeString)) + return REVIEW; + if ("rejected".equals(codeString)) + return REJECTED; + if ("error".equals(codeString)) + return ERROR; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("replaced".equals(codeString)) + return REPLACED; + if ("aborted".equals(codeString)) + return ABORTED; + if ("completed".equals(codeString)) + return COMPLETED; + throw new FHIRException("Unknown OrderStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PENDING: return "pending"; + case REVIEW: return "review"; + case REJECTED: return "rejected"; + case ERROR: return "error"; + case ACCEPTED: return "accepted"; + case CANCELLED: return "cancelled"; + case REPLACED: return "replaced"; + case ABORTED: return "aborted"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PENDING: return "http://hl7.org/fhir/order-status"; + case REVIEW: return "http://hl7.org/fhir/order-status"; + case REJECTED: return "http://hl7.org/fhir/order-status"; + case ERROR: return "http://hl7.org/fhir/order-status"; + case ACCEPTED: return "http://hl7.org/fhir/order-status"; + case CANCELLED: return "http://hl7.org/fhir/order-status"; + case REPLACED: return "http://hl7.org/fhir/order-status"; + case ABORTED: return "http://hl7.org/fhir/order-status"; + case COMPLETED: return "http://hl7.org/fhir/order-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PENDING: return "The order is known, but no processing has occurred at this time"; + case REVIEW: return "The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review)"; + case REJECTED: return "The order was rejected because of a workflow/business logic reason"; + case ERROR: return "The order was unable to be processed because of a technical error (i.e. unexpected error)"; + case ACCEPTED: return "The order has been accepted, and work is in progress."; + case CANCELLED: return "Processing the order was halted at the initiators request."; + case REPLACED: return "The order has been cancelled and replaced by another."; + case ABORTED: return "Processing the order was stopped because of some workflow/business logic reason."; + case COMPLETED: return "The order has been completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PENDING: return "Pending"; + case REVIEW: return "Review"; + case REJECTED: return "Rejected"; + case ERROR: return "Error"; + case ACCEPTED: return "Accepted"; + case CANCELLED: return "Cancelled"; + case REPLACED: return "Replaced"; + case ABORTED: return "Aborted"; + case COMPLETED: return "Completed"; + default: return "?"; + } + } + } + + public static class OrderStatusEnumFactory implements EnumFactory { + public OrderStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return OrderStatus.PENDING; + if ("review".equals(codeString)) + return OrderStatus.REVIEW; + if ("rejected".equals(codeString)) + return OrderStatus.REJECTED; + if ("error".equals(codeString)) + return OrderStatus.ERROR; + if ("accepted".equals(codeString)) + return OrderStatus.ACCEPTED; + if ("cancelled".equals(codeString)) + return OrderStatus.CANCELLED; + if ("replaced".equals(codeString)) + return OrderStatus.REPLACED; + if ("aborted".equals(codeString)) + return OrderStatus.ABORTED; + if ("completed".equals(codeString)) + return OrderStatus.COMPLETED; + throw new IllegalArgumentException("Unknown OrderStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return new Enumeration(this, OrderStatus.PENDING); + if ("review".equals(codeString)) + return new Enumeration(this, OrderStatus.REVIEW); + if ("rejected".equals(codeString)) + return new Enumeration(this, OrderStatus.REJECTED); + if ("error".equals(codeString)) + return new Enumeration(this, OrderStatus.ERROR); + if ("accepted".equals(codeString)) + return new Enumeration(this, OrderStatus.ACCEPTED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, OrderStatus.CANCELLED); + if ("replaced".equals(codeString)) + return new Enumeration(this, OrderStatus.REPLACED); + if ("aborted".equals(codeString)) + return new Enumeration(this, OrderStatus.ABORTED); + if ("completed".equals(codeString)) + return new Enumeration(this, OrderStatus.COMPLETED); + throw new FHIRException("Unknown OrderStatus code '"+codeString+"'"); + } + public String toCode(OrderStatus code) { + if (code == OrderStatus.PENDING) + return "pending"; + if (code == OrderStatus.REVIEW) + return "review"; + if (code == OrderStatus.REJECTED) + return "rejected"; + if (code == OrderStatus.ERROR) + return "error"; + if (code == OrderStatus.ACCEPTED) + return "accepted"; + if (code == OrderStatus.CANCELLED) + return "cancelled"; + if (code == OrderStatus.REPLACED) + return "replaced"; + if (code == OrderStatus.ABORTED) + return "aborted"; + if (code == OrderStatus.COMPLETED) + return "completed"; + return "?"; + } + public String toSystem(OrderStatus code) { + return code.getSystem(); + } + } + + /** + * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems." ) + protected List identifier; + + /** + * A reference to the order that this is in response to. + */ + @Child(name = "request", type = {Order.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The order that this is a response to", formalDefinition="A reference to the order that this is in response to." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (A reference to the order that this is in response to.) + */ + protected Order requestTarget; + + /** + * The date and time at which this order response was made (created/posted). + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the response was made", formalDefinition="The date and time at which this order response was made (created/posted)." ) + protected DateTimeType date; + + /** + * The person, organization, or device credited with making the response. + */ + @Child(name = "who", type = {Practitioner.class, Organization.class, Device.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who made the response", formalDefinition="The person, organization, or device credited with making the response." ) + protected Reference who; + + /** + * The actual object that is the target of the reference (The person, organization, or device credited with making the response.) + */ + protected Resource whoTarget; + + /** + * What this response says about the status of the original order. + */ + @Child(name = "orderStatus", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed", formalDefinition="What this response says about the status of the original order." ) + protected Enumeration orderStatus; + + /** + * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional description of the response", formalDefinition="Additional description about the response - e.g. a text description provided by a human user when making decisions about the order." ) + protected StringType description; + + /** + * Links to resources that provide details of the outcome of performing the order; e.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order. + */ + @Child(name = "fulfillment", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Details of the outcome of performing the order", formalDefinition="Links to resources that provide details of the outcome of performing the order; e.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order." ) + protected List fulfillment; + /** + * The actual objects that are the target of the reference (Links to resources that provide details of the outcome of performing the order; e.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + protected List fulfillmentTarget; + + + private static final long serialVersionUID = -856633109L; + + /** + * Constructor + */ + public OrderResponse() { + super(); + } + + /** + * Constructor + */ + public OrderResponse(Reference request, Enumeration orderStatus) { + super(); + this.request = request; + this.orderStatus = orderStatus; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) + */ + 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 assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public OrderResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (A reference to the order that this is in response to.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (A reference to the order that this is in response to.) + */ + public OrderResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (A reference to the order that this is in response to.) + */ + public Order getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new Order(); // aa + 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. (A reference to the order that this is in response to.) + */ + public OrderResponse setRequestTarget(Order value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #date} (The date and time at which this order response was made (created/posted).). 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 OrderResponse.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public OrderResponse setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date and time at which this order response was made (created/posted). + */ + 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(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #who} (The person, organization, or device credited with making the response.) + */ + public Reference getWho() { + if (this.who == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.who"); + else if (Configuration.doAutoCreate()) + this.who = new Reference(); // cc + return this.who; + } + + public boolean hasWho() { + return this.who != null && !this.who.isEmpty(); + } + + /** + * @param value {@link #who} (The person, organization, or device credited with making the response.) + */ + public OrderResponse setWho(Reference value) { + this.who = value; + return this; + } + + /** + * @return {@link #who} 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, organization, or device credited with making the response.) + */ + public Resource getWhoTarget() { + return this.whoTarget; + } + + /** + * @param value {@link #who} 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, organization, or device credited with making the response.) + */ + public OrderResponse setWhoTarget(Resource value) { + this.whoTarget = value; + return this; + } + + /** + * @return {@link #orderStatus} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getOrderStatus" gives direct access to the value + */ + public Enumeration getOrderStatusElement() { + if (this.orderStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.orderStatus"); + else if (Configuration.doAutoCreate()) + this.orderStatus = new Enumeration(new OrderStatusEnumFactory()); // bb + return this.orderStatus; + } + + public boolean hasOrderStatusElement() { + return this.orderStatus != null && !this.orderStatus.isEmpty(); + } + + public boolean hasOrderStatus() { + return this.orderStatus != null && !this.orderStatus.isEmpty(); + } + + /** + * @param value {@link #orderStatus} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getOrderStatus" gives direct access to the value + */ + public OrderResponse setOrderStatusElement(Enumeration value) { + this.orderStatus = value; + return this; + } + + /** + * @return What this response says about the status of the original order. + */ + public OrderStatus getOrderStatus() { + return this.orderStatus == null ? null : this.orderStatus.getValue(); + } + + /** + * @param value What this response says about the status of the original order. + */ + public OrderResponse setOrderStatus(OrderStatus value) { + if (this.orderStatus == null) + this.orderStatus = new Enumeration(new OrderStatusEnumFactory()); + this.orderStatus.setValue(value); + return this; + } + + /** + * @return {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). 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 OrderResponse.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public OrderResponse setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + public OrderResponse 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 #fulfillment} (Links to resources that provide details of the outcome of performing the order; e.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + public List getFulfillment() { + if (this.fulfillment == null) + this.fulfillment = new ArrayList(); + return this.fulfillment; + } + + public boolean hasFulfillment() { + if (this.fulfillment == null) + return false; + for (Reference item : this.fulfillment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order; e.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + // syntactic sugar + public Reference addFulfillment() { //3 + Reference t = new Reference(); + if (this.fulfillment == null) + this.fulfillment = new ArrayList(); + this.fulfillment.add(t); + return t; + } + + // syntactic sugar + public OrderResponse addFulfillment(Reference t) { //3 + if (t == null) + return this; + if (this.fulfillment == null) + this.fulfillment = new ArrayList(); + this.fulfillment.add(t); + return this; + } + + /** + * @return {@link #fulfillment} (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. Links to resources that provide details of the outcome of performing the order; e.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + public List getFulfillmentTarget() { + if (this.fulfillmentTarget == null) + this.fulfillmentTarget = new ArrayList(); + return this.fulfillmentTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(Order)", "A reference to the order that this is in response to.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("date", "dateTime", "The date and time at which this order response was made (created/posted).", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("who", "Reference(Practitioner|Organization|Device)", "The person, organization, or device credited with making the response.", 0, java.lang.Integer.MAX_VALUE, who)); + childrenList.add(new Property("orderStatus", "code", "What this response says about the status of the original order.", 0, java.lang.Integer.MAX_VALUE, orderStatus)); + childrenList.add(new Property("description", "string", "Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("fulfillment", "Reference(Any)", "Links to resources that provide details of the outcome of performing the order; e.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.", 0, java.lang.Integer.MAX_VALUE, fulfillment)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 117694: /*who*/ return this.who == null ? new Base[0] : new Base[] {this.who}; // Reference + case 1630081248: /*orderStatus*/ return this.orderStatus == null ? new Base[0] : new Base[] {this.orderStatus}; // Enumeration + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 1512395230: /*fulfillment*/ return this.fulfillment == null ? new Base[0] : this.fulfillment.toArray(new Base[this.fulfillment.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1095692943: // request + this.request = castToReference(value); // Reference + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 117694: // who + this.who = castToReference(value); // Reference + break; + case 1630081248: // orderStatus + this.orderStatus = new OrderStatusEnumFactory().fromType(value); // Enumeration + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 1512395230: // fulfillment + this.getFulfillment().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("request")) + this.request = castToReference(value); // Reference + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("who")) + this.who = castToReference(value); // Reference + else if (name.equals("orderStatus")) + this.orderStatus = new OrderStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("fulfillment")) + this.getFulfillment().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 1095692943: return getRequest(); // Reference + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 117694: return getWho(); // Reference + case 1630081248: throw new FHIRException("Cannot make property orderStatus as it is not a complex type"); // Enumeration + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 1512395230: return addFulfillment(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("request")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type OrderResponse.date"); + } + else if (name.equals("who")) { + this.who = new Reference(); + return this.who; + } + else if (name.equals("orderStatus")) { + throw new FHIRException("Cannot call addChild on a primitive type OrderResponse.orderStatus"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type OrderResponse.description"); + } + else if (name.equals("fulfillment")) { + return addFulfillment(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "OrderResponse"; + + } + + public OrderResponse copy() { + OrderResponse dst = new OrderResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.date = date == null ? null : date.copy(); + dst.who = who == null ? null : who.copy(); + dst.orderStatus = orderStatus == null ? null : orderStatus.copy(); + dst.description = description == null ? null : description.copy(); + if (fulfillment != null) { + dst.fulfillment = new ArrayList(); + for (Reference i : fulfillment) + dst.fulfillment.add(i.copy()); + }; + return dst; + } + + protected OrderResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OrderResponse)) + return false; + OrderResponse o = (OrderResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(date, o.date, true) + && compareDeep(who, o.who, true) && compareDeep(orderStatus, o.orderStatus, true) && compareDeep(description, o.description, true) + && compareDeep(fulfillment, o.fulfillment, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OrderResponse)) + return false; + OrderResponse o = (OrderResponse) other; + return compareValues(date, o.date, true) && compareValues(orderStatus, o.orderStatus, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (date == null || date.isEmpty()) && (who == null || who.isEmpty()) && (orderStatus == null || orderStatus.isEmpty()) + && (description == null || description.isEmpty()) && (fulfillment == null || fulfillment.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OrderResponse; + } + + /** + * Search parameter: fulfillment + *

+ * Description: Details of the outcome of performing the order
+ * Type: reference
+ * Path: OrderResponse.fulfillment
+ *

+ */ + @SearchParamDefinition(name="fulfillment", path="OrderResponse.fulfillment", description="Details of the outcome of performing the order", type="reference" ) + public static final String SP_FULFILLMENT = "fulfillment"; + /** + * Fluent Client search parameter constant for fulfillment + *

+ * Description: Details of the outcome of performing the order
+ * Type: reference
+ * Path: OrderResponse.fulfillment
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FULFILLMENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FULFILLMENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "OrderResponse:fulfillment". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_FULFILLMENT = new ca.uhn.fhir.model.api.Include("OrderResponse:fulfillment").toLocked(); + + /** + * Search parameter: request + *

+ * Description: The order that this is a response to
+ * Type: reference
+ * Path: OrderResponse.request
+ *

+ */ + @SearchParamDefinition(name="request", path="OrderResponse.request", description="The order that this is a response to", type="reference" ) + public static final String SP_REQUEST = "request"; + /** + * Fluent Client search parameter constant for request + *

+ * Description: The order that this is a response to
+ * Type: reference
+ * Path: OrderResponse.request
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "OrderResponse:request". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("OrderResponse:request").toLocked(); + + /** + * Search parameter: code + *

+ * Description: pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed
+ * Type: token
+ * Path: OrderResponse.orderStatus
+ *

+ */ + @SearchParamDefinition(name="code", path="OrderResponse.orderStatus", description="pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed
+ * Type: token
+ * Path: OrderResponse.orderStatus
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: When the response was made
+ * Type: date
+ * Path: OrderResponse.date
+ *

+ */ + @SearchParamDefinition(name="date", path="OrderResponse.date", description="When the response was made", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When the response was made
+ * Type: date
+ * Path: OrderResponse.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Identifiers assigned to this order by the orderer or by the receiver
+ * Type: token
+ * Path: OrderResponse.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="OrderResponse.identifier", description="Identifiers assigned to this order by the orderer or by the receiver", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Identifiers assigned to this order by the orderer or by the receiver
+ * Type: token
+ * Path: OrderResponse.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: who + *

+ * Description: Who made the response
+ * Type: reference
+ * Path: OrderResponse.who
+ *

+ */ + @SearchParamDefinition(name="who", path="OrderResponse.who", description="Who made the response", type="reference" ) + public static final String SP_WHO = "who"; + /** + * Fluent Client search parameter constant for who + *

+ * Description: Who made the response
+ * Type: reference
+ * Path: OrderResponse.who
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam WHO = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_WHO); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "OrderResponse:who". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_WHO = new ca.uhn.fhir.model.api.Include("OrderResponse:who").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OrderSet.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OrderSet.java new file mode 100644 index 00000000000..cfb83a7f4c4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/OrderSet.java @@ -0,0 +1,461 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support. + */ +@ResourceDef(name="OrderSet", profile="http://hl7.org/fhir/Profile/OrderSet") +public class OrderSet extends DomainResource { + + /** + * A reference to a ModuleMetadata resource containing metadata for the orderset. + */ + @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The metadata for the orderset", formalDefinition="A reference to a ModuleMetadata resource containing metadata for the orderset." ) + protected ModuleMetadata moduleMetadata; + + /** + * A reference to a Library resource containing any formal logic used by the orderset. + */ + @Child(name = "library", type = {Library.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Logic used by the orderset", formalDefinition="A reference to a Library resource containing any formal logic used by the orderset." ) + protected List library; + /** + * The actual objects that are the target of the reference (A reference to a Library resource containing any formal logic used by the orderset.) + */ + protected List libraryTarget; + + + /** + * The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions. + */ + @Child(name = "action", type = {ActionDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Groups, sections, and line items of the order set", formalDefinition="The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions." ) + protected List action; + + private static final long serialVersionUID = -728217200L; + + /** + * Constructor + */ + public OrderSet() { + super(); + } + + /** + * @return {@link #moduleMetadata} (A reference to a ModuleMetadata resource containing metadata for the orderset.) + */ + public ModuleMetadata getModuleMetadata() { + if (this.moduleMetadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderSet.moduleMetadata"); + else if (Configuration.doAutoCreate()) + this.moduleMetadata = new ModuleMetadata(); // cc + return this.moduleMetadata; + } + + public boolean hasModuleMetadata() { + return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); + } + + /** + * @param value {@link #moduleMetadata} (A reference to a ModuleMetadata resource containing metadata for the orderset.) + */ + public OrderSet setModuleMetadata(ModuleMetadata value) { + this.moduleMetadata = value; + return this; + } + + /** + * @return {@link #library} (A reference to a Library resource containing any formal logic used by the orderset.) + */ + public List getLibrary() { + if (this.library == null) + this.library = new ArrayList(); + return this.library; + } + + public boolean hasLibrary() { + if (this.library == null) + return false; + for (Reference item : this.library) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #library} (A reference to a Library resource containing any formal logic used by the orderset.) + */ + // syntactic sugar + public Reference addLibrary() { //3 + Reference t = new Reference(); + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return t; + } + + // syntactic sugar + public OrderSet addLibrary(Reference t) { //3 + if (t == null) + return this; + if (this.library == null) + this.library = new ArrayList(); + this.library.add(t); + return this; + } + + /** + * @return {@link #library} (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 reference to a Library resource containing any formal logic used by the orderset.) + */ + public List getLibraryTarget() { + if (this.libraryTarget == null) + this.libraryTarget = new ArrayList(); + return this.libraryTarget; + } + + // syntactic sugar + /** + * @return {@link #library} (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 reference to a Library resource containing any formal logic used by the orderset.) + */ + public Library addLibraryTarget() { + Library r = new Library(); + if (this.libraryTarget == null) + this.libraryTarget = new ArrayList(); + this.libraryTarget.add(r); + return r; + } + + /** + * @return {@link #action} (The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (ActionDefinition item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions.) + */ + // syntactic sugar + public ActionDefinition addAction() { //3 + ActionDefinition t = new ActionDefinition(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public OrderSet addAction(ActionDefinition t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "A reference to a ModuleMetadata resource containing metadata for the orderset.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); + childrenList.add(new Property("library", "Reference(Library)", "A reference to a Library resource containing any formal logic used by the orderset.", 0, java.lang.Integer.MAX_VALUE, library)); + childrenList.add(new Property("action", "ActionDefinition", "The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata + case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // Reference + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // ActionDefinition + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 455891387: // moduleMetadata + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + break; + case 166208699: // library + this.getLibrary().add(castToReference(value)); // Reference + break; + case -1422950858: // action + this.getAction().add(castToActionDefinition(value)); // ActionDefinition + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("moduleMetadata")) + this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata + else if (name.equals("library")) + this.getLibrary().add(castToReference(value)); + else if (name.equals("action")) + this.getAction().add(castToActionDefinition(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 455891387: return getModuleMetadata(); // ModuleMetadata + case 166208699: return addLibrary(); // Reference + case -1422950858: return addAction(); // ActionDefinition + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("moduleMetadata")) { + this.moduleMetadata = new ModuleMetadata(); + return this.moduleMetadata; + } + else if (name.equals("library")) { + return addLibrary(); + } + else if (name.equals("action")) { + return addAction(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "OrderSet"; + + } + + public OrderSet copy() { + OrderSet dst = new OrderSet(); + copyValues(dst); + dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); + if (library != null) { + dst.library = new ArrayList(); + for (Reference i : library) + dst.library.add(i.copy()); + }; + if (action != null) { + dst.action = new ArrayList(); + for (ActionDefinition i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + protected OrderSet typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OrderSet)) + return false; + OrderSet o = (OrderSet) other; + return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(library, o.library, true) + && compareDeep(action, o.action, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OrderSet)) + return false; + OrderSet o = (OrderSet) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (library == null || library.isEmpty()) + && (action == null || action.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OrderSet; + } + + /** + * Search parameter: topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: OrderSet.moduleMetadata.topic
+ *

+ */ + @SearchParamDefinition(name="topic", path="OrderSet.moduleMetadata.topic", description="Topics associated with the module", type="token" ) + public static final String SP_TOPIC = "topic"; + /** + * Fluent Client search parameter constant for topic + *

+ * Description: Topics associated with the module
+ * Type: token
+ * Path: OrderSet.moduleMetadata.topic
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); + + /** + * Search parameter: title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: OrderSet.moduleMetadata.title
+ *

+ */ + @SearchParamDefinition(name="title", path="OrderSet.moduleMetadata.title", description="Text search against the title", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Text search against the title
+ * Type: string
+ * Path: OrderSet.moduleMetadata.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: OrderSet.moduleMetadata.status
+ *

+ */ + @SearchParamDefinition(name="status", path="OrderSet.moduleMetadata.status", description="Status of the module", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Status of the module
+ * Type: token
+ * Path: OrderSet.moduleMetadata.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: OrderSet.moduleMetadata.description
+ *

+ */ + @SearchParamDefinition(name="description", path="OrderSet.moduleMetadata.description", description="Text search against the description", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search against the description
+ * Type: string
+ * Path: OrderSet.moduleMetadata.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: OrderSet.moduleMetadata.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="OrderSet.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Logical identifier for the module (e.g. CMS-143)
+ * Type: token
+ * Path: OrderSet.moduleMetadata.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: OrderSet.moduleMetadata.version
+ *

+ */ + @SearchParamDefinition(name="version", path="OrderSet.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: Version of the module (e.g. 1.0.0)
+ * Type: string
+ * Path: OrderSet.moduleMetadata.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Organization.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Organization.java new file mode 100644 index 00000000000..fe8d3c0228f --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Organization.java @@ -0,0 +1,1179 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * 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. + */ +@ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization") +public class Organization extends DomainResource { + + @Block() + public static class OrganizationContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates a purpose for which the contact can be reached. + */ + @Child(name = "purpose", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." ) + protected CodeableConcept purpose; + + /** + * A name associated with the contact. + */ + @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." ) + protected HumanName name; + + /** + * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contact details (telephone, email, etc.) for a contact", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." ) + protected List telecom; + + /** + * Visiting or postal addresses for the contact. + */ + @Child(name = "address", type = {Address.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." ) + protected Address address; + + private static final long serialVersionUID = 1831121305L; + + /** + * Constructor + */ + public OrganizationContactComponent() { + super(); + } + + /** + * @return {@link #purpose} (Indicates a purpose for which the contact can be reached.) + */ + public CodeableConcept getPurpose() { + if (this.purpose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.purpose"); + else if (Configuration.doAutoCreate()) + this.purpose = new CodeableConcept(); // cc + return this.purpose; + } + + public boolean hasPurpose() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + /** + * @param value {@link #purpose} (Indicates a purpose for which the contact can be reached.) + */ + public OrganizationContactComponent setPurpose(CodeableConcept value) { + this.purpose = value; + return this; + } + + /** + * @return {@link #name} (A name associated with the contact.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); // cc + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the contact.) + */ + public OrganizationContactComponent setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) + */ + 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 (e.g. a telephone number or an email address) by which the party may be contacted.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public OrganizationContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (Visiting or postal addresses for the contact.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); // cc + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Visiting or postal addresses for the contact.) + */ + public OrganizationContactComponent setAddress(Address value) { + this.address = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, java.lang.Integer.MAX_VALUE, purpose)); + childrenList.add(new Property("name", "HumanName", "A name associated with the contact.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, java.lang.Integer.MAX_VALUE, address)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // CodeableConcept + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -220463842: // purpose + this.purpose = castToCodeableConcept(value); // CodeableConcept + break; + case 3373707: // name + this.name = castToHumanName(value); // HumanName + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1147692044: // address + this.address = castToAddress(value); // Address + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("purpose")) + this.purpose = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("name")) + this.name = castToHumanName(value); // HumanName + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("address")) + this.address = castToAddress(value); // Address + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -220463842: return getPurpose(); // CodeableConcept + case 3373707: return getName(); // HumanName + case -1429363305: return addTelecom(); // ContactPoint + case -1147692044: return getAddress(); // Address + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("purpose")) { + this.purpose = new CodeableConcept(); + return this.purpose; + } + else if (name.equals("name")) { + this.name = new HumanName(); + return this.name; + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("address")) { + this.address = new Address(); + return this.address; + } + else + return super.addChild(name); + } + + public OrganizationContactComponent copy() { + OrganizationContactComponent dst = new OrganizationContactComponent(); + copyValues(dst); + dst.purpose = purpose == null ? null : purpose.copy(); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof OrganizationContactComponent)) + return false; + OrganizationContactComponent o = (OrganizationContactComponent) other; + return compareDeep(purpose, o.purpose, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(address, o.address, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof OrganizationContactComponent)) + return false; + OrganizationContactComponent o = (OrganizationContactComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (purpose == null || purpose.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()); + } + + public String fhirType() { + return "Organization.contact"; + + } + + } + + /** + * Identifier for the organization that is used to identify the organization across multiple disparate systems. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Identifies this organization across multiple systems", formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems." ) + protected List identifier; + + /** + * Whether the organization's record is still in active use. + */ + @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="Whether the organization's record is still in active use", formalDefinition="Whether the organization's record is still in active use." ) + protected BooleanType active; + + /** + * The kind of organization that this is. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Kind of organization", formalDefinition="The kind of organization that this is." ) + protected CodeableConcept type; + + /** + * A name associated with the organization. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name used for the organization", formalDefinition="A name associated with the organization." ) + protected StringType name; + + /** + * A contact detail for the organization. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A contact detail for the organization", formalDefinition="A contact detail for the organization." ) + protected List telecom; + + /** + * An address for the organization. + */ + @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." ) + protected List
address; + + /** + * The organization of which this organization forms a part. + */ + @Child(name = "partOf", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The organization of which this organization forms a part", formalDefinition="The organization of which this organization forms a part." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (The organization of which this organization forms a part.) + */ + protected Organization partOfTarget; + + /** + * Contact for the organization for a certain purpose. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Contact for the organization for a certain purpose", formalDefinition="Contact for the organization for a certain purpose." ) + protected List contact; + + private static final long serialVersionUID = -749567123L; + + /** + * Constructor + */ + public Organization() { + super(); + } + + /** + * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) + */ + 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 the organization that is used to identify the organization across multiple disparate systems.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Organization addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #active} (Whether the organization's record is still 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 Organization.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); // bb + 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 the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Organization setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether the organization's record is still in active use. + */ + public boolean getActive() { + return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Whether the organization's record is still in active use. + */ + public Organization setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + /** + * @return {@link #type} (The kind of organization that this is.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The kind of organization that this is.) + */ + public Organization setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #name} (A name associated with the organization.). 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 Organization.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Organization setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name associated with the organization. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name associated with the organization. + */ + public Organization setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the organization.) + */ + 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 organization.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Organization addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (An address for the organization.) + */ + 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} (An address for the organization.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + // syntactic sugar + public Organization addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @return {@link #partOf} (The organization of which this organization forms a part.) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); // cc + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (The organization of which this organization forms a part.) + */ + public Organization setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} 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 of which this organization forms a part.) + */ + public Organization getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Organization(); // aa + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} 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 of which this organization forms a part.) + */ + public Organization setPartOfTarget(Organization value) { + this.partOfTarget = value; + return this; + } + + /** + * @return {@link #contact} (Contact for the organization for a certain purpose.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (OrganizationContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contact for the organization for a certain purpose.) + */ + // syntactic sugar + public OrganizationContactComponent addContact() { //3 + OrganizationContactComponent t = new OrganizationContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Organization addContact(OrganizationContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the organization across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + childrenList.add(new Property("type", "CodeableConcept", "The kind of organization that this is.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("name", "string", "A name associated with the organization.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("partOf", "Reference(Organization)", "The organization of which this organization forms a part.", 0, java.lang.Integer.MAX_VALUE, partOf)); + childrenList.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address + case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : new Base[] {this.partOf}; // Reference + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // OrganizationContactComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1422950650: // active + this.active = castToBoolean(value); // BooleanType + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1147692044: // address + this.getAddress().add(castToAddress(value)); // Address + break; + case -995410646: // partOf + this.partOf = castToReference(value); // Reference + break; + case 951526432: // contact + this.getContact().add((OrganizationContactComponent) value); // OrganizationContactComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("active")) + this.active = castToBoolean(value); // BooleanType + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("address")) + this.getAddress().add(castToAddress(value)); + else if (name.equals("partOf")) + this.partOf = castToReference(value); // Reference + else if (name.equals("contact")) + this.getContact().add((OrganizationContactComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType + case 3575610: return getType(); // CodeableConcept + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + case -1147692044: return addAddress(); // Address + case -995410646: return getPartOf(); // Reference + case 951526432: return addContact(); // OrganizationContactComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("active")) { + throw new FHIRException("Cannot call addChild on a primitive type Organization.active"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Organization.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("address")) { + return addAddress(); + } + else if (name.equals("partOf")) { + this.partOf = new Reference(); + return this.partOf; + } + else if (name.equals("contact")) { + return addContact(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Organization"; + + } + + public Organization copy() { + Organization dst = new Organization(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.active = active == null ? null : active.copy(); + dst.type = type == null ? null : type.copy(); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.partOf = partOf == null ? null : partOf.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (OrganizationContactComponent i : contact) + dst.contact.add(i.copy()); + }; + return dst; + } + + protected Organization typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Organization)) + return false; + Organization o = (Organization) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(type, o.type, true) + && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) + && compareDeep(partOf, o.partOf, true) && compareDeep(contact, o.contact, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Organization)) + return false; + Organization o = (Organization) other; + return compareValues(active, o.active, true) && compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) + && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + && (address == null || address.isEmpty()) && (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Organization; + } + + /** + * Search parameter: address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Organization.address.state
+ *

+ */ + @SearchParamDefinition(name="address-state", path="Organization.address.state", description="A state specified in an address", type="string" ) + public static final String SP_ADDRESS_STATE = "address-state"; + /** + * Fluent Client search parameter constant for address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Organization.address.state
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); + + /** + * Search parameter: address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Organization.address.city
+ *

+ */ + @SearchParamDefinition(name="address-city", path="Organization.address.city", description="A city specified in an address", type="string" ) + public static final String SP_ADDRESS_CITY = "address-city"; + /** + * Fluent Client search parameter constant for address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Organization.address.city
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); + + /** + * Search parameter: phonetic + *

+ * Description: A portion of the organization's name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Organization.name
+ *

+ */ + @SearchParamDefinition(name="phonetic", path="Organization.name", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + /** + * Fluent Client search parameter constant for phonetic + *

+ * Description: A portion of the organization's name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Organization.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); + + /** + * Search parameter: partof + *

+ * Description: Search all organizations that are part of the given organization
+ * Type: reference
+ * Path: Organization.partOf
+ *

+ */ + @SearchParamDefinition(name="partof", path="Organization.partOf", description="Search all organizations that are part of the given organization", type="reference" ) + public static final String SP_PARTOF = "partof"; + /** + * Fluent Client search parameter constant for partof + *

+ * Description: Search all organizations that are part of the given organization
+ * Type: reference
+ * Path: Organization.partOf
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Organization:partof". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("Organization:partof").toLocked(); + + /** + * Search parameter: address + *

+ * Description: A (part of the) address of the Organization
+ * Type: string
+ * Path: Organization.address
+ *

+ */ + @SearchParamDefinition(name="address", path="Organization.address", description="A (part of the) address of the Organization", type="string" ) + public static final String SP_ADDRESS = "address"; + /** + * Fluent Client search parameter constant for address + *

+ * Description: A (part of the) address of the Organization
+ * Type: string
+ * Path: Organization.address
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); + + /** + * Search parameter: address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Organization.address.use
+ *

+ */ + @SearchParamDefinition(name="address-use", path="Organization.address.use", description="A use code specified in an address", type="token" ) + public static final String SP_ADDRESS_USE = "address-use"; + /** + * Fluent Client search parameter constant for address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Organization.address.use
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); + + /** + * Search parameter: name + *

+ * Description: A portion of the organization's name
+ * Type: string
+ * Path: Organization.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Organization.name", description="A portion of the organization's name", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: A portion of the organization's name
+ * Type: string
+ * Path: Organization.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Organization.address.country
+ *

+ */ + @SearchParamDefinition(name="address-country", path="Organization.address.country", description="A country specified in an address", type="string" ) + public static final String SP_ADDRESS_COUNTRY = "address-country"; + /** + * Fluent Client search parameter constant for address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Organization.address.country
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + + /** + * Search parameter: active + *

+ * Description: Whether the organization's record is active
+ * Type: token
+ * Path: Organization.active
+ *

+ */ + @SearchParamDefinition(name="active", path="Organization.active", description="Whether the organization's record is active", type="token" ) + public static final String SP_ACTIVE = "active"; + /** + * Fluent Client search parameter constant for active + *

+ * Description: Whether the organization's record is active
+ * Type: token
+ * Path: Organization.active
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVE); + + /** + * Search parameter: type + *

+ * Description: A code for the type of organization
+ * Type: token
+ * Path: Organization.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Organization.type", description="A code for the type of organization", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: A code for the type of organization
+ * Type: token
+ * Path: Organization.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: Any identifier for the organization (not the accreditation issuer's identifier)
+ * Type: token
+ * Path: Organization.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Organization.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Any identifier for the organization (not the accreditation issuer's identifier)
+ * Type: token
+ * Path: Organization.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: address-postalcode + *

+ * Description: A postal code specified in an address
+ * Type: string
+ * Path: Organization.address.postalCode
+ *

+ */ + @SearchParamDefinition(name="address-postalcode", path="Organization.address.postalCode", description="A postal code specified in an address", type="string" ) + public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; + /** + * Fluent Client search parameter constant for address-postalcode + *

+ * Description: A postal code specified in an address
+ * Type: string
+ * Path: Organization.address.postalCode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ParameterDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ParameterDefinition.java new file mode 100644 index 00000000000..bfc9858c4de --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ParameterDefinition.java @@ -0,0 +1,618 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. + */ +@DatatypeDef(name="ParameterDefinition") +public class ParameterDefinition extends Type implements ICompositeType { + + /** + * The name of the parameter. + */ + @Child(name = "name", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Parameter name", formalDefinition="The name of the parameter." ) + protected CodeType name; + + /** + * Whether the parameter is input or output for the module. + */ + @Child(name = "use", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="Whether the parameter is input or output for the module." ) + protected CodeType use; + + /** + * The minimum number of times this parameter SHALL appear in the request or response. + */ + @Child(name = "min", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @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=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Maximum cardinality (a number of *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) + protected StringType max; + + /** + * A brief discussion of what the parameter is for and how it is used by the module. + */ + @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A brief description of the parameter", formalDefinition="A brief discussion of what the parameter is for and how it is used by the module." ) + protected StringType documentation; + + /** + * The type of the parameter. + */ + @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="The type of the parameter." ) + protected CodeType type; + + /** + * If specified, this indicates a profile that the input data must conform to, or that the output data will conform to. + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The profile of the parameter, any", formalDefinition="If specified, this indicates a profile that the input data must conform to, or that the output data will conform to." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) + */ + protected StructureDefinition profileTarget; + + private static final long serialVersionUID = -1284894445L; + + /** + * Constructor + */ + public ParameterDefinition() { + super(); + } + + /** + * Constructor + */ + public ParameterDefinition(CodeType use, CodeType type) { + super(); + this.use = use; + this.type = type; + } + + /** + * @return {@link #name} (The name of 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 ParameterDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeType(); // bb + 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.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ParameterDefinition setNameElement(CodeType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter. + */ + public ParameterDefinition setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new CodeType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public CodeType getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ParameterDefinition.use"); + else if (Configuration.doAutoCreate()) + this.use = new CodeType(); // bb + 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} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public ParameterDefinition setUseElement(CodeType value) { + this.use = value; + return this; + } + + /** + * @return Whether the parameter is input or output for the module. + */ + public String getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Whether the parameter is input or output for the module. + */ + public ParameterDefinition setUse(String value) { + if (this.use == null) + this.use = new CodeType(); + this.use.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 ParameterDefinition.min"); + else if (Configuration.doAutoCreate()) + this.min = new IntegerType(); // bb + 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 ParameterDefinition 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 || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value The minimum number of times this parameter SHALL appear in the request or response. + */ + public ParameterDefinition 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 ParameterDefinition.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + 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 ParameterDefinition 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 ParameterDefinition setMax(String value) { + if (Utilities.noString(value)) + this.max = null; + else { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + } + return this; + } + + /** + * @return {@link #documentation} (A brief discussion of what the parameter is for and how it is used by the module.). 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 ParameterDefinition.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (A brief discussion of what the parameter is for and how it is used by the module.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ParameterDefinition setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return A brief discussion of what the parameter is for and how it is used by the module. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value A brief discussion of what the parameter is for and how it is used by the module. + */ + public ParameterDefinition 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 of the 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 ParameterDefinition.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); // bb + 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 of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ParameterDefinition setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of the parameter. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the parameter. + */ + public ParameterDefinition setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ParameterDefinition.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) + */ + public ParameterDefinition 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. (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ParameterDefinition.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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. (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) + */ + public ParameterDefinition setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "code", "The name of the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("use", "code", "Whether the parameter is input or output for the module.", 0, java.lang.Integer.MAX_VALUE, use)); + 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", "A brief discussion of what the parameter is for and how it is used by the module.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("type", "code", "The type of the parameter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // CodeType + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // CodeType + case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType + case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToCode(value); // CodeType + break; + case 116103: // use + this.use = castToCode(value); // CodeType + break; + case 108114: // min + this.min = castToInteger(value); // IntegerType + break; + case 107876: // max + this.max = castToString(value); // StringType + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + case 3575610: // type + this.type = castToCode(value); // CodeType + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToCode(value); // CodeType + else if (name.equals("use")) + this.use = castToCode(value); // CodeType + else if (name.equals("min")) + this.min = castToInteger(value); // IntegerType + else if (name.equals("max")) + this.max = castToString(value); // StringType + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else if (name.equals("type")) + this.type = castToCode(value); // CodeType + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // CodeType + case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // CodeType + case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType + case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType + case -309425751: return getProfile(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.name"); + } + else if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.use"); + } + else if (name.equals("min")) { + throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.min"); + } + else if (name.equals("max")) { + throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.max"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.documentation"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.type"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ParameterDefinition"; + + } + + public ParameterDefinition copy() { + ParameterDefinition dst = new ParameterDefinition(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.use = use == null ? null : use.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; + } + + protected ParameterDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ParameterDefinition)) + return false; + ParameterDefinition o = (ParameterDefinition) other; + return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true) + && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) + && compareDeep(profile, o.profile, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ParameterDefinition)) + return false; + ParameterDefinition o = (ParameterDefinition) other; + return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true) + && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true) + ; + } + + 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()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Parameters.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Parameters.java new file mode 100644 index 00000000000..b53662d0f7e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Parameters.java @@ -0,0 +1,638 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.instance.model.api.IBaseParameters; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +/** + * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. + */ +@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/Profile/Parameters") +public class Parameters extends Resource implements IBaseParameters { + + @Block() + public static class ParametersParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the parameter (reference to the operation definition). + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) + protected StringType name; + + /** + * If the parameter is a data type. + */ + @Child(name = "value", type = {}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." ) + protected org.hl7.fhir.dstu2016may.model.Type value; + + /** + * If the parameter is a whole resource. + */ + @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) + protected Resource resource; + + /** + * A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple". + */ + @Child(name = "part", type = {ParametersParameterComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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 = -839605058L; + + /** + * Constructor + */ + public ParametersParameterComponent() { + super(); + } + + /** + * Constructor + */ + public ParametersParameterComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @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 ParametersParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 ParametersParameterComponent 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 ParametersParameterComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (If the parameter is a data type.) + */ + public org.hl7.fhir.dstu2016may.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (If the parameter is a data type.) + */ + public ParametersParameterComponent setValue(org.hl7.fhir.dstu2016may.model.Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #resource} (If the parameter is a whole resource.) + */ + public Resource getResource() { + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (If the parameter is a whole resource.) + */ + public ParametersParameterComponent setResource(Resource value) { + this.resource = value; + 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 (ParametersParameterComponent 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 ParametersParameterComponent addPart() { //3 + ParametersParameterComponent t = new ParametersParameterComponent(); + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return t; + } + + // syntactic sugar + public ParametersParameterComponent addPart(ParametersParameterComponent t) { //3 + if (t == null) + return this; + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + 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]", "*", "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", "@Parameters.parameter", "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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu2016may.model.Type + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource + case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // ParametersParameterComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 111972721: // value + this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + case -341064690: // resource + this.resource = castToResource(value); // Resource + break; + case 3433459: // part + this.getPart().add((ParametersParameterComponent) value); // ParametersParameterComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("value[x]")) + this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else if (name.equals("resource")) + this.resource = castToResource(value); // Resource + else if (name.equals("part")) + this.getPart().add((ParametersParameterComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1410166417: return getValue(); // org.hl7.fhir.dstu2016may.model.Type + case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource + case 3433459: return addPart(); // ParametersParameterComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Parameters.name"); + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDecimal")) { + this.value = new DecimalType(); + return this.value; + } + else if (name.equals("valueBase64Binary")) { + this.value = new Base64BinaryType(); + return this.value; + } + else if (name.equals("valueInstant")) { + this.value = new InstantType(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueUri")) { + this.value = new UriType(); + return this.value; + } + else if (name.equals("valueDate")) { + this.value = new DateType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueCode")) { + this.value = new CodeType(); + return this.value; + } + else if (name.equals("valueOid")) { + this.value = new OidType(); + return this.value; + } + else if (name.equals("valueId")) { + this.value = new IdType(); + return this.value; + } + else if (name.equals("valueUnsignedInt")) { + this.value = new UnsignedIntType(); + return this.value; + } + else if (name.equals("valuePositiveInt")) { + this.value = new PositiveIntType(); + return this.value; + } + else if (name.equals("valueMarkdown")) { + this.value = new MarkdownType(); + return this.value; + } + else if (name.equals("valueAnnotation")) { + this.value = new Annotation(); + return this.value; + } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueIdentifier")) { + this.value = new Identifier(); + return this.value; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueCoding")) { + this.value = new Coding(); + return this.value; + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else if (name.equals("valueRatio")) { + this.value = new Ratio(); + return this.value; + } + else if (name.equals("valueSampledData")) { + this.value = new SampledData(); + return this.value; + } + else if (name.equals("valueSignature")) { + this.value = new Signature(); + return this.value; + } + else if (name.equals("valueHumanName")) { + this.value = new HumanName(); + return this.value; + } + else if (name.equals("valueAddress")) { + this.value = new Address(); + return this.value; + } + else if (name.equals("valueContactPoint")) { + this.value = new ContactPoint(); + return this.value; + } + else if (name.equals("valueTiming")) { + this.value = new Timing(); + return this.value; + } + else if (name.equals("valueReference")) { + this.value = new Reference(); + return this.value; + } + else if (name.equals("valueMeta")) { + this.value = new Meta(); + return this.value; + } + else if (name.equals("resource")) { + throw new FHIRException("Cannot call addChild on an abstract type Parameters.resource"); + } + else if (name.equals("part")) { + return addPart(); + } + else + return super.addChild(name); + } + + public ParametersParameterComponent copy() { + ParametersParameterComponent dst = new ParametersParameterComponent(); + copyValues(dst); + 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 (ParametersParameterComponent i : part) + dst.part.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ParametersParameterComponent)) + return false; + ParametersParameterComponent o = (ParametersParameterComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true) + && compareDeep(part, o.part, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ParametersParameterComponent)) + return false; + ParametersParameterComponent o = (ParametersParameterComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + && (resource == null || resource.isEmpty()) && (part == null || part.isEmpty()); + } + + public String fhirType() { + return "null"; + + } + + } + + /** + * A parameter passed to or received from the operation. + */ + @Child(name = "parameter", type = {}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." ) + protected List parameter; + + private static final long serialVersionUID = -1495940293L; + + /** + * Constructor + */ + public Parameters() { + super(); + } + + /** + * @return {@link #parameter} (A parameter passed to or received from the operation.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (ParametersParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (A parameter passed to or received from the operation.) + */ + // syntactic sugar + public ParametersParameterComponent addParameter() { //3 + ParametersParameterComponent t = new ParametersParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public Parameters addParameter(ParametersParameterComponent t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParametersParameterComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1954460585: // parameter + this.getParameter().add((ParametersParameterComponent) value); // ParametersParameterComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("parameter")) + this.getParameter().add((ParametersParameterComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1954460585: return addParameter(); // ParametersParameterComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("parameter")) { + return addParameter(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Parameters"; + + } + + public Parameters copy() { + Parameters dst = new Parameters(); + copyValues(dst); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (ParametersParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + return dst; + } + + protected Parameters typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Parameters)) + return false; + Parameters o = (Parameters) other; + return compareDeep(parameter, o.parameter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Parameters)) + return false; + Parameters o = (Parameters) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (parameter == null || parameter.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Parameters; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Patient.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Patient.java new file mode 100644 index 00000000000..39a5c5081f6 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Patient.java @@ -0,0 +1,3013 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Demographics and other administrative information about an individual or animal receiving care or other health-related services. + */ +@ResourceDef(name="Patient", profile="http://hl7.org/fhir/Profile/Patient") +public class Patient extends DomainResource { + + public enum LinkType { + /** + * 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 this link. + */ + REPLACE, + /** + * The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. + */ + REFER, + /** + * The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. + */ + SEEALSO, + /** + * added to help the parsers + */ + NULL; + public static LinkType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("replace".equals(codeString)) + return REPLACE; + if ("refer".equals(codeString)) + return REFER; + if ("seealso".equals(codeString)) + return SEEALSO; + throw new FHIRException("Unknown LinkType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REPLACE: return "replace"; + case REFER: return "refer"; + case SEEALSO: return "seealso"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REPLACE: return "http://hl7.org/fhir/link-type"; + case REFER: return "http://hl7.org/fhir/link-type"; + case SEEALSO: return "http://hl7.org/fhir/link-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REPLACE: return "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 this link."; + case REFER: return "The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information."; + case SEEALSO: return "The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REPLACE: return "Replace"; + case REFER: return "Refer"; + case SEEALSO: return "See also"; + default: return "?"; + } + } + } + + 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; + if ("replace".equals(codeString)) + return LinkType.REPLACE; + if ("refer".equals(codeString)) + return LinkType.REFER; + if ("seealso".equals(codeString)) + return LinkType.SEEALSO; + throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("replace".equals(codeString)) + return new Enumeration(this, LinkType.REPLACE); + if ("refer".equals(codeString)) + return new Enumeration(this, LinkType.REFER); + if ("seealso".equals(codeString)) + return new Enumeration(this, LinkType.SEEALSO); + throw new FHIRException("Unknown LinkType code '"+codeString+"'"); + } + public String toCode(LinkType code) { + if (code == LinkType.REPLACE) + return "replace"; + if (code == LinkType.REFER) + return "refer"; + if (code == LinkType.SEEALSO) + return "seealso"; + return "?"; + } + public String toSystem(LinkType code) { + return code.getSystem(); + } + } + + @Block() + public static class ContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The nature of the relationship between the patient and the contact person. + */ + @Child(name = "relationship", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The kind of relationship", formalDefinition="The nature of the relationship between the patient and the contact person." ) + protected List relationship; + + /** + * A name associated with the contact person. + */ + @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="A name associated with the contact person", formalDefinition="A name associated with the contact person." ) + protected HumanName name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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; + + /** + * Address for the contact person. + */ + @Child(name = "address", type = {Address.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." ) + protected Address address; + + /** + * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * Organization on behalf of which the contact is acting or for which the contact is working. + */ + @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Organization that is associated with the contact", formalDefinition="Organization on behalf of which the contact is acting or for which the contact is working." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + protected Organization organizationTarget; + + /** + * The period during which this contact person or organization is valid to be contacted relating to this patient. + */ + @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient", formalDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient." ) + protected Period period; + + private static final long serialVersionUID = 364269017L; + + /** + * Constructor + */ + public ContactComponent() { + super(); + } + + /** + * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) + */ + public List getRelationship() { + if (this.relationship == null) + this.relationship = new ArrayList(); + return this.relationship; + } + + public boolean hasRelationship() { + if (this.relationship == null) + return false; + for (CodeableConcept item : this.relationship) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) + */ + // syntactic sugar + public CodeableConcept addRelationship() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.relationship == null) + this.relationship = new ArrayList(); + this.relationship.add(t); + return t; + } + + // syntactic sugar + public ContactComponent addRelationship(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.relationship == null) + this.relationship = new ArrayList(); + this.relationship.add(t); + return this; + } + + /** + * @return {@link #name} (A name associated with the contact person.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); // cc + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the contact person.) + */ + public ContactComponent setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @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; + } + + // syntactic sugar + public ContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (Address for the contact person.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); // cc + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Address for the contact person.) + */ + public ContactComponent setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.). 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 ContactComponent.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + 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 - the gender that the contact person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public ContactComponent setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. + */ + public ContactComponent setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public ContactComponent 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. (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + 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. (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public ContactComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.) + */ + public ContactComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between the patient and the contact person.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("name", "HumanName", "A name associated with the contact 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("address", "Address", "Address for the contact person.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("organization", "Reference(Organization)", "Organization on behalf of which the contact is acting or for which the contact is working.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("period", "Period", "The period during which this contact person or organization is valid to be contacted relating to this patient.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : this.relationship.toArray(new Base[this.relationship.size()]); // CodeableConcept + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address + case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -261851592: // relationship + this.getRelationship().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 3373707: // name + this.name = castToHumanName(value); // HumanName + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1147692044: // address + this.address = castToAddress(value); // Address + break; + case -1249512767: // gender + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + break; + case 1178922291: // organization + this.organization = castToReference(value); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("relationship")) + this.getRelationship().add(castToCodeableConcept(value)); + else if (name.equals("name")) + this.name = castToHumanName(value); // HumanName + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("address")) + this.address = castToAddress(value); // Address + else if (name.equals("gender")) + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + else if (name.equals("organization")) + this.organization = castToReference(value); // Reference + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -261851592: return addRelationship(); // CodeableConcept + case 3373707: return getName(); // HumanName + case -1429363305: return addTelecom(); // ContactPoint + case -1147692044: return getAddress(); // Address + case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration + case 1178922291: return getOrganization(); // Reference + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("relationship")) { + return addRelationship(); + } + else if (name.equals("name")) { + this.name = new HumanName(); + return this.name; + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("address")) { + this.address = new Address(); + return this.address; + } + else if (name.equals("gender")) { + throw new FHIRException("Cannot call addChild on a primitive type Patient.gender"); + } + else if (name.equals("organization")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public ContactComponent copy() { + ContactComponent dst = new ContactComponent(); + copyValues(dst); + if (relationship != null) { + dst.relationship = new ArrayList(); + for (CodeableConcept i : relationship) + dst.relationship.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + dst.gender = gender == null ? null : gender.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ContactComponent)) + return false; + ContactComponent o = (ContactComponent) other; + return compareDeep(relationship, o.relationship, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) && compareDeep(organization, o.organization, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ContactComponent)) + return false; + ContactComponent o = (ContactComponent) other; + return compareValues(gender, o.gender, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) + && (organization == null || organization.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + public String fhirType() { + return "Patient.contact"; + + } + + } + + @Block() + public static class AnimalComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the high level taxonomic categorization of the kind of animal. + */ + @Child(name = "species", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="E.g. Dog, Cow", formalDefinition="Identifies the high level taxonomic categorization of the kind of animal." ) + protected CodeableConcept species; + + /** + * Identifies the detailed categorization of the kind of animal. + */ + @Child(name = "breed", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="E.g. Poodle, Angus", formalDefinition="Identifies the detailed categorization of the kind of animal." ) + protected CodeableConcept breed; + + /** + * Indicates the current state of the animal's reproductive organs. + */ + @Child(name = "genderStatus", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="E.g. Neutered, Intact", formalDefinition="Indicates the current state of the animal's reproductive organs." ) + protected CodeableConcept genderStatus; + + private static final long serialVersionUID = -549738382L; + + /** + * Constructor + */ + public AnimalComponent() { + super(); + } + + /** + * Constructor + */ + public AnimalComponent(CodeableConcept species) { + super(); + this.species = species; + } + + /** + * @return {@link #species} (Identifies the high level taxonomic categorization of the kind of animal.) + */ + public CodeableConcept getSpecies() { + if (this.species == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.species"); + else if (Configuration.doAutoCreate()) + this.species = new CodeableConcept(); // cc + return this.species; + } + + public boolean hasSpecies() { + return this.species != null && !this.species.isEmpty(); + } + + /** + * @param value {@link #species} (Identifies the high level taxonomic categorization of the kind of animal.) + */ + public AnimalComponent setSpecies(CodeableConcept value) { + this.species = value; + return this; + } + + /** + * @return {@link #breed} (Identifies the detailed categorization of the kind of animal.) + */ + public CodeableConcept getBreed() { + if (this.breed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.breed"); + else if (Configuration.doAutoCreate()) + this.breed = new CodeableConcept(); // cc + return this.breed; + } + + public boolean hasBreed() { + return this.breed != null && !this.breed.isEmpty(); + } + + /** + * @param value {@link #breed} (Identifies the detailed categorization of the kind of animal.) + */ + public AnimalComponent setBreed(CodeableConcept value) { + this.breed = value; + return this; + } + + /** + * @return {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) + */ + public CodeableConcept getGenderStatus() { + if (this.genderStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.genderStatus"); + else if (Configuration.doAutoCreate()) + this.genderStatus = new CodeableConcept(); // cc + return this.genderStatus; + } + + public boolean hasGenderStatus() { + return this.genderStatus != null && !this.genderStatus.isEmpty(); + } + + /** + * @param value {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) + */ + public AnimalComponent setGenderStatus(CodeableConcept value) { + this.genderStatus = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("species", "CodeableConcept", "Identifies the high level taxonomic categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, species)); + childrenList.add(new Property("breed", "CodeableConcept", "Identifies the detailed categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, breed)); + childrenList.add(new Property("genderStatus", "CodeableConcept", "Indicates the current state of the animal's reproductive organs.", 0, java.lang.Integer.MAX_VALUE, genderStatus)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -2008465092: /*species*/ return this.species == null ? new Base[0] : new Base[] {this.species}; // CodeableConcept + case 94001524: /*breed*/ return this.breed == null ? new Base[0] : new Base[] {this.breed}; // CodeableConcept + case -678569453: /*genderStatus*/ return this.genderStatus == null ? new Base[0] : new Base[] {this.genderStatus}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -2008465092: // species + this.species = castToCodeableConcept(value); // CodeableConcept + break; + case 94001524: // breed + this.breed = castToCodeableConcept(value); // CodeableConcept + break; + case -678569453: // genderStatus + this.genderStatus = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("species")) + this.species = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("breed")) + this.breed = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("genderStatus")) + this.genderStatus = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -2008465092: return getSpecies(); // CodeableConcept + case 94001524: return getBreed(); // CodeableConcept + case -678569453: return getGenderStatus(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("species")) { + this.species = new CodeableConcept(); + return this.species; + } + else if (name.equals("breed")) { + this.breed = new CodeableConcept(); + return this.breed; + } + else if (name.equals("genderStatus")) { + this.genderStatus = new CodeableConcept(); + return this.genderStatus; + } + else + return super.addChild(name); + } + + public AnimalComponent copy() { + AnimalComponent dst = new AnimalComponent(); + copyValues(dst); + dst.species = species == null ? null : species.copy(); + dst.breed = breed == null ? null : breed.copy(); + dst.genderStatus = genderStatus == null ? null : genderStatus.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof AnimalComponent)) + return false; + AnimalComponent o = (AnimalComponent) other; + return compareDeep(species, o.species, true) && compareDeep(breed, o.breed, true) && compareDeep(genderStatus, o.genderStatus, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof AnimalComponent)) + return false; + AnimalComponent o = (AnimalComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (species == null || species.isEmpty()) && (breed == null || breed.isEmpty()) + && (genderStatus == null || genderStatus.isEmpty()); + } + + public String fhirType() { + return "Patient.animal"; + + } + + } + + @Block() + public static class PatientCommunicationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. + */ + @Child(name = "language", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The language which can be used to communicate with the patient about his or her health", formalDefinition="The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English." ) + protected CodeableConcept language; + + /** + * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). + */ + @Child(name = "preferred", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Language preference indicator", formalDefinition="Indicates whether or not the patient prefers this language (over other languages he masters up a certain level)." ) + protected BooleanType preferred; + + private static final long serialVersionUID = 633792918L; + + /** + * Constructor + */ + public PatientCommunicationComponent() { + super(); + } + + /** + * Constructor + */ + public PatientCommunicationComponent(CodeableConcept language) { + super(); + this.language = language; + } + + /** + * @return {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) + */ + public CodeableConcept getLanguage() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientCommunicationComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeableConcept(); // cc + return this.language; + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) + */ + public PatientCommunicationComponent setLanguage(CodeableConcept value) { + this.language = value; + return this; + } + + /** + * @return {@link #preferred} (Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public BooleanType getPreferredElement() { + if (this.preferred == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientCommunicationComponent.preferred"); + else if (Configuration.doAutoCreate()) + this.preferred = new BooleanType(); // bb + return this.preferred; + } + + public boolean hasPreferredElement() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + public boolean hasPreferred() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + /** + * @param value {@link #preferred} (Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public PatientCommunicationComponent setPreferredElement(BooleanType value) { + this.preferred = value; + return this; + } + + /** + * @return Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). + */ + public boolean getPreferred() { + return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); + } + + /** + * @param value Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). + */ + public PatientCommunicationComponent setPreferred(boolean value) { + if (this.preferred == null) + this.preferred = new BooleanType(); + this.preferred.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("language", "CodeableConcept", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("preferred", "boolean", "Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).", 0, java.lang.Integer.MAX_VALUE, preferred)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept + case -1294005119: /*preferred*/ return this.preferred == null ? new Base[0] : new Base[] {this.preferred}; // BooleanType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1613589672: // language + this.language = castToCodeableConcept(value); // CodeableConcept + break; + case -1294005119: // preferred + this.preferred = castToBoolean(value); // BooleanType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("language")) + this.language = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("preferred")) + this.preferred = castToBoolean(value); // BooleanType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1613589672: return getLanguage(); // CodeableConcept + case -1294005119: throw new FHIRException("Cannot make property preferred as it is not a complex type"); // BooleanType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("language")) { + this.language = new CodeableConcept(); + return this.language; + } + else if (name.equals("preferred")) { + throw new FHIRException("Cannot call addChild on a primitive type Patient.preferred"); + } + else + return super.addChild(name); + } + + public PatientCommunicationComponent copy() { + PatientCommunicationComponent dst = new PatientCommunicationComponent(); + copyValues(dst); + dst.language = language == null ? null : language.copy(); + dst.preferred = preferred == null ? null : preferred.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PatientCommunicationComponent)) + return false; + PatientCommunicationComponent o = (PatientCommunicationComponent) other; + return compareDeep(language, o.language, true) && compareDeep(preferred, o.preferred, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PatientCommunicationComponent)) + return false; + PatientCommunicationComponent o = (PatientCommunicationComponent) other; + return compareValues(preferred, o.preferred, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (language == null || language.isEmpty()) && (preferred == null || preferred.isEmpty()) + ; + } + + public String fhirType() { + return "Patient.communication"; + + } + + } + + @Block() + public static class PatientLinkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The other patient resource that the link refers to. + */ + @Child(name = "other", type = {Patient.class}, order=1, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="The other patient resource that the link refers to", formalDefinition="The other patient resource that the link refers to." ) + protected Reference other; + + /** + * The actual object that is the target of the reference (The other patient resource that the link refers to.) + */ + protected Patient otherTarget; + + /** + * The type of link between this patient resource and another patient resource. + */ + @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="replace | refer | seealso - type of link", formalDefinition="The type of link between this patient resource and another patient resource." ) + protected Enumeration type; + + private static final long serialVersionUID = -1942104050L; + + /** + * Constructor + */ + public PatientLinkComponent() { + super(); + } + + /** + * Constructor + */ + public PatientLinkComponent(Reference other, Enumeration type) { + super(); + this.other = other; + this.type = type; + } + + /** + * @return {@link #other} (The other patient resource that the link refers to.) + */ + public Reference getOther() { + if (this.other == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientLinkComponent.other"); + else if (Configuration.doAutoCreate()) + this.other = new Reference(); // cc + return this.other; + } + + public boolean hasOther() { + return this.other != null && !this.other.isEmpty(); + } + + /** + * @param value {@link #other} (The other patient resource that the link refers to.) + */ + public PatientLinkComponent 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 other patient resource that the link refers to.) + */ + public Patient getOtherTarget() { + if (this.otherTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientLinkComponent.other"); + else if (Configuration.doAutoCreate()) + this.otherTarget = new Patient(); // aa + 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 other patient resource that the link refers to.) + */ + public PatientLinkComponent setOtherTarget(Patient value) { + this.otherTarget = value; + return this; + } + + /** + * @return {@link #type} (The type of link between this patient resource and another patient resource.). 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 PatientLinkComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new LinkTypeEnumFactory()); // bb + 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 of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public PatientLinkComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of link between this patient resource and another patient resource. + */ + public LinkType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of link between this patient resource and another patient resource. + */ + public PatientLinkComponent setType(LinkType value) { + if (this.type == null) + this.type = new Enumeration(new LinkTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("other", "Reference(Patient)", "The other patient resource that the link refers to.", 0, java.lang.Integer.MAX_VALUE, other)); + childrenList.add(new Property("type", "code", "The type of link between this patient resource and another patient resource.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 106069776: /*other*/ return this.other == null ? new Base[0] : new Base[] {this.other}; // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 106069776: // other + this.other = castToReference(value); // Reference + break; + case 3575610: // type + this.type = new LinkTypeEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("other")) + this.other = castToReference(value); // Reference + else if (name.equals("type")) + this.type = new LinkTypeEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 106069776: return getOther(); // Reference + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("other")) { + this.other = new Reference(); + return this.other; + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Patient.type"); + } + else + return super.addChild(name); + } + + public PatientLinkComponent copy() { + PatientLinkComponent dst = new PatientLinkComponent(); + copyValues(dst); + dst.other = other == null ? null : other.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PatientLinkComponent)) + return false; + PatientLinkComponent o = (PatientLinkComponent) other; + return compareDeep(other, o.other, true) && compareDeep(type, o.type, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PatientLinkComponent)) + return false; + PatientLinkComponent o = (PatientLinkComponent) other; + return compareValues(type, o.type, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (other == null || other.isEmpty()) && (type == null || type.isEmpty()) + ; + } + + public String fhirType() { + return "Patient.link"; + + } + + } + + /** + * An identifier for this patient. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="An identifier for this patient", formalDefinition="An identifier for this patient." ) + protected List identifier; + + /** + * Whether this patient record is in active use. + */ + @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="Whether this patient's record is in active use", formalDefinition="Whether this patient record is in active use." ) + protected BooleanType active; + + /** + * A name associated with the individual. + */ + @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A name associated with the patient", formalDefinition="A name associated with the individual." ) + protected List name; + + /** + * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A contact detail for the individual", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." ) + protected List telecom; + + /** + * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The date of birth for the individual. + */ + @Child(name = "birthDate", type = {DateType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The date of birth for the individual", formalDefinition="The date of birth for the individual." ) + protected DateType birthDate; + + /** + * Indicates if the individual is deceased or not. + */ + @Child(name = "deceased", type = {BooleanType.class, DateTimeType.class}, order=6, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="Indicates if the individual is deceased or not", formalDefinition="Indicates if the individual is deceased or not." ) + protected Type deceased; + + /** + * Addresses for the individual. + */ + @Child(name = "address", type = {Address.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Addresses for the individual", formalDefinition="Addresses for the individual." ) + protected List
address; + + /** + * This field contains a patient's most recent marital (civil) status. + */ + @Child(name = "maritalStatus", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Marital (civil) status of a patient", formalDefinition="This field contains a patient's most recent marital (civil) status." ) + protected CodeableConcept maritalStatus; + + /** + * Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer). + */ + @Child(name = "multipleBirth", type = {BooleanType.class, IntegerType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether patient is part of a multiple birth", formalDefinition="Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer)." ) + protected Type multipleBirth; + + /** + * Image of the patient. + */ + @Child(name = "photo", type = {Attachment.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Image of the patient", formalDefinition="Image of the patient." ) + protected List photo; + + /** + * A contact party (e.g. guardian, partner, friend) for the patient. + */ + @Child(name = "contact", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A contact party (e.g. guardian, partner, friend) for the patient", formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient." ) + protected List contact; + + /** + * This patient is known to be an animal. + */ + @Child(name = "animal", type = {}, order=12, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="This patient is known to be an animal (non-human)", formalDefinition="This patient is known to be an animal." ) + protected AnimalComponent animal; + + /** + * Languages which may be used to communicate with the patient about his or her health. + */ + @Child(name = "communication", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A list of Languages which may be used to communicate with the patient about his or her health", formalDefinition="Languages which may be used to communicate with the patient about his or her health." ) + protected List communication; + + /** + * Patient's nominated care provider. + */ + @Child(name = "careProvider", type = {Organization.class, Practitioner.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Patient's nominated primary care provider", formalDefinition="Patient's nominated care provider." ) + protected List careProvider; + /** + * The actual objects that are the target of the reference (Patient's nominated care provider.) + */ + protected List careProviderTarget; + + + /** + * Organization that is the custodian of the patient record. + */ + @Child(name = "managingOrganization", type = {Organization.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization that is the custodian of the patient record", formalDefinition="Organization that is the custodian of the patient record." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (Organization that is the custodian of the patient record.) + */ + protected Organization managingOrganizationTarget; + + /** + * Link to another patient resource that concerns the same actual patient. + */ + @Child(name = "link", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=false) + @Description(shortDefinition="Link to another patient resource that concerns the same actual person", formalDefinition="Link to another patient resource that concerns the same actual patient." ) + protected List link; + + private static final long serialVersionUID = 2019992554L; + + /** + * Constructor + */ + public Patient() { + super(); + } + + /** + * @return {@link #identifier} (An identifier for this patient.) + */ + 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} (An identifier for this patient.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Patient addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #active} (Whether this patient 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 Patient.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); // bb + 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 patient 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 Patient setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether this patient record is in active use. + */ + public boolean getActive() { + return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Whether this patient record is in active use. + */ + public Patient setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + /** + * @return {@link #name} (A name associated with the individual.) + */ + 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 individual.) + */ + // syntactic sugar + public HumanName addName() { //3 + HumanName t = new HumanName(); + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return t; + } + + // syntactic sugar + public Patient addName(HumanName t) { //3 + if (t == null) + return this; + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return this; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) + */ + 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 (e.g. a telephone number or an email address) by which the individual may be contacted.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Patient addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). 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 Patient.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + 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 - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Patient setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + public Patient setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateType(); // bb + 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 date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Patient setBirthDateElement(DateType value) { + this.birthDate = value; + return this; + } + + /** + * @return The date of birth for the individual. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The date of birth for the individual. + */ + public Patient setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public Type getDeceased() { + return this.deceased; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public BooleanType getDeceasedBooleanType() throws FHIRException { + if (!(this.deceased instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (BooleanType) this.deceased; + } + + public boolean hasDeceasedBooleanType() { + return this.deceased instanceof BooleanType; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public DateTimeType getDeceasedDateTimeType() throws FHIRException { + if (!(this.deceased instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (DateTimeType) this.deceased; + } + + public boolean hasDeceasedDateTimeType() { + return this.deceased instanceof DateTimeType; + } + + public boolean hasDeceased() { + return this.deceased != null && !this.deceased.isEmpty(); + } + + /** + * @param value {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public Patient setDeceased(Type value) { + this.deceased = value; + return this; + } + + /** + * @return {@link #address} (Addresses for the individual.) + */ + 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} (Addresses for the individual.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + // syntactic sugar + public Patient addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @return {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) + */ + public CodeableConcept getMaritalStatus() { + if (this.maritalStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.maritalStatus"); + else if (Configuration.doAutoCreate()) + this.maritalStatus = new CodeableConcept(); // cc + return this.maritalStatus; + } + + public boolean hasMaritalStatus() { + return this.maritalStatus != null && !this.maritalStatus.isEmpty(); + } + + /** + * @param value {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) + */ + public Patient setMaritalStatus(CodeableConcept value) { + this.maritalStatus = value; + return this; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).) + */ + public Type getMultipleBirth() { + return this.multipleBirth; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).) + */ + public BooleanType getMultipleBirthBooleanType() throws FHIRException { + if (!(this.multipleBirth instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); + return (BooleanType) this.multipleBirth; + } + + public boolean hasMultipleBirthBooleanType() { + return this.multipleBirth instanceof BooleanType; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).) + */ + public IntegerType getMultipleBirthIntegerType() throws FHIRException { + if (!(this.multipleBirth instanceof IntegerType)) + throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); + return (IntegerType) this.multipleBirth; + } + + public boolean hasMultipleBirthIntegerType() { + return this.multipleBirth instanceof IntegerType; + } + + public boolean hasMultipleBirth() { + return this.multipleBirth != null && !this.multipleBirth.isEmpty(); + } + + /** + * @param value {@link #multipleBirth} (Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).) + */ + public Patient setMultipleBirth(Type value) { + this.multipleBirth = value; + return this; + } + + /** + * @return {@link #photo} (Image of the patient.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the patient.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + // syntactic sugar + public Patient addPhoto(Attachment t) { //3 + if (t == null) + return this; + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return this; + } + + /** + * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) + */ + // syntactic sugar + public ContactComponent addContact() { //3 + ContactComponent t = new ContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Patient addContact(ContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #animal} (This patient is known to be an animal.) + */ + public AnimalComponent getAnimal() { + if (this.animal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.animal"); + else if (Configuration.doAutoCreate()) + this.animal = new AnimalComponent(); // cc + return this.animal; + } + + public boolean hasAnimal() { + return this.animal != null && !this.animal.isEmpty(); + } + + /** + * @param value {@link #animal} (This patient is known to be an animal.) + */ + public Patient setAnimal(AnimalComponent value) { + this.animal = value; + return this; + } + + /** + * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) + */ + public List getCommunication() { + if (this.communication == null) + this.communication = new ArrayList(); + return this.communication; + } + + public boolean hasCommunication() { + if (this.communication == null) + return false; + for (PatientCommunicationComponent item : this.communication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) + */ + // syntactic sugar + public PatientCommunicationComponent addCommunication() { //3 + PatientCommunicationComponent t = new PatientCommunicationComponent(); + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return t; + } + + // syntactic sugar + public Patient addCommunication(PatientCommunicationComponent t) { //3 + if (t == null) + return this; + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return this; + } + + /** + * @return {@link #careProvider} (Patient's nominated care provider.) + */ + public List getCareProvider() { + if (this.careProvider == null) + this.careProvider = new ArrayList(); + return this.careProvider; + } + + public boolean hasCareProvider() { + if (this.careProvider == null) + return false; + for (Reference item : this.careProvider) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #careProvider} (Patient's nominated care provider.) + */ + // syntactic sugar + public Reference addCareProvider() { //3 + Reference t = new Reference(); + if (this.careProvider == null) + this.careProvider = new ArrayList(); + this.careProvider.add(t); + return t; + } + + // syntactic sugar + public Patient addCareProvider(Reference t) { //3 + if (t == null) + return this; + if (this.careProvider == null) + this.careProvider = new ArrayList(); + this.careProvider.add(t); + return this; + } + + /** + * @return {@link #careProvider} (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. Patient's nominated care provider.) + */ + public List getCareProviderTarget() { + if (this.careProviderTarget == null) + this.careProviderTarget = new ArrayList(); + return this.careProviderTarget; + } + + /** + * @return {@link #managingOrganization} (Organization that is the custodian of the patient record.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); // cc + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (Organization that is the custodian of the patient record.) + */ + public Patient 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. (Organization that is the custodian of the patient record.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); // aa + 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. (Organization that is the custodian of the patient record.) + */ + public Patient setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #link} (Link to another patient resource that concerns the same actual patient.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (PatientLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (Link to another patient resource that concerns the same actual patient.) + */ + // syntactic sugar + public PatientLinkComponent addLink() { //3 + PatientLinkComponent t = new PatientLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public Patient addLink(PatientLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier for this patient.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("active", "boolean", "Whether this patient record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + childrenList.add(new Property("name", "HumanName", "A name associated with the individual.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "date", "The date of birth for the individual.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, java.lang.Integer.MAX_VALUE, deceased)); + childrenList.add(new Property("address", "Address", "Addresses for the individual.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("maritalStatus", "CodeableConcept", "This field contains a patient's most recent marital (civil) status.", 0, java.lang.Integer.MAX_VALUE, maritalStatus)); + childrenList.add(new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).", 0, java.lang.Integer.MAX_VALUE, multipleBirth)); + childrenList.add(new Property("photo", "Attachment", "Image of the patient.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("contact", "", "A contact party (e.g. guardian, partner, friend) for the patient.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("animal", "", "This patient is known to be an animal.", 0, java.lang.Integer.MAX_VALUE, animal)); + childrenList.add(new Property("communication", "", "Languages which may be used to communicate with the patient about his or her health.", 0, java.lang.Integer.MAX_VALUE, communication)); + childrenList.add(new Property("careProvider", "Reference(Organization|Practitioner)", "Patient's nominated care provider.", 0, java.lang.Integer.MAX_VALUE, careProvider)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "Organization that is the custodian of the patient record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("link", "", "Link to another patient resource that concerns the same actual patient.", 0, java.lang.Integer.MAX_VALUE, link)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType + case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration + case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType + case 561497972: /*deceased*/ return this.deceased == null ? new Base[0] : new Base[] {this.deceased}; // Type + case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address + case 1756919302: /*maritalStatus*/ return this.maritalStatus == null ? new Base[0] : new Base[] {this.maritalStatus}; // CodeableConcept + case -677369713: /*multipleBirth*/ return this.multipleBirth == null ? new Base[0] : new Base[] {this.multipleBirth}; // Type + case 106642994: /*photo*/ return this.photo == null ? new Base[0] : this.photo.toArray(new Base[this.photo.size()]); // Attachment + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactComponent + case -1413116420: /*animal*/ return this.animal == null ? new Base[0] : new Base[] {this.animal}; // AnimalComponent + case -1035284522: /*communication*/ return this.communication == null ? new Base[0] : this.communication.toArray(new Base[this.communication.size()]); // PatientCommunicationComponent + case 1963803682: /*careProvider*/ return this.careProvider == null ? new Base[0] : this.careProvider.toArray(new Base[this.careProvider.size()]); // Reference + case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference + case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // PatientLinkComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1422950650: // active + this.active = castToBoolean(value); // BooleanType + break; + case 3373707: // name + this.getName().add(castToHumanName(value)); // HumanName + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1249512767: // gender + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + break; + case -1210031859: // birthDate + this.birthDate = castToDate(value); // DateType + break; + case 561497972: // deceased + this.deceased = (Type) value; // Type + break; + case -1147692044: // address + this.getAddress().add(castToAddress(value)); // Address + break; + case 1756919302: // maritalStatus + this.maritalStatus = castToCodeableConcept(value); // CodeableConcept + break; + case -677369713: // multipleBirth + this.multipleBirth = (Type) value; // Type + break; + case 106642994: // photo + this.getPhoto().add(castToAttachment(value)); // Attachment + break; + case 951526432: // contact + this.getContact().add((ContactComponent) value); // ContactComponent + break; + case -1413116420: // animal + this.animal = (AnimalComponent) value; // AnimalComponent + break; + case -1035284522: // communication + this.getCommunication().add((PatientCommunicationComponent) value); // PatientCommunicationComponent + break; + case 1963803682: // careProvider + this.getCareProvider().add(castToReference(value)); // Reference + break; + case -2058947787: // managingOrganization + this.managingOrganization = castToReference(value); // Reference + break; + case 3321850: // link + this.getLink().add((PatientLinkComponent) value); // PatientLinkComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("active")) + this.active = castToBoolean(value); // BooleanType + else if (name.equals("name")) + this.getName().add(castToHumanName(value)); + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("gender")) + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + else if (name.equals("birthDate")) + this.birthDate = castToDate(value); // DateType + else if (name.equals("deceased[x]")) + this.deceased = (Type) value; // Type + else if (name.equals("address")) + this.getAddress().add(castToAddress(value)); + else if (name.equals("maritalStatus")) + this.maritalStatus = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("multipleBirth[x]")) + this.multipleBirth = (Type) value; // Type + else if (name.equals("photo")) + this.getPhoto().add(castToAttachment(value)); + else if (name.equals("contact")) + this.getContact().add((ContactComponent) value); + else if (name.equals("animal")) + this.animal = (AnimalComponent) value; // AnimalComponent + else if (name.equals("communication")) + this.getCommunication().add((PatientCommunicationComponent) value); + else if (name.equals("careProvider")) + this.getCareProvider().add(castToReference(value)); + else if (name.equals("managingOrganization")) + this.managingOrganization = castToReference(value); // Reference + else if (name.equals("link")) + this.getLink().add((PatientLinkComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType + case 3373707: return addName(); // HumanName + case -1429363305: return addTelecom(); // ContactPoint + case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration + case -1210031859: throw new FHIRException("Cannot make property birthDate as it is not a complex type"); // DateType + case -1311442804: return getDeceased(); // Type + case -1147692044: return addAddress(); // Address + case 1756919302: return getMaritalStatus(); // CodeableConcept + case -1764672111: return getMultipleBirth(); // Type + case 106642994: return addPhoto(); // Attachment + case 951526432: return addContact(); // ContactComponent + case -1413116420: return getAnimal(); // AnimalComponent + case -1035284522: return addCommunication(); // PatientCommunicationComponent + case 1963803682: return addCareProvider(); // Reference + case -2058947787: return getManagingOrganization(); // Reference + case 3321850: return addLink(); // PatientLinkComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("active")) { + throw new FHIRException("Cannot call addChild on a primitive type Patient.active"); + } + else if (name.equals("name")) { + return addName(); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("gender")) { + throw new FHIRException("Cannot call addChild on a primitive type Patient.gender"); + } + else if (name.equals("birthDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Patient.birthDate"); + } + else if (name.equals("deceasedBoolean")) { + this.deceased = new BooleanType(); + return this.deceased; + } + else if (name.equals("deceasedDateTime")) { + this.deceased = new DateTimeType(); + return this.deceased; + } + else if (name.equals("address")) { + return addAddress(); + } + else if (name.equals("maritalStatus")) { + this.maritalStatus = new CodeableConcept(); + return this.maritalStatus; + } + else if (name.equals("multipleBirthBoolean")) { + this.multipleBirth = new BooleanType(); + return this.multipleBirth; + } + else if (name.equals("multipleBirthInteger")) { + this.multipleBirth = new IntegerType(); + return this.multipleBirth; + } + else if (name.equals("photo")) { + return addPhoto(); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("animal")) { + this.animal = new AnimalComponent(); + return this.animal; + } + else if (name.equals("communication")) { + return addCommunication(); + } + else if (name.equals("careProvider")) { + return addCareProvider(); + } + else if (name.equals("managingOrganization")) { + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + else if (name.equals("link")) { + return addLink(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Patient"; + + } + + public Patient copy() { + Patient dst = new Patient(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.active = active == null ? null : active.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(); + dst.deceased = deceased == null ? null : deceased.copy(); + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy(); + dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy(); + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.animal = animal == null ? null : animal.copy(); + if (communication != null) { + dst.communication = new ArrayList(); + for (PatientCommunicationComponent i : communication) + dst.communication.add(i.copy()); + }; + if (careProvider != null) { + dst.careProvider = new ArrayList(); + for (Reference i : careProvider) + dst.careProvider.add(i.copy()); + }; + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (PatientLinkComponent i : link) + dst.link.add(i.copy()); + }; + return dst; + } + + protected Patient typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Patient)) + return false; + Patient o = (Patient) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(name, o.name, true) + && compareDeep(telecom, o.telecom, true) && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) + && compareDeep(deceased, o.deceased, true) && compareDeep(address, o.address, true) && compareDeep(maritalStatus, o.maritalStatus, true) + && compareDeep(multipleBirth, o.multipleBirth, true) && compareDeep(photo, o.photo, true) && compareDeep(contact, o.contact, true) + && compareDeep(animal, o.animal, true) && compareDeep(communication, o.communication, true) && compareDeep(careProvider, o.careProvider, true) + && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(link, o.link, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Patient)) + return false; + Patient o = (Patient) other; + return compareValues(active, o.active, true) && compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) + && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) + && (birthDate == null || birthDate.isEmpty()) && (deceased == null || deceased.isEmpty()) + && (address == null || address.isEmpty()) && (maritalStatus == null || maritalStatus.isEmpty()) + && (multipleBirth == null || multipleBirth.isEmpty()) && (photo == null || photo.isEmpty()) + && (contact == null || contact.isEmpty()) && (animal == null || animal.isEmpty()) && (communication == null || communication.isEmpty()) + && (careProvider == null || careProvider.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (link == null || link.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Patient; + } + + /** + * Search parameter: phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: Patient.telecom(system=phone)
+ *

+ */ + @SearchParamDefinition(name="phone", path="Patient.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) + public static final String SP_PHONE = "phone"; + /** + * Fluent Client search parameter constant for phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: Patient.telecom(system=phone)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); + + /** + * Search parameter: phonetic + *

+ * Description: A portion of either family or given name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Patient.name
+ *

+ */ + @SearchParamDefinition(name="phonetic", path="Patient.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + /** + * Fluent Client search parameter constant for phonetic + *

+ * Description: A portion of either family or given name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Patient.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); + + /** + * Search parameter: link + *

+ * Description: All patients linked to the given patient
+ * Type: reference
+ * Path: Patient.link.other
+ *

+ */ + @SearchParamDefinition(name="link", path="Patient.link.other", description="All patients linked to the given patient", type="reference" ) + public static final String SP_LINK = "link"; + /** + * Fluent Client search parameter constant for link + *

+ * Description: All patients linked to the given patient
+ * Type: reference
+ * Path: Patient.link.other
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LINK = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LINK); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Patient:link". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LINK = new ca.uhn.fhir.model.api.Include("Patient:link").toLocked(); + + /** + * Search parameter: animal-species + *

+ * Description: The species for animal patients
+ * Type: token
+ * Path: Patient.animal.species
+ *

+ */ + @SearchParamDefinition(name="animal-species", path="Patient.animal.species", description="The species for animal patients", type="token" ) + public static final String SP_ANIMAL_SPECIES = "animal-species"; + /** + * Fluent Client search parameter constant for animal-species + *

+ * Description: The species for animal patients
+ * Type: token
+ * Path: Patient.animal.species
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ANIMAL_SPECIES = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ANIMAL_SPECIES); + + /** + * Search parameter: organization + *

+ * Description: The organization at which this person is a patient
+ * Type: reference
+ * Path: Patient.managingOrganization
+ *

+ */ + @SearchParamDefinition(name="organization", path="Patient.managingOrganization", description="The organization at which this person is a patient", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: The organization at which this person is a patient
+ * Type: reference
+ * Path: Patient.managingOrganization
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Patient:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Patient:organization").toLocked(); + + /** + * Search parameter: address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Patient.address.city
+ *

+ */ + @SearchParamDefinition(name="address-city", path="Patient.address.city", description="A city specified in an address", type="string" ) + public static final String SP_ADDRESS_CITY = "address-city"; + /** + * Fluent Client search parameter constant for address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Patient.address.city
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); + + /** + * Search parameter: given + *

+ * Description: A portion of the given name of the patient
+ * Type: string
+ * Path: Patient.name.given
+ *

+ */ + @SearchParamDefinition(name="given", path="Patient.name.given", description="A portion of the given name of the patient", type="string" ) + public static final String SP_GIVEN = "given"; + /** + * Fluent Client search parameter constant for given + *

+ * Description: A portion of the given name of the patient
+ * Type: string
+ * Path: Patient.name.given
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam GIVEN = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_GIVEN); + + /** + * Search parameter: careprovider + *

+ * Description: Patient's nominated care provider, could be a care manager, not the organization that manages the record
+ * Type: reference
+ * Path: Patient.careProvider
+ *

+ */ + @SearchParamDefinition(name="careprovider", path="Patient.careProvider", description="Patient's nominated care provider, could be a care manager, not the organization that manages the record", type="reference" ) + public static final String SP_CAREPROVIDER = "careprovider"; + /** + * Fluent Client search parameter constant for careprovider + *

+ * Description: Patient's nominated care provider, could be a care manager, not the organization that manages the record
+ * Type: reference
+ * Path: Patient.careProvider
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CAREPROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CAREPROVIDER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Patient:careprovider". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CAREPROVIDER = new ca.uhn.fhir.model.api.Include("Patient:careprovider").toLocked(); + + /** + * Search parameter: family + *

+ * Description: A portion of the family name of the patient
+ * Type: string
+ * Path: Patient.name.family
+ *

+ */ + @SearchParamDefinition(name="family", path="Patient.name.family", description="A portion of the family name of the patient", type="string" ) + public static final String SP_FAMILY = "family"; + /** + * Fluent Client search parameter constant for family + *

+ * Description: A portion of the family name of the patient
+ * Type: string
+ * Path: Patient.name.family
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam FAMILY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_FAMILY); + + /** + * Search parameter: death-date + *

+ * Description: The date of death has been provided and satisfies this search value
+ * Type: date
+ * Path: Patient.deceasedDateTime
+ *

+ */ + @SearchParamDefinition(name="death-date", path="Patient.deceased.as(DateTime)", description="The date of death has been provided and satisfies this search value", type="date" ) + public static final String SP_DEATH_DATE = "death-date"; + /** + * Fluent Client search parameter constant for death-date + *

+ * Description: The date of death has been provided and satisfies this search value
+ * Type: date
+ * Path: Patient.deceasedDateTime
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DEATH_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DEATH_DATE); + + /** + * Search parameter: name + *

+ * Description: A portion of either family or given name of the patient
+ * Type: string
+ * Path: Patient.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Patient.name", description="A portion of either family or given name of the patient", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: A portion of either family or given name of the patient
+ * Type: string
+ * Path: Patient.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: telecom + *

+ * Description: The value in any kind of telecom details of the patient
+ * Type: token
+ * Path: Patient.telecom
+ *

+ */ + @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="token" ) + public static final String SP_TELECOM = "telecom"; + /** + * Fluent Client search parameter constant for telecom + *

+ * Description: The value in any kind of telecom details of the patient
+ * Type: token
+ * Path: Patient.telecom
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); + + /** + * Search parameter: birthdate + *

+ * Description: The patient's date of birth
+ * Type: date
+ * Path: Patient.birthDate
+ *

+ */ + @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date" ) + public static final String SP_BIRTHDATE = "birthdate"; + /** + * Fluent Client search parameter constant for birthdate + *

+ * Description: The patient's date of birth
+ * Type: date
+ * Path: Patient.birthDate
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE); + + /** + * Search parameter: gender + *

+ * Description: Gender of the patient
+ * Type: token
+ * Path: Patient.gender
+ *

+ */ + @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" ) + public static final String SP_GENDER = "gender"; + /** + * Fluent Client search parameter constant for gender + *

+ * Description: Gender of the patient
+ * Type: token
+ * Path: Patient.gender
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); + + /** + * Search parameter: deceased + *

+ * Description: This patient has been marked as deceased, or as a death date entered
+ * Type: token
+ * Path: Patient.deceased[x]
+ *

+ */ + @SearchParamDefinition(name="deceased", path="Patient.deceased.exists()", description="This patient has been marked as deceased, or as a death date entered", type="token" ) + public static final String SP_DECEASED = "deceased"; + /** + * Fluent Client search parameter constant for deceased + *

+ * Description: This patient has been marked as deceased, or as a death date entered
+ * Type: token
+ * Path: Patient.deceased[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam DECEASED = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DECEASED); + + /** + * Search parameter: animal-breed + *

+ * Description: The breed for animal patients
+ * Type: token
+ * Path: Patient.animal.breed
+ *

+ */ + @SearchParamDefinition(name="animal-breed", path="Patient.animal.breed", description="The breed for animal patients", type="token" ) + public static final String SP_ANIMAL_BREED = "animal-breed"; + /** + * Fluent Client search parameter constant for animal-breed + *

+ * Description: The breed for animal patients
+ * Type: token
+ * Path: Patient.animal.breed
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ANIMAL_BREED = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ANIMAL_BREED); + + /** + * Search parameter: address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Patient.address.country
+ *

+ */ + @SearchParamDefinition(name="address-country", path="Patient.address.country", description="A country specified in an address", type="string" ) + public static final String SP_ADDRESS_COUNTRY = "address-country"; + /** + * Fluent Client search parameter constant for address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Patient.address.country
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + + /** + * Search parameter: address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Patient.address.state
+ *

+ */ + @SearchParamDefinition(name="address-state", path="Patient.address.state", description="A state specified in an address", type="string" ) + public static final String SP_ADDRESS_STATE = "address-state"; + /** + * Fluent Client search parameter constant for address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Patient.address.state
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); + + /** + * Search parameter: address + *

+ * Description: An address in any kind of address/part of the patient
+ * Type: string
+ * Path: Patient.address
+ *

+ */ + @SearchParamDefinition(name="address", path="Patient.address", description="An address in any kind of address/part of the patient", type="string" ) + public static final String SP_ADDRESS = "address"; + /** + * Fluent Client search parameter constant for address + *

+ * Description: An address in any kind of address/part of the patient
+ * Type: string
+ * Path: Patient.address
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); + + /** + * Search parameter: email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: Patient.telecom(system=email)
+ *

+ */ + @SearchParamDefinition(name="email", path="Patient.telecom.where(system='email')", description="A value in an email contact", type="token" ) + public static final String SP_EMAIL = "email"; + /** + * Fluent Client search parameter constant for email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: Patient.telecom(system=email)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); + + /** + * Search parameter: address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Patient.address.use
+ *

+ */ + @SearchParamDefinition(name="address-use", path="Patient.address.use", description="A use code specified in an address", type="token" ) + public static final String SP_ADDRESS_USE = "address-use"; + /** + * Fluent Client search parameter constant for address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Patient.address.use
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); + + /** + * Search parameter: active + *

+ * Description: Whether the patient record is active
+ * Type: token
+ * Path: Patient.active
+ *

+ */ + @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token" ) + public static final String SP_ACTIVE = "active"; + /** + * Fluent Client search parameter constant for active + *

+ * Description: Whether the patient record is active
+ * Type: token
+ * Path: Patient.active
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVE); + + /** + * Search parameter: language + *

+ * Description: Language code (irrespective of use value)
+ * Type: token
+ * Path: Patient.communication.language
+ *

+ */ + @SearchParamDefinition(name="language", path="Patient.communication.language", description="Language code (irrespective of use value)", type="token" ) + public static final String SP_LANGUAGE = "language"; + /** + * Fluent Client search parameter constant for language + *

+ * Description: Language code (irrespective of use value)
+ * Type: token
+ * Path: Patient.communication.language
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE); + + /** + * Search parameter: identifier + *

+ * Description: A patient identifier
+ * Type: token
+ * Path: Patient.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A patient identifier
+ * Type: token
+ * Path: Patient.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: address-postalcode + *

+ * Description: A postalCode specified in an address
+ * Type: string
+ * Path: Patient.address.postalCode
+ *

+ */ + @SearchParamDefinition(name="address-postalcode", path="Patient.address.postalCode", description="A postalCode specified in an address", type="string" ) + public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; + /** + * Fluent Client search parameter constant for address-postalcode + *

+ * Description: A postalCode specified in an address
+ * Type: string
+ * Path: Patient.address.postalCode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PaymentNotice.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PaymentNotice.java new file mode 100644 index 00000000000..b455e4b628a --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PaymentNotice.java @@ -0,0 +1,1100 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. + */ +@ResourceDef(name="PaymentNotice", profile="http://hl7.org/fhir/Profile/PaymentNotice") +public class PaymentNotice extends DomainResource { + + /** + * The Response business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name = "target", type = {Identifier.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) + protected Type target; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Type provider; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "organization", type = {Identifier.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Type organization; + + /** + * Reference of resource to reverse. + */ + @Child(name = "request", type = {Identifier.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) + protected Type request; + + /** + * Reference of response to resource to reverse. + */ + @Child(name = "response", type = {Identifier.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) + protected Type response; + + /** + * The payment status, typically paid: payment sent, cleared: payment received. + */ + @Child(name = "paymentStatus", type = {Coding.class}, order=9, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) + protected Coding paymentStatus; + + /** + * The date when the above payment action occurrred. + */ + @Child(name = "statusDate", type = {DateType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payment or clearing date", formalDefinition="The date when the above payment action occurrred." ) + protected DateType statusDate; + + private static final long serialVersionUID = -771143315L; + + /** + * Constructor + */ + public PaymentNotice() { + super(); + } + + /** + * Constructor + */ + public PaymentNotice(Coding paymentStatus) { + super(); + this.paymentStatus = paymentStatus; + } + + /** + * @return {@link #identifier} (The Response business identifier.) + */ + 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 Response business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public PaymentNotice addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 PaymentNotice setRuleset(Coding value) { + this.ruleset = 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 PaymentNotice.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 PaymentNotice setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 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 setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public PaymentNotice 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} (The Insurer who is target of the request.) + */ + public Type getTarget() { + return this.target; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Identifier getTargetIdentifier() throws FHIRException { + if (!(this.target instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Identifier) this.target; + } + + public boolean hasTargetIdentifier() { + return this.target instanceof Identifier; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTargetReference() throws FHIRException { + if (!(this.target instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Reference) this.target; + } + + public boolean hasTargetReference() { + return this.target instanceof Reference; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public PaymentNotice setTarget(Type value) { + this.target = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Type getProvider() { + return this.provider; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Identifier getProviderIdentifier() throws FHIRException { + if (!(this.provider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Identifier) this.provider; + } + + public boolean hasProviderIdentifier() { + return this.provider instanceof Identifier; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProviderReference() throws FHIRException { + if (!(this.provider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Reference) this.provider; + } + + public boolean hasProviderReference() { + return this.provider instanceof Reference; + } + + 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 PaymentNotice setProvider(Type value) { + this.provider = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public PaymentNotice setOrganization(Type value) { + this.organization = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Type getRequest() { + return this.request; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Identifier getRequestIdentifier() throws FHIRException { + if (!(this.request instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Identifier) this.request; + } + + public boolean hasRequestIdentifier() { + return this.request instanceof Identifier; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Reference getRequestReference() throws FHIRException { + if (!(this.request instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Reference) this.request; + } + + public boolean hasRequestReference() { + return this.request instanceof Reference; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource to reverse.) + */ + public PaymentNotice setRequest(Type value) { + this.request = value; + return this; + } + + /** + * @return {@link #response} (Reference of response to resource to reverse.) + */ + public Type getResponse() { + return this.response; + } + + /** + * @return {@link #response} (Reference of response to resource to reverse.) + */ + public Identifier getResponseIdentifier() throws FHIRException { + if (!(this.response instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.response.getClass().getName()+" was encountered"); + return (Identifier) this.response; + } + + public boolean hasResponseIdentifier() { + return this.response instanceof Identifier; + } + + /** + * @return {@link #response} (Reference of response to resource to reverse.) + */ + public Reference getResponseReference() throws FHIRException { + if (!(this.response instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.response.getClass().getName()+" was encountered"); + return (Reference) this.response; + } + + public boolean hasResponseReference() { + return this.response instanceof Reference; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of response to resource to reverse.) + */ + public PaymentNotice setResponse(Type value) { + this.response = value; + return this; + } + + /** + * @return {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) + */ + public Coding getPaymentStatus() { + if (this.paymentStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.paymentStatus"); + else if (Configuration.doAutoCreate()) + this.paymentStatus = new Coding(); // cc + return this.paymentStatus; + } + + public boolean hasPaymentStatus() { + return this.paymentStatus != null && !this.paymentStatus.isEmpty(); + } + + /** + * @param value {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) + */ + public PaymentNotice setPaymentStatus(Coding value) { + this.paymentStatus = value; + return this; + } + + /** + * @return {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value + */ + public DateType getStatusDateElement() { + if (this.statusDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.statusDate"); + else if (Configuration.doAutoCreate()) + this.statusDate = new DateType(); // bb + return this.statusDate; + } + + public boolean hasStatusDateElement() { + return this.statusDate != null && !this.statusDate.isEmpty(); + } + + public boolean hasStatusDate() { + return this.statusDate != null && !this.statusDate.isEmpty(); + } + + /** + * @param value {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value + */ + public PaymentNotice setStatusDateElement(DateType value) { + this.statusDate = value; + return this; + } + + /** + * @return The date when the above payment action occurrred. + */ + public Date getStatusDate() { + return this.statusDate == null ? null : this.statusDate.getValue(); + } + + /** + * @param value The date when the above payment action occurrred. + */ + public PaymentNotice setStatusDate(Date value) { + if (value == null) + this.statusDate = null; + else { + if (this.statusDate == null) + this.statusDate = new DateType(); + this.statusDate.setValue(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("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider[x]", "Identifier|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[x]", "Identifier|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[x]", "Identifier|Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response[x]", "Identifier|Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("paymentStatus", "Coding", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus)); + childrenList.add(new Property("statusDate", "date", "The date when the above payment action occurrred.", 0, java.lang.Integer.MAX_VALUE, statusDate)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type + case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Type + case 1430704536: /*paymentStatus*/ return this.paymentStatus == null ? new Base[0] : new Base[] {this.paymentStatus}; // Coding + case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case -880905839: // target + this.target = (Type) value; // Type + break; + case -987494927: // provider + this.provider = (Type) value; // Type + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case 1095692943: // request + this.request = (Type) value; // Type + break; + case -340323263: // response + this.response = (Type) value; // Type + break; + case 1430704536: // paymentStatus + this.paymentStatus = castToCoding(value); // Coding + break; + case 247524032: // statusDate + this.statusDate = castToDate(value); // DateType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("target[x]")) + this.target = (Type) value; // Type + else if (name.equals("provider[x]")) + this.provider = (Type) value; // Type + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("request[x]")) + this.request = (Type) value; // Type + else if (name.equals("response[x]")) + this.response = (Type) value; // Type + else if (name.equals("paymentStatus")) + this.paymentStatus = castToCoding(value); // Coding + else if (name.equals("statusDate")) + this.statusDate = castToDate(value); // DateType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -815579825: return getTarget(); // Type + case 2064698607: return getProvider(); // Type + case 1326483053: return getOrganization(); // Type + case 37106577: return getRequest(); // Type + case 1847549087: return getResponse(); // Type + case 1430704536: return getPaymentStatus(); // Coding + case 247524032: throw new FHIRException("Cannot make property statusDate as it is not a complex type"); // DateType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.created"); + } + else if (name.equals("targetIdentifier")) { + this.target = new Identifier(); + return this.target; + } + else if (name.equals("targetReference")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("providerIdentifier")) { + this.provider = new Identifier(); + return this.provider; + } + else if (name.equals("providerReference")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("requestIdentifier")) { + this.request = new Identifier(); + return this.request; + } + else if (name.equals("requestReference")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("responseIdentifier")) { + this.response = new Identifier(); + return this.response; + } + else if (name.equals("responseReference")) { + this.response = new Reference(); + return this.response; + } + else if (name.equals("paymentStatus")) { + this.paymentStatus = new Coding(); + return this.paymentStatus; + } + else if (name.equals("statusDate")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.statusDate"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "PaymentNotice"; + + } + + public PaymentNotice copy() { + PaymentNotice dst = new PaymentNotice(); + 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.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy(); + dst.statusDate = statusDate == null ? null : statusDate.copy(); + return dst; + } + + protected PaymentNotice typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PaymentNotice)) + return false; + PaymentNotice o = (PaymentNotice) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) + && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) + && compareDeep(paymentStatus, o.paymentStatus, true) && compareDeep(statusDate, o.statusDate, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PaymentNotice)) + return false; + PaymentNotice o = (PaymentNotice) other; + return compareValues(created, o.created, true) && compareValues(statusDate, o.statusDate, true); + } + + 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()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (paymentStatus == null || paymentStatus.isEmpty()) + && (statusDate == null || statusDate.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PaymentNotice; + } + + /** + * Search parameter: paymentstatus + *

+ * Description: The type of payment notice
+ * Type: token
+ * Path: PaymentNotice.paymentStatus
+ *

+ */ + @SearchParamDefinition(name="paymentstatus", path="PaymentNotice.paymentStatus", description="The type of payment notice", type="token" ) + public static final String SP_PAYMENTSTATUS = "paymentstatus"; + /** + * Fluent Client search parameter constant for paymentstatus + *

+ * Description: The type of payment notice
+ * Type: token
+ * Path: PaymentNotice.paymentStatus
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PAYMENTSTATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PAYMENTSTATUS); + + /** + * Search parameter: statusdate + *

+ * Description: The date of the payment action
+ * Type: date
+ * Path: PaymentNotice.statusDate
+ *

+ */ + @SearchParamDefinition(name="statusdate", path="PaymentNotice.statusDate", description="The date of the payment action", type="date" ) + public static final String SP_STATUSDATE = "statusdate"; + /** + * Fluent Client search parameter constant for statusdate + *

+ * Description: The date of the payment action
+ * Type: date
+ * Path: PaymentNotice.statusDate
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam STATUSDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_STATUSDATE); + + /** + * Search parameter: created + *

+ * Description: Creation date fro the notice
+ * Type: date
+ * Path: PaymentNotice.created
+ *

+ */ + @SearchParamDefinition(name="created", path="PaymentNotice.created", description="Creation date fro the notice", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: Creation date fro the notice
+ * Type: date
+ * Path: PaymentNotice.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: requestidentifier + *

+ * Description: The Claim
+ * Type: token
+ * Path: PaymentNotice.requestIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestidentifier", path="PaymentNotice.request.as(Identifier)", description="The Claim", type="token" ) + public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; + /** + * Fluent Client search parameter constant for requestidentifier + *

+ * Description: The Claim
+ * Type: token
+ * Path: PaymentNotice.requestIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); + + /** + * Search parameter: providerreference + *

+ * Description: The reference to the provider
+ * Type: reference
+ * Path: PaymentNotice.providerReference
+ *

+ */ + @SearchParamDefinition(name="providerreference", path="PaymentNotice.provider.as(Reference)", description="The reference to the provider", type="reference" ) + public static final String SP_PROVIDERREFERENCE = "providerreference"; + /** + * Fluent Client search parameter constant for providerreference + *

+ * Description: The reference to the provider
+ * Type: reference
+ * Path: PaymentNotice.providerReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PaymentNotice:providerreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:providerreference").toLocked(); + + /** + * Search parameter: requestreference + *

+ * Description: The Claim
+ * Type: reference
+ * Path: PaymentNotice.requestReference
+ *

+ */ + @SearchParamDefinition(name="requestreference", path="PaymentNotice.request.as(Reference)", description="The Claim", type="reference" ) + public static final String SP_REQUESTREFERENCE = "requestreference"; + /** + * Fluent Client search parameter constant for requestreference + *

+ * Description: The Claim
+ * Type: reference
+ * Path: PaymentNotice.requestReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PaymentNotice:requestreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:requestreference").toLocked(); + + /** + * Search parameter: responsereference + *

+ * Description: The ClaimResponse
+ * Type: reference
+ * Path: PaymentNotice.responseReference
+ *

+ */ + @SearchParamDefinition(name="responsereference", path="PaymentNotice.response.as(Reference)", description="The ClaimResponse", type="reference" ) + public static final String SP_RESPONSEREFERENCE = "responsereference"; + /** + * Fluent Client search parameter constant for responsereference + *

+ * Description: The ClaimResponse
+ * Type: reference
+ * Path: PaymentNotice.responseReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSEREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSEREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PaymentNotice:responsereference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSEREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:responsereference").toLocked(); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: PaymentNotice.organizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="PaymentNotice.organization.as(Identifier)", description="The organization who generated this resource", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: PaymentNotice.organizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: organizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: PaymentNotice.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="PaymentNotice.organization.as(Reference)", description="The organization who generated this resource", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: PaymentNotice.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PaymentNotice:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:organizationreference").toLocked(); + + /** + * Search parameter: responseidentifier + *

+ * Description: The ClaimResponse
+ * Type: token
+ * Path: PaymentNotice.responseIdentifier
+ *

+ */ + @SearchParamDefinition(name="responseidentifier", path="PaymentNotice.response.as(Identifier)", description="The ClaimResponse", type="token" ) + public static final String SP_RESPONSEIDENTIFIER = "responseidentifier"; + /** + * Fluent Client search parameter constant for responseidentifier + *

+ * Description: The ClaimResponse
+ * Type: token
+ * Path: PaymentNotice.responseIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESPONSEIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESPONSEIDENTIFIER); + + /** + * Search parameter: identifier + *

+ * Description: The business identifier of the notice
+ * Type: token
+ * Path: PaymentNotice.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="PaymentNotice.identifier", description="The business identifier of the notice", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier of the notice
+ * Type: token
+ * Path: PaymentNotice.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: provideridentifier + *

+ * Description: The reference to the provider
+ * Type: token
+ * Path: PaymentNotice.providerIdentifier
+ *

+ */ + @SearchParamDefinition(name="provideridentifier", path="PaymentNotice.provider.as(Identifier)", description="The reference to the provider", type="token" ) + public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; + /** + * Fluent Client search parameter constant for provideridentifier + *

+ * Description: The reference to the provider
+ * Type: token
+ * Path: PaymentNotice.providerIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PaymentReconciliation.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PaymentReconciliation.java new file mode 100644 index 00000000000..c821a890932 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PaymentReconciliation.java @@ -0,0 +1,2056 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome; +import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides payment details and claim references supporting a bulk payment. + */ +@ResourceDef(name="PaymentReconciliation", profile="http://hl7.org/fhir/Profile/PaymentReconciliation") +public class PaymentReconciliation extends DomainResource { + + @Block() + public static class DetailsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code to indicate the nature of the payment, adjustment, funds advance, etc. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type code", formalDefinition="Code to indicate the nature of the payment, adjustment, funds advance, etc." ) + protected Coding type; + + /** + * The claim or financial resource. + */ + @Child(name = "request", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Claim", formalDefinition="The claim or financial resource." ) + protected Type request; + + /** + * The claim response resource. + */ + @Child(name = "responce", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Claim Response", formalDefinition="The claim response resource." ) + protected Type responce; + + /** + * The Organization which submitted the invoice or financial transaction. + */ + @Child(name = "submitter", type = {Identifier.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Submitter", formalDefinition="The Organization which submitted the invoice or financial transaction." ) + protected Type submitter; + + /** + * The organization which is receiving the payment. + */ + @Child(name = "payee", type = {Identifier.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Payee", formalDefinition="The organization which is receiving the payment." ) + protected Type payee; + + /** + * The date of the invoice or financial resource. + */ + @Child(name = "date", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Invoice date", formalDefinition="The date of the invoice or financial resource." ) + protected DateType date; + + /** + * Amount paid for this detail. + */ + @Child(name = "amount", type = {Money.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Detail amount", formalDefinition="Amount paid for this detail." ) + protected Money amount; + + private static final long serialVersionUID = 1706468339L; + + /** + * Constructor + */ + public DetailsComponent() { + super(); + } + + /** + * Constructor + */ + public DetailsComponent(Coding type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) + */ + public DetailsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #request} (The claim or financial resource.) + */ + public Type getRequest() { + return this.request; + } + + /** + * @return {@link #request} (The claim or financial resource.) + */ + public Identifier getRequestIdentifier() throws FHIRException { + if (!(this.request instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Identifier) this.request; + } + + public boolean hasRequestIdentifier() { + return this.request instanceof Identifier; + } + + /** + * @return {@link #request} (The claim or financial resource.) + */ + public Reference getRequestReference() throws FHIRException { + if (!(this.request instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Reference) this.request; + } + + public boolean hasRequestReference() { + return this.request instanceof Reference; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (The claim or financial resource.) + */ + public DetailsComponent setRequest(Type value) { + this.request = value; + return this; + } + + /** + * @return {@link #responce} (The claim response resource.) + */ + public Type getResponce() { + return this.responce; + } + + /** + * @return {@link #responce} (The claim response resource.) + */ + public Identifier getResponceIdentifier() throws FHIRException { + if (!(this.responce instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.responce.getClass().getName()+" was encountered"); + return (Identifier) this.responce; + } + + public boolean hasResponceIdentifier() { + return this.responce instanceof Identifier; + } + + /** + * @return {@link #responce} (The claim response resource.) + */ + public Reference getResponceReference() throws FHIRException { + if (!(this.responce instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.responce.getClass().getName()+" was encountered"); + return (Reference) this.responce; + } + + public boolean hasResponceReference() { + return this.responce instanceof Reference; + } + + public boolean hasResponce() { + return this.responce != null && !this.responce.isEmpty(); + } + + /** + * @param value {@link #responce} (The claim response resource.) + */ + public DetailsComponent setResponce(Type value) { + this.responce = value; + return this; + } + + /** + * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) + */ + public Type getSubmitter() { + return this.submitter; + } + + /** + * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) + */ + public Identifier getSubmitterIdentifier() throws FHIRException { + if (!(this.submitter instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.submitter.getClass().getName()+" was encountered"); + return (Identifier) this.submitter; + } + + public boolean hasSubmitterIdentifier() { + return this.submitter instanceof Identifier; + } + + /** + * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) + */ + public Reference getSubmitterReference() throws FHIRException { + if (!(this.submitter instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.submitter.getClass().getName()+" was encountered"); + return (Reference) this.submitter; + } + + public boolean hasSubmitterReference() { + return this.submitter instanceof Reference; + } + + public boolean hasSubmitter() { + return this.submitter != null && !this.submitter.isEmpty(); + } + + /** + * @param value {@link #submitter} (The Organization which submitted the invoice or financial transaction.) + */ + public DetailsComponent setSubmitter(Type value) { + this.submitter = value; + return this; + } + + /** + * @return {@link #payee} (The organization which is receiving the payment.) + */ + public Type getPayee() { + return this.payee; + } + + /** + * @return {@link #payee} (The organization which is receiving the payment.) + */ + public Identifier getPayeeIdentifier() throws FHIRException { + if (!(this.payee instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.payee.getClass().getName()+" was encountered"); + return (Identifier) this.payee; + } + + public boolean hasPayeeIdentifier() { + return this.payee instanceof Identifier; + } + + /** + * @return {@link #payee} (The organization which is receiving the payment.) + */ + public Reference getPayeeReference() throws FHIRException { + if (!(this.payee instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.payee.getClass().getName()+" was encountered"); + return (Reference) this.payee; + } + + public boolean hasPayeeReference() { + return this.payee instanceof Reference; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (The organization which is receiving the payment.) + */ + public DetailsComponent setPayee(Type value) { + this.payee = value; + return this; + } + + /** + * @return {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateType(); // bb + 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 date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DetailsComponent setDateElement(DateType value) { + this.date = value; + return this; + } + + /** + * @return The date of the invoice or financial resource. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date of the invoice or financial resource. + */ + public DetailsComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #amount} (Amount paid for this detail.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); // cc + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Amount paid for this detail.) + */ + public DetailsComponent setAmount(Money value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Code to indicate the nature of the payment, adjustment, funds advance, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("request[x]", "Identifier|Reference(Any)", "The claim or financial resource.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("responce[x]", "Identifier|Reference(Any)", "The claim response resource.", 0, java.lang.Integer.MAX_VALUE, responce)); + childrenList.add(new Property("submitter[x]", "Identifier|Reference(Organization)", "The Organization which submitted the invoice or financial transaction.", 0, java.lang.Integer.MAX_VALUE, submitter)); + childrenList.add(new Property("payee[x]", "Identifier|Reference(Organization)", "The organization which is receiving the payment.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("date", "date", "The date of the invoice or financial resource.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("amount", "Money", "Amount paid for this detail.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type + case -340323759: /*responce*/ return this.responce == null ? new Base[0] : new Base[] {this.responce}; // Type + case 348678409: /*submitter*/ return this.submitter == null ? new Base[0] : new Base[] {this.submitter}; // Type + case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // Type + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType + case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 1095692943: // request + this.request = (Type) value; // Type + break; + case -340323759: // responce + this.responce = (Type) value; // Type + break; + case 348678409: // submitter + this.submitter = (Type) value; // Type + break; + case 106443592: // payee + this.payee = (Type) value; // Type + break; + case 3076014: // date + this.date = castToDate(value); // DateType + break; + case -1413853096: // amount + this.amount = castToMoney(value); // Money + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("request[x]")) + this.request = (Type) value; // Type + else if (name.equals("responce[x]")) + this.responce = (Type) value; // Type + else if (name.equals("submitter[x]")) + this.submitter = (Type) value; // Type + else if (name.equals("payee[x]")) + this.payee = (Type) value; // Type + else if (name.equals("date")) + this.date = castToDate(value); // DateType + else if (name.equals("amount")) + this.amount = castToMoney(value); // Money + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 37106577: return getRequest(); // Type + case 1832772751: return getResponce(); // Type + case -2047315241: return getSubmitter(); // Type + case 1375276088: return getPayee(); // Type + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateType + case -1413853096: return getAmount(); // Money + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("requestIdentifier")) { + this.request = new Identifier(); + return this.request; + } + else if (name.equals("requestReference")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("responceIdentifier")) { + this.responce = new Identifier(); + return this.responce; + } + else if (name.equals("responceReference")) { + this.responce = new Reference(); + return this.responce; + } + else if (name.equals("submitterIdentifier")) { + this.submitter = new Identifier(); + return this.submitter; + } + else if (name.equals("submitterReference")) { + this.submitter = new Reference(); + return this.submitter; + } + else if (name.equals("payeeIdentifier")) { + this.payee = new Identifier(); + return this.payee; + } + else if (name.equals("payeeReference")) { + this.payee = new Reference(); + return this.payee; + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.date"); + } + else if (name.equals("amount")) { + this.amount = new Money(); + return this.amount; + } + else + return super.addChild(name); + } + + public DetailsComponent copy() { + DetailsComponent dst = new DetailsComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.request = request == null ? null : request.copy(); + dst.responce = responce == null ? null : responce.copy(); + dst.submitter = submitter == null ? null : submitter.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.date = date == null ? null : date.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof DetailsComponent)) + return false; + DetailsComponent o = (DetailsComponent) other; + return compareDeep(type, o.type, true) && compareDeep(request, o.request, true) && compareDeep(responce, o.responce, true) + && compareDeep(submitter, o.submitter, true) && compareDeep(payee, o.payee, true) && compareDeep(date, o.date, true) + && compareDeep(amount, o.amount, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof DetailsComponent)) + return false; + DetailsComponent o = (DetailsComponent) other; + return compareValues(date, o.date, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (request == null || request.isEmpty()) + && (responce == null || responce.isEmpty()) && (submitter == null || submitter.isEmpty()) + && (payee == null || payee.isEmpty()) && (date == null || date.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + public String fhirType() { + return "PaymentReconciliation.detail"; + + } + + } + + @Block() + public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The note purpose: Print/Display. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Notes text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 129959202L; + + /** + * Constructor + */ + public NotesComponent() { + super(); + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public NotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public NotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public NotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("text")) + this.text = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.text"); + } + else + return super.addChild(name); + } + + public NotesComponent copy() { + NotesComponent dst = new NotesComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof NotesComponent)) + return false; + NotesComponent o = (NotesComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + public String fhirType() { + return "PaymentReconciliation.note"; + + } + + } + + /** + * The Response business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {Identifier.class, ProcessRequest.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) + protected Type request; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + 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=7, min=0, max=1, modifier=false, summary=true) + @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 = {Identifier.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Type organization; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Type requestProvider; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Type requestOrganization; + + /** + * List of individual settlement amounts and the corresponding transaction. + */ + @Child(name = "detail", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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=12, min=0, max=1, modifier=false, summary=true) + @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=13, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount." ) + protected Money total; + + /** + * Suite of notes. + */ + @Child(name = "note", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Note text", formalDefinition="Suite of notes." ) + protected List note; + + private static final long serialVersionUID = -293306995L; + + /** + * Constructor + */ + public PaymentReconciliation() { + super(); + } + + /** + * Constructor + */ + public PaymentReconciliation(Money total) { + super(); + this.total = total; + } + + /** + * @return {@link #identifier} (The Response business identifier.) + */ + 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 Response business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public PaymentReconciliation addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Type getRequest() { + return this.request; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Identifier getRequestIdentifier() throws FHIRException { + if (!(this.request instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Identifier) this.request; + } + + public boolean hasRequestIdentifier() { + return this.request instanceof Identifier; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequestReference() throws FHIRException { + if (!(this.request instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Reference) this.request; + } + + public boolean hasRequestReference() { + return this.request instanceof Reference; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public PaymentReconciliation setRequest(Type value) { + this.request = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). 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 PaymentReconciliation.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb + 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} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public PaymentReconciliation setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RemittanceOutcome getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public PaymentReconciliation setOutcome(RemittanceOutcome value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public PaymentReconciliation setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public PaymentReconciliation setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 PaymentReconciliation setRuleset(Coding value) { + this.ruleset = 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 PaymentReconciliation.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 PaymentReconciliation 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 PaymentReconciliation.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 PaymentReconciliation 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 PaymentReconciliation 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 #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(); // cc + 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.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public PaymentReconciliation setOrganization(Type value) { + this.organization = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Type getRequestProvider() { + return this.requestProvider; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Identifier getRequestProviderIdentifier() throws FHIRException { + if (!(this.requestProvider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); + return (Identifier) this.requestProvider; + } + + public boolean hasRequestProviderIdentifier() { + return this.requestProvider instanceof Identifier; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProviderReference() throws FHIRException { + if (!(this.requestProvider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); + return (Reference) this.requestProvider; + } + + public boolean hasRequestProviderReference() { + return this.requestProvider instanceof Reference; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public PaymentReconciliation setRequestProvider(Type value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Type getRequestOrganization() { + return this.requestOrganization; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Identifier getRequestOrganizationIdentifier() throws FHIRException { + if (!(this.requestOrganization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); + return (Identifier) this.requestOrganization; + } + + public boolean hasRequestOrganizationIdentifier() { + return this.requestOrganization instanceof Identifier; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganizationReference() throws FHIRException { + if (!(this.requestOrganization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); + return (Reference) this.requestOrganization; + } + + public boolean hasRequestOrganizationReference() { + return this.requestOrganization instanceof Reference; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public PaymentReconciliation setRequestOrganization(Type value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailsComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) + */ + // syntactic sugar + public DetailsComponent addDetail() { //3 + DetailsComponent t = new DetailsComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + // syntactic sugar + public PaymentReconciliation addDetail(DetailsComponent t) { //3 + if (t == null) + return this; + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public PaymentReconciliation setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #total} (Total payment amount.) + */ + public Money getTotal() { + if (this.total == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.total"); + else if (Configuration.doAutoCreate()) + this.total = new Money(); // cc + return this.total; + } + + public boolean hasTotal() { + return this.total != null && !this.total.isEmpty(); + } + + /** + * @param value {@link #total} (Total payment amount.) + */ + public PaymentReconciliation setTotal(Money value) { + this.total = value; + return this; + } + + /** + * @return {@link #note} (Suite of notes.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (NotesComponent item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Suite of notes.) + */ + // syntactic sugar + public NotesComponent addNote() { //3 + NotesComponent t = new NotesComponent(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + // syntactic sugar + public PaymentReconciliation addNote(NotesComponent t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + 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("request[x]", "Identifier|Reference(ProcessRequest)", "Original request resource reference.", 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("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[x]", "Identifier|Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider[x]", "Identifier|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[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + childrenList.add(new Property("detail", "", "List of individual settlement amounts and the corresponding transaction.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("total", "Money", "Total payment amount.", 0, java.lang.Integer.MAX_VALUE, total)); + childrenList.add(new Property("note", "", "Suite of notes.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type + case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailsComponent + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding + case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // Money + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NotesComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1095692943: // request + this.request = (Type) value; // Type + break; + case -1106507950: // outcome + this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case 1601527200: // requestProvider + this.requestProvider = (Type) value; // Type + break; + case 599053666: // requestOrganization + this.requestOrganization = (Type) value; // Type + break; + case -1335224239: // detail + this.getDetail().add((DetailsComponent) value); // DetailsComponent + break; + case 3148996: // form + this.form = castToCoding(value); // Coding + break; + case 110549828: // total + this.total = castToMoney(value); // Money + break; + case 3387378: // note + this.getNote().add((NotesComponent) value); // NotesComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("request[x]")) + this.request = (Type) value; // Type + else if (name.equals("outcome")) + this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("requestProvider[x]")) + this.requestProvider = (Type) value; // Type + else if (name.equals("requestOrganization[x]")) + this.requestOrganization = (Type) value; // Type + else if (name.equals("detail")) + this.getDetail().add((DetailsComponent) value); + else if (name.equals("form")) + this.form = castToCoding(value); // Coding + else if (name.equals("total")) + this.total = castToMoney(value); // Money + else if (name.equals("note")) + this.getNote().add((NotesComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 37106577: return getRequest(); // Type + case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -991726143: return getPeriod(); // Period + case 1326483053: return getOrganization(); // Type + case -1694784800: return getRequestProvider(); // Type + case 818740190: return getRequestOrganization(); // Type + case -1335224239: return addDetail(); // DetailsComponent + case 3148996: return getForm(); // Coding + case 110549828: return getTotal(); // Money + case 3387378: return addNote(); // NotesComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("requestIdentifier")) { + this.request = new Identifier(); + return this.request; + } + else if (name.equals("requestReference")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("outcome")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.outcome"); + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.disposition"); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.created"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("requestProviderIdentifier")) { + this.requestProvider = new Identifier(); + return this.requestProvider; + } + else if (name.equals("requestProviderReference")) { + this.requestProvider = new Reference(); + return this.requestProvider; + } + else if (name.equals("requestOrganizationIdentifier")) { + this.requestOrganization = new Identifier(); + return this.requestOrganization; + } + else if (name.equals("requestOrganizationReference")) { + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + else if (name.equals("detail")) { + return addDetail(); + } + else if (name.equals("form")) { + this.form = new Coding(); + return this.form; + } + else if (name.equals("total")) { + this.total = new Money(); + return this.total; + } + else if (name.equals("note")) { + return addNote(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "PaymentReconciliation"; + + } + + public PaymentReconciliation copy() { + PaymentReconciliation dst = new PaymentReconciliation(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailsComponent i : detail) + dst.detail.add(i.copy()); + }; + dst.form = form == null ? null : form.copy(); + dst.total = total == null ? null : total.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (NotesComponent i : note) + dst.note.add(i.copy()); + }; + return dst; + } + + protected PaymentReconciliation typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PaymentReconciliation)) + return false; + PaymentReconciliation o = (PaymentReconciliation) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(period, o.period, true) && compareDeep(organization, o.organization, true) + && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(requestOrganization, o.requestOrganization, true) + && compareDeep(detail, o.detail, true) && compareDeep(form, o.form, true) && compareDeep(total, o.total, true) + && compareDeep(note, o.note, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PaymentReconciliation)) + return false; + PaymentReconciliation o = (PaymentReconciliation) other; + return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + ; + } + + public boolean isEmpty() { + 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()) + && (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()) + && (note == null || note.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PaymentReconciliation; + } + + /** + * Search parameter: requestorganizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: PaymentReconciliation.requestOrganizationReference
+ *

+ */ + @SearchParamDefinition(name="requestorganizationreference", path="PaymentReconciliation.requestOrganization.as(Reference)", description="The organization who generated this resource", type="reference" ) + public static final String SP_REQUESTORGANIZATIONREFERENCE = "requestorganizationreference"; + /** + * Fluent Client search parameter constant for requestorganizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: PaymentReconciliation.requestOrganizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PaymentReconciliation:requestorganizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:requestorganizationreference").toLocked(); + + /** + * Search parameter: created + *

+ * Description: The creation date
+ * Type: date
+ * Path: PaymentReconciliation.created
+ *

+ */ + @SearchParamDefinition(name="created", path="PaymentReconciliation.created", description="The creation date", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: The creation date
+ * Type: date
+ * Path: PaymentReconciliation.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: requestorganizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: PaymentReconciliation.requestOrganizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestorganizationidentifier", path="PaymentReconciliation.requestOrganization.as(Identifier)", description="The organization who generated this resource", type="token" ) + public static final String SP_REQUESTORGANIZATIONIDENTIFIER = "requestorganizationidentifier"; + /** + * Fluent Client search parameter constant for requestorganizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: PaymentReconciliation.requestOrganizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTORGANIZATIONIDENTIFIER); + + /** + * Search parameter: requestprovideridentifier + *

+ * Description: The reference to the provider who sumbitted the claim
+ * Type: token
+ * Path: PaymentReconciliation.requestProviderIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestprovideridentifier", path="PaymentReconciliation.requestProvider.as(Identifier)", description="The reference to the provider who sumbitted the claim", type="token" ) + public static final String SP_REQUESTPROVIDERIDENTIFIER = "requestprovideridentifier"; + /** + * Fluent Client search parameter constant for requestprovideridentifier + *

+ * Description: The reference to the provider who sumbitted the claim
+ * Type: token
+ * Path: PaymentReconciliation.requestProviderIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTPROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTPROVIDERIDENTIFIER); + + /** + * Search parameter: requestidentifier + *

+ * Description: The reference to the claim
+ * Type: token
+ * Path: PaymentReconciliation.requestIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestidentifier", path="PaymentReconciliation.request.as(Identifier)", description="The reference to the claim", type="token" ) + public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; + /** + * Fluent Client search parameter constant for requestidentifier + *

+ * Description: The reference to the claim
+ * Type: token
+ * Path: PaymentReconciliation.requestIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); + + /** + * Search parameter: requestreference + *

+ * Description: The reference to the claim
+ * Type: reference
+ * Path: PaymentReconciliation.requestReference
+ *

+ */ + @SearchParamDefinition(name="requestreference", path="PaymentReconciliation.request.as(Reference)", description="The reference to the claim", type="reference" ) + public static final String SP_REQUESTREFERENCE = "requestreference"; + /** + * Fluent Client search parameter constant for requestreference + *

+ * Description: The reference to the claim
+ * Type: reference
+ * Path: PaymentReconciliation.requestReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PaymentReconciliation:requestreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:requestreference").toLocked(); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: PaymentReconciliation.organizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="PaymentReconciliation.organization.as(Identifier)", description="The organization who generated this resource", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: PaymentReconciliation.organizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: requestproviderreference + *

+ * Description: The reference to the provider who sumbitted the claim
+ * Type: reference
+ * Path: PaymentReconciliation.requestProviderReference
+ *

+ */ + @SearchParamDefinition(name="requestproviderreference", path="PaymentReconciliation.requestProvider.as(Reference)", description="The reference to the provider who sumbitted the claim", type="reference" ) + public static final String SP_REQUESTPROVIDERREFERENCE = "requestproviderreference"; + /** + * Fluent Client search parameter constant for requestproviderreference + *

+ * Description: The reference to the provider who sumbitted the claim
+ * Type: reference
+ * Path: PaymentReconciliation.requestProviderReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTPROVIDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PaymentReconciliation:requestproviderreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:requestproviderreference").toLocked(); + + /** + * Search parameter: organizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: PaymentReconciliation.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="PaymentReconciliation.organization.as(Reference)", description="The organization who generated this resource", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: PaymentReconciliation.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PaymentReconciliation:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:organizationreference").toLocked(); + + /** + * Search parameter: outcome + *

+ * Description: The processing outcome
+ * Type: token
+ * Path: PaymentReconciliation.outcome
+ *

+ */ + @SearchParamDefinition(name="outcome", path="PaymentReconciliation.outcome", description="The processing outcome", type="token" ) + public static final String SP_OUTCOME = "outcome"; + /** + * Fluent Client search parameter constant for outcome + *

+ * Description: The processing outcome
+ * Type: token
+ * Path: PaymentReconciliation.outcome
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME); + + /** + * Search parameter: identifier + *

+ * Description: The business identifier of the Explanation of Benefit
+ * Type: token
+ * Path: PaymentReconciliation.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="PaymentReconciliation.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier of the Explanation of Benefit
+ * Type: token
+ * Path: PaymentReconciliation.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: disposition + *

+ * Description: The contents of the disposition message
+ * Type: string
+ * Path: PaymentReconciliation.disposition
+ *

+ */ + @SearchParamDefinition(name="disposition", path="PaymentReconciliation.disposition", description="The contents of the disposition message", type="string" ) + public static final String SP_DISPOSITION = "disposition"; + /** + * Fluent Client search parameter constant for disposition + *

+ * Description: The contents of the disposition message
+ * Type: string
+ * Path: PaymentReconciliation.disposition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Period.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Period.java new file mode 100644 index 00000000000..6ad43e01050 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Period.java @@ -0,0 +1,301 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A time period defined by a start and end date and optionally time. + */ +@DatatypeDef(name="Period") +public class Period extends Type implements ICompositeType { + + /** + * The start of the period. The boundary is inclusive. + */ + @Child(name = "start", type = {DateTimeType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Starting time with inclusive boundary", formalDefinition="The start of the period. The boundary is inclusive." ) + protected DateTimeType start; + + /** + * The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. + */ + @Child(name = "end", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="End time with inclusive boundary, if not ongoing", formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." ) + protected DateTimeType end; + + private static final long serialVersionUID = 649791751L; + + /** + * Constructor + */ + public Period() { + super(); + } + + /** + * @return {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public DateTimeType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Period.start"); + else if (Configuration.doAutoCreate()) + this.start = new DateTimeType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Period setStartElement(DateTimeType value) { + this.start = value; + return this; + } + + /** + * @return The start of the period. The boundary is inclusive. + */ + 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(Date value) { + if (value == null) + this.start = null; + else { + if (this.start == null) + this.start = new DateTimeType(); + this.start.setValue(value); + } + return this; + } + + /** + * @return {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public DateTimeType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Period.end"); + else if (Configuration.doAutoCreate()) + this.end = new DateTimeType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Period setEndElement(DateTimeType value) { + this.end = value; + return this; + } + + /** + * @return The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. + */ + 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. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. + */ + public Period setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new DateTimeType(); + this.end.setValue(value); + } + return this; + } + + /** + * Sets the value for start () + * + *

+ * Definition: + * The start of the period. The boundary is inclusive. + *

+ */ + public Period setStart( Date theDate, TemporalPrecisionEnum thePrecision) { + start = new DateTimeType(theDate, thePrecision); + return this; + } + + /** + * Sets the value for end () + * + *

+ * Definition: + * The end of the period. The boundary is inclusive. + *

+ */ + public Period setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { + end = new DateTimeType(theDate, thePrecision); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("start", "dateTime", "The start of the period. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "dateTime", "The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.", 0, java.lang.Integer.MAX_VALUE, end)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // DateTimeType + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // DateTimeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 109757538: // start + this.start = castToDateTime(value); // DateTimeType + break; + case 100571: // end + this.end = castToDateTime(value); // DateTimeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("start")) + this.start = castToDateTime(value); // DateTimeType + else if (name.equals("end")) + this.end = castToDateTime(value); // DateTimeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // DateTimeType + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // DateTimeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("start")) { + throw new FHIRException("Cannot call addChild on a primitive type Period.start"); + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type Period.end"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Period"; + + } + + public Period copy() { + Period dst = new Period(); + copyValues(dst); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + return dst; + } + + protected Period typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Period)) + return false; + Period o = (Period) other; + return compareDeep(start, o.start, true) && compareDeep(end, o.end, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Period)) + return false; + Period o = (Period) other; + return compareValues(start, o.start, true) && compareValues(end, o.end, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Person.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Person.java new file mode 100644 index 00000000000..4f099c688d2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Person.java @@ -0,0 +1,1541 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * 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 IdentityAssuranceLevel { + /** + * 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 IdentityAssuranceLevel fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/identity-assuranceLevel"; + case LEVEL2: return "http://hl7.org/fhir/identity-assuranceLevel"; + case LEVEL3: return "http://hl7.org/fhir/identity-assuranceLevel"; + case LEVEL4: return "http://hl7.org/fhir/identity-assuranceLevel"; + 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 Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("level1".equals(codeString)) + return new Enumeration(this, IdentityAssuranceLevel.LEVEL1); + if ("level2".equals(codeString)) + return new Enumeration(this, IdentityAssuranceLevel.LEVEL2); + if ("level3".equals(codeString)) + return new Enumeration(this, IdentityAssuranceLevel.LEVEL3); + if ("level4".equals(codeString)) + return new Enumeration(this, IdentityAssuranceLevel.LEVEL4); + throw new FHIRException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); + } + public String toCode(IdentityAssuranceLevel code) { + 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 "?"; + } + public String toSystem(IdentityAssuranceLevel code) { + return code.getSystem(); + } + } + + @Block() + public static class PersonLinkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The resource to which this actual person is associated. + */ + @Child(name = "target", type = {Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The resource to which this actual person is associated.) + */ + protected Resource targetTarget; + + /** + * Level of assurance that this link is actually associated with the target resource. + */ + @Child(name = "assurance", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the target resource." ) + protected Enumeration assurance; + + private static final long serialVersionUID = 508763647L; + + /** + * Constructor + */ + public PersonLinkComponent() { + super(); + } + + /** + * Constructor + */ + public PersonLinkComponent(Reference target) { + super(); + this.target = target; + } + + /** + * @return {@link #target} (The resource to which this actual person is associated.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PersonLinkComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The resource to which this actual person is associated.) + */ + public PersonLinkComponent 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. (The resource to which this actual person is associated.) + */ + public Resource getTargetTarget() { + 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. (The resource to which this actual person is associated.) + */ + public PersonLinkComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). 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(new IdentityAssuranceLevelEnumFactory()); // bb + 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 target resource.). 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 target resource. + */ + public IdentityAssuranceLevel getAssurance() { + return this.assurance == null ? null : this.assurance.getValue(); + } + + /** + * @param value Level of assurance that this link is actually associated with the target resource. + */ + public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) { + if (value == null) + this.assurance = null; + else { + if (this.assurance == null) + this.assurance = new Enumeration(new IdentityAssuranceLevelEnumFactory()); + this.assurance.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("target", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the target resource.", 0, java.lang.Integer.MAX_VALUE, assurance)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference + case 1771900717: /*assurance*/ return this.assurance == null ? new Base[0] : new Base[] {this.assurance}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -880905839: // target + this.target = castToReference(value); // Reference + break; + case 1771900717: // assurance + this.assurance = new IdentityAssuranceLevelEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("target")) + this.target = castToReference(value); // Reference + else if (name.equals("assurance")) + this.assurance = new IdentityAssuranceLevelEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -880905839: return getTarget(); // Reference + case 1771900717: throw new FHIRException("Cannot make property assurance as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("target")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("assurance")) { + throw new FHIRException("Cannot call addChild on a primitive type Person.assurance"); + } + else + return super.addChild(name); + } + + public PersonLinkComponent copy() { + PersonLinkComponent dst = new PersonLinkComponent(); + copyValues(dst); + dst.target = target == null ? null : target.copy(); + dst.assurance = assurance == null ? null : assurance.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PersonLinkComponent)) + return false; + PersonLinkComponent o = (PersonLinkComponent) other; + return compareDeep(target, o.target, true) && compareDeep(assurance, o.assurance, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PersonLinkComponent)) + return false; + PersonLinkComponent o = (PersonLinkComponent) other; + return compareValues(assurance, o.assurance, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (target == null || target.isEmpty()) && (assurance == null || assurance.isEmpty()) + ; + } + + public String fhirType() { + return "Person.link"; + + } + + } + + /** + * Identifier for a person within a particular scope. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." ) + protected Enumeration gender; + + /** + * The birth date for the person. + */ + @Child(name = "birthDate", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The date on which the person was born", formalDefinition="The birth date for the person." ) + protected DateType birthDate; + + /** + * One or more addresses for the person. + */ + @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @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=6, min=0, max=1, modifier=false, summary=false) + @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=7, min=0, max=1, modifier=false, summary=true) + @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=8, min=0, max=1, modifier=true, summary=true) + @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 concerns the same actual person. + */ + @Child(name = "link", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Link to a resource that concerns the same actual person", formalDefinition="Link to a resource that concerns the same actual person." ) + protected List link; + + private static final long serialVersionUID = -117464654L; + + /** + * Constructor + */ + 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; + } + + // syntactic sugar + public Person addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @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; + } + + // syntactic sugar + public Person addName(HumanName t) { //3 + if (t == null) + return this; + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return this; + } + + /** + * @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; + } + + // syntactic sugar + public Person addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @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(new AdministrativeGenderEnumFactory()); // bb + 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(new AdministrativeGenderEnumFactory()); + 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 DateType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateType(); // bb + 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(DateType 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 DateType(); + 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; + } + + // syntactic sugar + public Person addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @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(); // cc + 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(); // cc + 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(); // aa + 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(); // bb + 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 || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Whether this person's record is in active use. + */ + public Person setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + /** + * @return {@link #link} (Link to a resource that concerns 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 concerns 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; + } + + // syntactic sugar + public Person addLink(PersonLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + 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", "date", "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 concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration + case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType + case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address + case 106642994: /*photo*/ return this.photo == null ? new Base[0] : new Base[] {this.photo}; // Attachment + case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference + case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType + case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // PersonLinkComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 3373707: // name + this.getName().add(castToHumanName(value)); // HumanName + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1249512767: // gender + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + break; + case -1210031859: // birthDate + this.birthDate = castToDate(value); // DateType + break; + case -1147692044: // address + this.getAddress().add(castToAddress(value)); // Address + break; + case 106642994: // photo + this.photo = castToAttachment(value); // Attachment + break; + case -2058947787: // managingOrganization + this.managingOrganization = castToReference(value); // Reference + break; + case -1422950650: // active + this.active = castToBoolean(value); // BooleanType + break; + case 3321850: // link + this.getLink().add((PersonLinkComponent) value); // PersonLinkComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("name")) + this.getName().add(castToHumanName(value)); + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("gender")) + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + else if (name.equals("birthDate")) + this.birthDate = castToDate(value); // DateType + else if (name.equals("address")) + this.getAddress().add(castToAddress(value)); + else if (name.equals("photo")) + this.photo = castToAttachment(value); // Attachment + else if (name.equals("managingOrganization")) + this.managingOrganization = castToReference(value); // Reference + else if (name.equals("active")) + this.active = castToBoolean(value); // BooleanType + else if (name.equals("link")) + this.getLink().add((PersonLinkComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 3373707: return addName(); // HumanName + case -1429363305: return addTelecom(); // ContactPoint + case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration + case -1210031859: throw new FHIRException("Cannot make property birthDate as it is not a complex type"); // DateType + case -1147692044: return addAddress(); // Address + case 106642994: return getPhoto(); // Attachment + case -2058947787: return getManagingOrganization(); // Reference + case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType + case 3321850: return addLink(); // PersonLinkComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("name")) { + return addName(); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("gender")) { + throw new FHIRException("Cannot call addChild on a primitive type Person.gender"); + } + else if (name.equals("birthDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Person.birthDate"); + } + else if (name.equals("address")) { + return addAddress(); + } + else if (name.equals("photo")) { + this.photo = new Attachment(); + return this.photo; + } + else if (name.equals("managingOrganization")) { + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + else if (name.equals("active")) { + throw new FHIRException("Cannot call addChild on a primitive type Person.active"); + } + else if (name.equals("link")) { + return addLink(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Person"; + + } + + 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(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Person)) + return false; + Person o = (Person) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) + && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true) + && compareDeep(photo, o.photo, true) && compareDeep(managingOrganization, o.managingOrganization, true) + && compareDeep(active, o.active, true) && compareDeep(link, o.link, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Person)) + return false; + Person o = (Person) other; + return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) && compareValues(active, o.active, true) + ; + } + + 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; + } + + /** + * Search parameter: phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: Person.telecom(system=phone)
+ *

+ */ + @SearchParamDefinition(name="phone", path="Person.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) + public static final String SP_PHONE = "phone"; + /** + * Fluent Client search parameter constant for phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: Person.telecom(system=phone)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); + + /** + * Search parameter: phonetic + *

+ * Description: A portion of name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Person.name
+ *

+ */ + @SearchParamDefinition(name="phonetic", path="Person.name", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + /** + * Fluent Client search parameter constant for phonetic + *

+ * Description: A portion of name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Person.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); + + /** + * Search parameter: link + *

+ * Description: Any link has this Patient, Person, RelatedPerson or Practitioner reference
+ * Type: reference
+ * Path: Person.link.target
+ *

+ */ + @SearchParamDefinition(name="link", path="Person.link.target", description="Any link has this Patient, Person, RelatedPerson or Practitioner reference", type="reference" ) + public static final String SP_LINK = "link"; + /** + * Fluent Client search parameter constant for link + *

+ * Description: Any link has this Patient, Person, RelatedPerson or Practitioner reference
+ * Type: reference
+ * Path: Person.link.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LINK = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LINK); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Person:link". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LINK = new ca.uhn.fhir.model.api.Include("Person:link").toLocked(); + + /** + * Search parameter: address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Person.address.country
+ *

+ */ + @SearchParamDefinition(name="address-country", path="Person.address.country", description="A country specified in an address", type="string" ) + public static final String SP_ADDRESS_COUNTRY = "address-country"; + /** + * Fluent Client search parameter constant for address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Person.address.country
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + + /** + * Search parameter: relatedperson + *

+ * Description: The Person links to this RelatedPerson
+ * Type: reference
+ * Path: Person.link.target
+ *

+ */ + @SearchParamDefinition(name="relatedperson", path="Person.link.target", description="The Person links to this RelatedPerson", type="reference" ) + public static final String SP_RELATEDPERSON = "relatedperson"; + /** + * Fluent Client search parameter constant for relatedperson + *

+ * Description: The Person links to this RelatedPerson
+ * Type: reference
+ * Path: Person.link.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATEDPERSON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATEDPERSON); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Person:relatedperson". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATEDPERSON = new ca.uhn.fhir.model.api.Include("Person:relatedperson").toLocked(); + + /** + * Search parameter: organization + *

+ * Description: The organization at which this person record is being managed
+ * Type: reference
+ * Path: Person.managingOrganization
+ *

+ */ + @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"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: The organization at which this person record is being managed
+ * Type: reference
+ * Path: Person.managingOrganization
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Person:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Person:organization").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The Person links to this Patient
+ * Type: reference
+ * Path: Person.link.target
+ *

+ */ + @SearchParamDefinition(name="patient", path="Person.link.target", description="The Person links to this Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The Person links to this Patient
+ * Type: reference
+ * Path: Person.link.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Person:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Person:patient").toLocked(); + + /** + * Search parameter: address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Person.address.city
+ *

+ */ + @SearchParamDefinition(name="address-city", path="Person.address.city", description="A city specified in an address", type="string" ) + public static final String SP_ADDRESS_CITY = "address-city"; + /** + * Fluent Client search parameter constant for address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Person.address.city
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); + + /** + * Search parameter: address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Person.address.state
+ *

+ */ + @SearchParamDefinition(name="address-state", path="Person.address.state", description="A state specified in an address", type="string" ) + public static final String SP_ADDRESS_STATE = "address-state"; + /** + * Fluent Client search parameter constant for address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Person.address.state
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); + + /** + * Search parameter: practitioner + *

+ * Description: The Person links to this Practitioner
+ * Type: reference
+ * Path: Person.link.target
+ *

+ */ + @SearchParamDefinition(name="practitioner", path="Person.link.target", description="The Person links to this Practitioner", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + /** + * Fluent Client search parameter constant for practitioner + *

+ * Description: The Person links to this Practitioner
+ * Type: reference
+ * Path: Person.link.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Person:practitioner". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Person:practitioner").toLocked(); + + /** + * Search parameter: email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: Person.telecom(system=email)
+ *

+ */ + @SearchParamDefinition(name="email", path="Person.telecom.where(system='email')", description="A value in an email contact", type="token" ) + public static final String SP_EMAIL = "email"; + /** + * Fluent Client search parameter constant for email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: Person.telecom(system=email)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); + + /** + * Search parameter: address + *

+ * Description: An address in any kind of address/part
+ * Type: string
+ * Path: Person.address
+ *

+ */ + @SearchParamDefinition(name="address", path="Person.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + /** + * Fluent Client search parameter constant for address + *

+ * Description: An address in any kind of address/part
+ * Type: string
+ * Path: Person.address
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); + + /** + * Search parameter: address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Person.address.use
+ *

+ */ + @SearchParamDefinition(name="address-use", path="Person.address.use", description="A use code specified in an address", type="token" ) + public static final String SP_ADDRESS_USE = "address-use"; + /** + * Fluent Client search parameter constant for address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Person.address.use
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); + + /** + * Search parameter: name + *

+ * Description: A portion of name in any name part
+ * Type: string
+ * Path: Person.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Person.name", description="A portion of name in any name part", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: A portion of name in any name part
+ * Type: string
+ * Path: Person.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: birthdate + *

+ * Description: The person's date of birth
+ * Type: date
+ * Path: Person.birthDate
+ *

+ */ + @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" ) + public static final String SP_BIRTHDATE = "birthdate"; + /** + * Fluent Client search parameter constant for birthdate + *

+ * Description: The person's date of birth
+ * Type: date
+ * Path: Person.birthDate
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE); + + /** + * Search parameter: telecom + *

+ * Description: The value in any kind of contact
+ * Type: token
+ * Path: Person.telecom
+ *

+ */ + @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="token" ) + public static final String SP_TELECOM = "telecom"; + /** + * Fluent Client search parameter constant for telecom + *

+ * Description: The value in any kind of contact
+ * Type: token
+ * Path: Person.telecom
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); + + /** + * Search parameter: gender + *

+ * Description: The gender of the person
+ * Type: token
+ * Path: Person.gender
+ *

+ */ + @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" ) + public static final String SP_GENDER = "gender"; + /** + * Fluent Client search parameter constant for gender + *

+ * Description: The gender of the person
+ * Type: token
+ * Path: Person.gender
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); + + /** + * Search parameter: identifier + *

+ * Description: A person Identifier
+ * Type: token
+ * Path: Person.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Person.identifier", description="A person Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A person Identifier
+ * Type: token
+ * Path: Person.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: address-postalcode + *

+ * Description: A postal code specified in an address
+ * Type: string
+ * Path: Person.address.postalCode
+ *

+ */ + @SearchParamDefinition(name="address-postalcode", path="Person.address.postalCode", description="A postal code specified in an address", type="string" ) + public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; + /** + * Fluent Client search parameter constant for address-postalcode + *

+ * Description: A postal code specified in an address
+ * Type: string
+ * Path: Person.address.postalCode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PositiveIntType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PositiveIntType.java new file mode 100644 index 00000000000..86beadeed14 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PositiveIntType.java @@ -0,0 +1,97 @@ +/* +(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. + + */ +/** + * + */ +package org.hl7.fhir.dstu2016may.model; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "integer" in FHIR: A signed 32-bit integer + */ +@DatatypeDef(name = "positiveInt", profileOf=IntegerType.class) +public class PositiveIntType extends IntegerType { + + /** + * + */ + private static final long serialVersionUID = 1686497884249402429L; + + /** + * Constructor + */ + public PositiveIntType() { + // nothing + } + + /** + * Constructor + */ + public PositiveIntType(int theInteger) { + setValue(theInteger); + } + + /** + * Constructor + * + * @param theIntegerAsString + * A string representation of an integer + * @throws IllegalArgumentException + * If the string is not a valid integer representation + */ + public PositiveIntType(String theIntegerAsString) { + setValueAsString(theIntegerAsString); + } + + /** + * Constructor + * + * @param theValue The value + * @throws IllegalArgumentException If the value is too large to fit in a signed integer + */ + public PositiveIntType(Long theValue) { + if (theValue < 1 || 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()); + } + } + + @Override + public PositiveIntType copy() { + return new PositiveIntType(getValue()); + } + + public String fhirType() { + return "positiveInt"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Practitioner.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Practitioner.java new file mode 100644 index 00000000000..7d7b596bb6a --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Practitioner.java @@ -0,0 +1,2212 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A person who is directly or indirectly involved in the provisioning of healthcare. + */ +@ResourceDef(name="Practitioner", profile="http://hl7.org/fhir/Profile/Practitioner") +public class Practitioner extends DomainResource { + + @Block() + public static class PractitionerPractitionerRoleComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The organization where the Practitioner performs the roles associated. + */ + @Child(name = "organization", type = {Organization.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Organization where the roles are performed", formalDefinition="The organization where the Practitioner performs the roles associated." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization where the Practitioner performs the roles associated.) + */ + protected Organization organizationTarget; + + /** + * Roles which this practitioner is authorized to perform for the organization. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." ) + protected CodeableConcept role; + + /** + * Specific specialty of the practitioner. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." ) + protected List specialty; + + /** + * Business Identifiers that are specific to a role/location. + */ + @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifiers that are specific to a role/location", formalDefinition="Business Identifiers that are specific to a role/location." ) + protected List identifier; + + /** + * Contact details that are specific to the role/location/service. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details that are specific to the role/location/service", formalDefinition="Contact details that are specific to the role/location/service." ) + protected List telecom; + + /** + * The period during which the person is authorized to act as a practitioner in these role(s) for the organization. + */ + @Child(name = "period", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The period during which the practitioner is authorized to perform in these role(s)", formalDefinition="The period during which the person is authorized to act as a practitioner in these role(s) for the organization." ) + protected Period period; + + /** + * The location(s) at which this practitioner provides care. + */ + @Child(name = "location", type = {Location.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." ) + protected List location; + /** + * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.) + */ + protected List locationTarget; + + + /** + * The list of healthcare services that this worker provides for this role's Organization/Location(s). + */ + @Child(name = "healthcareService", type = {HealthcareService.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)", formalDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)." ) + protected List healthcareService; + /** + * The actual objects that are the target of the reference (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + protected List healthcareServiceTarget; + + + private static final long serialVersionUID = -2082448551L; + + /** + * Constructor + */ + public PractitionerPractitionerRoleComponent() { + super(); + } + + /** + * @return {@link #organization} (The organization where the Practitioner performs the roles associated.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization where the Practitioner performs the roles associated.) + */ + public PractitionerPractitionerRoleComponent 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 where the Practitioner performs the roles associated.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + 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 where the Practitioner performs the roles associated.) + */ + public PractitionerPractitionerRoleComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (Roles which this practitioner is authorized to perform for the organization.) + */ + public PractitionerPractitionerRoleComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + /** + * @return {@link #specialty} (Specific specialty of the practitioner.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (Specific specialty of the practitioner.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + // syntactic sugar + public PractitionerPractitionerRoleComponent addSpecialty(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return this; + } + + /** + * @return {@link #identifier} (Business Identifiers that are specific to a role/location.) + */ + 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} (Business Identifiers that are specific to a role/location.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public PractitionerPractitionerRoleComponent addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #telecom} (Contact details that are specific to the role/location/service.) + */ + 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} (Contact details that are specific to the role/location/service.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public PractitionerPractitionerRoleComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) + */ + public PractitionerPractitionerRoleComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #location} (The location(s) at which this practitioner provides care.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (Reference item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (The location(s) at which this practitioner provides care.) + */ + // syntactic sugar + public Reference addLocation() { //3 + Reference t = new Reference(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + // syntactic sugar + public PractitionerPractitionerRoleComponent addLocation(Reference t) { //3 + if (t == null) + return this; + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @return {@link #location} (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 location(s) at which this practitioner provides care.) + */ + public List getLocationTarget() { + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + return this.locationTarget; + } + + // syntactic sugar + /** + * @return {@link #location} (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 location(s) at which this practitioner provides care.) + */ + public Location addLocationTarget() { + Location r = new Location(); + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + this.locationTarget.add(r); + return r; + } + + /** + * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public List getHealthcareService() { + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + return this.healthcareService; + } + + public boolean hasHealthcareService() { + if (this.healthcareService == null) + return false; + for (Reference item : this.healthcareService) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + // syntactic sugar + public Reference addHealthcareService() { //3 + Reference t = new Reference(); + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + this.healthcareService.add(t); + return t; + } + + // syntactic sugar + public PractitionerPractitionerRoleComponent addHealthcareService(Reference t) { //3 + if (t == null) + return this; + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + this.healthcareService.add(t); + return this; + } + + /** + * @return {@link #healthcareService} (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 list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public List getHealthcareServiceTarget() { + if (this.healthcareServiceTarget == null) + this.healthcareServiceTarget = new ArrayList(); + return this.healthcareServiceTarget; + } + + // syntactic sugar + /** + * @return {@link #healthcareService} (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 list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public HealthcareService addHealthcareServiceTarget() { + HealthcareService r = new HealthcareService(); + if (this.healthcareServiceTarget == null) + this.healthcareServiceTarget = new ArrayList(); + this.healthcareServiceTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization where the Practitioner performs the roles associated.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("identifier", "Identifier", "Business Identifiers that are specific to a role/location.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details that are specific to the role/location/service.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("healthcareService", "Reference(HealthcareService)", "The list of healthcare services that this worker provides for this role's Organization/Location(s).", 0, java.lang.Integer.MAX_VALUE, healthcareService)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept + case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference + case 1289661064: /*healthcareService*/ return this.healthcareService == null ? new Base[0] : this.healthcareService.toArray(new Base[this.healthcareService.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1178922291: // organization + this.organization = castToReference(value); // Reference + break; + case 3506294: // role + this.role = castToCodeableConcept(value); // CodeableConcept + break; + case -1694759682: // specialty + this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case 1901043637: // location + this.getLocation().add(castToReference(value)); // Reference + break; + case 1289661064: // healthcareService + this.getHealthcareService().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("organization")) + this.organization = castToReference(value); // Reference + else if (name.equals("role")) + this.role = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("specialty")) + this.getSpecialty().add(castToCodeableConcept(value)); + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("location")) + this.getLocation().add(castToReference(value)); + else if (name.equals("healthcareService")) + this.getHealthcareService().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1178922291: return getOrganization(); // Reference + case 3506294: return getRole(); // CodeableConcept + case -1694759682: return addSpecialty(); // CodeableConcept + case -1618432855: return addIdentifier(); // Identifier + case -1429363305: return addTelecom(); // ContactPoint + case -991726143: return getPeriod(); // Period + case 1901043637: return addLocation(); // Reference + case 1289661064: return addHealthcareService(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("organization")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("role")) { + this.role = new CodeableConcept(); + return this.role; + } + else if (name.equals("specialty")) { + return addSpecialty(); + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("location")) { + return addLocation(); + } + else if (name.equals("healthcareService")) { + return addHealthcareService(); + } + else + return super.addChild(name); + } + + public PractitionerPractitionerRoleComponent copy() { + PractitionerPractitionerRoleComponent dst = new PractitionerPractitionerRoleComponent(); + copyValues(dst); + dst.organization = organization == null ? null : organization.copy(); + dst.role = role == null ? null : role.copy(); + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (Reference i : location) + dst.location.add(i.copy()); + }; + if (healthcareService != null) { + dst.healthcareService = new ArrayList(); + for (Reference i : healthcareService) + dst.healthcareService.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PractitionerPractitionerRoleComponent)) + return false; + PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other; + return compareDeep(organization, o.organization, true) && compareDeep(role, o.role, true) && compareDeep(specialty, o.specialty, true) + && compareDeep(identifier, o.identifier, true) && compareDeep(telecom, o.telecom, true) && compareDeep(period, o.period, true) + && compareDeep(location, o.location, true) && compareDeep(healthcareService, o.healthcareService, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PractitionerPractitionerRoleComponent)) + return false; + PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (organization == null || organization.isEmpty()) && (role == null || role.isEmpty()) + && (specialty == null || specialty.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (period == null || period.isEmpty()) && (location == null || location.isEmpty()) + && (healthcareService == null || healthcareService.isEmpty()); + } + + public String fhirType() { + return "Practitioner.practitionerRole"; + + } + + } + + @Block() + public static class PractitionerQualificationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier that applies to this person's qualification in this role. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="An identifier for this qualification for the practitioner", formalDefinition="An identifier that applies to this person's qualification in this role." ) + protected List identifier; + + /** + * Coded representation of the qualification. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Coded representation of the qualification", formalDefinition="Coded representation of the qualification." ) + protected CodeableConcept code; + + /** + * Period during which the qualification is valid. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Period during which the qualification is valid", formalDefinition="Period during which the qualification is valid." ) + protected Period period; + + /** + * Organization that regulates and issues the qualification. + */ + @Child(name = "issuer", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Organization that regulates and issues the qualification", formalDefinition="Organization that regulates and issues the qualification." ) + protected Reference issuer; + + /** + * The actual object that is the target of the reference (Organization that regulates and issues the qualification.) + */ + protected Organization issuerTarget; + + private static final long serialVersionUID = 1095219071L; + + /** + * Constructor + */ + public PractitionerQualificationComponent() { + super(); + } + + /** + * Constructor + */ + public PractitionerQualificationComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) + */ + 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} (An identifier that applies to this person's qualification in this role.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public PractitionerQualificationComponent addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #code} (Coded representation of the qualification.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Coded representation of the qualification.) + */ + public PractitionerQualificationComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #period} (Period during which the qualification is valid.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Period during which the qualification is valid.) + */ + public PractitionerQualificationComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #issuer} (Organization that regulates and issues the qualification.) + */ + public Reference getIssuer() { + if (this.issuer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); + else if (Configuration.doAutoCreate()) + this.issuer = new Reference(); // cc + return this.issuer; + } + + public boolean hasIssuer() { + return this.issuer != null && !this.issuer.isEmpty(); + } + + /** + * @param value {@link #issuer} (Organization that regulates and issues the qualification.) + */ + public PractitionerQualificationComponent setIssuer(Reference value) { + this.issuer = value; + return this; + } + + /** + * @return {@link #issuer} 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. (Organization that regulates and issues the qualification.) + */ + public Organization getIssuerTarget() { + if (this.issuerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); + else if (Configuration.doAutoCreate()) + this.issuerTarget = new Organization(); // aa + return this.issuerTarget; + } + + /** + * @param value {@link #issuer} 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. (Organization that regulates and issues the qualification.) + */ + public PractitionerQualificationComponent setIssuerTarget(Organization value) { + this.issuerTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person's qualification in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Coded representation of the qualification.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("period", "Period", "Period during which the qualification is valid.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("issuer", "Reference(Organization)", "Organization that regulates and issues the qualification.", 0, java.lang.Integer.MAX_VALUE, issuer)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -1179159879: // issuer + this.issuer = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("issuer")) + this.issuer = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 3059181: return getCode(); // CodeableConcept + case -991726143: return getPeriod(); // Period + case -1179159879: return getIssuer(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("issuer")) { + this.issuer = new Reference(); + return this.issuer; + } + else + return super.addChild(name); + } + + public PractitionerQualificationComponent copy() { + PractitionerQualificationComponent dst = new PractitionerQualificationComponent(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + dst.period = period == null ? null : period.copy(); + dst.issuer = issuer == null ? null : issuer.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PractitionerQualificationComponent)) + return false; + PractitionerQualificationComponent o = (PractitionerQualificationComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(period, o.period, true) + && compareDeep(issuer, o.issuer, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PractitionerQualificationComponent)) + return false; + PractitionerQualificationComponent o = (PractitionerQualificationComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (period == null || period.isEmpty()) && (issuer == null || issuer.isEmpty()); + } + + public String fhirType() { + return "Practitioner.qualification"; + + } + + } + + /** + * An identifier that applies to this person in this role. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A identifier for the person as this agent", formalDefinition="An identifier that applies to this person in this role." ) + protected List identifier; + + /** + * Whether this practitioner's record is in active use. + */ + @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether this practitioner's record is in active use", formalDefinition="Whether this practitioner's record is in active use." ) + protected BooleanType active; + + /** + * The name(s) associated with the practitioner. + */ + @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The name(s) associated with the practitioner", formalDefinition="The name(s) associated with the practitioner." ) + protected List name; + + /** + * A contact detail for the practitioner, e.g. a telephone number or an email address. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A contact detail for the practitioner (that apply to all roles)", formalDefinition="A contact detail for the practitioner, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * Address(es) of the practitioner that are not role specific (typically home address). +Work addresses are not typically entered in this property as they are usually role dependent. + */ + @Child(name = "address", type = {Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Address(es) of the practitioner that are not role specific (typically home address)", formalDefinition="Address(es) of the practitioner that are not role specific (typically home address). \nWork addresses are not typically entered in this property as they are usually role dependent." ) + protected List
address; + + /** + * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The date of birth for the practitioner. + */ + @Child(name = "birthDate", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The date on which the practitioner was born", formalDefinition="The date of birth for the practitioner." ) + protected DateType birthDate; + + /** + * Image of the person. + */ + @Child(name = "photo", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) + protected List photo; + + /** + * The list of roles/organizations that the practitioner is associated with. + */ + @Child(name = "practitionerRole", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Roles/organizations the practitioner is associated with", formalDefinition="The list of roles/organizations that the practitioner is associated with." ) + protected List practitionerRole; + + /** + * Qualifications obtained by training and certification. + */ + @Child(name = "qualification", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Qualifications obtained by training and certification", formalDefinition="Qualifications obtained by training and certification." ) + protected List qualification; + + /** + * A language the practitioner is able to use in patient communication. + */ + @Child(name = "communication", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A language the practitioner is able to use in patient communication", formalDefinition="A language the practitioner is able to use in patient communication." ) + protected List communication; + + private static final long serialVersionUID = 2137859974L; + + /** + * Constructor + */ + public Practitioner() { + super(); + } + + /** + * @return {@link #identifier} (An identifier that applies to this person in this role.) + */ + 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} (An identifier that applies to this person in this role.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Practitioner addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #active} (Whether this practitioner'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 Practitioner.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); // bb + 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 practitioner'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 Practitioner setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether this practitioner's record is in active use. + */ + public boolean getActive() { + return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Whether this practitioner's record is in active use. + */ + public Practitioner setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + /** + * @return {@link #name} (The name(s) associated with the practitioner.) + */ + 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} (The name(s) associated with the practitioner.) + */ + // syntactic sugar + public HumanName addName() { //3 + HumanName t = new HumanName(); + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return t; + } + + // syntactic sugar + public Practitioner addName(HumanName t) { //3 + if (t == null) + return this; + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the practitioner, 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 practitioner, 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; + } + + // syntactic sugar + public Practitioner addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #address} (Address(es) of the practitioner that are not role specific (typically home address). +Work addresses are not typically entered in this property as they are usually role dependent.) + */ + 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} (Address(es) of the practitioner that are not role specific (typically home address). +Work addresses are not typically entered in this property as they are usually role dependent.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + // syntactic sugar + public Practitioner addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). 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 Practitioner.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + 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 - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Practitioner setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public Practitioner setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateType(); // bb + 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 date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Practitioner setBirthDateElement(DateType value) { + this.birthDate = value; + return this; + } + + /** + * @return The date of birth for the practitioner. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The date of birth for the practitioner. + */ + public Practitioner setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + // syntactic sugar + public Practitioner addPhoto(Attachment t) { //3 + if (t == null) + return this; + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return this; + } + + /** + * @return {@link #practitionerRole} (The list of roles/organizations that the practitioner is associated with.) + */ + public List getPractitionerRole() { + if (this.practitionerRole == null) + this.practitionerRole = new ArrayList(); + return this.practitionerRole; + } + + public boolean hasPractitionerRole() { + if (this.practitionerRole == null) + return false; + for (PractitionerPractitionerRoleComponent item : this.practitionerRole) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #practitionerRole} (The list of roles/organizations that the practitioner is associated with.) + */ + // syntactic sugar + public PractitionerPractitionerRoleComponent addPractitionerRole() { //3 + PractitionerPractitionerRoleComponent t = new PractitionerPractitionerRoleComponent(); + if (this.practitionerRole == null) + this.practitionerRole = new ArrayList(); + this.practitionerRole.add(t); + return t; + } + + // syntactic sugar + public Practitioner addPractitionerRole(PractitionerPractitionerRoleComponent t) { //3 + if (t == null) + return this; + if (this.practitionerRole == null) + this.practitionerRole = new ArrayList(); + this.practitionerRole.add(t); + return this; + } + + /** + * @return {@link #qualification} (Qualifications obtained by training and certification.) + */ + public List getQualification() { + if (this.qualification == null) + this.qualification = new ArrayList(); + return this.qualification; + } + + public boolean hasQualification() { + if (this.qualification == null) + return false; + for (PractitionerQualificationComponent item : this.qualification) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #qualification} (Qualifications obtained by training and certification.) + */ + // syntactic sugar + public PractitionerQualificationComponent addQualification() { //3 + PractitionerQualificationComponent t = new PractitionerQualificationComponent(); + if (this.qualification == null) + this.qualification = new ArrayList(); + this.qualification.add(t); + return t; + } + + // syntactic sugar + public Practitioner addQualification(PractitionerQualificationComponent t) { //3 + if (t == null) + return this; + if (this.qualification == null) + this.qualification = new ArrayList(); + this.qualification.add(t); + return this; + } + + /** + * @return {@link #communication} (A language the practitioner is able to use in patient communication.) + */ + public List getCommunication() { + if (this.communication == null) + this.communication = new ArrayList(); + return this.communication; + } + + public boolean hasCommunication() { + if (this.communication == null) + return false; + for (CodeableConcept item : this.communication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #communication} (A language the practitioner is able to use in patient communication.) + */ + // syntactic sugar + public CodeableConcept addCommunication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return t; + } + + // syntactic sugar + public Practitioner addCommunication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("active", "boolean", "Whether this practitioner's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + childrenList.add(new Property("name", "HumanName", "The name(s) associated with the practitioner.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the practitioner, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Address(es) of the practitioner that are not role specific (typically home address). \nWork addresses are not typically entered in this property as they are usually role dependent.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "date", "The date of birth for the practitioner.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("practitionerRole", "", "The list of roles/organizations that the practitioner is associated with.", 0, java.lang.Integer.MAX_VALUE, practitionerRole)); + childrenList.add(new Property("qualification", "", "Qualifications obtained by training and certification.", 0, java.lang.Integer.MAX_VALUE, qualification)); + childrenList.add(new Property("communication", "CodeableConcept", "A language the practitioner is able to use in patient communication.", 0, java.lang.Integer.MAX_VALUE, communication)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType + case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address + case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration + case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType + case 106642994: /*photo*/ return this.photo == null ? new Base[0] : this.photo.toArray(new Base[this.photo.size()]); // Attachment + case 221717168: /*practitionerRole*/ return this.practitionerRole == null ? new Base[0] : this.practitionerRole.toArray(new Base[this.practitionerRole.size()]); // PractitionerPractitionerRoleComponent + case -631333393: /*qualification*/ return this.qualification == null ? new Base[0] : this.qualification.toArray(new Base[this.qualification.size()]); // PractitionerQualificationComponent + case -1035284522: /*communication*/ return this.communication == null ? new Base[0] : this.communication.toArray(new Base[this.communication.size()]); // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1422950650: // active + this.active = castToBoolean(value); // BooleanType + break; + case 3373707: // name + this.getName().add(castToHumanName(value)); // HumanName + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1147692044: // address + this.getAddress().add(castToAddress(value)); // Address + break; + case -1249512767: // gender + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + break; + case -1210031859: // birthDate + this.birthDate = castToDate(value); // DateType + break; + case 106642994: // photo + this.getPhoto().add(castToAttachment(value)); // Attachment + break; + case 221717168: // practitionerRole + this.getPractitionerRole().add((PractitionerPractitionerRoleComponent) value); // PractitionerPractitionerRoleComponent + break; + case -631333393: // qualification + this.getQualification().add((PractitionerQualificationComponent) value); // PractitionerQualificationComponent + break; + case -1035284522: // communication + this.getCommunication().add(castToCodeableConcept(value)); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("active")) + this.active = castToBoolean(value); // BooleanType + else if (name.equals("name")) + this.getName().add(castToHumanName(value)); + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("address")) + this.getAddress().add(castToAddress(value)); + else if (name.equals("gender")) + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + else if (name.equals("birthDate")) + this.birthDate = castToDate(value); // DateType + else if (name.equals("photo")) + this.getPhoto().add(castToAttachment(value)); + else if (name.equals("practitionerRole")) + this.getPractitionerRole().add((PractitionerPractitionerRoleComponent) value); + else if (name.equals("qualification")) + this.getQualification().add((PractitionerQualificationComponent) value); + else if (name.equals("communication")) + this.getCommunication().add(castToCodeableConcept(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType + case 3373707: return addName(); // HumanName + case -1429363305: return addTelecom(); // ContactPoint + case -1147692044: return addAddress(); // Address + case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration + case -1210031859: throw new FHIRException("Cannot make property birthDate as it is not a complex type"); // DateType + case 106642994: return addPhoto(); // Attachment + case 221717168: return addPractitionerRole(); // PractitionerPractitionerRoleComponent + case -631333393: return addQualification(); // PractitionerQualificationComponent + case -1035284522: return addCommunication(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("active")) { + throw new FHIRException("Cannot call addChild on a primitive type Practitioner.active"); + } + else if (name.equals("name")) { + return addName(); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("address")) { + return addAddress(); + } + else if (name.equals("gender")) { + throw new FHIRException("Cannot call addChild on a primitive type Practitioner.gender"); + } + else if (name.equals("birthDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Practitioner.birthDate"); + } + else if (name.equals("photo")) { + return addPhoto(); + } + else if (name.equals("practitionerRole")) { + return addPractitionerRole(); + } + else if (name.equals("qualification")) { + return addQualification(); + } + else if (name.equals("communication")) { + return addCommunication(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Practitioner"; + + } + + public Practitioner copy() { + Practitioner dst = new Practitioner(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.active = active == null ? null : active.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()); + }; + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.birthDate = birthDate == null ? null : birthDate.copy(); + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + if (practitionerRole != null) { + dst.practitionerRole = new ArrayList(); + for (PractitionerPractitionerRoleComponent i : practitionerRole) + dst.practitionerRole.add(i.copy()); + }; + if (qualification != null) { + dst.qualification = new ArrayList(); + for (PractitionerQualificationComponent i : qualification) + dst.qualification.add(i.copy()); + }; + if (communication != null) { + dst.communication = new ArrayList(); + for (CodeableConcept i : communication) + dst.communication.add(i.copy()); + }; + return dst; + } + + protected Practitioner typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Practitioner)) + return false; + Practitioner o = (Practitioner) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(name, o.name, true) + && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) + && compareDeep(birthDate, o.birthDate, true) && compareDeep(photo, o.photo, true) && compareDeep(practitionerRole, o.practitionerRole, true) + && compareDeep(qualification, o.qualification, true) && compareDeep(communication, o.communication, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Practitioner)) + return false; + Practitioner o = (Practitioner) other; + return compareValues(active, o.active, true) && compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) + && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) + && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) && (photo == null || photo.isEmpty()) + && (practitionerRole == null || practitionerRole.isEmpty()) && (qualification == null || qualification.isEmpty()) + && (communication == null || communication.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Practitioner; + } + + /** + * Search parameter: phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: Practitioner.telecom(system=phone), Practitioner.practitionerRole.telecom(system=phone)
+ *

+ */ + @SearchParamDefinition(name="phone", path="Practitioner.telecom.where(system='phone') or Practitioner.practitionerRole.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) + public static final String SP_PHONE = "phone"; + /** + * Fluent Client search parameter constant for phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: Practitioner.telecom(system=phone), Practitioner.practitionerRole.telecom(system=phone)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); + + /** + * Search parameter: phonetic + *

+ * Description: A portion of either family or given name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Practitioner.name
+ *

+ */ + @SearchParamDefinition(name="phonetic", path="Practitioner.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + /** + * Fluent Client search parameter constant for phonetic + *

+ * Description: A portion of either family or given name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Practitioner.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); + + /** + * Search parameter: location + *

+ * Description: One of the locations at which this practitioner provides care
+ * Type: reference
+ * Path: Practitioner.practitionerRole.location
+ *

+ */ + @SearchParamDefinition(name="location", path="Practitioner.practitionerRole.location", description="One of the locations at which this practitioner provides care", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: One of the locations at which this practitioner provides care
+ * Type: reference
+ * Path: Practitioner.practitionerRole.location
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Practitioner:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Practitioner:location").toLocked(); + + /** + * Search parameter: communication + *

+ * Description: One of the languages that the practitioner can communicate with
+ * Type: token
+ * Path: Practitioner.communication
+ *

+ */ + @SearchParamDefinition(name="communication", path="Practitioner.communication", description="One of the languages that the practitioner can communicate with", type="token" ) + public static final String SP_COMMUNICATION = "communication"; + /** + * Fluent Client search parameter constant for communication + *

+ * Description: One of the languages that the practitioner can communicate with
+ * Type: token
+ * Path: Practitioner.communication
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMMUNICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMMUNICATION); + + /** + * Search parameter: address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Practitioner.address.country
+ *

+ */ + @SearchParamDefinition(name="address-country", path="Practitioner.address.country", description="A country specified in an address", type="string" ) + public static final String SP_ADDRESS_COUNTRY = "address-country"; + /** + * Fluent Client search parameter constant for address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: Practitioner.address.country
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + + /** + * Search parameter: organization + *

+ * Description: The identity of the organization the practitioner represents / acts on behalf of
+ * Type: reference
+ * Path: Practitioner.practitionerRole.organization
+ *

+ */ + @SearchParamDefinition(name="organization", path="Practitioner.practitionerRole.organization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: The identity of the organization the practitioner represents / acts on behalf of
+ * Type: reference
+ * Path: Practitioner.practitionerRole.organization
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Practitioner:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Practitioner:organization").toLocked(); + + /** + * Search parameter: address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Practitioner.address.city
+ *

+ */ + @SearchParamDefinition(name="address-city", path="Practitioner.address.city", description="A city specified in an address", type="string" ) + public static final String SP_ADDRESS_CITY = "address-city"; + /** + * Fluent Client search parameter constant for address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Practitioner.address.city
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); + + /** + * Search parameter: address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Practitioner.address.state
+ *

+ */ + @SearchParamDefinition(name="address-state", path="Practitioner.address.state", description="A state specified in an address", type="string" ) + public static final String SP_ADDRESS_STATE = "address-state"; + /** + * Fluent Client search parameter constant for address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: Practitioner.address.state
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); + + /** + * Search parameter: given + *

+ * Description: A portion of the given name
+ * Type: string
+ * Path: Practitioner.name.given
+ *

+ */ + @SearchParamDefinition(name="given", path="Practitioner.name.given", description="A portion of the given name", type="string" ) + public static final String SP_GIVEN = "given"; + /** + * Fluent Client search parameter constant for given + *

+ * Description: A portion of the given name
+ * Type: string
+ * Path: Practitioner.name.given
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam GIVEN = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_GIVEN); + + /** + * Search parameter: email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: Practitioner.telecom(system=email), Practitioner.practitionerRole.telecom(system=email)
+ *

+ */ + @SearchParamDefinition(name="email", path="Practitioner.telecom.where(system='email') or Practitioner.practitionerRole.telecom.where(system='email')", description="A value in an email contact", type="token" ) + public static final String SP_EMAIL = "email"; + /** + * Fluent Client search parameter constant for email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: Practitioner.telecom(system=email), Practitioner.practitionerRole.telecom(system=email)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); + + /** + * Search parameter: address + *

+ * Description: An address in any kind of address/part
+ * Type: string
+ * Path: Practitioner.address
+ *

+ */ + @SearchParamDefinition(name="address", path="Practitioner.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + /** + * Fluent Client search parameter constant for address + *

+ * Description: An address in any kind of address/part
+ * Type: string
+ * Path: Practitioner.address
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); + + /** + * Search parameter: address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Practitioner.address.use
+ *

+ */ + @SearchParamDefinition(name="address-use", path="Practitioner.address.use", description="A use code specified in an address", type="token" ) + public static final String SP_ADDRESS_USE = "address-use"; + /** + * Fluent Client search parameter constant for address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Practitioner.address.use
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); + + /** + * Search parameter: family + *

+ * Description: A portion of the family name
+ * Type: string
+ * Path: Practitioner.name.family
+ *

+ */ + @SearchParamDefinition(name="family", path="Practitioner.name.family", description="A portion of the family name", type="string" ) + public static final String SP_FAMILY = "family"; + /** + * Fluent Client search parameter constant for family + *

+ * Description: A portion of the family name
+ * Type: string
+ * Path: Practitioner.name.family
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam FAMILY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_FAMILY); + + /** + * Search parameter: name + *

+ * Description: A portion of either family or given name
+ * Type: string
+ * Path: Practitioner.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Practitioner.name", description="A portion of either family or given name", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: A portion of either family or given name
+ * Type: string
+ * Path: Practitioner.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: telecom + *

+ * Description: The value in any kind of contact
+ * Type: token
+ * Path: Practitioner.telecom, Practitioner.practitionerRole.telecom
+ *

+ */ + @SearchParamDefinition(name="telecom", path="Practitioner.telecom | Practitioner.practitionerRole.telecom", description="The value in any kind of contact", type="token" ) + public static final String SP_TELECOM = "telecom"; + /** + * Fluent Client search parameter constant for telecom + *

+ * Description: The value in any kind of contact
+ * Type: token
+ * Path: Practitioner.telecom, Practitioner.practitionerRole.telecom
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); + + /** + * Search parameter: role + *

+ * Description: The practitioner can perform this role at for the organization
+ * Type: token
+ * Path: Practitioner.practitionerRole.role
+ *

+ */ + @SearchParamDefinition(name="role", path="Practitioner.practitionerRole.role", description="The practitioner can perform this role at for the organization", type="token" ) + public static final String SP_ROLE = "role"; + /** + * Fluent Client search parameter constant for role + *

+ * Description: The practitioner can perform this role at for the organization
+ * Type: token
+ * Path: Practitioner.practitionerRole.role
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROLE); + + /** + * Search parameter: gender + *

+ * Description: Gender of the practitioner
+ * Type: token
+ * Path: Practitioner.gender
+ *

+ */ + @SearchParamDefinition(name="gender", path="Practitioner.gender", description="Gender of the practitioner", type="token" ) + public static final String SP_GENDER = "gender"; + /** + * Fluent Client search parameter constant for gender + *

+ * Description: Gender of the practitioner
+ * Type: token
+ * Path: Practitioner.gender
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); + + /** + * Search parameter: specialty + *

+ * Description: The practitioner has this specialty at an organization
+ * Type: token
+ * Path: Practitioner.practitionerRole.specialty
+ *

+ */ + @SearchParamDefinition(name="specialty", path="Practitioner.practitionerRole.specialty", description="The practitioner has this specialty at an organization", type="token" ) + public static final String SP_SPECIALTY = "specialty"; + /** + * Fluent Client search parameter constant for specialty + *

+ * Description: The practitioner has this specialty at an organization
+ * Type: token
+ * Path: Practitioner.practitionerRole.specialty
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY); + + /** + * Search parameter: identifier + *

+ * Description: A practitioner's Identifier
+ * Type: token
+ * Path: Practitioner.identifier, Practitioner.practitionerRole.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Practitioner.identifier | Practitioner.practitionerRole.identifier", description="A practitioner's Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A practitioner's Identifier
+ * Type: token
+ * Path: Practitioner.identifier, Practitioner.practitionerRole.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: address-postalcode + *

+ * Description: A postalCode specified in an address
+ * Type: string
+ * Path: Practitioner.address.postalCode
+ *

+ */ + @SearchParamDefinition(name="address-postalcode", path="Practitioner.address.postalCode", description="A postalCode specified in an address", type="string" ) + public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; + /** + * Fluent Client search parameter constant for address-postalcode + *

+ * Description: A postalCode specified in an address
+ * Type: string
+ * Path: Practitioner.address.postalCode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PractitionerRole.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PractitionerRole.java new file mode 100644 index 00000000000..aba86f8e7fc --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PractitionerRole.java @@ -0,0 +1,1800 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. + */ +@ResourceDef(name="PractitionerRole", profile="http://hl7.org/fhir/Profile/PractitionerRole") +public class PractitionerRole extends DomainResource { + + @Block() + public static class PractitionerRoleAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Indicates which days of the week are available between the start and end Times. + */ + @Child(name = "daysOfWeek", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="mon | tue | wed | thu | fri | sat | sun", formalDefinition="Indicates which days of the week are available between the start and end Times." ) + protected List daysOfWeek; + + /** + * Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + @Child(name = "allDay", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Always available? e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." ) + protected BooleanType allDay; + + /** + * The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + @Child(name = "availableStartTime", type = {TimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Opening time of day (ignored if allDay = true)", formalDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored." ) + protected TimeType availableStartTime; + + /** + * The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + @Child(name = "availableEndTime", type = {TimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Closing time of day (ignored if allDay = true)", formalDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored." ) + protected TimeType availableEndTime; + + private static final long serialVersionUID = 2079379177L; + + /** + * Constructor + */ + public PractitionerRoleAvailableTimeComponent() { + super(); + } + + /** + * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) + */ + public List getDaysOfWeek() { + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList(); + return this.daysOfWeek; + } + + public boolean hasDaysOfWeek() { + if (this.daysOfWeek == null) + return false; + for (CodeType item : this.daysOfWeek) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) + */ + // syntactic sugar + public CodeType addDaysOfWeekElement() {//2 + CodeType t = new CodeType(); + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList(); + this.daysOfWeek.add(t); + return t; + } + + /** + * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) + */ + public PractitionerRoleAvailableTimeComponent addDaysOfWeek(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList(); + this.daysOfWeek.add(t); + return this; + } + + /** + * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) + */ + public boolean hasDaysOfWeek(String value) { + if (this.daysOfWeek == null) + return false; + for (CodeType v : this.daysOfWeek) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value + */ + public BooleanType getAllDayElement() { + if (this.allDay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.allDay"); + else if (Configuration.doAutoCreate()) + this.allDay = new BooleanType(); // bb + return this.allDay; + } + + public boolean hasAllDayElement() { + return this.allDay != null && !this.allDay.isEmpty(); + } + + public boolean hasAllDay() { + return this.allDay != null && !this.allDay.isEmpty(); + } + + /** + * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value + */ + public PractitionerRoleAvailableTimeComponent setAllDayElement(BooleanType value) { + this.allDay = value; + return this; + } + + /** + * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + public boolean getAllDay() { + return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue(); + } + + /** + * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + public PractitionerRoleAvailableTimeComponent setAllDay(boolean value) { + if (this.allDay == null) + this.allDay = new BooleanType(); + this.allDay.setValue(value); + return this; + } + + /** + * @return {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value + */ + public TimeType getAvailableStartTimeElement() { + if (this.availableStartTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.availableStartTime"); + else if (Configuration.doAutoCreate()) + this.availableStartTime = new TimeType(); // bb + return this.availableStartTime; + } + + public boolean hasAvailableStartTimeElement() { + return this.availableStartTime != null && !this.availableStartTime.isEmpty(); + } + + public boolean hasAvailableStartTime() { + return this.availableStartTime != null && !this.availableStartTime.isEmpty(); + } + + /** + * @param value {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value + */ + public PractitionerRoleAvailableTimeComponent setAvailableStartTimeElement(TimeType value) { + this.availableStartTime = value; + return this; + } + + /** + * @return The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public String getAvailableStartTime() { + return this.availableStartTime == null ? null : this.availableStartTime.getValue(); + } + + /** + * @param value The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public PractitionerRoleAvailableTimeComponent setAvailableStartTime(String value) { + if (value == null) + this.availableStartTime = null; + else { + if (this.availableStartTime == null) + this.availableStartTime = new TimeType(); + this.availableStartTime.setValue(value); + } + return this; + } + + /** + * @return {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value + */ + public TimeType getAvailableEndTimeElement() { + if (this.availableEndTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.availableEndTime"); + else if (Configuration.doAutoCreate()) + this.availableEndTime = new TimeType(); // bb + return this.availableEndTime; + } + + public boolean hasAvailableEndTimeElement() { + return this.availableEndTime != null && !this.availableEndTime.isEmpty(); + } + + public boolean hasAvailableEndTime() { + return this.availableEndTime != null && !this.availableEndTime.isEmpty(); + } + + /** + * @param value {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value + */ + public PractitionerRoleAvailableTimeComponent setAvailableEndTimeElement(TimeType value) { + this.availableEndTime = value; + return this; + } + + /** + * @return The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public String getAvailableEndTime() { + return this.availableEndTime == null ? null : this.availableEndTime.getValue(); + } + + /** + * @param value The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + */ + public PractitionerRoleAvailableTimeComponent setAvailableEndTime(String value) { + if (value == null) + this.availableEndTime = null; + else { + if (this.availableEndTime == null) + this.availableEndTime = new TimeType(); + this.availableEndTime.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("daysOfWeek", "code", "Indicates which days of the week are available between the start and end Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek)); + childrenList.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, java.lang.Integer.MAX_VALUE, allDay)); + childrenList.add(new Property("availableStartTime", "time", "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableStartTime)); + childrenList.add(new Property("availableEndTime", "time", "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableEndTime)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 68050338: /*daysOfWeek*/ return this.daysOfWeek == null ? new Base[0] : this.daysOfWeek.toArray(new Base[this.daysOfWeek.size()]); // CodeType + case -1414913477: /*allDay*/ return this.allDay == null ? new Base[0] : new Base[] {this.allDay}; // BooleanType + case -1039453818: /*availableStartTime*/ return this.availableStartTime == null ? new Base[0] : new Base[] {this.availableStartTime}; // TimeType + case 101151551: /*availableEndTime*/ return this.availableEndTime == null ? new Base[0] : new Base[] {this.availableEndTime}; // TimeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 68050338: // daysOfWeek + this.getDaysOfWeek().add(castToCode(value)); // CodeType + break; + case -1414913477: // allDay + this.allDay = castToBoolean(value); // BooleanType + break; + case -1039453818: // availableStartTime + this.availableStartTime = castToTime(value); // TimeType + break; + case 101151551: // availableEndTime + this.availableEndTime = castToTime(value); // TimeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("daysOfWeek")) + this.getDaysOfWeek().add(castToCode(value)); + else if (name.equals("allDay")) + this.allDay = castToBoolean(value); // BooleanType + else if (name.equals("availableStartTime")) + this.availableStartTime = castToTime(value); // TimeType + else if (name.equals("availableEndTime")) + this.availableEndTime = castToTime(value); // TimeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 68050338: throw new FHIRException("Cannot make property daysOfWeek as it is not a complex type"); // CodeType + case -1414913477: throw new FHIRException("Cannot make property allDay as it is not a complex type"); // BooleanType + case -1039453818: throw new FHIRException("Cannot make property availableStartTime as it is not a complex type"); // TimeType + case 101151551: throw new FHIRException("Cannot make property availableEndTime as it is not a complex type"); // TimeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("daysOfWeek")) { + throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.daysOfWeek"); + } + else if (name.equals("allDay")) { + throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.allDay"); + } + else if (name.equals("availableStartTime")) { + throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availableStartTime"); + } + else if (name.equals("availableEndTime")) { + throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availableEndTime"); + } + else + return super.addChild(name); + } + + public PractitionerRoleAvailableTimeComponent copy() { + PractitionerRoleAvailableTimeComponent dst = new PractitionerRoleAvailableTimeComponent(); + copyValues(dst); + if (daysOfWeek != null) { + dst.daysOfWeek = new ArrayList(); + for (CodeType i : daysOfWeek) + dst.daysOfWeek.add(i.copy()); + }; + dst.allDay = allDay == null ? null : allDay.copy(); + dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy(); + dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PractitionerRoleAvailableTimeComponent)) + return false; + PractitionerRoleAvailableTimeComponent o = (PractitionerRoleAvailableTimeComponent) other; + return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true) && compareDeep(availableStartTime, o.availableStartTime, true) + && compareDeep(availableEndTime, o.availableEndTime, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PractitionerRoleAvailableTimeComponent)) + return false; + PractitionerRoleAvailableTimeComponent o = (PractitionerRoleAvailableTimeComponent) other; + return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true) && compareValues(availableStartTime, o.availableStartTime, true) + && compareValues(availableEndTime, o.availableEndTime, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty()) + && (availableStartTime == null || availableStartTime.isEmpty()) && (availableEndTime == null || availableEndTime.isEmpty()) + ; + } + + public String fhirType() { + return "PractitionerRole.availableTime"; + + } + + } + + @Block() + public static class PractitionerRoleNotAvailableComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The reason that can be presented to the user as to why this time is not available. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reason presented to the user explaining why time not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." ) + protected StringType description; + + /** + * Service is not available (seasonally or for a public holiday) from this date. + */ + @Child(name = "during", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Service not availablefrom this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." ) + protected Period during; + + private static final long serialVersionUID = 310849929L; + + /** + * Constructor + */ + public PractitionerRoleNotAvailableComponent() { + super(); + } + + /** + * Constructor + */ + public PractitionerRoleNotAvailableComponent(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). 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 PractitionerRoleNotAvailableComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public PractitionerRoleNotAvailableComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The reason that can be presented to the user as to why this time is not available. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The reason that can be presented to the user as to why this time is not available. + */ + public PractitionerRoleNotAvailableComponent setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) + */ + public Period getDuring() { + if (this.during == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRoleNotAvailableComponent.during"); + else if (Configuration.doAutoCreate()) + this.during = new Period(); // cc + return this.during; + } + + public boolean hasDuring() { + return this.during != null && !this.during.isEmpty(); + } + + /** + * @param value {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) + */ + public PractitionerRoleNotAvailableComponent setDuring(Period value) { + this.during = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("during", "Period", "Service is not available (seasonally or for a public holiday) from this date.", 0, java.lang.Integer.MAX_VALUE, during)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1320499647: /*during*/ return this.during == null ? new Base[0] : new Base[] {this.during}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1320499647: // during + this.during = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("during")) + this.during = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1320499647: return getDuring(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.description"); + } + else if (name.equals("during")) { + this.during = new Period(); + return this.during; + } + else + return super.addChild(name); + } + + public PractitionerRoleNotAvailableComponent copy() { + PractitionerRoleNotAvailableComponent dst = new PractitionerRoleNotAvailableComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.during = during == null ? null : during.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PractitionerRoleNotAvailableComponent)) + return false; + PractitionerRoleNotAvailableComponent o = (PractitionerRoleNotAvailableComponent) other; + return compareDeep(description, o.description, true) && compareDeep(during, o.during, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PractitionerRoleNotAvailableComponent)) + return false; + PractitionerRoleNotAvailableComponent o = (PractitionerRoleNotAvailableComponent) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (during == null || during.isEmpty()) + ; + } + + public String fhirType() { + return "PractitionerRole.notAvailable"; + + } + + } + + /** + * Business Identifiers that are specific to a role/location. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifiers that are specific to a role/location", formalDefinition="Business Identifiers that are specific to a role/location." ) + protected List identifier; + + /** + * Whether this practitioner's record is in active use. + */ + @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether this practitioner's record is in active use", formalDefinition="Whether this practitioner's record is in active use." ) + protected BooleanType active; + + /** + * Practitioner that is able to provide the defined services for the organation. + */ + @Child(name = "practitioner", type = {Practitioner.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Practitioner that is able to provide the defined services for the organation", formalDefinition="Practitioner that is able to provide the defined services for the organation." ) + protected Reference practitioner; + + /** + * The actual object that is the target of the reference (Practitioner that is able to provide the defined services for the organation.) + */ + protected Practitioner practitionerTarget; + + /** + * The organization where the Practitioner performs the roles associated. + */ + @Child(name = "organization", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization where the roles are available", formalDefinition="The organization where the Practitioner performs the roles associated." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization where the Practitioner performs the roles associated.) + */ + protected Organization organizationTarget; + + /** + * Roles which this practitioner is authorized to perform for the organization. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." ) + protected List role; + + /** + * Specific specialty of the practitioner. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." ) + protected List specialty; + + /** + * The location(s) at which this practitioner provides care. + */ + @Child(name = "location", type = {Location.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." ) + protected List location; + /** + * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.) + */ + protected List locationTarget; + + + /** + * The list of healthcare services that this worker provides for this role's Organization/Location(s). + */ + @Child(name = "healthcareService", type = {HealthcareService.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)", formalDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)." ) + protected List healthcareService; + /** + * The actual objects that are the target of the reference (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + protected List healthcareServiceTarget; + + + /** + * Contact details that are specific to the role/location/service. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details that are specific to the role/location/service", formalDefinition="Contact details that are specific to the role/location/service." ) + protected List telecom; + + /** + * The period during which the person is authorized to act as a practitioner in these role(s) for the organization. + */ + @Child(name = "period", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The period during which the practitioner is authorized to perform in these role(s)", formalDefinition="The period during which the person is authorized to act as a practitioner in these role(s) for the organization." ) + protected Period period; + + /** + * A collection of times that the Service Site is available. + */ + @Child(name = "availableTime", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Times the Service Site is available", formalDefinition="A collection of times that the Service Site is available." ) + protected List availableTime; + + /** + * The HealthcareService is not available during this period of time due to the provided reason. + */ + @Child(name = "notAvailable", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Not available during this time due to provided reason", formalDefinition="The HealthcareService is not available during this period of time due to the provided reason." ) + protected List notAvailable; + + /** + * A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. + */ + @Child(name = "availabilityExceptions", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Description of availability exceptions", formalDefinition="A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times." ) + protected StringType availabilityExceptions; + + private static final long serialVersionUID = -408504135L; + + /** + * Constructor + */ + public PractitionerRole() { + super(); + } + + /** + * @return {@link #identifier} (Business Identifiers that are specific to a role/location.) + */ + 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} (Business Identifiers that are specific to a role/location.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public PractitionerRole addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #active} (Whether this practitioner'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 PractitionerRole.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); // bb + 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 practitioner'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 PractitionerRole setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether this practitioner's record is in active use. + */ + public boolean getActive() { + return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); + } + + /** + * @param value Whether this practitioner's record is in active use. + */ + public PractitionerRole setActive(boolean value) { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + return this; + } + + /** + * @return {@link #practitioner} (Practitioner that is able to provide the defined services for the organation.) + */ + public Reference getPractitioner() { + if (this.practitioner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRole.practitioner"); + else if (Configuration.doAutoCreate()) + this.practitioner = new Reference(); // cc + return this.practitioner; + } + + public boolean hasPractitioner() { + return this.practitioner != null && !this.practitioner.isEmpty(); + } + + /** + * @param value {@link #practitioner} (Practitioner that is able to provide the defined services for the organation.) + */ + public PractitionerRole setPractitioner(Reference value) { + this.practitioner = value; + return this; + } + + /** + * @return {@link #practitioner} 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. (Practitioner that is able to provide the defined services for the organation.) + */ + public Practitioner getPractitionerTarget() { + if (this.practitionerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRole.practitioner"); + else if (Configuration.doAutoCreate()) + this.practitionerTarget = new Practitioner(); // aa + return this.practitionerTarget; + } + + /** + * @param value {@link #practitioner} 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. (Practitioner that is able to provide the defined services for the organation.) + */ + public PractitionerRole setPractitionerTarget(Practitioner value) { + this.practitionerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization where the Practitioner performs the roles associated.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRole.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization where the Practitioner performs the roles associated.) + */ + public PractitionerRole 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 where the Practitioner performs the roles associated.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRole.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + 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 where the Practitioner performs the roles associated.) + */ + public PractitionerRole setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + // syntactic sugar + public PractitionerRole addRole(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return this; + } + + /** + * @return {@link #specialty} (Specific specialty of the practitioner.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (Specific specialty of the practitioner.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + // syntactic sugar + public PractitionerRole addSpecialty(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return this; + } + + /** + * @return {@link #location} (The location(s) at which this practitioner provides care.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (Reference item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (The location(s) at which this practitioner provides care.) + */ + // syntactic sugar + public Reference addLocation() { //3 + Reference t = new Reference(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + // syntactic sugar + public PractitionerRole addLocation(Reference t) { //3 + if (t == null) + return this; + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @return {@link #location} (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 location(s) at which this practitioner provides care.) + */ + public List getLocationTarget() { + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + return this.locationTarget; + } + + // syntactic sugar + /** + * @return {@link #location} (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 location(s) at which this practitioner provides care.) + */ + public Location addLocationTarget() { + Location r = new Location(); + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + this.locationTarget.add(r); + return r; + } + + /** + * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public List getHealthcareService() { + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + return this.healthcareService; + } + + public boolean hasHealthcareService() { + if (this.healthcareService == null) + return false; + for (Reference item : this.healthcareService) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + // syntactic sugar + public Reference addHealthcareService() { //3 + Reference t = new Reference(); + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + this.healthcareService.add(t); + return t; + } + + // syntactic sugar + public PractitionerRole addHealthcareService(Reference t) { //3 + if (t == null) + return this; + if (this.healthcareService == null) + this.healthcareService = new ArrayList(); + this.healthcareService.add(t); + return this; + } + + /** + * @return {@link #healthcareService} (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 list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public List getHealthcareServiceTarget() { + if (this.healthcareServiceTarget == null) + this.healthcareServiceTarget = new ArrayList(); + return this.healthcareServiceTarget; + } + + // syntactic sugar + /** + * @return {@link #healthcareService} (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 list of healthcare services that this worker provides for this role's Organization/Location(s).) + */ + public HealthcareService addHealthcareServiceTarget() { + HealthcareService r = new HealthcareService(); + if (this.healthcareServiceTarget == null) + this.healthcareServiceTarget = new ArrayList(); + this.healthcareServiceTarget.add(r); + return r; + } + + /** + * @return {@link #telecom} (Contact details that are specific to the role/location/service.) + */ + 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} (Contact details that are specific to the role/location/service.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public PractitionerRole addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRole.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) + */ + public PractitionerRole setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #availableTime} (A collection of times that the Service Site is available.) + */ + public List getAvailableTime() { + if (this.availableTime == null) + this.availableTime = new ArrayList(); + return this.availableTime; + } + + public boolean hasAvailableTime() { + if (this.availableTime == null) + return false; + for (PractitionerRoleAvailableTimeComponent item : this.availableTime) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #availableTime} (A collection of times that the Service Site is available.) + */ + // syntactic sugar + public PractitionerRoleAvailableTimeComponent addAvailableTime() { //3 + PractitionerRoleAvailableTimeComponent t = new PractitionerRoleAvailableTimeComponent(); + if (this.availableTime == null) + this.availableTime = new ArrayList(); + this.availableTime.add(t); + return t; + } + + // syntactic sugar + public PractitionerRole addAvailableTime(PractitionerRoleAvailableTimeComponent t) { //3 + if (t == null) + return this; + if (this.availableTime == null) + this.availableTime = new ArrayList(); + this.availableTime.add(t); + return this; + } + + /** + * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) + */ + public List getNotAvailable() { + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + return this.notAvailable; + } + + public boolean hasNotAvailable() { + if (this.notAvailable == null) + return false; + for (PractitionerRoleNotAvailableComponent item : this.notAvailable) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) + */ + // syntactic sugar + public PractitionerRoleNotAvailableComponent addNotAvailable() { //3 + PractitionerRoleNotAvailableComponent t = new PractitionerRoleNotAvailableComponent(); + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + this.notAvailable.add(t); + return t; + } + + // syntactic sugar + public PractitionerRole addNotAvailable(PractitionerRoleNotAvailableComponent t) { //3 + if (t == null) + return this; + if (this.notAvailable == null) + this.notAvailable = new ArrayList(); + this.notAvailable.add(t); + return this; + } + + /** + * @return {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value + */ + public StringType getAvailabilityExceptionsElement() { + if (this.availabilityExceptions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerRole.availabilityExceptions"); + else if (Configuration.doAutoCreate()) + this.availabilityExceptions = new StringType(); // bb + return this.availabilityExceptions; + } + + public boolean hasAvailabilityExceptionsElement() { + return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); + } + + public boolean hasAvailabilityExceptions() { + return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); + } + + /** + * @param value {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value + */ + public PractitionerRole setAvailabilityExceptionsElement(StringType value) { + this.availabilityExceptions = value; + return this; + } + + /** + * @return A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. + */ + public String getAvailabilityExceptions() { + return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue(); + } + + /** + * @param value A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. + */ + public PractitionerRole setAvailabilityExceptions(String value) { + if (Utilities.noString(value)) + this.availabilityExceptions = null; + else { + if (this.availabilityExceptions == null) + this.availabilityExceptions = new StringType(); + this.availabilityExceptions.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Business Identifiers that are specific to a role/location.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("active", "boolean", "Whether this practitioner's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + childrenList.add(new Property("practitioner", "Reference(Practitioner)", "Practitioner that is able to provide the defined services for the organation.", 0, java.lang.Integer.MAX_VALUE, practitioner)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization where the Practitioner performs the roles associated.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("healthcareService", "Reference(HealthcareService)", "The list of healthcare services that this worker provides for this role's Organization/Location(s).", 0, java.lang.Integer.MAX_VALUE, healthcareService)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details that are specific to the role/location/service.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("availableTime", "", "A collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); + childrenList.add(new Property("notAvailable", "", "The HealthcareService is not available during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable)); + childrenList.add(new Property("availabilityExceptions", "string", "A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType + case 574573338: /*practitioner*/ return this.practitioner == null ? new Base[0] : new Base[] {this.practitioner}; // Reference + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept + case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept + case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference + case 1289661064: /*healthcareService*/ return this.healthcareService == null ? new Base[0] : this.healthcareService.toArray(new Base[this.healthcareService.size()]); // Reference + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 1873069366: /*availableTime*/ return this.availableTime == null ? new Base[0] : this.availableTime.toArray(new Base[this.availableTime.size()]); // PractitionerRoleAvailableTimeComponent + case -629572298: /*notAvailable*/ return this.notAvailable == null ? new Base[0] : this.notAvailable.toArray(new Base[this.notAvailable.size()]); // PractitionerRoleNotAvailableComponent + case -1149143617: /*availabilityExceptions*/ return this.availabilityExceptions == null ? new Base[0] : new Base[] {this.availabilityExceptions}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1422950650: // active + this.active = castToBoolean(value); // BooleanType + break; + case 574573338: // practitioner + this.practitioner = castToReference(value); // Reference + break; + case 1178922291: // organization + this.organization = castToReference(value); // Reference + break; + case 3506294: // role + this.getRole().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1694759682: // specialty + this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1901043637: // location + this.getLocation().add(castToReference(value)); // Reference + break; + case 1289661064: // healthcareService + this.getHealthcareService().add(castToReference(value)); // Reference + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case 1873069366: // availableTime + this.getAvailableTime().add((PractitionerRoleAvailableTimeComponent) value); // PractitionerRoleAvailableTimeComponent + break; + case -629572298: // notAvailable + this.getNotAvailable().add((PractitionerRoleNotAvailableComponent) value); // PractitionerRoleNotAvailableComponent + break; + case -1149143617: // availabilityExceptions + this.availabilityExceptions = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("active")) + this.active = castToBoolean(value); // BooleanType + else if (name.equals("practitioner")) + this.practitioner = castToReference(value); // Reference + else if (name.equals("organization")) + this.organization = castToReference(value); // Reference + else if (name.equals("role")) + this.getRole().add(castToCodeableConcept(value)); + else if (name.equals("specialty")) + this.getSpecialty().add(castToCodeableConcept(value)); + else if (name.equals("location")) + this.getLocation().add(castToReference(value)); + else if (name.equals("healthcareService")) + this.getHealthcareService().add(castToReference(value)); + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("availableTime")) + this.getAvailableTime().add((PractitionerRoleAvailableTimeComponent) value); + else if (name.equals("notAvailable")) + this.getNotAvailable().add((PractitionerRoleNotAvailableComponent) value); + else if (name.equals("availabilityExceptions")) + this.availabilityExceptions = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType + case 574573338: return getPractitioner(); // Reference + case 1178922291: return getOrganization(); // Reference + case 3506294: return addRole(); // CodeableConcept + case -1694759682: return addSpecialty(); // CodeableConcept + case 1901043637: return addLocation(); // Reference + case 1289661064: return addHealthcareService(); // Reference + case -1429363305: return addTelecom(); // ContactPoint + case -991726143: return getPeriod(); // Period + case 1873069366: return addAvailableTime(); // PractitionerRoleAvailableTimeComponent + case -629572298: return addNotAvailable(); // PractitionerRoleNotAvailableComponent + case -1149143617: throw new FHIRException("Cannot make property availabilityExceptions as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("active")) { + throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.active"); + } + else if (name.equals("practitioner")) { + this.practitioner = new Reference(); + return this.practitioner; + } + else if (name.equals("organization")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("role")) { + return addRole(); + } + else if (name.equals("specialty")) { + return addSpecialty(); + } + else if (name.equals("location")) { + return addLocation(); + } + else if (name.equals("healthcareService")) { + return addHealthcareService(); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("availableTime")) { + return addAvailableTime(); + } + else if (name.equals("notAvailable")) { + return addNotAvailable(); + } + else if (name.equals("availabilityExceptions")) { + throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availabilityExceptions"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "PractitionerRole"; + + } + + public PractitionerRole copy() { + PractitionerRole dst = new PractitionerRole(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.active = active == null ? null : active.copy(); + dst.practitioner = practitioner == null ? null : practitioner.copy(); + dst.organization = organization == null ? null : organization.copy(); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + if (location != null) { + dst.location = new ArrayList(); + for (Reference i : location) + dst.location.add(i.copy()); + }; + if (healthcareService != null) { + dst.healthcareService = new ArrayList(); + for (Reference i : healthcareService) + dst.healthcareService.add(i.copy()); + }; + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + if (availableTime != null) { + dst.availableTime = new ArrayList(); + for (PractitionerRoleAvailableTimeComponent i : availableTime) + dst.availableTime.add(i.copy()); + }; + if (notAvailable != null) { + dst.notAvailable = new ArrayList(); + for (PractitionerRoleNotAvailableComponent i : notAvailable) + dst.notAvailable.add(i.copy()); + }; + dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); + return dst; + } + + protected PractitionerRole typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof PractitionerRole)) + return false; + PractitionerRole o = (PractitionerRole) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(practitioner, o.practitioner, true) + && compareDeep(organization, o.organization, true) && compareDeep(role, o.role, true) && compareDeep(specialty, o.specialty, true) + && compareDeep(location, o.location, true) && compareDeep(healthcareService, o.healthcareService, true) + && compareDeep(telecom, o.telecom, true) && compareDeep(period, o.period, true) && compareDeep(availableTime, o.availableTime, true) + && compareDeep(notAvailable, o.notAvailable, true) && compareDeep(availabilityExceptions, o.availabilityExceptions, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof PractitionerRole)) + return false; + PractitionerRole o = (PractitionerRole) other; + return compareValues(active, o.active, true) && compareValues(availabilityExceptions, o.availabilityExceptions, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) + && (practitioner == null || practitioner.isEmpty()) && (organization == null || organization.isEmpty()) + && (role == null || role.isEmpty()) && (specialty == null || specialty.isEmpty()) && (location == null || location.isEmpty()) + && (healthcareService == null || healthcareService.isEmpty()) && (telecom == null || telecom.isEmpty()) + && (period == null || period.isEmpty()) && (availableTime == null || availableTime.isEmpty()) + && (notAvailable == null || notAvailable.isEmpty()) && (availabilityExceptions == null || availabilityExceptions.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PractitionerRole; + } + + /** + * Search parameter: organization + *

+ * Description: The identity of the organization the practitioner represents / acts on behalf of
+ * Type: reference
+ * Path: PractitionerRole.organization
+ *

+ */ + @SearchParamDefinition(name="organization", path="PractitionerRole.organization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: The identity of the organization the practitioner represents / acts on behalf of
+ * Type: reference
+ * Path: PractitionerRole.organization
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PractitionerRole:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("PractitionerRole:organization").toLocked(); + + /** + * Search parameter: phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: PractitionerRole.telecom(system=phone)
+ *

+ */ + @SearchParamDefinition(name="phone", path="PractitionerRole.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) + public static final String SP_PHONE = "phone"; + /** + * Fluent Client search parameter constant for phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: PractitionerRole.telecom(system=phone)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); + + /** + * Search parameter: practitioner + *

+ * Description: Practitioner that is able to provide the defined services for the organation
+ * Type: reference
+ * Path: PractitionerRole.practitioner
+ *

+ */ + @SearchParamDefinition(name="practitioner", path="PractitionerRole.practitioner", description="Practitioner that is able to provide the defined services for the organation", type="reference" ) + public static final String SP_PRACTITIONER = "practitioner"; + /** + * Fluent Client search parameter constant for practitioner + *

+ * Description: Practitioner that is able to provide the defined services for the organation
+ * Type: reference
+ * Path: PractitionerRole.practitioner
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PractitionerRole:practitioner". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("PractitionerRole:practitioner").toLocked(); + + /** + * Search parameter: location + *

+ * Description: One of the locations at which this practitioner provides care
+ * Type: reference
+ * Path: PractitionerRole.location
+ *

+ */ + @SearchParamDefinition(name="location", path="PractitionerRole.location", description="One of the locations at which this practitioner provides care", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: One of the locations at which this practitioner provides care
+ * Type: reference
+ * Path: PractitionerRole.location
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PractitionerRole:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("PractitionerRole:location").toLocked(); + + /** + * Search parameter: email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: PractitionerRole.telecom(system=email)
+ *

+ */ + @SearchParamDefinition(name="email", path="PractitionerRole.telecom.where(system='email')", description="A value in an email contact", type="token" ) + public static final String SP_EMAIL = "email"; + /** + * Fluent Client search parameter constant for email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: PractitionerRole.telecom(system=email)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); + + /** + * Search parameter: telecom + *

+ * Description: The value in any kind of contact
+ * Type: token
+ * Path: PractitionerRole.telecom
+ *

+ */ + @SearchParamDefinition(name="telecom", path="PractitionerRole.telecom", description="The value in any kind of contact", type="token" ) + public static final String SP_TELECOM = "telecom"; + /** + * Fluent Client search parameter constant for telecom + *

+ * Description: The value in any kind of contact
+ * Type: token
+ * Path: PractitionerRole.telecom
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); + + /** + * Search parameter: role + *

+ * Description: The practitioner can perform this role at for the organization
+ * Type: token
+ * Path: PractitionerRole.role
+ *

+ */ + @SearchParamDefinition(name="role", path="PractitionerRole.role", description="The practitioner can perform this role at for the organization", type="token" ) + public static final String SP_ROLE = "role"; + /** + * Fluent Client search parameter constant for role + *

+ * Description: The practitioner can perform this role at for the organization
+ * Type: token
+ * Path: PractitionerRole.role
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROLE); + + /** + * Search parameter: specialty + *

+ * Description: The practitioner has this specialty at an organization
+ * Type: token
+ * Path: PractitionerRole.specialty
+ *

+ */ + @SearchParamDefinition(name="specialty", path="PractitionerRole.specialty", description="The practitioner has this specialty at an organization", type="token" ) + public static final String SP_SPECIALTY = "specialty"; + /** + * Fluent Client search parameter constant for specialty + *

+ * Description: The practitioner has this specialty at an organization
+ * Type: token
+ * Path: PractitionerRole.specialty
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY); + + /** + * Search parameter: identifier + *

+ * Description: A practitioner's Identifier
+ * Type: token
+ * Path: PractitionerRole.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="PractitionerRole.identifier", description="A practitioner's Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A practitioner's Identifier
+ * Type: token
+ * Path: PractitionerRole.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PrimitiveType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PrimitiveType.java new file mode 100644 index 00000000000..56494ba0b21 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/PrimitiveType.java @@ -0,0 +1,160 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.hl7.fhir.instance.model.api.IBaseHasExtensions; +import org.hl7.fhir.instance.model.api.IPrimitiveType; + +import ca.uhn.fhir.model.api.IElement; + +public abstract class PrimitiveType extends Type implements IPrimitiveType, IBaseHasExtensions, IElement, Externalizable { + + private static final long serialVersionUID = 3L; + + private T myCoercedValue; + private String myStringValue; + + public String asStringValue() { + return myStringValue; + } + + public abstract Type copy(); + + /** + * Subclasses must override to convert a "coerced" value into an encoded one. + * + * @param theValue + * Will not be null + * @return May return null if the value does not correspond to anything + */ + protected abstract String encode(T theValue); + + @Override + public boolean equalsDeep(Base obj) { + if (!super.equalsDeep(obj)) + return false; + if (obj == null) { + return false; + } + if (!(obj.getClass() == getClass())) { + return false; + } + + PrimitiveType o = (PrimitiveType) obj; + + EqualsBuilder b = new EqualsBuilder(); + b.append(getValue(), o.getValue()); + return b.isEquals(); + } + + @Override + public boolean equalsShallow(Base obj) { + if (obj == null) { + return false; + } + if (!(obj.getClass() == getClass())) { + return false; + } + + PrimitiveType o = (PrimitiveType) obj; + + EqualsBuilder b = new EqualsBuilder(); + b.append(getValue(), o.getValue()); + return b.isEquals(); + } + + public void fromStringValue(String theValue) { + myStringValue = theValue; + if (theValue == null) { + myCoercedValue = null; + } else { + // NB this might be null + myCoercedValue = parse(theValue); + } + } + + public T getValue() { + return myCoercedValue; + } + + public String getValueAsString() { + return asStringValue(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getValue()).toHashCode(); + } + + public boolean hasValue() { + return !StringUtils.isBlank(getValueAsString()); + } + + @Override + public boolean isEmpty() { + return super.isEmpty() && StringUtils.isBlank(getValueAsString()); + } + + public boolean isPrimitive() { + return true; + } + + /** + * Subclasses must override to convert an encoded representation of this datatype into a "coerced" one + * + * @param theValue + * Will not be null + * @return May return null if the value does not correspond to anything + */ + protected abstract T parse(String theValue); + + public String primitiveValue() { + return asStringValue(); + } + + @Override + public void readExternal(ObjectInput theIn) throws IOException, ClassNotFoundException { + String object = (String) theIn.readObject(); + setValueAsString(object); + } + + public PrimitiveType setValue(T theValue) { + myCoercedValue = theValue; + updateStringValue(); + return this; + } + + public void setValueAsString(String theValue) { + fromStringValue(theValue); + } + + @Override + public String toString() { + return getClass().getSimpleName() + "[" + asStringValue() + "]"; + } + + protected Type typedCopy() { + return copy(); + } + + protected void updateStringValue() { + if (myCoercedValue == null) { + myStringValue = null; + } else { + // NB this might be null + myStringValue = encode(myCoercedValue); + } + } + + @Override + public void writeExternal(ObjectOutput theOut) throws IOException { + theOut.writeObject(getValueAsString()); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Procedure.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Procedure.java new file mode 100644 index 00000000000..d8979e18b36 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Procedure.java @@ -0,0 +1,2220 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. + */ +@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/Profile/Procedure") +public class Procedure extends DomainResource { + + public enum ProcedureStatus { + /** + * The procedure is still occurring. + */ + INPROGRESS, + /** + * The procedure was terminated without completing successfully. + */ + ABORTED, + /** + * All actions involved in the procedure have taken place. + */ + COMPLETED, + /** + * The statement was entered in error and Is not valid. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static ProcedureStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("aborted".equals(codeString)) + return ABORTED; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown ProcedureStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case ABORTED: return "aborted"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return "http://hl7.org/fhir/procedure-status"; + case ABORTED: return "http://hl7.org/fhir/procedure-status"; + case COMPLETED: return "http://hl7.org/fhir/procedure-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/procedure-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The procedure is still occurring."; + case ABORTED: return "The procedure was terminated without completing successfully."; + case COMPLETED: return "All actions involved in the procedure have taken place."; + case ENTEREDINERROR: return "The statement was entered in error and Is not valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case ABORTED: return "Aboted"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + public static class ProcedureStatusEnumFactory implements EnumFactory { + public ProcedureStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return ProcedureStatus.INPROGRESS; + if ("aborted".equals(codeString)) + return ProcedureStatus.ABORTED; + if ("completed".equals(codeString)) + return ProcedureStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return ProcedureStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ProcedureStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return new Enumeration(this, ProcedureStatus.INPROGRESS); + if ("aborted".equals(codeString)) + return new Enumeration(this, ProcedureStatus.ABORTED); + if ("completed".equals(codeString)) + return new Enumeration(this, ProcedureStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, ProcedureStatus.ENTEREDINERROR); + throw new FHIRException("Unknown ProcedureStatus code '"+codeString+"'"); + } + public String toCode(ProcedureStatus code) { + if (code == ProcedureStatus.INPROGRESS) + return "in-progress"; + if (code == ProcedureStatus.ABORTED) + return "aborted"; + if (code == ProcedureStatus.COMPLETED) + return "completed"; + if (code == ProcedureStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(ProcedureStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class ProcedurePerformerComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The practitioner who was involved in the procedure. + */ + @Child(name = "actor", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The reference to the practitioner", formalDefinition="The practitioner who was involved in the procedure." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The practitioner who was involved in the procedure.) + */ + protected Resource actorTarget; + + /** + * For example: surgeon, anaethetist, endoscopist. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The role the actor was in", formalDefinition="For example: surgeon, anaethetist, endoscopist." ) + protected CodeableConcept role; + + private static final long serialVersionUID = -843698327L; + + /** + * Constructor + */ + public ProcedurePerformerComponent() { + super(); + } + + /** + * @return {@link #actor} (The practitioner who was involved in the procedure.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedurePerformerComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The practitioner who was involved in the procedure.) + */ + public ProcedurePerformerComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 was involved in the procedure.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 was involved in the procedure.) + */ + public ProcedurePerformerComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #role} (For example: surgeon, anaethetist, endoscopist.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedurePerformerComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (For example: surgeon, anaethetist, endoscopist.) + */ + public ProcedurePerformerComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("actor", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "The practitioner who was involved in the procedure.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("role", "CodeableConcept", "For example: surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, role)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 92645877: // actor + this.actor = castToReference(value); // Reference + break; + case 3506294: // role + this.role = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("actor")) + this.actor = castToReference(value); // Reference + else if (name.equals("role")) + this.role = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 92645877: return getActor(); // Reference + case 3506294: return getRole(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("actor")) { + this.actor = new Reference(); + return this.actor; + } + else if (name.equals("role")) { + this.role = new CodeableConcept(); + return this.role; + } + else + return super.addChild(name); + } + + public ProcedurePerformerComponent copy() { + ProcedurePerformerComponent dst = new ProcedurePerformerComponent(); + copyValues(dst); + dst.actor = actor == null ? null : actor.copy(); + dst.role = role == null ? null : role.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedurePerformerComponent)) + return false; + ProcedurePerformerComponent o = (ProcedurePerformerComponent) other; + return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedurePerformerComponent)) + return false; + ProcedurePerformerComponent o = (ProcedurePerformerComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (actor == null || actor.isEmpty()) && (role == null || role.isEmpty()) + ; + } + + public String fhirType() { + return "Procedure.performer"; + + } + + } + + @Block() + public static class ProcedureFocalDeviceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of change that happened to the device during the procedure. + */ + @Child(name = "action", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Kind of change to device", formalDefinition="The kind of change that happened to the device during the procedure." ) + protected CodeableConcept action; + + /** + * The device that was manipulated (changed) during the procedure. + */ + @Child(name = "manipulated", type = {Device.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Device that was changed", formalDefinition="The device that was manipulated (changed) during the procedure." ) + protected Reference manipulated; + + /** + * The actual object that is the target of the reference (The device that was manipulated (changed) during the procedure.) + */ + protected Device manipulatedTarget; + + private static final long serialVersionUID = 1779937807L; + + /** + * Constructor + */ + public ProcedureFocalDeviceComponent() { + super(); + } + + /** + * Constructor + */ + public ProcedureFocalDeviceComponent(Reference manipulated) { + super(); + this.manipulated = manipulated; + } + + /** + * @return {@link #action} (The kind of change that happened to the device during the procedure.) + */ + public CodeableConcept getAction() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.action"); + else if (Configuration.doAutoCreate()) + this.action = new CodeableConcept(); // cc + return this.action; + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (The kind of change that happened to the device during the procedure.) + */ + public ProcedureFocalDeviceComponent setAction(CodeableConcept value) { + this.action = value; + return this; + } + + /** + * @return {@link #manipulated} (The device that was manipulated (changed) during the procedure.) + */ + public Reference getManipulated() { + if (this.manipulated == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.manipulated"); + else if (Configuration.doAutoCreate()) + this.manipulated = new Reference(); // cc + return this.manipulated; + } + + public boolean hasManipulated() { + return this.manipulated != null && !this.manipulated.isEmpty(); + } + + /** + * @param value {@link #manipulated} (The device that was manipulated (changed) during the procedure.) + */ + public ProcedureFocalDeviceComponent setManipulated(Reference value) { + this.manipulated = value; + return this; + } + + /** + * @return {@link #manipulated} 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 device that was manipulated (changed) during the procedure.) + */ + public Device getManipulatedTarget() { + if (this.manipulatedTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.manipulated"); + else if (Configuration.doAutoCreate()) + this.manipulatedTarget = new Device(); // aa + return this.manipulatedTarget; + } + + /** + * @param value {@link #manipulated} 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 device that was manipulated (changed) during the procedure.) + */ + public ProcedureFocalDeviceComponent setManipulatedTarget(Device value) { + this.manipulatedTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("action", "CodeableConcept", "The kind of change that happened to the device during the procedure.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("manipulated", "Reference(Device)", "The device that was manipulated (changed) during the procedure.", 0, java.lang.Integer.MAX_VALUE, manipulated)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // CodeableConcept + case 947372650: /*manipulated*/ return this.manipulated == null ? new Base[0] : new Base[] {this.manipulated}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422950858: // action + this.action = castToCodeableConcept(value); // CodeableConcept + break; + case 947372650: // manipulated + this.manipulated = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("action")) + this.action = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("manipulated")) + this.manipulated = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422950858: return getAction(); // CodeableConcept + case 947372650: return getManipulated(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("action")) { + this.action = new CodeableConcept(); + return this.action; + } + else if (name.equals("manipulated")) { + this.manipulated = new Reference(); + return this.manipulated; + } + else + return super.addChild(name); + } + + public ProcedureFocalDeviceComponent copy() { + ProcedureFocalDeviceComponent dst = new ProcedureFocalDeviceComponent(); + copyValues(dst); + dst.action = action == null ? null : action.copy(); + dst.manipulated = manipulated == null ? null : manipulated.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureFocalDeviceComponent)) + return false; + ProcedureFocalDeviceComponent o = (ProcedureFocalDeviceComponent) other; + return compareDeep(action, o.action, true) && compareDeep(manipulated, o.manipulated, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureFocalDeviceComponent)) + return false; + ProcedureFocalDeviceComponent o = (ProcedureFocalDeviceComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (action == null || action.isEmpty()) && (manipulated == null || manipulated.isEmpty()) + ; + } + + public String fhirType() { + return "Procedure.focalDevice"; + + } + + } + + /** + * This records identifiers associated with this procedure 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=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Identifiers for this procedure", formalDefinition="This records identifiers associated with this procedure 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 person, animal or group on which the procedure was performed. + */ + @Child(name = "subject", type = {Patient.class, Group.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who the procedure was performed on", formalDefinition="The person, animal or group on which the procedure was performed." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The person, animal or group on which the procedure was performed.) + */ + protected Resource subjectTarget; + + /** + * A code specifying the state of the procedure. Generally this will be in-progress or completed state. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="in-progress | aborted | completed | entered-in-error", formalDefinition="A code specifying the state of the procedure. Generally this will be in-progress or completed state." ) + protected Enumeration status; + + /** + * A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure"). + */ + @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Classification of the procedure", formalDefinition="A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\")." ) + protected CodeableConcept category; + + /** + * The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy"). + */ + @Child(name = "code", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identification of the procedure", formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\")." ) + protected CodeableConcept code; + + /** + * Set this to true if the record is saying that the procedure was NOT performed. + */ + @Child(name = "notPerformed", type = {BooleanType.class}, order=5, min=0, max=1, modifier=true, summary=false) + @Description(shortDefinition="True if procedure was not performed as scheduled", formalDefinition="Set this to true if the record is saying that the procedure was NOT performed." ) + protected BooleanType notPerformed; + + /** + * A code indicating why the procedure was not performed. + */ + @Child(name = "reasonNotPerformed", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Reason procedure was not performed", formalDefinition="A code indicating why the procedure was not performed." ) + protected List reasonNotPerformed; + + /** + * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. + */ + @Child(name = "bodySite", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Target body sites", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." ) + protected List bodySite; + + /** + * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text. + */ + @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason procedure performed", formalDefinition="The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text." ) + protected Type reason; + + /** + * Limited to 'real' people rather than equipment. + */ + @Child(name = "performer", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The people who performed the procedure", formalDefinition="Limited to 'real' people rather than equipment." ) + protected List performer; + + /** + * The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. + */ + @Child(name = "performed", type = {DateTimeType.class, Period.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date/Period the procedure was performed", formalDefinition="The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured." ) + protected Type performed; + + /** + * The encounter during which the procedure was performed. + */ + @Child(name = "encounter", type = {Encounter.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The encounter associated with the procedure", formalDefinition="The encounter during which the procedure was performed." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter during which the procedure was performed.) + */ + protected Encounter encounterTarget; + + /** + * The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant. + */ + @Child(name = "location", type = {Location.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where the procedure happened", formalDefinition="The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) + */ + protected Location locationTarget; + + /** + * The outcome of the procedure - did it resolve reasons for the procedure being performed? + */ + @Child(name = "outcome", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The result of procedure", formalDefinition="The outcome of the procedure - did it resolve reasons for the procedure being performed?" ) + protected CodeableConcept outcome; + + /** + * This could be a histology result, pathology report, surgical report, etc.. + */ + @Child(name = "report", type = {DiagnosticReport.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Any report resulting from the procedure", formalDefinition="This could be a histology result, pathology report, surgical report, etc.." ) + protected List report; + /** + * The actual objects that are the target of the reference (This could be a histology result, pathology report, surgical report, etc..) + */ + protected List reportTarget; + + + /** + * Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues. + */ + @Child(name = "complication", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Complication following the procedure", formalDefinition="Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues." ) + protected List complication; + + /** + * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used. + */ + @Child(name = "followUp", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Instructions for follow up", formalDefinition="If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used." ) + protected List followUp; + + /** + * A reference to a resource that contains details of the request for this procedure. + */ + @Child(name = "request", type = {CarePlan.class, DiagnosticOrder.class, ProcedureRequest.class, ReferralRequest.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="A request for this procedure", formalDefinition="A reference to a resource that contains details of the request for this procedure." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (A reference to a resource that contains details of the request for this procedure.) + */ + protected Resource requestTarget; + + /** + * Any other notes about the procedure. E.g. the operative notes. + */ + @Child(name = "notes", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional information about the procedure", formalDefinition="Any other notes about the procedure. E.g. the operative notes." ) + protected List notes; + + /** + * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure. + */ + @Child(name = "focalDevice", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Device changed in procedure", formalDefinition="A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure." ) + protected List focalDevice; + + /** + * Identifies medications, devices and any other substance used as part of the procedure. + */ + @Child(name = "used", type = {Device.class, Medication.class, Substance.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Items used during procedure", formalDefinition="Identifies medications, devices and any other substance used as part of the procedure." ) + protected List used; + /** + * The actual objects that are the target of the reference (Identifies medications, devices and any other substance used as part of the procedure.) + */ + protected List usedTarget; + + + private static final long serialVersionUID = -489125036L; + + /** + * Constructor + */ + public Procedure() { + super(); + } + + /** + * Constructor + */ + public Procedure(Reference subject, Enumeration status, CodeableConcept code) { + super(); + this.subject = subject; + this.status = status; + this.code = code; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this procedure 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} (This records identifiers associated with this procedure 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; + } + + // syntactic sugar + public Procedure addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (The person, animal or group on which the procedure was performed.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The person, animal or group on which the procedure was performed.) + */ + public Procedure 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 person, animal or group on which the procedure was performed.) + */ + public Resource getSubjectTarget() { + 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 person, animal or group on which the procedure was performed.) + */ + public Procedure setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the procedure. Generally this will be in-progress or completed state.). 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 Procedure.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ProcedureStatusEnumFactory()); // bb + 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} (A code specifying the state of the procedure. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Procedure setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the procedure. Generally this will be in-progress or completed state. + */ + public ProcedureStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the procedure. Generally this will be in-progress or completed state. + */ + public Procedure setStatus(ProcedureStatus value) { + if (this.status == null) + this.status = new Enumeration(new ProcedureStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #category} (A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); // cc + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").) + */ + public Procedure setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #code} (The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").) + */ + public Procedure setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #notPerformed} (Set this to true if the record is saying that the procedure was NOT performed.). This is the underlying object with id, value and extensions. The accessor "getNotPerformed" gives direct access to the value + */ + public BooleanType getNotPerformedElement() { + if (this.notPerformed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.notPerformed"); + else if (Configuration.doAutoCreate()) + this.notPerformed = new BooleanType(); // bb + return this.notPerformed; + } + + public boolean hasNotPerformedElement() { + return this.notPerformed != null && !this.notPerformed.isEmpty(); + } + + public boolean hasNotPerformed() { + return this.notPerformed != null && !this.notPerformed.isEmpty(); + } + + /** + * @param value {@link #notPerformed} (Set this to true if the record is saying that the procedure was NOT performed.). This is the underlying object with id, value and extensions. The accessor "getNotPerformed" gives direct access to the value + */ + public Procedure setNotPerformedElement(BooleanType value) { + this.notPerformed = value; + return this; + } + + /** + * @return Set this to true if the record is saying that the procedure was NOT performed. + */ + public boolean getNotPerformed() { + return this.notPerformed == null || this.notPerformed.isEmpty() ? false : this.notPerformed.getValue(); + } + + /** + * @param value Set this to true if the record is saying that the procedure was NOT performed. + */ + public Procedure setNotPerformed(boolean value) { + if (this.notPerformed == null) + this.notPerformed = new BooleanType(); + this.notPerformed.setValue(value); + return this; + } + + /** + * @return {@link #reasonNotPerformed} (A code indicating why the procedure was not performed.) + */ + public List getReasonNotPerformed() { + if (this.reasonNotPerformed == null) + this.reasonNotPerformed = new ArrayList(); + return this.reasonNotPerformed; + } + + public boolean hasReasonNotPerformed() { + if (this.reasonNotPerformed == null) + return false; + for (CodeableConcept item : this.reasonNotPerformed) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotPerformed} (A code indicating why the procedure was not performed.) + */ + // syntactic sugar + public CodeableConcept addReasonNotPerformed() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotPerformed == null) + this.reasonNotPerformed = new ArrayList(); + this.reasonNotPerformed.add(t); + return t; + } + + // syntactic sugar + public Procedure addReasonNotPerformed(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.reasonNotPerformed == null) + this.reasonNotPerformed = new ArrayList(); + this.reasonNotPerformed.add(t); + return this; + } + + /** + * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (CodeableConcept item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + // syntactic sugar + public CodeableConcept addBodySite() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + // syntactic sugar + public Procedure addBodySite(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return this; + } + + /** + * @return {@link #reason} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) + */ + public CodeableConcept getReasonCodeableConcept() throws FHIRException { + if (!(this.reason instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + public boolean hasReasonCodeableConcept() { + return this.reason instanceof CodeableConcept; + } + + /** + * @return {@link #reason} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) + */ + public Reference getReasonReference() throws FHIRException { + if (!(this.reason instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReasonReference() { + return this.reason instanceof Reference; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) + */ + public Procedure setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #performer} (Limited to 'real' people rather than equipment.) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (ProcedurePerformerComponent item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Limited to 'real' people rather than equipment.) + */ + // syntactic sugar + public ProcedurePerformerComponent addPerformer() { //3 + ProcedurePerformerComponent t = new ProcedurePerformerComponent(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + // syntactic sugar + public Procedure addPerformer(ProcedurePerformerComponent t) { //3 + if (t == null) + return this; + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return this; + } + + /** + * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public Type getPerformed() { + return this.performed; + } + + /** + * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public DateTimeType getPerformedDateTimeType() throws FHIRException { + if (!(this.performed instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.performed.getClass().getName()+" was encountered"); + return (DateTimeType) this.performed; + } + + public boolean hasPerformedDateTimeType() { + return this.performed instanceof DateTimeType; + } + + /** + * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public Period getPerformedPeriod() throws FHIRException { + if (!(this.performed instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.performed.getClass().getName()+" was encountered"); + return (Period) this.performed; + } + + public boolean hasPerformedPeriod() { + return this.performed instanceof Period; + } + + public boolean hasPerformed() { + return this.performed != null && !this.performed.isEmpty(); + } + + /** + * @param value {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public Procedure setPerformed(Type value) { + this.performed = value; + return this; + } + + /** + * @return {@link #encounter} (The encounter during which the procedure was performed.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter during which the procedure was performed.) + */ + public Procedure 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 during which the procedure was performed.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 during which the procedure was performed.) + */ + public Procedure setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #location} (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) + */ + public Procedure 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. (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + 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. (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) + */ + public Procedure setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #outcome} (The outcome of the procedure - did it resolve reasons for the procedure being performed?) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (The outcome of the procedure - did it resolve reasons for the procedure being performed?) + */ + public Procedure setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #report} (This could be a histology result, pathology report, surgical report, etc..) + */ + public List getReport() { + if (this.report == null) + this.report = new ArrayList(); + return this.report; + } + + public boolean hasReport() { + if (this.report == null) + return false; + for (Reference item : this.report) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #report} (This could be a histology result, pathology report, surgical report, etc..) + */ + // syntactic sugar + public Reference addReport() { //3 + Reference t = new Reference(); + if (this.report == null) + this.report = new ArrayList(); + this.report.add(t); + return t; + } + + // syntactic sugar + public Procedure addReport(Reference t) { //3 + if (t == null) + return this; + if (this.report == null) + this.report = new ArrayList(); + this.report.add(t); + return this; + } + + /** + * @return {@link #report} (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 could be a histology result, pathology report, surgical report, etc..) + */ + public List getReportTarget() { + if (this.reportTarget == null) + this.reportTarget = new ArrayList(); + return this.reportTarget; + } + + // syntactic sugar + /** + * @return {@link #report} (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. This could be a histology result, pathology report, surgical report, etc..) + */ + public DiagnosticReport addReportTarget() { + DiagnosticReport r = new DiagnosticReport(); + if (this.reportTarget == null) + this.reportTarget = new ArrayList(); + this.reportTarget.add(r); + return r; + } + + /** + * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.) + */ + public List getComplication() { + if (this.complication == null) + this.complication = new ArrayList(); + return this.complication; + } + + public boolean hasComplication() { + if (this.complication == null) + return false; + for (CodeableConcept item : this.complication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.) + */ + // syntactic sugar + public CodeableConcept addComplication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.complication == null) + this.complication = new ArrayList(); + this.complication.add(t); + return t; + } + + // syntactic sugar + public Procedure addComplication(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.complication == null) + this.complication = new ArrayList(); + this.complication.add(t); + return this; + } + + /** + * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.) + */ + public List getFollowUp() { + if (this.followUp == null) + this.followUp = new ArrayList(); + return this.followUp; + } + + public boolean hasFollowUp() { + if (this.followUp == null) + return false; + for (CodeableConcept item : this.followUp) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.) + */ + // syntactic sugar + public CodeableConcept addFollowUp() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.followUp == null) + this.followUp = new ArrayList(); + this.followUp.add(t); + return t; + } + + // syntactic sugar + public Procedure addFollowUp(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.followUp == null) + this.followUp = new ArrayList(); + this.followUp.add(t); + return this; + } + + /** + * @return {@link #request} (A reference to a resource that contains details of the request for this procedure.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (A reference to a resource that contains details of the request for this procedure.) + */ + public Procedure setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (A reference to a resource that contains details of the request for this procedure.) + */ + public Resource getRequestTarget() { + 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. (A reference to a resource that contains details of the request for this procedure.) + */ + public Procedure setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #notes} (Any other notes about the procedure. E.g. the operative notes.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (Annotation item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Any other notes about the procedure. E.g. the operative notes.) + */ + // syntactic sugar + public Annotation addNotes() { //3 + Annotation t = new Annotation(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + // syntactic sugar + public Procedure addNotes(Annotation t) { //3 + if (t == null) + return this; + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @return {@link #focalDevice} (A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.) + */ + public List getFocalDevice() { + if (this.focalDevice == null) + this.focalDevice = new ArrayList(); + return this.focalDevice; + } + + public boolean hasFocalDevice() { + if (this.focalDevice == null) + return false; + for (ProcedureFocalDeviceComponent item : this.focalDevice) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #focalDevice} (A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.) + */ + // syntactic sugar + public ProcedureFocalDeviceComponent addFocalDevice() { //3 + ProcedureFocalDeviceComponent t = new ProcedureFocalDeviceComponent(); + if (this.focalDevice == null) + this.focalDevice = new ArrayList(); + this.focalDevice.add(t); + return t; + } + + // syntactic sugar + public Procedure addFocalDevice(ProcedureFocalDeviceComponent t) { //3 + if (t == null) + return this; + if (this.focalDevice == null) + this.focalDevice = new ArrayList(); + this.focalDevice.add(t); + return this; + } + + /** + * @return {@link #used} (Identifies medications, devices and any other substance used as part of the procedure.) + */ + public List getUsed() { + if (this.used == null) + this.used = new ArrayList(); + return this.used; + } + + public boolean hasUsed() { + if (this.used == null) + return false; + for (Reference item : this.used) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #used} (Identifies medications, devices and any other substance used as part of the procedure.) + */ + // syntactic sugar + public Reference addUsed() { //3 + Reference t = new Reference(); + if (this.used == null) + this.used = new ArrayList(); + this.used.add(t); + return t; + } + + // syntactic sugar + public Procedure addUsed(Reference t) { //3 + if (t == null) + return this; + if (this.used == null) + this.used = new ArrayList(); + this.used.add(t); + return this; + } + + /** + * @return {@link #used} (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 medications, devices and any other substance used as part of the procedure.) + */ + public List getUsedTarget() { + if (this.usedTarget == null) + this.usedTarget = new ArrayList(); + return this.usedTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this procedure 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("subject", "Reference(Patient|Group)", "The person, animal or group on which the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("status", "code", "A code specifying the state of the procedure. Generally this will be in-progress or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\").", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\").", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("notPerformed", "boolean", "Set this to true if the record is saying that the procedure was NOT performed.", 0, java.lang.Integer.MAX_VALUE, notPerformed)); + childrenList.add(new Property("reasonNotPerformed", "CodeableConcept", "A code indicating why the procedure was not performed.", 0, java.lang.Integer.MAX_VALUE, reasonNotPerformed)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("performer", "", "Limited to 'real' people rather than equipment.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("performed[x]", "dateTime|Period", "The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, java.lang.Integer.MAX_VALUE, performed)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter during which the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("location", "Reference(Location)", "The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("outcome", "CodeableConcept", "The outcome of the procedure - did it resolve reasons for the procedure being performed?", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("report", "Reference(DiagnosticReport)", "This could be a histology result, pathology report, surgical report, etc..", 0, java.lang.Integer.MAX_VALUE, report)); + childrenList.add(new Property("complication", "CodeableConcept", "Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.", 0, java.lang.Integer.MAX_VALUE, complication)); + childrenList.add(new Property("followUp", "CodeableConcept", "If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.", 0, java.lang.Integer.MAX_VALUE, followUp)); + childrenList.add(new Property("request", "Reference(CarePlan|DiagnosticOrder|ProcedureRequest|ReferralRequest)", "A reference to a resource that contains details of the request for this procedure.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("notes", "Annotation", "Any other notes about the procedure. E.g. the operative notes.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("focalDevice", "", "A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.", 0, java.lang.Integer.MAX_VALUE, focalDevice)); + childrenList.add(new Property("used", "Reference(Device|Medication|Substance)", "Identifies medications, devices and any other substance used as part of the procedure.", 0, java.lang.Integer.MAX_VALUE, used)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 585470509: /*notPerformed*/ return this.notPerformed == null ? new Base[0] : new Base[] {this.notPerformed}; // BooleanType + case -906415471: /*reasonNotPerformed*/ return this.reasonNotPerformed == null ? new Base[0] : this.reasonNotPerformed.toArray(new Base[this.reasonNotPerformed.size()]); // CodeableConcept + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // ProcedurePerformerComponent + case 481140672: /*performed*/ return this.performed == null ? new Base[0] : new Base[] {this.performed}; // Type + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept + case -934521548: /*report*/ return this.report == null ? new Base[0] : this.report.toArray(new Base[this.report.size()]); // Reference + case -1644401602: /*complication*/ return this.complication == null ? new Base[0] : this.complication.toArray(new Base[this.complication.size()]); // CodeableConcept + case 301801004: /*followUp*/ return this.followUp == null ? new Base[0] : this.followUp.toArray(new Base[this.followUp.size()]); // CodeableConcept + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // Annotation + case -1129235173: /*focalDevice*/ return this.focalDevice == null ? new Base[0] : this.focalDevice.toArray(new Base[this.focalDevice.size()]); // ProcedureFocalDeviceComponent + case 3599293: /*used*/ return this.used == null ? new Base[0] : this.used.toArray(new Base[this.used.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new ProcedureStatusEnumFactory().fromType(value); // Enumeration + break; + case 50511102: // category + this.category = castToCodeableConcept(value); // CodeableConcept + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 585470509: // notPerformed + this.notPerformed = castToBoolean(value); // BooleanType + break; + case -906415471: // reasonNotPerformed + this.getReasonNotPerformed().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1702620169: // bodySite + this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -934964668: // reason + this.reason = (Type) value; // Type + break; + case 481140686: // performer + this.getPerformer().add((ProcedurePerformerComponent) value); // ProcedurePerformerComponent + break; + case 481140672: // performed + this.performed = (Type) value; // Type + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 1901043637: // location + this.location = castToReference(value); // Reference + break; + case -1106507950: // outcome + this.outcome = castToCodeableConcept(value); // CodeableConcept + break; + case -934521548: // report + this.getReport().add(castToReference(value)); // Reference + break; + case -1644401602: // complication + this.getComplication().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 301801004: // followUp + this.getFollowUp().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1095692943: // request + this.request = castToReference(value); // Reference + break; + case 105008833: // notes + this.getNotes().add(castToAnnotation(value)); // Annotation + break; + case -1129235173: // focalDevice + this.getFocalDevice().add((ProcedureFocalDeviceComponent) value); // ProcedureFocalDeviceComponent + break; + case 3599293: // used + this.getUsed().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new ProcedureStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("category")) + this.category = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("notPerformed")) + this.notPerformed = castToBoolean(value); // BooleanType + else if (name.equals("reasonNotPerformed")) + this.getReasonNotPerformed().add(castToCodeableConcept(value)); + else if (name.equals("bodySite")) + this.getBodySite().add(castToCodeableConcept(value)); + else if (name.equals("reason[x]")) + this.reason = (Type) value; // Type + else if (name.equals("performer")) + this.getPerformer().add((ProcedurePerformerComponent) value); + else if (name.equals("performed[x]")) + this.performed = (Type) value; // Type + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("location")) + this.location = castToReference(value); // Reference + else if (name.equals("outcome")) + this.outcome = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("report")) + this.getReport().add(castToReference(value)); + else if (name.equals("complication")) + this.getComplication().add(castToCodeableConcept(value)); + else if (name.equals("followUp")) + this.getFollowUp().add(castToCodeableConcept(value)); + else if (name.equals("request")) + this.request = castToReference(value); // Reference + else if (name.equals("notes")) + this.getNotes().add(castToAnnotation(value)); + else if (name.equals("focalDevice")) + this.getFocalDevice().add((ProcedureFocalDeviceComponent) value); + else if (name.equals("used")) + this.getUsed().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1867885268: return getSubject(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 50511102: return getCategory(); // CodeableConcept + case 3059181: return getCode(); // CodeableConcept + case 585470509: throw new FHIRException("Cannot make property notPerformed as it is not a complex type"); // BooleanType + case -906415471: return addReasonNotPerformed(); // CodeableConcept + case 1702620169: return addBodySite(); // CodeableConcept + case -669418564: return getReason(); // Type + case 481140686: return addPerformer(); // ProcedurePerformerComponent + case 1355984064: return getPerformed(); // Type + case 1524132147: return getEncounter(); // Reference + case 1901043637: return getLocation(); // Reference + case -1106507950: return getOutcome(); // CodeableConcept + case -934521548: return addReport(); // Reference + case -1644401602: return addComplication(); // CodeableConcept + case 301801004: return addFollowUp(); // CodeableConcept + case 1095692943: return getRequest(); // Reference + case 105008833: return addNotes(); // Annotation + case -1129235173: return addFocalDevice(); // ProcedureFocalDeviceComponent + case 3599293: return addUsed(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Procedure.status"); + } + else if (name.equals("category")) { + this.category = new CodeableConcept(); + return this.category; + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("notPerformed")) { + throw new FHIRException("Cannot call addChild on a primitive type Procedure.notPerformed"); + } + else if (name.equals("reasonNotPerformed")) { + return addReasonNotPerformed(); + } + else if (name.equals("bodySite")) { + return addBodySite(); + } + else if (name.equals("reasonCodeableConcept")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else if (name.equals("reasonReference")) { + this.reason = new Reference(); + return this.reason; + } + else if (name.equals("performer")) { + return addPerformer(); + } + else if (name.equals("performedDateTime")) { + this.performed = new DateTimeType(); + return this.performed; + } + else if (name.equals("performedPeriod")) { + this.performed = new Period(); + return this.performed; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("location")) { + this.location = new Reference(); + return this.location; + } + else if (name.equals("outcome")) { + this.outcome = new CodeableConcept(); + return this.outcome; + } + else if (name.equals("report")) { + return addReport(); + } + else if (name.equals("complication")) { + return addComplication(); + } + else if (name.equals("followUp")) { + return addFollowUp(); + } + else if (name.equals("request")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("notes")) { + return addNotes(); + } + else if (name.equals("focalDevice")) { + return addFocalDevice(); + } + else if (name.equals("used")) { + return addUsed(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Procedure"; + + } + + public Procedure copy() { + Procedure dst = new Procedure(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.status = status == null ? null : status.copy(); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + dst.notPerformed = notPerformed == null ? null : notPerformed.copy(); + if (reasonNotPerformed != null) { + dst.reasonNotPerformed = new ArrayList(); + for (CodeableConcept i : reasonNotPerformed) + dst.reasonNotPerformed.add(i.copy()); + }; + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (CodeableConcept i : bodySite) + dst.bodySite.add(i.copy()); + }; + dst.reason = reason == null ? null : reason.copy(); + if (performer != null) { + dst.performer = new ArrayList(); + for (ProcedurePerformerComponent i : performer) + dst.performer.add(i.copy()); + }; + dst.performed = performed == null ? null : performed.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.location = location == null ? null : location.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + if (report != null) { + dst.report = new ArrayList(); + for (Reference i : report) + dst.report.add(i.copy()); + }; + if (complication != null) { + dst.complication = new ArrayList(); + for (CodeableConcept i : complication) + dst.complication.add(i.copy()); + }; + if (followUp != null) { + dst.followUp = new ArrayList(); + for (CodeableConcept i : followUp) + dst.followUp.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + if (notes != null) { + dst.notes = new ArrayList(); + for (Annotation i : notes) + dst.notes.add(i.copy()); + }; + if (focalDevice != null) { + dst.focalDevice = new ArrayList(); + for (ProcedureFocalDeviceComponent i : focalDevice) + dst.focalDevice.add(i.copy()); + }; + if (used != null) { + dst.used = new ArrayList(); + for (Reference i : used) + dst.used.add(i.copy()); + }; + return dst; + } + + protected Procedure typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Procedure)) + return false; + Procedure o = (Procedure) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(status, o.status, true) + && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(notPerformed, o.notPerformed, true) + && compareDeep(reasonNotPerformed, o.reasonNotPerformed, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(reason, o.reason, true) && compareDeep(performer, o.performer, true) && compareDeep(performed, o.performed, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(location, o.location, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(report, o.report, true) && compareDeep(complication, o.complication, true) && compareDeep(followUp, o.followUp, true) + && compareDeep(request, o.request, true) && compareDeep(notes, o.notes, true) && compareDeep(focalDevice, o.focalDevice, true) + && compareDeep(used, o.used, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Procedure)) + return false; + Procedure o = (Procedure) other; + return compareValues(status, o.status, true) && compareValues(notPerformed, o.notPerformed, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (status == null || status.isEmpty()) && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) + && (notPerformed == null || notPerformed.isEmpty()) && (reasonNotPerformed == null || reasonNotPerformed.isEmpty()) + && (bodySite == null || bodySite.isEmpty()) && (reason == null || reason.isEmpty()) && (performer == null || performer.isEmpty()) + && (performed == null || performed.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (location == null || location.isEmpty()) && (outcome == null || outcome.isEmpty()) && (report == null || report.isEmpty()) + && (complication == null || complication.isEmpty()) && (followUp == null || followUp.isEmpty()) + && (request == null || request.isEmpty()) && (notes == null || notes.isEmpty()) && (focalDevice == null || focalDevice.isEmpty()) + && (used == null || used.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Procedure; + } + + /** + * Search parameter: patient + *

+ * Description: Search by subject - a patient
+ * Type: reference
+ * Path: Procedure.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Procedure.subject", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Search by subject - a patient
+ * Type: reference
+ * Path: Procedure.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Procedure:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Procedure:patient").toLocked(); + + /** + * Search parameter: location + *

+ * Description: Where the procedure happened
+ * Type: reference
+ * Path: Procedure.location
+ *

+ */ + @SearchParamDefinition(name="location", path="Procedure.location", description="Where the procedure happened", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: Where the procedure happened
+ * Type: reference
+ * Path: Procedure.location
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Procedure:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Procedure:location").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: Search by subject
+ * Type: reference
+ * Path: Procedure.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Procedure.subject", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Search by subject
+ * Type: reference
+ * Path: Procedure.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Procedure:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Procedure:subject").toLocked(); + + /** + * Search parameter: performer + *

+ * Description: The reference to the practitioner
+ * Type: reference
+ * Path: Procedure.performer.actor
+ *

+ */ + @SearchParamDefinition(name="performer", path="Procedure.performer.actor", description="The reference to the practitioner", type="reference" ) + public static final String SP_PERFORMER = "performer"; + /** + * Fluent Client search parameter constant for performer + *

+ * Description: The reference to the practitioner
+ * Type: reference
+ * Path: Procedure.performer.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Procedure:performer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Procedure:performer").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: The encounter associated with the procedure
+ * Type: reference
+ * Path: Procedure.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="Procedure.encounter", description="The encounter associated with the procedure", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: The encounter associated with the procedure
+ * Type: reference
+ * Path: Procedure.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Procedure:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Procedure:encounter").toLocked(); + + /** + * Search parameter: code + *

+ * Description: A code to identify a procedure
+ * Type: token
+ * Path: Procedure.code
+ *

+ */ + @SearchParamDefinition(name="code", path="Procedure.code", description="A code to identify a procedure", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: A code to identify a procedure
+ * Type: token
+ * Path: Procedure.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: Date/Period the procedure was performed
+ * Type: date
+ * Path: Procedure.performed[x]
+ *

+ */ + @SearchParamDefinition(name="date", path="Procedure.performed", description="Date/Period the procedure was performed", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Date/Period the procedure was performed
+ * Type: date
+ * Path: Procedure.performed[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: A unique identifier for a procedure
+ * Type: token
+ * Path: Procedure.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Procedure.identifier", description="A unique identifier for a procedure", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A unique identifier for a procedure
+ * Type: token
+ * Path: Procedure.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcedureRequest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcedureRequest.java new file mode 100644 index 00000000000..5d690e8c192 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcedureRequest.java @@ -0,0 +1,1569 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A request for a procedure to be performed. May be a proposal or an order. + */ +@ResourceDef(name="ProcedureRequest", profile="http://hl7.org/fhir/Profile/ProcedureRequest") +public class ProcedureRequest extends DomainResource { + + public enum ProcedureRequestStatus { + /** + * The request has been proposed. + */ + PROPOSED, + /** + * The request is in preliminary form, prior to being requested. + */ + DRAFT, + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the request, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the request is happening. + */ + INPROGRESS, + /** + * The work has been completed, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The request was attempted, but due to some procedural error, it could not be completed. + */ + ABORTED, + /** + * added to help the parsers + */ + NULL; + public static ProcedureRequestStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("draft".equals(codeString)) + return DRAFT; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + 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 ("aborted".equals(codeString)) + return ABORTED; + throw new FHIRException("Unknown ProcedureRequestStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case DRAFT: return "draft"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case ABORTED: return "aborted"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return "http://hl7.org/fhir/procedure-request-status"; + case DRAFT: return "http://hl7.org/fhir/procedure-request-status"; + case REQUESTED: return "http://hl7.org/fhir/procedure-request-status"; + case RECEIVED: return "http://hl7.org/fhir/procedure-request-status"; + case ACCEPTED: return "http://hl7.org/fhir/procedure-request-status"; + case INPROGRESS: return "http://hl7.org/fhir/procedure-request-status"; + case COMPLETED: return "http://hl7.org/fhir/procedure-request-status"; + case SUSPENDED: return "http://hl7.org/fhir/procedure-request-status"; + case REJECTED: return "http://hl7.org/fhir/procedure-request-status"; + case ABORTED: return "http://hl7.org/fhir/procedure-request-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "The request has been proposed."; + case DRAFT: return "The request is in preliminary form, prior to being requested."; + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the request, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the request is happening."; + case COMPLETED: return "The work has been completed, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case ABORTED: return "The request was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "Proposed"; + case DRAFT: return "Draft"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Completed"; + case SUSPENDED: return "Suspended"; + case REJECTED: return "Rejected"; + case ABORTED: return "Aborted"; + default: return "?"; + } + } + } + + 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; + if ("proposed".equals(codeString)) + return ProcedureRequestStatus.PROPOSED; + if ("draft".equals(codeString)) + return ProcedureRequestStatus.DRAFT; + if ("requested".equals(codeString)) + return ProcedureRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return ProcedureRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return ProcedureRequestStatus.ACCEPTED; + if ("in-progress".equals(codeString)) + return ProcedureRequestStatus.INPROGRESS; + if ("completed".equals(codeString)) + return ProcedureRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return ProcedureRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return ProcedureRequestStatus.REJECTED; + if ("aborted".equals(codeString)) + return ProcedureRequestStatus.ABORTED; + throw new IllegalArgumentException("Unknown ProcedureRequestStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.PROPOSED); + if ("draft".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.DRAFT); + if ("requested".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.REQUESTED); + if ("received".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.RECEIVED); + if ("accepted".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.ACCEPTED); + if ("in-progress".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.INPROGRESS); + if ("completed".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.COMPLETED); + if ("suspended".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.SUSPENDED); + if ("rejected".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.REJECTED); + if ("aborted".equals(codeString)) + return new Enumeration(this, ProcedureRequestStatus.ABORTED); + throw new FHIRException("Unknown ProcedureRequestStatus code '"+codeString+"'"); + } + public String toCode(ProcedureRequestStatus code) { + if (code == ProcedureRequestStatus.PROPOSED) + return "proposed"; + if (code == ProcedureRequestStatus.DRAFT) + return "draft"; + if (code == ProcedureRequestStatus.REQUESTED) + return "requested"; + if (code == ProcedureRequestStatus.RECEIVED) + return "received"; + if (code == ProcedureRequestStatus.ACCEPTED) + return "accepted"; + if (code == ProcedureRequestStatus.INPROGRESS) + return "in-progress"; + if (code == ProcedureRequestStatus.COMPLETED) + return "completed"; + if (code == ProcedureRequestStatus.SUSPENDED) + return "suspended"; + if (code == ProcedureRequestStatus.REJECTED) + return "rejected"; + if (code == ProcedureRequestStatus.ABORTED) + return "aborted"; + return "?"; + } + public String toSystem(ProcedureRequestStatus code) { + return code.getSystem(); + } + } + + public enum ProcedureRequestPriority { + /** + * The request has a normal priority. + */ + ROUTINE, + /** + * The request should be done urgently. + */ + URGENT, + /** + * The request is time-critical. + */ + STAT, + /** + * The request should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + public static ProcedureRequestPriority fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new FHIRException("Unknown ProcedureRequestPriority code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return "http://hl7.org/fhir/procedure-request-priority"; + case URGENT: return "http://hl7.org/fhir/procedure-request-priority"; + case STAT: return "http://hl7.org/fhir/procedure-request-priority"; + case ASAP: return "http://hl7.org/fhir/procedure-request-priority"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The request has a normal priority."; + case URGENT: return "The request should be done urgently."; + case STAT: return "The request is time-critical."; + case ASAP: return "The request should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "ASAP"; + default: return "?"; + } + } + } + + 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; + if ("routine".equals(codeString)) + return ProcedureRequestPriority.ROUTINE; + if ("urgent".equals(codeString)) + return ProcedureRequestPriority.URGENT; + if ("stat".equals(codeString)) + return ProcedureRequestPriority.STAT; + if ("asap".equals(codeString)) + return ProcedureRequestPriority.ASAP; + throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return new Enumeration(this, ProcedureRequestPriority.ROUTINE); + if ("urgent".equals(codeString)) + return new Enumeration(this, ProcedureRequestPriority.URGENT); + if ("stat".equals(codeString)) + return new Enumeration(this, ProcedureRequestPriority.STAT); + if ("asap".equals(codeString)) + return new Enumeration(this, ProcedureRequestPriority.ASAP); + throw new FHIRException("Unknown ProcedureRequestPriority code '"+codeString+"'"); + } + public String toCode(ProcedureRequestPriority code) { + if (code == ProcedureRequestPriority.ROUTINE) + return "routine"; + if (code == ProcedureRequestPriority.URGENT) + return "urgent"; + if (code == ProcedureRequestPriority.STAT) + return "stat"; + if (code == ProcedureRequestPriority.ASAP) + return "asap"; + return "?"; + } + public String toSystem(ProcedureRequestPriority code) { + return code.getSystem(); + } + } + + /** + * Identifiers assigned to this order by the order or by the receiver. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier for the request", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) + protected List identifier; + + /** + * The person, animal or group that should receive the procedure. + */ + @Child(name = "subject", type = {Patient.class, Group.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who the procedure should be done to", formalDefinition="The person, animal or group that should receive the procedure." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The person, animal or group that should receive the procedure.) + */ + protected Resource subjectTarget; + + /** + * The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What procedure to perform", formalDefinition="The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded." ) + protected CodeableConcept code; + + /** + * Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites). + */ + @Child(name = "bodySite", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="What part of body to perform on", formalDefinition="Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites)." ) + protected List bodySite; + + /** + * The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance. + */ + @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why procedure should occur", formalDefinition="The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance." ) + protected Type reason; + + /** + * The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name = "scheduled", type = {DateTimeType.class, Period.class, Timing.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When procedure should occur", formalDefinition="The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"." ) + protected Type scheduled; + + /** + * The encounter within which the procedure proposal or request was created. + */ + @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Encounter request created during", formalDefinition="The encounter within which the procedure proposal or request was created." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter within which the procedure proposal or request was created.) + */ + protected Encounter encounterTarget; + + /** + * For example, the surgeon, anaethetist, endoscopist, etc. + */ + @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who should perform the procedure", formalDefinition="For example, the surgeon, anaethetist, endoscopist, etc." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (For example, the surgeon, anaethetist, endoscopist, etc.) + */ + protected Resource performerTarget; + + /** + * The status of the order. + */ + @Child(name = "status", type = {CodeType.class}, order=8, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposed | draft | requested | received | accepted | in-progress | completed | suspended | rejected | aborted", formalDefinition="The status of the order." ) + protected Enumeration status; + + /** + * Any other notes associated with this proposal or order - e.g. provider instructions. + */ + @Child(name = "notes", type = {Annotation.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Additional information about desired procedure", formalDefinition="Any other notes associated with this proposal or order - e.g. provider instructions." ) + protected List notes; + + /** + * If a CodeableConcept is present, it indicates the pre-condition for performing the procedure. + */ + @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Preconditions for procedure", formalDefinition="If a CodeableConcept is present, it indicates the pre-condition for performing the procedure." ) + protected Type asNeeded; + + /** + * The time when the request was made. + */ + @Child(name = "orderedOn", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When request was created", formalDefinition="The time when the request was made." ) + protected DateTimeType orderedOn; + + /** + * The healthcare professional responsible for proposing or ordering the procedure. + */ + @Child(name = "orderer", type = {Practitioner.class, Patient.class, RelatedPerson.class, Device.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who made request", formalDefinition="The healthcare professional responsible for proposing or ordering the procedure." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for proposing or ordering the procedure.) + */ + protected Resource ordererTarget; + + /** + * The clinical priority associated with this order. + */ + @Child(name = "priority", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) + protected Enumeration priority; + + private static final long serialVersionUID = -916650578L; + + /** + * Constructor + */ + public ProcedureRequest() { + super(); + } + + /** + * Constructor + */ + public ProcedureRequest(Reference subject, CodeableConcept code) { + super(); + this.subject = subject; + this.code = code; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) + */ + 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 assigned to this order by the order or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ProcedureRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #subject} (The person, animal or group that should receive the procedure.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The person, animal or group that should receive the procedure.) + */ + public ProcedureRequest 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 person, animal or group that should receive the procedure.) + */ + public Resource getSubjectTarget() { + 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 person, animal or group that should receive the procedure.) + */ + public ProcedureRequest setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #code} (The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded.) + */ + public ProcedureRequest setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (CodeableConcept item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).) + */ + // syntactic sugar + public CodeableConcept addBodySite() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + // syntactic sugar + public ProcedureRequest addBodySite(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return this; + } + + /** + * @return {@link #reason} (The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.) + */ + public CodeableConcept getReasonCodeableConcept() throws FHIRException { + if (!(this.reason instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + public boolean hasReasonCodeableConcept() { + return this.reason instanceof CodeableConcept; + } + + /** + * @return {@link #reason} (The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.) + */ + public Reference getReasonReference() throws FHIRException { + if (!(this.reason instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReasonReference() { + return this.reason instanceof Reference; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.) + */ + public ProcedureRequest setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getScheduledDateTimeType() throws FHIRException { + if (!(this.scheduled instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (DateTimeType) this.scheduled; + } + + public boolean hasScheduledDateTimeType() { + return this.scheduled instanceof DateTimeType; + } + + /** + * @return {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getScheduledPeriod() throws FHIRException { + if (!(this.scheduled instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + public boolean hasScheduledPeriod() { + return this.scheduled instanceof Period; + } + + /** + * @return {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getScheduledTiming() throws FHIRException { + if (!(this.scheduled instanceof Timing)) + throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + public boolean hasScheduledTiming() { + return this.scheduled instanceof Timing; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public ProcedureRequest setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #encounter} (The encounter within which the procedure proposal or request was created.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter within which the procedure proposal or request was created.) + */ + public ProcedureRequest 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 procedure proposal or request was created.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 procedure proposal or request was created.) + */ + public ProcedureRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #performer} (For example, the surgeon, anaethetist, endoscopist, etc.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (For example, the surgeon, anaethetist, endoscopist, etc.) + */ + public ProcedureRequest setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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. (For example, the surgeon, anaethetist, endoscopist, etc.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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. (For example, the surgeon, anaethetist, endoscopist, etc.) + */ + public ProcedureRequest setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the order.). 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 ProcedureRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ProcedureRequestStatusEnumFactory()); // bb + 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 order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ProcedureRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the order. + */ + public ProcedureRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the order. + */ + public ProcedureRequest setStatus(ProcedureRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ProcedureRequestStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #notes} (Any other notes associated with this proposal or order - e.g. provider instructions.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (Annotation item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Any other notes associated with this proposal or order - e.g. provider instructions.) + */ + // syntactic sugar + public Annotation addNotes() { //3 + Annotation t = new Annotation(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + // syntactic sugar + public ProcedureRequest addNotes(Annotation t) { //3 + if (t == null) + return this; + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public BooleanType getAsNeededBooleanType() throws FHIRException { + if (!(this.asNeeded instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + public boolean hasAsNeededBooleanType() { + return this.asNeeded instanceof BooleanType; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeededCodeableConcept() { + return this.asNeeded instanceof CodeableConcept; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public ProcedureRequest setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DateTimeType getOrderedOnElement() { + if (this.orderedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.orderedOn"); + else if (Configuration.doAutoCreate()) + this.orderedOn = new DateTimeType(); // bb + return this.orderedOn; + } + + public boolean hasOrderedOnElement() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + public boolean hasOrderedOn() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + /** + * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public ProcedureRequest setOrderedOnElement(DateTimeType value) { + this.orderedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getOrderedOn() { + return this.orderedOn == null ? null : this.orderedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public ProcedureRequest setOrderedOn(Date value) { + if (value == null) + this.orderedOn = null; + else { + if (this.orderedOn == null) + this.orderedOn = new DateTimeType(); + this.orderedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); // cc + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) + */ + public ProcedureRequest setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} 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 healthcare professional responsible for proposing or ordering the procedure.) + */ + public Resource getOrdererTarget() { + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} 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 healthcare professional responsible for proposing or ordering the procedure.) + */ + public ProcedureRequest setOrdererTarget(Resource value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new ProcedureRequestPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public ProcedureRequest setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return The clinical priority associated with this order. + */ + public ProcedureRequestPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value The clinical priority associated with this order. + */ + public ProcedureRequest setPriority(ProcedureRequestPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new ProcedureRequestPriorityEnumFactory()); + this.priority.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Group)", "The person, animal or group that should receive the procedure.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("code", "CodeableConcept", "The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("scheduled[x]", "dateTime|Period|Timing", "The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the procedure proposal or request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "For example, the surgeon, anaethetist, endoscopist, etc.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("notes", "Annotation", "Any other notes associated with this proposal or order - e.g. provider instructions.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); + childrenList.add(new Property("orderer", "Reference(Practitioner|Patient|RelatedPerson|Device)", "The healthcare professional responsible for proposing or ordering the procedure.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type + case -160710483: /*scheduled*/ return this.scheduled == null ? new Base[0] : new Base[] {this.scheduled}; // Type + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // Annotation + case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type + case -391079124: /*orderedOn*/ return this.orderedOn == null ? new Base[0] : new Base[] {this.orderedOn}; // DateTimeType + case -1207109509: /*orderer*/ return this.orderer == null ? new Base[0] : new Base[] {this.orderer}; // Reference + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case 1702620169: // bodySite + this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -934964668: // reason + this.reason = (Type) value; // Type + break; + case -160710483: // scheduled + this.scheduled = (Type) value; // Type + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 481140686: // performer + this.performer = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new ProcedureRequestStatusEnumFactory().fromType(value); // Enumeration + break; + case 105008833: // notes + this.getNotes().add(castToAnnotation(value)); // Annotation + break; + case -1432923513: // asNeeded + this.asNeeded = (Type) value; // Type + break; + case -391079124: // orderedOn + this.orderedOn = castToDateTime(value); // DateTimeType + break; + case -1207109509: // orderer + this.orderer = castToReference(value); // Reference + break; + case -1165461084: // priority + this.priority = new ProcedureRequestPriorityEnumFactory().fromType(value); // Enumeration + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("bodySite")) + this.getBodySite().add(castToCodeableConcept(value)); + else if (name.equals("reason[x]")) + this.reason = (Type) value; // Type + else if (name.equals("scheduled[x]")) + this.scheduled = (Type) value; // Type + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("performer")) + this.performer = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new ProcedureRequestStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("notes")) + this.getNotes().add(castToAnnotation(value)); + else if (name.equals("asNeeded[x]")) + this.asNeeded = (Type) value; // Type + else if (name.equals("orderedOn")) + this.orderedOn = castToDateTime(value); // DateTimeType + else if (name.equals("orderer")) + this.orderer = castToReference(value); // Reference + else if (name.equals("priority")) + this.priority = new ProcedureRequestPriorityEnumFactory().fromType(value); // Enumeration + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1867885268: return getSubject(); // Reference + case 3059181: return getCode(); // CodeableConcept + case 1702620169: return addBodySite(); // CodeableConcept + case -669418564: return getReason(); // Type + case 1162627251: return getScheduled(); // Type + case 1524132147: return getEncounter(); // Reference + case 481140686: return getPerformer(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 105008833: return addNotes(); // Annotation + case -544329575: return getAsNeeded(); // Type + case -391079124: throw new FHIRException("Cannot make property orderedOn as it is not a complex type"); // DateTimeType + case -1207109509: return getOrderer(); // Reference + case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("bodySite")) { + return addBodySite(); + } + else if (name.equals("reasonCodeableConcept")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else if (name.equals("reasonReference")) { + this.reason = new Reference(); + return this.reason; + } + else if (name.equals("scheduledDateTime")) { + this.scheduled = new DateTimeType(); + return this.scheduled; + } + else if (name.equals("scheduledPeriod")) { + this.scheduled = new Period(); + return this.scheduled; + } + else if (name.equals("scheduledTiming")) { + this.scheduled = new Timing(); + return this.scheduled; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("performer")) { + this.performer = new Reference(); + return this.performer; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcedureRequest.status"); + } + else if (name.equals("notes")) { + return addNotes(); + } + else if (name.equals("asNeededBoolean")) { + this.asNeeded = new BooleanType(); + return this.asNeeded; + } + else if (name.equals("asNeededCodeableConcept")) { + this.asNeeded = new CodeableConcept(); + return this.asNeeded; + } + else if (name.equals("orderedOn")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcedureRequest.orderedOn"); + } + else if (name.equals("orderer")) { + this.orderer = new Reference(); + return this.orderer; + } + else if (name.equals("priority")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcedureRequest.priority"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ProcedureRequest"; + + } + + public ProcedureRequest copy() { + ProcedureRequest dst = new ProcedureRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.code = code == null ? null : code.copy(); + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (CodeableConcept i : bodySite) + dst.bodySite.add(i.copy()); + }; + dst.reason = reason == null ? null : reason.copy(); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.status = status == null ? null : status.copy(); + if (notes != null) { + dst.notes = new ArrayList(); + for (Annotation i : notes) + dst.notes.add(i.copy()); + }; + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected ProcedureRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcedureRequest)) + return false; + ProcedureRequest o = (ProcedureRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(code, o.code, true) + && compareDeep(bodySite, o.bodySite, true) && compareDeep(reason, o.reason, true) && compareDeep(scheduled, o.scheduled, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(performer, o.performer, true) && compareDeep(status, o.status, true) + && compareDeep(notes, o.notes, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(orderedOn, o.orderedOn, true) + && compareDeep(orderer, o.orderer, true) && compareDeep(priority, o.priority, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcedureRequest)) + return false; + ProcedureRequest o = (ProcedureRequest) other; + return compareValues(status, o.status, true) && compareValues(orderedOn, o.orderedOn, true) && compareValues(priority, o.priority, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (code == null || code.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (reason == null || reason.isEmpty()) + && (scheduled == null || scheduled.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (performer == null || performer.isEmpty()) && (status == null || status.isEmpty()) && (notes == null || notes.isEmpty()) + && (asNeeded == null || asNeeded.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) + && (orderer == null || orderer.isEmpty()) && (priority == null || priority.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ProcedureRequest; + } + + /** + * Search parameter: orderer + *

+ * Description: Who made request
+ * Type: reference
+ * Path: ProcedureRequest.orderer
+ *

+ */ + @SearchParamDefinition(name="orderer", path="ProcedureRequest.orderer", description="Who made request", type="reference" ) + public static final String SP_ORDERER = "orderer"; + /** + * Fluent Client search parameter constant for orderer + *

+ * Description: Who made request
+ * Type: reference
+ * Path: ProcedureRequest.orderer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORDERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORDERER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcedureRequest:orderer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORDERER = new ca.uhn.fhir.model.api.Include("ProcedureRequest:orderer").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: Search by subject - a patient
+ * Type: reference
+ * Path: ProcedureRequest.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="ProcedureRequest.subject", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Search by subject - a patient
+ * Type: reference
+ * Path: ProcedureRequest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcedureRequest:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ProcedureRequest:patient").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: Search by subject
+ * Type: reference
+ * Path: ProcedureRequest.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="ProcedureRequest.subject", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Search by subject
+ * Type: reference
+ * Path: ProcedureRequest.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcedureRequest:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ProcedureRequest:subject").toLocked(); + + /** + * Search parameter: performer + *

+ * Description: Who should perform the procedure
+ * Type: reference
+ * Path: ProcedureRequest.performer
+ *

+ */ + @SearchParamDefinition(name="performer", path="ProcedureRequest.performer", description="Who should perform the procedure", type="reference" ) + public static final String SP_PERFORMER = "performer"; + /** + * Fluent Client search parameter constant for performer + *

+ * Description: Who should perform the procedure
+ * Type: reference
+ * Path: ProcedureRequest.performer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcedureRequest:performer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("ProcedureRequest:performer").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Encounter request created during
+ * Type: reference
+ * Path: ProcedureRequest.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="ProcedureRequest.encounter", description="Encounter request created during", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Encounter request created during
+ * Type: reference
+ * Path: ProcedureRequest.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcedureRequest:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("ProcedureRequest:encounter").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: A unique identifier of the Procedure Request
+ * Type: token
+ * Path: ProcedureRequest.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ProcedureRequest.identifier", description="A unique identifier of the Procedure Request", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A unique identifier of the Procedure Request
+ * Type: token
+ * Path: ProcedureRequest.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcessRequest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcessRequest.java new file mode 100644 index 00000000000..2a8b6434fc2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcessRequest.java @@ -0,0 +1,1600 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. + */ +@ResourceDef(name="ProcessRequest", profile="http://hl7.org/fhir/Profile/ProcessRequest") +public class ProcessRequest extends DomainResource { + + public enum ActionList { + /** + * Cancel, reverse or nullify the target resource. + */ + CANCEL, + /** + * Check for previously un-read/ not-retrieved resources. + */ + POLL, + /** + * Re-process the target resource. + */ + REPROCESS, + /** + * Retrieve the processing status of the target resource. + */ + STATUS, + /** + * added to help the parsers + */ + NULL; + public static ActionList fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("cancel".equals(codeString)) + return CANCEL; + if ("poll".equals(codeString)) + return POLL; + if ("reprocess".equals(codeString)) + return REPROCESS; + if ("status".equals(codeString)) + return STATUS; + throw new FHIRException("Unknown ActionList code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CANCEL: return "cancel"; + case POLL: return "poll"; + case REPROCESS: return "reprocess"; + case STATUS: return "status"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CANCEL: return "http://hl7.org/fhir/actionlist"; + case POLL: return "http://hl7.org/fhir/actionlist"; + case REPROCESS: return "http://hl7.org/fhir/actionlist"; + case STATUS: return "http://hl7.org/fhir/actionlist"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CANCEL: return "Cancel, reverse or nullify the target resource."; + case POLL: return "Check for previously un-read/ not-retrieved resources."; + case REPROCESS: return "Re-process the target resource."; + case STATUS: return "Retrieve the processing status of the target resource."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CANCEL: return "Cancel, Reverse or Nullify"; + case POLL: return "Poll"; + case REPROCESS: return "Re-Process"; + case STATUS: return "Status Check"; + default: return "?"; + } + } + } + + public static class ActionListEnumFactory implements EnumFactory { + public ActionList fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("cancel".equals(codeString)) + return ActionList.CANCEL; + if ("poll".equals(codeString)) + return ActionList.POLL; + if ("reprocess".equals(codeString)) + return ActionList.REPROCESS; + if ("status".equals(codeString)) + return ActionList.STATUS; + throw new IllegalArgumentException("Unknown ActionList code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("cancel".equals(codeString)) + return new Enumeration(this, ActionList.CANCEL); + if ("poll".equals(codeString)) + return new Enumeration(this, ActionList.POLL); + if ("reprocess".equals(codeString)) + return new Enumeration(this, ActionList.REPROCESS); + if ("status".equals(codeString)) + return new Enumeration(this, ActionList.STATUS); + throw new FHIRException("Unknown ActionList code '"+codeString+"'"); + } + public String toCode(ActionList code) { + if (code == ActionList.CANCEL) + return "cancel"; + if (code == ActionList.POLL) + return "poll"; + if (code == ActionList.REPROCESS) + return "reprocess"; + if (code == ActionList.STATUS) + return "status"; + return "?"; + } + public String toSystem(ActionList code) { + return code.getSystem(); + } + } + + @Block() + public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A service line number. + */ + @Child(name = "sequenceLinkId", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequenceLinkId; + + private static final long serialVersionUID = -1598360600L; + + /** + * Constructor + */ + public ItemsComponent() { + super(); + } + + /** + * Constructor + */ + public ItemsComponent(IntegerType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public IntegerType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new IntegerType(); // bb + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemsComponent setSequenceLinkIdElement(IntegerType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new IntegerType(); + this.sequenceLinkId.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // IntegerType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422298666: // sequenceLinkId + this.sequenceLinkId = castToInteger(value); // IntegerType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequenceLinkId")) + this.sequenceLinkId = castToInteger(value); // IntegerType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // IntegerType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequenceLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.sequenceLinkId"); + } + else + return super.addChild(name); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareDeep(sequenceLinkId, o.sequenceLinkId, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ItemsComponent)) + return false; + ItemsComponent o = (ItemsComponent) other; + return compareValues(sequenceLinkId, o.sequenceLinkId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()); + } + + public String fhirType() { + return "ProcessRequest.item"; + + } + + } + + /** + * The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. + */ + @Child(name = "action", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="cancel | poll | reprocess | status", formalDefinition="The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest." ) + protected Enumeration action; + + /** + * The ProcessRequest business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The ProcessRequest business identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The organization which is the target of the request. + */ + @Child(name = "target", type = {Identifier.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Target of the request", formalDefinition="The organization which is the target of the request." ) + protected Type target; + + /** + * The practitioner who is responsible for the action specified in thise request. + */ + @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the action specified in thise request." ) + protected Type provider; + + /** + * The organization which is responsible for the action speccified in thise request. + */ + @Child(name = "organization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the action speccified in thise request." ) + protected Type organization; + + /** + * Reference of resource which is the target or subject of this action. + */ + @Child(name = "request", type = {Identifier.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource which is the target or subject of this action." ) + protected Type request; + + /** + * Reference of a prior response to resource which is the target or subject of this action. + */ + @Child(name = "response", type = {Identifier.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Response reference", formalDefinition="Reference of a prior response to resource which is the target or subject of this action." ) + protected Type response; + + /** + * If true remove all history excluding audit. + */ + @Child(name = "nullify", type = {BooleanType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Nullify", formalDefinition="If true remove all history excluding audit." ) + protected BooleanType nullify; + + /** + * A reference to supply which authenticates the process. + */ + @Child(name = "reference", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference number/string", formalDefinition="A reference to supply which authenticates the process." ) + protected StringType reference; + + /** + * List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. + */ + @Child(name = "item", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Items to re-adjudicate", formalDefinition="List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated." ) + protected List item; + + /** + * Names of resource types to include. + */ + @Child(name = "include", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Resource type(s) to exclude", formalDefinition="Names of resource types to exclude." ) + protected List exclude; + + /** + * A period of time during which the fulfilling resources would have been created. + */ + @Child(name = "period", type = {Period.class}, order=15, min=0, max=1, modifier=false, summary=true) + @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 = -1557088159L; + + /** + * Constructor + */ + public ProcessRequest() { + super(); + } + + /** + * Constructor + */ + public ProcessRequest(Enumeration action) { + super(); + this.action = action; + } + + /** + * @return {@link #action} (The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public Enumeration getActionElement() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.action"); + else if (Configuration.doAutoCreate()) + this.action = new Enumeration(new ActionListEnumFactory()); // bb + return this.action; + } + + public boolean hasActionElement() { + return this.action != null && !this.action.isEmpty(); + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public ProcessRequest setActionElement(Enumeration value) { + this.action = value; + return this; + } + + /** + * @return The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. + */ + public ActionList getAction() { + return this.action == null ? null : this.action.getValue(); + } + + /** + * @param value The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. + */ + public ProcessRequest setAction(ActionList value) { + if (this.action == null) + this.action = new Enumeration(new ActionListEnumFactory()); + this.action.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (The ProcessRequest business identifier.) + */ + 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 ProcessRequest business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ProcessRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 ProcessRequest setRuleset(Coding value) { + this.ruleset = 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 ProcessRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 ProcessRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public ProcessRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public ProcessRequest 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} (The organization which is the target of the request.) + */ + public Type getTarget() { + return this.target; + } + + /** + * @return {@link #target} (The organization which is the target of the request.) + */ + public Identifier getTargetIdentifier() throws FHIRException { + if (!(this.target instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Identifier) this.target; + } + + public boolean hasTargetIdentifier() { + return this.target instanceof Identifier; + } + + /** + * @return {@link #target} (The organization which is the target of the request.) + */ + public Reference getTargetReference() throws FHIRException { + if (!(this.target instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Reference) this.target; + } + + public boolean hasTargetReference() { + return this.target instanceof Reference; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The organization which is the target of the request.) + */ + public ProcessRequest setTarget(Type value) { + this.target = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the action specified in thise request.) + */ + public Type getProvider() { + return this.provider; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the action specified in thise request.) + */ + public Identifier getProviderIdentifier() throws FHIRException { + if (!(this.provider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Identifier) this.provider; + } + + public boolean hasProviderIdentifier() { + return this.provider instanceof Identifier; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the action specified in thise request.) + */ + public Reference getProviderReference() throws FHIRException { + if (!(this.provider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); + return (Reference) this.provider; + } + + public boolean hasProviderReference() { + return this.provider instanceof Reference; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the action specified in thise request.) + */ + public ProcessRequest setProvider(Type value) { + this.provider = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the action speccified in thise request.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The organization which is responsible for the action speccified in thise request.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The organization which is responsible for the action speccified in thise request.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the action speccified in thise request.) + */ + public ProcessRequest setOrganization(Type value) { + this.organization = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource which is the target or subject of this action.) + */ + public Type getRequest() { + return this.request; + } + + /** + * @return {@link #request} (Reference of resource which is the target or subject of this action.) + */ + public Identifier getRequestIdentifier() throws FHIRException { + if (!(this.request instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Identifier) this.request; + } + + public boolean hasRequestIdentifier() { + return this.request instanceof Identifier; + } + + /** + * @return {@link #request} (Reference of resource which is the target or subject of this action.) + */ + public Reference getRequestReference() throws FHIRException { + if (!(this.request instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Reference) this.request; + } + + public boolean hasRequestReference() { + return this.request instanceof Reference; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource which is the target or subject of this action.) + */ + public ProcessRequest setRequest(Type value) { + this.request = value; + return this; + } + + /** + * @return {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) + */ + public Type getResponse() { + return this.response; + } + + /** + * @return {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) + */ + public Identifier getResponseIdentifier() throws FHIRException { + if (!(this.response instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.response.getClass().getName()+" was encountered"); + return (Identifier) this.response; + } + + public boolean hasResponseIdentifier() { + return this.response instanceof Identifier; + } + + /** + * @return {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) + */ + public Reference getResponseReference() throws FHIRException { + if (!(this.response instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.response.getClass().getName()+" was encountered"); + return (Reference) this.response; + } + + public boolean hasResponseReference() { + return this.response instanceof Reference; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) + */ + public ProcessRequest setResponse(Type value) { + this.response = value; + return this; + } + + /** + * @return {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value + */ + public BooleanType getNullifyElement() { + if (this.nullify == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.nullify"); + else if (Configuration.doAutoCreate()) + this.nullify = new BooleanType(); // bb + return this.nullify; + } + + public boolean hasNullifyElement() { + return this.nullify != null && !this.nullify.isEmpty(); + } + + public boolean hasNullify() { + return this.nullify != null && !this.nullify.isEmpty(); + } + + /** + * @param value {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value + */ + public ProcessRequest setNullifyElement(BooleanType value) { + this.nullify = value; + return this; + } + + /** + * @return If true remove all history excluding audit. + */ + public boolean getNullify() { + return this.nullify == null || this.nullify.isEmpty() ? false : this.nullify.getValue(); + } + + /** + * @param value If true remove all history excluding audit. + */ + public ProcessRequest setNullify(boolean value) { + if (this.nullify == null) + this.nullify = new BooleanType(); + this.nullify.setValue(value); + return this; + } + + /** + * @return {@link #reference} (A reference to supply which authenticates the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public StringType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new StringType(); // bb + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (A reference to supply which authenticates the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public ProcessRequest setReferenceElement(StringType value) { + this.reference = value; + return this; + } + + /** + * @return A reference to supply which authenticates the process. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value A reference to supply which authenticates the process. + */ + public ProcessRequest setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new StringType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #item} (List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.) + */ + 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} (List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public ProcessRequest addItem(ItemsComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + /** + * @return {@link #include} (Names of resource types to include.) + */ + public List getInclude() { + if (this.include == null) + this.include = new ArrayList(); + return this.include; + } + + public boolean hasInclude() { + if (this.include == null) + return false; + for (StringType item : this.include) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #include} (Names of resource types to include.) + */ + // syntactic sugar + public StringType addIncludeElement() {//2 + StringType t = new StringType(); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return t; + } + + /** + * @param value {@link #include} (Names of resource types to include.) + */ + public ProcessRequest addInclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return this; + } + + /** + * @param value {@link #include} (Names of resource types to include.) + */ + public boolean hasInclude(String value) { + if (this.include == null) + return false; + for (StringType v : this.include) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #exclude} (Names of resource types to exclude.) + */ + public List getExclude() { + if (this.exclude == null) + this.exclude = new ArrayList(); + return this.exclude; + } + + public boolean hasExclude() { + if (this.exclude == null) + return false; + for (StringType item : this.exclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exclude} (Names of resource types to exclude.) + */ + // syntactic sugar + public StringType addExcludeElement() {//2 + StringType t = new StringType(); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return t; + } + + /** + * @param value {@link #exclude} (Names of resource types to exclude.) + */ + public ProcessRequest addExclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return this; + } + + /** + * @param value {@link #exclude} (Names of resource types to exclude.) + */ + public boolean hasExclude(String value) { + if (this.exclude == null) + return false; + for (StringType v : this.exclude) + if (v.equals(value)) // string + return true; + 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 ProcessRequest.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + 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 ProcessRequest setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("action", "code", "The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("identifier", "Identifier", "The ProcessRequest 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("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "The organization which is the target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the action specified in thise request.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the action speccified in thise request.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("request[x]", "Identifier|Reference(Any)", "Reference of resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response[x]", "Identifier|Reference(Any)", "Reference of a prior response to resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("nullify", "boolean", "If true remove all history excluding audit.", 0, java.lang.Integer.MAX_VALUE, nullify)); + childrenList.add(new Property("reference", "string", "A reference to supply which authenticates the process.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("item", "", "List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.", 0, java.lang.Integer.MAX_VALUE, item)); + 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // Enumeration + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type + case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Type + case -2001137643: /*nullify*/ return this.nullify == null ? new Base[0] : new Base[] {this.nullify}; // BooleanType + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // StringType + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent + case 1942574248: /*include*/ return this.include == null ? new Base[0] : this.include.toArray(new Base[this.include.size()]); // StringType + case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : this.exclude.toArray(new Base[this.exclude.size()]); // StringType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422950858: // action + this.action = new ActionListEnumFactory().fromType(value); // Enumeration + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case -880905839: // target + this.target = (Type) value; // Type + break; + case -987494927: // provider + this.provider = (Type) value; // Type + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case 1095692943: // request + this.request = (Type) value; // Type + break; + case -340323263: // response + this.response = (Type) value; // Type + break; + case -2001137643: // nullify + this.nullify = castToBoolean(value); // BooleanType + break; + case -925155509: // reference + this.reference = castToString(value); // StringType + break; + case 3242771: // item + this.getItem().add((ItemsComponent) value); // ItemsComponent + break; + case 1942574248: // include + this.getInclude().add(castToString(value)); // StringType + break; + case -1321148966: // exclude + this.getExclude().add(castToString(value)); // StringType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("action")) + this.action = new ActionListEnumFactory().fromType(value); // Enumeration + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("target[x]")) + this.target = (Type) value; // Type + else if (name.equals("provider[x]")) + this.provider = (Type) value; // Type + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("request[x]")) + this.request = (Type) value; // Type + else if (name.equals("response[x]")) + this.response = (Type) value; // Type + else if (name.equals("nullify")) + this.nullify = castToBoolean(value); // BooleanType + else if (name.equals("reference")) + this.reference = castToString(value); // StringType + else if (name.equals("item")) + this.getItem().add((ItemsComponent) value); + else if (name.equals("include")) + this.getInclude().add(castToString(value)); + else if (name.equals("exclude")) + this.getExclude().add(castToString(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422950858: throw new FHIRException("Cannot make property action as it is not a complex type"); // Enumeration + case -1618432855: return addIdentifier(); // Identifier + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -815579825: return getTarget(); // Type + case 2064698607: return getProvider(); // Type + case 1326483053: return getOrganization(); // Type + case 37106577: return getRequest(); // Type + case 1847549087: return getResponse(); // Type + case -2001137643: throw new FHIRException("Cannot make property nullify as it is not a complex type"); // BooleanType + case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // StringType + case 3242771: return addItem(); // ItemsComponent + case 1942574248: throw new FHIRException("Cannot make property include as it is not a complex type"); // StringType + case -1321148966: throw new FHIRException("Cannot make property exclude as it is not a complex type"); // StringType + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("action")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.action"); + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.created"); + } + else if (name.equals("targetIdentifier")) { + this.target = new Identifier(); + return this.target; + } + else if (name.equals("targetReference")) { + this.target = new Reference(); + return this.target; + } + else if (name.equals("providerIdentifier")) { + this.provider = new Identifier(); + return this.provider; + } + else if (name.equals("providerReference")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("requestIdentifier")) { + this.request = new Identifier(); + return this.request; + } + else if (name.equals("requestReference")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("responseIdentifier")) { + this.response = new Identifier(); + return this.response; + } + else if (name.equals("responseReference")) { + this.response = new Reference(); + return this.response; + } + else if (name.equals("nullify")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.nullify"); + } + else if (name.equals("reference")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.reference"); + } + else if (name.equals("item")) { + return addItem(); + } + else if (name.equals("include")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.include"); + } + else if (name.equals("exclude")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.exclude"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ProcessRequest"; + + } + + public ProcessRequest copy() { + ProcessRequest dst = new ProcessRequest(); + copyValues(dst); + dst.action = action == null ? null : action.copy(); + 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.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.nullify = nullify == null ? null : nullify.copy(); + dst.reference = reference == null ? null : reference.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (include != null) { + dst.include = new ArrayList(); + for (StringType i : include) + dst.include.add(i.copy()); + }; + if (exclude != null) { + dst.exclude = new ArrayList(); + for (StringType i : exclude) + dst.exclude.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected ProcessRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcessRequest)) + return false; + ProcessRequest o = (ProcessRequest) other; + return compareDeep(action, o.action, true) && compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) + && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) + && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) + && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) && compareDeep(nullify, o.nullify, true) + && compareDeep(reference, o.reference, true) && compareDeep(item, o.item, true) && compareDeep(include, o.include, true) + && compareDeep(exclude, o.exclude, true) && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcessRequest)) + return false; + ProcessRequest o = (ProcessRequest) other; + return compareValues(action, o.action, true) && compareValues(created, o.created, true) && compareValues(nullify, o.nullify, true) + && compareValues(reference, o.reference, true) && compareValues(include, o.include, true) && compareValues(exclude, o.exclude, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (action == null || action.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()) && (request == null || request.isEmpty()) + && (response == null || response.isEmpty()) && (nullify == null || nullify.isEmpty()) && (reference == null || reference.isEmpty()) + && (item == null || item.isEmpty()) && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) + && (period == null || period.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ProcessRequest; + } + + /** + * Search parameter: action + *

+ * Description: The action requested by this resource
+ * Type: token
+ * Path: ProcessRequest.action
+ *

+ */ + @SearchParamDefinition(name="action", path="ProcessRequest.action", description="The action requested by this resource", type="token" ) + public static final String SP_ACTION = "action"; + /** + * Fluent Client search parameter constant for action + *

+ * Description: The action requested by this resource
+ * Type: token
+ * Path: ProcessRequest.action
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTION); + + /** + * Search parameter: providerreference + *

+ * Description: The provider who regenerated this request
+ * Type: reference
+ * Path: ProcessRequest.providerReference
+ *

+ */ + @SearchParamDefinition(name="providerreference", path="ProcessRequest.provider.as(Reference)", description="The provider who regenerated this request", type="reference" ) + public static final String SP_PROVIDERREFERENCE = "providerreference"; + /** + * Fluent Client search parameter constant for providerreference + *

+ * Description: The provider who regenerated this request
+ * Type: reference
+ * Path: ProcessRequest.providerReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcessRequest:providerreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessRequest:providerreference").toLocked(); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The organization who generated this request
+ * Type: token
+ * Path: ProcessRequest.organizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="ProcessRequest.organization.as(Identifier)", description="The organization who generated this request", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The organization who generated this request
+ * Type: token
+ * Path: ProcessRequest.organizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: organizationreference + *

+ * Description: The organization who generated this request
+ * Type: reference
+ * Path: ProcessRequest.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="ProcessRequest.organization.as(Reference)", description="The organization who generated this request", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The organization who generated this request
+ * Type: reference
+ * Path: ProcessRequest.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcessRequest:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessRequest:organizationreference").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The business identifier of the ProcessRequest
+ * Type: token
+ * Path: ProcessRequest.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ProcessRequest.identifier", description="The business identifier of the ProcessRequest", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier of the ProcessRequest
+ * Type: token
+ * Path: ProcessRequest.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: provideridentifier + *

+ * Description: The provider who regenerated this request
+ * Type: token
+ * Path: ProcessRequest.providerIdentifier
+ *

+ */ + @SearchParamDefinition(name="provideridentifier", path="ProcessRequest.provider.as(Identifier)", description="The provider who regenerated this request", type="token" ) + public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; + /** + * Fluent Client search parameter constant for provideridentifier + *

+ * Description: The provider who regenerated this request
+ * Type: token
+ * Path: ProcessRequest.providerIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcessResponse.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcessResponse.java new file mode 100644 index 00000000000..402828130d1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ProcessResponse.java @@ -0,0 +1,1339 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * This resource provides processing status, errors and notes from the processing of a resource. + */ +@ResourceDef(name="ProcessResponse", profile="http://hl7.org/fhir/Profile/ProcessResponse") +public class ProcessResponse extends DomainResource { + + @Block() + public static class ProcessResponseNotesComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The note purpose: Print/Display. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Notes text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 129959202L; + + /** + * Constructor + */ + public ProcessResponseNotesComponent() { + super(); + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponseNotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public ProcessResponseNotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponseNotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public ProcessResponseNotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public ProcessResponseNotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("text")) + this.text = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.text"); + } + else + return super.addChild(name); + } + + public ProcessResponseNotesComponent copy() { + ProcessResponseNotesComponent dst = new ProcessResponseNotesComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcessResponseNotesComponent)) + return false; + ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; + return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcessResponseNotesComponent)) + return false; + ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; + return compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + public String fhirType() { + return "ProcessResponse.notes"; + + } + + } + + /** + * The Response business identifier. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) + protected List identifier; + + /** + * Original request resource reference. + */ + @Child(name = "request", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Request reference", formalDefinition="Original request resource reference." ) + protected Type request; + + /** + * Transaction status: error, complete, held. + */ + @Child(name = "outcome", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." ) + protected Coding outcome; + + /** + * A description of the status of the adjudication or processing. + */ + @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The organization who produced this adjudicated response. + */ + @Child(name = "organization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Authoring Organization", formalDefinition="The organization who produced this adjudicated response." ) + protected Type organization; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible Practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Type requestProvider; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Type requestOrganization; + + /** + * The form to be used for printing the content. + */ + @Child(name = "form", type = {Coding.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Suite of processing note or additional requirements is the processing has been held. + */ + @Child(name = "notes", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Notes", formalDefinition="Suite of processing note or additional requirements is the processing has been held." ) + protected List notes; + + /** + * Processing errors. + */ + @Child(name = "error", type = {Coding.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Error code", formalDefinition="Processing errors." ) + protected List error; + + private static final long serialVersionUID = -501204073L; + + /** + * Constructor + */ + public ProcessResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response business identifier.) + */ + 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 Response business identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ProcessResponse addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Type getRequest() { + return this.request; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Identifier getRequestIdentifier() throws FHIRException { + if (!(this.request instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Identifier) this.request; + } + + public boolean hasRequestIdentifier() { + return this.request instanceof Identifier; + } + + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequestReference() throws FHIRException { + if (!(this.request instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); + return (Reference) this.request; + } + + public boolean hasRequestReference() { + return this.request instanceof Reference; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public ProcessResponse setRequest(Type value) { + this.request = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete, held.) + */ + public Coding getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Coding(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete, held.) + */ + public ProcessResponse setOutcome(Coding value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ProcessResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication or processing. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication or processing. + */ + public ProcessResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 ProcessResponse setRuleset(Coding value) { + this.ruleset = 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 ProcessResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); // cc + 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 ProcessResponse 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 ProcessResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 ProcessResponse 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 ProcessResponse 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 #organization} (The organization who produced this adjudicated response.) + */ + public Type getOrganization() { + return this.organization; + } + + /** + * @return {@link #organization} (The organization who produced this adjudicated response.) + */ + public Identifier getOrganizationIdentifier() throws FHIRException { + if (!(this.organization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Identifier) this.organization; + } + + public boolean hasOrganizationIdentifier() { + return this.organization instanceof Identifier; + } + + /** + * @return {@link #organization} (The organization who produced this adjudicated response.) + */ + public Reference getOrganizationReference() throws FHIRException { + if (!(this.organization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); + return (Reference) this.organization; + } + + public boolean hasOrganizationReference() { + return this.organization instanceof Reference; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who produced this adjudicated response.) + */ + public ProcessResponse setOrganization(Type value) { + this.organization = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Type getRequestProvider() { + return this.requestProvider; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Identifier getRequestProviderIdentifier() throws FHIRException { + if (!(this.requestProvider instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); + return (Identifier) this.requestProvider; + } + + public boolean hasRequestProviderIdentifier() { + return this.requestProvider instanceof Identifier; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProviderReference() throws FHIRException { + if (!(this.requestProvider instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); + return (Reference) this.requestProvider; + } + + public boolean hasRequestProviderReference() { + return this.requestProvider instanceof Reference; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ProcessResponse setRequestProvider(Type value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Type getRequestOrganization() { + return this.requestOrganization; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Identifier getRequestOrganizationIdentifier() throws FHIRException { + if (!(this.requestOrganization instanceof Identifier)) + throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); + return (Identifier) this.requestOrganization; + } + + public boolean hasRequestOrganizationIdentifier() { + return this.requestOrganization instanceof Identifier; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganizationReference() throws FHIRException { + if (!(this.requestOrganization instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); + return (Reference) this.requestOrganization; + } + + public boolean hasRequestOrganizationReference() { + return this.requestOrganization instanceof Reference; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public ProcessResponse setRequestOrganization(Type value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); // cc + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public ProcessResponse setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (ProcessResponseNotesComponent item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) + */ + // syntactic sugar + public ProcessResponseNotesComponent addNotes() { //3 + ProcessResponseNotesComponent t = new ProcessResponseNotesComponent(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + // syntactic sugar + public ProcessResponse addNotes(ProcessResponseNotesComponent t) { //3 + if (t == null) + return this; + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @return {@link #error} (Processing errors.) + */ + public List getError() { + if (this.error == null) + this.error = new ArrayList(); + return this.error; + } + + public boolean hasError() { + if (this.error == null) + return false; + for (Coding item : this.error) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #error} (Processing errors.) + */ + // syntactic sugar + public Coding addError() { //3 + Coding t = new Coding(); + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return t; + } + + // syntactic sugar + public ProcessResponse addError(Coding t) { //3 + if (t == null) + return this; + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + 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("request[x]", "Identifier|Reference(Any)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "Coding", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome)); + 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("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[x]", "Identifier|Reference(Organization)", "The organization who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("requestProvider[x]", "Identifier|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[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("notes", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("error", "Coding", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Coding + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding + case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type + case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type + case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding + case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // ProcessResponseNotesComponent + case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1095692943: // request + this.request = (Type) value; // Type + break; + case -1106507950: // outcome + this.outcome = castToCoding(value); // Coding + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; + case 1548678118: // ruleset + this.ruleset = castToCoding(value); // Coding + break; + case 1089373397: // originalRuleset + this.originalRuleset = castToCoding(value); // Coding + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case 1178922291: // organization + this.organization = (Type) value; // Type + break; + case 1601527200: // requestProvider + this.requestProvider = (Type) value; // Type + break; + case 599053666: // requestOrganization + this.requestOrganization = (Type) value; // Type + break; + case 3148996: // form + this.form = castToCoding(value); // Coding + break; + case 105008833: // notes + this.getNotes().add((ProcessResponseNotesComponent) value); // ProcessResponseNotesComponent + break; + case 96784904: // error + this.getError().add(castToCoding(value)); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("request[x]")) + this.request = (Type) value; // Type + else if (name.equals("outcome")) + this.outcome = castToCoding(value); // Coding + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType + else if (name.equals("ruleset")) + this.ruleset = castToCoding(value); // Coding + else if (name.equals("originalRuleset")) + this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("organization[x]")) + this.organization = (Type) value; // Type + else if (name.equals("requestProvider[x]")) + this.requestProvider = (Type) value; // Type + else if (name.equals("requestOrganization[x]")) + this.requestOrganization = (Type) value; // Type + else if (name.equals("form")) + this.form = castToCoding(value); // Coding + else if (name.equals("notes")) + this.getNotes().add((ProcessResponseNotesComponent) value); + else if (name.equals("error")) + this.getError().add(castToCoding(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 37106577: return getRequest(); // Type + case -1106507950: return getOutcome(); // Coding + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType + case 1548678118: return getRuleset(); // Coding + case 1089373397: return getOriginalRuleset(); // Coding + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 1326483053: return getOrganization(); // Type + case -1694784800: return getRequestProvider(); // Type + case 818740190: return getRequestOrganization(); // Type + case 3148996: return getForm(); // Coding + case 105008833: return addNotes(); // ProcessResponseNotesComponent + case 96784904: return addError(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("requestIdentifier")) { + this.request = new Identifier(); + return this.request; + } + else if (name.equals("requestReference")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("outcome")) { + this.outcome = new Coding(); + return this.outcome; + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.disposition"); + } + else if (name.equals("ruleset")) { + this.ruleset = new Coding(); + return this.ruleset; + } + else if (name.equals("originalRuleset")) { + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.created"); + } + else if (name.equals("organizationIdentifier")) { + this.organization = new Identifier(); + return this.organization; + } + else if (name.equals("organizationReference")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("requestProviderIdentifier")) { + this.requestProvider = new Identifier(); + return this.requestProvider; + } + else if (name.equals("requestProviderReference")) { + this.requestProvider = new Reference(); + return this.requestProvider; + } + else if (name.equals("requestOrganizationIdentifier")) { + this.requestOrganization = new Identifier(); + return this.requestOrganization; + } + else if (name.equals("requestOrganizationReference")) { + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + else if (name.equals("form")) { + this.form = new Coding(); + return this.form; + } + else if (name.equals("notes")) { + return addNotes(); + } + else if (name.equals("error")) { + return addError(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ProcessResponse"; + + } + + public ProcessResponse copy() { + ProcessResponse dst = new ProcessResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.form = form == null ? null : form.copy(); + if (notes != null) { + dst.notes = new ArrayList(); + for (ProcessResponseNotesComponent i : notes) + dst.notes.add(i.copy()); + }; + if (error != null) { + dst.error = new ArrayList(); + for (Coding i : error) + dst.error.add(i.copy()); + }; + return dst; + } + + protected ProcessResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProcessResponse)) + return false; + ProcessResponse o = (ProcessResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) + && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(form, o.form, true) + && compareDeep(notes, o.notes, true) && compareDeep(error, o.error, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProcessResponse)) + return false; + ProcessResponse o = (ProcessResponse) other; + return compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true); + } + + public boolean isEmpty() { + 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()) + && (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 + public ResourceType getResourceType() { + return ResourceType.ProcessResponse; + } + + /** + * Search parameter: requestorganizationreference + *

+ * Description: The Organization who is responsible the request transaction
+ * Type: reference
+ * Path: ProcessResponse.requestOrganizationReference
+ *

+ */ + @SearchParamDefinition(name="requestorganizationreference", path="ProcessResponse.requestOrganization.as(Reference)", description="The Organization who is responsible the request transaction", type="reference" ) + public static final String SP_REQUESTORGANIZATIONREFERENCE = "requestorganizationreference"; + /** + * Fluent Client search parameter constant for requestorganizationreference + *

+ * Description: The Organization who is responsible the request transaction
+ * Type: reference
+ * Path: ProcessResponse.requestOrganizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcessResponse:requestorganizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessResponse:requestorganizationreference").toLocked(); + + /** + * Search parameter: requestorganizationidentifier + *

+ * Description: The Organization who is responsible the request transaction
+ * Type: token
+ * Path: ProcessResponse.requestOrganizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestorganizationidentifier", path="ProcessResponse.requestOrganization.as(Identifier)", description="The Organization who is responsible the request transaction", type="token" ) + public static final String SP_REQUESTORGANIZATIONIDENTIFIER = "requestorganizationidentifier"; + /** + * Fluent Client search parameter constant for requestorganizationidentifier + *

+ * Description: The Organization who is responsible the request transaction
+ * Type: token
+ * Path: ProcessResponse.requestOrganizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTORGANIZATIONIDENTIFIER); + + /** + * Search parameter: requestprovideridentifier + *

+ * Description: The Provider who is responsible the request transaction
+ * Type: token
+ * Path: ProcessResponse.requestProviderIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestprovideridentifier", path="ProcessResponse.requestProvider.as(Identifier)", description="The Provider who is responsible the request transaction", type="token" ) + public static final String SP_REQUESTPROVIDERIDENTIFIER = "requestprovideridentifier"; + /** + * Fluent Client search parameter constant for requestprovideridentifier + *

+ * Description: The Provider who is responsible the request transaction
+ * Type: token
+ * Path: ProcessResponse.requestProviderIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTPROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTPROVIDERIDENTIFIER); + + /** + * Search parameter: requestidentifier + *

+ * Description: The reference to the claim
+ * Type: token
+ * Path: ProcessResponse.requestIdentifier
+ *

+ */ + @SearchParamDefinition(name="requestidentifier", path="ProcessResponse.request.as(Identifier)", description="The reference to the claim", type="token" ) + public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; + /** + * Fluent Client search parameter constant for requestidentifier + *

+ * Description: The reference to the claim
+ * Type: token
+ * Path: ProcessResponse.requestIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); + + /** + * Search parameter: requestreference + *

+ * Description: The reference to the claim
+ * Type: reference
+ * Path: ProcessResponse.requestReference
+ *

+ */ + @SearchParamDefinition(name="requestreference", path="ProcessResponse.request.as(Reference)", description="The reference to the claim", type="reference" ) + public static final String SP_REQUESTREFERENCE = "requestreference"; + /** + * Fluent Client search parameter constant for requestreference + *

+ * Description: The reference to the claim
+ * Type: reference
+ * Path: ProcessResponse.requestReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcessResponse:requestreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessResponse:requestreference").toLocked(); + + /** + * Search parameter: organizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: ProcessResponse.organizationIdentifier
+ *

+ */ + @SearchParamDefinition(name="organizationidentifier", path="ProcessResponse.organization.as(Identifier)", description="The organization who generated this resource", type="token" ) + public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; + /** + * Fluent Client search parameter constant for organizationidentifier + *

+ * Description: The organization who generated this resource
+ * Type: token
+ * Path: ProcessResponse.organizationIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); + + /** + * Search parameter: requestproviderreference + *

+ * Description: The Provider who is responsible the request transaction
+ * Type: reference
+ * Path: ProcessResponse.requestProviderReference
+ *

+ */ + @SearchParamDefinition(name="requestproviderreference", path="ProcessResponse.requestProvider.as(Reference)", description="The Provider who is responsible the request transaction", type="reference" ) + public static final String SP_REQUESTPROVIDERREFERENCE = "requestproviderreference"; + /** + * Fluent Client search parameter constant for requestproviderreference + *

+ * Description: The Provider who is responsible the request transaction
+ * Type: reference
+ * Path: ProcessResponse.requestProviderReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTPROVIDERREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcessResponse:requestproviderreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessResponse:requestproviderreference").toLocked(); + + /** + * Search parameter: organizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: ProcessResponse.organizationReference
+ *

+ */ + @SearchParamDefinition(name="organizationreference", path="ProcessResponse.organization.as(Reference)", description="The organization who generated this resource", type="reference" ) + public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; + /** + * Fluent Client search parameter constant for organizationreference + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: ProcessResponse.organizationReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ProcessResponse:organizationreference". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessResponse:organizationreference").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The business identifier of the Explanation of Benefit
+ * Type: token
+ * Path: ProcessResponse.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ProcessResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The business identifier of the Explanation of Benefit
+ * Type: token
+ * Path: ProcessResponse.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Property.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Property.java new file mode 100644 index 00000000000..f1c7d597de5 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Property.java @@ -0,0 +1,140 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * A child element or property defined by the FHIR specification + * This class is defined as a helper class when iterating the + * children of an element in a generic fashion + * + * At present, iteration is only based on the specification, but + * this may be changed to allow profile based expression at a + * later date + * + * note: there's no point in creating one of these classes outside this package + */ +public class Property { + + /** + * The name of the property as found in the FHIR specification + */ + private String name; + + /** + * The type of the property as specified in the FHIR specification (e.g. type|type|Reference(Name|Name) + */ + private String typeCode; + + /** + * The formal definition of the element given in the FHIR specification + */ + private String definition; + + /** + * The minimum allowed cardinality - 0 or 1 when based on the specification + */ + private int minCardinality; + + /** + * The maximum allowed cardinality - 1 or MAX_INT when based on the specification + */ + private int maxCardinality; + + /** + * The actual elements that exist on this instance + */ + private List values = new ArrayList(); + + /** + * For run time, if/once a property is hooked up to it's definition + */ + private StructureDefinition structure; + + /** + * Internal constructor + */ + public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, Base value) { + super(); + this.name = name; + this.typeCode = typeCode; + this.definition = definition; + this.minCardinality = minCardinality; + this.maxCardinality = maxCardinality; + this.values.add(value); + } + + /** + * Internal constructor + */ + public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, List values) { + super(); + this.name = name; + this.typeCode = typeCode; + this.definition = definition; + this.minCardinality = minCardinality; + this.maxCardinality = maxCardinality; + if (values != null) + this.values.addAll(values); + } + + /** + * @return The name of this property in the FHIR Specification + */ + public String getName() { + return name; + } + + /** + * @return The stated type in the FHIR specification + */ + public String getTypeCode() { + return typeCode; + } + + /** + * @return The definition of this element in the FHIR spec + */ + public String getDefinition() { + return definition; + } + + /** + * @return the minimum cardinality for this element + */ + public int getMinCardinality() { + return minCardinality; + } + + /** + * @return the maximum cardinality for this element + */ + public int getMaxCardinality() { + return maxCardinality; + } + + /** + * @return the actual values - will only be 1 unless maximum cardinality == MAX_INT + */ + public List getValues() { + return values; + } + + public boolean hasValues() { + for (Base e : getValues()) + if (e != null) + return true; + return false; + } + + public StructureDefinition getStructure() { + return structure; + } + + public void setStructure(StructureDefinition structure) { + this.structure = structure; + } + + + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Protocol.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Protocol.java new file mode 100644 index 00000000000..f029670471c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Protocol.java @@ -0,0 +1,3927 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points. + */ +@ResourceDef(name="Protocol", profile="http://hl7.org/fhir/Profile/Protocol") +public class Protocol extends DomainResource { + + public enum ProtocolStatus { + /** + * This protocol is still under development + */ + DRAFT, + /** + * This protocol was authored for testing purposes (or education/evaluation/marketing) + */ + TESTING, + /** + * This protocol is undergoing review to check that it is ready for production use + */ + REVIEW, + /** + * This protocol is ready for use in production systems + */ + ACTIVE, + /** + * This protocol has been withdrawn and should no longer be used + */ + WITHDRAWN, + /** + * This protocol has been replaced and a different protocol should be used in its place + */ + SUPERSEDED, + /** + * added to help the parsers + */ + NULL; + public static ProtocolStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("testing".equals(codeString)) + return TESTING; + if ("review".equals(codeString)) + return REVIEW; + if ("active".equals(codeString)) + return ACTIVE; + if ("withdrawn".equals(codeString)) + return WITHDRAWN; + if ("superseded".equals(codeString)) + return SUPERSEDED; + throw new FHIRException("Unknown ProtocolStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case TESTING: return "testing"; + case REVIEW: return "review"; + case ACTIVE: return "active"; + case WITHDRAWN: return "withdrawn"; + case SUPERSEDED: return "superseded"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return "http://hl7.org/fhir/protocol-status"; + case TESTING: return "http://hl7.org/fhir/protocol-status"; + case REVIEW: return "http://hl7.org/fhir/protocol-status"; + case ACTIVE: return "http://hl7.org/fhir/protocol-status"; + case WITHDRAWN: return "http://hl7.org/fhir/protocol-status"; + case SUPERSEDED: return "http://hl7.org/fhir/protocol-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This protocol is still under development"; + case TESTING: return "This protocol was authored for testing purposes (or education/evaluation/marketing)"; + case REVIEW: return "This protocol is undergoing review to check that it is ready for production use"; + case ACTIVE: return "This protocol is ready for use in production systems"; + case WITHDRAWN: return "This protocol has been withdrawn and should no longer be used"; + case SUPERSEDED: return "This protocol has been replaced and a different protocol should be used in its place"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case TESTING: return "Testing"; + case REVIEW: return "Review"; + case ACTIVE: return "Active"; + case WITHDRAWN: return "Withdrawn"; + case SUPERSEDED: return "Superseded"; + default: return "?"; + } + } + } + + public static class ProtocolStatusEnumFactory implements EnumFactory { + public ProtocolStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ProtocolStatus.DRAFT; + if ("testing".equals(codeString)) + return ProtocolStatus.TESTING; + if ("review".equals(codeString)) + return ProtocolStatus.REVIEW; + if ("active".equals(codeString)) + return ProtocolStatus.ACTIVE; + if ("withdrawn".equals(codeString)) + return ProtocolStatus.WITHDRAWN; + if ("superseded".equals(codeString)) + return ProtocolStatus.SUPERSEDED; + throw new IllegalArgumentException("Unknown ProtocolStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return new Enumeration(this, ProtocolStatus.DRAFT); + if ("testing".equals(codeString)) + return new Enumeration(this, ProtocolStatus.TESTING); + if ("review".equals(codeString)) + return new Enumeration(this, ProtocolStatus.REVIEW); + if ("active".equals(codeString)) + return new Enumeration(this, ProtocolStatus.ACTIVE); + if ("withdrawn".equals(codeString)) + return new Enumeration(this, ProtocolStatus.WITHDRAWN); + if ("superseded".equals(codeString)) + return new Enumeration(this, ProtocolStatus.SUPERSEDED); + throw new FHIRException("Unknown ProtocolStatus code '"+codeString+"'"); + } + public String toCode(ProtocolStatus code) { + if (code == ProtocolStatus.DRAFT) + return "draft"; + if (code == ProtocolStatus.TESTING) + return "testing"; + if (code == ProtocolStatus.REVIEW) + return "review"; + if (code == ProtocolStatus.ACTIVE) + return "active"; + if (code == ProtocolStatus.WITHDRAWN) + return "withdrawn"; + if (code == ProtocolStatus.SUPERSEDED) + return "superseded"; + return "?"; + } + public String toSystem(ProtocolStatus code) { + return code.getSystem(); + } + } + + public enum ProtocolType { + /** + * The protocol describes the steps to manage a particular health condition including monitoring, treatment, mitigation and/or follow-up + */ + CONDITION, + /** + * The protocol describes the appropriate use of a particular device (medical device, software, etc.) + */ + DEVICE, + /** + * The protocol describes the appropriate use of a particular medication including indications for use, dosages, treatment cycles, etc. + */ + DRUG, + /** + * The protocol describes the set of steps to occur for study subjects enrolled in an interventional study + */ + STUDY, + /** + * added to help the parsers + */ + NULL; + public static ProtocolType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("condition".equals(codeString)) + return CONDITION; + if ("device".equals(codeString)) + return DEVICE; + if ("drug".equals(codeString)) + return DRUG; + if ("study".equals(codeString)) + return STUDY; + throw new FHIRException("Unknown ProtocolType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CONDITION: return "condition"; + case DEVICE: return "device"; + case DRUG: return "drug"; + case STUDY: return "study"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CONDITION: return "http://hl7.org/fhir/protocol-type"; + case DEVICE: return "http://hl7.org/fhir/protocol-type"; + case DRUG: return "http://hl7.org/fhir/protocol-type"; + case STUDY: return "http://hl7.org/fhir/protocol-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CONDITION: return "The protocol describes the steps to manage a particular health condition including monitoring, treatment, mitigation and/or follow-up"; + case DEVICE: return "The protocol describes the appropriate use of a particular device (medical device, software, etc.)"; + case DRUG: return "The protocol describes the appropriate use of a particular medication including indications for use, dosages, treatment cycles, etc."; + case STUDY: return "The protocol describes the set of steps to occur for study subjects enrolled in an interventional study"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CONDITION: return "Condition"; + case DEVICE: return "Device"; + case DRUG: return "Drug"; + case STUDY: return "Study"; + default: return "?"; + } + } + } + + public static class ProtocolTypeEnumFactory implements EnumFactory { + public ProtocolType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("condition".equals(codeString)) + return ProtocolType.CONDITION; + if ("device".equals(codeString)) + return ProtocolType.DEVICE; + if ("drug".equals(codeString)) + return ProtocolType.DRUG; + if ("study".equals(codeString)) + return ProtocolType.STUDY; + throw new IllegalArgumentException("Unknown ProtocolType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("condition".equals(codeString)) + return new Enumeration(this, ProtocolType.CONDITION); + if ("device".equals(codeString)) + return new Enumeration(this, ProtocolType.DEVICE); + if ("drug".equals(codeString)) + return new Enumeration(this, ProtocolType.DRUG); + if ("study".equals(codeString)) + return new Enumeration(this, ProtocolType.STUDY); + throw new FHIRException("Unknown ProtocolType code '"+codeString+"'"); + } + public String toCode(ProtocolType code) { + if (code == ProtocolType.CONDITION) + return "condition"; + if (code == ProtocolType.DEVICE) + return "device"; + if (code == ProtocolType.DRUG) + return "drug"; + if (code == ProtocolType.STUDY) + return "study"; + return "?"; + } + public String toSystem(ProtocolType code) { + return code.getSystem(); + } + } + + public enum ActivityDefinitionCategory { + /** + * To consume food of a specified nature + */ + DIET, + /** + * To consume/receive a drug, vaccine or other product + */ + DRUG, + /** + * To meet or communicate with the patient (in-patient, out-patient, phone call, etc.) + */ + ENCOUNTER, + /** + * To capture information about a patient (vitals, labs, diagnostic images, etc.) + */ + OBSERVATION, + /** + * To modify the patient in some way (surgery, physiotherapy, education, counseling, etc.) + */ + PROCEDURE, + /** + * 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 ActivityDefinitionCategory fromCode(String codeString) throws FHIRException { + 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 FHIRException("Unknown ActivityDefinitionCategory code '"+codeString+"'"); + } + 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 "http://hl7.org/fhir/activity-definition-category"; + case DRUG: return "http://hl7.org/fhir/activity-definition-category"; + case ENCOUNTER: return "http://hl7.org/fhir/activity-definition-category"; + case OBSERVATION: return "http://hl7.org/fhir/activity-definition-category"; + case PROCEDURE: return "http://hl7.org/fhir/activity-definition-category"; + case SUPPLY: return "http://hl7.org/fhir/activity-definition-category"; + case OTHER: return "http://hl7.org/fhir/activity-definition-category"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DIET: return "To consume food of a specified nature"; + case DRUG: return "To consume/receive a drug, vaccine or other product"; + case ENCOUNTER: return "To meet or communicate with the patient (in-patient, out-patient, phone call, etc.)"; + case OBSERVATION: return "To capture information about a patient (vitals, labs, diagnostic images, etc.)"; + case PROCEDURE: return "To modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)"; + case SUPPLY: return "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 ActivityDefinitionCategoryEnumFactory implements EnumFactory { + public ActivityDefinitionCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return ActivityDefinitionCategory.DIET; + if ("drug".equals(codeString)) + return ActivityDefinitionCategory.DRUG; + if ("encounter".equals(codeString)) + return ActivityDefinitionCategory.ENCOUNTER; + if ("observation".equals(codeString)) + return ActivityDefinitionCategory.OBSERVATION; + if ("procedure".equals(codeString)) + return ActivityDefinitionCategory.PROCEDURE; + if ("supply".equals(codeString)) + return ActivityDefinitionCategory.SUPPLY; + if ("other".equals(codeString)) + return ActivityDefinitionCategory.OTHER; + throw new IllegalArgumentException("Unknown ActivityDefinitionCategory code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return new Enumeration(this, ActivityDefinitionCategory.DIET); + if ("drug".equals(codeString)) + return new Enumeration(this, ActivityDefinitionCategory.DRUG); + if ("encounter".equals(codeString)) + return new Enumeration(this, ActivityDefinitionCategory.ENCOUNTER); + if ("observation".equals(codeString)) + return new Enumeration(this, ActivityDefinitionCategory.OBSERVATION); + if ("procedure".equals(codeString)) + return new Enumeration(this, ActivityDefinitionCategory.PROCEDURE); + if ("supply".equals(codeString)) + return new Enumeration(this, ActivityDefinitionCategory.SUPPLY); + if ("other".equals(codeString)) + return new Enumeration(this, ActivityDefinitionCategory.OTHER); + throw new FHIRException("Unknown ActivityDefinitionCategory code '"+codeString+"'"); + } + public String toCode(ActivityDefinitionCategory code) { + if (code == ActivityDefinitionCategory.DIET) + return "diet"; + if (code == ActivityDefinitionCategory.DRUG) + return "drug"; + if (code == ActivityDefinitionCategory.ENCOUNTER) + return "encounter"; + if (code == ActivityDefinitionCategory.OBSERVATION) + return "observation"; + if (code == ActivityDefinitionCategory.PROCEDURE) + return "procedure"; + if (code == ActivityDefinitionCategory.SUPPLY) + return "supply"; + if (code == ActivityDefinitionCategory.OTHER) + return "other"; + return "?"; + } + public String toSystem(ActivityDefinitionCategory code) { + return code.getSystem(); + } + } + + @Block() + public static class ProtocolStepComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Label for step. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Label for step", formalDefinition="Label for step." ) + protected StringType name; + + /** + * Human description of activity. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human description of activity", formalDefinition="Human description of activity." ) + protected StringType description; + + /** + * How long does step last? + */ + @Child(name = "duration", type = {Duration.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How long does step last?", formalDefinition="How long does step last?" ) + protected Duration duration; + + /** + * Rules prior to execution. + */ + @Child(name = "precondition", type = {}, order=4, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="Rules prior to execution", formalDefinition="Rules prior to execution." ) + protected ProtocolStepPreconditionComponent precondition; + + /** + * Indicates the conditions that must be met for activities that are part of this time point to terminate. + */ + @Child(name = "exit", type = {ProtocolStepPreconditionComponent.class}, order=5, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="Rules prior to completion", formalDefinition="Indicates the conditions that must be met for activities that are part of this time point to terminate." ) + protected ProtocolStepPreconditionComponent exit; + + /** + * First activity within timepoint. + */ + @Child(name = "firstActivity", type = {UriType.class}, order=6, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="First activity within timepoint", formalDefinition="First activity within timepoint." ) + protected UriType firstActivity; + + /** + * Activities that occur within timepoint. + */ + @Child(name = "activity", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) + @Description(shortDefinition="Activities that occur within timepoint", formalDefinition="Activities that occur within timepoint." ) + protected List activity; + + /** + * What happens next? + */ + @Child(name = "next", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="What happens next?", formalDefinition="What happens next?" ) + protected List next; + + private static final long serialVersionUID = 626452062L; + + /** + * Constructor + */ + public ProtocolStepComponent() { + super(); + } + + /** + * @return {@link #name} (Label for step.). 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 ProtocolStepComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Label for step.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ProtocolStepComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Label for step. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Label for step. + */ + public ProtocolStepComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Human description of activity.). 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 ProtocolStepComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of activity.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ProtocolStepComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human description of activity. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human description of activity. + */ + public ProtocolStepComponent 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 #duration} (How long does step last?) + */ + public Duration getDuration() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new Duration(); // cc + return this.duration; + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (How long does step last?) + */ + public ProtocolStepComponent setDuration(Duration value) { + this.duration = value; + return this; + } + + /** + * @return {@link #precondition} (Rules prior to execution.) + */ + public ProtocolStepPreconditionComponent getPrecondition() { + if (this.precondition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepComponent.precondition"); + else if (Configuration.doAutoCreate()) + this.precondition = new ProtocolStepPreconditionComponent(); // cc + return this.precondition; + } + + public boolean hasPrecondition() { + return this.precondition != null && !this.precondition.isEmpty(); + } + + /** + * @param value {@link #precondition} (Rules prior to execution.) + */ + public ProtocolStepComponent setPrecondition(ProtocolStepPreconditionComponent value) { + this.precondition = value; + return this; + } + + /** + * @return {@link #exit} (Indicates the conditions that must be met for activities that are part of this time point to terminate.) + */ + public ProtocolStepPreconditionComponent getExit() { + if (this.exit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepComponent.exit"); + else if (Configuration.doAutoCreate()) + this.exit = new ProtocolStepPreconditionComponent(); // cc + return this.exit; + } + + public boolean hasExit() { + return this.exit != null && !this.exit.isEmpty(); + } + + /** + * @param value {@link #exit} (Indicates the conditions that must be met for activities that are part of this time point to terminate.) + */ + public ProtocolStepComponent setExit(ProtocolStepPreconditionComponent value) { + this.exit = value; + return this; + } + + /** + * @return {@link #firstActivity} (First activity within timepoint.). This is the underlying object with id, value and extensions. The accessor "getFirstActivity" gives direct access to the value + */ + public UriType getFirstActivityElement() { + if (this.firstActivity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepComponent.firstActivity"); + else if (Configuration.doAutoCreate()) + this.firstActivity = new UriType(); // bb + return this.firstActivity; + } + + public boolean hasFirstActivityElement() { + return this.firstActivity != null && !this.firstActivity.isEmpty(); + } + + public boolean hasFirstActivity() { + return this.firstActivity != null && !this.firstActivity.isEmpty(); + } + + /** + * @param value {@link #firstActivity} (First activity within timepoint.). This is the underlying object with id, value and extensions. The accessor "getFirstActivity" gives direct access to the value + */ + public ProtocolStepComponent setFirstActivityElement(UriType value) { + this.firstActivity = value; + return this; + } + + /** + * @return First activity within timepoint. + */ + public String getFirstActivity() { + return this.firstActivity == null ? null : this.firstActivity.getValue(); + } + + /** + * @param value First activity within timepoint. + */ + public ProtocolStepComponent setFirstActivity(String value) { + if (Utilities.noString(value)) + this.firstActivity = null; + else { + if (this.firstActivity == null) + this.firstActivity = new UriType(); + this.firstActivity.setValue(value); + } + return this; + } + + /** + * @return {@link #activity} (Activities that occur within timepoint.) + */ + public List getActivity() { + if (this.activity == null) + this.activity = new ArrayList(); + return this.activity; + } + + public boolean hasActivity() { + if (this.activity == null) + return false; + for (ProtocolStepActivityComponent item : this.activity) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #activity} (Activities that occur within timepoint.) + */ + // syntactic sugar + public ProtocolStepActivityComponent addActivity() { //3 + ProtocolStepActivityComponent t = new ProtocolStepActivityComponent(); + if (this.activity == null) + this.activity = new ArrayList(); + this.activity.add(t); + return t; + } + + // syntactic sugar + public ProtocolStepComponent addActivity(ProtocolStepActivityComponent t) { //3 + if (t == null) + return this; + if (this.activity == null) + this.activity = new ArrayList(); + this.activity.add(t); + return this; + } + + /** + * @return {@link #next} (What happens next?) + */ + public List getNext() { + if (this.next == null) + this.next = new ArrayList(); + return this.next; + } + + public boolean hasNext() { + if (this.next == null) + return false; + for (ProtocolStepNextComponent item : this.next) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #next} (What happens next?) + */ + // syntactic sugar + public ProtocolStepNextComponent addNext() { //3 + ProtocolStepNextComponent t = new ProtocolStepNextComponent(); + if (this.next == null) + this.next = new ArrayList(); + this.next.add(t); + return t; + } + + // syntactic sugar + public ProtocolStepComponent addNext(ProtocolStepNextComponent t) { //3 + if (t == null) + return this; + if (this.next == null) + this.next = new ArrayList(); + this.next.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Label for step.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Human description of activity.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("duration", "Duration", "How long does step last?", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("precondition", "", "Rules prior to execution.", 0, java.lang.Integer.MAX_VALUE, precondition)); + childrenList.add(new Property("exit", "@Protocol.step.precondition", "Indicates the conditions that must be met for activities that are part of this time point to terminate.", 0, java.lang.Integer.MAX_VALUE, exit)); + childrenList.add(new Property("firstActivity", "uri", "First activity within timepoint.", 0, java.lang.Integer.MAX_VALUE, firstActivity)); + childrenList.add(new Property("activity", "", "Activities that occur within timepoint.", 0, java.lang.Integer.MAX_VALUE, activity)); + childrenList.add(new Property("next", "", "What happens next?", 0, java.lang.Integer.MAX_VALUE, next)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // Duration + case -650968616: /*precondition*/ return this.precondition == null ? new Base[0] : new Base[] {this.precondition}; // ProtocolStepPreconditionComponent + case 3127582: /*exit*/ return this.exit == null ? new Base[0] : new Base[] {this.exit}; // ProtocolStepPreconditionComponent + case 185563615: /*firstActivity*/ return this.firstActivity == null ? new Base[0] : new Base[] {this.firstActivity}; // UriType + case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : this.activity.toArray(new Base[this.activity.size()]); // ProtocolStepActivityComponent + case 3377907: /*next*/ return this.next == null ? new Base[0] : this.next.toArray(new Base[this.next.size()]); // ProtocolStepNextComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1992012396: // duration + this.duration = castToDuration(value); // Duration + break; + case -650968616: // precondition + this.precondition = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent + break; + case 3127582: // exit + this.exit = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent + break; + case 185563615: // firstActivity + this.firstActivity = castToUri(value); // UriType + break; + case -1655966961: // activity + this.getActivity().add((ProtocolStepActivityComponent) value); // ProtocolStepActivityComponent + break; + case 3377907: // next + this.getNext().add((ProtocolStepNextComponent) value); // ProtocolStepNextComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("duration")) + this.duration = castToDuration(value); // Duration + else if (name.equals("precondition")) + this.precondition = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent + else if (name.equals("exit")) + this.exit = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent + else if (name.equals("firstActivity")) + this.firstActivity = castToUri(value); // UriType + else if (name.equals("activity")) + this.getActivity().add((ProtocolStepActivityComponent) value); + else if (name.equals("next")) + this.getNext().add((ProtocolStepNextComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1992012396: return getDuration(); // Duration + case -650968616: return getPrecondition(); // ProtocolStepPreconditionComponent + case 3127582: return getExit(); // ProtocolStepPreconditionComponent + case 185563615: throw new FHIRException("Cannot make property firstActivity as it is not a complex type"); // UriType + case -1655966961: return addActivity(); // ProtocolStepActivityComponent + case 3377907: return addNext(); // ProtocolStepNextComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.name"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.description"); + } + else if (name.equals("duration")) { + this.duration = new Duration(); + return this.duration; + } + else if (name.equals("precondition")) { + this.precondition = new ProtocolStepPreconditionComponent(); + return this.precondition; + } + else if (name.equals("exit")) { + this.exit = new ProtocolStepPreconditionComponent(); + return this.exit; + } + else if (name.equals("firstActivity")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.firstActivity"); + } + else if (name.equals("activity")) { + return addActivity(); + } + else if (name.equals("next")) { + return addNext(); + } + else + return super.addChild(name); + } + + public ProtocolStepComponent copy() { + ProtocolStepComponent dst = new ProtocolStepComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.precondition = precondition == null ? null : precondition.copy(); + dst.exit = exit == null ? null : exit.copy(); + dst.firstActivity = firstActivity == null ? null : firstActivity.copy(); + if (activity != null) { + dst.activity = new ArrayList(); + for (ProtocolStepActivityComponent i : activity) + dst.activity.add(i.copy()); + }; + if (next != null) { + dst.next = new ArrayList(); + for (ProtocolStepNextComponent i : next) + dst.next.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProtocolStepComponent)) + return false; + ProtocolStepComponent o = (ProtocolStepComponent) other; + return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(duration, o.duration, true) + && compareDeep(precondition, o.precondition, true) && compareDeep(exit, o.exit, true) && compareDeep(firstActivity, o.firstActivity, true) + && compareDeep(activity, o.activity, true) && compareDeep(next, o.next, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProtocolStepComponent)) + return false; + ProtocolStepComponent o = (ProtocolStepComponent) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(firstActivity, o.firstActivity, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) + && (duration == null || duration.isEmpty()) && (precondition == null || precondition.isEmpty()) + && (exit == null || exit.isEmpty()) && (firstActivity == null || firstActivity.isEmpty()) + && (activity == null || activity.isEmpty()) && (next == null || next.isEmpty()); + } + + public String fhirType() { + return "Protocol.step"; + + } + + } + + @Block() + public static class ProtocolStepPreconditionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Human-readable description of the condition. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description of condition", formalDefinition="Human-readable description of the condition." ) + protected StringType description; + + /** + * Defines the name/value pair that must hold for the condition to be met. + */ + @Child(name = "condition", type = {}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Condition evaluated", formalDefinition="Defines the name/value pair that must hold for the condition to be met." ) + protected ProtocolStepPreconditionConditionComponent condition; + + /** + * Lists a set of conditions that must all be met. + */ + @Child(name = "intersection", type = {ProtocolStepPreconditionComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="And conditions", formalDefinition="Lists a set of conditions that must all be met." ) + protected List intersection; + + /** + * Lists alternative conditions, at least one of must be met. + */ + @Child(name = "union", type = {ProtocolStepPreconditionComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Or conditions", formalDefinition="Lists alternative conditions, at least one of must be met." ) + protected List union; + + /** + * Lists conditions of which none must be met. + */ + @Child(name = "exclude", type = {ProtocolStepPreconditionComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Not conditions", formalDefinition="Lists conditions of which none must be met." ) + protected List exclude; + + private static final long serialVersionUID = -1469954145L; + + /** + * Constructor + */ + public ProtocolStepPreconditionComponent() { + super(); + } + + /** + * @return {@link #description} (Human-readable description of the condition.). 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 ProtocolStepPreconditionComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 the condition.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ProtocolStepPreconditionComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of the condition. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of the condition. + */ + public ProtocolStepPreconditionComponent 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 #condition} (Defines the name/value pair that must hold for the condition to be met.) + */ + public ProtocolStepPreconditionConditionComponent getCondition() { + if (this.condition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepPreconditionComponent.condition"); + else if (Configuration.doAutoCreate()) + this.condition = new ProtocolStepPreconditionConditionComponent(); // cc + return this.condition; + } + + public boolean hasCondition() { + return this.condition != null && !this.condition.isEmpty(); + } + + /** + * @param value {@link #condition} (Defines the name/value pair that must hold for the condition to be met.) + */ + public ProtocolStepPreconditionComponent setCondition(ProtocolStepPreconditionConditionComponent value) { + this.condition = value; + return this; + } + + /** + * @return {@link #intersection} (Lists a set of conditions that must all be met.) + */ + public List getIntersection() { + if (this.intersection == null) + this.intersection = new ArrayList(); + return this.intersection; + } + + public boolean hasIntersection() { + if (this.intersection == null) + return false; + for (ProtocolStepPreconditionComponent item : this.intersection) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #intersection} (Lists a set of conditions that must all be met.) + */ + // syntactic sugar + public ProtocolStepPreconditionComponent addIntersection() { //3 + ProtocolStepPreconditionComponent t = new ProtocolStepPreconditionComponent(); + if (this.intersection == null) + this.intersection = new ArrayList(); + this.intersection.add(t); + return t; + } + + // syntactic sugar + public ProtocolStepPreconditionComponent addIntersection(ProtocolStepPreconditionComponent t) { //3 + if (t == null) + return this; + if (this.intersection == null) + this.intersection = new ArrayList(); + this.intersection.add(t); + return this; + } + + /** + * @return {@link #union} (Lists alternative conditions, at least one of must be met.) + */ + public List getUnion() { + if (this.union == null) + this.union = new ArrayList(); + return this.union; + } + + public boolean hasUnion() { + if (this.union == null) + return false; + for (ProtocolStepPreconditionComponent item : this.union) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #union} (Lists alternative conditions, at least one of must be met.) + */ + // syntactic sugar + public ProtocolStepPreconditionComponent addUnion() { //3 + ProtocolStepPreconditionComponent t = new ProtocolStepPreconditionComponent(); + if (this.union == null) + this.union = new ArrayList(); + this.union.add(t); + return t; + } + + // syntactic sugar + public ProtocolStepPreconditionComponent addUnion(ProtocolStepPreconditionComponent t) { //3 + if (t == null) + return this; + if (this.union == null) + this.union = new ArrayList(); + this.union.add(t); + return this; + } + + /** + * @return {@link #exclude} (Lists conditions of which none must be met.) + */ + public List getExclude() { + if (this.exclude == null) + this.exclude = new ArrayList(); + return this.exclude; + } + + public boolean hasExclude() { + if (this.exclude == null) + return false; + for (ProtocolStepPreconditionComponent item : this.exclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exclude} (Lists conditions of which none must be met.) + */ + // syntactic sugar + public ProtocolStepPreconditionComponent addExclude() { //3 + ProtocolStepPreconditionComponent t = new ProtocolStepPreconditionComponent(); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return t; + } + + // syntactic sugar + public ProtocolStepPreconditionComponent addExclude(ProtocolStepPreconditionComponent t) { //3 + if (t == null) + return this; + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "Human-readable description of the condition.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("condition", "", "Defines the name/value pair that must hold for the condition to be met.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("intersection", "@Protocol.step.precondition", "Lists a set of conditions that must all be met.", 0, java.lang.Integer.MAX_VALUE, intersection)); + childrenList.add(new Property("union", "@Protocol.step.precondition", "Lists alternative conditions, at least one of must be met.", 0, java.lang.Integer.MAX_VALUE, union)); + childrenList.add(new Property("exclude", "@Protocol.step.precondition", "Lists conditions of which none must be met.", 0, java.lang.Integer.MAX_VALUE, exclude)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // ProtocolStepPreconditionConditionComponent + case 169749129: /*intersection*/ return this.intersection == null ? new Base[0] : this.intersection.toArray(new Base[this.intersection.size()]); // ProtocolStepPreconditionComponent + case 111433423: /*union*/ return this.union == null ? new Base[0] : this.union.toArray(new Base[this.union.size()]); // ProtocolStepPreconditionComponent + case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : this.exclude.toArray(new Base[this.exclude.size()]); // ProtocolStepPreconditionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -861311717: // condition + this.condition = (ProtocolStepPreconditionConditionComponent) value; // ProtocolStepPreconditionConditionComponent + break; + case 169749129: // intersection + this.getIntersection().add((ProtocolStepPreconditionComponent) value); // ProtocolStepPreconditionComponent + break; + case 111433423: // union + this.getUnion().add((ProtocolStepPreconditionComponent) value); // ProtocolStepPreconditionComponent + break; + case -1321148966: // exclude + this.getExclude().add((ProtocolStepPreconditionComponent) value); // ProtocolStepPreconditionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("condition")) + this.condition = (ProtocolStepPreconditionConditionComponent) value; // ProtocolStepPreconditionConditionComponent + else if (name.equals("intersection")) + this.getIntersection().add((ProtocolStepPreconditionComponent) value); + else if (name.equals("union")) + this.getUnion().add((ProtocolStepPreconditionComponent) value); + else if (name.equals("exclude")) + this.getExclude().add((ProtocolStepPreconditionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -861311717: return getCondition(); // ProtocolStepPreconditionConditionComponent + case 169749129: return addIntersection(); // ProtocolStepPreconditionComponent + case 111433423: return addUnion(); // ProtocolStepPreconditionComponent + case -1321148966: return addExclude(); // ProtocolStepPreconditionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.description"); + } + else if (name.equals("condition")) { + this.condition = new ProtocolStepPreconditionConditionComponent(); + return this.condition; + } + else if (name.equals("intersection")) { + return addIntersection(); + } + else if (name.equals("union")) { + return addUnion(); + } + else if (name.equals("exclude")) { + return addExclude(); + } + else + return super.addChild(name); + } + + public ProtocolStepPreconditionComponent copy() { + ProtocolStepPreconditionComponent dst = new ProtocolStepPreconditionComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.condition = condition == null ? null : condition.copy(); + if (intersection != null) { + dst.intersection = new ArrayList(); + for (ProtocolStepPreconditionComponent i : intersection) + dst.intersection.add(i.copy()); + }; + if (union != null) { + dst.union = new ArrayList(); + for (ProtocolStepPreconditionComponent i : union) + dst.union.add(i.copy()); + }; + if (exclude != null) { + dst.exclude = new ArrayList(); + for (ProtocolStepPreconditionComponent i : exclude) + dst.exclude.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProtocolStepPreconditionComponent)) + return false; + ProtocolStepPreconditionComponent o = (ProtocolStepPreconditionComponent) other; + return compareDeep(description, o.description, true) && compareDeep(condition, o.condition, true) + && compareDeep(intersection, o.intersection, true) && compareDeep(union, o.union, true) && compareDeep(exclude, o.exclude, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProtocolStepPreconditionComponent)) + return false; + ProtocolStepPreconditionComponent o = (ProtocolStepPreconditionComponent) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (condition == null || condition.isEmpty()) + && (intersection == null || intersection.isEmpty()) && (union == null || union.isEmpty()) + && (exclude == null || exclude.isEmpty()); + } + + public String fhirType() { + return "Protocol.step.precondition"; + + } + + } + + @Block() + public static class ProtocolStepPreconditionConditionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of observation, test or other assertion being evaluated by the condition. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Observation / test / assertion", formalDefinition="The type of observation, test or other assertion being evaluated by the condition." ) + protected CodeableConcept type; + + /** + * Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied. + */ + @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, SimpleQuantity.class, Range.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Value needed to satisfy condition", formalDefinition="Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied." ) + protected Type value; + + private static final long serialVersionUID = -491121170L; + + /** + * Constructor + */ + public ProtocolStepPreconditionConditionComponent() { + super(); + } + + /** + * Constructor + */ + public ProtocolStepPreconditionConditionComponent(CodeableConcept type, Type value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (The type of observation, test or other assertion being evaluated by the condition.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepPreconditionConditionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of observation, test or other assertion being evaluated by the condition.) + */ + public ProtocolStepPreconditionConditionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) + */ + public CodeableConcept getValueCodeableConcept() throws FHIRException { + if (!(this.value instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + public boolean hasValueCodeableConcept() { + return this.value instanceof CodeableConcept; + } + + /** + * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) + */ + public BooleanType getValueBooleanType() throws FHIRException { + if (!(this.value instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + public boolean hasValueBooleanType() { + return this.value instanceof BooleanType; + } + + /** + * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) + */ + public SimpleQuantity getValueSimpleQuantity() throws FHIRException { + if (!(this.value instanceof SimpleQuantity)) + throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (SimpleQuantity) this.value; + } + + public boolean hasValueSimpleQuantity() { + return this.value instanceof SimpleQuantity; + } + + /** + * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) + */ + public Range getValueRange() throws FHIRException { + if (!(this.value instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Range) this.value; + } + + public boolean hasValueRange() { + return this.value instanceof Range; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) + */ + public ProtocolStepPreconditionConditionComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The type of observation, test or other assertion being evaluated by the condition.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value[x]", "CodeableConcept|boolean|SimpleQuantity|Range", "Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case 111972721: // value + this.value = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("value[x]")) + this.value = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // CodeableConcept + case -1410166417: return getValue(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueSimpleQuantity")) { + this.value = new SimpleQuantity(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else + return super.addChild(name); + } + + public ProtocolStepPreconditionConditionComponent copy() { + ProtocolStepPreconditionConditionComponent dst = new ProtocolStepPreconditionConditionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProtocolStepPreconditionConditionComponent)) + return false; + ProtocolStepPreconditionConditionComponent o = (ProtocolStepPreconditionConditionComponent) other; + return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProtocolStepPreconditionConditionComponent)) + return false; + ProtocolStepPreconditionConditionComponent o = (ProtocolStepPreconditionConditionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "Protocol.step.precondition.condition"; + + } + + } + + @Block() + public static class ProtocolStepActivityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * What can be done instead? + */ + @Child(name = "alternative", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) + @Description(shortDefinition="What can be done instead?", formalDefinition="What can be done instead?" ) + protected List alternative; + + /** + * Activities that are part of this activity. + */ + @Child(name = "component", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Activities that are part of this activity", formalDefinition="Activities that are part of this activity." ) + protected List component; + + /** + * What happens next. + */ + @Child(name = "following", type = {UriType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) + @Description(shortDefinition="What happens next", formalDefinition="What happens next." ) + protected List following; + + /** + * Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity. + */ + @Child(name = "wait", type = {Duration.class}, order=4, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="Pause before start", formalDefinition="Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity." ) + protected Duration wait; + + /** + * Information about the nature of the activity, including type, timing and other qualifiers. + */ + @Child(name = "detail", type = {}, order=5, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="Details of activity", formalDefinition="Information about the nature of the activity, including type, timing and other qualifiers." ) + protected ProtocolStepActivityDetailComponent detail; + + private static final long serialVersionUID = 1430131373L; + + /** + * Constructor + */ + public ProtocolStepActivityComponent() { + super(); + } + + /** + * Constructor + */ + public ProtocolStepActivityComponent(ProtocolStepActivityDetailComponent detail) { + super(); + this.detail = detail; + } + + /** + * @return {@link #alternative} (What can be done instead?) + */ + public List getAlternative() { + if (this.alternative == null) + this.alternative = new ArrayList(); + return this.alternative; + } + + public boolean hasAlternative() { + if (this.alternative == null) + return false; + for (UriType item : this.alternative) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #alternative} (What can be done instead?) + */ + // syntactic sugar + public UriType addAlternativeElement() {//2 + UriType t = new UriType(); + if (this.alternative == null) + this.alternative = new ArrayList(); + this.alternative.add(t); + return t; + } + + /** + * @param value {@link #alternative} (What can be done instead?) + */ + public ProtocolStepActivityComponent addAlternative(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.alternative == null) + this.alternative = new ArrayList(); + this.alternative.add(t); + return this; + } + + /** + * @param value {@link #alternative} (What can be done instead?) + */ + public boolean hasAlternative(String value) { + if (this.alternative == null) + return false; + for (UriType v : this.alternative) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #component} (Activities that are part of this activity.) + */ + public List getComponent() { + if (this.component == null) + this.component = new ArrayList(); + return this.component; + } + + public boolean hasComponent() { + if (this.component == null) + return false; + for (ProtocolStepActivityComponentComponent item : this.component) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #component} (Activities that are part of this activity.) + */ + // syntactic sugar + public ProtocolStepActivityComponentComponent addComponent() { //3 + ProtocolStepActivityComponentComponent t = new ProtocolStepActivityComponentComponent(); + if (this.component == null) + this.component = new ArrayList(); + this.component.add(t); + return t; + } + + // syntactic sugar + public ProtocolStepActivityComponent addComponent(ProtocolStepActivityComponentComponent t) { //3 + if (t == null) + return this; + if (this.component == null) + this.component = new ArrayList(); + this.component.add(t); + return this; + } + + /** + * @return {@link #following} (What happens next.) + */ + public List getFollowing() { + if (this.following == null) + this.following = new ArrayList(); + return this.following; + } + + public boolean hasFollowing() { + if (this.following == null) + return false; + for (UriType item : this.following) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #following} (What happens next.) + */ + // syntactic sugar + public UriType addFollowingElement() {//2 + UriType t = new UriType(); + if (this.following == null) + this.following = new ArrayList(); + this.following.add(t); + return t; + } + + /** + * @param value {@link #following} (What happens next.) + */ + public ProtocolStepActivityComponent addFollowing(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.following == null) + this.following = new ArrayList(); + this.following.add(t); + return this; + } + + /** + * @param value {@link #following} (What happens next.) + */ + public boolean hasFollowing(String value) { + if (this.following == null) + return false; + for (UriType v : this.following) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #wait} (Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity.) + */ + public Duration getWait() { + if (this.wait == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepActivityComponent.wait"); + else if (Configuration.doAutoCreate()) + this.wait = new Duration(); // cc + return this.wait; + } + + public boolean hasWait() { + return this.wait != null && !this.wait.isEmpty(); + } + + /** + * @param value {@link #wait} (Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity.) + */ + public ProtocolStepActivityComponent setWait(Duration value) { + this.wait = value; + return this; + } + + /** + * @return {@link #detail} (Information about the nature of the activity, including type, timing and other qualifiers.) + */ + public ProtocolStepActivityDetailComponent getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepActivityComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new ProtocolStepActivityDetailComponent(); // cc + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (Information about the nature of the activity, including type, timing and other qualifiers.) + */ + public ProtocolStepActivityComponent setDetail(ProtocolStepActivityDetailComponent value) { + this.detail = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("alternative", "uri", "What can be done instead?", 0, java.lang.Integer.MAX_VALUE, alternative)); + childrenList.add(new Property("component", "", "Activities that are part of this activity.", 0, java.lang.Integer.MAX_VALUE, component)); + childrenList.add(new Property("following", "uri", "What happens next.", 0, java.lang.Integer.MAX_VALUE, following)); + childrenList.add(new Property("wait", "Duration", "Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity.", 0, java.lang.Integer.MAX_VALUE, wait)); + childrenList.add(new Property("detail", "", "Information about the nature of the activity, including type, timing and other qualifiers.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -196794451: /*alternative*/ return this.alternative == null ? new Base[0] : this.alternative.toArray(new Base[this.alternative.size()]); // UriType + case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // ProtocolStepActivityComponentComponent + case 765915793: /*following*/ return this.following == null ? new Base[0] : this.following.toArray(new Base[this.following.size()]); // UriType + case 3641717: /*wait*/ return this.wait == null ? new Base[0] : new Base[] {this.wait}; // Duration + case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // ProtocolStepActivityDetailComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -196794451: // alternative + this.getAlternative().add(castToUri(value)); // UriType + break; + case -1399907075: // component + this.getComponent().add((ProtocolStepActivityComponentComponent) value); // ProtocolStepActivityComponentComponent + break; + case 765915793: // following + this.getFollowing().add(castToUri(value)); // UriType + break; + case 3641717: // wait + this.wait = castToDuration(value); // Duration + break; + case -1335224239: // detail + this.detail = (ProtocolStepActivityDetailComponent) value; // ProtocolStepActivityDetailComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("alternative")) + this.getAlternative().add(castToUri(value)); + else if (name.equals("component")) + this.getComponent().add((ProtocolStepActivityComponentComponent) value); + else if (name.equals("following")) + this.getFollowing().add(castToUri(value)); + else if (name.equals("wait")) + this.wait = castToDuration(value); // Duration + else if (name.equals("detail")) + this.detail = (ProtocolStepActivityDetailComponent) value; // ProtocolStepActivityDetailComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -196794451: throw new FHIRException("Cannot make property alternative as it is not a complex type"); // UriType + case -1399907075: return addComponent(); // ProtocolStepActivityComponentComponent + case 765915793: throw new FHIRException("Cannot make property following as it is not a complex type"); // UriType + case 3641717: return getWait(); // Duration + case -1335224239: return getDetail(); // ProtocolStepActivityDetailComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("alternative")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.alternative"); + } + else if (name.equals("component")) { + return addComponent(); + } + else if (name.equals("following")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.following"); + } + else if (name.equals("wait")) { + this.wait = new Duration(); + return this.wait; + } + else if (name.equals("detail")) { + this.detail = new ProtocolStepActivityDetailComponent(); + return this.detail; + } + else + return super.addChild(name); + } + + public ProtocolStepActivityComponent copy() { + ProtocolStepActivityComponent dst = new ProtocolStepActivityComponent(); + copyValues(dst); + if (alternative != null) { + dst.alternative = new ArrayList(); + for (UriType i : alternative) + dst.alternative.add(i.copy()); + }; + if (component != null) { + dst.component = new ArrayList(); + for (ProtocolStepActivityComponentComponent i : component) + dst.component.add(i.copy()); + }; + if (following != null) { + dst.following = new ArrayList(); + for (UriType i : following) + dst.following.add(i.copy()); + }; + dst.wait = wait == null ? null : wait.copy(); + dst.detail = detail == null ? null : detail.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProtocolStepActivityComponent)) + return false; + ProtocolStepActivityComponent o = (ProtocolStepActivityComponent) other; + return compareDeep(alternative, o.alternative, true) && compareDeep(component, o.component, true) + && compareDeep(following, o.following, true) && compareDeep(wait, o.wait, true) && compareDeep(detail, o.detail, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProtocolStepActivityComponent)) + return false; + ProtocolStepActivityComponent o = (ProtocolStepActivityComponent) other; + return compareValues(alternative, o.alternative, true) && compareValues(following, o.following, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (alternative == null || alternative.isEmpty()) && (component == null || component.isEmpty()) + && (following == null || following.isEmpty()) && (wait == null || wait.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + public String fhirType() { + return "Protocol.step.activity"; + + } + + } + + @Block() + public static class ProtocolStepActivityComponentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Order of occurrence. + */ + @Child(name = "sequence", type = {IntegerType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="Order of occurrence", formalDefinition="Order of occurrence." ) + protected IntegerType sequence; + + /** + * Component activity. + */ + @Child(name = "activity", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Component activity", formalDefinition="Component activity." ) + protected UriType activity; + + private static final long serialVersionUID = -856295616L; + + /** + * Constructor + */ + public ProtocolStepActivityComponentComponent() { + super(); + } + + /** + * Constructor + */ + public ProtocolStepActivityComponentComponent(UriType activity) { + super(); + this.activity = activity; + } + + /** + * @return {@link #sequence} (Order of occurrence.). 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 ProtocolStepActivityComponentComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); // bb + 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} (Order of occurrence.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ProtocolStepActivityComponentComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Order of occurrence. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value Order of occurrence. + */ + public ProtocolStepActivityComponentComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #activity} (Component activity.). This is the underlying object with id, value and extensions. The accessor "getActivity" gives direct access to the value + */ + public UriType getActivityElement() { + if (this.activity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepActivityComponentComponent.activity"); + else if (Configuration.doAutoCreate()) + this.activity = new UriType(); // bb + return this.activity; + } + + public boolean hasActivityElement() { + return this.activity != null && !this.activity.isEmpty(); + } + + public boolean hasActivity() { + return this.activity != null && !this.activity.isEmpty(); + } + + /** + * @param value {@link #activity} (Component activity.). This is the underlying object with id, value and extensions. The accessor "getActivity" gives direct access to the value + */ + public ProtocolStepActivityComponentComponent setActivityElement(UriType value) { + this.activity = value; + return this; + } + + /** + * @return Component activity. + */ + public String getActivity() { + return this.activity == null ? null : this.activity.getValue(); + } + + /** + * @param value Component activity. + */ + public ProtocolStepActivityComponentComponent setActivity(String value) { + if (this.activity == null) + this.activity = new UriType(); + this.activity.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Order of occurrence.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("activity", "uri", "Component activity.", 0, java.lang.Integer.MAX_VALUE, activity)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // IntegerType + case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToInteger(value); // IntegerType + break; + case -1655966961: // activity + this.activity = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToInteger(value); // IntegerType + else if (name.equals("activity")) + this.activity = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // IntegerType + case -1655966961: throw new FHIRException("Cannot make property activity as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.sequence"); + } + else if (name.equals("activity")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.activity"); + } + else + return super.addChild(name); + } + + public ProtocolStepActivityComponentComponent copy() { + ProtocolStepActivityComponentComponent dst = new ProtocolStepActivityComponentComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.activity = activity == null ? null : activity.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProtocolStepActivityComponentComponent)) + return false; + ProtocolStepActivityComponentComponent o = (ProtocolStepActivityComponentComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(activity, o.activity, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProtocolStepActivityComponentComponent)) + return false; + ProtocolStepActivityComponentComponent o = (ProtocolStepActivityComponentComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(activity, o.activity, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (activity == null || activity.isEmpty()) + ; + } + + public String fhirType() { + return "Protocol.step.activity.component"; + + } + + } + + @Block() + public static class ProtocolStepActivityDetailComponent extends BackboneElement implements IBaseBackboneElement { + /** + * High-level categorization of the type of activity. + */ + @Child(name = "category", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="diet | drug | encounter | observation +", formalDefinition="High-level categorization of the type of activity." ) + 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, modifier=false, summary=true) + @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 = "timing", type = {CodeableConcept.class, Timing.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) + protected Type timing; + + /** + * 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, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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, modifier=false, summary=true) + @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 at once (per dose, per meal, etc.). + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How much is administered/consumed/supplied", formalDefinition="Identifies the quantity expected to be consumed at once (per dose, per meal, etc.)." ) + protected SimpleQuantity 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 = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @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 description; + + private static final long serialVersionUID = 8207475L; + + /** + * Constructor + */ + public ProtocolStepActivityDetailComponent() { + super(); + } + + /** + * @return {@link #category} (High-level categorization of the type of activity.). 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 ProtocolStepActivityDetailComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new ActivityDefinitionCategoryEnumFactory()); // bb + 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.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public ProtocolStepActivityDetailComponent setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return High-level categorization of the type of activity. + */ + public ActivityDefinitionCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value High-level categorization of the type of activity. + */ + public ProtocolStepActivityDetailComponent setCategory(ActivityDefinitionCategory value) { + if (value == null) + this.category = null; + else { + if (this.category == null) + this.category = new Enumeration(new ActivityDefinitionCategoryEnumFactory()); + 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 ProtocolStepActivityDetailComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + 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 ProtocolStepActivityDetailComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.) + */ + public CodeableConcept getTimingCodeableConcept() throws FHIRException { + if (!(this.timing instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (CodeableConcept) this.timing; + } + + public boolean hasTimingCodeableConcept() { + return this.timing instanceof CodeableConcept; + } + + /** + * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Timing getTimingTiming() throws FHIRException { + if (!(this.timing instanceof Timing)) + throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + public boolean hasTimingTiming() { + return this.timing instanceof Timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The period, timing or frequency upon which the described activity is to occur.) + */ + public ProtocolStepActivityDetailComponent setTiming(Type value) { + this.timing = 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 ProtocolStepActivityDetailComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + 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 ProtocolStepActivityDetailComponent 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 ProtocolStepActivityDetailComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + 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 ProtocolStepActivityDetailComponent 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; + } + + // syntactic sugar + public ProtocolStepActivityDetailComponent addPerformer(Reference t) { //3 + if (t == null) + return this; + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return this; + } + + /** + * @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 ProtocolStepActivityDetailComponent.product"); + else if (Configuration.doAutoCreate()) + this.product = new Reference(); // cc + 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 ProtocolStepActivityDetailComponent 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 ProtocolStepActivityDetailComponent setProductTarget(Resource value) { + this.productTarget = value; + return this; + } + + /** + * @return {@link #quantity} (Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).) + */ + public ProtocolStepActivityDetailComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #description} (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 "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (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 "getDescription" gives direct access to the value + */ + public ProtocolStepActivityDetailComponent setDescriptionElement(StringType value) { + this.description = 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 getDescription() { + return this.description == null ? null : this.description.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 ProtocolStepActivityDetailComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "code", "High-level categorization of the type of activity.", 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("timing[x]", "CodeableConcept|Timing", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, timing)); + 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("quantity", "SimpleQuantity", "Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("description", "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, description)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference + case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Reference + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 50511102: // category + this.category = new ActivityDefinitionCategoryEnumFactory().fromType(value); // Enumeration + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -873664438: // timing + this.timing = (Type) value; // Type + break; + case 1901043637: // location + this.location = castToReference(value); // Reference + break; + case 481140686: // performer + this.getPerformer().add(castToReference(value)); // Reference + break; + case -309474065: // product + this.product = castToReference(value); // Reference + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("category")) + this.category = new ActivityDefinitionCategoryEnumFactory().fromType(value); // Enumeration + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("timing[x]")) + this.timing = (Type) value; // Type + else if (name.equals("location")) + this.location = castToReference(value); // Reference + else if (name.equals("performer")) + this.getPerformer().add(castToReference(value)); + else if (name.equals("product")) + this.product = castToReference(value); // Reference + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("description")) + this.description = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration + case 3059181: return getCode(); // CodeableConcept + case 164632566: return getTiming(); // Type + case 1901043637: return getLocation(); // Reference + case 481140686: return addPerformer(); // Reference + case -309474065: return getProduct(); // Reference + case -1285004149: return getQuantity(); // SimpleQuantity + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("category")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.category"); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("timingCodeableConcept")) { + this.timing = new CodeableConcept(); + return this.timing; + } + else if (name.equals("timingTiming")) { + this.timing = new Timing(); + return this.timing; + } + else if (name.equals("location")) { + this.location = new Reference(); + return this.location; + } + else if (name.equals("performer")) { + return addPerformer(); + } + else if (name.equals("product")) { + this.product = new Reference(); + return this.product; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.description"); + } + else + return super.addChild(name); + } + + public ProtocolStepActivityDetailComponent copy() { + ProtocolStepActivityDetailComponent dst = new ProtocolStepActivityDetailComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + dst.timing = timing == null ? null : timing.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.quantity = quantity == null ? null : quantity.copy(); + dst.description = description == null ? null : description.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProtocolStepActivityDetailComponent)) + return false; + ProtocolStepActivityDetailComponent o = (ProtocolStepActivityDetailComponent) other; + return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(timing, o.timing, true) + && compareDeep(location, o.location, true) && compareDeep(performer, o.performer, true) && compareDeep(product, o.product, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(description, o.description, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProtocolStepActivityDetailComponent)) + return false; + ProtocolStepActivityDetailComponent o = (ProtocolStepActivityDetailComponent) other; + return compareValues(category, o.category, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) + && (timing == null || timing.isEmpty()) && (location == null || location.isEmpty()) && (performer == null || performer.isEmpty()) + && (product == null || product.isEmpty()) && (quantity == null || quantity.isEmpty()) && (description == null || description.isEmpty()) + ; + } + + public String fhirType() { + return "Protocol.step.activity.detail"; + + } + + } + + @Block() + public static class ProtocolStepNextComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Description of what happens next. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description of what happens next", formalDefinition="Description of what happens next." ) + protected StringType description; + + /** + * Id of following step. + */ + @Child(name = "reference", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Id of following step", formalDefinition="Id of following step." ) + protected UriType reference; + + /** + * Condition in which next step is executed. + */ + @Child(name = "condition", type = {ProtocolStepPreconditionComponent.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Condition in which next step is executed", formalDefinition="Condition in which next step is executed." ) + protected ProtocolStepPreconditionComponent condition; + + private static final long serialVersionUID = -1343883194L; + + /** + * Constructor + */ + public ProtocolStepNextComponent() { + super(); + } + + /** + * @return {@link #description} (Description of what happens next.). 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 ProtocolStepNextComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Description of what happens next.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ProtocolStepNextComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Description of what happens next. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Description of what happens next. + */ + public ProtocolStepNextComponent 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 #reference} (Id of following step.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public UriType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepNextComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new UriType(); // bb + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Id of following step.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public ProtocolStepNextComponent setReferenceElement(UriType value) { + this.reference = value; + return this; + } + + /** + * @return Id of following step. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value Id of following step. + */ + public ProtocolStepNextComponent setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new UriType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #condition} (Condition in which next step is executed.) + */ + public ProtocolStepPreconditionComponent getCondition() { + if (this.condition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProtocolStepNextComponent.condition"); + else if (Configuration.doAutoCreate()) + this.condition = new ProtocolStepPreconditionComponent(); // cc + return this.condition; + } + + public boolean hasCondition() { + return this.condition != null && !this.condition.isEmpty(); + } + + /** + * @param value {@link #condition} (Condition in which next step is executed.) + */ + public ProtocolStepNextComponent setCondition(ProtocolStepPreconditionComponent value) { + this.condition = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "Description of what happens next.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("reference", "uri", "Id of following step.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("condition", "@Protocol.step.precondition", "Condition in which next step is executed.", 0, java.lang.Integer.MAX_VALUE, condition)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // ProtocolStepPreconditionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -925155509: // reference + this.reference = castToUri(value); // UriType + break; + case -861311717: // condition + this.condition = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("reference")) + this.reference = castToUri(value); // UriType + else if (name.equals("condition")) + this.condition = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // UriType + case -861311717: return getCondition(); // ProtocolStepPreconditionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.description"); + } + else if (name.equals("reference")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.reference"); + } + else if (name.equals("condition")) { + this.condition = new ProtocolStepPreconditionComponent(); + return this.condition; + } + else + return super.addChild(name); + } + + public ProtocolStepNextComponent copy() { + ProtocolStepNextComponent dst = new ProtocolStepNextComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.condition = condition == null ? null : condition.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProtocolStepNextComponent)) + return false; + ProtocolStepNextComponent o = (ProtocolStepNextComponent) other; + return compareDeep(description, o.description, true) && compareDeep(reference, o.reference, true) + && compareDeep(condition, o.condition, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProtocolStepNextComponent)) + return false; + ProtocolStepNextComponent o = (ProtocolStepNextComponent) other; + return compareValues(description, o.description, true) && compareValues(reference, o.reference, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (reference == null || reference.isEmpty()) + && (condition == null || condition.isEmpty()); + } + + public String fhirType() { + return "Protocol.step.next"; + + } + + } + + /** + * A unique identifier for the protocol instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique Id for this particular protocol", formalDefinition="A unique identifier for the protocol instance." ) + protected List identifier; + + /** + * Name of protocol. + */ + @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of protocol", formalDefinition="Name of protocol." ) + protected StringType title; + + /** + * The status of the protocol. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | testing | review | active | withdrawn | superseded", formalDefinition="The status of the protocol." ) + protected Enumeration status; + + /** + * A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes. + */ + @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="condition | device | drug | study", formalDefinition="A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes." ) + protected Enumeration type; + + /** + * What does protocol deal with? + */ + @Child(name = "subject", type = {Condition.class, Device.class, Medication.class}, order=4, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="What does protocol deal with?", formalDefinition="What does protocol deal with?" ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (What does protocol deal with?) + */ + protected Resource subjectTarget; + + /** + * To whom does Protocol apply? + */ + @Child(name = "group", type = {Group.class}, order=5, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="To whom does Protocol apply?", formalDefinition="To whom does Protocol apply?" ) + protected Reference group; + + /** + * The actual object that is the target of the reference (To whom does Protocol apply?) + */ + protected Group groupTarget; + + /** + * When is protocol to be used? + */ + @Child(name = "purpose", type = {StringType.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="When is protocol to be used?", formalDefinition="When is protocol to be used?" ) + protected StringType purpose; + + /** + * Who wrote protocol? + */ + @Child(name = "author", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who wrote protocol?", formalDefinition="Who wrote protocol?" ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Who wrote protocol?) + */ + protected Organization authorTarget; + + /** + * What's done as part of protocol. + */ + @Child(name = "step", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="What's done as part of protocol", formalDefinition="What's done as part of protocol." ) + protected List step; + + private static final long serialVersionUID = -1458830869L; + + /** + * Constructor + */ + public Protocol() { + super(); + } + + /** + * Constructor + */ + public Protocol(Enumeration status, Enumeration type, StringType purpose) { + super(); + this.status = status; + this.type = type; + this.purpose = purpose; + } + + /** + * @return {@link #identifier} (A unique identifier for the protocol instance.) + */ + 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} (A unique identifier for the protocol instance.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Protocol addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #title} (Name of protocol.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Protocol.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (Name of protocol.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public Protocol setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return Name of protocol. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value Name of protocol. + */ + public Protocol setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the protocol.). 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 Protocol.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ProtocolStatusEnumFactory()); // bb + 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 protocol.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Protocol setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the protocol. + */ + public ProtocolStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the protocol. + */ + public Protocol setStatus(ProtocolStatus value) { + if (this.status == null) + this.status = new Enumeration(new ProtocolStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #type} (A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes.). 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 Protocol.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new ProtocolTypeEnumFactory()); // bb + 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} (A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Protocol setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes. + */ + public ProtocolType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes. + */ + public Protocol setType(ProtocolType value) { + if (this.type == null) + this.type = new Enumeration(new ProtocolTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #subject} (What does protocol deal with?) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Protocol.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (What does protocol deal with?) + */ + public Protocol 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. (What does protocol deal with?) + */ + public Resource getSubjectTarget() { + 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. (What does protocol deal with?) + */ + public Protocol setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #group} (To whom does Protocol apply?) + */ + public Reference getGroup() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Protocol.group"); + else if (Configuration.doAutoCreate()) + this.group = new Reference(); // cc + return this.group; + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (To whom does Protocol apply?) + */ + public Protocol setGroup(Reference value) { + this.group = value; + return this; + } + + /** + * @return {@link #group} 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. (To whom does Protocol apply?) + */ + public Group getGroupTarget() { + if (this.groupTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Protocol.group"); + else if (Configuration.doAutoCreate()) + this.groupTarget = new Group(); // aa + return this.groupTarget; + } + + /** + * @param value {@link #group} 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. (To whom does Protocol apply?) + */ + public Protocol setGroupTarget(Group value) { + this.groupTarget = value; + return this; + } + + /** + * @return {@link #purpose} (When is protocol to be used?). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value + */ + public StringType getPurposeElement() { + if (this.purpose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Protocol.purpose"); + else if (Configuration.doAutoCreate()) + this.purpose = new StringType(); // bb + return this.purpose; + } + + public boolean hasPurposeElement() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + public boolean hasPurpose() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + /** + * @param value {@link #purpose} (When is protocol to be used?). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value + */ + public Protocol setPurposeElement(StringType value) { + this.purpose = value; + return this; + } + + /** + * @return When is protocol to be used? + */ + public String getPurpose() { + return this.purpose == null ? null : this.purpose.getValue(); + } + + /** + * @param value When is protocol to be used? + */ + public Protocol setPurpose(String value) { + if (this.purpose == null) + this.purpose = new StringType(); + this.purpose.setValue(value); + return this; + } + + /** + * @return {@link #author} (Who wrote protocol?) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Protocol.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Who wrote protocol?) + */ + public Protocol setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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. (Who wrote protocol?) + */ + public Organization getAuthorTarget() { + if (this.authorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Protocol.author"); + else if (Configuration.doAutoCreate()) + this.authorTarget = new Organization(); // aa + return this.authorTarget; + } + + /** + * @param value {@link #author} 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. (Who wrote protocol?) + */ + public Protocol setAuthorTarget(Organization value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #step} (What's done as part of protocol.) + */ + public List getStep() { + if (this.step == null) + this.step = new ArrayList(); + return this.step; + } + + public boolean hasStep() { + if (this.step == null) + return false; + for (ProtocolStepComponent item : this.step) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #step} (What's done as part of protocol.) + */ + // syntactic sugar + public ProtocolStepComponent addStep() { //3 + ProtocolStepComponent t = new ProtocolStepComponent(); + if (this.step == null) + this.step = new ArrayList(); + this.step.add(t); + return t; + } + + // syntactic sugar + public Protocol addStep(ProtocolStepComponent t) { //3 + if (t == null) + return this; + if (this.step == null) + this.step = new ArrayList(); + this.step.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the protocol instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("title", "string", "Name of protocol.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("status", "code", "The status of the protocol.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "code", "A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subject", "Reference(Condition|Device|Medication)", "What does protocol deal with?", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("group", "Reference(Group)", "To whom does Protocol apply?", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("purpose", "string", "When is protocol to be used?", 0, java.lang.Integer.MAX_VALUE, purpose)); + childrenList.add(new Property("author", "Reference(Organization)", "Who wrote protocol?", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("step", "", "What's done as part of protocol.", 0, java.lang.Integer.MAX_VALUE, step)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 98629247: /*group*/ return this.group == null ? new Base[0] : new Base[] {this.group}; // Reference + case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // StringType + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case 3540684: /*step*/ return this.step == null ? new Base[0] : this.step.toArray(new Base[this.step.size()]); // ProtocolStepComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ProtocolStatusEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = new ProtocolTypeEnumFactory().fromType(value); // Enumeration + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 98629247: // group + this.group = castToReference(value); // Reference + break; + case -220463842: // purpose + this.purpose = castToString(value); // StringType + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case 3540684: // step + this.getStep().add((ProtocolStepComponent) value); // ProtocolStepComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ProtocolStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = new ProtocolTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("group")) + this.group = castToReference(value); // Reference + else if (name.equals("purpose")) + this.purpose = castToString(value); // StringType + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("step")) + this.getStep().add((ProtocolStepComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -1867885268: return getSubject(); // Reference + case 98629247: return getGroup(); // Reference + case -220463842: throw new FHIRException("Cannot make property purpose as it is not a complex type"); // StringType + case -1406328437: return getAuthor(); // Reference + case 3540684: return addStep(); // ProtocolStepComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.title"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.status"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.type"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("group")) { + this.group = new Reference(); + return this.group; + } + else if (name.equals("purpose")) { + throw new FHIRException("Cannot call addChild on a primitive type Protocol.purpose"); + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("step")) { + return addStep(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Protocol"; + + } + + public Protocol copy() { + Protocol dst = new Protocol(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.title = title == null ? null : title.copy(); + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.group = group == null ? null : group.copy(); + dst.purpose = purpose == null ? null : purpose.copy(); + dst.author = author == null ? null : author.copy(); + if (step != null) { + dst.step = new ArrayList(); + for (ProtocolStepComponent i : step) + dst.step.add(i.copy()); + }; + return dst; + } + + protected Protocol typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Protocol)) + return false; + Protocol o = (Protocol) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true) && compareDeep(status, o.status, true) + && compareDeep(type, o.type, true) && compareDeep(subject, o.subject, true) && compareDeep(group, o.group, true) + && compareDeep(purpose, o.purpose, true) && compareDeep(author, o.author, true) && compareDeep(step, o.step, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Protocol)) + return false; + Protocol o = (Protocol) other; + return compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(type, o.type, true) + && compareValues(purpose, o.purpose, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (title == null || title.isEmpty()) + && (status == null || status.isEmpty()) && (type == null || type.isEmpty()) && (subject == null || subject.isEmpty()) + && (group == null || group.isEmpty()) && (purpose == null || purpose.isEmpty()) && (author == null || author.isEmpty()) + && (step == null || step.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Protocol; + } + + /** + * Search parameter: subject + *

+ * Description: Protocols with specified subject
+ * Type: reference
+ * Path: Protocol.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Protocol.subject", description="Protocols with specified subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Protocols with specified subject
+ * Type: reference
+ * Path: Protocol.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Protocol:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Protocol:subject").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: The unique id for a particular protocol
+ * Type: token
+ * Path: Protocol.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Protocol.identifier", description="The unique id for a particular protocol", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The unique id for a particular protocol
+ * Type: token
+ * Path: Protocol.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Provenance.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Provenance.java new file mode 100644 index 00000000000..871ed941b09 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Provenance.java @@ -0,0 +1,2053 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. + */ +@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/Profile/Provenance") +public class Provenance extends DomainResource { + + public enum ProvenanceEntityRole { + /** + * 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. + */ + DERIVATION, + /** + * A derivation for which the resulting entity is a revised version of some original. + */ + REVISION, + /** + * The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author. + */ + QUOTATION, + /** + * A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight. + */ + SOURCE, + /** + * A derivation for which the entity is removed from accessibility usually through the use of the Delete operation. + */ + REMOVAL, + /** + * added to help the parsers + */ + NULL; + public static ProvenanceEntityRole fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("derivation".equals(codeString)) + return DERIVATION; + if ("revision".equals(codeString)) + return REVISION; + if ("quotation".equals(codeString)) + return QUOTATION; + if ("source".equals(codeString)) + return SOURCE; + if ("removal".equals(codeString)) + return REMOVAL; + throw new FHIRException("Unknown ProvenanceEntityRole code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DERIVATION: return "derivation"; + case REVISION: return "revision"; + case QUOTATION: return "quotation"; + case SOURCE: return "source"; + case REMOVAL: return "removal"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DERIVATION: return "http://hl7.org/fhir/provenance-entity-role"; + case REVISION: return "http://hl7.org/fhir/provenance-entity-role"; + case QUOTATION: return "http://hl7.org/fhir/provenance-entity-role"; + case SOURCE: return "http://hl7.org/fhir/provenance-entity-role"; + case REMOVAL: return "http://hl7.org/fhir/provenance-entity-role"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DERIVATION: return "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."; + case REVISION: return "A derivation for which the resulting entity is a revised version of some original."; + case QUOTATION: return "The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author."; + case SOURCE: return "A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight."; + case REMOVAL: return "A derivation for which the entity is removed from accessibility usually through the use of the Delete operation."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DERIVATION: return "Derivation"; + case REVISION: return "Revision"; + case QUOTATION: return "Quotation"; + case SOURCE: return "Source"; + case REMOVAL: return "Removal"; + default: return "?"; + } + } + } + + 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; + if ("derivation".equals(codeString)) + return ProvenanceEntityRole.DERIVATION; + if ("revision".equals(codeString)) + return ProvenanceEntityRole.REVISION; + if ("quotation".equals(codeString)) + return ProvenanceEntityRole.QUOTATION; + if ("source".equals(codeString)) + return ProvenanceEntityRole.SOURCE; + if ("removal".equals(codeString)) + return ProvenanceEntityRole.REMOVAL; + throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("derivation".equals(codeString)) + return new Enumeration(this, ProvenanceEntityRole.DERIVATION); + if ("revision".equals(codeString)) + return new Enumeration(this, ProvenanceEntityRole.REVISION); + if ("quotation".equals(codeString)) + return new Enumeration(this, ProvenanceEntityRole.QUOTATION); + if ("source".equals(codeString)) + return new Enumeration(this, ProvenanceEntityRole.SOURCE); + if ("removal".equals(codeString)) + return new Enumeration(this, ProvenanceEntityRole.REMOVAL); + throw new FHIRException("Unknown ProvenanceEntityRole code '"+codeString+"'"); + } + public String toCode(ProvenanceEntityRole code) { + if (code == ProvenanceEntityRole.DERIVATION) + return "derivation"; + if (code == ProvenanceEntityRole.REVISION) + return "revision"; + if (code == ProvenanceEntityRole.QUOTATION) + return "quotation"; + if (code == ProvenanceEntityRole.SOURCE) + return "source"; + if (code == ProvenanceEntityRole.REMOVAL) + return "removal"; + return "?"; + } + public String toSystem(ProvenanceEntityRole code) { + return code.getSystem(); + } + } + + @Block() + public static class ProvenanceAgentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The function of the agent with respect to the activity. + */ + @Child(name = "role", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What the agents involvement was", formalDefinition="The function of the agent with respect to the activity." ) + protected Coding role; + + /** + * The individual, device or organization that participated in the event. + */ + @Child(name = "actor", type = {Practitioner.class, RelatedPerson.class, Patient.class, Device.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Individual, device or organization playing role", formalDefinition="The individual, device or organization that participated in the event." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The individual, device or organization that participated in the event.) + */ + protected Resource actorTarget; + + /** + * The identity of the agent as known by the authorization system. + */ + @Child(name = "userId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Authorization-system identifier for the agent", formalDefinition="The identity of the agent as known by the authorization system." ) + protected Identifier userId; + + /** + * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest. + */ + @Child(name = "relatedAgent", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Track delegation between agents", formalDefinition="A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest." ) + protected List relatedAgent; + + private static final long serialVersionUID = 1792758952L; + + /** + * Constructor + */ + public ProvenanceAgentComponent() { + super(); + } + + /** + * Constructor + */ + public ProvenanceAgentComponent(Coding role) { + super(); + this.role = role; + } + + /** + * @return {@link #role} (The function of the agent with respect to the activity.) + */ + public Coding getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Coding(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (The function of the agent with respect to the activity.) + */ + public ProvenanceAgentComponent setRole(Coding value) { + this.role = value; + return this; + } + + /** + * @return {@link #actor} (The individual, device or organization that participated in the event.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The individual, device or organization that participated in the event.) + */ + public ProvenanceAgentComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 individual, device or organization that participated in the event.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 individual, device or organization that participated in the event.) + */ + public ProvenanceAgentComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #userId} (The identity of the agent as known by the authorization system.) + */ + public Identifier getUserId() { + if (this.userId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.userId"); + else if (Configuration.doAutoCreate()) + this.userId = new Identifier(); // cc + return this.userId; + } + + public boolean hasUserId() { + return this.userId != null && !this.userId.isEmpty(); + } + + /** + * @param value {@link #userId} (The identity of the agent as known by the authorization system.) + */ + public ProvenanceAgentComponent setUserId(Identifier value) { + this.userId = value; + return this; + } + + /** + * @return {@link #relatedAgent} (A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest.) + */ + public List getRelatedAgent() { + if (this.relatedAgent == null) + this.relatedAgent = new ArrayList(); + return this.relatedAgent; + } + + public boolean hasRelatedAgent() { + if (this.relatedAgent == null) + return false; + for (ProvenanceAgentRelatedAgentComponent item : this.relatedAgent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relatedAgent} (A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest.) + */ + // syntactic sugar + public ProvenanceAgentRelatedAgentComponent addRelatedAgent() { //3 + ProvenanceAgentRelatedAgentComponent t = new ProvenanceAgentRelatedAgentComponent(); + if (this.relatedAgent == null) + this.relatedAgent = new ArrayList(); + this.relatedAgent.add(t); + return t; + } + + // syntactic sugar + public ProvenanceAgentComponent addRelatedAgent(ProvenanceAgentRelatedAgentComponent t) { //3 + if (t == null) + return this; + if (this.relatedAgent == null) + this.relatedAgent = new ArrayList(); + this.relatedAgent.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "Coding", "The function of the agent with respect to the activity.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("actor", "Reference(Practitioner|RelatedPerson|Patient|Device|Organization)", "The individual, device or organization that participated in the event.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("userId", "Identifier", "The identity of the agent as known by the authorization system.", 0, java.lang.Integer.MAX_VALUE, userId)); + childrenList.add(new Property("relatedAgent", "", "A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest.", 0, java.lang.Integer.MAX_VALUE, relatedAgent)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding + case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference + case -836030906: /*userId*/ return this.userId == null ? new Base[0] : new Base[] {this.userId}; // Identifier + case 126261658: /*relatedAgent*/ return this.relatedAgent == null ? new Base[0] : this.relatedAgent.toArray(new Base[this.relatedAgent.size()]); // ProvenanceAgentRelatedAgentComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3506294: // role + this.role = castToCoding(value); // Coding + break; + case 92645877: // actor + this.actor = castToReference(value); // Reference + break; + case -836030906: // userId + this.userId = castToIdentifier(value); // Identifier + break; + case 126261658: // relatedAgent + this.getRelatedAgent().add((ProvenanceAgentRelatedAgentComponent) value); // ProvenanceAgentRelatedAgentComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("role")) + this.role = castToCoding(value); // Coding + else if (name.equals("actor")) + this.actor = castToReference(value); // Reference + else if (name.equals("userId")) + this.userId = castToIdentifier(value); // Identifier + else if (name.equals("relatedAgent")) + this.getRelatedAgent().add((ProvenanceAgentRelatedAgentComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3506294: return getRole(); // Coding + case 92645877: return getActor(); // Reference + case -836030906: return getUserId(); // Identifier + case 126261658: return addRelatedAgent(); // ProvenanceAgentRelatedAgentComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("role")) { + this.role = new Coding(); + return this.role; + } + else if (name.equals("actor")) { + this.actor = new Reference(); + return this.actor; + } + else if (name.equals("userId")) { + this.userId = new Identifier(); + return this.userId; + } + else if (name.equals("relatedAgent")) { + return addRelatedAgent(); + } + else + return super.addChild(name); + } + + public ProvenanceAgentComponent copy() { + ProvenanceAgentComponent dst = new ProvenanceAgentComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.actor = actor == null ? null : actor.copy(); + dst.userId = userId == null ? null : userId.copy(); + if (relatedAgent != null) { + dst.relatedAgent = new ArrayList(); + for (ProvenanceAgentRelatedAgentComponent i : relatedAgent) + dst.relatedAgent.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProvenanceAgentComponent)) + return false; + ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; + return compareDeep(role, o.role, true) && compareDeep(actor, o.actor, true) && compareDeep(userId, o.userId, true) + && compareDeep(relatedAgent, o.relatedAgent, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProvenanceAgentComponent)) + return false; + ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (actor == null || actor.isEmpty()) + && (userId == null || userId.isEmpty()) && (relatedAgent == null || relatedAgent.isEmpty()) + ; + } + + public String fhirType() { + return "Provenance.agent"; + + } + + } + + @Block() + public static class ProvenanceAgentRelatedAgentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of relationship between agents. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of relationship between agents", formalDefinition="The type of relationship between agents." ) + protected CodeableConcept type; + + /** + * An internal reference to another agent listed in this provenance by its identifier. + */ + @Child(name = "target", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference to other agent in this resource by identifier", formalDefinition="An internal reference to another agent listed in this provenance by its identifier." ) + protected UriType target; + + private static final long serialVersionUID = 794181198L; + + /** + * Constructor + */ + public ProvenanceAgentRelatedAgentComponent() { + super(); + } + + /** + * Constructor + */ + public ProvenanceAgentRelatedAgentComponent(CodeableConcept type, UriType target) { + super(); + this.type = type; + this.target = target; + } + + /** + * @return {@link #type} (The type of relationship between agents.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentRelatedAgentComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of relationship between agents.) + */ + public ProvenanceAgentRelatedAgentComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #target} (An internal reference to another agent listed in this provenance by its identifier.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value + */ + public UriType getTargetElement() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentRelatedAgentComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new UriType(); // bb + return this.target; + } + + public boolean hasTargetElement() { + return this.target != null && !this.target.isEmpty(); + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (An internal reference to another agent listed in this provenance by its identifier.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value + */ + public ProvenanceAgentRelatedAgentComponent setTargetElement(UriType value) { + this.target = value; + return this; + } + + /** + * @return An internal reference to another agent listed in this provenance by its identifier. + */ + public String getTarget() { + return this.target == null ? null : this.target.getValue(); + } + + /** + * @param value An internal reference to another agent listed in this provenance by its identifier. + */ + public ProvenanceAgentRelatedAgentComponent setTarget(String value) { + if (this.target == null) + this.target = new UriType(); + this.target.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The type of relationship between agents.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("target", "uri", "An internal reference to another agent listed in this provenance by its identifier.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // UriType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -880905839: // target + this.target = castToUri(value); // UriType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("target")) + this.target = castToUri(value); // UriType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // CodeableConcept + case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // UriType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("target")) { + throw new FHIRException("Cannot call addChild on a primitive type Provenance.target"); + } + else + return super.addChild(name); + } + + public ProvenanceAgentRelatedAgentComponent copy() { + ProvenanceAgentRelatedAgentComponent dst = new ProvenanceAgentRelatedAgentComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProvenanceAgentRelatedAgentComponent)) + return false; + ProvenanceAgentRelatedAgentComponent o = (ProvenanceAgentRelatedAgentComponent) other; + return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProvenanceAgentRelatedAgentComponent)) + return false; + ProvenanceAgentRelatedAgentComponent o = (ProvenanceAgentRelatedAgentComponent) other; + return compareValues(target, o.target, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + public String fhirType() { + return "Provenance.agent.relatedAgent"; + + } + + } + + @Block() + public static class ProvenanceEntityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * How the entity was used during the activity. + */ + @Child(name = "role", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="derivation | revision | quotation | source | removal", formalDefinition="How the entity was used during the activity." ) + protected Enumeration role; + + /** + * The type of the entity. If the entity is a resource, then this is a resource type. + */ + @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The type of resource in this entity", formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type." ) + protected Coding type; + + /** + * Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + */ + @Child(name = "reference", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identity of entity", formalDefinition="Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative." ) + protected UriType reference; + + /** + * Human-readable description of the entity. + */ + @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human description of entity", formalDefinition="Human-readable description of the entity." ) + protected StringType display; + + /** + * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. + */ + @Child(name = "agent", type = {ProvenanceAgentComponent.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Entity is attributed to this agent", formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity." ) + protected ProvenanceAgentComponent agent; + + private static final long serialVersionUID = 1533729633L; + + /** + * Constructor + */ + public ProvenanceEntityComponent() { + super(); + } + + /** + * Constructor + */ + public ProvenanceEntityComponent(Enumeration role, Coding type, UriType reference) { + super(); + this.role = role; + this.type = type; + this.reference = reference; + } + + /** + * @return {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public Enumeration getRoleElement() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Enumeration(new ProvenanceEntityRoleEnumFactory()); // bb + return this.role; + } + + public boolean hasRoleElement() { + return this.role != null && !this.role.isEmpty(); + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public ProvenanceEntityComponent setRoleElement(Enumeration value) { + this.role = value; + return this; + } + + /** + * @return How the entity was used during the activity. + */ + public ProvenanceEntityRole getRole() { + return this.role == null ? null : this.role.getValue(); + } + + /** + * @param value How the entity was used during the activity. + */ + public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { + if (this.role == null) + this.role = new Enumeration(new ProvenanceEntityRoleEnumFactory()); + this.role.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) + */ + public ProvenanceEntityComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public UriType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new UriType(); // bb + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public ProvenanceEntityComponent setReferenceElement(UriType value) { + this.reference = value; + return this; + } + + /** + * @return Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + */ + public ProvenanceEntityComponent setReference(String value) { + if (this.reference == null) + this.reference = new UriType(); + this.reference.setValue(value); + return this; + } + + /** + * @return {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ProvenanceEntityComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Human-readable description of the entity. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Human-readable description of the entity. + */ + public ProvenanceEntityComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) + */ + public ProvenanceAgentComponent getAgent() { + if (this.agent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.agent"); + else if (Configuration.doAutoCreate()) + this.agent = new ProvenanceAgentComponent(); // cc + return this.agent; + } + + public boolean hasAgent() { + return this.agent != null && !this.agent.isEmpty(); + } + + /** + * @param value {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) + */ + public ProvenanceEntityComponent setAgent(ProvenanceAgentComponent value) { + this.agent = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "code", "How the entity was used during the activity.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("type", "Coding", "The type of the entity. If the entity is a resource, then this is a resource type.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reference", "uri", "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("display", "string", "Human-readable description of the entity.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("agent", "@Provenance.agent", "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 0, java.lang.Integer.MAX_VALUE, agent)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType + case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType + case 92750597: /*agent*/ return this.agent == null ? new Base[0] : new Base[] {this.agent}; // ProvenanceAgentComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3506294: // role + this.role = new ProvenanceEntityRoleEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case -925155509: // reference + this.reference = castToUri(value); // UriType + break; + case 1671764162: // display + this.display = castToString(value); // StringType + break; + case 92750597: // agent + this.agent = (ProvenanceAgentComponent) value; // ProvenanceAgentComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("role")) + this.role = new ProvenanceEntityRoleEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("reference")) + this.reference = castToUri(value); // UriType + else if (name.equals("display")) + this.display = castToString(value); // StringType + else if (name.equals("agent")) + this.agent = (ProvenanceAgentComponent) value; // ProvenanceAgentComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3506294: throw new FHIRException("Cannot make property role as it is not a complex type"); // Enumeration + case 3575610: return getType(); // Coding + case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // UriType + case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType + case 92750597: return getAgent(); // ProvenanceAgentComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("role")) { + throw new FHIRException("Cannot call addChild on a primitive type Provenance.role"); + } + else if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("reference")) { + throw new FHIRException("Cannot call addChild on a primitive type Provenance.reference"); + } + else if (name.equals("display")) { + throw new FHIRException("Cannot call addChild on a primitive type Provenance.display"); + } + else if (name.equals("agent")) { + this.agent = new ProvenanceAgentComponent(); + return this.agent; + } + else + return super.addChild(name); + } + + public ProvenanceEntityComponent copy() { + ProvenanceEntityComponent dst = new ProvenanceEntityComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.type = type == null ? null : type.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + dst.agent = agent == null ? null : agent.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ProvenanceEntityComponent)) + return false; + ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; + return compareDeep(role, o.role, true) && compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true) + && compareDeep(display, o.display, true) && compareDeep(agent, o.agent, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ProvenanceEntityComponent)) + return false; + ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; + return compareValues(role, o.role, true) && compareValues(reference, o.reference, true) && compareValues(display, o.display, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) + && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) && (agent == null || agent.isEmpty()) + ; + } + + public String fhirType() { + return "Provenance.entity"; + + } + + } + + /** + * The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. + */ + @Child(name = "target", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Target Reference(s) (usually version specific)", formalDefinition="The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity." ) + protected List target; + /** + * The actual objects that are the target of the reference (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + protected List targetTarget; + + + /** + * The period during which the activity occurred. + */ + @Child(name = "period", type = {Period.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." ) + protected Period period; + + /** + * The instant of time at which the activity was recorded. + */ + @Child(name = "recorded", type = {InstantType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the activity was recorded / updated", formalDefinition="The instant of time at which the activity was recorded." ) + protected InstantType recorded; + + /** + * The reason that the activity was taking place. + */ + @Child(name = "reason", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Reason the activity is occurring", formalDefinition="The reason that the activity was taking place." ) + protected List reason; + + /** + * An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities. + */ + @Child(name = "activity", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Activity that occurred", formalDefinition="An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities." ) + protected Coding activity; + + /** + * Where the activity occurred, if relevant. + */ + @Child(name = "location", type = {Location.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where the activity occurred, if relevant", formalDefinition="Where the activity occurred, if relevant." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Where the activity occurred, if relevant.) + */ + protected Location locationTarget; + + /** + * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. + */ + @Child(name = "policy", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Policy or plan the activity was defined by", formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc." ) + protected List policy; + + /** + * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. + */ + @Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Actor involved", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." ) + protected List agent; + + /** + * An entity used in this activity. + */ + @Child(name = "entity", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="An entity used in this activity", formalDefinition="An entity used in this activity." ) + protected List entity; + + /** + * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated. + */ + @Child(name = "signature", type = {Signature.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Signature on target", formalDefinition="A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated." ) + protected List signature; + + private static final long serialVersionUID = -436783145L; + + /** + * Constructor + */ + public Provenance() { + super(); + } + + /** + * Constructor + */ + public Provenance(InstantType recorded) { + super(); + this.recorded = recorded; + } + + /** + * @return {@link #target} (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (Reference item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + // syntactic sugar + public Reference addTarget() { //3 + Reference t = new Reference(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + // syntactic sugar + public Provenance addTarget(Reference t) { //3 + if (t == null) + return this; + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @return {@link #target} (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 Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + public List getTargetTarget() { + if (this.targetTarget == null) + this.targetTarget = new ArrayList(); + return this.targetTarget; + } + + /** + * @return {@link #period} (The period during which the activity occurred.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period during which the activity occurred.) + */ + public Provenance setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value + */ + public InstantType getRecordedElement() { + if (this.recorded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.recorded"); + else if (Configuration.doAutoCreate()) + this.recorded = new InstantType(); // bb + return this.recorded; + } + + public boolean hasRecordedElement() { + return this.recorded != null && !this.recorded.isEmpty(); + } + + public boolean hasRecorded() { + return this.recorded != null && !this.recorded.isEmpty(); + } + + /** + * @param value {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value + */ + public Provenance setRecordedElement(InstantType value) { + this.recorded = value; + return this; + } + + /** + * @return The instant of time at which the activity was recorded. + */ + 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(Date value) { + if (this.recorded == null) + this.recorded = new InstantType(); + this.recorded.setValue(value); + return this; + } + + /** + * @return {@link #reason} (The reason that the activity was taking place.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (Coding item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (The reason that the activity was taking place.) + */ + // syntactic sugar + public Coding addReason() { //3 + Coding t = new Coding(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + // syntactic sugar + public Provenance addReason(Coding t) { //3 + if (t == null) + return this; + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return this; + } + + /** + * @return {@link #activity} (An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.) + */ + public Coding getActivity() { + if (this.activity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.activity"); + else if (Configuration.doAutoCreate()) + this.activity = new Coding(); // cc + return this.activity; + } + + public boolean hasActivity() { + return this.activity != null && !this.activity.isEmpty(); + } + + /** + * @param value {@link #activity} (An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.) + */ + public Provenance setActivity(Coding value) { + this.activity = value; + return this; + } + + /** + * @return {@link #location} (Where the activity occurred, if relevant.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); // cc + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Where the activity occurred, if relevant.) + */ + public Provenance 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. (Where the activity occurred, if relevant.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); // aa + 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. (Where the activity occurred, if relevant.) + */ + public Provenance setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public List getPolicy() { + if (this.policy == null) + this.policy = new ArrayList(); + return this.policy; + } + + public boolean hasPolicy() { + if (this.policy == null) + return false; + for (UriType item : this.policy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + // syntactic sugar + public UriType addPolicyElement() {//2 + UriType t = new UriType(); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return t; + } + + /** + * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public Provenance addPolicy(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return this; + } + + /** + * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public boolean hasPolicy(String value) { + if (this.policy == null) + return false; + for (UriType v : this.policy) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) + */ + public List getAgent() { + if (this.agent == null) + this.agent = new ArrayList(); + return this.agent; + } + + public boolean hasAgent() { + if (this.agent == null) + return false; + for (ProvenanceAgentComponent item : this.agent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) + */ + // syntactic sugar + public ProvenanceAgentComponent addAgent() { //3 + ProvenanceAgentComponent t = new ProvenanceAgentComponent(); + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return t; + } + + // syntactic sugar + public Provenance addAgent(ProvenanceAgentComponent t) { //3 + if (t == null) + return this; + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return this; + } + + /** + * @return {@link #entity} (An entity used in this activity.) + */ + public List getEntity() { + if (this.entity == null) + this.entity = new ArrayList(); + return this.entity; + } + + public boolean hasEntity() { + if (this.entity == null) + return false; + for (ProvenanceEntityComponent item : this.entity) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entity} (An entity used in this activity.) + */ + // syntactic sugar + public ProvenanceEntityComponent addEntity() { //3 + ProvenanceEntityComponent t = new ProvenanceEntityComponent(); + if (this.entity == null) + this.entity = new ArrayList(); + this.entity.add(t); + return t; + } + + // syntactic sugar + public Provenance addEntity(ProvenanceEntityComponent t) { //3 + if (t == null) + return this; + if (this.entity == null) + this.entity = new ArrayList(); + this.entity.add(t); + return this; + } + + /** + * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.) + */ + public List getSignature() { + if (this.signature == null) + this.signature = new ArrayList(); + return this.signature; + } + + public boolean hasSignature() { + if (this.signature == null) + return false; + for (Signature item : this.signature) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.) + */ + // syntactic sugar + public Signature addSignature() { //3 + Signature t = new Signature(); + if (this.signature == null) + this.signature = new ArrayList(); + this.signature.add(t); + return t; + } + + // syntactic sugar + public Provenance addSignature(Signature t) { //3 + if (t == null) + return this; + if (this.signature == null) + this.signature = new ArrayList(); + this.signature.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("target", "Reference(Any)", "The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("period", "Period", "The period during which the activity occurred.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("recorded", "instant", "The instant of time at which the activity was recorded.", 0, java.lang.Integer.MAX_VALUE, recorded)); + childrenList.add(new Property("reason", "Coding", "The reason that the activity was taking place.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("activity", "Coding", "An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.", 0, java.lang.Integer.MAX_VALUE, activity)); + childrenList.add(new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("policy", "uri", "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.", 0, java.lang.Integer.MAX_VALUE, policy)); + childrenList.add(new Property("agent", "", "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, agent)); + childrenList.add(new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("signature", "Signature", "A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.", 0, java.lang.Integer.MAX_VALUE, signature)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // InstantType + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // Coding + case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // Coding + case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference + case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // UriType + case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // ProvenanceAgentComponent + case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : this.entity.toArray(new Base[this.entity.size()]); // ProvenanceEntityComponent + case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : this.signature.toArray(new Base[this.signature.size()]); // Signature + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -880905839: // target + this.getTarget().add(castToReference(value)); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -799233872: // recorded + this.recorded = castToInstant(value); // InstantType + break; + case -934964668: // reason + this.getReason().add(castToCoding(value)); // Coding + break; + case -1655966961: // activity + this.activity = castToCoding(value); // Coding + break; + case 1901043637: // location + this.location = castToReference(value); // Reference + break; + case -982670030: // policy + this.getPolicy().add(castToUri(value)); // UriType + break; + case 92750597: // agent + this.getAgent().add((ProvenanceAgentComponent) value); // ProvenanceAgentComponent + break; + case -1298275357: // entity + this.getEntity().add((ProvenanceEntityComponent) value); // ProvenanceEntityComponent + break; + case 1073584312: // signature + this.getSignature().add(castToSignature(value)); // Signature + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("target")) + this.getTarget().add(castToReference(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("recorded")) + this.recorded = castToInstant(value); // InstantType + else if (name.equals("reason")) + this.getReason().add(castToCoding(value)); + else if (name.equals("activity")) + this.activity = castToCoding(value); // Coding + else if (name.equals("location")) + this.location = castToReference(value); // Reference + else if (name.equals("policy")) + this.getPolicy().add(castToUri(value)); + else if (name.equals("agent")) + this.getAgent().add((ProvenanceAgentComponent) value); + else if (name.equals("entity")) + this.getEntity().add((ProvenanceEntityComponent) value); + else if (name.equals("signature")) + this.getSignature().add(castToSignature(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -880905839: return addTarget(); // Reference + case -991726143: return getPeriod(); // Period + case -799233872: throw new FHIRException("Cannot make property recorded as it is not a complex type"); // InstantType + case -934964668: return addReason(); // Coding + case -1655966961: return getActivity(); // Coding + case 1901043637: return getLocation(); // Reference + case -982670030: throw new FHIRException("Cannot make property policy as it is not a complex type"); // UriType + case 92750597: return addAgent(); // ProvenanceAgentComponent + case -1298275357: return addEntity(); // ProvenanceEntityComponent + case 1073584312: return addSignature(); // Signature + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("target")) { + return addTarget(); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("recorded")) { + throw new FHIRException("Cannot call addChild on a primitive type Provenance.recorded"); + } + else if (name.equals("reason")) { + return addReason(); + } + else if (name.equals("activity")) { + this.activity = new Coding(); + return this.activity; + } + else if (name.equals("location")) { + this.location = new Reference(); + return this.location; + } + else if (name.equals("policy")) { + throw new FHIRException("Cannot call addChild on a primitive type Provenance.policy"); + } + else if (name.equals("agent")) { + return addAgent(); + } + else if (name.equals("entity")) { + return addEntity(); + } + else if (name.equals("signature")) { + return addSignature(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Provenance"; + + } + + public Provenance copy() { + Provenance dst = new Provenance(); + copyValues(dst); + if (target != null) { + dst.target = new ArrayList(); + for (Reference i : target) + dst.target.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.recorded = recorded == null ? null : recorded.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (Coding i : reason) + dst.reason.add(i.copy()); + }; + dst.activity = activity == null ? null : activity.copy(); + dst.location = location == null ? null : location.copy(); + if (policy != null) { + dst.policy = new ArrayList(); + for (UriType i : policy) + dst.policy.add(i.copy()); + }; + if (agent != null) { + dst.agent = new ArrayList(); + for (ProvenanceAgentComponent i : agent) + dst.agent.add(i.copy()); + }; + if (entity != null) { + dst.entity = new ArrayList(); + for (ProvenanceEntityComponent i : entity) + dst.entity.add(i.copy()); + }; + if (signature != null) { + dst.signature = new ArrayList(); + for (Signature i : signature) + dst.signature.add(i.copy()); + }; + return dst; + } + + protected Provenance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Provenance)) + return false; + Provenance o = (Provenance) other; + return compareDeep(target, o.target, true) && compareDeep(period, o.period, true) && compareDeep(recorded, o.recorded, true) + && compareDeep(reason, o.reason, true) && compareDeep(activity, o.activity, true) && compareDeep(location, o.location, true) + && compareDeep(policy, o.policy, true) && compareDeep(agent, o.agent, true) && compareDeep(entity, o.entity, true) + && compareDeep(signature, o.signature, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Provenance)) + return false; + Provenance o = (Provenance) other; + return compareValues(recorded, o.recorded, true) && compareValues(policy, o.policy, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (target == null || target.isEmpty()) && (period == null || period.isEmpty()) + && (recorded == null || recorded.isEmpty()) && (reason == null || reason.isEmpty()) && (activity == null || activity.isEmpty()) + && (location == null || location.isEmpty()) && (policy == null || policy.isEmpty()) && (agent == null || agent.isEmpty()) + && (entity == null || entity.isEmpty()) && (signature == null || signature.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Provenance; + } + + /** + * Search parameter: patient + *

+ * Description: Target Reference(s) (usually version specific)
+ * Type: reference
+ * Path: Provenance.target
+ *

+ */ + @SearchParamDefinition(name="patient", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Target Reference(s) (usually version specific)
+ * Type: reference
+ * Path: Provenance.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Provenance:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Provenance:patient").toLocked(); + + /** + * Search parameter: location + *

+ * Description: Where the activity occurred, if relevant
+ * Type: reference
+ * Path: Provenance.location
+ *

+ */ + @SearchParamDefinition(name="location", path="Provenance.location", description="Where the activity occurred, if relevant", type="reference" ) + public static final String SP_LOCATION = "location"; + /** + * Fluent Client search parameter constant for location + *

+ * Description: Where the activity occurred, if relevant
+ * Type: reference
+ * Path: Provenance.location
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Provenance:location". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Provenance:location").toLocked(); + + /** + * Search parameter: start + *

+ * Description: Starting time with inclusive boundary
+ * Type: date
+ * Path: Provenance.period.start
+ *

+ */ + @SearchParamDefinition(name="start", path="Provenance.period.start", description="Starting time with inclusive boundary", type="date" ) + public static final String SP_START = "start"; + /** + * Fluent Client search parameter constant for start + *

+ * Description: Starting time with inclusive boundary
+ * Type: date
+ * Path: Provenance.period.start
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam START = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_START); + + /** + * Search parameter: entity + *

+ * Description: Identity of entity
+ * Type: uri
+ * Path: Provenance.entity.reference
+ *

+ */ + @SearchParamDefinition(name="entity", path="Provenance.entity.reference", description="Identity of entity", type="uri" ) + public static final String SP_ENTITY = "entity"; + /** + * Fluent Client search parameter constant for entity + *

+ * Description: Identity of entity
+ * Type: uri
+ * Path: Provenance.entity.reference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam ENTITY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_ENTITY); + + /** + * Search parameter: userid + *

+ * Description: Authorization-system identifier for the agent
+ * Type: token
+ * Path: Provenance.agent.userId
+ *

+ */ + @SearchParamDefinition(name="userid", path="Provenance.agent.userId", description="Authorization-system identifier for the agent", type="token" ) + public static final String SP_USERID = "userid"; + /** + * Fluent Client search parameter constant for userid + *

+ * Description: Authorization-system identifier for the agent
+ * Type: token
+ * Path: Provenance.agent.userId
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam USERID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USERID); + + /** + * Search parameter: target + *

+ * Description: Target Reference(s) (usually version specific)
+ * Type: reference
+ * Path: Provenance.target
+ *

+ */ + @SearchParamDefinition(name="target", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" ) + public static final String SP_TARGET = "target"; + /** + * Fluent Client search parameter constant for target + *

+ * Description: Target Reference(s) (usually version specific)
+ * Type: reference
+ * Path: Provenance.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Provenance:target". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("Provenance:target").toLocked(); + + /** + * Search parameter: entity-type + *

+ * Description: The type of resource in this entity
+ * Type: token
+ * Path: Provenance.entity.type
+ *

+ */ + @SearchParamDefinition(name="entity-type", path="Provenance.entity.type", description="The type of resource in this entity", type="token" ) + public static final String SP_ENTITY_TYPE = "entity-type"; + /** + * Fluent Client search parameter constant for entity-type + *

+ * Description: The type of resource in this entity
+ * Type: token
+ * Path: Provenance.entity.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_TYPE); + + /** + * Search parameter: agent + *

+ * Description: Individual, device or organization playing role
+ * Type: reference
+ * Path: Provenance.agent.actor
+ *

+ */ + @SearchParamDefinition(name="agent", path="Provenance.agent.actor", description="Individual, device or organization playing role", type="reference" ) + public static final String SP_AGENT = "agent"; + /** + * Fluent Client search parameter constant for agent + *

+ * Description: Individual, device or organization playing role
+ * Type: reference
+ * Path: Provenance.agent.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Provenance:agent". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include("Provenance:agent").toLocked(); + + /** + * Search parameter: end + *

+ * Description: End time with inclusive boundary, if not ongoing
+ * Type: date
+ * Path: Provenance.period.end
+ *

+ */ + @SearchParamDefinition(name="end", path="Provenance.period.end", description="End time with inclusive boundary, if not ongoing", type="date" ) + public static final String SP_END = "end"; + /** + * Fluent Client search parameter constant for end + *

+ * Description: End time with inclusive boundary, if not ongoing
+ * Type: date
+ * Path: Provenance.period.end
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam END = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_END); + + /** + * Search parameter: sig + *

+ * Description: Indication of the reason the entity signed the object(s)
+ * Type: token
+ * Path: Provenance.signature.type
+ *

+ */ + @SearchParamDefinition(name="sig", path="Provenance.signature.type", description="Indication of the reason the entity signed the object(s)", type="token" ) + public static final String SP_SIG = "sig"; + /** + * Fluent Client search parameter constant for sig + *

+ * Description: Indication of the reason the entity signed the object(s)
+ * Type: token
+ * Path: Provenance.signature.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SIG = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SIG); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Quantity.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Quantity.java new file mode 100644 index 00000000000..d55a8c3e2b8 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Quantity.java @@ -0,0 +1,672 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Quantity") +public class Quantity extends Type implements ICompositeType { + + public enum QuantityComparator { + /** + * The actual value is less than the given value. + */ + LESS_THAN, + /** + * The actual value is less than or equal to the given value. + */ + LESS_OR_EQUAL, + /** + * The actual value is greater than or equal to the given value. + */ + GREATER_OR_EQUAL, + /** + * The actual value is greater than the given value. + */ + GREATER_THAN, + /** + * added to help the parsers + */ + NULL; + public static QuantityComparator fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("<".equals(codeString)) + return LESS_THAN; + if ("<=".equals(codeString)) + return LESS_OR_EQUAL; + if (">=".equals(codeString)) + return GREATER_OR_EQUAL; + if (">".equals(codeString)) + return GREATER_THAN; + throw new FHIRException("Unknown QuantityComparator code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case LESS_THAN: return "<"; + case LESS_OR_EQUAL: return "<="; + case GREATER_OR_EQUAL: return ">="; + case GREATER_THAN: return ">"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LESS_THAN: return "http://hl7.org/fhir/quantity-comparator"; + case LESS_OR_EQUAL: return "http://hl7.org/fhir/quantity-comparator"; + case GREATER_OR_EQUAL: return "http://hl7.org/fhir/quantity-comparator"; + case GREATER_THAN: return "http://hl7.org/fhir/quantity-comparator"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LESS_THAN: return "The actual value is less than the given value."; + case LESS_OR_EQUAL: return "The actual value is less than or equal to the given value."; + case GREATER_OR_EQUAL: return "The actual value is greater than or equal to the given value."; + case GREATER_THAN: return "The actual value is greater than the given value."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LESS_THAN: return "Less than"; + case LESS_OR_EQUAL: return "Less or Equal to"; + case GREATER_OR_EQUAL: return "Greater or Equal to"; + case GREATER_THAN: return "Greater than"; + default: return "?"; + } + } + } + + 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; + if ("<".equals(codeString)) + return QuantityComparator.LESS_THAN; + if ("<=".equals(codeString)) + return QuantityComparator.LESS_OR_EQUAL; + if (">=".equals(codeString)) + return QuantityComparator.GREATER_OR_EQUAL; + if (">".equals(codeString)) + return QuantityComparator.GREATER_THAN; + throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("<".equals(codeString)) + return new Enumeration(this, QuantityComparator.LESS_THAN); + if ("<=".equals(codeString)) + return new Enumeration(this, QuantityComparator.LESS_OR_EQUAL); + if (">=".equals(codeString)) + return new Enumeration(this, QuantityComparator.GREATER_OR_EQUAL); + if (">".equals(codeString)) + return new Enumeration(this, QuantityComparator.GREATER_THAN); + throw new FHIRException("Unknown QuantityComparator code '"+codeString+"'"); + } + public String toCode(QuantityComparator code) { + if (code == QuantityComparator.LESS_THAN) + return "<"; + if (code == QuantityComparator.LESS_OR_EQUAL) + return "<="; + if (code == QuantityComparator.GREATER_OR_EQUAL) + return ">="; + if (code == QuantityComparator.GREATER_THAN) + return ">"; + return "?"; + } + public String toSystem(QuantityComparator code) { + return code.getSystem(); + } + } + + /** + * The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + @Child(name = "value", type = {DecimalType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Numerical value (with implicit precision)", formalDefinition="The value of the measured amount. The value includes an implicit precision in the presentation of the value." ) + protected DecimalType value; + + /** + * How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. + */ + @Child(name = "comparator", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="< | <= | >= | > - how to understand the value", formalDefinition="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is \"<\" , then the real value is < stated value." ) + protected Enumeration comparator; + + /** + * A human-readable form of the unit. + */ + @Child(name = "unit", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unit representation", formalDefinition="A human-readable form of the unit." ) + protected StringType unit; + + /** + * The identification of the system that provides the coded form of the unit. + */ + @Child(name = "system", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="System that defines coded unit form", formalDefinition="The identification of the system that provides the coded form of the unit." ) + protected UriType system; + + /** + * A computer processable form of the unit in some unit representation system. + */ + @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Coded form of the unit", formalDefinition="A computer processable form of the unit in some unit representation system." ) + protected CodeType code; + + private static final long serialVersionUID = 1069574054L; + + /** + * Constructor + */ + public Quantity() { + super(); + } + + /** + * Convenience constructor + * + * @param theValue The {@link #setValue(double) value} + */ + public Quantity(double theValue) { + setValue(theValue); + } + + /** + * Convenience constructor + * + * @param theValue The {@link #setValue(long) value} + */ + public Quantity(long theValue) { + setValue(theValue); + } + + /** + * Convenience constructor + * + * @param theComparator The {@link #setComparator(QuantityComparator) comparator} + * @param theValue The {@link #setValue(BigDecimal) value} + * @param theSystem The {@link #setSystem(String)} (the code system for the units} + * @param theCode The {@link #setCode(String)} (the code for the units} + * @param theUnit The {@link #setUnit(String)} (the human readable display name for the units} + */ + public Quantity(QuantityComparator theComparator, double theValue, String theSystem, String theCode, String theUnit) { + setValue(theValue); + setComparator(theComparator); + setSystem(theSystem); + setCode(theCode); + setUnit(theUnit); + } + + /** + * Convenience constructor + * + * @param theComparator The {@link #setComparator(QuantityComparator) comparator} + * @param theValue The {@link #setValue(BigDecimal) value} + * @param theSystem The {@link #setSystem(String)} (the code system for the units} + * @param theCode The {@link #setCode(String)} (the code for the units} + * @param theUnit The {@link #setUnit(String)} (the human readable display name for the units} + */ + public Quantity(QuantityComparator theComparator, long theValue, String theSystem, String theCode, String theUnit) { + setValue(theValue); + setComparator(theComparator); + setSystem(theSystem); + setCode(theCode); + setUnit(theUnit); + } + /** + * @return {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Quantity setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + public Quantity setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + public Quantity setValue(long value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + public Quantity setValue(double value) { + this.value = new DecimalType(); + this.value.setValue(value); + return this; + } + + /** + * @return {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value + */ + public Enumeration getComparatorElement() { + if (this.comparator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.comparator"); + else if (Configuration.doAutoCreate()) + this.comparator = new Enumeration(new QuantityComparatorEnumFactory()); // bb + return this.comparator; + } + + public boolean hasComparatorElement() { + return this.comparator != null && !this.comparator.isEmpty(); + } + + public boolean hasComparator() { + return this.comparator != null && !this.comparator.isEmpty(); + } + + /** + * @param value {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value + */ + public Quantity setComparatorElement(Enumeration value) { + this.comparator = value; + return this; + } + + /** + * @return How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. + */ + public QuantityComparator getComparator() { + return this.comparator == null ? null : this.comparator.getValue(); + } + + /** + * @param value How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. + */ + public Quantity setComparator(QuantityComparator value) { + if (value == null) + this.comparator = null; + else { + if (this.comparator == null) + this.comparator = new Enumeration(new QuantityComparatorEnumFactory()); + this.comparator.setValue(value); + } + return this; + } + + /** + * @return {@link #unit} (A human-readable form of the unit.). This is the underlying object with id, value and extensions. The accessor "getUnit" gives direct access to the value + */ + public StringType getUnitElement() { + if (this.unit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.unit"); + else if (Configuration.doAutoCreate()) + this.unit = new StringType(); // bb + return this.unit; + } + + public boolean hasUnitElement() { + return this.unit != null && !this.unit.isEmpty(); + } + + public boolean hasUnit() { + return this.unit != null && !this.unit.isEmpty(); + } + + /** + * @param value {@link #unit} (A human-readable form of the unit.). This is the underlying object with id, value and extensions. The accessor "getUnit" gives direct access to the value + */ + public Quantity setUnitElement(StringType value) { + this.unit = value; + return this; + } + + /** + * @return A human-readable form of the unit. + */ + public String getUnit() { + return this.unit == null ? null : this.unit.getValue(); + } + + /** + * @param value A human-readable form of the unit. + */ + public Quantity setUnit(String value) { + if (Utilities.noString(value)) + this.unit = null; + else { + if (this.unit == null) + this.unit = new StringType(); + this.unit.setValue(value); + } + return this; + } + + /** + * @return {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Quantity setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return The identification of the system that provides the coded form of the unit. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value The identification of the system that provides the coded form of the unit. + */ + public Quantity setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A computer processable form of the unit in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A computer processable form of the unit in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Quantity setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A computer processable form of the unit in some unit representation system. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A computer processable form of the unit in some unit representation system. + */ + public Quantity setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value", "decimal", "The value of the measured amount. The value includes an implicit precision in the presentation of the value.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("comparator", "code", "How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is \"<\" , then the real value is < stated value.", 0, java.lang.Integer.MAX_VALUE, comparator)); + childrenList.add(new Property("unit", "string", "A human-readable form of the unit.", 0, java.lang.Integer.MAX_VALUE, unit)); + childrenList.add(new Property("system", "uri", "The identification of the system that provides the coded form of the unit.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("code", "code", "A computer processable form of the unit in some unit representation system.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType + case -844673834: /*comparator*/ return this.comparator == null ? new Base[0] : new Base[] {this.comparator}; // Enumeration + case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // StringType + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 111972721: // value + this.value = castToDecimal(value); // DecimalType + break; + case -844673834: // comparator + this.comparator = new QuantityComparatorEnumFactory().fromType(value); // Enumeration + break; + case 3594628: // unit + this.unit = castToString(value); // StringType + break; + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("value")) + this.value = castToDecimal(value); // DecimalType + else if (name.equals("comparator")) + this.comparator = new QuantityComparatorEnumFactory().fromType(value); // Enumeration + else if (name.equals("unit")) + this.unit = castToString(value); // StringType + else if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("code")) + this.code = castToCode(value); // CodeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType + case -844673834: throw new FHIRException("Cannot make property comparator as it is not a complex type"); // Enumeration + case 3594628: throw new FHIRException("Cannot make property unit as it is not a complex type"); // StringType + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type Quantity.value"); + } + else if (name.equals("comparator")) { + throw new FHIRException("Cannot call addChild on a primitive type Quantity.comparator"); + } + else if (name.equals("unit")) { + throw new FHIRException("Cannot call addChild on a primitive type Quantity.unit"); + } + else if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type Quantity.system"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type Quantity.code"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Quantity"; + + } + + public Quantity copy() { + Quantity dst = new Quantity(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Quantity typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Quantity)) + return false; + Quantity o = (Quantity) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Quantity)) + return false; + Quantity o = (Quantity) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Questionnaire.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Questionnaire.java new file mode 100644 index 00000000000..e8e3e81ea6a --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Questionnaire.java @@ -0,0 +1,3473 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ +@ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/Profile/Questionnaire") +public class Questionnaire extends DomainResource { + + public enum QuestionnaireStatus { + /** + * This Questionnaire is not ready for official use. + */ + DRAFT, + /** + * This Questionnaire is ready for use. + */ + PUBLISHED, + /** + * This Questionnaire should no longer be used to gather data. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + public static QuestionnaireStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("published".equals(codeString)) + return PUBLISHED; + if ("retired".equals(codeString)) + return RETIRED; + throw new FHIRException("Unknown QuestionnaireStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case PUBLISHED: return "published"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return "http://hl7.org/fhir/questionnaire-status"; + case PUBLISHED: return "http://hl7.org/fhir/questionnaire-status"; + case RETIRED: return "http://hl7.org/fhir/questionnaire-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This Questionnaire is not ready for official use."; + case PUBLISHED: return "This Questionnaire is ready for use."; + case RETIRED: return "This Questionnaire should no longer be used to gather data."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case PUBLISHED: return "Published"; + case RETIRED: return "Retired"; + default: return "?"; + } + } + } + + 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; + if ("draft".equals(codeString)) + return QuestionnaireStatus.DRAFT; + if ("published".equals(codeString)) + return QuestionnaireStatus.PUBLISHED; + if ("retired".equals(codeString)) + return QuestionnaireStatus.RETIRED; + throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return new Enumeration(this, QuestionnaireStatus.DRAFT); + if ("published".equals(codeString)) + return new Enumeration(this, QuestionnaireStatus.PUBLISHED); + if ("retired".equals(codeString)) + return new Enumeration(this, QuestionnaireStatus.RETIRED); + throw new FHIRException("Unknown QuestionnaireStatus code '"+codeString+"'"); + } + public String toCode(QuestionnaireStatus code) { + if (code == QuestionnaireStatus.DRAFT) + return "draft"; + if (code == QuestionnaireStatus.PUBLISHED) + return "published"; + if (code == QuestionnaireStatus.RETIRED) + return "retired"; + return "?"; + } + public String toSystem(QuestionnaireStatus code) { + return code.getSystem(); + } + } + + public enum QuestionnaireItemType { + /** + * An item with no direct answer but which has descendant items that are questions + */ + GROUP, + /** + * Text for display that will not capture an answer or have descendants + */ + DISPLAY, + /** + * An item that defines a specific answer to be captured (and may have descendant items) + */ + QUESTION, + /** + * Question with a yes/no answer + */ + BOOLEAN, + /** + * Question with is a real number answer + */ + DECIMAL, + /** + * Question with an integer answer + */ + INTEGER, + /** + * Question with adate answer + */ + DATE, + /** + * Question with a date and time answer + */ + DATETIME, + /** + * Question with a system timestamp answer + */ + INSTANT, + /** + * Question with a time (hour/minute/second) answer independent of date. + */ + TIME, + /** + * Question with a short (few words to short sentence) free-text entry answer + */ + STRING, + /** + * Question with a long (potentially multi-paragraph) free-text entry (still captured as a string) answer + */ + TEXT, + /** + * Question with a url (website, FTP site, etc.) answer + */ + URL, + /** + * Question with a Coding drawn from a list of options as an answer + */ + CHOICE, + /** + * Answer is a Coding drawn from a list of options or a free-text entry captured as Coding.display + */ + OPENCHOICE, + /** + * Question with binary content such as a image, PDF, etc. as an answer + */ + ATTACHMENT, + /** + * Question with a reference to another resource (practitioner, organization, etc.) as an answer + */ + REFERENCE, + /** + * Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an answer. + */ + QUANTITY, + /** + * added to help the parsers + */ + NULL; + public static QuestionnaireItemType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("group".equals(codeString)) + return GROUP; + if ("display".equals(codeString)) + return DISPLAY; + if ("question".equals(codeString)) + return QUESTION; + if ("boolean".equals(codeString)) + return BOOLEAN; + if ("decimal".equals(codeString)) + return DECIMAL; + if ("integer".equals(codeString)) + return INTEGER; + if ("date".equals(codeString)) + return DATE; + if ("dateTime".equals(codeString)) + return DATETIME; + if ("instant".equals(codeString)) + return INSTANT; + if ("time".equals(codeString)) + return TIME; + if ("string".equals(codeString)) + return STRING; + if ("text".equals(codeString)) + return TEXT; + if ("url".equals(codeString)) + return URL; + if ("choice".equals(codeString)) + return CHOICE; + if ("open-choice".equals(codeString)) + return OPENCHOICE; + if ("attachment".equals(codeString)) + return ATTACHMENT; + if ("reference".equals(codeString)) + return REFERENCE; + if ("quantity".equals(codeString)) + return QUANTITY; + throw new FHIRException("Unknown QuestionnaireItemType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case GROUP: return "group"; + case DISPLAY: return "display"; + case QUESTION: return "question"; + case BOOLEAN: return "boolean"; + case DECIMAL: return "decimal"; + case INTEGER: return "integer"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case INSTANT: return "instant"; + case TIME: return "time"; + case STRING: return "string"; + case TEXT: return "text"; + case URL: return "url"; + case CHOICE: return "choice"; + case OPENCHOICE: return "open-choice"; + case ATTACHMENT: return "attachment"; + case REFERENCE: return "reference"; + case QUANTITY: return "quantity"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case GROUP: return "http://hl7.org/fhir/item-type"; + case DISPLAY: return "http://hl7.org/fhir/item-type"; + case QUESTION: return "http://hl7.org/fhir/item-type"; + case BOOLEAN: return "http://hl7.org/fhir/item-type"; + case DECIMAL: return "http://hl7.org/fhir/item-type"; + case INTEGER: return "http://hl7.org/fhir/item-type"; + case DATE: return "http://hl7.org/fhir/item-type"; + case DATETIME: return "http://hl7.org/fhir/item-type"; + case INSTANT: return "http://hl7.org/fhir/item-type"; + case TIME: return "http://hl7.org/fhir/item-type"; + case STRING: return "http://hl7.org/fhir/item-type"; + case TEXT: return "http://hl7.org/fhir/item-type"; + case URL: return "http://hl7.org/fhir/item-type"; + case CHOICE: return "http://hl7.org/fhir/item-type"; + case OPENCHOICE: return "http://hl7.org/fhir/item-type"; + case ATTACHMENT: return "http://hl7.org/fhir/item-type"; + case REFERENCE: return "http://hl7.org/fhir/item-type"; + case QUANTITY: return "http://hl7.org/fhir/item-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case GROUP: return "An item with no direct answer but which has descendant items that are questions"; + case DISPLAY: return "Text for display that will not capture an answer or have descendants"; + case QUESTION: return "An item that defines a specific answer to be captured (and may have descendant items)"; + case BOOLEAN: return "Question with a yes/no answer"; + case DECIMAL: return "Question with is a real number answer"; + case INTEGER: return "Question with an integer answer"; + case DATE: return "Question with adate answer"; + case DATETIME: return "Question with a date and time answer"; + case INSTANT: return "Question with a system timestamp answer"; + case TIME: return "Question with a time (hour/minute/second) answer independent of date."; + case STRING: return "Question with a short (few words to short sentence) free-text entry answer"; + case TEXT: return "Question with a long (potentially multi-paragraph) free-text entry (still captured as a string) answer"; + case URL: return "Question with a url (website, FTP site, etc.) answer"; + case CHOICE: return "Question with a Coding drawn from a list of options as an answer"; + case OPENCHOICE: return "Answer is a Coding drawn from a list of options or a free-text entry captured as Coding.display"; + case ATTACHMENT: return "Question with binary content such as a image, PDF, etc. as an answer"; + case REFERENCE: return "Question with a reference to another resource (practitioner, organization, etc.) as an answer"; + case QUANTITY: return "Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an answer."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case GROUP: return "Group"; + case DISPLAY: return "Display"; + case QUESTION: return "Question"; + case BOOLEAN: return "Boolean"; + case DECIMAL: return "Decimal"; + case INTEGER: return "Integer"; + case DATE: return "Date"; + case DATETIME: return "Date Time"; + case INSTANT: return "Instant"; + case TIME: return "Time"; + case STRING: return "String"; + case TEXT: return "Text"; + case URL: return "Url"; + case CHOICE: return "Choice"; + case OPENCHOICE: return "Open Choice"; + case ATTACHMENT: return "Attachment"; + case REFERENCE: return "Reference"; + case QUANTITY: return "Quantity"; + default: return "?"; + } + } + } + + public static class QuestionnaireItemTypeEnumFactory implements EnumFactory { + public QuestionnaireItemType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("group".equals(codeString)) + return QuestionnaireItemType.GROUP; + if ("display".equals(codeString)) + return QuestionnaireItemType.DISPLAY; + if ("question".equals(codeString)) + return QuestionnaireItemType.QUESTION; + if ("boolean".equals(codeString)) + return QuestionnaireItemType.BOOLEAN; + if ("decimal".equals(codeString)) + return QuestionnaireItemType.DECIMAL; + if ("integer".equals(codeString)) + return QuestionnaireItemType.INTEGER; + if ("date".equals(codeString)) + return QuestionnaireItemType.DATE; + if ("dateTime".equals(codeString)) + return QuestionnaireItemType.DATETIME; + if ("instant".equals(codeString)) + return QuestionnaireItemType.INSTANT; + if ("time".equals(codeString)) + return QuestionnaireItemType.TIME; + if ("string".equals(codeString)) + return QuestionnaireItemType.STRING; + if ("text".equals(codeString)) + return QuestionnaireItemType.TEXT; + if ("url".equals(codeString)) + return QuestionnaireItemType.URL; + if ("choice".equals(codeString)) + return QuestionnaireItemType.CHOICE; + if ("open-choice".equals(codeString)) + return QuestionnaireItemType.OPENCHOICE; + if ("attachment".equals(codeString)) + return QuestionnaireItemType.ATTACHMENT; + if ("reference".equals(codeString)) + return QuestionnaireItemType.REFERENCE; + if ("quantity".equals(codeString)) + return QuestionnaireItemType.QUANTITY; + throw new IllegalArgumentException("Unknown QuestionnaireItemType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("group".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.GROUP); + if ("display".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.DISPLAY); + if ("question".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.QUESTION); + if ("boolean".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.BOOLEAN); + if ("decimal".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.DECIMAL); + if ("integer".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.INTEGER); + if ("date".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.DATE); + if ("dateTime".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.DATETIME); + if ("instant".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.INSTANT); + if ("time".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.TIME); + if ("string".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.STRING); + if ("text".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.TEXT); + if ("url".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.URL); + if ("choice".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.CHOICE); + if ("open-choice".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.OPENCHOICE); + if ("attachment".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.ATTACHMENT); + if ("reference".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.REFERENCE); + if ("quantity".equals(codeString)) + return new Enumeration(this, QuestionnaireItemType.QUANTITY); + throw new FHIRException("Unknown QuestionnaireItemType code '"+codeString+"'"); + } + public String toCode(QuestionnaireItemType code) { + if (code == QuestionnaireItemType.GROUP) + return "group"; + if (code == QuestionnaireItemType.DISPLAY) + return "display"; + if (code == QuestionnaireItemType.QUESTION) + return "question"; + if (code == QuestionnaireItemType.BOOLEAN) + return "boolean"; + if (code == QuestionnaireItemType.DECIMAL) + return "decimal"; + if (code == QuestionnaireItemType.INTEGER) + return "integer"; + if (code == QuestionnaireItemType.DATE) + return "date"; + if (code == QuestionnaireItemType.DATETIME) + return "dateTime"; + if (code == QuestionnaireItemType.INSTANT) + return "instant"; + if (code == QuestionnaireItemType.TIME) + return "time"; + if (code == QuestionnaireItemType.STRING) + return "string"; + if (code == QuestionnaireItemType.TEXT) + return "text"; + if (code == QuestionnaireItemType.URL) + return "url"; + if (code == QuestionnaireItemType.CHOICE) + return "choice"; + if (code == QuestionnaireItemType.OPENCHOICE) + return "open-choice"; + if (code == QuestionnaireItemType.ATTACHMENT) + return "attachment"; + if (code == QuestionnaireItemType.REFERENCE) + return "reference"; + if (code == QuestionnaireItemType.QUANTITY) + return "quantity"; + return "?"; + } + public String toSystem(QuestionnaireItemType code) { + return code.getSystem(); + } + } + + @Block() + public static class QuestionnaireItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. + */ + @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="To link questionnaire with questionnaire response", formalDefinition="An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource." ) + protected StringType linkId; + + /** + * Identifies a how this group of questions is known in a particular terminology such as LOINC. + */ + @Child(name = "concept", type = {Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Concept that represents this item within in a questionnaire", formalDefinition="Identifies a how this group of questions is known in a particular terminology such as LOINC." ) + protected List concept; + + /** + * A short label for a particular group, question or set of display text within the questionnaire. + */ + @Child(name = "prefix", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="E.g. \"1(a)\", \"2.5.3\"", formalDefinition="A short label for a particular group, question or set of display text within the questionnaire." ) + protected StringType prefix; + + /** + * The name of a section, the text of a question or text content for a text item. + */ + @Child(name = "text", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Primary text for the item", formalDefinition="The name of a section, the text of a question or text content for a text item." ) + protected StringType text; + + /** + * Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). + */ + @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="group | display | boolean | decimal | integer | date | dateTime +", formalDefinition="Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.)." ) + protected Enumeration type; + + /** + * If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true. + */ + @Child(name = "enableWhen", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=false) + @Description(shortDefinition="Only allow data when:", formalDefinition="If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true." ) + protected List enableWhen; + + /** + * If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. + */ + @Child(name = "required", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether the item must be included in data results", formalDefinition="If true, indicates that the item must be present in a \"completed\" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire." ) + protected BooleanType required; + + /** + * Whether the item may occur multiple times in the instance, containing multiple sets of answers. + */ + @Child(name = "repeats", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether the item may repeat", formalDefinition="Whether the item may occur multiple times in the instance, containing multiple sets of answers." ) + protected BooleanType repeats; + + /** + * If true, the value cannot be changed by a human respondent to the Questionnaire. + */ + @Child(name = "readOnly", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Don't allow human editing", formalDefinition="If true, the value cannot be changed by a human respondent to the Questionnaire." ) + protected BooleanType readOnly; + + /** + * The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. + */ + @Child(name = "maxLength", type = {IntegerType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="No more than this many characters", formalDefinition="The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse." ) + protected IntegerType maxLength; + + /** + * Reference to a value set containing a list of codes representing permitted answers for the question. + */ + @Child(name = "options", type = {ValueSet.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Valueset containing permitted answers", formalDefinition="Reference to a value set containing a list of codes representing permitted answers for the question." ) + protected Reference options; + + /** + * The actual object that is the target of the reference (Reference to a value set containing a list of codes representing permitted answers for the question.) + */ + protected ValueSet optionsTarget; + + /** + * For a "choice" question, identifies one of the permitted answers for the question. + */ + @Child(name = "option", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Permitted answer", formalDefinition="For a \"choice\" question, identifies one of the permitted answers for the question." ) + protected List option; + + /** + * The value that should be pre-populated when rendering the questionnaire for user input. + */ + @Child(name = "initial", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Initial presumed answer for question", formalDefinition="The value that should be pre-populated when rendering the questionnaire for user input." ) + protected Type initial; + + /** + * Allows text, questions and other groups to be nested beneath a question or group. + */ + @Child(name = "item", type = {QuestionnaireItemComponent.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Nested questionnaire items", formalDefinition="Allows text, questions and other groups to be nested beneath a question or group." ) + protected List item; + + private static final long serialVersionUID = -1787693458L; + + /** + * Constructor + */ + public QuestionnaireItemComponent() { + super(); + } + + /** + * Constructor + */ + public QuestionnaireItemComponent(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #linkId} (An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); // bb + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public QuestionnaireItemComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. + */ + public QuestionnaireItemComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (Coding item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + */ + // syntactic sugar + public Coding addConcept() { //3 + Coding t = new Coding(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public QuestionnaireItemComponent addConcept(Coding t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + /** + * @return {@link #prefix} (A short label for a particular group, question or set of display text within the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPrefix" gives direct access to the value + */ + public StringType getPrefixElement() { + if (this.prefix == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.prefix"); + else if (Configuration.doAutoCreate()) + this.prefix = new StringType(); // bb + return this.prefix; + } + + public boolean hasPrefixElement() { + return this.prefix != null && !this.prefix.isEmpty(); + } + + public boolean hasPrefix() { + return this.prefix != null && !this.prefix.isEmpty(); + } + + /** + * @param value {@link #prefix} (A short label for a particular group, question or set of display text within the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPrefix" gives direct access to the value + */ + public QuestionnaireItemComponent setPrefixElement(StringType value) { + this.prefix = value; + return this; + } + + /** + * @return A short label for a particular group, question or set of display text within the questionnaire. + */ + public String getPrefix() { + return this.prefix == null ? null : this.prefix.getValue(); + } + + /** + * @param value A short label for a particular group, question or set of display text within the questionnaire. + */ + public QuestionnaireItemComponent setPrefix(String value) { + if (Utilities.noString(value)) + this.prefix = null; + else { + if (this.prefix == null) + this.prefix = new StringType(); + this.prefix.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (The name of a section, the text of a question or text content for a text item.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The name of a section, the text of a question or text content for a text item.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public QuestionnaireItemComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The name of a section, the text of a question or text content for a text item. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The name of a section, the text of a question or text content for a text item. + */ + public QuestionnaireItemComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).). 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 QuestionnaireItemComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new QuestionnaireItemTypeEnumFactory()); // bb + 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} (Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public QuestionnaireItemComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). + */ + public QuestionnaireItemType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). + */ + public QuestionnaireItemComponent setType(QuestionnaireItemType value) { + if (this.type == null) + this.type = new Enumeration(new QuestionnaireItemTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #enableWhen} (If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.) + */ + public List getEnableWhen() { + if (this.enableWhen == null) + this.enableWhen = new ArrayList(); + return this.enableWhen; + } + + public boolean hasEnableWhen() { + if (this.enableWhen == null) + return false; + for (QuestionnaireItemEnableWhenComponent item : this.enableWhen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #enableWhen} (If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.) + */ + // syntactic sugar + public QuestionnaireItemEnableWhenComponent addEnableWhen() { //3 + QuestionnaireItemEnableWhenComponent t = new QuestionnaireItemEnableWhenComponent(); + if (this.enableWhen == null) + this.enableWhen = new ArrayList(); + this.enableWhen.add(t); + return t; + } + + // syntactic sugar + public QuestionnaireItemComponent addEnableWhen(QuestionnaireItemEnableWhenComponent t) { //3 + if (t == null) + return this; + if (this.enableWhen == null) + this.enableWhen = new ArrayList(); + this.enableWhen.add(t); + return this; + } + + /** + * @return {@link #required} (If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public BooleanType getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new BooleanType(); // bb + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public QuestionnaireItemComponent setRequiredElement(BooleanType value) { + this.required = value; + return this; + } + + /** + * @return If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. + */ + public boolean getRequired() { + return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); + } + + /** + * @param value If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. + */ + public QuestionnaireItemComponent setRequired(boolean value) { + if (this.required == null) + this.required = new BooleanType(); + this.required.setValue(value); + return this; + } + + /** + * @return {@link #repeats} (Whether the item may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public BooleanType getRepeatsElement() { + if (this.repeats == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.repeats"); + else if (Configuration.doAutoCreate()) + this.repeats = new BooleanType(); // bb + return this.repeats; + } + + public boolean hasRepeatsElement() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + public boolean hasRepeats() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + /** + * @param value {@link #repeats} (Whether the item may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public QuestionnaireItemComponent setRepeatsElement(BooleanType value) { + this.repeats = value; + return this; + } + + /** + * @return Whether the item may occur multiple times in the instance, containing multiple sets of answers. + */ + public boolean getRepeats() { + return this.repeats == null || this.repeats.isEmpty() ? false : this.repeats.getValue(); + } + + /** + * @param value Whether the item may occur multiple times in the instance, containing multiple sets of answers. + */ + public QuestionnaireItemComponent setRepeats(boolean value) { + if (this.repeats == null) + this.repeats = new BooleanType(); + this.repeats.setValue(value); + return this; + } + + /** + * @return {@link #readOnly} (If true, the value cannot be changed by a human respondent to the Questionnaire.). This is the underlying object with id, value and extensions. The accessor "getReadOnly" gives direct access to the value + */ + public BooleanType getReadOnlyElement() { + if (this.readOnly == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.readOnly"); + else if (Configuration.doAutoCreate()) + this.readOnly = new BooleanType(); // bb + return this.readOnly; + } + + public boolean hasReadOnlyElement() { + return this.readOnly != null && !this.readOnly.isEmpty(); + } + + public boolean hasReadOnly() { + return this.readOnly != null && !this.readOnly.isEmpty(); + } + + /** + * @param value {@link #readOnly} (If true, the value cannot be changed by a human respondent to the Questionnaire.). This is the underlying object with id, value and extensions. The accessor "getReadOnly" gives direct access to the value + */ + public QuestionnaireItemComponent setReadOnlyElement(BooleanType value) { + this.readOnly = value; + return this; + } + + /** + * @return If true, the value cannot be changed by a human respondent to the Questionnaire. + */ + public boolean getReadOnly() { + return this.readOnly == null || this.readOnly.isEmpty() ? false : this.readOnly.getValue(); + } + + /** + * @param value If true, the value cannot be changed by a human respondent to the Questionnaire. + */ + public QuestionnaireItemComponent setReadOnly(boolean value) { + if (this.readOnly == null) + this.readOnly = new BooleanType(); + this.readOnly.setValue(value); + return this; + } + + /** + * @return {@link #maxLength} (The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public IntegerType getMaxLengthElement() { + if (this.maxLength == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.maxLength"); + else if (Configuration.doAutoCreate()) + this.maxLength = new IntegerType(); // bb + return this.maxLength; + } + + public boolean hasMaxLengthElement() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + public boolean hasMaxLength() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + /** + * @param value {@link #maxLength} (The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public QuestionnaireItemComponent setMaxLengthElement(IntegerType value) { + this.maxLength = value; + return this; + } + + /** + * @return The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. + */ + public int getMaxLength() { + return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue(); + } + + /** + * @param value The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. + */ + public QuestionnaireItemComponent setMaxLength(int value) { + if (this.maxLength == null) + this.maxLength = new IntegerType(); + this.maxLength.setValue(value); + return this; + } + + /** + * @return {@link #options} (Reference to a value set containing a list of codes representing permitted answers for the question.) + */ + public Reference getOptions() { + if (this.options == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.options"); + else if (Configuration.doAutoCreate()) + this.options = new Reference(); // cc + return this.options; + } + + public boolean hasOptions() { + return this.options != null && !this.options.isEmpty(); + } + + /** + * @param value {@link #options} (Reference to a value set containing a list of codes representing permitted answers for the question.) + */ + public QuestionnaireItemComponent setOptions(Reference value) { + this.options = value; + return this; + } + + /** + * @return {@link #options} 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 a value set containing a list of codes representing permitted answers for the question.) + */ + public ValueSet getOptionsTarget() { + if (this.optionsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.options"); + else if (Configuration.doAutoCreate()) + this.optionsTarget = new ValueSet(); // aa + return this.optionsTarget; + } + + /** + * @param value {@link #options} 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 a value set containing a list of codes representing permitted answers for the question.) + */ + public QuestionnaireItemComponent setOptionsTarget(ValueSet value) { + this.optionsTarget = value; + return this; + } + + /** + * @return {@link #option} (For a "choice" question, identifies one of the permitted answers for the question.) + */ + public List getOption() { + if (this.option == null) + this.option = new ArrayList(); + return this.option; + } + + public boolean hasOption() { + if (this.option == null) + return false; + for (QuestionnaireItemOptionComponent item : this.option) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #option} (For a "choice" question, identifies one of the permitted answers for the question.) + */ + // syntactic sugar + public QuestionnaireItemOptionComponent addOption() { //3 + QuestionnaireItemOptionComponent t = new QuestionnaireItemOptionComponent(); + if (this.option == null) + this.option = new ArrayList(); + this.option.add(t); + return t; + } + + // syntactic sugar + public QuestionnaireItemComponent addOption(QuestionnaireItemOptionComponent t) { //3 + if (t == null) + return this; + if (this.option == null) + this.option = new ArrayList(); + this.option.add(t); + return this; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public Type getInitial() { + return this.initial; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public BooleanType getInitialBooleanType() throws FHIRException { + if (!(this.initial instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (BooleanType) this.initial; + } + + public boolean hasInitialBooleanType() { + return this.initial instanceof BooleanType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public DecimalType getInitialDecimalType() throws FHIRException { + if (!(this.initial instanceof DecimalType)) + throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (DecimalType) this.initial; + } + + public boolean hasInitialDecimalType() { + return this.initial instanceof DecimalType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public IntegerType getInitialIntegerType() throws FHIRException { + if (!(this.initial instanceof IntegerType)) + throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (IntegerType) this.initial; + } + + public boolean hasInitialIntegerType() { + return this.initial instanceof IntegerType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public DateType getInitialDateType() throws FHIRException { + if (!(this.initial instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (DateType) this.initial; + } + + public boolean hasInitialDateType() { + return this.initial instanceof DateType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public DateTimeType getInitialDateTimeType() throws FHIRException { + if (!(this.initial instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (DateTimeType) this.initial; + } + + public boolean hasInitialDateTimeType() { + return this.initial instanceof DateTimeType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public InstantType getInitialInstantType() throws FHIRException { + if (!(this.initial instanceof InstantType)) + throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (InstantType) this.initial; + } + + public boolean hasInitialInstantType() { + return this.initial instanceof InstantType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public TimeType getInitialTimeType() throws FHIRException { + if (!(this.initial instanceof TimeType)) + throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (TimeType) this.initial; + } + + public boolean hasInitialTimeType() { + return this.initial instanceof TimeType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public StringType getInitialStringType() throws FHIRException { + if (!(this.initial instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (StringType) this.initial; + } + + public boolean hasInitialStringType() { + return this.initial instanceof StringType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public UriType getInitialUriType() throws FHIRException { + if (!(this.initial instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (UriType) this.initial; + } + + public boolean hasInitialUriType() { + return this.initial instanceof UriType; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public Attachment getInitialAttachment() throws FHIRException { + if (!(this.initial instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (Attachment) this.initial; + } + + public boolean hasInitialAttachment() { + return this.initial instanceof Attachment; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public Coding getInitialCoding() throws FHIRException { + if (!(this.initial instanceof Coding)) + throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (Coding) this.initial; + } + + public boolean hasInitialCoding() { + return this.initial instanceof Coding; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public Quantity getInitialQuantity() throws FHIRException { + if (!(this.initial instanceof Quantity)) + throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (Quantity) this.initial; + } + + public boolean hasInitialQuantity() { + return this.initial instanceof Quantity; + } + + /** + * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public Reference getInitialReference() throws FHIRException { + if (!(this.initial instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.initial.getClass().getName()+" was encountered"); + return (Reference) this.initial; + } + + public boolean hasInitialReference() { + return this.initial instanceof Reference; + } + + public boolean hasInitial() { + return this.initial != null && !this.initial.isEmpty(); + } + + /** + * @param value {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + */ + public QuestionnaireItemComponent setInitial(Type value) { + this.initial = value; + return this; + } + + /** + * @return {@link #item} (Allows text, questions and other groups to be nested beneath a question or group.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (QuestionnaireItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (Allows text, questions and other groups to be nested beneath a question or group.) + */ + // syntactic sugar + public QuestionnaireItemComponent addItem() { //3 + QuestionnaireItemComponent t = new QuestionnaireItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public QuestionnaireItemComponent addItem(QuestionnaireItemComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + 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 item in a QuestionnaireResponse 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("prefix", "string", "A short label for a particular group, question or set of display text within the questionnaire.", 0, java.lang.Integer.MAX_VALUE, prefix)); + childrenList.add(new Property("text", "string", "The name of a section, the text of a question or text content for a text item.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("type", "code", "Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("enableWhen", "", "If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.", 0, java.lang.Integer.MAX_VALUE, enableWhen)); + childrenList.add(new Property("required", "boolean", "If true, indicates that the item must be present in a \"completed\" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("repeats", "boolean", "Whether the item may occur multiple times in the instance, containing multiple sets of answers.", 0, java.lang.Integer.MAX_VALUE, repeats)); + childrenList.add(new Property("readOnly", "boolean", "If true, the value cannot be changed by a human respondent to the Questionnaire.", 0, java.lang.Integer.MAX_VALUE, readOnly)); + childrenList.add(new Property("maxLength", "integer", "The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, maxLength)); + childrenList.add(new Property("options", "Reference(ValueSet)", "Reference to a value set containing a list of codes representing permitted answers for the question.", 0, java.lang.Integer.MAX_VALUE, options)); + childrenList.add(new Property("option", "", "For a \"choice\" question, identifies one of the permitted answers for the question.", 0, java.lang.Integer.MAX_VALUE, option)); + childrenList.add(new Property("initial[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be pre-populated when rendering the questionnaire for user input.", 0, java.lang.Integer.MAX_VALUE, initial)); + childrenList.add(new Property("item", "@Questionnaire.item", "Allows text, questions and other groups to be nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType + case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // Coding + case -980110702: /*prefix*/ return this.prefix == null ? new Base[0] : new Base[] {this.prefix}; // StringType + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 1893321565: /*enableWhen*/ return this.enableWhen == null ? new Base[0] : this.enableWhen.toArray(new Base[this.enableWhen.size()]); // QuestionnaireItemEnableWhenComponent + case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType + case 1094288952: /*repeats*/ return this.repeats == null ? new Base[0] : new Base[] {this.repeats}; // BooleanType + case -867683742: /*readOnly*/ return this.readOnly == null ? new Base[0] : new Base[] {this.readOnly}; // BooleanType + case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType + case -1249474914: /*options*/ return this.options == null ? new Base[0] : new Base[] {this.options}; // Reference + case -1010136971: /*option*/ return this.option == null ? new Base[0] : this.option.toArray(new Base[this.option.size()]); // QuestionnaireItemOptionComponent + case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // Type + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireItemComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1102667083: // linkId + this.linkId = castToString(value); // StringType + break; + case 951024232: // concept + this.getConcept().add(castToCoding(value)); // Coding + break; + case -980110702: // prefix + this.prefix = castToString(value); // StringType + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + case 3575610: // type + this.type = new QuestionnaireItemTypeEnumFactory().fromType(value); // Enumeration + break; + case 1893321565: // enableWhen + this.getEnableWhen().add((QuestionnaireItemEnableWhenComponent) value); // QuestionnaireItemEnableWhenComponent + break; + case -393139297: // required + this.required = castToBoolean(value); // BooleanType + break; + case 1094288952: // repeats + this.repeats = castToBoolean(value); // BooleanType + break; + case -867683742: // readOnly + this.readOnly = castToBoolean(value); // BooleanType + break; + case -791400086: // maxLength + this.maxLength = castToInteger(value); // IntegerType + break; + case -1249474914: // options + this.options = castToReference(value); // Reference + break; + case -1010136971: // option + this.getOption().add((QuestionnaireItemOptionComponent) value); // QuestionnaireItemOptionComponent + break; + case 1948342084: // initial + this.initial = (Type) value; // Type + break; + case 3242771: // item + this.getItem().add((QuestionnaireItemComponent) value); // QuestionnaireItemComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("linkId")) + this.linkId = castToString(value); // StringType + else if (name.equals("concept")) + this.getConcept().add(castToCoding(value)); + else if (name.equals("prefix")) + this.prefix = castToString(value); // StringType + else if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("type")) + this.type = new QuestionnaireItemTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("enableWhen")) + this.getEnableWhen().add((QuestionnaireItemEnableWhenComponent) value); + else if (name.equals("required")) + this.required = castToBoolean(value); // BooleanType + else if (name.equals("repeats")) + this.repeats = castToBoolean(value); // BooleanType + else if (name.equals("readOnly")) + this.readOnly = castToBoolean(value); // BooleanType + else if (name.equals("maxLength")) + this.maxLength = castToInteger(value); // IntegerType + else if (name.equals("options")) + this.options = castToReference(value); // Reference + else if (name.equals("option")) + this.getOption().add((QuestionnaireItemOptionComponent) value); + else if (name.equals("initial[x]")) + this.initial = (Type) value; // Type + else if (name.equals("item")) + this.getItem().add((QuestionnaireItemComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1102667083: throw new FHIRException("Cannot make property linkId as it is not a complex type"); // StringType + case 951024232: return addConcept(); // Coding + case -980110702: throw new FHIRException("Cannot make property prefix as it is not a complex type"); // StringType + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 1893321565: return addEnableWhen(); // QuestionnaireItemEnableWhenComponent + case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // BooleanType + case 1094288952: throw new FHIRException("Cannot make property repeats as it is not a complex type"); // BooleanType + case -867683742: throw new FHIRException("Cannot make property readOnly as it is not a complex type"); // BooleanType + case -791400086: throw new FHIRException("Cannot make property maxLength as it is not a complex type"); // IntegerType + case -1249474914: return getOptions(); // Reference + case -1010136971: return addOption(); // QuestionnaireItemOptionComponent + case 871077564: return getInitial(); // Type + case 3242771: return addItem(); // QuestionnaireItemComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("linkId")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.linkId"); + } + else if (name.equals("concept")) { + return addConcept(); + } + else if (name.equals("prefix")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.prefix"); + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.text"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.type"); + } + else if (name.equals("enableWhen")) { + return addEnableWhen(); + } + else if (name.equals("required")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.required"); + } + else if (name.equals("repeats")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.repeats"); + } + else if (name.equals("readOnly")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.readOnly"); + } + else if (name.equals("maxLength")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.maxLength"); + } + else if (name.equals("options")) { + this.options = new Reference(); + return this.options; + } + else if (name.equals("option")) { + return addOption(); + } + else if (name.equals("initialBoolean")) { + this.initial = new BooleanType(); + return this.initial; + } + else if (name.equals("initialDecimal")) { + this.initial = new DecimalType(); + return this.initial; + } + else if (name.equals("initialInteger")) { + this.initial = new IntegerType(); + return this.initial; + } + else if (name.equals("initialDate")) { + this.initial = new DateType(); + return this.initial; + } + else if (name.equals("initialDateTime")) { + this.initial = new DateTimeType(); + return this.initial; + } + else if (name.equals("initialInstant")) { + this.initial = new InstantType(); + return this.initial; + } + else if (name.equals("initialTime")) { + this.initial = new TimeType(); + return this.initial; + } + else if (name.equals("initialString")) { + this.initial = new StringType(); + return this.initial; + } + else if (name.equals("initialUri")) { + this.initial = new UriType(); + return this.initial; + } + else if (name.equals("initialAttachment")) { + this.initial = new Attachment(); + return this.initial; + } + else if (name.equals("initialCoding")) { + this.initial = new Coding(); + return this.initial; + } + else if (name.equals("initialQuantity")) { + this.initial = new Quantity(); + return this.initial; + } + else if (name.equals("initialReference")) { + this.initial = new Reference(); + return this.initial; + } + else if (name.equals("item")) { + return addItem(); + } + else + return super.addChild(name); + } + + public QuestionnaireItemComponent copy() { + QuestionnaireItemComponent dst = new QuestionnaireItemComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (Coding i : concept) + dst.concept.add(i.copy()); + }; + dst.prefix = prefix == null ? null : prefix.copy(); + dst.text = text == null ? null : text.copy(); + dst.type = type == null ? null : type.copy(); + if (enableWhen != null) { + dst.enableWhen = new ArrayList(); + for (QuestionnaireItemEnableWhenComponent i : enableWhen) + dst.enableWhen.add(i.copy()); + }; + dst.required = required == null ? null : required.copy(); + dst.repeats = repeats == null ? null : repeats.copy(); + dst.readOnly = readOnly == null ? null : readOnly.copy(); + dst.maxLength = maxLength == null ? null : maxLength.copy(); + dst.options = options == null ? null : options.copy(); + if (option != null) { + dst.option = new ArrayList(); + for (QuestionnaireItemOptionComponent i : option) + dst.option.add(i.copy()); + }; + dst.initial = initial == null ? null : initial.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (QuestionnaireItemComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionnaireItemComponent)) + return false; + QuestionnaireItemComponent o = (QuestionnaireItemComponent) other; + return compareDeep(linkId, o.linkId, true) && compareDeep(concept, o.concept, true) && compareDeep(prefix, o.prefix, true) + && compareDeep(text, o.text, true) && compareDeep(type, o.type, true) && compareDeep(enableWhen, o.enableWhen, true) + && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true) && compareDeep(readOnly, o.readOnly, true) + && compareDeep(maxLength, o.maxLength, true) && compareDeep(options, o.options, true) && compareDeep(option, o.option, true) + && compareDeep(initial, o.initial, true) && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionnaireItemComponent)) + return false; + QuestionnaireItemComponent o = (QuestionnaireItemComponent) other; + return compareValues(linkId, o.linkId, true) && compareValues(prefix, o.prefix, true) && compareValues(text, o.text, true) + && compareValues(type, o.type, true) && compareValues(required, o.required, true) && compareValues(repeats, o.repeats, true) + && compareValues(readOnly, o.readOnly, true) && compareValues(maxLength, o.maxLength, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (concept == null || concept.isEmpty()) + && (prefix == null || prefix.isEmpty()) && (text == null || text.isEmpty()) && (type == null || type.isEmpty()) + && (enableWhen == null || enableWhen.isEmpty()) && (required == null || required.isEmpty()) + && (repeats == null || repeats.isEmpty()) && (readOnly == null || readOnly.isEmpty()) && (maxLength == null || maxLength.isEmpty()) + && (options == null || options.isEmpty()) && (option == null || option.isEmpty()) && (initial == null || initial.isEmpty()) + && (item == null || item.isEmpty()); + } + + public String fhirType() { + return "Questionnaire.item"; + + } + + } + + @Block() + public static class QuestionnaireItemEnableWhenComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The linkId for the question whose answer (or lack of answer) governs whether this item is enabled. + */ + @Child(name = "question", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Question that determines whether item is enabled", formalDefinition="The linkId for the question whose answer (or lack of answer) governs whether this item is enabled." ) + protected StringType question; + + /** + * If present, indicates that this item should be enabled only if the specified question is answered or not answered. + */ + @Child(name = "answered", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Enable when answered or not", formalDefinition="If present, indicates that this item should be enabled only if the specified question is answered or not answered." ) + protected BooleanType answered; + + /** + * If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer. + */ + @Child(name = "answer", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Value question must have", formalDefinition="If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer." ) + protected Type answer; + + private static final long serialVersionUID = 903205698L; + + /** + * Constructor + */ + public QuestionnaireItemEnableWhenComponent() { + super(); + } + + /** + * Constructor + */ + public QuestionnaireItemEnableWhenComponent(StringType question) { + super(); + this.question = question; + } + + /** + * @return {@link #question} (The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value + */ + public StringType getQuestionElement() { + if (this.question == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemEnableWhenComponent.question"); + else if (Configuration.doAutoCreate()) + this.question = new StringType(); // bb + return this.question; + } + + public boolean hasQuestionElement() { + return this.question != null && !this.question.isEmpty(); + } + + public boolean hasQuestion() { + return this.question != null && !this.question.isEmpty(); + } + + /** + * @param value {@link #question} (The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value + */ + public QuestionnaireItemEnableWhenComponent setQuestionElement(StringType value) { + this.question = value; + return this; + } + + /** + * @return The linkId for the question whose answer (or lack of answer) governs whether this item is enabled. + */ + public String getQuestion() { + return this.question == null ? null : this.question.getValue(); + } + + /** + * @param value The linkId for the question whose answer (or lack of answer) governs whether this item is enabled. + */ + public QuestionnaireItemEnableWhenComponent setQuestion(String value) { + if (this.question == null) + this.question = new StringType(); + this.question.setValue(value); + return this; + } + + /** + * @return {@link #answered} (If present, indicates that this item should be enabled only if the specified question is answered or not answered.). This is the underlying object with id, value and extensions. The accessor "getAnswered" gives direct access to the value + */ + public BooleanType getAnsweredElement() { + if (this.answered == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemEnableWhenComponent.answered"); + else if (Configuration.doAutoCreate()) + this.answered = new BooleanType(); // bb + return this.answered; + } + + public boolean hasAnsweredElement() { + return this.answered != null && !this.answered.isEmpty(); + } + + public boolean hasAnswered() { + return this.answered != null && !this.answered.isEmpty(); + } + + /** + * @param value {@link #answered} (If present, indicates that this item should be enabled only if the specified question is answered or not answered.). This is the underlying object with id, value and extensions. The accessor "getAnswered" gives direct access to the value + */ + public QuestionnaireItemEnableWhenComponent setAnsweredElement(BooleanType value) { + this.answered = value; + return this; + } + + /** + * @return If present, indicates that this item should be enabled only if the specified question is answered or not answered. + */ + public boolean getAnswered() { + return this.answered == null || this.answered.isEmpty() ? false : this.answered.getValue(); + } + + /** + * @param value If present, indicates that this item should be enabled only if the specified question is answered or not answered. + */ + public QuestionnaireItemEnableWhenComponent setAnswered(boolean value) { + if (this.answered == null) + this.answered = new BooleanType(); + this.answered.setValue(value); + return this; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public Type getAnswer() { + return this.answer; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public BooleanType getAnswerBooleanType() throws FHIRException { + if (!(this.answer instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (BooleanType) this.answer; + } + + public boolean hasAnswerBooleanType() { + return this.answer instanceof BooleanType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public DecimalType getAnswerDecimalType() throws FHIRException { + if (!(this.answer instanceof DecimalType)) + throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (DecimalType) this.answer; + } + + public boolean hasAnswerDecimalType() { + return this.answer instanceof DecimalType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public IntegerType getAnswerIntegerType() throws FHIRException { + if (!(this.answer instanceof IntegerType)) + throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (IntegerType) this.answer; + } + + public boolean hasAnswerIntegerType() { + return this.answer instanceof IntegerType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public DateType getAnswerDateType() throws FHIRException { + if (!(this.answer instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (DateType) this.answer; + } + + public boolean hasAnswerDateType() { + return this.answer instanceof DateType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public DateTimeType getAnswerDateTimeType() throws FHIRException { + if (!(this.answer instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (DateTimeType) this.answer; + } + + public boolean hasAnswerDateTimeType() { + return this.answer instanceof DateTimeType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public InstantType getAnswerInstantType() throws FHIRException { + if (!(this.answer instanceof InstantType)) + throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (InstantType) this.answer; + } + + public boolean hasAnswerInstantType() { + return this.answer instanceof InstantType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public TimeType getAnswerTimeType() throws FHIRException { + if (!(this.answer instanceof TimeType)) + throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (TimeType) this.answer; + } + + public boolean hasAnswerTimeType() { + return this.answer instanceof TimeType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public StringType getAnswerStringType() throws FHIRException { + if (!(this.answer instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (StringType) this.answer; + } + + public boolean hasAnswerStringType() { + return this.answer instanceof StringType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public UriType getAnswerUriType() throws FHIRException { + if (!(this.answer instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (UriType) this.answer; + } + + public boolean hasAnswerUriType() { + return this.answer instanceof UriType; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public Attachment getAnswerAttachment() throws FHIRException { + if (!(this.answer instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (Attachment) this.answer; + } + + public boolean hasAnswerAttachment() { + return this.answer instanceof Attachment; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public Coding getAnswerCoding() throws FHIRException { + if (!(this.answer instanceof Coding)) + throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (Coding) this.answer; + } + + public boolean hasAnswerCoding() { + return this.answer instanceof Coding; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public Quantity getAnswerQuantity() throws FHIRException { + if (!(this.answer instanceof Quantity)) + throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (Quantity) this.answer; + } + + public boolean hasAnswerQuantity() { + return this.answer instanceof Quantity; + } + + /** + * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public Reference getAnswerReference() throws FHIRException { + if (!(this.answer instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.answer.getClass().getName()+" was encountered"); + return (Reference) this.answer; + } + + public boolean hasAnswerReference() { + return this.answer instanceof Reference; + } + + public boolean hasAnswer() { + return this.answer != null && !this.answer.isEmpty(); + } + + /** + * @param value {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) + */ + public QuestionnaireItemEnableWhenComponent setAnswer(Type value) { + this.answer = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("question", "string", "The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.", 0, java.lang.Integer.MAX_VALUE, question)); + childrenList.add(new Property("answered", "boolean", "If present, indicates that this item should be enabled only if the specified question is answered or not answered.", 0, java.lang.Integer.MAX_VALUE, answered)); + childrenList.add(new Property("answer[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.", 0, java.lang.Integer.MAX_VALUE, answer)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1165870106: /*question*/ return this.question == null ? new Base[0] : new Base[] {this.question}; // StringType + case -499559203: /*answered*/ return this.answered == null ? new Base[0] : new Base[] {this.answered}; // BooleanType + case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : new Base[] {this.answer}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1165870106: // question + this.question = castToString(value); // StringType + break; + case -499559203: // answered + this.answered = castToBoolean(value); // BooleanType + break; + case -1412808770: // answer + this.answer = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("question")) + this.question = castToString(value); // StringType + else if (name.equals("answered")) + this.answered = castToBoolean(value); // BooleanType + else if (name.equals("answer[x]")) + this.answer = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1165870106: throw new FHIRException("Cannot make property question as it is not a complex type"); // StringType + case -499559203: throw new FHIRException("Cannot make property answered as it is not a complex type"); // BooleanType + case 1693524994: return getAnswer(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("question")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.question"); + } + else if (name.equals("answered")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.answered"); + } + else if (name.equals("answerBoolean")) { + this.answer = new BooleanType(); + return this.answer; + } + else if (name.equals("answerDecimal")) { + this.answer = new DecimalType(); + return this.answer; + } + else if (name.equals("answerInteger")) { + this.answer = new IntegerType(); + return this.answer; + } + else if (name.equals("answerDate")) { + this.answer = new DateType(); + return this.answer; + } + else if (name.equals("answerDateTime")) { + this.answer = new DateTimeType(); + return this.answer; + } + else if (name.equals("answerInstant")) { + this.answer = new InstantType(); + return this.answer; + } + else if (name.equals("answerTime")) { + this.answer = new TimeType(); + return this.answer; + } + else if (name.equals("answerString")) { + this.answer = new StringType(); + return this.answer; + } + else if (name.equals("answerUri")) { + this.answer = new UriType(); + return this.answer; + } + else if (name.equals("answerAttachment")) { + this.answer = new Attachment(); + return this.answer; + } + else if (name.equals("answerCoding")) { + this.answer = new Coding(); + return this.answer; + } + else if (name.equals("answerQuantity")) { + this.answer = new Quantity(); + return this.answer; + } + else if (name.equals("answerReference")) { + this.answer = new Reference(); + return this.answer; + } + else + return super.addChild(name); + } + + public QuestionnaireItemEnableWhenComponent copy() { + QuestionnaireItemEnableWhenComponent dst = new QuestionnaireItemEnableWhenComponent(); + copyValues(dst); + dst.question = question == null ? null : question.copy(); + dst.answered = answered == null ? null : answered.copy(); + dst.answer = answer == null ? null : answer.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionnaireItemEnableWhenComponent)) + return false; + QuestionnaireItemEnableWhenComponent o = (QuestionnaireItemEnableWhenComponent) other; + return compareDeep(question, o.question, true) && compareDeep(answered, o.answered, true) && compareDeep(answer, o.answer, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionnaireItemEnableWhenComponent)) + return false; + QuestionnaireItemEnableWhenComponent o = (QuestionnaireItemEnableWhenComponent) other; + return compareValues(question, o.question, true) && compareValues(answered, o.answered, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (question == null || question.isEmpty()) && (answered == null || answered.isEmpty()) + && (answer == null || answer.isEmpty()); + } + + public String fhirType() { + return "Questionnaire.item.enableWhen"; + + } + + } + + @Block() + public static class QuestionnaireItemOptionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies a specific answer that's allowed as the answer to a question. + */ + @Child(name = "value", type = {IntegerType.class, DateType.class, TimeType.class, StringType.class, Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Answer value", formalDefinition="Identifies a specific answer that's allowed as the answer to a question." ) + protected Type value; + + private static final long serialVersionUID = -732981989L; + + /** + * Constructor + */ + public QuestionnaireItemOptionComponent() { + super(); + } + + /** + * Constructor + */ + public QuestionnaireItemOptionComponent(Type value) { + super(); + this.value = value; + } + + /** + * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) + */ + public IntegerType getValueIntegerType() throws FHIRException { + if (!(this.value instanceof IntegerType)) + throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IntegerType) this.value; + } + + public boolean hasValueIntegerType() { + return this.value instanceof IntegerType; + } + + /** + * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) + */ + public DateType getValueDateType() throws FHIRException { + if (!(this.value instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateType) this.value; + } + + public boolean hasValueDateType() { + return this.value instanceof DateType; + } + + /** + * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) + */ + public TimeType getValueTimeType() throws FHIRException { + if (!(this.value instanceof TimeType)) + throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + public boolean hasValueTimeType() { + return this.value instanceof TimeType; + } + + /** + * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) + */ + public StringType getValueStringType() throws FHIRException { + if (!(this.value instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + public boolean hasValueStringType() { + return this.value instanceof StringType; + } + + /** + * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) + */ + public Coding getValueCoding() throws FHIRException { + if (!(this.value instanceof Coding)) + throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Coding) this.value; + } + + public boolean hasValueCoding() { + return this.value instanceof Coding; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) + */ + public QuestionnaireItemOptionComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value[x]", "integer|date|time|string|Coding", "Identifies a specific answer that's allowed as the answer to a question.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 111972721: // value + this.value = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("value[x]")) + this.value = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1410166417: return getValue(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDate")) { + this.value = new DateType(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueCoding")) { + this.value = new Coding(); + return this.value; + } + else + return super.addChild(name); + } + + public QuestionnaireItemOptionComponent copy() { + QuestionnaireItemOptionComponent dst = new QuestionnaireItemOptionComponent(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionnaireItemOptionComponent)) + return false; + QuestionnaireItemOptionComponent o = (QuestionnaireItemOptionComponent) other; + return compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionnaireItemOptionComponent)) + return false; + QuestionnaireItemOptionComponent o = (QuestionnaireItemOptionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "Questionnaire.item.option"; + + } + + } + + /** + * An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Globally unique logical identifier for questionnaire", formalDefinition="An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published." ) + protected UriType url; + + /** + * This records identifiers associated with this question set 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, modifier=false, summary=true) + @Description(shortDefinition="External identifiers for this questionnaire", formalDefinition="This records identifiers associated with this question set 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 version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical identifier for this version of Questionnaire", formalDefinition="The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated." ) + protected StringType version; + + /** + * The lifecycle status of the questionnaire as a whole. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | published | retired", formalDefinition="The lifecycle status of the questionnaire as a whole." ) + protected Enumeration status; + + /** + * The date that this questionnaire was last changed. + */ + @Child(name = "date", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date this version was authored", formalDefinition="The date that this questionnaire was last changed." ) + protected DateTimeType date; + + /** + * Organization or person responsible for developing and maintaining the questionnaire. + */ + @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization/individual who designed the questionnaire", formalDefinition="Organization or person responsible for developing and maintaining the questionnaire." ) + protected StringType publisher; + + /** + * Contact details to assist a user in finding and communicating with the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. "Pediatric", "Admissions", "Research", "Demographic", "Opinion Survey", etc. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Questionnaire intends to support these contexts", formalDefinition="A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. \"Pediatric\", \"Admissions\", \"Research\", \"Demographic\", \"Opinion Survey\", etc." ) + protected List useContext; + + /** + * The name or label associated with this questionnaire. + */ + @Child(name = "title", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name for the questionnaire", formalDefinition="The name or label associated with this questionnaire." ) + protected StringType title; + + /** + * Identifies a how this question or group of questions is known in a particular terminology such as LOINC. + */ + @Child(name = "concept", type = {Coding.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Concept that represents the overall questionnaire", formalDefinition="Identifies a how this question or group of questions is known in a particular terminology such as LOINC." ) + protected List concept; + + /** + * Identifies the types of subjects that can be the subject of the questionnaire. + */ + @Child(name = "subjectType", type = {CodeType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Resource that can be subject of QuestionnaireResponse", formalDefinition="Identifies the types of subjects that can be the subject of the questionnaire." ) + protected List subjectType; + + /** + * The questions and groupings of questions that make up the questionnaire. + */ + @Child(name = "item", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Questions and sections within the Questionnaire", formalDefinition="The questions and groupings of questions that make up the questionnaire." ) + protected List item; + + private static final long serialVersionUID = 1271324566L; + + /** + * Constructor + */ + public Questionnaire() { + super(); + } + + /** + * Constructor + */ + public Questionnaire(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Questionnaire setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. + */ + public Questionnaire setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this question set 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} (This records identifiers associated with this question set 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; + } + + // syntactic sugar + public Questionnaire addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Questionnaire setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + public Questionnaire setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The lifecycle status of the questionnaire as a whole.). 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 Questionnaire.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new QuestionnaireStatusEnumFactory()); // bb + 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 lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Questionnaire setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The lifecycle status of the questionnaire as a whole. + */ + public QuestionnaireStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The lifecycle status of the questionnaire as a whole. + */ + public Questionnaire setStatus(QuestionnaireStatus value) { + if (this.status == null) + this.status = new Enumeration(new QuestionnaireStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @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) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 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; + return this; + } + + /** + * @return The date that this questionnaire was last changed. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that this questionnaire was last changed. + */ + public Questionnaire setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (Organization or person responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Organization or person responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public Questionnaire setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Organization or person responsible for developing and maintaining the questionnaire. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Organization or person responsible for developing and maintaining the questionnaire. + */ + public Questionnaire setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + 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} (Contact details to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public Questionnaire addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #useContext} (A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. "Pediatric", "Admissions", "Research", "Demographic", "Opinion Survey", etc.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. "Pediatric", "Admissions", "Research", "Demographic", "Opinion Survey", etc.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public Questionnaire addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #title} (The name or label associated with this questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The name or label associated with this questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public Questionnaire setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The name or label associated with this questionnaire. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The name or label associated with this questionnaire. + */ + public Questionnaire setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Identifies a how this question or group of questions is known in a particular terminology such as LOINC.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (Coding item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Identifies a how this question or group of questions is known in a particular terminology such as LOINC.) + */ + // syntactic sugar + public Coding addConcept() { //3 + Coding t = new Coding(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public Questionnaire addConcept(Coding t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + /** + * @return {@link #subjectType} (Identifies the types of subjects that can be the subject of the questionnaire.) + */ + public List getSubjectType() { + if (this.subjectType == null) + this.subjectType = new ArrayList(); + return this.subjectType; + } + + public boolean hasSubjectType() { + if (this.subjectType == null) + return false; + for (CodeType item : this.subjectType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subjectType} (Identifies the types of subjects that can be the subject of the questionnaire.) + */ + // syntactic sugar + public CodeType addSubjectTypeElement() {//2 + CodeType t = new CodeType(); + if (this.subjectType == null) + this.subjectType = new ArrayList(); + this.subjectType.add(t); + return t; + } + + /** + * @param value {@link #subjectType} (Identifies the types of subjects that can be the subject of the questionnaire.) + */ + public Questionnaire addSubjectType(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.subjectType == null) + this.subjectType = new ArrayList(); + this.subjectType.add(t); + return this; + } + + /** + * @param value {@link #subjectType} (Identifies the types of subjects that can be the subject of the questionnaire.) + */ + public boolean hasSubjectType(String value) { + if (this.subjectType == null) + return false; + for (CodeType v : this.subjectType) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #item} (The questions and groupings of questions that make up the questionnaire.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (QuestionnaireItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (The questions and groupings of questions that make up the questionnaire.) + */ + // syntactic sugar + public QuestionnaireItemComponent addItem() { //3 + QuestionnaireItemComponent t = new QuestionnaireItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public Questionnaire addItem(QuestionnaireItemComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this question set 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("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 questionnaire was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("publisher", "string", "Organization or person responsible for developing and maintaining the questionnaire.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("useContext", "CodeableConcept", "A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. \"Pediatric\", \"Admissions\", \"Research\", \"Demographic\", \"Opinion Survey\", etc.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("title", "string", "The name or label associated with this questionnaire.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("concept", "Coding", "Identifies a how this question or group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("subjectType", "code", "Identifies the types of subjects that can be the subject of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, subjectType)); + childrenList.add(new Property("item", "", "The questions and groupings of questions that make up the questionnaire.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // Coding + case -603200890: /*subjectType*/ return this.subjectType == null ? new Base[0] : this.subjectType.toArray(new Base[this.subjectType.size()]); // CodeType + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireItemComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case -892481550: // status + this.status = new QuestionnaireStatusEnumFactory().fromType(value); // Enumeration + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case 951024232: // concept + this.getConcept().add(castToCoding(value)); // Coding + break; + case -603200890: // subjectType + this.getSubjectType().add(castToCode(value)); // CodeType + break; + case 3242771: // item + this.getItem().add((QuestionnaireItemComponent) value); // QuestionnaireItemComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("status")) + this.status = new QuestionnaireStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("concept")) + this.getConcept().add(castToCoding(value)); + else if (name.equals("subjectType")) + this.getSubjectType().add(castToCode(value)); + else if (name.equals("item")) + this.getItem().add((QuestionnaireItemComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return addIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + case -669707736: return addUseContext(); // CodeableConcept + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case 951024232: return addConcept(); // Coding + case -603200890: throw new FHIRException("Cannot make property subjectType as it is not a complex type"); // CodeType + case 3242771: return addItem(); // QuestionnaireItemComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.url"); + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.version"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.status"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.date"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.publisher"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.title"); + } + else if (name.equals("concept")) { + return addConcept(); + } + else if (name.equals("subjectType")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.subjectType"); + } + else if (name.equals("item")) { + return addItem(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Questionnaire"; + + } + + public Questionnaire copy() { + Questionnaire dst = new Questionnaire(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.title = title == null ? null : title.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (Coding i : concept) + dst.concept.add(i.copy()); + }; + if (subjectType != null) { + dst.subjectType = new ArrayList(); + for (CodeType i : subjectType) + dst.subjectType.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (QuestionnaireItemComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + protected Questionnaire typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Questionnaire)) + return false; + Questionnaire o = (Questionnaire) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(telecom, o.telecom, true) && compareDeep(useContext, o.useContext, true) && compareDeep(title, o.title, true) + && compareDeep(concept, o.concept, true) && compareDeep(subjectType, o.subjectType, true) && compareDeep(item, o.item, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Questionnaire)) + return false; + Questionnaire o = (Questionnaire) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(status, o.status, true) + && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(title, o.title, true) + && compareValues(subjectType, o.subjectType, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (title == null || title.isEmpty()) && (concept == null || concept.isEmpty()) && (subjectType == null || subjectType.isEmpty()) + && (item == null || item.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Questionnaire; + } + + /** + * Search parameter: title + *

+ * Description: All or part of the name of the questionnaire
+ * Type: string
+ * Path: Questionnaire.title
+ *

+ */ + @SearchParamDefinition(name="title", path="Questionnaire.title", description="All or part of the name of the questionnaire", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: All or part of the name of the questionnaire
+ * Type: string
+ * Path: Questionnaire.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: status + *

+ * Description: The status of the questionnaire
+ * Type: token
+ * Path: Questionnaire.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Questionnaire.status", description="The status of the questionnaire", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The status of the questionnaire
+ * Type: token
+ * Path: Questionnaire.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the questionnaire
+ * Type: token
+ * Path: Questionnaire.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="Questionnaire.useContext", description="A use context assigned to the questionnaire", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the questionnaire
+ * Type: token
+ * Path: Questionnaire.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: code + *

+ * Description: A code that corresponds to the questionnaire or one of its groups
+ * Type: token
+ * Path: Questionnaire.item.concept
+ *

+ */ + @SearchParamDefinition(name="code", path="Questionnaire.item.concept", description="A code that corresponds to the questionnaire or one of its groups", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: A code that corresponds to the questionnaire or one of its groups
+ * Type: token
+ * Path: Questionnaire.item.concept
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: When the questionnaire was last changed
+ * Type: date
+ * Path: Questionnaire.date
+ *

+ */ + @SearchParamDefinition(name="date", path="Questionnaire.date", description="When the questionnaire was last changed", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When the questionnaire was last changed
+ * Type: date
+ * Path: Questionnaire.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: An identifier for the questionnaire
+ * Type: token
+ * Path: Questionnaire.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Questionnaire.identifier", description="An identifier for the questionnaire", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: An identifier for the questionnaire
+ * Type: token
+ * Path: Questionnaire.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: version + *

+ * Description: The business version of the questionnaire
+ * Type: string
+ * Path: Questionnaire.version
+ *

+ */ + @SearchParamDefinition(name="version", path="Questionnaire.version", description="The business version of the questionnaire", type="string" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The business version of the questionnaire
+ * Type: string
+ * Path: Questionnaire.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); + + /** + * Search parameter: publisher + *

+ * Description: The author of the questionnaire
+ * Type: string
+ * Path: Questionnaire.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="Questionnaire.publisher", description="The author of the questionnaire", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: The author of the questionnaire
+ * Type: string
+ * Path: Questionnaire.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/QuestionnaireResponse.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/QuestionnaireResponse.java new file mode 100644 index 00000000000..a6ca47dfbd9 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/QuestionnaireResponse.java @@ -0,0 +1,1854 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ +@ResourceDef(name="QuestionnaireResponse", profile="http://hl7.org/fhir/Profile/QuestionnaireResponse") +public class QuestionnaireResponse extends DomainResource { + + public enum QuestionnaireResponseStatus { + /** + * This QuestionnaireResponse has been partially filled out with answers, but changes or additions are still expected to be made to it. + */ + INPROGRESS, + /** + * This QuestionnaireResponse has been filled out with answers, and the current content is regarded as definitive. + */ + COMPLETED, + /** + * This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards. + */ + AMENDED, + /** + * added to help the parsers + */ + NULL; + public static QuestionnaireResponseStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("amended".equals(codeString)) + return AMENDED; + throw new FHIRException("Unknown QuestionnaireResponseStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case AMENDED: return "amended"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return "http://hl7.org/fhir/questionnaire-answers-status"; + case COMPLETED: return "http://hl7.org/fhir/questionnaire-answers-status"; + case AMENDED: return "http://hl7.org/fhir/questionnaire-answers-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "This QuestionnaireResponse has been partially filled out with answers, but changes or additions are still expected to be made to it."; + case COMPLETED: return "This QuestionnaireResponse has been filled out with answers, and the current content is regarded as definitive."; + case AMENDED: return "This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Completed"; + case AMENDED: return "Amended"; + default: return "?"; + } + } + } + + public static class QuestionnaireResponseStatusEnumFactory implements EnumFactory { + public QuestionnaireResponseStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return QuestionnaireResponseStatus.INPROGRESS; + if ("completed".equals(codeString)) + return QuestionnaireResponseStatus.COMPLETED; + if ("amended".equals(codeString)) + return QuestionnaireResponseStatus.AMENDED; + throw new IllegalArgumentException("Unknown QuestionnaireResponseStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return new Enumeration(this, QuestionnaireResponseStatus.INPROGRESS); + if ("completed".equals(codeString)) + return new Enumeration(this, QuestionnaireResponseStatus.COMPLETED); + if ("amended".equals(codeString)) + return new Enumeration(this, QuestionnaireResponseStatus.AMENDED); + throw new FHIRException("Unknown QuestionnaireResponseStatus code '"+codeString+"'"); + } + public String toCode(QuestionnaireResponseStatus code) { + if (code == QuestionnaireResponseStatus.INPROGRESS) + return "in-progress"; + if (code == QuestionnaireResponseStatus.COMPLETED) + return "completed"; + if (code == QuestionnaireResponseStatus.AMENDED) + return "amended"; + return "?"; + } + public String toSystem(QuestionnaireResponseStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class QuestionnaireResponseItemComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. + */ + @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Corresponding item within Questionnaire", formalDefinition="Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource." ) + protected StringType linkId; + + /** + * Text that is displayed above the contents of the group or as the text of the question being answered. + */ + @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name for group or question text", formalDefinition="Text that is displayed above the contents of the group or as the text of the question being answered." ) + protected StringType text; + + /** + * More specific subject this section's answers are about, details the subject given in QuestionnaireResponse. + */ + @Child(name = "subject", type = {}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The subject this group's answers are about", formalDefinition="More specific subject this section's answers are about, details the subject given in QuestionnaireResponse." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) + */ + protected Resource subjectTarget; + + /** + * The respondent's answer(s) to the question. + */ + @Child(name = "answer", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." ) + protected List answer; + + /** + * Questions or sub-groups nested beneath a question or group. + */ + @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Nested questionnaire response items", formalDefinition="Questions or sub-groups nested beneath a question or group." ) + protected List item; + + private static final long serialVersionUID = 1059526517L; + + /** + * Constructor + */ + public QuestionnaireResponseItemComponent() { + super(); + } + + /** + * @return {@link #linkId} (Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); // bb + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public QuestionnaireResponseItemComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. + */ + public QuestionnaireResponseItemComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (Text that is displayed above the contents of the group or as the text of the question being answered.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); // bb + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Text that is displayed above the contents of the group or as the text of the question being answered.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public QuestionnaireResponseItemComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Text that is displayed above the contents of the group or as the text of the question being answered. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Text that is displayed above the contents of the group or as the text of the question being answered. + */ + public QuestionnaireResponseItemComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) + */ + public QuestionnaireResponseItemComponent 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. (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) + */ + public Resource getSubjectTarget() { + 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. (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) + */ + public QuestionnaireResponseItemComponent setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #answer} (The respondent's answer(s) to the question.) + */ + public List getAnswer() { + if (this.answer == null) + this.answer = new ArrayList(); + return this.answer; + } + + public boolean hasAnswer() { + if (this.answer == null) + return false; + for (QuestionnaireResponseItemAnswerComponent item : this.answer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #answer} (The respondent's answer(s) to the question.) + */ + // syntactic sugar + public QuestionnaireResponseItemAnswerComponent addAnswer() { //3 + QuestionnaireResponseItemAnswerComponent t = new QuestionnaireResponseItemAnswerComponent(); + if (this.answer == null) + this.answer = new ArrayList(); + this.answer.add(t); + return t; + } + + // syntactic sugar + public QuestionnaireResponseItemComponent addAnswer(QuestionnaireResponseItemAnswerComponent t) { //3 + if (t == null) + return this; + if (this.answer == null) + this.answer = new ArrayList(); + this.answer.add(t); + return this; + } + + /** + * @return {@link #item} (Questions or sub-groups nested beneath a question or group.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (QuestionnaireResponseItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (Questions or sub-groups nested beneath a question or group.) + */ + // syntactic sugar + public QuestionnaireResponseItemComponent addItem() { //3 + QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public QuestionnaireResponseItemComponent addItem(QuestionnaireResponseItemComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("text", "string", "Text that is displayed above the contents of the group or as the text of the question being answered.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("subject", "Reference(Any)", "More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer)); + childrenList.add(new Property("item", "@QuestionnaireResponse.item", "Questions or sub-groups nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType + case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // QuestionnaireResponseItemAnswerComponent + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1102667083: // linkId + this.linkId = castToString(value); // StringType + break; + case 3556653: // text + this.text = castToString(value); // StringType + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -1412808770: // answer + this.getAnswer().add((QuestionnaireResponseItemAnswerComponent) value); // QuestionnaireResponseItemAnswerComponent + break; + case 3242771: // item + this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("linkId")) + this.linkId = castToString(value); // StringType + else if (name.equals("text")) + this.text = castToString(value); // StringType + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("answer")) + this.getAnswer().add((QuestionnaireResponseItemAnswerComponent) value); + else if (name.equals("item")) + this.getItem().add((QuestionnaireResponseItemComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1102667083: throw new FHIRException("Cannot make property linkId as it is not a complex type"); // StringType + case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType + case -1867885268: return getSubject(); // Reference + case -1412808770: return addAnswer(); // QuestionnaireResponseItemAnswerComponent + case 3242771: return addItem(); // QuestionnaireResponseItemComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("linkId")) { + throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.linkId"); + } + else if (name.equals("text")) { + throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.text"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("answer")) { + return addAnswer(); + } + else if (name.equals("item")) { + return addItem(); + } + else + return super.addChild(name); + } + + public QuestionnaireResponseItemComponent copy() { + QuestionnaireResponseItemComponent dst = new QuestionnaireResponseItemComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + dst.text = text == null ? null : text.copy(); + dst.subject = subject == null ? null : subject.copy(); + if (answer != null) { + dst.answer = new ArrayList(); + for (QuestionnaireResponseItemAnswerComponent i : answer) + dst.answer.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (QuestionnaireResponseItemComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionnaireResponseItemComponent)) + return false; + QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other; + return compareDeep(linkId, o.linkId, true) && compareDeep(text, o.text, true) && compareDeep(subject, o.subject, true) + && compareDeep(answer, o.answer, true) && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionnaireResponseItemComponent)) + return false; + QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other; + return compareValues(linkId, o.linkId, true) && compareValues(text, o.text, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (text == null || text.isEmpty()) + && (subject == null || subject.isEmpty()) && (answer == null || answer.isEmpty()) && (item == null || item.isEmpty()) + ; + } + + public String fhirType() { + return "QuestionnaireResponse.item"; + + } + + } + + @Block() + public static class QuestionnaireResponseItemAnswerComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The answer (or one of the answers) provided by the respondent to the question. + */ + @Child(name = "value", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Single-valued answer to the question", formalDefinition="The answer (or one of the answers) provided by the respondent to the question." ) + protected Type value; + + /** + * Nested groups and/or questions found within this particular answer. + */ + @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Nested groups and questions", formalDefinition="Nested groups and/or questions found within this particular answer." ) + protected List item; + + private static final long serialVersionUID = 2052422636L; + + /** + * Constructor + */ + public QuestionnaireResponseItemAnswerComponent() { + super(); + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public BooleanType getValueBooleanType() throws FHIRException { + if (!(this.value instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + public boolean hasValueBooleanType() { + return this.value instanceof BooleanType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public DecimalType getValueDecimalType() throws FHIRException { + if (!(this.value instanceof DecimalType)) + throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DecimalType) this.value; + } + + public boolean hasValueDecimalType() { + return this.value instanceof DecimalType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public IntegerType getValueIntegerType() throws FHIRException { + if (!(this.value instanceof IntegerType)) + throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IntegerType) this.value; + } + + public boolean hasValueIntegerType() { + return this.value instanceof IntegerType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public DateType getValueDateType() throws FHIRException { + if (!(this.value instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateType) this.value; + } + + public boolean hasValueDateType() { + return this.value instanceof DateType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public DateTimeType getValueDateTimeType() throws FHIRException { + if (!(this.value instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + public boolean hasValueDateTimeType() { + return this.value instanceof DateTimeType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public InstantType getValueInstantType() throws FHIRException { + if (!(this.value instanceof InstantType)) + throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (InstantType) this.value; + } + + public boolean hasValueInstantType() { + return this.value instanceof InstantType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public TimeType getValueTimeType() throws FHIRException { + if (!(this.value instanceof TimeType)) + throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + public boolean hasValueTimeType() { + return this.value instanceof TimeType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public StringType getValueStringType() throws FHIRException { + if (!(this.value instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + public boolean hasValueStringType() { + return this.value instanceof StringType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public UriType getValueUriType() throws FHIRException { + if (!(this.value instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (UriType) this.value; + } + + public boolean hasValueUriType() { + return this.value instanceof UriType; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public Attachment getValueAttachment() throws FHIRException { + if (!(this.value instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + public boolean hasValueAttachment() { + return this.value instanceof Attachment; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public Coding getValueCoding() throws FHIRException { + if (!(this.value instanceof Coding)) + throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Coding) this.value; + } + + public boolean hasValueCoding() { + return this.value instanceof Coding; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public Quantity getValueQuantity() throws FHIRException { + if (!(this.value instanceof Quantity)) + throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + public boolean hasValueQuantity() { + return this.value instanceof Quantity; + } + + /** + * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public Reference getValueReference() throws FHIRException { + if (!(this.value instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Reference) this.value; + } + + public boolean hasValueReference() { + return this.value instanceof Reference; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) + */ + public QuestionnaireResponseItemAnswerComponent setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #item} (Nested groups and/or questions found within this particular answer.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (QuestionnaireResponseItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (Nested groups and/or questions found within this particular answer.) + */ + // syntactic sugar + public QuestionnaireResponseItemComponent addItem() { //3 + QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public QuestionnaireResponseItemAnswerComponent addItem(QuestionnaireResponseItemComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("item", "@QuestionnaireResponse.item", "Nested groups and/or questions found within this particular answer.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 111972721: // value + this.value = (Type) value; // Type + break; + case 3242771: // item + this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("value[x]")) + this.value = (Type) value; // Type + else if (name.equals("item")) + this.getItem().add((QuestionnaireResponseItemComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1410166417: return getValue(); // Type + case 3242771: return addItem(); // QuestionnaireResponseItemComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueDecimal")) { + this.value = new DecimalType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDate")) { + this.value = new DateType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valueInstant")) { + this.value = new InstantType(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueUri")) { + this.value = new UriType(); + return this.value; + } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueCoding")) { + this.value = new Coding(); + return this.value; + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueReference")) { + this.value = new Reference(); + return this.value; + } + else if (name.equals("item")) { + return addItem(); + } + else + return super.addChild(name); + } + + public QuestionnaireResponseItemAnswerComponent copy() { + QuestionnaireResponseItemAnswerComponent dst = new QuestionnaireResponseItemAnswerComponent(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (QuestionnaireResponseItemComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionnaireResponseItemAnswerComponent)) + return false; + QuestionnaireResponseItemAnswerComponent o = (QuestionnaireResponseItemAnswerComponent) other; + return compareDeep(value, o.value, true) && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionnaireResponseItemAnswerComponent)) + return false; + QuestionnaireResponseItemAnswerComponent o = (QuestionnaireResponseItemAnswerComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (item == null || item.isEmpty()) + ; + } + + public String fhirType() { + return "QuestionnaireResponse.item.answer"; + + } + + } + + /** + * A business identifier assigned to a particular completed (or partially completed) questionnaire. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique id for this set of answers", formalDefinition="A business identifier assigned to a particular completed (or partially completed) questionnaire." ) + protected Identifier identifier; + + /** + * Indicates the Questionnaire resource that defines the form for which answers are being provided. + */ + @Child(name = "questionnaire", type = {Questionnaire.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Form being answered", formalDefinition="Indicates the Questionnaire resource that defines the form for which answers are being provided." ) + protected Reference questionnaire; + + /** + * The actual object that is the target of the reference (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + protected Questionnaire questionnaireTarget; + + /** + * The lifecycle status of the questionnaire response as a whole. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="in-progress | completed | amended", formalDefinition="The lifecycle status of the questionnaire response as a whole." ) + protected Enumeration status; + + /** + * The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. + */ + @Child(name = "subject", type = {}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The subject of the questions", formalDefinition="The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + protected Resource subjectTarget; + + /** + * Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system. + */ + @Child(name = "author", type = {Device.class, Practitioner.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Person who received and recorded the answers", formalDefinition="Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) + */ + protected Resource authorTarget; + + /** + * The date and/or time that this version of the questionnaire response was authored. + */ + @Child(name = "authored", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date this version was authored", formalDefinition="The date and/or time that this version of the questionnaire response was authored." ) + protected DateTimeType authored; + + /** + * The person who answered the questions about the subject. + */ + @Child(name = "source", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The person who answered the questions", formalDefinition="The person who answered the questions about the subject." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (The person who answered the questions about the subject.) + */ + protected Resource sourceTarget; + + /** + * Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. + */ + @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Primary encounter during which the answers were collected", formalDefinition="Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + protected Encounter encounterTarget; + + /** + * Corresponds to a group or question item from the original questionnaire. + */ + @Child(name = "item", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Groups and questions", formalDefinition="Corresponds to a group or question item from the original questionnaire." ) + protected List item; + + private static final long serialVersionUID = 850624885L; + + /** + * Constructor + */ + public QuestionnaireResponse() { + super(); + } + + /** + * Constructor + */ + public QuestionnaireResponse(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) + */ + public QuestionnaireResponse setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public Reference getQuestionnaire() { + if (this.questionnaire == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.questionnaire"); + else if (Configuration.doAutoCreate()) + this.questionnaire = new Reference(); // cc + return this.questionnaire; + } + + public boolean hasQuestionnaire() { + return this.questionnaire != null && !this.questionnaire.isEmpty(); + } + + /** + * @param value {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public QuestionnaireResponse setQuestionnaire(Reference value) { + this.questionnaire = value; + return this; + } + + /** + * @return {@link #questionnaire} 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. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public Questionnaire getQuestionnaireTarget() { + if (this.questionnaireTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.questionnaire"); + else if (Configuration.doAutoCreate()) + this.questionnaireTarget = new Questionnaire(); // aa + return this.questionnaireTarget; + } + + /** + * @param value {@link #questionnaire} 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. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public QuestionnaireResponse setQuestionnaireTarget(Questionnaire value) { + this.questionnaireTarget = value; + return this; + } + + /** + * @return {@link #status} (The lifecycle status of the questionnaire response as a whole.). 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 QuestionnaireResponse.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new QuestionnaireResponseStatusEnumFactory()); // bb + 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 lifecycle status of the questionnaire response as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public QuestionnaireResponse setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The lifecycle status of the questionnaire response as a whole. + */ + public QuestionnaireResponseStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The lifecycle status of the questionnaire response as a whole. + */ + public QuestionnaireResponse setStatus(QuestionnaireResponseStatus value) { + if (this.status == null) + this.status = new Enumeration(new QuestionnaireResponseStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #subject} (The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public QuestionnaireResponse 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 subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public Resource getSubjectTarget() { + 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 subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public QuestionnaireResponse setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); // cc + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) + */ + public QuestionnaireResponse setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} 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 received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} 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 received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) + */ + public QuestionnaireResponse setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #authored} (The date and/or time that this version of the questionnaire response was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + */ + public DateTimeType getAuthoredElement() { + if (this.authored == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.authored"); + else if (Configuration.doAutoCreate()) + this.authored = new DateTimeType(); // bb + return this.authored; + } + + public boolean hasAuthoredElement() { + return this.authored != null && !this.authored.isEmpty(); + } + + public boolean hasAuthored() { + return this.authored != null && !this.authored.isEmpty(); + } + + /** + * @param value {@link #authored} (The date and/or time that this version of the questionnaire response was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + */ + public QuestionnaireResponse setAuthoredElement(DateTimeType value) { + this.authored = value; + return this; + } + + /** + * @return The date and/or time that this version of the questionnaire response was authored. + */ + public Date getAuthored() { + return this.authored == null ? null : this.authored.getValue(); + } + + /** + * @param value The date and/or time that this version of the questionnaire response was authored. + */ + public QuestionnaireResponse setAuthored(Date value) { + if (value == null) + this.authored = null; + else { + if (this.authored == null) + this.authored = new DateTimeType(); + this.authored.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (The person who answered the questions about the subject.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The person who answered the questions about the subject.) + */ + public QuestionnaireResponse 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. (The person who answered the questions about the subject.) + */ + public Resource getSourceTarget() { + 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. (The person who answered the questions about the subject.) + */ + public QuestionnaireResponse setSourceTarget(Resource value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #encounter} (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public QuestionnaireResponse 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. (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponse.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public QuestionnaireResponse setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #item} (Corresponds to a group or question item from the original questionnaire.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (QuestionnaireResponseItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (Corresponds to a group or question item from the original questionnaire.) + */ + // syntactic sugar + public QuestionnaireResponseItemComponent addItem() { //3 + QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + // syntactic sugar + public QuestionnaireResponse addItem(QuestionnaireResponseItemComponent t) { //3 + if (t == null) + return this; + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("questionnaire", "Reference(Questionnaire)", "Indicates the Questionnaire resource that defines the form for which answers are being provided.", 0, java.lang.Integer.MAX_VALUE, questionnaire)); + childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire response as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("subject", "Reference(Any)", "The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Device|Practitioner|Patient|RelatedPerson)", "Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("authored", "dateTime", "The date and/or time that this version of the questionnaire response was authored.", 0, java.lang.Integer.MAX_VALUE, authored)); + childrenList.add(new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "The person who answered the questions about the subject.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("item", "", "Corresponds to a group or question item from the original questionnaire.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -1017049693: /*questionnaire*/ return this.questionnaire == null ? new Base[0] : new Base[] {this.questionnaire}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference + case 1433073514: /*authored*/ return this.authored == null ? new Base[0] : new Base[] {this.authored}; // DateTimeType + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -1017049693: // questionnaire + this.questionnaire = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new QuestionnaireResponseStatusEnumFactory().fromType(value); // Enumeration + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -1406328437: // author + this.author = castToReference(value); // Reference + break; + case 1433073514: // authored + this.authored = castToDateTime(value); // DateTimeType + break; + case -896505829: // source + this.source = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 3242771: // item + this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("questionnaire")) + this.questionnaire = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new QuestionnaireResponseStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("author")) + this.author = castToReference(value); // Reference + else if (name.equals("authored")) + this.authored = castToDateTime(value); // DateTimeType + else if (name.equals("source")) + this.source = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("item")) + this.getItem().add((QuestionnaireResponseItemComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -1017049693: return getQuestionnaire(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -1867885268: return getSubject(); // Reference + case -1406328437: return getAuthor(); // Reference + case 1433073514: throw new FHIRException("Cannot make property authored as it is not a complex type"); // DateTimeType + case -896505829: return getSource(); // Reference + case 1524132147: return getEncounter(); // Reference + case 3242771: return addItem(); // QuestionnaireResponseItemComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("questionnaire")) { + this.questionnaire = new Reference(); + return this.questionnaire; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.status"); + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("author")) { + this.author = new Reference(); + return this.author; + } + else if (name.equals("authored")) { + throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.authored"); + } + else if (name.equals("source")) { + this.source = new Reference(); + return this.source; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("item")) { + return addItem(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "QuestionnaireResponse"; + + } + + public QuestionnaireResponse copy() { + QuestionnaireResponse dst = new QuestionnaireResponse(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.questionnaire = questionnaire == null ? null : questionnaire.copy(); + dst.status = status == null ? null : status.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.author = author == null ? null : author.copy(); + dst.authored = authored == null ? null : authored.copy(); + dst.source = source == null ? null : source.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (QuestionnaireResponseItemComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + protected QuestionnaireResponse typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof QuestionnaireResponse)) + return false; + QuestionnaireResponse o = (QuestionnaireResponse) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(questionnaire, o.questionnaire, true) + && compareDeep(status, o.status, true) && compareDeep(subject, o.subject, true) && compareDeep(author, o.author, true) + && compareDeep(authored, o.authored, true) && compareDeep(source, o.source, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(item, o.item, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof QuestionnaireResponse)) + return false; + QuestionnaireResponse o = (QuestionnaireResponse) other; + return compareValues(status, o.status, true) && compareValues(authored, o.authored, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (questionnaire == null || questionnaire.isEmpty()) + && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) + && (authored == null || authored.isEmpty()) && (source == null || source.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (item == null || item.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.QuestionnaireResponse; + } + + /** + * Search parameter: author + *

+ * Description: The author of the questionnaire
+ * Type: reference
+ * Path: QuestionnaireResponse.author
+ *

+ */ + @SearchParamDefinition(name="author", path="QuestionnaireResponse.author", description="The author of the questionnaire", type="reference" ) + public static final String SP_AUTHOR = "author"; + /** + * Fluent Client search parameter constant for author + *

+ * Description: The author of the questionnaire
+ * Type: reference
+ * Path: QuestionnaireResponse.author
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "QuestionnaireResponse:author". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:author").toLocked(); + + /** + * Search parameter: questionnaire + *

+ * Description: The questionnaire the answers are provided for
+ * Type: reference
+ * Path: QuestionnaireResponse.questionnaire
+ *

+ */ + @SearchParamDefinition(name="questionnaire", path="QuestionnaireResponse.questionnaire", description="The questionnaire the answers are provided for", type="reference" ) + public static final String SP_QUESTIONNAIRE = "questionnaire"; + /** + * Fluent Client search parameter constant for questionnaire + *

+ * Description: The questionnaire the answers are provided for
+ * Type: reference
+ * Path: QuestionnaireResponse.questionnaire
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam QUESTIONNAIRE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_QUESTIONNAIRE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "QuestionnaireResponse:questionnaire". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_QUESTIONNAIRE = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:questionnaire").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: The patient that is the subject of the questionnaire
+ * Type: reference
+ * Path: QuestionnaireResponse.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="QuestionnaireResponse.subject", description="The patient that is the subject of the questionnaire", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The patient that is the subject of the questionnaire
+ * Type: reference
+ * Path: QuestionnaireResponse.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "QuestionnaireResponse:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:patient").toLocked(); + + /** + * Search parameter: authored + *

+ * Description: When the questionnaire was authored
+ * Type: date
+ * Path: QuestionnaireResponse.authored
+ *

+ */ + @SearchParamDefinition(name="authored", path="QuestionnaireResponse.authored", description="When the questionnaire was authored", type="date" ) + public static final String SP_AUTHORED = "authored"; + /** + * Fluent Client search parameter constant for authored + *

+ * Description: When the questionnaire was authored
+ * Type: date
+ * Path: QuestionnaireResponse.authored
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED); + + /** + * Search parameter: source + *

+ * Description: The person who answered the questions
+ * Type: reference
+ * Path: QuestionnaireResponse.source
+ *

+ */ + @SearchParamDefinition(name="source", path="QuestionnaireResponse.source", description="The person who answered the questions", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: The person who answered the questions
+ * Type: reference
+ * Path: QuestionnaireResponse.source
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "QuestionnaireResponse:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:source").toLocked(); + + /** + * Search parameter: status + *

+ * Description: The status of the questionnaire response
+ * Type: token
+ * Path: QuestionnaireResponse.status
+ *

+ */ + @SearchParamDefinition(name="status", path="QuestionnaireResponse.status", description="The status of the questionnaire response", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The status of the questionnaire response
+ * Type: token
+ * Path: QuestionnaireResponse.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: The subject of the questionnaire
+ * Type: reference
+ * Path: QuestionnaireResponse.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="QuestionnaireResponse.subject", description="The subject of the questionnaire", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: The subject of the questionnaire
+ * Type: reference
+ * Path: QuestionnaireResponse.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "QuestionnaireResponse:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:subject").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Encounter during which questionnaire was authored
+ * Type: reference
+ * Path: QuestionnaireResponse.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="QuestionnaireResponse.encounter", description="Encounter during which questionnaire was authored", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Encounter during which questionnaire was authored
+ * Type: reference
+ * Path: QuestionnaireResponse.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "QuestionnaireResponse:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:encounter").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Range.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Range.java new file mode 100644 index 00000000000..03335656917 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Range.java @@ -0,0 +1,226 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A set of ordered Quantities defined by a low and high limit. + */ +@DatatypeDef(name="Range") +public class Range extends Type implements ICompositeType { + + /** + * The low limit. The boundary is inclusive. + */ + @Child(name = "low", type = {SimpleQuantity.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Low limit", formalDefinition="The low limit. The boundary is inclusive." ) + protected SimpleQuantity low; + + /** + * The high limit. The boundary is inclusive. + */ + @Child(name = "high", type = {SimpleQuantity.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="High limit", formalDefinition="The high limit. The boundary is inclusive." ) + protected SimpleQuantity high; + + private static final long serialVersionUID = 1699187994L; + + /** + * Constructor + */ + public Range() { + super(); + } + + /** + * @return {@link #low} (The low limit. The boundary is inclusive.) + */ + public SimpleQuantity getLow() { + if (this.low == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Range.low"); + else if (Configuration.doAutoCreate()) + this.low = new SimpleQuantity(); // cc + return this.low; + } + + public boolean hasLow() { + return this.low != null && !this.low.isEmpty(); + } + + /** + * @param value {@link #low} (The low limit. The boundary is inclusive.) + */ + public Range setLow(SimpleQuantity value) { + this.low = value; + return this; + } + + /** + * @return {@link #high} (The high limit. The boundary is inclusive.) + */ + public SimpleQuantity getHigh() { + if (this.high == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Range.high"); + else if (Configuration.doAutoCreate()) + this.high = new SimpleQuantity(); // cc + return this.high; + } + + public boolean hasHigh() { + return this.high != null && !this.high.isEmpty(); + } + + /** + * @param value {@link #high} (The high limit. The boundary is inclusive.) + */ + public Range setHigh(SimpleQuantity value) { + this.high = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("low", "SimpleQuantity", "The low limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, low)); + childrenList.add(new Property("high", "SimpleQuantity", "The high limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, high)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 107348: /*low*/ return this.low == null ? new Base[0] : new Base[] {this.low}; // SimpleQuantity + case 3202466: /*high*/ return this.high == null ? new Base[0] : new Base[] {this.high}; // SimpleQuantity + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 107348: // low + this.low = castToSimpleQuantity(value); // SimpleQuantity + break; + case 3202466: // high + this.high = castToSimpleQuantity(value); // SimpleQuantity + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("low")) + this.low = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("high")) + this.high = castToSimpleQuantity(value); // SimpleQuantity + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 107348: return getLow(); // SimpleQuantity + case 3202466: return getHigh(); // SimpleQuantity + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("low")) { + this.low = new SimpleQuantity(); + return this.low; + } + else if (name.equals("high")) { + this.high = new SimpleQuantity(); + return this.high; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Range"; + + } + + public Range copy() { + Range dst = new Range(); + copyValues(dst); + dst.low = low == null ? null : low.copy(); + dst.high = high == null ? null : high.copy(); + return dst; + } + + protected Range typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Range)) + return false; + Range o = (Range) other; + return compareDeep(low, o.low, true) && compareDeep(high, o.high, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Range)) + return false; + Range o = (Range) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Ratio.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Ratio.java new file mode 100644 index 00000000000..9e79e8a92a6 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Ratio.java @@ -0,0 +1,227 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A relationship of two Quantity values - expressed as a numerator and a denominator. + */ +@DatatypeDef(name="Ratio") +public class Ratio extends Type implements ICompositeType { + + /** + * The value of the numerator. + */ + @Child(name = "numerator", type = {Quantity.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Numerator value", formalDefinition="The value of the numerator." ) + protected Quantity numerator; + + /** + * The value of the denominator. + */ + @Child(name = "denominator", type = {Quantity.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Denominator value", formalDefinition="The value of the denominator." ) + protected Quantity denominator; + + private static final long serialVersionUID = 479922563L; + + /** + * Constructor + */ + public Ratio() { + super(); + } + + /** + * @return {@link #numerator} (The value of the numerator.) + */ + public Quantity getNumerator() { + if (this.numerator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Ratio.numerator"); + else if (Configuration.doAutoCreate()) + this.numerator = new Quantity(); // cc + return this.numerator; + } + + public boolean hasNumerator() { + return this.numerator != null && !this.numerator.isEmpty(); + } + + /** + * @param value {@link #numerator} (The value of the numerator.) + */ + public Ratio setNumerator(Quantity value) { + this.numerator = value; + return this; + } + + /** + * @return {@link #denominator} (The value of the denominator.) + */ + public Quantity getDenominator() { + if (this.denominator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Ratio.denominator"); + else if (Configuration.doAutoCreate()) + this.denominator = new Quantity(); // cc + return this.denominator; + } + + public boolean hasDenominator() { + return this.denominator != null && !this.denominator.isEmpty(); + } + + /** + * @param value {@link #denominator} (The value of the denominator.) + */ + public Ratio setDenominator(Quantity value) { + this.denominator = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("numerator", "Quantity", "The value of the numerator.", 0, java.lang.Integer.MAX_VALUE, numerator)); + childrenList.add(new Property("denominator", "Quantity", "The value of the denominator.", 0, java.lang.Integer.MAX_VALUE, denominator)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1747334793: /*numerator*/ return this.numerator == null ? new Base[0] : new Base[] {this.numerator}; // Quantity + case -1983274394: /*denominator*/ return this.denominator == null ? new Base[0] : new Base[] {this.denominator}; // Quantity + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1747334793: // numerator + this.numerator = castToQuantity(value); // Quantity + break; + case -1983274394: // denominator + this.denominator = castToQuantity(value); // Quantity + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("numerator")) + this.numerator = castToQuantity(value); // Quantity + else if (name.equals("denominator")) + this.denominator = castToQuantity(value); // Quantity + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1747334793: return getNumerator(); // Quantity + case -1983274394: return getDenominator(); // Quantity + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("numerator")) { + this.numerator = new Quantity(); + return this.numerator; + } + else if (name.equals("denominator")) { + this.denominator = new Quantity(); + return this.denominator; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Ratio"; + + } + + public Ratio copy() { + Ratio dst = new Ratio(); + copyValues(dst); + dst.numerator = numerator == null ? null : numerator.copy(); + dst.denominator = denominator == null ? null : denominator.copy(); + return dst; + } + + protected Ratio typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Ratio)) + return false; + Ratio o = (Ratio) other; + return compareDeep(numerator, o.numerator, true) && compareDeep(denominator, o.denominator, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Ratio)) + return false; + Ratio o = (Ratio) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (numerator == null || numerator.isEmpty()) && (denominator == null || denominator.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Reference.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Reference.java new file mode 100644 index 00000000000..d41b39eb232 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Reference.java @@ -0,0 +1,321 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IAnyResource; +import org.hl7.fhir.instance.model.api.IBaseReference; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.instance.model.api.IIdType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A reference from one resource to another. + */ +@DatatypeDef(name="Reference") +public class Reference extends BaseReference implements IBaseReference, ICompositeType { + + /** + * A reference to a location at which the other resource is found. The reference may be 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. + */ + @Child(name = "reference", type = {StringType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Relative, internal or absolute URL reference", formalDefinition="A reference to a location at which the other resource is found. The reference may be 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. + */ + @Child(name = "display", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Text alternative for the resource", formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference." ) + protected StringType display; + + private static final long serialVersionUID = 22777321L; + + /** + * Constructor + */ + public Reference() { + super(); + } + + /** + * Constructor + * + * @param theReference The given reference string (e.g. "Patient/123" or "http://example.com/Patient/123") + */ + public Reference(String theReference) { + super(theReference); + } + + /** + * Constructor + * + * @param theReference The given reference as an IdType (e.g. "Patient/123" or "http://example.com/Patient/123") + */ + public Reference(IIdType theReference) { + super(theReference); + } + + /** + * Constructor + * + * @param theResource The resource represented by this reference + */ + public Reference(IAnyResource theResource) { + super(theResource); + } + + /** + * @return {@link #reference} (A reference to a location at which the other resource is found. The reference may be 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.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public StringType getReferenceElement_() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reference.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new StringType(); // bb + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (A reference to a location at which the other resource is found. The reference may be 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.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public Reference setReferenceElement(StringType value) { + this.reference = value; + return this; + } + + /** + * @return A reference to a location at which the other resource is found. The reference may be 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 getReference() { + 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 be 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 Reference setReference(String value) { + if (Utilities.noString(value)) + 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.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reference.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public Reference setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Plain text narrative that identifies the resource in addition to the resource reference. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Plain text narrative that identifies the resource in addition to the resource reference. + */ + public Reference setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * Convenience setter which sets the reference to the complete {@link IIdType#getValue() value} of the given + * reference. + * + * @param theReference The reference, or null + * @return + * @return Returns a reference to this + */ + public Reference setReferenceElement(IIdType theReference) { + if (theReference != null) { + setReference(theReference.getValue()); + } else { + setReference(null); + } + 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 be 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // StringType + case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -925155509: // reference + this.reference = castToString(value); // StringType + break; + case 1671764162: // display + this.display = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("reference")) + this.reference = castToString(value); // StringType + else if (name.equals("display")) + this.display = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // StringType + case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("reference")) { + throw new FHIRException("Cannot call addChild on a primitive type Reference.reference"); + } + else if (name.equals("display")) { + throw new FHIRException("Cannot call addChild on a primitive type Reference.display"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Reference"; + + } + + public Reference copy() { + Reference dst = new Reference(); + copyValues(dst); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + return dst; + } + + protected Reference typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Reference)) + return false; + Reference o = (Reference) other; + return compareDeep(reference, o.reference, true) && compareDeep(display, o.display, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Reference)) + return false; + Reference o = (Reference) other; + return compareValues(reference, o.reference, true) && compareValues(display, o.display, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ReferralRequest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ReferralRequest.java new file mode 100644 index 00000000000..1c6d883bde2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ReferralRequest.java @@ -0,0 +1,1759 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. + */ +@ResourceDef(name="ReferralRequest", profile="http://hl7.org/fhir/Profile/ReferralRequest") +public class ReferralRequest extends DomainResource { + + public enum ReferralStatus { + /** + * A draft referral that has yet to be send. + */ + DRAFT, + /** + * The referral is complete and is ready for fulfillment. + */ + ACTIVE, + /** + * The referral has been cancelled without being completed. For example it is no longer needed. + */ + CANCELLED, + /** + * The referral has been completely actioned. + */ + COMPLETED, + /** + * This referral record should never have existed, though it's possible some degree of real-world activity or decisions may have been taken due to its existence + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static ReferralStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown ReferralStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case CANCELLED: return "cancelled"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return "http://hl7.org/fhir/referralstatus"; + case ACTIVE: return "http://hl7.org/fhir/referralstatus"; + case CANCELLED: return "http://hl7.org/fhir/referralstatus"; + case COMPLETED: return "http://hl7.org/fhir/referralstatus"; + case ENTEREDINERROR: return "http://hl7.org/fhir/referralstatus"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "A draft referral that has yet to be send."; + case ACTIVE: return "The referral is complete and is ready for fulfillment."; + case CANCELLED: return "The referral has been cancelled without being completed. For example it is no longer needed."; + case COMPLETED: return "The referral has been completely actioned."; + case ENTEREDINERROR: return "This referral record should never have existed, though it's possible some degree of real-world activity or decisions may have been taken due to its existence"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case ACTIVE: return "Active"; + case CANCELLED: return "Cancelled"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + 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; + if ("draft".equals(codeString)) + return ReferralStatus.DRAFT; + if ("active".equals(codeString)) + return ReferralStatus.ACTIVE; + if ("cancelled".equals(codeString)) + return ReferralStatus.CANCELLED; + if ("completed".equals(codeString)) + return ReferralStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return ReferralStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ReferralStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return new Enumeration(this, ReferralStatus.DRAFT); + if ("active".equals(codeString)) + return new Enumeration(this, ReferralStatus.ACTIVE); + if ("cancelled".equals(codeString)) + return new Enumeration(this, ReferralStatus.CANCELLED); + if ("completed".equals(codeString)) + return new Enumeration(this, ReferralStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, ReferralStatus.ENTEREDINERROR); + throw new FHIRException("Unknown ReferralStatus code '"+codeString+"'"); + } + public String toCode(ReferralStatus code) { + if (code == ReferralStatus.DRAFT) + return "draft"; + if (code == ReferralStatus.ACTIVE) + return "active"; + if (code == ReferralStatus.CANCELLED) + return "cancelled"; + if (code == ReferralStatus.COMPLETED) + return "completed"; + if (code == ReferralStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(ReferralStatus code) { + return code.getSystem(); + } + } + + public enum ReferralCategory { + /** + * The referral request represents a suggestion or recommendation that a referral be made. + */ + PROPOSAL, + /** + * The referral request represents an intention by the author to make a referral, but no actual referral has yet been made/authorized. + */ + PLAN, + /** + * This is an actual referral request which, when active, will have the authorizations needed to allow it to be actioned. + */ + REQUEST, + /** + * added to help the parsers + */ + NULL; + public static ReferralCategory fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return PROPOSAL; + if ("plan".equals(codeString)) + return PLAN; + if ("request".equals(codeString)) + return REQUEST; + throw new FHIRException("Unknown ReferralCategory code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSAL: return "proposal"; + case PLAN: return "plan"; + case REQUEST: return "request"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSAL: return "http://hl7.org/fhir/referralcategory"; + case PLAN: return "http://hl7.org/fhir/referralcategory"; + case REQUEST: return "http://hl7.org/fhir/referralcategory"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSAL: return "The referral request represents a suggestion or recommendation that a referral be made."; + case PLAN: return "The referral request represents an intention by the author to make a referral, but no actual referral has yet been made/authorized."; + case REQUEST: return "This is an actual referral request which, when active, will have the authorizations needed to allow it to be actioned."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSAL: return "Proposal"; + case PLAN: return "Plan"; + case REQUEST: return "Request"; + default: return "?"; + } + } + } + + public static class ReferralCategoryEnumFactory implements EnumFactory { + public ReferralCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return ReferralCategory.PROPOSAL; + if ("plan".equals(codeString)) + return ReferralCategory.PLAN; + if ("request".equals(codeString)) + return ReferralCategory.REQUEST; + throw new IllegalArgumentException("Unknown ReferralCategory code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return new Enumeration(this, ReferralCategory.PROPOSAL); + if ("plan".equals(codeString)) + return new Enumeration(this, ReferralCategory.PLAN); + if ("request".equals(codeString)) + return new Enumeration(this, ReferralCategory.REQUEST); + throw new FHIRException("Unknown ReferralCategory code '"+codeString+"'"); + } + public String toCode(ReferralCategory code) { + if (code == ReferralCategory.PROPOSAL) + return "proposal"; + if (code == ReferralCategory.PLAN) + return "plan"; + if (code == ReferralCategory.REQUEST) + return "request"; + return "?"; + } + public String toSystem(ReferralCategory code) { + return code.getSystem(); + } + } + + /** + * Business identifier that uniquely identifies the referral/care transfer request instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Business identifier", formalDefinition="Business identifier that uniquely identifies the referral/care transfer request instance." ) + protected List identifier; + + /** + * Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part. + */ + @Child(name = "basedOn", type = {ReferralRequest.class, CarePlan.class, DiagnosticOrder.class, ProcedureRequest.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Request fulfilled by this request", formalDefinition="Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part." ) + protected List basedOn; + /** + * The actual objects that are the target of the reference (Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.) + */ + protected List basedOnTarget; + + + /** + * The business identifier of the logical "grouping" request/order that this referral is a part of. + */ + @Child(name = "parent", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Composite request this is part of", formalDefinition="The business identifier of the logical \"grouping\" request/order that this referral is a part of." ) + protected Identifier parent; + + /** + * The status of the authorization/intention reflected by the referral request record. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | cancelled | completed | entered-in-error", formalDefinition="The status of the authorization/intention reflected by the referral request record." ) + protected Enumeration status; + + /** + * Distinguishes the "level" of authorization/demand implicit in this request. + */ + @Child(name = "category", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="proposal | plan | request", formalDefinition="Distinguishes the \"level\" of authorization/demand implicit in this request." ) + protected Enumeration category; + + /** + * An indication of the type of referral (or where applicable the type of transfer of care) request. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Referral/Transition of care request type", formalDefinition="An indication of the type of referral (or where applicable the type of transfer of care) request." ) + protected CodeableConcept type; + + /** + * An indication of the urgency of referral (or where applicable the type of transfer of care) request. + */ + @Child(name = "priority", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Urgency of referral / transfer of care request", formalDefinition="An indication of the urgency of referral (or where applicable the type of transfer of care) request." ) + protected CodeableConcept priority; + + /** + * The patient who is the subject of a referral or transfer of care request. + */ + @Child(name = "patient", type = {Patient.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient referred to care or transfer", formalDefinition="The patient who is the subject of a referral or transfer of care request." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient who is the subject of a referral or transfer of care request.) + */ + protected Patient patientTarget; + + /** + * The encounter at which the request for referral or transfer of care is initiated. + */ + @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Originating encounter", formalDefinition="The encounter at which the request for referral or transfer of care is initiated." ) + protected Reference context; + + /** + * The actual object that is the target of the reference (The encounter at which the request for referral or transfer of care is initiated.) + */ + protected Resource contextTarget; + + /** + * The period of time within which the services identified in the referral/transfer of care is specified or required to occur. + */ + @Child(name = "fulfillmentTime", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Requested service(s) fulfillment time", formalDefinition="The period of time within which the services identified in the referral/transfer of care is specified or required to occur." ) + protected Period fulfillmentTime; + + /** + * Date/DateTime of creation for draft requests and date of activation for active requests. + */ + @Child(name = "authored", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date of creation/activation", formalDefinition="Date/DateTime of creation for draft requests and date of activation for active requests." ) + protected DateTimeType authored; + + /** + * The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral). + */ + @Child(name = "requester", type = {Practitioner.class, Organization.class, Patient.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Requester of referral / transfer of care", formalDefinition="The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral)." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) + */ + protected Resource requesterTarget; + + /** + * Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The clinical specialty (discipline) that the referral is requested for", formalDefinition="Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology." ) + protected CodeableConcept specialty; + + /** + * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request. + */ + @Child(name = "recipient", type = {Practitioner.class, Organization.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Receiver of referral / transfer of care request", formalDefinition="The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + protected List recipientTarget; + + + /** + * Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason for referral / transfer of care request", formalDefinition="Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management." ) + protected CodeableConcept reason; + + /** + * The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + @Child(name = "description", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="A textual description of the referral", formalDefinition="The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary." ) + protected StringType description; + + /** + * The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion. + */ + @Child(name = "serviceRequested", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Actions requested as part of the referral", formalDefinition="The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion." ) + protected List serviceRequested; + + /** + * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan. + */ + @Child(name = "supportingInformation", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Additonal information to support referral or transfer of care request", formalDefinition="Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan." ) + protected List supportingInformation; + /** + * The actual objects that are the target of the reference (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.) + */ + protected List supportingInformationTarget; + + + private static final long serialVersionUID = -1030392098L; + + /** + * Constructor + */ + public ReferralRequest() { + super(); + } + + /** + * Constructor + */ + public ReferralRequest(Enumeration status, Enumeration category) { + super(); + this.status = status; + this.category = category; + } + + /** + * @return {@link #identifier} (Business identifier that uniquely identifies the referral/care transfer request instance.) + */ + 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} (Business identifier that uniquely identifies the referral/care transfer request instance.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #basedOn} (Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.) + */ + public List getBasedOn() { + if (this.basedOn == null) + this.basedOn = new ArrayList(); + return this.basedOn; + } + + public boolean hasBasedOn() { + if (this.basedOn == null) + return false; + for (Reference item : this.basedOn) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #basedOn} (Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.) + */ + // syntactic sugar + public Reference addBasedOn() { //3 + Reference t = new Reference(); + if (this.basedOn == null) + this.basedOn = new ArrayList(); + this.basedOn.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addBasedOn(Reference t) { //3 + if (t == null) + return this; + if (this.basedOn == null) + this.basedOn = new ArrayList(); + this.basedOn.add(t); + return this; + } + + /** + * @return {@link #basedOn} (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. Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.) + */ + public List getBasedOnTarget() { + if (this.basedOnTarget == null) + this.basedOnTarget = new ArrayList(); + return this.basedOnTarget; + } + + /** + * @return {@link #parent} (The business identifier of the logical "grouping" request/order that this referral is a part of.) + */ + public Identifier getParent() { + if (this.parent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.parent"); + else if (Configuration.doAutoCreate()) + this.parent = new Identifier(); // cc + return this.parent; + } + + public boolean hasParent() { + return this.parent != null && !this.parent.isEmpty(); + } + + /** + * @param value {@link #parent} (The business identifier of the logical "grouping" request/order that this referral is a part of.) + */ + public ReferralRequest setParent(Identifier value) { + this.parent = value; + return this; + } + + /** + * @return {@link #status} (The status of the authorization/intention reflected by the referral request 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 ReferralRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ReferralStatusEnumFactory()); // bb + 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 authorization/intention reflected by the referral request record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ReferralRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the authorization/intention reflected by the referral request record. + */ + public ReferralStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the authorization/intention reflected by the referral request record. + */ + public ReferralRequest setStatus(ReferralStatus value) { + if (this.status == null) + this.status = new Enumeration(new ReferralStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #category} (Distinguishes the "level" of authorization/demand implicit in this request.). 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 ReferralRequest.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new ReferralCategoryEnumFactory()); // bb + 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} (Distinguishes the "level" of authorization/demand implicit in this request.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public ReferralRequest setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return Distinguishes the "level" of authorization/demand implicit in this request. + */ + public ReferralCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value Distinguishes the "level" of authorization/demand implicit in this request. + */ + public ReferralRequest setCategory(ReferralCategory value) { + if (this.category == null) + this.category = new Enumeration(new ReferralCategoryEnumFactory()); + this.category.setValue(value); + return this; + } + + /** + * @return {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) + */ + public ReferralRequest setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); // cc + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) + */ + public ReferralRequest setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + /** + * @return {@link #patient} (The patient who is the subject of a referral or transfer of care request.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient who is the subject of a referral or transfer of care request.) + */ + public ReferralRequest 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 who is the subject of a referral or transfer of care request.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 who is the subject of a referral or transfer of care request.) + */ + public ReferralRequest setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #context} (The encounter at which the request for referral or transfer of care is initiated.) + */ + public Reference getContext() { + if (this.context == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.context"); + else if (Configuration.doAutoCreate()) + this.context = new Reference(); // cc + return this.context; + } + + public boolean hasContext() { + return this.context != null && !this.context.isEmpty(); + } + + /** + * @param value {@link #context} (The encounter at which the request for referral or transfer of care is initiated.) + */ + public ReferralRequest setContext(Reference value) { + this.context = value; + return this; + } + + /** + * @return {@link #context} 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 at which the request for referral or transfer of care is initiated.) + */ + public Resource getContextTarget() { + return this.contextTarget; + } + + /** + * @param value {@link #context} 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 at which the request for referral or transfer of care is initiated.) + */ + public ReferralRequest setContextTarget(Resource value) { + this.contextTarget = value; + return this; + } + + /** + * @return {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) + */ + public Period getFulfillmentTime() { + if (this.fulfillmentTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.fulfillmentTime"); + else if (Configuration.doAutoCreate()) + this.fulfillmentTime = new Period(); // cc + return this.fulfillmentTime; + } + + public boolean hasFulfillmentTime() { + return this.fulfillmentTime != null && !this.fulfillmentTime.isEmpty(); + } + + /** + * @param value {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) + */ + public ReferralRequest setFulfillmentTime(Period value) { + this.fulfillmentTime = value; + return this; + } + + /** + * @return {@link #authored} (Date/DateTime of creation for draft requests and date of activation for active requests.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + */ + public DateTimeType getAuthoredElement() { + if (this.authored == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.authored"); + else if (Configuration.doAutoCreate()) + this.authored = new DateTimeType(); // bb + return this.authored; + } + + public boolean hasAuthoredElement() { + return this.authored != null && !this.authored.isEmpty(); + } + + public boolean hasAuthored() { + return this.authored != null && !this.authored.isEmpty(); + } + + /** + * @param value {@link #authored} (Date/DateTime of creation for draft requests and date of activation for active requests.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + */ + public ReferralRequest setAuthoredElement(DateTimeType value) { + this.authored = value; + return this; + } + + /** + * @return Date/DateTime of creation for draft requests and date of activation for active requests. + */ + public Date getAuthored() { + return this.authored == null ? null : this.authored.getValue(); + } + + /** + * @param value Date/DateTime of creation for draft requests and date of activation for active requests. + */ + public ReferralRequest setAuthored(Date value) { + if (value == null) + this.authored = null; + else { + if (this.authored == null) + this.authored = new DateTimeType(); + this.authored.setValue(value); + } + return this; + } + + /** + * @return {@link #requester} (The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); // cc + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public ReferralRequest setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} 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 healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public Resource getRequesterTarget() { + return this.requesterTarget; + } + + /** + * @param value {@link #requester} 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 healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public ReferralRequest setRequesterTarget(Resource value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology.) + */ + public CodeableConcept getSpecialty() { + if (this.specialty == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.specialty"); + else if (Configuration.doAutoCreate()) + this.specialty = new CodeableConcept(); // cc + return this.specialty; + } + + public boolean hasSpecialty() { + return this.specialty != null && !this.specialty.isEmpty(); + } + + /** + * @param value {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology.) + */ + public ReferralRequest setSpecialty(CodeableConcept value) { + this.specialty = value; + return this; + } + + /** + * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + 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 healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addRecipient(Reference t) { //3 + if (t == null) + return this; + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return this; + } + + /** + * @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 healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management.) + */ + public ReferralRequest setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #description} (The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). 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 ReferralRequest.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ReferralRequest setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + public ReferralRequest 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 #serviceRequested} (The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion.) + */ + public List getServiceRequested() { + if (this.serviceRequested == null) + this.serviceRequested = new ArrayList(); + return this.serviceRequested; + } + + public boolean hasServiceRequested() { + if (this.serviceRequested == null) + return false; + for (CodeableConcept item : this.serviceRequested) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion.) + */ + // syntactic sugar + public CodeableConcept addServiceRequested() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceRequested == null) + this.serviceRequested = new ArrayList(); + this.serviceRequested.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addServiceRequested(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.serviceRequested == null) + this.serviceRequested = new ArrayList(); + this.serviceRequested.add(t); + return this; + } + + /** + * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.) + */ + public List getSupportingInformation() { + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + return this.supportingInformation; + } + + public boolean hasSupportingInformation() { + if (this.supportingInformation == null) + return false; + for (Reference item : this.supportingInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.) + */ + // syntactic sugar + public Reference addSupportingInformation() { //3 + Reference t = new Reference(); + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return t; + } + + // syntactic sugar + public ReferralRequest addSupportingInformation(Reference t) { //3 + if (t == null) + return this; + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return this; + } + + /** + * @return {@link #supportingInformation} (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. Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.) + */ + public List getSupportingInformationTarget() { + if (this.supportingInformationTarget == null) + this.supportingInformationTarget = new ArrayList(); + return this.supportingInformationTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Business identifier that uniquely identifies the referral/care transfer request instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("basedOn", "Reference(ReferralRequest|CarePlan|DiagnosticOrder|ProcedureRequest)", "Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.", 0, java.lang.Integer.MAX_VALUE, basedOn)); + childrenList.add(new Property("parent", "Identifier", "The business identifier of the logical \"grouping\" request/order that this referral is a part of.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("status", "code", "The status of the authorization/intention reflected by the referral request record.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("category", "code", "Distinguishes the \"level\" of authorization/demand implicit in this request.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("type", "CodeableConcept", "An indication of the type of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("priority", "CodeableConcept", "An indication of the urgency of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient who is the subject of a referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter at which the request for referral or transfer of care is initiated.", 0, java.lang.Integer.MAX_VALUE, context)); + childrenList.add(new Property("fulfillmentTime", "Period", "The period of time within which the services identified in the referral/transfer of care is specified or required to occur.", 0, java.lang.Integer.MAX_VALUE, fulfillmentTime)); + childrenList.add(new Property("authored", "dateTime", "Date/DateTime of creation for draft requests and date of activation for active requests.", 0, java.lang.Integer.MAX_VALUE, authored)); + childrenList.add(new Property("requester", "Reference(Practitioner|Organization|Patient)", "The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("specialty", "CodeableConcept", "Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("recipient", "Reference(Practitioner|Organization)", "The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("reason", "CodeableConcept", "Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("description", "string", "The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("serviceRequested", "CodeableConcept", "The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion.", 0, java.lang.Integer.MAX_VALUE, serviceRequested)); + childrenList.add(new Property("supportingInformation", "Reference(Any)", "Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference + case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference + case 1098185163: /*fulfillmentTime*/ return this.fulfillmentTime == null ? new Base[0] : new Base[] {this.fulfillmentTime}; // Period + case 1433073514: /*authored*/ return this.authored == null ? new Base[0] : new Base[] {this.authored}; // DateTimeType + case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference + case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : new Base[] {this.specialty}; // CodeableConcept + case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 190229561: /*serviceRequested*/ return this.serviceRequested == null ? new Base[0] : this.serviceRequested.toArray(new Base[this.serviceRequested.size()]); // CodeableConcept + case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -332612366: // basedOn + this.getBasedOn().add(castToReference(value)); // Reference + break; + case -995424086: // parent + this.parent = castToIdentifier(value); // Identifier + break; + case -892481550: // status + this.status = new ReferralStatusEnumFactory().fromType(value); // Enumeration + break; + case 50511102: // category + this.category = new ReferralCategoryEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1165461084: // priority + this.priority = castToCodeableConcept(value); // CodeableConcept + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 951530927: // context + this.context = castToReference(value); // Reference + break; + case 1098185163: // fulfillmentTime + this.fulfillmentTime = castToPeriod(value); // Period + break; + case 1433073514: // authored + this.authored = castToDateTime(value); // DateTimeType + break; + case 693933948: // requester + this.requester = castToReference(value); // Reference + break; + case -1694759682: // specialty + this.specialty = castToCodeableConcept(value); // CodeableConcept + break; + case 820081177: // recipient + this.getRecipient().add(castToReference(value)); // Reference + break; + case -934964668: // reason + this.reason = castToCodeableConcept(value); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 190229561: // serviceRequested + this.getServiceRequested().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1248768647: // supportingInformation + this.getSupportingInformation().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("basedOn")) + this.getBasedOn().add(castToReference(value)); + else if (name.equals("parent")) + this.parent = castToIdentifier(value); // Identifier + else if (name.equals("status")) + this.status = new ReferralStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("category")) + this.category = new ReferralCategoryEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("priority")) + this.priority = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("context")) + this.context = castToReference(value); // Reference + else if (name.equals("fulfillmentTime")) + this.fulfillmentTime = castToPeriod(value); // Period + else if (name.equals("authored")) + this.authored = castToDateTime(value); // DateTimeType + else if (name.equals("requester")) + this.requester = castToReference(value); // Reference + else if (name.equals("specialty")) + this.specialty = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("recipient")) + this.getRecipient().add(castToReference(value)); + else if (name.equals("reason")) + this.reason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("serviceRequested")) + this.getServiceRequested().add(castToCodeableConcept(value)); + else if (name.equals("supportingInformation")) + this.getSupportingInformation().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -332612366: return addBasedOn(); // Reference + case -995424086: return getParent(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration + case 3575610: return getType(); // CodeableConcept + case -1165461084: return getPriority(); // CodeableConcept + case -791418107: return getPatient(); // Reference + case 951530927: return getContext(); // Reference + case 1098185163: return getFulfillmentTime(); // Period + case 1433073514: throw new FHIRException("Cannot make property authored as it is not a complex type"); // DateTimeType + case 693933948: return getRequester(); // Reference + case -1694759682: return getSpecialty(); // CodeableConcept + case 820081177: return addRecipient(); // Reference + case -934964668: return getReason(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 190229561: return addServiceRequested(); // CodeableConcept + case -1248768647: return addSupportingInformation(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("basedOn")) { + return addBasedOn(); + } + else if (name.equals("parent")) { + this.parent = new Identifier(); + return this.parent; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ReferralRequest.status"); + } + else if (name.equals("category")) { + throw new FHIRException("Cannot call addChild on a primitive type ReferralRequest.category"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("priority")) { + this.priority = new CodeableConcept(); + return this.priority; + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("context")) { + this.context = new Reference(); + return this.context; + } + else if (name.equals("fulfillmentTime")) { + this.fulfillmentTime = new Period(); + return this.fulfillmentTime; + } + else if (name.equals("authored")) { + throw new FHIRException("Cannot call addChild on a primitive type ReferralRequest.authored"); + } + else if (name.equals("requester")) { + this.requester = new Reference(); + return this.requester; + } + else if (name.equals("specialty")) { + this.specialty = new CodeableConcept(); + return this.specialty; + } + else if (name.equals("recipient")) { + return addRecipient(); + } + else if (name.equals("reason")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ReferralRequest.description"); + } + else if (name.equals("serviceRequested")) { + return addServiceRequested(); + } + else if (name.equals("supportingInformation")) { + return addSupportingInformation(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ReferralRequest"; + + } + + public ReferralRequest copy() { + ReferralRequest dst = new ReferralRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (basedOn != null) { + dst.basedOn = new ArrayList(); + for (Reference i : basedOn) + dst.basedOn.add(i.copy()); + }; + dst.parent = parent == null ? null : parent.copy(); + dst.status = status == null ? null : status.copy(); + dst.category = category == null ? null : category.copy(); + dst.type = type == null ? null : type.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.context = context == null ? null : context.copy(); + dst.fulfillmentTime = fulfillmentTime == null ? null : fulfillmentTime.copy(); + dst.authored = authored == null ? null : authored.copy(); + dst.requester = requester == null ? null : requester.copy(); + dst.specialty = specialty == null ? null : specialty.copy(); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + dst.reason = reason == null ? null : reason.copy(); + dst.description = description == null ? null : description.copy(); + if (serviceRequested != null) { + dst.serviceRequested = new ArrayList(); + for (CodeableConcept i : serviceRequested) + dst.serviceRequested.add(i.copy()); + }; + if (supportingInformation != null) { + dst.supportingInformation = new ArrayList(); + for (Reference i : supportingInformation) + dst.supportingInformation.add(i.copy()); + }; + return dst; + } + + protected ReferralRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ReferralRequest)) + return false; + ReferralRequest o = (ReferralRequest) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(parent, o.parent, true) + && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) && compareDeep(type, o.type, true) + && compareDeep(priority, o.priority, true) && compareDeep(patient, o.patient, true) && compareDeep(context, o.context, true) + && compareDeep(fulfillmentTime, o.fulfillmentTime, true) && compareDeep(authored, o.authored, true) + && compareDeep(requester, o.requester, true) && compareDeep(specialty, o.specialty, true) && compareDeep(recipient, o.recipient, true) + && compareDeep(reason, o.reason, true) && compareDeep(description, o.description, true) && compareDeep(serviceRequested, o.serviceRequested, true) + && compareDeep(supportingInformation, o.supportingInformation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ReferralRequest)) + return false; + ReferralRequest o = (ReferralRequest) other; + return compareValues(status, o.status, true) && compareValues(category, o.category, true) && compareValues(authored, o.authored, true) + && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (basedOn == null || basedOn.isEmpty()) + && (parent == null || parent.isEmpty()) && (status == null || status.isEmpty()) && (category == null || category.isEmpty()) + && (type == null || type.isEmpty()) && (priority == null || priority.isEmpty()) && (patient == null || patient.isEmpty()) + && (context == null || context.isEmpty()) && (fulfillmentTime == null || fulfillmentTime.isEmpty()) + && (authored == null || authored.isEmpty()) && (requester == null || requester.isEmpty()) + && (specialty == null || specialty.isEmpty()) && (recipient == null || recipient.isEmpty()) + && (reason == null || reason.isEmpty()) && (description == null || description.isEmpty()) + && (serviceRequested == null || serviceRequested.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ReferralRequest; + } + + /** + * Search parameter: category + *

+ * Description: Proposal, plan or request
+ * Type: token
+ * Path: ReferralRequest.category
+ *

+ */ + @SearchParamDefinition(name="category", path="ReferralRequest.category", description="Proposal, plan or request", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: Proposal, plan or request
+ * Type: token
+ * Path: ReferralRequest.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: requester + *

+ * Description: Requester of referral / transfer of care
+ * Type: reference
+ * Path: ReferralRequest.requester
+ *

+ */ + @SearchParamDefinition(name="requester", path="ReferralRequest.requester", description="Requester of referral / transfer of care", type="reference" ) + public static final String SP_REQUESTER = "requester"; + /** + * Fluent Client search parameter constant for requester + *

+ * Description: Requester of referral / transfer of care
+ * Type: reference
+ * Path: ReferralRequest.requester
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ReferralRequest:requester". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("ReferralRequest:requester").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: Who the referral is about
+ * Type: reference
+ * Path: ReferralRequest.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="ReferralRequest.patient", description="Who the referral is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who the referral is about
+ * Type: reference
+ * Path: ReferralRequest.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ReferralRequest:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ReferralRequest:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: The status of the referral
+ * Type: token
+ * Path: ReferralRequest.status
+ *

+ */ + @SearchParamDefinition(name="status", path="ReferralRequest.status", description="The status of the referral", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The status of the referral
+ * Type: token
+ * Path: ReferralRequest.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: priority + *

+ * Description: The priority assigned to the referral
+ * Type: token
+ * Path: ReferralRequest.priority
+ *

+ */ + @SearchParamDefinition(name="priority", path="ReferralRequest.priority", description="The priority assigned to the referral", type="token" ) + public static final String SP_PRIORITY = "priority"; + /** + * Fluent Client search parameter constant for priority + *

+ * Description: The priority assigned to the referral
+ * Type: token
+ * Path: ReferralRequest.priority
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); + + /** + * Search parameter: basedon + *

+ * Description: Request being fulfilled
+ * Type: reference
+ * Path: ReferralRequest.basedOn
+ *

+ */ + @SearchParamDefinition(name="basedon", path="ReferralRequest.basedOn", description="Request being fulfilled", type="reference" ) + public static final String SP_BASEDON = "basedon"; + /** + * Fluent Client search parameter constant for basedon + *

+ * Description: Request being fulfilled
+ * Type: reference
+ * Path: ReferralRequest.basedOn
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASEDON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASEDON); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ReferralRequest:basedon". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_BASEDON = new ca.uhn.fhir.model.api.Include("ReferralRequest:basedon").toLocked(); + + /** + * Search parameter: context + *

+ * Description: Part of encounter or episode of care
+ * Type: reference
+ * Path: ReferralRequest.context
+ *

+ */ + @SearchParamDefinition(name="context", path="ReferralRequest.context", description="Part of encounter or episode of care", type="reference" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: Part of encounter or episode of care
+ * Type: reference
+ * Path: ReferralRequest.context
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ReferralRequest:context". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("ReferralRequest:context").toLocked(); + + /** + * Search parameter: parent + *

+ * Description: Part of common request
+ * Type: token
+ * Path: ReferralRequest.parent
+ *

+ */ + @SearchParamDefinition(name="parent", path="ReferralRequest.parent", description="Part of common request", type="token" ) + public static final String SP_PARENT = "parent"; + /** + * Fluent Client search parameter constant for parent + *

+ * Description: Part of common request
+ * Type: token
+ * Path: ReferralRequest.parent
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PARENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PARENT); + + /** + * Search parameter: type + *

+ * Description: The type of the referral
+ * Type: token
+ * Path: ReferralRequest.type
+ *

+ */ + @SearchParamDefinition(name="type", path="ReferralRequest.type", description="The type of the referral", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The type of the referral
+ * Type: token
+ * Path: ReferralRequest.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: date + *

+ * Description: Creation or activation date
+ * Type: date
+ * Path: ReferralRequest.authored
+ *

+ */ + @SearchParamDefinition(name="date", path="ReferralRequest.authored", description="Creation or activation date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Creation or activation date
+ * Type: date
+ * Path: ReferralRequest.authored
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: specialty + *

+ * Description: The specialty that the referral is for
+ * Type: token
+ * Path: ReferralRequest.specialty
+ *

+ */ + @SearchParamDefinition(name="specialty", path="ReferralRequest.specialty", description="The specialty that the referral is for", type="token" ) + public static final String SP_SPECIALTY = "specialty"; + /** + * Fluent Client search parameter constant for specialty + *

+ * Description: The specialty that the referral is for
+ * Type: token
+ * Path: ReferralRequest.specialty
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY); + + /** + * Search parameter: recipient + *

+ * Description: The person that the referral was sent to
+ * Type: reference
+ * Path: ReferralRequest.recipient
+ *

+ */ + @SearchParamDefinition(name="recipient", path="ReferralRequest.recipient", description="The person that the referral was sent to", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + /** + * Fluent Client search parameter constant for recipient + *

+ * Description: The person that the referral was sent to
+ * Type: reference
+ * Path: ReferralRequest.recipient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ReferralRequest:recipient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("ReferralRequest:recipient").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/RelatedPerson.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/RelatedPerson.java new file mode 100644 index 00000000000..f451d012713 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/RelatedPerson.java @@ -0,0 +1,1055 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. + */ +@ResourceDef(name="RelatedPerson", profile="http://hl7.org/fhir/Profile/RelatedPerson") +public class RelatedPerson extends DomainResource { + + /** + * Identifier for a person within a particular scope. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) + protected List identifier; + + /** + * The patient this person is related to. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The patient this person is related to", formalDefinition="The patient this person is related to." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient this person is related to.) + */ + protected Patient patientTarget; + + /** + * The nature of the relationship between a patient and the related person. + */ + @Child(name = "relationship", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The nature of the relationship", formalDefinition="The nature of the relationship between a patient and the related person." ) + protected CodeableConcept relationship; + + /** + * A name associated with the person. + */ + @Child(name = "name", type = {HumanName.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected HumanName name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @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 - the gender that the person is considered to have for administration and record keeping purposes. + */ + @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The date on which the related person was born. + */ + @Child(name = "birthDate", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The date on which the related person was born", formalDefinition="The date on which the related person was born." ) + protected DateType birthDate; + + /** + * Address where the related person can be contacted or visited. + */ + @Child(name = "address", type = {Address.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." ) + protected List
address; + + /** + * Image of the person. + */ + @Child(name = "photo", type = {Attachment.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) + protected List photo; + + /** + * The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown. + */ + @Child(name = "period", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Period of time that this relationship is considered valid", formalDefinition="The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown." ) + protected Period period; + + private static final long serialVersionUID = 7777543L; + + /** + * Constructor + */ + public RelatedPerson() { + super(); + } + + /** + * Constructor + */ + public RelatedPerson(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @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; + } + + // syntactic sugar + public RelatedPerson addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #patient} (The patient this person is related to.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient this person is related to.) + */ + public RelatedPerson 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 this person is related to.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 this person is related to.) + */ + public RelatedPerson setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #relationship} (The nature of the relationship between a patient and the related person.) + */ + public CodeableConcept getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new CodeableConcept(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The nature of the relationship between a patient and the related person.) + */ + public RelatedPerson setRelationship(CodeableConcept value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); // cc + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the person.) + */ + public RelatedPerson setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @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; + } + + // syntactic sugar + public RelatedPerson addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). 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 RelatedPerson.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb + 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 - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public RelatedPerson setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public RelatedPerson setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The date on which the related person was born.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateType(); // bb + 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 date on which the related person was born.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public RelatedPerson setBirthDateElement(DateType value) { + this.birthDate = value; + return this; + } + + /** + * @return The date on which the related person was born. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The date on which the related person was born. + */ + public RelatedPerson setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #address} (Address where the related person can be contacted or visited.) + */ + 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} (Address where the related person can be contacted or visited.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + // syntactic sugar + public RelatedPerson addAddress(Address t) { //3 + if (t == null) + return this; + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return this; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + // syntactic sugar + public RelatedPerson addPhoto(Attachment t) { //3 + if (t == null) + return this; + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return this; + } + + /** + * @return {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.) + */ + public RelatedPerson setPeriod(Period value) { + this.period = value; + return this; + } + + 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("patient", "Reference(Patient)", "The patient this person is related to.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between a patient and the related person.", 0, java.lang.Integer.MAX_VALUE, relationship)); + 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 - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "date", "The date on which the related person was born.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("address", "Address", "Address where the related person can be contacted or visited.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("period", "Period", "The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration + case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType + case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address + case 106642994: /*photo*/ return this.photo == null ? new Base[0] : this.photo.toArray(new Base[this.photo.size()]); // Attachment + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -261851592: // relationship + this.relationship = castToCodeableConcept(value); // CodeableConcept + break; + case 3373707: // name + this.name = castToHumanName(value); // HumanName + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + case -1249512767: // gender + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + break; + case -1210031859: // birthDate + this.birthDate = castToDate(value); // DateType + break; + case -1147692044: // address + this.getAddress().add(castToAddress(value)); // Address + break; + case 106642994: // photo + this.getPhoto().add(castToAttachment(value)); // Attachment + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("relationship")) + this.relationship = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("name")) + this.name = castToHumanName(value); // HumanName + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else if (name.equals("gender")) + this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration + else if (name.equals("birthDate")) + this.birthDate = castToDate(value); // DateType + else if (name.equals("address")) + this.getAddress().add(castToAddress(value)); + else if (name.equals("photo")) + this.getPhoto().add(castToAttachment(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -791418107: return getPatient(); // Reference + case -261851592: return getRelationship(); // CodeableConcept + case 3373707: return getName(); // HumanName + case -1429363305: return addTelecom(); // ContactPoint + case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration + case -1210031859: throw new FHIRException("Cannot make property birthDate as it is not a complex type"); // DateType + case -1147692044: return addAddress(); // Address + case 106642994: return addPhoto(); // Attachment + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("relationship")) { + this.relationship = new CodeableConcept(); + return this.relationship; + } + else if (name.equals("name")) { + this.name = new HumanName(); + return this.name; + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else if (name.equals("gender")) { + throw new FHIRException("Cannot call addChild on a primitive type RelatedPerson.gender"); + } + else if (name.equals("birthDate")) { + throw new FHIRException("Cannot call addChild on a primitive type RelatedPerson.birthDate"); + } + else if (name.equals("address")) { + return addAddress(); + } + else if (name.equals("photo")) { + return addPhoto(); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "RelatedPerson"; + + } + + public RelatedPerson copy() { + RelatedPerson dst = new RelatedPerson(); + 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.relationship = relationship == null ? null : relationship.copy(); + dst.name = name == null ? null : name.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()); + }; + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected RelatedPerson typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RelatedPerson)) + return false; + RelatedPerson o = (RelatedPerson) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(relationship, o.relationship, true) + && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) && compareDeep(gender, o.gender, true) + && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true) && compareDeep(photo, o.photo, true) + && compareDeep(period, o.period, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RelatedPerson)) + return false; + RelatedPerson o = (RelatedPerson) other; + return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (relationship == null || relationship.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()) && (period == null || period.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.RelatedPerson; + } + + /** + * Search parameter: phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: RelatedPerson.telecom(system=phone)
+ *

+ */ + @SearchParamDefinition(name="phone", path="RelatedPerson.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) + public static final String SP_PHONE = "phone"; + /** + * Fluent Client search parameter constant for phone + *

+ * Description: A value in a phone contact
+ * Type: token
+ * Path: RelatedPerson.telecom(system=phone)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); + + /** + * Search parameter: phonetic + *

+ * Description: A portion of name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: RelatedPerson.name
+ *

+ */ + @SearchParamDefinition(name="phonetic", path="RelatedPerson.name", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + /** + * Fluent Client search parameter constant for phonetic + *

+ * Description: A portion of name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: RelatedPerson.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); + + /** + * Search parameter: address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: RelatedPerson.address.country
+ *

+ */ + @SearchParamDefinition(name="address-country", path="RelatedPerson.address.country", description="A country specified in an address", type="string" ) + public static final String SP_ADDRESS_COUNTRY = "address-country"; + /** + * Fluent Client search parameter constant for address-country + *

+ * Description: A country specified in an address
+ * Type: string
+ * Path: RelatedPerson.address.country
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + + /** + * Search parameter: patient + *

+ * Description: The patient this person is related to
+ * Type: reference
+ * Path: RelatedPerson.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="RelatedPerson.patient", description="The patient this person is related to", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The patient this person is related to
+ * Type: reference
+ * Path: RelatedPerson.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "RelatedPerson:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("RelatedPerson:patient").toLocked(); + + /** + * Search parameter: address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: RelatedPerson.address.city
+ *

+ */ + @SearchParamDefinition(name="address-city", path="RelatedPerson.address.city", description="A city specified in an address", type="string" ) + public static final String SP_ADDRESS_CITY = "address-city"; + /** + * Fluent Client search parameter constant for address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: RelatedPerson.address.city
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); + + /** + * Search parameter: address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: RelatedPerson.address.state
+ *

+ */ + @SearchParamDefinition(name="address-state", path="RelatedPerson.address.state", description="A state specified in an address", type="string" ) + public static final String SP_ADDRESS_STATE = "address-state"; + /** + * Fluent Client search parameter constant for address-state + *

+ * Description: A state specified in an address
+ * Type: string
+ * Path: RelatedPerson.address.state
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); + + /** + * Search parameter: email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: RelatedPerson.telecom(system=email)
+ *

+ */ + @SearchParamDefinition(name="email", path="RelatedPerson.telecom.where(system='email')", description="A value in an email contact", type="token" ) + public static final String SP_EMAIL = "email"; + /** + * Fluent Client search parameter constant for email + *

+ * Description: A value in an email contact
+ * Type: token
+ * Path: RelatedPerson.telecom(system=email)
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); + + /** + * Search parameter: address + *

+ * Description: An address in any kind of address/part
+ * Type: string
+ * Path: RelatedPerson.address
+ *

+ */ + @SearchParamDefinition(name="address", path="RelatedPerson.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + /** + * Fluent Client search parameter constant for address + *

+ * Description: An address in any kind of address/part
+ * Type: string
+ * Path: RelatedPerson.address
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); + + /** + * Search parameter: address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: RelatedPerson.address.use
+ *

+ */ + @SearchParamDefinition(name="address-use", path="RelatedPerson.address.use", description="A use code specified in an address", type="token" ) + public static final String SP_ADDRESS_USE = "address-use"; + /** + * Fluent Client search parameter constant for address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: RelatedPerson.address.use
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); + + /** + * Search parameter: name + *

+ * Description: A portion of name in any name part
+ * Type: string
+ * Path: RelatedPerson.name
+ *

+ */ + @SearchParamDefinition(name="name", path="RelatedPerson.name", description="A portion of name in any name part", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: A portion of name in any name part
+ * Type: string
+ * Path: RelatedPerson.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: birthdate + *

+ * Description: The Related Person's date of birth
+ * Type: date
+ * Path: RelatedPerson.birthDate
+ *

+ */ + @SearchParamDefinition(name="birthdate", path="RelatedPerson.birthDate", description="The Related Person's date of birth", type="date" ) + public static final String SP_BIRTHDATE = "birthdate"; + /** + * Fluent Client search parameter constant for birthdate + *

+ * Description: The Related Person's date of birth
+ * Type: date
+ * Path: RelatedPerson.birthDate
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE); + + /** + * Search parameter: telecom + *

+ * Description: The value in any kind of contact
+ * Type: token
+ * Path: RelatedPerson.telecom
+ *

+ */ + @SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="token" ) + public static final String SP_TELECOM = "telecom"; + /** + * Fluent Client search parameter constant for telecom + *

+ * Description: The value in any kind of contact
+ * Type: token
+ * Path: RelatedPerson.telecom
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); + + /** + * Search parameter: gender + *

+ * Description: Gender of the person
+ * Type: token
+ * Path: RelatedPerson.gender
+ *

+ */ + @SearchParamDefinition(name="gender", path="RelatedPerson.gender", description="Gender of the person", type="token" ) + public static final String SP_GENDER = "gender"; + /** + * Fluent Client search parameter constant for gender + *

+ * Description: Gender of the person
+ * Type: token
+ * Path: RelatedPerson.gender
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); + + /** + * Search parameter: identifier + *

+ * Description: A patient Identifier
+ * Type: token
+ * Path: RelatedPerson.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="RelatedPerson.identifier", description="A patient Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A patient Identifier
+ * Type: token
+ * Path: RelatedPerson.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: address-postalcode + *

+ * Description: A postal code specified in an address
+ * Type: string
+ * Path: RelatedPerson.address.postalCode
+ *

+ */ + @SearchParamDefinition(name="address-postalcode", path="RelatedPerson.address.postalCode", description="A postal code specified in an address", type="string" ) + public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; + /** + * Fluent Client search parameter constant for address-postalcode + *

+ * Description: A postal code specified in an address
+ * Type: string
+ * Path: RelatedPerson.address.postalCode
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Resource.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Resource.java new file mode 100644 index 00000000000..40b167d37cf --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Resource.java @@ -0,0 +1,382 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IAnyResource; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * This is the base resource type for everything. + */ +public abstract class Resource extends BaseResource implements IAnyResource { + + /** + * The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. + */ + @Child(name = "id", type = {IdType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical id of this artifact", formalDefinition="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes." ) + protected IdType id; + + /** + * The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + */ + @Child(name = "meta", type = {Meta.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Metadata about the resource", formalDefinition="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." ) + protected Meta meta; + + /** + * A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + @Child(name = "implicitRules", type = {UriType.class}, order=2, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="A set of rules under which this content was created", formalDefinition="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." ) + protected UriType implicitRules; + + /** + * The base language in which the resource is written. + */ + @Child(name = "language", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Language of the resource content", formalDefinition="The base language in which the resource is written." ) + protected CodeType language; + + private static final long serialVersionUID = -559462759L; + + /** + * Constructor + */ + public Resource() { + super(); + } + + /** + * @return {@link #id} (The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public IdType getIdElement() { + if (this.id == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.id"); + else if (Configuration.doAutoCreate()) + this.id = new IdType(); // bb + return this.id; + } + + public boolean hasIdElement() { + return this.id != null && !this.id.isEmpty(); + } + + public boolean hasId() { + return this.id != null && !this.id.isEmpty(); + } + + /** + * @param value {@link #id} (The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public Resource setIdElement(IdType value) { + this.id = value; + return this; + } + + /** + * @return The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. + */ + public String getId() { + return this.id == null ? null : this.id.getValue(); + } + + /** + * @param value The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. + */ + public Resource setId(String value) { + if (Utilities.noString(value)) + this.id = null; + else { + if (this.id == null) + this.id = new IdType(); + this.id.setValue(value); + } + return this; + } + + /** + * @return {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) + */ + public Meta getMeta() { + if (this.meta == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.meta"); + else if (Configuration.doAutoCreate()) + this.meta = new Meta(); // cc + return this.meta; + } + + public boolean hasMeta() { + return this.meta != null && !this.meta.isEmpty(); + } + + /** + * @param value {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) + */ + public Resource setMeta(Meta value) { + this.meta = value; + return this; + } + + /** + * @return {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value + */ + public UriType getImplicitRulesElement() { + if (this.implicitRules == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.implicitRules"); + else if (Configuration.doAutoCreate()) + this.implicitRules = new UriType(); // bb + return this.implicitRules; + } + + public boolean hasImplicitRulesElement() { + return this.implicitRules != null && !this.implicitRules.isEmpty(); + } + + public boolean hasImplicitRules() { + return this.implicitRules != null && !this.implicitRules.isEmpty(); + } + + /** + * @param value {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value + */ + public Resource setImplicitRulesElement(UriType value) { + this.implicitRules = value; + return this; + } + + /** + * @return A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + public String getImplicitRules() { + return this.implicitRules == null ? null : this.implicitRules.getValue(); + } + + /** + * @param value A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + public Resource setImplicitRules(String value) { + if (Utilities.noString(value)) + this.implicitRules = null; + else { + if (this.implicitRules == null) + this.implicitRules = new UriType(); + this.implicitRules.setValue(value); + } + return this; + } + + /** + * @return {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public Resource setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The base language in which the resource is written. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The base language in which the resource is written. + */ + public Resource setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("id", "id", "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.", 0, java.lang.Integer.MAX_VALUE, id)); + childrenList.add(new Property("meta", "Meta", "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.", 0, java.lang.Integer.MAX_VALUE, meta)); + childrenList.add(new Property("implicitRules", "uri", "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.", 0, java.lang.Integer.MAX_VALUE, implicitRules)); + childrenList.add(new Property("language", "code", "The base language in which the resource is written.", 0, java.lang.Integer.MAX_VALUE, language)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3355: /*id*/ return this.id == null ? new Base[0] : new Base[] {this.id}; // IdType + case 3347973: /*meta*/ return this.meta == null ? new Base[0] : new Base[] {this.meta}; // Meta + case -961826286: /*implicitRules*/ return this.implicitRules == null ? new Base[0] : new Base[] {this.implicitRules}; // UriType + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3355: // id + this.id = castToId(value); // IdType + break; + case 3347973: // meta + this.meta = castToMeta(value); // Meta + break; + case -961826286: // implicitRules + this.implicitRules = castToUri(value); // UriType + break; + case -1613589672: // language + this.language = castToCode(value); // CodeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("id")) + this.id = castToId(value); // IdType + else if (name.equals("meta")) + this.meta = castToMeta(value); // Meta + else if (name.equals("implicitRules")) + this.implicitRules = castToUri(value); // UriType + else if (name.equals("language")) + this.language = castToCode(value); // CodeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3355: throw new FHIRException("Cannot make property id as it is not a complex type"); // IdType + case 3347973: return getMeta(); // Meta + case -961826286: throw new FHIRException("Cannot make property implicitRules as it is not a complex type"); // UriType + case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("id")) { + throw new FHIRException("Cannot call addChild on a primitive type Resource.id"); + } + else if (name.equals("meta")) { + this.meta = new Meta(); + return this.meta; + } + else if (name.equals("implicitRules")) { + throw new FHIRException("Cannot call addChild on a primitive type Resource.implicitRules"); + } + else if (name.equals("language")) { + throw new FHIRException("Cannot call addChild on a primitive type Resource.language"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Resource"; + + } + + public abstract Resource copy(); + + public void copyValues(Resource dst) { + dst.id = id == null ? null : id.copy(); + dst.meta = meta == null ? null : meta.copy(); + dst.implicitRules = implicitRules == null ? null : implicitRules.copy(); + dst.language = language == null ? null : language.copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Resource)) + return false; + Resource o = (Resource) other; + return compareDeep(id, o.id, true) && compareDeep(meta, o.meta, true) && compareDeep(implicitRules, o.implicitRules, true) + && compareDeep(language, o.language, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Resource)) + return false; + Resource o = (Resource) other; + return compareValues(id, o.id, true) && compareValues(implicitRules, o.implicitRules, true) && compareValues(language, o.language, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (id == null || id.isEmpty()) && (meta == null || meta.isEmpty()) && (implicitRules == null || implicitRules.isEmpty()) + && (language == null || language.isEmpty()); + } + + public abstract ResourceType getResourceType(); + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ResourceFactory.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ResourceFactory.java new file mode 100644 index 00000000000..97c52cfab79 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ResourceFactory.java @@ -0,0 +1,631 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 + +import org.hl7.fhir.exceptions.FHIRException; + +public class ResourceFactory extends Factory { + + public static Resource createResource(String name) throws FHIRException { + if ("Condition".equals(name)) + return new Condition(); + if ("DeviceComponent".equals(name)) + return new DeviceComponent(); + if ("Communication".equals(name)) + return new Communication(); + if ("PractitionerRole".equals(name)) + return new PractitionerRole(); + if ("Group".equals(name)) + return new Group(); + if ("ValueSet".equals(name)) + return new ValueSet(); + if ("Coverage".equals(name)) + return new Coverage(); + if ("Appointment".equals(name)) + return new Appointment(); + if ("Library".equals(name)) + return new Library(); + if ("Slot".equals(name)) + return new Slot(); + if ("DecisionSupportRule".equals(name)) + return new DecisionSupportRule(); + if ("Composition".equals(name)) + return new Composition(); + if ("EpisodeOfCare".equals(name)) + return new EpisodeOfCare(); + if ("Conformance".equals(name)) + return new Conformance(); + if ("NamingSystem".equals(name)) + return new NamingSystem(); + if ("HealthcareService".equals(name)) + return new HealthcareService(); + if ("Linkage".equals(name)) + return new Linkage(); + if ("OrderResponse".equals(name)) + return new OrderResponse(); + if ("Task".equals(name)) + return new Task(); + if ("ConceptMap".equals(name)) + return new ConceptMap(); + if ("Practitioner".equals(name)) + return new Practitioner(); + if ("CarePlan".equals(name)) + return new CarePlan(); + if ("Substance".equals(name)) + return new Substance(); + if ("QuestionnaireResponse".equals(name)) + return new QuestionnaireResponse(); + if ("DeviceUseRequest".equals(name)) + return new DeviceUseRequest(); + if ("Schedule".equals(name)) + return new Schedule(); + if ("SupplyDelivery".equals(name)) + return new SupplyDelivery(); + if ("EligibilityRequest".equals(name)) + return new EligibilityRequest(); + if ("PaymentReconciliation".equals(name)) + return new PaymentReconciliation(); + if ("TestScript".equals(name)) + return new TestScript(); + if ("OperationDefinition".equals(name)) + return new OperationDefinition(); + if ("ImagingObjectSelection".equals(name)) + return new ImagingObjectSelection(); + if ("ClaimResponse".equals(name)) + return new ClaimResponse(); + if ("BodySite".equals(name)) + return new BodySite(); + if ("Flag".equals(name)) + return new Flag(); + if ("CommunicationRequest".equals(name)) + return new CommunicationRequest(); + if ("Claim".equals(name)) + return new Claim(); + if ("RiskAssessment".equals(name)) + return new RiskAssessment(); + if ("ExpansionProfile".equals(name)) + return new ExpansionProfile(); + if ("ExplanationOfBenefit".equals(name)) + return new ExplanationOfBenefit(); + if ("AllergyIntolerance".equals(name)) + return new AllergyIntolerance(); + if ("Observation".equals(name)) + return new Observation(); + if ("RelatedPerson".equals(name)) + return new RelatedPerson(); + if ("ProcessResponse".equals(name)) + return new ProcessResponse(); + if ("AuditEvent".equals(name)) + return new AuditEvent(); + if ("EligibilityResponse".equals(name)) + return new EligibilityResponse(); + if ("MedicationOrder".equals(name)) + return new MedicationOrder(); + if ("Person".equals(name)) + return new Person(); + if ("Parameters".equals(name)) + return new Parameters(); + if ("ModuleDefinition".equals(name)) + return new ModuleDefinition(); + if ("ProcedureRequest".equals(name)) + return new ProcedureRequest(); + if ("DeviceMetric".equals(name)) + return new DeviceMetric(); + if ("Organization".equals(name)) + return new Organization(); + if ("Measure".equals(name)) + return new Measure(); + if ("ProcessRequest".equals(name)) + return new ProcessRequest(); + if ("ImmunizationRecommendation".equals(name)) + return new ImmunizationRecommendation(); + if ("MedicationDispense".equals(name)) + return new MedicationDispense(); + if ("DetectedIssue".equals(name)) + return new DetectedIssue(); + if ("PaymentNotice".equals(name)) + return new PaymentNotice(); + if ("MedicationStatement".equals(name)) + return new MedicationStatement(); + if ("AppointmentResponse".equals(name)) + return new AppointmentResponse(); + if ("Sequence".equals(name)) + return new Sequence(); + if ("ImplementationGuide".equals(name)) + return new ImplementationGuide(); + if ("Protocol".equals(name)) + return new Protocol(); + if ("Questionnaire".equals(name)) + return new Questionnaire(); + if ("OperationOutcome".equals(name)) + return new OperationOutcome(); + if ("DecisionSupportServiceModule".equals(name)) + return new DecisionSupportServiceModule(); + if ("FamilyMemberHistory".equals(name)) + return new FamilyMemberHistory(); + if ("Media".equals(name)) + return new Media(); + if ("ImagingExcerpt".equals(name)) + return new ImagingExcerpt(); + if ("Binary".equals(name)) + return new Binary(); + if ("VisionPrescription".equals(name)) + return new VisionPrescription(); + if ("DocumentReference".equals(name)) + return new DocumentReference(); + if ("Immunization".equals(name)) + return new Immunization(); + if ("CareTeam".equals(name)) + return new CareTeam(); + if ("Bundle".equals(name)) + return new Bundle(); + if ("Subscription".equals(name)) + return new Subscription(); + if ("MeasureReport".equals(name)) + return new MeasureReport(); + if ("ImagingStudy".equals(name)) + return new ImagingStudy(); + if ("Provenance".equals(name)) + return new Provenance(); + if ("Device".equals(name)) + return new Device(); + if ("StructureDefinition".equals(name)) + return new StructureDefinition(); + if ("Account".equals(name)) + return new Account(); + if ("Order".equals(name)) + return new Order(); + if ("Procedure".equals(name)) + return new Procedure(); + if ("OrderSet".equals(name)) + return new OrderSet(); + if ("DiagnosticReport".equals(name)) + return new DiagnosticReport(); + if ("Medication".equals(name)) + return new Medication(); + if ("MessageHeader".equals(name)) + return new MessageHeader(); + if ("DocumentManifest".equals(name)) + return new DocumentManifest(); + if ("DataElement".equals(name)) + return new DataElement(); + if ("MedicationAdministration".equals(name)) + return new MedicationAdministration(); + if ("StructureMap".equals(name)) + return new StructureMap(); + if ("CompartmentDefinition".equals(name)) + return new CompartmentDefinition(); + if ("Encounter".equals(name)) + return new Encounter(); + if ("List".equals(name)) + return new ListResource(); + if ("CodeSystem".equals(name)) + return new CodeSystem(); + if ("DeviceUseStatement".equals(name)) + return new DeviceUseStatement(); + if ("Goal".equals(name)) + return new Goal(); + if ("GuidanceResponse".equals(name)) + return new GuidanceResponse(); + if ("SearchParameter".equals(name)) + return new SearchParameter(); + if ("NutritionOrder".equals(name)) + return new NutritionOrder(); + if ("ReferralRequest".equals(name)) + return new ReferralRequest(); + if ("ClinicalImpression".equals(name)) + return new ClinicalImpression(); + if ("EnrollmentRequest".equals(name)) + return new EnrollmentRequest(); + if ("Location".equals(name)) + return new Location(); + if ("Contract".equals(name)) + return new Contract(); + if ("Basic".equals(name)) + return new Basic(); + if ("Specimen".equals(name)) + return new Specimen(); + if ("EnrollmentResponse".equals(name)) + return new EnrollmentResponse(); + if ("SupplyRequest".equals(name)) + return new SupplyRequest(); + if ("Patient".equals(name)) + return new Patient(); + if ("DiagnosticOrder".equals(name)) + return new DiagnosticOrder(); + else + throw new FHIRException("Unknown Resource Name '"+name+"'"); + } + + public static Element createType(String name) throws FHIRException { + if ("Period".equals(name)) + return new Period(); + if ("Age".equals(name)) + return new Age(); + if ("Attachment".equals(name)) + return new Attachment(); + if ("Count".equals(name)) + return new Count(); + if ("SimpleQuantity".equals(name)) + return new SimpleQuantity(); + if ("Signature".equals(name)) + return new Signature(); + if ("Extension".equals(name)) + return new Extension(); + if ("ModuleMetadata".equals(name)) + return new ModuleMetadata(); + if ("ActionDefinition".equals(name)) + return new ActionDefinition(); + if ("HumanName".equals(name)) + return new HumanName(); + if ("Ratio".equals(name)) + return new Ratio(); + if ("Duration".equals(name)) + return new Duration(); + if ("CodeableConcept".equals(name)) + return new CodeableConcept(); + if ("Identifier".equals(name)) + return new Identifier(); + if ("Timing".equals(name)) + return new Timing(); + if ("Coding".equals(name)) + return new Coding(); + if ("Range".equals(name)) + return new Range(); + if ("Quantity".equals(name)) + return new Quantity(); + if ("Money".equals(name)) + return new Money(); + if ("Distance".equals(name)) + return new Distance(); + if ("DataRequirement".equals(name)) + return new DataRequirement(); + if ("ParameterDefinition".equals(name)) + return new ParameterDefinition(); + if ("ContactPoint".equals(name)) + return new ContactPoint(); + if ("TriggerDefinition".equals(name)) + return new TriggerDefinition(); + if ("ElementDefinition".equals(name)) + return new ElementDefinition(); + if ("Address".equals(name)) + return new Address(); + if ("Annotation".equals(name)) + return new Annotation(); + if ("Meta".equals(name)) + return new Meta(); + if ("SampledData".equals(name)) + return new SampledData(); + if ("Reference".equals(name)) + return new Reference(); + if ("Narrative".equals(name)) + return new Narrative(); + else + throw new FHIRException("Unknown Type Name '"+name+"'"); + } + + public static Base createResourceOrType(String name) throws FHIRException { + if ("Condition".equals(name)) + return new Condition(); + if ("DeviceComponent".equals(name)) + return new DeviceComponent(); + if ("Communication".equals(name)) + return new Communication(); + if ("PractitionerRole".equals(name)) + return new PractitionerRole(); + if ("Group".equals(name)) + return new Group(); + if ("ValueSet".equals(name)) + return new ValueSet(); + if ("Coverage".equals(name)) + return new Coverage(); + if ("Appointment".equals(name)) + return new Appointment(); + if ("Library".equals(name)) + return new Library(); + if ("Slot".equals(name)) + return new Slot(); + if ("DecisionSupportRule".equals(name)) + return new DecisionSupportRule(); + if ("Composition".equals(name)) + return new Composition(); + if ("EpisodeOfCare".equals(name)) + return new EpisodeOfCare(); + if ("Conformance".equals(name)) + return new Conformance(); + if ("NamingSystem".equals(name)) + return new NamingSystem(); + if ("HealthcareService".equals(name)) + return new HealthcareService(); + if ("Linkage".equals(name)) + return new Linkage(); + if ("OrderResponse".equals(name)) + return new OrderResponse(); + if ("Task".equals(name)) + return new Task(); + if ("ConceptMap".equals(name)) + return new ConceptMap(); + if ("Practitioner".equals(name)) + return new Practitioner(); + if ("CarePlan".equals(name)) + return new CarePlan(); + if ("Substance".equals(name)) + return new Substance(); + if ("QuestionnaireResponse".equals(name)) + return new QuestionnaireResponse(); + if ("DeviceUseRequest".equals(name)) + return new DeviceUseRequest(); + if ("Schedule".equals(name)) + return new Schedule(); + if ("SupplyDelivery".equals(name)) + return new SupplyDelivery(); + if ("EligibilityRequest".equals(name)) + return new EligibilityRequest(); + if ("PaymentReconciliation".equals(name)) + return new PaymentReconciliation(); + if ("TestScript".equals(name)) + return new TestScript(); + if ("OperationDefinition".equals(name)) + return new OperationDefinition(); + if ("ImagingObjectSelection".equals(name)) + return new ImagingObjectSelection(); + if ("ClaimResponse".equals(name)) + return new ClaimResponse(); + if ("BodySite".equals(name)) + return new BodySite(); + if ("Flag".equals(name)) + return new Flag(); + if ("CommunicationRequest".equals(name)) + return new CommunicationRequest(); + if ("Claim".equals(name)) + return new Claim(); + if ("RiskAssessment".equals(name)) + return new RiskAssessment(); + if ("ExpansionProfile".equals(name)) + return new ExpansionProfile(); + if ("ExplanationOfBenefit".equals(name)) + return new ExplanationOfBenefit(); + if ("AllergyIntolerance".equals(name)) + return new AllergyIntolerance(); + if ("Observation".equals(name)) + return new Observation(); + if ("RelatedPerson".equals(name)) + return new RelatedPerson(); + if ("ProcessResponse".equals(name)) + return new ProcessResponse(); + if ("AuditEvent".equals(name)) + return new AuditEvent(); + if ("EligibilityResponse".equals(name)) + return new EligibilityResponse(); + if ("MedicationOrder".equals(name)) + return new MedicationOrder(); + if ("Person".equals(name)) + return new Person(); + if ("Parameters".equals(name)) + return new Parameters(); + if ("ModuleDefinition".equals(name)) + return new ModuleDefinition(); + if ("ProcedureRequest".equals(name)) + return new ProcedureRequest(); + if ("DeviceMetric".equals(name)) + return new DeviceMetric(); + if ("Organization".equals(name)) + return new Organization(); + if ("Measure".equals(name)) + return new Measure(); + if ("ProcessRequest".equals(name)) + return new ProcessRequest(); + if ("ImmunizationRecommendation".equals(name)) + return new ImmunizationRecommendation(); + if ("MedicationDispense".equals(name)) + return new MedicationDispense(); + if ("DetectedIssue".equals(name)) + return new DetectedIssue(); + if ("PaymentNotice".equals(name)) + return new PaymentNotice(); + if ("MedicationStatement".equals(name)) + return new MedicationStatement(); + if ("AppointmentResponse".equals(name)) + return new AppointmentResponse(); + if ("Sequence".equals(name)) + return new Sequence(); + if ("ImplementationGuide".equals(name)) + return new ImplementationGuide(); + if ("Protocol".equals(name)) + return new Protocol(); + if ("Questionnaire".equals(name)) + return new Questionnaire(); + if ("OperationOutcome".equals(name)) + return new OperationOutcome(); + if ("DecisionSupportServiceModule".equals(name)) + return new DecisionSupportServiceModule(); + if ("FamilyMemberHistory".equals(name)) + return new FamilyMemberHistory(); + if ("Media".equals(name)) + return new Media(); + if ("ImagingExcerpt".equals(name)) + return new ImagingExcerpt(); + if ("Binary".equals(name)) + return new Binary(); + if ("VisionPrescription".equals(name)) + return new VisionPrescription(); + if ("DocumentReference".equals(name)) + return new DocumentReference(); + if ("Immunization".equals(name)) + return new Immunization(); + if ("CareTeam".equals(name)) + return new CareTeam(); + if ("Bundle".equals(name)) + return new Bundle(); + if ("Subscription".equals(name)) + return new Subscription(); + if ("MeasureReport".equals(name)) + return new MeasureReport(); + if ("ImagingStudy".equals(name)) + return new ImagingStudy(); + if ("Provenance".equals(name)) + return new Provenance(); + if ("Device".equals(name)) + return new Device(); + if ("StructureDefinition".equals(name)) + return new StructureDefinition(); + if ("Account".equals(name)) + return new Account(); + if ("Order".equals(name)) + return new Order(); + if ("Procedure".equals(name)) + return new Procedure(); + if ("OrderSet".equals(name)) + return new OrderSet(); + if ("DiagnosticReport".equals(name)) + return new DiagnosticReport(); + if ("Medication".equals(name)) + return new Medication(); + if ("MessageHeader".equals(name)) + return new MessageHeader(); + if ("DocumentManifest".equals(name)) + return new DocumentManifest(); + if ("DataElement".equals(name)) + return new DataElement(); + if ("MedicationAdministration".equals(name)) + return new MedicationAdministration(); + if ("StructureMap".equals(name)) + return new StructureMap(); + if ("CompartmentDefinition".equals(name)) + return new CompartmentDefinition(); + if ("Encounter".equals(name)) + return new Encounter(); + if ("List".equals(name)) + return new ListResource(); + if ("CodeSystem".equals(name)) + return new CodeSystem(); + if ("DeviceUseStatement".equals(name)) + return new DeviceUseStatement(); + if ("Goal".equals(name)) + return new Goal(); + if ("GuidanceResponse".equals(name)) + return new GuidanceResponse(); + if ("SearchParameter".equals(name)) + return new SearchParameter(); + if ("NutritionOrder".equals(name)) + return new NutritionOrder(); + if ("ReferralRequest".equals(name)) + return new ReferralRequest(); + if ("ClinicalImpression".equals(name)) + return new ClinicalImpression(); + if ("EnrollmentRequest".equals(name)) + return new EnrollmentRequest(); + if ("Location".equals(name)) + return new Location(); + if ("Contract".equals(name)) + return new Contract(); + if ("Basic".equals(name)) + return new Basic(); + if ("Specimen".equals(name)) + return new Specimen(); + if ("EnrollmentResponse".equals(name)) + return new EnrollmentResponse(); + if ("SupplyRequest".equals(name)) + return new SupplyRequest(); + if ("Patient".equals(name)) + return new Patient(); + if ("DiagnosticOrder".equals(name)) + return new DiagnosticOrder(); + if ("Period".equals(name)) + return new Period(); + if ("Age".equals(name)) + return new Age(); + if ("Attachment".equals(name)) + return new Attachment(); + if ("Count".equals(name)) + return new Count(); + if ("SimpleQuantity".equals(name)) + return new SimpleQuantity(); + if ("Signature".equals(name)) + return new Signature(); + if ("Extension".equals(name)) + return new Extension(); + if ("ModuleMetadata".equals(name)) + return new ModuleMetadata(); + if ("ActionDefinition".equals(name)) + return new ActionDefinition(); + if ("HumanName".equals(name)) + return new HumanName(); + if ("Ratio".equals(name)) + return new Ratio(); + if ("Duration".equals(name)) + return new Duration(); + if ("CodeableConcept".equals(name)) + return new CodeableConcept(); + if ("Identifier".equals(name)) + return new Identifier(); + if ("Timing".equals(name)) + return new Timing(); + if ("Coding".equals(name)) + return new Coding(); + if ("Range".equals(name)) + return new Range(); + if ("Quantity".equals(name)) + return new Quantity(); + if ("Money".equals(name)) + return new Money(); + if ("Distance".equals(name)) + return new Distance(); + if ("DataRequirement".equals(name)) + return new DataRequirement(); + if ("ParameterDefinition".equals(name)) + return new ParameterDefinition(); + if ("ContactPoint".equals(name)) + return new ContactPoint(); + if ("TriggerDefinition".equals(name)) + return new TriggerDefinition(); + if ("ElementDefinition".equals(name)) + return new ElementDefinition(); + if ("Address".equals(name)) + return new Address(); + if ("Annotation".equals(name)) + return new Annotation(); + if ("Meta".equals(name)) + return new Meta(); + if ("SampledData".equals(name)) + return new SampledData(); + if ("Reference".equals(name)) + return new Reference(); + if ("Narrative".equals(name)) + return new Narrative(); + else + throw new FHIRException("Unknown Resource or Type Name '"+name+"'"); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ResourceType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ResourceType.java new file mode 100644 index 00000000000..4cd5fd8c54b --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ResourceType.java @@ -0,0 +1,587 @@ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.exceptions.FHIRException; + +// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 + +public enum ResourceType { + Account, + AllergyIntolerance, + Appointment, + AppointmentResponse, + AuditEvent, + Basic, + Binary, + BodySite, + Bundle, + CarePlan, + CareTeam, + Claim, + ClaimResponse, + ClinicalImpression, + CodeSystem, + Communication, + CommunicationRequest, + CompartmentDefinition, + Composition, + ConceptMap, + Condition, + Conformance, + Contract, + Coverage, + DataElement, + DecisionSupportRule, + DecisionSupportServiceModule, + DetectedIssue, + Device, + DeviceComponent, + DeviceMetric, + DeviceUseRequest, + DeviceUseStatement, + DiagnosticOrder, + DiagnosticReport, + DocumentManifest, + DocumentReference, + EligibilityRequest, + EligibilityResponse, + Encounter, + EnrollmentRequest, + EnrollmentResponse, + EpisodeOfCare, + ExpansionProfile, + ExplanationOfBenefit, + FamilyMemberHistory, + Flag, + Goal, + Group, + GuidanceResponse, + HealthcareService, + ImagingExcerpt, + ImagingObjectSelection, + ImagingStudy, + Immunization, + ImmunizationRecommendation, + ImplementationGuide, + Library, + Linkage, + List, + Location, + Measure, + MeasureReport, + Media, + Medication, + MedicationAdministration, + MedicationDispense, + MedicationOrder, + MedicationStatement, + MessageHeader, + ModuleDefinition, + NamingSystem, + NutritionOrder, + Observation, + OperationDefinition, + OperationOutcome, + Order, + OrderResponse, + OrderSet, + Organization, + Parameters, + Patient, + PaymentNotice, + PaymentReconciliation, + Person, + Practitioner, + PractitionerRole, + Procedure, + ProcedureRequest, + ProcessRequest, + ProcessResponse, + Protocol, + Provenance, + Questionnaire, + QuestionnaireResponse, + ReferralRequest, + RelatedPerson, + RiskAssessment, + Schedule, + SearchParameter, + Sequence, + Slot, + Specimen, + StructureDefinition, + StructureMap, + Subscription, + Substance, + SupplyDelivery, + SupplyRequest, + Task, + TestScript, + ValueSet, + VisionPrescription; + + + public String getPath() {; + switch (this) { + case Account: + return "account"; + case AllergyIntolerance: + return "allergyintolerance"; + case Appointment: + return "appointment"; + case AppointmentResponse: + return "appointmentresponse"; + case AuditEvent: + return "auditevent"; + case Basic: + return "basic"; + case Binary: + return "binary"; + case BodySite: + return "bodysite"; + case Bundle: + return "bundle"; + case CarePlan: + return "careplan"; + case CareTeam: + return "careteam"; + case Claim: + return "claim"; + case ClaimResponse: + return "claimresponse"; + case ClinicalImpression: + return "clinicalimpression"; + case CodeSystem: + return "codesystem"; + case Communication: + return "communication"; + case CommunicationRequest: + return "communicationrequest"; + case CompartmentDefinition: + return "compartmentdefinition"; + case Composition: + return "composition"; + case ConceptMap: + return "conceptmap"; + case Condition: + return "condition"; + case Conformance: + return "conformance"; + case Contract: + return "contract"; + case Coverage: + return "coverage"; + case DataElement: + return "dataelement"; + case DecisionSupportRule: + return "decisionsupportrule"; + case DecisionSupportServiceModule: + return "decisionsupportservicemodule"; + case DetectedIssue: + return "detectedissue"; + case Device: + return "device"; + case DeviceComponent: + return "devicecomponent"; + case DeviceMetric: + return "devicemetric"; + case DeviceUseRequest: + return "deviceuserequest"; + case DeviceUseStatement: + return "deviceusestatement"; + case DiagnosticOrder: + return "diagnosticorder"; + case DiagnosticReport: + return "diagnosticreport"; + case DocumentManifest: + return "documentmanifest"; + case DocumentReference: + return "documentreference"; + case EligibilityRequest: + return "eligibilityrequest"; + case EligibilityResponse: + return "eligibilityresponse"; + case Encounter: + return "encounter"; + case EnrollmentRequest: + return "enrollmentrequest"; + case EnrollmentResponse: + return "enrollmentresponse"; + case EpisodeOfCare: + return "episodeofcare"; + case ExpansionProfile: + return "expansionprofile"; + case ExplanationOfBenefit: + return "explanationofbenefit"; + case FamilyMemberHistory: + return "familymemberhistory"; + case Flag: + return "flag"; + case Goal: + return "goal"; + case Group: + return "group"; + case GuidanceResponse: + return "guidanceresponse"; + case HealthcareService: + return "healthcareservice"; + case ImagingExcerpt: + return "imagingexcerpt"; + case ImagingObjectSelection: + return "imagingobjectselection"; + case ImagingStudy: + return "imagingstudy"; + case Immunization: + return "immunization"; + case ImmunizationRecommendation: + return "immunizationrecommendation"; + case ImplementationGuide: + return "implementationguide"; + case Library: + return "library"; + case Linkage: + return "linkage"; + case List: + return "list"; + case Location: + return "location"; + case Measure: + return "measure"; + case MeasureReport: + return "measurereport"; + case Media: + return "media"; + case Medication: + return "medication"; + case MedicationAdministration: + return "medicationadministration"; + case MedicationDispense: + return "medicationdispense"; + case MedicationOrder: + return "medicationorder"; + case MedicationStatement: + return "medicationstatement"; + case MessageHeader: + return "messageheader"; + case ModuleDefinition: + return "moduledefinition"; + case NamingSystem: + return "namingsystem"; + case NutritionOrder: + return "nutritionorder"; + case Observation: + return "observation"; + case OperationDefinition: + return "operationdefinition"; + case OperationOutcome: + return "operationoutcome"; + case Order: + return "order"; + case OrderResponse: + return "orderresponse"; + case OrderSet: + return "orderset"; + case Organization: + return "organization"; + case Parameters: + return "parameters"; + case Patient: + return "patient"; + case PaymentNotice: + return "paymentnotice"; + case PaymentReconciliation: + return "paymentreconciliation"; + case Person: + return "person"; + case Practitioner: + return "practitioner"; + case PractitionerRole: + return "practitionerrole"; + case Procedure: + return "procedure"; + case ProcedureRequest: + return "procedurerequest"; + case ProcessRequest: + return "processrequest"; + case ProcessResponse: + return "processresponse"; + case Protocol: + return "protocol"; + case Provenance: + return "provenance"; + case Questionnaire: + return "questionnaire"; + case QuestionnaireResponse: + return "questionnaireresponse"; + case ReferralRequest: + return "referralrequest"; + case RelatedPerson: + return "relatedperson"; + case RiskAssessment: + return "riskassessment"; + case Schedule: + return "schedule"; + case SearchParameter: + return "searchparameter"; + case Sequence: + return "sequence"; + case Slot: + return "slot"; + case Specimen: + return "specimen"; + case StructureDefinition: + return "structuredefinition"; + case StructureMap: + return "structuremap"; + case Subscription: + return "subscription"; + case Substance: + return "substance"; + case SupplyDelivery: + return "supplydelivery"; + case SupplyRequest: + return "supplyrequest"; + case Task: + return "task"; + case TestScript: + return "testscript"; + case ValueSet: + return "valueset"; + case VisionPrescription: + return "visionprescription"; + } + return null; + } + + + public static ResourceType fromCode(String code) throws FHIRException {; + if ("Account".equals(code)) + return Account; + if ("AllergyIntolerance".equals(code)) + return AllergyIntolerance; + if ("Appointment".equals(code)) + return Appointment; + if ("AppointmentResponse".equals(code)) + return AppointmentResponse; + if ("AuditEvent".equals(code)) + return AuditEvent; + if ("Basic".equals(code)) + return Basic; + if ("Binary".equals(code)) + return Binary; + if ("BodySite".equals(code)) + return BodySite; + if ("Bundle".equals(code)) + return Bundle; + if ("CarePlan".equals(code)) + return CarePlan; + if ("CareTeam".equals(code)) + return CareTeam; + if ("Claim".equals(code)) + return Claim; + if ("ClaimResponse".equals(code)) + return ClaimResponse; + if ("ClinicalImpression".equals(code)) + return ClinicalImpression; + if ("CodeSystem".equals(code)) + return CodeSystem; + if ("Communication".equals(code)) + return Communication; + if ("CommunicationRequest".equals(code)) + return CommunicationRequest; + if ("CompartmentDefinition".equals(code)) + return CompartmentDefinition; + if ("Composition".equals(code)) + return Composition; + if ("ConceptMap".equals(code)) + return ConceptMap; + if ("Condition".equals(code)) + return Condition; + if ("Conformance".equals(code)) + return Conformance; + if ("Contract".equals(code)) + return Contract; + if ("Coverage".equals(code)) + return Coverage; + if ("DataElement".equals(code)) + return DataElement; + if ("DecisionSupportRule".equals(code)) + return DecisionSupportRule; + if ("DecisionSupportServiceModule".equals(code)) + return DecisionSupportServiceModule; + if ("DetectedIssue".equals(code)) + return DetectedIssue; + if ("Device".equals(code)) + return Device; + if ("DeviceComponent".equals(code)) + return DeviceComponent; + if ("DeviceMetric".equals(code)) + return DeviceMetric; + if ("DeviceUseRequest".equals(code)) + return DeviceUseRequest; + if ("DeviceUseStatement".equals(code)) + return DeviceUseStatement; + if ("DiagnosticOrder".equals(code)) + return DiagnosticOrder; + if ("DiagnosticReport".equals(code)) + return DiagnosticReport; + if ("DocumentManifest".equals(code)) + return DocumentManifest; + if ("DocumentReference".equals(code)) + return DocumentReference; + if ("EligibilityRequest".equals(code)) + return EligibilityRequest; + if ("EligibilityResponse".equals(code)) + return EligibilityResponse; + if ("Encounter".equals(code)) + return Encounter; + if ("EnrollmentRequest".equals(code)) + return EnrollmentRequest; + if ("EnrollmentResponse".equals(code)) + return EnrollmentResponse; + if ("EpisodeOfCare".equals(code)) + return EpisodeOfCare; + if ("ExpansionProfile".equals(code)) + return ExpansionProfile; + if ("ExplanationOfBenefit".equals(code)) + return ExplanationOfBenefit; + if ("FamilyMemberHistory".equals(code)) + return FamilyMemberHistory; + if ("Flag".equals(code)) + return Flag; + if ("Goal".equals(code)) + return Goal; + if ("Group".equals(code)) + return Group; + if ("GuidanceResponse".equals(code)) + return GuidanceResponse; + if ("HealthcareService".equals(code)) + return HealthcareService; + if ("ImagingExcerpt".equals(code)) + return ImagingExcerpt; + if ("ImagingObjectSelection".equals(code)) + return ImagingObjectSelection; + if ("ImagingStudy".equals(code)) + return ImagingStudy; + if ("Immunization".equals(code)) + return Immunization; + if ("ImmunizationRecommendation".equals(code)) + return ImmunizationRecommendation; + if ("ImplementationGuide".equals(code)) + return ImplementationGuide; + if ("Library".equals(code)) + return Library; + if ("Linkage".equals(code)) + return Linkage; + if ("List".equals(code)) + return List; + if ("Location".equals(code)) + return Location; + if ("Measure".equals(code)) + return Measure; + if ("MeasureReport".equals(code)) + return MeasureReport; + if ("Media".equals(code)) + return Media; + if ("Medication".equals(code)) + return Medication; + if ("MedicationAdministration".equals(code)) + return MedicationAdministration; + if ("MedicationDispense".equals(code)) + return MedicationDispense; + if ("MedicationOrder".equals(code)) + return MedicationOrder; + if ("MedicationStatement".equals(code)) + return MedicationStatement; + if ("MessageHeader".equals(code)) + return MessageHeader; + if ("ModuleDefinition".equals(code)) + return ModuleDefinition; + if ("NamingSystem".equals(code)) + return NamingSystem; + if ("NutritionOrder".equals(code)) + return NutritionOrder; + if ("Observation".equals(code)) + return Observation; + if ("OperationDefinition".equals(code)) + return OperationDefinition; + if ("OperationOutcome".equals(code)) + return OperationOutcome; + if ("Order".equals(code)) + return Order; + if ("OrderResponse".equals(code)) + return OrderResponse; + if ("OrderSet".equals(code)) + return OrderSet; + if ("Organization".equals(code)) + return Organization; + if ("Parameters".equals(code)) + return Parameters; + if ("Patient".equals(code)) + return Patient; + if ("PaymentNotice".equals(code)) + return PaymentNotice; + if ("PaymentReconciliation".equals(code)) + return PaymentReconciliation; + if ("Person".equals(code)) + return Person; + if ("Practitioner".equals(code)) + return Practitioner; + if ("PractitionerRole".equals(code)) + return PractitionerRole; + if ("Procedure".equals(code)) + return Procedure; + if ("ProcedureRequest".equals(code)) + return ProcedureRequest; + if ("ProcessRequest".equals(code)) + return ProcessRequest; + if ("ProcessResponse".equals(code)) + return ProcessResponse; + if ("Protocol".equals(code)) + return Protocol; + if ("Provenance".equals(code)) + return Provenance; + if ("Questionnaire".equals(code)) + return Questionnaire; + if ("QuestionnaireResponse".equals(code)) + return QuestionnaireResponse; + if ("ReferralRequest".equals(code)) + return ReferralRequest; + if ("RelatedPerson".equals(code)) + return RelatedPerson; + if ("RiskAssessment".equals(code)) + return RiskAssessment; + if ("Schedule".equals(code)) + return Schedule; + if ("SearchParameter".equals(code)) + return SearchParameter; + if ("Sequence".equals(code)) + return Sequence; + if ("Slot".equals(code)) + return Slot; + if ("Specimen".equals(code)) + return Specimen; + if ("StructureDefinition".equals(code)) + return StructureDefinition; + if ("StructureMap".equals(code)) + return StructureMap; + if ("Subscription".equals(code)) + return Subscription; + if ("Substance".equals(code)) + return Substance; + if ("SupplyDelivery".equals(code)) + return SupplyDelivery; + if ("SupplyRequest".equals(code)) + return SupplyRequest; + if ("Task".equals(code)) + return Task; + if ("TestScript".equals(code)) + return TestScript; + if ("ValueSet".equals(code)) + return ValueSet; + if ("VisionPrescription".equals(code)) + return VisionPrescription; + + throw new FHIRException("Unknown resource type"+code); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/RiskAssessment.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/RiskAssessment.java new file mode 100644 index 00000000000..bdc31a06e60 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/RiskAssessment.java @@ -0,0 +1,1429 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + */ +@ResourceDef(name="RiskAssessment", profile="http://hl7.org/fhir/Profile/RiskAssessment") +public class RiskAssessment extends DomainResource { + + @Block() + public static class RiskAssessmentPredictionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * One of the potential outcomes for the patient (e.g. remission, death, a particular condition). + */ + @Child(name = "outcome", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Possible outcome for the subject", formalDefinition="One of the potential outcomes for the patient (e.g. remission, death, a particular condition)." ) + protected CodeableConcept outcome; + + /** + * How likely is the outcome (in the specified timeframe). + */ + @Child(name = "probability", type = {DecimalType.class, Range.class, CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Likelihood of specified outcome", formalDefinition="How likely is the outcome (in the specified timeframe)." ) + protected Type probability; + + /** + * Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + @Child(name = "relativeRisk", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Relative likelihood", formalDefinition="Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.)." ) + protected DecimalType relativeRisk; + + /** + * Indicates the period of time or age range of the subject to which the specified probability applies. + */ + @Child(name = "when", type = {Period.class, Range.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Timeframe or age range", formalDefinition="Indicates the period of time or age range of the subject to which the specified probability applies." ) + protected Type when; + + /** + * Additional information explaining the basis for the prediction. + */ + @Child(name = "rationale", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Explanation of prediction", formalDefinition="Additional information explaining the basis for the prediction." ) + protected StringType rationale; + + private static final long serialVersionUID = 647967428L; + + /** + * Constructor + */ + public RiskAssessmentPredictionComponent() { + super(); + } + + /** + * Constructor + */ + public RiskAssessmentPredictionComponent(CodeableConcept outcome) { + super(); + this.outcome = outcome; + } + + /** + * @return {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) + */ + public RiskAssessmentPredictionComponent setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public Type getProbability() { + return this.probability; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public DecimalType getProbabilityDecimalType() throws FHIRException { + if (!(this.probability instanceof DecimalType)) + throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (DecimalType) this.probability; + } + + public boolean hasProbabilityDecimalType() { + return this.probability instanceof DecimalType; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public Range getProbabilityRange() throws FHIRException { + if (!(this.probability instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (Range) this.probability; + } + + public boolean hasProbabilityRange() { + return this.probability instanceof Range; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public CodeableConcept getProbabilityCodeableConcept() throws FHIRException { + if (!(this.probability instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (CodeableConcept) this.probability; + } + + public boolean hasProbabilityCodeableConcept() { + return this.probability instanceof CodeableConcept; + } + + public boolean hasProbability() { + return this.probability != null && !this.probability.isEmpty(); + } + + /** + * @param value {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public RiskAssessmentPredictionComponent setProbability(Type value) { + this.probability = value; + return this; + } + + /** + * @return {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value + */ + public DecimalType getRelativeRiskElement() { + if (this.relativeRisk == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.relativeRisk"); + else if (Configuration.doAutoCreate()) + this.relativeRisk = new DecimalType(); // bb + return this.relativeRisk; + } + + public boolean hasRelativeRiskElement() { + return this.relativeRisk != null && !this.relativeRisk.isEmpty(); + } + + public boolean hasRelativeRisk() { + return this.relativeRisk != null && !this.relativeRisk.isEmpty(); + } + + /** + * @param value {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value + */ + public RiskAssessmentPredictionComponent setRelativeRiskElement(DecimalType value) { + this.relativeRisk = value; + return this; + } + + /** + * @return Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + public BigDecimal getRelativeRisk() { + return this.relativeRisk == null ? null : this.relativeRisk.getValue(); + } + + /** + * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + public RiskAssessmentPredictionComponent setRelativeRisk(BigDecimal value) { + if (value == null) + this.relativeRisk = null; + else { + if (this.relativeRisk == null) + this.relativeRisk = new DecimalType(); + this.relativeRisk.setValue(value); + } + return this; + } + + /** + * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + public RiskAssessmentPredictionComponent setRelativeRisk(long value) { + this.relativeRisk = new DecimalType(); + this.relativeRisk.setValue(value); + return this; + } + + /** + * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + public RiskAssessmentPredictionComponent setRelativeRisk(double value) { + this.relativeRisk = new DecimalType(); + this.relativeRisk.setValue(value); + return this; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Type getWhen() { + return this.when; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Period getWhenPeriod() throws FHIRException { + if (!(this.when instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.when.getClass().getName()+" was encountered"); + return (Period) this.when; + } + + public boolean hasWhenPeriod() { + return this.when instanceof Period; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Range getWhenRange() throws FHIRException { + if (!(this.when instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.when.getClass().getName()+" was encountered"); + return (Range) this.when; + } + + public boolean hasWhenRange() { + return this.when instanceof Range; + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public RiskAssessmentPredictionComponent setWhen(Type value) { + this.when = value; + return this; + } + + /** + * @return {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value + */ + public StringType getRationaleElement() { + if (this.rationale == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.rationale"); + else if (Configuration.doAutoCreate()) + this.rationale = new StringType(); // bb + return this.rationale; + } + + public boolean hasRationaleElement() { + return this.rationale != null && !this.rationale.isEmpty(); + } + + public boolean hasRationale() { + return this.rationale != null && !this.rationale.isEmpty(); + } + + /** + * @param value {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value + */ + public RiskAssessmentPredictionComponent setRationaleElement(StringType value) { + this.rationale = value; + return this; + } + + /** + * @return Additional information explaining the basis for the prediction. + */ + public String getRationale() { + return this.rationale == null ? null : this.rationale.getValue(); + } + + /** + * @param value Additional information explaining the basis for the prediction. + */ + public RiskAssessmentPredictionComponent setRationale(String value) { + if (Utilities.noString(value)) + this.rationale = null; + else { + if (this.rationale == null) + this.rationale = new StringType(); + this.rationale.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("outcome", "CodeableConcept", "One of the potential outcomes for the patient (e.g. remission, death, a particular condition).", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("probability[x]", "decimal|Range|CodeableConcept", "How likely is the outcome (in the specified timeframe).", 0, java.lang.Integer.MAX_VALUE, probability)); + childrenList.add(new Property("relativeRisk", "decimal", "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).", 0, java.lang.Integer.MAX_VALUE, relativeRisk)); + childrenList.add(new Property("when[x]", "Period|Range", "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("rationale", "string", "Additional information explaining the basis for the prediction.", 0, java.lang.Integer.MAX_VALUE, rationale)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept + case -1290561483: /*probability*/ return this.probability == null ? new Base[0] : new Base[] {this.probability}; // Type + case -70741061: /*relativeRisk*/ return this.relativeRisk == null ? new Base[0] : new Base[] {this.relativeRisk}; // DecimalType + case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // Type + case 345689335: /*rationale*/ return this.rationale == null ? new Base[0] : new Base[] {this.rationale}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1106507950: // outcome + this.outcome = castToCodeableConcept(value); // CodeableConcept + break; + case -1290561483: // probability + this.probability = (Type) value; // Type + break; + case -70741061: // relativeRisk + this.relativeRisk = castToDecimal(value); // DecimalType + break; + case 3648314: // when + this.when = (Type) value; // Type + break; + case 345689335: // rationale + this.rationale = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("outcome")) + this.outcome = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("probability[x]")) + this.probability = (Type) value; // Type + else if (name.equals("relativeRisk")) + this.relativeRisk = castToDecimal(value); // DecimalType + else if (name.equals("when[x]")) + this.when = (Type) value; // Type + else if (name.equals("rationale")) + this.rationale = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1106507950: return getOutcome(); // CodeableConcept + case 1430185003: return getProbability(); // Type + case -70741061: throw new FHIRException("Cannot make property relativeRisk as it is not a complex type"); // DecimalType + case 1312831238: return getWhen(); // Type + case 345689335: throw new FHIRException("Cannot make property rationale as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("outcome")) { + this.outcome = new CodeableConcept(); + return this.outcome; + } + else if (name.equals("probabilityDecimal")) { + this.probability = new DecimalType(); + return this.probability; + } + else if (name.equals("probabilityRange")) { + this.probability = new Range(); + return this.probability; + } + else if (name.equals("probabilityCodeableConcept")) { + this.probability = new CodeableConcept(); + return this.probability; + } + else if (name.equals("relativeRisk")) { + throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.relativeRisk"); + } + else if (name.equals("whenPeriod")) { + this.when = new Period(); + return this.when; + } + else if (name.equals("whenRange")) { + this.when = new Range(); + return this.when; + } + else if (name.equals("rationale")) { + throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.rationale"); + } + else + return super.addChild(name); + } + + public RiskAssessmentPredictionComponent copy() { + RiskAssessmentPredictionComponent dst = new RiskAssessmentPredictionComponent(); + copyValues(dst); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.probability = probability == null ? null : probability.copy(); + dst.relativeRisk = relativeRisk == null ? null : relativeRisk.copy(); + dst.when = when == null ? null : when.copy(); + dst.rationale = rationale == null ? null : rationale.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RiskAssessmentPredictionComponent)) + return false; + RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other; + return compareDeep(outcome, o.outcome, true) && compareDeep(probability, o.probability, true) && compareDeep(relativeRisk, o.relativeRisk, true) + && compareDeep(when, o.when, true) && compareDeep(rationale, o.rationale, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RiskAssessmentPredictionComponent)) + return false; + RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other; + return compareValues(relativeRisk, o.relativeRisk, true) && compareValues(rationale, o.rationale, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (outcome == null || outcome.isEmpty()) && (probability == null || probability.isEmpty()) + && (relativeRisk == null || relativeRisk.isEmpty()) && (when == null || when.isEmpty()) && (rationale == null || rationale.isEmpty()) + ; + } + + public String fhirType() { + return "RiskAssessment.prediction"; + + } + + } + + /** + * The patient or group the risk assessment applies to. + */ + @Child(name = "subject", type = {Patient.class, Group.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who/what does assessment apply to?", formalDefinition="The patient or group the risk assessment applies to." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient or group the risk assessment applies to.) + */ + protected Resource subjectTarget; + + /** + * The date (and possibly time) the risk assessment was performed. + */ + @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When was assessment made?", formalDefinition="The date (and possibly time) the risk assessment was performed." ) + protected DateTimeType date; + + /** + * For assessments or prognosis specific to a particular condition, indicates the condition being assessed. + */ + @Child(name = "condition", type = {Condition.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Condition assessed", formalDefinition="For assessments or prognosis specific to a particular condition, indicates the condition being assessed." ) + protected Reference condition; + + /** + * The actual object that is the target of the reference (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + protected Condition conditionTarget; + + /** + * The encounter where the assessment was performed. + */ + @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where was assessment performed?", formalDefinition="The encounter where the assessment was performed." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter where the assessment was performed.) + */ + protected Encounter encounterTarget; + + /** + * The provider or software application that performed the assessment. + */ + @Child(name = "performer", type = {Practitioner.class, Device.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who did assessment?", formalDefinition="The provider or software application that performed the assessment." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (The provider or software application that performed the assessment.) + */ + protected Resource performerTarget; + + /** + * Business identifier assigned to the risk assessment. + */ + @Child(name = "identifier", type = {Identifier.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier for the assessment", formalDefinition="Business identifier assigned to the risk assessment." ) + protected Identifier identifier; + + /** + * The algorithm, process or mechanism used to evaluate the risk. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Evaluation mechanism", formalDefinition="The algorithm, process or mechanism used to evaluate the risk." ) + protected CodeableConcept method; + + /** + * Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.). + */ + @Child(name = "basis", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Information used in assessment", formalDefinition="Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.)." ) + protected List basis; + /** + * The actual objects that are the target of the reference (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + protected List basisTarget; + + + /** + * Describes the expected outcome for the subject. + */ + @Child(name = "prediction", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Outcome predicted", formalDefinition="Describes the expected outcome for the subject." ) + protected List prediction; + + /** + * A description of the steps that might be taken to reduce the identified risk(s). + */ + @Child(name = "mitigation", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="How to reduce risk", formalDefinition="A description of the steps that might be taken to reduce the identified risk(s)." ) + protected StringType mitigation; + + private static final long serialVersionUID = 724306293L; + + /** + * Constructor + */ + public RiskAssessment() { + super(); + } + + /** + * @return {@link #subject} (The patient or group the risk assessment applies to.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient or group the risk assessment applies to.) + */ + public RiskAssessment 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 or group the risk assessment applies to.) + */ + public Resource getSubjectTarget() { + 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 or group the risk assessment applies to.) + */ + public RiskAssessment setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #date} (The date (and possibly time) the risk assessment was performed.). 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 RiskAssessment.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public RiskAssessment setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and possibly time) the risk assessment was performed. + */ + 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(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public Reference getCondition() { + if (this.condition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.condition"); + else if (Configuration.doAutoCreate()) + this.condition = new Reference(); // cc + return this.condition; + } + + public boolean hasCondition() { + return this.condition != null && !this.condition.isEmpty(); + } + + /** + * @param value {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public RiskAssessment setCondition(Reference value) { + this.condition = value; + return this; + } + + /** + * @return {@link #condition} 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. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public Condition getConditionTarget() { + if (this.conditionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.condition"); + else if (Configuration.doAutoCreate()) + this.conditionTarget = new Condition(); // aa + return this.conditionTarget; + } + + /** + * @param value {@link #condition} 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. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public RiskAssessment setConditionTarget(Condition value) { + this.conditionTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The encounter where the assessment was performed.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter where the assessment was performed.) + */ + public RiskAssessment 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 where the assessment was performed.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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 where the assessment was performed.) + */ + public RiskAssessment setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #performer} (The provider or software application that performed the assessment.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (The provider or software application that performed the assessment.) + */ + public RiskAssessment setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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 or software application that performed the assessment.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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 or software application that performed the assessment.) + */ + public RiskAssessment setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Business identifier assigned to the risk assessment.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Business identifier assigned to the risk assessment.) + */ + public RiskAssessment setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #method} (The algorithm, process or mechanism used to evaluate the risk.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (The algorithm, process or mechanism used to evaluate the risk.) + */ + public RiskAssessment setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + public List getBasis() { + if (this.basis == null) + this.basis = new ArrayList(); + return this.basis; + } + + public boolean hasBasis() { + if (this.basis == null) + return false; + for (Reference item : this.basis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + // syntactic sugar + public Reference addBasis() { //3 + Reference t = new Reference(); + if (this.basis == null) + this.basis = new ArrayList(); + this.basis.add(t); + return t; + } + + // syntactic sugar + public RiskAssessment addBasis(Reference t) { //3 + if (t == null) + return this; + if (this.basis == null) + this.basis = new ArrayList(); + this.basis.add(t); + return this; + } + + /** + * @return {@link #basis} (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. Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + public List getBasisTarget() { + if (this.basisTarget == null) + this.basisTarget = new ArrayList(); + return this.basisTarget; + } + + /** + * @return {@link #prediction} (Describes the expected outcome for the subject.) + */ + public List getPrediction() { + if (this.prediction == null) + this.prediction = new ArrayList(); + return this.prediction; + } + + public boolean hasPrediction() { + if (this.prediction == null) + return false; + for (RiskAssessmentPredictionComponent item : this.prediction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prediction} (Describes the expected outcome for the subject.) + */ + // syntactic sugar + public RiskAssessmentPredictionComponent addPrediction() { //3 + RiskAssessmentPredictionComponent t = new RiskAssessmentPredictionComponent(); + if (this.prediction == null) + this.prediction = new ArrayList(); + this.prediction.add(t); + return t; + } + + // syntactic sugar + public RiskAssessment addPrediction(RiskAssessmentPredictionComponent t) { //3 + if (t == null) + return this; + if (this.prediction == null) + this.prediction = new ArrayList(); + this.prediction.add(t); + return this; + } + + /** + * @return {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value + */ + public StringType getMitigationElement() { + if (this.mitigation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.mitigation"); + else if (Configuration.doAutoCreate()) + this.mitigation = new StringType(); // bb + return this.mitigation; + } + + public boolean hasMitigationElement() { + return this.mitigation != null && !this.mitigation.isEmpty(); + } + + public boolean hasMitigation() { + return this.mitigation != null && !this.mitigation.isEmpty(); + } + + /** + * @param value {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value + */ + public RiskAssessment setMitigationElement(StringType value) { + this.mitigation = value; + return this; + } + + /** + * @return A description of the steps that might be taken to reduce the identified risk(s). + */ + public String getMitigation() { + return this.mitigation == null ? null : this.mitigation.getValue(); + } + + /** + * @param value A description of the steps that might be taken to reduce the identified risk(s). + */ + public RiskAssessment setMitigation(String value) { + if (Utilities.noString(value)) + this.mitigation = null; + else { + if (this.mitigation == null) + this.mitigation = new StringType(); + this.mitigation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("subject", "Reference(Patient|Group)", "The patient or group the risk assessment applies to.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("date", "dateTime", "The date (and possibly time) the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("condition", "Reference(Condition)", "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter where the assessment was performed.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("performer", "Reference(Practitioner|Device)", "The provider or software application that performed the assessment.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("method", "CodeableConcept", "The algorithm, process or mechanism used to evaluate the risk.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("basis", "Reference(Any)", "Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).", 0, java.lang.Integer.MAX_VALUE, basis)); + childrenList.add(new Property("prediction", "", "Describes the expected outcome for the subject.", 0, java.lang.Integer.MAX_VALUE, prediction)); + childrenList.add(new Property("mitigation", "string", "A description of the steps that might be taken to reduce the identified risk(s).", 0, java.lang.Integer.MAX_VALUE, mitigation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept + case 93508670: /*basis*/ return this.basis == null ? new Base[0] : this.basis.toArray(new Base[this.basis.size()]); // Reference + case 1161234575: /*prediction*/ return this.prediction == null ? new Base[0] : this.prediction.toArray(new Base[this.prediction.size()]); // RiskAssessmentPredictionComponent + case 1293793087: /*mitigation*/ return this.mitigation == null ? new Base[0] : new Base[] {this.mitigation}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -861311717: // condition + this.condition = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case 481140686: // performer + this.performer = castToReference(value); // Reference + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -1077554975: // method + this.method = castToCodeableConcept(value); // CodeableConcept + break; + case 93508670: // basis + this.getBasis().add(castToReference(value)); // Reference + break; + case 1161234575: // prediction + this.getPrediction().add((RiskAssessmentPredictionComponent) value); // RiskAssessmentPredictionComponent + break; + case 1293793087: // mitigation + this.mitigation = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("condition")) + this.condition = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("performer")) + this.performer = castToReference(value); // Reference + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("method")) + this.method = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("basis")) + this.getBasis().add(castToReference(value)); + else if (name.equals("prediction")) + this.getPrediction().add((RiskAssessmentPredictionComponent) value); + else if (name.equals("mitigation")) + this.mitigation = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1867885268: return getSubject(); // Reference + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -861311717: return getCondition(); // Reference + case 1524132147: return getEncounter(); // Reference + case 481140686: return getPerformer(); // Reference + case -1618432855: return getIdentifier(); // Identifier + case -1077554975: return getMethod(); // CodeableConcept + case 93508670: return addBasis(); // Reference + case 1161234575: return addPrediction(); // RiskAssessmentPredictionComponent + case 1293793087: throw new FHIRException("Cannot make property mitigation as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.date"); + } + else if (name.equals("condition")) { + this.condition = new Reference(); + return this.condition; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("performer")) { + this.performer = new Reference(); + return this.performer; + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("method")) { + this.method = new CodeableConcept(); + return this.method; + } + else if (name.equals("basis")) { + return addBasis(); + } + else if (name.equals("prediction")) { + return addPrediction(); + } + else if (name.equals("mitigation")) { + throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.mitigation"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "RiskAssessment"; + + } + + public RiskAssessment copy() { + RiskAssessment dst = new RiskAssessment(); + copyValues(dst); + dst.subject = subject == null ? null : subject.copy(); + dst.date = date == null ? null : date.copy(); + dst.condition = condition == null ? null : condition.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.method = method == null ? null : method.copy(); + if (basis != null) { + dst.basis = new ArrayList(); + for (Reference i : basis) + dst.basis.add(i.copy()); + }; + if (prediction != null) { + dst.prediction = new ArrayList(); + for (RiskAssessmentPredictionComponent i : prediction) + dst.prediction.add(i.copy()); + }; + dst.mitigation = mitigation == null ? null : mitigation.copy(); + return dst; + } + + protected RiskAssessment typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RiskAssessment)) + return false; + RiskAssessment o = (RiskAssessment) other; + return compareDeep(subject, o.subject, true) && compareDeep(date, o.date, true) && compareDeep(condition, o.condition, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(performer, o.performer, true) && compareDeep(identifier, o.identifier, true) + && compareDeep(method, o.method, true) && compareDeep(basis, o.basis, true) && compareDeep(prediction, o.prediction, true) + && compareDeep(mitigation, o.mitigation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RiskAssessment)) + return false; + RiskAssessment o = (RiskAssessment) other; + return compareValues(date, o.date, true) && compareValues(mitigation, o.mitigation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (subject == null || subject.isEmpty()) && (date == null || date.isEmpty()) + && (condition == null || condition.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (performer == null || performer.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (method == null || method.isEmpty()) && (basis == null || basis.isEmpty()) && (prediction == null || prediction.isEmpty()) + && (mitigation == null || mitigation.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.RiskAssessment; + } + + /** + * Search parameter: patient + *

+ * Description: Who/what does assessment apply to?
+ * Type: reference
+ * Path: RiskAssessment.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who/what does assessment apply to?
+ * Type: reference
+ * Path: RiskAssessment.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "RiskAssessment:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("RiskAssessment:patient").toLocked(); + + /** + * Search parameter: condition + *

+ * Description: Condition assessed
+ * Type: reference
+ * Path: RiskAssessment.condition
+ *

+ */ + @SearchParamDefinition(name="condition", path="RiskAssessment.condition", description="Condition assessed", type="reference" ) + public static final String SP_CONDITION = "condition"; + /** + * Fluent Client search parameter constant for condition + *

+ * Description: Condition assessed
+ * Type: reference
+ * Path: RiskAssessment.condition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "RiskAssessment:condition". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("RiskAssessment:condition").toLocked(); + + /** + * Search parameter: subject + *

+ * Description: Who/what does assessment apply to?
+ * Type: reference
+ * Path: RiskAssessment.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Who/what does assessment apply to?
+ * Type: reference
+ * Path: RiskAssessment.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "RiskAssessment:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("RiskAssessment:subject").toLocked(); + + /** + * Search parameter: performer + *

+ * Description: Who did assessment?
+ * Type: reference
+ * Path: RiskAssessment.performer
+ *

+ */ + @SearchParamDefinition(name="performer", path="RiskAssessment.performer", description="Who did assessment?", type="reference" ) + public static final String SP_PERFORMER = "performer"; + /** + * Fluent Client search parameter constant for performer + *

+ * Description: Who did assessment?
+ * Type: reference
+ * Path: RiskAssessment.performer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "RiskAssessment:performer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("RiskAssessment:performer").toLocked(); + + /** + * Search parameter: method + *

+ * Description: Evaluation mechanism
+ * Type: token
+ * Path: RiskAssessment.method
+ *

+ */ + @SearchParamDefinition(name="method", path="RiskAssessment.method", description="Evaluation mechanism", type="token" ) + public static final String SP_METHOD = "method"; + /** + * Fluent Client search parameter constant for method + *

+ * Description: Evaluation mechanism
+ * Type: token
+ * Path: RiskAssessment.method
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam METHOD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_METHOD); + + /** + * Search parameter: encounter + *

+ * Description: Where was assessment performed?
+ * Type: reference
+ * Path: RiskAssessment.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="RiskAssessment.encounter", description="Where was assessment performed?", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Where was assessment performed?
+ * Type: reference
+ * Path: RiskAssessment.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "RiskAssessment:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("RiskAssessment:encounter").toLocked(); + + /** + * Search parameter: date + *

+ * Description: When was assessment made?
+ * Type: date
+ * Path: RiskAssessment.date
+ *

+ */ + @SearchParamDefinition(name="date", path="RiskAssessment.date", description="When was assessment made?", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When was assessment made?
+ * Type: date
+ * Path: RiskAssessment.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Unique identifier for the assessment
+ * Type: token
+ * Path: RiskAssessment.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="RiskAssessment.identifier", description="Unique identifier for the assessment", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique identifier for the assessment
+ * Type: token
+ * Path: RiskAssessment.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SampledData.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SampledData.java new file mode 100644 index 00000000000..52f63992c19 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SampledData.java @@ -0,0 +1,668 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + */ +@DatatypeDef(name="SampledData") +public class SampledData extends Type implements ICompositeType { + + /** + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. + */ + @Child(name = "origin", type = {SimpleQuantity.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Zero value and units", formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series." ) + protected SimpleQuantity origin; + + /** + * The length of time between sampling times, measured in milliseconds. + */ + @Child(name = "period", type = {DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of milliseconds between samples", formalDefinition="The length of time between sampling times, measured in milliseconds." ) + protected DecimalType period; + + /** + * A correction factor that is applied to the sampled data points before they are added to the origin. + */ + @Child(name = "factor", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Multiply data by this before adding to origin", formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin." ) + protected DecimalType factor; + + /** + * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + @Child(name = "lowerLimit", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lower limit of detection", formalDefinition="The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)." ) + protected DecimalType lowerLimit; + + /** + * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + @Child(name = "upperLimit", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Upper limit of detection", formalDefinition="The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)." ) + protected DecimalType upperLimit; + + /** + * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + @Child(name = "dimensions", type = {PositiveIntType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of sample points at each time point", formalDefinition="The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once." ) + protected PositiveIntType dimensions; + + /** + * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + @Child(name = "data", type = {StringType.class}, order=6, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Decimal values with spaces, or \"E\" | \"U\" | \"L\"", formalDefinition="A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value." ) + protected StringType data; + + private static final long serialVersionUID = -1763278368L; + + /** + * Constructor + */ + public SampledData() { + super(); + } + + /** + * Constructor + */ + public SampledData(SimpleQuantity origin, DecimalType period, PositiveIntType dimensions, StringType data) { + super(); + this.origin = origin; + this.period = period; + this.dimensions = dimensions; + this.data = data; + } + + /** + * @return {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) + */ + public SimpleQuantity getOrigin() { + if (this.origin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.origin"); + else if (Configuration.doAutoCreate()) + this.origin = new SimpleQuantity(); // cc + return this.origin; + } + + public boolean hasOrigin() { + return this.origin != null && !this.origin.isEmpty(); + } + + /** + * @param value {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) + */ + public SampledData setOrigin(SimpleQuantity value) { + this.origin = value; + return this; + } + + /** + * @return {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public DecimalType getPeriodElement() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.period"); + else if (Configuration.doAutoCreate()) + this.period = new DecimalType(); // bb + return this.period; + } + + public boolean hasPeriodElement() { + return this.period != null && !this.period.isEmpty(); + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public SampledData setPeriodElement(DecimalType value) { + this.period = value; + return this; + } + + /** + * @return The length of time between sampling times, measured in milliseconds. + */ + public BigDecimal getPeriod() { + return this.period == null ? null : this.period.getValue(); + } + + /** + * @param value The length of time between sampling times, measured in milliseconds. + */ + public SampledData setPeriod(BigDecimal value) { + if (this.period == null) + this.period = new DecimalType(); + this.period.setValue(value); + return this; + } + + /** + * @param value The length of time between sampling times, measured in milliseconds. + */ + public SampledData setPeriod(long value) { + this.period = new DecimalType(); + this.period.setValue(value); + return this; + } + + /** + * @param value The length of time between sampling times, measured in milliseconds. + */ + public SampledData setPeriod(double value) { + this.period = new DecimalType(); + this.period.setValue(value); + return this; + } + + /** + * @return {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). 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 SampledData.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); // bb + 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 correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SampledData setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A correction factor that is applied to the sampled data points before they are added to the origin. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A correction factor that is applied to the sampled data points before they are added to the origin. + */ + public SampledData setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @param value A correction factor that is applied to the sampled data points before they are added to the origin. + */ + public SampledData setFactor(long value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @param value A correction factor that is applied to the sampled data points before they are added to the origin. + */ + public SampledData setFactor(double value) { + this.factor = new DecimalType(); + this.factor.setValue(value); + return this; + } + + /** + * @return {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value + */ + public DecimalType getLowerLimitElement() { + if (this.lowerLimit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.lowerLimit"); + else if (Configuration.doAutoCreate()) + this.lowerLimit = new DecimalType(); // bb + return this.lowerLimit; + } + + public boolean hasLowerLimitElement() { + return this.lowerLimit != null && !this.lowerLimit.isEmpty(); + } + + public boolean hasLowerLimit() { + return this.lowerLimit != null && !this.lowerLimit.isEmpty(); + } + + /** + * @param value {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value + */ + public SampledData setLowerLimitElement(DecimalType value) { + this.lowerLimit = value; + return this; + } + + /** + * @return The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + public BigDecimal getLowerLimit() { + return this.lowerLimit == null ? null : this.lowerLimit.getValue(); + } + + /** + * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + public SampledData setLowerLimit(BigDecimal value) { + if (value == null) + this.lowerLimit = null; + else { + if (this.lowerLimit == null) + this.lowerLimit = new DecimalType(); + this.lowerLimit.setValue(value); + } + return this; + } + + /** + * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + public SampledData setLowerLimit(long value) { + this.lowerLimit = new DecimalType(); + this.lowerLimit.setValue(value); + return this; + } + + /** + * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + public SampledData setLowerLimit(double value) { + this.lowerLimit = new DecimalType(); + this.lowerLimit.setValue(value); + return this; + } + + /** + * @return {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value + */ + public DecimalType getUpperLimitElement() { + if (this.upperLimit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.upperLimit"); + else if (Configuration.doAutoCreate()) + this.upperLimit = new DecimalType(); // bb + return this.upperLimit; + } + + public boolean hasUpperLimitElement() { + return this.upperLimit != null && !this.upperLimit.isEmpty(); + } + + public boolean hasUpperLimit() { + return this.upperLimit != null && !this.upperLimit.isEmpty(); + } + + /** + * @param value {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value + */ + public SampledData setUpperLimitElement(DecimalType value) { + this.upperLimit = value; + return this; + } + + /** + * @return The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + public BigDecimal getUpperLimit() { + return this.upperLimit == null ? null : this.upperLimit.getValue(); + } + + /** + * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + public SampledData setUpperLimit(BigDecimal value) { + if (value == null) + this.upperLimit = null; + else { + if (this.upperLimit == null) + this.upperLimit = new DecimalType(); + this.upperLimit.setValue(value); + } + return this; + } + + /** + * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + public SampledData setUpperLimit(long value) { + this.upperLimit = new DecimalType(); + this.upperLimit.setValue(value); + return this; + } + + /** + * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + public SampledData setUpperLimit(double value) { + this.upperLimit = new DecimalType(); + this.upperLimit.setValue(value); + return this; + } + + /** + * @return {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value + */ + public PositiveIntType getDimensionsElement() { + if (this.dimensions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.dimensions"); + else if (Configuration.doAutoCreate()) + this.dimensions = new PositiveIntType(); // bb + return this.dimensions; + } + + public boolean hasDimensionsElement() { + return this.dimensions != null && !this.dimensions.isEmpty(); + } + + public boolean hasDimensions() { + return this.dimensions != null && !this.dimensions.isEmpty(); + } + + /** + * @param value {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value + */ + public SampledData setDimensionsElement(PositiveIntType value) { + this.dimensions = value; + return this; + } + + /** + * @return The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + public int getDimensions() { + return this.dimensions == null || this.dimensions.isEmpty() ? 0 : this.dimensions.getValue(); + } + + /** + * @param value The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + public SampledData setDimensions(int value) { + if (this.dimensions == null) + this.dimensions = new PositiveIntType(); + this.dimensions.setValue(value); + return this; + } + + /** + * @return {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public StringType getDataElement() { + if (this.data == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.data"); + else if (Configuration.doAutoCreate()) + this.data = new StringType(); // bb + return this.data; + } + + public boolean hasDataElement() { + return this.data != null && !this.data.isEmpty(); + } + + public boolean hasData() { + return this.data != null && !this.data.isEmpty(); + } + + /** + * @param value {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public SampledData setDataElement(StringType value) { + this.data = value; + return this; + } + + /** + * @return A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + public String getData() { + return this.data == null ? null : this.data.getValue(); + } + + /** + * @param value A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + public SampledData setData(String value) { + if (this.data == null) + this.data = new StringType(); + this.data.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("origin", "SimpleQuantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("lowerLimit", "decimal", "The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit).", 0, java.lang.Integer.MAX_VALUE, lowerLimit)); + childrenList.add(new Property("upperLimit", "decimal", "The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit).", 0, java.lang.Integer.MAX_VALUE, upperLimit)); + childrenList.add(new Property("dimensions", "positiveInt", "The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.", 0, java.lang.Integer.MAX_VALUE, dimensions)); + childrenList.add(new Property("data", "string", "A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value.", 0, java.lang.Integer.MAX_VALUE, data)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // SimpleQuantity + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType + case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType + case 1209133370: /*lowerLimit*/ return this.lowerLimit == null ? new Base[0] : new Base[] {this.lowerLimit}; // DecimalType + case -1681713095: /*upperLimit*/ return this.upperLimit == null ? new Base[0] : new Base[] {this.upperLimit}; // DecimalType + case 414334925: /*dimensions*/ return this.dimensions == null ? new Base[0] : new Base[] {this.dimensions}; // PositiveIntType + case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1008619738: // origin + this.origin = castToSimpleQuantity(value); // SimpleQuantity + break; + case -991726143: // period + this.period = castToDecimal(value); // DecimalType + break; + case -1282148017: // factor + this.factor = castToDecimal(value); // DecimalType + break; + case 1209133370: // lowerLimit + this.lowerLimit = castToDecimal(value); // DecimalType + break; + case -1681713095: // upperLimit + this.upperLimit = castToDecimal(value); // DecimalType + break; + case 414334925: // dimensions + this.dimensions = castToPositiveInt(value); // PositiveIntType + break; + case 3076010: // data + this.data = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("origin")) + this.origin = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("period")) + this.period = castToDecimal(value); // DecimalType + else if (name.equals("factor")) + this.factor = castToDecimal(value); // DecimalType + else if (name.equals("lowerLimit")) + this.lowerLimit = castToDecimal(value); // DecimalType + else if (name.equals("upperLimit")) + this.upperLimit = castToDecimal(value); // DecimalType + else if (name.equals("dimensions")) + this.dimensions = castToPositiveInt(value); // PositiveIntType + else if (name.equals("data")) + this.data = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1008619738: return getOrigin(); // SimpleQuantity + case -991726143: throw new FHIRException("Cannot make property period as it is not a complex type"); // DecimalType + case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType + case 1209133370: throw new FHIRException("Cannot make property lowerLimit as it is not a complex type"); // DecimalType + case -1681713095: throw new FHIRException("Cannot make property upperLimit as it is not a complex type"); // DecimalType + case 414334925: throw new FHIRException("Cannot make property dimensions as it is not a complex type"); // PositiveIntType + case 3076010: throw new FHIRException("Cannot make property data as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("origin")) { + this.origin = new SimpleQuantity(); + return this.origin; + } + else if (name.equals("period")) { + throw new FHIRException("Cannot call addChild on a primitive type SampledData.period"); + } + else if (name.equals("factor")) { + throw new FHIRException("Cannot call addChild on a primitive type SampledData.factor"); + } + else if (name.equals("lowerLimit")) { + throw new FHIRException("Cannot call addChild on a primitive type SampledData.lowerLimit"); + } + else if (name.equals("upperLimit")) { + throw new FHIRException("Cannot call addChild on a primitive type SampledData.upperLimit"); + } + else if (name.equals("dimensions")) { + throw new FHIRException("Cannot call addChild on a primitive type SampledData.dimensions"); + } + else if (name.equals("data")) { + throw new FHIRException("Cannot call addChild on a primitive type SampledData.data"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "SampledData"; + + } + + public SampledData copy() { + SampledData dst = new SampledData(); + copyValues(dst); + dst.origin = origin == null ? null : origin.copy(); + dst.period = period == null ? null : period.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy(); + dst.upperLimit = upperLimit == null ? null : upperLimit.copy(); + dst.dimensions = dimensions == null ? null : dimensions.copy(); + dst.data = data == null ? null : data.copy(); + return dst; + } + + protected SampledData typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SampledData)) + return false; + SampledData o = (SampledData) other; + return compareDeep(origin, o.origin, true) && compareDeep(period, o.period, true) && compareDeep(factor, o.factor, true) + && compareDeep(lowerLimit, o.lowerLimit, true) && compareDeep(upperLimit, o.upperLimit, true) && compareDeep(dimensions, o.dimensions, true) + && compareDeep(data, o.data, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SampledData)) + return false; + SampledData o = (SampledData) other; + return compareValues(period, o.period, true) && compareValues(factor, o.factor, true) && compareValues(lowerLimit, o.lowerLimit, true) + && compareValues(upperLimit, o.upperLimit, true) && compareValues(dimensions, o.dimensions, true) && compareValues(data, o.data, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (origin == null || origin.isEmpty()) && (period == null || period.isEmpty()) + && (factor == null || factor.isEmpty()) && (lowerLimit == null || lowerLimit.isEmpty()) && (upperLimit == null || upperLimit.isEmpty()) + && (dimensions == null || dimensions.isEmpty()) && (data == null || data.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Schedule.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Schedule.java new file mode 100644 index 00000000000..751b049530c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Schedule.java @@ -0,0 +1,653 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A container for slot(s) of time that may be available for booking appointments. + */ +@ResourceDef(name="Schedule", profile="http://hl7.org/fhir/Profile/Schedule") +public class Schedule extends DomainResource { + + /** + * External Ids for this item. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) + protected List identifier; + + /** + * A broad categorisation of the service that is to be performed during this appointment. + */ + @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A broad categorisation of the service that is to be performed during this appointment", formalDefinition="A broad categorisation of the service that is to be performed during this appointment." ) + protected CodeableConcept serviceCategory; + + /** + * The specific service that is to be performed during this appointment. + */ + @Child(name = "serviceType", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The specific service that is to be performed during this appointment", formalDefinition="The specific service that is to be performed during this appointment." ) + protected List serviceType; + + /** + * The specialty of a practitioner that would be required to perform the service requested in this appointment. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment", formalDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment." ) + protected List specialty; + + /** + * The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. + */ + @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson", formalDefinition="The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + protected Resource actorTarget; + + /** + * The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. + */ + @Child(name = "planningHorizon", type = {Period.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a \"template\" for planning outside these dates", formalDefinition="The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a \"template\" for planning outside these dates." ) + protected Period planningHorizon; + + /** + * Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + @Child(name = "comment", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", formalDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated." ) + protected StringType comment; + + private static final long serialVersionUID = 1234951934L; + + /** + * Constructor + */ + public Schedule() { + super(); + } + + /** + * Constructor + */ + public Schedule(Reference actor) { + super(); + this.actor = actor; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + 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} (External Ids for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Schedule addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) + */ + public CodeableConcept getServiceCategory() { + if (this.serviceCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Schedule.serviceCategory"); + else if (Configuration.doAutoCreate()) + this.serviceCategory = new CodeableConcept(); // cc + return this.serviceCategory; + } + + public boolean hasServiceCategory() { + return this.serviceCategory != null && !this.serviceCategory.isEmpty(); + } + + /** + * @param value {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) + */ + public Schedule setServiceCategory(CodeableConcept value) { + this.serviceCategory = value; + return this; + } + + /** + * @return {@link #serviceType} (The specific service that is to be performed during this appointment.) + */ + public List getServiceType() { + if (this.serviceType == null) + this.serviceType = new ArrayList(); + return this.serviceType; + } + + public boolean hasServiceType() { + if (this.serviceType == null) + return false; + for (CodeableConcept item : this.serviceType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceType} (The specific service that is to be performed during this appointment.) + */ + // syntactic sugar + public CodeableConcept addServiceType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return t; + } + + // syntactic sugar + public Schedule addServiceType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return this; + } + + /** + * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + // syntactic sugar + public Schedule addSpecialty(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return this; + } + + /** + * @return {@link #actor} (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Schedule.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); // cc + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Schedule setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Schedule setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #planningHorizon} (The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) + */ + public Period getPlanningHorizon() { + if (this.planningHorizon == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Schedule.planningHorizon"); + else if (Configuration.doAutoCreate()) + this.planningHorizon = new Period(); // cc + return this.planningHorizon; + } + + public boolean hasPlanningHorizon() { + return this.planningHorizon != null && !this.planningHorizon.isEmpty(); + } + + /** + * @param value {@link #planningHorizon} (The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) + */ + public Schedule setPlanningHorizon(Period value) { + this.planningHorizon = value; + return this; + } + + /** + * @return {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Schedule.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Schedule setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + public Schedule setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("serviceCategory", "CodeableConcept", "A broad categorisation of the service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); + childrenList.add(new Property("serviceType", "CodeableConcept", "The specific service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceType)); + childrenList.add(new Property("specialty", "CodeableConcept", "The specialty of a practitioner that would be required to perform the service requested in this appointment.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("planningHorizon", "Period", "The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a \"template\" for planning outside these dates.", 0, java.lang.Integer.MAX_VALUE, planningHorizon)); + childrenList.add(new Property("comment", "string", "Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.", 0, java.lang.Integer.MAX_VALUE, comment)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept + case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept + case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept + case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference + case -1718507650: /*planningHorizon*/ return this.planningHorizon == null ? new Base[0] : new Base[] {this.planningHorizon}; // Period + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1281188563: // serviceCategory + this.serviceCategory = castToCodeableConcept(value); // CodeableConcept + break; + case -1928370289: // serviceType + this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1694759682: // specialty + this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 92645877: // actor + this.actor = castToReference(value); // Reference + break; + case -1718507650: // planningHorizon + this.planningHorizon = castToPeriod(value); // Period + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("serviceCategory")) + this.serviceCategory = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("serviceType")) + this.getServiceType().add(castToCodeableConcept(value)); + else if (name.equals("specialty")) + this.getSpecialty().add(castToCodeableConcept(value)); + else if (name.equals("actor")) + this.actor = castToReference(value); // Reference + else if (name.equals("planningHorizon")) + this.planningHorizon = castToPeriod(value); // Period + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 1281188563: return getServiceCategory(); // CodeableConcept + case -1928370289: return addServiceType(); // CodeableConcept + case -1694759682: return addSpecialty(); // CodeableConcept + case 92645877: return getActor(); // Reference + case -1718507650: return getPlanningHorizon(); // Period + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("serviceCategory")) { + this.serviceCategory = new CodeableConcept(); + return this.serviceCategory; + } + else if (name.equals("serviceType")) { + return addServiceType(); + } + else if (name.equals("specialty")) { + return addSpecialty(); + } + else if (name.equals("actor")) { + this.actor = new Reference(); + return this.actor; + } + else if (name.equals("planningHorizon")) { + this.planningHorizon = new Period(); + return this.planningHorizon; + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type Schedule.comment"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Schedule"; + + } + + public Schedule copy() { + Schedule dst = new Schedule(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); + if (serviceType != null) { + dst.serviceType = new ArrayList(); + for (CodeableConcept i : serviceType) + dst.serviceType.add(i.copy()); + }; + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + dst.actor = actor == null ? null : actor.copy(); + dst.planningHorizon = planningHorizon == null ? null : planningHorizon.copy(); + dst.comment = comment == null ? null : comment.copy(); + return dst; + } + + protected Schedule typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Schedule)) + return false; + Schedule o = (Schedule) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(serviceCategory, o.serviceCategory, true) + && compareDeep(serviceType, o.serviceType, true) && compareDeep(specialty, o.specialty, true) && compareDeep(actor, o.actor, true) + && compareDeep(planningHorizon, o.planningHorizon, true) && compareDeep(comment, o.comment, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Schedule)) + return false; + Schedule o = (Schedule) other; + return compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty()) + && (serviceType == null || serviceType.isEmpty()) && (specialty == null || specialty.isEmpty()) + && (actor == null || actor.isEmpty()) && (planningHorizon == null || planningHorizon.isEmpty()) + && (comment == null || comment.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Schedule; + } + + /** + * Search parameter: actor + *

+ * Description: The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for
+ * Type: reference
+ * Path: Schedule.actor
+ *

+ */ + @SearchParamDefinition(name="actor", path="Schedule.actor", description="The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for", type="reference" ) + public static final String SP_ACTOR = "actor"; + /** + * Fluent Client search parameter constant for actor + *

+ * Description: The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for
+ * Type: reference
+ * Path: Schedule.actor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Schedule:actor". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("Schedule:actor").toLocked(); + + /** + * Search parameter: date + *

+ * Description: Search for Schedule resources that have a period that contains this date specified
+ * Type: date
+ * Path: Schedule.planningHorizon
+ *

+ */ + @SearchParamDefinition(name="date", path="Schedule.planningHorizon", description="Search for Schedule resources that have a period that contains this date specified", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Search for Schedule resources that have a period that contains this date specified
+ * Type: date
+ * Path: Schedule.planningHorizon
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: type + *

+ * Description: The type of appointments that can be booked into associated slot(s)
+ * Type: token
+ * Path: Schedule.serviceType
+ *

+ */ + @SearchParamDefinition(name="type", path="Schedule.serviceType", description="The type of appointments that can be booked into associated slot(s)", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The type of appointments that can be booked into associated slot(s)
+ * Type: token
+ * Path: Schedule.serviceType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: A Schedule Identifier
+ * Type: token
+ * Path: Schedule.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Schedule.identifier", description="A Schedule Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A Schedule Identifier
+ * Type: token
+ * Path: Schedule.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SearchParameter.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SearchParameter.java new file mode 100644 index 00000000000..99fa2262555 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SearchParameter.java @@ -0,0 +1,1824 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType; +import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A search parameter that defines a named search item that can be used to search/filter on a resource. + */ +@ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter") +public class SearchParameter extends DomainResource { + + public enum XPathUsageType { + /** + * The search parameter is derived directly from the selected nodes based on the type definitions. + */ + NORMAL, + /** + * The search parameter is derived by a phonetic transform from the selected nodes. + */ + PHONETIC, + /** + * The search parameter is based on a spatial transform of the selected nodes. + */ + NEARBY, + /** + * The search parameter is based on a spatial transform of the selected nodes, using physical distance from the middle. + */ + DISTANCE, + /** + * The interpretation of the xpath statement is unknown (and can't be automated). + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static XPathUsageType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("normal".equals(codeString)) + return NORMAL; + if ("phonetic".equals(codeString)) + return PHONETIC; + if ("nearby".equals(codeString)) + return NEARBY; + if ("distance".equals(codeString)) + return DISTANCE; + if ("other".equals(codeString)) + return OTHER; + throw new FHIRException("Unknown XPathUsageType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NORMAL: return "normal"; + case PHONETIC: return "phonetic"; + case NEARBY: return "nearby"; + case DISTANCE: return "distance"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NORMAL: return "http://hl7.org/fhir/search-xpath-usage"; + case PHONETIC: return "http://hl7.org/fhir/search-xpath-usage"; + case NEARBY: return "http://hl7.org/fhir/search-xpath-usage"; + case DISTANCE: return "http://hl7.org/fhir/search-xpath-usage"; + case OTHER: return "http://hl7.org/fhir/search-xpath-usage"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NORMAL: return "The search parameter is derived directly from the selected nodes based on the type definitions."; + case PHONETIC: return "The search parameter is derived by a phonetic transform from the selected nodes."; + case NEARBY: return "The search parameter is based on a spatial transform of the selected nodes."; + case DISTANCE: return "The search parameter is based on a spatial transform of the selected nodes, using physical distance from the middle."; + case OTHER: return "The interpretation of the xpath statement is unknown (and can't be automated)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NORMAL: return "Normal"; + case PHONETIC: return "Phonetic"; + case NEARBY: return "Nearby"; + case DISTANCE: return "Distance"; + case OTHER: return "Other"; + default: return "?"; + } + } + } + + public static class XPathUsageTypeEnumFactory implements EnumFactory { + public XPathUsageType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("normal".equals(codeString)) + return XPathUsageType.NORMAL; + if ("phonetic".equals(codeString)) + return XPathUsageType.PHONETIC; + if ("nearby".equals(codeString)) + return XPathUsageType.NEARBY; + if ("distance".equals(codeString)) + return XPathUsageType.DISTANCE; + if ("other".equals(codeString)) + return XPathUsageType.OTHER; + throw new IllegalArgumentException("Unknown XPathUsageType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("normal".equals(codeString)) + return new Enumeration(this, XPathUsageType.NORMAL); + if ("phonetic".equals(codeString)) + return new Enumeration(this, XPathUsageType.PHONETIC); + if ("nearby".equals(codeString)) + return new Enumeration(this, XPathUsageType.NEARBY); + if ("distance".equals(codeString)) + return new Enumeration(this, XPathUsageType.DISTANCE); + if ("other".equals(codeString)) + return new Enumeration(this, XPathUsageType.OTHER); + throw new FHIRException("Unknown XPathUsageType code '"+codeString+"'"); + } + public String toCode(XPathUsageType code) { + if (code == XPathUsageType.NORMAL) + return "normal"; + if (code == XPathUsageType.PHONETIC) + return "phonetic"; + if (code == XPathUsageType.NEARBY) + return "nearby"; + if (code == XPathUsageType.DISTANCE) + return "distance"; + if (code == XPathUsageType.OTHER) + return "other"; + return "?"; + } + public String toSystem(XPathUsageType code) { + return code.getSystem(); + } + } + + @Block() + public static class SearchParameterContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the search parameter. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the search parameter." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public SearchParameterContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the search parameter.). 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 SearchParameterContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SearchParameterContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the search parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the search parameter. + */ + public SearchParameterContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public SearchParameterContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public SearchParameterContactComponent copy() { + SearchParameterContactComponent dst = new SearchParameterContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SearchParameterContactComponent)) + return false; + SearchParameterContactComponent o = (SearchParameterContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SearchParameterContactComponent)) + return false; + SearchParameterContactComponent o = (SearchParameterContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "SearchParameter.contact"; + + } + + } + + /** + * An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Absolute URL used to reference this search parameter", formalDefinition="An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published." ) + protected UriType url; + + /** + * A free text natural language name identifying the search parameter. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this search parameter", formalDefinition="A free text natural language name identifying the search parameter." ) + protected StringType name; + + /** + * The status of this search parameter definition. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this search parameter definition." ) + protected Enumeration status; + + /** + * A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes." ) + protected DateTimeType date; + + /** + * The name of the individual or organization that published the search parameter. + */ + @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the search parameter." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters." ) + protected List useContext; + + /** + * The Scope and Usage that this search parameter was created to meet. + */ + @Child(name = "requirements", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why this search parameter is defined", formalDefinition="The Scope and Usage that this search parameter was created to meet." ) + protected StringType requirements; + + /** + * The code used in the URL or the parameter name in a parameters resource for this search parameter. + */ + @Child(name = "code", type = {CodeType.class}, order=9, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Code used in URL", formalDefinition="The code used in the URL or the parameter name in a parameters resource for this search parameter." ) + protected CodeType code; + + /** + * The base resource type that this search parameter refers to. + */ + @Child(name = "base", type = {CodeType.class}, order=10, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The resource type this search parameter applies to", formalDefinition="The base resource type that this search parameter refers to." ) + protected CodeType base; + + /** + * The type of value a search parameter refers to, and how the content is interpreted. + */ + @Child(name = "type", type = {CodeType.class}, order=11, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) + protected Enumeration type; + + /** + * A description of the search parameters and how it used. + */ + @Child(name = "description", type = {StringType.class}, order=12, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Documentation for search parameter", formalDefinition="A description of the search parameters and how it used." ) + protected StringType description; + + /** + * A FluentPath expression that returns a set of elements for the search parameter. + */ + @Child(name = "expression", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="FluentPath expression that extracts the values", formalDefinition="A FluentPath expression that returns a set of elements for the search parameter." ) + protected StringType expression; + + /** + * An XPath expression that returns a set of elements for the search parameter. + */ + @Child(name = "xpath", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="XPath that extracts the values", formalDefinition="An XPath expression that returns a set of elements for the search parameter." ) + protected StringType xpath; + + /** + * How the search parameter relates to the set of elements returned by evaluating the xpath query. + */ + @Child(name = "xpathUsage", type = {CodeType.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="normal | phonetic | nearby | distance | other", formalDefinition="How the search parameter relates to the set of elements returned by evaluating the xpath query." ) + protected Enumeration xpathUsage; + + /** + * Types of resource (if a resource is referenced). + */ + @Child(name = "target", type = {CodeType.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) + protected List target; + + private static final long serialVersionUID = -310845178L; + + /** + * Constructor + */ + public SearchParameter() { + super(); + } + + /** + * Constructor + */ + public SearchParameter(UriType url, StringType name, CodeType code, CodeType base, Enumeration type, StringType description) { + super(); + this.url = url; + this.name = name; + this.code = code; + this.base = base; + this.type = type; + this.description = description; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SearchParameter setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published. + */ + public SearchParameter setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the search parameter.). 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 SearchParameter.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name identifying the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SearchParameter setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the search parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the search parameter. + */ + public SearchParameter setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of this search parameter definition.). 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 SearchParameter.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public SearchParameter setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this search parameter definition. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this search parameter definition. + */ + public SearchParameter setStatus(ConformanceResourceStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public SearchParameter setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public SearchParameter setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.). 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 SearchParameter.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public SearchParameter setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes. + */ + public SearchParameter setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public SearchParameter setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the search parameter. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the search parameter. + */ + public SearchParameter setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (SearchParameterContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public SearchParameterContactComponent addContact() { //3 + SearchParameterContactComponent t = new SearchParameterContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public SearchParameter addContact(SearchParameterContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public SearchParameter addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public SearchParameter setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return The Scope and Usage that this search parameter was created to meet. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value The Scope and Usage that this search parameter was created to meet. + */ + public SearchParameter setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (The code used in the URL or the parameter name in a parameters resource for this search parameter.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The code used in the URL or the parameter name in a parameters resource for this search parameter.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public SearchParameter setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return The code used in the URL or the parameter name in a parameters resource for this search parameter. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The code used in the URL or the parameter name in a parameters resource for this search parameter. + */ + public SearchParameter setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public CodeType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.base"); + else if (Configuration.doAutoCreate()) + this.base = new CodeType(); // bb + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public SearchParameter setBaseElement(CodeType value) { + this.base = value; + return this; + } + + /** + * @return The base resource type that this search parameter refers to. + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The base resource type that this search parameter refers to. + */ + public SearchParameter setBase(String value) { + if (this.base == null) + this.base = new CodeType(); + this.base.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). 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 SearchParameter.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new SearchParamTypeEnumFactory()); // bb + 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 of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SearchParameter setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParamType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParameter setType(SearchParamType value) { + if (this.type == null) + this.type = new Enumeration(new SearchParamTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #description} (A description of the search parameters and how it used.). 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 SearchParameter.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SearchParameter setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the search parameters and how it used. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the search parameters and how it used. + */ + public SearchParameter setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #expression} (A FluentPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public StringType getExpressionElement() { + if (this.expression == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.expression"); + else if (Configuration.doAutoCreate()) + this.expression = new StringType(); // bb + return this.expression; + } + + public boolean hasExpressionElement() { + return this.expression != null && !this.expression.isEmpty(); + } + + public boolean hasExpression() { + return this.expression != null && !this.expression.isEmpty(); + } + + /** + * @param value {@link #expression} (A FluentPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public SearchParameter setExpressionElement(StringType value) { + this.expression = value; + return this; + } + + /** + * @return A FluentPath expression that returns a set of elements for the search parameter. + */ + public String getExpression() { + return this.expression == null ? null : this.expression.getValue(); + } + + /** + * @param value A FluentPath expression that returns a set of elements for the search parameter. + */ + public SearchParameter setExpression(String value) { + if (Utilities.noString(value)) + this.expression = null; + else { + if (this.expression == null) + this.expression = new StringType(); + this.expression.setValue(value); + } + return this; + } + + /** + * @return {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public StringType getXpathElement() { + if (this.xpath == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.xpath"); + else if (Configuration.doAutoCreate()) + this.xpath = new StringType(); // bb + return this.xpath; + } + + public boolean hasXpathElement() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + public boolean hasXpath() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + /** + * @param value {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public SearchParameter setXpathElement(StringType value) { + this.xpath = value; + return this; + } + + /** + * @return An XPath expression that returns a set of elements for the search parameter. + */ + public String getXpath() { + return this.xpath == null ? null : this.xpath.getValue(); + } + + /** + * @param value An XPath expression that returns a set of elements for the search parameter. + */ + public SearchParameter setXpath(String value) { + if (Utilities.noString(value)) + this.xpath = null; + else { + if (this.xpath == null) + this.xpath = new StringType(); + this.xpath.setValue(value); + } + return this; + } + + /** + * @return {@link #xpathUsage} (How the search parameter relates to the set of elements returned by evaluating the xpath query.). This is the underlying object with id, value and extensions. The accessor "getXpathUsage" gives direct access to the value + */ + public Enumeration getXpathUsageElement() { + if (this.xpathUsage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.xpathUsage"); + else if (Configuration.doAutoCreate()) + this.xpathUsage = new Enumeration(new XPathUsageTypeEnumFactory()); // bb + return this.xpathUsage; + } + + public boolean hasXpathUsageElement() { + return this.xpathUsage != null && !this.xpathUsage.isEmpty(); + } + + public boolean hasXpathUsage() { + return this.xpathUsage != null && !this.xpathUsage.isEmpty(); + } + + /** + * @param value {@link #xpathUsage} (How the search parameter relates to the set of elements returned by evaluating the xpath query.). This is the underlying object with id, value and extensions. The accessor "getXpathUsage" gives direct access to the value + */ + public SearchParameter setXpathUsageElement(Enumeration value) { + this.xpathUsage = value; + return this; + } + + /** + * @return How the search parameter relates to the set of elements returned by evaluating the xpath query. + */ + public XPathUsageType getXpathUsage() { + return this.xpathUsage == null ? null : this.xpathUsage.getValue(); + } + + /** + * @param value How the search parameter relates to the set of elements returned by evaluating the xpath query. + */ + public SearchParameter setXpathUsage(XPathUsageType value) { + if (value == null) + this.xpathUsage = null; + else { + if (this.xpathUsage == null) + this.xpathUsage = new Enumeration(new XPathUsageTypeEnumFactory()); + this.xpathUsage.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (CodeType item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + // syntactic sugar + public CodeType addTargetElement() {//2 + CodeType t = new CodeType(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public SearchParameter addTarget(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public boolean hasTarget(String value) { + if (this.target == null) + return false; + for (CodeType v : this.target) + if (v.equals(value)) // code + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of this search parameter definition.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the search parameter.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("requirements", "string", "The Scope and Usage that this search parameter was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("code", "code", "The code used in the URL or the parameter name in a parameters resource for this search parameter.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("base", "code", "The base resource type that this search parameter refers to.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("description", "string", "A description of the search parameters and how it used.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("expression", "string", "A FluentPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, expression)); + childrenList.add(new Property("xpath", "string", "An XPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, xpath)); + childrenList.add(new Property("xpathUsage", "code", "How the search parameter relates to the set of elements returned by evaluating the xpath query.", 0, java.lang.Integer.MAX_VALUE, xpathUsage)); + childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // SearchParameterContactComponent + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // CodeType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType + case 114256029: /*xpath*/ return this.xpath == null ? new Base[0] : new Base[] {this.xpath}; // StringType + case 1801322244: /*xpathUsage*/ return this.xpathUsage == null ? new Base[0] : new Base[] {this.xpathUsage}; // Enumeration + case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // CodeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((SearchParameterContactComponent) value); // SearchParameterContactComponent + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case 3016401: // base + this.base = castToCode(value); // CodeType + break; + case 3575610: // type + this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1795452264: // expression + this.expression = castToString(value); // StringType + break; + case 114256029: // xpath + this.xpath = castToString(value); // StringType + break; + case 1801322244: // xpathUsage + this.xpathUsage = new XPathUsageTypeEnumFactory().fromType(value); // Enumeration + break; + case -880905839: // target + this.getTarget().add(castToCode(value)); // CodeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((SearchParameterContactComponent) value); + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("base")) + this.base = castToCode(value); // CodeType + else if (name.equals("type")) + this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("expression")) + this.expression = castToString(value); // StringType + else if (name.equals("xpath")) + this.xpath = castToString(value); // StringType + else if (name.equals("xpathUsage")) + this.xpathUsage = new XPathUsageTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("target")) + this.getTarget().add(castToCode(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // SearchParameterContactComponent + case -669707736: return addUseContext(); // CodeableConcept + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case 3016401: throw new FHIRException("Cannot make property base as it is not a complex type"); // CodeType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType + case 114256029: throw new FHIRException("Cannot make property xpath as it is not a complex type"); // StringType + case 1801322244: throw new FHIRException("Cannot make property xpathUsage as it is not a complex type"); // Enumeration + case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // CodeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.url"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.experimental"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.date"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.requirements"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.code"); + } + else if (name.equals("base")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.base"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.type"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.description"); + } + else if (name.equals("expression")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.expression"); + } + else if (name.equals("xpath")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.xpath"); + } + else if (name.equals("xpathUsage")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.xpathUsage"); + } + else if (name.equals("target")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.target"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "SearchParameter"; + + } + + public SearchParameter copy() { + SearchParameter dst = new SearchParameter(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (SearchParameterContactComponent i : contact) + dst.contact.add(i.copy()); + }; + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.code = code == null ? null : code.copy(); + dst.base = base == null ? null : base.copy(); + dst.type = type == null ? null : type.copy(); + dst.description = description == null ? null : description.copy(); + dst.expression = expression == null ? null : expression.copy(); + dst.xpath = xpath == null ? null : xpath.copy(); + dst.xpathUsage = xpathUsage == null ? null : xpathUsage.copy(); + if (target != null) { + dst.target = new ArrayList(); + for (CodeType i : target) + dst.target.add(i.copy()); + }; + return dst; + } + + protected SearchParameter typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SearchParameter)) + return false; + SearchParameter o = (SearchParameter) other; + return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) + && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(contact, o.contact, true) && compareDeep(useContext, o.useContext, true) && compareDeep(requirements, o.requirements, true) + && compareDeep(code, o.code, true) && compareDeep(base, o.base, true) && compareDeep(type, o.type, true) + && compareDeep(description, o.description, true) && compareDeep(expression, o.expression, true) + && compareDeep(xpath, o.xpath, true) && compareDeep(xpathUsage, o.xpathUsage, true) && compareDeep(target, o.target, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SearchParameter)) + return false; + SearchParameter o = (SearchParameter) other; + return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(status, o.status, true) + && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) + && compareValues(requirements, o.requirements, true) && compareValues(code, o.code, true) && compareValues(base, o.base, true) + && compareValues(type, o.type, true) && compareValues(description, o.description, true) && compareValues(expression, o.expression, true) + && compareValues(xpath, o.xpath, true) && compareValues(xpathUsage, o.xpathUsage, true) && compareValues(target, o.target, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) + && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) + && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (code == null || code.isEmpty()) && (base == null || base.isEmpty()) && (type == null || type.isEmpty()) + && (description == null || description.isEmpty()) && (expression == null || expression.isEmpty()) + && (xpath == null || xpath.isEmpty()) && (xpathUsage == null || xpathUsage.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SearchParameter; + } + + /** + * Search parameter: description + *

+ * Description: Documentation for search parameter
+ * Type: string
+ * Path: SearchParameter.description
+ *

+ */ + @SearchParamDefinition(name="description", path="SearchParameter.description", description="Documentation for search parameter", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Documentation for search parameter
+ * Type: string
+ * Path: SearchParameter.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: Informal name for this search parameter
+ * Type: string
+ * Path: SearchParameter.name
+ *

+ */ + @SearchParamDefinition(name="name", path="SearchParameter.name", description="Informal name for this search parameter", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Informal name for this search parameter
+ * Type: string
+ * Path: SearchParameter.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the search parameter
+ * Type: token
+ * Path: SearchParameter.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="SearchParameter.useContext", description="A use context assigned to the search parameter", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the search parameter
+ * Type: token
+ * Path: SearchParameter.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: target + *

+ * Description: Types of resource (if a resource reference)
+ * Type: token
+ * Path: SearchParameter.target
+ *

+ */ + @SearchParamDefinition(name="target", path="SearchParameter.target", description="Types of resource (if a resource reference)", type="token" ) + public static final String SP_TARGET = "target"; + /** + * Fluent Client search parameter constant for target + *

+ * Description: Types of resource (if a resource reference)
+ * Type: token
+ * Path: SearchParameter.target
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGET = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGET); + + /** + * Search parameter: base + *

+ * Description: The resource type this search parameter applies to
+ * Type: token
+ * Path: SearchParameter.base
+ *

+ */ + @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type this search parameter applies to", type="token" ) + public static final String SP_BASE = "base"; + /** + * Fluent Client search parameter constant for base + *

+ * Description: The resource type this search parameter applies to
+ * Type: token
+ * Path: SearchParameter.base
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam BASE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BASE); + + /** + * Search parameter: code + *

+ * Description: Code used in URL
+ * Type: token
+ * Path: SearchParameter.code
+ *

+ */ + @SearchParamDefinition(name="code", path="SearchParameter.code", description="Code used in URL", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: Code used in URL
+ * Type: token
+ * Path: SearchParameter.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: type + *

+ * Description: number | date | string | token | reference | composite | quantity | uri
+ * Type: token
+ * Path: SearchParameter.type
+ *

+ */ + @SearchParamDefinition(name="type", path="SearchParameter.type", description="number | date | string | token | reference | composite | quantity | uri", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: number | date | string | token | reference | composite | quantity | uri
+ * Type: token
+ * Path: SearchParameter.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: url + *

+ * Description: Absolute URL used to reference this search parameter
+ * Type: uri
+ * Path: SearchParameter.url
+ *

+ */ + @SearchParamDefinition(name="url", path="SearchParameter.url", description="Absolute URL used to reference this search parameter", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: Absolute URL used to reference this search parameter
+ * Type: uri
+ * Path: SearchParameter.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Sequence.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Sequence.java new file mode 100644 index 00000000000..fe543c74622 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Sequence.java @@ -0,0 +1,3999 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Variation and Sequence data. + */ +@ResourceDef(name="Sequence", profile="http://hl7.org/fhir/Profile/Sequence") +public class Sequence extends DomainResource { + + public enum SequenceType { + /** + * Amino acid sequence + */ + AA, + /** + * DNA Sequence + */ + DNA, + /** + * RNA Sequence + */ + RNA, + /** + * added to help the parsers + */ + NULL; + public static SequenceType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("AA".equals(codeString)) + return AA; + if ("DNA".equals(codeString)) + return DNA; + if ("RNA".equals(codeString)) + return RNA; + throw new FHIRException("Unknown SequenceType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case AA: return "AA"; + case DNA: return "DNA"; + case RNA: return "RNA"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AA: return "http://hl7.org/fhir/sequence-type"; + case DNA: return "http://hl7.org/fhir/sequence-type"; + case RNA: return "http://hl7.org/fhir/sequence-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AA: return "Amino acid sequence"; + case DNA: return "DNA Sequence"; + case RNA: return "RNA Sequence"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AA: return "AA Sequence"; + case DNA: return "DNA Sequence"; + case RNA: return "RNA Sequence"; + default: return "?"; + } + } + } + + public static class SequenceTypeEnumFactory implements EnumFactory { + public SequenceType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("AA".equals(codeString)) + return SequenceType.AA; + if ("DNA".equals(codeString)) + return SequenceType.DNA; + if ("RNA".equals(codeString)) + return SequenceType.RNA; + throw new IllegalArgumentException("Unknown SequenceType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("AA".equals(codeString)) + return new Enumeration(this, SequenceType.AA); + if ("DNA".equals(codeString)) + return new Enumeration(this, SequenceType.DNA); + if ("RNA".equals(codeString)) + return new Enumeration(this, SequenceType.RNA); + throw new FHIRException("Unknown SequenceType code '"+codeString+"'"); + } + public String toCode(SequenceType code) { + if (code == SequenceType.AA) + return "AA"; + if (code == SequenceType.DNA) + return "DNA"; + if (code == SequenceType.RNA) + return "RNA"; + return "?"; + } + public String toSystem(SequenceType code) { + return code.getSystem(); + } + } + + @Block() + public static class SequenceReferenceSeqComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used. + */ + @Child(name = "chromosome", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The chromosome containing the genetic finding", formalDefinition="The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used." ) + protected CodeableConcept chromosome; + + /** + * The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. + */ + @Child(name = "genomeBuild", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'", formalDefinition="The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used." ) + protected StringType genomeBuild; + + /** + * Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences. + */ + @Child(name = "referenceSeqId", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference identifier", formalDefinition="Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences." ) + protected CodeableConcept referenceSeqId; + + /** + * A Pointer to another Sequence entity as refence sequence. + */ + @Child(name = "referenceSeqPointer", type = {Sequence.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A Pointer to another Sequence entity as refence sequence", formalDefinition="A Pointer to another Sequence entity as refence sequence." ) + protected Reference referenceSeqPointer; + + /** + * The actual object that is the target of the reference (A Pointer to another Sequence entity as refence sequence.) + */ + protected Sequence referenceSeqPointerTarget; + + /** + * A Reference Sequence string. + */ + @Child(name = "referenceSeqString", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A Reference Sequence string", formalDefinition="A Reference Sequence string." ) + protected StringType referenceSeqString; + + /** + * 0-based start position (inclusive) of the window on the reference sequence. + */ + @Child(name = "windowStart", type = {IntegerType.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="0-based start position (inclusive) of the window on the reference sequence", formalDefinition="0-based start position (inclusive) of the window on the reference sequence." ) + protected IntegerType windowStart; + + /** + * 0-based end position (exclusive) of the window on the reference sequence. + */ + @Child(name = "windowEnd", type = {IntegerType.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="0-based end position (exclusive) of the window on the reference sequence", formalDefinition="0-based end position (exclusive) of the window on the reference sequence." ) + protected IntegerType windowEnd; + + private static final long serialVersionUID = -165922935L; + + /** + * Constructor + */ + public SequenceReferenceSeqComponent() { + super(); + } + + /** + * Constructor + */ + public SequenceReferenceSeqComponent(CodeableConcept referenceSeqId, IntegerType windowStart, IntegerType windowEnd) { + super(); + this.referenceSeqId = referenceSeqId; + this.windowStart = windowStart; + this.windowEnd = windowEnd; + } + + /** + * @return {@link #chromosome} (The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used.) + */ + public CodeableConcept getChromosome() { + if (this.chromosome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.chromosome"); + else if (Configuration.doAutoCreate()) + this.chromosome = new CodeableConcept(); // cc + return this.chromosome; + } + + public boolean hasChromosome() { + return this.chromosome != null && !this.chromosome.isEmpty(); + } + + /** + * @param value {@link #chromosome} (The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used.) + */ + public SequenceReferenceSeqComponent setChromosome(CodeableConcept value) { + this.chromosome = value; + return this; + } + + /** + * @return {@link #genomeBuild} (The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used.). This is the underlying object with id, value and extensions. The accessor "getGenomeBuild" gives direct access to the value + */ + public StringType getGenomeBuildElement() { + if (this.genomeBuild == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.genomeBuild"); + else if (Configuration.doAutoCreate()) + this.genomeBuild = new StringType(); // bb + return this.genomeBuild; + } + + public boolean hasGenomeBuildElement() { + return this.genomeBuild != null && !this.genomeBuild.isEmpty(); + } + + public boolean hasGenomeBuild() { + return this.genomeBuild != null && !this.genomeBuild.isEmpty(); + } + + /** + * @param value {@link #genomeBuild} (The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used.). This is the underlying object with id, value and extensions. The accessor "getGenomeBuild" gives direct access to the value + */ + public SequenceReferenceSeqComponent setGenomeBuildElement(StringType value) { + this.genomeBuild = value; + return this; + } + + /** + * @return The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. + */ + public String getGenomeBuild() { + return this.genomeBuild == null ? null : this.genomeBuild.getValue(); + } + + /** + * @param value The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. + */ + public SequenceReferenceSeqComponent setGenomeBuild(String value) { + if (Utilities.noString(value)) + this.genomeBuild = null; + else { + if (this.genomeBuild == null) + this.genomeBuild = new StringType(); + this.genomeBuild.setValue(value); + } + return this; + } + + /** + * @return {@link #referenceSeqId} (Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.) + */ + public CodeableConcept getReferenceSeqId() { + if (this.referenceSeqId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqId"); + else if (Configuration.doAutoCreate()) + this.referenceSeqId = new CodeableConcept(); // cc + return this.referenceSeqId; + } + + public boolean hasReferenceSeqId() { + return this.referenceSeqId != null && !this.referenceSeqId.isEmpty(); + } + + /** + * @param value {@link #referenceSeqId} (Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.) + */ + public SequenceReferenceSeqComponent setReferenceSeqId(CodeableConcept value) { + this.referenceSeqId = value; + return this; + } + + /** + * @return {@link #referenceSeqPointer} (A Pointer to another Sequence entity as refence sequence.) + */ + public Reference getReferenceSeqPointer() { + if (this.referenceSeqPointer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer"); + else if (Configuration.doAutoCreate()) + this.referenceSeqPointer = new Reference(); // cc + return this.referenceSeqPointer; + } + + public boolean hasReferenceSeqPointer() { + return this.referenceSeqPointer != null && !this.referenceSeqPointer.isEmpty(); + } + + /** + * @param value {@link #referenceSeqPointer} (A Pointer to another Sequence entity as refence sequence.) + */ + public SequenceReferenceSeqComponent setReferenceSeqPointer(Reference value) { + this.referenceSeqPointer = value; + return this; + } + + /** + * @return {@link #referenceSeqPointer} 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 Pointer to another Sequence entity as refence sequence.) + */ + public Sequence getReferenceSeqPointerTarget() { + if (this.referenceSeqPointerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer"); + else if (Configuration.doAutoCreate()) + this.referenceSeqPointerTarget = new Sequence(); // aa + return this.referenceSeqPointerTarget; + } + + /** + * @param value {@link #referenceSeqPointer} 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 Pointer to another Sequence entity as refence sequence.) + */ + public SequenceReferenceSeqComponent setReferenceSeqPointerTarget(Sequence value) { + this.referenceSeqPointerTarget = value; + return this; + } + + /** + * @return {@link #referenceSeqString} (A Reference Sequence string.). This is the underlying object with id, value and extensions. The accessor "getReferenceSeqString" gives direct access to the value + */ + public StringType getReferenceSeqStringElement() { + if (this.referenceSeqString == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqString"); + else if (Configuration.doAutoCreate()) + this.referenceSeqString = new StringType(); // bb + return this.referenceSeqString; + } + + public boolean hasReferenceSeqStringElement() { + return this.referenceSeqString != null && !this.referenceSeqString.isEmpty(); + } + + public boolean hasReferenceSeqString() { + return this.referenceSeqString != null && !this.referenceSeqString.isEmpty(); + } + + /** + * @param value {@link #referenceSeqString} (A Reference Sequence string.). This is the underlying object with id, value and extensions. The accessor "getReferenceSeqString" gives direct access to the value + */ + public SequenceReferenceSeqComponent setReferenceSeqStringElement(StringType value) { + this.referenceSeqString = value; + return this; + } + + /** + * @return A Reference Sequence string. + */ + public String getReferenceSeqString() { + return this.referenceSeqString == null ? null : this.referenceSeqString.getValue(); + } + + /** + * @param value A Reference Sequence string. + */ + public SequenceReferenceSeqComponent setReferenceSeqString(String value) { + if (Utilities.noString(value)) + this.referenceSeqString = null; + else { + if (this.referenceSeqString == null) + this.referenceSeqString = new StringType(); + this.referenceSeqString.setValue(value); + } + return this; + } + + /** + * @return {@link #windowStart} (0-based start position (inclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value + */ + public IntegerType getWindowStartElement() { + if (this.windowStart == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowStart"); + else if (Configuration.doAutoCreate()) + this.windowStart = new IntegerType(); // bb + return this.windowStart; + } + + public boolean hasWindowStartElement() { + return this.windowStart != null && !this.windowStart.isEmpty(); + } + + public boolean hasWindowStart() { + return this.windowStart != null && !this.windowStart.isEmpty(); + } + + /** + * @param value {@link #windowStart} (0-based start position (inclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value + */ + public SequenceReferenceSeqComponent setWindowStartElement(IntegerType value) { + this.windowStart = value; + return this; + } + + /** + * @return 0-based start position (inclusive) of the window on the reference sequence. + */ + public int getWindowStart() { + return this.windowStart == null || this.windowStart.isEmpty() ? 0 : this.windowStart.getValue(); + } + + /** + * @param value 0-based start position (inclusive) of the window on the reference sequence. + */ + public SequenceReferenceSeqComponent setWindowStart(int value) { + if (this.windowStart == null) + this.windowStart = new IntegerType(); + this.windowStart.setValue(value); + return this; + } + + /** + * @return {@link #windowEnd} (0-based end position (exclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value + */ + public IntegerType getWindowEndElement() { + if (this.windowEnd == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowEnd"); + else if (Configuration.doAutoCreate()) + this.windowEnd = new IntegerType(); // bb + return this.windowEnd; + } + + public boolean hasWindowEndElement() { + return this.windowEnd != null && !this.windowEnd.isEmpty(); + } + + public boolean hasWindowEnd() { + return this.windowEnd != null && !this.windowEnd.isEmpty(); + } + + /** + * @param value {@link #windowEnd} (0-based end position (exclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value + */ + public SequenceReferenceSeqComponent setWindowEndElement(IntegerType value) { + this.windowEnd = value; + return this; + } + + /** + * @return 0-based end position (exclusive) of the window on the reference sequence. + */ + public int getWindowEnd() { + return this.windowEnd == null || this.windowEnd.isEmpty() ? 0 : this.windowEnd.getValue(); + } + + /** + * @param value 0-based end position (exclusive) of the window on the reference sequence. + */ + public SequenceReferenceSeqComponent setWindowEnd(int value) { + if (this.windowEnd == null) + this.windowEnd = new IntegerType(); + this.windowEnd.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("chromosome", "CodeableConcept", "The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used.", 0, java.lang.Integer.MAX_VALUE, chromosome)); + childrenList.add(new Property("genomeBuild", "string", "The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used.", 0, java.lang.Integer.MAX_VALUE, genomeBuild)); + childrenList.add(new Property("referenceSeqId", "CodeableConcept", "Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.", 0, java.lang.Integer.MAX_VALUE, referenceSeqId)); + childrenList.add(new Property("referenceSeqPointer", "Reference(Sequence)", "A Pointer to another Sequence entity as refence sequence.", 0, java.lang.Integer.MAX_VALUE, referenceSeqPointer)); + childrenList.add(new Property("referenceSeqString", "string", "A Reference Sequence string.", 0, java.lang.Integer.MAX_VALUE, referenceSeqString)); + childrenList.add(new Property("windowStart", "integer", "0-based start position (inclusive) of the window on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, windowStart)); + childrenList.add(new Property("windowEnd", "integer", "0-based end position (exclusive) of the window on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, windowEnd)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1499470472: /*chromosome*/ return this.chromosome == null ? new Base[0] : new Base[] {this.chromosome}; // CodeableConcept + case 1061239735: /*genomeBuild*/ return this.genomeBuild == null ? new Base[0] : new Base[] {this.genomeBuild}; // StringType + case -1911500465: /*referenceSeqId*/ return this.referenceSeqId == null ? new Base[0] : new Base[] {this.referenceSeqId}; // CodeableConcept + case 1923414665: /*referenceSeqPointer*/ return this.referenceSeqPointer == null ? new Base[0] : new Base[] {this.referenceSeqPointer}; // Reference + case -1648301499: /*referenceSeqString*/ return this.referenceSeqString == null ? new Base[0] : new Base[] {this.referenceSeqString}; // StringType + case 1903685202: /*windowStart*/ return this.windowStart == null ? new Base[0] : new Base[] {this.windowStart}; // IntegerType + case -217026869: /*windowEnd*/ return this.windowEnd == null ? new Base[0] : new Base[] {this.windowEnd}; // IntegerType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1499470472: // chromosome + this.chromosome = castToCodeableConcept(value); // CodeableConcept + break; + case 1061239735: // genomeBuild + this.genomeBuild = castToString(value); // StringType + break; + case -1911500465: // referenceSeqId + this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept + break; + case 1923414665: // referenceSeqPointer + this.referenceSeqPointer = castToReference(value); // Reference + break; + case -1648301499: // referenceSeqString + this.referenceSeqString = castToString(value); // StringType + break; + case 1903685202: // windowStart + this.windowStart = castToInteger(value); // IntegerType + break; + case -217026869: // windowEnd + this.windowEnd = castToInteger(value); // IntegerType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("chromosome")) + this.chromosome = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("genomeBuild")) + this.genomeBuild = castToString(value); // StringType + else if (name.equals("referenceSeqId")) + this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("referenceSeqPointer")) + this.referenceSeqPointer = castToReference(value); // Reference + else if (name.equals("referenceSeqString")) + this.referenceSeqString = castToString(value); // StringType + else if (name.equals("windowStart")) + this.windowStart = castToInteger(value); // IntegerType + else if (name.equals("windowEnd")) + this.windowEnd = castToInteger(value); // IntegerType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1499470472: return getChromosome(); // CodeableConcept + case 1061239735: throw new FHIRException("Cannot make property genomeBuild as it is not a complex type"); // StringType + case -1911500465: return getReferenceSeqId(); // CodeableConcept + case 1923414665: return getReferenceSeqPointer(); // Reference + case -1648301499: throw new FHIRException("Cannot make property referenceSeqString as it is not a complex type"); // StringType + case 1903685202: throw new FHIRException("Cannot make property windowStart as it is not a complex type"); // IntegerType + case -217026869: throw new FHIRException("Cannot make property windowEnd as it is not a complex type"); // IntegerType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("chromosome")) { + this.chromosome = new CodeableConcept(); + return this.chromosome; + } + else if (name.equals("genomeBuild")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.genomeBuild"); + } + else if (name.equals("referenceSeqId")) { + this.referenceSeqId = new CodeableConcept(); + return this.referenceSeqId; + } + else if (name.equals("referenceSeqPointer")) { + this.referenceSeqPointer = new Reference(); + return this.referenceSeqPointer; + } + else if (name.equals("referenceSeqString")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceSeqString"); + } + else if (name.equals("windowStart")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowStart"); + } + else if (name.equals("windowEnd")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowEnd"); + } + else + return super.addChild(name); + } + + public SequenceReferenceSeqComponent copy() { + SequenceReferenceSeqComponent dst = new SequenceReferenceSeqComponent(); + copyValues(dst); + dst.chromosome = chromosome == null ? null : chromosome.copy(); + dst.genomeBuild = genomeBuild == null ? null : genomeBuild.copy(); + dst.referenceSeqId = referenceSeqId == null ? null : referenceSeqId.copy(); + dst.referenceSeqPointer = referenceSeqPointer == null ? null : referenceSeqPointer.copy(); + dst.referenceSeqString = referenceSeqString == null ? null : referenceSeqString.copy(); + dst.windowStart = windowStart == null ? null : windowStart.copy(); + dst.windowEnd = windowEnd == null ? null : windowEnd.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SequenceReferenceSeqComponent)) + return false; + SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other; + return compareDeep(chromosome, o.chromosome, true) && compareDeep(genomeBuild, o.genomeBuild, true) + && compareDeep(referenceSeqId, o.referenceSeqId, true) && compareDeep(referenceSeqPointer, o.referenceSeqPointer, true) + && compareDeep(referenceSeqString, o.referenceSeqString, true) && compareDeep(windowStart, o.windowStart, true) + && compareDeep(windowEnd, o.windowEnd, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SequenceReferenceSeqComponent)) + return false; + SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other; + return compareValues(genomeBuild, o.genomeBuild, true) && compareValues(referenceSeqString, o.referenceSeqString, true) + && compareValues(windowStart, o.windowStart, true) && compareValues(windowEnd, o.windowEnd, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (chromosome == null || chromosome.isEmpty()) && (genomeBuild == null || genomeBuild.isEmpty()) + && (referenceSeqId == null || referenceSeqId.isEmpty()) && (referenceSeqPointer == null || referenceSeqPointer.isEmpty()) + && (referenceSeqString == null || referenceSeqString.isEmpty()) && (windowStart == null || windowStart.isEmpty()) + && (windowEnd == null || windowEnd.isEmpty()); + } + + public String fhirType() { + return "Sequence.referenceSeq"; + + } + + } + + @Block() + public static class SequenceVariationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * 0-based start position (inclusive) of the variation on the reference sequence. + */ + @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="0-based start position (inclusive) of the variation on the reference sequence", formalDefinition="0-based start position (inclusive) of the variation on the reference sequence." ) + protected IntegerType start; + + /** + * 0-based end position (exclusive) of the variation on the reference sequence. + */ + @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="0-based end position (exclusive) of the variation on the reference sequence", formalDefinition="0-based end position (exclusive) of the variation on the reference sequence." ) + protected IntegerType end; + + /** + * Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + */ + @Child(name = "observedAllele", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Nucleotide(s)/amino acids from start position to stop position of observed variation", formalDefinition="Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand." ) + protected StringType observedAllele; + + /** + * Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + */ + @Child(name = "referenceAllele", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Nucleotide(s)/amino acids from start position to stop position of reference variation", formalDefinition="Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand." ) + protected StringType referenceAllele; + + /** + * Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm). + */ + @Child(name = "cigar", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Extended CIGAR string for aligning the sequence with reference bases", formalDefinition="Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm)." ) + protected StringType cigar; + + private static final long serialVersionUID = 913298829L; + + /** + * Constructor + */ + public SequenceVariationComponent() { + super(); + } + + /** + * @return {@link #start} (0-based start position (inclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public IntegerType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceVariationComponent.start"); + else if (Configuration.doAutoCreate()) + this.start = new IntegerType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (0-based start position (inclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public SequenceVariationComponent setStartElement(IntegerType value) { + this.start = value; + return this; + } + + /** + * @return 0-based start position (inclusive) of the variation on the reference sequence. + */ + public int getStart() { + return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); + } + + /** + * @param value 0-based start position (inclusive) of the variation on the reference sequence. + */ + public SequenceVariationComponent setStart(int value) { + if (this.start == null) + this.start = new IntegerType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (0-based end position (exclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public IntegerType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceVariationComponent.end"); + else if (Configuration.doAutoCreate()) + this.end = new IntegerType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (0-based end position (exclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public SequenceVariationComponent setEndElement(IntegerType value) { + this.end = value; + return this; + } + + /** + * @return 0-based end position (exclusive) of the variation on the reference sequence. + */ + public int getEnd() { + return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); + } + + /** + * @param value 0-based end position (exclusive) of the variation on the reference sequence. + */ + public SequenceVariationComponent setEnd(int value) { + if (this.end == null) + this.end = new IntegerType(); + this.end.setValue(value); + return this; + } + + /** + * @return {@link #observedAllele} (Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value + */ + public StringType getObservedAlleleElement() { + if (this.observedAllele == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceVariationComponent.observedAllele"); + else if (Configuration.doAutoCreate()) + this.observedAllele = new StringType(); // bb + return this.observedAllele; + } + + public boolean hasObservedAlleleElement() { + return this.observedAllele != null && !this.observedAllele.isEmpty(); + } + + public boolean hasObservedAllele() { + return this.observedAllele != null && !this.observedAllele.isEmpty(); + } + + /** + * @param value {@link #observedAllele} (Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value + */ + public SequenceVariationComponent setObservedAlleleElement(StringType value) { + this.observedAllele = value; + return this; + } + + /** + * @return Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + */ + public String getObservedAllele() { + return this.observedAllele == null ? null : this.observedAllele.getValue(); + } + + /** + * @param value Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + */ + public SequenceVariationComponent setObservedAllele(String value) { + if (Utilities.noString(value)) + this.observedAllele = null; + else { + if (this.observedAllele == null) + this.observedAllele = new StringType(); + this.observedAllele.setValue(value); + } + return this; + } + + /** + * @return {@link #referenceAllele} (Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value + */ + public StringType getReferenceAlleleElement() { + if (this.referenceAllele == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceVariationComponent.referenceAllele"); + else if (Configuration.doAutoCreate()) + this.referenceAllele = new StringType(); // bb + return this.referenceAllele; + } + + public boolean hasReferenceAlleleElement() { + return this.referenceAllele != null && !this.referenceAllele.isEmpty(); + } + + public boolean hasReferenceAllele() { + return this.referenceAllele != null && !this.referenceAllele.isEmpty(); + } + + /** + * @param value {@link #referenceAllele} (Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value + */ + public SequenceVariationComponent setReferenceAlleleElement(StringType value) { + this.referenceAllele = value; + return this; + } + + /** + * @return Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + */ + public String getReferenceAllele() { + return this.referenceAllele == null ? null : this.referenceAllele.getValue(); + } + + /** + * @param value Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + */ + public SequenceVariationComponent setReferenceAllele(String value) { + if (Utilities.noString(value)) + this.referenceAllele = null; + else { + if (this.referenceAllele == null) + this.referenceAllele = new StringType(); + this.referenceAllele.setValue(value); + } + return this; + } + + /** + * @return {@link #cigar} (Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).). This is the underlying object with id, value and extensions. The accessor "getCigar" gives direct access to the value + */ + public StringType getCigarElement() { + if (this.cigar == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceVariationComponent.cigar"); + else if (Configuration.doAutoCreate()) + this.cigar = new StringType(); // bb + return this.cigar; + } + + public boolean hasCigarElement() { + return this.cigar != null && !this.cigar.isEmpty(); + } + + public boolean hasCigar() { + return this.cigar != null && !this.cigar.isEmpty(); + } + + /** + * @param value {@link #cigar} (Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).). This is the underlying object with id, value and extensions. The accessor "getCigar" gives direct access to the value + */ + public SequenceVariationComponent setCigarElement(StringType value) { + this.cigar = value; + return this; + } + + /** + * @return Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm). + */ + public String getCigar() { + return this.cigar == null ? null : this.cigar.getValue(); + } + + /** + * @param value Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm). + */ + public SequenceVariationComponent setCigar(String value) { + if (Utilities.noString(value)) + this.cigar = null; + else { + if (this.cigar == null) + this.cigar = new StringType(); + this.cigar.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("start", "integer", "0-based start position (inclusive) of the variation on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "integer", "0-based end position (exclusive) of the variation on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("observedAllele", "string", "Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.", 0, java.lang.Integer.MAX_VALUE, observedAllele)); + childrenList.add(new Property("referenceAllele", "string", "Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.", 0, java.lang.Integer.MAX_VALUE, referenceAllele)); + childrenList.add(new Property("cigar", "string", "Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).", 0, java.lang.Integer.MAX_VALUE, cigar)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType + case -1418745787: /*observedAllele*/ return this.observedAllele == null ? new Base[0] : new Base[] {this.observedAllele}; // StringType + case 364045960: /*referenceAllele*/ return this.referenceAllele == null ? new Base[0] : new Base[] {this.referenceAllele}; // StringType + case 94658738: /*cigar*/ return this.cigar == null ? new Base[0] : new Base[] {this.cigar}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 109757538: // start + this.start = castToInteger(value); // IntegerType + break; + case 100571: // end + this.end = castToInteger(value); // IntegerType + break; + case -1418745787: // observedAllele + this.observedAllele = castToString(value); // StringType + break; + case 364045960: // referenceAllele + this.referenceAllele = castToString(value); // StringType + break; + case 94658738: // cigar + this.cigar = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("start")) + this.start = castToInteger(value); // IntegerType + else if (name.equals("end")) + this.end = castToInteger(value); // IntegerType + else if (name.equals("observedAllele")) + this.observedAllele = castToString(value); // StringType + else if (name.equals("referenceAllele")) + this.referenceAllele = castToString(value); // StringType + else if (name.equals("cigar")) + this.cigar = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType + case -1418745787: throw new FHIRException("Cannot make property observedAllele as it is not a complex type"); // StringType + case 364045960: throw new FHIRException("Cannot make property referenceAllele as it is not a complex type"); // StringType + case 94658738: throw new FHIRException("Cannot make property cigar as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("start")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.start"); + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.end"); + } + else if (name.equals("observedAllele")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedAllele"); + } + else if (name.equals("referenceAllele")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceAllele"); + } + else if (name.equals("cigar")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.cigar"); + } + else + return super.addChild(name); + } + + public SequenceVariationComponent copy() { + SequenceVariationComponent dst = new SequenceVariationComponent(); + copyValues(dst); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + dst.observedAllele = observedAllele == null ? null : observedAllele.copy(); + dst.referenceAllele = referenceAllele == null ? null : referenceAllele.copy(); + dst.cigar = cigar == null ? null : cigar.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SequenceVariationComponent)) + return false; + SequenceVariationComponent o = (SequenceVariationComponent) other; + return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(observedAllele, o.observedAllele, true) + && compareDeep(referenceAllele, o.referenceAllele, true) && compareDeep(cigar, o.cigar, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SequenceVariationComponent)) + return false; + SequenceVariationComponent o = (SequenceVariationComponent) other; + return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(observedAllele, o.observedAllele, true) + && compareValues(referenceAllele, o.referenceAllele, true) && compareValues(cigar, o.cigar, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + && (observedAllele == null || observedAllele.isEmpty()) && (referenceAllele == null || referenceAllele.isEmpty()) + && (cigar == null || cigar.isEmpty()); + } + + public String fhirType() { + return "Sequence.variation"; + + } + + } + + @Block() + public static class SequenceQualityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * 0-based start position (inclusive) of the sequence. + */ + @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="0-based start position (inclusive) of the sequence", formalDefinition="0-based start position (inclusive) of the sequence." ) + protected IntegerType start; + + /** + * 0-based end position (exclusive) of the sequence. + */ + @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="0-based end position (exclusive) of the sequence", formalDefinition="0-based end position (exclusive) of the sequence." ) + protected IntegerType end; + + /** + * Quality score. + */ + @Child(name = "score", type = {Quantity.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Quality score", formalDefinition="Quality score." ) + protected Quantity score; + + /** + * Method for quality. + */ + @Child(name = "method", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Method for quality", formalDefinition="Method for quality." ) + protected StringType method; + + private static final long serialVersionUID = -1046665930L; + + /** + * Constructor + */ + public SequenceQualityComponent() { + super(); + } + + /** + * @return {@link #start} (0-based start position (inclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public IntegerType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceQualityComponent.start"); + else if (Configuration.doAutoCreate()) + this.start = new IntegerType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (0-based start position (inclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public SequenceQualityComponent setStartElement(IntegerType value) { + this.start = value; + return this; + } + + /** + * @return 0-based start position (inclusive) of the sequence. + */ + public int getStart() { + return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); + } + + /** + * @param value 0-based start position (inclusive) of the sequence. + */ + public SequenceQualityComponent setStart(int value) { + if (this.start == null) + this.start = new IntegerType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (0-based end position (exclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public IntegerType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceQualityComponent.end"); + else if (Configuration.doAutoCreate()) + this.end = new IntegerType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (0-based end position (exclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public SequenceQualityComponent setEndElement(IntegerType value) { + this.end = value; + return this; + } + + /** + * @return 0-based end position (exclusive) of the sequence. + */ + public int getEnd() { + return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); + } + + /** + * @param value 0-based end position (exclusive) of the sequence. + */ + public SequenceQualityComponent setEnd(int value) { + if (this.end == null) + this.end = new IntegerType(); + this.end.setValue(value); + return this; + } + + /** + * @return {@link #score} (Quality score.) + */ + public Quantity getScore() { + if (this.score == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceQualityComponent.score"); + else if (Configuration.doAutoCreate()) + this.score = new Quantity(); // cc + return this.score; + } + + public boolean hasScore() { + return this.score != null && !this.score.isEmpty(); + } + + /** + * @param value {@link #score} (Quality score.) + */ + public SequenceQualityComponent setScore(Quantity value) { + this.score = value; + return this; + } + + /** + * @return {@link #method} (Method for quality.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value + */ + public StringType getMethodElement() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceQualityComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new StringType(); // bb + return this.method; + } + + public boolean hasMethodElement() { + return this.method != null && !this.method.isEmpty(); + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (Method for quality.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value + */ + public SequenceQualityComponent setMethodElement(StringType value) { + this.method = value; + return this; + } + + /** + * @return Method for quality. + */ + public String getMethod() { + return this.method == null ? null : this.method.getValue(); + } + + /** + * @param value Method for quality. + */ + public SequenceQualityComponent setMethod(String value) { + if (Utilities.noString(value)) + this.method = null; + else { + if (this.method == null) + this.method = new StringType(); + this.method.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("start", "integer", "0-based start position (inclusive) of the sequence.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "integer", "0-based end position (exclusive) of the sequence.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("score", "Quantity", "Quality score.", 0, java.lang.Integer.MAX_VALUE, score)); + childrenList.add(new Property("method", "string", "Method for quality.", 0, java.lang.Integer.MAX_VALUE, method)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType + case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // Quantity + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 109757538: // start + this.start = castToInteger(value); // IntegerType + break; + case 100571: // end + this.end = castToInteger(value); // IntegerType + break; + case 109264530: // score + this.score = castToQuantity(value); // Quantity + break; + case -1077554975: // method + this.method = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("start")) + this.start = castToInteger(value); // IntegerType + else if (name.equals("end")) + this.end = castToInteger(value); // IntegerType + else if (name.equals("score")) + this.score = castToQuantity(value); // Quantity + else if (name.equals("method")) + this.method = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType + case 109264530: return getScore(); // Quantity + case -1077554975: throw new FHIRException("Cannot make property method as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("start")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.start"); + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.end"); + } + else if (name.equals("score")) { + this.score = new Quantity(); + return this.score; + } + else if (name.equals("method")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.method"); + } + else + return super.addChild(name); + } + + public SequenceQualityComponent copy() { + SequenceQualityComponent dst = new SequenceQualityComponent(); + copyValues(dst); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + dst.score = score == null ? null : score.copy(); + dst.method = method == null ? null : method.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SequenceQualityComponent)) + return false; + SequenceQualityComponent o = (SequenceQualityComponent) other; + return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(score, o.score, true) + && compareDeep(method, o.method, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SequenceQualityComponent)) + return false; + SequenceQualityComponent o = (SequenceQualityComponent) other; + return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(method, o.method, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + && (score == null || score.isEmpty()) && (method == null || method.isEmpty()); + } + + public String fhirType() { + return "Sequence.quality"; + + } + + } + + @Block() + public static class SequenceRepositoryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * URI of an external repository which contains further details about the genetics data. + */ + @Child(name = "url", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="URI of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." ) + protected UriType url; + + /** + * URI of an external repository which contains further details about the genetics data. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." ) + protected StringType name; + + /** + * Id of the variation in this external repository. + */ + @Child(name = "variantId", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Id of the variant", formalDefinition="Id of the variation in this external repository." ) + protected StringType variantId; + + /** + * Id of the read in this external repository. + */ + @Child(name = "readId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Id of the read", formalDefinition="Id of the read in this external repository." ) + protected StringType readId; + + private static final long serialVersionUID = 1218159360L; + + /** + * Constructor + */ + public SequenceRepositoryComponent() { + super(); + } + + /** + * @return {@link #url} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceRepositoryComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SequenceRepositoryComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return URI of an external repository which contains further details about the genetics data. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value URI of an external repository which contains further details about the genetics data. + */ + public SequenceRepositoryComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (URI of an external repository which contains further details about the genetics data.). 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 SequenceRepositoryComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SequenceRepositoryComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return URI of an external repository which contains further details about the genetics data. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value URI of an external repository which contains further details about the genetics data. + */ + public SequenceRepositoryComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #variantId} (Id of the variation in this external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantId" gives direct access to the value + */ + public StringType getVariantIdElement() { + if (this.variantId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceRepositoryComponent.variantId"); + else if (Configuration.doAutoCreate()) + this.variantId = new StringType(); // bb + return this.variantId; + } + + public boolean hasVariantIdElement() { + return this.variantId != null && !this.variantId.isEmpty(); + } + + public boolean hasVariantId() { + return this.variantId != null && !this.variantId.isEmpty(); + } + + /** + * @param value {@link #variantId} (Id of the variation in this external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantId" gives direct access to the value + */ + public SequenceRepositoryComponent setVariantIdElement(StringType value) { + this.variantId = value; + return this; + } + + /** + * @return Id of the variation in this external repository. + */ + public String getVariantId() { + return this.variantId == null ? null : this.variantId.getValue(); + } + + /** + * @param value Id of the variation in this external repository. + */ + public SequenceRepositoryComponent setVariantId(String value) { + if (Utilities.noString(value)) + this.variantId = null; + else { + if (this.variantId == null) + this.variantId = new StringType(); + this.variantId.setValue(value); + } + return this; + } + + /** + * @return {@link #readId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadId" gives direct access to the value + */ + public StringType getReadIdElement() { + if (this.readId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceRepositoryComponent.readId"); + else if (Configuration.doAutoCreate()) + this.readId = new StringType(); // bb + return this.readId; + } + + public boolean hasReadIdElement() { + return this.readId != null && !this.readId.isEmpty(); + } + + public boolean hasReadId() { + return this.readId != null && !this.readId.isEmpty(); + } + + /** + * @param value {@link #readId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadId" gives direct access to the value + */ + public SequenceRepositoryComponent setReadIdElement(StringType value) { + this.readId = value; + return this; + } + + /** + * @return Id of the read in this external repository. + */ + public String getReadId() { + return this.readId == null ? null : this.readId.getValue(); + } + + /** + * @param value Id of the read in this external repository. + */ + public SequenceRepositoryComponent setReadId(String value) { + if (Utilities.noString(value)) + this.readId = null; + else { + if (this.readId == null) + this.readId = new StringType(); + this.readId.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "URI of an external repository which contains further details about the genetics data.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("name", "string", "URI of an external repository which contains further details about the genetics data.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("variantId", "string", "Id of the variation in this external repository.", 0, java.lang.Integer.MAX_VALUE, variantId)); + childrenList.add(new Property("readId", "string", "Id of the read in this external repository.", 0, java.lang.Integer.MAX_VALUE, readId)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -82113408: /*variantId*/ return this.variantId == null ? new Base[0] : new Base[] {this.variantId}; // StringType + case -934980271: /*readId*/ return this.readId == null ? new Base[0] : new Base[] {this.readId}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -82113408: // variantId + this.variantId = castToString(value); // StringType + break; + case -934980271: // readId + this.readId = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("variantId")) + this.variantId = castToString(value); // StringType + else if (name.equals("readId")) + this.readId = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -82113408: throw new FHIRException("Cannot make property variantId as it is not a complex type"); // StringType + case -934980271: throw new FHIRException("Cannot make property readId as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.url"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.name"); + } + else if (name.equals("variantId")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.variantId"); + } + else if (name.equals("readId")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.readId"); + } + else + return super.addChild(name); + } + + public SequenceRepositoryComponent copy() { + SequenceRepositoryComponent dst = new SequenceRepositoryComponent(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.name = name == null ? null : name.copy(); + dst.variantId = variantId == null ? null : variantId.copy(); + dst.readId = readId == null ? null : readId.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SequenceRepositoryComponent)) + return false; + SequenceRepositoryComponent o = (SequenceRepositoryComponent) other; + return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(variantId, o.variantId, true) + && compareDeep(readId, o.readId, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SequenceRepositoryComponent)) + return false; + SequenceRepositoryComponent o = (SequenceRepositoryComponent) other; + return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(variantId, o.variantId, true) + && compareValues(readId, o.readId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) + && (variantId == null || variantId.isEmpty()) && (readId == null || readId.isEmpty()); + } + + public String fhirType() { + return "Sequence.repository"; + + } + + } + + @Block() + public static class SequenceStructureVariationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Precision of boundaries. + */ + @Child(name = "precisionOfBoundaries", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Precision of boundaries", formalDefinition="Precision of boundaries." ) + protected StringType precisionOfBoundaries; + + /** + * Structural Variant reported aCGH ratio. + */ + @Child(name = "reportedaCGHRatio", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Structural Variant reported aCGH ratio", formalDefinition="Structural Variant reported aCGH ratio." ) + protected DecimalType reportedaCGHRatio; + + /** + * Structural Variant Length. + */ + @Child(name = "length", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Structural Variant Length", formalDefinition="Structural Variant Length." ) + protected IntegerType length; + + /** + * Structural variant outer. + */ + @Child(name = "outer", type = {}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="Structural variant outer." ) + protected SequenceStructureVariationOuterComponent outer; + + /** + * Structural variant inner. + */ + @Child(name = "inner", type = {}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="Structural variant inner." ) + protected SequenceStructureVariationInnerComponent inner; + + private static final long serialVersionUID = -1615654736L; + + /** + * Constructor + */ + public SequenceStructureVariationComponent() { + super(); + } + + /** + * @return {@link #precisionOfBoundaries} (Precision of boundaries.). This is the underlying object with id, value and extensions. The accessor "getPrecisionOfBoundaries" gives direct access to the value + */ + public StringType getPrecisionOfBoundariesElement() { + if (this.precisionOfBoundaries == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationComponent.precisionOfBoundaries"); + else if (Configuration.doAutoCreate()) + this.precisionOfBoundaries = new StringType(); // bb + return this.precisionOfBoundaries; + } + + public boolean hasPrecisionOfBoundariesElement() { + return this.precisionOfBoundaries != null && !this.precisionOfBoundaries.isEmpty(); + } + + public boolean hasPrecisionOfBoundaries() { + return this.precisionOfBoundaries != null && !this.precisionOfBoundaries.isEmpty(); + } + + /** + * @param value {@link #precisionOfBoundaries} (Precision of boundaries.). This is the underlying object with id, value and extensions. The accessor "getPrecisionOfBoundaries" gives direct access to the value + */ + public SequenceStructureVariationComponent setPrecisionOfBoundariesElement(StringType value) { + this.precisionOfBoundaries = value; + return this; + } + + /** + * @return Precision of boundaries. + */ + public String getPrecisionOfBoundaries() { + return this.precisionOfBoundaries == null ? null : this.precisionOfBoundaries.getValue(); + } + + /** + * @param value Precision of boundaries. + */ + public SequenceStructureVariationComponent setPrecisionOfBoundaries(String value) { + if (Utilities.noString(value)) + this.precisionOfBoundaries = null; + else { + if (this.precisionOfBoundaries == null) + this.precisionOfBoundaries = new StringType(); + this.precisionOfBoundaries.setValue(value); + } + return this; + } + + /** + * @return {@link #reportedaCGHRatio} (Structural Variant reported aCGH ratio.). This is the underlying object with id, value and extensions. The accessor "getReportedaCGHRatio" gives direct access to the value + */ + public DecimalType getReportedaCGHRatioElement() { + if (this.reportedaCGHRatio == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationComponent.reportedaCGHRatio"); + else if (Configuration.doAutoCreate()) + this.reportedaCGHRatio = new DecimalType(); // bb + return this.reportedaCGHRatio; + } + + public boolean hasReportedaCGHRatioElement() { + return this.reportedaCGHRatio != null && !this.reportedaCGHRatio.isEmpty(); + } + + public boolean hasReportedaCGHRatio() { + return this.reportedaCGHRatio != null && !this.reportedaCGHRatio.isEmpty(); + } + + /** + * @param value {@link #reportedaCGHRatio} (Structural Variant reported aCGH ratio.). This is the underlying object with id, value and extensions. The accessor "getReportedaCGHRatio" gives direct access to the value + */ + public SequenceStructureVariationComponent setReportedaCGHRatioElement(DecimalType value) { + this.reportedaCGHRatio = value; + return this; + } + + /** + * @return Structural Variant reported aCGH ratio. + */ + public BigDecimal getReportedaCGHRatio() { + return this.reportedaCGHRatio == null ? null : this.reportedaCGHRatio.getValue(); + } + + /** + * @param value Structural Variant reported aCGH ratio. + */ + public SequenceStructureVariationComponent setReportedaCGHRatio(BigDecimal value) { + if (value == null) + this.reportedaCGHRatio = null; + else { + if (this.reportedaCGHRatio == null) + this.reportedaCGHRatio = new DecimalType(); + this.reportedaCGHRatio.setValue(value); + } + return this; + } + + /** + * @param value Structural Variant reported aCGH ratio. + */ + public SequenceStructureVariationComponent setReportedaCGHRatio(long value) { + this.reportedaCGHRatio = new DecimalType(); + this.reportedaCGHRatio.setValue(value); + return this; + } + + /** + * @param value Structural Variant reported aCGH ratio. + */ + public SequenceStructureVariationComponent setReportedaCGHRatio(double value) { + this.reportedaCGHRatio = new DecimalType(); + this.reportedaCGHRatio.setValue(value); + return this; + } + + /** + * @return {@link #length} (Structural Variant Length.). This is the underlying object with id, value and extensions. The accessor "getLength" gives direct access to the value + */ + public IntegerType getLengthElement() { + if (this.length == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationComponent.length"); + else if (Configuration.doAutoCreate()) + this.length = new IntegerType(); // bb + return this.length; + } + + public boolean hasLengthElement() { + return this.length != null && !this.length.isEmpty(); + } + + public boolean hasLength() { + return this.length != null && !this.length.isEmpty(); + } + + /** + * @param value {@link #length} (Structural Variant Length.). This is the underlying object with id, value and extensions. The accessor "getLength" gives direct access to the value + */ + public SequenceStructureVariationComponent setLengthElement(IntegerType value) { + this.length = value; + return this; + } + + /** + * @return Structural Variant Length. + */ + public int getLength() { + return this.length == null || this.length.isEmpty() ? 0 : this.length.getValue(); + } + + /** + * @param value Structural Variant Length. + */ + public SequenceStructureVariationComponent setLength(int value) { + if (this.length == null) + this.length = new IntegerType(); + this.length.setValue(value); + return this; + } + + /** + * @return {@link #outer} (Structural variant outer.) + */ + public SequenceStructureVariationOuterComponent getOuter() { + if (this.outer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationComponent.outer"); + else if (Configuration.doAutoCreate()) + this.outer = new SequenceStructureVariationOuterComponent(); // cc + return this.outer; + } + + public boolean hasOuter() { + return this.outer != null && !this.outer.isEmpty(); + } + + /** + * @param value {@link #outer} (Structural variant outer.) + */ + public SequenceStructureVariationComponent setOuter(SequenceStructureVariationOuterComponent value) { + this.outer = value; + return this; + } + + /** + * @return {@link #inner} (Structural variant inner.) + */ + public SequenceStructureVariationInnerComponent getInner() { + if (this.inner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationComponent.inner"); + else if (Configuration.doAutoCreate()) + this.inner = new SequenceStructureVariationInnerComponent(); // cc + return this.inner; + } + + public boolean hasInner() { + return this.inner != null && !this.inner.isEmpty(); + } + + /** + * @param value {@link #inner} (Structural variant inner.) + */ + public SequenceStructureVariationComponent setInner(SequenceStructureVariationInnerComponent value) { + this.inner = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("precisionOfBoundaries", "string", "Precision of boundaries.", 0, java.lang.Integer.MAX_VALUE, precisionOfBoundaries)); + childrenList.add(new Property("reportedaCGHRatio", "decimal", "Structural Variant reported aCGH ratio.", 0, java.lang.Integer.MAX_VALUE, reportedaCGHRatio)); + childrenList.add(new Property("length", "integer", "Structural Variant Length.", 0, java.lang.Integer.MAX_VALUE, length)); + childrenList.add(new Property("outer", "", "Structural variant outer.", 0, java.lang.Integer.MAX_VALUE, outer)); + childrenList.add(new Property("inner", "", "Structural variant inner.", 0, java.lang.Integer.MAX_VALUE, inner)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1591532317: /*precisionOfBoundaries*/ return this.precisionOfBoundaries == null ? new Base[0] : new Base[] {this.precisionOfBoundaries}; // StringType + case -1872600587: /*reportedaCGHRatio*/ return this.reportedaCGHRatio == null ? new Base[0] : new Base[] {this.reportedaCGHRatio}; // DecimalType + case -1106363674: /*length*/ return this.length == null ? new Base[0] : new Base[] {this.length}; // IntegerType + case 106111099: /*outer*/ return this.outer == null ? new Base[0] : new Base[] {this.outer}; // SequenceStructureVariationOuterComponent + case 100355670: /*inner*/ return this.inner == null ? new Base[0] : new Base[] {this.inner}; // SequenceStructureVariationInnerComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1591532317: // precisionOfBoundaries + this.precisionOfBoundaries = castToString(value); // StringType + break; + case -1872600587: // reportedaCGHRatio + this.reportedaCGHRatio = castToDecimal(value); // DecimalType + break; + case -1106363674: // length + this.length = castToInteger(value); // IntegerType + break; + case 106111099: // outer + this.outer = (SequenceStructureVariationOuterComponent) value; // SequenceStructureVariationOuterComponent + break; + case 100355670: // inner + this.inner = (SequenceStructureVariationInnerComponent) value; // SequenceStructureVariationInnerComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("precisionOfBoundaries")) + this.precisionOfBoundaries = castToString(value); // StringType + else if (name.equals("reportedaCGHRatio")) + this.reportedaCGHRatio = castToDecimal(value); // DecimalType + else if (name.equals("length")) + this.length = castToInteger(value); // IntegerType + else if (name.equals("outer")) + this.outer = (SequenceStructureVariationOuterComponent) value; // SequenceStructureVariationOuterComponent + else if (name.equals("inner")) + this.inner = (SequenceStructureVariationInnerComponent) value; // SequenceStructureVariationInnerComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1591532317: throw new FHIRException("Cannot make property precisionOfBoundaries as it is not a complex type"); // StringType + case -1872600587: throw new FHIRException("Cannot make property reportedaCGHRatio as it is not a complex type"); // DecimalType + case -1106363674: throw new FHIRException("Cannot make property length as it is not a complex type"); // IntegerType + case 106111099: return getOuter(); // SequenceStructureVariationOuterComponent + case 100355670: return getInner(); // SequenceStructureVariationInnerComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("precisionOfBoundaries")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.precisionOfBoundaries"); + } + else if (name.equals("reportedaCGHRatio")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.reportedaCGHRatio"); + } + else if (name.equals("length")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.length"); + } + else if (name.equals("outer")) { + this.outer = new SequenceStructureVariationOuterComponent(); + return this.outer; + } + else if (name.equals("inner")) { + this.inner = new SequenceStructureVariationInnerComponent(); + return this.inner; + } + else + return super.addChild(name); + } + + public SequenceStructureVariationComponent copy() { + SequenceStructureVariationComponent dst = new SequenceStructureVariationComponent(); + copyValues(dst); + dst.precisionOfBoundaries = precisionOfBoundaries == null ? null : precisionOfBoundaries.copy(); + dst.reportedaCGHRatio = reportedaCGHRatio == null ? null : reportedaCGHRatio.copy(); + dst.length = length == null ? null : length.copy(); + dst.outer = outer == null ? null : outer.copy(); + dst.inner = inner == null ? null : inner.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SequenceStructureVariationComponent)) + return false; + SequenceStructureVariationComponent o = (SequenceStructureVariationComponent) other; + return compareDeep(precisionOfBoundaries, o.precisionOfBoundaries, true) && compareDeep(reportedaCGHRatio, o.reportedaCGHRatio, true) + && compareDeep(length, o.length, true) && compareDeep(outer, o.outer, true) && compareDeep(inner, o.inner, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SequenceStructureVariationComponent)) + return false; + SequenceStructureVariationComponent o = (SequenceStructureVariationComponent) other; + return compareValues(precisionOfBoundaries, o.precisionOfBoundaries, true) && compareValues(reportedaCGHRatio, o.reportedaCGHRatio, true) + && compareValues(length, o.length, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (precisionOfBoundaries == null || precisionOfBoundaries.isEmpty()) + && (reportedaCGHRatio == null || reportedaCGHRatio.isEmpty()) && (length == null || length.isEmpty()) + && (outer == null || outer.isEmpty()) && (inner == null || inner.isEmpty()); + } + + public String fhirType() { + return "Sequence.structureVariation"; + + } + + } + + @Block() + public static class SequenceStructureVariationOuterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Structural Variant Outer Start-End. + */ + @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Structural Variant Outer Start-End", formalDefinition="Structural Variant Outer Start-End." ) + protected IntegerType start; + + /** + * Structural Variant Outer Start-End. + */ + @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Structural Variant Outer Start-End", formalDefinition="Structural Variant Outer Start-End." ) + protected IntegerType end; + + private static final long serialVersionUID = -1798864889L; + + /** + * Constructor + */ + public SequenceStructureVariationOuterComponent() { + super(); + } + + /** + * @return {@link #start} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public IntegerType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationOuterComponent.start"); + else if (Configuration.doAutoCreate()) + this.start = new IntegerType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public SequenceStructureVariationOuterComponent setStartElement(IntegerType value) { + this.start = value; + return this; + } + + /** + * @return Structural Variant Outer Start-End. + */ + public int getStart() { + return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); + } + + /** + * @param value Structural Variant Outer Start-End. + */ + public SequenceStructureVariationOuterComponent setStart(int value) { + if (this.start == null) + this.start = new IntegerType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public IntegerType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationOuterComponent.end"); + else if (Configuration.doAutoCreate()) + this.end = new IntegerType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public SequenceStructureVariationOuterComponent setEndElement(IntegerType value) { + this.end = value; + return this; + } + + /** + * @return Structural Variant Outer Start-End. + */ + public int getEnd() { + return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); + } + + /** + * @param value Structural Variant Outer Start-End. + */ + public SequenceStructureVariationOuterComponent setEnd(int value) { + if (this.end == null) + this.end = new IntegerType(); + this.end.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("start", "integer", "Structural Variant Outer Start-End.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "integer", "Structural Variant Outer Start-End.", 0, java.lang.Integer.MAX_VALUE, end)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 109757538: // start + this.start = castToInteger(value); // IntegerType + break; + case 100571: // end + this.end = castToInteger(value); // IntegerType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("start")) + this.start = castToInteger(value); // IntegerType + else if (name.equals("end")) + this.end = castToInteger(value); // IntegerType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("start")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.start"); + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.end"); + } + else + return super.addChild(name); + } + + public SequenceStructureVariationOuterComponent copy() { + SequenceStructureVariationOuterComponent dst = new SequenceStructureVariationOuterComponent(); + copyValues(dst); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SequenceStructureVariationOuterComponent)) + return false; + SequenceStructureVariationOuterComponent o = (SequenceStructureVariationOuterComponent) other; + return compareDeep(start, o.start, true) && compareDeep(end, o.end, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SequenceStructureVariationOuterComponent)) + return false; + SequenceStructureVariationOuterComponent o = (SequenceStructureVariationOuterComponent) other; + return compareValues(start, o.start, true) && compareValues(end, o.end, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + ; + } + + public String fhirType() { + return "Sequence.structureVariation.outer"; + + } + + } + + @Block() + public static class SequenceStructureVariationInnerComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Structural Variant Inner Start-End. + */ + @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Structural Variant Inner Start-End", formalDefinition="Structural Variant Inner Start-End." ) + protected IntegerType start; + + /** + * Structural Variant Inner Start-End. + */ + @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Structural Variant Inner Start-End", formalDefinition="Structural Variant Inner Start-End." ) + protected IntegerType end; + + private static final long serialVersionUID = -1798864889L; + + /** + * Constructor + */ + public SequenceStructureVariationInnerComponent() { + super(); + } + + /** + * @return {@link #start} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public IntegerType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationInnerComponent.start"); + else if (Configuration.doAutoCreate()) + this.start = new IntegerType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public SequenceStructureVariationInnerComponent setStartElement(IntegerType value) { + this.start = value; + return this; + } + + /** + * @return Structural Variant Inner Start-End. + */ + public int getStart() { + return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); + } + + /** + * @param value Structural Variant Inner Start-End. + */ + public SequenceStructureVariationInnerComponent setStart(int value) { + if (this.start == null) + this.start = new IntegerType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public IntegerType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceStructureVariationInnerComponent.end"); + else if (Configuration.doAutoCreate()) + this.end = new IntegerType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public SequenceStructureVariationInnerComponent setEndElement(IntegerType value) { + this.end = value; + return this; + } + + /** + * @return Structural Variant Inner Start-End. + */ + public int getEnd() { + return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); + } + + /** + * @param value Structural Variant Inner Start-End. + */ + public SequenceStructureVariationInnerComponent setEnd(int value) { + if (this.end == null) + this.end = new IntegerType(); + this.end.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("start", "integer", "Structural Variant Inner Start-End.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "integer", "Structural Variant Inner Start-End.", 0, java.lang.Integer.MAX_VALUE, end)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 109757538: // start + this.start = castToInteger(value); // IntegerType + break; + case 100571: // end + this.end = castToInteger(value); // IntegerType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("start")) + this.start = castToInteger(value); // IntegerType + else if (name.equals("end")) + this.end = castToInteger(value); // IntegerType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("start")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.start"); + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.end"); + } + else + return super.addChild(name); + } + + public SequenceStructureVariationInnerComponent copy() { + SequenceStructureVariationInnerComponent dst = new SequenceStructureVariationInnerComponent(); + copyValues(dst); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SequenceStructureVariationInnerComponent)) + return false; + SequenceStructureVariationInnerComponent o = (SequenceStructureVariationInnerComponent) other; + return compareDeep(start, o.start, true) && compareDeep(end, o.end, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SequenceStructureVariationInnerComponent)) + return false; + SequenceStructureVariationInnerComponent o = (SequenceStructureVariationInnerComponent) other; + return compareValues(start, o.start, true) && compareValues(end, o.end, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + ; + } + + public String fhirType() { + return "Sequence.structureVariation.inner"; + + } + + } + + /** + * Amino acid / cDNA transcript / RNA variation. + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="AA | DNA | RNA", formalDefinition="Amino acid / cDNA transcript / RNA variation." ) + protected Enumeration type; + + /** + * The patient, or group of patients whose sequencing results are described by this resource. + */ + @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient, or group of patients whose sequencing results are described by this resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient, or group of patients whose sequencing results are described by this resource.) + */ + protected Patient patientTarget; + + /** + * Specimen used for sequencing. + */ + @Child(name = "specimen", type = {Specimen.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specimen used for sequencing", formalDefinition="Specimen used for sequencing." ) + protected Reference specimen; + + /** + * The actual object that is the target of the reference (Specimen used for sequencing.) + */ + protected Specimen specimenTarget; + + /** + * The method for sequencing, for example, chip information. + */ + @Child(name = "device", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The method for sequencing", formalDefinition="The method for sequencing, for example, chip information." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The method for sequencing, for example, chip information.) + */ + protected Device deviceTarget; + + /** + * Quantity of the sequence. + */ + @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Quantity of the sequence", formalDefinition="Quantity of the sequence." ) + protected Quantity quantity; + + /** + * The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria. + */ + @Child(name = "species", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Supporting tests of human, viruses, and bacteria", formalDefinition="The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria." ) + protected CodeableConcept species; + + /** + * Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) . + */ + @Child(name = "referenceSeq", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Reference sequence", formalDefinition="Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) ." ) + protected List referenceSeq; + + /** + * Variation info in this sequence. + */ + @Child(name = "variation", type = {}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Variation info in this sequence", formalDefinition="Variation info in this sequence." ) + protected SequenceVariationComponent variation; + + /** + * Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing. + */ + @Child(name = "quality", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Sequence Quality", formalDefinition="Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing." ) + protected List quality; + + /** + * The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA. + */ + @Child(name = "allelicState", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The level of occurrence of a single DNA Sequence Variation within a set of chromosomes: Heteroplasmic / Homoplasmic / Homozygous / Heterozygous / Hemizygous", formalDefinition="The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA." ) + protected CodeableConcept allelicState; + + /** + * Allele frequencies. + */ + @Child(name = "allelicFrequency", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Allele frequencies", formalDefinition="Allele frequencies." ) + protected DecimalType allelicFrequency; + + /** + * Values: amplificaiton / deletion / LOH. + */ + @Child(name = "copyNumberEvent", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Copy Number Event: Values: amplificaiton / deletion / LOH", formalDefinition="Values: amplificaiton / deletion / LOH." ) + protected CodeableConcept copyNumberEvent; + + /** + * Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. + */ + @Child(name = "readCoverage", type = {IntegerType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Average number of reads representing a given nucleotide in the reconstructed sequence", formalDefinition="Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence." ) + protected IntegerType readCoverage; + + /** + * Configurations of the external repository. + */ + @Child(name = "repository", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External repository", formalDefinition="Configurations of the external repository." ) + protected List repository; + + /** + * Pointer to next atomic sequence which at most contains one variation. + */ + @Child(name = "pointer", type = {Sequence.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Pointer to next atomic sequence", formalDefinition="Pointer to next atomic sequence which at most contains one variation." ) + protected List pointer; + /** + * The actual objects that are the target of the reference (Pointer to next atomic sequence which at most contains one variation.) + */ + protected List pointerTarget; + + + /** + * Observed Sequence. + */ + @Child(name = "observedSeq", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Observed Sequence", formalDefinition="Observed Sequence." ) + protected StringType observedSeq; + + /** + * Analysis of the sequence. + */ + @Child(name = "observation", type = {Observation.class}, order=16, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Observation-genetics", formalDefinition="Analysis of the sequence." ) + protected Reference observation; + + /** + * The actual object that is the target of the reference (Analysis of the sequence.) + */ + protected Observation observationTarget; + + /** + * Structural variant. + */ + @Child(name = "structureVariation", type = {}, order=17, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="", formalDefinition="Structural variant." ) + protected SequenceStructureVariationComponent structureVariation; + + private static final long serialVersionUID = -1153660995L; + + /** + * Constructor + */ + public Sequence() { + super(); + } + + /** + * Constructor + */ + public Sequence(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Amino acid / cDNA transcript / RNA variation.). 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 Sequence.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new SequenceTypeEnumFactory()); // bb + 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} (Amino acid / cDNA transcript / RNA variation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Sequence setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Amino acid / cDNA transcript / RNA variation. + */ + public SequenceType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Amino acid / cDNA transcript / RNA variation. + */ + public Sequence setType(SequenceType value) { + if (this.type == null) + this.type = new Enumeration(new SequenceTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #patient} (The patient, or group of patients whose sequencing results are described by this resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient, or group of patients whose sequencing results are described by this resource.) + */ + public Sequence 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, or group of patients whose sequencing results are described by this resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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, or group of patients whose sequencing results are described by this resource.) + */ + public Sequence setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #specimen} (Specimen used for sequencing.) + */ + public Reference getSpecimen() { + if (this.specimen == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.specimen"); + else if (Configuration.doAutoCreate()) + this.specimen = new Reference(); // cc + return this.specimen; + } + + public boolean hasSpecimen() { + return this.specimen != null && !this.specimen.isEmpty(); + } + + /** + * @param value {@link #specimen} (Specimen used for sequencing.) + */ + public Sequence setSpecimen(Reference value) { + this.specimen = value; + return this; + } + + /** + * @return {@link #specimen} 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. (Specimen used for sequencing.) + */ + public Specimen getSpecimenTarget() { + if (this.specimenTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.specimen"); + else if (Configuration.doAutoCreate()) + this.specimenTarget = new Specimen(); // aa + return this.specimenTarget; + } + + /** + * @param value {@link #specimen} 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. (Specimen used for sequencing.) + */ + public Sequence setSpecimenTarget(Specimen value) { + this.specimenTarget = value; + return this; + } + + /** + * @return {@link #device} (The method for sequencing, for example, chip information.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); // cc + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The method for sequencing, for example, chip information.) + */ + public Sequence setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} 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 method for sequencing, for example, chip information.) + */ + public Device getDeviceTarget() { + if (this.deviceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.device"); + else if (Configuration.doAutoCreate()) + this.deviceTarget = new Device(); // aa + return this.deviceTarget; + } + + /** + * @param value {@link #device} 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 method for sequencing, for example, chip information.) + */ + public Sequence setDeviceTarget(Device value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #quantity} (Quantity of the sequence.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Quantity of the sequence.) + */ + public Sequence setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #species} (The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.) + */ + public CodeableConcept getSpecies() { + if (this.species == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.species"); + else if (Configuration.doAutoCreate()) + this.species = new CodeableConcept(); // cc + return this.species; + } + + public boolean hasSpecies() { + return this.species != null && !this.species.isEmpty(); + } + + /** + * @param value {@link #species} (The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.) + */ + public Sequence setSpecies(CodeableConcept value) { + this.species = value; + return this; + } + + /** + * @return {@link #referenceSeq} (Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .) + */ + public List getReferenceSeq() { + if (this.referenceSeq == null) + this.referenceSeq = new ArrayList(); + return this.referenceSeq; + } + + public boolean hasReferenceSeq() { + if (this.referenceSeq == null) + return false; + for (SequenceReferenceSeqComponent item : this.referenceSeq) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referenceSeq} (Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .) + */ + // syntactic sugar + public SequenceReferenceSeqComponent addReferenceSeq() { //3 + SequenceReferenceSeqComponent t = new SequenceReferenceSeqComponent(); + if (this.referenceSeq == null) + this.referenceSeq = new ArrayList(); + this.referenceSeq.add(t); + return t; + } + + // syntactic sugar + public Sequence addReferenceSeq(SequenceReferenceSeqComponent t) { //3 + if (t == null) + return this; + if (this.referenceSeq == null) + this.referenceSeq = new ArrayList(); + this.referenceSeq.add(t); + return this; + } + + /** + * @return {@link #variation} (Variation info in this sequence.) + */ + public SequenceVariationComponent getVariation() { + if (this.variation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.variation"); + else if (Configuration.doAutoCreate()) + this.variation = new SequenceVariationComponent(); // cc + return this.variation; + } + + public boolean hasVariation() { + return this.variation != null && !this.variation.isEmpty(); + } + + /** + * @param value {@link #variation} (Variation info in this sequence.) + */ + public Sequence setVariation(SequenceVariationComponent value) { + this.variation = value; + return this; + } + + /** + * @return {@link #quality} (Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.) + */ + public List getQuality() { + if (this.quality == null) + this.quality = new ArrayList(); + return this.quality; + } + + public boolean hasQuality() { + if (this.quality == null) + return false; + for (SequenceQualityComponent item : this.quality) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #quality} (Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.) + */ + // syntactic sugar + public SequenceQualityComponent addQuality() { //3 + SequenceQualityComponent t = new SequenceQualityComponent(); + if (this.quality == null) + this.quality = new ArrayList(); + this.quality.add(t); + return t; + } + + // syntactic sugar + public Sequence addQuality(SequenceQualityComponent t) { //3 + if (t == null) + return this; + if (this.quality == null) + this.quality = new ArrayList(); + this.quality.add(t); + return this; + } + + /** + * @return {@link #allelicState} (The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.) + */ + public CodeableConcept getAllelicState() { + if (this.allelicState == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.allelicState"); + else if (Configuration.doAutoCreate()) + this.allelicState = new CodeableConcept(); // cc + return this.allelicState; + } + + public boolean hasAllelicState() { + return this.allelicState != null && !this.allelicState.isEmpty(); + } + + /** + * @param value {@link #allelicState} (The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.) + */ + public Sequence setAllelicState(CodeableConcept value) { + this.allelicState = value; + return this; + } + + /** + * @return {@link #allelicFrequency} (Allele frequencies.). This is the underlying object with id, value and extensions. The accessor "getAllelicFrequency" gives direct access to the value + */ + public DecimalType getAllelicFrequencyElement() { + if (this.allelicFrequency == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.allelicFrequency"); + else if (Configuration.doAutoCreate()) + this.allelicFrequency = new DecimalType(); // bb + return this.allelicFrequency; + } + + public boolean hasAllelicFrequencyElement() { + return this.allelicFrequency != null && !this.allelicFrequency.isEmpty(); + } + + public boolean hasAllelicFrequency() { + return this.allelicFrequency != null && !this.allelicFrequency.isEmpty(); + } + + /** + * @param value {@link #allelicFrequency} (Allele frequencies.). This is the underlying object with id, value and extensions. The accessor "getAllelicFrequency" gives direct access to the value + */ + public Sequence setAllelicFrequencyElement(DecimalType value) { + this.allelicFrequency = value; + return this; + } + + /** + * @return Allele frequencies. + */ + public BigDecimal getAllelicFrequency() { + return this.allelicFrequency == null ? null : this.allelicFrequency.getValue(); + } + + /** + * @param value Allele frequencies. + */ + public Sequence setAllelicFrequency(BigDecimal value) { + if (value == null) + this.allelicFrequency = null; + else { + if (this.allelicFrequency == null) + this.allelicFrequency = new DecimalType(); + this.allelicFrequency.setValue(value); + } + return this; + } + + /** + * @param value Allele frequencies. + */ + public Sequence setAllelicFrequency(long value) { + this.allelicFrequency = new DecimalType(); + this.allelicFrequency.setValue(value); + return this; + } + + /** + * @param value Allele frequencies. + */ + public Sequence setAllelicFrequency(double value) { + this.allelicFrequency = new DecimalType(); + this.allelicFrequency.setValue(value); + return this; + } + + /** + * @return {@link #copyNumberEvent} (Values: amplificaiton / deletion / LOH.) + */ + public CodeableConcept getCopyNumberEvent() { + if (this.copyNumberEvent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.copyNumberEvent"); + else if (Configuration.doAutoCreate()) + this.copyNumberEvent = new CodeableConcept(); // cc + return this.copyNumberEvent; + } + + public boolean hasCopyNumberEvent() { + return this.copyNumberEvent != null && !this.copyNumberEvent.isEmpty(); + } + + /** + * @param value {@link #copyNumberEvent} (Values: amplificaiton / deletion / LOH.) + */ + public Sequence setCopyNumberEvent(CodeableConcept value) { + this.copyNumberEvent = value; + return this; + } + + /** + * @return {@link #readCoverage} (Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.). This is the underlying object with id, value and extensions. The accessor "getReadCoverage" gives direct access to the value + */ + public IntegerType getReadCoverageElement() { + if (this.readCoverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.readCoverage"); + else if (Configuration.doAutoCreate()) + this.readCoverage = new IntegerType(); // bb + return this.readCoverage; + } + + public boolean hasReadCoverageElement() { + return this.readCoverage != null && !this.readCoverage.isEmpty(); + } + + public boolean hasReadCoverage() { + return this.readCoverage != null && !this.readCoverage.isEmpty(); + } + + /** + * @param value {@link #readCoverage} (Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.). This is the underlying object with id, value and extensions. The accessor "getReadCoverage" gives direct access to the value + */ + public Sequence setReadCoverageElement(IntegerType value) { + this.readCoverage = value; + return this; + } + + /** + * @return Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. + */ + public int getReadCoverage() { + return this.readCoverage == null || this.readCoverage.isEmpty() ? 0 : this.readCoverage.getValue(); + } + + /** + * @param value Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. + */ + public Sequence setReadCoverage(int value) { + if (this.readCoverage == null) + this.readCoverage = new IntegerType(); + this.readCoverage.setValue(value); + return this; + } + + /** + * @return {@link #repository} (Configurations of the external repository.) + */ + public List getRepository() { + if (this.repository == null) + this.repository = new ArrayList(); + return this.repository; + } + + public boolean hasRepository() { + if (this.repository == null) + return false; + for (SequenceRepositoryComponent item : this.repository) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #repository} (Configurations of the external repository.) + */ + // syntactic sugar + public SequenceRepositoryComponent addRepository() { //3 + SequenceRepositoryComponent t = new SequenceRepositoryComponent(); + if (this.repository == null) + this.repository = new ArrayList(); + this.repository.add(t); + return t; + } + + // syntactic sugar + public Sequence addRepository(SequenceRepositoryComponent t) { //3 + if (t == null) + return this; + if (this.repository == null) + this.repository = new ArrayList(); + this.repository.add(t); + return this; + } + + /** + * @return {@link #pointer} (Pointer to next atomic sequence which at most contains one variation.) + */ + public List getPointer() { + if (this.pointer == null) + this.pointer = new ArrayList(); + return this.pointer; + } + + public boolean hasPointer() { + if (this.pointer == null) + return false; + for (Reference item : this.pointer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #pointer} (Pointer to next atomic sequence which at most contains one variation.) + */ + // syntactic sugar + public Reference addPointer() { //3 + Reference t = new Reference(); + if (this.pointer == null) + this.pointer = new ArrayList(); + this.pointer.add(t); + return t; + } + + // syntactic sugar + public Sequence addPointer(Reference t) { //3 + if (t == null) + return this; + if (this.pointer == null) + this.pointer = new ArrayList(); + this.pointer.add(t); + return this; + } + + /** + * @return {@link #pointer} (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. Pointer to next atomic sequence which at most contains one variation.) + */ + public List getPointerTarget() { + if (this.pointerTarget == null) + this.pointerTarget = new ArrayList(); + return this.pointerTarget; + } + + // syntactic sugar + /** + * @return {@link #pointer} (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. Pointer to next atomic sequence which at most contains one variation.) + */ + public Sequence addPointerTarget() { + Sequence r = new Sequence(); + if (this.pointerTarget == null) + this.pointerTarget = new ArrayList(); + this.pointerTarget.add(r); + return r; + } + + /** + * @return {@link #observedSeq} (Observed Sequence.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value + */ + public StringType getObservedSeqElement() { + if (this.observedSeq == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.observedSeq"); + else if (Configuration.doAutoCreate()) + this.observedSeq = new StringType(); // bb + return this.observedSeq; + } + + public boolean hasObservedSeqElement() { + return this.observedSeq != null && !this.observedSeq.isEmpty(); + } + + public boolean hasObservedSeq() { + return this.observedSeq != null && !this.observedSeq.isEmpty(); + } + + /** + * @param value {@link #observedSeq} (Observed Sequence.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value + */ + public Sequence setObservedSeqElement(StringType value) { + this.observedSeq = value; + return this; + } + + /** + * @return Observed Sequence. + */ + public String getObservedSeq() { + return this.observedSeq == null ? null : this.observedSeq.getValue(); + } + + /** + * @param value Observed Sequence. + */ + public Sequence setObservedSeq(String value) { + if (Utilities.noString(value)) + this.observedSeq = null; + else { + if (this.observedSeq == null) + this.observedSeq = new StringType(); + this.observedSeq.setValue(value); + } + return this; + } + + /** + * @return {@link #observation} (Analysis of the sequence.) + */ + public Reference getObservation() { + if (this.observation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.observation"); + else if (Configuration.doAutoCreate()) + this.observation = new Reference(); // cc + return this.observation; + } + + public boolean hasObservation() { + return this.observation != null && !this.observation.isEmpty(); + } + + /** + * @param value {@link #observation} (Analysis of the sequence.) + */ + public Sequence setObservation(Reference value) { + this.observation = value; + return this; + } + + /** + * @return {@link #observation} 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. (Analysis of the sequence.) + */ + public Observation getObservationTarget() { + if (this.observationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.observation"); + else if (Configuration.doAutoCreate()) + this.observationTarget = new Observation(); // aa + return this.observationTarget; + } + + /** + * @param value {@link #observation} 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. (Analysis of the sequence.) + */ + public Sequence setObservationTarget(Observation value) { + this.observationTarget = value; + return this; + } + + /** + * @return {@link #structureVariation} (Structural variant.) + */ + public SequenceStructureVariationComponent getStructureVariation() { + if (this.structureVariation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.structureVariation"); + else if (Configuration.doAutoCreate()) + this.structureVariation = new SequenceStructureVariationComponent(); // cc + return this.structureVariation; + } + + public boolean hasStructureVariation() { + return this.structureVariation != null && !this.structureVariation.isEmpty(); + } + + /** + * @param value {@link #structureVariation} (Structural variant.) + */ + public Sequence setStructureVariation(SequenceStructureVariationComponent value) { + this.structureVariation = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Amino acid / cDNA transcript / RNA variation.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient, or group of patients whose sequencing results are described by this resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("quantity", "Quantity", "Quantity of the sequence.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("species", "CodeableConcept", "The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.", 0, java.lang.Integer.MAX_VALUE, species)); + childrenList.add(new Property("referenceSeq", "", "Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .", 0, java.lang.Integer.MAX_VALUE, referenceSeq)); + childrenList.add(new Property("variation", "", "Variation info in this sequence.", 0, java.lang.Integer.MAX_VALUE, variation)); + childrenList.add(new Property("quality", "", "Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.", 0, java.lang.Integer.MAX_VALUE, quality)); + childrenList.add(new Property("allelicState", "CodeableConcept", "The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.", 0, java.lang.Integer.MAX_VALUE, allelicState)); + childrenList.add(new Property("allelicFrequency", "decimal", "Allele frequencies.", 0, java.lang.Integer.MAX_VALUE, allelicFrequency)); + childrenList.add(new Property("copyNumberEvent", "CodeableConcept", "Values: amplificaiton / deletion / LOH.", 0, java.lang.Integer.MAX_VALUE, copyNumberEvent)); + childrenList.add(new Property("readCoverage", "integer", "Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.", 0, java.lang.Integer.MAX_VALUE, readCoverage)); + childrenList.add(new Property("repository", "", "Configurations of the external repository.", 0, java.lang.Integer.MAX_VALUE, repository)); + childrenList.add(new Property("pointer", "Reference(Sequence)", "Pointer to next atomic sequence which at most contains one variation.", 0, java.lang.Integer.MAX_VALUE, pointer)); + childrenList.add(new Property("observedSeq", "string", "Observed Sequence.", 0, java.lang.Integer.MAX_VALUE, observedSeq)); + childrenList.add(new Property("observation", "Reference(Observation)", "Analysis of the sequence.", 0, java.lang.Integer.MAX_VALUE, observation)); + childrenList.add(new Property("structureVariation", "", "Structural variant.", 0, java.lang.Integer.MAX_VALUE, structureVariation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference + case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity + case -2008465092: /*species*/ return this.species == null ? new Base[0] : new Base[] {this.species}; // CodeableConcept + case -502547180: /*referenceSeq*/ return this.referenceSeq == null ? new Base[0] : this.referenceSeq.toArray(new Base[this.referenceSeq.size()]); // SequenceReferenceSeqComponent + case -81944045: /*variation*/ return this.variation == null ? new Base[0] : new Base[] {this.variation}; // SequenceVariationComponent + case 651215103: /*quality*/ return this.quality == null ? new Base[0] : this.quality.toArray(new Base[this.quality.size()]); // SequenceQualityComponent + case 2079026319: /*allelicState*/ return this.allelicState == null ? new Base[0] : new Base[] {this.allelicState}; // CodeableConcept + case 8650330: /*allelicFrequency*/ return this.allelicFrequency == null ? new Base[0] : new Base[] {this.allelicFrequency}; // DecimalType + case 960854556: /*copyNumberEvent*/ return this.copyNumberEvent == null ? new Base[0] : new Base[] {this.copyNumberEvent}; // CodeableConcept + case -1798816354: /*readCoverage*/ return this.readCoverage == null ? new Base[0] : new Base[] {this.readCoverage}; // IntegerType + case 1950800714: /*repository*/ return this.repository == null ? new Base[0] : this.repository.toArray(new Base[this.repository.size()]); // SequenceRepositoryComponent + case -400605635: /*pointer*/ return this.pointer == null ? new Base[0] : this.pointer.toArray(new Base[this.pointer.size()]); // Reference + case 125541495: /*observedSeq*/ return this.observedSeq == null ? new Base[0] : new Base[] {this.observedSeq}; // StringType + case 122345516: /*observation*/ return this.observation == null ? new Base[0] : new Base[] {this.observation}; // Reference + case 1886586336: /*structureVariation*/ return this.structureVariation == null ? new Base[0] : new Base[] {this.structureVariation}; // SequenceStructureVariationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new SequenceTypeEnumFactory().fromType(value); // Enumeration + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -2132868344: // specimen + this.specimen = castToReference(value); // Reference + break; + case -1335157162: // device + this.device = castToReference(value); // Reference + break; + case -1285004149: // quantity + this.quantity = castToQuantity(value); // Quantity + break; + case -2008465092: // species + this.species = castToCodeableConcept(value); // CodeableConcept + break; + case -502547180: // referenceSeq + this.getReferenceSeq().add((SequenceReferenceSeqComponent) value); // SequenceReferenceSeqComponent + break; + case -81944045: // variation + this.variation = (SequenceVariationComponent) value; // SequenceVariationComponent + break; + case 651215103: // quality + this.getQuality().add((SequenceQualityComponent) value); // SequenceQualityComponent + break; + case 2079026319: // allelicState + this.allelicState = castToCodeableConcept(value); // CodeableConcept + break; + case 8650330: // allelicFrequency + this.allelicFrequency = castToDecimal(value); // DecimalType + break; + case 960854556: // copyNumberEvent + this.copyNumberEvent = castToCodeableConcept(value); // CodeableConcept + break; + case -1798816354: // readCoverage + this.readCoverage = castToInteger(value); // IntegerType + break; + case 1950800714: // repository + this.getRepository().add((SequenceRepositoryComponent) value); // SequenceRepositoryComponent + break; + case -400605635: // pointer + this.getPointer().add(castToReference(value)); // Reference + break; + case 125541495: // observedSeq + this.observedSeq = castToString(value); // StringType + break; + case 122345516: // observation + this.observation = castToReference(value); // Reference + break; + case 1886586336: // structureVariation + this.structureVariation = (SequenceStructureVariationComponent) value; // SequenceStructureVariationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new SequenceTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("specimen")) + this.specimen = castToReference(value); // Reference + else if (name.equals("device")) + this.device = castToReference(value); // Reference + else if (name.equals("quantity")) + this.quantity = castToQuantity(value); // Quantity + else if (name.equals("species")) + this.species = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("referenceSeq")) + this.getReferenceSeq().add((SequenceReferenceSeqComponent) value); + else if (name.equals("variation")) + this.variation = (SequenceVariationComponent) value; // SequenceVariationComponent + else if (name.equals("quality")) + this.getQuality().add((SequenceQualityComponent) value); + else if (name.equals("allelicState")) + this.allelicState = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("allelicFrequency")) + this.allelicFrequency = castToDecimal(value); // DecimalType + else if (name.equals("copyNumberEvent")) + this.copyNumberEvent = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("readCoverage")) + this.readCoverage = castToInteger(value); // IntegerType + else if (name.equals("repository")) + this.getRepository().add((SequenceRepositoryComponent) value); + else if (name.equals("pointer")) + this.getPointer().add(castToReference(value)); + else if (name.equals("observedSeq")) + this.observedSeq = castToString(value); // StringType + else if (name.equals("observation")) + this.observation = castToReference(value); // Reference + else if (name.equals("structureVariation")) + this.structureVariation = (SequenceStructureVariationComponent) value; // SequenceStructureVariationComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -791418107: return getPatient(); // Reference + case -2132868344: return getSpecimen(); // Reference + case -1335157162: return getDevice(); // Reference + case -1285004149: return getQuantity(); // Quantity + case -2008465092: return getSpecies(); // CodeableConcept + case -502547180: return addReferenceSeq(); // SequenceReferenceSeqComponent + case -81944045: return getVariation(); // SequenceVariationComponent + case 651215103: return addQuality(); // SequenceQualityComponent + case 2079026319: return getAllelicState(); // CodeableConcept + case 8650330: throw new FHIRException("Cannot make property allelicFrequency as it is not a complex type"); // DecimalType + case 960854556: return getCopyNumberEvent(); // CodeableConcept + case -1798816354: throw new FHIRException("Cannot make property readCoverage as it is not a complex type"); // IntegerType + case 1950800714: return addRepository(); // SequenceRepositoryComponent + case -400605635: return addPointer(); // Reference + case 125541495: throw new FHIRException("Cannot make property observedSeq as it is not a complex type"); // StringType + case 122345516: return getObservation(); // Reference + case 1886586336: return getStructureVariation(); // SequenceStructureVariationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.type"); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("specimen")) { + this.specimen = new Reference(); + return this.specimen; + } + else if (name.equals("device")) { + this.device = new Reference(); + return this.device; + } + else if (name.equals("quantity")) { + this.quantity = new Quantity(); + return this.quantity; + } + else if (name.equals("species")) { + this.species = new CodeableConcept(); + return this.species; + } + else if (name.equals("referenceSeq")) { + return addReferenceSeq(); + } + else if (name.equals("variation")) { + this.variation = new SequenceVariationComponent(); + return this.variation; + } + else if (name.equals("quality")) { + return addQuality(); + } + else if (name.equals("allelicState")) { + this.allelicState = new CodeableConcept(); + return this.allelicState; + } + else if (name.equals("allelicFrequency")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.allelicFrequency"); + } + else if (name.equals("copyNumberEvent")) { + this.copyNumberEvent = new CodeableConcept(); + return this.copyNumberEvent; + } + else if (name.equals("readCoverage")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.readCoverage"); + } + else if (name.equals("repository")) { + return addRepository(); + } + else if (name.equals("pointer")) { + return addPointer(); + } + else if (name.equals("observedSeq")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedSeq"); + } + else if (name.equals("observation")) { + this.observation = new Reference(); + return this.observation; + } + else if (name.equals("structureVariation")) { + this.structureVariation = new SequenceStructureVariationComponent(); + return this.structureVariation; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Sequence"; + + } + + public Sequence copy() { + Sequence dst = new Sequence(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.specimen = specimen == null ? null : specimen.copy(); + dst.device = device == null ? null : device.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.species = species == null ? null : species.copy(); + if (referenceSeq != null) { + dst.referenceSeq = new ArrayList(); + for (SequenceReferenceSeqComponent i : referenceSeq) + dst.referenceSeq.add(i.copy()); + }; + dst.variation = variation == null ? null : variation.copy(); + if (quality != null) { + dst.quality = new ArrayList(); + for (SequenceQualityComponent i : quality) + dst.quality.add(i.copy()); + }; + dst.allelicState = allelicState == null ? null : allelicState.copy(); + dst.allelicFrequency = allelicFrequency == null ? null : allelicFrequency.copy(); + dst.copyNumberEvent = copyNumberEvent == null ? null : copyNumberEvent.copy(); + dst.readCoverage = readCoverage == null ? null : readCoverage.copy(); + if (repository != null) { + dst.repository = new ArrayList(); + for (SequenceRepositoryComponent i : repository) + dst.repository.add(i.copy()); + }; + if (pointer != null) { + dst.pointer = new ArrayList(); + for (Reference i : pointer) + dst.pointer.add(i.copy()); + }; + dst.observedSeq = observedSeq == null ? null : observedSeq.copy(); + dst.observation = observation == null ? null : observation.copy(); + dst.structureVariation = structureVariation == null ? null : structureVariation.copy(); + return dst; + } + + protected Sequence typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Sequence)) + return false; + Sequence o = (Sequence) other; + return compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) && compareDeep(specimen, o.specimen, true) + && compareDeep(device, o.device, true) && compareDeep(quantity, o.quantity, true) && compareDeep(species, o.species, true) + && compareDeep(referenceSeq, o.referenceSeq, true) && compareDeep(variation, o.variation, true) + && compareDeep(quality, o.quality, true) && compareDeep(allelicState, o.allelicState, true) && compareDeep(allelicFrequency, o.allelicFrequency, true) + && compareDeep(copyNumberEvent, o.copyNumberEvent, true) && compareDeep(readCoverage, o.readCoverage, true) + && compareDeep(repository, o.repository, true) && compareDeep(pointer, o.pointer, true) && compareDeep(observedSeq, o.observedSeq, true) + && compareDeep(observation, o.observation, true) && compareDeep(structureVariation, o.structureVariation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Sequence)) + return false; + Sequence o = (Sequence) other; + return compareValues(type, o.type, true) && compareValues(allelicFrequency, o.allelicFrequency, true) + && compareValues(readCoverage, o.readCoverage, true) && compareValues(observedSeq, o.observedSeq, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (patient == null || patient.isEmpty()) + && (specimen == null || specimen.isEmpty()) && (device == null || device.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (species == null || species.isEmpty()) && (referenceSeq == null || referenceSeq.isEmpty()) + && (variation == null || variation.isEmpty()) && (quality == null || quality.isEmpty()) && (allelicState == null || allelicState.isEmpty()) + && (allelicFrequency == null || allelicFrequency.isEmpty()) && (copyNumberEvent == null || copyNumberEvent.isEmpty()) + && (readCoverage == null || readCoverage.isEmpty()) && (repository == null || repository.isEmpty()) + && (pointer == null || pointer.isEmpty()) && (observedSeq == null || observedSeq.isEmpty()) + && (observation == null || observation.isEmpty()) && (structureVariation == null || structureVariation.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Sequence; + } + + /** + * Search parameter: patient + *

+ * Description: The subject that the observation is about
+ * Type: reference
+ * Path: Sequence.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="Sequence.patient", description="The subject that the observation is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The subject that the observation is about
+ * Type: reference
+ * Path: Sequence.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Sequence:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Sequence:patient").toLocked(); + + /** + * Search parameter: species + *

+ * Description: The organism from which sample of the sequence was extracted.
+ * Type: token
+ * Path: Sequence.species
+ *

+ */ + @SearchParamDefinition(name="species", path="Sequence.species", description="The organism from which sample of the sequence was extracted.", type="token" ) + public static final String SP_SPECIES = "species"; + /** + * Fluent Client search parameter constant for species + *

+ * Description: The organism from which sample of the sequence was extracted.
+ * Type: token
+ * Path: Sequence.species
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIES = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIES); + + /** + * Search parameter: coordinate + *

+ * Description: Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="coordinate", path="", description="Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`", type="composite", compositeOf={"chromosome", "start"} ) + public static final String SP_COORDINATE = "coordinate"; + /** + * Fluent Client search parameter constant for coordinate + *

+ * Description: Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COORDINATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COORDINATE); + + /** + * Search parameter: start + *

+ * Description: Start position (0-based inclusive) of the sequence
+ * Type: number
+ * Path: Sequence.variation.start
+ *

+ */ + @SearchParamDefinition(name="start", path="Sequence.variation.start", description="Start position (0-based inclusive) of the sequence", type="number" ) + public static final String SP_START = "start"; + /** + * Fluent Client search parameter constant for start + *

+ * Description: Start position (0-based inclusive) of the sequence
+ * Type: number
+ * Path: Sequence.variation.start
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.NumberClientParam START = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_START); + + /** + * Search parameter: type + *

+ * Description: The type of the variant: Amino acid / cDNA transcript / RNA variation.
+ * Type: token
+ * Path: Sequence.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Sequence.type", description="The type of the variant: Amino acid / cDNA transcript / RNA variation.", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The type of the variant: Amino acid / cDNA transcript / RNA variation.
+ * Type: token
+ * Path: Sequence.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: chromosome + *

+ * Description: Chromosome of the sequence
+ * Type: token
+ * Path: Sequence.referenceSeq.chromosome
+ *

+ */ + @SearchParamDefinition(name="chromosome", path="Sequence.referenceSeq.chromosome", description="Chromosome of the sequence", type="token" ) + public static final String SP_CHROMOSOME = "chromosome"; + /** + * Fluent Client search parameter constant for chromosome + *

+ * Description: Chromosome of the sequence
+ * Type: token
+ * Path: Sequence.referenceSeq.chromosome
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHROMOSOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHROMOSOME); + + /** + * Search parameter: end + *

+ * Description: End position (0-based exclusive) of the sequence
+ * Type: number
+ * Path: Sequence.variation.end
+ *

+ */ + @SearchParamDefinition(name="end", path="Sequence.variation.end", description="End position (0-based exclusive) of the sequence", type="number" ) + public static final String SP_END = "end"; + /** + * Fluent Client search parameter constant for end + *

+ * Description: End position (0-based exclusive) of the sequence
+ * Type: number
+ * Path: Sequence.variation.end
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.NumberClientParam END = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_END); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SidType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SidType.java new file mode 100644 index 00000000000..5db305ff134 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SidType.java @@ -0,0 +1,38 @@ +/* +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. + +*/ +package org.hl7.fhir.dstu2016may.model; + +public class SidType extends UriType { + + private static final long serialVersionUID = 5486832330986493589L; + + public String fhirType() { + return "sid"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Signature.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Signature.java new file mode 100644 index 00000000000..73e1043f817 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Signature.java @@ -0,0 +1,485 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities. + */ +@DatatypeDef(name="Signature") +public class Signature extends Type implements ICompositeType { + + /** + * An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. + */ + @Child(name = "type", type = {Coding.class}, order=0, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Indication of the reason the entity signed the object(s)", formalDefinition="An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document." ) + protected List type; + + /** + * When the digital signature was signed. + */ + @Child(name = "when", type = {InstantType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the signature was created", formalDefinition="When the digital signature was signed." ) + protected InstantType when; + + /** + * A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key). + */ + @Child(name = "who", type = {UriType.class, Practitioner.class, RelatedPerson.class, Patient.class, Device.class, Organization.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who signed the signature", formalDefinition="A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key)." ) + protected Type who; + + /** + * A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc. + */ + @Child(name = "contentType", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The technical format of the signature", formalDefinition="A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc." ) + protected CodeType contentType; + + /** + * The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. + */ + @Child(name = "blob", type = {Base64BinaryType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The actual signature content (XML DigSig. JWT, picture, etc.)", formalDefinition="The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty." ) + protected Base64BinaryType blob; + + private static final long serialVersionUID = -452432714L; + + /** + * Constructor + */ + public Signature() { + super(); + } + + /** + * Constructor + */ + public Signature(InstantType when, Type who) { + super(); + this.when = when; + this.who = who; + } + + /** + * @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (Coding item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.) + */ + // syntactic sugar + public Coding addType() { //3 + Coding t = new Coding(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + // syntactic sugar + public Signature addType(Coding t) { //3 + if (t == null) + return this; + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @return {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public InstantType getWhenElement() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Signature.when"); + else if (Configuration.doAutoCreate()) + this.when = new InstantType(); // bb + return this.when; + } + + public boolean hasWhenElement() { + return this.when != null && !this.when.isEmpty(); + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public Signature setWhenElement(InstantType value) { + this.when = value; + return this; + } + + /** + * @return When the digital signature was signed. + */ + public Date getWhen() { + return this.when == null ? null : this.when.getValue(); + } + + /** + * @param value When the digital signature was signed. + */ + public Signature setWhen(Date value) { + if (this.when == null) + this.when = new InstantType(); + this.when.setValue(value); + return this; + } + + /** + * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) + */ + public Type getWho() { + return this.who; + } + + /** + * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) + */ + public UriType getWhoUriType() throws FHIRException { + if (!(this.who instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.who.getClass().getName()+" was encountered"); + return (UriType) this.who; + } + + public boolean hasWhoUriType() { + return this.who instanceof UriType; + } + + /** + * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) + */ + public Reference getWhoReference() throws FHIRException { + if (!(this.who instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.who.getClass().getName()+" was encountered"); + return (Reference) this.who; + } + + public boolean hasWhoReference() { + return this.who instanceof Reference; + } + + public boolean hasWho() { + return this.who != null && !this.who.isEmpty(); + } + + /** + * @param value {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) + */ + public Signature setWho(Type value) { + this.who = value; + return this; + } + + /** + * @return {@link #contentType} (A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public CodeType getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Signature.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new CodeType(); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Signature setContentTypeElement(CodeType value) { + this.contentType = value; + return this; + } + + /** + * @return A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc. + */ + public String getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc. + */ + public Signature setContentType(String value) { + if (Utilities.noString(value)) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new CodeType(); + this.contentType.setValue(value); + } + return this; + } + + /** + * @return {@link #blob} (The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public Base64BinaryType getBlobElement() { + if (this.blob == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Signature.blob"); + else if (Configuration.doAutoCreate()) + this.blob = new Base64BinaryType(); // bb + return this.blob; + } + + public boolean hasBlobElement() { + return this.blob != null && !this.blob.isEmpty(); + } + + public boolean hasBlob() { + return this.blob != null && !this.blob.isEmpty(); + } + + /** + * @param value {@link #blob} (The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public Signature setBlobElement(Base64BinaryType value) { + this.blob = value; + return this; + } + + /** + * @return The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. + */ + public byte[] getBlob() { + return this.blob == null ? null : this.blob.getValue(); + } + + /** + * @param value The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. + */ + public Signature setBlob(byte[] value) { + if (value == null) + this.blob = null; + else { + if (this.blob == null) + this.blob = new Base64BinaryType(); + this.blob.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("when", "instant", "When the digital signature was signed.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("who[x]", "uri|Reference(Practitioner|RelatedPerson|Patient|Device|Organization)", "A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).", 0, java.lang.Integer.MAX_VALUE, who)); + childrenList.add(new Property("contentType", "code", "A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc.", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("blob", "base64Binary", "The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.", 0, java.lang.Integer.MAX_VALUE, blob)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Coding + case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // InstantType + case 117694: /*who*/ return this.who == null ? new Base[0] : new Base[] {this.who}; // Type + case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType + case 3026845: /*blob*/ return this.blob == null ? new Base[0] : new Base[] {this.blob}; // Base64BinaryType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.getType().add(castToCoding(value)); // Coding + break; + case 3648314: // when + this.when = castToInstant(value); // InstantType + break; + case 117694: // who + this.who = (Type) value; // Type + break; + case -389131437: // contentType + this.contentType = castToCode(value); // CodeType + break; + case 3026845: // blob + this.blob = castToBase64Binary(value); // Base64BinaryType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.getType().add(castToCoding(value)); + else if (name.equals("when")) + this.when = castToInstant(value); // InstantType + else if (name.equals("who[x]")) + this.who = (Type) value; // Type + else if (name.equals("contentType")) + this.contentType = castToCode(value); // CodeType + else if (name.equals("blob")) + this.blob = castToBase64Binary(value); // Base64BinaryType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return addType(); // Coding + case 3648314: throw new FHIRException("Cannot make property when as it is not a complex type"); // InstantType + case -788654078: return getWho(); // Type + case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType + case 3026845: throw new FHIRException("Cannot make property blob as it is not a complex type"); // Base64BinaryType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + return addType(); + } + else if (name.equals("when")) { + throw new FHIRException("Cannot call addChild on a primitive type Signature.when"); + } + else if (name.equals("whoUri")) { + this.who = new UriType(); + return this.who; + } + else if (name.equals("whoReference")) { + this.who = new Reference(); + return this.who; + } + else if (name.equals("contentType")) { + throw new FHIRException("Cannot call addChild on a primitive type Signature.contentType"); + } + else if (name.equals("blob")) { + throw new FHIRException("Cannot call addChild on a primitive type Signature.blob"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Signature"; + + } + + public Signature copy() { + Signature dst = new Signature(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (Coding i : type) + dst.type.add(i.copy()); + }; + dst.when = when == null ? null : when.copy(); + dst.who = who == null ? null : who.copy(); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.blob = blob == null ? null : blob.copy(); + return dst; + } + + protected Signature typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Signature)) + return false; + Signature o = (Signature) other; + return compareDeep(type, o.type, true) && compareDeep(when, o.when, true) && compareDeep(who, o.who, true) + && compareDeep(contentType, o.contentType, true) && compareDeep(blob, o.blob, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Signature)) + return false; + Signature o = (Signature) other; + return compareValues(when, o.when, true) && compareValues(contentType, o.contentType, true) && compareValues(blob, o.blob, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (when == null || when.isEmpty()) + && (who == null || who.isEmpty()) && (contentType == null || contentType.isEmpty()) && (blob == null || blob.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SimpleQuantity.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SimpleQuantity.java new file mode 100644 index 00000000000..9589ddee626 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SimpleQuantity.java @@ -0,0 +1,88 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="SimpleQuantity", profileOf=Quantity.class) +public class SimpleQuantity extends Quantity { + + private static final long serialVersionUID = 1069574054L; + + public SimpleQuantity copy() { + SimpleQuantity dst = new SimpleQuantity(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected SimpleQuantity typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SimpleQuantity)) + return false; + SimpleQuantity o = (SimpleQuantity) other; + return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) + && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SimpleQuantity)) + return false; + SimpleQuantity o = (SimpleQuantity) other; + return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) + && compareValues(system, o.system, true) && compareValues(code, o.code, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Slot.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Slot.java new file mode 100644 index 00000000000..735a264f12b --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Slot.java @@ -0,0 +1,1061 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A slot of time on a schedule that may be available for booking appointments. + */ +@ResourceDef(name="Slot", profile="http://hl7.org/fhir/Profile/Slot") +public class Slot extends DomainResource { + + public enum SlotStatus { + /** + * Indicates that the time interval is busy because one or more events have been scheduled for that interval. + */ + BUSY, + /** + * Indicates that the time interval is free for scheduling. + */ + FREE, + /** + * Indicates that the time interval is busy and that the interval can not be scheduled. + */ + BUSYUNAVAILABLE, + /** + * Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval. + */ + BUSYTENTATIVE, + /** + * added to help the parsers + */ + NULL; + public static SlotStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("busy".equals(codeString)) + return BUSY; + if ("free".equals(codeString)) + return FREE; + if ("busy-unavailable".equals(codeString)) + return BUSYUNAVAILABLE; + if ("busy-tentative".equals(codeString)) + return BUSYTENTATIVE; + throw new FHIRException("Unknown SlotStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case BUSY: return "busy"; + case FREE: return "free"; + case BUSYUNAVAILABLE: return "busy-unavailable"; + case BUSYTENTATIVE: return "busy-tentative"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case BUSY: return "http://hl7.org/fhir/slotstatus"; + case FREE: return "http://hl7.org/fhir/slotstatus"; + case BUSYUNAVAILABLE: return "http://hl7.org/fhir/slotstatus"; + case BUSYTENTATIVE: return "http://hl7.org/fhir/slotstatus"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case BUSY: return "Indicates that the time interval is busy because one or more events have been scheduled for that interval."; + case FREE: return "Indicates that the time interval is free for scheduling."; + case BUSYUNAVAILABLE: return "Indicates that the time interval is busy and that the interval can not be scheduled."; + case BUSYTENTATIVE: return "Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case BUSY: return "Busy"; + case FREE: return "Free"; + case BUSYUNAVAILABLE: return "Busy (Unavailable)"; + case BUSYTENTATIVE: return "Busy (Tentative)"; + default: return "?"; + } + } + } + + 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; + if ("busy".equals(codeString)) + return SlotStatus.BUSY; + if ("free".equals(codeString)) + return SlotStatus.FREE; + if ("busy-unavailable".equals(codeString)) + return SlotStatus.BUSYUNAVAILABLE; + if ("busy-tentative".equals(codeString)) + return SlotStatus.BUSYTENTATIVE; + throw new IllegalArgumentException("Unknown SlotStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("busy".equals(codeString)) + return new Enumeration(this, SlotStatus.BUSY); + if ("free".equals(codeString)) + return new Enumeration(this, SlotStatus.FREE); + if ("busy-unavailable".equals(codeString)) + return new Enumeration(this, SlotStatus.BUSYUNAVAILABLE); + if ("busy-tentative".equals(codeString)) + return new Enumeration(this, SlotStatus.BUSYTENTATIVE); + throw new FHIRException("Unknown SlotStatus code '"+codeString+"'"); + } + public String toCode(SlotStatus code) { + if (code == SlotStatus.BUSY) + return "busy"; + if (code == SlotStatus.FREE) + return "free"; + if (code == SlotStatus.BUSYUNAVAILABLE) + return "busy-unavailable"; + if (code == SlotStatus.BUSYTENTATIVE) + return "busy-tentative"; + return "?"; + } + public String toSystem(SlotStatus code) { + return code.getSystem(); + } + } + + /** + * External Ids for this item. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) + protected List identifier; + + /** + * A broad categorisation of the service that is to be performed during this appointment. + */ + @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="A broad categorisation of the service that is to be performed during this appointment", formalDefinition="A broad categorisation of the service that is to be performed during this appointment." ) + protected CodeableConcept serviceCategory; + + /** + * The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. + */ + @Child(name = "serviceType", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource", formalDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource." ) + protected List serviceType; + + /** + * The specialty of a practitioner that would be required to perform the service requested in this appointment. + */ + @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment", formalDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment." ) + protected List specialty; + + /** + * The style of appointment or patient that has been booked in the slot (not service type). + */ + @Child(name = "appointmentType", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The style of appointment or patient that has been booked in the slot (not service type)", formalDefinition="The style of appointment or patient that has been booked in the slot (not service type)." ) + protected CodeableConcept appointmentType; + + /** + * The schedule resource that this slot defines an interval of status information. + */ + @Child(name = "schedule", type = {Schedule.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The schedule resource that this slot defines an interval of status information", formalDefinition="The schedule resource that this slot defines an interval of status information." ) + protected Reference schedule; + + /** + * The actual object that is the target of the reference (The schedule resource that this slot defines an interval of status information.) + */ + protected Schedule scheduleTarget; + + /** + * busy | free | busy-unavailable | busy-tentative. + */ + @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="busy | free | busy-unavailable | busy-tentative", formalDefinition="busy | free | busy-unavailable | busy-tentative." ) + protected Enumeration status; + + /** + * Date/Time that the slot is to begin. + */ + @Child(name = "start", type = {InstantType.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date/Time that the slot is to begin", formalDefinition="Date/Time that the slot is to begin." ) + protected InstantType start; + + /** + * Date/Time that the slot is to conclude. + */ + @Child(name = "end", type = {InstantType.class}, order=8, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date/Time that the slot is to conclude", formalDefinition="Date/Time that the slot is to conclude." ) + protected InstantType end; + + /** + * This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + @Child(name = "overbooked", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time", formalDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time." ) + protected BooleanType overbooked; + + /** + * Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + @Child(name = "comment", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot", formalDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot." ) + protected StringType comment; + + private static final long serialVersionUID = 2085594970L; + + /** + * Constructor + */ + public Slot() { + super(); + } + + /** + * Constructor + */ + public Slot(Reference schedule, Enumeration status, InstantType start, InstantType end) { + super(); + this.schedule = schedule; + this.status = status; + this.start = start; + this.end = end; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + 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} (External Ids for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Slot addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) + */ + public CodeableConcept getServiceCategory() { + if (this.serviceCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.serviceCategory"); + else if (Configuration.doAutoCreate()) + this.serviceCategory = new CodeableConcept(); // cc + return this.serviceCategory; + } + + public boolean hasServiceCategory() { + return this.serviceCategory != null && !this.serviceCategory.isEmpty(); + } + + /** + * @param value {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) + */ + public Slot setServiceCategory(CodeableConcept value) { + this.serviceCategory = value; + return this; + } + + /** + * @return {@link #serviceType} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) + */ + public List getServiceType() { + if (this.serviceType == null) + this.serviceType = new ArrayList(); + return this.serviceType; + } + + public boolean hasServiceType() { + if (this.serviceType == null) + return false; + for (CodeableConcept item : this.serviceType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceType} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) + */ + // syntactic sugar + public CodeableConcept addServiceType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return t; + } + + // syntactic sugar + public Slot addServiceType(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return this; + } + + /** + * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + // syntactic sugar + public Slot addSpecialty(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return this; + } + + /** + * @return {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).) + */ + public CodeableConcept getAppointmentType() { + if (this.appointmentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.appointmentType"); + else if (Configuration.doAutoCreate()) + this.appointmentType = new CodeableConcept(); // cc + return this.appointmentType; + } + + public boolean hasAppointmentType() { + return this.appointmentType != null && !this.appointmentType.isEmpty(); + } + + /** + * @param value {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).) + */ + public Slot setAppointmentType(CodeableConcept value) { + this.appointmentType = value; + return this; + } + + /** + * @return {@link #schedule} (The schedule resource that this slot defines an interval of status information.) + */ + public Reference getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Reference(); // cc + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (The schedule resource that this slot defines an interval of status information.) + */ + public Slot setSchedule(Reference value) { + this.schedule = value; + return this; + } + + /** + * @return {@link #schedule} 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 schedule resource that this slot defines an interval of status information.) + */ + public Schedule getScheduleTarget() { + if (this.scheduleTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.schedule"); + else if (Configuration.doAutoCreate()) + this.scheduleTarget = new Schedule(); // aa + return this.scheduleTarget; + } + + /** + * @param value {@link #schedule} 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 schedule resource that this slot defines an interval of status information.) + */ + public Slot setScheduleTarget(Schedule value) { + this.scheduleTarget = value; + return this; + } + + /** + * @return {@link #status} (busy | free | busy-unavailable | busy-tentative.). 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 Slot.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new SlotStatusEnumFactory()); // bb + 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} (busy | free | busy-unavailable | busy-tentative.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Slot setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return busy | free | busy-unavailable | busy-tentative. + */ + public SlotStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value busy | free | busy-unavailable | busy-tentative. + */ + public Slot setStatus(SlotStatus value) { + if (this.status == null) + this.status = new Enumeration(new SlotStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); // bb + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Slot setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return Date/Time that the slot is to begin. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value Date/Time that the slot is to begin. + */ + public Slot setStart(Date value) { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Slot setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return Date/Time that the slot is to conclude. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value Date/Time that the slot is to conclude. + */ + public Slot setEnd(Date value) { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + return this; + } + + /** + * @return {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value + */ + public BooleanType getOverbookedElement() { + if (this.overbooked == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.overbooked"); + else if (Configuration.doAutoCreate()) + this.overbooked = new BooleanType(); // bb + return this.overbooked; + } + + public boolean hasOverbookedElement() { + return this.overbooked != null && !this.overbooked.isEmpty(); + } + + public boolean hasOverbooked() { + return this.overbooked != null && !this.overbooked.isEmpty(); + } + + /** + * @param value {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value + */ + public Slot setOverbookedElement(BooleanType value) { + this.overbooked = value; + return this; + } + + /** + * @return This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + public boolean getOverbooked() { + return this.overbooked == null || this.overbooked.isEmpty() ? false : this.overbooked.getValue(); + } + + /** + * @param value This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + public Slot setOverbooked(boolean value) { + if (this.overbooked == null) + this.overbooked = new BooleanType(); + this.overbooked.setValue(value); + return this; + } + + /** + * @return {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Slot setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + public Slot setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("serviceCategory", "CodeableConcept", "A broad categorisation of the service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); + childrenList.add(new Property("serviceType", "CodeableConcept", "The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.", 0, java.lang.Integer.MAX_VALUE, serviceType)); + childrenList.add(new Property("specialty", "CodeableConcept", "The specialty of a practitioner that would be required to perform the service requested in this appointment.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("appointmentType", "CodeableConcept", "The style of appointment or patient that has been booked in the slot (not service type).", 0, java.lang.Integer.MAX_VALUE, appointmentType)); + childrenList.add(new Property("schedule", "Reference(Schedule)", "The schedule resource that this slot defines an interval of status information.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("status", "code", "busy | free | busy-unavailable | busy-tentative.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("start", "instant", "Date/Time that the slot is to begin.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "Date/Time that the slot is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("overbooked", "boolean", "This slot has already been overbooked, appointments are unlikely to be accepted for this time.", 0, java.lang.Integer.MAX_VALUE, overbooked)); + childrenList.add(new Property("comment", "string", "Comments on the slot to describe any extended information. Such as custom constraints on the slot.", 0, java.lang.Integer.MAX_VALUE, comment)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept + case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept + case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept + case -1596426375: /*appointmentType*/ return this.appointmentType == null ? new Base[0] : new Base[] {this.appointmentType}; // CodeableConcept + case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // InstantType + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType + case 2068545308: /*overbooked*/ return this.overbooked == null ? new Base[0] : new Base[] {this.overbooked}; // BooleanType + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 1281188563: // serviceCategory + this.serviceCategory = castToCodeableConcept(value); // CodeableConcept + break; + case -1928370289: // serviceType + this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1694759682: // specialty + this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1596426375: // appointmentType + this.appointmentType = castToCodeableConcept(value); // CodeableConcept + break; + case -697920873: // schedule + this.schedule = castToReference(value); // Reference + break; + case -892481550: // status + this.status = new SlotStatusEnumFactory().fromType(value); // Enumeration + break; + case 109757538: // start + this.start = castToInstant(value); // InstantType + break; + case 100571: // end + this.end = castToInstant(value); // InstantType + break; + case 2068545308: // overbooked + this.overbooked = castToBoolean(value); // BooleanType + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("serviceCategory")) + this.serviceCategory = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("serviceType")) + this.getServiceType().add(castToCodeableConcept(value)); + else if (name.equals("specialty")) + this.getSpecialty().add(castToCodeableConcept(value)); + else if (name.equals("appointmentType")) + this.appointmentType = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("schedule")) + this.schedule = castToReference(value); // Reference + else if (name.equals("status")) + this.status = new SlotStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("start")) + this.start = castToInstant(value); // InstantType + else if (name.equals("end")) + this.end = castToInstant(value); // InstantType + else if (name.equals("overbooked")) + this.overbooked = castToBoolean(value); // BooleanType + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 1281188563: return getServiceCategory(); // CodeableConcept + case -1928370289: return addServiceType(); // CodeableConcept + case -1694759682: return addSpecialty(); // CodeableConcept + case -1596426375: return getAppointmentType(); // CodeableConcept + case -697920873: return getSchedule(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // InstantType + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType + case 2068545308: throw new FHIRException("Cannot make property overbooked as it is not a complex type"); // BooleanType + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("serviceCategory")) { + this.serviceCategory = new CodeableConcept(); + return this.serviceCategory; + } + else if (name.equals("serviceType")) { + return addServiceType(); + } + else if (name.equals("specialty")) { + return addSpecialty(); + } + else if (name.equals("appointmentType")) { + this.appointmentType = new CodeableConcept(); + return this.appointmentType; + } + else if (name.equals("schedule")) { + this.schedule = new Reference(); + return this.schedule; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Slot.status"); + } + else if (name.equals("start")) { + throw new FHIRException("Cannot call addChild on a primitive type Slot.start"); + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type Slot.end"); + } + else if (name.equals("overbooked")) { + throw new FHIRException("Cannot call addChild on a primitive type Slot.overbooked"); + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type Slot.comment"); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Slot"; + + } + + public Slot copy() { + Slot dst = new Slot(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); + if (serviceType != null) { + dst.serviceType = new ArrayList(); + for (CodeableConcept i : serviceType) + dst.serviceType.add(i.copy()); + }; + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + dst.appointmentType = appointmentType == null ? null : appointmentType.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + dst.status = status == null ? null : status.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + dst.overbooked = overbooked == null ? null : overbooked.copy(); + dst.comment = comment == null ? null : comment.copy(); + return dst; + } + + protected Slot typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Slot)) + return false; + Slot o = (Slot) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(serviceCategory, o.serviceCategory, true) + && compareDeep(serviceType, o.serviceType, true) && compareDeep(specialty, o.specialty, true) && compareDeep(appointmentType, o.appointmentType, true) + && compareDeep(schedule, o.schedule, true) && compareDeep(status, o.status, true) && compareDeep(start, o.start, true) + && compareDeep(end, o.end, true) && compareDeep(overbooked, o.overbooked, true) && compareDeep(comment, o.comment, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Slot)) + return false; + Slot o = (Slot) other; + return compareValues(status, o.status, true) && compareValues(start, o.start, true) && compareValues(end, o.end, true) + && compareValues(overbooked, o.overbooked, true) && compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty()) + && (serviceType == null || serviceType.isEmpty()) && (specialty == null || specialty.isEmpty()) + && (appointmentType == null || appointmentType.isEmpty()) && (schedule == null || schedule.isEmpty()) + && (status == null || status.isEmpty()) && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + && (overbooked == null || overbooked.isEmpty()) && (comment == null || comment.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Slot; + } + + /** + * Search parameter: schedule + *

+ * Description: The Schedule Resource that we are seeking a slot within
+ * Type: reference
+ * Path: Slot.schedule
+ *

+ */ + @SearchParamDefinition(name="schedule", path="Slot.schedule", description="The Schedule Resource that we are seeking a slot within", type="reference" ) + public static final String SP_SCHEDULE = "schedule"; + /** + * Fluent Client search parameter constant for schedule + *

+ * Description: The Schedule Resource that we are seeking a slot within
+ * Type: reference
+ * Path: Slot.schedule
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SCHEDULE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SCHEDULE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Slot:schedule". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SCHEDULE = new ca.uhn.fhir.model.api.Include("Slot:schedule").toLocked(); + + /** + * Search parameter: status + *

+ * Description: The free/busy status of the appointment
+ * Type: token
+ * Path: Slot.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Slot.status", description="The free/busy status of the appointment", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The free/busy status of the appointment
+ * Type: token
+ * Path: Slot.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: start + *

+ * Description: Appointment date/time.
+ * Type: date
+ * Path: Slot.start
+ *

+ */ + @SearchParamDefinition(name="start", path="Slot.start", description="Appointment date/time.", type="date" ) + public static final String SP_START = "start"; + /** + * Fluent Client search parameter constant for start + *

+ * Description: Appointment date/time.
+ * Type: date
+ * Path: Slot.start
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam START = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_START); + + /** + * Search parameter: slot-type + *

+ * Description: The type of appointments that can be booked into the slot
+ * Type: token
+ * Path: Slot.serviceType
+ *

+ */ + @SearchParamDefinition(name="slot-type", path="Slot.serviceType", description="The type of appointments that can be booked into the slot", type="token" ) + public static final String SP_SLOT_TYPE = "slot-type"; + /** + * Fluent Client search parameter constant for slot-type + *

+ * Description: The type of appointments that can be booked into the slot
+ * Type: token
+ * Path: Slot.serviceType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam SLOT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SLOT_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: A Slot Identifier
+ * Type: token
+ * Path: Slot.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Slot.identifier", description="A Slot Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: A Slot Identifier
+ * Type: token
+ * Path: Slot.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Specimen.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Specimen.java new file mode 100644 index 00000000000..6d796b56587 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Specimen.java @@ -0,0 +1,2280 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A sample to be used for analysis. + */ +@ResourceDef(name="Specimen", profile="http://hl7.org/fhir/Profile/Specimen") +public class Specimen extends DomainResource { + + public enum SpecimenStatus { + /** + * The physical specimen is present and in good condition. + */ + AVAILABLE, + /** + * There is no physical specimen because it is either lost, destroyed or consumed. + */ + UNAVAILABLE, + /** + * The specimen cannot be used because of a quality issue such as a broken container, contamination, or too old. + */ + UNSATISFACTORY, + /** + * The specimen was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static SpecimenStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("available".equals(codeString)) + return AVAILABLE; + if ("unavailable".equals(codeString)) + return UNAVAILABLE; + if ("unsatisfactory".equals(codeString)) + return UNSATISFACTORY; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown SpecimenStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case AVAILABLE: return "available"; + case UNAVAILABLE: return "unavailable"; + case UNSATISFACTORY: return "unsatisfactory"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AVAILABLE: return "http://hl7.org/fhir/specimen-status"; + case UNAVAILABLE: return "http://hl7.org/fhir/specimen-status"; + case UNSATISFACTORY: return "http://hl7.org/fhir/specimen-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/specimen-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AVAILABLE: return "The physical specimen is present and in good condition."; + case UNAVAILABLE: return "There is no physical specimen because it is either lost, destroyed or consumed."; + case UNSATISFACTORY: return "The specimen cannot be used because of a quality issue such as a broken container, contamination, or too old."; + case ENTEREDINERROR: return "The specimen was entered in error and therefore nullified."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AVAILABLE: return "Available"; + case UNAVAILABLE: return "Unavailable"; + case UNSATISFACTORY: return "Unsatisfactory"; + case ENTEREDINERROR: return "Entered-in-error"; + default: return "?"; + } + } + } + + public static class SpecimenStatusEnumFactory implements EnumFactory { + public SpecimenStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("available".equals(codeString)) + return SpecimenStatus.AVAILABLE; + if ("unavailable".equals(codeString)) + return SpecimenStatus.UNAVAILABLE; + if ("unsatisfactory".equals(codeString)) + return SpecimenStatus.UNSATISFACTORY; + if ("entered-in-error".equals(codeString)) + return SpecimenStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown SpecimenStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("available".equals(codeString)) + return new Enumeration(this, SpecimenStatus.AVAILABLE); + if ("unavailable".equals(codeString)) + return new Enumeration(this, SpecimenStatus.UNAVAILABLE); + if ("unsatisfactory".equals(codeString)) + return new Enumeration(this, SpecimenStatus.UNSATISFACTORY); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, SpecimenStatus.ENTEREDINERROR); + throw new FHIRException("Unknown SpecimenStatus code '"+codeString+"'"); + } + public String toCode(SpecimenStatus code) { + if (code == SpecimenStatus.AVAILABLE) + return "available"; + if (code == SpecimenStatus.UNAVAILABLE) + return "unavailable"; + if (code == SpecimenStatus.UNSATISFACTORY) + return "unsatisfactory"; + if (code == SpecimenStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(SpecimenStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class SpecimenCollectionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Person who collected the specimen. + */ + @Child(name = "collector", type = {Practitioner.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who collected the specimen", formalDefinition="Person who collected the specimen." ) + protected Reference collector; + + /** + * The actual object that is the target of the reference (Person who collected the specimen.) + */ + protected Practitioner collectorTarget; + + /** + * To communicate any details or issues encountered during the specimen collection procedure. + */ + @Child(name = "comment", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Collector comments", formalDefinition="To communicate any details or issues encountered during the specimen collection procedure." ) + protected StringType comment; + + /** + * Time when specimen was collected from subject - the physiologically relevant time. + */ + @Child(name = "collected", type = {DateTimeType.class, Period.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Collection time", formalDefinition="Time when specimen was collected from subject - the physiologically relevant time." ) + protected Type collected; + + /** + * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The quantity of specimen collected", formalDefinition="The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample." ) + protected SimpleQuantity quantity; + + /** + * A coded value specifying the technique that is used to perform the procedure. + */ + @Child(name = "method", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Technique used to perform collection", formalDefinition="A coded value specifying the technique that is used to perform the procedure." ) + protected CodeableConcept method; + + /** + * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens. + */ + @Child(name = "bodySite", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Anatomical collection site", formalDefinition="Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens." ) + protected CodeableConcept bodySite; + + private static final long serialVersionUID = 2083688215L; + + /** + * Constructor + */ + public SpecimenCollectionComponent() { + super(); + } + + /** + * @return {@link #collector} (Person who collected the specimen.) + */ + public Reference getCollector() { + if (this.collector == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); + else if (Configuration.doAutoCreate()) + this.collector = new Reference(); // cc + return this.collector; + } + + public boolean hasCollector() { + return this.collector != null && !this.collector.isEmpty(); + } + + /** + * @param value {@link #collector} (Person who collected the specimen.) + */ + public SpecimenCollectionComponent setCollector(Reference value) { + this.collector = value; + return this; + } + + /** + * @return {@link #collector} 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 collected the specimen.) + */ + public Practitioner getCollectorTarget() { + if (this.collectorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); + else if (Configuration.doAutoCreate()) + this.collectorTarget = new Practitioner(); // aa + return this.collectorTarget; + } + + /** + * @param value {@link #collector} 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 collected the specimen.) + */ + public SpecimenCollectionComponent setCollectorTarget(Practitioner value) { + this.collectorTarget = value; + return this; + } + + /** + * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); // bb + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public SpecimenCollectionComponent setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return To communicate any details or issues encountered during the specimen collection procedure. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value To communicate any details or issues encountered during the specimen collection procedure. + */ + public SpecimenCollectionComponent setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public Type getCollected() { + return this.collected; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public DateTimeType getCollectedDateTimeType() throws FHIRException { + if (!(this.collected instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.collected.getClass().getName()+" was encountered"); + return (DateTimeType) this.collected; + } + + public boolean hasCollectedDateTimeType() { + return this.collected instanceof DateTimeType; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public Period getCollectedPeriod() throws FHIRException { + if (!(this.collected instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.collected.getClass().getName()+" was encountered"); + return (Period) this.collected; + } + + public boolean hasCollectedPeriod() { + return this.collected instanceof Period; + } + + public boolean hasCollected() { + return this.collected != null && !this.collected.isEmpty(); + } + + /** + * @param value {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public SpecimenCollectionComponent setCollected(Type value) { + this.collected = value; + return this; + } + + /** + * @return {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) + */ + public SpecimenCollectionComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #method} (A coded value specifying the technique that is used to perform the procedure.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); // cc + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value specifying the technique that is used to perform the procedure.) + */ + public SpecimenCollectionComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) + */ + public CodeableConcept getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new CodeableConcept(); // cc + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) + */ + public SpecimenCollectionComponent setBodySite(CodeableConcept value) { + this.bodySite = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("collector", "Reference(Practitioner)", "Person who collected the specimen.", 0, java.lang.Integer.MAX_VALUE, collector)); + childrenList.add(new Property("comment", "string", "To communicate any details or issues encountered during the specimen collection procedure.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("collected[x]", "dateTime|Period", "Time when specimen was collected from subject - the physiologically relevant time.", 0, java.lang.Integer.MAX_VALUE, collected)); + childrenList.add(new Property("quantity", "SimpleQuantity", "The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value specifying the technique that is used to perform the procedure.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1883491469: /*collector*/ return this.collector == null ? new Base[0] : new Base[] {this.collector}; // Reference + case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType + case 1883491145: /*collected*/ return this.collected == null ? new Base[0] : new Base[] {this.collected}; // Type + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1883491469: // collector + this.collector = castToReference(value); // Reference + break; + case 950398559: // comment + this.comment = castToString(value); // StringType + break; + case 1883491145: // collected + this.collected = (Type) value; // Type + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -1077554975: // method + this.method = castToCodeableConcept(value); // CodeableConcept + break; + case 1702620169: // bodySite + this.bodySite = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("collector")) + this.collector = castToReference(value); // Reference + else if (name.equals("comment")) + this.comment = castToString(value); // StringType + else if (name.equals("collected[x]")) + this.collected = (Type) value; // Type + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("method")) + this.method = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("bodySite")) + this.bodySite = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1883491469: return getCollector(); // Reference + case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType + case 1632037015: return getCollected(); // Type + case -1285004149: return getQuantity(); // SimpleQuantity + case -1077554975: return getMethod(); // CodeableConcept + case 1702620169: return getBodySite(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("collector")) { + this.collector = new Reference(); + return this.collector; + } + else if (name.equals("comment")) { + throw new FHIRException("Cannot call addChild on a primitive type Specimen.comment"); + } + else if (name.equals("collectedDateTime")) { + this.collected = new DateTimeType(); + return this.collected; + } + else if (name.equals("collectedPeriod")) { + this.collected = new Period(); + return this.collected; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("method")) { + this.method = new CodeableConcept(); + return this.method; + } + else if (name.equals("bodySite")) { + this.bodySite = new CodeableConcept(); + return this.bodySite; + } + else + return super.addChild(name); + } + + public SpecimenCollectionComponent copy() { + SpecimenCollectionComponent dst = new SpecimenCollectionComponent(); + copyValues(dst); + dst.collector = collector == null ? null : collector.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.collected = collected == null ? null : collected.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.method = method == null ? null : method.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SpecimenCollectionComponent)) + return false; + SpecimenCollectionComponent o = (SpecimenCollectionComponent) other; + return compareDeep(collector, o.collector, true) && compareDeep(comment, o.comment, true) && compareDeep(collected, o.collected, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(method, o.method, true) && compareDeep(bodySite, o.bodySite, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SpecimenCollectionComponent)) + return false; + SpecimenCollectionComponent o = (SpecimenCollectionComponent) other; + return compareValues(comment, o.comment, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (collector == null || collector.isEmpty()) && (comment == null || comment.isEmpty()) + && (collected == null || collected.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (method == null || method.isEmpty()) && (bodySite == null || bodySite.isEmpty()); + } + + public String fhirType() { + return "Specimen.collection"; + + } + + } + + @Block() + public static class SpecimenTreatmentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Textual description of procedure. + */ + @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Textual description of procedure", formalDefinition="Textual description of procedure." ) + protected StringType description; + + /** + * A coded value specifying the procedure used to process the specimen. + */ + @Child(name = "procedure", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Indicates the treatment or processing step applied to the specimen", formalDefinition="A coded value specifying the procedure used to process the specimen." ) + protected CodeableConcept procedure; + + /** + * Material used in the processing step. + */ + @Child(name = "additive", type = {Substance.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Material used in the processing step", formalDefinition="Material used in the processing step." ) + protected List additive; + /** + * The actual objects that are the target of the reference (Material used in the processing step.) + */ + protected List additiveTarget; + + + private static final long serialVersionUID = -373251521L; + + /** + * Constructor + */ + public SpecimenTreatmentComponent() { + super(); + } + + /** + * @return {@link #description} (Textual description of procedure.). 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 SpecimenTreatmentComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SpecimenTreatmentComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Textual description of procedure. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Textual description of procedure. + */ + public SpecimenTreatmentComponent 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 #procedure} (A coded value specifying the procedure used to process the specimen.) + */ + public CodeableConcept getProcedure() { + if (this.procedure == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenTreatmentComponent.procedure"); + else if (Configuration.doAutoCreate()) + this.procedure = new CodeableConcept(); // cc + return this.procedure; + } + + public boolean hasProcedure() { + return this.procedure != null && !this.procedure.isEmpty(); + } + + /** + * @param value {@link #procedure} (A coded value specifying the procedure used to process the specimen.) + */ + public SpecimenTreatmentComponent setProcedure(CodeableConcept value) { + this.procedure = value; + return this; + } + + /** + * @return {@link #additive} (Material used in the processing step.) + */ + public List getAdditive() { + if (this.additive == null) + this.additive = new ArrayList(); + return this.additive; + } + + public boolean hasAdditive() { + if (this.additive == null) + return false; + for (Reference item : this.additive) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additive} (Material used in the processing step.) + */ + // syntactic sugar + public Reference addAdditive() { //3 + Reference t = new Reference(); + if (this.additive == null) + this.additive = new ArrayList(); + this.additive.add(t); + return t; + } + + // syntactic sugar + public SpecimenTreatmentComponent addAdditive(Reference t) { //3 + if (t == null) + return this; + if (this.additive == null) + this.additive = new ArrayList(); + this.additive.add(t); + return this; + } + + /** + * @return {@link #additive} (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. Material used in the processing step.) + */ + public List getAdditiveTarget() { + if (this.additiveTarget == null) + this.additiveTarget = new ArrayList(); + return this.additiveTarget; + } + + // syntactic sugar + /** + * @return {@link #additive} (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. Material used in the processing step.) + */ + public Substance addAdditiveTarget() { + Substance r = new Substance(); + if (this.additiveTarget == null) + this.additiveTarget = new ArrayList(); + this.additiveTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "Textual description of procedure.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("procedure", "CodeableConcept", "A coded value specifying the procedure used to process the specimen.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("additive", "Reference(Substance)", "Material used in the processing step.", 0, java.lang.Integer.MAX_VALUE, additive)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : new Base[] {this.procedure}; // CodeableConcept + case -1226589236: /*additive*/ return this.additive == null ? new Base[0] : this.additive.toArray(new Base[this.additive.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1095204141: // procedure + this.procedure = castToCodeableConcept(value); // CodeableConcept + break; + case -1226589236: // additive + this.getAdditive().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("procedure")) + this.procedure = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("additive")) + this.getAdditive().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1095204141: return getProcedure(); // CodeableConcept + case -1226589236: return addAdditive(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Specimen.description"); + } + else if (name.equals("procedure")) { + this.procedure = new CodeableConcept(); + return this.procedure; + } + else if (name.equals("additive")) { + return addAdditive(); + } + else + return super.addChild(name); + } + + public SpecimenTreatmentComponent copy() { + SpecimenTreatmentComponent dst = new SpecimenTreatmentComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.procedure = procedure == null ? null : procedure.copy(); + if (additive != null) { + dst.additive = new ArrayList(); + for (Reference i : additive) + dst.additive.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SpecimenTreatmentComponent)) + return false; + SpecimenTreatmentComponent o = (SpecimenTreatmentComponent) other; + return compareDeep(description, o.description, true) && compareDeep(procedure, o.procedure, true) + && compareDeep(additive, o.additive, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SpecimenTreatmentComponent)) + return false; + SpecimenTreatmentComponent o = (SpecimenTreatmentComponent) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (procedure == null || procedure.isEmpty()) + && (additive == null || additive.isEmpty()); + } + + public String fhirType() { + return "Specimen.treatment"; + + } + + } + + @Block() + public static class SpecimenContainerComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Id for the container", formalDefinition="Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances." ) + protected List identifier; + + /** + * Textual description of the container. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Textual description of the container", formalDefinition="Textual description of the container." ) + protected StringType description; + + /** + * The type of container associated with the specimen (e.g. slide, aliquot, etc.). + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Kind of container directly associated with specimen", formalDefinition="The type of container associated with the specimen (e.g. slide, aliquot, etc.)." ) + protected CodeableConcept type; + + /** + * The capacity (volume or other measure) the container may contain. + */ + @Child(name = "capacity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Container volume or size", formalDefinition="The capacity (volume or other measure) the container may contain." ) + protected SimpleQuantity capacity; + + /** + * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. + */ + @Child(name = "specimenQuantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Quantity of specimen within container", formalDefinition="The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type." ) + protected SimpleQuantity specimenQuantity; + + /** + * Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. + */ + @Child(name = "additive", type = {CodeableConcept.class, Substance.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Additive associated with container", formalDefinition="Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA." ) + protected Type additive; + + private static final long serialVersionUID = 187274879L; + + /** + * Constructor + */ + public SpecimenContainerComponent() { + super(); + } + + /** + * @return {@link #identifier} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) + */ + 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} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public SpecimenContainerComponent addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #description} (Textual description of the container.). 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 SpecimenContainerComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SpecimenContainerComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Textual description of the container. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Textual description of the container. + */ + public SpecimenContainerComponent 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 #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc.).) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc.).) + */ + public SpecimenContainerComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #capacity} (The capacity (volume or other measure) the container may contain.) + */ + public SimpleQuantity getCapacity() { + if (this.capacity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.capacity"); + else if (Configuration.doAutoCreate()) + this.capacity = new SimpleQuantity(); // cc + return this.capacity; + } + + public boolean hasCapacity() { + return this.capacity != null && !this.capacity.isEmpty(); + } + + /** + * @param value {@link #capacity} (The capacity (volume or other measure) the container may contain.) + */ + public SpecimenContainerComponent setCapacity(SimpleQuantity value) { + this.capacity = value; + return this; + } + + /** + * @return {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) + */ + public SimpleQuantity getSpecimenQuantity() { + if (this.specimenQuantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.specimenQuantity"); + else if (Configuration.doAutoCreate()) + this.specimenQuantity = new SimpleQuantity(); // cc + return this.specimenQuantity; + } + + public boolean hasSpecimenQuantity() { + return this.specimenQuantity != null && !this.specimenQuantity.isEmpty(); + } + + /** + * @param value {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) + */ + public SpecimenContainerComponent setSpecimenQuantity(SimpleQuantity value) { + this.specimenQuantity = value; + return this; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.) + */ + public Type getAdditive() { + return this.additive; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.) + */ + public CodeableConcept getAdditiveCodeableConcept() throws FHIRException { + if (!(this.additive instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.additive.getClass().getName()+" was encountered"); + return (CodeableConcept) this.additive; + } + + public boolean hasAdditiveCodeableConcept() { + return this.additive instanceof CodeableConcept; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.) + */ + public Reference getAdditiveReference() throws FHIRException { + if (!(this.additive instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.additive.getClass().getName()+" was encountered"); + return (Reference) this.additive; + } + + public boolean hasAdditiveReference() { + return this.additive instanceof Reference; + } + + public boolean hasAdditive() { + return this.additive != null && !this.additive.isEmpty(); + } + + /** + * @param value {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.) + */ + public SpecimenContainerComponent setAdditive(Type value) { + this.additive = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("description", "string", "Textual description of the container.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("type", "CodeableConcept", "The type of container associated with the specimen (e.g. slide, aliquot, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("capacity", "SimpleQuantity", "The capacity (volume or other measure) the container may contain.", 0, java.lang.Integer.MAX_VALUE, capacity)); + childrenList.add(new Property("specimenQuantity", "SimpleQuantity", "The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.", 0, java.lang.Integer.MAX_VALUE, specimenQuantity)); + childrenList.add(new Property("additive[x]", "CodeableConcept|Reference(Substance)", "Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.", 0, java.lang.Integer.MAX_VALUE, additive)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -67824454: /*capacity*/ return this.capacity == null ? new Base[0] : new Base[] {this.capacity}; // SimpleQuantity + case 1485980595: /*specimenQuantity*/ return this.specimenQuantity == null ? new Base[0] : new Base[] {this.specimenQuantity}; // SimpleQuantity + case -1226589236: /*additive*/ return this.additive == null ? new Base[0] : new Base[] {this.additive}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -67824454: // capacity + this.capacity = castToSimpleQuantity(value); // SimpleQuantity + break; + case 1485980595: // specimenQuantity + this.specimenQuantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case -1226589236: // additive + this.additive = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("capacity")) + this.capacity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("specimenQuantity")) + this.specimenQuantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("additive[x]")) + this.additive = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 3575610: return getType(); // CodeableConcept + case -67824454: return getCapacity(); // SimpleQuantity + case 1485980595: return getSpecimenQuantity(); // SimpleQuantity + case 261915956: return getAdditive(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Specimen.description"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("capacity")) { + this.capacity = new SimpleQuantity(); + return this.capacity; + } + else if (name.equals("specimenQuantity")) { + this.specimenQuantity = new SimpleQuantity(); + return this.specimenQuantity; + } + else if (name.equals("additiveCodeableConcept")) { + this.additive = new CodeableConcept(); + return this.additive; + } + else if (name.equals("additiveReference")) { + this.additive = new Reference(); + return this.additive; + } + else + return super.addChild(name); + } + + public SpecimenContainerComponent copy() { + SpecimenContainerComponent dst = new SpecimenContainerComponent(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.type = type == null ? null : type.copy(); + dst.capacity = capacity == null ? null : capacity.copy(); + dst.specimenQuantity = specimenQuantity == null ? null : specimenQuantity.copy(); + dst.additive = additive == null ? null : additive.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SpecimenContainerComponent)) + return false; + SpecimenContainerComponent o = (SpecimenContainerComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(description, o.description, true) + && compareDeep(type, o.type, true) && compareDeep(capacity, o.capacity, true) && compareDeep(specimenQuantity, o.specimenQuantity, true) + && compareDeep(additive, o.additive, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SpecimenContainerComponent)) + return false; + SpecimenContainerComponent o = (SpecimenContainerComponent) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (description == null || description.isEmpty()) + && (type == null || type.isEmpty()) && (capacity == null || capacity.isEmpty()) && (specimenQuantity == null || specimenQuantity.isEmpty()) + && (additive == null || additive.isEmpty()); + } + + public String fhirType() { + return "Specimen.container"; + + } + + } + + /** + * Id for specimen. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External Identifier", formalDefinition="Id for specimen." ) + protected List identifier; + + /** + * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. + */ + @Child(name = "accessionIdentifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier assigned by the lab", formalDefinition="The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures." ) + protected Identifier accessionIdentifier; + + /** + * The availability of the specimen. + */ + @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="available | unavailable | unsatisfactory | entered-in-error", formalDefinition="The availability of the specimen." ) + protected Enumeration status; + + /** + * The kind of material that forms the specimen. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Kind of material that forms the specimen", formalDefinition="The kind of material that forms the specimen." ) + protected CodeableConcept type; + + /** + * Where the specimen came from. This may be from the patient(s) or from the environment or a device. + */ + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Substance.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where the specimen came from. This may be from the patient(s) or from the environment or a device", formalDefinition="Where the specimen came from. This may be from the patient(s) or from the environment or a device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + protected Resource subjectTarget; + + /** + * Time when specimen was received for processing or testing. + */ + @Child(name = "receivedTime", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The time when specimen was received for processing", formalDefinition="Time when specimen was received for processing or testing." ) + protected DateTimeType receivedTime; + + /** + * Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen. + */ + @Child(name = "parent", type = {Specimen.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Specimen from which this specimen originated", formalDefinition="Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen." ) + protected List parent; + /** + * The actual objects that are the target of the reference (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) + */ + protected List parentTarget; + + + /** + * Details concerning the specimen collection. + */ + @Child(name = "collection", type = {}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Collection details", formalDefinition="Details concerning the specimen collection." ) + protected SpecimenCollectionComponent collection; + + /** + * Details concerning treatment and processing steps for the specimen. + */ + @Child(name = "treatment", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Treatment and processing step details", formalDefinition="Details concerning treatment and processing steps for the specimen." ) + protected List treatment; + + /** + * The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. + */ + @Child(name = "container", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Direct container of specimen (tube/slide, etc.)", formalDefinition="The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here." ) + protected List container; + + private static final long serialVersionUID = -374913648L; + + /** + * Constructor + */ + public Specimen() { + super(); + } + + /** + * Constructor + */ + public Specimen(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #identifier} (Id for specimen.) + */ + 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} (Id for specimen.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Specimen addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) + */ + public Identifier getAccessionIdentifier() { + if (this.accessionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.accessionIdentifier"); + else if (Configuration.doAutoCreate()) + this.accessionIdentifier = new Identifier(); // cc + return this.accessionIdentifier; + } + + public boolean hasAccessionIdentifier() { + return this.accessionIdentifier != null && !this.accessionIdentifier.isEmpty(); + } + + /** + * @param value {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) + */ + public Specimen setAccessionIdentifier(Identifier value) { + this.accessionIdentifier = value; + return this; + } + + /** + * @return {@link #status} (The availability of the specimen.). 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 Specimen.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new SpecimenStatusEnumFactory()); // bb + 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 availability of the specimen.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Specimen setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The availability of the specimen. + */ + public SpecimenStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The availability of the specimen. + */ + public Specimen setStatus(SpecimenStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new SpecimenStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The kind of material that forms the specimen.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The kind of material that forms the specimen.) + */ + public Specimen setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subject} (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + public Specimen 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. (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + public Resource getSubjectTarget() { + 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. (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) + */ + public Specimen setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value + */ + public DateTimeType getReceivedTimeElement() { + if (this.receivedTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.receivedTime"); + else if (Configuration.doAutoCreate()) + this.receivedTime = new DateTimeType(); // bb + return this.receivedTime; + } + + public boolean hasReceivedTimeElement() { + return this.receivedTime != null && !this.receivedTime.isEmpty(); + } + + public boolean hasReceivedTime() { + return this.receivedTime != null && !this.receivedTime.isEmpty(); + } + + /** + * @param value {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value + */ + public Specimen setReceivedTimeElement(DateTimeType value) { + this.receivedTime = value; + return this; + } + + /** + * @return Time when specimen was received for processing or testing. + */ + 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(Date value) { + if (value == null) + this.receivedTime = null; + else { + if (this.receivedTime == null) + this.receivedTime = new DateTimeType(); + this.receivedTime.setValue(value); + } + return this; + } + + /** + * @return {@link #parent} (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) + */ + public List getParent() { + if (this.parent == null) + this.parent = new ArrayList(); + return this.parent; + } + + public boolean hasParent() { + if (this.parent == null) + return false; + for (Reference item : this.parent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parent} (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) + */ + // syntactic sugar + public Reference addParent() { //3 + Reference t = new Reference(); + if (this.parent == null) + this.parent = new ArrayList(); + this.parent.add(t); + return t; + } + + // syntactic sugar + public Specimen addParent(Reference t) { //3 + if (t == null) + return this; + if (this.parent == null) + this.parent = new ArrayList(); + this.parent.add(t); + return this; + } + + /** + * @return {@link #parent} (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. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) + */ + public List getParentTarget() { + if (this.parentTarget == null) + this.parentTarget = new ArrayList(); + return this.parentTarget; + } + + // syntactic sugar + /** + * @return {@link #parent} (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. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) + */ + public Specimen addParentTarget() { + Specimen r = new Specimen(); + if (this.parentTarget == null) + this.parentTarget = new ArrayList(); + this.parentTarget.add(r); + return r; + } + + /** + * @return {@link #collection} (Details concerning the specimen collection.) + */ + public SpecimenCollectionComponent getCollection() { + if (this.collection == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.collection"); + else if (Configuration.doAutoCreate()) + this.collection = new SpecimenCollectionComponent(); // cc + return this.collection; + } + + public boolean hasCollection() { + return this.collection != null && !this.collection.isEmpty(); + } + + /** + * @param value {@link #collection} (Details concerning the specimen collection.) + */ + public Specimen setCollection(SpecimenCollectionComponent value) { + this.collection = value; + return this; + } + + /** + * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) + */ + public List getTreatment() { + if (this.treatment == null) + this.treatment = new ArrayList(); + return this.treatment; + } + + public boolean hasTreatment() { + if (this.treatment == null) + return false; + for (SpecimenTreatmentComponent item : this.treatment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) + */ + // syntactic sugar + public SpecimenTreatmentComponent addTreatment() { //3 + SpecimenTreatmentComponent t = new SpecimenTreatmentComponent(); + if (this.treatment == null) + this.treatment = new ArrayList(); + this.treatment.add(t); + return t; + } + + // syntactic sugar + public Specimen addTreatment(SpecimenTreatmentComponent t) { //3 + if (t == null) + return this; + if (this.treatment == null) + this.treatment = new ArrayList(); + this.treatment.add(t); + return this; + } + + /** + * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) + */ + public List getContainer() { + if (this.container == null) + this.container = new ArrayList(); + return this.container; + } + + public boolean hasContainer() { + if (this.container == null) + return false; + for (SpecimenContainerComponent item : this.container) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) + */ + // syntactic sugar + public SpecimenContainerComponent addContainer() { //3 + SpecimenContainerComponent t = new SpecimenContainerComponent(); + if (this.container == null) + this.container = new ArrayList(); + this.container.add(t); + return t; + } + + // syntactic sugar + public Specimen addContainer(SpecimenContainerComponent t) { //3 + if (t == null) + return this; + if (this.container == null) + this.container = new ArrayList(); + this.container.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Id for specimen.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("accessionIdentifier", "Identifier", "The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.", 0, java.lang.Integer.MAX_VALUE, accessionIdentifier)); + childrenList.add(new Property("status", "code", "The availability of the specimen.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "CodeableConcept", "The kind of material that forms the specimen.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Where the specimen came from. This may be from the patient(s) or from the environment or a device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("receivedTime", "dateTime", "Time when specimen was received for processing or testing.", 0, java.lang.Integer.MAX_VALUE, receivedTime)); + childrenList.add(new Property("parent", "Reference(Specimen)", "Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("collection", "", "Details concerning the specimen collection.", 0, java.lang.Integer.MAX_VALUE, collection)); + childrenList.add(new Property("treatment", "", "Details concerning treatment and processing steps for the specimen.", 0, java.lang.Integer.MAX_VALUE, treatment)); + childrenList.add(new Property("container", "", "The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.", 0, java.lang.Integer.MAX_VALUE, container)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 818734061: /*accessionIdentifier*/ return this.accessionIdentifier == null ? new Base[0] : new Base[] {this.accessionIdentifier}; // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case -767961010: /*receivedTime*/ return this.receivedTime == null ? new Base[0] : new Base[] {this.receivedTime}; // DateTimeType + case -995424086: /*parent*/ return this.parent == null ? new Base[0] : this.parent.toArray(new Base[this.parent.size()]); // Reference + case -1741312354: /*collection*/ return this.collection == null ? new Base[0] : new Base[] {this.collection}; // SpecimenCollectionComponent + case -63342472: /*treatment*/ return this.treatment == null ? new Base[0] : this.treatment.toArray(new Base[this.treatment.size()]); // SpecimenTreatmentComponent + case -410956671: /*container*/ return this.container == null ? new Base[0] : this.container.toArray(new Base[this.container.size()]); // SpecimenContainerComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 818734061: // accessionIdentifier + this.accessionIdentifier = castToIdentifier(value); // Identifier + break; + case -892481550: // status + this.status = new SpecimenStatusEnumFactory().fromType(value); // Enumeration + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case -767961010: // receivedTime + this.receivedTime = castToDateTime(value); // DateTimeType + break; + case -995424086: // parent + this.getParent().add(castToReference(value)); // Reference + break; + case -1741312354: // collection + this.collection = (SpecimenCollectionComponent) value; // SpecimenCollectionComponent + break; + case -63342472: // treatment + this.getTreatment().add((SpecimenTreatmentComponent) value); // SpecimenTreatmentComponent + break; + case -410956671: // container + this.getContainer().add((SpecimenContainerComponent) value); // SpecimenContainerComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("accessionIdentifier")) + this.accessionIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("status")) + this.status = new SpecimenStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("receivedTime")) + this.receivedTime = castToDateTime(value); // DateTimeType + else if (name.equals("parent")) + this.getParent().add(castToReference(value)); + else if (name.equals("collection")) + this.collection = (SpecimenCollectionComponent) value; // SpecimenCollectionComponent + else if (name.equals("treatment")) + this.getTreatment().add((SpecimenTreatmentComponent) value); + else if (name.equals("container")) + this.getContainer().add((SpecimenContainerComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 818734061: return getAccessionIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3575610: return getType(); // CodeableConcept + case -1867885268: return getSubject(); // Reference + case -767961010: throw new FHIRException("Cannot make property receivedTime as it is not a complex type"); // DateTimeType + case -995424086: return addParent(); // Reference + case -1741312354: return getCollection(); // SpecimenCollectionComponent + case -63342472: return addTreatment(); // SpecimenTreatmentComponent + case -410956671: return addContainer(); // SpecimenContainerComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("accessionIdentifier")) { + this.accessionIdentifier = new Identifier(); + return this.accessionIdentifier; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Specimen.status"); + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("receivedTime")) { + throw new FHIRException("Cannot call addChild on a primitive type Specimen.receivedTime"); + } + else if (name.equals("parent")) { + return addParent(); + } + else if (name.equals("collection")) { + this.collection = new SpecimenCollectionComponent(); + return this.collection; + } + else if (name.equals("treatment")) { + return addTreatment(); + } + else if (name.equals("container")) { + return addContainer(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Specimen"; + + } + + public Specimen copy() { + Specimen dst = new Specimen(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.accessionIdentifier = accessionIdentifier == null ? null : accessionIdentifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.receivedTime = receivedTime == null ? null : receivedTime.copy(); + if (parent != null) { + dst.parent = new ArrayList(); + for (Reference i : parent) + dst.parent.add(i.copy()); + }; + dst.collection = collection == null ? null : collection.copy(); + if (treatment != null) { + dst.treatment = new ArrayList(); + for (SpecimenTreatmentComponent i : treatment) + dst.treatment.add(i.copy()); + }; + if (container != null) { + dst.container = new ArrayList(); + for (SpecimenContainerComponent i : container) + dst.container.add(i.copy()); + }; + return dst; + } + + protected Specimen typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Specimen)) + return false; + Specimen o = (Specimen) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(accessionIdentifier, o.accessionIdentifier, true) + && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) && compareDeep(subject, o.subject, true) + && compareDeep(receivedTime, o.receivedTime, true) && compareDeep(parent, o.parent, true) && compareDeep(collection, o.collection, true) + && compareDeep(treatment, o.treatment, true) && compareDeep(container, o.container, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Specimen)) + return false; + Specimen o = (Specimen) other; + return compareValues(status, o.status, true) && compareValues(receivedTime, o.receivedTime, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (accessionIdentifier == null || accessionIdentifier.isEmpty()) + && (status == null || status.isEmpty()) && (type == null || type.isEmpty()) && (subject == null || subject.isEmpty()) + && (receivedTime == null || receivedTime.isEmpty()) && (parent == null || parent.isEmpty()) + && (collection == null || collection.isEmpty()) && (treatment == null || treatment.isEmpty()) + && (container == null || container.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Specimen; + } + + /** + * Search parameter: collector + *

+ * Description: Who collected the specimen
+ * Type: reference
+ * Path: Specimen.collection.collector
+ *

+ */ + @SearchParamDefinition(name="collector", path="Specimen.collection.collector", description="Who collected the specimen", type="reference" ) + public static final String SP_COLLECTOR = "collector"; + /** + * Fluent Client search parameter constant for collector + *

+ * Description: Who collected the specimen
+ * Type: reference
+ * Path: Specimen.collection.collector
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COLLECTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COLLECTOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Specimen:collector". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_COLLECTOR = new ca.uhn.fhir.model.api.Include("Specimen:collector").toLocked(); + + /** + * Search parameter: container-id + *

+ * Description: The unique identifier associated with the specimen container
+ * Type: token
+ * Path: Specimen.container.identifier
+ *

+ */ + @SearchParamDefinition(name="container-id", path="Specimen.container.identifier", description="The unique identifier associated with the specimen container", type="token" ) + public static final String SP_CONTAINER_ID = "container-id"; + /** + * Fluent Client search parameter constant for container-id + *

+ * Description: The unique identifier associated with the specimen container
+ * Type: token
+ * Path: Specimen.container.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER_ID); + + /** + * Search parameter: patient + *

+ * Description: The patient the specimen comes from
+ * Type: reference
+ * Path: Specimen.subject
+ *

+ */ + @SearchParamDefinition(name="patient", path="Specimen.subject", description="The patient the specimen comes from", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The patient the specimen comes from
+ * Type: reference
+ * Path: Specimen.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Specimen:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Specimen:patient").toLocked(); + + /** + * Search parameter: bodysite + *

+ * Description: The code for the body site from where the specimen originated
+ * Type: token
+ * Path: Specimen.collection.bodySite
+ *

+ */ + @SearchParamDefinition(name="bodysite", path="Specimen.collection.bodySite", description="The code for the body site from where the specimen originated", type="token" ) + public static final String SP_BODYSITE = "bodysite"; + /** + * Fluent Client search parameter constant for bodysite + *

+ * Description: The code for the body site from where the specimen originated
+ * Type: token
+ * Path: Specimen.collection.bodySite
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODYSITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODYSITE); + + /** + * Search parameter: container + *

+ * Description: The kind of specimen container
+ * Type: token
+ * Path: Specimen.container.type
+ *

+ */ + @SearchParamDefinition(name="container", path="Specimen.container.type", description="The kind of specimen container", type="token" ) + public static final String SP_CONTAINER = "container"; + /** + * Fluent Client search parameter constant for container + *

+ * Description: The kind of specimen container
+ * Type: token
+ * Path: Specimen.container.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER); + + /** + * Search parameter: collected + *

+ * Description: The date the specimen was collected
+ * Type: date
+ * Path: Specimen.collection.collected[x]
+ *

+ */ + @SearchParamDefinition(name="collected", path="Specimen.collection.collected", description="The date the specimen was collected", type="date" ) + public static final String SP_COLLECTED = "collected"; + /** + * Fluent Client search parameter constant for collected + *

+ * Description: The date the specimen was collected
+ * Type: date
+ * Path: Specimen.collection.collected[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam COLLECTED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_COLLECTED); + + /** + * Search parameter: subject + *

+ * Description: The subject of the specimen
+ * Type: reference
+ * Path: Specimen.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Specimen.subject", description="The subject of the specimen", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: The subject of the specimen
+ * Type: reference
+ * Path: Specimen.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Specimen:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Specimen:subject").toLocked(); + + /** + * Search parameter: accession + *

+ * Description: The accession number associated with the specimen
+ * Type: token
+ * Path: Specimen.accessionIdentifier
+ *

+ */ + @SearchParamDefinition(name="accession", path="Specimen.accessionIdentifier", description="The accession number associated with the specimen", type="token" ) + public static final String SP_ACCESSION = "accession"; + /** + * Fluent Client search parameter constant for accession + *

+ * Description: The accession number associated with the specimen
+ * Type: token
+ * Path: Specimen.accessionIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACCESSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACCESSION); + + /** + * Search parameter: parent + *

+ * Description: The parent of the specimen
+ * Type: reference
+ * Path: Specimen.parent
+ *

+ */ + @SearchParamDefinition(name="parent", path="Specimen.parent", description="The parent of the specimen", type="reference" ) + public static final String SP_PARENT = "parent"; + /** + * Fluent Client search parameter constant for parent + *

+ * Description: The parent of the specimen
+ * Type: reference
+ * Path: Specimen.parent
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Specimen:parent". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("Specimen:parent").toLocked(); + + /** + * Search parameter: type + *

+ * Description: The specimen type
+ * Type: token
+ * Path: Specimen.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Specimen.type", description="The specimen type", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The specimen type
+ * Type: token
+ * Path: Specimen.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: identifier + *

+ * Description: The unique identifier associated with the specimen
+ * Type: token
+ * Path: Specimen.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Specimen.identifier", description="The unique identifier associated with the specimen", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The unique identifier associated with the specimen
+ * Type: token
+ * Path: Specimen.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StringType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StringType.java new file mode 100644 index 00000000000..d82a72bc42f --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StringType.java @@ -0,0 +1,95 @@ +/* +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. + +*/ +package org.hl7.fhir.dstu2016may.model; + +import org.apache.commons.lang3.StringUtils; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + + +/** + * Primitive type "string" in FHIR - any sequence of unicode characters less than 1MB in length + */ +@DatatypeDef(name = "string") +public class StringType extends PrimitiveType { + + private static final long serialVersionUID = 3L; + + /** + * Create a new String + */ + public StringType() { + super(); + } + + /** + * Create a new String + */ + public StringType(String theValue) { + setValue(theValue); + } + + /** + * 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(); + } + + @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 String fhirType() { + return "string"; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StructureDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StructureDefinition.java new file mode 100644 index 00000000000..dfc6bb9600c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StructureDefinition.java @@ -0,0 +1,3495 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + */ +@ResourceDef(name="StructureDefinition", profile="http://hl7.org/fhir/Profile/StructureDefinition") +public class StructureDefinition extends DomainResource { + + public enum StructureDefinitionKind { + /** + * A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions. + */ + DATATYPE, + /** + * A resource defined by the FHIR specification. + */ + RESOURCE, + /** + * A logical model - a conceptual package of data that will be mapped to resources for implementation. + */ + LOGICAL, + /** + * added to help the parsers + */ + NULL; + public static StructureDefinitionKind fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("datatype".equals(codeString)) + return DATATYPE; + if ("resource".equals(codeString)) + return RESOURCE; + if ("logical".equals(codeString)) + return LOGICAL; + throw new FHIRException("Unknown StructureDefinitionKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DATATYPE: return "datatype"; + case RESOURCE: return "resource"; + case LOGICAL: return "logical"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DATATYPE: return "http://hl7.org/fhir/structure-definition-kind"; + case RESOURCE: return "http://hl7.org/fhir/structure-definition-kind"; + case LOGICAL: return "http://hl7.org/fhir/structure-definition-kind"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DATATYPE: return "A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions."; + case RESOURCE: return "A resource defined by the FHIR specification."; + case LOGICAL: return "A logical model - a conceptual package of data that will be mapped to resources for implementation."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DATATYPE: return "Data Type"; + case RESOURCE: return "Resource"; + case LOGICAL: return "Logical Model"; + default: return "?"; + } + } + } + + public static class StructureDefinitionKindEnumFactory implements EnumFactory { + public StructureDefinitionKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("datatype".equals(codeString)) + return StructureDefinitionKind.DATATYPE; + if ("resource".equals(codeString)) + return StructureDefinitionKind.RESOURCE; + if ("logical".equals(codeString)) + return StructureDefinitionKind.LOGICAL; + throw new IllegalArgumentException("Unknown StructureDefinitionKind code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("datatype".equals(codeString)) + return new Enumeration(this, StructureDefinitionKind.DATATYPE); + if ("resource".equals(codeString)) + return new Enumeration(this, StructureDefinitionKind.RESOURCE); + if ("logical".equals(codeString)) + return new Enumeration(this, StructureDefinitionKind.LOGICAL); + throw new FHIRException("Unknown StructureDefinitionKind code '"+codeString+"'"); + } + public String toCode(StructureDefinitionKind code) { + if (code == StructureDefinitionKind.DATATYPE) + return "datatype"; + if (code == StructureDefinitionKind.RESOURCE) + return "resource"; + if (code == StructureDefinitionKind.LOGICAL) + return "logical"; + return "?"; + } + public String toSystem(StructureDefinitionKind code) { + return code.getSystem(); + } + } + + public enum ExtensionContext { + /** + * The context is all elements matching a particular resource element path. + */ + RESOURCE, + /** + * The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name). + */ + DATATYPE, + /** + * The context is a particular extension from a particular profile, a uri that identifies the extension definition. + */ + EXTENSION, + /** + * added to help the parsers + */ + NULL; + public static ExtensionContext fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("resource".equals(codeString)) + return RESOURCE; + if ("datatype".equals(codeString)) + return DATATYPE; + if ("extension".equals(codeString)) + return EXTENSION; + throw new FHIRException("Unknown ExtensionContext code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case RESOURCE: return "resource"; + case DATATYPE: return "datatype"; + case EXTENSION: return "extension"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RESOURCE: return "http://hl7.org/fhir/extension-context"; + case DATATYPE: return "http://hl7.org/fhir/extension-context"; + case EXTENSION: return "http://hl7.org/fhir/extension-context"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RESOURCE: return "The context is all elements matching a particular resource element path."; + case DATATYPE: return "The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name)."; + case EXTENSION: return "The context is a particular extension from a particular profile, a uri that identifies the extension definition."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RESOURCE: return "Resource"; + case DATATYPE: return "Datatype"; + case EXTENSION: return "Extension"; + default: return "?"; + } + } + } + + 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; + if ("resource".equals(codeString)) + return ExtensionContext.RESOURCE; + if ("datatype".equals(codeString)) + return ExtensionContext.DATATYPE; + if ("extension".equals(codeString)) + return ExtensionContext.EXTENSION; + throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("resource".equals(codeString)) + return new Enumeration(this, ExtensionContext.RESOURCE); + if ("datatype".equals(codeString)) + return new Enumeration(this, ExtensionContext.DATATYPE); + if ("extension".equals(codeString)) + return new Enumeration(this, ExtensionContext.EXTENSION); + throw new FHIRException("Unknown ExtensionContext code '"+codeString+"'"); + } + public String toCode(ExtensionContext code) { + if (code == ExtensionContext.RESOURCE) + return "resource"; + if (code == ExtensionContext.DATATYPE) + return "datatype"; + if (code == ExtensionContext.EXTENSION) + return "extension"; + return "?"; + } + public String toSystem(ExtensionContext code) { + return code.getSystem(); + } + } + + public enum TypeDerivationRule { + /** + * This definition defines a new type that adds additional elements to the base type + */ + SPECIALIZATION, + /** + * This definition adds additional rules to an existing concrete type + */ + CONSTRAINT, + /** + * added to help the parsers + */ + NULL; + public static TypeDerivationRule fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("specialization".equals(codeString)) + return SPECIALIZATION; + if ("constraint".equals(codeString)) + return CONSTRAINT; + throw new FHIRException("Unknown TypeDerivationRule code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case SPECIALIZATION: return "specialization"; + case CONSTRAINT: return "constraint"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SPECIALIZATION: return "http://hl7.org/fhir/type-derivation-rule"; + case CONSTRAINT: return "http://hl7.org/fhir/type-derivation-rule"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SPECIALIZATION: return "This definition defines a new type that adds additional elements to the base type"; + case CONSTRAINT: return "This definition adds additional rules to an existing concrete type"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SPECIALIZATION: return "Specialization"; + case CONSTRAINT: return "Constraint"; + default: return "?"; + } + } + } + + public static class TypeDerivationRuleEnumFactory implements EnumFactory { + public TypeDerivationRule fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("specialization".equals(codeString)) + return TypeDerivationRule.SPECIALIZATION; + if ("constraint".equals(codeString)) + return TypeDerivationRule.CONSTRAINT; + throw new IllegalArgumentException("Unknown TypeDerivationRule code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("specialization".equals(codeString)) + return new Enumeration(this, TypeDerivationRule.SPECIALIZATION); + if ("constraint".equals(codeString)) + return new Enumeration(this, TypeDerivationRule.CONSTRAINT); + throw new FHIRException("Unknown TypeDerivationRule code '"+codeString+"'"); + } + public String toCode(TypeDerivationRule code) { + if (code == TypeDerivationRule.SPECIALIZATION) + return "specialization"; + if (code == TypeDerivationRule.CONSTRAINT) + return "constraint"; + return "?"; + } + public String toSystem(TypeDerivationRule code) { + return code.getSystem(); + } + } + + @Block() + public static class StructureDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the structure definition. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the structure definition." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public StructureDefinitionContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the structure 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 StructureDefinitionContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the structure definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureDefinitionContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the structure definition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the structure definition. + */ + public StructureDefinitionContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public StructureDefinitionContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the structure definition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public StructureDefinitionContactComponent copy() { + StructureDefinitionContactComponent dst = new StructureDefinitionContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinitionContactComponent)) + return false; + StructureDefinitionContactComponent o = (StructureDefinitionContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinitionContactComponent)) + return false; + StructureDefinitionContactComponent o = (StructureDefinitionContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "StructureDefinition.contact"; + + } + + } + + @Block() + public static class StructureDefinitionMappingComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An Internal id that is used to identify this mapping set when specific mappings are made. + */ + @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." ) + protected IdType identity; + + /** + * An absolute URI that identifies the specification that this mapping is expressed to. + */ + @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." ) + protected UriType uri; + + /** + * A name for the specification that is being mapped to. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @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=4, min=0, max=1, modifier=false, summary=false) + @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; + + private static final long serialVersionUID = 299630820L; + + /** + * Constructor + */ + public StructureDefinitionMappingComponent() { + super(); + } + + /** + * Constructor + */ + public StructureDefinitionMappingComponent(IdType identity) { + super(); + this.identity = identity; + } + + /** + * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); // bb + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public StructureDefinitionMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An Internal id that is used to identify this mapping set when specific mappings are made. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An Internal id that is used to identify this mapping set when specific mappings are made. + */ + public StructureDefinitionMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); // bb + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public StructureDefinitionMappingComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return An absolute URI that identifies the specification that this mapping is expressed to. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value An absolute URI that identifies the specification that this mapping is expressed to. + */ + public StructureDefinitionMappingComponent setUri(String value) { + if (Utilities.noString(value)) + this.uri = null; + else { + if (this.uri == null) + this.uri = new UriType(); + this.uri.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 + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (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 + */ + public StructureDefinitionMappingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name for the specification that is being mapped to. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name for the specification that is being mapped to. + */ + public StructureDefinitionMappingComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); // bb + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StructureDefinitionMappingComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public StructureDefinitionMappingComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, java.lang.Integer.MAX_VALUE, identity)); + childrenList.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); + 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)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType + case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -602415628: /*comments*/ return this.comments == null ? new Base[0] : new Base[] {this.comments}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -135761730: // identity + this.identity = castToId(value); // IdType + break; + case 116076: // uri + this.uri = castToUri(value); // UriType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -602415628: // comments + this.comments = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identity")) + this.identity = castToId(value); // IdType + else if (name.equals("uri")) + this.uri = castToUri(value); // UriType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("comments")) + this.comments = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -135761730: throw new FHIRException("Cannot make property identity as it is not a complex type"); // IdType + case 116076: throw new FHIRException("Cannot make property uri as it is not a complex type"); // UriType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -602415628: throw new FHIRException("Cannot make property comments as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identity")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.identity"); + } + else if (name.equals("uri")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.uri"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.name"); + } + else if (name.equals("comments")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.comments"); + } + else + return super.addChild(name); + } + + public StructureDefinitionMappingComponent copy() { + StructureDefinitionMappingComponent dst = new StructureDefinitionMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.uri = uri == null ? null : uri.copy(); + dst.name = name == null ? null : name.copy(); + dst.comments = comments == null ? null : comments.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinitionMappingComponent)) + return false; + StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other; + return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true) + && compareDeep(comments, o.comments, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinitionMappingComponent)) + return false; + StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other; + return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true) + && compareValues(comments, o.comments, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) + && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); + } + + public String fhirType() { + return "StructureDefinition.mapping"; + + } + + } + + @Block() + public static class StructureDefinitionSnapshotComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Captures constraints on each element within the resource. + */ + @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." ) + protected List element; + + private static final long serialVersionUID = 53896641L; + + /** + * Constructor + */ + public StructureDefinitionSnapshotComponent() { + super(); + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ElementDefinition item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + // syntactic sugar + public ElementDefinition addElement() { //3 + ElementDefinition t = new ElementDefinition(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + // syntactic sugar + public StructureDefinitionSnapshotComponent addElement(ElementDefinition t) { //3 + if (t == null) + return this; + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1662836996: // element + this.getElement().add(castToElementDefinition(value)); // ElementDefinition + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("element")) + this.getElement().add(castToElementDefinition(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1662836996: return addElement(); // ElementDefinition + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("element")) { + return addElement(); + } + else + return super.addChild(name); + } + + public StructureDefinitionSnapshotComponent copy() { + StructureDefinitionSnapshotComponent dst = new StructureDefinitionSnapshotComponent(); + copyValues(dst); + if (element != null) { + dst.element = new ArrayList(); + for (ElementDefinition i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinitionSnapshotComponent)) + return false; + StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other; + return compareDeep(element, o.element, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinitionSnapshotComponent)) + return false; + StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (element == null || element.isEmpty()); + } + + public String fhirType() { + return "StructureDefinition.snapshot"; + + } + + } + + @Block() + public static class StructureDefinitionDifferentialComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Captures constraints on each element within the resource. + */ + @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." ) + protected List element; + + private static final long serialVersionUID = 53896641L; + + /** + * Constructor + */ + public StructureDefinitionDifferentialComponent() { + super(); + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ElementDefinition item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + // syntactic sugar + public ElementDefinition addElement() { //3 + ElementDefinition t = new ElementDefinition(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + // syntactic sugar + public StructureDefinitionDifferentialComponent addElement(ElementDefinition t) { //3 + if (t == null) + return this; + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1662836996: // element + this.getElement().add(castToElementDefinition(value)); // ElementDefinition + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("element")) + this.getElement().add(castToElementDefinition(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1662836996: return addElement(); // ElementDefinition + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("element")) { + return addElement(); + } + else + return super.addChild(name); + } + + public StructureDefinitionDifferentialComponent copy() { + StructureDefinitionDifferentialComponent dst = new StructureDefinitionDifferentialComponent(); + copyValues(dst); + if (element != null) { + dst.element = new ArrayList(); + for (ElementDefinition i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinitionDifferentialComponent)) + return false; + StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other; + return compareDeep(element, o.element, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinitionDifferentialComponent)) + return false; + StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (element == null || element.isEmpty()); + } + + public String fhirType() { + return "StructureDefinition.differential"; + + } + + } + + /** + * An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Absolute URL used to reference this StructureDefinition", formalDefinition="An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Other identifiers for the StructureDefinition", formalDefinition="Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) + protected List identifier; + + /** + * The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical id for this version of the StructureDefinition", formalDefinition="The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually." ) + protected StringType version; + + /** + * A free text natural language name identifying the StructureDefinition. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this StructureDefinition", formalDefinition="A free text natural language name identifying the StructureDefinition." ) + protected StringType name; + + /** + * Defined so that applications can use this name when displaying the value of the extension to the user. + */ + @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Use this name when displaying the value", formalDefinition="Defined so that applications can use this name when displaying the value of the extension to the user." ) + protected StringType display; + + /** + * The status of the StructureDefinition. + */ + @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the StructureDefinition." ) + protected Enumeration status; + + /** + * This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the structure definition. + */ + @Child(name = "publisher", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the structure definition." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for this version of the StructureDefinition", formalDefinition="The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes." ) + protected DateTimeType date; + + /** + * A free text natural language description of the StructureDefinition and its use. + */ + @Child(name = "description", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Natural language description of the StructureDefinition", formalDefinition="A free text natural language description of the StructureDefinition and its use." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions." ) + protected List useContext; + + /** + * Explains why this structure definition is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Scope and Usage this structure definition is for", formalDefinition="Explains why this structure definition is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + @Child(name = "copyright", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) + protected StringType copyright; + + /** + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + */ + @Child(name = "code", type = {Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." ) + protected List code; + + /** + * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. + */ + @Child(name = "fhirVersion", type = {IdType.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="FHIR Version this StructureDefinition targets", formalDefinition="The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version." ) + protected IdType fhirVersion; + + /** + * An external specification that the content is mapped to. + */ + @Child(name = "mapping", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." ) + protected List mapping; + + /** + * Defines the kind of structure that this definition is describing. + */ + @Child(name = "kind", type = {CodeType.class}, order=17, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="datatype | resource | logical", formalDefinition="Defines the kind of structure that this definition is describing." ) + protected Enumeration kind; + + /** + * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + */ + @Child(name = "abstract", type = {BooleanType.class}, order=18, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether the structure is abstract", formalDefinition="Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type." ) + protected BooleanType abstract_; + + /** + * If this is an extension, Identifies the context within FHIR resources where the extension can be used. + */ + @Child(name = "contextType", type = {CodeType.class}, order=19, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="resource | datatype | extension", formalDefinition="If this is an extension, Identifies the context within FHIR resources where the extension can be used." ) + protected Enumeration contextType; + + /** + * Identifies the types of resource or data type elements to which the extension can be applied. + */ + @Child(name = "context", type = {StringType.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Where the extension can be used in instances", formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied." ) + protected List context; + + /** + * The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure. + */ + @Child(name = "baseType", type = {CodeType.class}, order=21, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Any datatype or resource, including abstract ones", formalDefinition="The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure." ) + protected CodeType baseType; + + /** + * An absolute URI that is the base structure from which this type is derived, either by specialization or constraint. + */ + @Child(name = "baseDefinition", type = {UriType.class}, order=22, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Definition that this type is constrained/specialized from", formalDefinition="An absolute URI that is the base structure from which this type is derived, either by specialization or constraint." ) + protected UriType baseDefinition; + + /** + * How the type relates to the baseDefinition. + */ + @Child(name = "derivation", type = {CodeType.class}, order=23, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="specialization | constraint - How relates to base definition", formalDefinition="How the type relates to the baseDefinition." ) + protected Enumeration derivation; + + /** + * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition. + */ + @Child(name = "snapshot", type = {}, order=24, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Snapshot view of the structure", formalDefinition="A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition." ) + protected StructureDefinitionSnapshotComponent snapshot; + + /** + * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. + */ + @Child(name = "differential", type = {}, order=25, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Differential view of the structure", formalDefinition="A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies." ) + protected StructureDefinitionDifferentialComponent differential; + + private static final long serialVersionUID = -1505153076L; + + /** + * Constructor + */ + public StructureDefinition() { + super(); + } + + /** + * Constructor + */ + public StructureDefinition(UriType url, StringType name, Enumeration status, Enumeration kind, BooleanType abstract_) { + super(); + this.url = url; + this.name = name; + this.status = status; + this.kind = kind; + this.abstract_ = abstract_; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StructureDefinition setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. + */ + public StructureDefinition setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + 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} (Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StructureDefinition setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. + */ + public StructureDefinition setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the StructureDefinition.). 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 StructureDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name identifying the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the StructureDefinition. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the StructureDefinition. + */ + public StructureDefinition setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StructureDefinition setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Defined so that applications can use this name when displaying the value of the extension to the user. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Defined so that applications can use this name when displaying the value of the extension to the user. + */ + public StructureDefinition setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the StructureDefinition.). 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 StructureDefinition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public StructureDefinition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the StructureDefinition. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the StructureDefinition. + */ + public StructureDefinition setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public StructureDefinition setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public StructureDefinition setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StructureDefinition setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the structure definition. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the structure definition. + */ + public StructureDefinition setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (StructureDefinitionContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public StructureDefinitionContactComponent addContact() { //3 + StructureDefinitionContactComponent t = new StructureDefinitionContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addContact(StructureDefinitionContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.). 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 StructureDefinition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public StructureDefinition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes. + */ + public StructureDefinition setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the StructureDefinition and its use.). 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 StructureDefinition.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the StructureDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StructureDefinition setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the StructureDefinition and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the StructureDefinition and its use. + */ + public StructureDefinition 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #requirements} (Explains why this structure definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this structure definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StructureDefinition setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this structure definition is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this structure definition is needed and why it's been constrained as it has. + */ + public StructureDefinition setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StructureDefinition setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public StructureDefinition setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (Coding item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) + */ + // syntactic sugar + public Coding addCode() { //3 + Coding t = new Coding(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addCode(Coding t) { //3 + if (t == null) + return this; + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return this; + } + + /** + * @return {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public IdType getFhirVersionElement() { + if (this.fhirVersion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.fhirVersion"); + else if (Configuration.doAutoCreate()) + this.fhirVersion = new IdType(); // bb + return this.fhirVersion; + } + + public boolean hasFhirVersionElement() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + public boolean hasFhirVersion() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + /** + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public StructureDefinition setFhirVersionElement(IdType value) { + this.fhirVersion = value; + return this; + } + + /** + * @return The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. + */ + public String getFhirVersion() { + return this.fhirVersion == null ? null : this.fhirVersion.getValue(); + } + + /** + * @param value The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. + */ + public StructureDefinition setFhirVersion(String value) { + if (Utilities.noString(value)) + this.fhirVersion = null; + else { + if (this.fhirVersion == null) + this.fhirVersion = new IdType(); + this.fhirVersion.setValue(value); + } + return this; + } + + /** + * @return {@link #mapping} (An external specification that the content is mapped to.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (StructureDefinitionMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (An external specification that the content is mapped to.) + */ + // syntactic sugar + public StructureDefinitionMappingComponent addMapping() { //3 + StructureDefinitionMappingComponent t = new StructureDefinitionMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + // syntactic sugar + public StructureDefinition addMapping(StructureDefinitionMappingComponent t) { //3 + if (t == null) + return this; + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return this; + } + + /** + * @return {@link #kind} (Defines the kind of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new StructureDefinitionKindEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Defines the kind of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public StructureDefinition setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return Defines the kind of structure that this definition is describing. + */ + public StructureDefinitionKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value Defines the kind of structure that this definition is describing. + */ + public StructureDefinition setKind(StructureDefinitionKind value) { + if (this.kind == null) + this.kind = new Enumeration(new StructureDefinitionKindEnumFactory()); + this.kind.setValue(value); + return this; + } + + /** + * @return {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public BooleanType getAbstractElement() { + if (this.abstract_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.abstract_"); + else if (Configuration.doAutoCreate()) + this.abstract_ = new BooleanType(); // bb + return this.abstract_; + } + + public boolean hasAbstractElement() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + public boolean hasAbstract() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + /** + * @param value {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public StructureDefinition setAbstractElement(BooleanType value) { + this.abstract_ = value; + return this; + } + + /** + * @return Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + */ + public boolean getAbstract() { + return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); + } + + /** + * @param value Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + */ + public StructureDefinition setAbstract(boolean value) { + if (this.abstract_ == null) + this.abstract_ = new BooleanType(); + this.abstract_.setValue(value); + return this; + } + + /** + * @return {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public Enumeration getContextTypeElement() { + if (this.contextType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.contextType"); + else if (Configuration.doAutoCreate()) + this.contextType = new Enumeration(new ExtensionContextEnumFactory()); // bb + return this.contextType; + } + + public boolean hasContextTypeElement() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + public boolean hasContextType() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + /** + * @param value {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public StructureDefinition setContextTypeElement(Enumeration value) { + this.contextType = value; + return this; + } + + /** + * @return If this is an extension, Identifies the context within FHIR resources where the extension can be used. + */ + public ExtensionContext getContextType() { + return this.contextType == null ? null : this.contextType.getValue(); + } + + /** + * @param value If this is an extension, Identifies the context within FHIR resources where the extension can be used. + */ + public StructureDefinition setContextType(ExtensionContext value) { + if (value == null) + this.contextType = null; + else { + if (this.contextType == null) + this.contextType = new Enumeration(new ExtensionContextEnumFactory()); + this.contextType.setValue(value); + } + return this; + } + + /** + * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public List getContext() { + if (this.context == null) + this.context = new ArrayList(); + return this.context; + } + + public boolean hasContext() { + if (this.context == null) + return false; + for (StringType item : this.context) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + // syntactic sugar + public StringType addContextElement() {//2 + StringType t = new StringType(); + if (this.context == null) + this.context = new ArrayList(); + this.context.add(t); + return t; + } + + /** + * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public StructureDefinition addContext(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.context == null) + this.context = new ArrayList(); + this.context.add(t); + return this; + } + + /** + * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public boolean hasContext(String value) { + if (this.context == null) + return false; + for (StringType v : this.context) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #baseType} (The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure.). This is the underlying object with id, value and extensions. The accessor "getBaseType" gives direct access to the value + */ + public CodeType getBaseTypeElement() { + if (this.baseType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.baseType"); + else if (Configuration.doAutoCreate()) + this.baseType = new CodeType(); // bb + return this.baseType; + } + + public boolean hasBaseTypeElement() { + return this.baseType != null && !this.baseType.isEmpty(); + } + + public boolean hasBaseType() { + return this.baseType != null && !this.baseType.isEmpty(); + } + + /** + * @param value {@link #baseType} (The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure.). This is the underlying object with id, value and extensions. The accessor "getBaseType" gives direct access to the value + */ + public StructureDefinition setBaseTypeElement(CodeType value) { + this.baseType = value; + return this; + } + + /** + * @return The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure. + */ + public String getBaseType() { + return this.baseType == null ? null : this.baseType.getValue(); + } + + /** + * @param value The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure. + */ + public StructureDefinition setBaseType(String value) { + if (Utilities.noString(value)) + this.baseType = null; + else { + if (this.baseType == null) + this.baseType = new CodeType(); + this.baseType.setValue(value); + } + return this; + } + + /** + * @return {@link #baseDefinition} (An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.). This is the underlying object with id, value and extensions. The accessor "getBaseDefinition" gives direct access to the value + */ + public UriType getBaseDefinitionElement() { + if (this.baseDefinition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.baseDefinition"); + else if (Configuration.doAutoCreate()) + this.baseDefinition = new UriType(); // bb + return this.baseDefinition; + } + + public boolean hasBaseDefinitionElement() { + return this.baseDefinition != null && !this.baseDefinition.isEmpty(); + } + + public boolean hasBaseDefinition() { + return this.baseDefinition != null && !this.baseDefinition.isEmpty(); + } + + /** + * @param value {@link #baseDefinition} (An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.). This is the underlying object with id, value and extensions. The accessor "getBaseDefinition" gives direct access to the value + */ + public StructureDefinition setBaseDefinitionElement(UriType value) { + this.baseDefinition = value; + return this; + } + + /** + * @return An absolute URI that is the base structure from which this type is derived, either by specialization or constraint. + */ + public String getBaseDefinition() { + return this.baseDefinition == null ? null : this.baseDefinition.getValue(); + } + + /** + * @param value An absolute URI that is the base structure from which this type is derived, either by specialization or constraint. + */ + public StructureDefinition setBaseDefinition(String value) { + if (Utilities.noString(value)) + this.baseDefinition = null; + else { + if (this.baseDefinition == null) + this.baseDefinition = new UriType(); + this.baseDefinition.setValue(value); + } + return this; + } + + /** + * @return {@link #derivation} (How the type relates to the baseDefinition.). This is the underlying object with id, value and extensions. The accessor "getDerivation" gives direct access to the value + */ + public Enumeration getDerivationElement() { + if (this.derivation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.derivation"); + else if (Configuration.doAutoCreate()) + this.derivation = new Enumeration(new TypeDerivationRuleEnumFactory()); // bb + return this.derivation; + } + + public boolean hasDerivationElement() { + return this.derivation != null && !this.derivation.isEmpty(); + } + + public boolean hasDerivation() { + return this.derivation != null && !this.derivation.isEmpty(); + } + + /** + * @param value {@link #derivation} (How the type relates to the baseDefinition.). This is the underlying object with id, value and extensions. The accessor "getDerivation" gives direct access to the value + */ + public StructureDefinition setDerivationElement(Enumeration value) { + this.derivation = value; + return this; + } + + /** + * @return How the type relates to the baseDefinition. + */ + public TypeDerivationRule getDerivation() { + return this.derivation == null ? null : this.derivation.getValue(); + } + + /** + * @param value How the type relates to the baseDefinition. + */ + public StructureDefinition setDerivation(TypeDerivationRule value) { + if (value == null) + this.derivation = null; + else { + if (this.derivation == null) + this.derivation = new Enumeration(new TypeDerivationRuleEnumFactory()); + this.derivation.setValue(value); + } + return this; + } + + /** + * @return {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.) + */ + public StructureDefinitionSnapshotComponent getSnapshot() { + if (this.snapshot == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.snapshot"); + else if (Configuration.doAutoCreate()) + this.snapshot = new StructureDefinitionSnapshotComponent(); // cc + return this.snapshot; + } + + public boolean hasSnapshot() { + return this.snapshot != null && !this.snapshot.isEmpty(); + } + + /** + * @param value {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.) + */ + public StructureDefinition setSnapshot(StructureDefinitionSnapshotComponent value) { + this.snapshot = value; + return this; + } + + /** + * @return {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.) + */ + public StructureDefinitionDifferentialComponent getDifferential() { + if (this.differential == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureDefinition.differential"); + else if (Configuration.doAutoCreate()) + this.differential = new StructureDefinitionDifferentialComponent(); // cc + return this.differential; + } + + public boolean hasDifferential() { + return this.differential != null && !this.differential.isEmpty(); + } + + /** + * @param value {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.) + */ + public StructureDefinition setDifferential(StructureDefinitionDifferentialComponent value) { + this.differential = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("display", "string", "Defined so that applications can use this name when displaying the value of the extension to the user.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("status", "code", "The status of the StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the structure definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A free text natural language description of the StructureDefinition and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("requirements", "string", "Explains why this structure definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); + childrenList.add(new Property("kind", "code", "Defines the kind of structure that this definition is describing.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("abstract", "boolean", "Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("contextType", "code", "If this is an extension, Identifies the context within FHIR resources where the extension can be used.", 0, java.lang.Integer.MAX_VALUE, contextType)); + childrenList.add(new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context)); + childrenList.add(new Property("baseType", "code", "The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure.", 0, java.lang.Integer.MAX_VALUE, baseType)); + childrenList.add(new Property("baseDefinition", "uri", "An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.", 0, java.lang.Integer.MAX_VALUE, baseDefinition)); + childrenList.add(new Property("derivation", "code", "How the type relates to the baseDefinition.", 0, java.lang.Integer.MAX_VALUE, derivation)); + childrenList.add(new Property("snapshot", "", "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, snapshot)); + childrenList.add(new Property("differential", "", "A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.", 0, java.lang.Integer.MAX_VALUE, differential)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // StructureDefinitionContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding + case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType + case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // StructureDefinitionMappingComponent + case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration + case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : new Base[] {this.abstract_}; // BooleanType + case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration + case 951530927: /*context*/ return this.context == null ? new Base[0] : this.context.toArray(new Base[this.context.size()]); // StringType + case -1721484885: /*baseType*/ return this.baseType == null ? new Base[0] : new Base[] {this.baseType}; // CodeType + case 1139771140: /*baseDefinition*/ return this.baseDefinition == null ? new Base[0] : new Base[] {this.baseDefinition}; // UriType + case -1353885513: /*derivation*/ return this.derivation == null ? new Base[0] : new Base[] {this.derivation}; // Enumeration + case 284874180: /*snapshot*/ return this.snapshot == null ? new Base[0] : new Base[] {this.snapshot}; // StructureDefinitionSnapshotComponent + case -1196150917: /*differential*/ return this.differential == null ? new Base[0] : new Base[] {this.differential}; // StructureDefinitionDifferentialComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 1671764162: // display + this.display = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((StructureDefinitionContactComponent) value); // StructureDefinitionContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case 3059181: // code + this.getCode().add(castToCoding(value)); // Coding + break; + case 461006061: // fhirVersion + this.fhirVersion = castToId(value); // IdType + break; + case 837556430: // mapping + this.getMapping().add((StructureDefinitionMappingComponent) value); // StructureDefinitionMappingComponent + break; + case 3292052: // kind + this.kind = new StructureDefinitionKindEnumFactory().fromType(value); // Enumeration + break; + case 1732898850: // abstract + this.abstract_ = castToBoolean(value); // BooleanType + break; + case -102839927: // contextType + this.contextType = new ExtensionContextEnumFactory().fromType(value); // Enumeration + break; + case 951530927: // context + this.getContext().add(castToString(value)); // StringType + break; + case -1721484885: // baseType + this.baseType = castToCode(value); // CodeType + break; + case 1139771140: // baseDefinition + this.baseDefinition = castToUri(value); // UriType + break; + case -1353885513: // derivation + this.derivation = new TypeDerivationRuleEnumFactory().fromType(value); // Enumeration + break; + case 284874180: // snapshot + this.snapshot = (StructureDefinitionSnapshotComponent) value; // StructureDefinitionSnapshotComponent + break; + case -1196150917: // differential + this.differential = (StructureDefinitionDifferentialComponent) value; // StructureDefinitionDifferentialComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("display")) + this.display = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((StructureDefinitionContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("code")) + this.getCode().add(castToCoding(value)); + else if (name.equals("fhirVersion")) + this.fhirVersion = castToId(value); // IdType + else if (name.equals("mapping")) + this.getMapping().add((StructureDefinitionMappingComponent) value); + else if (name.equals("kind")) + this.kind = new StructureDefinitionKindEnumFactory().fromType(value); // Enumeration + else if (name.equals("abstract")) + this.abstract_ = castToBoolean(value); // BooleanType + else if (name.equals("contextType")) + this.contextType = new ExtensionContextEnumFactory().fromType(value); // Enumeration + else if (name.equals("context")) + this.getContext().add(castToString(value)); + else if (name.equals("baseType")) + this.baseType = castToCode(value); // CodeType + else if (name.equals("baseDefinition")) + this.baseDefinition = castToUri(value); // UriType + else if (name.equals("derivation")) + this.derivation = new TypeDerivationRuleEnumFactory().fromType(value); // Enumeration + else if (name.equals("snapshot")) + this.snapshot = (StructureDefinitionSnapshotComponent) value; // StructureDefinitionSnapshotComponent + else if (name.equals("differential")) + this.differential = (StructureDefinitionDifferentialComponent) value; // StructureDefinitionDifferentialComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return addIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // StructureDefinitionContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case 3059181: return addCode(); // Coding + case 461006061: throw new FHIRException("Cannot make property fhirVersion as it is not a complex type"); // IdType + case 837556430: return addMapping(); // StructureDefinitionMappingComponent + case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration + case 1732898850: throw new FHIRException("Cannot make property abstract as it is not a complex type"); // BooleanType + case -102839927: throw new FHIRException("Cannot make property contextType as it is not a complex type"); // Enumeration + case 951530927: throw new FHIRException("Cannot make property context as it is not a complex type"); // StringType + case -1721484885: throw new FHIRException("Cannot make property baseType as it is not a complex type"); // CodeType + case 1139771140: throw new FHIRException("Cannot make property baseDefinition as it is not a complex type"); // UriType + case -1353885513: throw new FHIRException("Cannot make property derivation as it is not a complex type"); // Enumeration + case 284874180: return getSnapshot(); // StructureDefinitionSnapshotComponent + case -1196150917: return getDifferential(); // StructureDefinitionDifferentialComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.url"); + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.name"); + } + else if (name.equals("display")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.display"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.requirements"); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.copyright"); + } + else if (name.equals("code")) { + return addCode(); + } + else if (name.equals("fhirVersion")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.fhirVersion"); + } + else if (name.equals("mapping")) { + return addMapping(); + } + else if (name.equals("kind")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.kind"); + } + else if (name.equals("abstract")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.abstract"); + } + else if (name.equals("contextType")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.contextType"); + } + else if (name.equals("context")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.context"); + } + else if (name.equals("baseType")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.baseType"); + } + else if (name.equals("baseDefinition")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.baseDefinition"); + } + else if (name.equals("derivation")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.derivation"); + } + else if (name.equals("snapshot")) { + this.snapshot = new StructureDefinitionSnapshotComponent(); + return this.snapshot; + } + else if (name.equals("differential")) { + this.differential = new StructureDefinitionDifferentialComponent(); + return this.differential; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "StructureDefinition"; + + } + + public StructureDefinition copy() { + StructureDefinition dst = new StructureDefinition(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.display = display == null ? null : display.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (StructureDefinitionContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + if (code != null) { + dst.code = new ArrayList(); + for (Coding i : code) + dst.code.add(i.copy()); + }; + dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (StructureDefinitionMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + dst.kind = kind == null ? null : kind.copy(); + dst.abstract_ = abstract_ == null ? null : abstract_.copy(); + dst.contextType = contextType == null ? null : contextType.copy(); + if (context != null) { + dst.context = new ArrayList(); + for (StringType i : context) + dst.context.add(i.copy()); + }; + dst.baseType = baseType == null ? null : baseType.copy(); + dst.baseDefinition = baseDefinition == null ? null : baseDefinition.copy(); + dst.derivation = derivation == null ? null : derivation.copy(); + dst.snapshot = snapshot == null ? null : snapshot.copy(); + dst.differential = differential == null ? null : differential.copy(); + return dst; + } + + protected StructureDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureDefinition)) + return false; + StructureDefinition o = (StructureDefinition) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(display, o.display, true) && compareDeep(status, o.status, true) + && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true) + && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) + && compareDeep(useContext, o.useContext, true) && compareDeep(requirements, o.requirements, true) + && compareDeep(copyright, o.copyright, true) && compareDeep(code, o.code, true) && compareDeep(fhirVersion, o.fhirVersion, true) + && compareDeep(mapping, o.mapping, true) && compareDeep(kind, o.kind, true) && compareDeep(abstract_, o.abstract_, true) + && compareDeep(contextType, o.contextType, true) && compareDeep(context, o.context, true) && compareDeep(baseType, o.baseType, true) + && compareDeep(baseDefinition, o.baseDefinition, true) && compareDeep(derivation, o.derivation, true) + && compareDeep(snapshot, o.snapshot, true) && compareDeep(differential, o.differential, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureDefinition)) + return false; + StructureDefinition o = (StructureDefinition) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(display, o.display, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) + && compareValues(publisher, o.publisher, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true) + && compareValues(requirements, o.requirements, true) && compareValues(copyright, o.copyright, true) + && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(kind, o.kind, true) && compareValues(abstract_, o.abstract_, true) + && compareValues(contextType, o.contextType, true) && compareValues(context, o.context, true) && compareValues(baseType, o.baseType, true) + && compareValues(baseDefinition, o.baseDefinition, true) && compareValues(derivation, o.derivation, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (display == null || display.isEmpty()) + && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) + && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (requirements == null || requirements.isEmpty()) && (copyright == null || copyright.isEmpty()) + && (code == null || code.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) && (mapping == null || mapping.isEmpty()) + && (kind == null || kind.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) && (contextType == null || contextType.isEmpty()) + && (context == null || context.isEmpty()) && (baseType == null || baseType.isEmpty()) && (baseDefinition == null || baseDefinition.isEmpty()) + && (derivation == null || derivation.isEmpty()) && (snapshot == null || snapshot.isEmpty()) + && (differential == null || differential.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.StructureDefinition; + } + + /** + * Search parameter: abstract + *

+ * Description: Whether the structure is abstract
+ * Type: token
+ * Path: StructureDefinition.abstract
+ *

+ */ + @SearchParamDefinition(name="abstract", path="StructureDefinition.abstract", description="Whether the structure is abstract", type="token" ) + public static final String SP_ABSTRACT = "abstract"; + /** + * Fluent Client search parameter constant for abstract + *

+ * Description: Whether the structure is abstract
+ * Type: token
+ * Path: StructureDefinition.abstract
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ABSTRACT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ABSTRACT); + + /** + * Search parameter: status + *

+ * Description: The current status of the profile
+ * Type: token
+ * Path: StructureDefinition.status
+ *

+ */ + @SearchParamDefinition(name="status", path="StructureDefinition.status", description="The current status of the profile", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the profile
+ * Type: token
+ * Path: StructureDefinition.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: experimental + *

+ * Description: If for testing purposes, not real usage
+ * Type: token
+ * Path: StructureDefinition.experimental
+ *

+ */ + @SearchParamDefinition(name="experimental", path="StructureDefinition.experimental", description="If for testing purposes, not real usage", type="token" ) + public static final String SP_EXPERIMENTAL = "experimental"; + /** + * Fluent Client search parameter constant for experimental + *

+ * Description: If for testing purposes, not real usage
+ * Type: token
+ * Path: StructureDefinition.experimental
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL); + + /** + * Search parameter: display + *

+ * Description: Use this name when displaying the value
+ * Type: string
+ * Path: StructureDefinition.display
+ *

+ */ + @SearchParamDefinition(name="display", path="StructureDefinition.display", description="Use this name when displaying the value", type="string" ) + public static final String SP_DISPLAY = "display"; + /** + * Fluent Client search parameter constant for display + *

+ * Description: Use this name when displaying the value
+ * Type: string
+ * Path: StructureDefinition.display
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPLAY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPLAY); + + /** + * Search parameter: ext-context + *

+ * Description: Where the extension can be used in instances
+ * Type: string
+ * Path: StructureDefinition.context
+ *

+ */ + @SearchParamDefinition(name="ext-context", path="StructureDefinition.context", description="Where the extension can be used in instances", type="string" ) + public static final String SP_EXT_CONTEXT = "ext-context"; + /** + * Fluent Client search parameter constant for ext-context + *

+ * Description: Where the extension can be used in instances
+ * Type: string
+ * Path: StructureDefinition.context
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam EXT_CONTEXT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_EXT_CONTEXT); + + /** + * Search parameter: code + *

+ * Description: A code for the profile
+ * Type: token
+ * Path: StructureDefinition.code
+ *

+ */ + @SearchParamDefinition(name="code", path="StructureDefinition.code", description="A code for the profile", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: A code for the profile
+ * Type: token
+ * Path: StructureDefinition.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: date + *

+ * Description: The profile publication date
+ * Type: date
+ * Path: StructureDefinition.date
+ *

+ */ + @SearchParamDefinition(name="date", path="StructureDefinition.date", description="The profile publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The profile publication date
+ * Type: date
+ * Path: StructureDefinition.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: type + *

+ * Description: Any datatype or resource, including abstract ones
+ * Type: token
+ * Path: StructureDefinition.baseType
+ *

+ */ + @SearchParamDefinition(name="type", path="StructureDefinition.baseType", description="Any datatype or resource, including abstract ones", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Any datatype or resource, including abstract ones
+ * Type: token
+ * Path: StructureDefinition.baseType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: url + *

+ * Description: Absolute URL used to reference this StructureDefinition
+ * Type: uri
+ * Path: StructureDefinition.url
+ *

+ */ + @SearchParamDefinition(name="url", path="StructureDefinition.url", description="Absolute URL used to reference this StructureDefinition", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: Absolute URL used to reference this StructureDefinition
+ * Type: uri
+ * Path: StructureDefinition.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: kind + *

+ * Description: datatype | resource | logical
+ * Type: token
+ * Path: StructureDefinition.kind
+ *

+ */ + @SearchParamDefinition(name="kind", path="StructureDefinition.kind", description="datatype | resource | logical", type="token" ) + public static final String SP_KIND = "kind"; + /** + * Fluent Client search parameter constant for kind + *

+ * Description: datatype | resource | logical
+ * Type: token
+ * Path: StructureDefinition.kind
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the profile
+ * Type: token
+ * Path: StructureDefinition.version
+ *

+ */ + @SearchParamDefinition(name="version", path="StructureDefinition.version", description="The version identifier of the profile", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the profile
+ * Type: token
+ * Path: StructureDefinition.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the profile
+ * Type: string
+ * Path: StructureDefinition.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="StructureDefinition.publisher", description="Name of the publisher of the profile", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the profile
+ * Type: string
+ * Path: StructureDefinition.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: derivation + *

+ * Description: specialization | constraint - How relates to base definition
+ * Type: token
+ * Path: StructureDefinition.derivation
+ *

+ */ + @SearchParamDefinition(name="derivation", path="StructureDefinition.derivation", description="specialization | constraint - How relates to base definition", type="token" ) + public static final String SP_DERIVATION = "derivation"; + /** + * Fluent Client search parameter constant for derivation + *

+ * Description: specialization | constraint - How relates to base definition
+ * Type: token
+ * Path: StructureDefinition.derivation
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam DERIVATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DERIVATION); + + /** + * Search parameter: base-path + *

+ * Description: Path that identifies the base element
+ * Type: token
+ * Path: StructureDefinition.snapshot.element.base.path, StructureDefinition.differential.element.base.path
+ *

+ */ + @SearchParamDefinition(name="base-path", path="StructureDefinition.snapshot.element.base.path | StructureDefinition.differential.element.base.path", description="Path that identifies the base element", type="token" ) + public static final String SP_BASE_PATH = "base-path"; + /** + * Fluent Client search parameter constant for base-path + *

+ * Description: Path that identifies the base element
+ * Type: token
+ * Path: StructureDefinition.snapshot.element.base.path, StructureDefinition.differential.element.base.path
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam BASE_PATH = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BASE_PATH); + + /** + * Search parameter: valueset + *

+ * Description: A vocabulary binding reference
+ * Type: reference
+ * Path: StructureDefinition.snapshot.element.binding.valueSet[x]
+ *

+ */ + @SearchParamDefinition(name="valueset", path="StructureDefinition.snapshot.element.binding.valueSet", description="A vocabulary binding reference", type="reference" ) + public static final String SP_VALUESET = "valueset"; + /** + * Fluent Client search parameter constant for valueset + *

+ * Description: A vocabulary binding reference
+ * Type: reference
+ * Path: StructureDefinition.snapshot.element.binding.valueSet[x]
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam VALUESET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_VALUESET); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "StructureDefinition:valueset". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_VALUESET = new ca.uhn.fhir.model.api.Include("StructureDefinition:valueset").toLocked(); + + /** + * Search parameter: context-type + *

+ * Description: resource | datatype | extension
+ * Type: token
+ * Path: StructureDefinition.contextType
+ *

+ */ + @SearchParamDefinition(name="context-type", path="StructureDefinition.contextType", description="resource | datatype | extension", type="token" ) + public static final String SP_CONTEXT_TYPE = "context-type"; + /** + * Fluent Client search parameter constant for context-type + *

+ * Description: resource | datatype | extension
+ * Type: token
+ * Path: StructureDefinition.contextType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the profile
+ * Type: string
+ * Path: StructureDefinition.description
+ *

+ */ + @SearchParamDefinition(name="description", path="StructureDefinition.description", description="Text search in the description of the profile", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the profile
+ * Type: string
+ * Path: StructureDefinition.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: Name of the profile
+ * Type: string
+ * Path: StructureDefinition.name
+ *

+ */ + @SearchParamDefinition(name="name", path="StructureDefinition.name", description="Name of the profile", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the profile
+ * Type: string
+ * Path: StructureDefinition.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: base + *

+ * Description: Definition that this type is constrained/specialized from
+ * Type: uri
+ * Path: StructureDefinition.baseDefinition
+ *

+ */ + @SearchParamDefinition(name="base", path="StructureDefinition.baseDefinition", description="Definition that this type is constrained/specialized from", type="uri" ) + public static final String SP_BASE = "base"; + /** + * Fluent Client search parameter constant for base + *

+ * Description: Definition that this type is constrained/specialized from
+ * Type: uri
+ * Path: StructureDefinition.baseDefinition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam BASE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_BASE); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the structure
+ * Type: token
+ * Path: StructureDefinition.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="StructureDefinition.useContext", description="A use context assigned to the structure", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the structure
+ * Type: token
+ * Path: StructureDefinition.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: path + *

+ * Description: A path that is constrained in the profile
+ * Type: token
+ * Path: StructureDefinition.snapshot.element.path, StructureDefinition.differential.element.path
+ *

+ */ + @SearchParamDefinition(name="path", path="StructureDefinition.snapshot.element.path | StructureDefinition.differential.element.path", description="A path that is constrained in the profile", type="token" ) + public static final String SP_PATH = "path"; + /** + * Fluent Client search parameter constant for path + *

+ * Description: A path that is constrained in the profile
+ * Type: token
+ * Path: StructureDefinition.snapshot.element.path, StructureDefinition.differential.element.path
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATH = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATH); + + /** + * Search parameter: identifier + *

+ * Description: The identifier of the profile
+ * Type: token
+ * Path: StructureDefinition.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="StructureDefinition.identifier", description="The identifier of the profile", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier of the profile
+ * Type: token
+ * Path: StructureDefinition.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StructureMap.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StructureMap.java new file mode 100644 index 00000000000..18a355de319 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/StructureMap.java @@ -0,0 +1,5599 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A Map of relationships between 2 structures that can be used to transform data. + */ +@ResourceDef(name="StructureMap", profile="http://hl7.org/fhir/Profile/StructureMap") +public class StructureMap extends DomainResource { + + public enum StructureMapModelMode { + /** + * This structure describes an instance passed to the mapping engine that is used a source of data + */ + SOURCE, + /** + * This structure describes an instance that the mapping engine may ask for that is used a source of data + */ + QUERIED, + /** + * This structure describes an instance passed to the mapping engine that is used a target of data + */ + TARGET, + /** + * This structure describes an instance that the mapping engine may ask to create that is used a target of data + */ + PRODUCED, + /** + * added to help the parsers + */ + NULL; + public static StructureMapModelMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return SOURCE; + if ("queried".equals(codeString)) + return QUERIED; + if ("target".equals(codeString)) + return TARGET; + if ("produced".equals(codeString)) + return PRODUCED; + throw new FHIRException("Unknown StructureMapModelMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case SOURCE: return "source"; + case QUERIED: return "queried"; + case TARGET: return "target"; + case PRODUCED: return "produced"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SOURCE: return "http://hl7.org/fhir/map-model-mode"; + case QUERIED: return "http://hl7.org/fhir/map-model-mode"; + case TARGET: return "http://hl7.org/fhir/map-model-mode"; + case PRODUCED: return "http://hl7.org/fhir/map-model-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SOURCE: return "This structure describes an instance passed to the mapping engine that is used a source of data"; + case QUERIED: return "This structure describes an instance that the mapping engine may ask for that is used a source of data"; + case TARGET: return "This structure describes an instance passed to the mapping engine that is used a target of data"; + case PRODUCED: return "This structure describes an instance that the mapping engine may ask to create that is used a target of data"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SOURCE: return "Source Structure Definition"; + case QUERIED: return "Queried Structure Definition"; + case TARGET: return "Target Structure Definition"; + case PRODUCED: return "Produced Structure Definition"; + default: return "?"; + } + } + } + + public static class StructureMapModelModeEnumFactory implements EnumFactory { + public StructureMapModelMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return StructureMapModelMode.SOURCE; + if ("queried".equals(codeString)) + return StructureMapModelMode.QUERIED; + if ("target".equals(codeString)) + return StructureMapModelMode.TARGET; + if ("produced".equals(codeString)) + return StructureMapModelMode.PRODUCED; + throw new IllegalArgumentException("Unknown StructureMapModelMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return new Enumeration(this, StructureMapModelMode.SOURCE); + if ("queried".equals(codeString)) + return new Enumeration(this, StructureMapModelMode.QUERIED); + if ("target".equals(codeString)) + return new Enumeration(this, StructureMapModelMode.TARGET); + if ("produced".equals(codeString)) + return new Enumeration(this, StructureMapModelMode.PRODUCED); + throw new FHIRException("Unknown StructureMapModelMode code '"+codeString+"'"); + } + public String toCode(StructureMapModelMode code) { + if (code == StructureMapModelMode.SOURCE) + return "source"; + if (code == StructureMapModelMode.QUERIED) + return "queried"; + if (code == StructureMapModelMode.TARGET) + return "target"; + if (code == StructureMapModelMode.PRODUCED) + return "produced"; + return "?"; + } + public String toSystem(StructureMapModelMode code) { + return code.getSystem(); + } + } + + public enum StructureMapInputMode { + /** + * Names an input instance used a source for mapping + */ + SOURCE, + /** + * Names an instance that is being populated + */ + TARGET, + /** + * added to help the parsers + */ + NULL; + public static StructureMapInputMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return SOURCE; + if ("target".equals(codeString)) + return TARGET; + throw new FHIRException("Unknown StructureMapInputMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case SOURCE: return "source"; + case TARGET: return "target"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SOURCE: return "http://hl7.org/fhir/map-input-mode"; + case TARGET: return "http://hl7.org/fhir/map-input-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SOURCE: return "Names an input instance used a source for mapping"; + case TARGET: return "Names an instance that is being populated"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SOURCE: return "Source Instance"; + case TARGET: return "Target Instance"; + default: return "?"; + } + } + } + + public static class StructureMapInputModeEnumFactory implements EnumFactory { + public StructureMapInputMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return StructureMapInputMode.SOURCE; + if ("target".equals(codeString)) + return StructureMapInputMode.TARGET; + throw new IllegalArgumentException("Unknown StructureMapInputMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("source".equals(codeString)) + return new Enumeration(this, StructureMapInputMode.SOURCE); + if ("target".equals(codeString)) + return new Enumeration(this, StructureMapInputMode.TARGET); + throw new FHIRException("Unknown StructureMapInputMode code '"+codeString+"'"); + } + public String toCode(StructureMapInputMode code) { + if (code == StructureMapInputMode.SOURCE) + return "source"; + if (code == StructureMapInputMode.TARGET) + return "target"; + return "?"; + } + public String toSystem(StructureMapInputMode code) { + return code.getSystem(); + } + } + + public enum StructureMapContextType { + /** + * The context specifies a type + */ + TYPE, + /** + * The context specifies a variable + */ + VARIABLE, + /** + * added to help the parsers + */ + NULL; + public static StructureMapContextType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("type".equals(codeString)) + return TYPE; + if ("variable".equals(codeString)) + return VARIABLE; + throw new FHIRException("Unknown StructureMapContextType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case TYPE: return "type"; + case VARIABLE: return "variable"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case TYPE: return "http://hl7.org/fhir/map-context-type"; + case VARIABLE: return "http://hl7.org/fhir/map-context-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case TYPE: return "The context specifies a type"; + case VARIABLE: return "The context specifies a variable"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case TYPE: return "Type"; + case VARIABLE: return "Variable"; + default: return "?"; + } + } + } + + public static class StructureMapContextTypeEnumFactory implements EnumFactory { + public StructureMapContextType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("type".equals(codeString)) + return StructureMapContextType.TYPE; + if ("variable".equals(codeString)) + return StructureMapContextType.VARIABLE; + throw new IllegalArgumentException("Unknown StructureMapContextType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("type".equals(codeString)) + return new Enumeration(this, StructureMapContextType.TYPE); + if ("variable".equals(codeString)) + return new Enumeration(this, StructureMapContextType.VARIABLE); + throw new FHIRException("Unknown StructureMapContextType code '"+codeString+"'"); + } + public String toCode(StructureMapContextType code) { + if (code == StructureMapContextType.TYPE) + return "type"; + if (code == StructureMapContextType.VARIABLE) + return "variable"; + return "?"; + } + public String toSystem(StructureMapContextType code) { + return code.getSystem(); + } + } + + public enum StructureMapListMode { + /** + * when the target list is being assembled, the items for this rule go first. If more that one rule defines a first item (for a given instance of mapping) then this is an error + */ + FIRST, + /** + * the target instance is shared with the target instances generated by another rule (up to the first common n items, then create new ones) + */ + SHARE, + /** + * when the target list is being assembled, the items for this rule go last. If more that one rule defines a last item (for a given instance of mapping) then this is an error + */ + LAST, + /** + * added to help the parsers + */ + NULL; + public static StructureMapListMode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("first".equals(codeString)) + return FIRST; + if ("share".equals(codeString)) + return SHARE; + if ("last".equals(codeString)) + return LAST; + throw new FHIRException("Unknown StructureMapListMode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case FIRST: return "first"; + case SHARE: return "share"; + case LAST: return "last"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case FIRST: return "http://hl7.org/fhir/map-list-mode"; + case SHARE: return "http://hl7.org/fhir/map-list-mode"; + case LAST: return "http://hl7.org/fhir/map-list-mode"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case FIRST: return "when the target list is being assembled, the items for this rule go first. If more that one rule defines a first item (for a given instance of mapping) then this is an error"; + case SHARE: return "the target instance is shared with the target instances generated by another rule (up to the first common n items, then create new ones)"; + case LAST: return "when the target list is being assembled, the items for this rule go last. If more that one rule defines a last item (for a given instance of mapping) then this is an error"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case FIRST: return "First"; + case SHARE: return "Share"; + case LAST: return "Last"; + default: return "?"; + } + } + } + + public static class StructureMapListModeEnumFactory implements EnumFactory { + public StructureMapListMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("first".equals(codeString)) + return StructureMapListMode.FIRST; + if ("share".equals(codeString)) + return StructureMapListMode.SHARE; + if ("last".equals(codeString)) + return StructureMapListMode.LAST; + throw new IllegalArgumentException("Unknown StructureMapListMode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("first".equals(codeString)) + return new Enumeration(this, StructureMapListMode.FIRST); + if ("share".equals(codeString)) + return new Enumeration(this, StructureMapListMode.SHARE); + if ("last".equals(codeString)) + return new Enumeration(this, StructureMapListMode.LAST); + throw new FHIRException("Unknown StructureMapListMode code '"+codeString+"'"); + } + public String toCode(StructureMapListMode code) { + if (code == StructureMapListMode.FIRST) + return "first"; + if (code == StructureMapListMode.SHARE) + return "share"; + if (code == StructureMapListMode.LAST) + return "last"; + return "?"; + } + public String toSystem(StructureMapListMode code) { + return code.getSystem(); + } + } + + public enum StructureMapTransform { + /** + * create(type : string) - type is passed through to the application on the standard API, and must be known by it + */ + CREATE, + /** + * copy(source) + */ + COPY, + /** + * truncate(source, length) - source must be stringy type + */ + TRUNCATE, + /** + * escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped + */ + ESCAPE, + /** + * cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known + */ + CAST, + /** + * append(source...) - source is element or string + */ + APPEND, + /** + * translate(source, uri_of_map) - use the translate operation + */ + TRANSLATE, + /** + * reference(source : object) - return a string that references the provided tree properly + */ + REFERENCE, + /** + * something + */ + DATEOP, + /** + * something + */ + UUID, + /** + * something + */ + POINTER, + /** + * something + */ + EVALUATE, + /** + * added to help the parsers + */ + NULL; + public static StructureMapTransform fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("create".equals(codeString)) + return CREATE; + if ("copy".equals(codeString)) + return COPY; + if ("truncate".equals(codeString)) + return TRUNCATE; + if ("escape".equals(codeString)) + return ESCAPE; + if ("cast".equals(codeString)) + return CAST; + if ("append".equals(codeString)) + return APPEND; + if ("translate".equals(codeString)) + return TRANSLATE; + if ("reference".equals(codeString)) + return REFERENCE; + if ("dateOp".equals(codeString)) + return DATEOP; + if ("uuid".equals(codeString)) + return UUID; + if ("pointer".equals(codeString)) + return POINTER; + if ("evaluate".equals(codeString)) + return EVALUATE; + throw new FHIRException("Unknown StructureMapTransform code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CREATE: return "create"; + case COPY: return "copy"; + case TRUNCATE: return "truncate"; + case ESCAPE: return "escape"; + case CAST: return "cast"; + case APPEND: return "append"; + case TRANSLATE: return "translate"; + case REFERENCE: return "reference"; + case DATEOP: return "dateOp"; + case UUID: return "uuid"; + case POINTER: return "pointer"; + case EVALUATE: return "evaluate"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CREATE: return "http://hl7.org/fhir/map-transform"; + case COPY: return "http://hl7.org/fhir/map-transform"; + case TRUNCATE: return "http://hl7.org/fhir/map-transform"; + case ESCAPE: return "http://hl7.org/fhir/map-transform"; + case CAST: return "http://hl7.org/fhir/map-transform"; + case APPEND: return "http://hl7.org/fhir/map-transform"; + case TRANSLATE: return "http://hl7.org/fhir/map-transform"; + case REFERENCE: return "http://hl7.org/fhir/map-transform"; + case DATEOP: return "http://hl7.org/fhir/map-transform"; + case UUID: return "http://hl7.org/fhir/map-transform"; + case POINTER: return "http://hl7.org/fhir/map-transform"; + case EVALUATE: return "http://hl7.org/fhir/map-transform"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CREATE: return "create(type : string) - type is passed through to the application on the standard API, and must be known by it"; + case COPY: return "copy(source)"; + case TRUNCATE: return "truncate(source, length) - source must be stringy type"; + case ESCAPE: return "escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped"; + case CAST: return "cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known"; + case APPEND: return "append(source...) - source is element or string"; + case TRANSLATE: return "translate(source, uri_of_map) - use the translate operation"; + case REFERENCE: return "reference(source : object) - return a string that references the provided tree properly"; + case DATEOP: return "something"; + case UUID: return "something"; + case POINTER: return "something"; + case EVALUATE: return "something"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CREATE: return "create"; + case COPY: return "copy"; + case TRUNCATE: return "truncate"; + case ESCAPE: return "escape"; + case CAST: return "cast"; + case APPEND: return "append"; + case TRANSLATE: return "translate"; + case REFERENCE: return "reference"; + case DATEOP: return "dateOp"; + case UUID: return "uuid"; + case POINTER: return "pointer"; + case EVALUATE: return "evaluate"; + default: return "?"; + } + } + } + + public static class StructureMapTransformEnumFactory implements EnumFactory { + public StructureMapTransform fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("create".equals(codeString)) + return StructureMapTransform.CREATE; + if ("copy".equals(codeString)) + return StructureMapTransform.COPY; + if ("truncate".equals(codeString)) + return StructureMapTransform.TRUNCATE; + if ("escape".equals(codeString)) + return StructureMapTransform.ESCAPE; + if ("cast".equals(codeString)) + return StructureMapTransform.CAST; + if ("append".equals(codeString)) + return StructureMapTransform.APPEND; + if ("translate".equals(codeString)) + return StructureMapTransform.TRANSLATE; + if ("reference".equals(codeString)) + return StructureMapTransform.REFERENCE; + if ("dateOp".equals(codeString)) + return StructureMapTransform.DATEOP; + if ("uuid".equals(codeString)) + return StructureMapTransform.UUID; + if ("pointer".equals(codeString)) + return StructureMapTransform.POINTER; + if ("evaluate".equals(codeString)) + return StructureMapTransform.EVALUATE; + throw new IllegalArgumentException("Unknown StructureMapTransform code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("create".equals(codeString)) + return new Enumeration(this, StructureMapTransform.CREATE); + if ("copy".equals(codeString)) + return new Enumeration(this, StructureMapTransform.COPY); + if ("truncate".equals(codeString)) + return new Enumeration(this, StructureMapTransform.TRUNCATE); + if ("escape".equals(codeString)) + return new Enumeration(this, StructureMapTransform.ESCAPE); + if ("cast".equals(codeString)) + return new Enumeration(this, StructureMapTransform.CAST); + if ("append".equals(codeString)) + return new Enumeration(this, StructureMapTransform.APPEND); + if ("translate".equals(codeString)) + return new Enumeration(this, StructureMapTransform.TRANSLATE); + if ("reference".equals(codeString)) + return new Enumeration(this, StructureMapTransform.REFERENCE); + if ("dateOp".equals(codeString)) + return new Enumeration(this, StructureMapTransform.DATEOP); + if ("uuid".equals(codeString)) + return new Enumeration(this, StructureMapTransform.UUID); + if ("pointer".equals(codeString)) + return new Enumeration(this, StructureMapTransform.POINTER); + if ("evaluate".equals(codeString)) + return new Enumeration(this, StructureMapTransform.EVALUATE); + throw new FHIRException("Unknown StructureMapTransform code '"+codeString+"'"); + } + public String toCode(StructureMapTransform code) { + if (code == StructureMapTransform.CREATE) + return "create"; + if (code == StructureMapTransform.COPY) + return "copy"; + if (code == StructureMapTransform.TRUNCATE) + return "truncate"; + if (code == StructureMapTransform.ESCAPE) + return "escape"; + if (code == StructureMapTransform.CAST) + return "cast"; + if (code == StructureMapTransform.APPEND) + return "append"; + if (code == StructureMapTransform.TRANSLATE) + return "translate"; + if (code == StructureMapTransform.REFERENCE) + return "reference"; + if (code == StructureMapTransform.DATEOP) + return "dateOp"; + if (code == StructureMapTransform.UUID) + return "uuid"; + if (code == StructureMapTransform.POINTER) + return "pointer"; + if (code == StructureMapTransform.EVALUATE) + return "evaluate"; + return "?"; + } + public String toSystem(StructureMapTransform code) { + return code.getSystem(); + } + } + + @Block() + public static class StructureMapContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the structure map. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the structure map." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public StructureMapContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the structure map.). 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 StructureMapContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the structure map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureMapContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the structure map. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the structure map. + */ + public StructureMapContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public StructureMapContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the structure map.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public StructureMapContactComponent copy() { + StructureMapContactComponent dst = new StructureMapContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapContactComponent)) + return false; + StructureMapContactComponent o = (StructureMapContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapContactComponent)) + return false; + StructureMapContactComponent o = (StructureMapContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "StructureMap.contact"; + + } + + } + + @Block() + public static class StructureMapStructureComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The canonical URL that identifies the structure. + */ + @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Canonical URL for structure definition", formalDefinition="The canonical URL that identifies the structure." ) + protected UriType url; + + /** + * How the referenced structure is used in this mapping. + */ + @Child(name = "mode", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="source | queried | target | produced", formalDefinition="How the referenced structure is used in this mapping." ) + protected Enumeration mode; + + /** + * Documentation that describes how the structure is used in the mapping. + */ + @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Documentation on use of structure", formalDefinition="Documentation that describes how the structure is used in the mapping." ) + protected StringType documentation; + + private static final long serialVersionUID = -451631915L; + + /** + * Constructor + */ + public StructureMapStructureComponent() { + super(); + } + + /** + * Constructor + */ + public StructureMapStructureComponent(UriType url, Enumeration mode) { + super(); + this.url = url; + this.mode = mode; + } + + /** + * @return {@link #url} (The canonical URL that identifies the structure.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapStructureComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The canonical URL that identifies the structure.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StructureMapStructureComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The canonical URL that identifies the structure. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The canonical URL that identifies the structure. + */ + public StructureMapStructureComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #mode} (How the referenced structure is used in this mapping.). 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 StructureMapStructureComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new StructureMapModelModeEnumFactory()); // bb + 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} (How the referenced structure is used in this mapping.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public StructureMapStructureComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return How the referenced structure is used in this mapping. + */ + public StructureMapModelMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value How the referenced structure is used in this mapping. + */ + public StructureMapStructureComponent setMode(StructureMapModelMode value) { + if (this.mode == null) + this.mode = new Enumeration(new StructureMapModelModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Documentation that describes how the structure is used in the mapping.). 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 StructureMapStructureComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Documentation that describes how the structure is used in the mapping.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StructureMapStructureComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Documentation that describes how the structure is used in the mapping. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Documentation that describes how the structure is used in the mapping. + */ + public StructureMapStructureComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "The canonical URL that identifies the structure.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("mode", "code", "How the referenced structure is used in this mapping.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("documentation", "string", "Documentation that describes how the structure is used in the mapping.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 3357091: // mode + this.mode = new StructureMapModelModeEnumFactory().fromType(value); // Enumeration + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("mode")) + this.mode = new StructureMapModelModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.url"); + } + else if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.mode"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation"); + } + else + return super.addChild(name); + } + + public StructureMapStructureComponent copy() { + StructureMapStructureComponent dst = new StructureMapStructureComponent(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapStructureComponent)) + return false; + StructureMapStructureComponent o = (StructureMapStructureComponent) other; + return compareDeep(url, o.url, true) && compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapStructureComponent)) + return false; + StructureMapStructureComponent o = (StructureMapStructureComponent) other; + return compareValues(url, o.url, true) && compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (mode == null || mode.isEmpty()) + && (documentation == null || documentation.isEmpty()); + } + + public String fhirType() { + return "StructureMap.structure"; + + } + + } + + @Block() + public static class StructureMapGroupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Descriptive name for a user. + */ + @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Descriptive name for a user", formalDefinition="Descriptive name for a user." ) + protected IdType name; + + /** + * Another group that this group adds rules to. + */ + @Child(name = "extends", type = {IdType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Another group that this group adds rules to", formalDefinition="Another group that this group adds rules to." ) + protected IdType extends_; + + /** + * Documentation for this group. + */ + @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Documentation for this group", formalDefinition="Documentation for this group." ) + protected StringType documentation; + + /** + * A name assigned to an instance of data. The instance must be provided when the mapping is invoked. + */ + @Child(name = "input", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Named instance provided when invoking the map", formalDefinition="A name assigned to an instance of data. The instance must be provided when the mapping is invoked." ) + protected List input; + + /** + * Transform Rule from source to target. + */ + @Child(name = "rule", type = {}, order=5, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Transform Rule from source to target", formalDefinition="Transform Rule from source to target." ) + protected List rule; + + private static final long serialVersionUID = -1311232924L; + + /** + * Constructor + */ + public StructureMapGroupComponent() { + super(); + } + + /** + * Constructor + */ + public StructureMapGroupComponent(IdType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (Descriptive name for a user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public IdType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new IdType(); // bb + 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} (Descriptive name for a user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureMapGroupComponent setNameElement(IdType value) { + this.name = value; + return this; + } + + /** + * @return Descriptive name for a user. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Descriptive name for a user. + */ + public StructureMapGroupComponent setName(String value) { + if (this.name == null) + this.name = new IdType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #extends_} (Another group that this group adds rules to.). This is the underlying object with id, value and extensions. The accessor "getExtends" gives direct access to the value + */ + public IdType getExtendsElement() { + if (this.extends_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupComponent.extends_"); + else if (Configuration.doAutoCreate()) + this.extends_ = new IdType(); // bb + return this.extends_; + } + + public boolean hasExtendsElement() { + return this.extends_ != null && !this.extends_.isEmpty(); + } + + public boolean hasExtends() { + return this.extends_ != null && !this.extends_.isEmpty(); + } + + /** + * @param value {@link #extends_} (Another group that this group adds rules to.). This is the underlying object with id, value and extensions. The accessor "getExtends" gives direct access to the value + */ + public StructureMapGroupComponent setExtendsElement(IdType value) { + this.extends_ = value; + return this; + } + + /** + * @return Another group that this group adds rules to. + */ + public String getExtends() { + return this.extends_ == null ? null : this.extends_.getValue(); + } + + /** + * @param value Another group that this group adds rules to. + */ + public StructureMapGroupComponent setExtends(String value) { + if (Utilities.noString(value)) + this.extends_ = null; + else { + if (this.extends_ == null) + this.extends_ = new IdType(); + this.extends_.setValue(value); + } + return this; + } + + /** + * @return {@link #documentation} (Documentation for this group.). 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 StructureMapGroupComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Documentation for this group.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StructureMapGroupComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Documentation for this group. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Documentation for this group. + */ + public StructureMapGroupComponent 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 #input} (A name assigned to an instance of data. The instance must be provided when the mapping is invoked.) + */ + public List getInput() { + if (this.input == null) + this.input = new ArrayList(); + return this.input; + } + + public boolean hasInput() { + if (this.input == null) + return false; + for (StructureMapGroupInputComponent item : this.input) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #input} (A name assigned to an instance of data. The instance must be provided when the mapping is invoked.) + */ + // syntactic sugar + public StructureMapGroupInputComponent addInput() { //3 + StructureMapGroupInputComponent t = new StructureMapGroupInputComponent(); + if (this.input == null) + this.input = new ArrayList(); + this.input.add(t); + return t; + } + + // syntactic sugar + public StructureMapGroupComponent addInput(StructureMapGroupInputComponent t) { //3 + if (t == null) + return this; + if (this.input == null) + this.input = new ArrayList(); + this.input.add(t); + return this; + } + + /** + * @return {@link #rule} (Transform Rule from source to target.) + */ + public List getRule() { + if (this.rule == null) + this.rule = new ArrayList(); + return this.rule; + } + + public boolean hasRule() { + if (this.rule == null) + return false; + for (StructureMapGroupRuleComponent item : this.rule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rule} (Transform Rule from source to target.) + */ + // syntactic sugar + public StructureMapGroupRuleComponent addRule() { //3 + StructureMapGroupRuleComponent t = new StructureMapGroupRuleComponent(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + // syntactic sugar + public StructureMapGroupComponent addRule(StructureMapGroupRuleComponent t) { //3 + if (t == null) + return this; + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "id", "Descriptive name for a user.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("extends", "id", "Another group that this group adds rules to.", 0, java.lang.Integer.MAX_VALUE, extends_)); + childrenList.add(new Property("documentation", "string", "Documentation for this group.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("input", "", "A name assigned to an instance of data. The instance must be provided when the mapping is invoked.", 0, java.lang.Integer.MAX_VALUE, input)); + childrenList.add(new Property("rule", "", "Transform Rule from source to target.", 0, java.lang.Integer.MAX_VALUE, rule)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType + case -1305664359: /*extends*/ return this.extends_ == null ? new Base[0] : new Base[] {this.extends_}; // IdType + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // StructureMapGroupInputComponent + case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // StructureMapGroupRuleComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToId(value); // IdType + break; + case -1305664359: // extends + this.extends_ = castToId(value); // IdType + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + case 100358090: // input + this.getInput().add((StructureMapGroupInputComponent) value); // StructureMapGroupInputComponent + break; + case 3512060: // rule + this.getRule().add((StructureMapGroupRuleComponent) value); // StructureMapGroupRuleComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToId(value); // IdType + else if (name.equals("extends")) + this.extends_ = castToId(value); // IdType + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else if (name.equals("input")) + this.getInput().add((StructureMapGroupInputComponent) value); + else if (name.equals("rule")) + this.getRule().add((StructureMapGroupRuleComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // IdType + case -1305664359: throw new FHIRException("Cannot make property extends as it is not a complex type"); // IdType + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + case 100358090: return addInput(); // StructureMapGroupInputComponent + case 3512060: return addRule(); // StructureMapGroupRuleComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); + } + else if (name.equals("extends")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.extends"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation"); + } + else if (name.equals("input")) { + return addInput(); + } + else if (name.equals("rule")) { + return addRule(); + } + else + return super.addChild(name); + } + + public StructureMapGroupComponent copy() { + StructureMapGroupComponent dst = new StructureMapGroupComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.extends_ = extends_ == null ? null : extends_.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + if (input != null) { + dst.input = new ArrayList(); + for (StructureMapGroupInputComponent i : input) + dst.input.add(i.copy()); + }; + if (rule != null) { + dst.rule = new ArrayList(); + for (StructureMapGroupRuleComponent i : rule) + dst.rule.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapGroupComponent)) + return false; + StructureMapGroupComponent o = (StructureMapGroupComponent) other; + return compareDeep(name, o.name, true) && compareDeep(extends_, o.extends_, true) && compareDeep(documentation, o.documentation, true) + && compareDeep(input, o.input, true) && compareDeep(rule, o.rule, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapGroupComponent)) + return false; + StructureMapGroupComponent o = (StructureMapGroupComponent) other; + return compareValues(name, o.name, true) && compareValues(extends_, o.extends_, true) && compareValues(documentation, o.documentation, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (extends_ == null || extends_.isEmpty()) + && (documentation == null || documentation.isEmpty()) && (input == null || input.isEmpty()) + && (rule == null || rule.isEmpty()); + } + + public String fhirType() { + return "StructureMap.group"; + + } + + } + + @Block() + public static class StructureMapGroupInputComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Name for this instance of data. + */ + @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name for this instance of data", formalDefinition="Name for this instance of data." ) + protected IdType name; + + /** + * Type for this instance of data. + */ + @Child(name = "type", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type for this instance of data", formalDefinition="Type for this instance of data." ) + protected StringType type; + + /** + * Mode for this instance of data. + */ + @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="source | target", formalDefinition="Mode for this instance of data." ) + protected Enumeration mode; + + /** + * Documentation for this instance of data. + */ + @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Documentation for this instance of data", formalDefinition="Documentation for this instance of data." ) + protected StringType documentation; + + private static final long serialVersionUID = -25050724L; + + /** + * Constructor + */ + public StructureMapGroupInputComponent() { + super(); + } + + /** + * Constructor + */ + public StructureMapGroupInputComponent(IdType name, Enumeration mode) { + super(); + this.name = name; + this.mode = mode; + } + + /** + * @return {@link #name} (Name for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public IdType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupInputComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new IdType(); // bb + 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} (Name for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureMapGroupInputComponent setNameElement(IdType value) { + this.name = value; + return this; + } + + /** + * @return Name for this instance of data. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name for this instance of data. + */ + public StructureMapGroupInputComponent setName(String value) { + if (this.name == null) + this.name = new IdType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #type} (Type for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StringType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupInputComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new StringType(); // bb + 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} (Type for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StructureMapGroupInputComponent setTypeElement(StringType value) { + this.type = value; + return this; + } + + /** + * @return Type for this instance of data. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Type for this instance of data. + */ + public StructureMapGroupInputComponent setType(String value) { + if (Utilities.noString(value)) + this.type = null; + else { + if (this.type == null) + this.type = new StringType(); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #mode} (Mode for this instance of data.). 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 StructureMapGroupInputComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(new StructureMapInputModeEnumFactory()); // bb + 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} (Mode for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public StructureMapGroupInputComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Mode for this instance of data. + */ + public StructureMapInputMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Mode for this instance of data. + */ + public StructureMapGroupInputComponent setMode(StructureMapInputMode value) { + if (this.mode == null) + this.mode = new Enumeration(new StructureMapInputModeEnumFactory()); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Documentation for this instance of data.). 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 StructureMapGroupInputComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StructureMapGroupInputComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Documentation for this instance of data. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Documentation for this instance of data. + */ + public StructureMapGroupInputComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "id", "Name for this instance of data.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("type", "string", "Type for this instance of data.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("mode", "code", "Mode for this instance of data.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("documentation", "string", "Documentation for this instance of data.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType + case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToId(value); // IdType + break; + case 3575610: // type + this.type = castToString(value); // StringType + break; + case 3357091: // mode + this.mode = new StructureMapInputModeEnumFactory().fromType(value); // Enumeration + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToId(value); // IdType + else if (name.equals("type")) + this.type = castToString(value); // StringType + else if (name.equals("mode")) + this.mode = new StructureMapInputModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // IdType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // StringType + case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.type"); + } + else if (name.equals("mode")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.mode"); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation"); + } + else + return super.addChild(name); + } + + public StructureMapGroupInputComponent copy() { + StructureMapGroupInputComponent dst = new StructureMapGroupInputComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.type = type == null ? null : type.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapGroupInputComponent)) + return false; + StructureMapGroupInputComponent o = (StructureMapGroupInputComponent) other; + return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(mode, o.mode, true) + && compareDeep(documentation, o.documentation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapGroupInputComponent)) + return false; + StructureMapGroupInputComponent o = (StructureMapGroupInputComponent) other; + return compareValues(name, o.name, true) && compareValues(type, o.type, true) && compareValues(mode, o.mode, true) + && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (type == null || type.isEmpty()) + && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + public String fhirType() { + return "StructureMap.group.input"; + + } + + } + + @Block() + public static class StructureMapGroupRuleComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Name of the rule for internal references. + */ + @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the rule for internal references", formalDefinition="Name of the rule for internal references." ) + protected IdType name; + + /** + * Source inputs to the mapping. + */ + @Child(name = "source", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Source inputs to the mapping", formalDefinition="Source inputs to the mapping." ) + protected List source; + + /** + * Content to create because of this mapping rule. + */ + @Child(name = "target", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content to create because of this mapping rule", formalDefinition="Content to create because of this mapping rule." ) + protected List target; + + /** + * Rules contained in this rule. + */ + @Child(name = "rule", type = {StructureMapGroupRuleComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Rules contained in this rule", formalDefinition="Rules contained in this rule." ) + protected List rule; + + /** + * Which other rules to apply in the context of this rule. + */ + @Child(name = "dependent", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Which other rules to apply in the context of this rule", formalDefinition="Which other rules to apply in the context of this rule." ) + protected List dependent; + + /** + * Documentation for this instance of data. + */ + @Child(name = "documentation", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Documentation for this instance of data", formalDefinition="Documentation for this instance of data." ) + protected StringType documentation; + + private static final long serialVersionUID = 773925517L; + + /** + * Constructor + */ + public StructureMapGroupRuleComponent() { + super(); + } + + /** + * Constructor + */ + public StructureMapGroupRuleComponent(IdType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (Name of the rule for internal references.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public IdType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new IdType(); // bb + 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} (Name of the rule for internal references.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureMapGroupRuleComponent setNameElement(IdType value) { + this.name = value; + return this; + } + + /** + * @return Name of the rule for internal references. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name of the rule for internal references. + */ + public StructureMapGroupRuleComponent setName(String value) { + if (this.name == null) + this.name = new IdType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #source} (Source inputs to the mapping.) + */ + public List getSource() { + if (this.source == null) + this.source = new ArrayList(); + return this.source; + } + + public boolean hasSource() { + if (this.source == null) + return false; + for (StructureMapGroupRuleSourceComponent item : this.source) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #source} (Source inputs to the mapping.) + */ + // syntactic sugar + public StructureMapGroupRuleSourceComponent addSource() { //3 + StructureMapGroupRuleSourceComponent t = new StructureMapGroupRuleSourceComponent(); + if (this.source == null) + this.source = new ArrayList(); + this.source.add(t); + return t; + } + + // syntactic sugar + public StructureMapGroupRuleComponent addSource(StructureMapGroupRuleSourceComponent t) { //3 + if (t == null) + return this; + if (this.source == null) + this.source = new ArrayList(); + this.source.add(t); + return this; + } + + /** + * @return {@link #target} (Content to create because of this mapping rule.) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (StructureMapGroupRuleTargetComponent item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (Content to create because of this mapping rule.) + */ + // syntactic sugar + public StructureMapGroupRuleTargetComponent addTarget() { //3 + StructureMapGroupRuleTargetComponent t = new StructureMapGroupRuleTargetComponent(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + // syntactic sugar + public StructureMapGroupRuleComponent addTarget(StructureMapGroupRuleTargetComponent t) { //3 + if (t == null) + return this; + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @return {@link #rule} (Rules contained in this rule.) + */ + public List getRule() { + if (this.rule == null) + this.rule = new ArrayList(); + return this.rule; + } + + public boolean hasRule() { + if (this.rule == null) + return false; + for (StructureMapGroupRuleComponent item : this.rule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rule} (Rules contained in this rule.) + */ + // syntactic sugar + public StructureMapGroupRuleComponent addRule() { //3 + StructureMapGroupRuleComponent t = new StructureMapGroupRuleComponent(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + // syntactic sugar + public StructureMapGroupRuleComponent addRule(StructureMapGroupRuleComponent t) { //3 + if (t == null) + return this; + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return this; + } + + /** + * @return {@link #dependent} (Which other rules to apply in the context of this rule.) + */ + public List getDependent() { + if (this.dependent == null) + this.dependent = new ArrayList(); + return this.dependent; + } + + public boolean hasDependent() { + if (this.dependent == null) + return false; + for (StructureMapGroupRuleDependentComponent item : this.dependent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dependent} (Which other rules to apply in the context of this rule.) + */ + // syntactic sugar + public StructureMapGroupRuleDependentComponent addDependent() { //3 + StructureMapGroupRuleDependentComponent t = new StructureMapGroupRuleDependentComponent(); + if (this.dependent == null) + this.dependent = new ArrayList(); + this.dependent.add(t); + return t; + } + + // syntactic sugar + public StructureMapGroupRuleComponent addDependent(StructureMapGroupRuleDependentComponent t) { //3 + if (t == null) + return this; + if (this.dependent == null) + this.dependent = new ArrayList(); + this.dependent.add(t); + return this; + } + + /** + * @return {@link #documentation} (Documentation for this instance of data.). 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 StructureMapGroupRuleComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); // bb + 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} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StructureMapGroupRuleComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Documentation for this instance of data. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Documentation for this instance of data. + */ + public StructureMapGroupRuleComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "id", "Name of the rule for internal references.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("source", "", "Source inputs to the mapping.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target", "", "Content to create because of this mapping rule.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("rule", "@StructureMap.group.rule", "Rules contained in this rule.", 0, java.lang.Integer.MAX_VALUE, rule)); + childrenList.add(new Property("dependent", "", "Which other rules to apply in the context of this rule.", 0, java.lang.Integer.MAX_VALUE, dependent)); + childrenList.add(new Property("documentation", "string", "Documentation for this instance of data.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType + case -896505829: /*source*/ return this.source == null ? new Base[0] : this.source.toArray(new Base[this.source.size()]); // StructureMapGroupRuleSourceComponent + case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // StructureMapGroupRuleTargetComponent + case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // StructureMapGroupRuleComponent + case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : this.dependent.toArray(new Base[this.dependent.size()]); // StructureMapGroupRuleDependentComponent + case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToId(value); // IdType + break; + case -896505829: // source + this.getSource().add((StructureMapGroupRuleSourceComponent) value); // StructureMapGroupRuleSourceComponent + break; + case -880905839: // target + this.getTarget().add((StructureMapGroupRuleTargetComponent) value); // StructureMapGroupRuleTargetComponent + break; + case 3512060: // rule + this.getRule().add((StructureMapGroupRuleComponent) value); // StructureMapGroupRuleComponent + break; + case -1109226753: // dependent + this.getDependent().add((StructureMapGroupRuleDependentComponent) value); // StructureMapGroupRuleDependentComponent + break; + case 1587405498: // documentation + this.documentation = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToId(value); // IdType + else if (name.equals("source")) + this.getSource().add((StructureMapGroupRuleSourceComponent) value); + else if (name.equals("target")) + this.getTarget().add((StructureMapGroupRuleTargetComponent) value); + else if (name.equals("rule")) + this.getRule().add((StructureMapGroupRuleComponent) value); + else if (name.equals("dependent")) + this.getDependent().add((StructureMapGroupRuleDependentComponent) value); + else if (name.equals("documentation")) + this.documentation = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // IdType + case -896505829: return addSource(); // StructureMapGroupRuleSourceComponent + case -880905839: return addTarget(); // StructureMapGroupRuleTargetComponent + case 3512060: return addRule(); // StructureMapGroupRuleComponent + case -1109226753: return addDependent(); // StructureMapGroupRuleDependentComponent + case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); + } + else if (name.equals("source")) { + return addSource(); + } + else if (name.equals("target")) { + return addTarget(); + } + else if (name.equals("rule")) { + return addRule(); + } + else if (name.equals("dependent")) { + return addDependent(); + } + else if (name.equals("documentation")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation"); + } + else + return super.addChild(name); + } + + public StructureMapGroupRuleComponent copy() { + StructureMapGroupRuleComponent dst = new StructureMapGroupRuleComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (source != null) { + dst.source = new ArrayList(); + for (StructureMapGroupRuleSourceComponent i : source) + dst.source.add(i.copy()); + }; + if (target != null) { + dst.target = new ArrayList(); + for (StructureMapGroupRuleTargetComponent i : target) + dst.target.add(i.copy()); + }; + if (rule != null) { + dst.rule = new ArrayList(); + for (StructureMapGroupRuleComponent i : rule) + dst.rule.add(i.copy()); + }; + if (dependent != null) { + dst.dependent = new ArrayList(); + for (StructureMapGroupRuleDependentComponent i : dependent) + dst.dependent.add(i.copy()); + }; + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapGroupRuleComponent)) + return false; + StructureMapGroupRuleComponent o = (StructureMapGroupRuleComponent) other; + return compareDeep(name, o.name, true) && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) + && compareDeep(rule, o.rule, true) && compareDeep(dependent, o.dependent, true) && compareDeep(documentation, o.documentation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapGroupRuleComponent)) + return false; + StructureMapGroupRuleComponent o = (StructureMapGroupRuleComponent) other; + return compareValues(name, o.name, true) && compareValues(documentation, o.documentation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (source == null || source.isEmpty()) + && (target == null || target.isEmpty()) && (rule == null || rule.isEmpty()) && (dependent == null || dependent.isEmpty()) + && (documentation == null || documentation.isEmpty()); + } + + public String fhirType() { + return "StructureMap.group.rule"; + + } + + } + + @Block() + public static class StructureMapGroupRuleSourceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Whether this rule applies if the source isn't found. + */ + @Child(name = "required", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether this rule applies if the source isn't found", formalDefinition="Whether this rule applies if the source isn't found." ) + protected BooleanType required; + + /** + * Type or variable this rule applies to. + */ + @Child(name = "context", type = {IdType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type or variable this rule applies to", formalDefinition="Type or variable this rule applies to." ) + protected IdType context; + + /** + * How to interpret the context. + */ + @Child(name = "contextType", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="type | variable", formalDefinition="How to interpret the context." ) + protected Enumeration contextType; + + /** + * Optional field for this source. + */ + @Child(name = "element", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Optional field for this source", formalDefinition="Optional field for this source." ) + protected StringType element; + + /** + * How to handle the list mode for this element. + */ + @Child(name = "listMode", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="first | share | last", formalDefinition="How to handle the list mode for this element." ) + protected Enumeration listMode; + + /** + * Named context for field, if a field is specified. + */ + @Child(name = "variable", type = {IdType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Named context for field, if a field is specified", formalDefinition="Named context for field, if a field is specified." ) + protected IdType variable; + + /** + * FluentPath expression - must be true or the rule does not apply. + */ + @Child(name = "condition", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="FluentPath expression - must be true or the rule does not apply", formalDefinition="FluentPath expression - must be true or the rule does not apply." ) + protected StringType condition; + + /** + * FluentPath expression - must be true or the mapping engine throws an error instead of completing. + */ + @Child(name = "check", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="FluentPath expression - must be true or the mapping engine throws an error instead of completing", formalDefinition="FluentPath expression - must be true or the mapping engine throws an error instead of completing." ) + protected StringType check; + + private static final long serialVersionUID = -1039728628L; + + /** + * Constructor + */ + public StructureMapGroupRuleSourceComponent() { + super(); + } + + /** + * Constructor + */ + public StructureMapGroupRuleSourceComponent(BooleanType required, IdType context, Enumeration contextType) { + super(); + this.required = required; + this.context = context; + this.contextType = contextType; + } + + /** + * @return {@link #required} (Whether this rule applies if the source isn't found.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public BooleanType getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new BooleanType(); // bb + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (Whether this rule applies if the source isn't found.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setRequiredElement(BooleanType value) { + this.required = value; + return this; + } + + /** + * @return Whether this rule applies if the source isn't found. + */ + public boolean getRequired() { + return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); + } + + /** + * @param value Whether this rule applies if the source isn't found. + */ + public StructureMapGroupRuleSourceComponent setRequired(boolean value) { + if (this.required == null) + this.required = new BooleanType(); + this.required.setValue(value); + return this; + } + + /** + * @return {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value + */ + public IdType getContextElement() { + if (this.context == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.context"); + else if (Configuration.doAutoCreate()) + this.context = new IdType(); // bb + return this.context; + } + + public boolean hasContextElement() { + return this.context != null && !this.context.isEmpty(); + } + + public boolean hasContext() { + return this.context != null && !this.context.isEmpty(); + } + + /** + * @param value {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setContextElement(IdType value) { + this.context = value; + return this; + } + + /** + * @return Type or variable this rule applies to. + */ + public String getContext() { + return this.context == null ? null : this.context.getValue(); + } + + /** + * @param value Type or variable this rule applies to. + */ + public StructureMapGroupRuleSourceComponent setContext(String value) { + if (this.context == null) + this.context = new IdType(); + this.context.setValue(value); + return this; + } + + /** + * @return {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public Enumeration getContextTypeElement() { + if (this.contextType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.contextType"); + else if (Configuration.doAutoCreate()) + this.contextType = new Enumeration(new StructureMapContextTypeEnumFactory()); // bb + return this.contextType; + } + + public boolean hasContextTypeElement() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + public boolean hasContextType() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + /** + * @param value {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setContextTypeElement(Enumeration value) { + this.contextType = value; + return this; + } + + /** + * @return How to interpret the context. + */ + public StructureMapContextType getContextType() { + return this.contextType == null ? null : this.contextType.getValue(); + } + + /** + * @param value How to interpret the context. + */ + public StructureMapGroupRuleSourceComponent setContextType(StructureMapContextType value) { + if (this.contextType == null) + this.contextType = new Enumeration(new StructureMapContextTypeEnumFactory()); + this.contextType.setValue(value); + return this; + } + + /** + * @return {@link #element} (Optional field for this source.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public StringType getElementElement() { + if (this.element == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.element"); + else if (Configuration.doAutoCreate()) + this.element = new StringType(); // bb + return this.element; + } + + public boolean hasElementElement() { + return this.element != null && !this.element.isEmpty(); + } + + public boolean hasElement() { + return this.element != null && !this.element.isEmpty(); + } + + /** + * @param value {@link #element} (Optional field for this source.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setElementElement(StringType value) { + this.element = value; + return this; + } + + /** + * @return Optional field for this source. + */ + public String getElement() { + return this.element == null ? null : this.element.getValue(); + } + + /** + * @param value Optional field for this source. + */ + public StructureMapGroupRuleSourceComponent setElement(String value) { + if (Utilities.noString(value)) + this.element = null; + else { + if (this.element == null) + this.element = new StringType(); + this.element.setValue(value); + } + return this; + } + + /** + * @return {@link #listMode} (How to handle the list mode for this element.). This is the underlying object with id, value and extensions. The accessor "getListMode" gives direct access to the value + */ + public Enumeration getListModeElement() { + if (this.listMode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.listMode"); + else if (Configuration.doAutoCreate()) + this.listMode = new Enumeration(new StructureMapListModeEnumFactory()); // bb + return this.listMode; + } + + public boolean hasListModeElement() { + return this.listMode != null && !this.listMode.isEmpty(); + } + + public boolean hasListMode() { + return this.listMode != null && !this.listMode.isEmpty(); + } + + /** + * @param value {@link #listMode} (How to handle the list mode for this element.). This is the underlying object with id, value and extensions. The accessor "getListMode" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setListModeElement(Enumeration value) { + this.listMode = value; + return this; + } + + /** + * @return How to handle the list mode for this element. + */ + public StructureMapListMode getListMode() { + return this.listMode == null ? null : this.listMode.getValue(); + } + + /** + * @param value How to handle the list mode for this element. + */ + public StructureMapGroupRuleSourceComponent setListMode(StructureMapListMode value) { + if (value == null) + this.listMode = null; + else { + if (this.listMode == null) + this.listMode = new Enumeration(new StructureMapListModeEnumFactory()); + this.listMode.setValue(value); + } + return this; + } + + /** + * @return {@link #variable} (Named context for field, if a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value + */ + public IdType getVariableElement() { + if (this.variable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.variable"); + else if (Configuration.doAutoCreate()) + this.variable = new IdType(); // bb + return this.variable; + } + + public boolean hasVariableElement() { + return this.variable != null && !this.variable.isEmpty(); + } + + public boolean hasVariable() { + return this.variable != null && !this.variable.isEmpty(); + } + + /** + * @param value {@link #variable} (Named context for field, if a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setVariableElement(IdType value) { + this.variable = value; + return this; + } + + /** + * @return Named context for field, if a field is specified. + */ + public String getVariable() { + return this.variable == null ? null : this.variable.getValue(); + } + + /** + * @param value Named context for field, if a field is specified. + */ + public StructureMapGroupRuleSourceComponent setVariable(String value) { + if (Utilities.noString(value)) + this.variable = null; + else { + if (this.variable == null) + this.variable = new IdType(); + this.variable.setValue(value); + } + return this; + } + + /** + * @return {@link #condition} (FluentPath expression - must be true or the rule does not apply.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value + */ + public StringType getConditionElement() { + if (this.condition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.condition"); + else if (Configuration.doAutoCreate()) + this.condition = new StringType(); // bb + return this.condition; + } + + public boolean hasConditionElement() { + return this.condition != null && !this.condition.isEmpty(); + } + + public boolean hasCondition() { + return this.condition != null && !this.condition.isEmpty(); + } + + /** + * @param value {@link #condition} (FluentPath expression - must be true or the rule does not apply.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setConditionElement(StringType value) { + this.condition = value; + return this; + } + + /** + * @return FluentPath expression - must be true or the rule does not apply. + */ + public String getCondition() { + return this.condition == null ? null : this.condition.getValue(); + } + + /** + * @param value FluentPath expression - must be true or the rule does not apply. + */ + public StructureMapGroupRuleSourceComponent setCondition(String value) { + if (Utilities.noString(value)) + this.condition = null; + else { + if (this.condition == null) + this.condition = new StringType(); + this.condition.setValue(value); + } + return this; + } + + /** + * @return {@link #check} (FluentPath expression - must be true or the mapping engine throws an error instead of completing.). This is the underlying object with id, value and extensions. The accessor "getCheck" gives direct access to the value + */ + public StringType getCheckElement() { + if (this.check == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.check"); + else if (Configuration.doAutoCreate()) + this.check = new StringType(); // bb + return this.check; + } + + public boolean hasCheckElement() { + return this.check != null && !this.check.isEmpty(); + } + + public boolean hasCheck() { + return this.check != null && !this.check.isEmpty(); + } + + /** + * @param value {@link #check} (FluentPath expression - must be true or the mapping engine throws an error instead of completing.). This is the underlying object with id, value and extensions. The accessor "getCheck" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setCheckElement(StringType value) { + this.check = value; + return this; + } + + /** + * @return FluentPath expression - must be true or the mapping engine throws an error instead of completing. + */ + public String getCheck() { + return this.check == null ? null : this.check.getValue(); + } + + /** + * @param value FluentPath expression - must be true or the mapping engine throws an error instead of completing. + */ + public StructureMapGroupRuleSourceComponent setCheck(String value) { + if (Utilities.noString(value)) + this.check = null; + else { + if (this.check == null) + this.check = new StringType(); + this.check.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("required", "boolean", "Whether this rule applies if the source isn't found.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("context", "id", "Type or variable this rule applies to.", 0, java.lang.Integer.MAX_VALUE, context)); + childrenList.add(new Property("contextType", "code", "How to interpret the context.", 0, java.lang.Integer.MAX_VALUE, contextType)); + childrenList.add(new Property("element", "string", "Optional field for this source.", 0, java.lang.Integer.MAX_VALUE, element)); + childrenList.add(new Property("listMode", "code", "How to handle the list mode for this element.", 0, java.lang.Integer.MAX_VALUE, listMode)); + childrenList.add(new Property("variable", "id", "Named context for field, if a field is specified.", 0, java.lang.Integer.MAX_VALUE, variable)); + childrenList.add(new Property("condition", "string", "FluentPath expression - must be true or the rule does not apply.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("check", "string", "FluentPath expression - must be true or the mapping engine throws an error instead of completing.", 0, java.lang.Integer.MAX_VALUE, check)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType + case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // IdType + case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration + case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // StringType + case 1345445729: /*listMode*/ return this.listMode == null ? new Base[0] : new Base[] {this.listMode}; // Enumeration + case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : new Base[] {this.variable}; // IdType + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // StringType + case 94627080: /*check*/ return this.check == null ? new Base[0] : new Base[] {this.check}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -393139297: // required + this.required = castToBoolean(value); // BooleanType + break; + case 951530927: // context + this.context = castToId(value); // IdType + break; + case -102839927: // contextType + this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration + break; + case -1662836996: // element + this.element = castToString(value); // StringType + break; + case 1345445729: // listMode + this.listMode = new StructureMapListModeEnumFactory().fromType(value); // Enumeration + break; + case -1249586564: // variable + this.variable = castToId(value); // IdType + break; + case -861311717: // condition + this.condition = castToString(value); // StringType + break; + case 94627080: // check + this.check = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("required")) + this.required = castToBoolean(value); // BooleanType + else if (name.equals("context")) + this.context = castToId(value); // IdType + else if (name.equals("contextType")) + this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("element")) + this.element = castToString(value); // StringType + else if (name.equals("listMode")) + this.listMode = new StructureMapListModeEnumFactory().fromType(value); // Enumeration + else if (name.equals("variable")) + this.variable = castToId(value); // IdType + else if (name.equals("condition")) + this.condition = castToString(value); // StringType + else if (name.equals("check")) + this.check = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // BooleanType + case 951530927: throw new FHIRException("Cannot make property context as it is not a complex type"); // IdType + case -102839927: throw new FHIRException("Cannot make property contextType as it is not a complex type"); // Enumeration + case -1662836996: throw new FHIRException("Cannot make property element as it is not a complex type"); // StringType + case 1345445729: throw new FHIRException("Cannot make property listMode as it is not a complex type"); // Enumeration + case -1249586564: throw new FHIRException("Cannot make property variable as it is not a complex type"); // IdType + case -861311717: throw new FHIRException("Cannot make property condition as it is not a complex type"); // StringType + case 94627080: throw new FHIRException("Cannot make property check as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("required")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.required"); + } + else if (name.equals("context")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.context"); + } + else if (name.equals("contextType")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.contextType"); + } + else if (name.equals("element")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.element"); + } + else if (name.equals("listMode")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listMode"); + } + else if (name.equals("variable")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable"); + } + else if (name.equals("condition")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.condition"); + } + else if (name.equals("check")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.check"); + } + else + return super.addChild(name); + } + + public StructureMapGroupRuleSourceComponent copy() { + StructureMapGroupRuleSourceComponent dst = new StructureMapGroupRuleSourceComponent(); + copyValues(dst); + dst.required = required == null ? null : required.copy(); + dst.context = context == null ? null : context.copy(); + dst.contextType = contextType == null ? null : contextType.copy(); + dst.element = element == null ? null : element.copy(); + dst.listMode = listMode == null ? null : listMode.copy(); + dst.variable = variable == null ? null : variable.copy(); + dst.condition = condition == null ? null : condition.copy(); + dst.check = check == null ? null : check.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapGroupRuleSourceComponent)) + return false; + StructureMapGroupRuleSourceComponent o = (StructureMapGroupRuleSourceComponent) other; + return compareDeep(required, o.required, true) && compareDeep(context, o.context, true) && compareDeep(contextType, o.contextType, true) + && compareDeep(element, o.element, true) && compareDeep(listMode, o.listMode, true) && compareDeep(variable, o.variable, true) + && compareDeep(condition, o.condition, true) && compareDeep(check, o.check, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapGroupRuleSourceComponent)) + return false; + StructureMapGroupRuleSourceComponent o = (StructureMapGroupRuleSourceComponent) other; + return compareValues(required, o.required, true) && compareValues(context, o.context, true) && compareValues(contextType, o.contextType, true) + && compareValues(element, o.element, true) && compareValues(listMode, o.listMode, true) && compareValues(variable, o.variable, true) + && compareValues(condition, o.condition, true) && compareValues(check, o.check, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (required == null || required.isEmpty()) && (context == null || context.isEmpty()) + && (contextType == null || contextType.isEmpty()) && (element == null || element.isEmpty()) + && (listMode == null || listMode.isEmpty()) && (variable == null || variable.isEmpty()) && (condition == null || condition.isEmpty()) + && (check == null || check.isEmpty()); + } + + public String fhirType() { + return "StructureMap.group.rule.source"; + + } + + } + + @Block() + public static class StructureMapGroupRuleTargetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Type or variable this rule applies to. + */ + @Child(name = "context", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type or variable this rule applies to", formalDefinition="Type or variable this rule applies to." ) + protected IdType context; + + /** + * How to interpret the context. + */ + @Child(name = "contextType", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="type | variable", formalDefinition="How to interpret the context." ) + protected Enumeration contextType; + + /** + * Field to create in the context. + */ + @Child(name = "element", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Field to create in the context", formalDefinition="Field to create in the context." ) + protected StringType element; + + /** + * Named context for field, if desired, and a field is specified. + */ + @Child(name = "variable", type = {IdType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Named context for field, if desired, and a field is specified", formalDefinition="Named context for field, if desired, and a field is specified." ) + protected IdType variable; + + /** + * If field is a list, how to manage the list. + */ + @Child(name = "listMode", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="first | share | last", formalDefinition="If field is a list, how to manage the list." ) + protected List> listMode; + + /** + * Internal rule reference for shared list items. + */ + @Child(name = "listRuleId", type = {IdType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Internal rule reference for shared list items", formalDefinition="Internal rule reference for shared list items." ) + protected IdType listRuleId; + + /** + * How the data is copied / created. + */ + @Child(name = "transform", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="create | copy +", formalDefinition="How the data is copied / created." ) + protected Enumeration transform; + + /** + * Parameters to the transform. + */ + @Child(name = "parameter", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Parameters to the transform", formalDefinition="Parameters to the transform." ) + protected List parameter; + + private static final long serialVersionUID = 775400884L; + + /** + * Constructor + */ + public StructureMapGroupRuleTargetComponent() { + super(); + } + + /** + * Constructor + */ + public StructureMapGroupRuleTargetComponent(IdType context, Enumeration contextType) { + super(); + this.context = context; + this.contextType = contextType; + } + + /** + * @return {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value + */ + public IdType getContextElement() { + if (this.context == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.context"); + else if (Configuration.doAutoCreate()) + this.context = new IdType(); // bb + return this.context; + } + + public boolean hasContextElement() { + return this.context != null && !this.context.isEmpty(); + } + + public boolean hasContext() { + return this.context != null && !this.context.isEmpty(); + } + + /** + * @param value {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value + */ + public StructureMapGroupRuleTargetComponent setContextElement(IdType value) { + this.context = value; + return this; + } + + /** + * @return Type or variable this rule applies to. + */ + public String getContext() { + return this.context == null ? null : this.context.getValue(); + } + + /** + * @param value Type or variable this rule applies to. + */ + public StructureMapGroupRuleTargetComponent setContext(String value) { + if (this.context == null) + this.context = new IdType(); + this.context.setValue(value); + return this; + } + + /** + * @return {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public Enumeration getContextTypeElement() { + if (this.contextType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.contextType"); + else if (Configuration.doAutoCreate()) + this.contextType = new Enumeration(new StructureMapContextTypeEnumFactory()); // bb + return this.contextType; + } + + public boolean hasContextTypeElement() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + public boolean hasContextType() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + /** + * @param value {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public StructureMapGroupRuleTargetComponent setContextTypeElement(Enumeration value) { + this.contextType = value; + return this; + } + + /** + * @return How to interpret the context. + */ + public StructureMapContextType getContextType() { + return this.contextType == null ? null : this.contextType.getValue(); + } + + /** + * @param value How to interpret the context. + */ + public StructureMapGroupRuleTargetComponent setContextType(StructureMapContextType value) { + if (this.contextType == null) + this.contextType = new Enumeration(new StructureMapContextTypeEnumFactory()); + this.contextType.setValue(value); + return this; + } + + /** + * @return {@link #element} (Field to create in the context.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public StringType getElementElement() { + if (this.element == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.element"); + else if (Configuration.doAutoCreate()) + this.element = new StringType(); // bb + return this.element; + } + + public boolean hasElementElement() { + return this.element != null && !this.element.isEmpty(); + } + + public boolean hasElement() { + return this.element != null && !this.element.isEmpty(); + } + + /** + * @param value {@link #element} (Field to create in the context.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public StructureMapGroupRuleTargetComponent setElementElement(StringType value) { + this.element = value; + return this; + } + + /** + * @return Field to create in the context. + */ + public String getElement() { + return this.element == null ? null : this.element.getValue(); + } + + /** + * @param value Field to create in the context. + */ + public StructureMapGroupRuleTargetComponent setElement(String value) { + if (Utilities.noString(value)) + this.element = null; + else { + if (this.element == null) + this.element = new StringType(); + this.element.setValue(value); + } + return this; + } + + /** + * @return {@link #variable} (Named context for field, if desired, and a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value + */ + public IdType getVariableElement() { + if (this.variable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.variable"); + else if (Configuration.doAutoCreate()) + this.variable = new IdType(); // bb + return this.variable; + } + + public boolean hasVariableElement() { + return this.variable != null && !this.variable.isEmpty(); + } + + public boolean hasVariable() { + return this.variable != null && !this.variable.isEmpty(); + } + + /** + * @param value {@link #variable} (Named context for field, if desired, and a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value + */ + public StructureMapGroupRuleTargetComponent setVariableElement(IdType value) { + this.variable = value; + return this; + } + + /** + * @return Named context for field, if desired, and a field is specified. + */ + public String getVariable() { + return this.variable == null ? null : this.variable.getValue(); + } + + /** + * @param value Named context for field, if desired, and a field is specified. + */ + public StructureMapGroupRuleTargetComponent setVariable(String value) { + if (Utilities.noString(value)) + this.variable = null; + else { + if (this.variable == null) + this.variable = new IdType(); + this.variable.setValue(value); + } + return this; + } + + /** + * @return {@link #listMode} (If field is a list, how to manage the list.) + */ + public List> getListMode() { + if (this.listMode == null) + this.listMode = new ArrayList>(); + return this.listMode; + } + + public boolean hasListMode() { + if (this.listMode == null) + return false; + for (Enumeration item : this.listMode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #listMode} (If field is a list, how to manage the list.) + */ + // syntactic sugar + public Enumeration addListModeElement() {//2 + Enumeration t = new Enumeration(new StructureMapListModeEnumFactory()); + if (this.listMode == null) + this.listMode = new ArrayList>(); + this.listMode.add(t); + return t; + } + + /** + * @param value {@link #listMode} (If field is a list, how to manage the list.) + */ + public StructureMapGroupRuleTargetComponent addListMode(StructureMapListMode value) { //1 + Enumeration t = new Enumeration(new StructureMapListModeEnumFactory()); + t.setValue(value); + if (this.listMode == null) + this.listMode = new ArrayList>(); + this.listMode.add(t); + return this; + } + + /** + * @param value {@link #listMode} (If field is a list, how to manage the list.) + */ + public boolean hasListMode(StructureMapListMode value) { + if (this.listMode == null) + return false; + for (Enumeration v : this.listMode) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #listRuleId} (Internal rule reference for shared list items.). This is the underlying object with id, value and extensions. The accessor "getListRuleId" gives direct access to the value + */ + public IdType getListRuleIdElement() { + if (this.listRuleId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.listRuleId"); + else if (Configuration.doAutoCreate()) + this.listRuleId = new IdType(); // bb + return this.listRuleId; + } + + public boolean hasListRuleIdElement() { + return this.listRuleId != null && !this.listRuleId.isEmpty(); + } + + public boolean hasListRuleId() { + return this.listRuleId != null && !this.listRuleId.isEmpty(); + } + + /** + * @param value {@link #listRuleId} (Internal rule reference for shared list items.). This is the underlying object with id, value and extensions. The accessor "getListRuleId" gives direct access to the value + */ + public StructureMapGroupRuleTargetComponent setListRuleIdElement(IdType value) { + this.listRuleId = value; + return this; + } + + /** + * @return Internal rule reference for shared list items. + */ + public String getListRuleId() { + return this.listRuleId == null ? null : this.listRuleId.getValue(); + } + + /** + * @param value Internal rule reference for shared list items. + */ + public StructureMapGroupRuleTargetComponent setListRuleId(String value) { + if (Utilities.noString(value)) + this.listRuleId = null; + else { + if (this.listRuleId == null) + this.listRuleId = new IdType(); + this.listRuleId.setValue(value); + } + return this; + } + + /** + * @return {@link #transform} (How the data is copied / created.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value + */ + public Enumeration getTransformElement() { + if (this.transform == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.transform"); + else if (Configuration.doAutoCreate()) + this.transform = new Enumeration(new StructureMapTransformEnumFactory()); // bb + return this.transform; + } + + public boolean hasTransformElement() { + return this.transform != null && !this.transform.isEmpty(); + } + + public boolean hasTransform() { + return this.transform != null && !this.transform.isEmpty(); + } + + /** + * @param value {@link #transform} (How the data is copied / created.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value + */ + public StructureMapGroupRuleTargetComponent setTransformElement(Enumeration value) { + this.transform = value; + return this; + } + + /** + * @return How the data is copied / created. + */ + public StructureMapTransform getTransform() { + return this.transform == null ? null : this.transform.getValue(); + } + + /** + * @param value How the data is copied / created. + */ + public StructureMapGroupRuleTargetComponent setTransform(StructureMapTransform value) { + if (value == null) + this.transform = null; + else { + if (this.transform == null) + this.transform = new Enumeration(new StructureMapTransformEnumFactory()); + this.transform.setValue(value); + } + return this; + } + + /** + * @return {@link #parameter} (Parameters to the transform.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (StructureMapGroupRuleTargetParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (Parameters to the transform.) + */ + // syntactic sugar + public StructureMapGroupRuleTargetParameterComponent addParameter() { //3 + StructureMapGroupRuleTargetParameterComponent t = new StructureMapGroupRuleTargetParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public StructureMapGroupRuleTargetComponent addParameter(StructureMapGroupRuleTargetParameterComponent t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("context", "id", "Type or variable this rule applies to.", 0, java.lang.Integer.MAX_VALUE, context)); + childrenList.add(new Property("contextType", "code", "How to interpret the context.", 0, java.lang.Integer.MAX_VALUE, contextType)); + childrenList.add(new Property("element", "string", "Field to create in the context.", 0, java.lang.Integer.MAX_VALUE, element)); + childrenList.add(new Property("variable", "id", "Named context for field, if desired, and a field is specified.", 0, java.lang.Integer.MAX_VALUE, variable)); + childrenList.add(new Property("listMode", "code", "If field is a list, how to manage the list.", 0, java.lang.Integer.MAX_VALUE, listMode)); + childrenList.add(new Property("listRuleId", "id", "Internal rule reference for shared list items.", 0, java.lang.Integer.MAX_VALUE, listRuleId)); + childrenList.add(new Property("transform", "code", "How the data is copied / created.", 0, java.lang.Integer.MAX_VALUE, transform)); + childrenList.add(new Property("parameter", "", "Parameters to the transform.", 0, java.lang.Integer.MAX_VALUE, parameter)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // IdType + case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration + case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // StringType + case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : new Base[] {this.variable}; // IdType + case 1345445729: /*listMode*/ return this.listMode == null ? new Base[0] : this.listMode.toArray(new Base[this.listMode.size()]); // Enumeration + case 337117045: /*listRuleId*/ return this.listRuleId == null ? new Base[0] : new Base[] {this.listRuleId}; // IdType + case 1052666732: /*transform*/ return this.transform == null ? new Base[0] : new Base[] {this.transform}; // Enumeration + case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // StructureMapGroupRuleTargetParameterComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 951530927: // context + this.context = castToId(value); // IdType + break; + case -102839927: // contextType + this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration + break; + case -1662836996: // element + this.element = castToString(value); // StringType + break; + case -1249586564: // variable + this.variable = castToId(value); // IdType + break; + case 1345445729: // listMode + this.getListMode().add(new StructureMapListModeEnumFactory().fromType(value)); // Enumeration + break; + case 337117045: // listRuleId + this.listRuleId = castToId(value); // IdType + break; + case 1052666732: // transform + this.transform = new StructureMapTransformEnumFactory().fromType(value); // Enumeration + break; + case 1954460585: // parameter + this.getParameter().add((StructureMapGroupRuleTargetParameterComponent) value); // StructureMapGroupRuleTargetParameterComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("context")) + this.context = castToId(value); // IdType + else if (name.equals("contextType")) + this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("element")) + this.element = castToString(value); // StringType + else if (name.equals("variable")) + this.variable = castToId(value); // IdType + else if (name.equals("listMode")) + this.getListMode().add(new StructureMapListModeEnumFactory().fromType(value)); + else if (name.equals("listRuleId")) + this.listRuleId = castToId(value); // IdType + else if (name.equals("transform")) + this.transform = new StructureMapTransformEnumFactory().fromType(value); // Enumeration + else if (name.equals("parameter")) + this.getParameter().add((StructureMapGroupRuleTargetParameterComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 951530927: throw new FHIRException("Cannot make property context as it is not a complex type"); // IdType + case -102839927: throw new FHIRException("Cannot make property contextType as it is not a complex type"); // Enumeration + case -1662836996: throw new FHIRException("Cannot make property element as it is not a complex type"); // StringType + case -1249586564: throw new FHIRException("Cannot make property variable as it is not a complex type"); // IdType + case 1345445729: throw new FHIRException("Cannot make property listMode as it is not a complex type"); // Enumeration + case 337117045: throw new FHIRException("Cannot make property listRuleId as it is not a complex type"); // IdType + case 1052666732: throw new FHIRException("Cannot make property transform as it is not a complex type"); // Enumeration + case 1954460585: return addParameter(); // StructureMapGroupRuleTargetParameterComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("context")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.context"); + } + else if (name.equals("contextType")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.contextType"); + } + else if (name.equals("element")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.element"); + } + else if (name.equals("variable")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable"); + } + else if (name.equals("listMode")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listMode"); + } + else if (name.equals("listRuleId")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listRuleId"); + } + else if (name.equals("transform")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.transform"); + } + else if (name.equals("parameter")) { + return addParameter(); + } + else + return super.addChild(name); + } + + public StructureMapGroupRuleTargetComponent copy() { + StructureMapGroupRuleTargetComponent dst = new StructureMapGroupRuleTargetComponent(); + copyValues(dst); + dst.context = context == null ? null : context.copy(); + dst.contextType = contextType == null ? null : contextType.copy(); + dst.element = element == null ? null : element.copy(); + dst.variable = variable == null ? null : variable.copy(); + if (listMode != null) { + dst.listMode = new ArrayList>(); + for (Enumeration i : listMode) + dst.listMode.add(i.copy()); + }; + dst.listRuleId = listRuleId == null ? null : listRuleId.copy(); + dst.transform = transform == null ? null : transform.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (StructureMapGroupRuleTargetParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapGroupRuleTargetComponent)) + return false; + StructureMapGroupRuleTargetComponent o = (StructureMapGroupRuleTargetComponent) other; + return compareDeep(context, o.context, true) && compareDeep(contextType, o.contextType, true) && compareDeep(element, o.element, true) + && compareDeep(variable, o.variable, true) && compareDeep(listMode, o.listMode, true) && compareDeep(listRuleId, o.listRuleId, true) + && compareDeep(transform, o.transform, true) && compareDeep(parameter, o.parameter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapGroupRuleTargetComponent)) + return false; + StructureMapGroupRuleTargetComponent o = (StructureMapGroupRuleTargetComponent) other; + return compareValues(context, o.context, true) && compareValues(contextType, o.contextType, true) && compareValues(element, o.element, true) + && compareValues(variable, o.variable, true) && compareValues(listMode, o.listMode, true) && compareValues(listRuleId, o.listRuleId, true) + && compareValues(transform, o.transform, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (context == null || context.isEmpty()) && (contextType == null || contextType.isEmpty()) + && (element == null || element.isEmpty()) && (variable == null || variable.isEmpty()) && (listMode == null || listMode.isEmpty()) + && (listRuleId == null || listRuleId.isEmpty()) && (transform == null || transform.isEmpty()) + && (parameter == null || parameter.isEmpty()); + } + + public String fhirType() { + return "StructureMap.group.rule.target"; + + } + + } + + @Block() + public static class StructureMapGroupRuleTargetParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Parameter value - variable or literal. + */ + @Child(name = "value", type = {IdType.class, StringType.class, BooleanType.class, IntegerType.class, DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Parameter value - variable or literal", formalDefinition="Parameter value - variable or literal." ) + protected Type value; + + private static final long serialVersionUID = -732981989L; + + /** + * Constructor + */ + public StructureMapGroupRuleTargetParameterComponent() { + super(); + } + + /** + * Constructor + */ + public StructureMapGroupRuleTargetParameterComponent(Type value) { + super(); + this.value = value; + } + + /** + * @return {@link #value} (Parameter value - variable or literal.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (Parameter value - variable or literal.) + */ + public IdType getValueIdType() throws FHIRException { + if (!(this.value instanceof IdType)) + throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IdType) this.value; + } + + public boolean hasValueIdType() { + return this.value instanceof IdType; + } + + /** + * @return {@link #value} (Parameter value - variable or literal.) + */ + public StringType getValueStringType() throws FHIRException { + if (!(this.value instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + public boolean hasValueStringType() { + return this.value instanceof StringType; + } + + /** + * @return {@link #value} (Parameter value - variable or literal.) + */ + public BooleanType getValueBooleanType() throws FHIRException { + if (!(this.value instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + public boolean hasValueBooleanType() { + return this.value instanceof BooleanType; + } + + /** + * @return {@link #value} (Parameter value - variable or literal.) + */ + public IntegerType getValueIntegerType() throws FHIRException { + if (!(this.value instanceof IntegerType)) + throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IntegerType) this.value; + } + + public boolean hasValueIntegerType() { + return this.value instanceof IntegerType; + } + + /** + * @return {@link #value} (Parameter value - variable or literal.) + */ + public DecimalType getValueDecimalType() throws FHIRException { + if (!(this.value instanceof DecimalType)) + throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DecimalType) this.value; + } + + public boolean hasValueDecimalType() { + return this.value instanceof DecimalType; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Parameter value - variable or literal.) + */ + public StructureMapGroupRuleTargetParameterComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 111972721: // value + this.value = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("value[x]")) + this.value = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1410166417: return getValue(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("valueId")) { + this.value = new IdType(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDecimal")) { + this.value = new DecimalType(); + return this.value; + } + else + return super.addChild(name); + } + + public StructureMapGroupRuleTargetParameterComponent copy() { + StructureMapGroupRuleTargetParameterComponent dst = new StructureMapGroupRuleTargetParameterComponent(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapGroupRuleTargetParameterComponent)) + return false; + StructureMapGroupRuleTargetParameterComponent o = (StructureMapGroupRuleTargetParameterComponent) other; + return compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapGroupRuleTargetParameterComponent)) + return false; + StructureMapGroupRuleTargetParameterComponent o = (StructureMapGroupRuleTargetParameterComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "StructureMap.group.rule.target.parameter"; + + } + + } + + @Block() + public static class StructureMapGroupRuleDependentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Name of a rule or group to apply. + */ + @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of a rule or group to apply", formalDefinition="Name of a rule or group to apply." ) + protected IdType name; + + /** + * Names of variables to pass to the rule or group. + */ + @Child(name = "variable", type = {StringType.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Names of variables to pass to the rule or group", formalDefinition="Names of variables to pass to the rule or group." ) + protected List variable; + + private static final long serialVersionUID = 1021661591L; + + /** + * Constructor + */ + public StructureMapGroupRuleDependentComponent() { + super(); + } + + /** + * Constructor + */ + public StructureMapGroupRuleDependentComponent(IdType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (Name of a rule or group to apply.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public IdType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleDependentComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new IdType(); // bb + 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} (Name of a rule or group to apply.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureMapGroupRuleDependentComponent setNameElement(IdType value) { + this.name = value; + return this; + } + + /** + * @return Name of a rule or group to apply. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name of a rule or group to apply. + */ + public StructureMapGroupRuleDependentComponent setName(String value) { + if (this.name == null) + this.name = new IdType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #variable} (Names of variables to pass to the rule or group.) + */ + public List getVariable() { + if (this.variable == null) + this.variable = new ArrayList(); + return this.variable; + } + + public boolean hasVariable() { + if (this.variable == null) + return false; + for (StringType item : this.variable) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #variable} (Names of variables to pass to the rule or group.) + */ + // syntactic sugar + public StringType addVariableElement() {//2 + StringType t = new StringType(); + if (this.variable == null) + this.variable = new ArrayList(); + this.variable.add(t); + return t; + } + + /** + * @param value {@link #variable} (Names of variables to pass to the rule or group.) + */ + public StructureMapGroupRuleDependentComponent addVariable(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.variable == null) + this.variable = new ArrayList(); + this.variable.add(t); + return this; + } + + /** + * @param value {@link #variable} (Names of variables to pass to the rule or group.) + */ + public boolean hasVariable(String value) { + if (this.variable == null) + return false; + for (StringType v : this.variable) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "id", "Name of a rule or group to apply.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("variable", "string", "Names of variables to pass to the rule or group.", 0, java.lang.Integer.MAX_VALUE, variable)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType + case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : this.variable.toArray(new Base[this.variable.size()]); // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToId(value); // IdType + break; + case -1249586564: // variable + this.getVariable().add(castToString(value)); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToId(value); // IdType + else if (name.equals("variable")) + this.getVariable().add(castToString(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // IdType + case -1249586564: throw new FHIRException("Cannot make property variable as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); + } + else if (name.equals("variable")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable"); + } + else + return super.addChild(name); + } + + public StructureMapGroupRuleDependentComponent copy() { + StructureMapGroupRuleDependentComponent dst = new StructureMapGroupRuleDependentComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (variable != null) { + dst.variable = new ArrayList(); + for (StringType i : variable) + dst.variable.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMapGroupRuleDependentComponent)) + return false; + StructureMapGroupRuleDependentComponent o = (StructureMapGroupRuleDependentComponent) other; + return compareDeep(name, o.name, true) && compareDeep(variable, o.variable, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMapGroupRuleDependentComponent)) + return false; + StructureMapGroupRuleDependentComponent o = (StructureMapGroupRuleDependentComponent) other; + return compareValues(name, o.name, true) && compareValues(variable, o.variable, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (variable == null || variable.isEmpty()) + ; + } + + public String fhirType() { + return "StructureMap.group.rule.dependent"; + + } + + } + + /** + * An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Absolute URL used to reference this StructureMap", formalDefinition="An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Other identifiers for the StructureMap", formalDefinition="Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) + protected List identifier; + + /** + * The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical id for this version of the StructureMap", formalDefinition="The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually." ) + protected StringType version; + + /** + * A free text natural language name identifying the StructureMap. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this StructureMap", formalDefinition="A free text natural language name identifying the StructureMap." ) + protected StringType name; + + /** + * The status of the StructureMap. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the StructureMap." ) + protected Enumeration status; + + /** + * This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the structure map. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the structure map." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes. + */ + @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for this version of the StructureMap", formalDefinition="The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes." ) + protected DateTimeType date; + + /** + * A free text natural language description of the StructureMap and its use. + */ + @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Natural language description of the StructureMap", formalDefinition="A free text natural language description of the StructureMap and its use." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps." ) + protected List useContext; + + /** + * Explains why this structure map is needed and why it's been designed as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Scope and Usage this structure map is for", formalDefinition="Explains why this structure map is needed and why it's been designed as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) + protected StringType copyright; + + /** + * A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced. + */ + @Child(name = "structure", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Structure Definition used by this map", formalDefinition="A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced." ) + protected List structure; + + /** + * Other maps used by this map (canonical URLs). + */ + @Child(name = "import", type = {UriType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Other maps used by this map (canonical URLs)", formalDefinition="Other maps used by this map (canonical URLs)." ) + protected List import_; + + /** + * Named sections for reader convenience. + */ + @Child(name = "group", type = {}, order=15, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Named sections for reader convenience", formalDefinition="Named sections for reader convenience." ) + protected List group; + + private static final long serialVersionUID = 710892955L; + + /** + * Constructor + */ + public StructureMap() { + super(); + } + + /** + * Constructor + */ + public StructureMap(UriType url, StringType name, Enumeration status) { + super(); + this.url = url; + this.name = name; + this.status = status; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMap.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StructureMap setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. + */ + public StructureMap setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + 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} (Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public StructureMap addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMap.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StructureMap setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually. + */ + public StructureMap setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the StructureMap.). 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 StructureMap.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name identifying the StructureMap.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StructureMap setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the StructureMap. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the StructureMap. + */ + public StructureMap setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of the StructureMap.). 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 StructureMap.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 StructureMap.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public StructureMap setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the StructureMap. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the StructureMap. + */ + public StructureMap setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMap.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public StructureMap setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public StructureMap setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the structure map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMap.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the structure map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StructureMap setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the structure map. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the structure map. + */ + public StructureMap setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (StructureMapContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public StructureMapContactComponent addContact() { //3 + StructureMapContactComponent t = new StructureMapContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public StructureMap addContact(StructureMapContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.). 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 StructureMap.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public StructureMap setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes. + */ + public StructureMap setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the StructureMap and its use.). 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 StructureMap.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the StructureMap and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StructureMap setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the StructureMap and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the StructureMap and its use. + */ + public StructureMap 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public StructureMap addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #requirements} (Explains why this structure map is needed and why it's been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMap.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this structure map is needed and why it's been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StructureMap setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this structure map is needed and why it's been designed as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this structure map is needed and why it's been designed as it has. + */ + public StructureMap setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMap.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StructureMap setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public StructureMap setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #structure} (A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.) + */ + public List getStructure() { + if (this.structure == null) + this.structure = new ArrayList(); + return this.structure; + } + + public boolean hasStructure() { + if (this.structure == null) + return false; + for (StructureMapStructureComponent item : this.structure) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #structure} (A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.) + */ + // syntactic sugar + public StructureMapStructureComponent addStructure() { //3 + StructureMapStructureComponent t = new StructureMapStructureComponent(); + if (this.structure == null) + this.structure = new ArrayList(); + this.structure.add(t); + return t; + } + + // syntactic sugar + public StructureMap addStructure(StructureMapStructureComponent t) { //3 + if (t == null) + return this; + if (this.structure == null) + this.structure = new ArrayList(); + this.structure.add(t); + return this; + } + + /** + * @return {@link #import_} (Other maps used by this map (canonical URLs).) + */ + public List getImport() { + if (this.import_ == null) + this.import_ = new ArrayList(); + return this.import_; + } + + public boolean hasImport() { + if (this.import_ == null) + return false; + for (UriType item : this.import_) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #import_} (Other maps used by this map (canonical URLs).) + */ + // syntactic sugar + public UriType addImportElement() {//2 + UriType t = new UriType(); + if (this.import_ == null) + this.import_ = new ArrayList(); + this.import_.add(t); + return t; + } + + /** + * @param value {@link #import_} (Other maps used by this map (canonical URLs).) + */ + public StructureMap addImport(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.import_ == null) + this.import_ = new ArrayList(); + this.import_.add(t); + return this; + } + + /** + * @param value {@link #import_} (Other maps used by this map (canonical URLs).) + */ + public boolean hasImport(String value) { + if (this.import_ == null) + return false; + for (UriType v : this.import_) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #group} (Named sections for reader convenience.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (StructureMapGroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (Named sections for reader convenience.) + */ + // syntactic sugar + public StructureMapGroupComponent addGroup() { //3 + StructureMapGroupComponent t = new StructureMapGroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + // syntactic sugar + public StructureMap addGroup(StructureMapGroupComponent t) { //3 + if (t == null) + return this; + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the StructureMap.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the StructureMap.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the structure map.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A free text natural language description of the StructureMap and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("requirements", "string", "Explains why this structure map is needed and why it's been designed as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("structure", "", "A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.", 0, java.lang.Integer.MAX_VALUE, structure)); + childrenList.add(new Property("import", "uri", "Other maps used by this map (canonical URLs).", 0, java.lang.Integer.MAX_VALUE, import_)); + childrenList.add(new Property("group", "", "Named sections for reader convenience.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // StructureMapContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case 144518515: /*structure*/ return this.structure == null ? new Base[0] : this.structure.toArray(new Base[this.structure.size()]); // StructureMapStructureComponent + case -1184795739: /*import*/ return this.import_ == null ? new Base[0] : this.import_.toArray(new Base[this.import_.size()]); // UriType + case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // StructureMapGroupComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((StructureMapContactComponent) value); // StructureMapContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case 144518515: // structure + this.getStructure().add((StructureMapStructureComponent) value); // StructureMapStructureComponent + break; + case -1184795739: // import + this.getImport().add(castToUri(value)); // UriType + break; + case 98629247: // group + this.getGroup().add((StructureMapGroupComponent) value); // StructureMapGroupComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((StructureMapContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("structure")) + this.getStructure().add((StructureMapStructureComponent) value); + else if (name.equals("import")) + this.getImport().add(castToUri(value)); + else if (name.equals("group")) + this.getGroup().add((StructureMapGroupComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return addIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // StructureMapContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case 144518515: return addStructure(); // StructureMapStructureComponent + case -1184795739: throw new FHIRException("Cannot make property import as it is not a complex type"); // UriType + case 98629247: return addGroup(); // StructureMapGroupComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.url"); + } + else if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.requirements"); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.copyright"); + } + else if (name.equals("structure")) { + return addStructure(); + } + else if (name.equals("import")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.import"); + } + else if (name.equals("group")) { + return addGroup(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "StructureMap"; + + } + + public StructureMap copy() { + StructureMap dst = new StructureMap(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (StructureMapContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + if (structure != null) { + dst.structure = new ArrayList(); + for (StructureMapStructureComponent i : structure) + dst.structure.add(i.copy()); + }; + if (import_ != null) { + dst.import_ = new ArrayList(); + for (UriType i : import_) + dst.import_.add(i.copy()); + }; + if (group != null) { + dst.group = new ArrayList(); + for (StructureMapGroupComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + protected StructureMap typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof StructureMap)) + return false; + StructureMap o = (StructureMap) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) + && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(structure, o.structure, true) && compareDeep(import_, o.import_, true) && compareDeep(group, o.group, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof StructureMap)) + return false; + StructureMap o = (StructureMap) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(copyright, o.copyright, true) && compareValues(import_, o.import_, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) + && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (structure == null || structure.isEmpty()) + && (import_ == null || import_.isEmpty()) && (group == null || group.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.StructureMap; + } + + /** + * Search parameter: status + *

+ * Description: The current status of the profile
+ * Type: token
+ * Path: StructureMap.status
+ *

+ */ + @SearchParamDefinition(name="status", path="StructureMap.status", description="The current status of the profile", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the profile
+ * Type: token
+ * Path: StructureMap.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the profile
+ * Type: string
+ * Path: StructureMap.description
+ *

+ */ + @SearchParamDefinition(name="description", path="StructureMap.description", description="Text search in the description of the profile", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the profile
+ * Type: string
+ * Path: StructureMap.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: Name of the profile
+ * Type: string
+ * Path: StructureMap.name
+ *

+ */ + @SearchParamDefinition(name="name", path="StructureMap.name", description="Name of the profile", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the profile
+ * Type: string
+ * Path: StructureMap.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the structure
+ * Type: token
+ * Path: StructureMap.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="StructureMap.useContext", description="A use context assigned to the structure", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the structure
+ * Type: token
+ * Path: StructureMap.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: experimental + *

+ * Description: Whether the map is defined purely for experimental reasons
+ * Type: token
+ * Path: StructureMap.experimental
+ *

+ */ + @SearchParamDefinition(name="experimental", path="StructureMap.experimental", description="Whether the map is defined purely for experimental reasons", type="token" ) + public static final String SP_EXPERIMENTAL = "experimental"; + /** + * Fluent Client search parameter constant for experimental + *

+ * Description: Whether the map is defined purely for experimental reasons
+ * Type: token
+ * Path: StructureMap.experimental
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL); + + /** + * Search parameter: date + *

+ * Description: The profile publication date
+ * Type: date
+ * Path: StructureMap.date
+ *

+ */ + @SearchParamDefinition(name="date", path="StructureMap.date", description="The profile publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The profile publication date
+ * Type: date
+ * Path: StructureMap.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: The identifier of the profile
+ * Type: token
+ * Path: StructureMap.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="StructureMap.identifier", description="The identifier of the profile", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier of the profile
+ * Type: token
+ * Path: StructureMap.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: url + *

+ * Description: The url that identifies the structure map
+ * Type: uri
+ * Path: StructureMap.url
+ *

+ */ + @SearchParamDefinition(name="url", path="StructureMap.url", description="The url that identifies the structure map", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: The url that identifies the structure map
+ * Type: uri
+ * Path: StructureMap.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the profile
+ * Type: string
+ * Path: StructureMap.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="StructureMap.publisher", description="Name of the publisher of the profile", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the profile
+ * Type: string
+ * Path: StructureMap.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the profile
+ * Type: token
+ * Path: StructureMap.version
+ *

+ */ + @SearchParamDefinition(name="version", path="StructureMap.version", description="The version identifier of the profile", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the profile
+ * Type: token
+ * Path: StructureMap.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Subscription.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Subscription.java new file mode 100644 index 00000000000..15ee6c5f87b --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Subscription.java @@ -0,0 +1,1420 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. + */ +@ResourceDef(name="Subscription", profile="http://hl7.org/fhir/Profile/Subscription") +public class Subscription extends DomainResource { + + public enum SubscriptionStatus { + /** + * The client has requested the subscription, and the server has not yet set it up. + */ + REQUESTED, + /** + * The subscription is active. + */ + ACTIVE, + /** + * The server has an error executing the notification. + */ + ERROR, + /** + * Too many errors have occurred or the subscription has expired. + */ + OFF, + /** + * added to help the parsers + */ + NULL; + public static SubscriptionStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("active".equals(codeString)) + return ACTIVE; + if ("error".equals(codeString)) + return ERROR; + if ("off".equals(codeString)) + return OFF; + throw new FHIRException("Unknown SubscriptionStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case ACTIVE: return "active"; + case ERROR: return "error"; + case OFF: return "off"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return "http://hl7.org/fhir/subscription-status"; + case ACTIVE: return "http://hl7.org/fhir/subscription-status"; + case ERROR: return "http://hl7.org/fhir/subscription-status"; + case OFF: return "http://hl7.org/fhir/subscription-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "The client has requested the subscription, and the server has not yet set it up."; + case ACTIVE: return "The subscription is active."; + case ERROR: return "The server has an error executing the notification."; + case OFF: return "Too many errors have occurred or the subscription has expired."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "Requested"; + case ACTIVE: return "Active"; + case ERROR: return "Error"; + case OFF: return "Off"; + default: return "?"; + } + } + } + + 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; + if ("requested".equals(codeString)) + return SubscriptionStatus.REQUESTED; + if ("active".equals(codeString)) + return SubscriptionStatus.ACTIVE; + if ("error".equals(codeString)) + return SubscriptionStatus.ERROR; + if ("off".equals(codeString)) + return SubscriptionStatus.OFF; + throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return new Enumeration(this, SubscriptionStatus.REQUESTED); + if ("active".equals(codeString)) + return new Enumeration(this, SubscriptionStatus.ACTIVE); + if ("error".equals(codeString)) + return new Enumeration(this, SubscriptionStatus.ERROR); + if ("off".equals(codeString)) + return new Enumeration(this, SubscriptionStatus.OFF); + throw new FHIRException("Unknown SubscriptionStatus code '"+codeString+"'"); + } + public String toCode(SubscriptionStatus code) { + if (code == SubscriptionStatus.REQUESTED) + return "requested"; + if (code == SubscriptionStatus.ACTIVE) + return "active"; + if (code == SubscriptionStatus.ERROR) + return "error"; + if (code == SubscriptionStatus.OFF) + return "off"; + return "?"; + } + public String toSystem(SubscriptionStatus code) { + return code.getSystem(); + } + } + + public enum SubscriptionChannelType { + /** + * 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. + */ + RESTHOOK, + /** + * The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL. + */ + WEBSOCKET, + /** + * The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:). + */ + EMAIL, + /** + * The channel is executed by sending an SMS message to the phone number identified in the URL (tel:). + */ + SMS, + /** + * The channel is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc.) to the application identified in the URI. + */ + MESSAGE, + /** + * added to help the parsers + */ + NULL; + public static SubscriptionChannelType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("rest-hook".equals(codeString)) + return RESTHOOK; + if ("websocket".equals(codeString)) + return WEBSOCKET; + if ("email".equals(codeString)) + return EMAIL; + if ("sms".equals(codeString)) + return SMS; + if ("message".equals(codeString)) + return MESSAGE; + throw new FHIRException("Unknown SubscriptionChannelType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case RESTHOOK: return "rest-hook"; + case WEBSOCKET: return "websocket"; + case EMAIL: return "email"; + case SMS: return "sms"; + case MESSAGE: return "message"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RESTHOOK: return "http://hl7.org/fhir/subscription-channel-type"; + case WEBSOCKET: return "http://hl7.org/fhir/subscription-channel-type"; + case EMAIL: return "http://hl7.org/fhir/subscription-channel-type"; + case SMS: return "http://hl7.org/fhir/subscription-channel-type"; + case MESSAGE: return "http://hl7.org/fhir/subscription-channel-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RESTHOOK: return "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."; + case WEBSOCKET: return "The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL."; + case EMAIL: return "The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:)."; + case SMS: return "The channel is executed by sending an SMS message to the phone number identified in the URL (tel:)."; + case MESSAGE: return "The channel is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc.) to the application identified in the URI."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RESTHOOK: return "Rest Hook"; + case WEBSOCKET: return "Websocket"; + case EMAIL: return "Email"; + case SMS: return "SMS"; + case MESSAGE: return "Message"; + default: return "?"; + } + } + } + + 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; + if ("rest-hook".equals(codeString)) + return SubscriptionChannelType.RESTHOOK; + if ("websocket".equals(codeString)) + return SubscriptionChannelType.WEBSOCKET; + if ("email".equals(codeString)) + return SubscriptionChannelType.EMAIL; + if ("sms".equals(codeString)) + return SubscriptionChannelType.SMS; + if ("message".equals(codeString)) + return SubscriptionChannelType.MESSAGE; + throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("rest-hook".equals(codeString)) + return new Enumeration(this, SubscriptionChannelType.RESTHOOK); + if ("websocket".equals(codeString)) + return new Enumeration(this, SubscriptionChannelType.WEBSOCKET); + if ("email".equals(codeString)) + return new Enumeration(this, SubscriptionChannelType.EMAIL); + if ("sms".equals(codeString)) + return new Enumeration(this, SubscriptionChannelType.SMS); + if ("message".equals(codeString)) + return new Enumeration(this, SubscriptionChannelType.MESSAGE); + throw new FHIRException("Unknown SubscriptionChannelType code '"+codeString+"'"); + } + public String toCode(SubscriptionChannelType code) { + if (code == SubscriptionChannelType.RESTHOOK) + return "rest-hook"; + if (code == SubscriptionChannelType.WEBSOCKET) + return "websocket"; + if (code == SubscriptionChannelType.EMAIL) + return "email"; + if (code == SubscriptionChannelType.SMS) + return "sms"; + if (code == SubscriptionChannelType.MESSAGE) + return "message"; + return "?"; + } + public String toSystem(SubscriptionChannelType code) { + return code.getSystem(); + } + } + + @Block() + public static class SubscriptionChannelComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The type of channel to send notifications on. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="rest-hook | websocket | email | sms | message", formalDefinition="The type of channel to send notifications on." ) + protected Enumeration type; + + /** + * The uri that describes the actual end-point to send messages to. + */ + @Child(name = "endpoint", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where the channel points to", formalDefinition="The uri that describes the actual end-point to send messages to." ) + protected UriType endpoint; + + /** + * The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. + */ + @Child(name = "payload", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Mimetype to send, or blank for no payload", formalDefinition="The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification." ) + protected StringType payload; + + /** + * Additional headers / information to send as part of the notification. + */ + @Child(name = "header", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Usage depends on the channel type", formalDefinition="Additional headers / information to send as part of the notification." ) + protected StringType header; + + private static final long serialVersionUID = -279715391L; + + /** + * Constructor + */ + public SubscriptionChannelComponent() { + super(); + } + + /** + * Constructor + */ + public SubscriptionChannelComponent(Enumeration type, StringType payload) { + super(); + this.type = type; + this.payload = payload; + } + + /** + * @return {@link #type} (The type of channel to send notifications on.). 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 SubscriptionChannelComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new SubscriptionChannelTypeEnumFactory()); // bb + 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 of channel to send notifications on.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SubscriptionChannelComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of channel to send notifications on. + */ + public SubscriptionChannelType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of channel to send notifications on. + */ + public SubscriptionChannelComponent setType(SubscriptionChannelType value) { + if (this.type == null) + this.type = new Enumeration(new SubscriptionChannelTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #endpoint} (The uri that describes the actual end-point to send messages to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); // bb + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (The uri that describes the actual end-point to send messages to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public SubscriptionChannelComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return The uri that describes the actual end-point to send messages to. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value The uri that describes the actual end-point to send messages to. + */ + public SubscriptionChannelComponent setEndpoint(String value) { + if (Utilities.noString(value)) + this.endpoint = null; + else { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + } + return this; + } + + /** + * @return {@link #payload} (The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value + */ + public StringType getPayloadElement() { + if (this.payload == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.payload"); + else if (Configuration.doAutoCreate()) + this.payload = new StringType(); // bb + return this.payload; + } + + public boolean hasPayloadElement() { + return this.payload != null && !this.payload.isEmpty(); + } + + public boolean hasPayload() { + return this.payload != null && !this.payload.isEmpty(); + } + + /** + * @param value {@link #payload} (The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value + */ + public SubscriptionChannelComponent setPayloadElement(StringType value) { + this.payload = value; + return this; + } + + /** + * @return The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. + */ + public String getPayload() { + return this.payload == null ? null : this.payload.getValue(); + } + + /** + * @param value The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. + */ + public SubscriptionChannelComponent setPayload(String value) { + if (this.payload == null) + this.payload = new StringType(); + this.payload.setValue(value); + return this; + } + + /** + * @return {@link #header} (Additional headers / information to send as part of the notification.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value + */ + public StringType getHeaderElement() { + if (this.header == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.header"); + else if (Configuration.doAutoCreate()) + this.header = new StringType(); // bb + return this.header; + } + + public boolean hasHeaderElement() { + return this.header != null && !this.header.isEmpty(); + } + + public boolean hasHeader() { + return this.header != null && !this.header.isEmpty(); + } + + /** + * @param value {@link #header} (Additional headers / information to send as part of the notification.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value + */ + public SubscriptionChannelComponent setHeaderElement(StringType value) { + this.header = value; + return this; + } + + /** + * @return Additional headers / information to send as part of the notification. + */ + public String getHeader() { + return this.header == null ? null : this.header.getValue(); + } + + /** + * @param value Additional headers / information to send as part of the notification. + */ + public SubscriptionChannelComponent setHeader(String value) { + if (Utilities.noString(value)) + this.header = null; + else { + if (this.header == null) + this.header = new StringType(); + this.header.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of channel to send notifications on.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("endpoint", "uri", "The uri that describes the actual end-point to send messages to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + childrenList.add(new Property("payload", "string", "The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.", 0, java.lang.Integer.MAX_VALUE, payload)); + childrenList.add(new Property("header", "string", "Additional headers / information to send as part of the notification.", 0, java.lang.Integer.MAX_VALUE, header)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : new Base[] {this.endpoint}; // UriType + case -786701938: /*payload*/ return this.payload == null ? new Base[0] : new Base[] {this.payload}; // StringType + case -1221270899: /*header*/ return this.header == null ? new Base[0] : new Base[] {this.header}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new SubscriptionChannelTypeEnumFactory().fromType(value); // Enumeration + break; + case 1741102485: // endpoint + this.endpoint = castToUri(value); // UriType + break; + case -786701938: // payload + this.payload = castToString(value); // StringType + break; + case -1221270899: // header + this.header = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new SubscriptionChannelTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("endpoint")) + this.endpoint = castToUri(value); // UriType + else if (name.equals("payload")) + this.payload = castToString(value); // StringType + else if (name.equals("header")) + this.header = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 1741102485: throw new FHIRException("Cannot make property endpoint as it is not a complex type"); // UriType + case -786701938: throw new FHIRException("Cannot make property payload as it is not a complex type"); // StringType + case -1221270899: throw new FHIRException("Cannot make property header as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.type"); + } + else if (name.equals("endpoint")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.endpoint"); + } + else if (name.equals("payload")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.payload"); + } + else if (name.equals("header")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.header"); + } + else + return super.addChild(name); + } + + public SubscriptionChannelComponent copy() { + SubscriptionChannelComponent dst = new SubscriptionChannelComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + dst.payload = payload == null ? null : payload.copy(); + dst.header = header == null ? null : header.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubscriptionChannelComponent)) + return false; + SubscriptionChannelComponent o = (SubscriptionChannelComponent) other; + return compareDeep(type, o.type, true) && compareDeep(endpoint, o.endpoint, true) && compareDeep(payload, o.payload, true) + && compareDeep(header, o.header, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubscriptionChannelComponent)) + return false; + SubscriptionChannelComponent o = (SubscriptionChannelComponent) other; + return compareValues(type, o.type, true) && compareValues(endpoint, o.endpoint, true) && compareValues(payload, o.payload, true) + && compareValues(header, o.header, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (endpoint == null || endpoint.isEmpty()) + && (payload == null || payload.isEmpty()) && (header == null || header.isEmpty()); + } + + public String fhirType() { + return "Subscription.channel"; + + } + + } + + /** + * The rules that the server should use to determine when to generate notifications for this subscription. + */ + @Child(name = "criteria", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Rule for server push criteria", formalDefinition="The rules that the server should use to determine when to generate notifications for this subscription." ) + protected StringType criteria; + + /** + * Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. + */ + @Child(name = "contact", type = {ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for source (e.g. troubleshooting)", formalDefinition="Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting." ) + protected List contact; + + /** + * A description of why this subscription is defined. + */ + @Child(name = "reason", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Description of why this subscription was created", formalDefinition="A description of why this subscription is defined." ) + protected StringType reason; + + /** + * The status of the subscription, which marks the server state for managing the subscription. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="requested | active | error | off", formalDefinition="The status of the subscription, which marks the server state for managing the subscription." ) + protected Enumeration status; + + /** + * A record of the last error that occurred when the server processed a notification. + */ + @Child(name = "error", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Latest error note", formalDefinition="A record of the last error that occurred when the server processed a notification." ) + protected StringType error; + + /** + * Details where to send notifications when resources are received that meet the criteria. + */ + @Child(name = "channel", type = {}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The channel on which to report matches to the criteria", formalDefinition="Details where to send notifications when resources are received that meet the criteria." ) + protected SubscriptionChannelComponent channel; + + /** + * The time for the server to turn the subscription off. + */ + @Child(name = "end", type = {InstantType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When to automatically delete the subscription", formalDefinition="The time for the server to turn the subscription off." ) + protected InstantType end; + + /** + * A tag to add to any resource that matches the criteria, after the subscription is processed. + */ + @Child(name = "tag", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A tag to add to matching resources", formalDefinition="A tag to add to any resource that matches the criteria, after the subscription is processed." ) + protected List tag; + + private static final long serialVersionUID = -1390870804L; + + /** + * Constructor + */ + public Subscription() { + super(); + } + + /** + * Constructor + */ + public Subscription(StringType criteria, StringType reason, Enumeration status, SubscriptionChannelComponent channel) { + super(); + this.criteria = criteria; + this.reason = reason; + this.status = status; + this.channel = channel; + } + + /** + * @return {@link #criteria} (The rules that the server should use to determine when to generate notifications for this subscription.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public StringType getCriteriaElement() { + if (this.criteria == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.criteria"); + else if (Configuration.doAutoCreate()) + this.criteria = new StringType(); // bb + return this.criteria; + } + + public boolean hasCriteriaElement() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + public boolean hasCriteria() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + /** + * @param value {@link #criteria} (The rules that the server should use to determine when to generate notifications for this subscription.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public Subscription setCriteriaElement(StringType value) { + this.criteria = value; + return this; + } + + /** + * @return The rules that the server should use to determine when to generate notifications for this subscription. + */ + public String getCriteria() { + return this.criteria == null ? null : this.criteria.getValue(); + } + + /** + * @param value The rules that the server should use to determine when to generate notifications for this subscription. + */ + public Subscription setCriteria(String value) { + if (this.criteria == null) + this.criteria = new StringType(); + this.criteria.setValue(value); + return this; + } + + /** + * @return {@link #contact} (Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactPoint item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.) + */ + // syntactic sugar + public ContactPoint addContact() { //3 + ContactPoint t = new ContactPoint(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public Subscription addContact(ContactPoint t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #reason} (A description of why this subscription is defined.). 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 Subscription.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new StringType(); // bb + 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} (A description of why this subscription is defined.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public Subscription setReasonElement(StringType value) { + this.reason = value; + return this; + } + + /** + * @return A description of why this subscription is defined. + */ + public String getReason() { + return this.reason == null ? null : this.reason.getValue(); + } + + /** + * @param value A description of why this subscription is defined. + */ + public Subscription setReason(String value) { + if (this.reason == null) + this.reason = new StringType(); + this.reason.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of the subscription, which marks the server state for managing the subscription.). 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 Subscription.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new SubscriptionStatusEnumFactory()); // bb + 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 subscription, which marks the server state for managing the subscription.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Subscription setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the subscription, which marks the server state for managing the subscription. + */ + public SubscriptionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the subscription, which marks the server state for managing the subscription. + */ + public Subscription setStatus(SubscriptionStatus value) { + if (this.status == null) + this.status = new Enumeration(new SubscriptionStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #error} (A record of the last error that occurred when the server processed a notification.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value + */ + public StringType getErrorElement() { + if (this.error == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.error"); + else if (Configuration.doAutoCreate()) + this.error = new StringType(); // bb + return this.error; + } + + public boolean hasErrorElement() { + return this.error != null && !this.error.isEmpty(); + } + + public boolean hasError() { + return this.error != null && !this.error.isEmpty(); + } + + /** + * @param value {@link #error} (A record of the last error that occurred when the server processed a notification.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value + */ + public Subscription setErrorElement(StringType value) { + this.error = value; + return this; + } + + /** + * @return A record of the last error that occurred when the server processed a notification. + */ + public String getError() { + return this.error == null ? null : this.error.getValue(); + } + + /** + * @param value A record of the last error that occurred when the server processed a notification. + */ + public Subscription setError(String value) { + if (Utilities.noString(value)) + this.error = null; + else { + if (this.error == null) + this.error = new StringType(); + this.error.setValue(value); + } + return this; + } + + /** + * @return {@link #channel} (Details where to send notifications when resources are received that meet the criteria.) + */ + public SubscriptionChannelComponent getChannel() { + if (this.channel == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.channel"); + else if (Configuration.doAutoCreate()) + this.channel = new SubscriptionChannelComponent(); // cc + return this.channel; + } + + public boolean hasChannel() { + return this.channel != null && !this.channel.isEmpty(); + } + + /** + * @param value {@link #channel} (Details where to send notifications when resources are received that meet the criteria.) + */ + public Subscription setChannel(SubscriptionChannelComponent value) { + this.channel = value; + return this; + } + + /** + * @return {@link #end} (The time for the server to turn the subscription off.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); // bb + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (The time for the server to turn the subscription off.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Subscription setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return The time for the server to turn the subscription off. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value The time for the server to turn the subscription off. + */ + public Subscription setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + } + return this; + } + + /** + * @return {@link #tag} (A tag to add to any resource that matches the criteria, after the subscription is processed.) + */ + public List getTag() { + if (this.tag == null) + this.tag = new ArrayList(); + return this.tag; + } + + public boolean hasTag() { + if (this.tag == null) + return false; + for (Coding item : this.tag) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #tag} (A tag to add to any resource that matches the criteria, after the subscription is processed.) + */ + // syntactic sugar + public Coding addTag() { //3 + Coding t = new Coding(); + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return t; + } + + // syntactic sugar + public Subscription addTag(Coding t) { //3 + if (t == null) + return this; + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("criteria", "string", "The rules that the server should use to determine when to generate notifications for this subscription.", 0, java.lang.Integer.MAX_VALUE, criteria)); + childrenList.add(new Property("contact", "ContactPoint", "Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("reason", "string", "A description of why this subscription is defined.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("status", "code", "The status of the subscription, which marks the server state for managing the subscription.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("error", "string", "A record of the last error that occurred when the server processed a notification.", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("channel", "", "Details where to send notifications when resources are received that meet the criteria.", 0, java.lang.Integer.MAX_VALUE, channel)); + childrenList.add(new Property("end", "instant", "The time for the server to turn the subscription off.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("tag", "Coding", "A tag to add to any resource that matches the criteria, after the subscription is processed.", 0, java.lang.Integer.MAX_VALUE, tag)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1952046943: /*criteria*/ return this.criteria == null ? new Base[0] : new Base[] {this.criteria}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 96784904: /*error*/ return this.error == null ? new Base[0] : new Base[] {this.error}; // StringType + case 738950403: /*channel*/ return this.channel == null ? new Base[0] : new Base[] {this.channel}; // SubscriptionChannelComponent + case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType + case 114586: /*tag*/ return this.tag == null ? new Base[0] : this.tag.toArray(new Base[this.tag.size()]); // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1952046943: // criteria + this.criteria = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add(castToContactPoint(value)); // ContactPoint + break; + case -934964668: // reason + this.reason = castToString(value); // StringType + break; + case -892481550: // status + this.status = new SubscriptionStatusEnumFactory().fromType(value); // Enumeration + break; + case 96784904: // error + this.error = castToString(value); // StringType + break; + case 738950403: // channel + this.channel = (SubscriptionChannelComponent) value; // SubscriptionChannelComponent + break; + case 100571: // end + this.end = castToInstant(value); // InstantType + break; + case 114586: // tag + this.getTag().add(castToCoding(value)); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("criteria")) + this.criteria = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add(castToContactPoint(value)); + else if (name.equals("reason")) + this.reason = castToString(value); // StringType + else if (name.equals("status")) + this.status = new SubscriptionStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("error")) + this.error = castToString(value); // StringType + else if (name.equals("channel")) + this.channel = (SubscriptionChannelComponent) value; // SubscriptionChannelComponent + else if (name.equals("end")) + this.end = castToInstant(value); // InstantType + else if (name.equals("tag")) + this.getTag().add(castToCoding(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1952046943: throw new FHIRException("Cannot make property criteria as it is not a complex type"); // StringType + case 951526432: return addContact(); // ContactPoint + case -934964668: throw new FHIRException("Cannot make property reason as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 96784904: throw new FHIRException("Cannot make property error as it is not a complex type"); // StringType + case 738950403: return getChannel(); // SubscriptionChannelComponent + case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType + case 114586: return addTag(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("criteria")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.criteria"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("reason")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.reason"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.status"); + } + else if (name.equals("error")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.error"); + } + else if (name.equals("channel")) { + this.channel = new SubscriptionChannelComponent(); + return this.channel; + } + else if (name.equals("end")) { + throw new FHIRException("Cannot call addChild on a primitive type Subscription.end"); + } + else if (name.equals("tag")) { + return addTag(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Subscription"; + + } + + public Subscription copy() { + Subscription dst = new Subscription(); + copyValues(dst); + dst.criteria = criteria == null ? null : criteria.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactPoint i : contact) + dst.contact.add(i.copy()); + }; + dst.reason = reason == null ? null : reason.copy(); + dst.status = status == null ? null : status.copy(); + dst.error = error == null ? null : error.copy(); + dst.channel = channel == null ? null : channel.copy(); + dst.end = end == null ? null : end.copy(); + if (tag != null) { + dst.tag = new ArrayList(); + for (Coding i : tag) + dst.tag.add(i.copy()); + }; + return dst; + } + + protected Subscription typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Subscription)) + return false; + Subscription o = (Subscription) other; + return compareDeep(criteria, o.criteria, true) && compareDeep(contact, o.contact, true) && compareDeep(reason, o.reason, true) + && compareDeep(status, o.status, true) && compareDeep(error, o.error, true) && compareDeep(channel, o.channel, true) + && compareDeep(end, o.end, true) && compareDeep(tag, o.tag, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Subscription)) + return false; + Subscription o = (Subscription) other; + return compareValues(criteria, o.criteria, true) && compareValues(reason, o.reason, true) && compareValues(status, o.status, true) + && compareValues(error, o.error, true) && compareValues(end, o.end, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (criteria == null || criteria.isEmpty()) && (contact == null || contact.isEmpty()) + && (reason == null || reason.isEmpty()) && (status == null || status.isEmpty()) && (error == null || error.isEmpty()) + && (channel == null || channel.isEmpty()) && (end == null || end.isEmpty()) && (tag == null || tag.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Subscription; + } + + /** + * Search parameter: criteria + *

+ * Description: Rule for server push criteria
+ * Type: string
+ * Path: Subscription.criteria
+ *

+ */ + @SearchParamDefinition(name="criteria", path="Subscription.criteria", description="Rule for server push criteria", type="string" ) + public static final String SP_CRITERIA = "criteria"; + /** + * Fluent Client search parameter constant for criteria + *

+ * Description: Rule for server push criteria
+ * Type: string
+ * Path: Subscription.criteria
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam CRITERIA = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_CRITERIA); + + /** + * Search parameter: status + *

+ * Description: requested | active | error | off
+ * Type: token
+ * Path: Subscription.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Subscription.status", description="requested | active | error | off", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: requested | active | error | off
+ * Type: token
+ * Path: Subscription.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: tag + *

+ * Description: A tag to add to matching resources
+ * Type: token
+ * Path: Subscription.tag
+ *

+ */ + @SearchParamDefinition(name="tag", path="Subscription.tag", description="A tag to add to matching resources", type="token" ) + public static final String SP_TAG = "tag"; + /** + * Fluent Client search parameter constant for tag + *

+ * Description: A tag to add to matching resources
+ * Type: token
+ * Path: Subscription.tag
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TAG = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TAG); + + /** + * Search parameter: payload + *

+ * Description: Mimetype to send, or blank for no payload
+ * Type: string
+ * Path: Subscription.channel.payload
+ *

+ */ + @SearchParamDefinition(name="payload", path="Subscription.channel.payload", description="Mimetype to send, or blank for no payload", type="string" ) + public static final String SP_PAYLOAD = "payload"; + /** + * Fluent Client search parameter constant for payload + *

+ * Description: Mimetype to send, or blank for no payload
+ * Type: string
+ * Path: Subscription.channel.payload
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PAYLOAD = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PAYLOAD); + + /** + * Search parameter: type + *

+ * Description: rest-hook | websocket | email | sms | message
+ * Type: token
+ * Path: Subscription.channel.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Subscription.channel.type", description="rest-hook | websocket | email | sms | message", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: rest-hook | websocket | email | sms | message
+ * Type: token
+ * Path: Subscription.channel.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: contact + *

+ * Description: Contact details for source (e.g. troubleshooting)
+ * Type: token
+ * Path: Subscription.contact
+ *

+ */ + @SearchParamDefinition(name="contact", path="Subscription.contact", description="Contact details for source (e.g. troubleshooting)", type="token" ) + public static final String SP_CONTACT = "contact"; + /** + * Fluent Client search parameter constant for contact + *

+ * Description: Contact details for source (e.g. troubleshooting)
+ * Type: token
+ * Path: Subscription.contact
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTACT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTACT); + + /** + * Search parameter: url + *

+ * Description: Where the channel points to
+ * Type: uri
+ * Path: Subscription.channel.endpoint
+ *

+ */ + @SearchParamDefinition(name="url", path="Subscription.channel.endpoint", description="Where the channel points to", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: Where the channel points to
+ * Type: uri
+ * Path: Subscription.channel.endpoint
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Substance.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Substance.java new file mode 100644 index 00000000000..48168cc9b6d --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Substance.java @@ -0,0 +1,1125 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A homogeneous material with a definite composition. + */ +@ResourceDef(name="Substance", profile="http://hl7.org/fhir/Profile/Substance") +public class Substance extends DomainResource { + + @Block() + public static class SubstanceInstanceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifier associated with the package/container (usually a label affixed directly). + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Identifier of the package/container", formalDefinition="Identifier associated with the package/container (usually a label affixed directly)." ) + protected Identifier identifier; + + /** + * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + */ + @Child(name = "expiry", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When no longer valid to use", formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry." ) + protected DateTimeType expiry; + + /** + * The amount of the substance. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount of substance in the package", formalDefinition="The amount of the substance." ) + protected SimpleQuantity quantity; + + private static final long serialVersionUID = -794314734L; + + /** + * Constructor + */ + public SubstanceInstanceComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) + */ + public SubstanceInstanceComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public DateTimeType getExpiryElement() { + if (this.expiry == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.expiry"); + else if (Configuration.doAutoCreate()) + this.expiry = new DateTimeType(); // bb + return this.expiry; + } + + public boolean hasExpiryElement() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + public boolean hasExpiry() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + /** + * @param value {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public SubstanceInstanceComponent setExpiryElement(DateTimeType value) { + this.expiry = value; + return this; + } + + /** + * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + */ + 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(Date value) { + if (value == null) + this.expiry = null; + else { + if (this.expiry == null) + this.expiry = new DateTimeType(); + this.expiry.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The amount of the substance.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the substance.) + */ + public SubstanceInstanceComponent setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, java.lang.Integer.MAX_VALUE, expiry)); + childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of the substance.", 0, java.lang.Integer.MAX_VALUE, quantity)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -1289159373: /*expiry*/ return this.expiry == null ? new Base[0] : new Base[] {this.expiry}; // DateTimeType + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -1289159373: // expiry + this.expiry = castToDateTime(value); // DateTimeType + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("expiry")) + this.expiry = castToDateTime(value); // DateTimeType + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -1289159373: throw new FHIRException("Cannot make property expiry as it is not a complex type"); // DateTimeType + case -1285004149: return getQuantity(); // SimpleQuantity + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("expiry")) { + throw new FHIRException("Cannot call addChild on a primitive type Substance.expiry"); + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else + return super.addChild(name); + } + + public SubstanceInstanceComponent copy() { + SubstanceInstanceComponent dst = new SubstanceInstanceComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.expiry = expiry == null ? null : expiry.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubstanceInstanceComponent)) + return false; + SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(expiry, o.expiry, true) && compareDeep(quantity, o.quantity, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubstanceInstanceComponent)) + return false; + SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; + return compareValues(expiry, o.expiry, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (expiry == null || expiry.isEmpty()) + && (quantity == null || quantity.isEmpty()); + } + + public String fhirType() { + return "Substance.instance"; + + } + + } + + @Block() + public static class SubstanceIngredientComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The amount of the ingredient in the substance - a concentration ratio. + */ + @Child(name = "quantity", type = {Ratio.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Optional amount (concentration)", formalDefinition="The amount of the ingredient in the substance - a concentration ratio." ) + protected Ratio quantity; + + /** + * Another substance that is a component of this substance. + */ + @Child(name = "substance", type = {Substance.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="A component of the substance", formalDefinition="Another substance that is a component of this substance." ) + protected Reference substance; + + /** + * The actual object that is the target of the reference (Another substance that is a component of this substance.) + */ + protected Substance substanceTarget; + + private static final long serialVersionUID = -1783242034L; + + /** + * Constructor + */ + public SubstanceIngredientComponent() { + super(); + } + + /** + * Constructor + */ + public SubstanceIngredientComponent(Reference substance) { + super(); + this.substance = substance; + } + + /** + * @return {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) + */ + public Ratio getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Ratio(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) + */ + public SubstanceIngredientComponent setQuantity(Ratio value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #substance} (Another substance that is a component of this substance.) + */ + public Reference getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new Reference(); // cc + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Another substance that is a component of this substance.) + */ + public SubstanceIngredientComponent setSubstance(Reference value) { + this.substance = value; + return this; + } + + /** + * @return {@link #substance} 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. (Another substance that is a component of this substance.) + */ + public Substance getSubstanceTarget() { + if (this.substanceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substanceTarget = new Substance(); // aa + return this.substanceTarget; + } + + /** + * @param value {@link #substance} 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. (Another substance that is a component of this substance.) + */ + public SubstanceIngredientComponent setSubstanceTarget(Substance value) { + this.substanceTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("substance", "Reference(Substance)", "Another substance that is a component of this substance.", 0, java.lang.Integer.MAX_VALUE, substance)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Ratio + case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1285004149: // quantity + this.quantity = castToRatio(value); // Ratio + break; + case 530040176: // substance + this.substance = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("quantity")) + this.quantity = castToRatio(value); // Ratio + else if (name.equals("substance")) + this.substance = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1285004149: return getQuantity(); // Ratio + case 530040176: return getSubstance(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("quantity")) { + this.quantity = new Ratio(); + return this.quantity; + } + else if (name.equals("substance")) { + this.substance = new Reference(); + return this.substance; + } + else + return super.addChild(name); + } + + public SubstanceIngredientComponent copy() { + SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); + copyValues(dst); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.substance = substance == null ? null : substance.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SubstanceIngredientComponent)) + return false; + SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; + return compareDeep(quantity, o.quantity, true) && compareDeep(substance, o.substance, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SubstanceIngredientComponent)) + return false; + SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (quantity == null || quantity.isEmpty()) && (substance == null || substance.isEmpty()) + ; + } + + public String fhirType() { + return "Substance.ingredient"; + + } + + } + + /** + * Unique identifier for the substance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for the substance." ) + protected List identifier; + + /** + * A code that classifies the general type of substance. This is used for searching, sorting and display purposes. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="What class/type of substance this is", formalDefinition="A code that classifies the general type of substance. This is used for searching, sorting and display purposes." ) + protected List category; + + /** + * A code (or set of codes) that identify this substance. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="What substance this is", formalDefinition="A code (or set of codes) that identify this substance." ) + protected CodeableConcept code; + + /** + * A description of the substance - its appearance, handling requirements, and other usage notes. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Textual description of the substance, comments", formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes." ) + protected StringType description; + + /** + * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. + */ + @Child(name = "instance", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="If this describes a specific package/container of the substance", formalDefinition="Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance." ) + protected List instance; + + /** + * A substance can be composed of other substances. + */ + @Child(name = "ingredient", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Composition information about the substance", formalDefinition="A substance can be composed of other substances." ) + protected List ingredient; + + private static final long serialVersionUID = -1653977206L; + + /** + * Constructor + */ + public Substance() { + super(); + } + + /** + * Constructor + */ + public Substance(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #identifier} (Unique identifier for the substance.) + */ + 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} (Unique identifier for the substance.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public Substance addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #category} (A code that classifies the general type of substance. This is used for searching, sorting and display purposes.) + */ + public List getCategory() { + if (this.category == null) + this.category = new ArrayList(); + return this.category; + } + + public boolean hasCategory() { + if (this.category == null) + return false; + for (CodeableConcept item : this.category) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #category} (A code that classifies the general type of substance. This is used for searching, sorting and display purposes.) + */ + // syntactic sugar + public CodeableConcept addCategory() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return t; + } + + // syntactic sugar + public Substance addCategory(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return this; + } + + /** + * @return {@link #code} (A code (or set of codes) that identify this substance.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Substance.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code (or set of codes) that identify this substance.) + */ + public Substance setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). 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 Substance.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Substance setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the substance - its appearance, handling requirements, and other usage notes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the substance - its appearance, handling requirements, and other usage notes. + */ + public Substance 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 #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) + */ + public List getInstance() { + if (this.instance == null) + this.instance = new ArrayList(); + return this.instance; + } + + public boolean hasInstance() { + if (this.instance == null) + return false; + for (SubstanceInstanceComponent item : this.instance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) + */ + // syntactic sugar + public SubstanceInstanceComponent addInstance() { //3 + SubstanceInstanceComponent t = new SubstanceInstanceComponent(); + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return t; + } + + // syntactic sugar + public Substance addInstance(SubstanceInstanceComponent t) { //3 + if (t == null) + return this; + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return this; + } + + /** + * @return {@link #ingredient} (A substance can be composed of other substances.) + */ + public List getIngredient() { + if (this.ingredient == null) + this.ingredient = new ArrayList(); + return this.ingredient; + } + + public boolean hasIngredient() { + if (this.ingredient == null) + return false; + for (SubstanceIngredientComponent item : this.ingredient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ingredient} (A substance can be composed of other substances.) + */ + // syntactic sugar + public SubstanceIngredientComponent addIngredient() { //3 + SubstanceIngredientComponent t = new SubstanceIngredientComponent(); + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return t; + } + + // syntactic sugar + public Substance addIngredient(SubstanceIngredientComponent t) { //3 + if (t == null) + return this; + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for the substance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the general type of substance. This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that identify this substance.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("instance", "", "Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.", 0, java.lang.Integer.MAX_VALUE, instance)); + childrenList.add(new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // SubstanceInstanceComponent + case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // SubstanceIngredientComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 50511102: // category + this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case 555127957: // instance + this.getInstance().add((SubstanceInstanceComponent) value); // SubstanceInstanceComponent + break; + case -206409263: // ingredient + this.getIngredient().add((SubstanceIngredientComponent) value); // SubstanceIngredientComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("category")) + this.getCategory().add(castToCodeableConcept(value)); + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("instance")) + this.getInstance().add((SubstanceInstanceComponent) value); + else if (name.equals("ingredient")) + this.getIngredient().add((SubstanceIngredientComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 50511102: return addCategory(); // CodeableConcept + case 3059181: return getCode(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case 555127957: return addInstance(); // SubstanceInstanceComponent + case -206409263: return addIngredient(); // SubstanceIngredientComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("category")) { + return addCategory(); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Substance.description"); + } + else if (name.equals("instance")) { + return addInstance(); + } + else if (name.equals("ingredient")) { + return addIngredient(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Substance"; + + } + + public Substance copy() { + Substance dst = new Substance(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (category != null) { + dst.category = new ArrayList(); + for (CodeableConcept i : category) + dst.category.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + dst.description = description == null ? null : description.copy(); + if (instance != null) { + dst.instance = new ArrayList(); + for (SubstanceInstanceComponent i : instance) + dst.instance.add(i.copy()); + }; + if (ingredient != null) { + dst.ingredient = new ArrayList(); + for (SubstanceIngredientComponent i : ingredient) + dst.ingredient.add(i.copy()); + }; + return dst; + } + + protected Substance typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Substance)) + return false; + Substance o = (Substance) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) + && compareDeep(description, o.description, true) && compareDeep(instance, o.instance, true) && compareDeep(ingredient, o.ingredient, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Substance)) + return false; + Substance o = (Substance) other; + return compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (code == null || code.isEmpty()) && (description == null || description.isEmpty()) && (instance == null || instance.isEmpty()) + && (ingredient == null || ingredient.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Substance; + } + + /** + * Search parameter: substance + *

+ * Description: A component of the substance
+ * Type: reference
+ * Path: Substance.ingredient.substance
+ *

+ */ + @SearchParamDefinition(name="substance", path="Substance.ingredient.substance", description="A component of the substance", type="reference" ) + public static final String SP_SUBSTANCE = "substance"; + /** + * Fluent Client search parameter constant for substance + *

+ * Description: A component of the substance
+ * Type: reference
+ * Path: Substance.ingredient.substance
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBSTANCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBSTANCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Substance:substance". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBSTANCE = new ca.uhn.fhir.model.api.Include("Substance:substance").toLocked(); + + /** + * Search parameter: container-identifier + *

+ * Description: Identifier of the package/container
+ * Type: token
+ * Path: Substance.instance.identifier
+ *

+ */ + @SearchParamDefinition(name="container-identifier", path="Substance.instance.identifier", description="Identifier of the package/container", type="token" ) + public static final String SP_CONTAINER_IDENTIFIER = "container-identifier"; + /** + * Fluent Client search parameter constant for container-identifier + *

+ * Description: Identifier of the package/container
+ * Type: token
+ * Path: Substance.instance.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER_IDENTIFIER); + + /** + * Search parameter: category + *

+ * Description: The category of the substance
+ * Type: token
+ * Path: Substance.category
+ *

+ */ + @SearchParamDefinition(name="category", path="Substance.category", description="The category of the substance", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: The category of the substance
+ * Type: token
+ * Path: Substance.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: quantity + *

+ * Description: Amount of substance in the package
+ * Type: quantity
+ * Path: Substance.instance.quantity
+ *

+ */ + @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="Amount of substance in the package", type="quantity" ) + public static final String SP_QUANTITY = "quantity"; + /** + * Fluent Client search parameter constant for quantity + *

+ * Description: Amount of substance in the package
+ * Type: quantity
+ * Path: Substance.instance.quantity
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.QuantityClientParam QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_QUANTITY); + + /** + * Search parameter: code + *

+ * Description: The code of the substance
+ * Type: token
+ * Path: Substance.code
+ *

+ */ + @SearchParamDefinition(name="code", path="Substance.code", description="The code of the substance", type="token" ) + public static final String SP_CODE = "code"; + /** + * Fluent Client search parameter constant for code + *

+ * Description: The code of the substance
+ * Type: token
+ * Path: Substance.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + + /** + * Search parameter: identifier + *

+ * Description: Unique identifier for the substance
+ * Type: token
+ * Path: Substance.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Substance.identifier", description="Unique identifier for the substance", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique identifier for the substance
+ * Type: token
+ * Path: Substance.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: expiry + *

+ * Description: Expiry date of package or container of substance
+ * Type: date
+ * Path: Substance.instance.expiry
+ *

+ */ + @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="Expiry date of package or container of substance", type="date" ) + public static final String SP_EXPIRY = "expiry"; + /** + * Fluent Client search parameter constant for expiry + *

+ * Description: Expiry date of package or container of substance
+ * Type: date
+ * Path: Substance.instance.expiry
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam EXPIRY = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EXPIRY); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SupplyDelivery.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SupplyDelivery.java new file mode 100644 index 00000000000..b3b8511578b --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SupplyDelivery.java @@ -0,0 +1,1044 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * Record of delivery of what is supplied. + */ +@ResourceDef(name="SupplyDelivery", profile="http://hl7.org/fhir/Profile/SupplyDelivery") +public class SupplyDelivery extends DomainResource { + + public enum SupplyDeliveryStatus { + /** + * Supply has been requested, but not delivered. + */ + INPROGRESS, + /** + * Supply has been delivered ("completed"). + */ + COMPLETED, + /** + * Dispensing was not completed. + */ + ABANDONED, + /** + * added to help the parsers + */ + NULL; + public static SupplyDeliveryStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("abandoned".equals(codeString)) + return ABANDONED; + throw new FHIRException("Unknown SupplyDeliveryStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INPROGRESS: return "in-progress"; + case COMPLETED: return "completed"; + case ABANDONED: return "abandoned"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return "http://hl7.org/fhir/supplydelivery-status"; + case COMPLETED: return "http://hl7.org/fhir/supplydelivery-status"; + case ABANDONED: return "http://hl7.org/fhir/supplydelivery-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "Supply has been requested, but not delivered."; + case COMPLETED: return "Supply has been delivered (\"completed\")."; + case ABANDONED: return "Dispensing was not completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case COMPLETED: return "Delivered"; + case ABANDONED: return "Abandoned"; + default: return "?"; + } + } + } + + public static class SupplyDeliveryStatusEnumFactory implements EnumFactory { + public SupplyDeliveryStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return SupplyDeliveryStatus.INPROGRESS; + if ("completed".equals(codeString)) + return SupplyDeliveryStatus.COMPLETED; + if ("abandoned".equals(codeString)) + return SupplyDeliveryStatus.ABANDONED; + throw new IllegalArgumentException("Unknown SupplyDeliveryStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("in-progress".equals(codeString)) + return new Enumeration(this, SupplyDeliveryStatus.INPROGRESS); + if ("completed".equals(codeString)) + return new Enumeration(this, SupplyDeliveryStatus.COMPLETED); + if ("abandoned".equals(codeString)) + return new Enumeration(this, SupplyDeliveryStatus.ABANDONED); + throw new FHIRException("Unknown SupplyDeliveryStatus code '"+codeString+"'"); + } + public String toCode(SupplyDeliveryStatus code) { + if (code == SupplyDeliveryStatus.INPROGRESS) + return "in-progress"; + if (code == SupplyDeliveryStatus.COMPLETED) + return "completed"; + if (code == SupplyDeliveryStatus.ABANDONED) + return "abandoned"; + return "?"; + } + public String toSystem(SupplyDeliveryStatus code) { + return code.getSystem(); + } + } + + /** + * Identifier assigned by the dispensing facility when the item(s) is dispensed. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility when the item(s) is dispensed." ) + protected Identifier identifier; + + /** + * A code specifying the state of the dispense event. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="in-progress | completed | abandoned", formalDefinition="A code specifying the state of the dispense event." ) + protected Enumeration status; + + /** + * A link to a resource representing the person whom the delivered item is for. + */ + @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the delivered item is for." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person whom the delivered item is for.) + */ + protected Patient patientTarget; + + /** + * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Category of dispense event", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) + protected CodeableConcept type; + + /** + * The amount of supply that has been dispensed. Includes unit of measure. + */ + @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." ) + protected SimpleQuantity quantity; + + /** + * Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. + */ + @Child(name = "suppliedItem", type = {Medication.class, Substance.class, Device.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list." ) + protected Reference suppliedItem; + + /** + * The actual object that is the target of the reference (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + protected Resource suppliedItemTarget; + + /** + * The individual responsible for dispensing the medication, supplier or device. + */ + @Child(name = "supplier", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." ) + protected Reference supplier; + + /** + * The actual object that is the target of the reference (The individual responsible for dispensing the medication, supplier or device.) + */ + protected Practitioner supplierTarget; + + /** + * The time the dispense event occurred. + */ + @Child(name = "whenPrepared", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Dispensing time", formalDefinition="The time the dispense event occurred." ) + protected Period whenPrepared; + + /** + * The time the dispensed item was sent or handed to the patient (or agent). + */ + @Child(name = "time", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." ) + protected DateTimeType time; + + /** + * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. + */ + @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Where the Supply was sent", formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + protected Location destinationTarget; + + /** + * Identifies the person who picked up the Supply. + */ + @Child(name = "receiver", type = {Practitioner.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." ) + protected List receiver; + /** + * The actual objects that are the target of the reference (Identifies the person who picked up the Supply.) + */ + protected List receiverTarget; + + + private static final long serialVersionUID = -1520129707L; + + /** + * Constructor + */ + public SupplyDelivery() { + super(); + } + + /** + * @return {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) + */ + public SupplyDelivery setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the dispense event.). 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 SupplyDelivery.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new SupplyDeliveryStatusEnumFactory()); // bb + 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} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public SupplyDelivery setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the dispense event. + */ + public SupplyDeliveryStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the dispense event. + */ + public SupplyDelivery setStatus(SupplyDeliveryStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new SupplyDeliveryStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person whom the delivered item is for.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person whom the delivered item is for.) + */ + public SupplyDelivery 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. (A link to a resource representing the person whom the delivered item is for.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (A link to a resource representing the person whom the delivered item is for.) + */ + public SupplyDelivery setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public SupplyDelivery setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) + */ + public SimpleQuantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new SimpleQuantity(); // cc + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) + */ + public SupplyDelivery setQuantity(SimpleQuantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #suppliedItem} (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public Reference getSuppliedItem() { + if (this.suppliedItem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.suppliedItem"); + else if (Configuration.doAutoCreate()) + this.suppliedItem = new Reference(); // cc + return this.suppliedItem; + } + + public boolean hasSuppliedItem() { + return this.suppliedItem != null && !this.suppliedItem.isEmpty(); + } + + /** + * @param value {@link #suppliedItem} (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public SupplyDelivery setSuppliedItem(Reference value) { + this.suppliedItem = value; + return this; + } + + /** + * @return {@link #suppliedItem} 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 medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public Resource getSuppliedItemTarget() { + return this.suppliedItemTarget; + } + + /** + * @param value {@link #suppliedItem} 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 medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public SupplyDelivery setSuppliedItemTarget(Resource value) { + this.suppliedItemTarget = value; + return this; + } + + /** + * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) + */ + public Reference getSupplier() { + if (this.supplier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.supplier"); + else if (Configuration.doAutoCreate()) + this.supplier = new Reference(); // cc + return this.supplier; + } + + public boolean hasSupplier() { + return this.supplier != null && !this.supplier.isEmpty(); + } + + /** + * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) + */ + public SupplyDelivery setSupplier(Reference value) { + this.supplier = value; + return this; + } + + /** + * @return {@link #supplier} 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 individual responsible for dispensing the medication, supplier or device.) + */ + public Practitioner getSupplierTarget() { + if (this.supplierTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.supplier"); + else if (Configuration.doAutoCreate()) + this.supplierTarget = new Practitioner(); // aa + return this.supplierTarget; + } + + /** + * @param value {@link #supplier} 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 individual responsible for dispensing the medication, supplier or device.) + */ + public SupplyDelivery setSupplierTarget(Practitioner value) { + this.supplierTarget = value; + return this; + } + + /** + * @return {@link #whenPrepared} (The time the dispense event occurred.) + */ + public Period getWhenPrepared() { + if (this.whenPrepared == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.whenPrepared"); + else if (Configuration.doAutoCreate()) + this.whenPrepared = new Period(); // cc + return this.whenPrepared; + } + + public boolean hasWhenPrepared() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + /** + * @param value {@link #whenPrepared} (The time the dispense event occurred.) + */ + public SupplyDelivery setWhenPrepared(Period value) { + this.whenPrepared = value; + return this; + } + + /** + * @return {@link #time} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DateTimeType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.time"); + else if (Configuration.doAutoCreate()) + this.time = new DateTimeType(); // bb + 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} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public SupplyDelivery setTimeElement(DateTimeType value) { + this.time = value; + return this; + } + + /** + * @return The time the dispensed item was sent or handed to the patient (or agent). + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value The time the dispensed item was sent or handed to the patient (or agent). + */ + public SupplyDelivery setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new DateTimeType(); + this.time.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); // cc + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public SupplyDelivery setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} 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. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDelivery.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); // aa + return this.destinationTarget; + } + + /** + * @param value {@link #destination} 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. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public SupplyDelivery setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the Supply.) + */ + public List getReceiver() { + if (this.receiver == null) + this.receiver = new ArrayList(); + return this.receiver; + } + + public boolean hasReceiver() { + if (this.receiver == null) + return false; + for (Reference item : this.receiver) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the Supply.) + */ + // syntactic sugar + public Reference addReceiver() { //3 + Reference t = new Reference(); + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return t; + } + + // syntactic sugar + public SupplyDelivery addReceiver(Reference t) { //3 + if (t == null) + return this; + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return this; + } + + /** + * @return {@link #receiver} (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 person who picked up the Supply.) + */ + public List getReceiverTarget() { + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + return this.receiverTarget; + } + + // syntactic sugar + /** + * @return {@link #receiver} (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 person who picked up the Supply.) + */ + public Practitioner addReceiverTarget() { + Practitioner r = new Practitioner(); + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + this.receiverTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility when the item(s) is dispensed.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the delivered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("suppliedItem", "Reference(Medication|Substance|Device)", "Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.", 0, java.lang.Integer.MAX_VALUE, suppliedItem)); + childrenList.add(new Property("supplier", "Reference(Practitioner)", "The individual responsible for dispensing the medication, supplier or device.", 0, java.lang.Integer.MAX_VALUE, supplier)); + childrenList.add(new Property("whenPrepared", "Period", "The time the dispense event occurred.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); + childrenList.add(new Property("time", "dateTime", "The time the dispensed item was sent or handed to the patient (or agent).", 0, java.lang.Integer.MAX_VALUE, time)); + childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("receiver", "Reference(Practitioner)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity + case 1993333233: /*suppliedItem*/ return this.suppliedItem == null ? new Base[0] : new Base[] {this.suppliedItem}; // Reference + case -1663305268: /*supplier*/ return this.supplier == null ? new Base[0] : new Base[] {this.supplier}; // Reference + case -562837097: /*whenPrepared*/ return this.whenPrepared == null ? new Base[0] : new Base[] {this.whenPrepared}; // Period + case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType + case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference + case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : this.receiver.toArray(new Base[this.receiver.size()]); // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -892481550: // status + this.status = new SupplyDeliveryStatusEnumFactory().fromType(value); // Enumeration + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1285004149: // quantity + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + break; + case 1993333233: // suppliedItem + this.suppliedItem = castToReference(value); // Reference + break; + case -1663305268: // supplier + this.supplier = castToReference(value); // Reference + break; + case -562837097: // whenPrepared + this.whenPrepared = castToPeriod(value); // Period + break; + case 3560141: // time + this.time = castToDateTime(value); // DateTimeType + break; + case -1429847026: // destination + this.destination = castToReference(value); // Reference + break; + case -808719889: // receiver + this.getReceiver().add(castToReference(value)); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("status")) + this.status = new SupplyDeliveryStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("quantity")) + this.quantity = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("suppliedItem")) + this.suppliedItem = castToReference(value); // Reference + else if (name.equals("supplier")) + this.supplier = castToReference(value); // Reference + else if (name.equals("whenPrepared")) + this.whenPrepared = castToPeriod(value); // Period + else if (name.equals("time")) + this.time = castToDateTime(value); // DateTimeType + else if (name.equals("destination")) + this.destination = castToReference(value); // Reference + else if (name.equals("receiver")) + this.getReceiver().add(castToReference(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -791418107: return getPatient(); // Reference + case 3575610: return getType(); // CodeableConcept + case -1285004149: return getQuantity(); // SimpleQuantity + case 1993333233: return getSuppliedItem(); // Reference + case -1663305268: return getSupplier(); // Reference + case -562837097: return getWhenPrepared(); // Period + case 3560141: throw new FHIRException("Cannot make property time as it is not a complex type"); // DateTimeType + case -1429847026: return getDestination(); // Reference + case -808719889: return addReceiver(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type SupplyDelivery.status"); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("quantity")) { + this.quantity = new SimpleQuantity(); + return this.quantity; + } + else if (name.equals("suppliedItem")) { + this.suppliedItem = new Reference(); + return this.suppliedItem; + } + else if (name.equals("supplier")) { + this.supplier = new Reference(); + return this.supplier; + } + else if (name.equals("whenPrepared")) { + this.whenPrepared = new Period(); + return this.whenPrepared; + } + else if (name.equals("time")) { + throw new FHIRException("Cannot call addChild on a primitive type SupplyDelivery.time"); + } + else if (name.equals("destination")) { + this.destination = new Reference(); + return this.destination; + } + else if (name.equals("receiver")) { + return addReceiver(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "SupplyDelivery"; + + } + + public SupplyDelivery copy() { + SupplyDelivery dst = new SupplyDelivery(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.type = type == null ? null : type.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy(); + dst.supplier = supplier == null ? null : supplier.copy(); + dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); + dst.time = time == null ? null : time.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (receiver != null) { + dst.receiver = new ArrayList(); + for (Reference i : receiver) + dst.receiver.add(i.copy()); + }; + return dst; + } + + protected SupplyDelivery typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SupplyDelivery)) + return false; + SupplyDelivery o = (SupplyDelivery) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) + && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(suppliedItem, o.suppliedItem, true) + && compareDeep(supplier, o.supplier, true) && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(time, o.time, true) + && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SupplyDelivery)) + return false; + SupplyDelivery o = (SupplyDelivery) other; + return compareValues(status, o.status, true) && compareValues(time, o.time, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (patient == null || patient.isEmpty()) && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (suppliedItem == null || suppliedItem.isEmpty()) && (supplier == null || supplier.isEmpty()) + && (whenPrepared == null || whenPrepared.isEmpty()) && (time == null || time.isEmpty()) && (destination == null || destination.isEmpty()) + && (receiver == null || receiver.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SupplyDelivery; + } + + /** + * Search parameter: patient + *

+ * Description: Patient for whom the item is supplied
+ * Type: reference
+ * Path: SupplyDelivery.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="SupplyDelivery.patient", description="Patient for whom the item is supplied", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Patient for whom the item is supplied
+ * Type: reference
+ * Path: SupplyDelivery.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "SupplyDelivery:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("SupplyDelivery:patient").toLocked(); + + /** + * Search parameter: receiver + *

+ * Description: Who collected the Supply
+ * Type: reference
+ * Path: SupplyDelivery.receiver
+ *

+ */ + @SearchParamDefinition(name="receiver", path="SupplyDelivery.receiver", description="Who collected the Supply", type="reference" ) + public static final String SP_RECEIVER = "receiver"; + /** + * Fluent Client search parameter constant for receiver + *

+ * Description: Who collected the Supply
+ * Type: reference
+ * Path: SupplyDelivery.receiver
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "SupplyDelivery:receiver". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("SupplyDelivery:receiver").toLocked(); + + /** + * Search parameter: status + *

+ * Description: in-progress | completed | abandoned
+ * Type: token
+ * Path: SupplyDelivery.status
+ *

+ */ + @SearchParamDefinition(name="status", path="SupplyDelivery.status", description="in-progress | completed | abandoned", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: in-progress | completed | abandoned
+ * Type: token
+ * Path: SupplyDelivery.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: identifier + *

+ * Description: External identifier
+ * Type: token
+ * Path: SupplyDelivery.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="SupplyDelivery.identifier", description="External identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: External identifier
+ * Type: token
+ * Path: SupplyDelivery.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: supplier + *

+ * Description: Dispenser
+ * Type: reference
+ * Path: SupplyDelivery.supplier
+ *

+ */ + @SearchParamDefinition(name="supplier", path="SupplyDelivery.supplier", description="Dispenser", type="reference" ) + public static final String SP_SUPPLIER = "supplier"; + /** + * Fluent Client search parameter constant for supplier + *

+ * Description: Dispenser
+ * Type: reference
+ * Path: SupplyDelivery.supplier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPLIER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPLIER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "SupplyDelivery:supplier". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPLIER = new ca.uhn.fhir.model.api.Include("SupplyDelivery:supplier").toLocked(); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SupplyRequest.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SupplyRequest.java new file mode 100644 index 00000000000..201af41e2ed --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/SupplyRequest.java @@ -0,0 +1,1229 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A record of a request for a medication, substance or device used in the healthcare setting. + */ +@ResourceDef(name="SupplyRequest", profile="http://hl7.org/fhir/Profile/SupplyRequest") +public class SupplyRequest extends DomainResource { + + public enum SupplyRequestStatus { + /** + * Supply has been requested, but not dispensed. + */ + REQUESTED, + /** + * Supply has been received by the requestor. + */ + COMPLETED, + /** + * The supply will not be completed because the supplier was unable or unwilling to supply the item. + */ + FAILED, + /** + * The orderer of the supply cancelled the request. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + public static SupplyRequestStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("completed".equals(codeString)) + return COMPLETED; + if ("failed".equals(codeString)) + return FAILED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new FHIRException("Unknown SupplyRequestStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case COMPLETED: return "completed"; + case FAILED: return "failed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return "http://hl7.org/fhir/supplyrequest-status"; + case COMPLETED: return "http://hl7.org/fhir/supplyrequest-status"; + case FAILED: return "http://hl7.org/fhir/supplyrequest-status"; + case CANCELLED: return "http://hl7.org/fhir/supplyrequest-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "Supply has been requested, but not dispensed."; + case COMPLETED: return "Supply has been received by the requestor."; + case FAILED: return "The supply will not be completed because the supplier was unable or unwilling to supply the item."; + case CANCELLED: return "The orderer of the supply cancelled the request."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "Requested"; + case COMPLETED: return "Received"; + case FAILED: return "Failed"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class SupplyRequestStatusEnumFactory implements EnumFactory { + public SupplyRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return SupplyRequestStatus.REQUESTED; + if ("completed".equals(codeString)) + return SupplyRequestStatus.COMPLETED; + if ("failed".equals(codeString)) + return SupplyRequestStatus.FAILED; + if ("cancelled".equals(codeString)) + return SupplyRequestStatus.CANCELLED; + throw new IllegalArgumentException("Unknown SupplyRequestStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return new Enumeration(this, SupplyRequestStatus.REQUESTED); + if ("completed".equals(codeString)) + return new Enumeration(this, SupplyRequestStatus.COMPLETED); + if ("failed".equals(codeString)) + return new Enumeration(this, SupplyRequestStatus.FAILED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, SupplyRequestStatus.CANCELLED); + throw new FHIRException("Unknown SupplyRequestStatus code '"+codeString+"'"); + } + public String toCode(SupplyRequestStatus code) { + if (code == SupplyRequestStatus.REQUESTED) + return "requested"; + if (code == SupplyRequestStatus.COMPLETED) + return "completed"; + if (code == SupplyRequestStatus.FAILED) + return "failed"; + if (code == SupplyRequestStatus.CANCELLED) + return "cancelled"; + return "?"; + } + public String toSystem(SupplyRequestStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class SupplyRequestWhenComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Code indicating when the request should be fulfilled. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Fulfilment code", formalDefinition="Code indicating when the request should be fulfilled." ) + protected CodeableConcept code; + + /** + * Formal fulfillment schedule. + */ + @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Formal fulfillment schedule", formalDefinition="Formal fulfillment schedule." ) + protected Timing schedule; + + private static final long serialVersionUID = 307115287L; + + /** + * Constructor + */ + public SupplyRequestWhenComponent() { + super(); + } + + /** + * @return {@link #code} (Code indicating when the request should be fulfilled.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequestWhenComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating when the request should be fulfilled.) + */ + public SupplyRequestWhenComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #schedule} (Formal fulfillment schedule.) + */ + public Timing getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequestWhenComponent.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Timing(); // cc + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (Formal fulfillment schedule.) + */ + public SupplyRequestWhenComponent setSchedule(Timing value) { + this.schedule = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Code indicating when the request should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("schedule", "Timing", "Formal fulfillment schedule.", 0, java.lang.Integer.MAX_VALUE, schedule)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Timing + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -697920873: // schedule + this.schedule = castToTiming(value); // Timing + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("schedule")) + this.schedule = castToTiming(value); // Timing + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: return getCode(); // CodeableConcept + case -697920873: return getSchedule(); // Timing + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("schedule")) { + this.schedule = new Timing(); + return this.schedule; + } + else + return super.addChild(name); + } + + public SupplyRequestWhenComponent copy() { + SupplyRequestWhenComponent dst = new SupplyRequestWhenComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SupplyRequestWhenComponent)) + return false; + SupplyRequestWhenComponent o = (SupplyRequestWhenComponent) other; + return compareDeep(code, o.code, true) && compareDeep(schedule, o.schedule, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SupplyRequestWhenComponent)) + return false; + SupplyRequestWhenComponent o = (SupplyRequestWhenComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (schedule == null || schedule.isEmpty()) + ; + } + + public String fhirType() { + return "SupplyRequest.when"; + + } + + } + + /** + * A link to a resource representing the person whom the ordered item is for. + */ + @Child(name = "patient", type = {Patient.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the ordered item is for." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person whom the ordered item is for.) + */ + protected Patient patientTarget; + + /** + * The Practitioner , Organization or Patient who initiated this order for the supply. + */ + @Child(name = "source", type = {Practitioner.class, Organization.class, Patient.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who initiated this order", formalDefinition="The Practitioner , Organization or Patient who initiated this order for the supply." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (The Practitioner , Organization or Patient who initiated this order for the supply.) + */ + protected Resource sourceTarget; + + /** + * When the request was made. + */ + @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the request was made", formalDefinition="When the request was made." ) + protected DateTimeType date; + + /** + * Unique identifier for this supply request. + */ + @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for this supply request." ) + protected Identifier identifier; + + /** + * Status of the supply request. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="requested | completed | failed | cancelled", formalDefinition="Status of the supply request." ) + protected Enumeration status; + + /** + * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. + */ + @Child(name = "kind", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The kind of supply (central, non-stock, etc.)", formalDefinition="Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process." ) + protected CodeableConcept kind; + + /** + * The item that is requested to be supplied. + */ + @Child(name = "orderedItem", type = {Medication.class, Substance.class, Device.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied." ) + protected Reference orderedItem; + + /** + * The actual object that is the target of the reference (The item that is requested to be supplied.) + */ + protected Resource orderedItemTarget; + + /** + * Who is intended to fulfill the request. + */ + @Child(name = "supplier", type = {Organization.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Who is intended to fulfill the request", formalDefinition="Who is intended to fulfill the request." ) + protected List supplier; + /** + * The actual objects that are the target of the reference (Who is intended to fulfill the request.) + */ + protected List supplierTarget; + + + /** + * Why the supply item was requested. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why the supply item was requested", formalDefinition="Why the supply item was requested." ) + protected Type reason; + + /** + * When the request should be fulfilled. + */ + @Child(name = "when", type = {}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the request should be fulfilled", formalDefinition="When the request should be fulfilled." ) + protected SupplyRequestWhenComponent when; + + private static final long serialVersionUID = 1649766198L; + + /** + * Constructor + */ + public SupplyRequest() { + super(); + } + + /** + * @return {@link #patient} (A link to a resource representing the person whom the ordered item is for.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person whom the ordered item is for.) + */ + public SupplyRequest 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. (A link to a resource representing the person whom the ordered item is for.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (A link to a resource representing the person whom the ordered item is for.) + */ + public SupplyRequest setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #source} (The Practitioner , Organization or Patient who initiated this order for the supply.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); // cc + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The Practitioner , Organization or Patient who initiated this order for the supply.) + */ + public SupplyRequest 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. (The Practitioner , Organization or Patient who initiated this order for the supply.) + */ + public Resource getSourceTarget() { + 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. (The Practitioner , Organization or Patient who initiated this order for the supply.) + */ + public SupplyRequest setSourceTarget(Resource value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #date} (When the request was made.). 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 SupplyRequest.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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} (When the request was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public SupplyRequest setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return When the request was made. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value When the request was made. + */ + public SupplyRequest setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Unique identifier for this supply request.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique identifier for this supply request.) + */ + public SupplyRequest setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (Status of the supply request.). 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 SupplyRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new SupplyRequestStatusEnumFactory()); // bb + 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} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public SupplyRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Status of the supply request. + */ + public SupplyRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Status of the supply request. + */ + public SupplyRequest setStatus(SupplyRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new SupplyRequestStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) + */ + public CodeableConcept getKind() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new CodeableConcept(); // cc + return this.kind; + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) + */ + public SupplyRequest setKind(CodeableConcept value) { + this.kind = value; + return this; + } + + /** + * @return {@link #orderedItem} (The item that is requested to be supplied.) + */ + public Reference getOrderedItem() { + if (this.orderedItem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.orderedItem"); + else if (Configuration.doAutoCreate()) + this.orderedItem = new Reference(); // cc + return this.orderedItem; + } + + public boolean hasOrderedItem() { + return this.orderedItem != null && !this.orderedItem.isEmpty(); + } + + /** + * @param value {@link #orderedItem} (The item that is requested to be supplied.) + */ + public SupplyRequest setOrderedItem(Reference value) { + this.orderedItem = value; + return this; + } + + /** + * @return {@link #orderedItem} 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 item that is requested to be supplied.) + */ + public Resource getOrderedItemTarget() { + return this.orderedItemTarget; + } + + /** + * @param value {@link #orderedItem} 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 item that is requested to be supplied.) + */ + public SupplyRequest setOrderedItemTarget(Resource value) { + this.orderedItemTarget = value; + return this; + } + + /** + * @return {@link #supplier} (Who is intended to fulfill the request.) + */ + public List getSupplier() { + if (this.supplier == null) + this.supplier = new ArrayList(); + return this.supplier; + } + + public boolean hasSupplier() { + if (this.supplier == null) + return false; + for (Reference item : this.supplier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supplier} (Who is intended to fulfill the request.) + */ + // syntactic sugar + public Reference addSupplier() { //3 + Reference t = new Reference(); + if (this.supplier == null) + this.supplier = new ArrayList(); + this.supplier.add(t); + return t; + } + + // syntactic sugar + public SupplyRequest addSupplier(Reference t) { //3 + if (t == null) + return this; + if (this.supplier == null) + this.supplier = new ArrayList(); + this.supplier.add(t); + return this; + } + + /** + * @return {@link #supplier} (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. Who is intended to fulfill the request.) + */ + public List getSupplierTarget() { + if (this.supplierTarget == null) + this.supplierTarget = new ArrayList(); + return this.supplierTarget; + } + + // syntactic sugar + /** + * @return {@link #supplier} (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. Who is intended to fulfill the request.) + */ + public Organization addSupplierTarget() { + Organization r = new Organization(); + if (this.supplierTarget == null) + this.supplierTarget = new ArrayList(); + this.supplierTarget.add(r); + return r; + } + + /** + * @return {@link #reason} (Why the supply item was requested.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Why the supply item was requested.) + */ + public CodeableConcept getReasonCodeableConcept() throws FHIRException { + if (!(this.reason instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + public boolean hasReasonCodeableConcept() { + return this.reason instanceof CodeableConcept; + } + + /** + * @return {@link #reason} (Why the supply item was requested.) + */ + public Reference getReasonReference() throws FHIRException { + if (!(this.reason instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReasonReference() { + return this.reason instanceof Reference; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Why the supply item was requested.) + */ + public SupplyRequest setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #when} (When the request should be fulfilled.) + */ + public SupplyRequestWhenComponent getWhen() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyRequest.when"); + else if (Configuration.doAutoCreate()) + this.when = new SupplyRequestWhenComponent(); // cc + return this.when; + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (When the request should be fulfilled.) + */ + public SupplyRequest setWhen(SupplyRequestWhenComponent value) { + this.when = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the ordered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("source", "Reference(Practitioner|Organization|Patient)", "The Practitioner , Organization or Patient who initiated this order for the supply.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("date", "dateTime", "When the request was made.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this supply request.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Status of the supply request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("kind", "CodeableConcept", "Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("orderedItem", "Reference(Medication|Substance|Device)", "The item that is requested to be supplied.", 0, java.lang.Integer.MAX_VALUE, orderedItem)); + childrenList.add(new Property("supplier", "Reference(Organization)", "Who is intended to fulfill the request.", 0, java.lang.Integer.MAX_VALUE, supplier)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Any)", "Why the supply item was requested.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("when", "", "When the request should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, when)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // CodeableConcept + case 2129914144: /*orderedItem*/ return this.orderedItem == null ? new Base[0] : new Base[] {this.orderedItem}; // Reference + case -1663305268: /*supplier*/ return this.supplier == null ? new Base[0] : this.supplier.toArray(new Base[this.supplier.size()]); // Reference + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type + case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // SupplyRequestWhenComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -896505829: // source + this.source = castToReference(value); // Reference + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -892481550: // status + this.status = new SupplyRequestStatusEnumFactory().fromType(value); // Enumeration + break; + case 3292052: // kind + this.kind = castToCodeableConcept(value); // CodeableConcept + break; + case 2129914144: // orderedItem + this.orderedItem = castToReference(value); // Reference + break; + case -1663305268: // supplier + this.getSupplier().add(castToReference(value)); // Reference + break; + case -934964668: // reason + this.reason = (Type) value; // Type + break; + case 3648314: // when + this.when = (SupplyRequestWhenComponent) value; // SupplyRequestWhenComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("source")) + this.source = castToReference(value); // Reference + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("status")) + this.status = new SupplyRequestStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("kind")) + this.kind = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("orderedItem")) + this.orderedItem = castToReference(value); // Reference + else if (name.equals("supplier")) + this.getSupplier().add(castToReference(value)); + else if (name.equals("reason[x]")) + this.reason = (Type) value; // Type + else if (name.equals("when")) + this.when = (SupplyRequestWhenComponent) value; // SupplyRequestWhenComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -791418107: return getPatient(); // Reference + case -896505829: return getSource(); // Reference + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1618432855: return getIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3292052: return getKind(); // CodeableConcept + case 2129914144: return getOrderedItem(); // Reference + case -1663305268: return addSupplier(); // Reference + case -669418564: return getReason(); // Type + case 3648314: return getWhen(); // SupplyRequestWhenComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("source")) { + this.source = new Reference(); + return this.source; + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type SupplyRequest.date"); + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type SupplyRequest.status"); + } + else if (name.equals("kind")) { + this.kind = new CodeableConcept(); + return this.kind; + } + else if (name.equals("orderedItem")) { + this.orderedItem = new Reference(); + return this.orderedItem; + } + else if (name.equals("supplier")) { + return addSupplier(); + } + else if (name.equals("reasonCodeableConcept")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else if (name.equals("reasonReference")) { + this.reason = new Reference(); + return this.reason; + } + else if (name.equals("when")) { + this.when = new SupplyRequestWhenComponent(); + return this.when; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "SupplyRequest"; + + } + + public SupplyRequest copy() { + SupplyRequest dst = new SupplyRequest(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.source = source == null ? null : source.copy(); + dst.date = date == null ? null : date.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.kind = kind == null ? null : kind.copy(); + dst.orderedItem = orderedItem == null ? null : orderedItem.copy(); + if (supplier != null) { + dst.supplier = new ArrayList(); + for (Reference i : supplier) + dst.supplier.add(i.copy()); + }; + dst.reason = reason == null ? null : reason.copy(); + dst.when = when == null ? null : when.copy(); + return dst; + } + + protected SupplyRequest typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SupplyRequest)) + return false; + SupplyRequest o = (SupplyRequest) other; + return compareDeep(patient, o.patient, true) && compareDeep(source, o.source, true) && compareDeep(date, o.date, true) + && compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(kind, o.kind, true) + && compareDeep(orderedItem, o.orderedItem, true) && compareDeep(supplier, o.supplier, true) && compareDeep(reason, o.reason, true) + && compareDeep(when, o.when, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SupplyRequest)) + return false; + SupplyRequest o = (SupplyRequest) other; + return compareValues(date, o.date, true) && compareValues(status, o.status, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (source == null || source.isEmpty()) + && (date == null || date.isEmpty()) && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (kind == null || kind.isEmpty()) && (orderedItem == null || orderedItem.isEmpty()) && (supplier == null || supplier.isEmpty()) + && (reason == null || reason.isEmpty()) && (when == null || when.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SupplyRequest; + } + + /** + * Search parameter: patient + *

+ * Description: Patient for whom the item is supplied
+ * Type: reference
+ * Path: SupplyRequest.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="SupplyRequest.patient", description="Patient for whom the item is supplied", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Patient for whom the item is supplied
+ * Type: reference
+ * Path: SupplyRequest.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "SupplyRequest:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("SupplyRequest:patient").toLocked(); + + /** + * Search parameter: source + *

+ * Description: Who initiated this order
+ * Type: reference
+ * Path: SupplyRequest.source
+ *

+ */ + @SearchParamDefinition(name="source", path="SupplyRequest.source", description="Who initiated this order", type="reference" ) + public static final String SP_SOURCE = "source"; + /** + * Fluent Client search parameter constant for source + *

+ * Description: Who initiated this order
+ * Type: reference
+ * Path: SupplyRequest.source
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "SupplyRequest:source". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("SupplyRequest:source").toLocked(); + + /** + * Search parameter: status + *

+ * Description: requested | completed | failed | cancelled
+ * Type: token
+ * Path: SupplyRequest.status
+ *

+ */ + @SearchParamDefinition(name="status", path="SupplyRequest.status", description="requested | completed | failed | cancelled", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: requested | completed | failed | cancelled
+ * Type: token
+ * Path: SupplyRequest.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: date + *

+ * Description: When the request was made
+ * Type: date
+ * Path: SupplyRequest.date
+ *

+ */ + @SearchParamDefinition(name="date", path="SupplyRequest.date", description="When the request was made", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When the request was made
+ * Type: date
+ * Path: SupplyRequest.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Unique identifier
+ * Type: token
+ * Path: SupplyRequest.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="SupplyRequest.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Unique identifier
+ * Type: token
+ * Path: SupplyRequest.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: supplier + *

+ * Description: Who is intended to fulfill the request
+ * Type: reference
+ * Path: SupplyRequest.supplier
+ *

+ */ + @SearchParamDefinition(name="supplier", path="SupplyRequest.supplier", description="Who is intended to fulfill the request", type="reference" ) + public static final String SP_SUPPLIER = "supplier"; + /** + * Fluent Client search parameter constant for supplier + *

+ * Description: Who is intended to fulfill the request
+ * Type: reference
+ * Path: SupplyRequest.supplier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPLIER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPLIER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "SupplyRequest:supplier". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPLIER = new ca.uhn.fhir.model.api.Include("SupplyRequest:supplier").toLocked(); + + /** + * Search parameter: kind + *

+ * Description: The kind of supply (central, non-stock, etc.)
+ * Type: token
+ * Path: SupplyRequest.kind
+ *

+ */ + @SearchParamDefinition(name="kind", path="SupplyRequest.kind", description="The kind of supply (central, non-stock, etc.)", type="token" ) + public static final String SP_KIND = "kind"; + /** + * Fluent Client search parameter constant for kind + *

+ * Description: The kind of supply (central, non-stock, etc.)
+ * Type: token
+ * Path: SupplyRequest.kind
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Task.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Task.java new file mode 100644 index 00000000000..41519c426da --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Task.java @@ -0,0 +1,2474 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A task to be performed. + */ +@ResourceDef(name="Task", profile="http://hl7.org/fhir/Profile/Task") +public class Task extends DomainResource { + + public enum TaskPriority { + /** + * This task has low priority. + */ + LOW, + /** + * This task has normal priority. + */ + NORMAL, + /** + * This task has high priority. + */ + HIGH, + /** + * added to help the parsers + */ + NULL; + public static TaskPriority fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("low".equals(codeString)) + return LOW; + if ("normal".equals(codeString)) + return NORMAL; + if ("high".equals(codeString)) + return HIGH; + throw new FHIRException("Unknown TaskPriority code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case LOW: return "low"; + case NORMAL: return "normal"; + case HIGH: return "high"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LOW: return "http://hl7.org/fhir/task-priority"; + case NORMAL: return "http://hl7.org/fhir/task-priority"; + case HIGH: return "http://hl7.org/fhir/task-priority"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LOW: return "This task has low priority."; + case NORMAL: return "This task has normal priority."; + case HIGH: return "This task has high priority."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LOW: return "Low"; + case NORMAL: return "Normal"; + case HIGH: return "High"; + default: return "?"; + } + } + } + + public static class TaskPriorityEnumFactory implements EnumFactory { + public TaskPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("low".equals(codeString)) + return TaskPriority.LOW; + if ("normal".equals(codeString)) + return TaskPriority.NORMAL; + if ("high".equals(codeString)) + return TaskPriority.HIGH; + throw new IllegalArgumentException("Unknown TaskPriority code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("low".equals(codeString)) + return new Enumeration(this, TaskPriority.LOW); + if ("normal".equals(codeString)) + return new Enumeration(this, TaskPriority.NORMAL); + if ("high".equals(codeString)) + return new Enumeration(this, TaskPriority.HIGH); + throw new FHIRException("Unknown TaskPriority code '"+codeString+"'"); + } + public String toCode(TaskPriority code) { + if (code == TaskPriority.LOW) + return "low"; + if (code == TaskPriority.NORMAL) + return "normal"; + if (code == TaskPriority.HIGH) + return "high"; + return "?"; + } + public String toSystem(TaskPriority code) { + return code.getSystem(); + } + } + + public enum TaskStatus { + /** + * The task is not yet ready to be acted upon. + */ + DRAFT, + /** + * The task is ready to be acted upon + */ + REQUESTED, + /** + * A potential performer has claimed ownership of the task and is evaluating whether to perform it + */ + RECEIVED, + /** + * The potential performer has agreed to execute the task but has not yet started work + */ + ACCEPTED, + /** + * The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action. + */ + REJECTED, + /** + * Task is ready to be performed, but no action has yet been taken. Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given. + */ + READY, + /** + * Task has been started but is not yet complete. + */ + INPROGRESS, + /** + * Task has been started but work has been paused + */ + ONHOLD, + /** + * The task was attempted but could not be completed due to some error. + */ + FAILED, + /** + * The task has been completed (more or less) as requested. + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + public static TaskStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("ready".equals(codeString)) + return READY; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("on-hold".equals(codeString)) + return ONHOLD; + if ("failed".equals(codeString)) + return FAILED; + if ("completed".equals(codeString)) + return COMPLETED; + throw new FHIRException("Unknown TaskStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case REJECTED: return "rejected"; + case READY: return "ready"; + case INPROGRESS: return "in-progress"; + case ONHOLD: return "on-hold"; + case FAILED: return "failed"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return "http://hl7.org/fhir/task-status"; + case REQUESTED: return "http://hl7.org/fhir/task-status"; + case RECEIVED: return "http://hl7.org/fhir/task-status"; + case ACCEPTED: return "http://hl7.org/fhir/task-status"; + case REJECTED: return "http://hl7.org/fhir/task-status"; + case READY: return "http://hl7.org/fhir/task-status"; + case INPROGRESS: return "http://hl7.org/fhir/task-status"; + case ONHOLD: return "http://hl7.org/fhir/task-status"; + case FAILED: return "http://hl7.org/fhir/task-status"; + case COMPLETED: return "http://hl7.org/fhir/task-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "The task is not yet ready to be acted upon."; + case REQUESTED: return "The task is ready to be acted upon"; + case RECEIVED: return "A potential performer has claimed ownership of the task and is evaluating whether to perform it"; + case ACCEPTED: return "The potential performer has agreed to execute the task but has not yet started work"; + case REJECTED: return "The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action."; + case READY: return "Task is ready to be performed, but no action has yet been taken. Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given."; + case INPROGRESS: return "Task has been started but is not yet complete."; + case ONHOLD: return "Task has been started but work has been paused"; + case FAILED: return "The task was attempted but could not be completed due to some error."; + case COMPLETED: return "The task has been completed (more or less) as requested."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case REQUESTED: return "Requested"; + case RECEIVED: return "Received"; + case ACCEPTED: return "Accepted"; + case REJECTED: return "Rejected"; + case READY: return "Ready"; + case INPROGRESS: return "In Progress"; + case ONHOLD: return "On Hold"; + case FAILED: return "Failed"; + case COMPLETED: return "Completed"; + default: return "?"; + } + } + } + + public static class TaskStatusEnumFactory implements EnumFactory { + public TaskStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return TaskStatus.DRAFT; + if ("requested".equals(codeString)) + return TaskStatus.REQUESTED; + if ("received".equals(codeString)) + return TaskStatus.RECEIVED; + if ("accepted".equals(codeString)) + return TaskStatus.ACCEPTED; + if ("rejected".equals(codeString)) + return TaskStatus.REJECTED; + if ("ready".equals(codeString)) + return TaskStatus.READY; + if ("in-progress".equals(codeString)) + return TaskStatus.INPROGRESS; + if ("on-hold".equals(codeString)) + return TaskStatus.ONHOLD; + if ("failed".equals(codeString)) + return TaskStatus.FAILED; + if ("completed".equals(codeString)) + return TaskStatus.COMPLETED; + throw new IllegalArgumentException("Unknown TaskStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return new Enumeration(this, TaskStatus.DRAFT); + if ("requested".equals(codeString)) + return new Enumeration(this, TaskStatus.REQUESTED); + if ("received".equals(codeString)) + return new Enumeration(this, TaskStatus.RECEIVED); + if ("accepted".equals(codeString)) + return new Enumeration(this, TaskStatus.ACCEPTED); + if ("rejected".equals(codeString)) + return new Enumeration(this, TaskStatus.REJECTED); + if ("ready".equals(codeString)) + return new Enumeration(this, TaskStatus.READY); + if ("in-progress".equals(codeString)) + return new Enumeration(this, TaskStatus.INPROGRESS); + if ("on-hold".equals(codeString)) + return new Enumeration(this, TaskStatus.ONHOLD); + if ("failed".equals(codeString)) + return new Enumeration(this, TaskStatus.FAILED); + if ("completed".equals(codeString)) + return new Enumeration(this, TaskStatus.COMPLETED); + throw new FHIRException("Unknown TaskStatus code '"+codeString+"'"); + } + public String toCode(TaskStatus code) { + if (code == TaskStatus.DRAFT) + return "draft"; + if (code == TaskStatus.REQUESTED) + return "requested"; + if (code == TaskStatus.RECEIVED) + return "received"; + if (code == TaskStatus.ACCEPTED) + return "accepted"; + if (code == TaskStatus.REJECTED) + return "rejected"; + if (code == TaskStatus.READY) + return "ready"; + if (code == TaskStatus.INPROGRESS) + return "in-progress"; + if (code == TaskStatus.ONHOLD) + return "on-hold"; + if (code == TaskStatus.FAILED) + return "failed"; + if (code == TaskStatus.COMPLETED) + return "completed"; + return "?"; + } + public String toSystem(TaskStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class ParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the input parameter. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Input Name", formalDefinition="The name of the input parameter." ) + protected StringType name; + + /** + * The value of the input parameter as a basic type. + */ + @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Input Value", formalDefinition="The value of the input parameter as a basic type." ) + protected org.hl7.fhir.dstu2016may.model.Type value; + + private static final long serialVersionUID = 342865819L; + + /** + * Constructor + */ + public ParameterComponent() { + super(); + } + + /** + * Constructor + */ + public ParameterComponent(StringType name, org.hl7.fhir.dstu2016may.model.Type value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @return {@link #name} (The name of the input parameter.). 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 ParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 input parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ParameterComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the input parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the input parameter. + */ + public ParameterComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the input parameter as a basic type.) + */ + public org.hl7.fhir.dstu2016may.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the input parameter as a basic type.) + */ + public ParameterComponent setValue(org.hl7.fhir.dstu2016may.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 input parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu2016may.model.Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 111972721: // value + this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("value[x]")) + this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1410166417: return getValue(); // org.hl7.fhir.dstu2016may.model.Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.name"); + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDecimal")) { + this.value = new DecimalType(); + return this.value; + } + else if (name.equals("valueBase64Binary")) { + this.value = new Base64BinaryType(); + return this.value; + } + else if (name.equals("valueInstant")) { + this.value = new InstantType(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueUri")) { + this.value = new UriType(); + return this.value; + } + else if (name.equals("valueDate")) { + this.value = new DateType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueCode")) { + this.value = new CodeType(); + return this.value; + } + else if (name.equals("valueOid")) { + this.value = new OidType(); + return this.value; + } + else if (name.equals("valueId")) { + this.value = new IdType(); + return this.value; + } + else if (name.equals("valueUnsignedInt")) { + this.value = new UnsignedIntType(); + return this.value; + } + else if (name.equals("valuePositiveInt")) { + this.value = new PositiveIntType(); + return this.value; + } + else if (name.equals("valueMarkdown")) { + this.value = new MarkdownType(); + return this.value; + } + else if (name.equals("valueAnnotation")) { + this.value = new Annotation(); + return this.value; + } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueIdentifier")) { + this.value = new Identifier(); + return this.value; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueCoding")) { + this.value = new Coding(); + return this.value; + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else if (name.equals("valueRatio")) { + this.value = new Ratio(); + return this.value; + } + else if (name.equals("valueSampledData")) { + this.value = new SampledData(); + return this.value; + } + else if (name.equals("valueSignature")) { + this.value = new Signature(); + return this.value; + } + else if (name.equals("valueHumanName")) { + this.value = new HumanName(); + return this.value; + } + else if (name.equals("valueAddress")) { + this.value = new Address(); + return this.value; + } + else if (name.equals("valueContactPoint")) { + this.value = new ContactPoint(); + return this.value; + } + else if (name.equals("valueTiming")) { + this.value = new Timing(); + return this.value; + } + else if (name.equals("valueReference")) { + this.value = new Reference(); + return this.value; + } + else if (name.equals("valueMeta")) { + this.value = new Meta(); + return this.value; + } + else + return super.addChild(name); + } + + public ParameterComponent copy() { + ParameterComponent dst = new ParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ParameterComponent)) + return false; + ParameterComponent o = (ParameterComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ParameterComponent)) + return false; + ParameterComponent o = (ParameterComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "Task.input"; + + } + + } + + @Block() + public static class TaskOutputComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the Output parameter. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Output Name", formalDefinition="The name of the Output parameter." ) + protected StringType name; + + /** + * The value of the Output parameter as a basic type. + */ + @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Output Value", formalDefinition="The value of the Output parameter as a basic type." ) + protected org.hl7.fhir.dstu2016may.model.Type value; + + private static final long serialVersionUID = 342865819L; + + /** + * Constructor + */ + public TaskOutputComponent() { + super(); + } + + /** + * Constructor + */ + public TaskOutputComponent(StringType name, org.hl7.fhir.dstu2016may.model.Type value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @return {@link #name} (The name of the Output parameter.). 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 TaskOutputComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 Output parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TaskOutputComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the Output parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the Output parameter. + */ + public TaskOutputComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the Output parameter as a basic type.) + */ + public org.hl7.fhir.dstu2016may.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the Output parameter as a basic type.) + */ + public TaskOutputComponent setValue(org.hl7.fhir.dstu2016may.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 Output parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu2016may.model.Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 111972721: // value + this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("value[x]")) + this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1410166417: return getValue(); // org.hl7.fhir.dstu2016may.model.Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.name"); + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDecimal")) { + this.value = new DecimalType(); + return this.value; + } + else if (name.equals("valueBase64Binary")) { + this.value = new Base64BinaryType(); + return this.value; + } + else if (name.equals("valueInstant")) { + this.value = new InstantType(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueUri")) { + this.value = new UriType(); + return this.value; + } + else if (name.equals("valueDate")) { + this.value = new DateType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueCode")) { + this.value = new CodeType(); + return this.value; + } + else if (name.equals("valueOid")) { + this.value = new OidType(); + return this.value; + } + else if (name.equals("valueId")) { + this.value = new IdType(); + return this.value; + } + else if (name.equals("valueUnsignedInt")) { + this.value = new UnsignedIntType(); + return this.value; + } + else if (name.equals("valuePositiveInt")) { + this.value = new PositiveIntType(); + return this.value; + } + else if (name.equals("valueMarkdown")) { + this.value = new MarkdownType(); + return this.value; + } + else if (name.equals("valueAnnotation")) { + this.value = new Annotation(); + return this.value; + } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueIdentifier")) { + this.value = new Identifier(); + return this.value; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueCoding")) { + this.value = new Coding(); + return this.value; + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else if (name.equals("valueRatio")) { + this.value = new Ratio(); + return this.value; + } + else if (name.equals("valueSampledData")) { + this.value = new SampledData(); + return this.value; + } + else if (name.equals("valueSignature")) { + this.value = new Signature(); + return this.value; + } + else if (name.equals("valueHumanName")) { + this.value = new HumanName(); + return this.value; + } + else if (name.equals("valueAddress")) { + this.value = new Address(); + return this.value; + } + else if (name.equals("valueContactPoint")) { + this.value = new ContactPoint(); + return this.value; + } + else if (name.equals("valueTiming")) { + this.value = new Timing(); + return this.value; + } + else if (name.equals("valueReference")) { + this.value = new Reference(); + return this.value; + } + else if (name.equals("valueMeta")) { + this.value = new Meta(); + return this.value; + } + else + return super.addChild(name); + } + + public TaskOutputComponent copy() { + TaskOutputComponent dst = new TaskOutputComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TaskOutputComponent)) + return false; + TaskOutputComponent o = (TaskOutputComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TaskOutputComponent)) + return false; + TaskOutputComponent o = (TaskOutputComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "Task.output"; + + } + + } + + /** + * The business identifier for this task. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Task Instance Identifier", formalDefinition="The business identifier for this task." ) + protected Identifier identifier; + + /** + * A name or code (or both) briefly describing what the task involves. + */ + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Task Type", formalDefinition="A name or code (or both) briefly describing what the task involves." ) + protected CodeableConcept type; + + /** + * A description of this task. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Task Description", formalDefinition="A description of this task." ) + protected StringType description; + + /** + * The type of participant that can execute the task. + */ + @Child(name = "performerType", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="requester | dispatcher | scheduler | performer | monitor | manager | acquirer | reviewer", formalDefinition="The type of participant that can execute the task." ) + protected List performerType; + + /** + * The priority of the task among other tasks of the same type. + */ + @Child(name = "priority", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="low | normal | high", formalDefinition="The priority of the task among other tasks of the same type." ) + protected Enumeration priority; + + /** + * The current status of the task. + */ + @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="draft | requested | received | accepted | +", formalDefinition="The current status of the task." ) + protected Enumeration status; + + /** + * An explaination as to why this task failed. + */ + @Child(name = "failureReason", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Task Failure Reason", formalDefinition="An explaination as to why this task failed." ) + protected CodeableConcept failureReason; + + /** + * The subject of the task. + */ + @Child(name = "subject", type = {}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Task Subject", formalDefinition="The subject of the task." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The subject of the task.) + */ + protected Resource subjectTarget; + + /** + * The entity who benefits from the performance of the service specified in the task (e.g., the patient). + */ + @Child(name = "for", type = {}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Beneficiary of the Task", formalDefinition="The entity who benefits from the performance of the service specified in the task (e.g., the patient)." ) + protected Reference for_; + + /** + * The actual object that is the target of the reference (The entity who benefits from the performance of the service specified in the task (e.g., the patient).) + */ + protected Resource for_Target; + + /** + * A reference to a formal or informal definition of the task. + */ + @Child(name = "definition", type = {UriType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Task Definition", formalDefinition="A reference to a formal or informal definition of the task." ) + protected UriType definition; + + /** + * The date and time this task was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=10, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Task Creation Date", formalDefinition="The date and time this task was created." ) + protected DateTimeType created; + + /** + * The date and time of last modification to this task. + */ + @Child(name = "lastModified", type = {DateTimeType.class}, order=11, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Task Last Modified Date", formalDefinition="The date and time of last modification to this task." ) + protected DateTimeType lastModified; + + /** + * The creator of the task. + */ + @Child(name = "creator", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=12, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Task Creator", formalDefinition="The creator of the task." ) + protected Reference creator; + + /** + * The actual object that is the target of the reference (The creator of the task.) + */ + protected Resource creatorTarget; + + /** + * The owner of this task. The participant who can execute this task. + */ + @Child(name = "owner", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Task Owner", formalDefinition="The owner of this task. The participant who can execute this task." ) + protected Reference owner; + + /** + * The actual object that is the target of the reference (The owner of this task. The participant who can execute this task.) + */ + protected Resource ownerTarget; + + /** + * Task that this particular task is part of. + */ + @Child(name = "parent", type = {Task.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Composite task", formalDefinition="Task that this particular task is part of." ) + protected Reference parent; + + /** + * The actual object that is the target of the reference (Task that this particular task is part of.) + */ + protected Task parentTarget; + + /** + * Inputs to the task. + */ + @Child(name = "input", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Task Input", formalDefinition="Inputs to the task." ) + protected List input; + + /** + * Outputs produced by the Task. + */ + @Child(name = "output", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Task Output", formalDefinition="Outputs produced by the Task." ) + protected List output; + + private static final long serialVersionUID = 969281174L; + + /** + * Constructor + */ + public Task() { + super(); + } + + /** + * Constructor + */ + public Task(Enumeration status, DateTimeType created, DateTimeType lastModified, Reference creator) { + super(); + this.status = status; + this.created = created; + this.lastModified = lastModified; + this.creator = creator; + } + + /** + * @return {@link #identifier} (The business identifier for this task.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The business identifier for this task.) + */ + public Task setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #type} (A name or code (or both) briefly describing what the task involves.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A name or code (or both) briefly describing what the task involves.) + */ + public Task setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #description} (A description of this task.). 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 Task.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 description of this task.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Task setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of this task. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of this task. + */ + public Task 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 #performerType} (The type of participant that can execute the task.) + */ + public List getPerformerType() { + if (this.performerType == null) + this.performerType = new ArrayList(); + return this.performerType; + } + + public boolean hasPerformerType() { + if (this.performerType == null) + return false; + for (Coding item : this.performerType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performerType} (The type of participant that can execute the task.) + */ + // syntactic sugar + public Coding addPerformerType() { //3 + Coding t = new Coding(); + if (this.performerType == null) + this.performerType = new ArrayList(); + this.performerType.add(t); + return t; + } + + // syntactic sugar + public Task addPerformerType(Coding t) { //3 + if (t == null) + return this; + if (this.performerType == null) + this.performerType = new ArrayList(); + this.performerType.add(t); + return this; + } + + /** + * @return {@link #priority} (The priority of the task among other tasks of the same type.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new TaskPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The priority of the task among other tasks of the same type.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Task setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return The priority of the task among other tasks of the same type. + */ + public TaskPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value The priority of the task among other tasks of the same type. + */ + public Task setPriority(TaskPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new TaskPriorityEnumFactory()); + this.priority.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The current status of the task.). 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 Task.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new TaskStatusEnumFactory()); // bb + 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 current status of the task.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Task setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The current status of the task. + */ + public TaskStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The current status of the task. + */ + public Task setStatus(TaskStatus value) { + if (this.status == null) + this.status = new Enumeration(new TaskStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #failureReason} (An explaination as to why this task failed.) + */ + public CodeableConcept getFailureReason() { + if (this.failureReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.failureReason"); + else if (Configuration.doAutoCreate()) + this.failureReason = new CodeableConcept(); // cc + return this.failureReason; + } + + public boolean hasFailureReason() { + return this.failureReason != null && !this.failureReason.isEmpty(); + } + + /** + * @param value {@link #failureReason} (An explaination as to why this task failed.) + */ + public Task setFailureReason(CodeableConcept value) { + this.failureReason = value; + return this; + } + + /** + * @return {@link #subject} (The subject of the task.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The subject of the task.) + */ + public Task 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 subject of the task.) + */ + public Resource getSubjectTarget() { + 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 subject of the task.) + */ + public Task setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #for_} (The entity who benefits from the performance of the service specified in the task (e.g., the patient).) + */ + public Reference getFor() { + if (this.for_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.for_"); + else if (Configuration.doAutoCreate()) + this.for_ = new Reference(); // cc + return this.for_; + } + + public boolean hasFor() { + return this.for_ != null && !this.for_.isEmpty(); + } + + /** + * @param value {@link #for_} (The entity who benefits from the performance of the service specified in the task (e.g., the patient).) + */ + public Task setFor(Reference value) { + this.for_ = value; + return this; + } + + /** + * @return {@link #for_} 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 who benefits from the performance of the service specified in the task (e.g., the patient).) + */ + public Resource getForTarget() { + return this.for_Target; + } + + /** + * @param value {@link #for_} 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 who benefits from the performance of the service specified in the task (e.g., the patient).) + */ + public Task setForTarget(Resource value) { + this.for_Target = value; + return this; + } + + /** + * @return {@link #definition} (A reference to a formal or informal definition of the task.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public UriType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new UriType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (A reference to a formal or informal definition of the task.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public Task setDefinitionElement(UriType value) { + this.definition = value; + return this; + } + + /** + * @return A reference to a formal or informal definition of the task. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value A reference to a formal or informal definition of the task. + */ + public Task setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new UriType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #created} (The date and time this task was created.). 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 Task.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); // bb + 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 and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public Task setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date and time this task was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date and time this task was created. + */ + public Task setCreated(Date value) { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + return this; + } + + /** + * @return {@link #lastModified} (The date and time of last modification to this task.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public DateTimeType getLastModifiedElement() { + if (this.lastModified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.lastModified"); + else if (Configuration.doAutoCreate()) + this.lastModified = new DateTimeType(); // bb + return this.lastModified; + } + + public boolean hasLastModifiedElement() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + public boolean hasLastModified() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + /** + * @param value {@link #lastModified} (The date and time of last modification to this task.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public Task setLastModifiedElement(DateTimeType value) { + this.lastModified = value; + return this; + } + + /** + * @return The date and time of last modification to this task. + */ + public Date getLastModified() { + return this.lastModified == null ? null : this.lastModified.getValue(); + } + + /** + * @param value The date and time of last modification to this task. + */ + public Task setLastModified(Date value) { + if (this.lastModified == null) + this.lastModified = new DateTimeType(); + this.lastModified.setValue(value); + return this; + } + + /** + * @return {@link #creator} (The creator of the task.) + */ + public Reference getCreator() { + if (this.creator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.creator"); + else if (Configuration.doAutoCreate()) + this.creator = new Reference(); // cc + return this.creator; + } + + public boolean hasCreator() { + return this.creator != null && !this.creator.isEmpty(); + } + + /** + * @param value {@link #creator} (The creator of the task.) + */ + public Task setCreator(Reference value) { + this.creator = value; + return this; + } + + /** + * @return {@link #creator} 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 creator of the task.) + */ + public Resource getCreatorTarget() { + return this.creatorTarget; + } + + /** + * @param value {@link #creator} 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 creator of the task.) + */ + public Task setCreatorTarget(Resource value) { + this.creatorTarget = value; + return this; + } + + /** + * @return {@link #owner} (The owner of this task. The participant who can execute this task.) + */ + public Reference getOwner() { + if (this.owner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.owner"); + else if (Configuration.doAutoCreate()) + this.owner = new Reference(); // cc + return this.owner; + } + + public boolean hasOwner() { + return this.owner != null && !this.owner.isEmpty(); + } + + /** + * @param value {@link #owner} (The owner of this task. The participant who can execute this task.) + */ + public Task setOwner(Reference value) { + this.owner = value; + return this; + } + + /** + * @return {@link #owner} 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 owner of this task. The participant who can execute this task.) + */ + public Resource getOwnerTarget() { + return this.ownerTarget; + } + + /** + * @param value {@link #owner} 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 owner of this task. The participant who can execute this task.) + */ + public Task setOwnerTarget(Resource value) { + this.ownerTarget = value; + return this; + } + + /** + * @return {@link #parent} (Task that this particular task is part of.) + */ + public Reference getParent() { + if (this.parent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.parent"); + else if (Configuration.doAutoCreate()) + this.parent = new Reference(); // cc + return this.parent; + } + + public boolean hasParent() { + return this.parent != null && !this.parent.isEmpty(); + } + + /** + * @param value {@link #parent} (Task that this particular task is part of.) + */ + public Task 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. (Task that this particular task is part of.) + */ + public Task getParentTarget() { + if (this.parentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.parent"); + else if (Configuration.doAutoCreate()) + this.parentTarget = new Task(); // aa + 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. (Task that this particular task is part of.) + */ + public Task setParentTarget(Task value) { + this.parentTarget = value; + return this; + } + + /** + * @return {@link #input} (Inputs to the task.) + */ + public List getInput() { + if (this.input == null) + this.input = new ArrayList(); + return this.input; + } + + public boolean hasInput() { + if (this.input == null) + return false; + for (ParameterComponent item : this.input) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #input} (Inputs to the task.) + */ + // syntactic sugar + public ParameterComponent addInput() { //3 + ParameterComponent t = new ParameterComponent(); + if (this.input == null) + this.input = new ArrayList(); + this.input.add(t); + return t; + } + + // syntactic sugar + public Task addInput(ParameterComponent t) { //3 + if (t == null) + return this; + if (this.input == null) + this.input = new ArrayList(); + this.input.add(t); + return this; + } + + /** + * @return {@link #output} (Outputs produced by the Task.) + */ + public List getOutput() { + if (this.output == null) + this.output = new ArrayList(); + return this.output; + } + + public boolean hasOutput() { + if (this.output == null) + return false; + for (TaskOutputComponent item : this.output) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #output} (Outputs produced by the Task.) + */ + // syntactic sugar + public TaskOutputComponent addOutput() { //3 + TaskOutputComponent t = new TaskOutputComponent(); + if (this.output == null) + this.output = new ArrayList(); + this.output.add(t); + return t; + } + + // syntactic sugar + public Task addOutput(TaskOutputComponent t) { //3 + if (t == null) + return this; + if (this.output == null) + this.output = new ArrayList(); + this.output.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The business identifier for this task.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "A name or code (or both) briefly describing what the task involves.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("description", "string", "A description of this task.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("performerType", "Coding", "The type of participant that can execute the task.", 0, java.lang.Integer.MAX_VALUE, performerType)); + childrenList.add(new Property("priority", "code", "The priority of the task among other tasks of the same type.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("status", "code", "The current status of the task.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("failureReason", "CodeableConcept", "An explaination as to why this task failed.", 0, java.lang.Integer.MAX_VALUE, failureReason)); + childrenList.add(new Property("subject", "Reference(Any)", "The subject of the task.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("for", "Reference(Any)", "The entity who benefits from the performance of the service specified in the task (e.g., the patient).", 0, java.lang.Integer.MAX_VALUE, for_)); + childrenList.add(new Property("definition", "uri", "A reference to a formal or informal definition of the task.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("created", "dateTime", "The date and time this task was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("lastModified", "dateTime", "The date and time of last modification to this task.", 0, java.lang.Integer.MAX_VALUE, lastModified)); + childrenList.add(new Property("creator", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The creator of the task.", 0, java.lang.Integer.MAX_VALUE, creator)); + childrenList.add(new Property("owner", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The owner of this task. The participant who can execute this task.", 0, java.lang.Integer.MAX_VALUE, owner)); + childrenList.add(new Property("parent", "Reference(Task)", "Task that this particular task is part of.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("input", "", "Inputs to the task.", 0, java.lang.Integer.MAX_VALUE, input)); + childrenList.add(new Property("output", "", "Outputs produced by the Task.", 0, java.lang.Integer.MAX_VALUE, output)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : this.performerType.toArray(new Base[this.performerType.size()]); // Coding + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -1990598546: /*failureReason*/ return this.failureReason == null ? new Base[0] : new Base[] {this.failureReason}; // CodeableConcept + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference + case 101577: /*for*/ return this.for_ == null ? new Base[0] : new Base[] {this.for_}; // Reference + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 1959003007: /*lastModified*/ return this.lastModified == null ? new Base[0] : new Base[] {this.lastModified}; // DateTimeType + case 1028554796: /*creator*/ return this.creator == null ? new Base[0] : new Base[] {this.creator}; // Reference + case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference + case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference + case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // ParameterComponent + case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // TaskOutputComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 3575610: // type + this.type = castToCodeableConcept(value); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -901444568: // performerType + this.getPerformerType().add(castToCoding(value)); // Coding + break; + case -1165461084: // priority + this.priority = new TaskPriorityEnumFactory().fromType(value); // Enumeration + break; + case -892481550: // status + this.status = new TaskStatusEnumFactory().fromType(value); // Enumeration + break; + case -1990598546: // failureReason + this.failureReason = castToCodeableConcept(value); // CodeableConcept + break; + case -1867885268: // subject + this.subject = castToReference(value); // Reference + break; + case 101577: // for + this.for_ = castToReference(value); // Reference + break; + case -1014418093: // definition + this.definition = castToUri(value); // UriType + break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; + case 1959003007: // lastModified + this.lastModified = castToDateTime(value); // DateTimeType + break; + case 1028554796: // creator + this.creator = castToReference(value); // Reference + break; + case 106164915: // owner + this.owner = castToReference(value); // Reference + break; + case -995424086: // parent + this.parent = castToReference(value); // Reference + break; + case 100358090: // input + this.getInput().add((ParameterComponent) value); // ParameterComponent + break; + case -1005512447: // output + this.getOutput().add((TaskOutputComponent) value); // TaskOutputComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("type")) + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("performerType")) + this.getPerformerType().add(castToCoding(value)); + else if (name.equals("priority")) + this.priority = new TaskPriorityEnumFactory().fromType(value); // Enumeration + else if (name.equals("status")) + this.status = new TaskStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("failureReason")) + this.failureReason = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference + else if (name.equals("for")) + this.for_ = castToReference(value); // Reference + else if (name.equals("definition")) + this.definition = castToUri(value); // UriType + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("lastModified")) + this.lastModified = castToDateTime(value); // DateTimeType + else if (name.equals("creator")) + this.creator = castToReference(value); // Reference + else if (name.equals("owner")) + this.owner = castToReference(value); // Reference + else if (name.equals("parent")) + this.parent = castToReference(value); // Reference + else if (name.equals("input")) + this.getInput().add((ParameterComponent) value); + else if (name.equals("output")) + this.getOutput().add((TaskOutputComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case 3575610: return getType(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -901444568: return addPerformerType(); // Coding + case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -1990598546: return getFailureReason(); // CodeableConcept + case -1867885268: return getSubject(); // Reference + case 101577: return getFor(); // Reference + case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // UriType + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 1959003007: throw new FHIRException("Cannot make property lastModified as it is not a complex type"); // DateTimeType + case 1028554796: return getCreator(); // Reference + case 106164915: return getOwner(); // Reference + case -995424086: return getParent(); // Reference + case 100358090: return addInput(); // ParameterComponent + case -1005512447: return addOutput(); // TaskOutputComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("type")) { + this.type = new CodeableConcept(); + return this.type; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.description"); + } + else if (name.equals("performerType")) { + return addPerformerType(); + } + else if (name.equals("priority")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.priority"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.status"); + } + else if (name.equals("failureReason")) { + this.failureReason = new CodeableConcept(); + return this.failureReason; + } + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; + } + else if (name.equals("for")) { + this.for_ = new Reference(); + return this.for_; + } + else if (name.equals("definition")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.definition"); + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.created"); + } + else if (name.equals("lastModified")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.lastModified"); + } + else if (name.equals("creator")) { + this.creator = new Reference(); + return this.creator; + } + else if (name.equals("owner")) { + this.owner = new Reference(); + return this.owner; + } + else if (name.equals("parent")) { + this.parent = new Reference(); + return this.parent; + } + else if (name.equals("input")) { + return addInput(); + } + else if (name.equals("output")) { + return addOutput(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Task"; + + } + + public Task copy() { + Task dst = new Task(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.type = type == null ? null : type.copy(); + dst.description = description == null ? null : description.copy(); + if (performerType != null) { + dst.performerType = new ArrayList(); + for (Coding i : performerType) + dst.performerType.add(i.copy()); + }; + dst.priority = priority == null ? null : priority.copy(); + dst.status = status == null ? null : status.copy(); + dst.failureReason = failureReason == null ? null : failureReason.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.for_ = for_ == null ? null : for_.copy(); + dst.definition = definition == null ? null : definition.copy(); + dst.created = created == null ? null : created.copy(); + dst.lastModified = lastModified == null ? null : lastModified.copy(); + dst.creator = creator == null ? null : creator.copy(); + dst.owner = owner == null ? null : owner.copy(); + dst.parent = parent == null ? null : parent.copy(); + if (input != null) { + dst.input = new ArrayList(); + for (ParameterComponent i : input) + dst.input.add(i.copy()); + }; + if (output != null) { + dst.output = new ArrayList(); + for (TaskOutputComponent i : output) + dst.output.add(i.copy()); + }; + return dst; + } + + protected Task typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Task)) + return false; + Task o = (Task) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true) + && compareDeep(performerType, o.performerType, true) && compareDeep(priority, o.priority, true) + && compareDeep(status, o.status, true) && compareDeep(failureReason, o.failureReason, true) && compareDeep(subject, o.subject, true) + && compareDeep(for_, o.for_, true) && compareDeep(definition, o.definition, true) && compareDeep(created, o.created, true) + && compareDeep(lastModified, o.lastModified, true) && compareDeep(creator, o.creator, true) && compareDeep(owner, o.owner, true) + && compareDeep(parent, o.parent, true) && compareDeep(input, o.input, true) && compareDeep(output, o.output, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Task)) + return false; + Task o = (Task) other; + return compareValues(description, o.description, true) && compareValues(priority, o.priority, true) + && compareValues(status, o.status, true) && compareValues(definition, o.definition, true) && compareValues(created, o.created, true) + && compareValues(lastModified, o.lastModified, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (description == null || description.isEmpty()) && (performerType == null || performerType.isEmpty()) + && (priority == null || priority.isEmpty()) && (status == null || status.isEmpty()) && (failureReason == null || failureReason.isEmpty()) + && (subject == null || subject.isEmpty()) && (for_ == null || for_.isEmpty()) && (definition == null || definition.isEmpty()) + && (created == null || created.isEmpty()) && (lastModified == null || lastModified.isEmpty()) + && (creator == null || creator.isEmpty()) && (owner == null || owner.isEmpty()) && (parent == null || parent.isEmpty()) + && (input == null || input.isEmpty()) && (output == null || output.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Task; + } + + /** + * Search parameter: definition + *

+ * Description: Search by task definition
+ * Type: uri
+ * Path: Task.definition
+ *

+ */ + @SearchParamDefinition(name="definition", path="Task.definition", description="Search by task definition", type="uri" ) + public static final String SP_DEFINITION = "definition"; + /** + * Fluent Client search parameter constant for definition + *

+ * Description: Search by task definition
+ * Type: uri
+ * Path: Task.definition
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam DEFINITION = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DEFINITION); + + /** + * Search parameter: status + *

+ * Description: Search by task status
+ * Type: token
+ * Path: Task.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Task.status", description="Search by task status", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: Search by task status
+ * Type: token
+ * Path: Task.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: subject + *

+ * Description: Search by task subject
+ * Type: reference
+ * Path: Task.subject
+ *

+ */ + @SearchParamDefinition(name="subject", path="Task.subject", description="Search by task subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + /** + * Fluent Client search parameter constant for subject + *

+ * Description: Search by task subject
+ * Type: reference
+ * Path: Task.subject
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Task:subject").toLocked(); + + /** + * Search parameter: parent + *

+ * Description: Search by parent task
+ * Type: reference
+ * Path: Task.parent
+ *

+ */ + @SearchParamDefinition(name="parent", path="Task.parent", description="Search by parent task", type="reference" ) + public static final String SP_PARENT = "parent"; + /** + * Fluent Client search parameter constant for parent + *

+ * Description: Search by parent task
+ * Type: reference
+ * Path: Task.parent
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:parent". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("Task:parent").toLocked(); + + /** + * Search parameter: type + *

+ * Description: Search by task type
+ * Type: token
+ * Path: Task.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Task.type", description="Search by task type", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: Search by task type
+ * Type: token
+ * Path: Task.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + + /** + * Search parameter: modified + *

+ * Description: Search by last modification date
+ * Type: date
+ * Path: Task.lastModified
+ *

+ */ + @SearchParamDefinition(name="modified", path="Task.lastModified", description="Search by last modification date", type="date" ) + public static final String SP_MODIFIED = "modified"; + /** + * Fluent Client search parameter constant for modified + *

+ * Description: Search by last modification date
+ * Type: date
+ * Path: Task.lastModified
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam MODIFIED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_MODIFIED); + + /** + * Search parameter: creator + *

+ * Description: Search by task creator
+ * Type: reference
+ * Path: Task.creator
+ *

+ */ + @SearchParamDefinition(name="creator", path="Task.creator", description="Search by task creator", type="reference" ) + public static final String SP_CREATOR = "creator"; + /** + * Fluent Client search parameter constant for creator + *

+ * Description: Search by task creator
+ * Type: reference
+ * Path: Task.creator
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CREATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CREATOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:creator". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CREATOR = new ca.uhn.fhir.model.api.Include("Task:creator").toLocked(); + + /** + * Search parameter: failure + *

+ * Description: Search by failure reason
+ * Type: token
+ * Path: Task.failureReason
+ *

+ */ + @SearchParamDefinition(name="failure", path="Task.failureReason", description="Search by failure reason", type="token" ) + public static final String SP_FAILURE = "failure"; + /** + * Fluent Client search parameter constant for failure + *

+ * Description: Search by failure reason
+ * Type: token
+ * Path: Task.failureReason
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FAILURE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FAILURE); + + /** + * Search parameter: created + *

+ * Description: Search by creation date
+ * Type: date
+ * Path: Task.created
+ *

+ */ + @SearchParamDefinition(name="created", path="Task.created", description="Search by creation date", type="date" ) + public static final String SP_CREATED = "created"; + /** + * Fluent Client search parameter constant for created + *

+ * Description: Search by creation date
+ * Type: date
+ * Path: Task.created
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + + /** + * Search parameter: priority + *

+ * Description: Search by task priority
+ * Type: token
+ * Path: Task.priority
+ *

+ */ + @SearchParamDefinition(name="priority", path="Task.priority", description="Search by task priority", type="token" ) + public static final String SP_PRIORITY = "priority"; + /** + * Fluent Client search parameter constant for priority + *

+ * Description: Search by task priority
+ * Type: token
+ * Path: Task.priority
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); + + /** + * Search parameter: owner + *

+ * Description: Search by task owner
+ * Type: reference
+ * Path: Task.owner
+ *

+ */ + @SearchParamDefinition(name="owner", path="Task.owner", description="Search by task owner", type="reference" ) + public static final String SP_OWNER = "owner"; + /** + * Fluent Client search parameter constant for owner + *

+ * Description: Search by task owner
+ * Type: reference
+ * Path: Task.owner
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:owner". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNER = new ca.uhn.fhir.model.api.Include("Task:owner").toLocked(); + + /** + * Search parameter: performer + *

+ * Description: Search by recommended type of performer (e.g., Requester, Performer, Scheduler).
+ * Type: token
+ * Path: Task.performerType
+ *

+ */ + @SearchParamDefinition(name="performer", path="Task.performerType", description="Search by recommended type of performer (e.g., Requester, Performer, Scheduler).", type="token" ) + public static final String SP_PERFORMER = "performer"; + /** + * Fluent Client search parameter constant for performer + *

+ * Description: Search by recommended type of performer (e.g., Requester, Performer, Scheduler).
+ * Type: token
+ * Path: Task.performerType
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PERFORMER); + + /** + * Search parameter: identifier + *

+ * Description: Search for a task instance by its business identifier
+ * Type: token
+ * Path: Task.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Task.identifier", description="Search for a task instance by its business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Search for a task instance by its business identifier
+ * Type: token
+ * Path: Task.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TemporalPrecisionEnum.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TemporalPrecisionEnum.java new file mode 100644 index 00000000000..76175a748e2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TemporalPrecisionEnum.java @@ -0,0 +1,62 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.util.Calendar; +import java.util.Date; + +import org.apache.commons.lang3.time.DateUtils; + +public enum TemporalPrecisionEnum { + + YEAR(Calendar.YEAR) { + @Override + public Date add(Date theInput, int theAmount) { + return DateUtils.addYears(theInput, theAmount); + } + }, + + MONTH(Calendar.MONTH) { + @Override + public Date add(Date theInput, int theAmount) { + return DateUtils.addMonths(theInput, theAmount); + } + }, + DAY(Calendar.DATE) { + @Override + public Date add(Date theInput, int theAmount) { + 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) { + return DateUtils.addMilliseconds(theInput, theAmount); + } + }, + + ; + + private int myCalendarConstant; + + TemporalPrecisionEnum(int theCalendarConstant) { + myCalendarConstant = theCalendarConstant; + } + + public abstract Date add(Date theInput, int theAmount); + + public int getCalendarConstant() { + return myCalendarConstant; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TestScript.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TestScript.java new file mode 100644 index 00000000000..3216788e2ad --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TestScript.java @@ -0,0 +1,10956 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + */ +@ResourceDef(name="TestScript", profile="http://hl7.org/fhir/Profile/TestScript") +public class TestScript extends DomainResource { + + public enum ContentType { + /** + * XML content-type corresponding to the application/xml+fhir mime-type. + */ + XML, + /** + * JSON content-type corresponding to the application/json+fhir mime-type. + */ + JSON, + /** + * added to help the parsers + */ + NULL; + public static ContentType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("xml".equals(codeString)) + return XML; + if ("json".equals(codeString)) + return JSON; + throw new FHIRException("Unknown ContentType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case XML: return "xml"; + case JSON: return "json"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case XML: return "http://hl7.org/fhir/content-type"; + case JSON: return "http://hl7.org/fhir/content-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case XML: return "XML content-type corresponding to the application/xml+fhir mime-type."; + case JSON: return "JSON content-type corresponding to the application/json+fhir mime-type."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case XML: return "xml"; + case JSON: return "json"; + default: return "?"; + } + } + } + + public static class ContentTypeEnumFactory implements EnumFactory { + public ContentType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("xml".equals(codeString)) + return ContentType.XML; + if ("json".equals(codeString)) + return ContentType.JSON; + throw new IllegalArgumentException("Unknown ContentType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("xml".equals(codeString)) + return new Enumeration(this, ContentType.XML); + if ("json".equals(codeString)) + return new Enumeration(this, ContentType.JSON); + throw new FHIRException("Unknown ContentType code '"+codeString+"'"); + } + public String toCode(ContentType code) { + if (code == ContentType.XML) + return "xml"; + if (code == ContentType.JSON) + return "json"; + return "?"; + } + public String toSystem(ContentType code) { + return code.getSystem(); + } + } + + public enum AssertionDirectionType { + /** + * The assertion is evaluated on the response. This is the default value. + */ + RESPONSE, + /** + * The assertion is evaluated on the request. + */ + REQUEST, + /** + * added to help the parsers + */ + NULL; + public static AssertionDirectionType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("response".equals(codeString)) + return RESPONSE; + if ("request".equals(codeString)) + return REQUEST; + throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case RESPONSE: return "response"; + case REQUEST: return "request"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RESPONSE: return "http://hl7.org/fhir/assert-direction-codes"; + case REQUEST: return "http://hl7.org/fhir/assert-direction-codes"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RESPONSE: return "The assertion is evaluated on the response. This is the default value."; + case REQUEST: return "The assertion is evaluated on the request."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RESPONSE: return "response"; + case REQUEST: return "request"; + default: return "?"; + } + } + } + + public static class AssertionDirectionTypeEnumFactory implements EnumFactory { + public AssertionDirectionType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("response".equals(codeString)) + return AssertionDirectionType.RESPONSE; + if ("request".equals(codeString)) + return AssertionDirectionType.REQUEST; + throw new IllegalArgumentException("Unknown AssertionDirectionType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("response".equals(codeString)) + return new Enumeration(this, AssertionDirectionType.RESPONSE); + if ("request".equals(codeString)) + return new Enumeration(this, AssertionDirectionType.REQUEST); + throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'"); + } + public String toCode(AssertionDirectionType code) { + if (code == AssertionDirectionType.RESPONSE) + return "response"; + if (code == AssertionDirectionType.REQUEST) + return "request"; + return "?"; + } + public String toSystem(AssertionDirectionType code) { + return code.getSystem(); + } + } + + public enum AssertionOperatorType { + /** + * Default value. Equals comparison. + */ + EQUALS, + /** + * Not equals comparison. + */ + NOTEQUALS, + /** + * Compare value within a known set of values. + */ + IN, + /** + * Compare value not within a known set of values. + */ + NOTIN, + /** + * Compare value to be greater than a known value. + */ + GREATERTHAN, + /** + * Compare value to be less than a known value. + */ + LESSTHAN, + /** + * Compare value is empty. + */ + EMPTY, + /** + * Compare value is not empty. + */ + NOTEMPTY, + /** + * Compare value string contains a known value. + */ + CONTAINS, + /** + * Compare value string does not contain a known value. + */ + NOTCONTAINS, + /** + * added to help the parsers + */ + NULL; + public static AssertionOperatorType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("equals".equals(codeString)) + return EQUALS; + if ("notEquals".equals(codeString)) + return NOTEQUALS; + if ("in".equals(codeString)) + return IN; + if ("notIn".equals(codeString)) + return NOTIN; + if ("greaterThan".equals(codeString)) + return GREATERTHAN; + if ("lessThan".equals(codeString)) + return LESSTHAN; + if ("empty".equals(codeString)) + return EMPTY; + if ("notEmpty".equals(codeString)) + return NOTEMPTY; + if ("contains".equals(codeString)) + return CONTAINS; + if ("notContains".equals(codeString)) + return NOTCONTAINS; + throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case EQUALS: return "equals"; + case NOTEQUALS: return "notEquals"; + case IN: return "in"; + case NOTIN: return "notIn"; + case GREATERTHAN: return "greaterThan"; + case LESSTHAN: return "lessThan"; + case EMPTY: return "empty"; + case NOTEMPTY: return "notEmpty"; + case CONTAINS: return "contains"; + case NOTCONTAINS: return "notContains"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EQUALS: return "http://hl7.org/fhir/assert-operator-codes"; + case NOTEQUALS: return "http://hl7.org/fhir/assert-operator-codes"; + case IN: return "http://hl7.org/fhir/assert-operator-codes"; + case NOTIN: return "http://hl7.org/fhir/assert-operator-codes"; + case GREATERTHAN: return "http://hl7.org/fhir/assert-operator-codes"; + case LESSTHAN: return "http://hl7.org/fhir/assert-operator-codes"; + case EMPTY: return "http://hl7.org/fhir/assert-operator-codes"; + case NOTEMPTY: return "http://hl7.org/fhir/assert-operator-codes"; + case CONTAINS: return "http://hl7.org/fhir/assert-operator-codes"; + case NOTCONTAINS: return "http://hl7.org/fhir/assert-operator-codes"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case EQUALS: return "Default value. Equals comparison."; + case NOTEQUALS: return "Not equals comparison."; + case IN: return "Compare value within a known set of values."; + case NOTIN: return "Compare value not within a known set of values."; + case GREATERTHAN: return "Compare value to be greater than a known value."; + case LESSTHAN: return "Compare value to be less than a known value."; + case EMPTY: return "Compare value is empty."; + case NOTEMPTY: return "Compare value is not empty."; + case CONTAINS: return "Compare value string contains a known value."; + case NOTCONTAINS: return "Compare value string does not contain a known value."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case EQUALS: return "equals"; + case NOTEQUALS: return "notEquals"; + case IN: return "in"; + case NOTIN: return "notIn"; + case GREATERTHAN: return "greaterThan"; + case LESSTHAN: return "lessThan"; + case EMPTY: return "empty"; + case NOTEMPTY: return "notEmpty"; + case CONTAINS: return "contains"; + case NOTCONTAINS: return "notContains"; + default: return "?"; + } + } + } + + public static class AssertionOperatorTypeEnumFactory implements EnumFactory { + public AssertionOperatorType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("equals".equals(codeString)) + return AssertionOperatorType.EQUALS; + if ("notEquals".equals(codeString)) + return AssertionOperatorType.NOTEQUALS; + if ("in".equals(codeString)) + return AssertionOperatorType.IN; + if ("notIn".equals(codeString)) + return AssertionOperatorType.NOTIN; + if ("greaterThan".equals(codeString)) + return AssertionOperatorType.GREATERTHAN; + if ("lessThan".equals(codeString)) + return AssertionOperatorType.LESSTHAN; + if ("empty".equals(codeString)) + return AssertionOperatorType.EMPTY; + if ("notEmpty".equals(codeString)) + return AssertionOperatorType.NOTEMPTY; + if ("contains".equals(codeString)) + return AssertionOperatorType.CONTAINS; + if ("notContains".equals(codeString)) + return AssertionOperatorType.NOTCONTAINS; + throw new IllegalArgumentException("Unknown AssertionOperatorType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("equals".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.EQUALS); + if ("notEquals".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.NOTEQUALS); + if ("in".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.IN); + if ("notIn".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.NOTIN); + if ("greaterThan".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.GREATERTHAN); + if ("lessThan".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.LESSTHAN); + if ("empty".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.EMPTY); + if ("notEmpty".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.NOTEMPTY); + if ("contains".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.CONTAINS); + if ("notContains".equals(codeString)) + return new Enumeration(this, AssertionOperatorType.NOTCONTAINS); + throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'"); + } + public String toCode(AssertionOperatorType code) { + if (code == AssertionOperatorType.EQUALS) + return "equals"; + if (code == AssertionOperatorType.NOTEQUALS) + return "notEquals"; + if (code == AssertionOperatorType.IN) + return "in"; + if (code == AssertionOperatorType.NOTIN) + return "notIn"; + if (code == AssertionOperatorType.GREATERTHAN) + return "greaterThan"; + if (code == AssertionOperatorType.LESSTHAN) + return "lessThan"; + if (code == AssertionOperatorType.EMPTY) + return "empty"; + if (code == AssertionOperatorType.NOTEMPTY) + return "notEmpty"; + if (code == AssertionOperatorType.CONTAINS) + return "contains"; + if (code == AssertionOperatorType.NOTCONTAINS) + return "notContains"; + return "?"; + } + public String toSystem(AssertionOperatorType code) { + return code.getSystem(); + } + } + + public enum AssertionResponseTypes { + /** + * Response code is 200. + */ + OKAY, + /** + * Response code is 201. + */ + CREATED, + /** + * Response code is 204. + */ + NOCONTENT, + /** + * Response code is 304. + */ + NOTMODIFIED, + /** + * Response code is 400. + */ + BAD, + /** + * Response code is 403. + */ + FORBIDDEN, + /** + * Response code is 404. + */ + NOTFOUND, + /** + * Response code is 405. + */ + METHODNOTALLOWED, + /** + * Response code is 409. + */ + CONFLICT, + /** + * Response code is 410. + */ + GONE, + /** + * Response code is 412. + */ + PRECONDITIONFAILED, + /** + * Response code is 422. + */ + UNPROCESSABLE, + /** + * added to help the parsers + */ + NULL; + public static AssertionResponseTypes fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("okay".equals(codeString)) + return OKAY; + if ("created".equals(codeString)) + return CREATED; + if ("noContent".equals(codeString)) + return NOCONTENT; + if ("notModified".equals(codeString)) + return NOTMODIFIED; + if ("bad".equals(codeString)) + return BAD; + if ("forbidden".equals(codeString)) + return FORBIDDEN; + if ("notFound".equals(codeString)) + return NOTFOUND; + if ("methodNotAllowed".equals(codeString)) + return METHODNOTALLOWED; + if ("conflict".equals(codeString)) + return CONFLICT; + if ("gone".equals(codeString)) + return GONE; + if ("preconditionFailed".equals(codeString)) + return PRECONDITIONFAILED; + if ("unprocessable".equals(codeString)) + return UNPROCESSABLE; + throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OKAY: return "okay"; + case CREATED: return "created"; + case NOCONTENT: return "noContent"; + case NOTMODIFIED: return "notModified"; + case BAD: return "bad"; + case FORBIDDEN: return "forbidden"; + case NOTFOUND: return "notFound"; + case METHODNOTALLOWED: return "methodNotAllowed"; + case CONFLICT: return "conflict"; + case GONE: return "gone"; + case PRECONDITIONFAILED: return "preconditionFailed"; + case UNPROCESSABLE: return "unprocessable"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OKAY: return "http://hl7.org/fhir/assert-response-code-types"; + case CREATED: return "http://hl7.org/fhir/assert-response-code-types"; + case NOCONTENT: return "http://hl7.org/fhir/assert-response-code-types"; + case NOTMODIFIED: return "http://hl7.org/fhir/assert-response-code-types"; + case BAD: return "http://hl7.org/fhir/assert-response-code-types"; + case FORBIDDEN: return "http://hl7.org/fhir/assert-response-code-types"; + case NOTFOUND: return "http://hl7.org/fhir/assert-response-code-types"; + case METHODNOTALLOWED: return "http://hl7.org/fhir/assert-response-code-types"; + case CONFLICT: return "http://hl7.org/fhir/assert-response-code-types"; + case GONE: return "http://hl7.org/fhir/assert-response-code-types"; + case PRECONDITIONFAILED: return "http://hl7.org/fhir/assert-response-code-types"; + case UNPROCESSABLE: return "http://hl7.org/fhir/assert-response-code-types"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OKAY: return "Response code is 200."; + case CREATED: return "Response code is 201."; + case NOCONTENT: return "Response code is 204."; + case NOTMODIFIED: return "Response code is 304."; + case BAD: return "Response code is 400."; + case FORBIDDEN: return "Response code is 403."; + case NOTFOUND: return "Response code is 404."; + case METHODNOTALLOWED: return "Response code is 405."; + case CONFLICT: return "Response code is 409."; + case GONE: return "Response code is 410."; + case PRECONDITIONFAILED: return "Response code is 412."; + case UNPROCESSABLE: return "Response code is 422."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OKAY: return "okay"; + case CREATED: return "created"; + case NOCONTENT: return "noContent"; + case NOTMODIFIED: return "notModified"; + case BAD: return "bad"; + case FORBIDDEN: return "forbidden"; + case NOTFOUND: return "notFound"; + case METHODNOTALLOWED: return "methodNotAllowed"; + case CONFLICT: return "conflict"; + case GONE: return "gone"; + case PRECONDITIONFAILED: return "preconditionFailed"; + case UNPROCESSABLE: return "unprocessable"; + default: return "?"; + } + } + } + + public static class AssertionResponseTypesEnumFactory implements EnumFactory { + public AssertionResponseTypes fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("okay".equals(codeString)) + return AssertionResponseTypes.OKAY; + if ("created".equals(codeString)) + return AssertionResponseTypes.CREATED; + if ("noContent".equals(codeString)) + return AssertionResponseTypes.NOCONTENT; + if ("notModified".equals(codeString)) + return AssertionResponseTypes.NOTMODIFIED; + if ("bad".equals(codeString)) + return AssertionResponseTypes.BAD; + if ("forbidden".equals(codeString)) + return AssertionResponseTypes.FORBIDDEN; + if ("notFound".equals(codeString)) + return AssertionResponseTypes.NOTFOUND; + if ("methodNotAllowed".equals(codeString)) + return AssertionResponseTypes.METHODNOTALLOWED; + if ("conflict".equals(codeString)) + return AssertionResponseTypes.CONFLICT; + if ("gone".equals(codeString)) + return AssertionResponseTypes.GONE; + if ("preconditionFailed".equals(codeString)) + return AssertionResponseTypes.PRECONDITIONFAILED; + if ("unprocessable".equals(codeString)) + return AssertionResponseTypes.UNPROCESSABLE; + throw new IllegalArgumentException("Unknown AssertionResponseTypes code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("okay".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.OKAY); + if ("created".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.CREATED); + if ("noContent".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.NOCONTENT); + if ("notModified".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.NOTMODIFIED); + if ("bad".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.BAD); + if ("forbidden".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.FORBIDDEN); + if ("notFound".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.NOTFOUND); + if ("methodNotAllowed".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.METHODNOTALLOWED); + if ("conflict".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.CONFLICT); + if ("gone".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.GONE); + if ("preconditionFailed".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.PRECONDITIONFAILED); + if ("unprocessable".equals(codeString)) + return new Enumeration(this, AssertionResponseTypes.UNPROCESSABLE); + throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'"); + } + public String toCode(AssertionResponseTypes code) { + if (code == AssertionResponseTypes.OKAY) + return "okay"; + if (code == AssertionResponseTypes.CREATED) + return "created"; + if (code == AssertionResponseTypes.NOCONTENT) + return "noContent"; + if (code == AssertionResponseTypes.NOTMODIFIED) + return "notModified"; + if (code == AssertionResponseTypes.BAD) + return "bad"; + if (code == AssertionResponseTypes.FORBIDDEN) + return "forbidden"; + if (code == AssertionResponseTypes.NOTFOUND) + return "notFound"; + if (code == AssertionResponseTypes.METHODNOTALLOWED) + return "methodNotAllowed"; + if (code == AssertionResponseTypes.CONFLICT) + return "conflict"; + if (code == AssertionResponseTypes.GONE) + return "gone"; + if (code == AssertionResponseTypes.PRECONDITIONFAILED) + return "preconditionFailed"; + if (code == AssertionResponseTypes.UNPROCESSABLE) + return "unprocessable"; + return "?"; + } + public String toSystem(AssertionResponseTypes code) { + return code.getSystem(); + } + } + + @Block() + public static class TestScriptContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the Test Script. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the Test Script." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public TestScriptContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the Test Script.). 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 TestScriptContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the Test Script.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TestScriptContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the Test Script. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the Test Script. + */ + public TestScriptContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public TestScriptContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the Test Script.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public TestScriptContactComponent copy() { + TestScriptContactComponent dst = new TestScriptContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptContactComponent)) + return false; + TestScriptContactComponent o = (TestScriptContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptContactComponent)) + return false; + TestScriptContactComponent o = (TestScriptContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.contact"; + + } + + } + + @Block() + public static class TestScriptOriginComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Abstract name given to an origin server in this test script. The name is provided as a number starting at 1. + */ + @Child(name = "index", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The index of the abstract origin server starting at 1", formalDefinition="Abstract name given to an origin server in this test script. The name is provided as a number starting at 1." ) + protected IntegerType index; + + /** + * The type of origin profile the test system supports. + */ + @Child(name = "profile", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="FHIR-Client | FHIR-SDC-FormFiller", formalDefinition="The type of origin profile the test system supports." ) + protected Coding profile; + + private static final long serialVersionUID = -1239935149L; + + /** + * Constructor + */ + public TestScriptOriginComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptOriginComponent(IntegerType index, Coding profile) { + super(); + this.index = index; + this.profile = profile; + } + + /** + * @return {@link #index} (Abstract name given to an origin server in this test script. The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value + */ + public IntegerType getIndexElement() { + if (this.index == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptOriginComponent.index"); + else if (Configuration.doAutoCreate()) + this.index = new IntegerType(); // bb + return this.index; + } + + public boolean hasIndexElement() { + return this.index != null && !this.index.isEmpty(); + } + + public boolean hasIndex() { + return this.index != null && !this.index.isEmpty(); + } + + /** + * @param value {@link #index} (Abstract name given to an origin server in this test script. The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value + */ + public TestScriptOriginComponent setIndexElement(IntegerType value) { + this.index = value; + return this; + } + + /** + * @return Abstract name given to an origin server in this test script. The name is provided as a number starting at 1. + */ + public int getIndex() { + return this.index == null || this.index.isEmpty() ? 0 : this.index.getValue(); + } + + /** + * @param value Abstract name given to an origin server in this test script. The name is provided as a number starting at 1. + */ + public TestScriptOriginComponent setIndex(int value) { + if (this.index == null) + this.index = new IntegerType(); + this.index.setValue(value); + return this; + } + + /** + * @return {@link #profile} (The type of origin profile the test system supports.) + */ + public Coding getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptOriginComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Coding(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (The type of origin profile the test system supports.) + */ + public TestScriptOriginComponent setProfile(Coding value) { + this.profile = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("index", "integer", "Abstract name given to an origin server in this test script. The name is provided as a number starting at 1.", 0, java.lang.Integer.MAX_VALUE, index)); + childrenList.add(new Property("profile", "Coding", "The type of origin profile the test system supports.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 100346066: /*index*/ return this.index == null ? new Base[0] : new Base[] {this.index}; // IntegerType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 100346066: // index + this.index = castToInteger(value); // IntegerType + break; + case -309425751: // profile + this.profile = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("index")) + this.index = castToInteger(value); // IntegerType + else if (name.equals("profile")) + this.profile = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 100346066: throw new FHIRException("Cannot make property index as it is not a complex type"); // IntegerType + case -309425751: return getProfile(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("index")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.index"); + } + else if (name.equals("profile")) { + this.profile = new Coding(); + return this.profile; + } + else + return super.addChild(name); + } + + public TestScriptOriginComponent copy() { + TestScriptOriginComponent dst = new TestScriptOriginComponent(); + copyValues(dst); + dst.index = index == null ? null : index.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptOriginComponent)) + return false; + TestScriptOriginComponent o = (TestScriptOriginComponent) other; + return compareDeep(index, o.index, true) && compareDeep(profile, o.profile, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptOriginComponent)) + return false; + TestScriptOriginComponent o = (TestScriptOriginComponent) other; + return compareValues(index, o.index, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (index == null || index.isEmpty()) && (profile == null || profile.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.origin"; + + } + + } + + @Block() + public static class TestScriptDestinationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Abstract name given to a destination server in this test script. The name is provided as a number starting at 1. + */ + @Child(name = "index", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The index of the abstract destination server starting at 1", formalDefinition="Abstract name given to a destination server in this test script. The name is provided as a number starting at 1." ) + protected IntegerType index; + + /** + * The type of destination profile the test system supports. + */ + @Child(name = "profile", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor", formalDefinition="The type of destination profile the test system supports." ) + protected Coding profile; + + private static final long serialVersionUID = -1239935149L; + + /** + * Constructor + */ + public TestScriptDestinationComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptDestinationComponent(IntegerType index, Coding profile) { + super(); + this.index = index; + this.profile = profile; + } + + /** + * @return {@link #index} (Abstract name given to a destination server in this test script. The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value + */ + public IntegerType getIndexElement() { + if (this.index == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptDestinationComponent.index"); + else if (Configuration.doAutoCreate()) + this.index = new IntegerType(); // bb + return this.index; + } + + public boolean hasIndexElement() { + return this.index != null && !this.index.isEmpty(); + } + + public boolean hasIndex() { + return this.index != null && !this.index.isEmpty(); + } + + /** + * @param value {@link #index} (Abstract name given to a destination server in this test script. The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value + */ + public TestScriptDestinationComponent setIndexElement(IntegerType value) { + this.index = value; + return this; + } + + /** + * @return Abstract name given to a destination server in this test script. The name is provided as a number starting at 1. + */ + public int getIndex() { + return this.index == null || this.index.isEmpty() ? 0 : this.index.getValue(); + } + + /** + * @param value Abstract name given to a destination server in this test script. The name is provided as a number starting at 1. + */ + public TestScriptDestinationComponent setIndex(int value) { + if (this.index == null) + this.index = new IntegerType(); + this.index.setValue(value); + return this; + } + + /** + * @return {@link #profile} (The type of destination profile the test system supports.) + */ + public Coding getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptDestinationComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Coding(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (The type of destination profile the test system supports.) + */ + public TestScriptDestinationComponent setProfile(Coding value) { + this.profile = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("index", "integer", "Abstract name given to a destination server in this test script. The name is provided as a number starting at 1.", 0, java.lang.Integer.MAX_VALUE, index)); + childrenList.add(new Property("profile", "Coding", "The type of destination profile the test system supports.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 100346066: /*index*/ return this.index == null ? new Base[0] : new Base[] {this.index}; // IntegerType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Coding + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 100346066: // index + this.index = castToInteger(value); // IntegerType + break; + case -309425751: // profile + this.profile = castToCoding(value); // Coding + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("index")) + this.index = castToInteger(value); // IntegerType + else if (name.equals("profile")) + this.profile = castToCoding(value); // Coding + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 100346066: throw new FHIRException("Cannot make property index as it is not a complex type"); // IntegerType + case -309425751: return getProfile(); // Coding + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("index")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.index"); + } + else if (name.equals("profile")) { + this.profile = new Coding(); + return this.profile; + } + else + return super.addChild(name); + } + + public TestScriptDestinationComponent copy() { + TestScriptDestinationComponent dst = new TestScriptDestinationComponent(); + copyValues(dst); + dst.index = index == null ? null : index.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptDestinationComponent)) + return false; + TestScriptDestinationComponent o = (TestScriptDestinationComponent) other; + return compareDeep(index, o.index, true) && compareDeep(profile, o.profile, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptDestinationComponent)) + return false; + TestScriptDestinationComponent o = (TestScriptDestinationComponent) other; + return compareValues(index, o.index, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (index == null || index.isEmpty()) && (profile == null || profile.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.destination"; + + } + + } + + @Block() + public static class TestScriptMetadataComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A link to the FHIR specification that this test is covering. + */ + @Child(name = "link", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Links to the FHIR specification", formalDefinition="A link to the FHIR specification that this test is covering." ) + protected List link; + + /** + * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. + */ + @Child(name = "capability", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Capabilities that are assumed to function correctly on the FHIR server being tested", formalDefinition="Capabilities that must exist and are assumed to function correctly on the FHIR server being tested." ) + protected List capability; + + private static final long serialVersionUID = 745183328L; + + /** + * Constructor + */ + public TestScriptMetadataComponent() { + super(); + } + + /** + * @return {@link #link} (A link to the FHIR specification that this test is covering.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (TestScriptMetadataLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (A link to the FHIR specification that this test is covering.) + */ + // syntactic sugar + public TestScriptMetadataLinkComponent addLink() { //3 + TestScriptMetadataLinkComponent t = new TestScriptMetadataLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + // syntactic sugar + public TestScriptMetadataComponent addLink(TestScriptMetadataLinkComponent t) { //3 + if (t == null) + return this; + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + /** + * @return {@link #capability} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) + */ + public List getCapability() { + if (this.capability == null) + this.capability = new ArrayList(); + return this.capability; + } + + public boolean hasCapability() { + if (this.capability == null) + return false; + for (TestScriptMetadataCapabilityComponent item : this.capability) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #capability} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) + */ + // syntactic sugar + public TestScriptMetadataCapabilityComponent addCapability() { //3 + TestScriptMetadataCapabilityComponent t = new TestScriptMetadataCapabilityComponent(); + if (this.capability == null) + this.capability = new ArrayList(); + this.capability.add(t); + return t; + } + + // syntactic sugar + public TestScriptMetadataComponent addCapability(TestScriptMetadataCapabilityComponent t) { //3 + if (t == null) + return this; + if (this.capability == null) + this.capability = new ArrayList(); + this.capability.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("link", "", "A link to the FHIR specification that this test is covering.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("capability", "", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, capability)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // TestScriptMetadataLinkComponent + case -783669992: /*capability*/ return this.capability == null ? new Base[0] : this.capability.toArray(new Base[this.capability.size()]); // TestScriptMetadataCapabilityComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3321850: // link + this.getLink().add((TestScriptMetadataLinkComponent) value); // TestScriptMetadataLinkComponent + break; + case -783669992: // capability + this.getCapability().add((TestScriptMetadataCapabilityComponent) value); // TestScriptMetadataCapabilityComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("link")) + this.getLink().add((TestScriptMetadataLinkComponent) value); + else if (name.equals("capability")) + this.getCapability().add((TestScriptMetadataCapabilityComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3321850: return addLink(); // TestScriptMetadataLinkComponent + case -783669992: return addCapability(); // TestScriptMetadataCapabilityComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("link")) { + return addLink(); + } + else if (name.equals("capability")) { + return addCapability(); + } + else + return super.addChild(name); + } + + public TestScriptMetadataComponent copy() { + TestScriptMetadataComponent dst = new TestScriptMetadataComponent(); + copyValues(dst); + if (link != null) { + dst.link = new ArrayList(); + for (TestScriptMetadataLinkComponent i : link) + dst.link.add(i.copy()); + }; + if (capability != null) { + dst.capability = new ArrayList(); + for (TestScriptMetadataCapabilityComponent i : capability) + dst.capability.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptMetadataComponent)) + return false; + TestScriptMetadataComponent o = (TestScriptMetadataComponent) other; + return compareDeep(link, o.link, true) && compareDeep(capability, o.capability, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptMetadataComponent)) + return false; + TestScriptMetadataComponent o = (TestScriptMetadataComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (link == null || link.isEmpty()) && (capability == null || capability.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.metadata"; + + } + + } + + @Block() + public static class TestScriptMetadataLinkComponent extends BackboneElement implements IBaseBackboneElement { + /** + * URL to a particular requirement or feature within the FHIR specification. + */ + @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="URL to the specification", formalDefinition="URL to a particular requirement or feature within the FHIR specification." ) + protected UriType url; + + /** + * Short description of the link. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Short description", formalDefinition="Short description of the link." ) + protected StringType description; + + private static final long serialVersionUID = 213372298L; + + /** + * Constructor + */ + public TestScriptMetadataLinkComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptMetadataLinkComponent(UriType url) { + super(); + this.url = url; + } + + /** + * @return {@link #url} (URL to a particular requirement or feature within the FHIR specification.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (URL to a particular requirement or feature within the FHIR specification.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public TestScriptMetadataLinkComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return URL to a particular requirement or feature within the FHIR specification. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value URL to a particular requirement or feature within the FHIR specification. + */ + public TestScriptMetadataLinkComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #description} (Short description of the link.). 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 TestScriptMetadataLinkComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Short description of the link.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public TestScriptMetadataLinkComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Short description of the link. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Short description of the link. + */ + public TestScriptMetadataLinkComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "URL to a particular requirement or feature within the FHIR specification.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("description", "string", "Short description of the link.", 0, java.lang.Integer.MAX_VALUE, description)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.url"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); + } + else + return super.addChild(name); + } + + public TestScriptMetadataLinkComponent copy() { + TestScriptMetadataLinkComponent dst = new TestScriptMetadataLinkComponent(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.description = description == null ? null : description.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptMetadataLinkComponent)) + return false; + TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other; + return compareDeep(url, o.url, true) && compareDeep(description, o.description, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptMetadataLinkComponent)) + return false; + TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other; + return compareValues(url, o.url, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (description == null || description.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.metadata.link"; + + } + + } + + @Block() + public static class TestScriptMetadataCapabilityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Whether or not the test execution will require the given capabilities of the server in order for this test script to execute. + */ + @Child(name = "required", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Are the capabilities required?", formalDefinition="Whether or not the test execution will require the given capabilities of the server in order for this test script to execute." ) + protected BooleanType required; + + /** + * Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute. + */ + @Child(name = "validated", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Are the capabilities validated?", formalDefinition="Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute." ) + protected BooleanType validated; + + /** + * Description of the capabilities that this test script is requiring the server to support. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The expected capabilities of the server", formalDefinition="Description of the capabilities that this test script is requiring the server to support." ) + protected StringType description; + + /** + * Which origin server these requirements apply to. + */ + @Child(name = "origin", type = {IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Which origin server these requirements apply to", formalDefinition="Which origin server these requirements apply to." ) + protected List origin; + + /** + * Which server these requirements apply to. + */ + @Child(name = "destination", type = {IntegerType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Which server these requirements apply to", formalDefinition="Which server these requirements apply to." ) + protected IntegerType destination; + + /** + * Links to the FHIR specification that describes this interaction and the resources involved in more detail. + */ + @Child(name = "link", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Links to the FHIR specification", formalDefinition="Links to the FHIR specification that describes this interaction and the resources involved in more detail." ) + protected List link; + + /** + * Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped. + */ + @Child(name = "conformance", type = {Conformance.class}, order=7, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Required Conformance", formalDefinition="Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped." ) + protected Reference conformance; + + /** + * The actual object that is the target of the reference (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) + */ + protected Conformance conformanceTarget; + + private static final long serialVersionUID = 500671983L; + + /** + * Constructor + */ + public TestScriptMetadataCapabilityComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptMetadataCapabilityComponent(Reference conformance) { + super(); + this.conformance = conformance; + } + + /** + * @return {@link #required} (Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public BooleanType getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new BooleanType(); // bb + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public TestScriptMetadataCapabilityComponent setRequiredElement(BooleanType value) { + this.required = value; + return this; + } + + /** + * @return Whether or not the test execution will require the given capabilities of the server in order for this test script to execute. + */ + public boolean getRequired() { + return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); + } + + /** + * @param value Whether or not the test execution will require the given capabilities of the server in order for this test script to execute. + */ + public TestScriptMetadataCapabilityComponent setRequired(boolean value) { + if (this.required == null) + this.required = new BooleanType(); + this.required.setValue(value); + return this; + } + + /** + * @return {@link #validated} (Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getValidated" gives direct access to the value + */ + public BooleanType getValidatedElement() { + if (this.validated == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.validated"); + else if (Configuration.doAutoCreate()) + this.validated = new BooleanType(); // bb + return this.validated; + } + + public boolean hasValidatedElement() { + return this.validated != null && !this.validated.isEmpty(); + } + + public boolean hasValidated() { + return this.validated != null && !this.validated.isEmpty(); + } + + /** + * @param value {@link #validated} (Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getValidated" gives direct access to the value + */ + public TestScriptMetadataCapabilityComponent setValidatedElement(BooleanType value) { + this.validated = value; + return this; + } + + /** + * @return Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute. + */ + public boolean getValidated() { + return this.validated == null || this.validated.isEmpty() ? false : this.validated.getValue(); + } + + /** + * @param value Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute. + */ + public TestScriptMetadataCapabilityComponent setValidated(boolean value) { + if (this.validated == null) + this.validated = new BooleanType(); + this.validated.setValue(value); + return this; + } + + /** + * @return {@link #description} (Description of the capabilities that this test script is requiring the server to support.). 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 TestScriptMetadataCapabilityComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (Description of the capabilities that this test script is requiring the server to support.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public TestScriptMetadataCapabilityComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Description of the capabilities that this test script is requiring the server to support. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Description of the capabilities that this test script is requiring the server to support. + */ + public TestScriptMetadataCapabilityComponent 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 #origin} (Which origin server these requirements apply to.) + */ + public List getOrigin() { + if (this.origin == null) + this.origin = new ArrayList(); + return this.origin; + } + + public boolean hasOrigin() { + if (this.origin == null) + return false; + for (IntegerType item : this.origin) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #origin} (Which origin server these requirements apply to.) + */ + // syntactic sugar + public IntegerType addOriginElement() {//2 + IntegerType t = new IntegerType(); + if (this.origin == null) + this.origin = new ArrayList(); + this.origin.add(t); + return t; + } + + /** + * @param value {@link #origin} (Which origin server these requirements apply to.) + */ + public TestScriptMetadataCapabilityComponent addOrigin(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.origin == null) + this.origin = new ArrayList(); + this.origin.add(t); + return this; + } + + /** + * @param value {@link #origin} (Which origin server these requirements apply to.) + */ + public boolean hasOrigin(int value) { + if (this.origin == null) + return false; + for (IntegerType v : this.origin) + if (v.equals(value)) // integer + return true; + return false; + } + + /** + * @return {@link #destination} (Which server these requirements apply to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public IntegerType getDestinationElement() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new IntegerType(); // bb + return this.destination; + } + + public boolean hasDestinationElement() { + return this.destination != null && !this.destination.isEmpty(); + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Which server these requirements apply to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public TestScriptMetadataCapabilityComponent setDestinationElement(IntegerType value) { + this.destination = value; + return this; + } + + /** + * @return Which server these requirements apply to. + */ + public int getDestination() { + return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); + } + + /** + * @param value Which server these requirements apply to. + */ + public TestScriptMetadataCapabilityComponent setDestination(int value) { + if (this.destination == null) + this.destination = new IntegerType(); + this.destination.setValue(value); + return this; + } + + /** + * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (UriType item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.) + */ + // syntactic sugar + public UriType addLinkElement() {//2 + UriType t = new UriType(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + /** + * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.) + */ + public TestScriptMetadataCapabilityComponent addLink(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return this; + } + + /** + * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.) + */ + public boolean hasLink(String value) { + if (this.link == null) + return false; + for (UriType v : this.link) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #conformance} (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) + */ + public Reference getConformance() { + if (this.conformance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.conformance"); + else if (Configuration.doAutoCreate()) + this.conformance = new Reference(); // cc + return this.conformance; + } + + public boolean hasConformance() { + return this.conformance != null && !this.conformance.isEmpty(); + } + + /** + * @param value {@link #conformance} (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) + */ + public TestScriptMetadataCapabilityComponent setConformance(Reference value) { + this.conformance = value; + return this; + } + + /** + * @return {@link #conformance} 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. (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) + */ + public Conformance getConformanceTarget() { + if (this.conformanceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.conformance"); + else if (Configuration.doAutoCreate()) + this.conformanceTarget = new Conformance(); // aa + return this.conformanceTarget; + } + + /** + * @param value {@link #conformance} 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. (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) + */ + public TestScriptMetadataCapabilityComponent setConformanceTarget(Conformance value) { + this.conformanceTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("required", "boolean", "Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("validated", "boolean", "Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.", 0, java.lang.Integer.MAX_VALUE, validated)); + childrenList.add(new Property("description", "string", "Description of the capabilities that this test script is requiring the server to support.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("origin", "integer", "Which origin server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("destination", "integer", "Which server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("link", "uri", "Links to the FHIR specification that describes this interaction and the resources involved in more detail.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("conformance", "Reference(Conformance)", "Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.", 0, java.lang.Integer.MAX_VALUE, conformance)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType + case -1109784050: /*validated*/ return this.validated == null ? new Base[0] : new Base[] {this.validated}; // BooleanType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : this.origin.toArray(new Base[this.origin.size()]); // IntegerType + case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // IntegerType + case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // UriType + case 1374858133: /*conformance*/ return this.conformance == null ? new Base[0] : new Base[] {this.conformance}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -393139297: // required + this.required = castToBoolean(value); // BooleanType + break; + case -1109784050: // validated + this.validated = castToBoolean(value); // BooleanType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1008619738: // origin + this.getOrigin().add(castToInteger(value)); // IntegerType + break; + case -1429847026: // destination + this.destination = castToInteger(value); // IntegerType + break; + case 3321850: // link + this.getLink().add(castToUri(value)); // UriType + break; + case 1374858133: // conformance + this.conformance = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("required")) + this.required = castToBoolean(value); // BooleanType + else if (name.equals("validated")) + this.validated = castToBoolean(value); // BooleanType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("origin")) + this.getOrigin().add(castToInteger(value)); + else if (name.equals("destination")) + this.destination = castToInteger(value); // IntegerType + else if (name.equals("link")) + this.getLink().add(castToUri(value)); + else if (name.equals("conformance")) + this.conformance = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // BooleanType + case -1109784050: throw new FHIRException("Cannot make property validated as it is not a complex type"); // BooleanType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1008619738: throw new FHIRException("Cannot make property origin as it is not a complex type"); // IntegerType + case -1429847026: throw new FHIRException("Cannot make property destination as it is not a complex type"); // IntegerType + case 3321850: throw new FHIRException("Cannot make property link as it is not a complex type"); // UriType + case 1374858133: return getConformance(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("required")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.required"); + } + else if (name.equals("validated")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.validated"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); + } + else if (name.equals("origin")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.origin"); + } + else if (name.equals("destination")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination"); + } + else if (name.equals("link")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.link"); + } + else if (name.equals("conformance")) { + this.conformance = new Reference(); + return this.conformance; + } + else + return super.addChild(name); + } + + public TestScriptMetadataCapabilityComponent copy() { + TestScriptMetadataCapabilityComponent dst = new TestScriptMetadataCapabilityComponent(); + copyValues(dst); + dst.required = required == null ? null : required.copy(); + dst.validated = validated == null ? null : validated.copy(); + dst.description = description == null ? null : description.copy(); + if (origin != null) { + dst.origin = new ArrayList(); + for (IntegerType i : origin) + dst.origin.add(i.copy()); + }; + dst.destination = destination == null ? null : destination.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (UriType i : link) + dst.link.add(i.copy()); + }; + dst.conformance = conformance == null ? null : conformance.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptMetadataCapabilityComponent)) + return false; + TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other; + return compareDeep(required, o.required, true) && compareDeep(validated, o.validated, true) && compareDeep(description, o.description, true) + && compareDeep(origin, o.origin, true) && compareDeep(destination, o.destination, true) && compareDeep(link, o.link, true) + && compareDeep(conformance, o.conformance, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptMetadataCapabilityComponent)) + return false; + TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other; + return compareValues(required, o.required, true) && compareValues(validated, o.validated, true) && compareValues(description, o.description, true) + && compareValues(origin, o.origin, true) && compareValues(destination, o.destination, true) && compareValues(link, o.link, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (required == null || required.isEmpty()) && (validated == null || validated.isEmpty()) + && (description == null || description.isEmpty()) && (origin == null || origin.isEmpty()) + && (destination == null || destination.isEmpty()) && (link == null || link.isEmpty()) && (conformance == null || conformance.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.metadata.capability"; + + } + + } + + @Block() + public static class TestScriptFixtureComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. + */ + @Child(name = "autocreate", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether or not to implicitly create the fixture during setup", formalDefinition="Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section." ) + protected BooleanType autocreate; + + /** + * Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. + */ + @Child(name = "autodelete", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether or not to implicitly delete the fixture during teardown", formalDefinition="Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section." ) + protected BooleanType autodelete; + + /** + * Reference to the resource (containing the contents of the resource needed for operations). + */ + @Child(name = "resource", type = {}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reference of the resource", formalDefinition="Reference to the resource (containing the contents of the resource needed for operations)." ) + protected Reference resource; + + /** + * The actual object that is the target of the reference (Reference to the resource (containing the contents of the resource needed for operations).) + */ + protected Resource resourceTarget; + + private static final long serialVersionUID = 1110683307L; + + /** + * Constructor + */ + public TestScriptFixtureComponent() { + super(); + } + + /** + * @return {@link #autocreate} (Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.). This is the underlying object with id, value and extensions. The accessor "getAutocreate" gives direct access to the value + */ + public BooleanType getAutocreateElement() { + if (this.autocreate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptFixtureComponent.autocreate"); + else if (Configuration.doAutoCreate()) + this.autocreate = new BooleanType(); // bb + return this.autocreate; + } + + public boolean hasAutocreateElement() { + return this.autocreate != null && !this.autocreate.isEmpty(); + } + + public boolean hasAutocreate() { + return this.autocreate != null && !this.autocreate.isEmpty(); + } + + /** + * @param value {@link #autocreate} (Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.). This is the underlying object with id, value and extensions. The accessor "getAutocreate" gives direct access to the value + */ + public TestScriptFixtureComponent setAutocreateElement(BooleanType value) { + this.autocreate = value; + return this; + } + + /** + * @return Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. + */ + public boolean getAutocreate() { + return this.autocreate == null || this.autocreate.isEmpty() ? false : this.autocreate.getValue(); + } + + /** + * @param value Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. + */ + public TestScriptFixtureComponent setAutocreate(boolean value) { + if (this.autocreate == null) + this.autocreate = new BooleanType(); + this.autocreate.setValue(value); + return this; + } + + /** + * @return {@link #autodelete} (Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.). This is the underlying object with id, value and extensions. The accessor "getAutodelete" gives direct access to the value + */ + public BooleanType getAutodeleteElement() { + if (this.autodelete == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptFixtureComponent.autodelete"); + else if (Configuration.doAutoCreate()) + this.autodelete = new BooleanType(); // bb + return this.autodelete; + } + + public boolean hasAutodeleteElement() { + return this.autodelete != null && !this.autodelete.isEmpty(); + } + + public boolean hasAutodelete() { + return this.autodelete != null && !this.autodelete.isEmpty(); + } + + /** + * @param value {@link #autodelete} (Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.). This is the underlying object with id, value and extensions. The accessor "getAutodelete" gives direct access to the value + */ + public TestScriptFixtureComponent setAutodeleteElement(BooleanType value) { + this.autodelete = value; + return this; + } + + /** + * @return Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. + */ + public boolean getAutodelete() { + return this.autodelete == null || this.autodelete.isEmpty() ? false : this.autodelete.getValue(); + } + + /** + * @param value Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. + */ + public TestScriptFixtureComponent setAutodelete(boolean value) { + if (this.autodelete == null) + this.autodelete = new BooleanType(); + this.autodelete.setValue(value); + return this; + } + + /** + * @return {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).) + */ + public Reference getResource() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptFixtureComponent.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new Reference(); // cc + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).) + */ + public TestScriptFixtureComponent setResource(Reference value) { + this.resource = value; + return this; + } + + /** + * @return {@link #resource} 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 resource (containing the contents of the resource needed for operations).) + */ + public Resource getResourceTarget() { + return this.resourceTarget; + } + + /** + * @param value {@link #resource} 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 resource (containing the contents of the resource needed for operations).) + */ + public TestScriptFixtureComponent setResourceTarget(Resource value) { + this.resourceTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("autocreate", "boolean", "Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.", 0, java.lang.Integer.MAX_VALUE, autocreate)); + childrenList.add(new Property("autodelete", "boolean", "Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.", 0, java.lang.Integer.MAX_VALUE, autodelete)); + childrenList.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the resource needed for operations).", 0, java.lang.Integer.MAX_VALUE, resource)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 73154411: /*autocreate*/ return this.autocreate == null ? new Base[0] : new Base[] {this.autocreate}; // BooleanType + case 89990170: /*autodelete*/ return this.autodelete == null ? new Base[0] : new Base[] {this.autodelete}; // BooleanType + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 73154411: // autocreate + this.autocreate = castToBoolean(value); // BooleanType + break; + case 89990170: // autodelete + this.autodelete = castToBoolean(value); // BooleanType + break; + case -341064690: // resource + this.resource = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("autocreate")) + this.autocreate = castToBoolean(value); // BooleanType + else if (name.equals("autodelete")) + this.autodelete = castToBoolean(value); // BooleanType + else if (name.equals("resource")) + this.resource = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 73154411: throw new FHIRException("Cannot make property autocreate as it is not a complex type"); // BooleanType + case 89990170: throw new FHIRException("Cannot make property autodelete as it is not a complex type"); // BooleanType + case -341064690: return getResource(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("autocreate")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.autocreate"); + } + else if (name.equals("autodelete")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.autodelete"); + } + else if (name.equals("resource")) { + this.resource = new Reference(); + return this.resource; + } + else + return super.addChild(name); + } + + public TestScriptFixtureComponent copy() { + TestScriptFixtureComponent dst = new TestScriptFixtureComponent(); + copyValues(dst); + dst.autocreate = autocreate == null ? null : autocreate.copy(); + dst.autodelete = autodelete == null ? null : autodelete.copy(); + dst.resource = resource == null ? null : resource.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptFixtureComponent)) + return false; + TestScriptFixtureComponent o = (TestScriptFixtureComponent) other; + return compareDeep(autocreate, o.autocreate, true) && compareDeep(autodelete, o.autodelete, true) + && compareDeep(resource, o.resource, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptFixtureComponent)) + return false; + TestScriptFixtureComponent o = (TestScriptFixtureComponent) other; + return compareValues(autocreate, o.autocreate, true) && compareValues(autodelete, o.autodelete, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (autocreate == null || autocreate.isEmpty()) && (autodelete == null || autodelete.isEmpty()) + && (resource == null || resource.isEmpty()); + } + + public String fhirType() { + return "TestScript.fixture"; + + } + + } + + @Block() + public static class TestScriptVariableComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Descriptive name for this variable. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Descriptive name for this variable", formalDefinition="Descriptive name for this variable." ) + protected StringType name; + + /** + * A default, hard-coded, or user-defined value for this variable. + */ + @Child(name = "defaultValue", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Default, hard-coded, or user-defined value for this variable", formalDefinition="A default, hard-coded, or user-defined value for this variable." ) + protected StringType defaultValue; + + /** + * Will be used to grab the HTTP header field value from the headers that sourceId is pointing to. + */ + @Child(name = "headerField", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="HTTP header field name for source", formalDefinition="Will be used to grab the HTTP header field value from the headers that sourceId is pointing to." ) + protected StringType headerField; + + /** + * XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both. + */ + @Child(name = "path", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="XPath or JSONPath against the fixture body", formalDefinition="XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both." ) + protected StringType path; + + /** + * Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable. + */ + @Child(name = "sourceId", type = {IdType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Fixture Id of source expression or headerField within this variable", formalDefinition="Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable." ) + protected IdType sourceId; + + private static final long serialVersionUID = 1821729272L; + + /** + * Constructor + */ + public TestScriptVariableComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptVariableComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (Descriptive name for this variable.). 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 TestScriptVariableComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Descriptive name for this variable.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TestScriptVariableComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Descriptive name for this variable. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Descriptive name for this variable. + */ + public TestScriptVariableComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #defaultValue} (A default, hard-coded, or user-defined value for this variable.). This is the underlying object with id, value and extensions. The accessor "getDefaultValue" gives direct access to the value + */ + public StringType getDefaultValueElement() { + if (this.defaultValue == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptVariableComponent.defaultValue"); + else if (Configuration.doAutoCreate()) + this.defaultValue = new StringType(); // bb + return this.defaultValue; + } + + public boolean hasDefaultValueElement() { + return this.defaultValue != null && !this.defaultValue.isEmpty(); + } + + public boolean hasDefaultValue() { + return this.defaultValue != null && !this.defaultValue.isEmpty(); + } + + /** + * @param value {@link #defaultValue} (A default, hard-coded, or user-defined value for this variable.). This is the underlying object with id, value and extensions. The accessor "getDefaultValue" gives direct access to the value + */ + public TestScriptVariableComponent setDefaultValueElement(StringType value) { + this.defaultValue = value; + return this; + } + + /** + * @return A default, hard-coded, or user-defined value for this variable. + */ + public String getDefaultValue() { + return this.defaultValue == null ? null : this.defaultValue.getValue(); + } + + /** + * @param value A default, hard-coded, or user-defined value for this variable. + */ + public TestScriptVariableComponent setDefaultValue(String value) { + if (Utilities.noString(value)) + this.defaultValue = null; + else { + if (this.defaultValue == null) + this.defaultValue = new StringType(); + this.defaultValue.setValue(value); + } + return this; + } + + /** + * @return {@link #headerField} (Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value + */ + public StringType getHeaderFieldElement() { + if (this.headerField == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptVariableComponent.headerField"); + else if (Configuration.doAutoCreate()) + this.headerField = new StringType(); // bb + return this.headerField; + } + + public boolean hasHeaderFieldElement() { + return this.headerField != null && !this.headerField.isEmpty(); + } + + public boolean hasHeaderField() { + return this.headerField != null && !this.headerField.isEmpty(); + } + + /** + * @param value {@link #headerField} (Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value + */ + public TestScriptVariableComponent setHeaderFieldElement(StringType value) { + this.headerField = value; + return this; + } + + /** + * @return Will be used to grab the HTTP header field value from the headers that sourceId is pointing to. + */ + public String getHeaderField() { + return this.headerField == null ? null : this.headerField.getValue(); + } + + /** + * @param value Will be used to grab the HTTP header field value from the headers that sourceId is pointing to. + */ + public TestScriptVariableComponent setHeaderField(String value) { + if (Utilities.noString(value)) + this.headerField = null; + else { + if (this.headerField == null) + this.headerField = new StringType(); + this.headerField.setValue(value); + } + return this; + } + + /** + * @return {@link #path} (XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptVariableComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public TestScriptVariableComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both. + */ + public TestScriptVariableComponent setPath(String value) { + if (Utilities.noString(value)) + this.path = null; + else { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + } + return this; + } + + /** + * @return {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value + */ + public IdType getSourceIdElement() { + if (this.sourceId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptVariableComponent.sourceId"); + else if (Configuration.doAutoCreate()) + this.sourceId = new IdType(); // bb + return this.sourceId; + } + + public boolean hasSourceIdElement() { + return this.sourceId != null && !this.sourceId.isEmpty(); + } + + public boolean hasSourceId() { + return this.sourceId != null && !this.sourceId.isEmpty(); + } + + /** + * @param value {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value + */ + public TestScriptVariableComponent setSourceIdElement(IdType value) { + this.sourceId = value; + return this; + } + + /** + * @return Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable. + */ + public String getSourceId() { + return this.sourceId == null ? null : this.sourceId.getValue(); + } + + /** + * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable. + */ + public TestScriptVariableComponent setSourceId(String value) { + if (Utilities.noString(value)) + this.sourceId = null; + else { + if (this.sourceId == null) + this.sourceId = new IdType(); + this.sourceId.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Descriptive name for this variable.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("defaultValue", "string", "A default, hard-coded, or user-defined value for this variable.", 0, java.lang.Integer.MAX_VALUE, defaultValue)); + childrenList.add(new Property("headerField", "string", "Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.", 0, java.lang.Integer.MAX_VALUE, headerField)); + childrenList.add(new Property("path", "string", "XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable.", 0, java.lang.Integer.MAX_VALUE, sourceId)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // StringType + case 1160732269: /*headerField*/ return this.headerField == null ? new Base[0] : new Base[] {this.headerField}; // StringType + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -659125328: // defaultValue + this.defaultValue = castToString(value); // StringType + break; + case 1160732269: // headerField + this.headerField = castToString(value); // StringType + break; + case 3433509: // path + this.path = castToString(value); // StringType + break; + case 1746327190: // sourceId + this.sourceId = castToId(value); // IdType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("defaultValue")) + this.defaultValue = castToString(value); // StringType + else if (name.equals("headerField")) + this.headerField = castToString(value); // StringType + else if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("sourceId")) + this.sourceId = castToId(value); // IdType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -659125328: throw new FHIRException("Cannot make property defaultValue as it is not a complex type"); // StringType + case 1160732269: throw new FHIRException("Cannot make property headerField as it is not a complex type"); // StringType + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case 1746327190: throw new FHIRException("Cannot make property sourceId as it is not a complex type"); // IdType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); + } + else if (name.equals("defaultValue")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.defaultValue"); + } + else if (name.equals("headerField")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField"); + } + else if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.path"); + } + else if (name.equals("sourceId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId"); + } + else + return super.addChild(name); + } + + public TestScriptVariableComponent copy() { + TestScriptVariableComponent dst = new TestScriptVariableComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.defaultValue = defaultValue == null ? null : defaultValue.copy(); + dst.headerField = headerField == null ? null : headerField.copy(); + dst.path = path == null ? null : path.copy(); + dst.sourceId = sourceId == null ? null : sourceId.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptVariableComponent)) + return false; + TestScriptVariableComponent o = (TestScriptVariableComponent) other; + return compareDeep(name, o.name, true) && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(headerField, o.headerField, true) + && compareDeep(path, o.path, true) && compareDeep(sourceId, o.sourceId, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptVariableComponent)) + return false; + TestScriptVariableComponent o = (TestScriptVariableComponent) other; + return compareValues(name, o.name, true) && compareValues(defaultValue, o.defaultValue, true) && compareValues(headerField, o.headerField, true) + && compareValues(path, o.path, true) && compareValues(sourceId, o.sourceId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (defaultValue == null || defaultValue.isEmpty()) + && (headerField == null || headerField.isEmpty()) && (path == null || path.isEmpty()) && (sourceId == null || sourceId.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.variable"; + + } + + } + + @Block() + public static class TestScriptRuleComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Reference to the resource (containing the contents of the rule needed for assertions). + */ + @Child(name = "resource", type = {}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Assert rule resource reference", formalDefinition="Reference to the resource (containing the contents of the rule needed for assertions)." ) + protected Reference resource; + + /** + * The actual object that is the target of the reference (Reference to the resource (containing the contents of the rule needed for assertions).) + */ + protected Resource resourceTarget; + + /** + * Each rule template can take one or more parameters for rule evaluation. + */ + @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." ) + protected List param; + + private static final long serialVersionUID = -524260474L; + + /** + * Constructor + */ + public TestScriptRuleComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptRuleComponent(Reference resource) { + super(); + this.resource = resource; + } + + /** + * @return {@link #resource} (Reference to the resource (containing the contents of the rule needed for assertions).) + */ + public Reference getResource() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptRuleComponent.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new Reference(); // cc + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (Reference to the resource (containing the contents of the rule needed for assertions).) + */ + public TestScriptRuleComponent setResource(Reference value) { + this.resource = value; + return this; + } + + /** + * @return {@link #resource} 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 resource (containing the contents of the rule needed for assertions).) + */ + public Resource getResourceTarget() { + return this.resourceTarget; + } + + /** + * @param value {@link #resource} 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 resource (containing the contents of the rule needed for assertions).) + */ + public TestScriptRuleComponent setResourceTarget(Resource value) { + this.resourceTarget = value; + return this; + } + + /** + * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) + */ + public List getParam() { + if (this.param == null) + this.param = new ArrayList(); + return this.param; + } + + public boolean hasParam() { + if (this.param == null) + return false; + for (TestScriptRuleParamComponent item : this.param) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) + */ + // syntactic sugar + public TestScriptRuleParamComponent addParam() { //3 + TestScriptRuleParamComponent t = new TestScriptRuleParamComponent(); + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return t; + } + + // syntactic sugar + public TestScriptRuleComponent addParam(TestScriptRuleParamComponent t) { //3 + if (t == null) + return this; + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the rule needed for assertions).", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference + case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // TestScriptRuleParamComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -341064690: // resource + this.resource = castToReference(value); // Reference + break; + case 106436749: // param + this.getParam().add((TestScriptRuleParamComponent) value); // TestScriptRuleParamComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("resource")) + this.resource = castToReference(value); // Reference + else if (name.equals("param")) + this.getParam().add((TestScriptRuleParamComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -341064690: return getResource(); // Reference + case 106436749: return addParam(); // TestScriptRuleParamComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("resource")) { + this.resource = new Reference(); + return this.resource; + } + else if (name.equals("param")) { + return addParam(); + } + else + return super.addChild(name); + } + + public TestScriptRuleComponent copy() { + TestScriptRuleComponent dst = new TestScriptRuleComponent(); + copyValues(dst); + dst.resource = resource == null ? null : resource.copy(); + if (param != null) { + dst.param = new ArrayList(); + for (TestScriptRuleParamComponent i : param) + dst.param.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptRuleComponent)) + return false; + TestScriptRuleComponent o = (TestScriptRuleComponent) other; + return compareDeep(resource, o.resource, true) && compareDeep(param, o.param, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptRuleComponent)) + return false; + TestScriptRuleComponent o = (TestScriptRuleComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (resource == null || resource.isEmpty()) && (param == null || param.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.rule"; + + } + + } + + @Block() + public static class TestScriptRuleParamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Descriptive name for this parameter that matches the external assert rule parameter name. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Parameter name matching external assert rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert rule parameter name." ) + protected StringType name; + + /** + * The explict or dynamic value for the parameter that will be passed on to the external rule template. + */ + @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The explict or dynamic value for the parameter that will be passed on to the external rule template." ) + protected StringType value; + + private static final long serialVersionUID = 395259392L; + + /** + * Constructor + */ + public TestScriptRuleParamComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptRuleParamComponent(StringType name, StringType value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @return {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). 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 TestScriptRuleParamComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TestScriptRuleParamComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Descriptive name for this parameter that matches the external assert rule parameter name. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Descriptive name for this parameter that matches the external assert rule parameter name. + */ + public TestScriptRuleParamComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The explict or dynamic value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptRuleParamComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The explict or dynamic value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public TestScriptRuleParamComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The explict or dynamic value for the parameter that will be passed on to the external rule template. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The explict or dynamic value for the parameter that will be passed on to the external rule template. + */ + public TestScriptRuleParamComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value", "string", "The explict or dynamic value for the parameter that will be passed on to the external rule template.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("value")) + this.value = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); + } + else + return super.addChild(name); + } + + public TestScriptRuleParamComponent copy() { + TestScriptRuleParamComponent dst = new TestScriptRuleParamComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptRuleParamComponent)) + return false; + TestScriptRuleParamComponent o = (TestScriptRuleParamComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptRuleParamComponent)) + return false; + TestScriptRuleParamComponent o = (TestScriptRuleParamComponent) other; + return compareValues(name, o.name, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.rule.param"; + + } + + } + + @Block() + public static class TestScriptRulesetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Reference to the resource (containing the contents of the ruleset needed for assertions). + */ + @Child(name = "resource", type = {}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Assert ruleset resource reference", formalDefinition="Reference to the resource (containing the contents of the ruleset needed for assertions)." ) + protected Reference resource; + + /** + * The actual object that is the target of the reference (Reference to the resource (containing the contents of the ruleset needed for assertions).) + */ + protected Resource resourceTarget; + + /** + * The referenced rule within the external ruleset template. + */ + @Child(name = "rule", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The referenced rule within the ruleset", formalDefinition="The referenced rule within the external ruleset template." ) + protected List rule; + + private static final long serialVersionUID = 5813554L; + + /** + * Constructor + */ + public TestScriptRulesetComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptRulesetComponent(Reference resource) { + super(); + this.resource = resource; + } + + /** + * @return {@link #resource} (Reference to the resource (containing the contents of the ruleset needed for assertions).) + */ + public Reference getResource() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptRulesetComponent.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new Reference(); // cc + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (Reference to the resource (containing the contents of the ruleset needed for assertions).) + */ + public TestScriptRulesetComponent setResource(Reference value) { + this.resource = value; + return this; + } + + /** + * @return {@link #resource} 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 resource (containing the contents of the ruleset needed for assertions).) + */ + public Resource getResourceTarget() { + return this.resourceTarget; + } + + /** + * @param value {@link #resource} 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 resource (containing the contents of the ruleset needed for assertions).) + */ + public TestScriptRulesetComponent setResourceTarget(Resource value) { + this.resourceTarget = value; + return this; + } + + /** + * @return {@link #rule} (The referenced rule within the external ruleset template.) + */ + public List getRule() { + if (this.rule == null) + this.rule = new ArrayList(); + return this.rule; + } + + public boolean hasRule() { + if (this.rule == null) + return false; + for (TestScriptRulesetRuleComponent item : this.rule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rule} (The referenced rule within the external ruleset template.) + */ + // syntactic sugar + public TestScriptRulesetRuleComponent addRule() { //3 + TestScriptRulesetRuleComponent t = new TestScriptRulesetRuleComponent(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + // syntactic sugar + public TestScriptRulesetComponent addRule(TestScriptRulesetRuleComponent t) { //3 + if (t == null) + return this; + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the ruleset needed for assertions).", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference + case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // TestScriptRulesetRuleComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -341064690: // resource + this.resource = castToReference(value); // Reference + break; + case 3512060: // rule + this.getRule().add((TestScriptRulesetRuleComponent) value); // TestScriptRulesetRuleComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("resource")) + this.resource = castToReference(value); // Reference + else if (name.equals("rule")) + this.getRule().add((TestScriptRulesetRuleComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -341064690: return getResource(); // Reference + case 3512060: return addRule(); // TestScriptRulesetRuleComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("resource")) { + this.resource = new Reference(); + return this.resource; + } + else if (name.equals("rule")) { + return addRule(); + } + else + return super.addChild(name); + } + + public TestScriptRulesetComponent copy() { + TestScriptRulesetComponent dst = new TestScriptRulesetComponent(); + copyValues(dst); + dst.resource = resource == null ? null : resource.copy(); + if (rule != null) { + dst.rule = new ArrayList(); + for (TestScriptRulesetRuleComponent i : rule) + dst.rule.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptRulesetComponent)) + return false; + TestScriptRulesetComponent o = (TestScriptRulesetComponent) other; + return compareDeep(resource, o.resource, true) && compareDeep(rule, o.rule, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptRulesetComponent)) + return false; + TestScriptRulesetComponent o = (TestScriptRulesetComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (resource == null || resource.isEmpty()) && (rule == null || rule.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.ruleset"; + + } + + } + + @Block() + public static class TestScriptRulesetRuleComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Id of the referenced rule within the external ruleset template. + */ + @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Id of referenced rule within the ruleset", formalDefinition="Id of the referenced rule within the external ruleset template." ) + protected IdType ruleId; + + /** + * Each rule template can take one or more parameters for rule evaluation. + */ + @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Ruleset rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." ) + protected List param; + + private static final long serialVersionUID = 155033950L; + + /** + * Constructor + */ + public TestScriptRulesetRuleComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptRulesetRuleComponent(IdType ruleId) { + super(); + this.ruleId = ruleId; + } + + /** + * @return {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value + */ + public IdType getRuleIdElement() { + if (this.ruleId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptRulesetRuleComponent.ruleId"); + else if (Configuration.doAutoCreate()) + this.ruleId = new IdType(); // bb + return this.ruleId; + } + + public boolean hasRuleIdElement() { + return this.ruleId != null && !this.ruleId.isEmpty(); + } + + public boolean hasRuleId() { + return this.ruleId != null && !this.ruleId.isEmpty(); + } + + /** + * @param value {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value + */ + public TestScriptRulesetRuleComponent setRuleIdElement(IdType value) { + this.ruleId = value; + return this; + } + + /** + * @return Id of the referenced rule within the external ruleset template. + */ + public String getRuleId() { + return this.ruleId == null ? null : this.ruleId.getValue(); + } + + /** + * @param value Id of the referenced rule within the external ruleset template. + */ + public TestScriptRulesetRuleComponent setRuleId(String value) { + if (this.ruleId == null) + this.ruleId = new IdType(); + this.ruleId.setValue(value); + return this; + } + + /** + * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) + */ + public List getParam() { + if (this.param == null) + this.param = new ArrayList(); + return this.param; + } + + public boolean hasParam() { + if (this.param == null) + return false; + for (TestScriptRulesetRuleParamComponent item : this.param) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) + */ + // syntactic sugar + public TestScriptRulesetRuleParamComponent addParam() { //3 + TestScriptRulesetRuleParamComponent t = new TestScriptRulesetRuleParamComponent(); + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return t; + } + + // syntactic sugar + public TestScriptRulesetRuleComponent addParam(TestScriptRulesetRuleParamComponent t) { //3 + if (t == null) + return this; + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, ruleId)); + childrenList.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType + case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // TestScriptRulesetRuleParamComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -919875273: // ruleId + this.ruleId = castToId(value); // IdType + break; + case 106436749: // param + this.getParam().add((TestScriptRulesetRuleParamComponent) value); // TestScriptRulesetRuleParamComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("ruleId")) + this.ruleId = castToId(value); // IdType + else if (name.equals("param")) + this.getParam().add((TestScriptRulesetRuleParamComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -919875273: throw new FHIRException("Cannot make property ruleId as it is not a complex type"); // IdType + case 106436749: return addParam(); // TestScriptRulesetRuleParamComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("ruleId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId"); + } + else if (name.equals("param")) { + return addParam(); + } + else + return super.addChild(name); + } + + public TestScriptRulesetRuleComponent copy() { + TestScriptRulesetRuleComponent dst = new TestScriptRulesetRuleComponent(); + copyValues(dst); + dst.ruleId = ruleId == null ? null : ruleId.copy(); + if (param != null) { + dst.param = new ArrayList(); + for (TestScriptRulesetRuleParamComponent i : param) + dst.param.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptRulesetRuleComponent)) + return false; + TestScriptRulesetRuleComponent o = (TestScriptRulesetRuleComponent) other; + return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptRulesetRuleComponent)) + return false; + TestScriptRulesetRuleComponent o = (TestScriptRulesetRuleComponent) other; + return compareValues(ruleId, o.ruleId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (ruleId == null || ruleId.isEmpty()) && (param == null || param.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.ruleset.rule"; + + } + + } + + @Block() + public static class TestScriptRulesetRuleParamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Descriptive name for this parameter that matches the external assert ruleset rule parameter name. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Parameter name matching external assert ruleset rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert ruleset rule parameter name." ) + protected StringType name; + + /** + * The value for the parameter that will be passed on to the external ruleset rule template. + */ + @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external ruleset rule template." ) + protected StringType value; + + private static final long serialVersionUID = 395259392L; + + /** + * Constructor + */ + public TestScriptRulesetRuleParamComponent() { + super(); + } + + /** + * Constructor + */ + public TestScriptRulesetRuleParamComponent(StringType name, StringType value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @return {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). 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 TestScriptRulesetRuleParamComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TestScriptRulesetRuleParamComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Descriptive name for this parameter that matches the external assert ruleset rule parameter name. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Descriptive name for this parameter that matches the external assert ruleset rule parameter name. + */ + public TestScriptRulesetRuleParamComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptRulesetRuleParamComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public TestScriptRulesetRuleParamComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The value for the parameter that will be passed on to the external ruleset rule template. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value for the parameter that will be passed on to the external ruleset rule template. + */ + public TestScriptRulesetRuleParamComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value", "string", "The value for the parameter that will be passed on to the external ruleset rule template.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("value")) + this.value = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); + } + else + return super.addChild(name); + } + + public TestScriptRulesetRuleParamComponent copy() { + TestScriptRulesetRuleParamComponent dst = new TestScriptRulesetRuleParamComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptRulesetRuleParamComponent)) + return false; + TestScriptRulesetRuleParamComponent o = (TestScriptRulesetRuleParamComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptRulesetRuleParamComponent)) + return false; + TestScriptRulesetRuleParamComponent o = (TestScriptRulesetRuleParamComponent) other; + return compareValues(name, o.name, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.ruleset.rule.param"; + + } + + } + + @Block() + public static class TestScriptSetupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. + */ + @Child(name = "metadata", type = {TestScriptMetadataComponent.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Capabilities that are assumed to function correctly on the FHIR server being tested", formalDefinition="Capabilities that must exist and are assumed to function correctly on the FHIR server being tested." ) + protected TestScriptMetadataComponent metadata; + + /** + * Action would contain either an operation or an assertion. + */ + @Child(name = "action", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A setup operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." ) + protected List action; + + private static final long serialVersionUID = 9850834L; + + /** + * Constructor + */ + public TestScriptSetupComponent() { + super(); + } + + /** + * @return {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) + */ + public TestScriptMetadataComponent getMetadata() { + if (this.metadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptSetupComponent.metadata"); + else if (Configuration.doAutoCreate()) + this.metadata = new TestScriptMetadataComponent(); // cc + return this.metadata; + } + + public boolean hasMetadata() { + return this.metadata != null && !this.metadata.isEmpty(); + } + + /** + * @param value {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) + */ + public TestScriptSetupComponent setMetadata(TestScriptMetadataComponent value) { + this.metadata = value; + return this; + } + + /** + * @return {@link #action} (Action would contain either an operation or an assertion.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (SetupActionComponent item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Action would contain either an operation or an assertion.) + */ + // syntactic sugar + public SetupActionComponent addAction() { //3 + SetupActionComponent t = new SetupActionComponent(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public TestScriptSetupComponent addAction(SetupActionComponent t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("metadata", "@TestScript.metadata", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata)); + childrenList.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -450004177: /*metadata*/ return this.metadata == null ? new Base[0] : new Base[] {this.metadata}; // TestScriptMetadataComponent + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // SetupActionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -450004177: // metadata + this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent + break; + case -1422950858: // action + this.getAction().add((SetupActionComponent) value); // SetupActionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("metadata")) + this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent + else if (name.equals("action")) + this.getAction().add((SetupActionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -450004177: return getMetadata(); // TestScriptMetadataComponent + case -1422950858: return addAction(); // SetupActionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("metadata")) { + this.metadata = new TestScriptMetadataComponent(); + return this.metadata; + } + else if (name.equals("action")) { + return addAction(); + } + else + return super.addChild(name); + } + + public TestScriptSetupComponent copy() { + TestScriptSetupComponent dst = new TestScriptSetupComponent(); + copyValues(dst); + dst.metadata = metadata == null ? null : metadata.copy(); + if (action != null) { + dst.action = new ArrayList(); + for (SetupActionComponent i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptSetupComponent)) + return false; + TestScriptSetupComponent o = (TestScriptSetupComponent) other; + return compareDeep(metadata, o.metadata, true) && compareDeep(action, o.action, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptSetupComponent)) + return false; + TestScriptSetupComponent o = (TestScriptSetupComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (metadata == null || metadata.isEmpty()) && (action == null || action.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.setup"; + + } + + } + + @Block() + public static class SetupActionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The operation to perform. + */ + @Child(name = "operation", type = {}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The setup operation to perform", formalDefinition="The operation to perform." ) + protected SetupActionOperationComponent operation; + + /** + * Evaluates the results of previous operations to determine if the server under test behaves appropriately. + */ + @Child(name = "assert", type = {}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." ) + protected SetupActionAssertComponent assert_; + + private static final long serialVersionUID = -252088305L; + + /** + * Constructor + */ + public SetupActionComponent() { + super(); + } + + /** + * @return {@link #operation} (The operation to perform.) + */ + public SetupActionOperationComponent getOperation() { + if (this.operation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionComponent.operation"); + else if (Configuration.doAutoCreate()) + this.operation = new SetupActionOperationComponent(); // cc + return this.operation; + } + + public boolean hasOperation() { + return this.operation != null && !this.operation.isEmpty(); + } + + /** + * @param value {@link #operation} (The operation to perform.) + */ + public SetupActionComponent setOperation(SetupActionOperationComponent value) { + this.operation = value; + return this; + } + + /** + * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.) + */ + public SetupActionAssertComponent getAssert() { + if (this.assert_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionComponent.assert_"); + else if (Configuration.doAutoCreate()) + this.assert_ = new SetupActionAssertComponent(); // cc + return this.assert_; + } + + public boolean hasAssert() { + return this.assert_ != null && !this.assert_.isEmpty(); + } + + /** + * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.) + */ + public SetupActionComponent setAssert(SetupActionAssertComponent value) { + this.assert_ = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("operation", "", "The operation to perform.", 0, java.lang.Integer.MAX_VALUE, operation)); + childrenList.add(new Property("assert", "", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, java.lang.Integer.MAX_VALUE, assert_)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent + case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1662702951: // operation + this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent + break; + case -1408208058: // assert + this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("operation")) + this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent + else if (name.equals("assert")) + this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1662702951: return getOperation(); // SetupActionOperationComponent + case -1408208058: return getAssert(); // SetupActionAssertComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("operation")) { + this.operation = new SetupActionOperationComponent(); + return this.operation; + } + else if (name.equals("assert")) { + this.assert_ = new SetupActionAssertComponent(); + return this.assert_; + } + else + return super.addChild(name); + } + + public SetupActionComponent copy() { + SetupActionComponent dst = new SetupActionComponent(); + copyValues(dst); + dst.operation = operation == null ? null : operation.copy(); + dst.assert_ = assert_ == null ? null : assert_.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionComponent)) + return false; + SetupActionComponent o = (SetupActionComponent) other; + return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionComponent)) + return false; + SetupActionComponent o = (SetupActionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (operation == null || operation.isEmpty()) && (assert_ == null || assert_.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.setup.action"; + + } + + } + + @Block() + public static class SetupActionOperationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Server interaction or operation type. + */ + @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The operation code type that will be executed", formalDefinition="Server interaction or operation type." ) + protected Coding type; + + /** + * The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + */ + @Child(name = "resource", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Resource type", formalDefinition="The type of the resource. See http://hl7-fhir.github.io/resourcelist.html." ) + protected CodeType resource; + + /** + * The label would be used for tracking/logging purposes by test engines. + */ + @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Tracking/logging operation label", formalDefinition="The label would be used for tracking/logging purposes by test engines." ) + protected StringType label; + + /** + * The description would be used by test engines for tracking and reporting purposes. + */ + @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Tracking/reporting operation description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." ) + protected StringType description; + + /** + * The content-type or mime-type to use for RESTful operation in the 'Accept' header. + */ + @Child(name = "accept", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Accept' header." ) + protected Enumeration accept; + + /** + * The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. + */ + @Child(name = "contentType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Content-Type' header." ) + protected Enumeration contentType; + + /** + * The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section. + */ + @Child(name = "destination", type = {IntegerType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Server responding to the request", formalDefinition="The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section." ) + protected IntegerType destination; + + /** + * Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths. + */ + @Child(name = "encodeRequestUrl", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Whether or not to send the request url in encoded format", formalDefinition="Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths." ) + protected BooleanType encodeRequestUrl; + + /** + * The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section. + */ + @Child(name = "origin", type = {IntegerType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Server initiating the request", formalDefinition="The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section." ) + protected IntegerType origin; + + /** + * Path plus parameters after [type]. Used to set parts of the request URL explicitly. + */ + @Child(name = "params", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Explicitly defined path parameters", formalDefinition="Path plus parameters after [type]. Used to set parts of the request URL explicitly." ) + protected StringType params; + + /** + * Header elements would be used to set HTTP headers. + */ + @Child(name = "requestHeader", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Each operation can have one ore more header elements", formalDefinition="Header elements would be used to set HTTP headers." ) + protected List requestHeader; + + /** + * The fixture id (maybe new) to map to the response. + */ + @Child(name = "responseId", type = {IdType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Fixture Id of mapped response", formalDefinition="The fixture id (maybe new) to map to the response." ) + protected IdType responseId; + + /** + * The id of the fixture used as the body of a PUT or POST request. + */ + @Child(name = "sourceId", type = {IdType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Fixture Id of body for PUT and POST requests", formalDefinition="The id of the fixture used as the body of a PUT or POST request." ) + protected IdType sourceId; + + /** + * Id of fixture used for extracting the [id], [type], and [vid] for GET requests. + */ + @Child(name = "targetId", type = {IdType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Id of fixture used for extracting the [id], [type], and [vid] for GET requests", formalDefinition="Id of fixture used for extracting the [id], [type], and [vid] for GET requests." ) + protected IdType targetId; + + /** + * Complete request URL. + */ + @Child(name = "url", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Request URL", formalDefinition="Complete request URL." ) + protected StringType url; + + private static final long serialVersionUID = 606457859L; + + /** + * Constructor + */ + public SetupActionOperationComponent() { + super(); + } + + /** + * @return {@link #type} (Server interaction or operation type.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Server interaction or operation type.) + */ + public SetupActionOperationComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value + */ + public CodeType getResourceElement() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new CodeType(); // bb + return this.resource; + } + + public boolean hasResourceElement() { + return this.resource != null && !this.resource.isEmpty(); + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value + */ + public SetupActionOperationComponent setResourceElement(CodeType value) { + this.resource = value; + return this; + } + + /** + * @return The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + */ + public String getResource() { + return this.resource == null ? null : this.resource.getValue(); + } + + /** + * @param value The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + */ + public SetupActionOperationComponent setResource(String value) { + if (Utilities.noString(value)) + this.resource = null; + else { + if (this.resource == null) + this.resource = new CodeType(); + this.resource.setValue(value); + } + return this; + } + + /** + * @return {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public StringType getLabelElement() { + if (this.label == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.label"); + else if (Configuration.doAutoCreate()) + this.label = new StringType(); // bb + return this.label; + } + + public boolean hasLabelElement() { + return this.label != null && !this.label.isEmpty(); + } + + public boolean hasLabel() { + return this.label != null && !this.label.isEmpty(); + } + + /** + * @param value {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public SetupActionOperationComponent setLabelElement(StringType value) { + this.label = value; + return this; + } + + /** + * @return The label would be used for tracking/logging purposes by test engines. + */ + public String getLabel() { + return this.label == null ? null : this.label.getValue(); + } + + /** + * @param value The label would be used for tracking/logging purposes by test engines. + */ + public SetupActionOperationComponent setLabel(String value) { + if (Utilities.noString(value)) + this.label = null; + else { + if (this.label == null) + this.label = new StringType(); + this.label.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (The description would be used by test engines for tracking and reporting purposes.). 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 SetupActionOperationComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (The description would be used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SetupActionOperationComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The description would be used by test engines for tracking and reporting purposes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The description would be used by test engines for tracking and reporting purposes. + */ + public SetupActionOperationComponent 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 #accept} (The content-type or mime-type to use for RESTful operation in the 'Accept' header.). This is the underlying object with id, value and extensions. The accessor "getAccept" gives direct access to the value + */ + public Enumeration getAcceptElement() { + if (this.accept == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.accept"); + else if (Configuration.doAutoCreate()) + this.accept = new Enumeration(new ContentTypeEnumFactory()); // bb + return this.accept; + } + + public boolean hasAcceptElement() { + return this.accept != null && !this.accept.isEmpty(); + } + + public boolean hasAccept() { + return this.accept != null && !this.accept.isEmpty(); + } + + /** + * @param value {@link #accept} (The content-type or mime-type to use for RESTful operation in the 'Accept' header.). This is the underlying object with id, value and extensions. The accessor "getAccept" gives direct access to the value + */ + public SetupActionOperationComponent setAcceptElement(Enumeration value) { + this.accept = value; + return this; + } + + /** + * @return The content-type or mime-type to use for RESTful operation in the 'Accept' header. + */ + public ContentType getAccept() { + return this.accept == null ? null : this.accept.getValue(); + } + + /** + * @param value The content-type or mime-type to use for RESTful operation in the 'Accept' header. + */ + public SetupActionOperationComponent setAccept(ContentType value) { + if (value == null) + this.accept = null; + else { + if (this.accept == null) + this.accept = new Enumeration(new ContentTypeEnumFactory()); + this.accept.setValue(value); + } + return this; + } + + /** + * @return {@link #contentType} (The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Enumeration getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public SetupActionOperationComponent setContentTypeElement(Enumeration value) { + this.contentType = value; + return this; + } + + /** + * @return The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. + */ + public ContentType getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. + */ + public SetupActionOperationComponent setContentType(ContentType value) { + if (value == null) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); + this.contentType.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public IntegerType getDestinationElement() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new IntegerType(); // bb + return this.destination; + } + + public boolean hasDestinationElement() { + return this.destination != null && !this.destination.isEmpty(); + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value + */ + public SetupActionOperationComponent setDestinationElement(IntegerType value) { + this.destination = value; + return this; + } + + /** + * @return The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section. + */ + public int getDestination() { + return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); + } + + /** + * @param value The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section. + */ + public SetupActionOperationComponent setDestination(int value) { + if (this.destination == null) + this.destination = new IntegerType(); + this.destination.setValue(value); + return this; + } + + /** + * @return {@link #encodeRequestUrl} (Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.). This is the underlying object with id, value and extensions. The accessor "getEncodeRequestUrl" gives direct access to the value + */ + public BooleanType getEncodeRequestUrlElement() { + if (this.encodeRequestUrl == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.encodeRequestUrl"); + else if (Configuration.doAutoCreate()) + this.encodeRequestUrl = new BooleanType(); // bb + return this.encodeRequestUrl; + } + + public boolean hasEncodeRequestUrlElement() { + return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty(); + } + + public boolean hasEncodeRequestUrl() { + return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty(); + } + + /** + * @param value {@link #encodeRequestUrl} (Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.). This is the underlying object with id, value and extensions. The accessor "getEncodeRequestUrl" gives direct access to the value + */ + public SetupActionOperationComponent setEncodeRequestUrlElement(BooleanType value) { + this.encodeRequestUrl = value; + return this; + } + + /** + * @return Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths. + */ + public boolean getEncodeRequestUrl() { + return this.encodeRequestUrl == null || this.encodeRequestUrl.isEmpty() ? false : this.encodeRequestUrl.getValue(); + } + + /** + * @param value Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths. + */ + public SetupActionOperationComponent setEncodeRequestUrl(boolean value) { + if (this.encodeRequestUrl == null) + this.encodeRequestUrl = new BooleanType(); + this.encodeRequestUrl.setValue(value); + return this; + } + + /** + * @return {@link #origin} (The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section.). This is the underlying object with id, value and extensions. The accessor "getOrigin" gives direct access to the value + */ + public IntegerType getOriginElement() { + if (this.origin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.origin"); + else if (Configuration.doAutoCreate()) + this.origin = new IntegerType(); // bb + return this.origin; + } + + public boolean hasOriginElement() { + return this.origin != null && !this.origin.isEmpty(); + } + + public boolean hasOrigin() { + return this.origin != null && !this.origin.isEmpty(); + } + + /** + * @param value {@link #origin} (The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section.). This is the underlying object with id, value and extensions. The accessor "getOrigin" gives direct access to the value + */ + public SetupActionOperationComponent setOriginElement(IntegerType value) { + this.origin = value; + return this; + } + + /** + * @return The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section. + */ + public int getOrigin() { + return this.origin == null || this.origin.isEmpty() ? 0 : this.origin.getValue(); + } + + /** + * @param value The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section. + */ + public SetupActionOperationComponent setOrigin(int value) { + if (this.origin == null) + this.origin = new IntegerType(); + this.origin.setValue(value); + return this; + } + + /** + * @return {@link #params} (Path plus parameters after [type]. Used to set parts of the request URL explicitly.). This is the underlying object with id, value and extensions. The accessor "getParams" gives direct access to the value + */ + public StringType getParamsElement() { + if (this.params == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.params"); + else if (Configuration.doAutoCreate()) + this.params = new StringType(); // bb + return this.params; + } + + public boolean hasParamsElement() { + return this.params != null && !this.params.isEmpty(); + } + + public boolean hasParams() { + return this.params != null && !this.params.isEmpty(); + } + + /** + * @param value {@link #params} (Path plus parameters after [type]. Used to set parts of the request URL explicitly.). This is the underlying object with id, value and extensions. The accessor "getParams" gives direct access to the value + */ + public SetupActionOperationComponent setParamsElement(StringType value) { + this.params = value; + return this; + } + + /** + * @return Path plus parameters after [type]. Used to set parts of the request URL explicitly. + */ + public String getParams() { + return this.params == null ? null : this.params.getValue(); + } + + /** + * @param value Path plus parameters after [type]. Used to set parts of the request URL explicitly. + */ + public SetupActionOperationComponent setParams(String value) { + if (Utilities.noString(value)) + this.params = null; + else { + if (this.params == null) + this.params = new StringType(); + this.params.setValue(value); + } + return this; + } + + /** + * @return {@link #requestHeader} (Header elements would be used to set HTTP headers.) + */ + public List getRequestHeader() { + if (this.requestHeader == null) + this.requestHeader = new ArrayList(); + return this.requestHeader; + } + + public boolean hasRequestHeader() { + if (this.requestHeader == null) + return false; + for (SetupActionOperationRequestHeaderComponent item : this.requestHeader) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #requestHeader} (Header elements would be used to set HTTP headers.) + */ + // syntactic sugar + public SetupActionOperationRequestHeaderComponent addRequestHeader() { //3 + SetupActionOperationRequestHeaderComponent t = new SetupActionOperationRequestHeaderComponent(); + if (this.requestHeader == null) + this.requestHeader = new ArrayList(); + this.requestHeader.add(t); + return t; + } + + // syntactic sugar + public SetupActionOperationComponent addRequestHeader(SetupActionOperationRequestHeaderComponent t) { //3 + if (t == null) + return this; + if (this.requestHeader == null) + this.requestHeader = new ArrayList(); + this.requestHeader.add(t); + return this; + } + + /** + * @return {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value + */ + public IdType getResponseIdElement() { + if (this.responseId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.responseId"); + else if (Configuration.doAutoCreate()) + this.responseId = new IdType(); // bb + return this.responseId; + } + + public boolean hasResponseIdElement() { + return this.responseId != null && !this.responseId.isEmpty(); + } + + public boolean hasResponseId() { + return this.responseId != null && !this.responseId.isEmpty(); + } + + /** + * @param value {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value + */ + public SetupActionOperationComponent setResponseIdElement(IdType value) { + this.responseId = value; + return this; + } + + /** + * @return The fixture id (maybe new) to map to the response. + */ + public String getResponseId() { + return this.responseId == null ? null : this.responseId.getValue(); + } + + /** + * @param value The fixture id (maybe new) to map to the response. + */ + public SetupActionOperationComponent setResponseId(String value) { + if (Utilities.noString(value)) + this.responseId = null; + else { + if (this.responseId == null) + this.responseId = new IdType(); + this.responseId.setValue(value); + } + return this; + } + + /** + * @return {@link #sourceId} (The id of the fixture used as the body of a PUT or POST request.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value + */ + public IdType getSourceIdElement() { + if (this.sourceId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.sourceId"); + else if (Configuration.doAutoCreate()) + this.sourceId = new IdType(); // bb + return this.sourceId; + } + + public boolean hasSourceIdElement() { + return this.sourceId != null && !this.sourceId.isEmpty(); + } + + public boolean hasSourceId() { + return this.sourceId != null && !this.sourceId.isEmpty(); + } + + /** + * @param value {@link #sourceId} (The id of the fixture used as the body of a PUT or POST request.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value + */ + public SetupActionOperationComponent setSourceIdElement(IdType value) { + this.sourceId = value; + return this; + } + + /** + * @return The id of the fixture used as the body of a PUT or POST request. + */ + public String getSourceId() { + return this.sourceId == null ? null : this.sourceId.getValue(); + } + + /** + * @param value The id of the fixture used as the body of a PUT or POST request. + */ + public SetupActionOperationComponent setSourceId(String value) { + if (Utilities.noString(value)) + this.sourceId = null; + else { + if (this.sourceId == null) + this.sourceId = new IdType(); + this.sourceId.setValue(value); + } + return this; + } + + /** + * @return {@link #targetId} (Id of fixture used for extracting the [id], [type], and [vid] for GET requests.). This is the underlying object with id, value and extensions. The accessor "getTargetId" gives direct access to the value + */ + public IdType getTargetIdElement() { + if (this.targetId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.targetId"); + else if (Configuration.doAutoCreate()) + this.targetId = new IdType(); // bb + return this.targetId; + } + + public boolean hasTargetIdElement() { + return this.targetId != null && !this.targetId.isEmpty(); + } + + public boolean hasTargetId() { + return this.targetId != null && !this.targetId.isEmpty(); + } + + /** + * @param value {@link #targetId} (Id of fixture used for extracting the [id], [type], and [vid] for GET requests.). This is the underlying object with id, value and extensions. The accessor "getTargetId" gives direct access to the value + */ + public SetupActionOperationComponent setTargetIdElement(IdType value) { + this.targetId = value; + return this; + } + + /** + * @return Id of fixture used for extracting the [id], [type], and [vid] for GET requests. + */ + public String getTargetId() { + return this.targetId == null ? null : this.targetId.getValue(); + } + + /** + * @param value Id of fixture used for extracting the [id], [type], and [vid] for GET requests. + */ + public SetupActionOperationComponent setTargetId(String value) { + if (Utilities.noString(value)) + this.targetId = null; + else { + if (this.targetId == null) + this.targetId = new IdType(); + this.targetId.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (Complete request URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public StringType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new StringType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (Complete request URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SetupActionOperationComponent setUrlElement(StringType value) { + this.url = value; + return this; + } + + /** + * @return Complete request URL. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value Complete request URL. + */ + public SetupActionOperationComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new StringType(); + this.url.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Server interaction or operation type.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("resource", "code", "The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, label)); + childrenList.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("accept", "code", "The content-type or mime-type to use for RESTful operation in the 'Accept' header.", 0, java.lang.Integer.MAX_VALUE, accept)); + childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("destination", "integer", "The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("encodeRequestUrl", "boolean", "Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.", 0, java.lang.Integer.MAX_VALUE, encodeRequestUrl)); + childrenList.add(new Property("origin", "integer", "The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("params", "string", "Path plus parameters after [type]. Used to set parts of the request URL explicitly.", 0, java.lang.Integer.MAX_VALUE, params)); + childrenList.add(new Property("requestHeader", "", "Header elements would be used to set HTTP headers.", 0, java.lang.Integer.MAX_VALUE, requestHeader)); + childrenList.add(new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, java.lang.Integer.MAX_VALUE, responseId)); + childrenList.add(new Property("sourceId", "id", "The id of the fixture used as the body of a PUT or POST request.", 0, java.lang.Integer.MAX_VALUE, sourceId)); + childrenList.add(new Property("targetId", "id", "Id of fixture used for extracting the [id], [type], and [vid] for GET requests.", 0, java.lang.Integer.MAX_VALUE, targetId)); + childrenList.add(new Property("url", "string", "Complete request URL.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CodeType + case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1423461112: /*accept*/ return this.accept == null ? new Base[0] : new Base[] {this.accept}; // Enumeration + case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // Enumeration + case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // IntegerType + case -1760554218: /*encodeRequestUrl*/ return this.encodeRequestUrl == null ? new Base[0] : new Base[] {this.encodeRequestUrl}; // BooleanType + case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // IntegerType + case -995427962: /*params*/ return this.params == null ? new Base[0] : new Base[] {this.params}; // StringType + case 1074158076: /*requestHeader*/ return this.requestHeader == null ? new Base[0] : this.requestHeader.toArray(new Base[this.requestHeader.size()]); // SetupActionOperationRequestHeaderComponent + case -633138884: /*responseId*/ return this.responseId == null ? new Base[0] : new Base[] {this.responseId}; // IdType + case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType + case -441951604: /*targetId*/ return this.targetId == null ? new Base[0] : new Base[] {this.targetId}; // IdType + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = castToCoding(value); // Coding + break; + case -341064690: // resource + this.resource = castToCode(value); // CodeType + break; + case 102727412: // label + this.label = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1423461112: // accept + this.accept = new ContentTypeEnumFactory().fromType(value); // Enumeration + break; + case -389131437: // contentType + this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration + break; + case -1429847026: // destination + this.destination = castToInteger(value); // IntegerType + break; + case -1760554218: // encodeRequestUrl + this.encodeRequestUrl = castToBoolean(value); // BooleanType + break; + case -1008619738: // origin + this.origin = castToInteger(value); // IntegerType + break; + case -995427962: // params + this.params = castToString(value); // StringType + break; + case 1074158076: // requestHeader + this.getRequestHeader().add((SetupActionOperationRequestHeaderComponent) value); // SetupActionOperationRequestHeaderComponent + break; + case -633138884: // responseId + this.responseId = castToId(value); // IdType + break; + case 1746327190: // sourceId + this.sourceId = castToId(value); // IdType + break; + case -441951604: // targetId + this.targetId = castToId(value); // IdType + break; + case 116079: // url + this.url = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = castToCoding(value); // Coding + else if (name.equals("resource")) + this.resource = castToCode(value); // CodeType + else if (name.equals("label")) + this.label = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("accept")) + this.accept = new ContentTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("contentType")) + this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("destination")) + this.destination = castToInteger(value); // IntegerType + else if (name.equals("encodeRequestUrl")) + this.encodeRequestUrl = castToBoolean(value); // BooleanType + else if (name.equals("origin")) + this.origin = castToInteger(value); // IntegerType + else if (name.equals("params")) + this.params = castToString(value); // StringType + else if (name.equals("requestHeader")) + this.getRequestHeader().add((SetupActionOperationRequestHeaderComponent) value); + else if (name.equals("responseId")) + this.responseId = castToId(value); // IdType + else if (name.equals("sourceId")) + this.sourceId = castToId(value); // IdType + else if (name.equals("targetId")) + this.targetId = castToId(value); // IdType + else if (name.equals("url")) + this.url = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: return getType(); // Coding + case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // CodeType + case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1423461112: throw new FHIRException("Cannot make property accept as it is not a complex type"); // Enumeration + case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // Enumeration + case -1429847026: throw new FHIRException("Cannot make property destination as it is not a complex type"); // IntegerType + case -1760554218: throw new FHIRException("Cannot make property encodeRequestUrl as it is not a complex type"); // BooleanType + case -1008619738: throw new FHIRException("Cannot make property origin as it is not a complex type"); // IntegerType + case -995427962: throw new FHIRException("Cannot make property params as it is not a complex type"); // StringType + case 1074158076: return addRequestHeader(); // SetupActionOperationRequestHeaderComponent + case -633138884: throw new FHIRException("Cannot make property responseId as it is not a complex type"); // IdType + case 1746327190: throw new FHIRException("Cannot make property sourceId as it is not a complex type"); // IdType + case -441951604: throw new FHIRException("Cannot make property targetId as it is not a complex type"); // IdType + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + this.type = new Coding(); + return this.type; + } + else if (name.equals("resource")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource"); + } + else if (name.equals("label")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.label"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); + } + else if (name.equals("accept")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.accept"); + } + else if (name.equals("contentType")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType"); + } + else if (name.equals("destination")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination"); + } + else if (name.equals("encodeRequestUrl")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.encodeRequestUrl"); + } + else if (name.equals("origin")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.origin"); + } + else if (name.equals("params")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.params"); + } + else if (name.equals("requestHeader")) { + return addRequestHeader(); + } + else if (name.equals("responseId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseId"); + } + else if (name.equals("sourceId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId"); + } + else if (name.equals("targetId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.targetId"); + } + else if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.url"); + } + else + return super.addChild(name); + } + + public SetupActionOperationComponent copy() { + SetupActionOperationComponent dst = new SetupActionOperationComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.resource = resource == null ? null : resource.copy(); + dst.label = label == null ? null : label.copy(); + dst.description = description == null ? null : description.copy(); + dst.accept = accept == null ? null : accept.copy(); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.destination = destination == null ? null : destination.copy(); + dst.encodeRequestUrl = encodeRequestUrl == null ? null : encodeRequestUrl.copy(); + dst.origin = origin == null ? null : origin.copy(); + dst.params = params == null ? null : params.copy(); + if (requestHeader != null) { + dst.requestHeader = new ArrayList(); + for (SetupActionOperationRequestHeaderComponent i : requestHeader) + dst.requestHeader.add(i.copy()); + }; + dst.responseId = responseId == null ? null : responseId.copy(); + dst.sourceId = sourceId == null ? null : sourceId.copy(); + dst.targetId = targetId == null ? null : targetId.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionOperationComponent)) + return false; + SetupActionOperationComponent o = (SetupActionOperationComponent) other; + return compareDeep(type, o.type, true) && compareDeep(resource, o.resource, true) && compareDeep(label, o.label, true) + && compareDeep(description, o.description, true) && compareDeep(accept, o.accept, true) && compareDeep(contentType, o.contentType, true) + && compareDeep(destination, o.destination, true) && compareDeep(encodeRequestUrl, o.encodeRequestUrl, true) + && compareDeep(origin, o.origin, true) && compareDeep(params, o.params, true) && compareDeep(requestHeader, o.requestHeader, true) + && compareDeep(responseId, o.responseId, true) && compareDeep(sourceId, o.sourceId, true) && compareDeep(targetId, o.targetId, true) + && compareDeep(url, o.url, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionOperationComponent)) + return false; + SetupActionOperationComponent o = (SetupActionOperationComponent) other; + return compareValues(resource, o.resource, true) && compareValues(label, o.label, true) && compareValues(description, o.description, true) + && compareValues(accept, o.accept, true) && compareValues(contentType, o.contentType, true) && compareValues(destination, o.destination, true) + && compareValues(encodeRequestUrl, o.encodeRequestUrl, true) && compareValues(origin, o.origin, true) + && compareValues(params, o.params, true) && compareValues(responseId, o.responseId, true) && compareValues(sourceId, o.sourceId, true) + && compareValues(targetId, o.targetId, true) && compareValues(url, o.url, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (resource == null || resource.isEmpty()) + && (label == null || label.isEmpty()) && (description == null || description.isEmpty()) && (accept == null || accept.isEmpty()) + && (contentType == null || contentType.isEmpty()) && (destination == null || destination.isEmpty()) + && (encodeRequestUrl == null || encodeRequestUrl.isEmpty()) && (origin == null || origin.isEmpty()) + && (params == null || params.isEmpty()) && (requestHeader == null || requestHeader.isEmpty()) + && (responseId == null || responseId.isEmpty()) && (sourceId == null || sourceId.isEmpty()) + && (targetId == null || targetId.isEmpty()) && (url == null || url.isEmpty()); + } + + public String fhirType() { + return "TestScript.setup.action.operation"; + + } + + } + + @Block() + public static class SetupActionOperationRequestHeaderComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The HTTP header field e.g. "Accept". + */ + @Child(name = "field", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field e.g. \"Accept\"." ) + protected StringType field; + + /** + * The value of the header e.g. "application/xml". + */ + @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="HTTP headerfield value", formalDefinition="The value of the header e.g. \"application/xml\"." ) + protected StringType value; + + private static final long serialVersionUID = 274395337L; + + /** + * Constructor + */ + public SetupActionOperationRequestHeaderComponent() { + super(); + } + + /** + * Constructor + */ + public SetupActionOperationRequestHeaderComponent(StringType field, StringType value) { + super(); + this.field = field; + this.value = value; + } + + /** + * @return {@link #field} (The HTTP header field e.g. "Accept".). This is the underlying object with id, value and extensions. The accessor "getField" gives direct access to the value + */ + public StringType getFieldElement() { + if (this.field == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationRequestHeaderComponent.field"); + else if (Configuration.doAutoCreate()) + this.field = new StringType(); // bb + return this.field; + } + + public boolean hasFieldElement() { + return this.field != null && !this.field.isEmpty(); + } + + public boolean hasField() { + return this.field != null && !this.field.isEmpty(); + } + + /** + * @param value {@link #field} (The HTTP header field e.g. "Accept".). This is the underlying object with id, value and extensions. The accessor "getField" gives direct access to the value + */ + public SetupActionOperationRequestHeaderComponent setFieldElement(StringType value) { + this.field = value; + return this; + } + + /** + * @return The HTTP header field e.g. "Accept". + */ + public String getField() { + return this.field == null ? null : this.field.getValue(); + } + + /** + * @param value The HTTP header field e.g. "Accept". + */ + public SetupActionOperationRequestHeaderComponent setField(String value) { + if (this.field == null) + this.field = new StringType(); + this.field.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the header e.g. "application/xml".). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionOperationRequestHeaderComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the header e.g. "application/xml".). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SetupActionOperationRequestHeaderComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The value of the header e.g. "application/xml". + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value of the header e.g. "application/xml". + */ + public SetupActionOperationRequestHeaderComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("field", "string", "The HTTP header field e.g. \"Accept\".", 0, java.lang.Integer.MAX_VALUE, field)); + childrenList.add(new Property("value", "string", "The value of the header e.g. \"application/xml\".", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 97427706: /*field*/ return this.field == null ? new Base[0] : new Base[] {this.field}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 97427706: // field + this.field = castToString(value); // StringType + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("field")) + this.field = castToString(value); // StringType + else if (name.equals("value")) + this.value = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 97427706: throw new FHIRException("Cannot make property field as it is not a complex type"); // StringType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("field")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.field"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); + } + else + return super.addChild(name); + } + + public SetupActionOperationRequestHeaderComponent copy() { + SetupActionOperationRequestHeaderComponent dst = new SetupActionOperationRequestHeaderComponent(); + copyValues(dst); + dst.field = field == null ? null : field.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionOperationRequestHeaderComponent)) + return false; + SetupActionOperationRequestHeaderComponent o = (SetupActionOperationRequestHeaderComponent) other; + return compareDeep(field, o.field, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionOperationRequestHeaderComponent)) + return false; + SetupActionOperationRequestHeaderComponent o = (SetupActionOperationRequestHeaderComponent) other; + return compareValues(field, o.field, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (field == null || field.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.setup.action.operation.requestHeader"; + + } + + } + + @Block() + public static class SetupActionAssertComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The label would be used for tracking/logging purposes by test engines. + */ + @Child(name = "label", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Tracking/logging assertion label", formalDefinition="The label would be used for tracking/logging purposes by test engines." ) + protected StringType label; + + /** + * The description would be used by test engines for tracking and reporting purposes. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Tracking/reporting assertion description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." ) + protected StringType description; + + /** + * The direction to use for the assertion. + */ + @Child(name = "direction", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="response | request", formalDefinition="The direction to use for the assertion." ) + protected Enumeration direction; + + /** + * Id of fixture used to compare the "sourceId/path" evaluations to. + */ + @Child(name = "compareToSourceId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Id of fixture used to compare the \"sourceId/path\" evaluations to", formalDefinition="Id of fixture used to compare the \"sourceId/path\" evaluations to." ) + protected StringType compareToSourceId; + + /** + * XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to. + */ + @Child(name = "compareToSourcePath", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to", formalDefinition="XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to." ) + protected StringType compareToSourcePath; + + /** + * The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. + */ + @Child(name = "contentType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Content-Type' header." ) + protected Enumeration contentType; + + /** + * The HTTP header field name e.g. 'Location'. + */ + @Child(name = "headerField", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field name e.g. 'Location'." ) + protected StringType headerField; + + /** + * The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId. + */ + @Child(name = "minimumId", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Fixture Id of minimum content resource", formalDefinition="The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId." ) + protected StringType minimumId; + + /** + * Whether or not the test execution performs validation on the bundle navigation links. + */ + @Child(name = "navigationLinks", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Perform validation on navigation links?", formalDefinition="Whether or not the test execution performs validation on the bundle navigation links." ) + protected BooleanType navigationLinks; + + /** + * The operator type. + */ + @Child(name = "operator", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains", formalDefinition="The operator type." ) + protected Enumeration operator; + + /** + * The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server. + */ + @Child(name = "path", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="XPath or JSONPath expression", formalDefinition="The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server." ) + protected StringType path; + + /** + * The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + */ + @Child(name = "resource", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Resource type", formalDefinition="The type of the resource. See http://hl7-fhir.github.io/resourcelist.html." ) + protected CodeType resource; + + /** + * okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. + */ + @Child(name = "response", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable", formalDefinition="okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable." ) + protected Enumeration response; + + /** + * The value of the HTTP response code to be tested. + */ + @Child(name = "responseCode", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="HTTP response code to test", formalDefinition="The value of the HTTP response code to be tested." ) + protected StringType responseCode; + + /** + * The TestScript.rule this assert will evaluate. + */ + @Child(name = "rule", type = {}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The reference to a TestScript.rule", formalDefinition="The TestScript.rule this assert will evaluate." ) + protected SetupActionAssertRuleComponent rule; + + /** + * The TestScript.ruleset this assert will evaluate. + */ + @Child(name = "ruleset", type = {}, order=16, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The reference to a TestScript.ruleset", formalDefinition="The TestScript.ruleset this assert will evaluate." ) + protected SetupActionAssertRulesetComponent ruleset; + + /** + * Fixture to evaluate the XPath/JSONPath expression or the headerField against. + */ + @Child(name = "sourceId", type = {IdType.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Fixture Id of source expression or headerField", formalDefinition="Fixture to evaluate the XPath/JSONPath expression or the headerField against." ) + protected IdType sourceId; + + /** + * The ID of the Profile to validate against. + */ + @Child(name = "validateProfileId", type = {IdType.class}, order=18, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Profile Id of validation profile reference", formalDefinition="The ID of the Profile to validate against." ) + protected IdType validateProfileId; + + /** + * The value to compare to. + */ + @Child(name = "value", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The value to compare to", formalDefinition="The value to compare to." ) + protected StringType value; + + /** + * Whether or not the test execution will produce a warning only on error for this assert. + */ + @Child(name = "warningOnly", type = {BooleanType.class}, order=20, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Will this assert produce a warning only on error?", formalDefinition="Whether or not the test execution will produce a warning only on error for this assert." ) + protected BooleanType warningOnly; + + private static final long serialVersionUID = -561290310L; + + /** + * Constructor + */ + public SetupActionAssertComponent() { + super(); + } + + /** + * @return {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public StringType getLabelElement() { + if (this.label == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.label"); + else if (Configuration.doAutoCreate()) + this.label = new StringType(); // bb + return this.label; + } + + public boolean hasLabelElement() { + return this.label != null && !this.label.isEmpty(); + } + + public boolean hasLabel() { + return this.label != null && !this.label.isEmpty(); + } + + /** + * @param value {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public SetupActionAssertComponent setLabelElement(StringType value) { + this.label = value; + return this; + } + + /** + * @return The label would be used for tracking/logging purposes by test engines. + */ + public String getLabel() { + return this.label == null ? null : this.label.getValue(); + } + + /** + * @param value The label would be used for tracking/logging purposes by test engines. + */ + public SetupActionAssertComponent setLabel(String value) { + if (Utilities.noString(value)) + this.label = null; + else { + if (this.label == null) + this.label = new StringType(); + this.label.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (The description would be used by test engines for tracking and reporting purposes.). 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 SetupActionAssertComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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} (The description would be used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SetupActionAssertComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The description would be used by test engines for tracking and reporting purposes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The description would be used by test engines for tracking and reporting purposes. + */ + public SetupActionAssertComponent 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 #direction} (The direction to use for the assertion.). This is the underlying object with id, value and extensions. The accessor "getDirection" gives direct access to the value + */ + public Enumeration getDirectionElement() { + if (this.direction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.direction"); + else if (Configuration.doAutoCreate()) + this.direction = new Enumeration(new AssertionDirectionTypeEnumFactory()); // bb + return this.direction; + } + + public boolean hasDirectionElement() { + return this.direction != null && !this.direction.isEmpty(); + } + + public boolean hasDirection() { + return this.direction != null && !this.direction.isEmpty(); + } + + /** + * @param value {@link #direction} (The direction to use for the assertion.). This is the underlying object with id, value and extensions. The accessor "getDirection" gives direct access to the value + */ + public SetupActionAssertComponent setDirectionElement(Enumeration value) { + this.direction = value; + return this; + } + + /** + * @return The direction to use for the assertion. + */ + public AssertionDirectionType getDirection() { + return this.direction == null ? null : this.direction.getValue(); + } + + /** + * @param value The direction to use for the assertion. + */ + public SetupActionAssertComponent setDirection(AssertionDirectionType value) { + if (value == null) + this.direction = null; + else { + if (this.direction == null) + this.direction = new Enumeration(new AssertionDirectionTypeEnumFactory()); + this.direction.setValue(value); + } + return this; + } + + /** + * @return {@link #compareToSourceId} (Id of fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceId" gives direct access to the value + */ + public StringType getCompareToSourceIdElement() { + if (this.compareToSourceId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourceId"); + else if (Configuration.doAutoCreate()) + this.compareToSourceId = new StringType(); // bb + return this.compareToSourceId; + } + + public boolean hasCompareToSourceIdElement() { + return this.compareToSourceId != null && !this.compareToSourceId.isEmpty(); + } + + public boolean hasCompareToSourceId() { + return this.compareToSourceId != null && !this.compareToSourceId.isEmpty(); + } + + /** + * @param value {@link #compareToSourceId} (Id of fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceId" gives direct access to the value + */ + public SetupActionAssertComponent setCompareToSourceIdElement(StringType value) { + this.compareToSourceId = value; + return this; + } + + /** + * @return Id of fixture used to compare the "sourceId/path" evaluations to. + */ + public String getCompareToSourceId() { + return this.compareToSourceId == null ? null : this.compareToSourceId.getValue(); + } + + /** + * @param value Id of fixture used to compare the "sourceId/path" evaluations to. + */ + public SetupActionAssertComponent setCompareToSourceId(String value) { + if (Utilities.noString(value)) + this.compareToSourceId = null; + else { + if (this.compareToSourceId == null) + this.compareToSourceId = new StringType(); + this.compareToSourceId.setValue(value); + } + return this; + } + + /** + * @return {@link #compareToSourcePath} (XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourcePath" gives direct access to the value + */ + public StringType getCompareToSourcePathElement() { + if (this.compareToSourcePath == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourcePath"); + else if (Configuration.doAutoCreate()) + this.compareToSourcePath = new StringType(); // bb + return this.compareToSourcePath; + } + + public boolean hasCompareToSourcePathElement() { + return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty(); + } + + public boolean hasCompareToSourcePath() { + return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty(); + } + + /** + * @param value {@link #compareToSourcePath} (XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourcePath" gives direct access to the value + */ + public SetupActionAssertComponent setCompareToSourcePathElement(StringType value) { + this.compareToSourcePath = value; + return this; + } + + /** + * @return XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to. + */ + public String getCompareToSourcePath() { + return this.compareToSourcePath == null ? null : this.compareToSourcePath.getValue(); + } + + /** + * @param value XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to. + */ + public SetupActionAssertComponent setCompareToSourcePath(String value) { + if (Utilities.noString(value)) + this.compareToSourcePath = null; + else { + if (this.compareToSourcePath == null) + this.compareToSourcePath = new StringType(); + this.compareToSourcePath.setValue(value); + } + return this; + } + + /** + * @return {@link #contentType} (The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Enumeration getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); // bb + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public SetupActionAssertComponent setContentTypeElement(Enumeration value) { + this.contentType = value; + return this; + } + + /** + * @return The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. + */ + public ContentType getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. + */ + public SetupActionAssertComponent setContentType(ContentType value) { + if (value == null) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new Enumeration(new ContentTypeEnumFactory()); + this.contentType.setValue(value); + } + return this; + } + + /** + * @return {@link #headerField} (The HTTP header field name e.g. 'Location'.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value + */ + public StringType getHeaderFieldElement() { + if (this.headerField == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.headerField"); + else if (Configuration.doAutoCreate()) + this.headerField = new StringType(); // bb + return this.headerField; + } + + public boolean hasHeaderFieldElement() { + return this.headerField != null && !this.headerField.isEmpty(); + } + + public boolean hasHeaderField() { + return this.headerField != null && !this.headerField.isEmpty(); + } + + /** + * @param value {@link #headerField} (The HTTP header field name e.g. 'Location'.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value + */ + public SetupActionAssertComponent setHeaderFieldElement(StringType value) { + this.headerField = value; + return this; + } + + /** + * @return The HTTP header field name e.g. 'Location'. + */ + public String getHeaderField() { + return this.headerField == null ? null : this.headerField.getValue(); + } + + /** + * @param value The HTTP header field name e.g. 'Location'. + */ + public SetupActionAssertComponent setHeaderField(String value) { + if (Utilities.noString(value)) + this.headerField = null; + else { + if (this.headerField == null) + this.headerField = new StringType(); + this.headerField.setValue(value); + } + return this; + } + + /** + * @return {@link #minimumId} (The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId.). This is the underlying object with id, value and extensions. The accessor "getMinimumId" gives direct access to the value + */ + public StringType getMinimumIdElement() { + if (this.minimumId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.minimumId"); + else if (Configuration.doAutoCreate()) + this.minimumId = new StringType(); // bb + return this.minimumId; + } + + public boolean hasMinimumIdElement() { + return this.minimumId != null && !this.minimumId.isEmpty(); + } + + public boolean hasMinimumId() { + return this.minimumId != null && !this.minimumId.isEmpty(); + } + + /** + * @param value {@link #minimumId} (The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId.). This is the underlying object with id, value and extensions. The accessor "getMinimumId" gives direct access to the value + */ + public SetupActionAssertComponent setMinimumIdElement(StringType value) { + this.minimumId = value; + return this; + } + + /** + * @return The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId. + */ + public String getMinimumId() { + return this.minimumId == null ? null : this.minimumId.getValue(); + } + + /** + * @param value The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId. + */ + public SetupActionAssertComponent setMinimumId(String value) { + if (Utilities.noString(value)) + this.minimumId = null; + else { + if (this.minimumId == null) + this.minimumId = new StringType(); + this.minimumId.setValue(value); + } + return this; + } + + /** + * @return {@link #navigationLinks} (Whether or not the test execution performs validation on the bundle navigation links.). This is the underlying object with id, value and extensions. The accessor "getNavigationLinks" gives direct access to the value + */ + public BooleanType getNavigationLinksElement() { + if (this.navigationLinks == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.navigationLinks"); + else if (Configuration.doAutoCreate()) + this.navigationLinks = new BooleanType(); // bb + return this.navigationLinks; + } + + public boolean hasNavigationLinksElement() { + return this.navigationLinks != null && !this.navigationLinks.isEmpty(); + } + + public boolean hasNavigationLinks() { + return this.navigationLinks != null && !this.navigationLinks.isEmpty(); + } + + /** + * @param value {@link #navigationLinks} (Whether or not the test execution performs validation on the bundle navigation links.). This is the underlying object with id, value and extensions. The accessor "getNavigationLinks" gives direct access to the value + */ + public SetupActionAssertComponent setNavigationLinksElement(BooleanType value) { + this.navigationLinks = value; + return this; + } + + /** + * @return Whether or not the test execution performs validation on the bundle navigation links. + */ + public boolean getNavigationLinks() { + return this.navigationLinks == null || this.navigationLinks.isEmpty() ? false : this.navigationLinks.getValue(); + } + + /** + * @param value Whether or not the test execution performs validation on the bundle navigation links. + */ + public SetupActionAssertComponent setNavigationLinks(boolean value) { + if (this.navigationLinks == null) + this.navigationLinks = new BooleanType(); + this.navigationLinks.setValue(value); + return this; + } + + /** + * @return {@link #operator} (The operator type.). This is the underlying object with id, value and extensions. The accessor "getOperator" gives direct access to the value + */ + public Enumeration getOperatorElement() { + if (this.operator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.operator"); + else if (Configuration.doAutoCreate()) + this.operator = new Enumeration(new AssertionOperatorTypeEnumFactory()); // bb + return this.operator; + } + + public boolean hasOperatorElement() { + return this.operator != null && !this.operator.isEmpty(); + } + + public boolean hasOperator() { + return this.operator != null && !this.operator.isEmpty(); + } + + /** + * @param value {@link #operator} (The operator type.). This is the underlying object with id, value and extensions. The accessor "getOperator" gives direct access to the value + */ + public SetupActionAssertComponent setOperatorElement(Enumeration value) { + this.operator = value; + return this; + } + + /** + * @return The operator type. + */ + public AssertionOperatorType getOperator() { + return this.operator == null ? null : this.operator.getValue(); + } + + /** + * @param value The operator type. + */ + public SetupActionAssertComponent setOperator(AssertionOperatorType value) { + if (value == null) + this.operator = null; + else { + if (this.operator == null) + this.operator = new Enumeration(new AssertionOperatorTypeEnumFactory()); + this.operator.setValue(value); + } + return this; + } + + /** + * @return {@link #path} (The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); // bb + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public SetupActionAssertComponent setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server. + */ + public SetupActionAssertComponent setPath(String value) { + if (Utilities.noString(value)) + this.path = null; + else { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + } + return this; + } + + /** + * @return {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value + */ + public CodeType getResourceElement() { + if (this.resource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.resource"); + else if (Configuration.doAutoCreate()) + this.resource = new CodeType(); // bb + return this.resource; + } + + public boolean hasResourceElement() { + return this.resource != null && !this.resource.isEmpty(); + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value + */ + public SetupActionAssertComponent setResourceElement(CodeType value) { + this.resource = value; + return this; + } + + /** + * @return The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + */ + public String getResource() { + return this.resource == null ? null : this.resource.getValue(); + } + + /** + * @param value The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + */ + public SetupActionAssertComponent setResource(String value) { + if (Utilities.noString(value)) + this.resource = null; + else { + if (this.resource == null) + this.resource = new CodeType(); + this.resource.setValue(value); + } + return this; + } + + /** + * @return {@link #response} (okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.). This is the underlying object with id, value and extensions. The accessor "getResponse" gives direct access to the value + */ + public Enumeration getResponseElement() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.response"); + else if (Configuration.doAutoCreate()) + this.response = new Enumeration(new AssertionResponseTypesEnumFactory()); // bb + return this.response; + } + + public boolean hasResponseElement() { + return this.response != null && !this.response.isEmpty(); + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.). This is the underlying object with id, value and extensions. The accessor "getResponse" gives direct access to the value + */ + public SetupActionAssertComponent setResponseElement(Enumeration value) { + this.response = value; + return this; + } + + /** + * @return okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. + */ + public AssertionResponseTypes getResponse() { + return this.response == null ? null : this.response.getValue(); + } + + /** + * @param value okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. + */ + public SetupActionAssertComponent setResponse(AssertionResponseTypes value) { + if (value == null) + this.response = null; + else { + if (this.response == null) + this.response = new Enumeration(new AssertionResponseTypesEnumFactory()); + this.response.setValue(value); + } + return this; + } + + /** + * @return {@link #responseCode} (The value of the HTTP response code to be tested.). This is the underlying object with id, value and extensions. The accessor "getResponseCode" gives direct access to the value + */ + public StringType getResponseCodeElement() { + if (this.responseCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.responseCode"); + else if (Configuration.doAutoCreate()) + this.responseCode = new StringType(); // bb + return this.responseCode; + } + + public boolean hasResponseCodeElement() { + return this.responseCode != null && !this.responseCode.isEmpty(); + } + + public boolean hasResponseCode() { + return this.responseCode != null && !this.responseCode.isEmpty(); + } + + /** + * @param value {@link #responseCode} (The value of the HTTP response code to be tested.). This is the underlying object with id, value and extensions. The accessor "getResponseCode" gives direct access to the value + */ + public SetupActionAssertComponent setResponseCodeElement(StringType value) { + this.responseCode = value; + return this; + } + + /** + * @return The value of the HTTP response code to be tested. + */ + public String getResponseCode() { + return this.responseCode == null ? null : this.responseCode.getValue(); + } + + /** + * @param value The value of the HTTP response code to be tested. + */ + public SetupActionAssertComponent setResponseCode(String value) { + if (Utilities.noString(value)) + this.responseCode = null; + else { + if (this.responseCode == null) + this.responseCode = new StringType(); + this.responseCode.setValue(value); + } + return this; + } + + /** + * @return {@link #rule} (The TestScript.rule this assert will evaluate.) + */ + public SetupActionAssertRuleComponent getRule() { + if (this.rule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.rule"); + else if (Configuration.doAutoCreate()) + this.rule = new SetupActionAssertRuleComponent(); // cc + return this.rule; + } + + public boolean hasRule() { + return this.rule != null && !this.rule.isEmpty(); + } + + /** + * @param value {@link #rule} (The TestScript.rule this assert will evaluate.) + */ + public SetupActionAssertComponent setRule(SetupActionAssertRuleComponent value) { + this.rule = value; + return this; + } + + /** + * @return {@link #ruleset} (The TestScript.ruleset this assert will evaluate.) + */ + public SetupActionAssertRulesetComponent getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new SetupActionAssertRulesetComponent(); // cc + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The TestScript.ruleset this assert will evaluate.) + */ + public SetupActionAssertComponent setRuleset(SetupActionAssertRulesetComponent value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField against.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value + */ + public IdType getSourceIdElement() { + if (this.sourceId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.sourceId"); + else if (Configuration.doAutoCreate()) + this.sourceId = new IdType(); // bb + return this.sourceId; + } + + public boolean hasSourceIdElement() { + return this.sourceId != null && !this.sourceId.isEmpty(); + } + + public boolean hasSourceId() { + return this.sourceId != null && !this.sourceId.isEmpty(); + } + + /** + * @param value {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField against.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value + */ + public SetupActionAssertComponent setSourceIdElement(IdType value) { + this.sourceId = value; + return this; + } + + /** + * @return Fixture to evaluate the XPath/JSONPath expression or the headerField against. + */ + public String getSourceId() { + return this.sourceId == null ? null : this.sourceId.getValue(); + } + + /** + * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField against. + */ + public SetupActionAssertComponent setSourceId(String value) { + if (Utilities.noString(value)) + this.sourceId = null; + else { + if (this.sourceId == null) + this.sourceId = new IdType(); + this.sourceId.setValue(value); + } + return this; + } + + /** + * @return {@link #validateProfileId} (The ID of the Profile to validate against.). This is the underlying object with id, value and extensions. The accessor "getValidateProfileId" gives direct access to the value + */ + public IdType getValidateProfileIdElement() { + if (this.validateProfileId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.validateProfileId"); + else if (Configuration.doAutoCreate()) + this.validateProfileId = new IdType(); // bb + return this.validateProfileId; + } + + public boolean hasValidateProfileIdElement() { + return this.validateProfileId != null && !this.validateProfileId.isEmpty(); + } + + public boolean hasValidateProfileId() { + return this.validateProfileId != null && !this.validateProfileId.isEmpty(); + } + + /** + * @param value {@link #validateProfileId} (The ID of the Profile to validate against.). This is the underlying object with id, value and extensions. The accessor "getValidateProfileId" gives direct access to the value + */ + public SetupActionAssertComponent setValidateProfileIdElement(IdType value) { + this.validateProfileId = value; + return this; + } + + /** + * @return The ID of the Profile to validate against. + */ + public String getValidateProfileId() { + return this.validateProfileId == null ? null : this.validateProfileId.getValue(); + } + + /** + * @param value The ID of the Profile to validate against. + */ + public SetupActionAssertComponent setValidateProfileId(String value) { + if (Utilities.noString(value)) + this.validateProfileId = null; + else { + if (this.validateProfileId == null) + this.validateProfileId = new IdType(); + this.validateProfileId.setValue(value); + } + return this; + } + + /** + * @return {@link #value} (The value to compare to.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value to compare to.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SetupActionAssertComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The value to compare to. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value to compare to. + */ + public SetupActionAssertComponent setValue(String value) { + if (Utilities.noString(value)) + this.value = null; + else { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #warningOnly} (Whether or not the test execution will produce a warning only on error for this assert.). This is the underlying object with id, value and extensions. The accessor "getWarningOnly" gives direct access to the value + */ + public BooleanType getWarningOnlyElement() { + if (this.warningOnly == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertComponent.warningOnly"); + else if (Configuration.doAutoCreate()) + this.warningOnly = new BooleanType(); // bb + return this.warningOnly; + } + + public boolean hasWarningOnlyElement() { + return this.warningOnly != null && !this.warningOnly.isEmpty(); + } + + public boolean hasWarningOnly() { + return this.warningOnly != null && !this.warningOnly.isEmpty(); + } + + /** + * @param value {@link #warningOnly} (Whether or not the test execution will produce a warning only on error for this assert.). This is the underlying object with id, value and extensions. The accessor "getWarningOnly" gives direct access to the value + */ + public SetupActionAssertComponent setWarningOnlyElement(BooleanType value) { + this.warningOnly = value; + return this; + } + + /** + * @return Whether or not the test execution will produce a warning only on error for this assert. + */ + public boolean getWarningOnly() { + return this.warningOnly == null || this.warningOnly.isEmpty() ? false : this.warningOnly.getValue(); + } + + /** + * @param value Whether or not the test execution will produce a warning only on error for this assert. + */ + public SetupActionAssertComponent setWarningOnly(boolean value) { + if (this.warningOnly == null) + this.warningOnly = new BooleanType(); + this.warningOnly.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, label)); + childrenList.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("direction", "code", "The direction to use for the assertion.", 0, java.lang.Integer.MAX_VALUE, direction)); + childrenList.add(new Property("compareToSourceId", "string", "Id of fixture used to compare the \"sourceId/path\" evaluations to.", 0, java.lang.Integer.MAX_VALUE, compareToSourceId)); + childrenList.add(new Property("compareToSourcePath", "string", "XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to.", 0, java.lang.Integer.MAX_VALUE, compareToSourcePath)); + childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("headerField", "string", "The HTTP header field name e.g. 'Location'.", 0, java.lang.Integer.MAX_VALUE, headerField)); + childrenList.add(new Property("minimumId", "string", "The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId.", 0, java.lang.Integer.MAX_VALUE, minimumId)); + childrenList.add(new Property("navigationLinks", "boolean", "Whether or not the test execution performs validation on the bundle navigation links.", 0, java.lang.Integer.MAX_VALUE, navigationLinks)); + childrenList.add(new Property("operator", "code", "The operator type.", 0, java.lang.Integer.MAX_VALUE, operator)); + childrenList.add(new Property("path", "string", "The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("resource", "code", "The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("response", "code", "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("responseCode", "string", "The value of the HTTP response code to be tested.", 0, java.lang.Integer.MAX_VALUE, responseCode)); + childrenList.add(new Property("rule", "", "The TestScript.rule this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, rule)); + childrenList.add(new Property("ruleset", "", "The TestScript.ruleset this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField against.", 0, java.lang.Integer.MAX_VALUE, sourceId)); + childrenList.add(new Property("validateProfileId", "id", "The ID of the Profile to validate against.", 0, java.lang.Integer.MAX_VALUE, validateProfileId)); + childrenList.add(new Property("value", "string", "The value to compare to.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("warningOnly", "boolean", "Whether or not the test execution will produce a warning only on error for this assert.", 0, java.lang.Integer.MAX_VALUE, warningOnly)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -962590849: /*direction*/ return this.direction == null ? new Base[0] : new Base[] {this.direction}; // Enumeration + case 2081856758: /*compareToSourceId*/ return this.compareToSourceId == null ? new Base[0] : new Base[] {this.compareToSourceId}; // StringType + case -790206144: /*compareToSourcePath*/ return this.compareToSourcePath == null ? new Base[0] : new Base[] {this.compareToSourcePath}; // StringType + case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // Enumeration + case 1160732269: /*headerField*/ return this.headerField == null ? new Base[0] : new Base[] {this.headerField}; // StringType + case 818925001: /*minimumId*/ return this.minimumId == null ? new Base[0] : new Base[] {this.minimumId}; // StringType + case 1001488901: /*navigationLinks*/ return this.navigationLinks == null ? new Base[0] : new Base[] {this.navigationLinks}; // BooleanType + case -500553564: /*operator*/ return this.operator == null ? new Base[0] : new Base[] {this.operator}; // Enumeration + case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType + case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CodeType + case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Enumeration + case 1438723534: /*responseCode*/ return this.responseCode == null ? new Base[0] : new Base[] {this.responseCode}; // StringType + case 3512060: /*rule*/ return this.rule == null ? new Base[0] : new Base[] {this.rule}; // SetupActionAssertRuleComponent + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // SetupActionAssertRulesetComponent + case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType + case 1555541038: /*validateProfileId*/ return this.validateProfileId == null ? new Base[0] : new Base[] {this.validateProfileId}; // IdType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + case -481159832: /*warningOnly*/ return this.warningOnly == null ? new Base[0] : new Base[] {this.warningOnly}; // BooleanType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 102727412: // label + this.label = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -962590849: // direction + this.direction = new AssertionDirectionTypeEnumFactory().fromType(value); // Enumeration + break; + case 2081856758: // compareToSourceId + this.compareToSourceId = castToString(value); // StringType + break; + case -790206144: // compareToSourcePath + this.compareToSourcePath = castToString(value); // StringType + break; + case -389131437: // contentType + this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration + break; + case 1160732269: // headerField + this.headerField = castToString(value); // StringType + break; + case 818925001: // minimumId + this.minimumId = castToString(value); // StringType + break; + case 1001488901: // navigationLinks + this.navigationLinks = castToBoolean(value); // BooleanType + break; + case -500553564: // operator + this.operator = new AssertionOperatorTypeEnumFactory().fromType(value); // Enumeration + break; + case 3433509: // path + this.path = castToString(value); // StringType + break; + case -341064690: // resource + this.resource = castToCode(value); // CodeType + break; + case -340323263: // response + this.response = new AssertionResponseTypesEnumFactory().fromType(value); // Enumeration + break; + case 1438723534: // responseCode + this.responseCode = castToString(value); // StringType + break; + case 3512060: // rule + this.rule = (SetupActionAssertRuleComponent) value; // SetupActionAssertRuleComponent + break; + case 1548678118: // ruleset + this.ruleset = (SetupActionAssertRulesetComponent) value; // SetupActionAssertRulesetComponent + break; + case 1746327190: // sourceId + this.sourceId = castToId(value); // IdType + break; + case 1555541038: // validateProfileId + this.validateProfileId = castToId(value); // IdType + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + case -481159832: // warningOnly + this.warningOnly = castToBoolean(value); // BooleanType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("label")) + this.label = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("direction")) + this.direction = new AssertionDirectionTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("compareToSourceId")) + this.compareToSourceId = castToString(value); // StringType + else if (name.equals("compareToSourcePath")) + this.compareToSourcePath = castToString(value); // StringType + else if (name.equals("contentType")) + this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("headerField")) + this.headerField = castToString(value); // StringType + else if (name.equals("minimumId")) + this.minimumId = castToString(value); // StringType + else if (name.equals("navigationLinks")) + this.navigationLinks = castToBoolean(value); // BooleanType + else if (name.equals("operator")) + this.operator = new AssertionOperatorTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("path")) + this.path = castToString(value); // StringType + else if (name.equals("resource")) + this.resource = castToCode(value); // CodeType + else if (name.equals("response")) + this.response = new AssertionResponseTypesEnumFactory().fromType(value); // Enumeration + else if (name.equals("responseCode")) + this.responseCode = castToString(value); // StringType + else if (name.equals("rule")) + this.rule = (SetupActionAssertRuleComponent) value; // SetupActionAssertRuleComponent + else if (name.equals("ruleset")) + this.ruleset = (SetupActionAssertRulesetComponent) value; // SetupActionAssertRulesetComponent + else if (name.equals("sourceId")) + this.sourceId = castToId(value); // IdType + else if (name.equals("validateProfileId")) + this.validateProfileId = castToId(value); // IdType + else if (name.equals("value")) + this.value = castToString(value); // StringType + else if (name.equals("warningOnly")) + this.warningOnly = castToBoolean(value); // BooleanType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -962590849: throw new FHIRException("Cannot make property direction as it is not a complex type"); // Enumeration + case 2081856758: throw new FHIRException("Cannot make property compareToSourceId as it is not a complex type"); // StringType + case -790206144: throw new FHIRException("Cannot make property compareToSourcePath as it is not a complex type"); // StringType + case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // Enumeration + case 1160732269: throw new FHIRException("Cannot make property headerField as it is not a complex type"); // StringType + case 818925001: throw new FHIRException("Cannot make property minimumId as it is not a complex type"); // StringType + case 1001488901: throw new FHIRException("Cannot make property navigationLinks as it is not a complex type"); // BooleanType + case -500553564: throw new FHIRException("Cannot make property operator as it is not a complex type"); // Enumeration + case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType + case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // CodeType + case -340323263: throw new FHIRException("Cannot make property response as it is not a complex type"); // Enumeration + case 1438723534: throw new FHIRException("Cannot make property responseCode as it is not a complex type"); // StringType + case 3512060: return getRule(); // SetupActionAssertRuleComponent + case 1548678118: return getRuleset(); // SetupActionAssertRulesetComponent + case 1746327190: throw new FHIRException("Cannot make property sourceId as it is not a complex type"); // IdType + case 1555541038: throw new FHIRException("Cannot make property validateProfileId as it is not a complex type"); // IdType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + case -481159832: throw new FHIRException("Cannot make property warningOnly as it is not a complex type"); // BooleanType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("label")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.label"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); + } + else if (name.equals("direction")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.direction"); + } + else if (name.equals("compareToSourceId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourceId"); + } + else if (name.equals("compareToSourcePath")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourcePath"); + } + else if (name.equals("contentType")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType"); + } + else if (name.equals("headerField")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField"); + } + else if (name.equals("minimumId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.minimumId"); + } + else if (name.equals("navigationLinks")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.navigationLinks"); + } + else if (name.equals("operator")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.operator"); + } + else if (name.equals("path")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.path"); + } + else if (name.equals("resource")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource"); + } + else if (name.equals("response")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.response"); + } + else if (name.equals("responseCode")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseCode"); + } + else if (name.equals("rule")) { + this.rule = new SetupActionAssertRuleComponent(); + return this.rule; + } + else if (name.equals("ruleset")) { + this.ruleset = new SetupActionAssertRulesetComponent(); + return this.ruleset; + } + else if (name.equals("sourceId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId"); + } + else if (name.equals("validateProfileId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.validateProfileId"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); + } + else if (name.equals("warningOnly")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.warningOnly"); + } + else + return super.addChild(name); + } + + public SetupActionAssertComponent copy() { + SetupActionAssertComponent dst = new SetupActionAssertComponent(); + copyValues(dst); + dst.label = label == null ? null : label.copy(); + dst.description = description == null ? null : description.copy(); + dst.direction = direction == null ? null : direction.copy(); + dst.compareToSourceId = compareToSourceId == null ? null : compareToSourceId.copy(); + dst.compareToSourcePath = compareToSourcePath == null ? null : compareToSourcePath.copy(); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.headerField = headerField == null ? null : headerField.copy(); + dst.minimumId = minimumId == null ? null : minimumId.copy(); + dst.navigationLinks = navigationLinks == null ? null : navigationLinks.copy(); + dst.operator = operator == null ? null : operator.copy(); + dst.path = path == null ? null : path.copy(); + dst.resource = resource == null ? null : resource.copy(); + dst.response = response == null ? null : response.copy(); + dst.responseCode = responseCode == null ? null : responseCode.copy(); + dst.rule = rule == null ? null : rule.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.sourceId = sourceId == null ? null : sourceId.copy(); + dst.validateProfileId = validateProfileId == null ? null : validateProfileId.copy(); + dst.value = value == null ? null : value.copy(); + dst.warningOnly = warningOnly == null ? null : warningOnly.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionAssertComponent)) + return false; + SetupActionAssertComponent o = (SetupActionAssertComponent) other; + return compareDeep(label, o.label, true) && compareDeep(description, o.description, true) && compareDeep(direction, o.direction, true) + && compareDeep(compareToSourceId, o.compareToSourceId, true) && compareDeep(compareToSourcePath, o.compareToSourcePath, true) + && compareDeep(contentType, o.contentType, true) && compareDeep(headerField, o.headerField, true) + && compareDeep(minimumId, o.minimumId, true) && compareDeep(navigationLinks, o.navigationLinks, true) + && compareDeep(operator, o.operator, true) && compareDeep(path, o.path, true) && compareDeep(resource, o.resource, true) + && compareDeep(response, o.response, true) && compareDeep(responseCode, o.responseCode, true) && compareDeep(rule, o.rule, true) + && compareDeep(ruleset, o.ruleset, true) && compareDeep(sourceId, o.sourceId, true) && compareDeep(validateProfileId, o.validateProfileId, true) + && compareDeep(value, o.value, true) && compareDeep(warningOnly, o.warningOnly, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionAssertComponent)) + return false; + SetupActionAssertComponent o = (SetupActionAssertComponent) other; + return compareValues(label, o.label, true) && compareValues(description, o.description, true) && compareValues(direction, o.direction, true) + && compareValues(compareToSourceId, o.compareToSourceId, true) && compareValues(compareToSourcePath, o.compareToSourcePath, true) + && compareValues(contentType, o.contentType, true) && compareValues(headerField, o.headerField, true) + && compareValues(minimumId, o.minimumId, true) && compareValues(navigationLinks, o.navigationLinks, true) + && compareValues(operator, o.operator, true) && compareValues(path, o.path, true) && compareValues(resource, o.resource, true) + && compareValues(response, o.response, true) && compareValues(responseCode, o.responseCode, true) && compareValues(sourceId, o.sourceId, true) + && compareValues(validateProfileId, o.validateProfileId, true) && compareValues(value, o.value, true) + && compareValues(warningOnly, o.warningOnly, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (label == null || label.isEmpty()) && (description == null || description.isEmpty()) + && (direction == null || direction.isEmpty()) && (compareToSourceId == null || compareToSourceId.isEmpty()) + && (compareToSourcePath == null || compareToSourcePath.isEmpty()) && (contentType == null || contentType.isEmpty()) + && (headerField == null || headerField.isEmpty()) && (minimumId == null || minimumId.isEmpty()) + && (navigationLinks == null || navigationLinks.isEmpty()) && (operator == null || operator.isEmpty()) + && (path == null || path.isEmpty()) && (resource == null || resource.isEmpty()) && (response == null || response.isEmpty()) + && (responseCode == null || responseCode.isEmpty()) && (rule == null || rule.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (sourceId == null || sourceId.isEmpty()) && (validateProfileId == null || validateProfileId.isEmpty()) + && (value == null || value.isEmpty()) && (warningOnly == null || warningOnly.isEmpty()); + } + + public String fhirType() { + return "TestScript.setup.action.assert"; + + } + + } + + @Block() + public static class SetupActionAssertRuleComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The TestScript.rule id value this assert will evaluate. + */ + @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Id of the TestScript.rule", formalDefinition="The TestScript.rule id value this assert will evaluate." ) + protected IdType ruleId; + + /** + * Each rule template can take one or more parameters for rule evaluation. + */ + @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." ) + protected List param; + + private static final long serialVersionUID = -319928210L; + + /** + * Constructor + */ + public SetupActionAssertRuleComponent() { + super(); + } + + /** + * Constructor + */ + public SetupActionAssertRuleComponent(IdType ruleId) { + super(); + this.ruleId = ruleId; + } + + /** + * @return {@link #ruleId} (The TestScript.rule id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value + */ + public IdType getRuleIdElement() { + if (this.ruleId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertRuleComponent.ruleId"); + else if (Configuration.doAutoCreate()) + this.ruleId = new IdType(); // bb + return this.ruleId; + } + + public boolean hasRuleIdElement() { + return this.ruleId != null && !this.ruleId.isEmpty(); + } + + public boolean hasRuleId() { + return this.ruleId != null && !this.ruleId.isEmpty(); + } + + /** + * @param value {@link #ruleId} (The TestScript.rule id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value + */ + public SetupActionAssertRuleComponent setRuleIdElement(IdType value) { + this.ruleId = value; + return this; + } + + /** + * @return The TestScript.rule id value this assert will evaluate. + */ + public String getRuleId() { + return this.ruleId == null ? null : this.ruleId.getValue(); + } + + /** + * @param value The TestScript.rule id value this assert will evaluate. + */ + public SetupActionAssertRuleComponent setRuleId(String value) { + if (this.ruleId == null) + this.ruleId = new IdType(); + this.ruleId.setValue(value); + return this; + } + + /** + * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) + */ + public List getParam() { + if (this.param == null) + this.param = new ArrayList(); + return this.param; + } + + public boolean hasParam() { + if (this.param == null) + return false; + for (SetupActionAssertRuleParamComponent item : this.param) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) + */ + // syntactic sugar + public SetupActionAssertRuleParamComponent addParam() { //3 + SetupActionAssertRuleParamComponent t = new SetupActionAssertRuleParamComponent(); + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return t; + } + + // syntactic sugar + public SetupActionAssertRuleComponent addParam(SetupActionAssertRuleParamComponent t) { //3 + if (t == null) + return this; + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("ruleId", "id", "The TestScript.rule id value this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, ruleId)); + childrenList.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType + case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // SetupActionAssertRuleParamComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -919875273: // ruleId + this.ruleId = castToId(value); // IdType + break; + case 106436749: // param + this.getParam().add((SetupActionAssertRuleParamComponent) value); // SetupActionAssertRuleParamComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("ruleId")) + this.ruleId = castToId(value); // IdType + else if (name.equals("param")) + this.getParam().add((SetupActionAssertRuleParamComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -919875273: throw new FHIRException("Cannot make property ruleId as it is not a complex type"); // IdType + case 106436749: return addParam(); // SetupActionAssertRuleParamComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("ruleId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId"); + } + else if (name.equals("param")) { + return addParam(); + } + else + return super.addChild(name); + } + + public SetupActionAssertRuleComponent copy() { + SetupActionAssertRuleComponent dst = new SetupActionAssertRuleComponent(); + copyValues(dst); + dst.ruleId = ruleId == null ? null : ruleId.copy(); + if (param != null) { + dst.param = new ArrayList(); + for (SetupActionAssertRuleParamComponent i : param) + dst.param.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionAssertRuleComponent)) + return false; + SetupActionAssertRuleComponent o = (SetupActionAssertRuleComponent) other; + return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionAssertRuleComponent)) + return false; + SetupActionAssertRuleComponent o = (SetupActionAssertRuleComponent) other; + return compareValues(ruleId, o.ruleId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (ruleId == null || ruleId.isEmpty()) && (param == null || param.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.setup.action.assert.rule"; + + } + + } + + @Block() + public static class SetupActionAssertRuleParamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Descriptive name for this parameter that matches the external assert rule parameter name. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Parameter name matching external assert rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert rule parameter name." ) + protected StringType name; + + /** + * The value for the parameter that will be passed on to the external rule template. + */ + @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external rule template." ) + protected StringType value; + + private static final long serialVersionUID = 395259392L; + + /** + * Constructor + */ + public SetupActionAssertRuleParamComponent() { + super(); + } + + /** + * Constructor + */ + public SetupActionAssertRuleParamComponent(StringType name, StringType value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @return {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). 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 SetupActionAssertRuleParamComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SetupActionAssertRuleParamComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Descriptive name for this parameter that matches the external assert rule parameter name. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Descriptive name for this parameter that matches the external assert rule parameter name. + */ + public SetupActionAssertRuleParamComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertRuleParamComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SetupActionAssertRuleParamComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The value for the parameter that will be passed on to the external rule template. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value for the parameter that will be passed on to the external rule template. + */ + public SetupActionAssertRuleParamComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value", "string", "The value for the parameter that will be passed on to the external rule template.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("value")) + this.value = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); + } + else + return super.addChild(name); + } + + public SetupActionAssertRuleParamComponent copy() { + SetupActionAssertRuleParamComponent dst = new SetupActionAssertRuleParamComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionAssertRuleParamComponent)) + return false; + SetupActionAssertRuleParamComponent o = (SetupActionAssertRuleParamComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionAssertRuleParamComponent)) + return false; + SetupActionAssertRuleParamComponent o = (SetupActionAssertRuleParamComponent) other; + return compareValues(name, o.name, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.setup.action.assert.rule.param"; + + } + + } + + @Block() + public static class SetupActionAssertRulesetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The TestScript.ruleset id value this assert will evaluate. + */ + @Child(name = "rulesetId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Id of the TestScript.ruleset", formalDefinition="The TestScript.ruleset id value this assert will evaluate." ) + protected IdType rulesetId; + + /** + * The referenced rule within the external ruleset template. + */ + @Child(name = "rule", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="The referenced rule within the ruleset", formalDefinition="The referenced rule within the external ruleset template." ) + protected List rule; + + private static final long serialVersionUID = 2070600738L; + + /** + * Constructor + */ + public SetupActionAssertRulesetComponent() { + super(); + } + + /** + * Constructor + */ + public SetupActionAssertRulesetComponent(IdType rulesetId) { + super(); + this.rulesetId = rulesetId; + } + + /** + * @return {@link #rulesetId} (The TestScript.ruleset id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRulesetId" gives direct access to the value + */ + public IdType getRulesetIdElement() { + if (this.rulesetId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertRulesetComponent.rulesetId"); + else if (Configuration.doAutoCreate()) + this.rulesetId = new IdType(); // bb + return this.rulesetId; + } + + public boolean hasRulesetIdElement() { + return this.rulesetId != null && !this.rulesetId.isEmpty(); + } + + public boolean hasRulesetId() { + return this.rulesetId != null && !this.rulesetId.isEmpty(); + } + + /** + * @param value {@link #rulesetId} (The TestScript.ruleset id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRulesetId" gives direct access to the value + */ + public SetupActionAssertRulesetComponent setRulesetIdElement(IdType value) { + this.rulesetId = value; + return this; + } + + /** + * @return The TestScript.ruleset id value this assert will evaluate. + */ + public String getRulesetId() { + return this.rulesetId == null ? null : this.rulesetId.getValue(); + } + + /** + * @param value The TestScript.ruleset id value this assert will evaluate. + */ + public SetupActionAssertRulesetComponent setRulesetId(String value) { + if (this.rulesetId == null) + this.rulesetId = new IdType(); + this.rulesetId.setValue(value); + return this; + } + + /** + * @return {@link #rule} (The referenced rule within the external ruleset template.) + */ + public List getRule() { + if (this.rule == null) + this.rule = new ArrayList(); + return this.rule; + } + + public boolean hasRule() { + if (this.rule == null) + return false; + for (SetupActionAssertRulesetRuleComponent item : this.rule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rule} (The referenced rule within the external ruleset template.) + */ + // syntactic sugar + public SetupActionAssertRulesetRuleComponent addRule() { //3 + SetupActionAssertRulesetRuleComponent t = new SetupActionAssertRulesetRuleComponent(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + // syntactic sugar + public SetupActionAssertRulesetComponent addRule(SetupActionAssertRulesetRuleComponent t) { //3 + if (t == null) + return this; + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("rulesetId", "id", "The TestScript.ruleset id value this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, rulesetId)); + childrenList.add(new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -2073977951: /*rulesetId*/ return this.rulesetId == null ? new Base[0] : new Base[] {this.rulesetId}; // IdType + case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // SetupActionAssertRulesetRuleComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -2073977951: // rulesetId + this.rulesetId = castToId(value); // IdType + break; + case 3512060: // rule + this.getRule().add((SetupActionAssertRulesetRuleComponent) value); // SetupActionAssertRulesetRuleComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("rulesetId")) + this.rulesetId = castToId(value); // IdType + else if (name.equals("rule")) + this.getRule().add((SetupActionAssertRulesetRuleComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -2073977951: throw new FHIRException("Cannot make property rulesetId as it is not a complex type"); // IdType + case 3512060: return addRule(); // SetupActionAssertRulesetRuleComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("rulesetId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.rulesetId"); + } + else if (name.equals("rule")) { + return addRule(); + } + else + return super.addChild(name); + } + + public SetupActionAssertRulesetComponent copy() { + SetupActionAssertRulesetComponent dst = new SetupActionAssertRulesetComponent(); + copyValues(dst); + dst.rulesetId = rulesetId == null ? null : rulesetId.copy(); + if (rule != null) { + dst.rule = new ArrayList(); + for (SetupActionAssertRulesetRuleComponent i : rule) + dst.rule.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionAssertRulesetComponent)) + return false; + SetupActionAssertRulesetComponent o = (SetupActionAssertRulesetComponent) other; + return compareDeep(rulesetId, o.rulesetId, true) && compareDeep(rule, o.rule, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionAssertRulesetComponent)) + return false; + SetupActionAssertRulesetComponent o = (SetupActionAssertRulesetComponent) other; + return compareValues(rulesetId, o.rulesetId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (rulesetId == null || rulesetId.isEmpty()) && (rule == null || rule.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.setup.action.assert.ruleset"; + + } + + } + + @Block() + public static class SetupActionAssertRulesetRuleComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Id of the referenced rule within the external ruleset template. + */ + @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Id of referenced rule within the ruleset", formalDefinition="Id of the referenced rule within the external ruleset template." ) + protected IdType ruleId; + + /** + * Each rule template can take one or more parameters for rule evaluation. + */ + @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." ) + protected List param; + + private static final long serialVersionUID = 52246314L; + + /** + * Constructor + */ + public SetupActionAssertRulesetRuleComponent() { + super(); + } + + /** + * Constructor + */ + public SetupActionAssertRulesetRuleComponent(IdType ruleId) { + super(); + this.ruleId = ruleId; + } + + /** + * @return {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value + */ + public IdType getRuleIdElement() { + if (this.ruleId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertRulesetRuleComponent.ruleId"); + else if (Configuration.doAutoCreate()) + this.ruleId = new IdType(); // bb + return this.ruleId; + } + + public boolean hasRuleIdElement() { + return this.ruleId != null && !this.ruleId.isEmpty(); + } + + public boolean hasRuleId() { + return this.ruleId != null && !this.ruleId.isEmpty(); + } + + /** + * @param value {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value + */ + public SetupActionAssertRulesetRuleComponent setRuleIdElement(IdType value) { + this.ruleId = value; + return this; + } + + /** + * @return Id of the referenced rule within the external ruleset template. + */ + public String getRuleId() { + return this.ruleId == null ? null : this.ruleId.getValue(); + } + + /** + * @param value Id of the referenced rule within the external ruleset template. + */ + public SetupActionAssertRulesetRuleComponent setRuleId(String value) { + if (this.ruleId == null) + this.ruleId = new IdType(); + this.ruleId.setValue(value); + return this; + } + + /** + * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) + */ + public List getParam() { + if (this.param == null) + this.param = new ArrayList(); + return this.param; + } + + public boolean hasParam() { + if (this.param == null) + return false; + for (SetupActionAssertRulesetRuleParamComponent item : this.param) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) + */ + // syntactic sugar + public SetupActionAssertRulesetRuleParamComponent addParam() { //3 + SetupActionAssertRulesetRuleParamComponent t = new SetupActionAssertRulesetRuleParamComponent(); + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return t; + } + + // syntactic sugar + public SetupActionAssertRulesetRuleComponent addParam(SetupActionAssertRulesetRuleParamComponent t) { //3 + if (t == null) + return this; + if (this.param == null) + this.param = new ArrayList(); + this.param.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, ruleId)); + childrenList.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType + case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // SetupActionAssertRulesetRuleParamComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -919875273: // ruleId + this.ruleId = castToId(value); // IdType + break; + case 106436749: // param + this.getParam().add((SetupActionAssertRulesetRuleParamComponent) value); // SetupActionAssertRulesetRuleParamComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("ruleId")) + this.ruleId = castToId(value); // IdType + else if (name.equals("param")) + this.getParam().add((SetupActionAssertRulesetRuleParamComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -919875273: throw new FHIRException("Cannot make property ruleId as it is not a complex type"); // IdType + case 106436749: return addParam(); // SetupActionAssertRulesetRuleParamComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("ruleId")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId"); + } + else if (name.equals("param")) { + return addParam(); + } + else + return super.addChild(name); + } + + public SetupActionAssertRulesetRuleComponent copy() { + SetupActionAssertRulesetRuleComponent dst = new SetupActionAssertRulesetRuleComponent(); + copyValues(dst); + dst.ruleId = ruleId == null ? null : ruleId.copy(); + if (param != null) { + dst.param = new ArrayList(); + for (SetupActionAssertRulesetRuleParamComponent i : param) + dst.param.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionAssertRulesetRuleComponent)) + return false; + SetupActionAssertRulesetRuleComponent o = (SetupActionAssertRulesetRuleComponent) other; + return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionAssertRulesetRuleComponent)) + return false; + SetupActionAssertRulesetRuleComponent o = (SetupActionAssertRulesetRuleComponent) other; + return compareValues(ruleId, o.ruleId, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (ruleId == null || ruleId.isEmpty()) && (param == null || param.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.setup.action.assert.ruleset.rule"; + + } + + } + + @Block() + public static class SetupActionAssertRulesetRuleParamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Descriptive name for this parameter that matches the external assert ruleset rule parameter name. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Parameter name matching external assert ruleset rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert ruleset rule parameter name." ) + protected StringType name; + + /** + * The value for the parameter that will be passed on to the external ruleset rule template. + */ + @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external ruleset rule template." ) + protected StringType value; + + private static final long serialVersionUID = 395259392L; + + /** + * Constructor + */ + public SetupActionAssertRulesetRuleParamComponent() { + super(); + } + + /** + * Constructor + */ + public SetupActionAssertRulesetRuleParamComponent(StringType name, StringType value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @return {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). 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 SetupActionAssertRulesetRuleParamComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SetupActionAssertRulesetRuleParamComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Descriptive name for this parameter that matches the external assert ruleset rule parameter name. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Descriptive name for this parameter that matches the external assert ruleset rule parameter name. + */ + public SetupActionAssertRulesetRuleParamComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SetupActionAssertRulesetRuleParamComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SetupActionAssertRulesetRuleParamComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The value for the parameter that will be passed on to the external ruleset rule template. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value for the parameter that will be passed on to the external ruleset rule template. + */ + public SetupActionAssertRulesetRuleParamComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value", "string", "The value for the parameter that will be passed on to the external ruleset rule template.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("value")) + this.value = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); + } + else + return super.addChild(name); + } + + public SetupActionAssertRulesetRuleParamComponent copy() { + SetupActionAssertRulesetRuleParamComponent dst = new SetupActionAssertRulesetRuleParamComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SetupActionAssertRulesetRuleParamComponent)) + return false; + SetupActionAssertRulesetRuleParamComponent o = (SetupActionAssertRulesetRuleParamComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SetupActionAssertRulesetRuleParamComponent)) + return false; + SetupActionAssertRulesetRuleParamComponent o = (SetupActionAssertRulesetRuleParamComponent) other; + return compareValues(name, o.name, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.setup.action.assert.ruleset.rule.param"; + + } + + } + + @Block() + public static class TestScriptTestComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of this test used for tracking/logging purposes by test engines. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Tracking/logging name of this test", formalDefinition="The name of this test used for tracking/logging purposes by test engines." ) + protected StringType name; + + /** + * A short description of the test used by test engines for tracking and reporting purposes. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Tracking/reporting short description of the test", formalDefinition="A short description of the test used by test engines for tracking and reporting purposes." ) + protected StringType description; + + /** + * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. + */ + @Child(name = "metadata", type = {TestScriptMetadataComponent.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Capabilities that are expected to function correctly on the FHIR server being tested", formalDefinition="Capabilities that must exist and are assumed to function correctly on the FHIR server being tested." ) + protected TestScriptMetadataComponent metadata; + + /** + * Action would contain either an operation or an assertion. + */ + @Child(name = "action", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A test operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." ) + protected List action; + + private static final long serialVersionUID = -1607790780L; + + /** + * Constructor + */ + public TestScriptTestComponent() { + super(); + } + + /** + * @return {@link #name} (The name of this test used for tracking/logging purposes by test engines.). 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 TestScriptTestComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TestScriptTestComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of this test used for tracking/logging purposes by test engines. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of this test used for tracking/logging purposes by test engines. + */ + public TestScriptTestComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). 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 TestScriptTestComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public TestScriptTestComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A short description of the test used by test engines for tracking and reporting purposes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A short description of the test used by test engines for tracking and reporting purposes. + */ + public TestScriptTestComponent 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 #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) + */ + public TestScriptMetadataComponent getMetadata() { + if (this.metadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScriptTestComponent.metadata"); + else if (Configuration.doAutoCreate()) + this.metadata = new TestScriptMetadataComponent(); // cc + return this.metadata; + } + + public boolean hasMetadata() { + return this.metadata != null && !this.metadata.isEmpty(); + } + + /** + * @param value {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) + */ + public TestScriptTestComponent setMetadata(TestScriptMetadataComponent value) { + this.metadata = value; + return this; + } + + /** + * @return {@link #action} (Action would contain either an operation or an assertion.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (TestActionComponent item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Action would contain either an operation or an assertion.) + */ + // syntactic sugar + public TestActionComponent addAction() { //3 + TestActionComponent t = new TestActionComponent(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public TestScriptTestComponent addAction(TestActionComponent t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("metadata", "@TestScript.metadata", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata)); + childrenList.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -450004177: /*metadata*/ return this.metadata == null ? new Base[0] : new Base[] {this.metadata}; // TestScriptMetadataComponent + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TestActionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -450004177: // metadata + this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent + break; + case -1422950858: // action + this.getAction().add((TestActionComponent) value); // TestActionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("metadata")) + this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent + else if (name.equals("action")) + this.getAction().add((TestActionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -450004177: return getMetadata(); // TestScriptMetadataComponent + case -1422950858: return addAction(); // TestActionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); + } + else if (name.equals("metadata")) { + this.metadata = new TestScriptMetadataComponent(); + return this.metadata; + } + else if (name.equals("action")) { + return addAction(); + } + else + return super.addChild(name); + } + + public TestScriptTestComponent copy() { + TestScriptTestComponent dst = new TestScriptTestComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.metadata = metadata == null ? null : metadata.copy(); + if (action != null) { + dst.action = new ArrayList(); + for (TestActionComponent i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTestComponent)) + return false; + TestScriptTestComponent o = (TestScriptTestComponent) other; + return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(metadata, o.metadata, true) + && compareDeep(action, o.action, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTestComponent)) + return false; + TestScriptTestComponent o = (TestScriptTestComponent) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) + && (metadata == null || metadata.isEmpty()) && (action == null || action.isEmpty()); + } + + public String fhirType() { + return "TestScript.test"; + + } + + } + + @Block() + public static class TestActionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An operation would involve a REST request to a server. + */ + @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The setup operation to perform", formalDefinition="An operation would involve a REST request to a server." ) + protected SetupActionOperationComponent operation; + + /** + * Evaluates the results of previous operations to determine if the server under test behaves appropriately. + */ + @Child(name = "assert", type = {SetupActionAssertComponent.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The setup assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." ) + protected SetupActionAssertComponent assert_; + + private static final long serialVersionUID = -252088305L; + + /** + * Constructor + */ + public TestActionComponent() { + super(); + } + + /** + * @return {@link #operation} (An operation would involve a REST request to a server.) + */ + public SetupActionOperationComponent getOperation() { + if (this.operation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestActionComponent.operation"); + else if (Configuration.doAutoCreate()) + this.operation = new SetupActionOperationComponent(); // cc + return this.operation; + } + + public boolean hasOperation() { + return this.operation != null && !this.operation.isEmpty(); + } + + /** + * @param value {@link #operation} (An operation would involve a REST request to a server.) + */ + public TestActionComponent setOperation(SetupActionOperationComponent value) { + this.operation = value; + return this; + } + + /** + * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.) + */ + public SetupActionAssertComponent getAssert() { + if (this.assert_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestActionComponent.assert_"); + else if (Configuration.doAutoCreate()) + this.assert_ = new SetupActionAssertComponent(); // cc + return this.assert_; + } + + public boolean hasAssert() { + return this.assert_ != null && !this.assert_.isEmpty(); + } + + /** + * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.) + */ + public TestActionComponent setAssert(SetupActionAssertComponent value) { + this.assert_ = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, java.lang.Integer.MAX_VALUE, operation)); + childrenList.add(new Property("assert", "@TestScript.setup.action.assert", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, java.lang.Integer.MAX_VALUE, assert_)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent + case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1662702951: // operation + this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent + break; + case -1408208058: // assert + this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("operation")) + this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent + else if (name.equals("assert")) + this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1662702951: return getOperation(); // SetupActionOperationComponent + case -1408208058: return getAssert(); // SetupActionAssertComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("operation")) { + this.operation = new SetupActionOperationComponent(); + return this.operation; + } + else if (name.equals("assert")) { + this.assert_ = new SetupActionAssertComponent(); + return this.assert_; + } + else + return super.addChild(name); + } + + public TestActionComponent copy() { + TestActionComponent dst = new TestActionComponent(); + copyValues(dst); + dst.operation = operation == null ? null : operation.copy(); + dst.assert_ = assert_ == null ? null : assert_.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestActionComponent)) + return false; + TestActionComponent o = (TestActionComponent) other; + return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestActionComponent)) + return false; + TestActionComponent o = (TestActionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (operation == null || operation.isEmpty()) && (assert_ == null || assert_.isEmpty()) + ; + } + + public String fhirType() { + return "TestScript.test.action"; + + } + + } + + @Block() + public static class TestScriptTeardownComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The teardown action will only contain an operation. + */ + @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="One or more teardown operations to perform", formalDefinition="The teardown action will only contain an operation." ) + protected List action; + + private static final long serialVersionUID = 1168638089L; + + /** + * Constructor + */ + public TestScriptTeardownComponent() { + super(); + } + + /** + * @return {@link #action} (The teardown action will only contain an operation.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (TeardownActionComponent item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (The teardown action will only contain an operation.) + */ + // syntactic sugar + public TeardownActionComponent addAction() { //3 + TeardownActionComponent t = new TeardownActionComponent(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + // syntactic sugar + public TestScriptTeardownComponent addAction(TeardownActionComponent t) { //3 + if (t == null) + return this; + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TeardownActionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1422950858: // action + this.getAction().add((TeardownActionComponent) value); // TeardownActionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("action")) + this.getAction().add((TeardownActionComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1422950858: return addAction(); // TeardownActionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("action")) { + return addAction(); + } + else + return super.addChild(name); + } + + public TestScriptTeardownComponent copy() { + TestScriptTeardownComponent dst = new TestScriptTeardownComponent(); + copyValues(dst); + if (action != null) { + dst.action = new ArrayList(); + for (TeardownActionComponent i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScriptTeardownComponent)) + return false; + TestScriptTeardownComponent o = (TestScriptTeardownComponent) other; + return compareDeep(action, o.action, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScriptTeardownComponent)) + return false; + TestScriptTeardownComponent o = (TestScriptTeardownComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (action == null || action.isEmpty()); + } + + public String fhirType() { + return "TestScript.teardown"; + + } + + } + + @Block() + public static class TeardownActionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An operation would involve a REST request to a server. + */ + @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The teardown operation to perform", formalDefinition="An operation would involve a REST request to a server." ) + protected SetupActionOperationComponent operation; + + private static final long serialVersionUID = -1099598054L; + + /** + * Constructor + */ + public TeardownActionComponent() { + super(); + } + + /** + * @return {@link #operation} (An operation would involve a REST request to a server.) + */ + public SetupActionOperationComponent getOperation() { + if (this.operation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TeardownActionComponent.operation"); + else if (Configuration.doAutoCreate()) + this.operation = new SetupActionOperationComponent(); // cc + return this.operation; + } + + public boolean hasOperation() { + return this.operation != null && !this.operation.isEmpty(); + } + + /** + * @param value {@link #operation} (An operation would involve a REST request to a server.) + */ + public TeardownActionComponent setOperation(SetupActionOperationComponent value) { + this.operation = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, java.lang.Integer.MAX_VALUE, operation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1662702951: // operation + this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("operation")) + this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1662702951: return getOperation(); // SetupActionOperationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("operation")) { + this.operation = new SetupActionOperationComponent(); + return this.operation; + } + else + return super.addChild(name); + } + + public TeardownActionComponent copy() { + TeardownActionComponent dst = new TeardownActionComponent(); + copyValues(dst); + dst.operation = operation == null ? null : operation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TeardownActionComponent)) + return false; + TeardownActionComponent o = (TeardownActionComponent) other; + return compareDeep(operation, o.operation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TeardownActionComponent)) + return false; + TeardownActionComponent o = (TeardownActionComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && (operation == null || operation.isEmpty()); + } + + public String fhirType() { + return "TestScript.teardown.action"; + + } + + } + + /** + * An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Absolute URL used to reference this TestScript", formalDefinition="An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published." ) + protected UriType url; + + /** + * The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually. + */ + @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical id for this version of the TestScript", formalDefinition="The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually." ) + protected StringType version; + + /** + * A free text natural language name identifying the TestScript. + */ + @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this TestScript", formalDefinition="A free text natural language name identifying the TestScript." ) + protected StringType name; + + /** + * The status of the TestScript. + */ + @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the TestScript." ) + protected Enumeration status; + + /** + * Identifier for the TestScript assigned for external purposes outside the context of FHIR. + */ + @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="External identifier", formalDefinition="Identifier for the TestScript assigned for external purposes outside the context of FHIR." ) + protected Identifier identifier; + + /** + * This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the Test Script. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the Test Script." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change. + */ + @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for this version of the TestScript", formalDefinition="The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change." ) + protected DateTimeType date; + + /** + * A free text natural language description of the TestScript and its use. + */ + @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Natural language description of the TestScript", formalDefinition="A free text natural language description of the TestScript and its use." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts." ) + protected List useContext; + + /** + * Explains why this Test Script is needed and why it's been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Scope and Usage this Test Script is for", formalDefinition="Explains why this Test Script is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) + protected StringType copyright; + + /** + * An abstract server used in operations within this test script in the origin element. + */ + @Child(name = "origin", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="An abstract server representing a client or sender in a message exchange", formalDefinition="An abstract server used in operations within this test script in the origin element." ) + protected List origin; + + /** + * An abstract server used in operations within this test script in the destination element. + */ + @Child(name = "destination", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="An abstract server representing a destination or receiver in a message exchange", formalDefinition="An abstract server used in operations within this test script in the destination element." ) + protected List destination; + + /** + * The required capability must exist and are assumed to function correctly on the FHIR server being tested. + */ + @Child(name = "metadata", type = {}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Required capability that is assumed to function correctly on the FHIR server being tested", formalDefinition="The required capability must exist and are assumed to function correctly on the FHIR server being tested." ) + protected TestScriptMetadataComponent metadata; + + /** + * Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. + */ + @Child(name = "fixture", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Fixture in the test script - by reference (uri)", formalDefinition="Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute." ) + protected List fixture; + + /** + * Reference to the profile to be used for validation. + */ + @Child(name = "profile", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Reference of the validation profile", formalDefinition="Reference to the profile to be used for validation." ) + protected List profile; + /** + * The actual objects that are the target of the reference (Reference to the profile to be used for validation.) + */ + protected List profileTarget; + + + /** + * Variable is set based either on element value in response body or on header field value in the response headers. + */ + @Child(name = "variable", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Placeholder for evaluated elements", formalDefinition="Variable is set based either on element value in response body or on header field value in the response headers." ) + protected List variable; + + /** + * Assert rule to be used in one or more asserts within the test script. + */ + @Child(name = "rule", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Assert rule used within the test script", formalDefinition="Assert rule to be used in one or more asserts within the test script." ) + protected List rule; + + /** + * Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied. + */ + @Child(name = "ruleset", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Assert ruleset used within the test script", formalDefinition="Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied." ) + protected List ruleset; + + /** + * A series of required setup operations before tests are executed. + */ + @Child(name = "setup", type = {}, order=21, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="A series of required setup operations before tests are executed", formalDefinition="A series of required setup operations before tests are executed." ) + protected TestScriptSetupComponent setup; + + /** + * A test in this script. + */ + @Child(name = "test", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A test in this script", formalDefinition="A test in this script." ) + protected List test; + + /** + * A series of operations required to clean up after the all the tests are executed (successfully or otherwise). + */ + @Child(name = "teardown", type = {}, order=23, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="A series of required clean up steps", formalDefinition="A series of operations required to clean up after the all the tests are executed (successfully or otherwise)." ) + protected TestScriptTeardownComponent teardown; + + private static final long serialVersionUID = -468958725L; + + /** + * Constructor + */ + public TestScript() { + super(); + } + + /** + * Constructor + */ + public TestScript(UriType url, StringType name, Enumeration status) { + super(); + this.url = url; + this.name = name; + this.status = status; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public TestScript setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published. + */ + public TestScript setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public TestScript setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually. + */ + public TestScript setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the TestScript.). 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 TestScript.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name identifying the TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public TestScript setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the TestScript. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the TestScript. + */ + public TestScript setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of the TestScript.). 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 TestScript.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 TestScript.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public TestScript setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the TestScript. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the TestScript. + */ + public TestScript setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.) + */ + public TestScript setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #experimental} (This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public TestScript setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public TestScript setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the Test Script.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the Test Script.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public TestScript setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the Test Script. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the Test Script. + */ + public TestScript setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (TestScriptContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public TestScriptContactComponent addContact() { //3 + TestScriptContactComponent t = new TestScriptContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public TestScript addContact(TestScriptContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.). 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 TestScript.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public TestScript setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change. + */ + public TestScript setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the TestScript and its use.). 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 TestScript.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the TestScript and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public TestScript setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the TestScript and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the TestScript and its use. + */ + public TestScript 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public TestScript addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #requirements} (Explains why this Test Script is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this Test Script is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public TestScript setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this Test Script is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this Test Script is needed and why it's been constrained as it has. + */ + public TestScript setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public TestScript setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + */ + public TestScript setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #origin} (An abstract server used in operations within this test script in the origin element.) + */ + public List getOrigin() { + if (this.origin == null) + this.origin = new ArrayList(); + return this.origin; + } + + public boolean hasOrigin() { + if (this.origin == null) + return false; + for (TestScriptOriginComponent item : this.origin) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #origin} (An abstract server used in operations within this test script in the origin element.) + */ + // syntactic sugar + public TestScriptOriginComponent addOrigin() { //3 + TestScriptOriginComponent t = new TestScriptOriginComponent(); + if (this.origin == null) + this.origin = new ArrayList(); + this.origin.add(t); + return t; + } + + // syntactic sugar + public TestScript addOrigin(TestScriptOriginComponent t) { //3 + if (t == null) + return this; + if (this.origin == null) + this.origin = new ArrayList(); + this.origin.add(t); + return this; + } + + /** + * @return {@link #destination} (An abstract server used in operations within this test script in the destination element.) + */ + public List getDestination() { + if (this.destination == null) + this.destination = new ArrayList(); + return this.destination; + } + + public boolean hasDestination() { + if (this.destination == null) + return false; + for (TestScriptDestinationComponent item : this.destination) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #destination} (An abstract server used in operations within this test script in the destination element.) + */ + // syntactic sugar + public TestScriptDestinationComponent addDestination() { //3 + TestScriptDestinationComponent t = new TestScriptDestinationComponent(); + if (this.destination == null) + this.destination = new ArrayList(); + this.destination.add(t); + return t; + } + + // syntactic sugar + public TestScript addDestination(TestScriptDestinationComponent t) { //3 + if (t == null) + return this; + if (this.destination == null) + this.destination = new ArrayList(); + this.destination.add(t); + return this; + } + + /** + * @return {@link #metadata} (The required capability must exist and are assumed to function correctly on the FHIR server being tested.) + */ + public TestScriptMetadataComponent getMetadata() { + if (this.metadata == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.metadata"); + else if (Configuration.doAutoCreate()) + this.metadata = new TestScriptMetadataComponent(); // cc + return this.metadata; + } + + public boolean hasMetadata() { + return this.metadata != null && !this.metadata.isEmpty(); + } + + /** + * @param value {@link #metadata} (The required capability must exist and are assumed to function correctly on the FHIR server being tested.) + */ + public TestScript setMetadata(TestScriptMetadataComponent value) { + this.metadata = value; + return this; + } + + /** + * @return {@link #fixture} (Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.) + */ + public List getFixture() { + if (this.fixture == null) + this.fixture = new ArrayList(); + return this.fixture; + } + + public boolean hasFixture() { + if (this.fixture == null) + return false; + for (TestScriptFixtureComponent item : this.fixture) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #fixture} (Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.) + */ + // syntactic sugar + public TestScriptFixtureComponent addFixture() { //3 + TestScriptFixtureComponent t = new TestScriptFixtureComponent(); + if (this.fixture == null) + this.fixture = new ArrayList(); + this.fixture.add(t); + return t; + } + + // syntactic sugar + public TestScript addFixture(TestScriptFixtureComponent t) { //3 + if (t == null) + return this; + if (this.fixture == null) + this.fixture = new ArrayList(); + this.fixture.add(t); + return this; + } + + /** + * @return {@link #profile} (Reference to the profile to be used for validation.) + */ + public List getProfile() { + if (this.profile == null) + this.profile = new ArrayList(); + return this.profile; + } + + public boolean hasProfile() { + if (this.profile == null) + return false; + for (Reference item : this.profile) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #profile} (Reference to the profile to be used for validation.) + */ + // syntactic sugar + public Reference addProfile() { //3 + Reference t = new Reference(); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return t; + } + + // syntactic sugar + public TestScript addProfile(Reference t) { //3 + if (t == null) + return this; + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return this; + } + + /** + * @return {@link #profile} (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. Reference to the profile to be used for validation.) + */ + public List getProfileTarget() { + if (this.profileTarget == null) + this.profileTarget = new ArrayList(); + return this.profileTarget; + } + + /** + * @return {@link #variable} (Variable is set based either on element value in response body or on header field value in the response headers.) + */ + public List getVariable() { + if (this.variable == null) + this.variable = new ArrayList(); + return this.variable; + } + + public boolean hasVariable() { + if (this.variable == null) + return false; + for (TestScriptVariableComponent item : this.variable) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #variable} (Variable is set based either on element value in response body or on header field value in the response headers.) + */ + // syntactic sugar + public TestScriptVariableComponent addVariable() { //3 + TestScriptVariableComponent t = new TestScriptVariableComponent(); + if (this.variable == null) + this.variable = new ArrayList(); + this.variable.add(t); + return t; + } + + // syntactic sugar + public TestScript addVariable(TestScriptVariableComponent t) { //3 + if (t == null) + return this; + if (this.variable == null) + this.variable = new ArrayList(); + this.variable.add(t); + return this; + } + + /** + * @return {@link #rule} (Assert rule to be used in one or more asserts within the test script.) + */ + public List getRule() { + if (this.rule == null) + this.rule = new ArrayList(); + return this.rule; + } + + public boolean hasRule() { + if (this.rule == null) + return false; + for (TestScriptRuleComponent item : this.rule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rule} (Assert rule to be used in one or more asserts within the test script.) + */ + // syntactic sugar + public TestScriptRuleComponent addRule() { //3 + TestScriptRuleComponent t = new TestScriptRuleComponent(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + // syntactic sugar + public TestScript addRule(TestScriptRuleComponent t) { //3 + if (t == null) + return this; + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return this; + } + + /** + * @return {@link #ruleset} (Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied.) + */ + public List getRuleset() { + if (this.ruleset == null) + this.ruleset = new ArrayList(); + return this.ruleset; + } + + public boolean hasRuleset() { + if (this.ruleset == null) + return false; + for (TestScriptRulesetComponent item : this.ruleset) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ruleset} (Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied.) + */ + // syntactic sugar + public TestScriptRulesetComponent addRuleset() { //3 + TestScriptRulesetComponent t = new TestScriptRulesetComponent(); + if (this.ruleset == null) + this.ruleset = new ArrayList(); + this.ruleset.add(t); + return t; + } + + // syntactic sugar + public TestScript addRuleset(TestScriptRulesetComponent t) { //3 + if (t == null) + return this; + if (this.ruleset == null) + this.ruleset = new ArrayList(); + this.ruleset.add(t); + return this; + } + + /** + * @return {@link #setup} (A series of required setup operations before tests are executed.) + */ + public TestScriptSetupComponent getSetup() { + if (this.setup == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.setup"); + else if (Configuration.doAutoCreate()) + this.setup = new TestScriptSetupComponent(); // cc + return this.setup; + } + + public boolean hasSetup() { + return this.setup != null && !this.setup.isEmpty(); + } + + /** + * @param value {@link #setup} (A series of required setup operations before tests are executed.) + */ + public TestScript setSetup(TestScriptSetupComponent value) { + this.setup = value; + return this; + } + + /** + * @return {@link #test} (A test in this script.) + */ + public List getTest() { + if (this.test == null) + this.test = new ArrayList(); + return this.test; + } + + public boolean hasTest() { + if (this.test == null) + return false; + for (TestScriptTestComponent item : this.test) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #test} (A test in this script.) + */ + // syntactic sugar + public TestScriptTestComponent addTest() { //3 + TestScriptTestComponent t = new TestScriptTestComponent(); + if (this.test == null) + this.test = new ArrayList(); + this.test.add(t); + return t; + } + + // syntactic sugar + public TestScript addTest(TestScriptTestComponent t) { //3 + if (t == null) + return this; + if (this.test == null) + this.test = new ArrayList(); + this.test.add(t); + return this; + } + + /** + * @return {@link #teardown} (A series of operations required to clean up after the all the tests are executed (successfully or otherwise).) + */ + public TestScriptTeardownComponent getTeardown() { + if (this.teardown == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TestScript.teardown"); + else if (Configuration.doAutoCreate()) + this.teardown = new TestScriptTeardownComponent(); // cc + return this.teardown; + } + + public boolean hasTeardown() { + return this.teardown != null && !this.teardown.isEmpty(); + } + + /** + * @param value {@link #teardown} (A series of operations required to clean up after the all the tests are executed (successfully or otherwise).) + */ + public TestScript setTeardown(TestScriptTeardownComponent value) { + this.teardown = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the TestScript.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the TestScript.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("identifier", "Identifier", "Identifier for the TestScript assigned for external purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("experimental", "boolean", "This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the Test Script.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A free text natural language description of the TestScript and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("requirements", "string", "Explains why this Test Script is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("origin", "", "An abstract server used in operations within this test script in the origin element.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("destination", "", "An abstract server used in operations within this test script in the destination element.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("metadata", "", "The required capability must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata)); + childrenList.add(new Property("fixture", "", "Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.", 0, java.lang.Integer.MAX_VALUE, fixture)); + childrenList.add(new Property("profile", "Reference(Any)", "Reference to the profile to be used for validation.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("variable", "", "Variable is set based either on element value in response body or on header field value in the response headers.", 0, java.lang.Integer.MAX_VALUE, variable)); + childrenList.add(new Property("rule", "", "Assert rule to be used in one or more asserts within the test script.", 0, java.lang.Integer.MAX_VALUE, rule)); + childrenList.add(new Property("ruleset", "", "Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("setup", "", "A series of required setup operations before tests are executed.", 0, java.lang.Integer.MAX_VALUE, setup)); + childrenList.add(new Property("test", "", "A test in this script.", 0, java.lang.Integer.MAX_VALUE, test)); + childrenList.add(new Property("teardown", "", "A series of operations required to clean up after the all the tests are executed (successfully or otherwise).", 0, java.lang.Integer.MAX_VALUE, teardown)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // TestScriptContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : this.origin.toArray(new Base[this.origin.size()]); // TestScriptOriginComponent + case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : this.destination.toArray(new Base[this.destination.size()]); // TestScriptDestinationComponent + case -450004177: /*metadata*/ return this.metadata == null ? new Base[0] : new Base[] {this.metadata}; // TestScriptMetadataComponent + case -843449847: /*fixture*/ return this.fixture == null ? new Base[0] : this.fixture.toArray(new Base[this.fixture.size()]); // TestScriptFixtureComponent + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference + case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : this.variable.toArray(new Base[this.variable.size()]); // TestScriptVariableComponent + case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // TestScriptRuleComponent + case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : this.ruleset.toArray(new Base[this.ruleset.size()]); // TestScriptRulesetComponent + case 109329021: /*setup*/ return this.setup == null ? new Base[0] : new Base[] {this.setup}; // TestScriptSetupComponent + case 3556498: /*test*/ return this.test == null ? new Base[0] : this.test.toArray(new Base[this.test.size()]); // TestScriptTestComponent + case -1663474172: /*teardown*/ return this.teardown == null ? new Base[0] : new Base[] {this.teardown}; // TestScriptTeardownComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((TestScriptContactComponent) value); // TestScriptContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case -1008619738: // origin + this.getOrigin().add((TestScriptOriginComponent) value); // TestScriptOriginComponent + break; + case -1429847026: // destination + this.getDestination().add((TestScriptDestinationComponent) value); // TestScriptDestinationComponent + break; + case -450004177: // metadata + this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent + break; + case -843449847: // fixture + this.getFixture().add((TestScriptFixtureComponent) value); // TestScriptFixtureComponent + break; + case -309425751: // profile + this.getProfile().add(castToReference(value)); // Reference + break; + case -1249586564: // variable + this.getVariable().add((TestScriptVariableComponent) value); // TestScriptVariableComponent + break; + case 3512060: // rule + this.getRule().add((TestScriptRuleComponent) value); // TestScriptRuleComponent + break; + case 1548678118: // ruleset + this.getRuleset().add((TestScriptRulesetComponent) value); // TestScriptRulesetComponent + break; + case 109329021: // setup + this.setup = (TestScriptSetupComponent) value; // TestScriptSetupComponent + break; + case 3556498: // test + this.getTest().add((TestScriptTestComponent) value); // TestScriptTestComponent + break; + case -1663474172: // teardown + this.teardown = (TestScriptTeardownComponent) value; // TestScriptTeardownComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((TestScriptContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("origin")) + this.getOrigin().add((TestScriptOriginComponent) value); + else if (name.equals("destination")) + this.getDestination().add((TestScriptDestinationComponent) value); + else if (name.equals("metadata")) + this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent + else if (name.equals("fixture")) + this.getFixture().add((TestScriptFixtureComponent) value); + else if (name.equals("profile")) + this.getProfile().add(castToReference(value)); + else if (name.equals("variable")) + this.getVariable().add((TestScriptVariableComponent) value); + else if (name.equals("rule")) + this.getRule().add((TestScriptRuleComponent) value); + else if (name.equals("ruleset")) + this.getRuleset().add((TestScriptRulesetComponent) value); + else if (name.equals("setup")) + this.setup = (TestScriptSetupComponent) value; // TestScriptSetupComponent + else if (name.equals("test")) + this.getTest().add((TestScriptTestComponent) value); + else if (name.equals("teardown")) + this.teardown = (TestScriptTeardownComponent) value; // TestScriptTeardownComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -1618432855: return getIdentifier(); // Identifier + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // TestScriptContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case -1008619738: return addOrigin(); // TestScriptOriginComponent + case -1429847026: return addDestination(); // TestScriptDestinationComponent + case -450004177: return getMetadata(); // TestScriptMetadataComponent + case -843449847: return addFixture(); // TestScriptFixtureComponent + case -309425751: return addProfile(); // Reference + case -1249586564: return addVariable(); // TestScriptVariableComponent + case 3512060: return addRule(); // TestScriptRuleComponent + case 1548678118: return addRuleset(); // TestScriptRulesetComponent + case 109329021: return getSetup(); // TestScriptSetupComponent + case 3556498: return addTest(); // TestScriptTestComponent + case -1663474172: return getTeardown(); // TestScriptTeardownComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.url"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.status"); + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.date"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.requirements"); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type TestScript.copyright"); + } + else if (name.equals("origin")) { + return addOrigin(); + } + else if (name.equals("destination")) { + return addDestination(); + } + else if (name.equals("metadata")) { + this.metadata = new TestScriptMetadataComponent(); + return this.metadata; + } + else if (name.equals("fixture")) { + return addFixture(); + } + else if (name.equals("profile")) { + return addProfile(); + } + else if (name.equals("variable")) { + return addVariable(); + } + else if (name.equals("rule")) { + return addRule(); + } + else if (name.equals("ruleset")) { + return addRuleset(); + } + else if (name.equals("setup")) { + this.setup = new TestScriptSetupComponent(); + return this.setup; + } + else if (name.equals("test")) { + return addTest(); + } + else if (name.equals("teardown")) { + this.teardown = new TestScriptTeardownComponent(); + return this.teardown; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "TestScript"; + + } + + public TestScript copy() { + TestScript dst = new TestScript(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (TestScriptContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + if (origin != null) { + dst.origin = new ArrayList(); + for (TestScriptOriginComponent i : origin) + dst.origin.add(i.copy()); + }; + if (destination != null) { + dst.destination = new ArrayList(); + for (TestScriptDestinationComponent i : destination) + dst.destination.add(i.copy()); + }; + dst.metadata = metadata == null ? null : metadata.copy(); + if (fixture != null) { + dst.fixture = new ArrayList(); + for (TestScriptFixtureComponent i : fixture) + dst.fixture.add(i.copy()); + }; + if (profile != null) { + dst.profile = new ArrayList(); + for (Reference i : profile) + dst.profile.add(i.copy()); + }; + if (variable != null) { + dst.variable = new ArrayList(); + for (TestScriptVariableComponent i : variable) + dst.variable.add(i.copy()); + }; + if (rule != null) { + dst.rule = new ArrayList(); + for (TestScriptRuleComponent i : rule) + dst.rule.add(i.copy()); + }; + if (ruleset != null) { + dst.ruleset = new ArrayList(); + for (TestScriptRulesetComponent i : ruleset) + dst.ruleset.add(i.copy()); + }; + dst.setup = setup == null ? null : setup.copy(); + if (test != null) { + dst.test = new ArrayList(); + for (TestScriptTestComponent i : test) + dst.test.add(i.copy()); + }; + dst.teardown = teardown == null ? null : teardown.copy(); + return dst; + } + + protected TestScript typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TestScript)) + return false; + TestScript o = (TestScript) other; + return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) + && compareDeep(status, o.status, true) && compareDeep(identifier, o.identifier, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) + && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) + && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) + && compareDeep(origin, o.origin, true) && compareDeep(destination, o.destination, true) && compareDeep(metadata, o.metadata, true) + && compareDeep(fixture, o.fixture, true) && compareDeep(profile, o.profile, true) && compareDeep(variable, o.variable, true) + && compareDeep(rule, o.rule, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(setup, o.setup, true) + && compareDeep(test, o.test, true) && compareDeep(teardown, o.teardown, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TestScript)) + return false; + TestScript o = (TestScript) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) + && compareValues(copyright, o.copyright, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) + && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (origin == null || origin.isEmpty()) && (destination == null || destination.isEmpty()) + && (metadata == null || metadata.isEmpty()) && (fixture == null || fixture.isEmpty()) && (profile == null || profile.isEmpty()) + && (variable == null || variable.isEmpty()) && (rule == null || rule.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (setup == null || setup.isEmpty()) && (test == null || test.isEmpty()) && (teardown == null || teardown.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.TestScript; + } + + /** + * Search parameter: testscript-test-capability + *

+ * Description: TestScript test required and validated capability
+ * Type: string
+ * Path: TestScript.test.metadata.capability.description
+ *

+ */ + @SearchParamDefinition(name="testscript-test-capability", path="TestScript.test.metadata.capability.description", description="TestScript test required and validated capability", type="string" ) + public static final String SP_TESTSCRIPT_TEST_CAPABILITY = "testscript-test-capability"; + /** + * Fluent Client search parameter constant for testscript-test-capability + *

+ * Description: TestScript test required and validated capability
+ * Type: string
+ * Path: TestScript.test.metadata.capability.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTSCRIPT_TEST_CAPABILITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTSCRIPT_TEST_CAPABILITY); + + /** + * Search parameter: testscript-setup-capability + *

+ * Description: TestScript setup required and validated capability
+ * Type: string
+ * Path: TestScript.setup.metadata.capability.description
+ *

+ */ + @SearchParamDefinition(name="testscript-setup-capability", path="TestScript.setup.metadata.capability.description", description="TestScript setup required and validated capability", type="string" ) + public static final String SP_TESTSCRIPT_SETUP_CAPABILITY = "testscript-setup-capability"; + /** + * Fluent Client search parameter constant for testscript-setup-capability + *

+ * Description: TestScript setup required and validated capability
+ * Type: string
+ * Path: TestScript.setup.metadata.capability.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTSCRIPT_SETUP_CAPABILITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTSCRIPT_SETUP_CAPABILITY); + + /** + * Search parameter: description + *

+ * Description: Natural language description of the TestScript
+ * Type: string
+ * Path: TestScript.description
+ *

+ */ + @SearchParamDefinition(name="description", path="TestScript.description", description="Natural language description of the TestScript", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Natural language description of the TestScript
+ * Type: string
+ * Path: TestScript.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: Informal name for this TestScript
+ * Type: string
+ * Path: TestScript.name
+ *

+ */ + @SearchParamDefinition(name="name", path="TestScript.name", description="Informal name for this TestScript", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Informal name for this TestScript
+ * Type: string
+ * Path: TestScript.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: testscript-capability + *

+ * Description: TestScript required and validated capability
+ * Type: string
+ * Path: TestScript.metadata.capability.description
+ *

+ */ + @SearchParamDefinition(name="testscript-capability", path="TestScript.metadata.capability.description", description="TestScript required and validated capability", type="string" ) + public static final String SP_TESTSCRIPT_CAPABILITY = "testscript-capability"; + /** + * Fluent Client search parameter constant for testscript-capability + *

+ * Description: TestScript required and validated capability
+ * Type: string
+ * Path: TestScript.metadata.capability.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTSCRIPT_CAPABILITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTSCRIPT_CAPABILITY); + + /** + * Search parameter: identifier + *

+ * Description: External identifier
+ * Type: token
+ * Path: TestScript.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="TestScript.identifier", description="External identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: External identifier
+ * Type: token
+ * Path: TestScript.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: url + *

+ * Description: Absolute URL used to reference this TestScript
+ * Type: uri
+ * Path: TestScript.url
+ *

+ */ + @SearchParamDefinition(name="url", path="TestScript.url", description="Absolute URL used to reference this TestScript", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: Absolute URL used to reference this TestScript
+ * Type: uri
+ * Path: TestScript.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TimeType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TimeType.java new file mode 100644 index 00000000000..de1c686a69b --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TimeType.java @@ -0,0 +1,76 @@ +/* +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. + +*/ + +package org.hl7.fhir.dstu2016may.model; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Represents a Time datatype, per the FHIR specification. A time is a specification of hours and minutes (and optionally milliseconds), with NO date and NO timezone information attached. It is + * expressed as a string in the form HH:mm:ss[.SSSS] + */ +@DatatypeDef(name="time") +public class TimeType extends PrimitiveType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public TimeType() { + // nothing + } + + /** + * Constructor + */ + public TimeType(String theValue) { + setValue(theValue); + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public TimeType copy() { + return new TimeType(getValue()); + } + + public String fhirType() { + return "time"; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Timing.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Timing.java new file mode 100644 index 00000000000..7db4d6e7243 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Timing.java @@ -0,0 +1,1811 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; +import org.hl7.fhir.instance.model.api.ICompositeType; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. + */ +@DatatypeDef(name="Timing") +public class Timing extends Type implements ICompositeType { + + public enum UnitsOfTime { + /** + * null + */ + S, + /** + * null + */ + MIN, + /** + * null + */ + H, + /** + * null + */ + D, + /** + * null + */ + WK, + /** + * null + */ + MO, + /** + * null + */ + A, + /** + * added to help the parsers + */ + NULL; + public static UnitsOfTime fromCode(String codeString) throws FHIRException { + 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 FHIRException("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 String getSystem() { + switch (this) { + case S: return "http://unitsofmeasure.org"; + case MIN: return "http://unitsofmeasure.org"; + case H: return "http://unitsofmeasure.org"; + case D: return "http://unitsofmeasure.org"; + case WK: return "http://unitsofmeasure.org"; + case MO: return "http://unitsofmeasure.org"; + case A: return "http://unitsofmeasure.org"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case S: return ""; + case MIN: return ""; + case H: return ""; + case D: return ""; + case WK: return ""; + case MO: return ""; + case A: return ""; + default: return "?"; + } + } + public String getDisplay() { + 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 UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { + 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 IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("s".equals(codeString)) + return new Enumeration(this, UnitsOfTime.S); + if ("min".equals(codeString)) + return new Enumeration(this, UnitsOfTime.MIN); + if ("h".equals(codeString)) + return new Enumeration(this, UnitsOfTime.H); + if ("d".equals(codeString)) + return new Enumeration(this, UnitsOfTime.D); + if ("wk".equals(codeString)) + return new Enumeration(this, UnitsOfTime.WK); + if ("mo".equals(codeString)) + return new Enumeration(this, UnitsOfTime.MO); + if ("a".equals(codeString)) + return new Enumeration(this, UnitsOfTime.A); + throw new FHIRException("Unknown UnitsOfTime code '"+codeString+"'"); + } + public String toCode(UnitsOfTime code) { + 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 String toSystem(UnitsOfTime code) { + return code.getSystem(); + } + } + + public enum EventTiming { + /** + * null + */ + HS, + /** + * null + */ + WAKE, + /** + * null + */ + C, + /** + * null + */ + CM, + /** + * null + */ + CD, + /** + * null + */ + CV, + /** + * null + */ + AC, + /** + * null + */ + ACM, + /** + * null + */ + ACD, + /** + * null + */ + ACV, + /** + * null + */ + PC, + /** + * null + */ + PCM, + /** + * null + */ + PCD, + /** + * null + */ + PCV, + /** + * added to help the parsers + */ + NULL; + public static EventTiming fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("HS".equals(codeString)) + return HS; + if ("WAKE".equals(codeString)) + return WAKE; + if ("C".equals(codeString)) + return C; + if ("CM".equals(codeString)) + return CM; + if ("CD".equals(codeString)) + return CD; + if ("CV".equals(codeString)) + return CV; + 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 FHIRException("Unknown EventTiming code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case HS: return "HS"; + case WAKE: return "WAKE"; + case C: return "C"; + case CM: return "CM"; + case CD: return "CD"; + case CV: return "CV"; + 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 String getSystem() { + switch (this) { + case HS: return "http://hl7.org/fhir/v3/TimingEvent"; + case WAKE: return "http://hl7.org/fhir/v3/TimingEvent"; + case C: return "http://hl7.org/fhir/v3/TimingEvent"; + case CM: return "http://hl7.org/fhir/v3/TimingEvent"; + case CD: return "http://hl7.org/fhir/v3/TimingEvent"; + case CV: return "http://hl7.org/fhir/v3/TimingEvent"; + case AC: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACM: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACD: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACV: return "http://hl7.org/fhir/v3/TimingEvent"; + case PC: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCM: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCD: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCV: return "http://hl7.org/fhir/v3/TimingEvent"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HS: return ""; + case WAKE: return ""; + case C: return ""; + case CM: return ""; + case CD: return ""; + case CV: return ""; + case AC: return ""; + case ACM: return ""; + case ACD: return ""; + case ACV: return ""; + case PC: return ""; + case PCM: return ""; + case PCD: return ""; + case PCV: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HS: return "HS"; + case WAKE: return "WAKE"; + case C: return "C"; + case CM: return "CM"; + case CD: return "CD"; + case CV: return "CV"; + 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 EventTiming fromCode(String codeString) throws IllegalArgumentException { + 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 ("C".equals(codeString)) + return EventTiming.C; + if ("CM".equals(codeString)) + return EventTiming.CM; + if ("CD".equals(codeString)) + return EventTiming.CD; + if ("CV".equals(codeString)) + return EventTiming.CV; + 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 IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("HS".equals(codeString)) + return new Enumeration(this, EventTiming.HS); + if ("WAKE".equals(codeString)) + return new Enumeration(this, EventTiming.WAKE); + if ("C".equals(codeString)) + return new Enumeration(this, EventTiming.C); + if ("CM".equals(codeString)) + return new Enumeration(this, EventTiming.CM); + if ("CD".equals(codeString)) + return new Enumeration(this, EventTiming.CD); + if ("CV".equals(codeString)) + return new Enumeration(this, EventTiming.CV); + if ("AC".equals(codeString)) + return new Enumeration(this, EventTiming.AC); + if ("ACM".equals(codeString)) + return new Enumeration(this, EventTiming.ACM); + if ("ACD".equals(codeString)) + return new Enumeration(this, EventTiming.ACD); + if ("ACV".equals(codeString)) + return new Enumeration(this, EventTiming.ACV); + if ("PC".equals(codeString)) + return new Enumeration(this, EventTiming.PC); + if ("PCM".equals(codeString)) + return new Enumeration(this, EventTiming.PCM); + if ("PCD".equals(codeString)) + return new Enumeration(this, EventTiming.PCD); + if ("PCV".equals(codeString)) + return new Enumeration(this, EventTiming.PCV); + throw new FHIRException("Unknown EventTiming code '"+codeString+"'"); + } + public String toCode(EventTiming code) { + if (code == EventTiming.HS) + return "HS"; + if (code == EventTiming.WAKE) + return "WAKE"; + if (code == EventTiming.C) + return "C"; + if (code == EventTiming.CM) + return "CM"; + if (code == EventTiming.CD) + return "CD"; + if (code == EventTiming.CV) + return "CV"; + 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 String toSystem(EventTiming code) { + return code.getSystem(); + } + } + + @Block() + public static class TimingRepeatComponent extends Element implements IBaseDatatypeElement { + /** + * Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule. + */ + @Child(name = "bounds", type = {Duration.class, Range.class, Period.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Length/Range of lengths, or (Start and/or end) limits", formalDefinition="Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule." ) + protected Type bounds; + + /** + * A total count of the desired number of repetitions. + */ + @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Number of times to repeat", formalDefinition="A total count of the desired number of repetitions." ) + protected IntegerType count; + + /** + * A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). + */ + @Child(name = "countMax", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Maximum number of times to repeat", formalDefinition="A maximum value for the count of the desired repetitions (e.g. do something 6-8 times)." ) + protected IntegerType countMax; + + /** + * How long this thing happens for when it happens. + */ + @Child(name = "duration", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How long when it happens", formalDefinition="How long this thing happens for when it happens." ) + protected DecimalType duration; + + /** + * The upper limit of how long this thing happens for when it happens. + */ + @Child(name = "durationMax", type = {DecimalType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="How long when it happens (Max)", formalDefinition="The upper limit of how long this thing happens for when it happens." ) + protected DecimalType durationMax; + + /** + * The units of time for the duration, in UCUM units. + */ + @Child(name = "durationUnit", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the duration, in UCUM units." ) + protected Enumeration durationUnit; + + /** + * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). + */ + @Child(name = "frequency", type = {IntegerType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Event occurs frequency times per period", formalDefinition="The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)." ) + protected IntegerType frequency; + + /** + * If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. + */ + @Child(name = "frequencyMax", type = {IntegerType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Event occurs up to frequencyMax times per period", formalDefinition="If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range." ) + protected IntegerType frequencyMax; + + /** + * Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + */ + @Child(name = "period", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Event occurs frequency times per period", formalDefinition="Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period." ) + protected DecimalType period; + + /** + * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + */ + @Child(name = "periodMax", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Upper limit of period (3-4 hours)", formalDefinition="If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days." ) + protected DecimalType periodMax; + + /** + * The units of time for the period in UCUM units. + */ + @Child(name = "periodUnit", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the period in UCUM units." ) + protected Enumeration periodUnit; + + /** + * A real world event that the occurrence of the event should be tied to. + */ + @Child(name = "when", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Regular life events the event is tied to", formalDefinition="A real world event that the occurrence of the event should be tied to." ) + protected Enumeration when; + + /** + * The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. + */ + @Child(name = "offset", type = {UnsignedIntType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Minutes from event (before or after)", formalDefinition="The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event." ) + protected UnsignedIntType offset; + + private static final long serialVersionUID = -1317919984L; + + /** + * Constructor + */ + public TimingRepeatComponent() { + super(); + } + + /** + * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) + */ + public Type getBounds() { + return this.bounds; + } + + /** + * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) + */ + public Duration getBoundsDuration() throws FHIRException { + if (!(this.bounds instanceof Duration)) + throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.bounds.getClass().getName()+" was encountered"); + return (Duration) this.bounds; + } + + public boolean hasBoundsDuration() { + return this.bounds instanceof Duration; + } + + /** + * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) + */ + public Range getBoundsRange() throws FHIRException { + if (!(this.bounds instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.bounds.getClass().getName()+" was encountered"); + return (Range) this.bounds; + } + + public boolean hasBoundsRange() { + return this.bounds instanceof Range; + } + + /** + * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) + */ + public Period getBoundsPeriod() throws FHIRException { + if (!(this.bounds instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.bounds.getClass().getName()+" was encountered"); + return (Period) this.bounds; + } + + public boolean hasBoundsPeriod() { + return this.bounds instanceof Period; + } + + public boolean hasBounds() { + return this.bounds != null && !this.bounds.isEmpty(); + } + + /** + * @param value {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) + */ + public TimingRepeatComponent setBounds(Type value) { + this.bounds = value; + return this; + } + + /** + * @return {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public IntegerType getCountElement() { + if (this.count == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.count"); + else if (Configuration.doAutoCreate()) + this.count = new IntegerType(); // bb + return this.count; + } + + public boolean hasCountElement() { + return this.count != null && !this.count.isEmpty(); + } + + public boolean hasCount() { + return this.count != null && !this.count.isEmpty(); + } + + /** + * @param value {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public TimingRepeatComponent setCountElement(IntegerType value) { + this.count = value; + return this; + } + + /** + * @return A total count of the desired number of repetitions. + */ + public int getCount() { + return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); + } + + /** + * @param value A total count of the desired number of repetitions. + */ + public TimingRepeatComponent setCount(int value) { + if (this.count == null) + this.count = new IntegerType(); + this.count.setValue(value); + return this; + } + + /** + * @return {@link #countMax} (A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).). This is the underlying object with id, value and extensions. The accessor "getCountMax" gives direct access to the value + */ + public IntegerType getCountMaxElement() { + if (this.countMax == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.countMax"); + else if (Configuration.doAutoCreate()) + this.countMax = new IntegerType(); // bb + return this.countMax; + } + + public boolean hasCountMaxElement() { + return this.countMax != null && !this.countMax.isEmpty(); + } + + public boolean hasCountMax() { + return this.countMax != null && !this.countMax.isEmpty(); + } + + /** + * @param value {@link #countMax} (A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).). This is the underlying object with id, value and extensions. The accessor "getCountMax" gives direct access to the value + */ + public TimingRepeatComponent setCountMaxElement(IntegerType value) { + this.countMax = value; + return this; + } + + /** + * @return A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). + */ + public int getCountMax() { + return this.countMax == null || this.countMax.isEmpty() ? 0 : this.countMax.getValue(); + } + + /** + * @param value A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). + */ + public TimingRepeatComponent setCountMax(int value) { + if (this.countMax == null) + this.countMax = new IntegerType(); + this.countMax.setValue(value); + return this; + } + + /** + * @return {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public DecimalType getDurationElement() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new DecimalType(); // bb + return this.duration; + } + + public boolean hasDurationElement() { + return this.duration != null && !this.duration.isEmpty(); + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public TimingRepeatComponent setDurationElement(DecimalType value) { + this.duration = value; + return this; + } + + /** + * @return How long this thing happens for when it happens. + */ + public BigDecimal getDuration() { + return this.duration == null ? null : this.duration.getValue(); + } + + /** + * @param value How long this thing happens for when it happens. + */ + public TimingRepeatComponent setDuration(BigDecimal value) { + if (value == null) + this.duration = null; + else { + if (this.duration == null) + this.duration = new DecimalType(); + this.duration.setValue(value); + } + return this; + } + + /** + * @param value How long this thing happens for when it happens. + */ + public TimingRepeatComponent setDuration(long value) { + this.duration = new DecimalType(); + this.duration.setValue(value); + return this; + } + + /** + * @param value How long this thing happens for when it happens. + */ + public TimingRepeatComponent setDuration(double value) { + this.duration = new DecimalType(); + this.duration.setValue(value); + return this; + } + + /** + * @return {@link #durationMax} (The upper limit of how long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDurationMax" gives direct access to the value + */ + public DecimalType getDurationMaxElement() { + if (this.durationMax == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.durationMax"); + else if (Configuration.doAutoCreate()) + this.durationMax = new DecimalType(); // bb + return this.durationMax; + } + + public boolean hasDurationMaxElement() { + return this.durationMax != null && !this.durationMax.isEmpty(); + } + + public boolean hasDurationMax() { + return this.durationMax != null && !this.durationMax.isEmpty(); + } + + /** + * @param value {@link #durationMax} (The upper limit of how long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDurationMax" gives direct access to the value + */ + public TimingRepeatComponent setDurationMaxElement(DecimalType value) { + this.durationMax = value; + return this; + } + + /** + * @return The upper limit of how long this thing happens for when it happens. + */ + public BigDecimal getDurationMax() { + return this.durationMax == null ? null : this.durationMax.getValue(); + } + + /** + * @param value The upper limit of how long this thing happens for when it happens. + */ + public TimingRepeatComponent setDurationMax(BigDecimal value) { + if (value == null) + this.durationMax = null; + else { + if (this.durationMax == null) + this.durationMax = new DecimalType(); + this.durationMax.setValue(value); + } + return this; + } + + /** + * @param value The upper limit of how long this thing happens for when it happens. + */ + public TimingRepeatComponent setDurationMax(long value) { + this.durationMax = new DecimalType(); + this.durationMax.setValue(value); + return this; + } + + /** + * @param value The upper limit of how long this thing happens for when it happens. + */ + public TimingRepeatComponent setDurationMax(double value) { + this.durationMax = new DecimalType(); + this.durationMax.setValue(value); + return this; + } + + /** + * @return {@link #durationUnit} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnit" gives direct access to the value + */ + public Enumeration getDurationUnitElement() { + if (this.durationUnit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.durationUnit"); + else if (Configuration.doAutoCreate()) + this.durationUnit = new Enumeration(new UnitsOfTimeEnumFactory()); // bb + return this.durationUnit; + } + + public boolean hasDurationUnitElement() { + return this.durationUnit != null && !this.durationUnit.isEmpty(); + } + + public boolean hasDurationUnit() { + return this.durationUnit != null && !this.durationUnit.isEmpty(); + } + + /** + * @param value {@link #durationUnit} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnit" gives direct access to the value + */ + public TimingRepeatComponent setDurationUnitElement(Enumeration value) { + this.durationUnit = value; + return this; + } + + /** + * @return The units of time for the duration, in UCUM units. + */ + public UnitsOfTime getDurationUnit() { + return this.durationUnit == null ? null : this.durationUnit.getValue(); + } + + /** + * @param value The units of time for the duration, in UCUM units. + */ + public TimingRepeatComponent setDurationUnit(UnitsOfTime value) { + if (value == null) + this.durationUnit = null; + else { + if (this.durationUnit == null) + this.durationUnit = new Enumeration(new UnitsOfTimeEnumFactory()); + this.durationUnit.setValue(value); + } + return this; + } + + /** + * @return {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value + */ + public IntegerType getFrequencyElement() { + if (this.frequency == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.frequency"); + else if (Configuration.doAutoCreate()) + this.frequency = new IntegerType(); // bb + return this.frequency; + } + + public boolean hasFrequencyElement() { + return this.frequency != null && !this.frequency.isEmpty(); + } + + public boolean hasFrequency() { + return this.frequency != null && !this.frequency.isEmpty(); + } + + /** + * @param value {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value + */ + public TimingRepeatComponent setFrequencyElement(IntegerType value) { + this.frequency = value; + return this; + } + + /** + * @return The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). + */ + public int getFrequency() { + return this.frequency == null || this.frequency.isEmpty() ? 0 : this.frequency.getValue(); + } + + /** + * @param value The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). + */ + public TimingRepeatComponent setFrequency(int value) { + if (this.frequency == null) + this.frequency = new IntegerType(); + this.frequency.setValue(value); + return this; + } + + /** + * @return {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value + */ + public IntegerType getFrequencyMaxElement() { + if (this.frequencyMax == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.frequencyMax"); + else if (Configuration.doAutoCreate()) + this.frequencyMax = new IntegerType(); // bb + return this.frequencyMax; + } + + public boolean hasFrequencyMaxElement() { + return this.frequencyMax != null && !this.frequencyMax.isEmpty(); + } + + public boolean hasFrequencyMax() { + return this.frequencyMax != null && !this.frequencyMax.isEmpty(); + } + + /** + * @param value {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value + */ + public TimingRepeatComponent setFrequencyMaxElement(IntegerType value) { + this.frequencyMax = value; + return this; + } + + /** + * @return If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. + */ + public int getFrequencyMax() { + return this.frequencyMax == null || this.frequencyMax.isEmpty() ? 0 : this.frequencyMax.getValue(); + } + + /** + * @param value If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. + */ + public TimingRepeatComponent setFrequencyMax(int value) { + if (this.frequencyMax == null) + this.frequencyMax = new IntegerType(); + this.frequencyMax.setValue(value); + return this; + } + + /** + * @return {@link #period} (Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public DecimalType getPeriodElement() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new DecimalType(); // bb + return this.period; + } + + public boolean hasPeriodElement() { + return this.period != null && !this.period.isEmpty(); + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public TimingRepeatComponent setPeriodElement(DecimalType value) { + this.period = value; + return this; + } + + /** + * @return Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + */ + public BigDecimal getPeriod() { + return this.period == null ? null : this.period.getValue(); + } + + /** + * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + */ + public TimingRepeatComponent setPeriod(BigDecimal value) { + if (value == null) + this.period = null; + else { + if (this.period == null) + this.period = new DecimalType(); + this.period.setValue(value); + } + return this; + } + + /** + * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + */ + public TimingRepeatComponent setPeriod(long value) { + this.period = new DecimalType(); + this.period.setValue(value); + return this; + } + + /** + * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + */ + public TimingRepeatComponent setPeriod(double value) { + this.period = new DecimalType(); + this.period.setValue(value); + return this; + } + + /** + * @return {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value + */ + public DecimalType getPeriodMaxElement() { + if (this.periodMax == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.periodMax"); + else if (Configuration.doAutoCreate()) + this.periodMax = new DecimalType(); // bb + return this.periodMax; + } + + public boolean hasPeriodMaxElement() { + return this.periodMax != null && !this.periodMax.isEmpty(); + } + + public boolean hasPeriodMax() { + return this.periodMax != null && !this.periodMax.isEmpty(); + } + + /** + * @param value {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value + */ + public TimingRepeatComponent setPeriodMaxElement(DecimalType value) { + this.periodMax = value; + return this; + } + + /** + * @return If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + */ + public BigDecimal getPeriodMax() { + return this.periodMax == null ? null : this.periodMax.getValue(); + } + + /** + * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + */ + public TimingRepeatComponent setPeriodMax(BigDecimal value) { + if (value == null) + this.periodMax = null; + else { + if (this.periodMax == null) + this.periodMax = new DecimalType(); + this.periodMax.setValue(value); + } + return this; + } + + /** + * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + */ + public TimingRepeatComponent setPeriodMax(long value) { + this.periodMax = new DecimalType(); + this.periodMax.setValue(value); + return this; + } + + /** + * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + */ + public TimingRepeatComponent setPeriodMax(double value) { + this.periodMax = new DecimalType(); + this.periodMax.setValue(value); + return this; + } + + /** + * @return {@link #periodUnit} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnit" gives direct access to the value + */ + public Enumeration getPeriodUnitElement() { + if (this.periodUnit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.periodUnit"); + else if (Configuration.doAutoCreate()) + this.periodUnit = new Enumeration(new UnitsOfTimeEnumFactory()); // bb + return this.periodUnit; + } + + public boolean hasPeriodUnitElement() { + return this.periodUnit != null && !this.periodUnit.isEmpty(); + } + + public boolean hasPeriodUnit() { + return this.periodUnit != null && !this.periodUnit.isEmpty(); + } + + /** + * @param value {@link #periodUnit} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnit" gives direct access to the value + */ + public TimingRepeatComponent setPeriodUnitElement(Enumeration value) { + this.periodUnit = value; + return this; + } + + /** + * @return The units of time for the period in UCUM units. + */ + public UnitsOfTime getPeriodUnit() { + return this.periodUnit == null ? null : this.periodUnit.getValue(); + } + + /** + * @param value The units of time for the period in UCUM units. + */ + public TimingRepeatComponent setPeriodUnit(UnitsOfTime value) { + if (value == null) + this.periodUnit = null; + else { + if (this.periodUnit == null) + this.periodUnit = new Enumeration(new UnitsOfTimeEnumFactory()); + this.periodUnit.setValue(value); + } + return this; + } + + /** + * @return {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public Enumeration getWhenElement() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.when"); + else if (Configuration.doAutoCreate()) + this.when = new Enumeration(new EventTimingEnumFactory()); // bb + return this.when; + } + + public boolean hasWhenElement() { + return this.when != null && !this.when.isEmpty(); + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public TimingRepeatComponent setWhenElement(Enumeration value) { + this.when = value; + return this; + } + + /** + * @return A real world event that the occurrence of the event should be tied to. + */ + public EventTiming getWhen() { + return this.when == null ? null : this.when.getValue(); + } + + /** + * @param value A real world event that the occurrence of the event should be tied to. + */ + public TimingRepeatComponent setWhen(EventTiming value) { + if (value == null) + this.when = null; + else { + if (this.when == null) + this.when = new Enumeration(new EventTimingEnumFactory()); + this.when.setValue(value); + } + return this; + } + + /** + * @return {@link #offset} (The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value + */ + public UnsignedIntType getOffsetElement() { + if (this.offset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.offset"); + else if (Configuration.doAutoCreate()) + this.offset = new UnsignedIntType(); // bb + return this.offset; + } + + public boolean hasOffsetElement() { + return this.offset != null && !this.offset.isEmpty(); + } + + public boolean hasOffset() { + return this.offset != null && !this.offset.isEmpty(); + } + + /** + * @param value {@link #offset} (The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value + */ + public TimingRepeatComponent setOffsetElement(UnsignedIntType value) { + this.offset = value; + return this; + } + + /** + * @return The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. + */ + public int getOffset() { + return this.offset == null || this.offset.isEmpty() ? 0 : this.offset.getValue(); + } + + /** + * @param value The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. + */ + public TimingRepeatComponent setOffset(int value) { + if (this.offset == null) + this.offset = new UnsignedIntType(); + this.offset.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bounds[x]", "Duration|Range|Period", "Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.", 0, java.lang.Integer.MAX_VALUE, bounds)); + 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("countMax", "integer", "A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).", 0, java.lang.Integer.MAX_VALUE, countMax)); + childrenList.add(new Property("duration", "decimal", "How long this thing happens for when it happens.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("durationMax", "decimal", "The upper limit of how long this thing happens for when it happens.", 0, java.lang.Integer.MAX_VALUE, durationMax)); + childrenList.add(new Property("durationUnit", "code", "The units of time for the duration, in UCUM units.", 0, java.lang.Integer.MAX_VALUE, durationUnit)); + childrenList.add(new Property("frequency", "integer", "The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).", 0, java.lang.Integer.MAX_VALUE, frequency)); + childrenList.add(new Property("frequencyMax", "integer", "If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.", 0, java.lang.Integer.MAX_VALUE, frequencyMax)); + childrenList.add(new Property("period", "decimal", "Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("periodMax", "decimal", "If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days.", 0, java.lang.Integer.MAX_VALUE, periodMax)); + childrenList.add(new Property("periodUnit", "code", "The units of time for the period in UCUM units.", 0, java.lang.Integer.MAX_VALUE, periodUnit)); + childrenList.add(new Property("when", "code", "A real world event that the occurrence of the event should be tied to.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("offset", "unsignedInt", "The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.", 0, java.lang.Integer.MAX_VALUE, offset)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1383205195: /*bounds*/ return this.bounds == null ? new Base[0] : new Base[] {this.bounds}; // Type + case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType + case -372044331: /*countMax*/ return this.countMax == null ? new Base[0] : new Base[] {this.countMax}; // IntegerType + case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // DecimalType + case -478083280: /*durationMax*/ return this.durationMax == null ? new Base[0] : new Base[] {this.durationMax}; // DecimalType + case -1935429320: /*durationUnit*/ return this.durationUnit == null ? new Base[0] : new Base[] {this.durationUnit}; // Enumeration + case -70023844: /*frequency*/ return this.frequency == null ? new Base[0] : new Base[] {this.frequency}; // IntegerType + case 1273846376: /*frequencyMax*/ return this.frequencyMax == null ? new Base[0] : new Base[] {this.frequencyMax}; // IntegerType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType + case 566580195: /*periodMax*/ return this.periodMax == null ? new Base[0] : new Base[] {this.periodMax}; // DecimalType + case 384367333: /*periodUnit*/ return this.periodUnit == null ? new Base[0] : new Base[] {this.periodUnit}; // Enumeration + case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // Enumeration + case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // UnsignedIntType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1383205195: // bounds + this.bounds = (Type) value; // Type + break; + case 94851343: // count + this.count = castToInteger(value); // IntegerType + break; + case -372044331: // countMax + this.countMax = castToInteger(value); // IntegerType + break; + case -1992012396: // duration + this.duration = castToDecimal(value); // DecimalType + break; + case -478083280: // durationMax + this.durationMax = castToDecimal(value); // DecimalType + break; + case -1935429320: // durationUnit + this.durationUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration + break; + case -70023844: // frequency + this.frequency = castToInteger(value); // IntegerType + break; + case 1273846376: // frequencyMax + this.frequencyMax = castToInteger(value); // IntegerType + break; + case -991726143: // period + this.period = castToDecimal(value); // DecimalType + break; + case 566580195: // periodMax + this.periodMax = castToDecimal(value); // DecimalType + break; + case 384367333: // periodUnit + this.periodUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration + break; + case 3648314: // when + this.when = new EventTimingEnumFactory().fromType(value); // Enumeration + break; + case -1019779949: // offset + this.offset = castToUnsignedInt(value); // UnsignedIntType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("bounds[x]")) + this.bounds = (Type) value; // Type + else if (name.equals("count")) + this.count = castToInteger(value); // IntegerType + else if (name.equals("countMax")) + this.countMax = castToInteger(value); // IntegerType + else if (name.equals("duration")) + this.duration = castToDecimal(value); // DecimalType + else if (name.equals("durationMax")) + this.durationMax = castToDecimal(value); // DecimalType + else if (name.equals("durationUnit")) + this.durationUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration + else if (name.equals("frequency")) + this.frequency = castToInteger(value); // IntegerType + else if (name.equals("frequencyMax")) + this.frequencyMax = castToInteger(value); // IntegerType + else if (name.equals("period")) + this.period = castToDecimal(value); // DecimalType + else if (name.equals("periodMax")) + this.periodMax = castToDecimal(value); // DecimalType + else if (name.equals("periodUnit")) + this.periodUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration + else if (name.equals("when")) + this.when = new EventTimingEnumFactory().fromType(value); // Enumeration + else if (name.equals("offset")) + this.offset = castToUnsignedInt(value); // UnsignedIntType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1149635157: return getBounds(); // Type + case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType + case -372044331: throw new FHIRException("Cannot make property countMax as it is not a complex type"); // IntegerType + case -1992012396: throw new FHIRException("Cannot make property duration as it is not a complex type"); // DecimalType + case -478083280: throw new FHIRException("Cannot make property durationMax as it is not a complex type"); // DecimalType + case -1935429320: throw new FHIRException("Cannot make property durationUnit as it is not a complex type"); // Enumeration + case -70023844: throw new FHIRException("Cannot make property frequency as it is not a complex type"); // IntegerType + case 1273846376: throw new FHIRException("Cannot make property frequencyMax as it is not a complex type"); // IntegerType + case -991726143: throw new FHIRException("Cannot make property period as it is not a complex type"); // DecimalType + case 566580195: throw new FHIRException("Cannot make property periodMax as it is not a complex type"); // DecimalType + case 384367333: throw new FHIRException("Cannot make property periodUnit as it is not a complex type"); // Enumeration + case 3648314: throw new FHIRException("Cannot make property when as it is not a complex type"); // Enumeration + case -1019779949: throw new FHIRException("Cannot make property offset as it is not a complex type"); // UnsignedIntType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("boundsDuration")) { + this.bounds = new Duration(); + return this.bounds; + } + else if (name.equals("boundsRange")) { + this.bounds = new Range(); + return this.bounds; + } + else if (name.equals("boundsPeriod")) { + this.bounds = new Period(); + return this.bounds; + } + else if (name.equals("count")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.count"); + } + else if (name.equals("countMax")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.countMax"); + } + else if (name.equals("duration")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.duration"); + } + else if (name.equals("durationMax")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.durationMax"); + } + else if (name.equals("durationUnit")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.durationUnit"); + } + else if (name.equals("frequency")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.frequency"); + } + else if (name.equals("frequencyMax")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.frequencyMax"); + } + else if (name.equals("period")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.period"); + } + else if (name.equals("periodMax")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.periodMax"); + } + else if (name.equals("periodUnit")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.periodUnit"); + } + else if (name.equals("when")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.when"); + } + else if (name.equals("offset")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.offset"); + } + else + return super.addChild(name); + } + + public TimingRepeatComponent copy() { + TimingRepeatComponent dst = new TimingRepeatComponent(); + copyValues(dst); + dst.bounds = bounds == null ? null : bounds.copy(); + dst.count = count == null ? null : count.copy(); + dst.countMax = countMax == null ? null : countMax.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.durationMax = durationMax == null ? null : durationMax.copy(); + dst.durationUnit = durationUnit == null ? null : durationUnit.copy(); + dst.frequency = frequency == null ? null : frequency.copy(); + dst.frequencyMax = frequencyMax == null ? null : frequencyMax.copy(); + dst.period = period == null ? null : period.copy(); + dst.periodMax = periodMax == null ? null : periodMax.copy(); + dst.periodUnit = periodUnit == null ? null : periodUnit.copy(); + dst.when = when == null ? null : when.copy(); + dst.offset = offset == null ? null : offset.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TimingRepeatComponent)) + return false; + TimingRepeatComponent o = (TimingRepeatComponent) other; + return compareDeep(bounds, o.bounds, true) && compareDeep(count, o.count, true) && compareDeep(countMax, o.countMax, true) + && compareDeep(duration, o.duration, true) && compareDeep(durationMax, o.durationMax, true) && compareDeep(durationUnit, o.durationUnit, true) + && compareDeep(frequency, o.frequency, true) && compareDeep(frequencyMax, o.frequencyMax, true) + && compareDeep(period, o.period, true) && compareDeep(periodMax, o.periodMax, true) && compareDeep(periodUnit, o.periodUnit, true) + && compareDeep(when, o.when, true) && compareDeep(offset, o.offset, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TimingRepeatComponent)) + return false; + TimingRepeatComponent o = (TimingRepeatComponent) other; + return compareValues(count, o.count, true) && compareValues(countMax, o.countMax, true) && compareValues(duration, o.duration, true) + && compareValues(durationMax, o.durationMax, true) && compareValues(durationUnit, o.durationUnit, true) + && compareValues(frequency, o.frequency, true) && compareValues(frequencyMax, o.frequencyMax, true) + && compareValues(period, o.period, true) && compareValues(periodMax, o.periodMax, true) && compareValues(periodUnit, o.periodUnit, true) + && compareValues(when, o.when, true) && compareValues(offset, o.offset, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (bounds == null || bounds.isEmpty()) && (count == null || count.isEmpty()) + && (countMax == null || countMax.isEmpty()) && (duration == null || duration.isEmpty()) && (durationMax == null || durationMax.isEmpty()) + && (durationUnit == null || durationUnit.isEmpty()) && (frequency == null || frequency.isEmpty()) + && (frequencyMax == null || frequencyMax.isEmpty()) && (period == null || period.isEmpty()) + && (periodMax == null || periodMax.isEmpty()) && (periodUnit == null || periodUnit.isEmpty()) + && (when == null || when.isEmpty()) && (offset == null || offset.isEmpty()); + } + + public String fhirType() { + return "Timing.repeat"; + + } + + } + + /** + * Identifies specific times when the event occurs. + */ + @Child(name = "event", type = {DateTimeType.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="When the event occurs", formalDefinition="Identifies specific times when the event occurs." ) + protected List event; + + /** + * A set of rules that describe when the event should occur. + */ + @Child(name = "repeat", type = {}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the event is to occur", formalDefinition="A set of rules that describe when the event should occur." ) + protected TimingRepeatComponent repeat; + + /** + * A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="QD | QOD | Q4H | Q6H | BID | TID | QID | AM | PM +", formalDefinition="A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing." ) + protected CodeableConcept code; + + private static final long serialVersionUID = 791565112L; + + /** + * Constructor + */ + public Timing() { + super(); + } + + /** + * @return {@link #event} (Identifies specific times when the event occurs.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (DateTimeType item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (Identifies specific times when the event occurs.) + */ + // syntactic sugar + public DateTimeType addEventElement() {//2 + DateTimeType t = new DateTimeType(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + /** + * @param value {@link #event} (Identifies specific times when the event occurs.) + */ + public Timing addEvent(Date value) { //1 + DateTimeType t = new DateTimeType(); + t.setValue(value); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return this; + } + + /** + * @param value {@link #event} (Identifies specific times when the event occurs.) + */ + public boolean hasEvent(Date value) { + if (this.event == null) + return false; + for (DateTimeType v : this.event) + if (v.equals(value)) // dateTime + return true; + return false; + } + + /** + * @return {@link #repeat} (A set of rules that describe when the event should occur.) + */ + public TimingRepeatComponent getRepeat() { + if (this.repeat == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Timing.repeat"); + else if (Configuration.doAutoCreate()) + this.repeat = new TimingRepeatComponent(); // cc + return this.repeat; + } + + public boolean hasRepeat() { + return this.repeat != null && !this.repeat.isEmpty(); + } + + /** + * @param value {@link #repeat} (A set of rules that describe when the event should occur.) + */ + public Timing setRepeat(TimingRepeatComponent value) { + this.repeat = value; + return this; + } + + /** + * @return {@link #code} (A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Timing.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.) + */ + public Timing setCode(CodeableConcept value) { + this.code = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("event", "dateTime", "Identifies specific times when the event occurs.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("repeat", "", "A set of rules that describe when the event should occur.", 0, java.lang.Integer.MAX_VALUE, repeat)); + childrenList.add(new Property("code", "CodeableConcept", "A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // DateTimeType + case -934531685: /*repeat*/ return this.repeat == null ? new Base[0] : new Base[] {this.repeat}; // TimingRepeatComponent + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 96891546: // event + this.getEvent().add(castToDateTime(value)); // DateTimeType + break; + case -934531685: // repeat + this.repeat = (TimingRepeatComponent) value; // TimingRepeatComponent + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("event")) + this.getEvent().add(castToDateTime(value)); + else if (name.equals("repeat")) + this.repeat = (TimingRepeatComponent) value; // TimingRepeatComponent + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 96891546: throw new FHIRException("Cannot make property event as it is not a complex type"); // DateTimeType + case -934531685: return getRepeat(); // TimingRepeatComponent + case 3059181: return getCode(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("event")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.event"); + } + else if (name.equals("repeat")) { + this.repeat = new TimingRepeatComponent(); + return this.repeat; + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "Timing"; + + } + + public Timing copy() { + Timing dst = new Timing(); + copyValues(dst); + if (event != null) { + dst.event = new ArrayList(); + for (DateTimeType i : event) + dst.event.add(i.copy()); + }; + dst.repeat = repeat == null ? null : repeat.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Timing typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof Timing)) + return false; + Timing o = (Timing) other; + return compareDeep(event, o.event, true) && compareDeep(repeat, o.repeat, true) && compareDeep(code, o.code, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof Timing)) + return false; + Timing o = (Timing) other; + return compareValues(event, o.event, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (event == null || event.isEmpty()) && (repeat == null || repeat.isEmpty()) + && (code == null || code.isEmpty()); + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TriggerDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TriggerDefinition.java new file mode 100644 index 00000000000..cd17c4b4f53 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/TriggerDefinition.java @@ -0,0 +1,595 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +/** + * A description of a triggering event. + */ +@DatatypeDef(name="TriggerDefinition") +public class TriggerDefinition extends Type implements ICompositeType { + + public enum TriggerType { + /** + * The trigger occurs in response to a specific named event + */ + NAMEDEVENT, + /** + * The trigger occurs at a specific time or periodically as described by a timing or schedule + */ + PERIODIC, + /** + * The trigger occurs whenever data of a particular type is added + */ + DATAADDED, + /** + * The trigger occurs whenever data of a particular type is modified + */ + DATAMODIFIED, + /** + * The trigger occurs whenever data of a particular type is removed + */ + DATAREMOVED, + /** + * The trigger occurs whenever data of a particular type is accessed + */ + DATAACCESSED, + /** + * The trigger occurs whenever access to data of a particular type is completed + */ + DATAACCESSENDED, + /** + * added to help the parsers + */ + NULL; + public static TriggerType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("named-event".equals(codeString)) + return NAMEDEVENT; + if ("periodic".equals(codeString)) + return PERIODIC; + if ("data-added".equals(codeString)) + return DATAADDED; + if ("data-modified".equals(codeString)) + return DATAMODIFIED; + if ("data-removed".equals(codeString)) + return DATAREMOVED; + if ("data-accessed".equals(codeString)) + return DATAACCESSED; + if ("data-access-ended".equals(codeString)) + return DATAACCESSENDED; + throw new FHIRException("Unknown TriggerType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NAMEDEVENT: return "named-event"; + case PERIODIC: return "periodic"; + case DATAADDED: return "data-added"; + case DATAMODIFIED: return "data-modified"; + case DATAREMOVED: return "data-removed"; + case DATAACCESSED: return "data-accessed"; + case DATAACCESSENDED: return "data-access-ended"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NAMEDEVENT: return "http://hl7.org/fhir/trigger-type"; + case PERIODIC: return "http://hl7.org/fhir/trigger-type"; + case DATAADDED: return "http://hl7.org/fhir/trigger-type"; + case DATAMODIFIED: return "http://hl7.org/fhir/trigger-type"; + case DATAREMOVED: return "http://hl7.org/fhir/trigger-type"; + case DATAACCESSED: return "http://hl7.org/fhir/trigger-type"; + case DATAACCESSENDED: return "http://hl7.org/fhir/trigger-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NAMEDEVENT: return "The trigger occurs in response to a specific named event"; + case PERIODIC: return "The trigger occurs at a specific time or periodically as described by a timing or schedule"; + case DATAADDED: return "The trigger occurs whenever data of a particular type is added"; + case DATAMODIFIED: return "The trigger occurs whenever data of a particular type is modified"; + case DATAREMOVED: return "The trigger occurs whenever data of a particular type is removed"; + case DATAACCESSED: return "The trigger occurs whenever data of a particular type is accessed"; + case DATAACCESSENDED: return "The trigger occurs whenever access to data of a particular type is completed"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NAMEDEVENT: return "Named Event"; + case PERIODIC: return "Periodic"; + case DATAADDED: return "Data Added"; + case DATAMODIFIED: return "Data Modified"; + case DATAREMOVED: return "Data Removed"; + case DATAACCESSED: return "Data Accessed"; + case DATAACCESSENDED: return "Data Access Ended"; + default: return "?"; + } + } + } + + public static class TriggerTypeEnumFactory implements EnumFactory { + public TriggerType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("named-event".equals(codeString)) + return TriggerType.NAMEDEVENT; + if ("periodic".equals(codeString)) + return TriggerType.PERIODIC; + if ("data-added".equals(codeString)) + return TriggerType.DATAADDED; + if ("data-modified".equals(codeString)) + return TriggerType.DATAMODIFIED; + if ("data-removed".equals(codeString)) + return TriggerType.DATAREMOVED; + if ("data-accessed".equals(codeString)) + return TriggerType.DATAACCESSED; + if ("data-access-ended".equals(codeString)) + return TriggerType.DATAACCESSENDED; + throw new IllegalArgumentException("Unknown TriggerType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("named-event".equals(codeString)) + return new Enumeration(this, TriggerType.NAMEDEVENT); + if ("periodic".equals(codeString)) + return new Enumeration(this, TriggerType.PERIODIC); + if ("data-added".equals(codeString)) + return new Enumeration(this, TriggerType.DATAADDED); + if ("data-modified".equals(codeString)) + return new Enumeration(this, TriggerType.DATAMODIFIED); + if ("data-removed".equals(codeString)) + return new Enumeration(this, TriggerType.DATAREMOVED); + if ("data-accessed".equals(codeString)) + return new Enumeration(this, TriggerType.DATAACCESSED); + if ("data-access-ended".equals(codeString)) + return new Enumeration(this, TriggerType.DATAACCESSENDED); + throw new FHIRException("Unknown TriggerType code '"+codeString+"'"); + } + public String toCode(TriggerType code) { + if (code == TriggerType.NAMEDEVENT) + return "named-event"; + if (code == TriggerType.PERIODIC) + return "periodic"; + if (code == TriggerType.DATAADDED) + return "data-added"; + if (code == TriggerType.DATAMODIFIED) + return "data-modified"; + if (code == TriggerType.DATAREMOVED) + return "data-removed"; + if (code == TriggerType.DATAACCESSED) + return "data-accessed"; + if (code == TriggerType.DATAACCESSENDED) + return "data-access-ended"; + return "?"; + } + public String toSystem(TriggerType code) { + return code.getSystem(); + } + } + + /** + * The type of triggering event. + */ + @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="named-event | periodic | data-added | data-modified | data-removed | data-accessed | data-access-ended", formalDefinition="The type of triggering event." ) + protected Enumeration type; + + /** + * The name of the event (if this is a named-event trigger). + */ + @Child(name = "eventName", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the event", formalDefinition="The name of the event (if this is a named-event trigger)." ) + protected StringType eventName; + + /** + * The timing of the event (if this is a period trigger). + */ + @Child(name = "eventTiming", type = {Timing.class, Schedule.class, DateType.class, DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Timing of the event", formalDefinition="The timing of the event (if this is a period trigger)." ) + protected Type eventTiming; + + /** + * The triggering data of the event (if this is a data trigger). + */ + @Child(name = "eventData", type = {DataRequirement.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Triggering data of the event", formalDefinition="The triggering data of the event (if this is a data trigger)." ) + protected DataRequirement eventData; + + private static final long serialVersionUID = -1695534864L; + + /** + * Constructor + */ + public TriggerDefinition() { + super(); + } + + /** + * Constructor + */ + public TriggerDefinition(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The type of triggering event.). 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 TriggerDefinition.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new TriggerTypeEnumFactory()); // bb + 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 of triggering event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public TriggerDefinition setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of triggering event. + */ + public TriggerType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of triggering event. + */ + public TriggerDefinition setType(TriggerType value) { + if (this.type == null) + this.type = new Enumeration(new TriggerTypeEnumFactory()); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #eventName} (The name of the event (if this is a named-event trigger).). This is the underlying object with id, value and extensions. The accessor "getEventName" gives direct access to the value + */ + public StringType getEventNameElement() { + if (this.eventName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TriggerDefinition.eventName"); + else if (Configuration.doAutoCreate()) + this.eventName = new StringType(); // bb + return this.eventName; + } + + public boolean hasEventNameElement() { + return this.eventName != null && !this.eventName.isEmpty(); + } + + public boolean hasEventName() { + return this.eventName != null && !this.eventName.isEmpty(); + } + + /** + * @param value {@link #eventName} (The name of the event (if this is a named-event trigger).). This is the underlying object with id, value and extensions. The accessor "getEventName" gives direct access to the value + */ + public TriggerDefinition setEventNameElement(StringType value) { + this.eventName = value; + return this; + } + + /** + * @return The name of the event (if this is a named-event trigger). + */ + public String getEventName() { + return this.eventName == null ? null : this.eventName.getValue(); + } + + /** + * @param value The name of the event (if this is a named-event trigger). + */ + public TriggerDefinition setEventName(String value) { + if (Utilities.noString(value)) + this.eventName = null; + else { + if (this.eventName == null) + this.eventName = new StringType(); + this.eventName.setValue(value); + } + return this; + } + + /** + * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) + */ + public Type getEventTiming() { + return this.eventTiming; + } + + /** + * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) + */ + public Timing getEventTimingTiming() throws FHIRException { + if (!(this.eventTiming instanceof Timing)) + throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); + return (Timing) this.eventTiming; + } + + public boolean hasEventTimingTiming() { + return this.eventTiming instanceof Timing; + } + + /** + * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) + */ + public Reference getEventTimingReference() throws FHIRException { + if (!(this.eventTiming instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); + return (Reference) this.eventTiming; + } + + public boolean hasEventTimingReference() { + return this.eventTiming instanceof Reference; + } + + /** + * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) + */ + public DateType getEventTimingDateType() throws FHIRException { + if (!(this.eventTiming instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); + return (DateType) this.eventTiming; + } + + public boolean hasEventTimingDateType() { + return this.eventTiming instanceof DateType; + } + + /** + * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) + */ + public DateTimeType getEventTimingDateTimeType() throws FHIRException { + if (!(this.eventTiming instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); + return (DateTimeType) this.eventTiming; + } + + public boolean hasEventTimingDateTimeType() { + return this.eventTiming instanceof DateTimeType; + } + + public boolean hasEventTiming() { + return this.eventTiming != null && !this.eventTiming.isEmpty(); + } + + /** + * @param value {@link #eventTiming} (The timing of the event (if this is a period trigger).) + */ + public TriggerDefinition setEventTiming(Type value) { + this.eventTiming = value; + return this; + } + + /** + * @return {@link #eventData} (The triggering data of the event (if this is a data trigger).) + */ + public DataRequirement getEventData() { + if (this.eventData == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TriggerDefinition.eventData"); + else if (Configuration.doAutoCreate()) + this.eventData = new DataRequirement(); // cc + return this.eventData; + } + + public boolean hasEventData() { + return this.eventData != null && !this.eventData.isEmpty(); + } + + /** + * @param value {@link #eventData} (The triggering data of the event (if this is a data trigger).) + */ + public TriggerDefinition setEventData(DataRequirement value) { + this.eventData = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The type of triggering event.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("eventName", "string", "The name of the event (if this is a named-event trigger).", 0, java.lang.Integer.MAX_VALUE, eventName)); + childrenList.add(new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, java.lang.Integer.MAX_VALUE, eventTiming)); + childrenList.add(new Property("eventData", "DataRequirement", "The triggering data of the event (if this is a data trigger).", 0, java.lang.Integer.MAX_VALUE, eventData)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 31228997: /*eventName*/ return this.eventName == null ? new Base[0] : new Base[] {this.eventName}; // StringType + case 125465476: /*eventTiming*/ return this.eventTiming == null ? new Base[0] : new Base[] {this.eventTiming}; // Type + case 30931300: /*eventData*/ return this.eventData == null ? new Base[0] : new Base[] {this.eventData}; // DataRequirement + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3575610: // type + this.type = new TriggerTypeEnumFactory().fromType(value); // Enumeration + break; + case 31228997: // eventName + this.eventName = castToString(value); // StringType + break; + case 125465476: // eventTiming + this.eventTiming = (Type) value; // Type + break; + case 30931300: // eventData + this.eventData = castToDataRequirement(value); // DataRequirement + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("type")) + this.type = new TriggerTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("eventName")) + this.eventName = castToString(value); // StringType + else if (name.equals("eventTiming[x]")) + this.eventTiming = (Type) value; // Type + else if (name.equals("eventData")) + this.eventData = castToDataRequirement(value); // DataRequirement + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 31228997: throw new FHIRException("Cannot make property eventName as it is not a complex type"); // StringType + case 1120539260: return getEventTiming(); // Type + case 30931300: return getEventData(); // DataRequirement + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type TriggerDefinition.type"); + } + else if (name.equals("eventName")) { + throw new FHIRException("Cannot call addChild on a primitive type TriggerDefinition.eventName"); + } + else if (name.equals("eventTimingTiming")) { + this.eventTiming = new Timing(); + return this.eventTiming; + } + else if (name.equals("eventTimingReference")) { + this.eventTiming = new Reference(); + return this.eventTiming; + } + else if (name.equals("eventTimingDate")) { + this.eventTiming = new DateType(); + return this.eventTiming; + } + else if (name.equals("eventTimingDateTime")) { + this.eventTiming = new DateTimeType(); + return this.eventTiming; + } + else if (name.equals("eventData")) { + this.eventData = new DataRequirement(); + return this.eventData; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "TriggerDefinition"; + + } + + public TriggerDefinition copy() { + TriggerDefinition dst = new TriggerDefinition(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.eventName = eventName == null ? null : eventName.copy(); + dst.eventTiming = eventTiming == null ? null : eventTiming.copy(); + dst.eventData = eventData == null ? null : eventData.copy(); + return dst; + } + + protected TriggerDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TriggerDefinition)) + return false; + TriggerDefinition o = (TriggerDefinition) other; + return compareDeep(type, o.type, true) && compareDeep(eventName, o.eventName, true) && compareDeep(eventTiming, o.eventTiming, true) + && compareDeep(eventData, o.eventData, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TriggerDefinition)) + return false; + TriggerDefinition o = (TriggerDefinition) other; + return compareValues(type, o.type, true) && compareValues(eventName, o.eventName, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (eventName == null || eventName.isEmpty()) + && (eventTiming == null || eventTiming.isEmpty()) && (eventData == null || eventData.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Type.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Type.java new file mode 100644 index 00000000000..500d639083e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Type.java @@ -0,0 +1,47 @@ +/* +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. + + */ +package org.hl7.fhir.dstu2016may.model; + +import org.hl7.fhir.instance.model.api.IBaseDatatype; + +import ca.uhn.fhir.model.api.IElement; + +/** + * An element that is a type. Used when the element type in FHIR is a choice of more than one data type + */ +public abstract class Type extends Element implements IBaseDatatype, IElement { + + private static final long serialVersionUID = 4623040030733049991L; + + public Type copy() { + return typedCopy(); + } + + protected abstract Type typedCopy(); +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UnsignedIntType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UnsignedIntType.java new file mode 100644 index 00000000000..15e90d790a4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UnsignedIntType.java @@ -0,0 +1,98 @@ +/* +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. + + */ +/** + * + */ +package org.hl7.fhir.dstu2016may.model; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * Primitive type "integer" in FHIR: A signed 32-bit integer + */ +@DatatypeDef(name = "unsignedInt", profileOf=IntegerType.class) +public class UnsignedIntType extends IntegerType { + + + /** + * + */ + private static final long serialVersionUID = -7991875974606711355L; + + /** + * Constructor + */ + public UnsignedIntType() { + // nothing + } + + /** + * Constructor + */ + public UnsignedIntType(int theInteger) { + setValue(theInteger); + } + + /** + * Constructor + * + * @param theIntegerAsString + * A string representation of an integer + * @throws IllegalArgumentException + * If the string is not a valid integer representation + */ + public UnsignedIntType(String theIntegerAsString) { + setValueAsString(theIntegerAsString); + } + + /** + * Constructor + * + * @param theValue The value + * @throws IllegalArgumentException If the value is too large to fit in a signed integer + */ + public UnsignedIntType(Long theValue) { + if (theValue < 0 || 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()); + } + } + + @Override + public UnsignedIntType copy() { + return new UnsignedIntType(getValue()); + } + + public String fhirType() { + return "unsignedInt"; + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UriType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UriType.java new file mode 100644 index 00000000000..6ebb6ca3374 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UriType.java @@ -0,0 +1,163 @@ +/* +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. + +*/ +package org.hl7.fhir.dstu2016may.model; + +import java.net.URI; +import java.net.URISyntaxException; + +import org.apache.commons.lang3.StringUtils; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/** + * 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 { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public UriType() { + // nothing + } + + /** + * Constructor + */ + public UriType(String theValue) { + setValueAsString(theValue); + } + + /** + * Constructor + */ + public UriType(URI theValue) { + setValue(theValue.toString()); + } + + @Override + public UriType copy() { + return new UriType(getValue()); + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + /** + * Compares the given string to the string representation of this URI. In many cases it is preferable to use this + * instead of the standard {@link #equals(Object)} method, since that method returns false unless it is + * passed an instance of {@link UriType} + */ + public boolean equals(String theString) { + return StringUtils.equals(getValueAsString(), theString); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + + String normalize = normalize(getValue()); + result = prime * result + ((normalize == null) ? 0 : normalize.hashCode()); + + return result; + } + + private String normalize(String theValue) { + if (theValue == null) { + return null; + } + 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)); + } + return retVal.toASCIIString(); + } catch (URISyntaxException e) { + // ourLog.debug("Failed to normalize URL '{}', message was: {}", urlString, e.toString()); + return theValue; + } + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + /** + * 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 OidType fromOid(String theOid) { + if (theOid == null) { + return new OidType(); + } + return new OidType("urn:oid:" + theOid); + } + + @Override + public boolean equalsDeep(Base obj) { + if (!super.equalsDeep(obj)) + return false; + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + + UriType other = (UriType) obj; + if (getValue() == null && other.getValue() == null) { + return true; + } + if (getValue() == null || other.getValue() == null) { + return false; + } + + String normalize = normalize(getValue()); + String normalize2 = normalize(other.getValue()); + return normalize.equals(normalize2); + } + + public String fhirType() { + return "uri"; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UuidType.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UuidType.java new file mode 100644 index 00000000000..a47cb6d1f65 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/UuidType.java @@ -0,0 +1,70 @@ +/* +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. + +*/ +package org.hl7.fhir.dstu2016may.model; + +import java.net.URI; + +public class UuidType extends UriType { + + private static final long serialVersionUID = 3L; + + /** + * Constructor + */ + public UuidType() { + super(); + } + + /** + * Constructor + */ + public UuidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public UuidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public UuidType copy() { + return new UuidType(getValue()); + } + + public String fhirType() { + return "uuid"; + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ValueSet.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ValueSet.java new file mode 100644 index 00000000000..34a8adb19dd --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/ValueSet.java @@ -0,0 +1,4674 @@ +package org.hl7.fhir.dstu2016may.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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * A value set specifies a set of codes drawn from one or more code systems. + */ +@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/Profile/ValueSet") +public class ValueSet extends DomainResource { + + public enum FilterOperator { + /** + * The specified property of the code equals the provided value. + */ + EQUAL, + /** + * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself. + */ + ISA, + /** + * The specified property of the code does not have an is-a relationship with the provided value. + */ + ISNOTA, + /** + * The specified property of the code matches the regex specified in the provided value. + */ + REGEX, + /** + * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list). + */ + IN, + /** + * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list). + */ + NOTIN, + /** + * added to help the parsers + */ + NULL; + public static FilterOperator fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("=".equals(codeString)) + return EQUAL; + if ("is-a".equals(codeString)) + return ISA; + if ("is-not-a".equals(codeString)) + return ISNOTA; + if ("regex".equals(codeString)) + return REGEX; + if ("in".equals(codeString)) + return IN; + if ("not-in".equals(codeString)) + return NOTIN; + throw new FHIRException("Unknown FilterOperator code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case EQUAL: return "="; + case ISA: return "is-a"; + case ISNOTA: return "is-not-a"; + case REGEX: return "regex"; + case IN: return "in"; + case NOTIN: return "not-in"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EQUAL: return "http://hl7.org/fhir/filter-operator"; + case ISA: return "http://hl7.org/fhir/filter-operator"; + case ISNOTA: return "http://hl7.org/fhir/filter-operator"; + case REGEX: return "http://hl7.org/fhir/filter-operator"; + case IN: return "http://hl7.org/fhir/filter-operator"; + case NOTIN: return "http://hl7.org/fhir/filter-operator"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case EQUAL: return "The specified property of the code equals the provided value."; + case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself."; + case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; + case REGEX: return "The specified property of the code matches the regex specified in the provided value."; + case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; + case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case EQUAL: return "Equals"; + case ISA: return "Is A (by subsumption)"; + case ISNOTA: return "Not (Is A) (by subsumption)"; + case REGEX: return "Regular Expression"; + case IN: return "In Set"; + case NOTIN: return "Not in Set"; + default: return "?"; + } + } + } + + 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; + if ("=".equals(codeString)) + return FilterOperator.EQUAL; + if ("is-a".equals(codeString)) + return FilterOperator.ISA; + if ("is-not-a".equals(codeString)) + return FilterOperator.ISNOTA; + if ("regex".equals(codeString)) + return FilterOperator.REGEX; + if ("in".equals(codeString)) + return FilterOperator.IN; + if ("not-in".equals(codeString)) + return FilterOperator.NOTIN; + throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("=".equals(codeString)) + return new Enumeration(this, FilterOperator.EQUAL); + if ("is-a".equals(codeString)) + return new Enumeration(this, FilterOperator.ISA); + if ("is-not-a".equals(codeString)) + return new Enumeration(this, FilterOperator.ISNOTA); + if ("regex".equals(codeString)) + return new Enumeration(this, FilterOperator.REGEX); + if ("in".equals(codeString)) + return new Enumeration(this, FilterOperator.IN); + if ("not-in".equals(codeString)) + return new Enumeration(this, FilterOperator.NOTIN); + throw new FHIRException("Unknown FilterOperator code '"+codeString+"'"); + } + public String toCode(FilterOperator code) { + if (code == FilterOperator.EQUAL) + return "="; + if (code == FilterOperator.ISA) + return "is-a"; + if (code == FilterOperator.ISNOTA) + return "is-not-a"; + if (code == FilterOperator.REGEX) + return "regex"; + if (code == FilterOperator.IN) + return "in"; + if (code == FilterOperator.NOTIN) + return "not-in"; + return "?"; + } + public String toSystem(FilterOperator code) { + return code.getSystem(); + } + } + + @Block() + public static class ValueSetContactComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of an individual to contact regarding the value set. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the value set." ) + protected StringType name; + + /** + * Contact details for individual (if a name was provided) or the publisher. + */ + @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) + protected List telecom; + + private static final long serialVersionUID = -1179697803L; + + /** + * Constructor + */ + public ValueSetContactComponent() { + super(); + } + + /** + * @return {@link #name} (The name of an individual to contact regarding the value set.). 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 ValueSetContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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 an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ValueSetContactComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of an individual to contact regarding the value set. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of an individual to contact regarding the value set. + */ + public ValueSetContactComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) + */ + 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} (Contact details for individual (if a name was provided) or the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + // syntactic sugar + public ValueSetContactComponent addTelecom(ContactPoint t) { //3 + if (t == null) + return this; + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the value set.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -1429363305: // telecom + this.getTelecom().add(castToContactPoint(value)); // ContactPoint + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("telecom")) + this.getTelecom().add(castToContactPoint(value)); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1429363305: return addTelecom(); // ContactPoint + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name"); + } + else if (name.equals("telecom")) { + return addTelecom(); + } + else + return super.addChild(name); + } + + public ValueSetContactComponent copy() { + ValueSetContactComponent dst = new ValueSetContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetContactComponent)) + return false; + ValueSetContactComponent o = (ValueSetContactComponent) other; + return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetContactComponent)) + return false; + ValueSetContactComponent o = (ValueSetContactComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + public String fhirType() { + return "ValueSet.contact"; + + } + + } + + @Block() + public static class ValueSetComposeComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri. + */ + @Child(name = "import", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Import the contents of another value set", formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri." ) + protected List import_; + + /** + * Include one or more codes from a code system. + */ + @Child(name = "include", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Include one or more codes from a code system", formalDefinition="Include one or more codes from a code system." ) + protected List include; + + /** + * Exclude one or more codes from the value set. + */ + @Child(name = "exclude", type = {ConceptSetComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Explicitly exclude codes", formalDefinition="Exclude one or more codes from the value set." ) + protected List exclude; + + private static final long serialVersionUID = -703166694L; + + /** + * Constructor + */ + public ValueSetComposeComponent() { + super(); + } + + /** + * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) + */ + public List getImport() { + if (this.import_ == null) + this.import_ = new ArrayList(); + return this.import_; + } + + public boolean hasImport() { + if (this.import_ == null) + return false; + for (UriType item : this.import_) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) + */ + // syntactic sugar + public UriType addImportElement() {//2 + UriType t = new UriType(); + if (this.import_ == null) + this.import_ = new ArrayList(); + this.import_.add(t); + return t; + } + + /** + * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) + */ + public ValueSetComposeComponent addImport(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.import_ == null) + this.import_ = new ArrayList(); + this.import_.add(t); + return this; + } + + /** + * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) + */ + public boolean hasImport(String value) { + if (this.import_ == null) + return false; + for (UriType v : this.import_) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #include} (Include one or more codes from a code system.) + */ + public List getInclude() { + if (this.include == null) + this.include = new ArrayList(); + return this.include; + } + + public boolean hasInclude() { + if (this.include == null) + return false; + for (ConceptSetComponent item : this.include) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #include} (Include one or more codes from a code system.) + */ + // syntactic sugar + public ConceptSetComponent addInclude() { //3 + ConceptSetComponent t = new ConceptSetComponent(); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return t; + } + + // syntactic sugar + public ValueSetComposeComponent addInclude(ConceptSetComponent t) { //3 + if (t == null) + return this; + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return this; + } + + /** + * @return {@link #exclude} (Exclude one or more codes from the value set.) + */ + public List getExclude() { + if (this.exclude == null) + this.exclude = new ArrayList(); + return this.exclude; + } + + public boolean hasExclude() { + if (this.exclude == null) + return false; + for (ConceptSetComponent item : this.exclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exclude} (Exclude one or more codes from the value set.) + */ + // syntactic sugar + public ConceptSetComponent addExclude() { //3 + ConceptSetComponent t = new ConceptSetComponent(); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return t; + } + + // syntactic sugar + public ValueSetComposeComponent addExclude(ConceptSetComponent t) { //3 + if (t == null) + return this; + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("import", "uri", "Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.", 0, java.lang.Integer.MAX_VALUE, import_)); + childrenList.add(new Property("include", "", "Include one or more codes from a code system.", 0, java.lang.Integer.MAX_VALUE, include)); + childrenList.add(new Property("exclude", "@ValueSet.compose.include", "Exclude one or more codes from the value set.", 0, java.lang.Integer.MAX_VALUE, exclude)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1184795739: /*import*/ return this.import_ == null ? new Base[0] : this.import_.toArray(new Base[this.import_.size()]); // UriType + case 1942574248: /*include*/ return this.include == null ? new Base[0] : this.include.toArray(new Base[this.include.size()]); // ConceptSetComponent + case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : this.exclude.toArray(new Base[this.exclude.size()]); // ConceptSetComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1184795739: // import + this.getImport().add(castToUri(value)); // UriType + break; + case 1942574248: // include + this.getInclude().add((ConceptSetComponent) value); // ConceptSetComponent + break; + case -1321148966: // exclude + this.getExclude().add((ConceptSetComponent) value); // ConceptSetComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("import")) + this.getImport().add(castToUri(value)); + else if (name.equals("include")) + this.getInclude().add((ConceptSetComponent) value); + else if (name.equals("exclude")) + this.getExclude().add((ConceptSetComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1184795739: throw new FHIRException("Cannot make property import as it is not a complex type"); // UriType + case 1942574248: return addInclude(); // ConceptSetComponent + case -1321148966: return addExclude(); // ConceptSetComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("import")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.import"); + } + else if (name.equals("include")) { + return addInclude(); + } + else if (name.equals("exclude")) { + return addExclude(); + } + else + return super.addChild(name); + } + + public ValueSetComposeComponent copy() { + ValueSetComposeComponent dst = new ValueSetComposeComponent(); + copyValues(dst); + if (import_ != null) { + dst.import_ = new ArrayList(); + for (UriType i : import_) + dst.import_.add(i.copy()); + }; + if (include != null) { + dst.include = new ArrayList(); + for (ConceptSetComponent i : include) + dst.include.add(i.copy()); + }; + if (exclude != null) { + dst.exclude = new ArrayList(); + for (ConceptSetComponent i : exclude) + dst.exclude.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetComposeComponent)) + return false; + ValueSetComposeComponent o = (ValueSetComposeComponent) other; + return compareDeep(import_, o.import_, true) && compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetComposeComponent)) + return false; + ValueSetComposeComponent o = (ValueSetComposeComponent) other; + return compareValues(import_, o.import_, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (import_ == null || import_.isEmpty()) && (include == null || include.isEmpty()) + && (exclude == null || exclude.isEmpty()); + } + + public String fhirType() { + return "ValueSet.compose"; + + } + + } + + @Block() + public static class ConceptSetComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI which is the code system from which the selected codes come from. + */ + @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="The system the codes come from", formalDefinition="An absolute URI which is the code system from which the selected codes come from." ) + protected UriType system; + + /** + * The version of the code system that the codes are selected from. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system that the codes are selected from." ) + protected StringType version; + + /** + * Specifies a concept to be included or excluded. + */ + @Child(name = "concept", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A concept defined in the system", formalDefinition="Specifies a concept to be included or excluded." ) + protected List concept; + + /** + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + */ + @Child(name = "filter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Select codes/concepts by their properties (including relationships)", formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true." ) + protected List filter; + + private static final long serialVersionUID = -196054471L; + + /** + * Constructor + */ + public ConceptSetComponent() { + super(); + } + + /** + * Constructor + */ + public ConceptSetComponent(UriType system) { + super(); + this.system = system; + } + + /** + * @return {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ConceptSetComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI which is the code system from which the selected codes come from. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI which is the code system from which the selected codes come from. + */ + public ConceptSetComponent setSystem(String value) { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConceptSetComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the code system that the codes are selected from. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the code system that the codes are selected from. + */ + public ConceptSetComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Specifies a concept to be included or excluded.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptReferenceComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Specifies a concept to be included or excluded.) + */ + // syntactic sugar + public ConceptReferenceComponent addConcept() { //3 + ConceptReferenceComponent t = new ConceptReferenceComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + // syntactic sugar + public ConceptSetComponent addConcept(ConceptReferenceComponent t) { //3 + if (t == null) + return this; + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return this; + } + + /** + * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) + */ + public List getFilter() { + if (this.filter == null) + this.filter = new ArrayList(); + return this.filter; + } + + public boolean hasFilter() { + if (this.filter == null) + return false; + for (ConceptSetFilterComponent item : this.filter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) + */ + // syntactic sugar + public ConceptSetFilterComponent addFilter() { //3 + ConceptSetFilterComponent t = new ConceptSetFilterComponent(); + if (this.filter == null) + this.filter = new ArrayList(); + this.filter.add(t); + return t; + } + + // syntactic sugar + public ConceptSetComponent addFilter(ConceptSetFilterComponent t) { //3 + if (t == null) + return this; + if (this.filter == null) + this.filter = new ArrayList(); + this.filter.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI which is the code system from which the selected codes come from.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of the code system that the codes are selected from.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("concept", "", "Specifies a concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("filter", "", "Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.", 0, java.lang.Integer.MAX_VALUE, filter)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptReferenceComponent + case -1274492040: /*filter*/ return this.filter == null ? new Base[0] : this.filter.toArray(new Base[this.filter.size()]); // ConceptSetFilterComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 951024232: // concept + this.getConcept().add((ConceptReferenceComponent) value); // ConceptReferenceComponent + break; + case -1274492040: // filter + this.getFilter().add((ConceptSetFilterComponent) value); // ConceptSetFilterComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("concept")) + this.getConcept().add((ConceptReferenceComponent) value); + else if (name.equals("filter")) + this.getFilter().add((ConceptSetFilterComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 951024232: return addConcept(); // ConceptReferenceComponent + case -1274492040: return addFilter(); // ConceptSetFilterComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.system"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version"); + } + else if (name.equals("concept")) { + return addConcept(); + } + else if (name.equals("filter")) { + return addFilter(); + } + else + return super.addChild(name); + } + + public ConceptSetComponent copy() { + ConceptSetComponent dst = new ConceptSetComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptReferenceComponent i : concept) + dst.concept.add(i.copy()); + }; + if (filter != null) { + dst.filter = new ArrayList(); + for (ConceptSetFilterComponent i : filter) + dst.filter.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptSetComponent)) + return false; + ConceptSetComponent o = (ConceptSetComponent) other; + return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(concept, o.concept, true) + && compareDeep(filter, o.filter, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptSetComponent)) + return false; + ConceptSetComponent o = (ConceptSetComponent) other; + return compareValues(system, o.system, true) && compareValues(version, o.version, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (concept == null || concept.isEmpty()) && (filter == null || filter.isEmpty()); + } + + public String fhirType() { + return "ValueSet.compose.include"; + + } + + } + + @Block() + public static class ConceptReferenceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Specifies a code for the concept to be included or excluded. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code or expression from system", formalDefinition="Specifies a code for the concept to be included or excluded." ) + protected CodeType code; + + /** + * The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + @Child(name = "display", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Test to display for this code for this value set", formalDefinition="The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system." ) + protected StringType display; + + /** + * Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc. + */ + @Child(name = "designation", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Additional representations for this valueset", formalDefinition="Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc." ) + protected List designation; + + private static final long serialVersionUID = 260579971L; + + /** + * Constructor + */ + public ConceptReferenceComponent() { + super(); + } + + /** + * Constructor + */ + public ConceptReferenceComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptReferenceComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Specifies a code for the concept to be included or excluded. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Specifies a code for the concept to be included or excluded. + */ + public ConceptReferenceComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ConceptReferenceComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + public ConceptReferenceComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.) + */ + public List getDesignation() { + if (this.designation == null) + this.designation = new ArrayList(); + return this.designation; + } + + public boolean hasDesignation() { + if (this.designation == null) + return false; + for (ConceptReferenceDesignationComponent item : this.designation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.) + */ + // syntactic sugar + public ConceptReferenceDesignationComponent addDesignation() { //3 + ConceptReferenceDesignationComponent t = new ConceptReferenceDesignationComponent(); + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return t; + } + + // syntactic sugar + public ConceptReferenceComponent addDesignation(ConceptReferenceDesignationComponent t) { //3 + if (t == null) + return this; + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Specifies a code for the concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("designation", "", "Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType + case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // ConceptReferenceDesignationComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case 1671764162: // display + this.display = castToString(value); // StringType + break; + case -900931593: // designation + this.getDesignation().add((ConceptReferenceDesignationComponent) value); // ConceptReferenceDesignationComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("display")) + this.display = castToString(value); // StringType + else if (name.equals("designation")) + this.getDesignation().add((ConceptReferenceDesignationComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType + case -900931593: return addDesignation(); // ConceptReferenceDesignationComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.code"); + } + else if (name.equals("display")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.display"); + } + else if (name.equals("designation")) { + return addDesignation(); + } + else + return super.addChild(name); + } + + public ConceptReferenceComponent copy() { + ConceptReferenceComponent dst = new ConceptReferenceComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + if (designation != null) { + dst.designation = new ArrayList(); + for (ConceptReferenceDesignationComponent i : designation) + dst.designation.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptReferenceComponent)) + return false; + ConceptReferenceComponent o = (ConceptReferenceComponent) other; + return compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(designation, o.designation, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptReferenceComponent)) + return false; + ConceptReferenceComponent o = (ConceptReferenceComponent) other; + return compareValues(code, o.code, true) && compareValues(display, o.display, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) + && (designation == null || designation.isEmpty()); + } + + public String fhirType() { + return "ValueSet.compose.include.concept"; + + } + + } + + @Block() + public static class ConceptReferenceDesignationComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The language this designation is defined for. + */ + @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Human language of the designation", formalDefinition="The language this designation is defined for." ) + protected CodeType language; + + /** + * A code that details how this designation would be used. + */ + @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." ) + protected Coding use; + + /** + * The text value for this designation. + */ + @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." ) + protected StringType value; + + private static final long serialVersionUID = 1515662414L; + + /** + * Constructor + */ + public ConceptReferenceDesignationComponent() { + super(); + } + + /** + * Constructor + */ + public ConceptReferenceDesignationComponent(StringType value) { + super(); + this.value = value; + } + + /** + * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public ConceptReferenceDesignationComponent setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The language this designation is defined for. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The language this designation is defined for. + */ + public ConceptReferenceDesignationComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (A code that details how this designation would be used.) + */ + public Coding getUse() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Coding(); // cc + return this.use; + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (A code that details how this designation would be used.) + */ + public ConceptReferenceDesignationComponent setUse(Coding value) { + this.use = value; + return this; + } + + /** + * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ConceptReferenceDesignationComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The text value for this designation. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The text value for this designation. + */ + public ConceptReferenceDesignationComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1613589672: // language + this.language = castToCode(value); // CodeType + break; + case 116103: // use + this.use = castToCoding(value); // Coding + break; + case 111972721: // value + this.value = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("language")) + this.language = castToCode(value); // CodeType + else if (name.equals("use")) + this.use = castToCoding(value); // Coding + else if (name.equals("value")) + this.value = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType + case 116103: return getUse(); // Coding + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("language")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.language"); + } + else if (name.equals("use")) { + this.use = new Coding(); + return this.use; + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.value"); + } + else + return super.addChild(name); + } + + public ConceptReferenceDesignationComponent copy() { + ConceptReferenceDesignationComponent dst = new ConceptReferenceDesignationComponent(); + copyValues(dst); + dst.language = language == null ? null : language.copy(); + dst.use = use == null ? null : use.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptReferenceDesignationComponent)) + return false; + ConceptReferenceDesignationComponent o = (ConceptReferenceDesignationComponent) other; + return compareDeep(language, o.language, true) && compareDeep(use, o.use, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptReferenceDesignationComponent)) + return false; + ConceptReferenceDesignationComponent o = (ConceptReferenceDesignationComponent) other; + return compareValues(language, o.language, true) && compareValues(value, o.value, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) + && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ValueSet.compose.include.concept.designation"; + + } + + } + + @Block() + public static class ConceptSetFilterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A code that identifies a property defined in the code system. + */ + @Child(name = "property", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="A property defined by the code system", formalDefinition="A code that identifies a property defined in the code system." ) + protected CodeType property; + + /** + * The kind of operation to perform as a part of the filter criteria. + */ + @Child(name = "op", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="= | is-a | is-not-a | regex | in | not-in", formalDefinition="The kind of operation to perform as a part of the filter criteria." ) + protected Enumeration op; + + /** + * The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value. + */ + @Child(name = "value", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code from the system, or regex criteria", formalDefinition="The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value." ) + protected CodeType value; + + private static final long serialVersionUID = 1985515000L; + + /** + * Constructor + */ + public ConceptSetFilterComponent() { + super(); + } + + /** + * Constructor + */ + public ConceptSetFilterComponent(CodeType property, Enumeration op, CodeType value) { + super(); + this.property = property; + this.op = op; + this.value = value; + } + + /** + * @return {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value + */ + public CodeType getPropertyElement() { + if (this.property == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.property"); + else if (Configuration.doAutoCreate()) + this.property = new CodeType(); // bb + return this.property; + } + + public boolean hasPropertyElement() { + return this.property != null && !this.property.isEmpty(); + } + + public boolean hasProperty() { + return this.property != null && !this.property.isEmpty(); + } + + /** + * @param value {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value + */ + public ConceptSetFilterComponent setPropertyElement(CodeType value) { + this.property = value; + return this; + } + + /** + * @return A code that identifies a property defined in the code system. + */ + public String getProperty() { + return this.property == null ? null : this.property.getValue(); + } + + /** + * @param value A code that identifies a property defined in the code system. + */ + public ConceptSetFilterComponent setProperty(String value) { + if (this.property == null) + this.property = new CodeType(); + this.property.setValue(value); + return this; + } + + /** + * @return {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value + */ + public Enumeration getOpElement() { + if (this.op == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.op"); + else if (Configuration.doAutoCreate()) + this.op = new Enumeration(new FilterOperatorEnumFactory()); // bb + return this.op; + } + + public boolean hasOpElement() { + return this.op != null && !this.op.isEmpty(); + } + + public boolean hasOp() { + return this.op != null && !this.op.isEmpty(); + } + + /** + * @param value {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value + */ + public ConceptSetFilterComponent setOpElement(Enumeration value) { + this.op = value; + return this; + } + + /** + * @return The kind of operation to perform as a part of the filter criteria. + */ + public FilterOperator getOp() { + return this.op == null ? null : this.op.getValue(); + } + + /** + * @param value The kind of operation to perform as a part of the filter criteria. + */ + public ConceptSetFilterComponent setOp(FilterOperator value) { + if (this.op == null) + this.op = new Enumeration(new FilterOperatorEnumFactory()); + this.op.setValue(value); + return this; + } + + /** + * @return {@link #value} (The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public CodeType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new CodeType(); // bb + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ConceptSetFilterComponent setValueElement(CodeType value) { + this.value = value; + return this; + } + + /** + * @return The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value. + */ + public ConceptSetFilterComponent setValue(String value) { + if (this.value == null) + this.value = new CodeType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("property", "code", "A code that identifies a property defined in the code system.", 0, java.lang.Integer.MAX_VALUE, property)); + childrenList.add(new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.", 0, java.lang.Integer.MAX_VALUE, op)); + childrenList.add(new Property("value", "code", "The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -993141291: /*property*/ return this.property == null ? new Base[0] : new Base[] {this.property}; // CodeType + case 3553: /*op*/ return this.op == null ? new Base[0] : new Base[] {this.op}; // Enumeration + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -993141291: // property + this.property = castToCode(value); // CodeType + break; + case 3553: // op + this.op = new FilterOperatorEnumFactory().fromType(value); // Enumeration + break; + case 111972721: // value + this.value = castToCode(value); // CodeType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("property")) + this.property = castToCode(value); // CodeType + else if (name.equals("op")) + this.op = new FilterOperatorEnumFactory().fromType(value); // Enumeration + else if (name.equals("value")) + this.value = castToCode(value); // CodeType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -993141291: throw new FHIRException("Cannot make property property as it is not a complex type"); // CodeType + case 3553: throw new FHIRException("Cannot make property op as it is not a complex type"); // Enumeration + case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // CodeType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("property")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.property"); + } + else if (name.equals("op")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.op"); + } + else if (name.equals("value")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.value"); + } + else + return super.addChild(name); + } + + public ConceptSetFilterComponent copy() { + ConceptSetFilterComponent dst = new ConceptSetFilterComponent(); + copyValues(dst); + dst.property = property == null ? null : property.copy(); + dst.op = op == null ? null : op.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ConceptSetFilterComponent)) + return false; + ConceptSetFilterComponent o = (ConceptSetFilterComponent) other; + return compareDeep(property, o.property, true) && compareDeep(op, o.op, true) && compareDeep(value, o.value, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ConceptSetFilterComponent)) + return false; + ConceptSetFilterComponent o = (ConceptSetFilterComponent) other; + return compareValues(property, o.property, true) && compareValues(op, o.op, true) && compareValues(value, o.value, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && (property == null || property.isEmpty()) && (op == null || op.isEmpty()) + && (value == null || value.isEmpty()); + } + + public String fhirType() { + return "ValueSet.compose.include.filter"; + + } + + } + + @Block() + public static class ValueSetExpansionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. + */ + @Child(name = "identifier", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Uniquely identifies this expansion", formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so." ) + protected UriType identifier; + + /** + * The time at which the expansion was produced by the expanding system. + */ + @Child(name = "timestamp", type = {DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Time ValueSet expansion happened", formalDefinition="The time at which the expansion was produced by the expanding system." ) + protected DateTimeType timestamp; + + /** + * The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter. + */ + @Child(name = "total", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Total number of codes in the expansion", formalDefinition="The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter." ) + protected IntegerType total; + + /** + * If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present. + */ + @Child(name = "offset", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Offset at which this resource starts", formalDefinition="If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present." ) + protected IntegerType offset; + + /** + * A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. + */ + @Child(name = "parameter", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Parameter that controlled the expansion process", formalDefinition="A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion." ) + protected List parameter; + + /** + * The codes that are contained in the value set expansion. + */ + @Child(name = "contains", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Codes in the value set", formalDefinition="The codes that are contained in the value set expansion." ) + protected List contains; + + private static final long serialVersionUID = -43471993L; + + /** + * Constructor + */ + public ValueSetExpansionComponent() { + super(); + } + + /** + * Constructor + */ + public ValueSetExpansionComponent(UriType identifier, DateTimeType timestamp) { + super(); + this.identifier = identifier; + this.timestamp = timestamp; + } + + /** + * @return {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). 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 ValueSetExpansionComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new UriType(); // bb + 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} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public ValueSetExpansionComponent setIdentifierElement(UriType value) { + this.identifier = value; + return this; + } + + /** + * @return An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. + */ + public ValueSetExpansionComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new UriType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public DateTimeType getTimestampElement() { + if (this.timestamp == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionComponent.timestamp"); + else if (Configuration.doAutoCreate()) + this.timestamp = new DateTimeType(); // bb + return this.timestamp; + } + + public boolean hasTimestampElement() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + public boolean hasTimestamp() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + /** + * @param value {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public ValueSetExpansionComponent setTimestampElement(DateTimeType value) { + this.timestamp = value; + return this; + } + + /** + * @return The time at which the expansion was produced by the expanding system. + */ + 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(Date value) { + if (this.timestamp == null) + this.timestamp = new DateTimeType(); + this.timestamp.setValue(value); + return this; + } + + /** + * @return {@link #total} (The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.). 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 ValueSetExpansionComponent.total"); + else if (Configuration.doAutoCreate()) + this.total = new IntegerType(); // bb + 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} (The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value + */ + public ValueSetExpansionComponent setTotalElement(IntegerType value) { + this.total = value; + return this; + } + + /** + * @return The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter. + */ + public int getTotal() { + return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue(); + } + + /** + * @param value The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter. + */ + public ValueSetExpansionComponent setTotal(int value) { + if (this.total == null) + this.total = new IntegerType(); + this.total.setValue(value); + return this; + } + + /** + * @return {@link #offset} (If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value + */ + public IntegerType getOffsetElement() { + if (this.offset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionComponent.offset"); + else if (Configuration.doAutoCreate()) + this.offset = new IntegerType(); // bb + return this.offset; + } + + public boolean hasOffsetElement() { + return this.offset != null && !this.offset.isEmpty(); + } + + public boolean hasOffset() { + return this.offset != null && !this.offset.isEmpty(); + } + + /** + * @param value {@link #offset} (If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value + */ + public ValueSetExpansionComponent setOffsetElement(IntegerType value) { + this.offset = value; + return this; + } + + /** + * @return If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present. + */ + public int getOffset() { + return this.offset == null || this.offset.isEmpty() ? 0 : this.offset.getValue(); + } + + /** + * @param value If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present. + */ + public ValueSetExpansionComponent setOffset(int value) { + if (this.offset == null) + this.offset = new IntegerType(); + this.offset.setValue(value); + return this; + } + + /** + * @return {@link #parameter} (A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (ValueSetExpansionParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.) + */ + // syntactic sugar + public ValueSetExpansionParameterComponent addParameter() { //3 + ValueSetExpansionParameterComponent t = new ValueSetExpansionParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + // syntactic sugar + public ValueSetExpansionComponent addParameter(ValueSetExpansionParameterComponent t) { //3 + if (t == null) + return this; + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return this; + } + + /** + * @return {@link #contains} (The codes that are contained in the value set expansion.) + */ + public List getContains() { + if (this.contains == null) + this.contains = new ArrayList(); + return this.contains; + } + + public boolean hasContains() { + if (this.contains == null) + return false; + for (ValueSetExpansionContainsComponent item : this.contains) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contains} (The codes that are contained in the value set expansion.) + */ + // syntactic sugar + public ValueSetExpansionContainsComponent addContains() { //3 + ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return t; + } + + // syntactic sugar + public ValueSetExpansionComponent addContains(ValueSetExpansionContainsComponent t) { //3 + if (t == null) + return this; + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "uri", "An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("timestamp", "dateTime", "The time at which the expansion was produced by the expanding system.", 0, java.lang.Integer.MAX_VALUE, timestamp)); + childrenList.add(new Property("total", "integer", "The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.", 0, java.lang.Integer.MAX_VALUE, total)); + childrenList.add(new Property("offset", "integer", "If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present.", 0, java.lang.Integer.MAX_VALUE, offset)); + childrenList.add(new Property("parameter", "", "A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("contains", "", "The codes that are contained in the value set expansion.", 0, java.lang.Integer.MAX_VALUE, contains)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // UriType + case 55126294: /*timestamp*/ return this.timestamp == null ? new Base[0] : new Base[] {this.timestamp}; // DateTimeType + case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // IntegerType + case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // IntegerType + case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ValueSetExpansionParameterComponent + case -567445985: /*contains*/ return this.contains == null ? new Base[0] : this.contains.toArray(new Base[this.contains.size()]); // ValueSetExpansionContainsComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToUri(value); // UriType + break; + case 55126294: // timestamp + this.timestamp = castToDateTime(value); // DateTimeType + break; + case 110549828: // total + this.total = castToInteger(value); // IntegerType + break; + case -1019779949: // offset + this.offset = castToInteger(value); // IntegerType + break; + case 1954460585: // parameter + this.getParameter().add((ValueSetExpansionParameterComponent) value); // ValueSetExpansionParameterComponent + break; + case -567445985: // contains + this.getContains().add((ValueSetExpansionContainsComponent) value); // ValueSetExpansionContainsComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToUri(value); // UriType + else if (name.equals("timestamp")) + this.timestamp = castToDateTime(value); // DateTimeType + else if (name.equals("total")) + this.total = castToInteger(value); // IntegerType + else if (name.equals("offset")) + this.offset = castToInteger(value); // IntegerType + else if (name.equals("parameter")) + this.getParameter().add((ValueSetExpansionParameterComponent) value); + else if (name.equals("contains")) + this.getContains().add((ValueSetExpansionContainsComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // UriType + case 55126294: throw new FHIRException("Cannot make property timestamp as it is not a complex type"); // DateTimeType + case 110549828: throw new FHIRException("Cannot make property total as it is not a complex type"); // IntegerType + case -1019779949: throw new FHIRException("Cannot make property offset as it is not a complex type"); // IntegerType + case 1954460585: return addParameter(); // ValueSetExpansionParameterComponent + case -567445985: return addContains(); // ValueSetExpansionContainsComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.identifier"); + } + else if (name.equals("timestamp")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.timestamp"); + } + else if (name.equals("total")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.total"); + } + else if (name.equals("offset")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.offset"); + } + else if (name.equals("parameter")) { + return addParameter(); + } + else if (name.equals("contains")) { + return addContains(); + } + else + return super.addChild(name); + } + + public ValueSetExpansionComponent copy() { + ValueSetExpansionComponent dst = new ValueSetExpansionComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.timestamp = timestamp == null ? null : timestamp.copy(); + dst.total = total == null ? null : total.copy(); + dst.offset = offset == null ? null : offset.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (ValueSetExpansionParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + if (contains != null) { + dst.contains = new ArrayList(); + for (ValueSetExpansionContainsComponent i : contains) + dst.contains.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetExpansionComponent)) + return false; + ValueSetExpansionComponent o = (ValueSetExpansionComponent) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(timestamp, o.timestamp, true) + && compareDeep(total, o.total, true) && compareDeep(offset, o.offset, true) && compareDeep(parameter, o.parameter, true) + && compareDeep(contains, o.contains, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetExpansionComponent)) + return false; + ValueSetExpansionComponent o = (ValueSetExpansionComponent) other; + return compareValues(identifier, o.identifier, true) && compareValues(timestamp, o.timestamp, true) + && compareValues(total, o.total, true) && compareValues(offset, o.offset, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) + && (total == null || total.isEmpty()) && (offset == null || offset.isEmpty()) && (parameter == null || parameter.isEmpty()) + && (contains == null || contains.isEmpty()); + } + + public String fhirType() { + return "ValueSet.expansion"; + + } + + } + + @Block() + public static class ValueSetExpansionParameterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The name of the parameter. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Name as assigned by the server", formalDefinition="The name of the parameter." ) + protected StringType name; + + /** + * The value of the parameter. + */ + @Child(name = "value", type = {StringType.class, BooleanType.class, IntegerType.class, DecimalType.class, UriType.class, CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Value of the named parameter", formalDefinition="The value of the parameter." ) + protected Type value; + + private static final long serialVersionUID = 1172641169L; + + /** + * Constructor + */ + public ValueSetExpansionParameterComponent() { + super(); + } + + /** + * Constructor + */ + public ValueSetExpansionParameterComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (The name of the parameter.). 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 ValueSetExpansionParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ValueSetExpansionParameterComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter. + */ + public ValueSetExpansionParameterComponent 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 Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public StringType getValueStringType() throws FHIRException { + if (!(this.value instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + public boolean hasValueStringType() { + return this.value instanceof StringType; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public BooleanType getValueBooleanType() throws FHIRException { + if (!(this.value instanceof BooleanType)) + throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + public boolean hasValueBooleanType() { + return this.value instanceof BooleanType; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public IntegerType getValueIntegerType() throws FHIRException { + if (!(this.value instanceof IntegerType)) + throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IntegerType) this.value; + } + + public boolean hasValueIntegerType() { + return this.value instanceof IntegerType; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public DecimalType getValueDecimalType() throws FHIRException { + if (!(this.value instanceof DecimalType)) + throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DecimalType) this.value; + } + + public boolean hasValueDecimalType() { + return this.value instanceof DecimalType; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public UriType getValueUriType() throws FHIRException { + if (!(this.value instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (UriType) this.value; + } + + public boolean hasValueUriType() { + return this.value instanceof UriType; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public CodeType getValueCodeType() throws FHIRException { + if (!(this.value instanceof CodeType)) + throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeType) this.value; + } + + public boolean hasValueCodeType() { + return this.value instanceof CodeType; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the parameter.) + */ + public ValueSetExpansionParameterComponent setValue(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.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "string|boolean|integer|decimal|uri|code", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 111972721: // value + this.value = (Type) value; // Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("value[x]")) + this.value = (Type) value; // Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -1410166417: return getValue(); // Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name"); + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDecimal")) { + this.value = new DecimalType(); + return this.value; + } + else if (name.equals("valueUri")) { + this.value = new UriType(); + return this.value; + } + else if (name.equals("valueCode")) { + this.value = new CodeType(); + return this.value; + } + else + return super.addChild(name); + } + + public ValueSetExpansionParameterComponent copy() { + ValueSetExpansionParameterComponent dst = new ValueSetExpansionParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetExpansionParameterComponent)) + return false; + ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other; + return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetExpansionParameterComponent)) + return false; + ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other; + return compareValues(name, o.name, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + public String fhirType() { + return "ValueSet.expansion.parameter"; + + } + + } + + @Block() + public static class ValueSetExpansionContainsComponent extends BackboneElement implements IBaseBackboneElement { + /** + * An absolute URI which is the code system in which the code for this item in the expansion is defined. + */ + @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="System value for the code", formalDefinition="An absolute URI which is the code system in which the code for this item in the expansion is defined." ) + protected UriType system; + + /** + * If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + @Child(name = "abstract", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If user cannot select this entry", formalDefinition="If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value." ) + protected BooleanType abstract_; + + /** + * The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Version in which this code/display is defined", formalDefinition="The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence." ) + protected StringType version; + + /** + * The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. + */ + @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Code - if blank, this is not a selectable code", formalDefinition="The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set." ) + protected CodeType code; + + /** + * The recommended display for this item in the expansion. + */ + @Child(name = "display", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="User display for the concept", formalDefinition="The recommended display for this item in the expansion." ) + protected StringType display; + + /** + * Other codes and entries contained under this entry in the hierarchy. + */ + @Child(name = "contains", type = {ValueSetExpansionContainsComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Codes contained under this entry", formalDefinition="Other codes and entries contained under this entry in the hierarchy." ) + protected List contains; + + private static final long serialVersionUID = -2038349483L; + + /** + * Constructor + */ + public ValueSetExpansionContainsComponent() { + super(); + } + + /** + * @return {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); // bb + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return An absolute URI which is the code system in which the code for this item in the expansion is defined. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value An absolute URI which is the code system in which the code for this item in the expansion is defined. + */ + public ValueSetExpansionContainsComponent setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public BooleanType getAbstractElement() { + if (this.abstract_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.abstract_"); + else if (Configuration.doAutoCreate()) + this.abstract_ = new BooleanType(); // bb + return this.abstract_; + } + + public boolean hasAbstractElement() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + public boolean hasAbstract() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + /** + * @param value {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setAbstractElement(BooleanType value) { + this.abstract_ = value; + return this; + } + + /** + * @return If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + public boolean getAbstract() { + return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); + } + + /** + * @param value If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + public ValueSetExpansionContainsComponent setAbstract(boolean value) { + if (this.abstract_ == null) + this.abstract_ = new BooleanType(); + this.abstract_.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + public ValueSetExpansionContainsComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. + */ + public ValueSetExpansionContainsComponent setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (The recommended display for this item in the expansion.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); // bb + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (The recommended display for this item in the expansion.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return The recommended display for this item in the expansion. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value The recommended display for this item in the expansion. + */ + public ValueSetExpansionContainsComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #contains} (Other codes and entries contained under this entry in the hierarchy.) + */ + public List getContains() { + if (this.contains == null) + this.contains = new ArrayList(); + return this.contains; + } + + public boolean hasContains() { + if (this.contains == null) + return false; + for (ValueSetExpansionContainsComponent item : this.contains) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contains} (Other codes and entries contained under this entry in the hierarchy.) + */ + // syntactic sugar + public ValueSetExpansionContainsComponent addContains() { //3 + ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return t; + } + + // syntactic sugar + public ValueSetExpansionContainsComponent addContains(ValueSetExpansionContainsComponent t) { //3 + if (t == null) + return this; + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "An absolute URI which is the code system in which the code for this item in the expansion is defined.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("abstract", "boolean", "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("version", "string", "The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("code", "code", "The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "The recommended display for this item in the expansion.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("contains", "@ValueSet.expansion.contains", "Other codes and entries contained under this entry in the hierarchy.", 0, java.lang.Integer.MAX_VALUE, contains)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType + case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : new Base[] {this.abstract_}; // BooleanType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType + case -567445985: /*contains*/ return this.contains == null ? new Base[0] : this.contains.toArray(new Base[this.contains.size()]); // ValueSetExpansionContainsComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -887328209: // system + this.system = castToUri(value); // UriType + break; + case 1732898850: // abstract + this.abstract_ = castToBoolean(value); // BooleanType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case 1671764162: // display + this.display = castToString(value); // StringType + break; + case -567445985: // contains + this.getContains().add((ValueSetExpansionContainsComponent) value); // ValueSetExpansionContainsComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("system")) + this.system = castToUri(value); // UriType + else if (name.equals("abstract")) + this.abstract_ = castToBoolean(value); // BooleanType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("display")) + this.display = castToString(value); // StringType + else if (name.equals("contains")) + this.getContains().add((ValueSetExpansionContainsComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType + case 1732898850: throw new FHIRException("Cannot make property abstract as it is not a complex type"); // BooleanType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType + case -567445985: return addContains(); // ValueSetExpansionContainsComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("system")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.system"); + } + else if (name.equals("abstract")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.abstract"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version"); + } + else if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.code"); + } + else if (name.equals("display")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.display"); + } + else if (name.equals("contains")) { + return addContains(); + } + else + return super.addChild(name); + } + + public ValueSetExpansionContainsComponent copy() { + ValueSetExpansionContainsComponent dst = new ValueSetExpansionContainsComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.abstract_ = abstract_ == null ? null : abstract_.copy(); + dst.version = version == null ? null : version.copy(); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + if (contains != null) { + dst.contains = new ArrayList(); + for (ValueSetExpansionContainsComponent i : contains) + dst.contains.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSetExpansionContainsComponent)) + return false; + ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; + return compareDeep(system, o.system, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(version, o.version, true) + && compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(contains, o.contains, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSetExpansionContainsComponent)) + return false; + ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; + return compareValues(system, o.system, true) && compareValues(abstract_, o.abstract_, true) && compareValues(version, o.version, true) + && compareValues(code, o.code, true) && compareValues(display, o.display, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) + && (version == null || version.isEmpty()) && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) + && (contains == null || contains.isEmpty()); + } + + public String fhirType() { + return "ValueSet.expansion.contains"; + + } + + } + + /** + * An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published. + */ + @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Globally unique logical identifier for value set", formalDefinition="An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Additional identifier for the value set (e.g. HL7 v2 / CDA)", formalDefinition="Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance." ) + protected Identifier identifier; + + /** + * Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Logical identifier for this version of the value set", formalDefinition="Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name describing the value set. + */ + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Informal name for this value set", formalDefinition="A free text natural language name describing the value set." ) + protected StringType name; + + /** + * The status of the value set. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the value set." ) + protected Enumeration status; + + /** + * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The name of the individual or organization that published the value set. + */ + @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the value set." ) + protected StringType publisher; + + /** + * Contacts to assist a user in finding and communicating with the publisher. + */ + @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) + protected List contact; + + /** + * The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). + */ + @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Date for given status", formalDefinition="The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition')." ) + protected DateTimeType date; + + /** + * If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. + */ + @Child(name = "lockedDate", type = {DateType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Fixed date for all referenced code systems and value sets", formalDefinition="If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date." ) + protected DateType lockedDate; + + /** + * A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. + */ + @Child(name = "description", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Human language description of the value set", formalDefinition="A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set." ) + protected StringType description; + + /** + * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions. + */ + @Child(name = "useContext", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions." ) + protected List useContext; + + /** + * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + @Child(name = "immutable", type = {BooleanType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Indicates whether or not any change to the content logical definition may occur", formalDefinition="If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change." ) + protected BooleanType immutable; + + /** + * Explains why this value set is needed and why it has been constrained as it has. + */ + @Child(name = "requirements", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Why needed", formalDefinition="Explains why this value set is needed and why it has been constrained as it has." ) + protected StringType requirements; + + /** + * A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. + */ + @Child(name = "copyright", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set." ) + protected StringType copyright; + + /** + * Whether this is intended to be used with an extensible binding or not. + */ + @Child(name = "extensible", type = {BooleanType.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether this is intended to be used with an extensible binding", formalDefinition="Whether this is intended to be used with an extensible binding or not." ) + protected BooleanType extensible; + + /** + * A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set. + */ + @Child(name = "compose", type = {}, order=16, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="When value set includes codes from elsewhere", formalDefinition="A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set." ) + protected ValueSetComposeComponent compose; + + /** + * A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. + */ + @Child(name = "expansion", type = {}, order=17, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Used when the value set is \"expanded\"", formalDefinition="A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed." ) + protected ValueSetExpansionComponent expansion; + + private static final long serialVersionUID = 1847545818L; + + /** + * Constructor + */ + public ValueSet() { + super(); + } + + /** + * Constructor + */ + public ValueSet(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ValueSet setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published. + */ + public ValueSet setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.) + */ + public ValueSet setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #version} (Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ValueSet setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public ValueSet setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name describing the value set.). 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 ValueSet.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ValueSet setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name describing the value set. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name describing the value set. + */ + public ValueSet setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the value set.). 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 ValueSet.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb + 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 value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ValueSet setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the value set. + */ + public ConformanceResourceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the value set. + */ + public ValueSet setStatus(ConformanceResourceStatus value) { + if (this.status == null) + this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ValueSet setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public ValueSet setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ValueSet setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the value set. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the value set. + */ + public ValueSet setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ValueSetContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ValueSetContactComponent addContact() { //3 + ValueSetContactComponent t = new ValueSetContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + // syntactic sugar + public ValueSet addContact(ValueSetContactComponent t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return {@link #date} (The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). 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 ValueSet.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ValueSet setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). + */ + public ValueSet setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value + */ + public DateType getLockedDateElement() { + if (this.lockedDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.lockedDate"); + else if (Configuration.doAutoCreate()) + this.lockedDate = new DateType(); // bb + return this.lockedDate; + } + + public boolean hasLockedDateElement() { + return this.lockedDate != null && !this.lockedDate.isEmpty(); + } + + public boolean hasLockedDate() { + return this.lockedDate != null && !this.lockedDate.isEmpty(); + } + + /** + * @param value {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value + */ + public ValueSet setLockedDateElement(DateType value) { + this.lockedDate = value; + return this; + } + + /** + * @return If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. + */ + public Date getLockedDate() { + return this.lockedDate == null ? null : this.lockedDate.getValue(); + } + + /** + * @param value If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. + */ + public ValueSet setLockedDate(Date value) { + if (value == null) + this.lockedDate = null; + else { + if (this.lockedDate == null) + this.lockedDate = new DateType(); + this.lockedDate.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). 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 ValueSet.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ValueSet setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. + */ + public ValueSet 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 #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (CodeableConcept item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.) + */ + // syntactic sugar + public CodeableConcept addUseContext() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + // syntactic sugar + public ValueSet addUseContext(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value + */ + public BooleanType getImmutableElement() { + if (this.immutable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.immutable"); + else if (Configuration.doAutoCreate()) + this.immutable = new BooleanType(); // bb + return this.immutable; + } + + public boolean hasImmutableElement() { + return this.immutable != null && !this.immutable.isEmpty(); + } + + public boolean hasImmutable() { + return this.immutable != null && !this.immutable.isEmpty(); + } + + /** + * @param value {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value + */ + public ValueSet setImmutableElement(BooleanType value) { + this.immutable = value; + return this; + } + + /** + * @return If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + public boolean getImmutable() { + return this.immutable == null || this.immutable.isEmpty() ? false : this.immutable.getValue(); + } + + /** + * @param value If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + public ValueSet setImmutable(boolean value) { + if (this.immutable == null) + this.immutable = new BooleanType(); + this.immutable.setValue(value); + return this; + } + + /** + * @return {@link #requirements} (Explains why this value set is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); // bb + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this value set is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ValueSet setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this value set is needed and why it has been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this value set is needed and why it has been constrained as it has. + */ + public ValueSet setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public ValueSet setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. + */ + public ValueSet setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value + */ + public BooleanType getExtensibleElement() { + if (this.extensible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.extensible"); + else if (Configuration.doAutoCreate()) + this.extensible = new BooleanType(); // bb + return this.extensible; + } + + public boolean hasExtensibleElement() { + return this.extensible != null && !this.extensible.isEmpty(); + } + + public boolean hasExtensible() { + return this.extensible != null && !this.extensible.isEmpty(); + } + + /** + * @param value {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value + */ + public ValueSet setExtensibleElement(BooleanType value) { + this.extensible = value; + return this; + } + + /** + * @return Whether this is intended to be used with an extensible binding or not. + */ + public boolean getExtensible() { + return this.extensible == null || this.extensible.isEmpty() ? false : this.extensible.getValue(); + } + + /** + * @param value Whether this is intended to be used with an extensible binding or not. + */ + public ValueSet setExtensible(boolean value) { + if (this.extensible == null) + this.extensible = new BooleanType(); + this.extensible.setValue(value); + return this; + } + + /** + * @return {@link #compose} (A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.) + */ + public ValueSetComposeComponent getCompose() { + if (this.compose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.compose"); + else if (Configuration.doAutoCreate()) + this.compose = new ValueSetComposeComponent(); // cc + return this.compose; + } + + public boolean hasCompose() { + return this.compose != null && !this.compose.isEmpty(); + } + + /** + * @param value {@link #compose} (A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.) + */ + public ValueSet setCompose(ValueSetComposeComponent value) { + this.compose = value; + return this; + } + + /** + * @return {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) + */ + public ValueSetExpansionComponent getExpansion() { + if (this.expansion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.expansion"); + else if (Configuration.doAutoCreate()) + this.expansion = new ValueSetExpansionComponent(); // cc + return this.expansion; + } + + public boolean hasExpansion() { + return this.expansion != null && !this.expansion.isEmpty(); + } + + /** + * @param value {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) + */ + public ValueSet setExpansion(ValueSetExpansionComponent value) { + this.expansion = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name describing the value set.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the value set.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the value set.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("date", "dateTime", "The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("lockedDate", "date", "If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.", 0, java.lang.Integer.MAX_VALUE, lockedDate)); + childrenList.add(new Property("description", "string", "A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("immutable", "boolean", "If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.", 0, java.lang.Integer.MAX_VALUE, immutable)); + childrenList.add(new Property("requirements", "string", "Explains why this value set is needed and why it has been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("extensible", "boolean", "Whether this is intended to be used with an extensible binding or not.", 0, java.lang.Integer.MAX_VALUE, extensible)); + childrenList.add(new Property("compose", "", "A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.", 0, java.lang.Integer.MAX_VALUE, compose)); + childrenList.add(new Property("expansion", "", "A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.", 0, java.lang.Integer.MAX_VALUE, expansion)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ValueSetContactComponent + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 1391591896: /*lockedDate*/ return this.lockedDate == null ? new Base[0] : new Base[] {this.lockedDate}; // DateType + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept + case 1596987778: /*immutable*/ return this.immutable == null ? new Base[0] : new Base[] {this.immutable}; // BooleanType + case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType + case -1809433861: /*extensible*/ return this.extensible == null ? new Base[0] : new Base[] {this.extensible}; // BooleanType + case 950497682: /*compose*/ return this.compose == null ? new Base[0] : new Base[] {this.compose}; // ValueSetComposeComponent + case 17878207: /*expansion*/ return this.expansion == null ? new Base[0] : new Base[] {this.expansion}; // ValueSetExpansionComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case -892481550: // status + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add((ValueSetContactComponent) value); // ValueSetContactComponent + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 1391591896: // lockedDate + this.lockedDate = castToDate(value); // DateType + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -669707736: // useContext + this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 1596987778: // immutable + this.immutable = castToBoolean(value); // BooleanType + break; + case -1619874672: // requirements + this.requirements = castToString(value); // StringType + break; + case 1522889671: // copyright + this.copyright = castToString(value); // StringType + break; + case -1809433861: // extensible + this.extensible = castToBoolean(value); // BooleanType + break; + case 950497682: // compose + this.compose = (ValueSetComposeComponent) value; // ValueSetComposeComponent + break; + case 17878207: // expansion + this.expansion = (ValueSetExpansionComponent) value; // ValueSetExpansionComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("status")) + this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add((ValueSetContactComponent) value); + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("lockedDate")) + this.lockedDate = castToDate(value); // DateType + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("useContext")) + this.getUseContext().add(castToCodeableConcept(value)); + else if (name.equals("immutable")) + this.immutable = castToBoolean(value); // BooleanType + else if (name.equals("requirements")) + this.requirements = castToString(value); // StringType + else if (name.equals("copyright")) + this.copyright = castToString(value); // StringType + else if (name.equals("extensible")) + this.extensible = castToBoolean(value); // BooleanType + else if (name.equals("compose")) + this.compose = (ValueSetComposeComponent) value; // ValueSetComposeComponent + else if (name.equals("expansion")) + this.expansion = (ValueSetExpansionComponent) value; // ValueSetExpansionComponent + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case -1618432855: return getIdentifier(); // Identifier + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // ValueSetContactComponent + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1391591896: throw new FHIRException("Cannot make property lockedDate as it is not a complex type"); // DateType + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -669707736: return addUseContext(); // CodeableConcept + case 1596987778: throw new FHIRException("Cannot make property immutable as it is not a complex type"); // BooleanType + case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType + case -1809433861: throw new FHIRException("Cannot make property extensible as it is not a complex type"); // BooleanType + case 950497682: return getCompose(); // ValueSetComposeComponent + case 17878207: return getExpansion(); // ValueSetExpansionComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.url"); + } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.experimental"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.date"); + } + else if (name.equals("lockedDate")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.lockedDate"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("immutable")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.immutable"); + } + else if (name.equals("requirements")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.requirements"); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.copyright"); + } + else if (name.equals("extensible")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.extensible"); + } + else if (name.equals("compose")) { + this.compose = new ValueSetComposeComponent(); + return this.compose; + } + else if (name.equals("expansion")) { + this.expansion = new ValueSetExpansionComponent(); + return this.expansion; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ValueSet"; + + } + + public ValueSet copy() { + ValueSet dst = new ValueSet(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ValueSetContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.lockedDate = lockedDate == null ? null : lockedDate.copy(); + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (CodeableConcept i : useContext) + dst.useContext.add(i.copy()); + }; + dst.immutable = immutable == null ? null : immutable.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.extensible = extensible == null ? null : extensible.copy(); + dst.compose = compose == null ? null : compose.copy(); + dst.expansion = expansion == null ? null : expansion.copy(); + return dst; + } + + protected ValueSet typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ValueSet)) + return false; + ValueSet o = (ValueSet) other; + return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) + && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) + && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) + && compareDeep(lockedDate, o.lockedDate, true) && compareDeep(description, o.description, true) + && compareDeep(useContext, o.useContext, true) && compareDeep(immutable, o.immutable, true) && compareDeep(requirements, o.requirements, true) + && compareDeep(copyright, o.copyright, true) && compareDeep(extensible, o.extensible, true) && compareDeep(compose, o.compose, true) + && compareDeep(expansion, o.expansion, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ValueSet)) + return false; + ValueSet o = (ValueSet) other; + return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) + && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) + && compareValues(date, o.date, true) && compareValues(lockedDate, o.lockedDate, true) && compareValues(description, o.description, true) + && compareValues(immutable, o.immutable, true) && compareValues(requirements, o.requirements, true) + && compareValues(copyright, o.copyright, true) && compareValues(extensible, o.extensible, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (lockedDate == null || lockedDate.isEmpty()) + && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) + && (immutable == null || immutable.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (extensible == null || extensible.isEmpty()) + && (compose == null || compose.isEmpty()) && (expansion == null || expansion.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ValueSet; + } + + /** + * Search parameter: expansion + *

+ * Description: Uniquely identifies this expansion
+ * Type: uri
+ * Path: ValueSet.expansion.identifier
+ *

+ */ + @SearchParamDefinition(name="expansion", path="ValueSet.expansion.identifier", description="Uniquely identifies this expansion", type="uri" ) + public static final String SP_EXPANSION = "expansion"; + /** + * Fluent Client search parameter constant for expansion + *

+ * Description: Uniquely identifies this expansion
+ * Type: uri
+ * Path: ValueSet.expansion.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam EXPANSION = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_EXPANSION); + + /** + * Search parameter: status + *

+ * Description: The status of the value set
+ * Type: token
+ * Path: ValueSet.status
+ *

+ */ + @SearchParamDefinition(name="status", path="ValueSet.status", description="The status of the value set", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The status of the value set
+ * Type: token
+ * Path: ValueSet.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + /** + * Search parameter: description + *

+ * Description: Text search in the description of the value set
+ * Type: string
+ * Path: ValueSet.description
+ *

+ */ + @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the value set
+ * Type: string
+ * Path: ValueSet.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: name + *

+ * Description: The name of the value set
+ * Type: string
+ * Path: ValueSet.name
+ *

+ */ + @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: The name of the value set
+ * Type: string
+ * Path: ValueSet.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: context + *

+ * Description: A use context assigned to the value set
+ * Type: token
+ * Path: ValueSet.useContext
+ *

+ */ + @SearchParamDefinition(name="context", path="ValueSet.useContext", description="A use context assigned to the value set", type="token" ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: A use context assigned to the value set
+ * Type: token
+ * Path: ValueSet.useContext
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); + + /** + * Search parameter: date + *

+ * Description: The value set publication date
+ * Type: date
+ * Path: ValueSet.date
+ *

+ */ + @SearchParamDefinition(name="date", path="ValueSet.date", description="The value set publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The value set publication date
+ * Type: date
+ * Path: ValueSet.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: The identifier for the value set
+ * Type: token
+ * Path: ValueSet.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier for the value set", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier for the value set
+ * Type: token
+ * Path: ValueSet.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: reference + *

+ * Description: A code system included or excluded in the value set or an imported value set
+ * Type: uri
+ * Path: ValueSet.compose.include.system
+ *

+ */ + @SearchParamDefinition(name="reference", path="ValueSet.compose.include.system", description="A code system included or excluded in the value set or an imported value set", type="uri" ) + public static final String SP_REFERENCE = "reference"; + /** + * Fluent Client search parameter constant for reference + *

+ * Description: A code system included or excluded in the value set or an imported value set
+ * Type: uri
+ * Path: ValueSet.compose.include.system
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam REFERENCE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_REFERENCE); + + /** + * Search parameter: url + *

+ * Description: The logical URL for the value set
+ * Type: uri
+ * Path: ValueSet.url
+ *

+ */ + @SearchParamDefinition(name="url", path="ValueSet.url", description="The logical URL for the value set", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: The logical URL for the value set
+ * Type: uri
+ * Path: ValueSet.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the value set
+ * Type: string
+ * Path: ValueSet.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the value set
+ * Type: string
+ * Path: ValueSet.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the value set
+ * Type: token
+ * Path: ValueSet.version
+ *

+ */ + @SearchParamDefinition(name="version", path="ValueSet.version", description="The version identifier of the value set", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the value set
+ * Type: token
+ * Path: ValueSet.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/VisionPrescription.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/VisionPrescription.java new file mode 100644 index 00000000000..2f130793678 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/VisionPrescription.java @@ -0,0 +1,2152 @@ +package org.hl7.fhir.dstu2016may.model; + +import java.math.BigDecimal; + +/* + 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, May 8, 2016 03:05+1000 for FHIR v1.4.0 +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBackboneElement; +import org.hl7.fhir.utilities.Utilities; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +/** + * An authorization for the supply of glasses and/or contact lenses to a patient. + */ +@ResourceDef(name="VisionPrescription", profile="http://hl7.org/fhir/Profile/VisionPrescription") +public class VisionPrescription extends DomainResource { + + public enum VisionEyes { + /** + * Right Eye + */ + RIGHT, + /** + * Left Eye + */ + LEFT, + /** + * added to help the parsers + */ + NULL; + public static VisionEyes fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("right".equals(codeString)) + return RIGHT; + if ("left".equals(codeString)) + return LEFT; + throw new FHIRException("Unknown VisionEyes code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case RIGHT: return "right"; + case LEFT: return "left"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RIGHT: return "http://hl7.org/fhir/vision-eye-codes"; + case LEFT: return "http://hl7.org/fhir/vision-eye-codes"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RIGHT: return "Right Eye"; + case LEFT: return "Left Eye"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RIGHT: return "Right Eye"; + case LEFT: return "Left Eye"; + default: return "?"; + } + } + } + + public static class VisionEyesEnumFactory implements EnumFactory { + public VisionEyes fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("right".equals(codeString)) + return VisionEyes.RIGHT; + if ("left".equals(codeString)) + return VisionEyes.LEFT; + throw new IllegalArgumentException("Unknown VisionEyes code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("right".equals(codeString)) + return new Enumeration(this, VisionEyes.RIGHT); + if ("left".equals(codeString)) + return new Enumeration(this, VisionEyes.LEFT); + throw new FHIRException("Unknown VisionEyes code '"+codeString+"'"); + } + public String toCode(VisionEyes code) { + if (code == VisionEyes.RIGHT) + return "right"; + if (code == VisionEyes.LEFT) + return "left"; + return "?"; + } + public String toSystem(VisionEyes code) { + return code.getSystem(); + } + } + + public enum VisionBase { + /** + * top + */ + UP, + /** + * bottom + */ + DOWN, + /** + * inner edge + */ + IN, + /** + * outer edge + */ + OUT, + /** + * added to help the parsers + */ + NULL; + public static VisionBase fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("up".equals(codeString)) + return UP; + if ("down".equals(codeString)) + return DOWN; + if ("in".equals(codeString)) + return IN; + if ("out".equals(codeString)) + return OUT; + throw new FHIRException("Unknown VisionBase code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case UP: return "up"; + case DOWN: return "down"; + case IN: return "in"; + case OUT: return "out"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UP: return "http://hl7.org/fhir/vision-base-codes"; + case DOWN: return "http://hl7.org/fhir/vision-base-codes"; + case IN: return "http://hl7.org/fhir/vision-base-codes"; + case OUT: return "http://hl7.org/fhir/vision-base-codes"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UP: return "top"; + case DOWN: return "bottom"; + case IN: return "inner edge"; + case OUT: return "outer edge"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UP: return "Up"; + case DOWN: return "Down"; + case IN: return "In"; + case OUT: return "Out"; + default: return "?"; + } + } + } + + public static class VisionBaseEnumFactory implements EnumFactory { + public VisionBase fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("up".equals(codeString)) + return VisionBase.UP; + if ("down".equals(codeString)) + return VisionBase.DOWN; + if ("in".equals(codeString)) + return VisionBase.IN; + if ("out".equals(codeString)) + return VisionBase.OUT; + throw new IllegalArgumentException("Unknown VisionBase code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("up".equals(codeString)) + return new Enumeration(this, VisionBase.UP); + if ("down".equals(codeString)) + return new Enumeration(this, VisionBase.DOWN); + if ("in".equals(codeString)) + return new Enumeration(this, VisionBase.IN); + if ("out".equals(codeString)) + return new Enumeration(this, VisionBase.OUT); + throw new FHIRException("Unknown VisionBase code '"+codeString+"'"); + } + public String toCode(VisionBase code) { + if (code == VisionBase.UP) + return "up"; + if (code == VisionBase.DOWN) + return "down"; + if (code == VisionBase.IN) + return "in"; + if (code == VisionBase.OUT) + return "out"; + return "?"; + } + public String toSystem(VisionBase code) { + return code.getSystem(); + } + } + + @Block() + public static class VisionPrescriptionDispenseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies the type of vision correction product which is required for the patient. + */ + @Child(name = "product", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the type of vision correction product which is required for the patient." ) + protected Coding product; + + /** + * The eye for which the lens applies. + */ + @Child(name = "eye", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="right | left", formalDefinition="The eye for which the lens applies." ) + protected Enumeration eye; + + /** + * Lens power measured in diopters (0.25 units). + */ + @Child(name = "sphere", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lens sphere", formalDefinition="Lens power measured in diopters (0.25 units)." ) + protected DecimalType sphere; + + /** + * Power adjustment for astigmatism measured in diopters (0.25 units). + */ + @Child(name = "cylinder", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lens cylinder", formalDefinition="Power adjustment for astigmatism measured in diopters (0.25 units)." ) + protected DecimalType cylinder; + + /** + * Adjustment for astigmatism measured in integer degrees. + */ + @Child(name = "axis", type = {IntegerType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lens axis", formalDefinition="Adjustment for astigmatism measured in integer degrees." ) + protected IntegerType axis; + + /** + * Amount of prism to compensate for eye alignment in fractional units. + */ + @Child(name = "prism", type = {DecimalType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lens prism", formalDefinition="Amount of prism to compensate for eye alignment in fractional units." ) + protected DecimalType prism; + + /** + * The relative base, or reference lens edge, for the prism. + */ + @Child(name = "base", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="up | down | in | out", formalDefinition="The relative base, or reference lens edge, for the prism." ) + protected Enumeration base; + + /** + * Power adjustment for multifocal lenses measured in diopters (0.25 units). + */ + @Child(name = "add", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lens add", formalDefinition="Power adjustment for multifocal lenses measured in diopters (0.25 units)." ) + protected DecimalType add; + + /** + * Contact lens power measured in diopters (0.25 units). + */ + @Child(name = "power", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contact lens power", formalDefinition="Contact lens power measured in diopters (0.25 units)." ) + protected DecimalType power; + + /** + * Back curvature measured in millimeters. + */ + @Child(name = "backCurve", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contact lens back curvature", formalDefinition="Back curvature measured in millimeters." ) + protected DecimalType backCurve; + + /** + * Contact lens diameter measured in millimeters. + */ + @Child(name = "diameter", type = {DecimalType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Contact lens diameter", formalDefinition="Contact lens diameter measured in millimeters." ) + protected DecimalType diameter; + + /** + * The recommended maximum wear period for the lens. + */ + @Child(name = "duration", type = {SimpleQuantity.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lens wear duration", formalDefinition="The recommended maximum wear period for the lens." ) + protected SimpleQuantity duration; + + /** + * Special color or pattern. + */ + @Child(name = "color", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lens add", formalDefinition="Special color or pattern." ) + protected StringType color; + + /** + * Brand recommendations or restrictions. + */ + @Child(name = "brand", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Lens add", formalDefinition="Brand recommendations or restrictions." ) + protected StringType brand; + + /** + * Notes for special requirements such as coatings and lens materials. + */ + @Child(name = "notes", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Notes for coatings", formalDefinition="Notes for special requirements such as coatings and lens materials." ) + protected StringType notes; + + private static final long serialVersionUID = -1586392610L; + + /** + * Constructor + */ + public VisionPrescriptionDispenseComponent() { + super(); + } + + /** + * Constructor + */ + public VisionPrescriptionDispenseComponent(Coding product) { + super(); + this.product = product; + } + + /** + * @return {@link #product} (Identifies the type of vision correction product which is required for the patient.) + */ + public Coding getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.product"); + else if (Configuration.doAutoCreate()) + this.product = new Coding(); // cc + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Identifies the type of vision correction product which is required for the patient.) + */ + public VisionPrescriptionDispenseComponent setProduct(Coding value) { + this.product = value; + return this; + } + + /** + * @return {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value + */ + public Enumeration getEyeElement() { + if (this.eye == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.eye"); + else if (Configuration.doAutoCreate()) + this.eye = new Enumeration(new VisionEyesEnumFactory()); // bb + return this.eye; + } + + public boolean hasEyeElement() { + return this.eye != null && !this.eye.isEmpty(); + } + + public boolean hasEye() { + return this.eye != null && !this.eye.isEmpty(); + } + + /** + * @param value {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setEyeElement(Enumeration value) { + this.eye = value; + return this; + } + + /** + * @return The eye for which the lens applies. + */ + public VisionEyes getEye() { + return this.eye == null ? null : this.eye.getValue(); + } + + /** + * @param value The eye for which the lens applies. + */ + public VisionPrescriptionDispenseComponent setEye(VisionEyes value) { + if (value == null) + this.eye = null; + else { + if (this.eye == null) + this.eye = new Enumeration(new VisionEyesEnumFactory()); + this.eye.setValue(value); + } + return this; + } + + /** + * @return {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value + */ + public DecimalType getSphereElement() { + if (this.sphere == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.sphere"); + else if (Configuration.doAutoCreate()) + this.sphere = new DecimalType(); // bb + return this.sphere; + } + + public boolean hasSphereElement() { + return this.sphere != null && !this.sphere.isEmpty(); + } + + public boolean hasSphere() { + return this.sphere != null && !this.sphere.isEmpty(); + } + + /** + * @param value {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setSphereElement(DecimalType value) { + this.sphere = value; + return this; + } + + /** + * @return Lens power measured in diopters (0.25 units). + */ + public BigDecimal getSphere() { + return this.sphere == null ? null : this.sphere.getValue(); + } + + /** + * @param value Lens power measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setSphere(BigDecimal value) { + if (value == null) + this.sphere = null; + else { + if (this.sphere == null) + this.sphere = new DecimalType(); + this.sphere.setValue(value); + } + return this; + } + + /** + * @param value Lens power measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setSphere(long value) { + this.sphere = new DecimalType(); + this.sphere.setValue(value); + return this; + } + + /** + * @param value Lens power measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setSphere(double value) { + this.sphere = new DecimalType(); + this.sphere.setValue(value); + return this; + } + + /** + * @return {@link #cylinder} (Power adjustment for astigmatism measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value + */ + public DecimalType getCylinderElement() { + if (this.cylinder == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.cylinder"); + else if (Configuration.doAutoCreate()) + this.cylinder = new DecimalType(); // bb + return this.cylinder; + } + + public boolean hasCylinderElement() { + return this.cylinder != null && !this.cylinder.isEmpty(); + } + + public boolean hasCylinder() { + return this.cylinder != null && !this.cylinder.isEmpty(); + } + + /** + * @param value {@link #cylinder} (Power adjustment for astigmatism measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setCylinderElement(DecimalType value) { + this.cylinder = value; + return this; + } + + /** + * @return Power adjustment for astigmatism measured in diopters (0.25 units). + */ + public BigDecimal getCylinder() { + return this.cylinder == null ? null : this.cylinder.getValue(); + } + + /** + * @param value Power adjustment for astigmatism measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setCylinder(BigDecimal value) { + if (value == null) + this.cylinder = null; + else { + if (this.cylinder == null) + this.cylinder = new DecimalType(); + this.cylinder.setValue(value); + } + return this; + } + + /** + * @param value Power adjustment for astigmatism measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setCylinder(long value) { + this.cylinder = new DecimalType(); + this.cylinder.setValue(value); + return this; + } + + /** + * @param value Power adjustment for astigmatism measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setCylinder(double value) { + this.cylinder = new DecimalType(); + this.cylinder.setValue(value); + return this; + } + + /** + * @return {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value + */ + public IntegerType getAxisElement() { + if (this.axis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.axis"); + else if (Configuration.doAutoCreate()) + this.axis = new IntegerType(); // bb + return this.axis; + } + + public boolean hasAxisElement() { + return this.axis != null && !this.axis.isEmpty(); + } + + public boolean hasAxis() { + return this.axis != null && !this.axis.isEmpty(); + } + + /** + * @param value {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setAxisElement(IntegerType value) { + this.axis = value; + return this; + } + + /** + * @return Adjustment for astigmatism measured in integer degrees. + */ + public int getAxis() { + return this.axis == null || this.axis.isEmpty() ? 0 : this.axis.getValue(); + } + + /** + * @param value Adjustment for astigmatism measured in integer degrees. + */ + public VisionPrescriptionDispenseComponent setAxis(int value) { + if (this.axis == null) + this.axis = new IntegerType(); + this.axis.setValue(value); + return this; + } + + /** + * @return {@link #prism} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getPrism" gives direct access to the value + */ + public DecimalType getPrismElement() { + if (this.prism == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.prism"); + else if (Configuration.doAutoCreate()) + this.prism = new DecimalType(); // bb + return this.prism; + } + + public boolean hasPrismElement() { + return this.prism != null && !this.prism.isEmpty(); + } + + public boolean hasPrism() { + return this.prism != null && !this.prism.isEmpty(); + } + + /** + * @param value {@link #prism} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getPrism" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setPrismElement(DecimalType value) { + this.prism = value; + return this; + } + + /** + * @return Amount of prism to compensate for eye alignment in fractional units. + */ + public BigDecimal getPrism() { + return this.prism == null ? null : this.prism.getValue(); + } + + /** + * @param value Amount of prism to compensate for eye alignment in fractional units. + */ + public VisionPrescriptionDispenseComponent setPrism(BigDecimal value) { + if (value == null) + this.prism = null; + else { + if (this.prism == null) + this.prism = new DecimalType(); + this.prism.setValue(value); + } + return this; + } + + /** + * @param value Amount of prism to compensate for eye alignment in fractional units. + */ + public VisionPrescriptionDispenseComponent setPrism(long value) { + this.prism = new DecimalType(); + this.prism.setValue(value); + return this; + } + + /** + * @param value Amount of prism to compensate for eye alignment in fractional units. + */ + public VisionPrescriptionDispenseComponent setPrism(double value) { + this.prism = new DecimalType(); + this.prism.setValue(value); + return this; + } + + /** + * @return {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public Enumeration getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.base"); + else if (Configuration.doAutoCreate()) + this.base = new Enumeration(new VisionBaseEnumFactory()); // bb + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setBaseElement(Enumeration value) { + this.base = value; + return this; + } + + /** + * @return The relative base, or reference lens edge, for the prism. + */ + public VisionBase getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The relative base, or reference lens edge, for the prism. + */ + public VisionPrescriptionDispenseComponent setBase(VisionBase value) { + if (value == null) + this.base = null; + else { + if (this.base == null) + this.base = new Enumeration(new VisionBaseEnumFactory()); + this.base.setValue(value); + } + return this; + } + + /** + * @return {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value + */ + public DecimalType getAddElement() { + if (this.add == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.add"); + else if (Configuration.doAutoCreate()) + this.add = new DecimalType(); // bb + return this.add; + } + + public boolean hasAddElement() { + return this.add != null && !this.add.isEmpty(); + } + + public boolean hasAdd() { + return this.add != null && !this.add.isEmpty(); + } + + /** + * @param value {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setAddElement(DecimalType value) { + this.add = value; + return this; + } + + /** + * @return Power adjustment for multifocal lenses measured in diopters (0.25 units). + */ + public BigDecimal getAdd() { + return this.add == null ? null : this.add.getValue(); + } + + /** + * @param value Power adjustment for multifocal lenses measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setAdd(BigDecimal value) { + if (value == null) + this.add = null; + else { + if (this.add == null) + this.add = new DecimalType(); + this.add.setValue(value); + } + return this; + } + + /** + * @param value Power adjustment for multifocal lenses measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setAdd(long value) { + this.add = new DecimalType(); + this.add.setValue(value); + return this; + } + + /** + * @param value Power adjustment for multifocal lenses measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setAdd(double value) { + this.add = new DecimalType(); + this.add.setValue(value); + return this; + } + + /** + * @return {@link #power} (Contact lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value + */ + public DecimalType getPowerElement() { + if (this.power == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.power"); + else if (Configuration.doAutoCreate()) + this.power = new DecimalType(); // bb + return this.power; + } + + public boolean hasPowerElement() { + return this.power != null && !this.power.isEmpty(); + } + + public boolean hasPower() { + return this.power != null && !this.power.isEmpty(); + } + + /** + * @param value {@link #power} (Contact lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setPowerElement(DecimalType value) { + this.power = value; + return this; + } + + /** + * @return Contact lens power measured in diopters (0.25 units). + */ + public BigDecimal getPower() { + return this.power == null ? null : this.power.getValue(); + } + + /** + * @param value Contact lens power measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setPower(BigDecimal value) { + if (value == null) + this.power = null; + else { + if (this.power == null) + this.power = new DecimalType(); + this.power.setValue(value); + } + return this; + } + + /** + * @param value Contact lens power measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setPower(long value) { + this.power = new DecimalType(); + this.power.setValue(value); + return this; + } + + /** + * @param value Contact lens power measured in diopters (0.25 units). + */ + public VisionPrescriptionDispenseComponent setPower(double value) { + this.power = new DecimalType(); + this.power.setValue(value); + return this; + } + + /** + * @return {@link #backCurve} (Back curvature measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value + */ + public DecimalType getBackCurveElement() { + if (this.backCurve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.backCurve"); + else if (Configuration.doAutoCreate()) + this.backCurve = new DecimalType(); // bb + return this.backCurve; + } + + public boolean hasBackCurveElement() { + return this.backCurve != null && !this.backCurve.isEmpty(); + } + + public boolean hasBackCurve() { + return this.backCurve != null && !this.backCurve.isEmpty(); + } + + /** + * @param value {@link #backCurve} (Back curvature measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setBackCurveElement(DecimalType value) { + this.backCurve = value; + return this; + } + + /** + * @return Back curvature measured in millimeters. + */ + public BigDecimal getBackCurve() { + return this.backCurve == null ? null : this.backCurve.getValue(); + } + + /** + * @param value Back curvature measured in millimeters. + */ + public VisionPrescriptionDispenseComponent setBackCurve(BigDecimal value) { + if (value == null) + this.backCurve = null; + else { + if (this.backCurve == null) + this.backCurve = new DecimalType(); + this.backCurve.setValue(value); + } + return this; + } + + /** + * @param value Back curvature measured in millimeters. + */ + public VisionPrescriptionDispenseComponent setBackCurve(long value) { + this.backCurve = new DecimalType(); + this.backCurve.setValue(value); + return this; + } + + /** + * @param value Back curvature measured in millimeters. + */ + public VisionPrescriptionDispenseComponent setBackCurve(double value) { + this.backCurve = new DecimalType(); + this.backCurve.setValue(value); + return this; + } + + /** + * @return {@link #diameter} (Contact lens diameter measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value + */ + public DecimalType getDiameterElement() { + if (this.diameter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.diameter"); + else if (Configuration.doAutoCreate()) + this.diameter = new DecimalType(); // bb + return this.diameter; + } + + public boolean hasDiameterElement() { + return this.diameter != null && !this.diameter.isEmpty(); + } + + public boolean hasDiameter() { + return this.diameter != null && !this.diameter.isEmpty(); + } + + /** + * @param value {@link #diameter} (Contact lens diameter measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setDiameterElement(DecimalType value) { + this.diameter = value; + return this; + } + + /** + * @return Contact lens diameter measured in millimeters. + */ + public BigDecimal getDiameter() { + return this.diameter == null ? null : this.diameter.getValue(); + } + + /** + * @param value Contact lens diameter measured in millimeters. + */ + public VisionPrescriptionDispenseComponent setDiameter(BigDecimal value) { + if (value == null) + this.diameter = null; + else { + if (this.diameter == null) + this.diameter = new DecimalType(); + this.diameter.setValue(value); + } + return this; + } + + /** + * @param value Contact lens diameter measured in millimeters. + */ + public VisionPrescriptionDispenseComponent setDiameter(long value) { + this.diameter = new DecimalType(); + this.diameter.setValue(value); + return this; + } + + /** + * @param value Contact lens diameter measured in millimeters. + */ + public VisionPrescriptionDispenseComponent setDiameter(double value) { + this.diameter = new DecimalType(); + this.diameter.setValue(value); + return this; + } + + /** + * @return {@link #duration} (The recommended maximum wear period for the lens.) + */ + public SimpleQuantity getDuration() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new SimpleQuantity(); // cc + return this.duration; + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (The recommended maximum wear period for the lens.) + */ + public VisionPrescriptionDispenseComponent setDuration(SimpleQuantity value) { + this.duration = value; + return this; + } + + /** + * @return {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value + */ + public StringType getColorElement() { + if (this.color == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.color"); + else if (Configuration.doAutoCreate()) + this.color = new StringType(); // bb + return this.color; + } + + public boolean hasColorElement() { + return this.color != null && !this.color.isEmpty(); + } + + public boolean hasColor() { + return this.color != null && !this.color.isEmpty(); + } + + /** + * @param value {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setColorElement(StringType value) { + this.color = value; + return this; + } + + /** + * @return Special color or pattern. + */ + public String getColor() { + return this.color == null ? null : this.color.getValue(); + } + + /** + * @param value Special color or pattern. + */ + public VisionPrescriptionDispenseComponent setColor(String value) { + if (Utilities.noString(value)) + this.color = null; + else { + if (this.color == null) + this.color = new StringType(); + this.color.setValue(value); + } + return this; + } + + /** + * @return {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value + */ + public StringType getBrandElement() { + if (this.brand == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.brand"); + else if (Configuration.doAutoCreate()) + this.brand = new StringType(); // bb + return this.brand; + } + + public boolean hasBrandElement() { + return this.brand != null && !this.brand.isEmpty(); + } + + public boolean hasBrand() { + return this.brand != null && !this.brand.isEmpty(); + } + + /** + * @param value {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setBrandElement(StringType value) { + this.brand = value; + return this; + } + + /** + * @return Brand recommendations or restrictions. + */ + public String getBrand() { + return this.brand == null ? null : this.brand.getValue(); + } + + /** + * @param value Brand recommendations or restrictions. + */ + public VisionPrescriptionDispenseComponent setBrand(String value) { + if (Utilities.noString(value)) + this.brand = null; + else { + if (this.brand == null) + this.brand = new StringType(); + this.brand.setValue(value); + } + return this; + } + + /** + * @return {@link #notes} (Notes for special requirements such as coatings and lens materials.). 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 VisionPrescriptionDispenseComponent.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); // bb + 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 for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public VisionPrescriptionDispenseComponent setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Notes for special requirements such as coatings and lens materials. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Notes for special requirements such as coatings and lens materials. + */ + public VisionPrescriptionDispenseComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("product", "Coding", "Identifies the type of vision correction product which is required for the patient.", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("eye", "code", "The eye for which the lens applies.", 0, java.lang.Integer.MAX_VALUE, eye)); + childrenList.add(new Property("sphere", "decimal", "Lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, sphere)); + childrenList.add(new Property("cylinder", "decimal", "Power adjustment for astigmatism measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, cylinder)); + childrenList.add(new Property("axis", "integer", "Adjustment for astigmatism measured in integer degrees.", 0, java.lang.Integer.MAX_VALUE, axis)); + childrenList.add(new Property("prism", "decimal", "Amount of prism to compensate for eye alignment in fractional units.", 0, java.lang.Integer.MAX_VALUE, prism)); + childrenList.add(new Property("base", "code", "The relative base, or reference lens edge, for the prism.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("add", "decimal", "Power adjustment for multifocal lenses measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, add)); + childrenList.add(new Property("power", "decimal", "Contact lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, power)); + childrenList.add(new Property("backCurve", "decimal", "Back curvature measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, backCurve)); + childrenList.add(new Property("diameter", "decimal", "Contact lens diameter measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, diameter)); + childrenList.add(new Property("duration", "SimpleQuantity", "The recommended maximum wear period for the lens.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("color", "string", "Special color or pattern.", 0, java.lang.Integer.MAX_VALUE, color)); + childrenList.add(new Property("brand", "string", "Brand recommendations or restrictions.", 0, java.lang.Integer.MAX_VALUE, brand)); + childrenList.add(new Property("notes", "string", "Notes for special requirements such as coatings and lens materials.", 0, java.lang.Integer.MAX_VALUE, notes)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Coding + case 100913: /*eye*/ return this.eye == null ? new Base[0] : new Base[] {this.eye}; // Enumeration + case -895981619: /*sphere*/ return this.sphere == null ? new Base[0] : new Base[] {this.sphere}; // DecimalType + case -349378602: /*cylinder*/ return this.cylinder == null ? new Base[0] : new Base[] {this.cylinder}; // DecimalType + case 3008417: /*axis*/ return this.axis == null ? new Base[0] : new Base[] {this.axis}; // IntegerType + case 106935105: /*prism*/ return this.prism == null ? new Base[0] : new Base[] {this.prism}; // DecimalType + case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // Enumeration + case 96417: /*add*/ return this.add == null ? new Base[0] : new Base[] {this.add}; // DecimalType + case 106858757: /*power*/ return this.power == null ? new Base[0] : new Base[] {this.power}; // DecimalType + case 1309344840: /*backCurve*/ return this.backCurve == null ? new Base[0] : new Base[] {this.backCurve}; // DecimalType + case -233204595: /*diameter*/ return this.diameter == null ? new Base[0] : new Base[] {this.diameter}; // DecimalType + case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // SimpleQuantity + case 94842723: /*color*/ return this.color == null ? new Base[0] : new Base[] {this.color}; // StringType + case 93997959: /*brand*/ return this.brand == null ? new Base[0] : new Base[] {this.brand}; // StringType + case 105008833: /*notes*/ return this.notes == null ? new Base[0] : new Base[] {this.notes}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -309474065: // product + this.product = castToCoding(value); // Coding + break; + case 100913: // eye + this.eye = new VisionEyesEnumFactory().fromType(value); // Enumeration + break; + case -895981619: // sphere + this.sphere = castToDecimal(value); // DecimalType + break; + case -349378602: // cylinder + this.cylinder = castToDecimal(value); // DecimalType + break; + case 3008417: // axis + this.axis = castToInteger(value); // IntegerType + break; + case 106935105: // prism + this.prism = castToDecimal(value); // DecimalType + break; + case 3016401: // base + this.base = new VisionBaseEnumFactory().fromType(value); // Enumeration + break; + case 96417: // add + this.add = castToDecimal(value); // DecimalType + break; + case 106858757: // power + this.power = castToDecimal(value); // DecimalType + break; + case 1309344840: // backCurve + this.backCurve = castToDecimal(value); // DecimalType + break; + case -233204595: // diameter + this.diameter = castToDecimal(value); // DecimalType + break; + case -1992012396: // duration + this.duration = castToSimpleQuantity(value); // SimpleQuantity + break; + case 94842723: // color + this.color = castToString(value); // StringType + break; + case 93997959: // brand + this.brand = castToString(value); // StringType + break; + case 105008833: // notes + this.notes = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("product")) + this.product = castToCoding(value); // Coding + else if (name.equals("eye")) + this.eye = new VisionEyesEnumFactory().fromType(value); // Enumeration + else if (name.equals("sphere")) + this.sphere = castToDecimal(value); // DecimalType + else if (name.equals("cylinder")) + this.cylinder = castToDecimal(value); // DecimalType + else if (name.equals("axis")) + this.axis = castToInteger(value); // IntegerType + else if (name.equals("prism")) + this.prism = castToDecimal(value); // DecimalType + else if (name.equals("base")) + this.base = new VisionBaseEnumFactory().fromType(value); // Enumeration + else if (name.equals("add")) + this.add = castToDecimal(value); // DecimalType + else if (name.equals("power")) + this.power = castToDecimal(value); // DecimalType + else if (name.equals("backCurve")) + this.backCurve = castToDecimal(value); // DecimalType + else if (name.equals("diameter")) + this.diameter = castToDecimal(value); // DecimalType + else if (name.equals("duration")) + this.duration = castToSimpleQuantity(value); // SimpleQuantity + else if (name.equals("color")) + this.color = castToString(value); // StringType + else if (name.equals("brand")) + this.brand = castToString(value); // StringType + else if (name.equals("notes")) + this.notes = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -309474065: return getProduct(); // Coding + case 100913: throw new FHIRException("Cannot make property eye as it is not a complex type"); // Enumeration + case -895981619: throw new FHIRException("Cannot make property sphere as it is not a complex type"); // DecimalType + case -349378602: throw new FHIRException("Cannot make property cylinder as it is not a complex type"); // DecimalType + case 3008417: throw new FHIRException("Cannot make property axis as it is not a complex type"); // IntegerType + case 106935105: throw new FHIRException("Cannot make property prism as it is not a complex type"); // DecimalType + case 3016401: throw new FHIRException("Cannot make property base as it is not a complex type"); // Enumeration + case 96417: throw new FHIRException("Cannot make property add as it is not a complex type"); // DecimalType + case 106858757: throw new FHIRException("Cannot make property power as it is not a complex type"); // DecimalType + case 1309344840: throw new FHIRException("Cannot make property backCurve as it is not a complex type"); // DecimalType + case -233204595: throw new FHIRException("Cannot make property diameter as it is not a complex type"); // DecimalType + case -1992012396: return getDuration(); // SimpleQuantity + case 94842723: throw new FHIRException("Cannot make property color as it is not a complex type"); // StringType + case 93997959: throw new FHIRException("Cannot make property brand as it is not a complex type"); // StringType + case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("product")) { + this.product = new Coding(); + return this.product; + } + else if (name.equals("eye")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.eye"); + } + else if (name.equals("sphere")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.sphere"); + } + else if (name.equals("cylinder")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.cylinder"); + } + else if (name.equals("axis")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.axis"); + } + else if (name.equals("prism")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.prism"); + } + else if (name.equals("base")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.base"); + } + else if (name.equals("add")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.add"); + } + else if (name.equals("power")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.power"); + } + else if (name.equals("backCurve")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.backCurve"); + } + else if (name.equals("diameter")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.diameter"); + } + else if (name.equals("duration")) { + this.duration = new SimpleQuantity(); + return this.duration; + } + else if (name.equals("color")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.color"); + } + else if (name.equals("brand")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.brand"); + } + else if (name.equals("notes")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.notes"); + } + else + return super.addChild(name); + } + + public VisionPrescriptionDispenseComponent copy() { + VisionPrescriptionDispenseComponent dst = new VisionPrescriptionDispenseComponent(); + copyValues(dst); + dst.product = product == null ? null : product.copy(); + dst.eye = eye == null ? null : eye.copy(); + dst.sphere = sphere == null ? null : sphere.copy(); + dst.cylinder = cylinder == null ? null : cylinder.copy(); + dst.axis = axis == null ? null : axis.copy(); + dst.prism = prism == null ? null : prism.copy(); + dst.base = base == null ? null : base.copy(); + dst.add = add == null ? null : add.copy(); + dst.power = power == null ? null : power.copy(); + dst.backCurve = backCurve == null ? null : backCurve.copy(); + dst.diameter = diameter == null ? null : diameter.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.color = color == null ? null : color.copy(); + dst.brand = brand == null ? null : brand.copy(); + dst.notes = notes == null ? null : notes.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof VisionPrescriptionDispenseComponent)) + return false; + VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; + return compareDeep(product, o.product, true) && compareDeep(eye, o.eye, true) && compareDeep(sphere, o.sphere, true) + && compareDeep(cylinder, o.cylinder, true) && compareDeep(axis, o.axis, true) && compareDeep(prism, o.prism, true) + && compareDeep(base, o.base, true) && compareDeep(add, o.add, true) && compareDeep(power, o.power, true) + && compareDeep(backCurve, o.backCurve, true) && compareDeep(diameter, o.diameter, true) && compareDeep(duration, o.duration, true) + && compareDeep(color, o.color, true) && compareDeep(brand, o.brand, true) && compareDeep(notes, o.notes, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof VisionPrescriptionDispenseComponent)) + return false; + VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; + return compareValues(eye, o.eye, true) && compareValues(sphere, o.sphere, true) && compareValues(cylinder, o.cylinder, true) + && compareValues(axis, o.axis, true) && compareValues(prism, o.prism, true) && compareValues(base, o.base, true) + && compareValues(add, o.add, true) && compareValues(power, o.power, true) && compareValues(backCurve, o.backCurve, true) + && compareValues(diameter, o.diameter, true) && compareValues(color, o.color, true) && compareValues(brand, o.brand, true) + && compareValues(notes, o.notes, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (product == null || product.isEmpty()) && (eye == null || eye.isEmpty()) + && (sphere == null || sphere.isEmpty()) && (cylinder == null || cylinder.isEmpty()) && (axis == null || axis.isEmpty()) + && (prism == null || prism.isEmpty()) && (base == null || base.isEmpty()) && (add == null || add.isEmpty()) + && (power == null || power.isEmpty()) && (backCurve == null || backCurve.isEmpty()) && (diameter == null || diameter.isEmpty()) + && (duration == null || duration.isEmpty()) && (color == null || color.isEmpty()) && (brand == null || brand.isEmpty()) + && (notes == null || notes.isEmpty()); + } + + public String fhirType() { + return "VisionPrescription.dispense"; + + } + + } + + /** + * Business identifier which may be used by other parties to reference or identify the prescription. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business identifier", formalDefinition="Business identifier which may be used by other parties to reference or identify the prescription." ) + protected List identifier; + + /** + * The date (and perhaps time) when the prescription was written. + */ + @Child(name = "dateWritten", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) + protected DateTimeType dateWritten; + + /** + * A link to a resource representing the person to whom the vision products will be supplied. + */ + @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the vision products will be supplied." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person to whom the vision products will be supplied.) + */ + protected Patient patientTarget; + + /** + * The healthcare professional responsible for authorizing the prescription. + */ + @Child(name = "prescriber", type = {Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who authorizes the vision product", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) + protected Reference prescriber; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) + */ + protected Practitioner prescriberTarget; + + /** + * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. + */ + @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + protected Encounter encounterTarget; + + /** + * Can be the reason or the indication for writing the prescription. + */ + @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) + protected Type reason; + + /** + * Deals with details of the dispense part of the supply specification. + */ + @Child(name = "dispense", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Vision supply authorization", formalDefinition="Deals with details of the dispense part of the supply specification." ) + protected List dispense; + + private static final long serialVersionUID = -1108276057L; + + /** + * Constructor + */ + public VisionPrescription() { + super(); + } + + /** + * @return {@link #identifier} (Business identifier which may be used by other parties to reference or identify the prescription.) + */ + 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} (Business identifier which may be used by other parties to reference or identify the prescription.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + // syntactic sugar + public VisionPrescription addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public DateTimeType getDateWrittenElement() { + if (this.dateWritten == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.dateWritten"); + else if (Configuration.doAutoCreate()) + this.dateWritten = new DateTimeType(); // bb + return this.dateWritten; + } + + public boolean hasDateWrittenElement() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + public boolean hasDateWritten() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + /** + * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public VisionPrescription setDateWrittenElement(DateTimeType value) { + this.dateWritten = value; + return this; + } + + /** + * @return The date (and perhaps time) when the prescription was written. + */ + public Date getDateWritten() { + return this.dateWritten == null ? null : this.dateWritten.getValue(); + } + + /** + * @param value The date (and perhaps time) when the prescription was written. + */ + public VisionPrescription setDateWritten(Date value) { + if (value == null) + this.dateWritten = null; + else { + if (this.dateWritten == null) + this.dateWritten = new DateTimeType(); + this.dateWritten.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the vision products will be supplied.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person to whom the vision products will be supplied.) + */ + public VisionPrescription 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. (A link to a resource representing the person to whom the vision products will be supplied.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (A link to a resource representing the person to whom the vision products will be supplied.) + */ + public VisionPrescription setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public Reference getPrescriber() { + if (this.prescriber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriber = new Reference(); // cc + return this.prescriber; + } + + public boolean hasPrescriber() { + return this.prescriber != null && !this.prescriber.isEmpty(); + } + + /** + * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public VisionPrescription setPrescriber(Reference value) { + this.prescriber = value; + return this; + } + + /** + * @return {@link #prescriber} 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 healthcare professional responsible for authorizing the prescription.) + */ + public Practitioner getPrescriberTarget() { + if (this.prescriberTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriberTarget = new Practitioner(); // aa + return this.prescriberTarget; + } + + /** + * @param value {@link #prescriber} 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 healthcare professional responsible for authorizing the prescription.) + */ + public VisionPrescription setPrescriberTarget(Practitioner value) { + this.prescriberTarget = value; + return this; + } + + /** + * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public VisionPrescription 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public VisionPrescription setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public CodeableConcept getReasonCodeableConcept() throws FHIRException { + if (!(this.reason instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + public boolean hasReasonCodeableConcept() { + return this.reason instanceof CodeableConcept; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public Reference getReasonReference() throws FHIRException { + if (!(this.reason instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReasonReference() { + return this.reason instanceof Reference; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public VisionPrescription setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #dispense} (Deals with details of the dispense part of the supply specification.) + */ + public List getDispense() { + if (this.dispense == null) + this.dispense = new ArrayList(); + return this.dispense; + } + + public boolean hasDispense() { + if (this.dispense == null) + return false; + for (VisionPrescriptionDispenseComponent item : this.dispense) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dispense} (Deals with details of the dispense part of the supply specification.) + */ + // syntactic sugar + public VisionPrescriptionDispenseComponent addDispense() { //3 + VisionPrescriptionDispenseComponent t = new VisionPrescriptionDispenseComponent(); + if (this.dispense == null) + this.dispense = new ArrayList(); + this.dispense.add(t); + return t; + } + + // syntactic sugar + public VisionPrescription addDispense(VisionPrescriptionDispenseComponent t) { //3 + if (t == null) + return this; + if (this.dispense == null) + this.dispense = new ArrayList(); + this.dispense.add(t); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Business identifier which may be used by other parties to reference or identify the prescription.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the vision products will be supplied.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the supply specification.", 0, java.lang.Integer.MAX_VALUE, dispense)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1496880759: /*dateWritten*/ return this.dateWritten == null ? new Base[0] : new Base[] {this.dateWritten}; // DateTimeType + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 1430631077: /*prescriber*/ return this.prescriber == null ? new Base[0] : new Base[] {this.prescriber}; // Reference + case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type + case 284885341: /*dispense*/ return this.dispense == null ? new Base[0] : this.dispense.toArray(new Base[this.dispense.size()]); // VisionPrescriptionDispenseComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1496880759: // dateWritten + this.dateWritten = castToDateTime(value); // DateTimeType + break; + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 1430631077: // prescriber + this.prescriber = castToReference(value); // Reference + break; + case 1524132147: // encounter + this.encounter = castToReference(value); // Reference + break; + case -934964668: // reason + this.reason = (Type) value; // Type + break; + case 284885341: // dispense + this.getDispense().add((VisionPrescriptionDispenseComponent) value); // VisionPrescriptionDispenseComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("dateWritten")) + this.dateWritten = castToDateTime(value); // DateTimeType + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("prescriber")) + this.prescriber = castToReference(value); // Reference + else if (name.equals("encounter")) + this.encounter = castToReference(value); // Reference + else if (name.equals("reason[x]")) + this.reason = (Type) value; // Type + else if (name.equals("dispense")) + this.getDispense().add((VisionPrescriptionDispenseComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case -1496880759: throw new FHIRException("Cannot make property dateWritten as it is not a complex type"); // DateTimeType + case -791418107: return getPatient(); // Reference + case 1430631077: return getPrescriber(); // Reference + case 1524132147: return getEncounter(); // Reference + case -669418564: return getReason(); // Type + case 284885341: return addDispense(); // VisionPrescriptionDispenseComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("dateWritten")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.dateWritten"); + } + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; + } + else if (name.equals("prescriber")) { + this.prescriber = new Reference(); + return this.prescriber; + } + else if (name.equals("encounter")) { + this.encounter = new Reference(); + return this.encounter; + } + else if (name.equals("reasonCodeableConcept")) { + this.reason = new CodeableConcept(); + return this.reason; + } + else if (name.equals("reasonReference")) { + this.reason = new Reference(); + return this.reason; + } + else if (name.equals("dispense")) { + return addDispense(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "VisionPrescription"; + + } + + public VisionPrescription copy() { + VisionPrescription dst = new VisionPrescription(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.prescriber = prescriber == null ? null : prescriber.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.reason = reason == null ? null : reason.copy(); + if (dispense != null) { + dst.dispense = new ArrayList(); + for (VisionPrescriptionDispenseComponent i : dispense) + dst.dispense.add(i.copy()); + }; + return dst; + } + + protected VisionPrescription typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof VisionPrescription)) + return false; + VisionPrescription o = (VisionPrescription) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(dateWritten, o.dateWritten, true) + && compareDeep(patient, o.patient, true) && compareDeep(prescriber, o.prescriber, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(reason, o.reason, true) && compareDeep(dispense, o.dispense, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof VisionPrescription)) + return false; + VisionPrescription o = (VisionPrescription) other; + return compareValues(dateWritten, o.dateWritten, true); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) + && (patient == null || patient.isEmpty()) && (prescriber == null || prescriber.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (reason == null || reason.isEmpty()) && (dispense == null || dispense.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.VisionPrescription; + } + + /** + * Search parameter: datewritten + *

+ * Description: Return prescriptions written on this date
+ * Type: date
+ * Path: VisionPrescription.dateWritten
+ *

+ */ + @SearchParamDefinition(name="datewritten", path="VisionPrescription.dateWritten", description="Return prescriptions written on this date", type="date" ) + public static final String SP_DATEWRITTEN = "datewritten"; + /** + * Fluent Client search parameter constant for datewritten + *

+ * Description: Return prescriptions written on this date
+ * Type: date
+ * Path: VisionPrescription.dateWritten
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATEWRITTEN = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATEWRITTEN); + + /** + * Search parameter: patient + *

+ * Description: The identity of a patient to list dispenses for
+ * Type: reference
+ * Path: VisionPrescription.patient
+ *

+ */ + @SearchParamDefinition(name="patient", path="VisionPrescription.patient", description="The identity of a patient to list dispenses for", type="reference" ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: The identity of a patient to list dispenses for
+ * Type: reference
+ * Path: VisionPrescription.patient
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "VisionPrescription:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("VisionPrescription:patient").toLocked(); + + /** + * Search parameter: prescriber + *

+ * Description: Who authorizes the vision product
+ * Type: reference
+ * Path: VisionPrescription.prescriber
+ *

+ */ + @SearchParamDefinition(name="prescriber", path="VisionPrescription.prescriber", description="Who authorizes the vision product", type="reference" ) + public static final String SP_PRESCRIBER = "prescriber"; + /** + * Fluent Client search parameter constant for prescriber + *

+ * Description: Who authorizes the vision product
+ * Type: reference
+ * Path: VisionPrescription.prescriber
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIBER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "VisionPrescription:prescriber". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIBER = new ca.uhn.fhir.model.api.Include("VisionPrescription:prescriber").toLocked(); + + /** + * Search parameter: encounter + *

+ * Description: Return prescriptions with this encounter identifier
+ * Type: reference
+ * Path: VisionPrescription.encounter
+ *

+ */ + @SearchParamDefinition(name="encounter", path="VisionPrescription.encounter", description="Return prescriptions with this encounter identifier", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + /** + * Fluent Client search parameter constant for encounter + *

+ * Description: Return prescriptions with this encounter identifier
+ * Type: reference
+ * Path: VisionPrescription.encounter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "VisionPrescription:encounter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("VisionPrescription:encounter").toLocked(); + + /** + * Search parameter: identifier + *

+ * Description: Return prescriptions with this external identifier
+ * Type: token
+ * Path: VisionPrescription.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="VisionPrescription.identifier", description="Return prescriptions with this external identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Return prescriptions with this external identifier
+ * Type: token
+ * Path: VisionPrescription.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + +} + diff --git a/hapi-fhir-structures-dstu2.1/src/main/resources/.keep b/hapi-fhir-structures-dstu2.1/src/main/resources/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-structures-dstu2.1/src/main/resources/org/hl7/fhir/dstu2016may/model/fhirversion.properties b/hapi-fhir-structures-dstu2.1/src/main/resources/org/hl7/fhir/dstu2016may/model/fhirversion.properties new file mode 100644 index 00000000000..2415b72b994 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/main/resources/org/hl7/fhir/dstu2016may/model/fhirversion.properties @@ -0,0 +1,165 @@ +# This file contains version definitions + +resource.Account=org.hl7.fhir.dstu2016may.model.Account +resource.AllergyIntolerance=org.hl7.fhir.dstu2016may.model.AllergyIntolerance +resource.Appointment=org.hl7.fhir.dstu2016may.model.Appointment +resource.AppointmentResponse=org.hl7.fhir.dstu2016may.model.AppointmentResponse +resource.AuditEvent=org.hl7.fhir.dstu2016may.model.AuditEvent +resource.Basic=org.hl7.fhir.dstu2016may.model.Basic +resource.Binary=org.hl7.fhir.dstu2016may.model.Binary +resource.BodySite=org.hl7.fhir.dstu2016may.model.BodySite +resource.Bundle=org.hl7.fhir.dstu2016may.model.Bundle +resource.CarePlan=org.hl7.fhir.dstu2016may.model.CarePlan +resource.CareTeam=org.hl7.fhir.dstu2016may.model.CareTeam +resource.Claim=org.hl7.fhir.dstu2016may.model.Claim +resource.ClaimResponse=org.hl7.fhir.dstu2016may.model.ClaimResponse +resource.ClinicalImpression=org.hl7.fhir.dstu2016may.model.ClinicalImpression +resource.CodeSystem=org.hl7.fhir.dstu2016may.model.CodeSystem +resource.Communication=org.hl7.fhir.dstu2016may.model.Communication +resource.CommunicationRequest=org.hl7.fhir.dstu2016may.model.CommunicationRequest +resource.CompartmentDefinition=org.hl7.fhir.dstu2016may.model.CompartmentDefinition +resource.Composition=org.hl7.fhir.dstu2016may.model.Composition +resource.ConceptMap=org.hl7.fhir.dstu2016may.model.ConceptMap +resource.Condition=org.hl7.fhir.dstu2016may.model.Condition +resource.Conformance=org.hl7.fhir.dstu2016may.model.Conformance +resource.Contract=org.hl7.fhir.dstu2016may.model.Contract +resource.Coverage=org.hl7.fhir.dstu2016may.model.Coverage +resource.DataElement=org.hl7.fhir.dstu2016may.model.DataElement +resource.DecisionSupportRule=org.hl7.fhir.dstu2016may.model.DecisionSupportRule +resource.DecisionSupportServiceModule=org.hl7.fhir.dstu2016may.model.DecisionSupportServiceModule +resource.DetectedIssue=org.hl7.fhir.dstu2016may.model.DetectedIssue +resource.Device=org.hl7.fhir.dstu2016may.model.Device +resource.DeviceComponent=org.hl7.fhir.dstu2016may.model.DeviceComponent +resource.DeviceMetric=org.hl7.fhir.dstu2016may.model.DeviceMetric +resource.DeviceUseRequest=org.hl7.fhir.dstu2016may.model.DeviceUseRequest +resource.DeviceUseStatement=org.hl7.fhir.dstu2016may.model.DeviceUseStatement +resource.DiagnosticOrder=org.hl7.fhir.dstu2016may.model.DiagnosticOrder +resource.DiagnosticReport=org.hl7.fhir.dstu2016may.model.DiagnosticReport +resource.DocumentManifest=org.hl7.fhir.dstu2016may.model.DocumentManifest +resource.DocumentReference=org.hl7.fhir.dstu2016may.model.DocumentReference +resource.EligibilityRequest=org.hl7.fhir.dstu2016may.model.EligibilityRequest +resource.EligibilityResponse=org.hl7.fhir.dstu2016may.model.EligibilityResponse +resource.Encounter=org.hl7.fhir.dstu2016may.model.Encounter +resource.EnrollmentRequest=org.hl7.fhir.dstu2016may.model.EnrollmentRequest +resource.EnrollmentResponse=org.hl7.fhir.dstu2016may.model.EnrollmentResponse +resource.EpisodeOfCare=org.hl7.fhir.dstu2016may.model.EpisodeOfCare +resource.ExpansionProfile=org.hl7.fhir.dstu2016may.model.ExpansionProfile +resource.ExplanationOfBenefit=org.hl7.fhir.dstu2016may.model.ExplanationOfBenefit +resource.FamilyMemberHistory=org.hl7.fhir.dstu2016may.model.FamilyMemberHistory +resource.Flag=org.hl7.fhir.dstu2016may.model.Flag +resource.Goal=org.hl7.fhir.dstu2016may.model.Goal +resource.Group=org.hl7.fhir.dstu2016may.model.Group +resource.GuidanceResponse=org.hl7.fhir.dstu2016may.model.GuidanceResponse +resource.HealthcareService=org.hl7.fhir.dstu2016may.model.HealthcareService +resource.ImagingExcerpt=org.hl7.fhir.dstu2016may.model.ImagingExcerpt +resource.ImagingObjectSelection=org.hl7.fhir.dstu2016may.model.ImagingObjectSelection +resource.ImagingStudy=org.hl7.fhir.dstu2016may.model.ImagingStudy +resource.Immunization=org.hl7.fhir.dstu2016may.model.Immunization +resource.ImmunizationRecommendation=org.hl7.fhir.dstu2016may.model.ImmunizationRecommendation +resource.ImplementationGuide=org.hl7.fhir.dstu2016may.model.ImplementationGuide +resource.Library=org.hl7.fhir.dstu2016may.model.Library +resource.Linkage=org.hl7.fhir.dstu2016may.model.Linkage +resource.List=org.hl7.fhir.dstu2016may.model.ListResource +resource.Location=org.hl7.fhir.dstu2016may.model.Location +resource.Measure=org.hl7.fhir.dstu2016may.model.Measure +resource.MeasureReport=org.hl7.fhir.dstu2016may.model.MeasureReport +resource.Media=org.hl7.fhir.dstu2016may.model.Media +resource.Medication=org.hl7.fhir.dstu2016may.model.Medication +resource.MedicationAdministration=org.hl7.fhir.dstu2016may.model.MedicationAdministration +resource.MedicationDispense=org.hl7.fhir.dstu2016may.model.MedicationDispense +resource.MedicationOrder=org.hl7.fhir.dstu2016may.model.MedicationOrder +resource.MedicationStatement=org.hl7.fhir.dstu2016may.model.MedicationStatement +resource.MessageHeader=org.hl7.fhir.dstu2016may.model.MessageHeader +resource.ModuleDefinition=org.hl7.fhir.dstu2016may.model.ModuleDefinition +resource.NamingSystem=org.hl7.fhir.dstu2016may.model.NamingSystem +resource.NutritionOrder=org.hl7.fhir.dstu2016may.model.NutritionOrder +resource.Observation=org.hl7.fhir.dstu2016may.model.Observation +resource.OperationDefinition=org.hl7.fhir.dstu2016may.model.OperationDefinition +resource.OperationOutcome=org.hl7.fhir.dstu2016may.model.OperationOutcome +resource.Order=org.hl7.fhir.dstu2016may.model.Order +resource.OrderResponse=org.hl7.fhir.dstu2016may.model.OrderResponse +resource.OrderSet=org.hl7.fhir.dstu2016may.model.OrderSet +resource.Organization=org.hl7.fhir.dstu2016may.model.Organization +resource.Parameters=org.hl7.fhir.dstu2016may.model.Parameters +resource.Patient=org.hl7.fhir.dstu2016may.model.Patient +resource.PaymentNotice=org.hl7.fhir.dstu2016may.model.PaymentNotice +resource.PaymentReconciliation=org.hl7.fhir.dstu2016may.model.PaymentReconciliation +resource.Person=org.hl7.fhir.dstu2016may.model.Person +resource.Practitioner=org.hl7.fhir.dstu2016may.model.Practitioner +resource.PractitionerRole=org.hl7.fhir.dstu2016may.model.PractitionerRole +resource.Procedure=org.hl7.fhir.dstu2016may.model.Procedure +resource.ProcedureRequest=org.hl7.fhir.dstu2016may.model.ProcedureRequest +resource.ProcessRequest=org.hl7.fhir.dstu2016may.model.ProcessRequest +resource.ProcessResponse=org.hl7.fhir.dstu2016may.model.ProcessResponse +resource.Protocol=org.hl7.fhir.dstu2016may.model.Protocol +resource.Provenance=org.hl7.fhir.dstu2016may.model.Provenance +resource.Questionnaire=org.hl7.fhir.dstu2016may.model.Questionnaire +resource.QuestionnaireResponse=org.hl7.fhir.dstu2016may.model.QuestionnaireResponse +resource.ReferralRequest=org.hl7.fhir.dstu2016may.model.ReferralRequest +resource.RelatedPerson=org.hl7.fhir.dstu2016may.model.RelatedPerson +resource.RiskAssessment=org.hl7.fhir.dstu2016may.model.RiskAssessment +resource.Schedule=org.hl7.fhir.dstu2016may.model.Schedule +resource.SearchParameter=org.hl7.fhir.dstu2016may.model.SearchParameter +resource.Sequence=org.hl7.fhir.dstu2016may.model.Sequence +resource.Slot=org.hl7.fhir.dstu2016may.model.Slot +resource.Specimen=org.hl7.fhir.dstu2016may.model.Specimen +resource.StructureDefinition=org.hl7.fhir.dstu2016may.model.StructureDefinition +resource.StructureMap=org.hl7.fhir.dstu2016may.model.StructureMap +resource.Subscription=org.hl7.fhir.dstu2016may.model.Subscription +resource.Substance=org.hl7.fhir.dstu2016may.model.Substance +resource.SupplyDelivery=org.hl7.fhir.dstu2016may.model.SupplyDelivery +resource.SupplyRequest=org.hl7.fhir.dstu2016may.model.SupplyRequest +resource.Task=org.hl7.fhir.dstu2016may.model.Task +resource.TestScript=org.hl7.fhir.dstu2016may.model.TestScript +resource.ValueSet=org.hl7.fhir.dstu2016may.model.ValueSet +resource.VisionPrescription=org.hl7.fhir.dstu2016may.model.VisionPrescription + +datatype.ActionDefinition=org.hl7.fhir.dstu2016may.model.ActionDefinition +datatype.Address=org.hl7.fhir.dstu2016may.model.Address +datatype.Age=org.hl7.fhir.dstu2016may.model.Age +datatype.Annotation=org.hl7.fhir.dstu2016may.model.Annotation +datatype.Attachment=org.hl7.fhir.dstu2016may.model.Attachment +datatype.CodeableConcept=org.hl7.fhir.dstu2016may.model.CodeableConcept +datatype.Coding=org.hl7.fhir.dstu2016may.model.Coding +datatype.ContactPoint=org.hl7.fhir.dstu2016may.model.ContactPoint +datatype.Count=org.hl7.fhir.dstu2016may.model.Count +datatype.DataRequirement=org.hl7.fhir.dstu2016may.model.DataRequirement +datatype.Distance=org.hl7.fhir.dstu2016may.model.Distance +datatype.Duration=org.hl7.fhir.dstu2016may.model.Duration +datatype.ElementDefinition=org.hl7.fhir.dstu2016may.model.ElementDefinition +datatype.Extension=org.hl7.fhir.dstu2016may.model.Extension +datatype.HumanName=org.hl7.fhir.dstu2016may.model.HumanName +datatype.Identifier=org.hl7.fhir.dstu2016may.model.Identifier +datatype.Meta=org.hl7.fhir.dstu2016may.model.Meta +datatype.ModuleMetadata=org.hl7.fhir.dstu2016may.model.ModuleMetadata +datatype.Money=org.hl7.fhir.dstu2016may.model.Money +datatype.Narrative=org.hl7.fhir.dstu2016may.model.Narrative +datatype.ParameterDefinition=org.hl7.fhir.dstu2016may.model.ParameterDefinition +datatype.Period=org.hl7.fhir.dstu2016may.model.Period +datatype.Quantity=org.hl7.fhir.dstu2016may.model.Quantity +datatype.Range=org.hl7.fhir.dstu2016may.model.Range +datatype.Ratio=org.hl7.fhir.dstu2016may.model.Ratio +datatype.Reference=org.hl7.fhir.dstu2016may.model.Reference +datatype.SampledData=org.hl7.fhir.dstu2016may.model.SampledData +datatype.Signature=org.hl7.fhir.dstu2016may.model.Signature +datatype.SimpleQuantity=org.hl7.fhir.dstu2016may.model.SimpleQuantity +datatype.Timing=org.hl7.fhir.dstu2016may.model.Timing +datatype.TriggerDefinition=org.hl7.fhir.dstu2016may.model.TriggerDefinition +datatype.base64binary=org.hl7.fhir.dstu2016may.model.Base64BinaryType +datatype.boolean=org.hl7.fhir.dstu2016may.model.BooleanType +datatype.code=org.hl7.fhir.dstu2016may.model.CodeType +datatype.code.2=org.hl7.fhir.dstu2016may.model.Enumeration +datatype.date=org.hl7.fhir.dstu2016may.model.DateType +datatype.dateTime=org.hl7.fhir.dstu2016may.model.DateTimeType +datatype.decimal=org.hl7.fhir.dstu2016may.model.DecimalType +datatype.id=org.hl7.fhir.dstu2016may.model.IdType +datatype.instant=org.hl7.fhir.dstu2016may.model.InstantType +datatype.integer=org.hl7.fhir.dstu2016may.model.IntegerType +datatype.markdown=org.hl7.fhir.dstu2016may.model.MarkdownType +datatype.oid=org.hl7.fhir.dstu2016may.model.OidType +datatype.positiveInt=org.hl7.fhir.dstu2016may.model.PositiveIntType +datatype.string=org.hl7.fhir.dstu2016may.model.StringType +datatype.time=org.hl7.fhir.dstu2016may.model.TimeType +datatype.unsignedInt=org.hl7.fhir.dstu2016may.model.UnsignedIntType +datatype.uri=org.hl7.fhir.dstu2016may.model.UriType +datatype.xhtml=org.hl7.fhir.utilities.xhtml.XhtmlNode diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/IdTypeDstu21Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/IdTypeDstu21Test.java new file mode 100644 index 00000000000..792f2bf6c01 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/IdTypeDstu21Test.java @@ -0,0 +1,240 @@ +package ca.uhn.fhir.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.math.BigDecimal; + +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.Reference; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.util.TestUtil; + +public class IdTypeDstu21Test { + + private static FhirContext ourCtx; + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(IdTypeDstu21Test.class); + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + @Test + public void testDetectLocal() { + IdType id; + + id = new IdType("#123"); + assertEquals("#123", id.getValue()); + assertTrue(id.isLocal()); + + id = new IdType("#Medication/499059CE-CDD4-48BC-9014-528A35D15CED/_history/1"); + assertEquals("#Medication/499059CE-CDD4-48BC-9014-528A35D15CED/_history/1", id.getValue()); + assertTrue(id.isLocal()); + + id = new IdType("http://example.com/Patient/33#123"); + assertEquals("http://example.com/Patient/33#123", id.getValue()); + assertFalse(id.isLocal()); + } + + @Test + public void testConstructorsWithNullArguments() { + IdType id = new IdType(null, null, null); + assertEquals(null, id.getValue()); + } + + @Test + public void testDetectLocalBase() { + assertEquals("urn:uuid:180f219f-97a8-486d-99d9-ed631fe4fc57", new IdType("urn:uuid:180f219f-97a8-486d-99d9-ed631fe4fc57").getValue()); + assertEquals("urn:uuid:", new IdType("urn:uuid:180f219f-97a8-486d-99d9-ed631fe4fc57").getBaseUrl()); + assertEquals("180f219f-97a8-486d-99d9-ed631fe4fc57", new IdType("urn:uuid:180f219f-97a8-486d-99d9-ed631fe4fc57").getIdPart()); + + assertEquals("cid:180f219f-97a8-486d-99d9-ed631fe4fc57", new IdType("cid:180f219f-97a8-486d-99d9-ed631fe4fc57").getValue()); + assertEquals("cid:", new IdType("cid:180f219f-97a8-486d-99d9-ed631fe4fc57").getBaseUrl()); + assertEquals("180f219f-97a8-486d-99d9-ed631fe4fc57", new IdType("cid:180f219f-97a8-486d-99d9-ed631fe4fc57").getIdPart()); + + assertEquals("#180f219f-97a8-486d-99d9-ed631fe4fc57", new IdType("#180f219f-97a8-486d-99d9-ed631fe4fc57").getValue()); + assertEquals("#", new IdType("#180f219f-97a8-486d-99d9-ed631fe4fc57").getBaseUrl()); + assertEquals("180f219f-97a8-486d-99d9-ed631fe4fc57", new IdType("#180f219f-97a8-486d-99d9-ed631fe4fc57").getIdPart()); + } + + + /** + * See #67 + */ + @Test + public void testComplicatedLocal() { + IdType id = new IdType("#Patient/cid:Patient-72/_history/1"); + assertTrue(id.isLocal()); + assertEquals("#", id.getBaseUrl()); + assertNull(id.getResourceType()); + assertNull(id.getVersionIdPart()); + assertEquals("Patient/cid:Patient-72/_history/1", id.getIdPart()); + + IdType id2 = new IdType("#Patient/cid:Patient-72/_history/1"); + assertEquals(id, id2); + + id2 = id2.toUnqualified(); + assertFalse(id2.isLocal()); + assertNull(id2.getBaseUrl()); + assertNull(id2.getResourceType()); + assertNull(id2.getVersionIdPart()); + assertEquals("Patient/cid:Patient-72/_history/1", id2.getIdPart()); + + } + + @Test + public void testDetermineBase() { + + IdType rr; + + rr = new IdType("http://foo/fhir/Organization/123"); + assertEquals("http://foo/fhir", rr.getBaseUrl()); + + rr = new IdType("http://foo/fhir/Organization/123/_history/123"); + assertEquals("http://foo/fhir", rr.getBaseUrl()); + + rr = new IdType("Organization/123/_history/123"); + assertEquals(null, rr.getBaseUrl()); + + } + + @Test + public void testParseValueAbsolute() { + Patient patient = new Patient(); + IdType rr = new IdType(); + rr.setValue("http://foo/fhir/Organization/123"); + + patient.setManagingOrganization(new Reference(rr)); + + Patient actual = parseAndEncode(patient); + Reference ref = actual.getManagingOrganization(); + assertEquals("Organization", ref.getReferenceElement().getResourceType()); + assertEquals("123", ref.getReferenceElement().getIdPart()); + + } + + @Test + public void testBigDecimalIds() { + + IdType id = new IdType(new BigDecimal("123")); + assertEquals(id.getIdPartAsBigDecimal(), new BigDecimal("123")); + + } + + @Test + public void testParseValueAbsoluteWithVersion() { + Patient patient = new Patient(); + IdType rr = new IdType(); + rr.setValue("http://foo/fhir/Organization/123/_history/999"); + patient.setManagingOrganization(new Reference(rr)); + + Patient actual = parseAndEncode(patient); + Reference ref = actual.getManagingOrganization(); + assertEquals("Organization", ref.getReferenceElement().getResourceType()); + assertEquals("123", ref.getReferenceElement().getIdPart()); + assertEquals(null, ref.getReferenceElement().getVersionIdPart()); + + } + + + @Test + public void testViewMethods() { + IdType i = new IdType("http://foo/fhir/Organization/123/_history/999"); + assertEquals("Organization/123/_history/999", i.toUnqualified().getValue()); + assertEquals("http://foo/fhir/Organization/123", i.toVersionless().getValue()); + assertEquals("Organization/123", i.toUnqualifiedVersionless().getValue()); + } + + @Test + public void testParseValueWithVersion() { + Patient patient = new Patient(); + IdType rr = new IdType(); + rr.setValue("/123/_history/999"); + patient.setManagingOrganization(new Reference(rr)); + + Patient actual = parseAndEncode(patient); + Reference ref = actual.getManagingOrganization(); + assertEquals(null, ref.getReferenceElement().getResourceType()); + assertEquals("123", ref.getReferenceElement().getIdPart()); + assertEquals(null, ref.getReferenceElement().getVersionIdPart()); + + } + + @Test + public void testParseValueMissingType1() { + Patient patient = new Patient(); + IdType rr = new IdType(); + rr.setValue("/123"); + patient.setManagingOrganization(new Reference(rr)); + + Patient actual = parseAndEncode(patient); + Reference ref = actual.getManagingOrganization(); + assertEquals(null, ref.getReferenceElement().getResourceType()); + assertEquals("123", ref.getReferenceElement().getIdPart()); + + } + + @Test + public void testParseValueMissingType2() { + Patient patient = new Patient(); + IdType rr = new IdType(); + rr.setValue("123"); + patient.setManagingOrganization(new Reference(rr)); + + Patient actual = parseAndEncode(patient); + Reference ref = actual.getManagingOrganization(); + assertEquals(null, ref.getReferenceElement().getResourceType()); + assertEquals("123", ref.getReferenceElement().getIdPart()); + + } + + @Test + public void testParseValueRelative1() { + Patient patient = new Patient(); + IdType rr = new IdType(); + rr.setValue("Organization/123"); + patient.setManagingOrganization(new Reference(rr)); + + Patient actual = parseAndEncode(patient); + Reference ref = actual.getManagingOrganization(); + assertEquals("Organization", ref.getReferenceElement().getResourceType()); + assertEquals("123", ref.getReferenceElement().getIdPart()); + + } + + @Test + public void testParseValueRelative2() { + Patient patient = new Patient(); + IdType rr = new IdType(); + rr.setValue("/Organization/123"); + patient.setManagingOrganization(new Reference(rr)); + + Patient actual = parseAndEncode(patient); + Reference ref = actual.getManagingOrganization(); + assertEquals("Organization", ref.getReferenceElement().getResourceType()); + assertEquals("123", ref.getReferenceElement().getIdPart()); + + } + + private Patient parseAndEncode(Patient patient) { + String encoded = ourCtx.newXmlParser().encodeResourceToString(patient); + ourLog.info("\n" + encoded); + return ourCtx.newXmlParser().parseResource(Patient.class, encoded); + } + + @BeforeClass + public static void beforeClass() { + ourCtx = FhirContext.forDstu2_1(); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/ModelDstu21Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/ModelDstu21Test.java new file mode 100644 index 00000000000..739afecdad0 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/ModelDstu21Test.java @@ -0,0 +1,129 @@ +package ca.uhn.fhir.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Appointment; +import org.hl7.fhir.dstu2016may.model.CodeableConcept; +import org.hl7.fhir.dstu2016may.model.Element; +import org.hl7.fhir.dstu2016may.model.Enumerations; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.Practitioner; +import org.hl7.fhir.dstu2016may.model.Practitioner.PractitionerPractitionerRoleComponent; +import org.hl7.fhir.instance.model.api.IBaseElement; +import org.junit.AfterClass; +import org.junit.Ignore; +import org.junit.Test; + +import ca.uhn.fhir.context.BaseRuntimeDeclaredChildDefinition; +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.util.FhirTerser; +import ca.uhn.fhir.util.TestUtil; + +public class ModelDstu21Test { + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + + @Test + public void testElementHasInterface() { + assertTrue(IBaseElement.class.isAssignableFrom(Element.class)); + } + + + /** + * See #320 + */ + @Test + public void testDontUseBoundCodeForExampleBinding() { + Practitioner p = new Practitioner(); + PractitionerPractitionerRoleComponent role = p.addPractitionerRole(); + CodeableConcept roleField = role.getRole(); + assertEquals(CodeableConcept.class, roleField.getClass()); + } + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + /** + * See #304 + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Test + public void testPopulateWrongGenericType() { + Patient p = new Patient(); + List names = Arrays.asList("name"); + + List existingNames = p.getName(); + existingNames.addAll(names); + + try { + ourCtx.newXmlParser().encodeResourceToString(p); + } catch (ClassCastException e) { + assertEquals("Found instance of class java.lang.String - Did you set a field value to the incorrect type? Expected org.hl7.fhir.instance.model.api.IBase", e.getMessage()); + } + } + + +// private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ModelDstu21Test.class); + + + /** + * See #325 + */ + @Test + @Ignore + public void testEqualsDeep() throws Exception { + + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + Date date = dateFormat.parse("19920925"); + FhirContext context = FhirContext.forDstu2_1(); + + Patient patient1 = new Patient(); + patient1.setBirthDate(date) + .setGender(Enumerations.AdministrativeGender.MALE) + .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").addFamily("family"); + + Patient patient2 = context.newJsonParser().parseResource(Patient.class, + context.newJsonParser().encodeResourceToString(patient1)); + + assertTrue(patient1.equalsDeep(patient2)); + assertTrue(patient1.equalsShallow(patient2)); + + Patient patient3 = new Patient(); + patient3.setBirthDate(date) + .setGender(Enumerations.AdministrativeGender.MALE) + .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").addFamily("family"); + + assertTrue(patient1.equalsDeep(patient3)); + assertTrue(patient1.equalsShallow(patient3)); + + Patient patient4 = new Patient(); + patient4.setBirthDate(date) + .setGender(Enumerations.AdministrativeGender.MALE) + .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").addFamily("family2"); + + assertTrue(patient1.equalsShallow(patient4)); + assertFalse(patient1.equalsDeep(patient4)); + + Patient patient5 = new Patient(); + patient5.setBirthDate(date) + .setGender(Enumerations.AdministrativeGender.FEMALE) + .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").addFamily("family2"); + + assertFalse(patient1.equalsShallow(patient5)); + assertFalse(patient1.equalsDeep(patient5)); + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu21Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu21Test.java new file mode 100644 index 00000000000..b5e9d7831b7 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu21Test.java @@ -0,0 +1,89 @@ +package ca.uhn.fhir.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Date; + +import org.apache.commons.lang3.SerializationUtils; +import org.hl7.fhir.dstu2016may.model.Address; +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.util.TestUtil; + +public class ModelSerializationDstu21Test { + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + + /** + * Verify that MaritalStatusCodeEnum (and, by extension, BoundCodeableConcepts in general) are serializable. Author: Nick Peterson (nrpeterson@gmail.com) + */ + @Test + public void testBoundCodeableConceptSerialization() { + AdministrativeGender maritalStatus = AdministrativeGender.MALE; + byte[] bytes = SerializationUtils.serialize(maritalStatus); + assertTrue(bytes.length > 0); + + AdministrativeGender deserialized = SerializationUtils.deserialize(bytes); + assertEquals(AdministrativeGender.MALE, deserialized); + } + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + @Test + public void testBoundCodeSerialization() { + Patient p = new Patient(); + p.setGender(AdministrativeGender.MALE); + + Patient out = testIsSerializable(p); + + /* + * Make sure the binder still works for Code + */ + assertEquals(AdministrativeGender.MALE, out.getGender()); + out.getGenderElement().setValueAsString("female"); + assertEquals(AdministrativeGender.FEMALE, out.getGender()); + + } + + @SuppressWarnings("unchecked") + private T testIsSerializable(T theObject) { + byte[] bytes = SerializationUtils.serialize(theObject); + assertTrue(bytes.length > 0); + + IBaseResource obj = SerializationUtils.deserialize(bytes); + assertTrue(obj != null); + + IParser p = ourCtx.newXmlParser().setPrettyPrint(true); + assertEquals(p.encodeResourceToString(theObject), p.encodeResourceToString(obj)); + + return (T) obj; + } + + /** + * Contributed by Travis from iSalus + */ + @Test + public void testSerialization2() { + Patient patient = new Patient(); + patient.addName(new HumanName().addGiven("George").addFamily("Washington")); + patient.addName(new HumanName().addGiven("George2").addFamily("Washington2")); + patient.addAddress(new Address().addLine("line 1").addLine("line 2").setCity("city").setState("UT")); + patient.addAddress(new Address().addLine("line 1b").addLine("line 2b").setCity("cityb").setState("UT")); + patient.setBirthDate(new Date()); + + testIsSerializable(patient); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomDiagnosticReport.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomDiagnosticReport.java new file mode 100644 index 00000000000..51887943338 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomDiagnosticReport.java @@ -0,0 +1,14 @@ +package ca.uhn.fhir.parser; + +import org.hl7.fhir.dstu2016may.model.DiagnosticReport; + +import ca.uhn.fhir.model.api.annotation.ResourceDef; + +@ResourceDef(name = "DiagnosticReport", profile = CustomDiagnosticReport.PROFILE) +public class CustomDiagnosticReport extends DiagnosticReport { + + public static final String PROFILE = "http://custom_DiagnosticReport"; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomObservation.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomObservation.java new file mode 100644 index 00000000000..df61e13393d --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomObservation.java @@ -0,0 +1,14 @@ +package ca.uhn.fhir.parser; + +import org.hl7.fhir.dstu2016may.model.Observation; + +import ca.uhn.fhir.model.api.annotation.ResourceDef; + +@ResourceDef(name = "Observation", profile = CustomObservation.PROFILE) +public class CustomObservation extends Observation { + + public static final String PROFILE = "http://custom_Observation"; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomResource364Dstu21.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomResource364Dstu21.java new file mode 100644 index 00000000000..0f3aa9b9131 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomResource364Dstu21.java @@ -0,0 +1,97 @@ +package ca.uhn.fhir.parser; + +import org.hl7.fhir.dstu2016may.model.DateTimeType; +import org.hl7.fhir.dstu2016may.model.DomainResource; +import org.hl7.fhir.dstu2016may.model.ResourceType; +import org.hl7.fhir.dstu2016may.model.Type; +import org.hl7.fhir.instance.model.api.ICompositeType; + +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.util.ElementUtil; + +/** + * This is an example of a custom resource that also uses a custom + * datatype. + * + * See #364 + */ +@ResourceDef(name = "CustomResource", profile = "http://hl7.org/fhir/profiles/custom-resource", id = "custom-resource") +public class CustomResource364Dstu21 extends DomainResource { + + private static final long serialVersionUID = 1L; + + @Child(name = "baseValue", min = 1, max = Child.MAX_UNLIMITED, type= {}) + private Type baseValues; + + public Type getBaseValues() { + return baseValues; + } + + + @Override + public FhirVersionEnum getStructureFhirVersionEnum() { + return FhirVersionEnum.DSTU2_1; + } + + @Override + public boolean isEmpty() { + return ElementUtil.isEmpty(baseValues); + } + + public void setBaseValues(Type theValue) { + this.baseValues = theValue; + } + + @DatatypeDef(name="CustomDate") + public static class CustomResource364CustomDate extends Type implements ICompositeType { + + private static final long serialVersionUID = 1L; + + @Child(name = "date", order = 0, min = 1, max = 1, type = { DateTimeDt.class }) + private DateTimeType date; + + + public DateTimeType getDate() { + if (date == null) + date = new DateTimeType(); + return date; + } + + @Override + public boolean isEmpty() { + return ElementUtil.isEmpty(date); + } + + public CustomResource364CustomDate setDate(DateTimeType theValue) { + date = theValue; + return this; + } + + @Override + protected CustomResource364CustomDate typedCopy() { + CustomResource364CustomDate retVal = new CustomResource364CustomDate(); + super.copyValues(retVal); + retVal.date = date; + return retVal; + } + } + + @Override + public CustomResource364Dstu21 copy() { + CustomResource364Dstu21 retVal = new CustomResource364Dstu21(); + super.copyValues(retVal); + retVal.baseValues = baseValues; + return retVal; + } + + + @Override + public ResourceType getResourceType() { + return null; + } + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu21Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu21Test.java new file mode 100644 index 00000000000..533dda85abc --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu21Test.java @@ -0,0 +1,607 @@ +package ca.uhn.fhir.parser; + +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.DateTimeType; +import org.hl7.fhir.dstu2016may.model.Extension; +import org.hl7.fhir.dstu2016may.model.Medication; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.Quantity; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.hl7.fhir.dstu2016may.model.MedicationOrder; +import org.hl7.fhir.instance.model.api.IBase; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.parser.CustomResource364Dstu21.CustomResource364CustomDate; +import ca.uhn.fhir.rest.server.AddProfileTagEnum; +import ca.uhn.fhir.util.ElementUtil; +import ca.uhn.fhir.util.TestUtil; + +public class CustomTypeDstu21Test { + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CustomTypeDstu21Test.class); + + @Before + public void before() { + ourCtx.setAddProfileTagWhenEncoding(AddProfileTagEnum.ONLY_FOR_CUSTOM); + } + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + /** + * See #364 + */ + @Test + public void testCustomTypeWithCustomDatatype() { + FhirContext context = FhirContext.forDstu2_1(); + context.registerCustomType(CustomResource364Dstu21.class); + context.registerCustomType(CustomResource364CustomDate.class); + IParser parser = context.newXmlParser(); + + CustomResource364Dstu21 resource = new CustomResource364Dstu21(); + resource.setBaseValues(new CustomResource364CustomDate().setDate(new DateTimeType("2016-05-13"))); + + String xml = parser.encodeResourceToString(resource); + ourLog.info(xml); + + //@formatter:on + assertThat(xml, stringContainsInOrder( + "", + "", + "", + "" + )); + //@formatter:on + + CustomResource364Dstu21 parsedResource = parser.parseResource(CustomResource364Dstu21.class, xml); + assertEquals("2016-05-13", ((CustomResource364CustomDate)parsedResource.getBaseValues()).getDate().getValueAsString()); + } + + /** + * See #364 + */ + @Test + public void testCustomTypeWithPrimitiveType() { + FhirContext context = FhirContext.forDstu2_1(); + context.registerCustomTypes(new ArrayList>()); + + IParser parser = context.newXmlParser(); + + CustomResource364Dstu21 resource = new CustomResource364Dstu21(); + resource.setBaseValues(new StringType("2016-05-13")); + + String xml = parser.encodeResourceToString(resource); + + //@formatter:on + assertThat(xml, stringContainsInOrder( + "", + "", + "", + "" + )); + //@formatter:on + + CustomResource364Dstu21 parsedResource = parser.parseResource(CustomResource364Dstu21.class, xml); + assertEquals("2016-05-13", ((StringType)parsedResource.getBaseValues()).getValueAsString()); + } + + + @Test + public void parseBundleWithResourceDirective() { + String input = createBundle(createResource(false), createResource(true)); + + FhirContext ctx = FhirContext.forDstu2_1(); + ctx.setDefaultTypeForProfile("http://example.com/foo", MyCustomPatient.class); + + Bundle bundle = ctx.newXmlParser().parseResource(Bundle.class, input); + + Patient res0 = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(0, res0.getMeta().getProfile().size()); + List exts = res0.getExtensionsByUrl("http://example.com/Weight"); + assertEquals(1, exts.size()); + assertEquals("185 cm", ((StringType)exts.get(0).getValue()).getValue()); + + MyCustomPatient res1 = (MyCustomPatient) bundle.getEntry().get(1).getResource(); + assertEquals(1, res1.getMeta().getProfile().size()); + assertEquals("http://example.com/foo", res1.getMeta().getProfile().get(0).getValue()); + exts = res1.getExtensionsByUrl("http://example.com/Weight"); + assertEquals(0, exts.size()); + assertEquals("185 cm", res1.getWeight().getValue()); + } + + @Test + public void parseResourceWithDirective() { + String input = createResource(true); + + FhirContext ctx = FhirContext.forDstu2_1(); + ctx.setDefaultTypeForProfile("http://example.com/foo", MyCustomPatient.class); + + MyCustomPatient parsed = (MyCustomPatient) ctx.newXmlParser().parseResource(input); + assertEquals(1, parsed.getMeta().getProfile().size()); + assertEquals("http://example.com/foo", parsed.getMeta().getProfile().get(0).getValue()); + + List exts = parsed.getExtensionsByUrl("http://example.com/Weight"); + assertEquals(0, exts.size()); + + assertEquals("185 cm", parsed.getWeight().getValue()); + } + + + @Test + public void parseResourceWithNoDirective() { + String input = createResource(true); + + FhirContext ctx = FhirContext.forDstu2_1(); + Patient parsed = (Patient) ctx.newXmlParser().parseResource(input); + assertEquals(1, parsed.getMeta().getProfile().size()); + assertEquals("http://example.com/foo", parsed.getMeta().getProfile().get(0).getValue()); + + List exts = parsed.getExtensionsByUrl("http://example.com/Weight"); + assertEquals(1, exts.size()); + assertEquals("185 cm", ((StringType)exts.get(0).getValue()).getValue()); + } + + @Test + public void testAccessEmptyMetaLists() { + Patient p = new Patient(); + assertThat(p.getMeta().getProfile(), empty()); + assertThat(p.getMeta().getFormatCommentsPost(), empty()); + assertThat(p.getMeta().getFormatCommentsPre(), empty()); + assertThat(p.getMeta().getLastUpdated(), nullValue()); + assertThat(p.getMeta().getSecurity(), empty()); + assertThat(p.getMeta().getSecurity("foo", "bar"), nullValue()); + assertThat(p.getMeta().getTag(), empty()); + assertThat(p.getMeta().getTag("foo", "bar"), nullValue()); + assertThat(p.getMeta().getVersionId(), nullValue()); + + } + + @Test + public void testEncodeCompleteMetaLists() { + Patient p = new Patient(); + p.getMeta().addProfile("http://foo/profile1"); + p.getMeta().addProfile("http://foo/profile2"); + p.getMeta().addSecurity().setSystem("SEC_S1").setCode("SEC_C1").setDisplay("SED_D1"); + p.getMeta().addSecurity().setSystem("SEC_S2").setCode("SEC_C2").setDisplay("SED_D2"); + p.getMeta().addTag().setSystem("TAG_S1").setCode("TAG_C1").setDisplay("TAG_D1"); + p.getMeta().addTag().setSystem("TAG_S2").setCode("TAG_C2").setDisplay("TAG_D2"); + + String out = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(out); + + //@formatter:off + assertThat(out, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + } + + @Test + public void testEncodeWithCustomType() { + + MyCustomPatient patient = new MyCustomPatient(); + + patient.addIdentifier().setSystem("urn:system").setValue("1234"); + patient.addName().addFamily("Rossi").addGiven("Mario"); + patient.setInsulinLevel(new Quantity()); + patient.setGlucoseLevel(new Quantity()); + patient.setHbA1c(new Quantity()); + patient.setBloodPressure(new Quantity()); + patient.setCholesterol(new Quantity()); + patient.setWeight(new StringDt("80 kg")); + patient.setWeight(new StringDt("185 cm")); + patient.setCheckDates(new ArrayList()); + patient.getCheckDates().add(new DateTimeDt("2014-01-26T11:11:11")); + + ourCtx.setAddProfileTagWhenEncoding(AddProfileTagEnum.ONLY_FOR_CUSTOM); + IParser p = ourCtx.newXmlParser().setPrettyPrint(true); + String messageString = p.encodeResourceToString(patient); + + ourLog.info(messageString); + + //@formatter:off + assertThat(messageString, stringContainsInOrder( + "", + "", + "")); + //@formatter:on + + //@formatter:off + assertThat(messageString, not(stringContainsInOrder( + "", + "", + "", + ""))); + //@formatter:on + } + + @Test + public void testEncodeWithCustomTypeAndAutoInsertedProfile() { + + MyCustomPatient patient = new MyCustomPatient(); + + patient.getMeta().addProfile("http://example.com/foo"); + patient.getMeta().addProfile("http://example.com/bar"); + + patient.addIdentifier().setSystem("urn:system").setValue("1234"); + patient.addName().addFamily("Rossi").addGiven("Mario"); + patient.setInsulinLevel(new Quantity()); + patient.setGlucoseLevel(new Quantity()); + patient.setHbA1c(new Quantity()); + patient.setBloodPressure(new Quantity()); + patient.setCholesterol(new Quantity()); + patient.setWeight(new StringDt("80 kg")); + patient.setWeight(new StringDt("185 cm")); + patient.setCheckDates(new ArrayList()); + patient.getCheckDates().add(new DateTimeDt("2014-01-26T11:11:11")); + + ourCtx.setAddProfileTagWhenEncoding(AddProfileTagEnum.ONLY_FOR_CUSTOM); + IParser p = ourCtx.newXmlParser().setPrettyPrint(true); + String messageString = p.encodeResourceToString(patient); + + ourLog.info(messageString); + + //@formatter:off + assertThat(messageString, stringContainsInOrder( + "", + "", + "", + "")); + //@formatter:on + + //@formatter:off + assertThat(messageString, not(stringContainsInOrder( + "", + "", + "", + ""))); + //@formatter:on + } + + /** + * See #318 + */ + @Test + public void testParseResourceWithContainedResourcesWithProfile() { + //@formatter:off + String input = "" + + " " + + " " + + " " + + " " + + " " + + " " + + "" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + ""; + //@formatter:on + + FhirContext ctx = FhirContext.forDstu2_1(); + ctx.setDefaultTypeForProfile("http://fhir.something.com/StructureDefinition/our-medication", MyMedication.class); + + MedicationOrder mo = ctx.newXmlParser().parseResource(MedicationOrder.class, input); + assertEquals(MyMedication.class, mo.getContained().get(0).getClass()); + } + + public static String createBundle(String... theResources) { + StringBuilder b = new StringBuilder(); + b.append("\n"); + for (String next : theResources) { + b.append(" \n"); + b.append(" \n"); + b.append(next); + b.append(" \n"); + b.append(" \n"); + } + b.append(""); + return b.toString(); + } + + public static String createResource(boolean theWithProfile) { + StringBuilder b = new StringBuilder(); + b.append("\n"); + if (theWithProfile) { + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + } + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(" \n"); + b.append(""); + String input = + b.toString(); + return input; + } + + @ResourceDef(name = "Patient", profile = "http://example.com/foo") + public static class MyCustomPatient extends Patient { + + private static final long serialVersionUID = 1L; + + @Child(name = "bloodPressure") // once every 3 month. The average target is 130/80 mmHg or less + @ca.uhn.fhir.model.api.annotation.Extension(url = "http://example.com/BloodPressure", definedLocally = false, isModifier = false) + @Description(shortDefinition = "The value of the patient's blood pressure") + private Quantity myBloodPressure; + + // Dates of periodic tests + @Child(name = "CheckDates", max = Child.MAX_UNLIMITED) + @ca.uhn.fhir.model.api.annotation.Extension(url = "http://example.com/diabetes2", definedLocally = false, isModifier = true) + @Description(shortDefinition = "Dates of periodic tests") + private List myCheckDates; + + @Child(name = "cholesterol") // once a year. The target is triglycerides =< 2 mmol/l e cholesterol =< 4 mmol/l + @ca.uhn.fhir.model.api.annotation.Extension(url = "http://example.com/Cholesterol", definedLocally = false, isModifier = false) + @Description(shortDefinition = "The value of the patient's cholesterol") + private Quantity myCholesterol; + + @Child(name = "glucoseLevel") // fingerprick test + @ca.uhn.fhir.model.api.annotation.Extension(url = "http://example.com/Glucose", definedLocally = false, isModifier = false) + @Description(shortDefinition = "The value of the patient's blood glucose") + private Quantity myGlucoseLevel; + + // Periodic Tests + @Child(name = "hbA1c") // once every 6 month. The average target is 53 mmol/mol (or 7%) or less. + @ca.uhn.fhir.model.api.annotation.Extension(url = "http://example.com/HbA1c", definedLocally = false, isModifier = false) + @Description(shortDefinition = "The value of the patient's glucose") + private Quantity myHbA1c; + + @Child(name = "Height") + @ca.uhn.fhir.model.api.annotation.Extension(url = "http://example.com/Height", definedLocally = false, isModifier = false) + @Description(shortDefinition = "The patient's height in cm") + private StringDt myHeight; + + @Child(name = "insulinLevel") // Normal range is [43,208] pmol/l + @ca.uhn.fhir.model.api.annotation.Extension(url = "http://example.com/Insuline", definedLocally = false, isModifier = false) + @Description(shortDefinition = "The value of the patient's insulin") + private Quantity myInsulinLevel; + + // Other parameters + @Child(name = "weight") + @ca.uhn.fhir.model.api.annotation.Extension(url = "http://example.com/Weight", definedLocally = false, isModifier = false) + @Description(shortDefinition = "The patient's weight in Kg") + private StringDt myWeight; + + public Quantity Cholesterol() { + if (myCholesterol == null) { + myCholesterol = new Quantity(); + } + myCholesterol.getValue(); + myCholesterol.getSystem(); + myCholesterol.getCode(); + + return myCholesterol; + } + + public Quantity getBloodPressure() { + if (myBloodPressure == null) { + myBloodPressure = new Quantity(); + } + myBloodPressure.getValue(); + myBloodPressure.getSystem(); + myBloodPressure.getCode(); + + return myBloodPressure; + } + + public List getCheckDates() { + if (myCheckDates == null) { + myCheckDates = new ArrayList(); + } + return myCheckDates; + } + + public Quantity getGlucoseLevel() { + if (myGlucoseLevel == null) { + myGlucoseLevel = new Quantity(); + } + myGlucoseLevel.getValue(); + myGlucoseLevel.getSystem(); + myGlucoseLevel.getCode(); + + return myGlucoseLevel; + } + + public Quantity getHbA1c() { + if (myHbA1c == null) { + myHbA1c = new Quantity(); + } + myHbA1c.getValue(); + myHbA1c.getSystem(); + myHbA1c.getCode(); + + return myHbA1c; + } + + public StringDt getHeight() { + if (myHeight == null) { + myHeight = new StringDt(); + } + return myHeight; + } + + public Quantity getInsulinLevel() { + if (myInsulinLevel == null) { + myInsulinLevel = new Quantity(); + } + myInsulinLevel.getValue(); + myInsulinLevel.getSystem(); + myInsulinLevel.getCode(); + + return myInsulinLevel; + } + + public StringDt getWeight() { + if (myWeight == null) { + myWeight = new StringDt(); + } + return myWeight; + } + + @Override + public boolean isEmpty() { + return super.isEmpty() && ElementUtil.isEmpty(myInsulinLevel, myGlucoseLevel, myHbA1c, myBloodPressure, myCholesterol, myWeight, myHeight, myCheckDates); + } + + public void setBloodPressure(Quantity bloodPressure) { + myBloodPressure = bloodPressure; + myBloodPressure.setValue(110); + myBloodPressure.setSystem("http://unitsofmeasure.org"); + myBloodPressure.setCode("mmHg"); + } + + public void setCheckDates(List theCheckDates) { + myCheckDates = theCheckDates; + myCheckDates.add(new DateTimeDt("2010-01-02")); + } + + public void setCholesterol(Quantity cholesterol) { + myCholesterol = cholesterol; + myCholesterol.setValue(2); + myCholesterol.setSystem("http://unitsofmeasure.org"); + myCholesterol.setCode("mmol/l"); + } + + public void setGlucoseLevel(Quantity glucoseLevel) { + myGlucoseLevel = glucoseLevel; + myGlucoseLevel.setValue(95); + myGlucoseLevel.setSystem("http://unitsofmeasure.org"); + myGlucoseLevel.setCode("mg/dl"); + } + + public void setHbA1c(Quantity hba1c) { + myHbA1c = hba1c; + myHbA1c.setValue(48); + myHbA1c.setSystem("http://unitsofmeasure.org"); + myHbA1c.setCode("mmol/mol"); + } + + public void setHeight(StringDt height) { + myHeight = height; + } + + // Setter/Getter methods + public void setInsulinLevel(Quantity insulinLevel) { + myInsulinLevel = insulinLevel; + myInsulinLevel.setValue(125); + myInsulinLevel.setSystem("http://unitsofmeasure.org"); + myInsulinLevel.setCode("pmol/l"); + } + + public void setWeight(StringDt weight) { + myWeight = weight; + } + + } + + + @ResourceDef() + public static class MyMedication extends Medication + { + + private static final long serialVersionUID = 1L; + + } +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/EmptyElementWithExtensionDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/EmptyElementWithExtensionDstu3Test.java new file mode 100644 index 00000000000..4fac8c2d3b5 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/EmptyElementWithExtensionDstu3Test.java @@ -0,0 +1,84 @@ +package ca.uhn.fhir.parser; + +import static org.junit.Assert.assertEquals; + +import org.hl7.fhir.dstu2016may.model.Coding; +import org.hl7.fhir.dstu2016may.model.Extension; +import org.hl7.fhir.dstu2016may.model.Observation; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.junit.AfterClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.util.TestUtil; + +/** + * Created by Bill de Beaubien on 12/20/2015. + */ +public class EmptyElementWithExtensionDstu3Test { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(EmptyElementWithExtensionDstu3Test.class); + private static FhirContext ctx = FhirContext.forDstu2_1(); + + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + @Test + public void testNullFlavorCompositeJson() throws Exception { + Observation observation = new Observation(); + observation.getCode().addCoding().addExtension(new Extension("http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor", new StringType("UNK"))); + IParser parser = ctx.newJsonParser().setPrettyPrint(true); + String json = parser.encodeResourceToString(observation); + + ourLog.info(json); + + observation = (Observation) parser.parseResource(json); + assertEquals(1, observation.getCode().getCoding().get(0).getExtension().size()); + } + + @Test + public void testNullFlavorCompositeXml() throws Exception { + Observation observation = new Observation(); + observation.getCode().addCoding().addExtension(new Extension("http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor", new StringType("UNK"))); + IParser parser = ctx.newXmlParser().setPrettyPrint(true); + String xml = parser.encodeResourceToString(observation); + + ourLog.info(xml); + + observation = (Observation) parser.parseResource(xml); + assertEquals(1, observation.getCode().getCoding().get(0).getExtension().size()); + } + + @Test + public void testNullFlavorPrimitiveJson() throws Exception { + Observation observation = new Observation(); + observation.getCode().getCoding().add(new Coding().setSystem("http://loinc.org").setCode("3141-9")); + observation.getStatusElement().addExtension(new Extension("http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor", new StringType("UNK"))); + IParser parser = ctx.newJsonParser().setPrettyPrint(true); + String json = parser.encodeResourceToString(observation); + + ourLog.info(json); + + observation = (Observation) parser.parseResource(json); + assertEquals(1, observation.getStatusElement().getExtension().size()); + } + + @Test + public void testNullFlavorPrimitiveXml() throws Exception { + Observation observation = new Observation(); + observation.getCode().getCoding().add(new Coding().setSystem("http://loinc.org").setCode("3141-9")); + observation.getStatusElement().addExtension(new Extension("http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor", new StringType("UNK"))); + IParser parser = ctx.newXmlParser().setPrettyPrint(true); + String xml = parser.encodeResourceToString(observation); + + ourLog.info(xml); + + observation = (Observation) parser.parseResource(xml); + assertEquals(1, observation.getStatusElement().getExtension().size()); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/ErrorHandlerTest.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/ErrorHandlerTest.java new file mode 100644 index 00000000000..a8752e147e7 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/ErrorHandlerTest.java @@ -0,0 +1,96 @@ +package ca.uhn.fhir.parser; + +import static org.junit.Assert.fail; + +import org.junit.Test; + +import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2016 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +public class ErrorHandlerTest { + + @Test + public void testAdapterMethods() { + new ErrorHandlerAdapter().unexpectedRepeatingElement(null, null); + new ErrorHandlerAdapter().unknownAttribute(null, null); + new ErrorHandlerAdapter().unknownElement(null, null); + new ErrorHandlerAdapter().containedResourceWithNoId(null); + new ErrorHandlerAdapter().unknownReference(null, null); + new ErrorHandlerAdapter().missingRequiredElement(null, null); + new ErrorHandlerAdapter().incorrectJsonType(null, null, null, null); + new ErrorHandlerAdapter().invalidValue(null, null, null); + } + + @Test + public void testLenientMethods() { + new LenientErrorHandler().unexpectedRepeatingElement(null, null); + new LenientErrorHandler().unknownAttribute(null, null); + new LenientErrorHandler().unknownElement(null, null); + new LenientErrorHandler().containedResourceWithNoId(null); + new LenientErrorHandler().unknownReference(null, null); + new LenientErrorHandler().incorrectJsonType(null, null, ValueType.ARRAY, ValueType.SCALAR); + new LenientErrorHandler().setErrorOnInvalidValue(false).invalidValue(null, "FOO", ""); + new LenientErrorHandler().invalidValue(null, null, ""); + try { + new LenientErrorHandler().invalidValue(null, "FOO", ""); + fail(); + } catch (DataFormatException e) { + // good, this one method defaults to causing an error + } + } + + @Test(expected = DataFormatException.class) + public void testStrictMethods1() { + new StrictErrorHandler().unexpectedRepeatingElement(null, null); + } + + @Test(expected = DataFormatException.class) + public void testStrictMethods2() { + new StrictErrorHandler().unknownAttribute(null, null); + } + + @Test(expected = DataFormatException.class) + public void testStrictMethods3() { + new StrictErrorHandler().unknownElement(null, null); + } + + @Test(expected = DataFormatException.class) + public void testStrictMethods4() { + new StrictErrorHandler().containedResourceWithNoId(null); + } + + @Test(expected = DataFormatException.class) + public void testStrictMethods5() { + new StrictErrorHandler().unknownReference(null, null); + } + + @Test(expected = DataFormatException.class) + public void testStrictMethods6() { + new StrictErrorHandler().incorrectJsonType(null, null, ValueType.ARRAY, ValueType.SCALAR); + } + + @Test(expected = DataFormatException.class) + public void testStrictMethods7() { + new StrictErrorHandler().invalidValue(null, null, null); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/FooMessageHeader.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/FooMessageHeader.java new file mode 100644 index 00000000000..2a220518794 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/FooMessageHeader.java @@ -0,0 +1,47 @@ +package ca.uhn.fhir.parser; + +import org.hl7.fhir.dstu2016may.model.Identifier; +import org.hl7.fhir.dstu2016may.model.MessageHeader; +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Extension; +import ca.uhn.fhir.model.api.annotation.ResourceDef; + +@ResourceDef(name = "MessageHeader") +public class FooMessageHeader extends MessageHeader { + + private static final long serialVersionUID = 1L; + + @Block() + public static class FooMessageSourceComponent extends MessageHeader.MessageSourceComponent { + + private static final long serialVersionUID = 1L; + @Child(name = "ext-messageheader-application-id", type = Identifier.class, modifier = true) + @Description(shortDefinition = "Message Header Application ID") + @Extension(url = "http://foo", definedLocally = false, isModifier = false) + private Identifier messageHeaderApplicationId; + + /* + * Get messageHeaderApplicationId + */ + public Identifier getMessageHeaderApplicationId() throws FHIRException { + + if (messageHeaderApplicationId == null) { + messageHeaderApplicationId = new Identifier(); + } + return messageHeaderApplicationId; + } + + /* + * Set messageHeaderApplicationId + */ + public void setmessageHeaderApplicationId(Identifier messageHeaderApplicationId) { + this.messageHeaderApplicationId = messageHeaderApplicationId; + } + + } + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/FooMessageHeaderWithExplicitField.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/FooMessageHeaderWithExplicitField.java new file mode 100644 index 00000000000..7dc050cfbfb --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/FooMessageHeaderWithExplicitField.java @@ -0,0 +1,58 @@ +package ca.uhn.fhir.parser; + +import org.hl7.fhir.dstu2016may.model.Identifier; +import org.hl7.fhir.dstu2016may.model.MessageHeader; +import org.hl7.fhir.exceptions.FHIRException; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Extension; +import ca.uhn.fhir.model.api.annotation.ResourceDef; + +@ResourceDef(name = "FooMessageHeader") +public class FooMessageHeaderWithExplicitField extends MessageHeader { + + private static final long serialVersionUID = 1L; + + /** + * The source application from which this message originated. + */ + @Child(name = "source", type = {}, order = Child.REPLACE_PARENT, min = 1, max = 1, modifier = false, summary = true) + @Description(shortDefinition = "Message Source Application", formalDefinition = "The source application from which this message originated.") + protected FooMessageSourceComponent source; + + public void setSourceNew(FooMessageSourceComponent theSource) { + source = theSource; + } + + @Block() + public static class FooMessageSourceComponent extends MessageHeader.MessageSourceComponent { + + private static final long serialVersionUID = 1L; + @Child(name = "ext-messageheader-application-id", type = Identifier.class, modifier = true) + @Description(shortDefinition = "Message Header Application ID") + @Extension(url = "http://foo", definedLocally = false, isModifier = false) + private Identifier messageHeaderApplicationId; + + /* + * Get messageHeaderApplicationId + */ + public Identifier getMessageHeaderApplicationId() throws FHIRException { + + if (messageHeaderApplicationId == null) { + messageHeaderApplicationId = new Identifier(); + } + return messageHeaderApplicationId; + } + + /* + * Set messageHeaderApplicationId + */ + public void setmessageHeaderApplicationId(Identifier messageHeaderApplicationId) { + this.messageHeaderApplicationId = messageHeaderApplicationId; + } + + } + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/JsonParserDstu21Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/JsonParserDstu21Test.java new file mode 100644 index 00000000000..1cf79c1a769 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/JsonParserDstu21Test.java @@ -0,0 +1,1896 @@ +package ca.uhn.fhir.parser; + +import static org.apache.commons.lang3.StringUtils.countMatches; +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Matchers.eq; +import static org.mockito.Matchers.isNull; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import java.io.IOException; +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.UUID; + +import org.apache.commons.io.IOUtils; +import org.hamcrest.Matchers; +import org.hamcrest.core.StringContains; +import org.hl7.fhir.dstu2016may.model.Address.AddressUse; +import org.hl7.fhir.dstu2016may.model.Address.AddressUseEnumFactory; +import org.hl7.fhir.dstu2016may.model.Attachment; +import org.hl7.fhir.dstu2016may.model.AuditEvent; +import org.hl7.fhir.dstu2016may.model.Basic; +import org.hl7.fhir.dstu2016may.model.Binary; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleType; +import org.hl7.fhir.dstu2016may.model.Claim; +import org.hl7.fhir.dstu2016may.model.Coding; +import org.hl7.fhir.dstu2016may.model.Communication; +import org.hl7.fhir.dstu2016may.model.Condition; +import org.hl7.fhir.dstu2016may.model.Condition.ConditionVerificationStatus; +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode; +import org.hl7.fhir.dstu2016may.model.Coverage; +import org.hl7.fhir.dstu2016may.model.DateTimeType; +import org.hl7.fhir.dstu2016may.model.DateType; +import org.hl7.fhir.dstu2016may.model.DecimalType; +import org.hl7.fhir.dstu2016may.model.DiagnosticReport; +import org.hl7.fhir.dstu2016may.model.EnumFactory; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; +import org.hl7.fhir.dstu2016may.model.ExplanationOfBenefit; +import org.hl7.fhir.dstu2016may.model.Extension; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse; +import org.hl7.fhir.dstu2016may.model.Linkage; +import org.hl7.fhir.dstu2016may.model.Medication; +import org.hl7.fhir.dstu2016may.model.MedicationOrder; +import org.hl7.fhir.dstu2016may.model.Observation; +import org.hl7.fhir.dstu2016may.model.Observation.ObservationStatus; +import org.hl7.fhir.dstu2016may.model.Parameters; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.PrimitiveType; +import org.hl7.fhir.dstu2016may.model.Quantity; +import org.hl7.fhir.dstu2016may.model.QuestionnaireResponse; +import org.hl7.fhir.dstu2016may.model.Reference; +import org.hl7.fhir.dstu2016may.model.RelatedPerson; +import org.hl7.fhir.dstu2016may.model.SampledData; +import org.hl7.fhir.dstu2016may.model.SimpleQuantity; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.hl7.fhir.dstu2016may.model.UriType; +import org.hl7.fhir.dstu2016may.model.ValueSet; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.xhtml.XhtmlNode; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; + +import com.google.common.collect.Sets; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; +import ca.uhn.fhir.parser.IParserErrorHandler.IParseLocation; +import ca.uhn.fhir.parser.PatientWithExtendedContactDstu3.CustomContactComponent; +import ca.uhn.fhir.parser.XmlParserDstu3Test.TestPatientFor327; +import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.util.TestUtil; +import ca.uhn.fhir.validation.FhirValidator; +import ca.uhn.fhir.validation.ValidationResult; +import net.sf.json.JSON; +import net.sf.json.JSONSerializer; +import net.sf.json.JsonConfig; + +public class JsonParserDstu21Test { + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JsonParserDstu21Test.class); + + @After + public void after() { + ourCtx.setNarrativeGenerator(null); + } + + + + /** + * #480 + */ + @Test + public void testEncodeEmptyValue() { + QuestionnaireResponse qr = new QuestionnaireResponse(); + qr.setId("123"); + qr.getAuthoredElement().setValueAsString(""); + qr.addItem().setLinkIdElement(new StringType()); + qr.getItem().get(0).addItem().setLinkIdElement(new StringType("")); + qr.getItem().get(0).addItem().setLinkIdElement(new StringType("LINKID")); + + String encoded = ourCtx.newJsonParser().encodeResourceToString(qr); + ourLog.info(encoded); + + assertThat(encoded, stringContainsInOrder("123")); + assertThat(encoded, not(stringContainsInOrder("\"\""))); + assertThat(encoded, not(stringContainsInOrder("null"))); + } + + + + @Test + public void testEncodeAndParseExtensions() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setUse(IdentifierUse.OFFICIAL).setSystem("urn:example").setValue("7000135"); + + Extension ext = new Extension(); + ext.setUrl("http://example.com/extensions#someext"); + ext.setValue(new DateTimeType("2011-01-02T11:13:15")); + patient.addExtension(ext); + + Extension parent = new Extension().setUrl("http://example.com#parent"); + patient.addExtension(parent); + Extension child1 = new Extension().setUrl("http://example.com#child").setValue(new StringType("value1")); + parent.addExtension(child1); + Extension child2 = new Extension().setUrl("http://example.com#child").setValue(new StringType("value2")); + parent.addExtension(child2); + + Extension modExt = new Extension(); + modExt.setUrl("http://example.com/extensions#modext"); + modExt.setValue(new DateType("1995-01-02")); + patient.addModifierExtension(modExt); + + HumanName name = patient.addName(); + name.addFamily("Blah"); + StringType given = name.addGivenElement(); + given.setValue("Joe"); + Extension ext2 = new Extension().setUrl("http://examples.com#givenext").setValue(new StringType("given")); + given.addExtension(ext2); + + StringType given2 = name.addGivenElement(); + given2.setValue("Shmoe"); + Extension given2ext = new Extension().setUrl("http://examples.com#givenext_parent"); + given2.addExtension(given2ext); + given2ext.addExtension(new Extension().setUrl("http://examples.com#givenext_child").setValue(new StringType("CHILD"))); + + String output = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(patient); + ourLog.info(output); + + String enc = ourCtx.newJsonParser().encodeResourceToString(patient); + assertThat(enc, Matchers.stringContainsInOrder("{\"resourceType\":\"Patient\",", "\"extension\":[{\"url\":\"http://example.com/extensions#someext\",\"valueDateTime\":\"2011-01-02T11:13:15\"}", + "{\"url\":\"http://example.com#parent\",\"extension\":[{\"url\":\"http://example.com#child\",\"valueString\":\"value1\"},{\"url\":\"http://example.com#child\",\"valueString\":\"value2\"}]}")); + assertThat(enc, Matchers.stringContainsInOrder("\"modifierExtension\":[" + "{" + "\"url\":\"http://example.com/extensions#modext\"," + "\"valueDate\":\"1995-01-02\"" + "}" + "],")); + assertThat(enc, + containsString("\"_given\":[" + "{" + "\"extension\":[" + "{" + "\"url\":\"http://examples.com#givenext\"," + "\"valueString\":\"given\"" + "}" + "]" + "}," + "{" + "\"extension\":[" + "{" + + "\"url\":\"http://examples.com#givenext_parent\"," + "\"extension\":[" + "{" + "\"url\":\"http://examples.com#givenext_child\"," + "\"valueString\":\"CHILD\"" + "}" + "]" + "}" + + "]" + "}")); + + /* + * Now parse this back + */ + + Patient parsed = ourCtx.newJsonParser().parseResource(Patient.class, enc); + ext = parsed.getExtension().get(0); + assertEquals("http://example.com/extensions#someext", ext.getUrl()); + assertEquals("2011-01-02T11:13:15", ((DateTimeType) ext.getValue()).getValueAsString()); + + parent = patient.getExtension().get(1); + assertEquals("http://example.com#parent", parent.getUrl()); + assertNull(parent.getValue()); + child1 = parent.getExtension().get(0); + assertEquals("http://example.com#child", child1.getUrl()); + assertEquals("value1", ((StringType) child1.getValue()).getValueAsString()); + child2 = parent.getExtension().get(1); + assertEquals("http://example.com#child", child2.getUrl()); + assertEquals("value2", ((StringType) child2.getValue()).getValueAsString()); + + modExt = parsed.getModifierExtension().get(0); + assertEquals("http://example.com/extensions#modext", modExt.getUrl()); + assertEquals("1995-01-02", ((DateType) modExt.getValue()).getValueAsString()); + + name = parsed.getName().get(0); + + ext2 = name.getGiven().get(0).getExtension().get(0); + assertEquals("http://examples.com#givenext", ext2.getUrl()); + assertEquals("given", ((StringType) ext2.getValue()).getValueAsString()); + + given2ext = name.getGiven().get(1).getExtension().get(0); + assertEquals("http://examples.com#givenext_parent", given2ext.getUrl()); + assertNull(given2ext.getValue()); + Extension given2ext2 = given2ext.getExtension().get(0); + assertEquals("http://examples.com#givenext_child", given2ext2.getUrl()); + assertEquals("CHILD", ((StringType) given2ext2.getValue()).getValue()); + + } + + @Test + public void testEncodeAndParseMetaProfileAndTags() { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + + p.getMeta().addProfile("http://foo/Profile1"); + p.getMeta().addProfile("http://foo/Profile2"); + + p.getMeta().addTag().setSystem("scheme1").setCode("term1").setDisplay("label1"); + p.getMeta().addTag().setSystem("scheme2").setCode("term2").setDisplay("label2"); + + p.getMeta().addSecurity().setSystem("sec_scheme1").setCode("sec_term1").setDisplay("sec_label1"); + p.getMeta().addSecurity().setSystem("sec_scheme2").setCode("sec_term2").setDisplay("sec_label2"); + + String enc = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + + //@formatter:off + assertThat(enc, stringContainsInOrder("\"meta\": {", + "\"profile\": [", + "\"http://foo/Profile1\",", + "\"http://foo/Profile2\"", + "],", + "\"security\": [", + "{", + "\"system\": \"sec_scheme1\",", + "\"code\": \"sec_term1\",", + "\"display\": \"sec_label1\"", + "},", + "{", + "\"system\": \"sec_scheme2\",", + "\"code\": \"sec_term2\",", + "\"display\": \"sec_label2\"", + "}", + "],", + "\"tag\": [", + "{", + "\"system\": \"scheme1\",", + "\"code\": \"term1\",", + "\"display\": \"label1\"", + "},", + "{", + "\"system\": \"scheme2\",", + "\"code\": \"term2\",", + "\"display\": \"label2\"", + "}", + "]", + "},")); + //@formatter:on + + Patient parsed = ourCtx.newJsonParser().parseResource(Patient.class, enc); + + List gotLabels = parsed.getMeta().getProfile(); + assertEquals(2, gotLabels.size()); + UriType label = gotLabels.get(0); + assertEquals("http://foo/Profile1", label.getValue()); + label = gotLabels.get(1); + assertEquals("http://foo/Profile2", label.getValue()); + + List tagList = parsed.getMeta().getTag(); + assertEquals(2, tagList.size()); + assertEquals("scheme1", tagList.get(0).getSystem()); + assertEquals("term1", tagList.get(0).getCode()); + assertEquals("label1", tagList.get(0).getDisplay()); + assertEquals("scheme2", tagList.get(1).getSystem()); + assertEquals("term2", tagList.get(1).getCode()); + assertEquals("label2", tagList.get(1).getDisplay()); + + tagList = parsed.getMeta().getSecurity(); + assertEquals(2, tagList.size()); + assertEquals("sec_scheme1", tagList.get(0).getSystem()); + assertEquals("sec_term1", tagList.get(0).getCode()); + assertEquals("sec_label1", tagList.get(0).getDisplay()); + assertEquals("sec_scheme2", tagList.get(1).getSystem()); + assertEquals("sec_term2", tagList.get(1).getCode()); + assertEquals("sec_label2", tagList.get(1).getDisplay()); + } + + /** + * See #336 + */ + @Test + public void testEncodeAndParseNullPrimitiveWithExtensions() { + + Patient p = new Patient(); + p.setId("patid"); + HumanName name = p.addName(); + name.addGivenElement().setValue(null).setId("f0").addExtension(new Extension("http://foo", new StringType("FOOEXT0"))); + name.addGivenElement().setValue("V1").setId("f1").addExtension((Extension) new Extension("http://foo", new StringType("FOOEXT1")).setId("ext1id")); + name.addGivenElement(); // this one shouldn't get encoded + name.addGivenElement().setValue(null).addExtension(new Extension("http://foo", new StringType("FOOEXT3"))); + name.setId("nameid"); + + String output = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(output); + + output = ourCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(p); + String expected = "{\"resourceType\":\"Patient\",\"id\":\"patid\",\"name\":[{\"id\":\"nameid\",\"given\":[null,\"V1\",null],\"_given\":[{\"id\":\"f0\",\"extension\":[{\"url\":\"http://foo\",\"valueString\":\"FOOEXT0\"}]},{\"id\":\"f1\",\"extension\":[{\"id\":\"ext1id\",\"url\":\"http://foo\",\"valueString\":\"FOOEXT1\"}]},{\"extension\":[{\"url\":\"http://foo\",\"valueString\":\"FOOEXT3\"}]}]}]}"; + + ourLog.info("Exp: {}", expected); + ourLog.info("Act: {}", output); + + assertEquals(expected, output); + + p = ourCtx.newJsonParser().parseResource(Patient.class, output); + assertEquals("patid", p.getIdElement().getIdPart()); + + name = p.getName().get(0); + assertEquals("nameid", name.getId()); + assertEquals(3, name.getGiven().size()); + + assertEquals(null, name.getGiven().get(0).getValue()); + assertEquals("V1", name.getGiven().get(1).getValue()); + assertEquals(null, name.getGiven().get(2).getValue()); + + assertEquals("f0", name.getGiven().get(0).getId()); + assertEquals("f1", name.getGiven().get(1).getId()); + assertEquals(null, name.getGiven().get(2).getId()); + + assertEquals(1, name.getGiven().get(0).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(0).getExtension().get(0).getUrl()); + assertEquals("FOOEXT0", ((StringType) name.getGiven().get(0).getExtension().get(0).getValue()).getValue()); + assertEquals(null, name.getGiven().get(0).getExtension().get(0).getId()); + + assertEquals(1, name.getGiven().get(1).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(1).getExtension().get(0).getUrl()); + assertEquals("FOOEXT1", ((StringType) name.getGiven().get(1).getExtension().get(0).getValue()).getValue()); + assertEquals("ext1id", name.getGiven().get(1).getExtension().get(0).getId()); + + assertEquals(1, name.getGiven().get(2).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(2).getExtension().get(0).getUrl()); + assertEquals("FOOEXT3", ((StringType) name.getGiven().get(2).getExtension().get(0).getValue()).getValue()); + assertEquals(null, name.getGiven().get(2).getExtension().get(0).getId()); + + } + + + + @Test + public void testEncodeBundleNewBundleNoText() { + + Bundle b = new Bundle(); + + BundleEntryComponent e = b.addEntry(); + e.setResource(new Patient()); + + String val = ourCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(b); + ourLog.info(val); + assertThat(val, not(containsString("text"))); + + val = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(b); + ourLog.info(val); + assertThat(val, not(containsString("text"))); + + } + + /** + * See #326 + */ + @Test + public void testEncodeContainedResource() { + Patient patient = new Patient(); + patient.getBirthDateElement().setValueAsString("2016-04-05"); + patient.addExtension().setUrl("test").setValue(new Reference(new Condition())); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(patient); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "{", + "\"resourceType\": \"Patient\",", + "\"contained\": [", + "{", + "\"resourceType\": \"Condition\",", + "\"id\": \"1\"", + "}", + "],", + "\"extension\": [", + "{", + "\"url\": \"test\",", + "\"valueReference\": {", + "\"reference\": \"#1\"", + "}", + "}", + "],", + "\"birthDate\": \"2016-04-05\"", + "}" + )); + //@formatter:on + } + + @Test + public void testEncodeDoesntIncludeUuidId() { + Patient p = new Patient(); + p.setId(new IdType("urn:uuid:42795ed8-041f-4ebf-b6f4-78ef6f64c2f2")); + p.addIdentifier().setSystem("ACME"); + + String actual = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); + assertThat(actual, not(containsString("78ef6f64c2f2"))); + } + + @Test + public void testEncodeEmptyBinary() { + String output = ourCtx.newJsonParser().encodeResourceToString(new Binary()); + assertEquals("{\"resourceType\":\"Binary\"}", output); + } + + /** + * #158 + */ + @Test + public void testEncodeEmptyTag() { + ArrayList tagList = new ArrayList(); + tagList.add(new Coding()); + tagList.add(new Coding().setDisplay("Label")); + + Patient p = new Patient(); + p.getMeta().getTag().addAll(tagList); + + String encoded = ourCtx.newJsonParser().encodeResourceToString(p); + assertThat(encoded, not(containsString("tag"))); + } + + /** + * #158 + */ + @Test + public void testEncodeEmptyTag2() { + ArrayList tagList = new ArrayList(); + tagList.add(new Coding().setSystem("scheme").setCode("code")); + tagList.add(new Coding().setDisplay("Label")); + + Patient p = new Patient(); + p.getMeta().getTag().addAll(tagList); + + String encoded = ourCtx.newJsonParser().encodeResourceToString(p); + assertThat(encoded, containsString("tag")); + assertThat(encoded, containsString("scheme")); + assertThat(encoded, not(containsString("Label"))); + } + + @Test + public void testEncodeExtendedInfrastructureComponent() { + IParser parser = ourCtx.newJsonParser(); + + PatientWithExtendedContactDstu3 patient = new PatientWithExtendedContactDstu3(); + patient.setId("123"); + + CustomContactComponent customContactComponent = new CustomContactComponent(); + customContactComponent.getEyeColour().setValue("EYE"); + customContactComponent.getName().addFamily("FAMILY"); + patient.getCustomContact().add(customContactComponent); + + String val = parser.encodeResourceToString(patient); + ourLog.info(val); + + assertEquals( + "{\"resourceType\":\"Patient\",\"id\":\"123\",\"contact\":[{\"extension\":[{\"url\":\"http://foo.com/contact-eyecolour\",\"valueIdentifier\":{\"value\":\"EYE\"}}],\"name\":{\"family\":[\"FAMILY\"]}}]}", + val); + + FhirContext newCtx = FhirContext.forDstu2_1(); + PatientWithExtendedContactDstu3 actual = newCtx.newJsonParser().parseResource(PatientWithExtendedContactDstu3.class, val); + assertEquals("EYE", actual.getCustomContact().get(0).getEyeColour().getValue()); + + } + + @Test + public void testEncodeExtensionInPrimitiveElement() { + + Conformance c = new Conformance(); + c.getAcceptUnknownElement().addExtension().setUrl("http://foo").setValue(new StringType("AAA")); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(c); + ourLog.info(encoded); + + encoded = ourCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(c); + ourLog.info(encoded); + assertEquals(encoded, "{\"resourceType\":\"Conformance\",\"_acceptUnknown\":{\"extension\":[{\"url\":\"http://foo\",\"valueString\":\"AAA\"}]}}"); + + // Now with a value + ourLog.info("---------------"); + + c = new Conformance(); + c.getAcceptUnknownElement().setValue(UnknownContentCode.ELEMENTS); + c.getAcceptUnknownElement().addExtension().setUrl("http://foo").setValue(new StringType("AAA")); + + encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(c); + ourLog.info(encoded); + + encoded = ourCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(c); + ourLog.info(encoded); + assertEquals(encoded, "{\"resourceType\":\"Conformance\",\"acceptUnknown\":\"elements\",\"_acceptUnknown\":{\"extension\":[{\"url\":\"http://foo\",\"valueString\":\"AAA\"}]}}"); + + } + + @Test + public void testEncodeExtensionUndeclaredNonModifier() { + Observation obs = new Observation(); + obs.setId("1"); + obs.getMeta().addProfile("http://profile"); + Extension ext = obs.addExtension(); + ext.setUrl("http://exturl").setValue(new StringType("ext_url_value")); + + obs.getCode().setText("CODE"); + + IParser parser = ourCtx.newJsonParser(); + + String output = parser.setPrettyPrint(true).encodeResourceToString(obs); + ourLog.info(output); + + //@formatter:off + assertThat(output, stringContainsInOrder( + "\"id\": \"1\"", + "\"meta\"", + "\"extension\"", + "\"url\": \"http://exturl\"", + "\"valueString\": \"ext_url_value\"", + "\"code\":" + )); + assertThat(output, not(stringContainsInOrder( + "\"url\": \"http://exturl\"", + ",", + "\"url\": \"http://exturl\"" + ))); + //@formatter:on + + obs = parser.parseResource(Observation.class, output); + assertEquals(1, obs.getExtension().size()); + assertEquals("http://exturl", obs.getExtension().get(0).getUrl()); + assertEquals("ext_url_value", ((StringType) obs.getExtension().get(0).getValue()).getValue()); + } + + @Test + public void testEncodeExtensionUndeclaredNonModifierWithChildExtension() { + Observation obs = new Observation(); + obs.setId("1"); + obs.getMeta().addProfile("http://profile"); + Extension ext = obs.addExtension(); + ext.setUrl("http://exturl"); + + Extension subExt = ext.addExtension(); + subExt.setUrl("http://subext").setValue(new StringType("sub_ext_value")); + + obs.getCode().setText("CODE"); + + IParser parser = ourCtx.newJsonParser(); + + String output = parser.setPrettyPrint(true).encodeResourceToString(obs); + ourLog.info(output); + + //@formatter:off + assertThat(output, stringContainsInOrder( + "\"id\": \"1\"", + "\"meta\"", + "\"extension\"", + "\"url\": \"http://exturl\"", + "\"extension\"", + "\"url\": \"http://subext\"", + "\"valueString\": \"sub_ext_value\"", + "\"code\":" + )); + assertThat(output, not(stringContainsInOrder( + "\"url\": \"http://exturl\"", + ",", + "\"url\": \"http://exturl\"" + ))); + //@formatter:on + + obs = parser.parseResource(Observation.class, output); + assertEquals(1, obs.getExtension().size()); + assertEquals("http://exturl", obs.getExtension().get(0).getUrl()); + assertEquals(1, obs.getExtension().get(0).getExtension().size()); + assertEquals("http://subext", obs.getExtension().get(0).getExtension().get(0).getUrl()); + assertEquals("sub_ext_value", ((StringType) obs.getExtension().get(0).getExtension().get(0).getValue()).getValue()); + } + + /** + * See #327 + */ + @Test + public void testEncodeExtensionWithContainedResource() { + + TestPatientFor327 patient = new TestPatientFor327(); + patient.setBirthDateElement(new DateType("2016-04-14")); + + List conditions = new ArrayList(); + Condition condition = new Condition(); + condition.addBodySite().setText("BODY SITE"); + conditions.add(new Reference(condition)); + patient.setCondition(conditions); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(patient); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "\"resourceType\": \"Patient\"", + "\"contained\": [", + "\"resourceType\": \"Condition\"", + "\"id\": \"1\"", + "\"bodySite\": [", + "\"text\": \"BODY SITE\"", + "\"extension\": [", + "\"url\": \"testCondition\",", + "\"valueReference\": {", + "\"reference\": \"#1\"", + "\"birthDate\": \"2016-04-14\"", + "}" + )); + //@formatter:on + } + + @Test + public void testEncodeHistoryEncodeVersionsAtPath1() { + ourCtx = FhirContext.forDstu2_1(); + + assertNull(ourCtx.newJsonParser().getStripVersionsFromReferences()); + + Patient p = new Patient(); + p.setManagingOrganization(new Reference("http://foo.com/Organization/2/_history/1")); + + IParser parser = ourCtx.newJsonParser(); + + parser.setDontStripVersionsFromReferencesAtPaths("Patient.managingOrganization"); + String enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2/_history/1\"")); + } + + @Test + public void testEncodeHistoryEncodeVersionsAtPath2() { + ourCtx = FhirContext.forDstu2_1(); + + assertNull(ourCtx.newJsonParser().getStripVersionsFromReferences()); + assertTrue(ourCtx.getParserOptions().isStripVersionsFromReferences()); + + Patient p = new Patient(); + p.setManagingOrganization(new Reference("http://foo.com/Organization/2/_history/1")); + + IParser parser = ourCtx.newJsonParser(); + + parser.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); + String enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2\"")); + } + + @Test + public void testEncodeHistoryEncodeVersionsAtPath3() { + ourCtx = FhirContext.forDstu2_1(); + + assertNull(ourCtx.newJsonParser().getStripVersionsFromReferences()); + + AuditEvent auditEvent = new AuditEvent(); + auditEvent.addEntity().setReference(new Reference("http://foo.com/Organization/2/_history/1")); + + IParser parser = ourCtx.newJsonParser(); + + parser.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); + String enc = parser.setPrettyPrint(true).encodeResourceToString(auditEvent); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2/_history/1\"")); + + parser.setDontStripVersionsFromReferencesAtPaths(new ArrayList()); + enc = parser.setPrettyPrint(true).encodeResourceToString(auditEvent); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2\"")); + + parser.setDontStripVersionsFromReferencesAtPaths((String[]) null); + enc = parser.setPrettyPrint(true).encodeResourceToString(auditEvent); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2\"")); + + parser.setDontStripVersionsFromReferencesAtPaths((List) null); + enc = parser.setPrettyPrint(true).encodeResourceToString(auditEvent); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2\"")); + } + + @Test + public void testEncodeHistoryEncodeVersionsAtPathUsingOptions() { + ourCtx = FhirContext.forDstu2_1(); + + assertNull(ourCtx.newJsonParser().getStripVersionsFromReferences()); + assertTrue(ourCtx.getParserOptions().isStripVersionsFromReferences()); + assertThat(ourCtx.getParserOptions().getDontStripVersionsFromReferencesAtPaths(), empty()); + + Patient p = new Patient(); + p.setManagingOrganization(new Reference("http://foo.com/Organization/2/_history/1")); + + IParser parser = ourCtx.newJsonParser(); + + ourCtx.getParserOptions().setDontStripVersionsFromReferencesAtPaths("Patient.managingOrganization"); + String enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2/_history/1\"")); + + ourCtx.getParserOptions().setDontStripVersionsFromReferencesAtPaths(Arrays.asList("Patient.managingOrganization")); + enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2/_history/1\"")); + + ourCtx.getParserOptions().setDontStripVersionsFromReferencesAtPaths(new HashSet(Arrays.asList("Patient.managingOrganization"))); + enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2/_history/1\"")); + } + + @Test + public void testEncodeHistoryStripVersionsFromReferences() { + ourCtx = FhirContext.forDstu2_1(); + + assertNull(ourCtx.newJsonParser().getStripVersionsFromReferences()); + + Patient p = new Patient(); + p.setManagingOrganization(new Reference("http://foo.com/Organization/2/_history/1")); + + IParser parser = ourCtx.newJsonParser(); + String enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2\"")); + + parser.setStripVersionsFromReferences(false); + enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2/_history/1\"")); + + ourCtx = FhirContext.forDstu2_1(); + } + + @Test + public void testEncodeHistoryStripVersionsFromReferencesFromContext() { + ourCtx = FhirContext.forDstu2_1(); + + assertTrue(ourCtx.getParserOptions().isStripVersionsFromReferences()); + + Patient p = new Patient(); + p.setManagingOrganization(new Reference("http://foo.com/Organization/2/_history/1")); + + IParser parser = ourCtx.newJsonParser(); + String enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2\"")); + + ourCtx.getParserOptions().setStripVersionsFromReferences(false); + enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2/_history/1\"")); + + parser.setStripVersionsFromReferences(true); + enc = parser.setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + assertThat(enc, containsString("\"reference\": \"http://foo.com/Organization/2\"")); + + ourCtx = FhirContext.forDstu2_1(); + } + + @Test + public void testEncodeNarrativeShouldIncludeNamespace() { + + Patient p = new Patient(); + p.getText().setDivAsString("
VALUE
"); + + String output = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(output); + assertThat(output, containsString("\"div\": \"
VALUE
\"")); + } + + @Test + public void testEncodeNarrativeShouldIncludeNamespaceWithProcessingInstruction() { + + Patient p = new Patient(); + p.getText().setDivAsString("
VALUE
"); + + String output = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(output); + assertThat(output, containsString("\"div\": \"
VALUE
\"")); + } + + @Test + public void testEncodeNarrativeSuppressed() throws Exception { + Patient patient = new Patient(); + patient.setId("Patient/1/_history/1"); + patient.getText().setDivAsString("
THE DIV
"); + patient.addName().addFamily("FAMILY"); + patient.getMaritalStatus().addCoding().setCode("D"); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).setSuppressNarratives(true).encodeResourceToString(patient); + ourLog.info(encoded); + + assertThat(encoded, containsString("Patient")); + assertThat(encoded, stringContainsInOrder(Constants.TAG_SUBSETTED_SYSTEM, Constants.TAG_SUBSETTED_CODE)); + assertThat(encoded, not(containsString("text"))); + assertThat(encoded, not(containsString("THE DIV"))); + assertThat(encoded, containsString("family")); + assertThat(encoded, containsString("maritalStatus")); + } + + @Test + public void testEncodeParametersWithId() { + Parameters reqParms = new Parameters(); + IdType patient = new IdType(1); + reqParms.addParameter().setName("patient").setValue(patient); + + String enc = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(reqParms); + ourLog.info(enc); + + assertThat(enc, containsString("\"valueId\": \"1\"")); + } + + @Test + public void testEncodeSummary() { + Patient patient = new Patient(); + patient.setId("Patient/1/_history/1"); + patient.getText().setDivAsString("
THE DIV
"); + patient.addName().addFamily("FAMILY"); + patient.addPhoto().setTitle("green"); + patient.getMaritalStatus().addCoding().setCode("D"); + + ourLog.info(ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(patient)); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).setSummaryMode(true).encodeResourceToString(patient); + ourLog.info(encoded); + + assertThat(encoded, containsString("Patient")); + assertThat(encoded, stringContainsInOrder("\"tag\"", "\"system\": \"" + Constants.TAG_SUBSETTED_SYSTEM + "\",", "\"code\": \"" + Constants.TAG_SUBSETTED_CODE + "\"")); + assertThat(encoded, not(containsString("THE DIV"))); + assertThat(encoded, containsString("family")); + assertThat(encoded, not(containsString("maritalStatus"))); + } + + @Test + public void testEncodeSummary2() { + Patient patient = new Patient(); + patient.setId("Patient/1/_history/1"); + patient.getText().setDivAsString("
THE DIV
"); + patient.addName().addFamily("FAMILY"); + patient.getMaritalStatus().addCoding().setCode("D"); + + patient.getMeta().addTag().setSystem("foo").setCode("bar"); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).setSummaryMode(true).encodeResourceToString(patient); + ourLog.info(encoded); + + assertThat(encoded, containsString("Patient")); + assertThat(encoded, stringContainsInOrder("\"tag\"", "\"system\": \"foo\",", "\"code\": \"bar\"", "\"system\": \"" + Constants.TAG_SUBSETTED_SYSTEM + "\"", + "\"code\": \"" + Constants.TAG_SUBSETTED_CODE + "\"")); + assertThat(encoded, not(containsString("THE DIV"))); + assertThat(encoded, containsString("family")); + assertThat(encoded, not(containsString("maritalStatus"))); + } + + /** + * See #205 + */ + @Test + public void testEncodeTags() { + Patient pt = new Patient(); + pt.addIdentifier().setSystem("sys").setValue("val"); + + pt.getMeta().addTag().setSystem("scheme").setCode("term").setDisplay("display"); + + String enc = ourCtx.newJsonParser().encodeResourceToString(pt); + ourLog.info(enc); + + assertEquals("{\"resourceType\":\"Patient\",\"meta\":{\"tag\":[{\"system\":\"scheme\",\"code\":\"term\",\"display\":\"display\"}]},\"identifier\":[{\"system\":\"sys\",\"value\":\"val\"}]}", + enc); + + } + + /** + * See #241 + */ + @Test + public void testEncodeThenParseShouldNotAddSpuriousId() throws Exception { + Condition condition = new Condition().setVerificationStatus(ConditionVerificationStatus.CONFIRMED); + Bundle bundle = new Bundle(); + BundleEntryComponent entry = new Bundle.BundleEntryComponent(); + entry.setId("123"); + entry.setResource(condition); + bundle.getEntry().add(entry); + IParser parser = ourCtx.newJsonParser(); + String json = parser.encodeResourceToString(bundle); + ourLog.info(json); + bundle = (Bundle) parser.parseResource(json); + + assertEquals("123", bundle.getEntry().get(0).getId()); + + condition = (Condition) bundle.getEntry().get(0).getResource(); + assertEquals(null, condition.getId()); + } + + @Test + public void testEncodeUndeclaredBlock() throws Exception { + FooMessageHeader.FooMessageSourceComponent source = new FooMessageHeader.FooMessageSourceComponent(); + source.getMessageHeaderApplicationId().setValue("APPID"); + source.setName("NAME"); + + FooMessageHeader header = new FooMessageHeader(); + header.setSource(source); + + Bundle bundle = new Bundle(); + bundle.addEntry().setResource(header); + + IParser p = ourCtx.newJsonParser(); + p.setPrettyPrint(true); + + String encode = p.encodeResourceToString(bundle); + ourLog.info(encode); + + assertThat(encode, containsString("\"value\": \"APPID\"")); + } + + @Test + public void testEncodeUndeclaredExtensionWithEnumerationContent() { + IParser parser = ourCtx.newJsonParser(); + + Patient patient = new Patient(); + patient.addAddress().setUse(AddressUse.HOME); + EnumFactory fact = new AddressUseEnumFactory(); + PrimitiveType enumeration = new Enumeration(fact).setValue(AddressUse.HOME); + patient.addExtension().setUrl("urn:foo").setValue(enumeration); + + String val = parser.encodeResourceToString(patient); + ourLog.info(val); + assertThat(val, StringContains.containsString("\"extension\":[{\"url\":\"urn:foo\",\"valueCode\":\"home\"}]")); + + MyPatientWithOneDeclaredEnumerationExtensionDstu3 actual = parser.parseResource(MyPatientWithOneDeclaredEnumerationExtensionDstu3.class, val); + assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse()); + Enumeration ref = actual.getFoo(); + assertEquals("home", ref.getValue().toCode()); + + } + + @Test + public void testEncodeWithDontEncodeElements() throws Exception { + Patient patient = new Patient(); + patient.setId("123"); + + patient.getMeta().addProfile(("http://profile")); + patient.addName().addFamily("FAMILY").addGiven("GIVEN"); + patient.addAddress().addLine("LINE1"); + + { + IParser p = ourCtx.newJsonParser(); + p.setDontEncodeElements(Sets.newHashSet("*.meta", "*.id")); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("Patient")); + assertThat(out, containsString("name")); + assertThat(out, containsString("address")); + assertThat(out, not(containsString("id"))); + assertThat(out, not(containsString("meta"))); + } + { + IParser p = ourCtx.newJsonParser(); + p.setDontEncodeElements(Sets.newHashSet("Patient.meta", "Patient.id")); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("Patient")); + assertThat(out, containsString("name")); + assertThat(out, containsString("address")); + assertThat(out, not(containsString("id"))); + assertThat(out, not(containsString("meta"))); + } + { + IParser p = ourCtx.newJsonParser(); + p.setDontEncodeElements(Sets.newHashSet("Patient.name.family")); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("GIVEN")); + assertThat(out, not(containsString("FAMILY"))); + } + { + IParser p = ourCtx.newJsonParser(); + p.setDontEncodeElements(Sets.newHashSet("*.meta", "*.id")); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("Patient")); + assertThat(out, containsString("name")); + assertThat(out, containsString("address")); + assertThat(out, not(containsString("id"))); + assertThat(out, not(containsString("meta"))); + } + { + IParser p = ourCtx.newJsonParser(); + p.setDontEncodeElements(Sets.newHashSet("Patient.meta")); + p.setEncodeElements(new HashSet(Arrays.asList("Patient.name"))); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("Patient")); + assertThat(out, containsString("name")); + assertThat(out, containsString("id")); + assertThat(out, not(containsString("address"))); + assertThat(out, not(containsString("meta"))); + } + } + + @Test + public void testEncodeWithNarrative() { + Patient p = new Patient(); + p.addName().addFamily("Smith").addGiven("John"); + + ourCtx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); + + String output = ourCtx.newJsonParser().encodeResourceToString(p); + ourLog.info(output); + + assertThat(output, containsString("\"text\":{\"status\":\"generated\",\"div\":\"
John SMITH
")); + } + + @Test + public void testEncodingNullExtension() { + Patient p = new Patient(); + Extension extension = new Extension("http://foo#bar"); + p.addExtension(extension); + String str = ourCtx.newJsonParser().encodeResourceToString(p); + + assertEquals("{\"resourceType\":\"Patient\"}", str); + + extension.setValue(new StringType()); + + str = ourCtx.newJsonParser().encodeResourceToString(p); + assertEquals("{\"resourceType\":\"Patient\"}", str); + + extension.setValue(new StringType("")); + + str = ourCtx.newJsonParser().encodeResourceToString(p); + assertEquals("{\"resourceType\":\"Patient\"}", str); + + } + + + @Test + public void testExponentDoesntGetEncodedAsSuch() { + Observation obs = new Observation(); + obs.setValue(new Quantity().setValue(new BigDecimal("0.000000000000000100"))); + + String str = ourCtx.newJsonParser().encodeResourceToString(obs); + ourLog.info(str); + + assertEquals("{\"resourceType\":\"Observation\",\"valueQuantity\":{\"value\":0.000000000000000100}}", str); + } + + @Test + public void testExponentParseWorks() { + String input = "{\"resourceType\":\"Observation\",\"valueQuantity\":{\"value\":0.0000000000000001}}"; + Observation obs = ourCtx.newJsonParser().parseResource(Observation.class, input); + + assertEquals("0.0000000000000001", ((Quantity) obs.getValue()).getValueElement().getValueAsString()); + + String str = ourCtx.newJsonParser().encodeResourceToString(obs); + ourLog.info(str); + assertEquals("{\"resourceType\":\"Observation\",\"valueQuantity\":{\"value\":0.0000000000000001}}", str); + } + + /** + * #516 + */ + @Test(expected = DataFormatException.class) + public void testInvalidEnumValue() { + String res = "{ \"resourceType\": \"ValueSet\", \"url\": \"http://sample/ValueSet/education-levels\", \"version\": \"1\", \"name\": \"Education Levels\", \"status\": \"draft\", \"compose\": { \"include\": [ { \"filter\": [ { \"property\": \"n\", \"op\": \"n\", \"value\": \"365460000\" } ], \"system\": \"http://snomed.info/sct\" } ], \"exclude\": [ { \"concept\": [ { \"code\": \"224298008\" }, { \"code\": \"365460000\" }, { \"code\": \"473462005\" }, { \"code\": \"424587006\" } ], \"system\": \"http://snomed.info/sct\" } ] }, \"description\": \"A selection of Education Levels\", \"text\": { \"status\": \"generated\", \"div\": \"

Education Levels

http://csiro.au/ValueSet/education-levels

A selection of Education Levels

\" }, \"experimental\": true, \"date\": \"2016-07-26\" }"; + IParser parser = ourCtx.newJsonParser(); + parser.setParserErrorHandler(new StrictErrorHandler()); + ValueSet parsed = parser.parseResource(ValueSet.class, res); + fail("DataFormat Invalid attribute exception should be thrown"); + } + + @Test + public void testInvalidEnumValueBlank() { + IParserErrorHandler errorHandler = mock(IParserErrorHandler.class); + + String res = "{ \"resourceType\": \"Patient\", \"gender\": \"\" }"; + IParser parser = ourCtx.newJsonParser(); + parser.setParserErrorHandler(errorHandler); + Patient parsed = parser.parseResource(Patient.class, res); + + assertEquals(null, parsed.getGenderElement().getValue()); + assertEquals(null, parsed.getGenderElement().getValueAsString()); + + ArgumentCaptor msgCaptor = ArgumentCaptor.forClass(String.class); + verify(errorHandler, times(1)).invalidValue(isNull(IParseLocation.class), eq(""), msgCaptor.capture()); + assertEquals("Attribute values must not be empty (\"\")", msgCaptor.getValue()); + + String encoded = ourCtx.newJsonParser().encodeResourceToString(parsed); + assertEquals("{\"resourceType\":\"Patient\"}", encoded); + } + + @Test + public void testInvalidEnumValueInvalid() { + IParserErrorHandler errorHandler = mock(IParserErrorHandler.class); + + String res = "{ \"resourceType\": \"Patient\", \"gender\": \"foo\" }"; + IParser parser = ourCtx.newJsonParser(); + parser.setParserErrorHandler(errorHandler); + Patient parsed = parser.parseResource(Patient.class, res); + + assertEquals(null, parsed.getGenderElement().getValue()); + assertEquals("foo", parsed.getGenderElement().getValueAsString()); + + ArgumentCaptor msgCaptor = ArgumentCaptor.forClass(String.class); + verify(errorHandler, times(1)).invalidValue(isNull(IParseLocation.class), eq("foo"), msgCaptor.capture()); + assertEquals("Unknown AdministrativeGender code 'foo'", msgCaptor.getValue()); + + String encoded = ourCtx.newJsonParser().encodeResourceToString(parsed); + assertEquals("{\"resourceType\":\"Patient\",\"gender\":\"foo\"}", encoded); + } + + @Test + public void testInvalidDateTimeValueInvalid() throws Exception { + IParserErrorHandler errorHandler = mock(IParserErrorHandler.class); + + String res = "{ \"resourceType\": \"Observation\", \"valueDateTime\": \"foo\" }"; + IParser parser = ourCtx.newJsonParser(); + parser.setParserErrorHandler(errorHandler); + Observation parsed = parser.parseResource(Observation.class, res); + + assertEquals(null, parsed.getValueDateTimeType().getValue()); + assertEquals("foo", parsed.getValueDateTimeType().getValueAsString()); + + ArgumentCaptor msgCaptor = ArgumentCaptor.forClass(String.class); + verify(errorHandler, times(1)).invalidValue(isNull(IParseLocation.class), eq("foo"), msgCaptor.capture()); + assertEquals("Invalid date/time format: \"foo\"", msgCaptor.getValue()); + + String encoded = ourCtx.newJsonParser().encodeResourceToString(parsed); + assertEquals("{\"resourceType\":\"Observation\",\"valueDateTime\":\"foo\"}", encoded); + } + + /** + * #65 + */ + @Test + public void testJsonPrimitiveWithExtensionEncoding() { + + QuestionnaireResponse parsed = new QuestionnaireResponse(); + parsed.addItem().setLinkId("value123"); + parsed.getItem().get(0).getLinkIdElement().addExtension(new Extension("http://123", new StringType("HELLO"))); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(parsed); + ourLog.info(encoded); + assertThat(encoded, containsString("{\"linkId\":\"value123\",\"_linkId\":{\"extension\":[{\"url\":\"http://123\",\"valueString\":\"HELLO\"}]}}")); + + } + + @Test + public void testLinkage() { + Linkage l = new Linkage(); + l.addItem().getResource().setDisplay("FOO"); + String out = ourCtx.newXmlParser().encodeResourceToString(l); + ourLog.info(out); + assertEquals("", out); + } + + // FIXME: this should pass + @Test + @Ignore + public void testNamespacePreservationEncode() throws Exception { + //@formatter:off + String input = "" + + "" + + "" + + "" + + "@fhirabend" + + "" + + "" + + ""; + //@formatter:on + Patient parsed = ourCtx.newXmlParser().parseResource(Patient.class, input); + + String expected = "@fhirabend"; + assertEquals(expected, parsed.getText().getDiv().getValueAsString()); + + String encoded = ourCtx.newJsonParser().encodeResourceToString(parsed); + ourLog.info(encoded); + assertThat(encoded, containsString("\"div\":\"" + expected.replace("\"", "\\\"") + "\"")); + } + + // TODO: this should pass + @Test + @Ignore + public void testNamespacePreservationParse() throws Exception { + String input = "{\"resourceType\":\"Patient\",\"text\":{\"div\":\"@fhirabend\"}}"; + Patient parsed = ourCtx.newJsonParser().parseResource(Patient.class, input); + XhtmlNode div = parsed.getText().getDiv(); + + assertEquals("@fhirabend", div.getValueAsString()); + + String encoded = ourCtx.newXmlParser().encodeResourceToString(parsed); + assertEquals("@fhirabend", encoded); + } + + @Test + public void testOmitResourceId() { + Patient p = new Patient(); + p.setId("123"); + p.addName().addFamily("ABC"); + + assertThat(ourCtx.newJsonParser().encodeResourceToString(p), stringContainsInOrder("123", "ABC")); + assertThat(ourCtx.newJsonParser().setOmitResourceId(true).encodeResourceToString(p), containsString("ABC")); + assertThat(ourCtx.newJsonParser().setOmitResourceId(true).encodeResourceToString(p), not(containsString("123"))); + } + + @Test + @Ignore + public void testParseAndEncodeBundle() throws Exception { + String content = IOUtils.toString(JsonParserDstu21Test.class.getResourceAsStream("/bundle-example.json"), StandardCharsets.UTF_8); + + Bundle parsed = ourCtx.newXmlParser().parseResource(Bundle.class, content); + assertEquals("Bundle/example/_history/1", parsed.getIdElement().getValue()); + assertEquals("1", parsed.getMeta().getVersionId()); + assertEquals("1", parsed.getIdElement().getVersionIdPart()); + assertEquals(("2014-08-18T01:43:30Z"), parsed.getMeta().getLastUpdatedElement().getValueAsString()); + assertEquals("searchset", parsed.getType().toCode()); + assertEquals(3, parsed.getTotal()); + assertEquals("https://example.com/base/MedicationOrder?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2", parsed.getLink("next").getUrl()); + assertEquals("https://example.com/base/MedicationOrder?patient=347&_include=MedicationOrder.medication", parsed.getLink("self").getUrl()); + + assertEquals(2, parsed.getEntry().size()); + assertEquals("http://foo?search", parsed.getEntry().get(0).getLink("search").getUrl()); + + assertEquals("http://example.com/base/MedicationOrder/3123/_history/1", parsed.getEntry().get(0).getLink("alternate").getUrl()); + MedicationOrder p = (MedicationOrder) parsed.getEntry().get(0).getResource(); + assertEquals("Patient/347", p.getPatient().getReference()); + assertEquals("2014-08-16T05:31:17Z", p.getMeta().getLastUpdatedElement().getValueAsString()); + assertEquals("http://example.com/base/MedicationOrder/3123/_history/1", p.getId()); + + Medication m = (Medication) parsed.getEntry().get(1).getResource(); + assertEquals("http://example.com/base/Medication/example", m.getId()); + assertSame(((Reference) p.getMedication()).getResource(), m); + + String reencoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(parsed); + ourLog.info(reencoded); + + JsonConfig cfg = new JsonConfig(); + + JSON expected = JSONSerializer.toJSON(content.trim(), cfg); + JSON actual = JSONSerializer.toJSON(reencoded.trim(), cfg); + + String exp = expected.toString().replace("\\r\\n", "\\n"); // .replace("§", "§"); + String act = actual.toString().replace("\\r\\n", "\\n"); + + ourLog.info("Expected: {}", exp); + ourLog.info("Actual : {}", act); + + assertEquals(exp, act); + + } + + /** + * Test for #146 + */ + @Test + @Ignore + public void testParseAndEncodeBundleFromXmlToJson() throws Exception { + String content = IOUtils.toString(JsonParserDstu21Test.class.getResourceAsStream("/bundle-example2.xml"), StandardCharsets.UTF_8); + + Bundle parsed = ourCtx.newXmlParser().parseResource(Bundle.class, content); + + MedicationOrder p = (MedicationOrder) parsed.getEntry().get(0).getResource(); + assertEquals("#med", ((Reference) p.getMedication()).getReference()); + + Medication m = (Medication) ((Reference) p.getMedication()).getResource(); + assertNotNull(m); + assertEquals("#med", m.getIdElement().getValue()); + assertEquals(1, p.getContained().size()); + assertSame(m, p.getContained().get(0)); + + String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed); + ourLog.info(reencoded); + assertThat(reencoded, containsString("contained")); + + reencoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(parsed); + ourLog.info(reencoded); + assertThat(reencoded, containsString("contained")); + } + + @Test + @Ignore + public void testParseAndEncodeBundleNewStyle() throws Exception { + String content = IOUtils.toString(JsonParserDstu21Test.class.getResourceAsStream("/bundle-example.json"), StandardCharsets.UTF_8); + + Bundle parsed = ourCtx.newJsonParser().parseResource(Bundle.class, content); + assertEquals("Bundle/example/_history/1", parsed.getIdElement().getValue()); + assertEquals("1", parsed.getIdElement().getVersionIdPart()); + assertEquals("2014-08-18T01:43:30Z", parsed.getMeta().getLastUpdatedElement().getValueAsString()); + assertEquals("searchset", parsed.getType()); + assertEquals(3, parsed.getTotal()); + assertEquals("https://example.com/base/MedicationOrder?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2", parsed.getLink().get(0).getUrlElement().getValueAsString()); + assertEquals("https://example.com/base/MedicationOrder?patient=347&_include=MedicationOrder.medication", parsed.getLink().get(1).getUrlElement().getValueAsString()); + + assertEquals(2, parsed.getEntry().size()); + assertEquals("alternate", parsed.getEntry().get(0).getLink().get(0).getRelation()); + assertEquals("http://example.com/base/MedicationOrder/3123/_history/1", parsed.getEntry().get(0).getLink().get(0).getUrl()); + assertEquals("http://foo?search", parsed.getEntry().get(0).getRequest().getUrlElement().getValueAsString()); + + MedicationOrder p = (MedicationOrder) parsed.getEntry().get(0).getResource(); + assertEquals("Patient/347", p.getPatient().getReference()); + assertEquals("2014-08-16T05:31:17Z", p.getMeta().getLastUpdatedElement().getValueAsString()); + assertEquals("http://example.com/base/MedicationOrder/3123/_history/1", p.getId()); + // assertEquals("3123", p.getId()); + + Medication m = (Medication) parsed.getEntry().get(1).getResource(); + assertEquals("http://example.com/base/Medication/example", m.getId()); + assertSame(((Reference) p.getMedication()).getResource(), m); + + String reencoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(parsed); + ourLog.info(reencoded); + + JsonConfig cfg = new JsonConfig(); + + JSON expected = JSONSerializer.toJSON(content.trim(), cfg); + JSON actual = JSONSerializer.toJSON(reencoded.trim(), cfg); + + String exp = expected.toString().replace("\\r\\n", "\\n"); // .replace("§", "§"); + String act = actual.toString().replace("\\r\\n", "\\n"); + + ourLog.info("Expected: {}", exp); + ourLog.info("Actual : {}", act); + + assertEquals(exp, act); + + } + + @Test + public void testParseAndEncodeBundleWithUuidBase() { + //@formatter:off + String input = + "{\n" + + " \"resourceType\":\"Bundle\",\n" + + " \"type\":\"document\",\n" + + " \"entry\":[\n" + + " {\n" + + " \"fullUrl\":\"urn:uuid:180f219f-97a8-486d-99d9-ed631fe4fc57\",\n" + + " \"resource\":{\n" + + " \"resourceType\":\"Composition\",\n" + + " \"id\":\"180f219f-97a8-486d-99d9-ed631fe4fc57\",\n" + + " \"meta\":{\n" + + " \"lastUpdated\":\"2013-05-28T22:12:21Z\"\n" + + " },\n" + + " \"text\":{\n" + + " \"status\":\"generated\",\n" + + " \"div\":\"

Generated Narrative with Details

id: 180f219f-97a8-486d-99d9-ed631fe4fc57

meta:

date: Feb 1, 2013 12:30:02 PM

type: Discharge Summary from Responsible Clinician (Details : {LOINC code '28655-9' = 'Physician attending Discharge summary)

status: final

confidentiality: N

author: Doctor Dave. Generated Summary: 23; Adam Careful

encounter: http://fhir.healthintersections.com.au/open/Encounter/doc-example

\"\n" + + " },\n" + + " \"date\":\"2013-02-01T12:30:02Z\",\n" + + " \"type\":{\n" + + " \"coding\":[\n" + + " {\n" + + " \"system\":\"http://loinc.org\",\n" + + " \"code\":\"28655-9\"\n" + + " }\n" + + " ],\n" + + " \"text\":\"Discharge Summary from Responsible Clinician\"\n" + + " },\n" + + " \"status\":\"final\",\n" + + " \"confidentiality\":\"N\",\n" + + " \"subject\":{\n" + + " \"reference\":\"http://fhir.healthintersections.com.au/open/Patient/d1\",\n" + + " \"display\":\"Eve Everywoman\"\n" + + " },\n" + + " \"author\":[\n" + + " {\n" + + " \"reference\":\"Practitioner/example\",\n" + + " \"display\":\"Doctor Dave\"\n" + + " }\n" + + " ],\n" + + " \"encounter\":{\n" + + " \"reference\":\"http://fhir.healthintersections.com.au/open/Encounter/doc-example\"\n" + + " },\n" + + " \"section\":[\n" + + " {\n" + + " \"title\":\"Reason for admission\",\n" + + " \"content\":{\n" + + " \"reference\":\"urn:uuid:d0dd51d3-3ab2-4c84-b697-a630c3e40e7a\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"title\":\"Medications on Discharge\",\n" + + " \"content\":{\n" + + " \"reference\":\"urn:uuid:673f8db5-0ffd-4395-9657-6da00420bbc1\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"title\":\"Known allergies\",\n" + + " \"content\":{\n" + + " \"reference\":\"urn:uuid:68f86194-e6e1-4f65-b64a-5314256f8d7b\"\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + " }" + + " ]" + + "}"; + //@formatter:on + + Bundle parsed = ourCtx.newJsonParser().parseResource(Bundle.class, input); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(parsed); + ourLog.info(encoded); + + assertEquals("urn:uuid:180f219f-97a8-486d-99d9-ed631fe4fc57", parsed.getEntry().get(0).getResource().getIdElement().getValue()); + assertEquals("urn:uuid:", parsed.getEntry().get(0).getResource().getIdElement().getBaseUrl()); + assertEquals("180f219f-97a8-486d-99d9-ed631fe4fc57", parsed.getEntry().get(0).getResource().getIdElement().getIdPart()); + assertThat(encoded, not(containsString("\"id\":\"180f219f-97a8-486d-99d9-ed631fe4fc57\""))); + } + + @Test + public void testParseAndEncodeComments() { + //@formatter:off + String input = "{\n" + + " \"resourceType\": \"Patient\",\n" + + " \"id\": \"pat1\",\n" + + " \"text\": {\n" + + " \"status\": \"generated\",\n" + + " \"div\": \"
\\n \\n

Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321

\\n \\n
\"\n" + + " },\n" + + " \"identifier\": [\n" + + " {\n" + + " \"fhir_comments\":[\"identifier comment 1\",\"identifier comment 2\"],\n" + + " \"use\": \"usual\",\n" + + " \"_use\": {\n" + + " \"fhir_comments\":[\"use comment 1\",\"use comment 2\"]\n" + + " },\n" + + " \"type\": {\n" + + " \"coding\": [\n" + + " {\n" + + " \"system\": \"http://hl7.org/fhir/v2/0203\",\n" + + " \"code\": \"MR\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"system\": \"urn:oid:0.1.2.3.4.5.6.7\",\n" + + " \"value\": \"654321\"\n" + + " }\n" + + " ],\n" + + " \"active\": true" + + "}"; + //@formatter:off + + Patient res = ourCtx.newJsonParser().parseResource(Patient.class, input); + res.getFormatCommentsPre(); + assertEquals("Patient/pat1", res.getId()); + assertEquals("654321", res.getIdentifier().get(0).getValue()); + assertEquals(true, res.getActive()); + + assertThat(res.getIdentifier().get(0).getFormatCommentsPre(), contains("identifier comment 1", "identifier comment 2")); + assertThat(res.getIdentifier().get(0).getUseElement().getFormatCommentsPre(), contains("use comment 1", "use comment 2")); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(res); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "\"identifier\": [", + "{", + "\"fhir_comments\":", + "[", + "\"identifier comment 1\"", + ",", + "\"identifier comment 2\"", + "]", + "\"use\": \"usual\",", + "\"_use\": {", + "\"fhir_comments\":", + "[", + "\"use comment 1\"", + ",", + "\"use comment 2\"", + "]", + "},", + "\"type\"" + )); + //@formatter:off + } + + @Test + public void testParseBundleWithBinary() { + Binary patient = new Binary(); + patient.setId(new IdType("http://base/Binary/11/_history/22")); + patient.setContentType("foo"); + patient.setContent(new byte[] { 1, 2, 3, 4 }); + + String val = ourCtx.newJsonParser().encodeResourceToString(patient); + + String expected = "{\"resourceType\":\"Binary\",\"id\":\"11\",\"contentType\":\"foo\",\"content\":\"AQIDBA==\"}"; + ourLog.info("Expected: {}", expected); + ourLog.info("Actual : {}", val); + assertEquals(expected, val); + } + + + + /** + * see #144 and #146 + */ + @Test + @Ignore + public void testParseContained() { + + FhirContext c = FhirContext.forDstu2(); + IParser parser = c.newJsonParser().setPrettyPrint(true); + + Observation o = new Observation(); + o.getCode().setText("obs text"); + + Patient p = new Patient(); + p.addName().addFamily("patient family"); + o.getSubject().setResource(p); + + String enc = parser.encodeResourceToString(o); + ourLog.info(enc); + + //@formatter:off + assertThat(enc, stringContainsInOrder( + "\"resourceType\":\"Observation\"", + "\"contained\":[", + "\"resourceType\":\"Patient\",", + "\"id\":\"1\"", + "\"reference\":\"#1\"" + )); + //@formatter:on + + o = parser.parseResource(Observation.class, enc); + assertEquals("obs text", o.getCode().getText()); + + assertNotNull(o.getSubject().getResource()); + p = (Patient) o.getSubject().getResource(); + assertEquals("patient family", p.getName().get(0).getFamilyAsSingleString()); + } + + + /** + * See #342 + */ + @Test() + public void testParseInvalid() { + try { + ourCtx.newJsonParser().parseResource("FOO"); + fail(); + } catch (DataFormatException e) { + assertEquals("Failed to parse JSON content, error was: Content does not appear to be FHIR JSON, first non-whitespace character was: 'F' (must be '{')", e.getMessage()); + } + try { + ourCtx.newJsonParser().parseResource("[\"aaa\"]"); + fail(); + } catch (DataFormatException e) { + assertEquals("Failed to parse JSON content, error was: Content does not appear to be FHIR JSON, first non-whitespace character was: '[' (must be '{')", e.getMessage()); + } + + assertEquals(Bundle.class, ourCtx.newJsonParser().parseResource(" {\"resourceType\" : \"Bundle\"}").getClass()); + + } + + /** + * See #414 + */ + @Test + public void testParseJsonExtensionWithoutUrl() { + //@formatter:off + String input = + "{\"resourceType\":\"Patient\"," + + "\"extension\":[ {\"valueDateTime\":\"2011-01-02T11:13:15\"} ]" + + "}"; + //@formatter:on + + IParser parser = ourCtx.newJsonParser(); + parser.setParserErrorHandler(new LenientErrorHandler()); + Patient parsed = (Patient) parser.parseResource(input); + assertEquals(1, parsed.getExtension().size()); + assertEquals(null, parsed.getExtension().get(0).getUrl()); + assertEquals("2011-01-02T11:13:15", ((PrimitiveType)parsed.getExtension().get(0).getValue()).getValueAsString()); + + try { + parser = ourCtx.newJsonParser(); + parser.setParserErrorHandler(new StrictErrorHandler()); + parser.parseResource(input); + fail(); + } catch (DataFormatException e) { + assertEquals("Resource is missing required element 'url' in parent element 'extension'", e.getMessage()); + } + + } + + /** + * See #414 + */ + @Test + public void testParseJsonModifierExtensionWithoutUrl() { + //@formatter:off + String input = + "{\"resourceType\":\"Patient\"," + + "\"modifierExtension\":[ {\"valueDateTime\":\"2011-01-02T11:13:15\"} ]" + + "}"; + //@formatter:on + + IParser parser = ourCtx.newJsonParser(); + parser.setParserErrorHandler(new LenientErrorHandler()); + Patient parsed = (Patient) parser.parseResource(input); + assertEquals(1, parsed.getModifierExtension().size()); + assertEquals(null, parsed.getModifierExtension().get(0).getUrl()); + assertEquals("2011-01-02T11:13:15", ((PrimitiveType)parsed.getModifierExtension().get(0).getValue()).getValueAsString()); + + try { + parser = ourCtx.newJsonParser(); + parser.setParserErrorHandler(new StrictErrorHandler()); + parser.parseResource(input); + fail(); + } catch (DataFormatException e) { + assertEquals("Resource is missing required element 'url' in parent element 'modifierExtension'", e.getMessage()); + } + + } + + @Test + public void testParseMetadata() throws Exception { + //@formatter:off + String bundle = "{\n" + + " \"resourceType\" : \"Bundle\",\n" + + " \"total\" : 1,\n" + + " \"link\": [{\n" + + " \"relation\" : \"self\",\n" + + " \"url\" : \"http://localhost:52788/Binary?_pretty=true\"\n" + + " }],\n" + + " \"entry\" : [{\n" + + " \"fullUrl\" : \"http://foo/fhirBase2/Patient/1/_history/2\",\n" + + " \"resource\" : {\n" + + " \"resourceType\" : \"Patient\",\n" + + " \"id\" : \"1\",\n" + + " \"meta\" : {\n" + + " \"versionId\" : \"2\",\n" + + " \"lastUpdated\" : \"2001-02-22T11:22:33-05:00\"\n" + + " },\n" + + " \"birthDate\" : \"2012-01-02\"\n" + + " },\n" + + " \"search\" : {\n" + + " \"mode\" : \"match\",\n" + + " \"score\" : 0.123\n" + + " },\n" + + " \"request\" : {\n" + + " \"method\" : \"POST\",\n" + + " \"url\" : \"http://foo/Patient?identifier=value\"\n" + + " }\n" + + " }]\n" + + "}"; + //@formatter:on + + Bundle b = ourCtx.newJsonParser().parseResource(Bundle.class, bundle); + assertEquals(1, b.getEntry().size()); + + BundleEntryComponent entry = b.getEntry().get(0); + Patient pt = (Patient) entry.getResource(); + assertEquals("http://foo/fhirBase2/Patient/1/_history/2", pt.getIdElement().getValue()); + assertEquals("2012-01-02", pt.getBirthDateElement().getValueAsString()); + assertEquals("0.123", entry.getSearch().getScore().toString()); + assertEquals("match", entry.getSearch().getMode().toCode()); + assertEquals("POST", entry.getRequest().getMethod().toCode()); + assertEquals("http://foo/Patient?identifier=value", entry.getRequest().getUrl()); + assertEquals("2001-02-22T11:22:33-05:00", pt.getMeta().getLastUpdatedElement().getValueAsString()); + + String reEncoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(b); + + JsonConfig cfg = new JsonConfig(); + + JSON expected = JSONSerializer.toJSON(bundle.trim(), cfg); + JSON actual = JSONSerializer.toJSON(reEncoded.trim(), cfg); + + String exp = expected.toString().replace("\\r\\n", "\\n"); // .replace("§", "§"); + String act = actual.toString().replace("\\r\\n", "\\n"); + + ourLog.info("Expected: {}", exp); + ourLog.info("Actual : {}", act); + + assertEquals(exp, act); + + } + + + /** + * See #484 + */ + @Test + public void testParseNarrativeWithEmptyDiv() { + String input = "{\"resourceType\":\"Basic\",\"id\":\"1\",\"text\":{\"status\":\"generated\",\"div\":\"
\"}}"; + Basic basic = ourCtx.newJsonParser().parseResource(Basic.class, input); + assertEquals(null, basic.getText().getDivAsString()); + + input = "{\"resourceType\":\"Basic\",\"id\":\"1\",\"text\":{\"status\":\"generated\",\"div\":\"
\"}}"; + basic = ourCtx.newJsonParser().parseResource(Basic.class, input); + assertEquals(null, basic.getText().getDivAsString()); + + input = "{\"resourceType\":\"Basic\",\"id\":\"1\",\"text\":{\"status\":\"generated\",\"div\":\"
\"}}"; + basic = ourCtx.newJsonParser().parseResource(Basic.class, input); + assertEquals("
", basic.getText().getDivAsString()); + + } + + /** + * See #163 + */ + @Test + public void testParseResourceType() { + IParser jsonParser = ourCtx.newJsonParser().setPrettyPrint(true); + + // Patient + Patient patient = new Patient(); + String patientId = UUID.randomUUID().toString(); + patient.setId(new IdType("Patient", patientId)); + patient.addName().addGiven("John").addFamily("Smith"); + patient.setGender(AdministrativeGender.MALE); + patient.setBirthDateElement(new DateType("1987-04-16")); + + // Bundle + Bundle bundle = new Bundle(); + bundle.setType(BundleType.COLLECTION); + bundle.addEntry().setResource(patient); + + String bundleText = jsonParser.encodeResourceToString(bundle); + ourLog.info(bundleText); + + Bundle reincarnatedBundle = jsonParser.parseResource(Bundle.class, bundleText); + Patient reincarnatedPatient = (Patient) reincarnatedBundle.getEntry().get(0).getResource(); + + assertEquals("Patient", patient.getIdElement().getResourceType()); + assertEquals("Patient", reincarnatedPatient.getIdElement().getResourceType()); + } + + /** + * See #207 + */ + @Test + public void testParseResourceWithInvalidType() { + String input = "{" + "\"resourceType\":\"Patient\"," + "\"contained\":[" + " {" + " \"rezType\":\"Organization\"" + " }" + " ]" + "}"; + + IParser jsonParser = ourCtx.newJsonParser().setPrettyPrint(true); + try { + jsonParser.parseResource(input); + fail(); + } catch (DataFormatException e) { + assertEquals("Missing required element 'resourceType' from JSON resource object, unable to parse", e.getMessage()); + } + } + + /** + * See #344 + */ + @Test + public void testParserIsCaseSensitive() { + Observation obs = new Observation(); + SampledData data = new SampledData(); + data.setData("1 2 3"); + data.setOrigin((SimpleQuantity) new SimpleQuantity().setValue(0L)); + data.setPeriod(1000L); + obs.setValue(data); + + IParser p = ourCtx.newJsonParser().setPrettyPrint(true).setParserErrorHandler(new StrictErrorHandler()); + String encoded = p.encodeResourceToString(obs); + ourLog.info(encoded); + + p.parseResource(encoded); + + try { + p.parseResource(encoded.replace("Observation", "observation")); + fail(); + } catch (DataFormatException e) { + assertEquals("Unknown resource type 'observation': Resource names are case sensitive, found similar name: 'Observation'", e.getMessage()); + } + + try { + p.parseResource(encoded.replace("valueSampledData", "valueSampleddata")); + fail(); + } catch (DataFormatException e) { + assertEquals("Unknown element 'valueSampleddata' found during parse", e.getMessage()); + } + } + + @Test + public void testParseWithPrecision() { + String input = "{\"resourceType\":\"Observation\",\"valueQuantity\":{\"value\":0.000000000000000100}}"; + Observation obs = ourCtx.newJsonParser().parseResource(Observation.class, input); + + DecimalType valueElement = ((Quantity) obs.getValue()).getValueElement(); + assertEquals("0.000000000000000100", valueElement.getValueAsString()); + + String str = ourCtx.newJsonParser().encodeResourceToString(obs); + ourLog.info(str); + assertEquals("{\"resourceType\":\"Observation\",\"valueQuantity\":{\"value\":0.000000000000000100}}", str); + } + + @Test(expected = DataFormatException.class) + public void testParseWithTrailingContent() throws Exception { + //@formatter:off + String bundle = "{\n" + + " \"resourceType\" : \"Bundle\",\n" + + " \"total\" : 1\n" + + "}}"; + //@formatter:on + + Bundle b = ourCtx.newJsonParser().parseResource(Bundle.class, bundle); + } + + @Test + @Ignore + public void testParseWithWrongTypeObjectShouldBeArray() throws Exception { + String input = IOUtils.toString(getClass().getResourceAsStream("/invalid_metadata.json")); + try { + ourCtx.newJsonParser().parseResource(Conformance.class, input); + fail(); + } catch (DataFormatException e) { + assertEquals("Syntax error parsing JSON FHIR structure: Expected ARRAY at element 'modifierExtension', found 'OBJECT'", e.getMessage()); + } + } + + /** + * See #144 and #146 + */ + @Test + public void testReportSerialize() { + + ReportObservationDstu3 obsv = new ReportObservationDstu3(); + obsv.getCode().addCoding().setCode("name"); + obsv.setValue(new StringType("value test")); + obsv.setStatus(ObservationStatus.FINAL); + obsv.addIdentifier().setSystem("System").setValue("id value"); + + DiagnosticReport report = new DiagnosticReport(); + report.getContained().add(obsv); + report.addResult().setResource(obsv); + + IParser parser = ourCtx.newXmlParser().setPrettyPrint(true); + String message = parser.encodeResourceToString(report); + ourLog.info(message); + Assert.assertThat(message, containsString("contained")); + } + + /** + * See #144 and #146 + */ + @Test + public void testReportSerializeWithMatchingId() { + + ReportObservationDstu3 obsv = new ReportObservationDstu3(); + obsv.getCode().addCoding().setCode("name"); + obsv.setValue(new StringType("value test")); + obsv.setStatus(ObservationStatus.FINAL); + obsv.addIdentifier().setSystem("System").setValue("id value"); + + DiagnosticReport report = new DiagnosticReport(); + report.getContained().add(obsv); + + obsv.setId("#123"); + report.addResult().setReference("#123"); + + IParser parser = ourCtx.newXmlParser().setPrettyPrint(true); + String message = parser.encodeResourceToString(report); + ourLog.info(message); + Assert.assertThat(message, containsString("contained")); + } + + + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/MyPatientWithOneDeclaredEnumerationExtensionDstu3.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/MyPatientWithOneDeclaredEnumerationExtensionDstu3.java new file mode 100644 index 00000000000..e134b1d64c9 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/MyPatientWithOneDeclaredEnumerationExtensionDstu3.java @@ -0,0 +1,68 @@ +package ca.uhn.fhir.parser; + +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Address.AddressUse; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.Identifier; +import org.hl7.fhir.dstu2016may.model.Patient; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Extension; +import ca.uhn.fhir.model.api.annotation.ResourceDef; + +@ResourceDef(name = "Patient") +public class MyPatientWithOneDeclaredEnumerationExtensionDstu3 extends Patient { + + private static final long serialVersionUID = 1L; + + @Child(order = 0, name = "foo") + @ca.uhn.fhir.model.api.annotation.Extension(url = "urn:foo", definedLocally = true, isModifier = false) + private Enumeration myFoo; + + /** + * A contact party (e.g. guardian, partner, friend) for the patient. + */ + @Child(name = "contact", type = {}, order=Child.REPLACE_PARENT, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="A contact party (e.g. guardian, partner, friend) for the patient", formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient." ) + protected List contact; + + public Enumeration getFoo() { + return myFoo; + } + + public void setFoo(Enumeration theFoo) { + myFoo = theFoo; + } + + @Block() + public static class MessageSourceComponent extends Patient.ContactComponent { + + private static final long serialVersionUID = 1L; + @Child(name = "contact-eyecolour", type = { Identifier.class }, modifier = true) + @Description(shortDefinition = "Application ID") + @Extension(url = "http://foo.com/contact-eyecolour", definedLocally = false, isModifier = false) + private Identifier myEyeColour; + + /* + * Get messageHeaderApplicationId + */ + public Identifier getEyeColour() { + if (myEyeColour == null) { + myEyeColour = new Identifier(); + } + return myEyeColour; + } + + /* + * Set messageHeaderApplicationId + */ + public void setEyeColour(Identifier messageHeaderApplicationId) { + this.myEyeColour = messageHeaderApplicationId; + } + + } + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/PatientWithCustomCompositeExtension.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/PatientWithCustomCompositeExtension.java new file mode 100644 index 00000000000..d47103adde1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/PatientWithCustomCompositeExtension.java @@ -0,0 +1,82 @@ +package ca.uhn.fhir.parser; + +import org.hl7.fhir.dstu2016may.model.BackboneElement; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.StringType; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Extension; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.util.ElementUtil; + +@ResourceDef(name = "Patient") +public class PatientWithCustomCompositeExtension extends Patient { + + private static final long serialVersionUID = 1L; + + /** + * A custom extension + */ + @Child(name = "foo") + @Extension(url="http://acme.org/fooParent", definedLocally = false, isModifier = false) + protected FooParentExtension fooParentExtension; + + public FooParentExtension getFooParentExtension() { + return fooParentExtension; + } + + @Override + public boolean isEmpty() { + return super.isEmpty() && ElementUtil.isEmpty(fooParentExtension); + } + + public void setFooParentExtension(FooParentExtension theFooParentExtension) { + fooParentExtension = theFooParentExtension; + } + + @Block + public static class FooParentExtension extends BackboneElement { + + private static final long serialVersionUID = 4522090347756045145L; + + @Child(name = "childA") + @Extension(url = "http://acme.org/fooChildA", definedLocally = false, isModifier = false) + private StringType myChildA; + + @Child(name = "childB") + @Extension(url = "http://acme.org/fooChildB", definedLocally = false, isModifier = false) + private StringType myChildB; + + @Override + public FooParentExtension copy() { + FooParentExtension copy = new FooParentExtension(); + copy.myChildA = myChildA; + copy.myChildB = myChildB; + return copy; + } + + @Override + public boolean isEmpty() { + return super.isEmpty() && ElementUtil.isEmpty(myChildA, myChildB); + } + + public StringType getChildA() { + return myChildA; + } + + public StringType getChildB() { + return myChildB; + } + + public void setChildA(StringType theChildA) { + myChildA = theChildA; + } + + public void setChildB(StringType theChildB) { + myChildB = theChildB; + } + + } + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/PatientWithExtendedContactDstu3.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/PatientWithExtendedContactDstu3.java new file mode 100644 index 00000000000..1a01989c20a --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/PatientWithExtendedContactDstu3.java @@ -0,0 +1,62 @@ +package ca.uhn.fhir.parser; + +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.Identifier; +import org.hl7.fhir.dstu2016may.model.Patient; + +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Extension; +import ca.uhn.fhir.model.api.annotation.ResourceDef; + +@ResourceDef(name = "Patient") +public class PatientWithExtendedContactDstu3 extends Patient { + + private static final long serialVersionUID = 1L; + + /** + * A contact party (e.g. guardian, partner, friend) for the patient. + */ + @Child(name = "contact", type = {}, order = Child.REPLACE_PARENT, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) + @Description(shortDefinition = "A contact party (e.g. guardian, partner, friend) for the patient", formalDefinition = "A contact party (e.g. guardian, partner, friend) for the patient.") + protected List customContact; + + public List getCustomContact() { + if (customContact == null) { + customContact = new ArrayList(); + } + return customContact; + } + + @Block() + public static class CustomContactComponent extends Patient.ContactComponent { + + private static final long serialVersionUID = 1L; + @Child(name = "contact-eyecolour", type = { Identifier.class }, modifier = true) + @Description(shortDefinition = "Application ID") + @Extension(url = "http://foo.com/contact-eyecolour", definedLocally = false, isModifier = false) + private Identifier myEyeColour; + + /* + * Get messageHeaderApplicationId + */ + public Identifier getEyeColour() { + if (myEyeColour == null) { + myEyeColour = new Identifier(); + } + return myEyeColour; + } + + /* + * Set messageHeaderApplicationId + */ + public void setEyeColour(Identifier messageHeaderApplicationId) { + this.myEyeColour = messageHeaderApplicationId; + } + + } + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/ReportObservationDstu3.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/ReportObservationDstu3.java new file mode 100644 index 00000000000..5b16791e5d4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/ReportObservationDstu3.java @@ -0,0 +1,112 @@ +package ca.uhn.fhir.parser; + +import org.hl7.fhir.dstu2016may.model.BooleanType; +import org.hl7.fhir.dstu2016may.model.Observation; +import org.hl7.fhir.dstu2016may.model.StringType; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Extension; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.util.ElementUtil; + +@ResourceDef(name = "Observation", id = "reportobservation") +public class ReportObservationDstu3 extends Observation { + + /** + * Each extension is defined in a field. Any valid HAPI Data Type can be used for the field type. Note that the + * [name=""] attribute in the @Child annotation needs to match the name for the bean accessor and mutator methods. + */ + @Child(name = "mandatory", order = 0) + @Extension(url = "#mandatory", definedLocally = true, isModifier = false) + @Description(shortDefinition = "The report observation is mandatory or not") + private BooleanType mandatory; + + @Child(name = "readOnly", order = 1) + @Extension(url = "#readOnly", definedLocally = true, isModifier = false) + @Description(shortDefinition = "The report observation is read only or not") + private BooleanType readOnly; + + @Child(name = "defaultCursor", order = 2) + @Extension(url = "#defaultCursor", definedLocally = true, isModifier = false) + @Description(shortDefinition = "The report observation is default cursor or not") + private BooleanType defaultCursor; + + @Child(name = "sectionContentId", order = 3) + @Extension(url = "#sectionContentId", definedLocally = true, isModifier = false) + @Description(shortDefinition = "The primary key of the report section content") + private StringType sectionContentId; + + /** + * It is important to override the isEmpty() method, adding a check for any newly added fields. + */ + @Override + public boolean isEmpty() { + return super.isEmpty() && ElementUtil.isEmpty(mandatory, readOnly, defaultCursor, sectionContentId); + } + + /******** + * Accessors and mutators follow + * + * IMPORTANT: Each extension is required to have an getter/accessor and a stter/mutator. You are highly recommended + * to create getters which create instances if they do not already exist, since this is how the rest of the HAPI + * FHIR API works. + ********/ + + /** Getter for mandatory */ + public BooleanType getMandatory() { + if (mandatory == null) { + mandatory = new BooleanType(false); + } + return mandatory; + } + + /** Setter for mandatory */ + public ReportObservationDstu3 setMandatory(Boolean isMandatory) { + mandatory = new BooleanType(isMandatory); + return this; + } + + /** Getter for readOnly */ + public BooleanType getReadOnly() { + if (readOnly == null) { + readOnly = new BooleanType(false); + } + return readOnly; + } + + /** Setter for readOnly */ + public ReportObservationDstu3 setReadOnly(Boolean isReadOnly) { + readOnly = new BooleanType(isReadOnly); + return this; + } + + /** Getter for defaultCursor */ + public BooleanType getDefaultCursor() { + if (defaultCursor == null) { + defaultCursor = new BooleanType(false); + } + return defaultCursor; + } + + /** Setter for defaultCursor */ + public ReportObservationDstu3 setDefaultCursor(Boolean isDefaultCursor) { + defaultCursor = new BooleanType(isDefaultCursor); + return this; + } + + /** Getter for sectionContentId */ + public StringType getSectionContentId() { + if (sectionContentId == null) { + sectionContentId = new StringType(); + } + return sectionContentId; + } + + /** Setter for sectionContentId */ + public ReportObservationDstu3 setSectionContentId(String sectionContentId) { + this.sectionContentId = new StringType(sectionContentId); + return this; + } + +} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/RoundTripDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/RoundTripDstu3Test.java new file mode 100644 index 00000000000..26ea71eae18 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/RoundTripDstu3Test.java @@ -0,0 +1,120 @@ +package ca.uhn.fhir.parser; + +import static org.junit.Assert.assertTrue; + +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.events.XMLEvent; + +import org.custommonkey.xmlunit.DetailedDiff; +import org.custommonkey.xmlunit.Diff; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.util.TestUtil; +import ca.uhn.fhir.util.XmlUtil; + +public class RoundTripDstu3Test { + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RoundTripDstu3Test.class); + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + + @Test + public void testIt() { + // Just so this doesn't complain until we enable roundtrip test + } + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + +// @Test + public void testRoundTrip() throws Exception { + ZipInputStream is = new ZipInputStream(new FileInputStream("src/test/resources/examples.zip")); + try { + while (true) { + ZipEntry nextEntry = is.getNextEntry(); + if (nextEntry == null) { + break; + } + + ByteArrayOutputStream oos = new ByteArrayOutputStream(); + byte[] buffer = new byte[2048]; + int len = 0; + while ((len = is.read(buffer)) > 0) { + oos.write(buffer, 0, len); + } + + String exampleText = oos.toString("UTF-8"); + ourLog.info("Next file: {} - Size: {} bytes", nextEntry.getName(), exampleText.length()); + if (!nextEntry.getName().contains("diagnosticreport-examples-lab")) { + continue; + } + + IBaseResource parsed = ourCtx.newXmlParser().parseResource(exampleText); + String encodedXml = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed); + + exampleText = cleanXml(exampleText); + encodedXml = cleanXml(encodedXml); + + DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml))); +// d.overrideDifferenceListener(new DifferenceListener() { +// +// @Override +// public void skippedComparison(Node theControl, Node theTest) { +// ourLog.info("" + theControl); +// } +// +// @Override +// public int differenceFound(Difference theDifference) { +// ourLog.info("" + theDifference); +// return 0; +// } +// }); + + boolean similar = d.similar(); + if (!similar) { + exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", ""); + encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", ""); + if (exampleText.length() != encodedXml.length()) { +// ourLog.info("Expected: " + exampleText); +// ourLog.info("Actual : " + encodedXml); + assertTrue(d.toString(), similar); + } + } + + } + + } finally { + is.close(); + } + } + + private String cleanXml(String exampleText) throws Error, Exception { + XMLEventReader read = XmlUtil.createXmlReader(new StringReader(exampleText)); + StringWriter sw = new StringWriter(); + XMLEventWriter write = XmlUtil.createXmlWriter(sw); + while (read.hasNext()) { + XMLEvent nextEvent = read.nextEvent(); + if (nextEvent.getEventType() == XMLStreamConstants.COMMENT) { + continue; + } + write.add(nextEvent); + } + write.add(read); + sw.close(); + return sw.toString().replaceAll("", "").replace("\n", " ").replace("\r", " ").replaceAll(">\\s+<", "><").replaceAll("<\\?.*\\?>", "").replaceAll("\\s+", " "); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/XmlParserDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/XmlParserDstu3Test.java new file mode 100644 index 00000000000..bf69619c4fc --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/parser/XmlParserDstu3Test.java @@ -0,0 +1,2734 @@ +package ca.uhn.fhir.parser; + +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.startsWith; +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import java.io.IOException; +import java.io.StringReader; +import java.nio.charset.StandardCharsets; +import java.text.Annotation; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.List; +import java.util.UUID; + +import org.apache.commons.io.IOUtils; +import org.custommonkey.xmlunit.Diff; +import org.custommonkey.xmlunit.XMLUnit; +import org.hamcrest.collection.IsEmptyCollection; +import org.hamcrest.core.StringContains; +import org.hamcrest.text.StringContainsInOrder; +import org.hl7.fhir.dstu2016may.model.Address.AddressUse; +import org.hl7.fhir.dstu2016may.model.Address.AddressUseEnumFactory; +import org.hl7.fhir.dstu2016may.model.AllergyIntolerance; +import org.hl7.fhir.dstu2016may.model.Appointment; +import org.hl7.fhir.dstu2016may.model.AuditEvent; +import org.hl7.fhir.dstu2016may.model.Binary; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleType; +import org.hl7.fhir.dstu2016may.model.CodeType; +import org.hl7.fhir.dstu2016may.model.CodeableConcept; +import org.hl7.fhir.dstu2016may.model.Coding; +import org.hl7.fhir.dstu2016may.model.Composition; +import org.hl7.fhir.dstu2016may.model.ConceptMap; +import org.hl7.fhir.dstu2016may.model.Condition; +import org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem; +import org.hl7.fhir.dstu2016may.model.DateTimeType; +import org.hl7.fhir.dstu2016may.model.DateType; +import org.hl7.fhir.dstu2016may.model.DiagnosticReport; +import org.hl7.fhir.dstu2016may.model.DiagnosticReport.DiagnosticReportStatus; +import org.hl7.fhir.dstu2016may.model.DocumentManifest; +import org.hl7.fhir.dstu2016may.model.Duration; +import org.hl7.fhir.dstu2016may.model.ElementDefinition; +import org.hl7.fhir.dstu2016may.model.ElementDefinition.ElementDefinitionBindingComponent; +import org.hl7.fhir.dstu2016may.model.Encounter; +import org.hl7.fhir.dstu2016may.model.EnumFactory; +import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; +import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatus; +import org.hl7.fhir.dstu2016may.model.Extension; +import org.hl7.fhir.dstu2016may.model.GuidanceResponse; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.HumanName.NameUse; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Identifier; +import org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse; +import org.hl7.fhir.dstu2016may.model.InstantType; +import org.hl7.fhir.dstu2016may.model.Location; +import org.hl7.fhir.dstu2016may.model.Medication; +import org.hl7.fhir.dstu2016may.model.MedicationOrder; +import org.hl7.fhir.dstu2016may.model.MedicationStatement; +import org.hl7.fhir.dstu2016may.model.Observation; +import org.hl7.fhir.dstu2016may.model.Observation.ObservationRelationshipType; +import org.hl7.fhir.dstu2016may.model.Observation.ObservationStatus; +import org.hl7.fhir.dstu2016may.model.Organization; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.Practitioner; +import org.hl7.fhir.dstu2016may.model.PrimitiveType; +import org.hl7.fhir.dstu2016may.model.ProcedureRequest; +import org.hl7.fhir.dstu2016may.model.Quantity; +import org.hl7.fhir.dstu2016may.model.Reference; +import org.hl7.fhir.dstu2016may.model.Resource; +import org.hl7.fhir.dstu2016may.model.SampledData; +import org.hl7.fhir.dstu2016may.model.SimpleQuantity; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.hl7.fhir.dstu2016may.model.UriType; +import org.hl7.fhir.dstu2016may.model.ValueSet; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.mockito.ArgumentCaptor; + +import com.google.common.collect.Sets; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; +import ca.uhn.fhir.parser.FooMessageHeaderWithExplicitField.FooMessageSourceComponent; +import ca.uhn.fhir.parser.IParserErrorHandler.IParseLocation; +import ca.uhn.fhir.parser.PatientWithCustomCompositeExtension.FooParentExtension; +import ca.uhn.fhir.rest.client.IGenericClient; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.util.TestUtil; +import net.sf.saxon.style.DataElement; + +public class XmlParserDstu3Test { + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParserDstu3Test.class); + + @After + public void after() { + if (ourCtx == null) { + ourCtx = FhirContext.forDstu2_1(); + } + ourCtx.setNarrativeGenerator(null); + } + + /** + * See #414 + */ + @Test + public void testParseXmlExtensionWithoutUrl() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + + IParser parser = ourCtx.newXmlParser(); + parser.setParserErrorHandler(new LenientErrorHandler()); + Patient parsed = (Patient) parser.parseResource(input); + assertEquals(1, parsed.getExtension().size()); + assertEquals(null, parsed.getExtension().get(0).getUrl()); + assertEquals("2011-01-02T11:13:15", ((PrimitiveType)parsed.getExtension().get(0).getValue()).getValueAsString()); + + try { + parser = ourCtx.newXmlParser(); + parser.setParserErrorHandler(new StrictErrorHandler()); + parser.parseResource(input); + fail(); + } catch (DataFormatException e) { + assertEquals("Resource is missing required element 'url' in parent element 'extension'", e.getCause().getMessage()); + } + + } + + + /** + * See #414 + */ + @Test + public void testParseXmlModifierExtensionWithoutUrl() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + + IParser parser = ourCtx.newXmlParser(); + parser.setParserErrorHandler(new LenientErrorHandler()); + Patient parsed = (Patient) parser.parseResource(input); + assertEquals(1, parsed.getModifierExtension().size()); + assertEquals(null, parsed.getModifierExtension().get(0).getUrl()); + assertEquals("2011-01-02T11:13:15", ((PrimitiveType)parsed.getModifierExtension().get(0).getValue()).getValueAsString()); + + try { + parser = ourCtx.newXmlParser(); + parser.setParserErrorHandler(new StrictErrorHandler()); + parser.parseResource(input); + fail(); + } catch (DataFormatException e) { + assertEquals("Resource is missing required element 'url' in parent element 'modifierExtension'", e.getCause().getMessage()); + } + + } + + @Test + public void testEncodeChainedContainedResourcer() { + Organization gp = new Organization(); + gp.setName("grandparent"); + + Organization parent = new Organization(); + parent.setName("parent"); + parent.getPartOf().setResource(gp); + + Organization child = new Organization(); + child.setName("child"); + child.getPartOf().setResource(parent); + + Patient patient = new Patient(); + patient.getManagingOrganization().setResource(child); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient); + ourLog.info(encoded); + + patient = ourCtx.newXmlParser().parseResource(Patient.class, encoded); + + child = (Organization) patient.getManagingOrganization().getResource(); + assertEquals("child", child.getName()); + + parent = (Organization) child.getPartOf().getResource(); + assertEquals("parent", parent.getName()); + + gp = (Organization) parent.getPartOf().getResource(); + assertEquals("grandparent", gp.getName()); + } + + + + + + + + @Test + public void testBundleWithBinary() { + //@formatter:off + String bundle = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + + Bundle b = ourCtx.newXmlParser().parseResource(Bundle.class, bundle); + assertEquals(1, b.getEntry().size()); + + Binary bin = (Binary) b.getEntry().get(0).getResource(); + assertArrayEquals(new byte[] { 1, 2, 3, 4 }, bin.getContent()); + + } + + @Test + public void testContainedResourceInExtensionUndeclared() { + Patient p = new Patient(); + p.addName().addFamily("PATIENT"); + + Organization o = new Organization(); + o.setName("ORG"); + p.addExtension(new Extension("urn:foo", new Reference(o))); + + String str = ourCtx.newXmlParser().encodeResourceToString(p); + ourLog.info(str); + + p = ourCtx.newXmlParser().parseResource(Patient.class, str); + assertEquals("PATIENT", p.getName().get(0).getFamilyAsSingleString()); + + List exts = p.getExtensionsByUrl("urn:foo"); + assertEquals(1, exts.size()); + Reference rr = (Reference) exts.get(0).getValue(); + o = (Organization) rr.getResource(); + assertEquals("ORG", o.getName()); + } + + @Test + public void testDuration() { + Encounter enc = new Encounter(); + Duration duration = new Duration(); + duration.setUnit("day").setValue(123L); + enc.setLength(duration); + + String str = ourCtx.newXmlParser().encodeResourceToString(enc); + ourLog.info(str); + + assertThat(str, not(containsString("meta"))); + assertThat(str, containsString("")); + } + + @Test + public void testEncodeAndParseBundleWithResourceRefs() { + + Patient pt = new Patient(); + pt.setId("patid"); + pt.addName().addFamily("PATIENT"); + + Organization org = new Organization(); + org.setId("orgid"); + org.setName("ORG"); + pt.getManagingOrganization().setResource(org); + + Bundle bundle = new Bundle(); + bundle.addEntry().setResource(pt); + bundle.addEntry().setResource(org); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "", + "", + "", + "" + )); + //@formatter:on + + bundle = ourCtx.newXmlParser().parseResource(Bundle.class, encoded); + pt = (Patient) bundle.getEntry().get(0).getResource(); + org = (Organization) bundle.getEntry().get(1).getResource(); + + assertEquals("Organization/orgid", org.getIdElement().getValue()); + assertEquals("Organization/orgid", pt.getManagingOrganization().getReferenceElement().getValue()); + assertSame(org, pt.getManagingOrganization().getResource()); + } + + @Test + public void testEncodeAndParseCompositeExtension() { + PatientWithCustomCompositeExtension pat = new PatientWithCustomCompositeExtension(); + pat.setId("123"); + pat.setFooParentExtension(new FooParentExtension()); + pat.getFooParentExtension().setChildA(new StringType("ValueA")); + pat.getFooParentExtension().setChildB(new StringType("ValueB")); + + String enc = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(pat); + ourLog.info(enc); + + pat = ourCtx.newXmlParser().parseResource(PatientWithCustomCompositeExtension.class, enc); + + assertEquals("ValueA", pat.getFooParentExtension().getChildA().getValue()); + assertEquals("ValueB", pat.getFooParentExtension().getChildB().getValue()); + } + + @Test + public void testEncodeAndParseContained() { + IParser xmlParser = ourCtx.newXmlParser().setPrettyPrint(true); + + // Create an organization, note that the organization does not have an ID + Organization org = new Organization(); + org.getNameElement().setValue("Contained Test Organization"); + + // Create a patient + Patient patient = new Patient(); + patient.setId("Patient/1333"); + patient.addIdentifier().setSystem("urn:mrns").setValue("253345"); + + // Put the organization as a reference in the patient resource + patient.getManagingOrganization().setResource(org); + + String encoded = xmlParser.encodeResourceToString(patient); + ourLog.info(encoded); + assertThat(encoded, containsString("")); + assertThat(encoded, containsString("")); + + // Create a bundle with just the patient resource + Bundle b = new Bundle(); + b.addEntry().setResource(patient); + + // Encode the bundle + encoded = xmlParser.encodeResourceToString(b); + ourLog.info(encoded); + assertThat(encoded, stringContainsInOrder(Arrays.asList("", "", ""))); + assertThat(encoded, containsString("")); + assertThat(encoded, stringContainsInOrder(Arrays.asList("", ""))); + assertThat(encoded, not(stringContainsInOrder(Arrays.asList("", "", "")))); + + // Re-parse the bundle + patient = (Patient) xmlParser.parseResource(xmlParser.encodeResourceToString(patient)); + assertEquals("#1", patient.getManagingOrganization().getReference()); + + assertNotNull(patient.getManagingOrganization().getResource()); + org = (Organization) patient.getManagingOrganization().getResource(); + assertEquals("#1", org.getIdElement().getValue()); + assertEquals("Contained Test Organization", org.getName()); + + // And re-encode a second time + encoded = xmlParser.encodeResourceToString(patient); + ourLog.info(encoded); + assertThat(encoded, stringContainsInOrder(Arrays.asList("", "", "", ""))); + assertThat(encoded, not(stringContainsInOrder(Arrays.asList("", "")))); + assertThat(encoded, containsString("")); + + // And re-encode once more, with the references cleared + patient.getContained().clear(); + patient.getManagingOrganization().setReference((String) null); + encoded = xmlParser.encodeResourceToString(patient); + ourLog.info(encoded); + assertThat(encoded, stringContainsInOrder(Arrays.asList("", "", "", ""))); + assertThat(encoded, not(stringContainsInOrder(Arrays.asList("", "")))); + assertThat(encoded, containsString("")); + + // And re-encode once more, with the references cleared and a manually set local ID + patient.getContained().clear(); + patient.getManagingOrganization().setReference((String) null); + patient.getManagingOrganization().getResource().setId(("#333")); + encoded = xmlParser.encodeResourceToString(patient); + ourLog.info(encoded); + assertThat(encoded, stringContainsInOrder(Arrays.asList("", "", "", ""))); + assertThat(encoded, not(stringContainsInOrder(Arrays.asList("", "")))); + + } + + @Test + public void testEncodeAndParseContainedCustomTypes() { + ourCtx = FhirContext.forDstu2_1(); + ourCtx.setDefaultTypeForProfile(CustomObservation.PROFILE, CustomObservation.class); + ourCtx.setDefaultTypeForProfile(CustomDiagnosticReport.PROFILE, CustomDiagnosticReport.class); + + CustomObservation obs = new CustomObservation(); + obs.setStatus(ObservationStatus.FINAL); + + CustomDiagnosticReport dr = new CustomDiagnosticReport(); + dr.setStatus(DiagnosticReportStatus.FINAL); + dr.addResult().setResource(obs); + + IParser parser = ourCtx.newXmlParser(); + parser.setPrettyPrint(true); + + String output = parser.encodeResourceToString(dr); + ourLog.info(output); + + //@formatter:off + assertThat(output,stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + /* + * Now PARSE! + */ + + dr = (CustomDiagnosticReport) parser.parseResource(output); + assertEquals(DiagnosticReportStatus.FINAL, dr.getStatus()); + + assertEquals("#1", dr.getResult().get(0).getReference()); + obs = (CustomObservation) dr.getResult().get(0).getResource(); + assertEquals(ObservationStatus.FINAL, obs.getStatus()); + + ourCtx = null; + } + + @Test + public void testEncodeAndParseContainedNonCustomTypes() { + ourCtx = FhirContext.forDstu2_1(); + + Observation obs = new Observation(); + obs.setStatus(ObservationStatus.FINAL); + + DiagnosticReport dr = new DiagnosticReport(); + dr.setStatus(DiagnosticReportStatus.FINAL); + dr.addResult().setResource(obs); + + IParser parser = ourCtx.newXmlParser(); + parser.setPrettyPrint(true); + + String output = parser.encodeResourceToString(dr); + ourLog.info(output); + + //@formatter:off + assertThat(output,stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + /* + * Now PARSE! + */ + + dr = (DiagnosticReport) parser.parseResource(output); + assertEquals(DiagnosticReportStatus.FINAL, dr.getStatus()); + + assertEquals("#1", dr.getResult().get(0).getReference()); + obs = (Observation) dr.getResult().get(0).getResource(); + assertEquals(ObservationStatus.FINAL, obs.getStatus()); + + ourCtx = null; + } + + @Test + public void testEncodeAndParseExtensionOnCode() { + Organization o = new Organization(); + o.setName("ORG"); + o.addExtension(new Extension("urn:foo", new CodeType("acode"))); + + String str = ourCtx.newXmlParser().encodeResourceToString(o); + ourLog.info(str); + assertThat(str, containsString("")); + + o = ourCtx.newXmlParser().parseResource(Organization.class, str); + + List exts = o.getExtensionsByUrl("urn:foo"); + assertEquals(1, exts.size()); + CodeType code = (CodeType) exts.get(0).getValue(); + assertEquals("acode", code.getValue()); + + } + + + @Test + public void testEncodeAndParseExtensions() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setUse(IdentifierUse.OFFICIAL).setSystem("urn:example").setValue("7000135"); + + Extension ext = new Extension(); + ext.setUrl("http://example.com/extensions#someext"); + ext.setValue(new DateTimeType("2011-01-02T11:13:15")); + patient.addExtension(ext); + + Extension parent = new Extension().setUrl("http://example.com#parent"); + patient.addExtension(parent); + Extension child1 = new Extension().setUrl("http://example.com#child").setValue(new StringType("value1")); + parent.addExtension(child1); + Extension child2 = new Extension().setUrl("http://example.com#child").setValue(new StringType("value2")); + parent.addExtension(child2); + + Extension modExt = new Extension(); + modExt.setUrl("http://example.com/extensions#modext"); + modExt.setValue(new DateType("1995-01-02")); + patient.addModifierExtension(modExt); + + HumanName name = patient.addName(); + name.addFamily("Blah"); + StringType given = name.addGivenElement(); + given.setValue("Joe"); + Extension ext2 = new Extension().setUrl("http://examples.com#givenext").setValue(new StringType("given")); + given.addExtension(ext2); + + StringType given2 = name.addGivenElement(); + given2.setValue("Shmoe"); + Extension given2ext = new Extension().setUrl("http://examples.com#givenext_parent"); + given2.addExtension(given2ext); + given2ext.addExtension(new Extension().setUrl("http://examples.com#givenext_child").setValue(new StringType("CHILD"))); + + String output = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient); + ourLog.info(output); + + String enc = ourCtx.newXmlParser().encodeResourceToString(patient); + assertThat(enc, containsString("")); + assertThat(enc, containsString("")); + assertThat(enc, containsString( + "")); + assertThat(enc, containsString("")); + assertThat(enc, containsString( + "")); + + /* + * Now parse this back + */ + + Patient parsed = ourCtx.newXmlParser().parseResource(Patient.class, enc); + ext = parsed.getExtension().get(0); + assertEquals("http://example.com/extensions#someext", ext.getUrl()); + assertEquals("2011-01-02T11:13:15", ((DateTimeType) ext.getValue()).getValueAsString()); + + parent = patient.getExtension().get(1); + assertEquals("http://example.com#parent", parent.getUrl()); + assertNull(parent.getValue()); + child1 = parent.getExtension().get(0); + assertEquals("http://example.com#child", child1.getUrl()); + assertEquals("value1", ((StringType) child1.getValue()).getValueAsString()); + child2 = parent.getExtension().get(1); + assertEquals("http://example.com#child", child2.getUrl()); + assertEquals("value2", ((StringType) child2.getValue()).getValueAsString()); + + modExt = parsed.getModifierExtension().get(0); + assertEquals("http://example.com/extensions#modext", modExt.getUrl()); + assertEquals("1995-01-02", ((DateType) modExt.getValue()).getValueAsString()); + + name = parsed.getName().get(0); + + ext2 = name.getGiven().get(0).getExtension().get(0); + assertEquals("http://examples.com#givenext", ext2.getUrl()); + assertEquals("given", ((StringType) ext2.getValue()).getValueAsString()); + + given2ext = name.getGiven().get(1).getExtension().get(0); + assertEquals("http://examples.com#givenext_parent", given2ext.getUrl()); + assertNull(given2ext.getValue()); + Extension given2ext2 = given2ext.getExtension().get(0); + assertEquals("http://examples.com#givenext_child", given2ext2.getUrl()); + assertEquals("CHILD", ((StringType) given2ext2.getValue()).getValue()); + + } + + /** + * See #216 + */ + @Test + public void testEncodeAndParseIdentifierDstu2() { + IParser xmlParser = ourCtx.newXmlParser().setPrettyPrint(true); + + Patient patient = new Patient(); + patient.addIdentifier().setSystem("SYS").setValue("VAL").setType(new CodeableConcept().addCoding(new Coding().setSystem("http://hl7.org/fhir/v2/0203").setCode("MR"))); + + String out = xmlParser.encodeResourceToString(patient); + ourLog.info(out); + + //@formatter:off + assertThat(out, stringContainsInOrder("", + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + patient = ourCtx.newXmlParser().parseResource(Patient.class, out); + assertEquals("http://hl7.org/fhir/v2/0203", patient.getIdentifier().get(0).getType().getCoding().get(0).getSystem()); + assertEquals("MR", patient.getIdentifier().get(0).getType().getCoding().get(0).getCode()); + } + + /** + * See #347 + */ + @Test + public void testEncodeAndParseMedicationOrder() { + MedicationOrder mo = new MedicationOrder(); + mo.getDateWrittenElement().setValueAsString("2015-10-05"); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(mo); + ourLog.info(encoded); + + mo = ourCtx.newXmlParser().parseResource(MedicationOrder.class, encoded); + assertEquals("2015-10-05", mo.getDateWrittenElement().getValueAsString()); + } + + @Test + public void testEncodeAndParseMetaProfileAndTags() { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + + p.getMeta().addProfile("http://foo/Profile1"); + p.getMeta().addProfile("http://foo/Profile2"); + + p.getMeta().addTag().setSystem("scheme1").setCode("term1").setDisplay("label1"); + p.getMeta().addTag().setSystem("scheme2").setCode("term2").setDisplay("label2"); + + p.getMeta().addSecurity().setSystem("sec_scheme1").setCode("sec_term1").setDisplay("sec_label1"); + p.getMeta().addSecurity().setSystem("sec_scheme2").setCode("sec_term2").setDisplay("sec_label2"); + + String enc = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + + //@formatter:off + assertThat(enc, stringContainsInOrder("", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + Patient parsed = ourCtx.newXmlParser().parseResource(Patient.class, enc); + List gotLabels = parsed.getMeta().getProfile(); + assertEquals(2, gotLabels.size()); + UriType label = gotLabels.get(0); + assertEquals("http://foo/Profile1", label.getValue()); + label = gotLabels.get(1); + assertEquals("http://foo/Profile2", label.getValue()); + + List tagList = parsed.getMeta().getTag(); + assertEquals(2, tagList.size()); + assertEquals("scheme1", tagList.get(0).getSystem()); + assertEquals("term1", tagList.get(0).getCode()); + assertEquals("label1", tagList.get(0).getDisplay()); + assertEquals("scheme2", tagList.get(1).getSystem()); + assertEquals("term2", tagList.get(1).getCode()); + assertEquals("label2", tagList.get(1).getDisplay()); + + tagList = parsed.getMeta().getSecurity(); + assertEquals(2, tagList.size()); + assertEquals("sec_scheme1", tagList.get(0).getSystem()); + assertEquals("sec_term1", tagList.get(0).getCode()); + assertEquals("sec_label1", tagList.get(0).getDisplay()); + assertEquals("sec_scheme2", tagList.get(1).getSystem()); + assertEquals("sec_term2", tagList.get(1).getCode()); + assertEquals("sec_label2", tagList.get(1).getDisplay()); + } + + @Test + public void testEncodeAndParseMetaProfiles() { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + + p.getMeta().addTag().setSystem("scheme1").setCode("term1").setDisplay("label1"); + p.getMeta().addTag().setSystem("scheme2").setCode("term2").setDisplay("label2"); + + String enc = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + + //@formatter:off + assertThat(enc, stringContainsInOrder("", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + Patient parsed = ourCtx.newXmlParser().parseResource(Patient.class, enc); + assertThat(parsed.getMeta().getProfile(), empty()); + + List tagList = parsed.getMeta().getTag(); + assertEquals(2, tagList.size()); + assertEquals("scheme1", tagList.get(0).getSystem()); + assertEquals("term1", tagList.get(0).getCode()); + assertEquals("label1", tagList.get(0).getDisplay()); + assertEquals("scheme2", tagList.get(1).getSystem()); + assertEquals("term2", tagList.get(1).getCode()); + assertEquals("label2", tagList.get(1).getDisplay()); + } + + /** + * See #336 + */ + @Test + public void testEncodeAndParseNullPrimitiveWithExtensions() { + + Patient p = new Patient(); + p.setId("patid"); + HumanName name = p.addName(); + name.addGivenElement().setValue(null).setId("f0").addExtension(new Extension("http://foo", new StringType("FOOEXT0"))); + name.addGivenElement().setValue("V1").setId("f1").addExtension((Extension) new Extension("http://foo", new StringType("FOOEXT1")).setId("ext1id")); + name.addGivenElement(); // this one shouldn't get encoded + name.addGivenElement().setValue(null).addExtension(new Extension("http://foo", new StringType("FOOEXT3"))); + name.setId("nameid"); + + String output = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(output); + + output = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(p); + String expected = ""; + + ourLog.info("Expected: {}", expected); + ourLog.info("Actual : {}", output); + + assertEquals(expected, output); + + p = ourCtx.newXmlParser().parseResource(Patient.class, output); + assertEquals("patid", p.getIdElement().getIdPart()); + + name = p.getName().get(0); + assertEquals("nameid", name.getId()); + assertEquals(3, name.getGiven().size()); + + assertEquals(null, name.getGiven().get(0).getValue()); + assertEquals("V1", name.getGiven().get(1).getValue()); + assertEquals(null, name.getGiven().get(2).getValue()); + + assertEquals("f0", name.getGiven().get(0).getId()); + assertEquals("f1", name.getGiven().get(1).getId()); + assertEquals(null, name.getGiven().get(2).getId()); + + assertEquals(1, name.getGiven().get(0).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(0).getExtension().get(0).getUrl()); + assertEquals("FOOEXT0", ((StringType) name.getGiven().get(0).getExtension().get(0).getValue()).getValue()); + assertEquals(null, name.getGiven().get(0).getExtension().get(0).getId()); + + assertEquals(1, name.getGiven().get(1).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(1).getExtension().get(0).getUrl()); + assertEquals("FOOEXT1", ((StringType) name.getGiven().get(1).getExtension().get(0).getValue()).getValue()); + assertEquals("ext1id", name.getGiven().get(1).getExtension().get(0).getId()); + + assertEquals(1, name.getGiven().get(2).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(2).getExtension().get(0).getUrl()); + assertEquals("FOOEXT3", ((StringType) name.getGiven().get(2).getExtension().get(0).getValue()).getValue()); + assertEquals(null, name.getGiven().get(2).getExtension().get(0).getId()); + + } + + + + + @Test + public void testEncodeAndParseSecurityLabels() { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + + List labels = new ArrayList(); + labels.add(new Coding().setSystem("SYSTEM1").setCode("CODE1").setDisplay("DISPLAY1").setVersion("VERSION1")); + labels.add(new Coding().setSystem("SYSTEM2").setCode("CODE2").setDisplay("DISPLAY2").setVersion("VERSION2")); + p.getMeta().getSecurity().addAll(labels); + + String enc = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(enc); + + //@formatter:off + assertThat(enc, stringContainsInOrder("", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + Patient parsed = ourCtx.newXmlParser().parseResource(Patient.class, enc); + List gotLabels = parsed.getMeta().getSecurity(); + + assertEquals(2, gotLabels.size()); + + Coding label = gotLabels.get(0); + assertEquals("SYSTEM1", label.getSystem()); + assertEquals("CODE1", label.getCode()); + assertEquals("DISPLAY1", label.getDisplay()); + assertEquals("VERSION1", label.getVersion()); + + label = gotLabels.get(1); + assertEquals("SYSTEM2", label.getSystem()); + assertEquals("CODE2", label.getCode()); + assertEquals("DISPLAY2", label.getDisplay()); + assertEquals("VERSION2", label.getVersion()); + } + + + @Test + public void testEncodeBinaryWithNoContentType() { + Binary b = new Binary(); + b.setContent(new byte[] { 1, 2, 3, 4 }); + + String output = ourCtx.newXmlParser().encodeResourceToString(b); + ourLog.info(output); + + assertEquals("", output); + } + + @Test + public void testEncodeBundleWithContained() { + DiagnosticReport rpt = new DiagnosticReport(); + rpt.addResult().setResource(new Observation().setCode(new CodeableConcept().setText("Sharp1")).setId("#1")); + rpt.addResult().setResource(new Observation().setCode(new CodeableConcept().setText("Uuid1")).setId("urn:uuid:UUID1")); + + Bundle b = new Bundle(); + b.addEntry().setResource(rpt); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(b); + ourLog.info(encoded); + + assertThat(encoded, stringContainsInOrder("", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + )); + //@formatter:on + } + + /** + * See #113 + */ + @Test + public void testEncodeContainedResources() { + + MedicationOrder medicationPrescript = new MedicationOrder(); + + String medId = "123"; + CodeableConcept codeDt = new CodeableConcept().addCoding(new Coding().setSystem("urn:sys").setCode("code1")); + + // Adding medication to Contained. + Medication medResource = new Medication(); + medResource.setCode(codeDt); + medResource.setId("#" + String.valueOf(medId)); + medicationPrescript.getContained().add(medResource); + + // Medication reference. This should point to the contained resource. + Reference medRefDt = new Reference("#" + medId); + medRefDt.setDisplay("MedRef"); + medicationPrescript.setMedication(medRefDt); + + IParser p = ourCtx.newXmlParser().setPrettyPrint(true); + String encoded = p.encodeResourceToString(medicationPrescript); + ourLog.info(encoded); + + // @formatter:on + assertThat(encoded, + stringContainsInOrder("", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "")); + //@formatter:off + + } + + /** + * See #113 + */ + @Test + public void testEncodeContainedResourcesAutomatic() { + + MedicationOrder medicationPrescript = new MedicationOrder(); + String nameDisp = "MedRef"; + CodeableConcept codeDt = new CodeableConcept().addCoding(new Coding("urn:sys", "code1", null)); + + // Adding medication to Contained. + Medication medResource = new Medication(); + // No ID set + medResource.setCode(codeDt); + + // Medication reference. This should point to the contained resource. + Reference medRefDt = new Reference(); + medRefDt.setDisplay(nameDisp); + // Resource reference set, but no ID + medRefDt.setResource(medResource); + medicationPrescript.setMedication(medRefDt); + + IParser p = ourCtx.newXmlParser().setPrettyPrint(true); + String encoded = p.encodeResourceToString(medicationPrescript); + ourLog.info(encoded); + + //@formatter:on + assertThat(encoded, + stringContainsInOrder("", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "")); + //@formatter:off + } + + /** + * See #113 + */ + @Test + public void testEncodeContainedResourcesManualContainUsingNonLocalId() { + + MedicationOrder medicationPrescript = new MedicationOrder(); + + String medId = "123"; + CodeableConcept codeDt = new CodeableConcept().addCoding(new Coding("urn:sys", "code1", null)); + + // Adding medication to Contained. + Medication medResource = new Medication(); + medResource.setCode(codeDt); + medResource.setId(String.valueOf(medId)); // ID does not start with '#' + medicationPrescript.getContained().add(medResource); + + // Medication reference. This should point to the contained resource. + Reference medRefDt = new Reference("#" + medId); + medRefDt.setDisplay("MedRef"); + medicationPrescript.setMedication(medRefDt); + + IParser p = ourCtx.newXmlParser().setPrettyPrint(true); + String encoded = p.encodeResourceToString(medicationPrescript); + ourLog.info(encoded); + + //@formatter:on + assertThat(encoded, + stringContainsInOrder("", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "")); + //@formatter:off + + } + + @Test + public void testEncodeContainedWithNarrativeIsSuppresed() throws Exception { + IParser parser = ourCtx.newXmlParser().setPrettyPrint(true); + + // Create an organization, note that the organization does not have an ID + Organization org = new Organization(); + org.getNameElement().setValue("Contained Test Organization"); + org.getText().setDivAsString("
FOOBAR
"); + + // Create a patient + Patient patient = new Patient(); + patient.setId("Patient/1333"); + patient.addIdentifier().setSystem("urn:mrns").setValue("253345"); + patient.getText().setDivAsString("
BARFOO
"); + patient.getManagingOrganization().setResource(org); + + String encoded = parser.encodeResourceToString(patient); + ourLog.info(encoded); + + assertThat(encoded, stringContainsInOrder("", "
BARFOO
", "", "", "", "")); + assertThat(encode, stringContainsInOrder("\n\n

A P TAG

line1\nline2\nline3  BOLD

"); + + String output = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(p); + ourLog.info(output); + + //@formatter:off + assertThat(output, stringContainsInOrder( + "A P TAG

", + "

line1\nline2\nline3  BOLD
" + )); + //@formatter:on + + } + + @Test + public void testEncodeDivWithPrePrettyPrint() { + + Patient p = new Patient(); + p.getText().setDivAsString("
\n\n

A P TAG

line1\nline2\nline3  BOLD

"); + + String output = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(output); + + //@formatter:off + assertThat(output, stringContainsInOrder( + " ", + " line1\nline2\nline3 BOLD" + )); + //@formatter:on + + } + + @Test + public void testEncodeDoesntIncludeUuidId() { + Patient p = new Patient(); + p.setId(new IdType("urn:uuid:42795ed8-041f-4ebf-b6f4-78ef6f64c2f2")); + p.addIdentifier().setSystem("ACME"); + + String actual = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); + assertThat(actual, not(containsString("78ef6f64c2f2"))); + } + + @Test + public void testEncodeEmptyBinary() { + String output = ourCtx.newXmlParser().encodeResourceToString(new Binary()); + assertEquals("", output); + } + + /** + * #158 + */ + @Test + public void testEncodeEmptyTag() { + ArrayList tagList = new ArrayList(); + tagList.add(new Coding()); + tagList.add(new Coding().setDisplay("Label")); + + Patient p = new Patient(); + p.getMeta().getTag().addAll(tagList); + + String encoded = ourCtx.newXmlParser().encodeResourceToString(p); + assertThat(encoded, not(containsString("tag"))); + } + + /** + * #158 + */ + @Test + public void testEncodeEmptyTag2() { + ArrayList tagList = new ArrayList(); + tagList.add(new Coding().setSystem("scheme").setCode("code")); + tagList.add(new Coding().setDisplay("Label")); + + Patient p = new Patient(); + p.getMeta().getTag().addAll(tagList); + + String encoded = ourCtx.newXmlParser().encodeResourceToString(p); + assertThat(encoded, containsString("tag")); + assertThat(encoded, containsString("scheme")); + assertThat(encoded, not(containsString("Label"))); + } + + @Test + public void testEncodeExtensionUndeclaredNonModifier() { + Observation obs = new Observation(); + obs.setId("1"); + obs.getMeta().addProfile("http://profile"); + Extension ext = obs.addExtension(); + ext.setUrl("http://exturl").setValue(new StringType("ext_url_value")); + + obs.getCode().setText("CODE"); + + IParser parser = ourCtx.newXmlParser(); + + String output = parser.setPrettyPrint(true).encodeResourceToString(obs); + ourLog.info(output); + + //@formatter:off + assertThat(output, stringContainsInOrder( + "", + "", + "", + "", + "", + "" + )); + assertThat(output, not(stringContainsInOrder( + "" + ))); + //@formatter:on + + obs = parser.parseResource(Observation.class, output); + assertEquals(1, obs.getExtension().size()); + assertEquals("http://exturl", obs.getExtension().get(0).getUrl()); + assertEquals("ext_url_value", ((StringType) obs.getExtension().get(0).getValue()).getValue()); + } + + @Test + public void testEncodeExtensionUndeclaredNonModifierWithChildExtension() { + Observation obs = new Observation(); + obs.setId("1"); + obs.getMeta().addProfile("http://profile"); + Extension ext = obs.addExtension(); + ext.setUrl("http://exturl"); + + Extension subExt = ext.addExtension(); + subExt.setUrl("http://subext").setValue(new StringType("sub_ext_value")); + + obs.getCode().setText("CODE"); + + IParser parser = ourCtx.newXmlParser(); + + String output = parser.setPrettyPrint(true).encodeResourceToString(obs); + ourLog.info(output); + + //@formatter:off + assertThat(output, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "" + )); + assertThat(output, not(stringContainsInOrder( + "" + ))); + //@formatter:on + + obs = parser.parseResource(Observation.class, output); + assertEquals(1, obs.getExtension().size()); + assertEquals("http://exturl", obs.getExtension().get(0).getUrl()); + assertEquals(1, obs.getExtension().get(0).getExtension().size()); + assertEquals("http://subext", obs.getExtension().get(0).getExtension().get(0).getUrl()); + assertEquals("sub_ext_value", ((StringType) obs.getExtension().get(0).getExtension().get(0).getValue()).getValue()); + } + + /** + * See #327 + */ + @Test + public void testEncodeExtensionWithContainedResource() { + + TestPatientFor327 patient = new TestPatientFor327(); + patient.setBirthDateElement(new DateType("2016-04-14")); + + List conditions = new ArrayList(); + Condition condition = new Condition(); + condition.addBodySite().setText("BODY SITE"); + conditions.add(new Reference(condition)); + patient.setCondition(conditions); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + )); + //@formatter:on + } + + @Test + public void testEncodeExtensionWithResourceContent() { + IParser parser = ourCtx.newXmlParser(); + + Patient patient = new Patient(); + patient.addAddress().setUse(AddressUse.HOME); + patient.addExtension(new Extension("urn:foo", new Reference("Organization/123"))); + + String val = parser.encodeResourceToString(patient); + ourLog.info(val); + assertThat(val, StringContains.containsString("")); + + Patient actual = parser.parseResource(Patient.class, val); + assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse()); + List ext = actual.getExtension(); + assertEquals(1, ext.size()); + Reference ref = (Reference) ext.get(0).getValue(); + assertEquals("Organization/123", ref.getReference()); + + } + + @Test + public void testEncodeHistoryEncodeVersionsAtPath3() { + ourCtx = FhirContext.forDstu2_1(); + + assertNull(ourCtx.newXmlParser().getStripVersionsFromReferences()); + + AuditEvent auditEvent = new AuditEvent(); + auditEvent.addEntity().setReference(new Reference("http://foo.com/Organization/2/_history/1")); + + IParser parser = ourCtx.newXmlParser(); + + parser.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); + String enc = parser.setPrettyPrint(true).encodeResourceToString(auditEvent); + ourLog.info(enc); + assertThat(enc, containsString("")); + + parser.setDontStripVersionsFromReferencesAtPaths(new ArrayList()); + enc = parser.setPrettyPrint(true).encodeResourceToString(auditEvent); + ourLog.info(enc); + assertThat(enc, containsString("")); + + parser.setDontStripVersionsFromReferencesAtPaths((String[]) null); + enc = parser.setPrettyPrint(true).encodeResourceToString(auditEvent); + ourLog.info(enc); + assertThat(enc, containsString("")); + + parser.setDontStripVersionsFromReferencesAtPaths((List) null); + enc = parser.setPrettyPrint(true).encodeResourceToString(auditEvent); + ourLog.info(enc); + assertThat(enc, containsString("")); + + } + + @Test + public void testEncodeNarrativeSuppressed() { + Patient patient = new Patient(); + patient.setId("Patient/1/_history/1"); + patient.getText().setDivAsString("
THE DIV
"); + patient.addName().addFamily("FAMILY"); + patient.setMaritalStatus(new CodeableConcept().addCoding(new Coding().setCode("D"))); + patient.setMaritalStatus(new CodeableConcept().addCoding(new Coding().setCode("D"))); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).setSuppressNarratives(true).encodeResourceToString(patient); + ourLog.info(encoded); + + assertThat(encoded, containsString("", "", "", "")); + assertThat(encoded, not(containsString("text"))); + assertThat(encoded, not(containsString("THE DIV"))); + assertThat(encoded, containsString("family")); + assertThat(encoded, containsString("maritalStatus")); + } + + @Test + public void testEncodeNonContained() { + // Create an organization + Organization org = new Organization(); + org.setId("Organization/65546"); + org.getNameElement().setValue("Contained Test Organization"); + + // Create a patient + Patient patient = new Patient(); + patient.setId("Patient/1333"); + patient.addIdentifier().setSystem("urn:mrns").setValue("253345"); + patient.getManagingOrganization().setResource(org); + + // Create a list containing both resources. In a server method, you might just + // return this list, but here we will create a bundle to encode. + List resources = new ArrayList(); + resources.add(org); + resources.add(patient); + + // Create a bundle with both + Bundle b = new Bundle(); + b.addEntry().setResource(org); + b.addEntry().setResource(patient); + + // Encode the buntdle + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(b); + ourLog.info(encoded); + assertThat(encoded, not(containsString(""))); + assertThat(encoded, stringContainsInOrder("", "")); + assertThat(encoded, containsString("")); + assertThat(encoded, stringContainsInOrder("", "")); + + encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient); + ourLog.info(encoded); + assertThat(encoded, not(containsString(""))); + assertThat(encoded, containsString("")); + + } + + + + + + @Test + public void testEncodeReferenceUsingUnqualifiedResourceWorksCorrectly() { + + Patient patient = new Patient(); + patient.setId("phitcc_pat_normal"); + patient.addName().addGiven("Patty").setUse(NameUse.NICKNAME); + patient.addTelecom().setSystem(ContactPointSystem.EMAIL).setValue("patpain@ehealthinnovation.org"); + patient.setGender(AdministrativeGender.FEMALE); + patient.setBirthDateElement(new DateType("2001-10-13")); + + DateTimeType obsEffectiveTime = new DateTimeType("2015-04-11T12:22:01-04:00"); + + Observation obsParent = new Observation(); + obsParent.setId("phitcc_obs_bp_parent"); + obsParent.getSubject().setResource(patient); + obsParent.setStatus(ObservationStatus.FINAL); + obsParent.setEffective(obsEffectiveTime); + + Observation obsSystolic = new Observation(); + obsSystolic.setId("phitcc_obs_bp_dia"); + obsSystolic.getSubject().setResource(patient); + obsSystolic.setEffective(obsEffectiveTime); + obsParent.addRelated().setType(ObservationRelationshipType.HASMEMBER).setTarget(new Reference(obsSystolic)); + + Observation obsDiastolic = new Observation(); + obsDiastolic.setId("phitcc_obs_bp_dia"); + obsDiastolic.getSubject().setResource(patient); + obsDiastolic.setEffective(obsEffectiveTime); + obsParent.addRelated().setType(ObservationRelationshipType.HASMEMBER).setTarget(new Reference(obsDiastolic)); + + String str = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(obsParent); + ourLog.info(str); + + assertThat(str, containsString("")); + assertThat(str, containsString("")); + } + + + @Test + public void testEncodeSummary() { + Patient patient = new Patient(); + patient.setId("Patient/1/_history/1"); + patient.getText().setDivAsString("
THE DIV
"); + patient.addName().addFamily("FAMILY"); + patient.setMaritalStatus(new CodeableConcept().addCoding(new Coding().setCode("D"))); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).setSummaryMode(true).encodeResourceToString(patient); + ourLog.info(encoded); + + assertThat(encoded, containsString("", "", "", "")); + assertThat(encoded, not(containsString("THE DIV"))); + assertThat(encoded, containsString("family")); + assertThat(encoded, not(containsString("maritalStatus"))); + } + + @Test + public void testEncodeSummary2() { + Patient patient = new Patient(); + patient.setId("Patient/1/_history/1"); + patient.getText().setDivAsString("
THE DIV
"); + patient.addName().addFamily("FAMILY"); + patient.setMaritalStatus(new CodeableConcept().addCoding(new Coding().setCode("D"))); + + patient.getMeta().addTag().setSystem("foo").setCode("bar"); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).setSummaryMode(true).encodeResourceToString(patient); + ourLog.info(encoded); + + assertThat(encoded, containsString("", "", "", "")); + assertThat(encoded, stringContainsInOrder("", "", "", "")); + assertThat(encoded, not(containsString("THE DIV"))); + assertThat(encoded, containsString("family")); + assertThat(encoded, not(containsString("maritalStatus"))); + } + + @Test + public void testEncodeUndeclaredBlock() throws Exception { + FooMessageHeader.FooMessageSourceComponent source = new FooMessageHeader.FooMessageSourceComponent(); + source.getMessageHeaderApplicationId().setValue("APPID"); + source.setName("NAME"); + + FooMessageHeader header = new FooMessageHeader(); + header.setSource(source); + + header.addDestination().setName("DEST"); + + Bundle bundle = new Bundle(); + bundle.addEntry().setResource(header); + + IParser p = ourCtx.newXmlParser(); + p.setPrettyPrint(true); + + String encode = p.encodeResourceToString(bundle); + ourLog.info(encode); + + assertThat(encode, containsString("")); + assertThat(encode, stringContainsInOrder(" contained = new ArrayList(); + + // Will be added by reference + Patient p = new Patient(); + p.setId("#" + "1000"); + contained.add(p); + + // Will be added by direct resource object + Location l = new Location(); + l.setId("#" + "1001"); + contained.add(l); + + // Will not be referred to (and therefore shouldn't appear in output) + Location l2 = new Location(); + l2.setId("#1002"); + contained.add(l2); + + Appointment appointment = new Appointment(); + appointment.setId("1234"); + appointment.getContained().addAll(contained); + + appointment.addParticipant().getActor().setReference("#1000"); + appointment.addParticipant().getActor().setResource(l); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(appointment); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + )); + //@formatter:on + + assertThat(encoded, not(containsString("#1002"))); + } + + @Test + public void testEncodeWithDontEncodeElements() throws Exception { + Patient patient = new Patient(); + patient.setId("123"); + patient.getMeta().addProfile("http://profile"); + patient.addName().addFamily("FAMILY").addGiven("GIVEN"); + patient.addAddress().addLine("LINE1"); + + { + IParser p = ourCtx.newXmlParser(); + p.setDontEncodeElements(Sets.newHashSet("*.meta", "*.id")); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("Patient")); + assertThat(out, containsString("name")); + assertThat(out, containsString("address")); + assertThat(out, not(containsString("id"))); + assertThat(out, not(containsString("meta"))); + } + { + IParser p = ourCtx.newXmlParser(); + p.setDontEncodeElements(Sets.newHashSet("Patient.meta", "Patient.id")); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("Patient")); + assertThat(out, containsString("name")); + assertThat(out, containsString("address")); + assertThat(out, not(containsString("id"))); + assertThat(out, not(containsString("meta"))); + } + { + IParser p = ourCtx.newXmlParser(); + p.setDontEncodeElements(Sets.newHashSet("Patient.name.family")); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("GIVEN")); + assertThat(out, not(containsString("FAMILY"))); + } + { + IParser p = ourCtx.newXmlParser(); + p.setDontEncodeElements(Sets.newHashSet("*.meta", "*.id")); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("Patient")); + assertThat(out, containsString("name")); + assertThat(out, containsString("address")); + assertThat(out, not(containsString("id"))); + assertThat(out, not(containsString("meta"))); + } + { + IParser p = ourCtx.newXmlParser(); + p.setDontEncodeElements(Sets.newHashSet("Patient.meta")); + p.setEncodeElements(new HashSet(Arrays.asList("Patient.name"))); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(patient); + ourLog.info(out); + assertThat(out, containsString("Patient")); + assertThat(out, containsString("name")); + assertThat(out, containsString("id")); + assertThat(out, not(containsString("address"))); + assertThat(out, not(containsString("meta"))); + } + } + + @Test + public void testEncodeWithEncodeElements() throws Exception { + Patient patient = new Patient(); + patient.getMeta().addProfile("http://profile"); + patient.addName().addFamily("FAMILY"); + patient.addAddress().addLine("LINE1"); + + Bundle bundle = new Bundle(); + bundle.setTotal(100); + bundle.addEntry().setResource(patient); + + { + IParser p = ourCtx.newXmlParser(); + p.setEncodeElements(new HashSet(Arrays.asList("Patient.name", "Bundle.entry"))); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(bundle); + ourLog.info(out); + assertThat(out, not(containsString("total"))); + assertThat(out, (containsString("Patient"))); + assertThat(out, (containsString("name"))); + assertThat(out, not(containsString("address"))); + } + { + IParser p = ourCtx.newXmlParser(); + p.setEncodeElements(new HashSet(Arrays.asList("Patient.name"))); + p.setEncodeElementsAppliesToResourceTypes(new HashSet(Arrays.asList("Patient"))); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(bundle); + ourLog.info(out); + assertThat(out, (containsString("total"))); + assertThat(out, (containsString("Patient"))); + assertThat(out, (containsString("name"))); + assertThat(out, not(containsString("address"))); + } + { + IParser p = ourCtx.newXmlParser(); + p.setEncodeElements(new HashSet(Arrays.asList("Patient"))); + p.setEncodeElementsAppliesToResourceTypes(new HashSet(Arrays.asList("Patient"))); + p.setPrettyPrint(true); + String out = p.encodeResourceToString(bundle); + ourLog.info(out); + assertThat(out, (containsString("total"))); + assertThat(out, (containsString("Patient"))); + assertThat(out, (containsString("name"))); + assertThat(out, (containsString("address"))); + } + + } + + @Test + public void testEncodeWithNarrative() { + Patient p = new Patient(); + p.addName().addFamily("Smith").addGiven("John"); + + ourCtx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); + + String output = ourCtx.newXmlParser().encodeResourceToString(p); + ourLog.info(output); + + assertThat(output, containsString("
John SMITH ")); + } + + + + @Test + public void testMoreExtensions() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setUse(IdentifierUse.OFFICIAL).setSystem("urn:example").setValue("7000135"); + + Extension ext = new Extension(); + ext.setUrl("http://example.com/extensions#someext"); + ext.setValue(new DateTimeType("2011-01-02T11:13:15")); + + // Add the extension to the resource + patient.addExtension(ext); + // END SNIPPET: resourceExtension + + // START SNIPPET: resourceStringExtension + HumanName name = patient.addName(); + name.addFamily("Shmoe"); + StringType given = name.addGivenElement(); + given.setValue("Joe"); + Extension ext2 = new Extension().setUrl("http://examples.com#givenext").setValue(new StringType("given")); + given.addExtension(ext2); + + StringType given2 = name.addGivenElement(); + given2.setValue("Shmoe"); + Extension given2ext = new Extension().setUrl("http://examples.com#givenext_parent"); + given2.addExtension(given2ext); + Extension givenExtChild = new Extension(); + givenExtChild.setUrl("http://examples.com#givenext_child").setValue(new StringType("CHILD")); + given2ext.addExtension(givenExtChild); + // END SNIPPET: resourceStringExtension + + // START SNIPPET: subExtension + Extension parent = new Extension().setUrl("http://example.com#parent"); + patient.addExtension(parent); + + Extension child1 = new Extension().setUrl("http://example.com#child").setValue(new StringType("value1")); + parent.addExtension(child1); + + Extension child2 = new Extension().setUrl("http://example.com#child").setValue(new StringType("value1")); + parent.addExtension(child2); + // END SNIPPET: subExtension + + String output = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient); + ourLog.info(output); + + String enc = ourCtx.newXmlParser().encodeResourceToString(patient); + assertThat(enc, containsString("")); + assertThat(enc, containsString( + "")); + assertThat(enc, containsString("")); + assertThat(enc, containsString( + "")); + } + + @Test + public void testOmitResourceId() { + Patient p = new Patient(); + p.setId("123"); + p.addName().addFamily("ABC"); + + assertThat(ourCtx.newXmlParser().encodeResourceToString(p), stringContainsInOrder("123", "ABC")); + assertThat(ourCtx.newXmlParser().setOmitResourceId(true).encodeResourceToString(p), containsString("ABC")); + assertThat(ourCtx.newXmlParser().setOmitResourceId(true).encodeResourceToString(p), not(containsString("123"))); + } + + @Test + @Ignore + public void testParseAndEncodeBundle() throws Exception { + String content = IOUtils.toString(XmlParserDstu3Test.class.getResourceAsStream("/bundle-example.xml"), StandardCharsets.UTF_8); + + Bundle parsed = ourCtx.newXmlParser().parseResource(Bundle.class, content); + assertEquals("Bundle/example/_history/1", parsed.getIdElement().getValue()); + assertEquals("1", parsed.getMeta().getVersionId()); + assertEquals("1", parsed.getIdElement().getVersionIdPart()); + assertEquals(("2014-08-18T01:43:30Z"), parsed.getMeta().getLastUpdatedElement().getValueAsString()); + assertEquals("searchset", parsed.getType().toCode()); + assertEquals(3, parsed.getTotal()); + assertEquals("https://example.com/base/MedicationOrder?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2", parsed.getLink("next").getUrl()); + assertEquals("https://example.com/base/MedicationOrder?patient=347&_include=MedicationOrder.medication", parsed.getLink("self").getUrl()); + + assertEquals(2, parsed.getEntry().size()); + assertEquals("http://foo?search", parsed.getEntry().get(0).getLink("search").getUrl()); + + assertEquals("http://example.com/base/MedicationOrder/3123/_history/1", parsed.getEntry().get(0).getLink("alternate").getUrl()); + MedicationOrder p = (MedicationOrder) parsed.getEntry().get(0).getResource(); + assertEquals("Patient/347", p.getPatient().getReference()); + assertEquals("2014-08-16T05:31:17Z", p.getMeta().getLastUpdatedElement().getValueAsString()); + assertEquals("http://example.com/base/MedicationOrder/3123/_history/1", p.getId()); + + Medication m = (Medication) parsed.getEntry().get(1).getResource(); + assertEquals("http://example.com/base/Medication/example", m.getId()); + assertSame(((Reference) p.getMedication()).getResource(), m); + + String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed); + ourLog.info(reencoded); + + Diff d = new Diff(new StringReader(content), new StringReader(reencoded)); + assertTrue(d.toString(), d.identical()); + + } + + @Test + @Ignore + public void testParseAndEncodeBundleNewStyle() throws Exception { + String content = IOUtils.toString(XmlParserDstu3Test.class.getResourceAsStream("/bundle-example.xml"), StandardCharsets.UTF_8); + + IParser newXmlParser = ourCtx.newXmlParser(); + Bundle parsed = newXmlParser.parseResource(Bundle.class, content); + assertEquals("Bundle/example/_history/1", parsed.getIdElement().getValue()); + assertEquals("1", parsed.getIdElement().getVersionIdPart()); + assertEquals("2014-08-18T01:43:30Z", parsed.getMeta().getLastUpdatedElement().getValueAsString()); + assertEquals("searchset", parsed.getType()); + assertEquals(3, parsed.getTotal()); + assertEquals("https://example.com/base/MedicationOrder?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2", parsed.getLink().get(0).getUrlElement().getValueAsString()); + assertEquals("https://example.com/base/MedicationOrder?patient=347&_include=MedicationOrder.medication", parsed.getLink().get(1).getUrlElement().getValueAsString()); + + assertEquals(2, parsed.getEntry().size()); + assertEquals("alternate", parsed.getEntry().get(0).getLink().get(0).getRelation()); + assertEquals("http://example.com/base/MedicationOrder/3123/_history/1", parsed.getEntry().get(0).getLink().get(0).getUrl()); + assertEquals("http://foo?search", parsed.getEntry().get(0).getRequest().getUrlElement().getValueAsString()); + + MedicationOrder p = (MedicationOrder) parsed.getEntry().get(0).getResource(); + assertEquals("Patient/347", p.getPatient().getReference()); + assertEquals("2014-08-16T05:31:17Z", p.getMeta().getLastUpdatedElement().getValueAsString()); + assertEquals("http://example.com/base/MedicationOrder/3123/_history/1", p.getId()); + // assertEquals("3123", p.getId()); + + Medication m = (Medication) parsed.getEntry().get(1).getResource(); + assertEquals("http://example.com/base/Medication/example", m.getId()); + assertSame(((Reference) p.getMedication()).getResource(), m); + + String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed); + ourLog.info(reencoded); + + Diff d = new Diff(new StringReader(content), new StringReader(reencoded)); + assertTrue(d.toString(), d.identical()); + + } + + @Test + public void testParseAndEncodeComments() throws IOException { + //@formatter:off + String input = "\n" + + " " + + " \n" + + " \n" + + " \n" + + "
\n" + + "\n" + + "

Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321

\n" + + "\n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " " + + " " + + "
"; + //@formatter:off + + Patient res = ourCtx.newXmlParser().parseResource(Patient.class, input); + res.getFormatCommentsPre(); + assertEquals("Patient/pat1", res.getId()); + assertEquals("654321", res.getIdentifier().get(0).getValue()); + assertEquals(true, res.getActive()); + + assertThat(res.getIdElement().getFormatCommentsPre(), contains("pre resource comment")); + assertThat(res.getIdentifier().get(0).getFormatCommentsPre(), contains("identifier comment 1", "identifier comment 2")); + assertThat(res.getIdentifier().get(0).getUseElement().getFormatCommentsPre(), contains("use comment 1", "use comment 2")); + assertThat(res.getActiveElement().getFormatCommentsPost(), contains("post resource comment")); + + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(res); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "\"identifier\": [", + "{", + "\"fhir_comments\":", + "[", + "\"identifier comment 1\"", + ",", + "\"identifier comment 2\"", + "]", + "\"use\": \"usual\",", + "\"_use\": {", + "\"fhir_comments\":", + "[", + "\"use comment 1\"", + ",", + "\"use comment 2\"", + "]", + "},", + "\"type\"" + )); + //@formatter:off + + encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(res); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "", + "", + "", + "", + "
", + "

Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321

", + "
", + "
", + " \n", + " ", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "
" + )); + //@formatter:off + + } + + @Test + public void testParseAndEncodeCommentsOnExtensions() { + //@formatter:off + String input = + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + + Patient pat = ourCtx.newXmlParser().parseResource(Patient.class, input); + String output = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(pat); + ourLog.info(output); + + assertThat(output, stringContainsInOrder( + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "" + )); + + output = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(pat); + ourLog.info(output); + + assertThat(output, stringContainsInOrder( + "{", + " \"resourceType\": \"Patient\",", + " \"id\": \"someid\",", + " \"_id\": {", + " \"fhir_comments\": [", + " \" comment 1 \"", + " ]", + " },", + " \"extension\": [", + " {", + " \"fhir_comments\": [", + " \" comment 2 \",", + " \" comment 7 \"", + " ],", + " \"url\": \"urn:patientext:att\",", + " \"valueAttachment\": {", + " \"fhir_comments\": [", + " \" comment 3 \",", + " \" comment 6 \"", + " ],", + " \"contentType\": \"aaaa\",", + " \"_contentType\": {", + " \"fhir_comments\": [", + " \" comment 4 \"", + " ]", + " },", + " \"data\": \"AAAA\",", + " \"_data\": {", + " \"fhir_comments\": [", + " \" comment 5 \"", + " ]", + " }", + " }", + " }", + " ]", + "}" + )); + + //@formatter:on + } + + + @Test + public void testParseAndEncodeNestedExtensions() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + + Patient p = ourCtx.newXmlParser().parseResource(Patient.class, input); + DateType bd = p.getBirthDateElement(); + assertEquals("2005-03-04", bd.getValueAsString()); + + List exts = bd.getExtensionsByUrl("http://my.fancy.extension.url"); + assertEquals(1, exts.size()); + Extension ext = exts.get(0); + assertEquals(null, ext.getValue()); + + exts = ext.getExtensionsByUrl("http://my.fancy.extension.url"); + assertEquals(1, exts.size()); + ext = exts.get(0); + assertEquals("myNestedValue", ((StringType) ext.getValue()).getValue()); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); + ourLog.info(encoded); + + //@formatter:off + assertThat(encoded, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + } + + @Test + public void testParseBundleNewWithPlaceholderIds() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + //@formatter:on + + Bundle parsed = ourCtx.newXmlParser().parseResource(Bundle.class, input); + assertEquals("urn:oid:0.1.2.3", parsed.getEntry().get(0).getResource().getIdElement().getValue()); + + } + + @Test + public void testParseBundleNewWithPlaceholderIdsInBase1() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + //@formatter:on + + Bundle parsed = ourCtx.newXmlParser().parseResource(Bundle.class, input); + assertEquals("urn:oid:0.1.2.3", parsed.getEntry().get(0).getResource().getIdElement().getValue()); + } + + @Test + public void testParseBundleNewWithPlaceholderIdsInBase2() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + //@formatter:on + + Bundle parsed = ourCtx.newXmlParser().parseResource(Bundle.class, input); + assertEquals("urn:uuid:0.1.2.3", parsed.getEntry().get(0).getResource().getIdElement().getValue()); + + //@formatter:off + input = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + //@formatter:on + + parsed = ourCtx.newXmlParser().parseResource(Bundle.class, input); + assertEquals("urn:uuid:0.1.2.3", parsed.getEntry().get(0).getResource().getIdElement().getValue()); + + } + + @Test + public void testParseBundleOldStyleWithUnknownLinks() throws Exception { + //@formatter:off + String bundle = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + + Bundle b = (Bundle) ourCtx.newXmlParser().parseResource(bundle); + assertEquals(1, b.getEntry().size()); + + } + + @Test + public void testParseBundleOldWithPlaceholderIds() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + //@formatter:on + + Bundle parsed = (Bundle) ourCtx.newXmlParser().parseResource(input); + assertEquals("urn:oid:0.1.2.3", parsed.getEntry().get(0).getResource().getId()); + + } + + @Test + public void testParseBundleWithBinary() { + // TODO: implement this test, make sure we handle ID and meta correctly in Binary + } + + + + @Test + public void testParseBundleWithResourceId() { + //@formatter:off + String input = "" + + "" + + "" + + "" + + "\n"; + //@formatter:on + + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, input); + assertEquals("http://localhost:58402/fhir/context/Patient/1/_history/3", bundle.getEntry().get(0).getResource().getIdElement().getValue()); + assertEquals("http://localhost:58402/fhir/context/Patient/1/_history/2", bundle.getEntry().get(1).getResource().getIdElement().getValue()); + assertEquals("http://localhost:58402/fhir/context/Patient/1/_history/1", bundle.getEntry().get(2).getResource().getIdElement().getValue()); + } + + /** + * see #144 and #146 + */ + @Test + @Ignore + public void testParseContained() { + + FhirContext c = FhirContext.forDstu2_1(); + IParser parser = c.newXmlParser().setPrettyPrint(true); + + Observation o = new Observation(); + o.getCode().setText("obs text"); + + Patient p = new Patient(); + p.addName().addFamily("patient family"); + o.getSubject().setResource(p); + + String enc = parser.encodeResourceToString(o); + ourLog.info(enc); + + //@formatter:off + assertThat(enc, stringContainsInOrder( + "", + "", + "", + "", + "", + "" + )); + //@formatter:on + + o = parser.parseResource(Observation.class, enc); + assertEquals("obs text", o.getCode().getText()); + + assertNotNull(o.getSubject().getResource()); + p = (Patient) o.getSubject().getResource(); + assertEquals("patient family", p.getName().get(0).getFamily()); + } + + /** + * Thanks to Alexander Kley! + */ + @Test + public void testParseContainedBinaryResource() { + byte[] bin = new byte[] { 0, 1, 2, 3, 4 }; + final Binary binary = new Binary(); + binary.setContentType("PatientConsent").setContent(bin); + + DocumentManifest manifest = new DocumentManifest(); + CodeableConcept cc = new CodeableConcept(); + cc.addCoding().setSystem("mySystem").setCode("PatientDocument"); + manifest.setType(cc); + manifest.setMasterIdentifier(new Identifier().setSystem("mySystem").setValue(UUID.randomUUID().toString())); + manifest.addContent().setP(new Reference(binary)); + manifest.setStatus(DocumentReferenceStatus.CURRENT); + + String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(manifest); + ourLog.info(encoded); + assertThat(encoded, StringContainsInOrder.stringContainsInOrder(Arrays.asList("contained>", ""))); + + DocumentManifest actual = ourCtx.newXmlParser().parseResource(DocumentManifest.class, encoded); + assertEquals(1, actual.getContained().size()); + assertEquals(1, actual.getContent().size()); + + /* + * If this fails, it's possibe the DocumentManifest structure is wrong: It should be + * + * @Child(name = "p", type = {Attachment.class, ValueSet.class}, order=1, min=1, max=1, modifier=false, summary=true) + */ + assertNotNull(((Reference) actual.getContent().get(0).getP()).getResource()); + } + + /** + * See #426 + */ + @Test + public void testParseExtensionWithIdType() { + //@formatter:off + String input = + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + Patient pt = ourCtx.newXmlParser().parseResource(Patient.class, input); + + List extList = pt.getExtensionsByUrl("http://aaa.ch/fhir/Patient#mangedcare"); + extList = extList.get(0).getExtensionsByUrl("http://aaa.ch/fhir/Patient#mangedcare-aaa-id"); + Extension ext = extList.get(0); + IdType value = (IdType) ext.getValue(); + assertEquals("mc1", value.getValueAsString()); + } + + /** + * See #426 + * + * Value type of FOO isn't a valid datatype + */ + @Test + public void testParseExtensionWithInvalidType() { + //@formatter:off + String input = + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + Patient pt = ourCtx.newXmlParser().parseResource(Patient.class, input); + + List extList = pt.getExtensionsByUrl("http://aaa.ch/fhir/Patient#mangedcare"); + extList = extList.get(0).getExtensionsByUrl("http://aaa.ch/fhir/Patient#mangedcare-aaa-id"); + Extension ext = extList.get(0); + IdType value = (IdType) ext.getValue(); + assertEquals(null, value); + } + + /** + * See #342 + */ + @Test(expected = DataFormatException.class) + public void testParseInvalid() { + ourCtx.newXmlParser().parseResource("FOO"); + } + + /** + * See #366 + */ + @Test() + public void testParseInvalidBoolean() { + //@formatter:off + String resource = "\n" + + " \n" + + ""; + //@formatter:on + + IParser p = ourCtx.newXmlParser(); + + try { + p.parseResource(resource); + fail(); + } catch (DataFormatException e) { + assertEquals("DataFormatException at [[row,col {unknown-source}]: [2,4]]: Invalid attribute value \"1\": Invalid boolean string: '1'", e.getMessage()); + } + + LenientErrorHandler errorHandler = new LenientErrorHandler(); + assertEquals(true, errorHandler.isErrorOnInvalidValue()); + errorHandler.setErrorOnInvalidValue(false); + p.setParserErrorHandler(errorHandler); + } + + @Test + public void testParseInvalidTextualNumber() { + Observation obs = new Observation(); + obs.setValue(new Quantity().setValue(1234)); + String encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs); + encoded = encoded.replace("1234", "\"1234\""); + ourLog.info(encoded); + ourCtx.newJsonParser().parseResource(encoded); + } + + /** + * See #216 + */ + @Test + public void testParseMalformedIdentifierDstu2() { + + // This was changed from 0.5 to 1.0.0 + + //@formatter:off + String out = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + + IParserErrorHandler errorHandler = mock(IParserErrorHandler.class); + + IParser p = ourCtx.newXmlParser(); + p.setParserErrorHandler(errorHandler); + + Patient patient = p.parseResource(Patient.class, out); + assertThat(patient.getIdentifier().get(0).getType().getCoding(), IsEmptyCollection.empty()); + + ArgumentCaptor capt = ArgumentCaptor.forClass(String.class); + verify(errorHandler, times(1)).unknownAttribute(any(IParseLocation.class), capt.capture()); + + assertEquals("value", capt.getValue()); + } + + @Test + public void testParseMetadata() throws Exception { + //@formatter:off + String bundle = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + + Bundle b = ourCtx.newXmlParser().parseResource(Bundle.class, bundle); + assertEquals(1, b.getEntry().size()); + + BundleEntryComponent entry = b.getEntry().get(0); + Patient pt = (Patient) entry.getResource(); + assertEquals("http://foo/fhirBase2/Patient/1/_history/2", pt.getIdElement().getValue()); + assertEquals("2012-01-02", pt.getBirthDateElement().getValueAsString()); + assertEquals("0.123", entry.getSearch().getScore().toString()); + assertEquals("match", entry.getSearch().getMode().toCode()); + assertEquals("POST", entry.getRequest().getMethod().toCode()); + assertEquals("http://foo/Patient?identifier=value", entry.getRequest().getUrl()); + assertEquals("2001-02-22T09:22:33-07:00", pt.getMeta().getLastUpdatedElement().getValueAsString()); + + IParser p = ourCtx.newXmlParser().setPrettyPrint(true); + String reEncoded = p.encodeResourceToString(b); + ourLog.info(reEncoded); + + Diff d = new Diff(new StringReader(bundle), new StringReader(reEncoded)); + assertTrue(d.toString(), d.identical()); + + } + + @Test + public void testParseMetaUpdatedDate() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + Bundle b = ourCtx.newXmlParser().parseResource(Bundle.class, input); + + InstantType updated = b.getMeta().getLastUpdatedElement(); + assertEquals("2015-06-22T15:48:57.554-04:00", updated.getValueAsString()); + + } + + // TODO: this should work + @Test + @Ignore + public void testParseNarrative() throws Exception { + //@formatter:off + String htmlNoNs = "
AAABBBCCC
"; + String htmlNs = htmlNoNs.replace("
", "
"); + String res= "\n" + + " \n" + + " \n" + + " " + htmlNs + "\n" + + " \n" + + ""; + //@formatter:on + + Patient p = ourCtx.newXmlParser().parseResource(Patient.class, res); + assertEquals(htmlNs, p.getText().getDiv().getValueAsString()); + } + + @Test + public void testParseNestedExtensionsInvalid() { + //@formatter:off + String input = "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + //@formatter:on + + try { + ourCtx.newXmlParser().parseResource(Patient.class, input); + fail(); + } catch (DataFormatException e) { + assertThat(e.getMessage(), containsString("Extension (URL='http://my.fancy.extension.url') must not have both a value and other contained extensions")); + } + } + + /** + * See #163 + */ + @Test + public void testParseResourceType() { + IParser xmlParser = ourCtx.newXmlParser().setPrettyPrint(true); + + // Patient + Patient patient = new Patient(); + String patientId = UUID.randomUUID().toString(); + patient.setId(new IdType("Patient", patientId)); + patient.addName().addGiven("John").addFamily("Smith"); + patient.setGender(AdministrativeGender.MALE); + patient.setBirthDateElement(new DateType("1987-04-16")); + + // Bundle + Bundle bundle = new Bundle(); + bundle.setType(BundleType.COLLECTION); + bundle.addEntry().setResource(patient); + + String bundleText = xmlParser.encodeResourceToString(bundle); + ourLog.info(bundleText); + + Bundle reincarnatedBundle = xmlParser.parseResource(Bundle.class, bundleText); + Patient reincarnatedPatient = (Patient) reincarnatedBundle.getEntry().get(0).getResource(); + + assertEquals("Patient", patient.getIdElement().getResourceType()); + assertEquals("Patient", reincarnatedPatient.getIdElement().getResourceType()); + } + + /** + * See #344 + */ + @Test + public void testParserIsCaseSensitive() { + Observation obs = new Observation(); + SampledData data = new SampledData(); + data.setData("1 2 3"); + data.setOrigin((SimpleQuantity) new SimpleQuantity().setValue(0L)); + data.setPeriod(1000L); + obs.setValue(data); + + IParser p = ourCtx.newXmlParser().setPrettyPrint(true).setParserErrorHandler(new StrictErrorHandler()); + String encoded = p.encodeResourceToString(obs); + ourLog.info(encoded); + + p.parseResource(encoded); + + try { + p.parseResource(encoded.replace("Observation", "observation")); + fail(); + } catch (DataFormatException e) { + assertEquals("DataFormatException at [[row,col {unknown-source}]: [1,1]]: Unknown resource type 'observation': Resource names are case sensitive, found similar name: 'Observation'", + e.getMessage()); + } + + try { + p.parseResource(encoded.replace("valueSampledData", "valueSampleddata")); + fail(); + } catch (DataFormatException e) { + assertEquals("DataFormatException at [[row,col {unknown-source}]: [2,4]]: Unknown element 'valueSampleddata' found during parse", e.getMessage()); + } + } + + /** + * See #339 + * + * https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing + */ + @Test + public void testXxe() { + //@formatter:off + String input = + "" + + "" + + "]>" + + "" + + "" + + "
TEXT &xxe; TEXT
" + + "
" + + "
" + + "" + + "
" + + "
"; + //@formatter:on + + ourLog.info(input); + + try { + ourCtx.newXmlParser().parseResource(Patient.class, input); + fail(); + } catch (DataFormatException e) { + assertThat(e.toString(), containsString("Undeclared general entity")); + } + + } + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() { + XMLUnit.setIgnoreAttributeOrder(true); + XMLUnit.setIgnoreComments(true); + XMLUnit.setIgnoreWhitespace(true); + } + + public static void main(String[] args) { + IGenericClient c = ourCtx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open"); + // c.registerInterceptor(new LoggingInterceptor(true)); + c.read().resource("Patient").withId("324").execute(); + } + + @ResourceDef(name = "Patient") + public static class TestPatientFor327 extends Patient { + + private static final long serialVersionUID = 1L; + + @Child(name = "testCondition") + @ca.uhn.fhir.model.api.annotation.Extension(url = "testCondition", definedLocally = true, isModifier = false) + private List testConditions = null; + + public List getConditions() { + return this.testConditions; + } + + public void setCondition(List ref) { + this.testConditions = ref; + } + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java new file mode 100644 index 00000000000..88be5b44b88 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java @@ -0,0 +1,115 @@ +package ca.uhn.fhir.rest.client; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.io.StringReader; +import java.nio.charset.Charset; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.input.ReaderInputStream; +import org.apache.http.HttpResponse; +import org.apache.http.ProtocolVersion; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.message.BasicHeader; +import org.apache.http.message.BasicStatusLine; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.util.TestUtil; + +public class ClientWithCustomTypeDstu3Test { + private static FhirContext ourCtx; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ClientWithCustomTypeDstu3Test.class); + private HttpClient myHttpClient; + private HttpResponse myHttpResponse; + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + @Before + public void before() { + myHttpClient = mock(HttpClient.class, new ReturnsDeepStubs()); + ourCtx.getRestfulClientFactory().setHttpClient(myHttpClient); + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); + myHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); + } + + private byte[] extractBodyAsByteArray(ArgumentCaptor capt) throws IOException { + byte[] body = IOUtils.toByteArray(((HttpEntityEnclosingRequestBase) capt.getAllValues().get(0)).getEntity().getContent()); + return body; + } + + private String extractBodyAsString(ArgumentCaptor capt) throws IOException { + String body = IOUtils.toString(((HttpEntityEnclosingRequestBase) capt.getAllValues().get(0)).getEntity().getContent(), "UTF-8"); + return body; + } + + + @Test + public void testReadCustomType() throws Exception { + IParser p = ourCtx.newXmlParser(); + + MyPatientWithExtensions response = new MyPatientWithExtensions(); + response.addName().addFamily("FAMILY"); + response.getStringExt().setValue("STRINGVAL"); + response.getDateExt().setValueAsString("2011-01-02"); + final String respString = p.encodeResourceToString(response); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + //@formatter:off + MyPatientWithExtensions value = client + .read() + .resource(MyPatientWithExtensions.class) + .withId("123") + .execute(); + //@formatter:on + + HttpUriRequest request = capt.getAllValues().get(0); + + assertEquals("http://example.com/fhir/Patient/123", request.getURI().toASCIIString()); + assertEquals("GET", request.getMethod()); + + assertEquals(1, value.getName().size()); + assertEquals("FAMILY", value.getName().get(0).getFamilyAsSingleString()); + assertEquals("STRINGVAL", value.getStringExt().getValue()); + assertEquals("2011-01-02", value.getDateExt().getValueAsString()); + + } + + + + @BeforeClass + public static void beforeClass() { + ourCtx = FhirContext.forDstu2_1(); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu3Test.java new file mode 100644 index 00000000000..d9f05919ce3 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu3Test.java @@ -0,0 +1,2104 @@ +package ca.uhn.fhir.rest.client; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.startsWith; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.input.ReaderInputStream; +import org.apache.http.Header; +import org.apache.http.HttpResponse; +import org.apache.http.ProtocolVersion; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.message.BasicHeader; +import org.apache.http.message.BasicStatusLine; +import org.hl7.fhir.dstu2016may.model.Binary; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleType; +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.hl7.fhir.dstu2016may.model.Device; +import org.hl7.fhir.dstu2016may.model.Encounter; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Observation; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Parameters; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import com.google.common.base.Charsets; +import com.phloc.commons.io.streams.StringInputStream; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.model.api.TemporalPrecisionEnum; +import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; +import ca.uhn.fhir.parser.CustomTypeDstu21Test; +import ca.uhn.fhir.parser.CustomTypeDstu21Test.MyCustomPatient; +import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.api.PreferReturnEnum; +import ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException; +import ca.uhn.fhir.rest.client.exceptions.NonFhirResponseException; +import ca.uhn.fhir.rest.client.interceptor.CookieInterceptor; +import ca.uhn.fhir.rest.client.interceptor.UserInfoInterceptor; +import ca.uhn.fhir.rest.param.ParamPrefixEnum; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.rest.server.EncodingEnum; +import ca.uhn.fhir.rest.server.exceptions.NotImplementedOperationException; +import ca.uhn.fhir.rest.server.exceptions.UnclassifiedServerFailureException; +import ca.uhn.fhir.util.TestUtil; +import ca.uhn.fhir.util.UrlUtil; +import ca.uhn.fhir.util.VersionUtil; + +public class GenericClientDstu3Test { + private static FhirContext ourCtx; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(GenericClientDstu3Test.class); + private int myAnswerCount; + private HttpClient myHttpClient; + private HttpResponse myHttpResponse; + + @Before + public void before() { + myHttpClient = mock(HttpClient.class, new ReturnsDeepStubs()); + ourCtx.getRestfulClientFactory().setHttpClient(myHttpClient); + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); + myHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); + myAnswerCount = 0; + System.setProperty(BaseClient.HAPI_CLIENT_KEEPRESPONSES, "true"); + } + + private String expectedUserAgent() { + return "HAPI-FHIR/" + VersionUtil.getVersion() + " (FHIR Client; FHIR " + FhirVersionEnum.DSTU2_1.getVersionImplementation().getVersionString() + "/DSTU2_1; apache)"; + } + + private byte[] extractBodyAsByteArray(ArgumentCaptor capt) throws IOException { + byte[] body = IOUtils.toByteArray(((HttpEntityEnclosingRequestBase) capt.getAllValues().get(0)).getEntity().getContent()); + return body; + } + + private String extractBodyAsString(ArgumentCaptor capt) throws IOException { + String body = IOUtils.toString(((HttpEntityEnclosingRequestBase) capt.getAllValues().get(0)).getEntity().getContent(), "UTF-8"); + return body; + } + + private ArgumentCaptor prepareClientForSearchResponse() throws IOException, ClientProtocolException { + final String msg = "{\"resourceType\":\"Bundle\",\"id\":null,\"base\":\"http://localhost:57931/fhir/contextDev\",\"total\":1,\"link\":[{\"relation\":\"self\",\"url\":\"http://localhost:57931/fhir/contextDev/Patient?identifier=urn%3AMultiFhirVersionTest%7CtestSubmitPatient01&_format=json\"}],\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"1\",\"meta\":{\"versionId\":\"1\",\"lastUpdated\":\"2014-12-20T18:41:29.706-05:00\"},\"identifier\":[{\"system\":\"urn:MultiFhirVersionTest\",\"value\":\"testSubmitPatient01\"}]}}]}"; + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")); + } + }); + return capt; + } + + @Test + public void testPatchJsonByIdString() throws Exception { + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + final String respString = ourCtx.newJsonParser().encodeResourceToString(conf); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + String patch = "[ { \"op\":\"replace\", \"path\":\"/active\", \"value\":false } ]"; + + MethodOutcome outcome = client + .patch() + .withBody(patch) + .withId("Patient/123") + .execute(); + + assertEquals("http://example.com/fhir/Patient/123", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("PATCH", capt.getAllValues().get(0).getRequestLine().getMethod()); + assertEquals(patch, extractBodyAsString(capt)); + assertEquals(Constants.CT_JSON_PATCH, capt.getAllValues().get(idx).getFirstHeader("Content-Type").getValue().replaceAll(";.*", "")); + idx++; + + OperationOutcome oo = (OperationOutcome) outcome.getOperationOutcome(); + assertThat(oo.getText().getDivAsString(), containsString("OK!")); + } + @Test + public void testPatchJsonByIdType() throws Exception { + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + final String respString = ourCtx.newJsonParser().encodeResourceToString(conf); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + String patch = "[ { \"op\":\"replace\", \"path\":\"/active\", \"value\":false } ]"; + + MethodOutcome outcome = client + .patch() + .withBody(patch) + .withId(new IdType("http://localhost/fhir/Patient/123/_history/234")) + .execute(); + + assertEquals("http://example.com/fhir/Patient/123", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("PATCH", capt.getAllValues().get(0).getRequestLine().getMethod()); + assertEquals(patch, extractBodyAsString(capt)); + assertEquals(Constants.CT_JSON_PATCH, capt.getAllValues().get(idx).getFirstHeader("Content-Type").getValue().replaceAll(";.*", "")); + idx++; + + OperationOutcome oo = (OperationOutcome) outcome.getOperationOutcome(); + assertThat(oo.getText().getDivAsString(), containsString("OK!")); + } + @Test + public void testPatchJsonByConditionalString() throws Exception { + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + final String respString = ourCtx.newJsonParser().encodeResourceToString(conf); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + String patch = "[ { \"op\":\"replace\", \"path\":\"/active\", \"value\":false } ]"; + + MethodOutcome outcome = client + .patch() + .withBody(patch) + .conditionalByUrl("Patient?foo=bar") + .execute(); + + assertEquals("http://example.com/fhir/Patient?foo=bar", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("PATCH", capt.getAllValues().get(0).getRequestLine().getMethod()); + assertEquals(patch, extractBodyAsString(capt)); + assertEquals(Constants.CT_JSON_PATCH, capt.getAllValues().get(idx).getFirstHeader("Content-Type").getValue().replaceAll(";.*", "")); + idx++; + + OperationOutcome oo = (OperationOutcome) outcome.getOperationOutcome(); + assertThat(oo.getText().getDivAsString(), containsString("OK!")); + } + @Test + public void testPatchJsonByConditionalParam() throws Exception { + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + final String respString = ourCtx.newJsonParser().encodeResourceToString(conf); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + String patch = "[ { \"op\":\"replace\", \"path\":\"/active\", \"value\":false } ]"; + + MethodOutcome outcome = client + .patch() + .withBody(patch) + .conditional("Patient").where(Patient.NAME.matches().value("TEST")) + .and(Patient.FAMILY.matches().value("TEST2")) + .execute(); + + assertEquals("http://example.com/fhir/Patient?name=TEST&family=TEST2", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("PATCH", capt.getAllValues().get(0).getRequestLine().getMethod()); + assertEquals(patch, extractBodyAsString(capt)); + assertEquals(Constants.CT_JSON_PATCH, capt.getAllValues().get(idx).getFirstHeader("Content-Type").getValue().replaceAll(";.*", "")); + idx++; + + OperationOutcome oo = (OperationOutcome) outcome.getOperationOutcome(); + assertThat(oo.getText().getDivAsString(), containsString("OK!")); + } + @Test + public void testPatchJsonByConditionalParamResourceType() throws Exception { + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + final String respString = ourCtx.newJsonParser().encodeResourceToString(conf); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + String patch = "[ { \"op\":\"replace\", \"path\":\"/active\", \"value\":false } ]"; + + MethodOutcome outcome = client + .patch() + .withBody(patch) + .conditional(Patient.class).where(Patient.NAME.matches().value("TEST")) + .and(Patient.FAMILY.matches().value("TEST2")) + .execute(); + + assertEquals("http://example.com/fhir/Patient?name=TEST&family=TEST2", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("PATCH", capt.getAllValues().get(0).getRequestLine().getMethod()); + assertEquals(patch, extractBodyAsString(capt)); + assertEquals(Constants.CT_JSON_PATCH, capt.getAllValues().get(idx).getFirstHeader("Content-Type").getValue().replaceAll(";.*", "")); + idx++; + + OperationOutcome oo = (OperationOutcome) outcome.getOperationOutcome(); + assertThat(oo.getText().getDivAsString(), containsString("OK!")); + } + @Test + public void testPatchXmlByIdString() throws Exception { + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + final String respString = ourCtx.newJsonParser().encodeResourceToString(conf); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + String patch = "false"; + + MethodOutcome outcome = client + .patch() + .withBody(patch) + .withId("Patient/123") + .execute(); + + assertEquals("http://example.com/fhir/Patient/123", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("PATCH", capt.getAllValues().get(0).getRequestLine().getMethod()); + assertEquals(patch, extractBodyAsString(capt)); + assertEquals(Constants.CT_XML_PATCH, capt.getAllValues().get(idx).getFirstHeader("Content-Type").getValue().replaceAll(";.*", "")); + idx++; + + OperationOutcome oo = (OperationOutcome) outcome.getOperationOutcome(); + assertThat(oo.getText().getDivAsString(), containsString("OK!")); + } + + @Test + public void testPatchInvalid() throws Exception { + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + try { + client + .patch() + .withBody("AA") + .withId("Patient/123") + .execute(); + } catch (IllegalArgumentException e) { + assertEquals("Unable to determine encoding of patch", e.getMessage()); + } + } + + @Test + public void testAcceptHeaderWithEncodingSpecified() throws Exception { + final String msg = "{\"resourceType\":\"Bundle\",\"id\":null,\"base\":\"http://localhost:57931/fhir/contextDev\",\"total\":1,\"link\":[{\"relation\":\"self\",\"url\":\"http://localhost:57931/fhir/contextDev/Patient?identifier=urn%3AMultiFhirVersionTest%7CtestSubmitPatient01&_format=json\"}],\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"1\",\"meta\":{\"versionId\":\"1\",\"lastUpdated\":\"2014-12-20T18:41:29.706-05:00\"},\"identifier\":[{\"system\":\"urn:MultiFhirVersionTest\",\"value\":\"testSubmitPatient01\"}]}}]}"; + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + //@formatter:off + client.setEncoding(EncodingEnum.JSON); + client.search() + .forResource("Device") + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Device?_format=json", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("application/fhir+json;q=1.0, application/json+fhir;q=0.9", capt.getAllValues().get(idx).getFirstHeader(Constants.HEADER_ACCEPT).getValue()); + idx++; + + //@formatter:off + client.setEncoding(EncodingEnum.XML); + client.search() + .forResource("Device") + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Device?_format=xml", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("application/fhir+xml;q=1.0, application/xml+fhir;q=0.9", capt.getAllValues().get(idx).getFirstHeader(Constants.HEADER_ACCEPT).getValue()); + idx++; + + } + + @Test + public void testBinaryCreateWithFhirContentType() throws Exception { + IParser p = ourCtx.newXmlParser(); + + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + + final String respString = p.encodeResourceToString(conf); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Patient pt = new Patient(); + pt.getText().setDivAsString("A PATIENT"); + + Binary bin = new Binary(); + bin.setContent(ourCtx.newJsonParser().encodeResourceToString(pt).getBytes("UTF-8")); + bin.setContentType(Constants.CT_FHIR_JSON); + client.create().resource(bin).execute(); + + ourLog.info(Arrays.asList(capt.getAllValues().get(0).getAllHeaders()).toString()); + + assertEquals("http://example.com/fhir/Binary", capt.getAllValues().get(0).getURI().toASCIIString()); + validateUserAgent(capt); + + assertEquals("application/xml+fhir;charset=utf-8", capt.getAllValues().get(0).getHeaders("Content-Type")[0].getValue().toLowerCase().replace(" ", "")); + assertEquals(Constants.HEADER_ACCEPT_VALUE_XML_NON_LEGACY, capt.getAllValues().get(0).getHeaders("Accept")[0].getValue()); + Binary output = ourCtx.newXmlParser().parseResource(Binary.class, extractBodyAsString(capt)); + assertEquals(Constants.CT_FHIR_JSON, output.getContentType()); + + Patient outputPt = (Patient) ourCtx.newJsonParser().parseResource(new String(output.getContent(), "UTF-8")); + assertEquals("
A PATIENT
", outputPt.getText().getDivAsString()); + } + + @Test + public void testBinaryCreateWithNoContentType() throws Exception { + IParser p = ourCtx.newXmlParser(); + + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + + final String respString = p.encodeResourceToString(conf); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Binary bin = new Binary(); + bin.setContent(new byte[] { 0, 1, 2, 3, 4 }); + client.create().resource(bin).execute(); + + ourLog.info(Arrays.asList(capt.getAllValues().get(0).getAllHeaders()).toString()); + + assertEquals("http://example.com/fhir/Binary", capt.getAllValues().get(0).getURI().toASCIIString()); + validateUserAgent(capt); + + assertEquals("application/xml+fhir;charset=utf-8", capt.getAllValues().get(0).getHeaders("Content-Type")[0].getValue().toLowerCase().replace(" ", "")); + assertEquals(Constants.HEADER_ACCEPT_VALUE_XML_NON_LEGACY, capt.getAllValues().get(0).getHeaders("Accept")[0].getValue()); + assertArrayEquals(new byte[] { 0, 1, 2, 3, 4 }, ourCtx.newXmlParser().parseResource(Binary.class, extractBodyAsString(capt)).getContent()); + + } + + + + @SuppressWarnings("unchecked") + @Test + public void testClientFailures() throws Exception { + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenThrow(IllegalStateException.class, RuntimeException.class, Exception.class); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + try { + client.read().resource(Patient.class).withId("1").execute(); + fail(); + } catch (FhirClientConnectionException e) { + assertEquals("java.lang.IllegalStateException", e.getMessage()); + } + + try { + client.read().resource(Patient.class).withId("1").execute(); + fail(); + } catch (RuntimeException e) { + assertEquals("java.lang.RuntimeException", e.toString()); + } + + try { + client.read().resource(Patient.class).withId("1").execute(); + fail(); + } catch (FhirClientConnectionException e) { + assertEquals("java.lang.Exception", e.getMessage()); + } + } + + @Test + public void testCookieInterceptor() throws Exception { + final String respString = CustomTypeDstu21Test.createBundle(CustomTypeDstu21Test.createResource(false)); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + client.registerInterceptor(new CookieInterceptor("foo=bar")); + + //@formatter:off + Bundle resp = client + .history() + .onType(Patient.class) + .andReturnBundle(Bundle.class) + .execute(); + //@formatter:on + + assertEquals("foo=bar", capt.getAllValues().get(0).getFirstHeader("Cookie").getValue()); + } + + @Test + public void testCreateWithPreferRepresentationServerReturnsOO() throws Exception { + final IParser p = ourCtx.newXmlParser(); + + final OperationOutcome resp0 = new OperationOutcome(); + resp0.getText().setDivAsString("OK!"); + + final Patient resp1 = new Patient(); + resp1.getText().setDivAsString("FINAL VALUE"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getAllHeaders()).thenAnswer(new Answer() { + @Override + public Header[] answer(InvocationOnMock theInvocation) throws Throwable { + return new Header[] { new BasicHeader(Constants.HEADER_LOCATION, "http://foo.com/base/Patient/222/_history/3") }; + } + }); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + if (myAnswerCount++ == 0) { + return new ReaderInputStream(new StringReader(p.encodeResourceToString(resp0)), Charset.forName("UTF-8")); + } else { + return new ReaderInputStream(new StringReader(p.encodeResourceToString(resp1)), Charset.forName("UTF-8")); + } + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Patient pt = new Patient(); + pt.getText().setDivAsString("A PATIENT"); + + MethodOutcome outcome = client.create().resource(pt).prefer(PreferReturnEnum.REPRESENTATION).execute(); + + assertEquals(2, myAnswerCount); + assertNotNull(outcome.getOperationOutcome()); + assertNotNull(outcome.getResource()); + + assertEquals("
OK!
", ((OperationOutcome) outcome.getOperationOutcome()).getText().getDivAsString()); + assertEquals("
FINAL VALUE
", ((Patient) outcome.getResource()).getText().getDivAsString()); + + assertEquals(myAnswerCount, capt.getAllValues().size()); + assertEquals("http://example.com/fhir/Patient", capt.getAllValues().get(0).getURI().toASCIIString()); + assertEquals(Constants.CT_FHIR_XML, capt.getAllValues().get(0).getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + + assertEquals("http://foo.com/base/Patient/222/_history/3", capt.getAllValues().get(1).getURI().toASCIIString()); + } + + @Test + public void testCreateWithPreferRepresentationServerReturnsResource() throws Exception { + final IParser p = ourCtx.newXmlParser(); + + final Patient resp1 = new Patient(); + resp1.getText().setDivAsString("FINAL VALUE"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getAllHeaders()).thenAnswer(new Answer() { + @Override + public Header[] answer(InvocationOnMock theInvocation) throws Throwable { + return new Header[] { new BasicHeader(Constants.HEADER_LOCATION, "http://foo.com/base/Patient/222/_history/3") }; + } + }); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + myAnswerCount++; + return new ReaderInputStream(new StringReader(p.encodeResourceToString(resp1)), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Patient pt = new Patient(); + pt.getText().setDivAsString("A PATIENT"); + + MethodOutcome outcome = client.create().resource(pt).prefer(PreferReturnEnum.REPRESENTATION).execute(); + + assertEquals(1, myAnswerCount); + assertNull(outcome.getOperationOutcome()); + assertNotNull(outcome.getResource()); + + assertEquals("
FINAL VALUE
", ((Patient) outcome.getResource()).getText().getDivAsString()); + + assertEquals(myAnswerCount, capt.getAllValues().size()); + assertEquals("http://example.com/fhir/Patient", capt.getAllValues().get(0).getURI().toASCIIString()); + } + + @Test + public void testExplicitCustomTypeHistoryType() throws Exception { + final String respString = CustomTypeDstu21Test.createBundle(CustomTypeDstu21Test.createResource(false)); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + //@formatter:off + Bundle resp = client + .history() + .onType(CustomTypeDstu21Test.MyCustomPatient.class) + .andReturnBundle(Bundle.class) + .execute(); + //@formatter:on + + assertEquals(1, resp.getEntry().size()); + assertEquals(CustomTypeDstu21Test.MyCustomPatient.class, resp.getEntry().get(0).getResource().getClass()); + assertEquals("http://example.com/fhir/Patient/_history", capt.getAllValues().get(0).getURI().toASCIIString()); + } + + @Test + public void testExplicitCustomTypeLoadPage() throws Exception { + final String respString = CustomTypeDstu21Test.createBundle(CustomTypeDstu21Test.createResource(false)); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + Bundle bundle = new Bundle(); + bundle.addLink().setRelation("next").setUrl("http://foo/next"); + + //@formatter:off + Bundle resp = client + .loadPage() + .next(bundle) + .preferResponseType(MyCustomPatient.class) + .execute(); + //@formatter:on + + assertEquals(1, resp.getEntry().size()); + assertEquals(CustomTypeDstu21Test.MyCustomPatient.class, resp.getEntry().get(0).getResource().getClass()); + assertEquals("http://foo/next", capt.getAllValues().get(0).getURI().toASCIIString()); + + //@formatter:off + resp = client + .loadPage() + .next(bundle) + .preferResponseTypes(toTypeList(MyCustomPatient.class)) + .execute(); + //@formatter:on + + assertEquals(1, resp.getEntry().size()); + assertEquals(CustomTypeDstu21Test.MyCustomPatient.class, resp.getEntry().get(0).getResource().getClass()); + assertEquals("http://foo/next", capt.getAllValues().get(0).getURI().toASCIIString()); + } + + @Test + public void testExplicitCustomTypeOperation() throws Exception { + + Parameters param = new Parameters(); + Patient patient = new Patient(); + patient.addName().addFamily("FOO"); + param.addParameter().setName("foo").setResource(patient); + final String respString = ourCtx.newXmlParser().encodeResourceToString(param); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + //@formatter:off + Parameters resp = client + .operation() + .onServer() + .named("foo") + .withNoParameters(Parameters.class) + .preferResponseType(MyCustomPatient.class) + .execute(); + //@formatter:on + + assertEquals(1, resp.getParameter().size()); + assertEquals(CustomTypeDstu21Test.MyCustomPatient.class, resp.getParameter().get(0).getResource().getClass()); + assertEquals("http://example.com/fhir/$foo", capt.getAllValues().get(0).getURI().toASCIIString()); + + //@formatter:off + resp = client + .operation() + .onType(MyCustomPatient.class) + .named("foo") + .withNoParameters(Parameters.class) + .execute(); + //@formatter:on + + assertEquals(1, resp.getParameter().size()); + assertEquals(CustomTypeDstu21Test.MyCustomPatient.class, resp.getParameter().get(0).getResource().getClass()); + assertEquals("http://example.com/fhir/Patient/$foo", capt.getAllValues().get(1).getURI().toASCIIString()); + } + + @Test + public void testExplicitCustomTypeSearch() throws Exception { + final String respString = CustomTypeDstu21Test.createBundle(CustomTypeDstu21Test.createResource(false)); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + //@formatter:off + Bundle resp = client + .search() + .forResource(CustomTypeDstu21Test.MyCustomPatient.class) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + + assertEquals(1, resp.getEntry().size()); + assertEquals(CustomTypeDstu21Test.MyCustomPatient.class, resp.getEntry().get(0).getResource().getClass()); + assertEquals("http://example.com/fhir/Patient", capt.getAllValues().get(0).getURI().toASCIIString()); + } + + @Test + public void testFetchCapabilityStatementReceiveCapabilityStatement() throws Exception { + final IParser p = ourCtx.newXmlParser(); + + final Conformance conf = new Conformance(); + conf.setCopyright("COPY"); + + final Patient patient = new Patient(); + patient.addName().addFamily("FAM"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + private int myCount = 0; + + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + final String respString; + if (myCount == 1 || myCount == 2) { + ourLog.info("Encoding patient"); + respString = p.encodeResourceToString(patient); + } else { + ourLog.info("Encoding conformance"); + respString = p.encodeResourceToString(conf); + } + myCount++; + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.ONCE); + IGenericClient client = ourCtx.newRestfulGenericClient("http://testForceConformanceCapabilityStatement.com/fhir"); + + client.read().resource("Patient").withId("1").execute(); + assertEquals(2, capt.getAllValues().size()); + assertEquals("http://testForceConformanceCapabilityStatement.com/fhir/metadata", capt.getAllValues().get(0).getURI().toASCIIString()); + assertEquals("http://testForceConformanceCapabilityStatement.com/fhir/Patient/1", capt.getAllValues().get(1).getURI().toASCIIString()); + + client.read().resource("Patient").withId("1").execute(); + assertEquals(3, capt.getAllValues().size()); + assertEquals("http://testForceConformanceCapabilityStatement.com/fhir/Patient/1", capt.getAllValues().get(2).getURI().toASCIIString()); + + client.forceConformanceCheck(); + assertEquals(4, capt.getAllValues().size()); + assertEquals("http://testForceConformanceCapabilityStatement.com/fhir/metadata", capt.getAllValues().get(3).getURI().toASCIIString()); + } + + @SuppressWarnings("deprecation") + @Test + public void testFetchCapabilityStatementReceiveConformance() throws Exception { + final IParser p = ourCtx.newXmlParser(); + + final Conformance conf = new Conformance(); + conf.setCopyright("COPY"); + + final Patient patient = new Patient(); + patient.addName().addFamily("FAM"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + final String respString; + if (myAnswerCount >= 1) { + ourLog.info("Encoding patient"); + respString = p.encodeResourceToString(patient); + } else { + ourLog.info("Encoding conformance"); + respString = p.encodeResourceToString(conf); + } + myAnswerCount++; + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.ONCE); + IGenericClient client = ourCtx.newRestfulGenericClient("http://testForceConformanceConformance.com/fhir"); + + client.read().resource("Patient").withId("1").execute(); + assertEquals(2, capt.getAllValues().size()); + assertEquals("http://testForceConformanceConformance.com/fhir/metadata", capt.getAllValues().get(0).getURI().toASCIIString()); + assertEquals("http://testForceConformanceConformance.com/fhir/Patient/1", capt.getAllValues().get(1).getURI().toASCIIString()); + + client.read().resource("Patient").withId("1").execute(); + assertEquals(3, capt.getAllValues().size()); + assertEquals("http://testForceConformanceConformance.com/fhir/Patient/1", capt.getAllValues().get(2).getURI().toASCIIString()); + + myAnswerCount = 0; + client.forceConformanceCheck(); + assertEquals(4, capt.getAllValues().size()); + assertEquals("http://testForceConformanceConformance.com/fhir/metadata", capt.getAllValues().get(3).getURI().toASCIIString()); + } + + @SuppressWarnings("deprecation") + @Test + public void testForceConformance() throws Exception { + final IParser p = ourCtx.newXmlParser(); + + final Conformance conf = new Conformance(); + conf.setCopyright("COPY"); + + final Patient patient = new Patient(); + patient.addName().addFamily("FAM"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + final String respString; + if (myAnswerCount >= 1) { + ourLog.info("Encoding patient"); + respString = p.encodeResourceToString(patient); + } else { + ourLog.info("Encoding conformance"); + respString = p.encodeResourceToString(conf); + } + myAnswerCount++; + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.ONCE); + IGenericClient client = ourCtx.newRestfulGenericClient("http://testForceConformance.com/fhir"); + + client.read().resource("Patient").withId("1").execute(); + assertEquals(2, capt.getAllValues().size()); + assertEquals("http://testForceConformance.com/fhir/metadata", capt.getAllValues().get(0).getURI().toASCIIString()); + assertEquals("http://testForceConformance.com/fhir/Patient/1", capt.getAllValues().get(1).getURI().toASCIIString()); + + client.read().resource("Patient").withId("1").execute(); + assertEquals(3, capt.getAllValues().size()); + assertEquals("http://testForceConformance.com/fhir/Patient/1", capt.getAllValues().get(2).getURI().toASCIIString()); + + myAnswerCount = 0; + client.forceConformanceCheck(); + assertEquals(4, capt.getAllValues().size()); + assertEquals("http://testForceConformance.com/fhir/metadata", capt.getAllValues().get(3).getURI().toASCIIString()); + } + + @Test + public void testHttp499() throws Exception { + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 499, "Wacky Message")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public StringInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new StringInputStream("HELLO", Charsets.UTF_8); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + try { + client.read().resource(Patient.class).withId("1").execute(); + fail(); + } catch (UnclassifiedServerFailureException e) { + assertEquals("ca.uhn.fhir.rest.server.exceptions.UnclassifiedServerFailureException: HTTP 499 Wacky Message", e.toString()); + assertEquals("HELLO", e.getResponseBody()); + } + + } + + @Test + public void testHttp501() throws Exception { + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 501, "Not Implemented")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public StringInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new StringInputStream("not implemented", Charsets.UTF_8); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + try { + client.read().resource(Patient.class).withId("1").execute(); + fail(); + } catch (NotImplementedOperationException e) { + assertEquals("HTTP 501 Not Implemented", e.getMessage()); + } + + } + + @SuppressWarnings("deprecation") + @Test + public void testInvalidConformanceCall() { + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + try { + client.conformance(); + fail(); + } catch (IllegalArgumentException e) { + assertEquals("Must call fetchConformance() instead of conformance() for RI/STU3+ structures", e.getMessage()); + } + } + + /** + * See #150 + */ + @Test + public void testNullAndEmptyParamValuesAreIgnored() throws Exception { + ArgumentCaptor capt = prepareClientForSearchResponse(); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + //@formatter:off + client + .search() + .forResource(Patient.class) + .where(Patient.FAMILY.matches().value((String)null)) + .and(Patient.BIRTHDATE.exactly().day((Date)null)) + .and(Patient.GENDER.exactly().code((String)null)) + .and(Patient.ORGANIZATION.hasId((String)null)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + + assertEquals("http://example.com/fhir/Patient", capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client + .search() + .forResource(Encounter.class) + .where(Encounter.LENGTH.exactly().number(null)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + + assertEquals("http://example.com/fhir/Encounter", capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client + .search() + .forResource(Observation.class) + .where(Observation.VALUE_QUANTITY.exactly().number(null).andUnits(null)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + + assertEquals("http://example.com/fhir/Observation", capt.getAllValues().get(idx).getURI().toString()); + idx++; + + } + + @Test + public void testPutDoesntForceAllIdsJson() throws Exception { + IParser p = ourCtx.newJsonParser(); + + Patient patient = new Patient(); + patient.setId("PATIENT1"); + patient.addName().addFamily("PATIENT1"); + + Bundle bundle = new Bundle(); + bundle.setId("BUNDLE1"); + bundle.addEntry().setResource(patient); + + final String encoded = p.encodeResourceToString(bundle); + assertEquals("{\"resourceType\":\"Bundle\",\"id\":\"BUNDLE1\",\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"PATIENT1\",\"name\":[{\"family\":[\"PATIENT1\"]}]}}]}", encoded); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON_NEW + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(encoded), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + //@formatter:off + client + .update() + .resource(bundle) + .prefer(PreferReturnEnum.REPRESENTATION) + .encodedJson() + .execute(); + + HttpPut httpRequest = (HttpPut) capt.getValue(); + assertEquals("http://example.com/fhir/Bundle/BUNDLE1", httpRequest.getURI().toASCIIString()); + + String requestString = IOUtils.toString(httpRequest.getEntity().getContent(), StandardCharsets.UTF_8); + assertEquals(encoded, requestString); + } + + @Test + public void testPutDoesntForceAllIdsXml() throws Exception { + IParser p = ourCtx.newXmlParser(); + + Patient patient = new Patient(); + patient.setId("PATIENT1"); + patient.addName().addFamily("PATIENT1"); + + Bundle bundle = new Bundle(); + bundle.setId("BUNDLE1"); + bundle.addEntry().setResource(patient); + + final String encoded = p.encodeResourceToString(bundle); + assertEquals("", encoded); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(encoded), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + //@formatter:off + client + .update() + .resource(bundle) + .prefer(PreferReturnEnum.REPRESENTATION) + .execute(); + + HttpPut httpRequest = (HttpPut) capt.getValue(); + assertEquals("http://example.com/fhir/Bundle/BUNDLE1", httpRequest.getURI().toASCIIString()); + + String requestString = IOUtils.toString(httpRequest.getEntity().getContent(), StandardCharsets.UTF_8); + assertEquals(encoded, requestString); + } + + @Test + public void testReadWithUnparseableResponse() throws Exception { + String msg = "{\"resourceTypeeeee\":\"Patient\"}"; + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + try { + client.read().resource("Patient").withId("123").elementsSubset("name", "identifier").execute(); + fail(); + } catch (FhirClientConnectionException e) { + assertEquals("Failed to parse response from server when performing GET to URL http://example.com/fhir/Patient/123?_elements=identifier%2Cname - ca.uhn.fhir.parser.DataFormatException: Invalid JSON content detected, missing required element: 'resourceType'", e.getMessage()); + } + } + + @Test + public void testResponseHasContentTypeMissing() throws Exception { + IParser p = ourCtx.newXmlParser(); + Patient patient = new Patient(); + patient.addName().addFamily("FAM"); + final String respString = p.encodeResourceToString(patient); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + // when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(null); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + try { + client.read().resource(Patient.class).withId("1").execute(); + fail(); + } catch (NonFhirResponseException e) { + assertEquals("Response contains no Content-Type", e.getMessage()); + } + + // Patient resp = client.read().resource(Patient.class).withId("1").execute(); + // assertEquals("FAM", resp.getNameFirstRep().getFamilyAsSingleString()); + } + + @Test + public void testResponseHasContentTypeNonFhir() throws Exception { + IParser p = ourCtx.newXmlParser(); + Patient patient = new Patient(); + patient.addName().addFamily("FAM"); + final String respString = p.encodeResourceToString(patient); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", "text/plain")); + // when(myHttpResponse.getEntity().getContentType()).thenReturn(null); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + try { + client.read().resource(Patient.class).withId("1").execute(); + fail(); + } catch (NonFhirResponseException e) { + assertEquals("Response contains non FHIR Content-Type 'text/plain' : ", e.getMessage()); + } + + // Patient resp = client.read().resource(Patient.class).withId("1").execute(); + // assertEquals("FAM", resp.getNameFirstRep().getFamilyAsSingleString()); + } + + @Test + public void testSearchByDate() throws Exception { + final String msg = "{\"resourceType\":\"Bundle\",\"id\":null,\"base\":\"http://localhost:57931/fhir/contextDev\",\"total\":1,\"link\":[{\"relation\":\"self\",\"url\":\"http://localhost:57931/fhir/contextDev/Patient?identifier=urn%3AMultiFhirVersionTest%7CtestSubmitPatient01&_format=json\"}],\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"1\",\"meta\":{\"versionId\":\"1\",\"lastUpdated\":\"2014-12-20T18:41:29.706-05:00\"},\"identifier\":[{\"system\":\"urn:MultiFhirVersionTest\",\"value\":\"testSubmitPatient01\"}]}}]}"; + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + DateTimeDt now = DateTimeDt.withCurrentTime(); + String dateString = now.getValueAsString().substring(0, 10); + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.after().day(dateString)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?birthdate=gt"+dateString, capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.after().day(now.getValue())) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?birthdate=gt"+dateString, capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.afterOrEquals().day(dateString)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?birthdate=ge"+dateString, capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.before().day(dateString)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?birthdate=lt"+dateString, capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.beforeOrEquals().day(dateString)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?birthdate=le"+dateString, capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.exactly().day(dateString)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?birthdate="+dateString, capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.after().second("2011-01-02T22:33:01Z")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?birthdate=gt2011-01-02T22:33:01Z", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.after().second(now.getValueAsString())) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?birthdate=gt" + now.getValueAsString(), UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.BIRTHDATE.after().now()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertThat(capt.getAllValues().get(idx).getURI().toString(), startsWith("http://example.com/fhir/Patient?birthdate=gt2")); + dateString = UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString()).substring(44); + ourLog.info(dateString); + assertEquals(TemporalPrecisionEnum.SECOND, new DateTimeDt(dateString).getPrecision()); + idx++; + } + + @SuppressWarnings("deprecation") + @Test + public void testSearchByQuantity() throws Exception { + final String msg = "{\"resourceType\":\"Bundle\",\"id\":null,\"base\":\"http://localhost:57931/fhir/contextDev\",\"total\":1,\"link\":[{\"relation\":\"self\",\"url\":\"http://localhost:57931/fhir/contextDev/Patient?identifier=urn%3AMultiFhirVersionTest%7CtestSubmitPatient01&_format=json\"}],\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"1\",\"meta\":{\"versionId\":\"1\",\"lastUpdated\":\"2014-12-20T18:41:29.706-05:00\"},\"identifier\":[{\"system\":\"urn:MultiFhirVersionTest\",\"value\":\"testSubmitPatient01\"}]}}]}"; + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.approximately().number(123).andNoUnits()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=ap123||", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.approximately().number("123").andUnits("CODE")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=ap123||CODE", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.approximately().number("123").andUnits("SYSTEM", "CODE")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=ap123|SYSTEM|CODE", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.exactly().number(123).andNoUnits()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=123||", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.exactly().number("123").andUnits("CODE")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=123||CODE", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.exactly().number("123").andUnits("SYSTEM", "CODE")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=123|SYSTEM|CODE", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.greaterThan().number(123).andNoUnits()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=gt123||", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.lessThan().number(123).andNoUnits()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=lt123||", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.greaterThanOrEquals().number(123).andNoUnits()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=ge123||", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.lessThanOrEquals().number(123).andNoUnits()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=le123||", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.withComparator(QuantityCompararatorEnum.GREATERTHAN).number(123).andNoUnits()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=gt123||", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Observation") + .where(Observation.VALUE_QUANTITY.withPrefix(ParamPrefixEnum.GREATERTHAN).number(123).andNoUnits()) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Observation?value-quantity=gt123||", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + } + + @Test + public void testSearchByString() throws Exception { + final String msg = "{\"resourceType\":\"Bundle\",\"id\":null,\"base\":\"http://localhost:57931/fhir/contextDev\",\"total\":1,\"link\":[{\"relation\":\"self\",\"url\":\"http://localhost:57931/fhir/contextDev/Patient?identifier=urn%3AMultiFhirVersionTest%7CtestSubmitPatient01&_format=json\"}],\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"1\",\"meta\":{\"versionId\":\"1\",\"lastUpdated\":\"2014-12-20T18:41:29.706-05:00\"},\"identifier\":[{\"system\":\"urn:MultiFhirVersionTest\",\"value\":\"testSubmitPatient01\"}]}}]}"; + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.NAME.matches().value("AAA")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?name=AAA", capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.NAME.matches().value(new StringDt("AAA"))) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?name=AAA", capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.NAME.matches().values("AAA", "BBB")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?name=AAA,BBB", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.NAME.matches().values(Arrays.asList("AAA", "BBB"))) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?name=AAA,BBB", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.NAME.matchesExactly().value("AAA")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?name%3Aexact=AAA", capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.NAME.matchesExactly().value(new StringDt("AAA"))) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?name%3Aexact=AAA", capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.NAME.matchesExactly().values("AAA", "BBB")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?name:exact=AAA,BBB", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.NAME.matchesExactly().values(Arrays.asList("AAA", "BBB"))) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?name:exact=AAA,BBB", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + } + + @Test + public void testSearchByUrl() throws Exception { + final String msg = "{\"resourceType\":\"Bundle\",\"id\":null,\"base\":\"http://localhost:57931/fhir/contextDev\",\"total\":1,\"link\":[{\"relation\":\"self\",\"url\":\"http://localhost:57931/fhir/contextDev/Patient?identifier=urn%3AMultiFhirVersionTest%7CtestSubmitPatient01&_format=json\"}],\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"1\",\"meta\":{\"versionId\":\"1\",\"lastUpdated\":\"2014-12-20T18:41:29.706-05:00\"},\"identifier\":[{\"system\":\"urn:MultiFhirVersionTest\",\"value\":\"testSubmitPatient01\"}]}}]}"; + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).then(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + //@formatter:off + client.search() + .forResource("Device") + .where(Device.URL.matches().value("http://foo.com")) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Device?url=http://foo.com", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + assertEquals("http://example.com/fhir/Device?url=http%3A%2F%2Ffoo.com", capt.getAllValues().get(idx).getURI().toString()); + idx++; + + //@formatter:off + client.search() + .forResource("Device") + .where(Device.URL.matches().value(new StringDt("http://foo.com"))) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Device?url=http://foo.com", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + } + + @Test + public void testSearchForUnknownType() throws Exception { + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + try { + client.search(new UriDt("?aaaa")); + fail(); + } catch (IllegalArgumentException e) { + assertEquals("Unable to determine the resource type from the given URI: ?aaaa", e.getMessage()); + } + } + + @Test + public void testSearchWithMultipleTokens() throws Exception { + ArgumentCaptor capt = prepareClientForSearchResponse(); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + Collection values = Arrays.asList("VAL1", "VAL2", "VAL3A,B"); + + //@formatter:off + client.search() + .forResource("Patient") + .where(Patient.IDENTIFIER.exactly().systemAndValues("SYS", values)) + .returnBundle(Bundle.class) + .execute(); + //@formatter:on + assertEquals("http://example.com/fhir/Patient?identifier=SYS%7CVAL1%2CSYS%7CVAL2%2CSYS%7CVAL3A%5C%2CB", capt.getAllValues().get(idx).getURI().toString()); + assertEquals("http://example.com/fhir/Patient?identifier=SYS|VAL1,SYS|VAL2,SYS|VAL3A\\,B", UrlUtil.unescape(capt.getAllValues().get(idx).getURI().toString())); + idx++; + + } + + /** + * See #371 + */ + @Test + public void testSortDstu3Test() throws Exception { + IParser p = ourCtx.newXmlParser(); + + Bundle b = new Bundle(); + b.setType(BundleType.SEARCHSET); + + final String respString = p.encodeResourceToString(b); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + int idx = 0; + + //@formatter:off + client + .search() + .forResource(Patient.class) + .sort().ascending("address") + .returnBundle(Bundle.class) + .execute(); + assertEquals("http://example.com/fhir/Patient?_sort=address", capt.getAllValues().get(idx++).getURI().toASCIIString()); + + client + .search() + .forResource(Patient.class) + .sort().descending("address") + .returnBundle(Bundle.class) + .execute(); + assertEquals("http://example.com/fhir/Patient?_sort=-address", capt.getAllValues().get(idx++).getURI().toASCIIString()); + + client + .search() + .forResource(Patient.class) + .sort().descending("address") + .sort().ascending("name") + .sort().descending(Patient.BIRTHDATE) + .returnBundle(Bundle.class) + .execute(); + assertEquals("http://example.com/fhir/Patient?_sort=-address%2Cname%2C-birthdate", capt.getAllValues().get(idx++).getURI().toASCIIString()); + //@formatter:on + } + + @Test + public void testTransactionWithInvalidBody() throws Exception { + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + // Transaction + try { + client.transaction().withBundle("FOO"); + fail(); + } catch (IllegalArgumentException e) { + assertEquals("Unable to determing encoding of request (body does not appear to be valid XML or JSON)", e.getMessage()); + } + + // Create + try { + client.create().resource("FOO").execute(); + fail(); + } catch (IllegalArgumentException e) { + assertEquals("Unable to determing encoding of request (body does not appear to be valid XML or JSON)", e.getMessage()); + } + + // Update + try { + client.update().resource("FOO").execute(); + fail(); + } catch (IllegalArgumentException e) { + assertEquals("Unable to determing encoding of request (body does not appear to be valid XML or JSON)", e.getMessage()); + } + + // Validate + try { + client.validate().resource("FOO").execute(); + fail(); + } catch (IllegalArgumentException e) { + assertEquals("Unable to determing encoding of request (body does not appear to be valid XML or JSON)", e.getMessage()); + } + + + } + + @Test + public void testUpdateById() throws Exception { + IParser p = ourCtx.newXmlParser(); + + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + + final String respString = p.encodeResourceToString(conf); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Patient pt = new Patient(); + pt.setId("222"); + pt.getText().setDivAsString("A PATIENT"); + + client.update().resource(pt).withId("111").execute(); + + ourLog.info(Arrays.asList(capt.getAllValues().get(0).getAllHeaders()).toString()); + + assertEquals("http://example.com/fhir/Patient/111", capt.getAllValues().get(0).getURI().toASCIIString()); + validateUserAgent(capt); + + assertEquals("application/xml+fhir;charset=utf-8", capt.getAllValues().get(0).getHeaders("Content-Type")[0].getValue().toLowerCase().replace(" ", "")); + assertEquals(Constants.HEADER_ACCEPT_VALUE_XML_NON_LEGACY, capt.getAllValues().get(0).getHeaders("Accept")[0].getValue()); + String body = extractBodyAsString(capt); + assertThat(body, containsString("")); + } + + @Test + public void testUpdateWithPreferRepresentationServerReturnsOO() throws Exception { + final IParser p = ourCtx.newXmlParser(); + + final OperationOutcome resp0 = new OperationOutcome(); + resp0.getText().setDivAsString("OK!"); + + final Patient resp1 = new Patient(); + resp1.getText().setDivAsString("FINAL VALUE"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getAllHeaders()).thenAnswer(new Answer() { + @Override + public Header[] answer(InvocationOnMock theInvocation) throws Throwable { + return new Header[] { new BasicHeader(Constants.HEADER_LOCATION, "http://foo.com/base/Patient/222/_history/3") }; + } + }); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + if (myAnswerCount++ == 0) { + return new ReaderInputStream(new StringReader(p.encodeResourceToString(resp0)), Charset.forName("UTF-8")); + } else { + return new ReaderInputStream(new StringReader(p.encodeResourceToString(resp1)), Charset.forName("UTF-8")); + } + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Patient pt = new Patient(); + pt.setId("Patient/222"); + pt.getText().setDivAsString("A PATIENT"); + + MethodOutcome outcome = client.update().resource(pt).prefer(PreferReturnEnum.REPRESENTATION).execute(); + + assertEquals(2, myAnswerCount); + assertNotNull(outcome.getOperationOutcome()); + assertNotNull(outcome.getResource()); + + assertEquals("
OK!
", ((OperationOutcome) outcome.getOperationOutcome()).getText().getDivAsString()); + assertEquals("
FINAL VALUE
", ((Patient) outcome.getResource()).getText().getDivAsString()); + + assertEquals(myAnswerCount, capt.getAllValues().size()); + assertEquals("http://example.com/fhir/Patient/222", capt.getAllValues().get(0).getURI().toASCIIString()); + assertEquals("http://foo.com/base/Patient/222/_history/3", capt.getAllValues().get(1).getURI().toASCIIString()); + } + + @Test + public void testUpdateWithPreferRepresentationServerReturnsResource() throws Exception { + final IParser p = ourCtx.newXmlParser(); + + final Patient resp1 = new Patient(); + resp1.getText().setDivAsString("FINAL VALUE"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getAllHeaders()).thenAnswer(new Answer() { + @Override + public Header[] answer(InvocationOnMock theInvocation) throws Throwable { + return new Header[] { new BasicHeader(Constants.HEADER_LOCATION, "http://foo.com/base/Patient/222/_history/3") }; + } + }); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + myAnswerCount++; + return new ReaderInputStream(new StringReader(p.encodeResourceToString(resp1)), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Patient pt = new Patient(); + pt.setId("Patient/222"); + pt.getText().setDivAsString("A PATIENT"); + + MethodOutcome outcome = client.update().resource(pt).prefer(PreferReturnEnum.REPRESENTATION).execute(); + + assertEquals(1, myAnswerCount); + assertNull(outcome.getOperationOutcome()); + assertNotNull(outcome.getResource()); + + assertEquals("
FINAL VALUE
", ((Patient) outcome.getResource()).getText().getDivAsString()); + + assertEquals(myAnswerCount, capt.getAllValues().size()); + assertEquals("http://example.com/fhir/Patient/222", capt.getAllValues().get(0).getURI().toASCIIString()); + } + + @Test + public void testUserAgentForBinary() throws Exception { + IParser p = ourCtx.newXmlParser(); + + Conformance conf = new Conformance(); + conf.setCopyright("COPY"); + + final String respString = p.encodeResourceToString(conf); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Binary bin = new Binary(); + bin.setContentType("application/foo"); + bin.setContent(new byte[] { 0, 1, 2, 3, 4 }); + client.create().resource(bin).execute(); + + ourLog.info(Arrays.asList(capt.getAllValues().get(0).getAllHeaders()).toString()); + + assertEquals("http://example.com/fhir/Binary", capt.getAllValues().get(0).getURI().toASCIIString()); + validateUserAgent(capt); + + assertEquals("application/foo", capt.getAllValues().get(0).getHeaders("Content-Type")[0].getValue()); + assertEquals(Constants.HEADER_ACCEPT_VALUE_XML_OR_JSON_NON_LEGACY, capt.getAllValues().get(0).getHeaders("Accept")[0].getValue()); + assertArrayEquals(new byte[] { 0, 1, 2, 3, 4 }, extractBodyAsByteArray(capt)); + + } + + @Test + public void testUserAgentForConformance() throws Exception { + IParser p = ourCtx.newXmlParser(); + + Conformance conf = new Conformance(); + conf.setCopyright("COPY"); + + final String respString = p.encodeResourceToString(conf); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + client.fetchConformance().ofType(Conformance.class).execute(); + assertEquals("http://example.com/fhir/metadata", capt.getAllValues().get(0).getURI().toASCIIString()); + validateUserAgent(capt); + } + + @Test + public void testUserInfoInterceptor() throws Exception { + final String respString = CustomTypeDstu21Test.createBundle(CustomTypeDstu21Test.createResource(false)); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + client.registerInterceptor(new UserInfoInterceptor("user_id", "user_name", "app-name")); + + //@formatter:off + Bundle resp = client + .history() + .onType(Patient.class) + .andReturnBundle(Bundle.class) + .execute(); + //@formatter:on + + } + + @Test + public void testValidate() throws Exception { + final IParser p = ourCtx.newXmlParser(); + + final OperationOutcome resp0 = new OperationOutcome(); + resp0.getText().setDivAsString("OK!"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getAllHeaders()).thenAnswer(new Answer() { + @Override + public Header[] answer(InvocationOnMock theInvocation) throws Throwable { + return new Header[] {}; + } + }); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(p.encodeResourceToString(resp0)), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Patient pt = new Patient(); + pt.setId("Patient/222"); + pt.getText().setDivAsString("A PATIENT"); + + MethodOutcome outcome = client.validate().resource(pt).execute(); + + assertNotNull(outcome.getOperationOutcome()); + assertEquals("
OK!
", ((OperationOutcome) outcome.getOperationOutcome()).getText().getDivAsString()); + + } + + @Test + public void testValidateCustomTypeFromClientRead() throws Exception { + IParser p = ourCtx.newXmlParser(); + + MyPatientWithExtensions patient = new MyPatientWithExtensions(); + patient.setId("123"); + patient.getText().setDivAsString("OK!"); + + final String respString = p.encodeResourceToString(patient); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + MyPatientWithExtensions read = client.read().resource(MyPatientWithExtensions.class).withId(new IdType("1")).execute(); + assertEquals("
OK!
", read.getText().getDivAsString()); + + // Ensure that we haven't overridden the default type for the name + assertFalse(MyPatientWithExtensions.class.isAssignableFrom(Patient.class)); + assertFalse(Patient.class.isAssignableFrom(MyPatientWithExtensions.class)); + Patient pt = new Patient(); + pt.getText().setDivAsString("A PATIENT"); + IParser parser = ourCtx.newXmlParser(); + String encoded = parser.encodeResourceToString(pt); + pt = (Patient) parser.parseResource(encoded); + + } + + @Test + public void testValidateCustomTypeFromClientSearch() throws Exception { + IParser p = ourCtx.newXmlParser(); + + Bundle b = new Bundle(); + + MyPatientWithExtensions patient = new MyPatientWithExtensions(); + patient.setId("123"); + patient.getText().setDivAsString("OK!"); + b.addEntry().setResource(patient); + + + final String respString = p.encodeResourceToString(b); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + Bundle bundle = client.search().forResource(MyPatientWithExtensions.class).returnBundle(Bundle.class).execute(); + + assertEquals(1, bundle.getEntry().size()); + assertEquals(MyPatientWithExtensions.class, bundle.getEntry().get(0).getResource().getClass()); + } + + private List> toTypeList(Class theClass) { + ArrayList> retVal = new ArrayList>(); + retVal.add(theClass); + return retVal; + } + + private void validateUserAgent(ArgumentCaptor capt) { + assertEquals(1, capt.getAllValues().get(0).getHeaders("User-Agent").length); + assertEquals(expectedUserAgent(), capt.getAllValues().get(0).getHeaders("User-Agent")[0].getValue()); + } + + + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() { + ourCtx = FhirContext.forDstu2_1(); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/MyPatientWithExtensions.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/MyPatientWithExtensions.java new file mode 100644 index 00000000000..5caf0c137ea --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/MyPatientWithExtensions.java @@ -0,0 +1,92 @@ +package ca.uhn.fhir.rest.client; + +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.dstu2016may.model.DateType; +import org.hl7.fhir.dstu2016may.model.DomainResource; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.ResourceType; +import org.hl7.fhir.dstu2016may.model.StringType; + +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Extension; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.util.ElementUtil; + + +@ResourceDef(name="Patient", profile="http://example.com/StructureDefinition/patient_with_extensions") +public class MyPatientWithExtensions extends DomainResource { + + private static final long serialVersionUID = 1L; + + @Extension(url = "http://example.com/ext/date", definedLocally = false, isModifier = true) + @Child(name = "modExt") + private DateType myDateExt; + + @Extension(url = "http://example.com/ext/string", definedLocally = false, isModifier = false) + @Child(name = "extAtt") + private StringType myStringExt; + + @Child(name = "name", type = {HumanName.class}, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="A name associated with the patient", formalDefinition="A name associated with the individual." ) + private List myName; + + + public List getName() { + if (myName == null) { + myName = new ArrayList(); + } + return myName; + } + + public void setName(List theName) { + myName = theName; + } + + public DateType getDateExt() { + if (myDateExt == null) { + myDateExt = new DateType(); + } + return myDateExt; + } + + public StringType getStringExt() { + if (myStringExt == null) { + myStringExt = new StringType(); + } + return myStringExt; + } + + @Override + public boolean isEmpty() { + return super.isEmpty() && ElementUtil.isEmpty(myStringExt, myDateExt); + } + + public void setDateExt(DateType theDateExt) { + myDateExt = theDateExt; + } + + public void setStringExt(StringType theStringExt) { + myStringExt = theStringExt; + } + + @Override + public DomainResource copy() { + return null; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Patient; + } + + public HumanName addName() { + HumanName retVal = new HumanName(); + getName().add(retVal); + return retVal; + } + + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/NonGenericClientDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/NonGenericClientDstu3Test.java new file mode 100644 index 00000000000..aaa0f903a09 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/NonGenericClientDstu3Test.java @@ -0,0 +1,194 @@ +package ca.uhn.fhir.rest.client; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.io.StringReader; +import java.nio.charset.Charset; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.input.ReaderInputStream; +import org.apache.http.HttpResponse; +import org.apache.http.ProtocolVersion; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.message.BasicHeader; +import org.apache.http.message.BasicStatusLine; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.annotation.Validate; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.api.ValidationModeEnum; +import ca.uhn.fhir.rest.client.api.IRestfulClient; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.util.TestUtil; + +public class NonGenericClientDstu3Test { + private static FhirContext ourCtx; + private HttpClient myHttpClient; + private HttpResponse myHttpResponse; + + @Before + public void before() { + myHttpClient = mock(HttpClient.class, new ReturnsDeepStubs()); + ourCtx.getRestfulClientFactory().setHttpClient(myHttpClient); + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); + myHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); + + System.setProperty(BaseClient.HAPI_CLIENT_KEEPRESPONSES, "true"); + + } + + private String extractBodyAsString(ArgumentCaptor capt, int theIdx) throws IOException { + String body = IOUtils.toString(((HttpEntityEnclosingRequestBase) capt.getAllValues().get(theIdx)).getEntity().getContent(), "UTF-8"); + return body; + } + + @Test + public void testValidateCustomTypeFromClientSearch() throws Exception { + IParser p = ourCtx.newXmlParser(); + + Bundle b = new Bundle(); + + MyPatientWithExtensions patient = new MyPatientWithExtensions(); + patient.setId("123"); + patient.getText().setDivAsString("OK!"); + b.addEntry().setResource(patient); + + + final String respString = p.encodeResourceToString(b); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IClientWithCustomType client = ourCtx.newRestfulClient(IClientWithCustomType.class, "http://example.com/fhir"); + List list = client.search(); + + assertEquals(1, list.size()); + assertEquals(MyPatientWithExtensions.class, list.get(0).getClass()); + } + + @Test + public void testValidateCustomTypeFromClientRead() throws Exception { + IParser p = ourCtx.newXmlParser(); + + MyPatientWithExtensions patient = new MyPatientWithExtensions(); + patient.setId("123"); + patient.getText().setDivAsString("OK!"); + + final String respString = p.encodeResourceToString(patient); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IClientWithCustomType client = ourCtx.newRestfulClient(IClientWithCustomType.class, "http://example.com/fhir"); + MyPatientWithExtensions read = client.read(new IdType("1")); + assertEquals("
OK!
", read.getText().getDivAsString()); + } + + @Test + public void testValidateResourceOnly() throws Exception { + IParser p = ourCtx.newXmlParser(); + + OperationOutcome conf = new OperationOutcome(); + conf.getText().setDivAsString("OK!"); + + final String respString = p.encodeResourceToString(conf); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); + } + }); + + IClient client = ourCtx.newRestfulClient(IClient.class, "http://example.com/fhir"); + + Patient patient = new Patient(); + patient.addName().addFamily("FAM"); + + int idx = 0; + MethodOutcome outcome = client.validate(patient, null, null); + String resp = ourCtx.newXmlParser().encodeResourceToString(outcome.getOperationOutcome()); + assertEquals("
OK!
", resp); + assertEquals("http://example.com/fhir/$validate", capt.getAllValues().get(idx).getURI().toString()); + String request = extractBodyAsString(capt,idx); + assertEquals("", request); + + idx = 1; + outcome = client.validate(patient, ValidationModeEnum.CREATE, "http://foo"); + resp = ourCtx.newXmlParser().encodeResourceToString(outcome.getOperationOutcome()); + assertEquals("
OK!
", resp); + assertEquals("http://example.com/fhir/$validate", capt.getAllValues().get(idx).getURI().toString()); + request = extractBodyAsString(capt,idx); + assertEquals("", request); + } + + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() { + ourCtx = FhirContext.forDstu2_1(); + } + + private interface IClient extends IRestfulClient { + + @Validate + MethodOutcome validate(@ResourceParam IBaseResource theResource, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile); + + } + + private interface IClientWithCustomType extends IRestfulClient { + + @Search + List search(); + + @Read + MyPatientWithExtensions read(@IdParam IdType theId); + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/OperationClientDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/OperationClientDstu3Test.java new file mode 100644 index 00000000000..c1b57aaf43e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/OperationClientDstu3Test.java @@ -0,0 +1,195 @@ +package ca.uhn.fhir.rest.client; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.InputStream; +import java.io.StringReader; +import java.nio.charset.Charset; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.input.ReaderInputStream; +import org.apache.http.HttpResponse; +import org.apache.http.ProtocolVersion; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.message.BasicHeader; +import org.apache.http.message.BasicStatusLine; +import org.hl7.fhir.dstu2016may.model.Parameters; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Operation; +import ca.uhn.fhir.rest.annotation.OperationParam; +import ca.uhn.fhir.rest.client.api.IBasicClient; +import ca.uhn.fhir.rest.param.StringAndListParam; +import ca.uhn.fhir.rest.param.StringOrListParam; +import ca.uhn.fhir.rest.param.StringParam; +import ca.uhn.fhir.rest.param.TokenAndListParam; +import ca.uhn.fhir.rest.param.TokenOrListParam; +import ca.uhn.fhir.rest.param.TokenParam; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.util.TestUtil; + +public class OperationClientDstu3Test { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(OperationClientDstu3Test.class); + private FhirContext ourCtx; + private HttpClient ourHttpClient; + + private HttpResponse ourHttpResponse; + private IOpClient ourAnnClient; + private ArgumentCaptor capt; + private IGenericClient ourGenClient; + + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + @Before + public void before() throws Exception { + ourCtx = FhirContext.forDstu2_1(); + + ourHttpClient = mock(HttpClient.class, new ReturnsDeepStubs()); + ourCtx.getRestfulClientFactory().setHttpClient(ourHttpClient); + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); + + ourHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); + + Parameters outParams = new Parameters(); + outParams.addParameter().setName("FOO"); + final String retVal = ourCtx.newXmlParser().encodeResourceToString(outParams); + + capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(ourHttpClient.execute(capt.capture())).thenReturn(ourHttpResponse); + when(ourHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(ourHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(ourHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(retVal), Charset.forName("UTF-8")); + } + }); + + ourAnnClient = ourCtx.newRestfulClient(IOpClient.class, "http://foo"); + ourGenClient = ourCtx.newRestfulGenericClient("http://foo"); + } + + @Test + public void testNonRepeatingGenericUsingParameters() throws Exception { + ourGenClient + .operation() + .onServer() + .named("nonrepeating") + .withSearchParameter(Parameters.class, "valstr", new StringParam("str")) + .andSearchParameter("valtok", new TokenParam("sys2", "val2")) + .execute(); + Parameters response = ourAnnClient.nonrepeating(new StringParam("str"), new TokenParam("sys", "val")); + assertEquals("FOO", response.getParameter().get(0).getName()); + + HttpPost value = (HttpPost) capt.getAllValues().get(0); + String requestBody = IOUtils.toString(((HttpPost) value).getEntity().getContent()); + IOUtils.closeQuietly(((HttpPost) value).getEntity().getContent()); + ourLog.info(requestBody); + Parameters request = ourCtx.newXmlParser().parseResource(Parameters.class, requestBody); + assertEquals("http://foo/$nonrepeating", value.getURI().toASCIIString()); + assertEquals(2, request.getParameter().size()); + assertEquals("valstr", request.getParameter().get(0).getName()); + assertEquals("str", ((StringType) request.getParameter().get(0).getValue()).getValue()); + assertEquals("valtok", request.getParameter().get(1).getName()); + assertEquals("sys2|val2", ((StringType) request.getParameter().get(1).getValue()).getValue()); + } + + @Test + public void testNonRepeatingGenericUsingUrl() throws Exception { + ourGenClient + .operation() + .onServer() + .named("nonrepeating") + .withSearchParameter(Parameters.class, "valstr", new StringParam("str")) + .andSearchParameter("valtok", new TokenParam("sys2", "val2")) + .useHttpGet() + .execute(); + Parameters response = ourAnnClient.nonrepeating(new StringParam("str"), new TokenParam("sys", "val")); + assertEquals("FOO", response.getParameter().get(0).getName()); + + HttpGet value = (HttpGet) capt.getAllValues().get(0); + assertEquals("http://foo/$nonrepeating?valstr=str&valtok=sys2%7Cval2", value.getURI().toASCIIString()); + } + + @Test + public void testNonRepeatingUsingParameters() throws Exception { + Parameters response = ourAnnClient.nonrepeating(new StringParam("str"), new TokenParam("sys", "val")); + assertEquals("FOO", response.getParameter().get(0).getName()); + + HttpPost value = (HttpPost) capt.getAllValues().get(0); + String requestBody = IOUtils.toString(((HttpPost) value).getEntity().getContent()); + IOUtils.closeQuietly(((HttpPost) value).getEntity().getContent()); + ourLog.info(requestBody); + Parameters request = ourCtx.newXmlParser().parseResource(Parameters.class, requestBody); + assertEquals("http://foo/$nonrepeating", value.getURI().toASCIIString()); + assertEquals(2, request.getParameter().size()); + assertEquals("valstr", request.getParameter().get(0).getName()); + assertEquals("str", ((StringType) request.getParameter().get(0).getValue()).getValue()); + assertEquals("valtok", request.getParameter().get(1).getName()); + assertEquals("sys|val", ((StringType) request.getParameter().get(1).getValue()).getValue()); + } + + public interface IOpClient extends IBasicClient { + + @Operation(name = "$andlist", idempotent = true) + public Parameters andlist( + //@formatter:off + @OperationParam(name="valstr", max=10) StringAndListParam theValStr, + @OperationParam(name="valtok", max=10) TokenAndListParam theValTok + //@formatter:on + ); + + @Operation(name = "$andlist-withnomax", idempotent = true) + public Parameters andlistWithNoMax( + //@formatter:off + @OperationParam(name="valstr") StringAndListParam theValStr, + @OperationParam(name="valtok") TokenAndListParam theValTok + //@formatter:on + ); + + @Operation(name = "$nonrepeating", idempotent = true) + public Parameters nonrepeating( + //@formatter:off + @OperationParam(name="valstr") StringParam theValStr, + @OperationParam(name="valtok") TokenParam theValTok + //@formatter:on + ); + + @Operation(name = "$orlist", idempotent = true) + public Parameters orlist( + //@formatter:off + @OperationParam(name="valstr", max=10) List theValStr, + @OperationParam(name="valtok", max=10) List theValTok + //@formatter:on + ); + + @Operation(name = "$orlist-withnomax", idempotent = true) + public Parameters orlistWithNoMax( + //@formatter:off + @OperationParam(name="valstr") List theValStr, + @OperationParam(name="valtok") List theValTok + //@formatter:on + ); + + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/PatchClientDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/PatchClientDstu3Test.java new file mode 100644 index 00000000000..1b1517b6e25 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/PatchClientDstu3Test.java @@ -0,0 +1,139 @@ +package ca.uhn.fhir.rest.client; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.io.StringReader; +import java.nio.charset.Charset; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.input.ReaderInputStream; +import org.apache.http.HttpResponse; +import org.apache.http.ProtocolVersion; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.message.BasicHeader; +import org.apache.http.message.BasicStatusLine; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Patch; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.api.PatchTypeEnum; +import ca.uhn.fhir.rest.client.api.IRestfulClient; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.util.TestUtil; + +public class PatchClientDstu3Test { + public interface IClientType extends IRestfulClient { + + @Patch(type=Patient.class) + MethodOutcome patch(@IdParam IdType theId, @ResourceParam String theBody, PatchTypeEnum thePatchType); + + } + + private static FhirContext ourCtx; + private HttpClient myHttpClient; + private HttpResponse myHttpResponse; + + @Before + public void before() { + myHttpClient = mock(HttpClient.class, new ReturnsDeepStubs()); + ourCtx.getRestfulClientFactory().setHttpClient(myHttpClient); + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); + myHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); + } + + @Test + public void testJsonPatchAnnotation() throws Exception { + ArgumentCaptor capt = prepareResponse(); + + IClientType client = ourCtx.newRestfulClient(IClientType.class, "http://example.com/fhir"); + + Patient pt = new Patient(); + pt.getText().setDivAsString("A PATIENT"); + + MethodOutcome outcome = client.patch(new IdType("Patient/123"), "{}", PatchTypeEnum.JSON_PATCH); + + assertEquals("PATCH", capt.getAllValues().get(0).getMethod()); + assertEquals("http://example.com/fhir/Patient/123", capt.getAllValues().get(0).getURI().toASCIIString()); + assertEquals(Constants.CT_JSON_PATCH, capt.getAllValues().get(0).getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + assertEquals("{}", extractBodyAsString(capt)); + assertEquals("
OK
", ((OperationOutcome) outcome.getOperationOutcome()).getText().getDivAsString()); + } + + @Test + @Ignore + public void testJsonPatchFluent() throws Exception { + ArgumentCaptor capt = prepareResponse(); + + IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); + + Patient pt = new Patient(); + pt.getText().setDivAsString("A PATIENT"); + +// MethodOutcome outcome = client.patch().resource(""). + +// patch(new IdType("Patient/123"), "{}", PatchTypeEnum.JSON_PATCH); + +// assertEquals("PATCH", capt.getAllValues().get(0).getMethod()); +// assertEquals("http://example.com/fhir/Patient/123", capt.getAllValues().get(0).getURI().toASCIIString()); +// assertEquals(Constants.CT_JSON_PATCH, capt.getAllValues().get(0).getFirstHeader("content-type").getValue().replaceAll(";.*", "")); +// assertEquals("{}", extractBodyAsString(capt)); +// assertEquals("
OK
", ((OperationOutcome) outcome.getOperationOutcome()).getText().getDivAsString()); + } + + + private String extractBodyAsString(ArgumentCaptor capt) throws IOException { + String body = IOUtils.toString(((HttpEntityEnclosingRequestBase) capt.getAllValues().get(0)).getEntity().getContent(), "UTF-8"); + return body; + } + + private ArgumentCaptor prepareResponse() throws IOException, ClientProtocolException { + final IParser p = ourCtx.newXmlParser(); + + final OperationOutcome resp1 = new OperationOutcome(); + resp1.getText().setDivAsString("OK"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); + when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8")); + when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(p.encodeResourceToString(resp1)), Charset.forName("UTF-8")); + } + }); + return capt; + } + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() { + ourCtx = FhirContext.forDstu2_1(); + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/RestfulClientFactoryTest.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/RestfulClientFactoryTest.java new file mode 100644 index 00000000000..1c65a5e11bc --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/RestfulClientFactoryTest.java @@ -0,0 +1,76 @@ +package ca.uhn.fhir.rest.client; + +import static org.junit.Assert.fail; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.List; +import java.util.Map; + +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.junit.AfterClass; +import org.junit.Test; +import org.mockito.Mockito; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.parser.DataFormatException; +import ca.uhn.fhir.rest.api.RequestTypeEnum; +import ca.uhn.fhir.rest.client.apache.ApacheRestfulClientFactory; +import ca.uhn.fhir.rest.client.api.IHttpClient; +import ca.uhn.fhir.rest.client.api.IHttpRequest; +import ca.uhn.fhir.rest.client.api.IHttpResponse; +import ca.uhn.fhir.rest.server.EncodingEnum; +import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import ca.uhn.fhir.util.TestUtil; + +@SuppressWarnings("deprecation") +public class RestfulClientFactoryTest { + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + + /** + * See #518 + */ + @SuppressWarnings({ "unchecked", "cast" }) + @Test + public void testMissingCapabilityStatement() throws Exception { + FhirContext ctx = mock(FhirContext.class); + IRestfulClientFactory restfulClientFactory = mock(IRestfulClientFactory.class); + IHttpClient httpClient = mock(IHttpClient.class); + + when(ctx.getResourceDefinition(Mockito.eq("CapabilityStatement"))).thenThrow(new DataFormatException()); + when(ctx.getResourceDefinition(Mockito.eq("Conformance"))).thenReturn(ourCtx.getResourceDefinition("Conformance")); + when(ctx.getResourceDefinition(Conformance.class)).thenReturn(ourCtx.getResourceDefinition("Conformance")); + when(ctx.getVersion()).thenReturn(FhirVersionEnum.DSTU2_1.getVersionImplementation()); + when(ctx.getRestfulClientFactory()).thenReturn(restfulClientFactory); + + when(restfulClientFactory.getHttpClient(any(StringBuilder.class), (Map>)any(Map.class), any(String.class), any(RequestTypeEnum.class), any(List.class))).thenReturn(httpClient); + + IHttpRequest httpRequest = mock(IHttpRequest.class); + when(httpClient.createGetRequest(any(FhirContext.class), any(EncodingEnum.class))).thenReturn(httpRequest); + + IHttpResponse httpResponse = mock(IHttpResponse.class); + when(httpRequest.execute()).thenReturn(httpResponse); + + when(httpResponse.getStatus()).thenReturn(404); + + ApacheRestfulClientFactory cf = new ApacheRestfulClientFactory(ctx); + IHttpClient client = mock(IHttpClient.class); + BaseClient baseClient = mock(BaseClient.class); + + try { + cf.validateServerBase("http://localhost:9999", client, baseClient); + fail(); + } catch (ResourceNotFoundException e) { + // ok + } + + } + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/SearchClientDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/SearchClientDstu3Test.java new file mode 100644 index 00000000000..b462474a2e1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/client/SearchClientDstu3Test.java @@ -0,0 +1,246 @@ +package ca.uhn.fhir.rest.client; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.InputStream; +import java.io.StringReader; +import java.nio.charset.Charset; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.List; +import java.util.TimeZone; + +import org.apache.commons.io.input.ReaderInputStream; +import org.apache.http.HttpResponse; +import org.apache.http.ProtocolVersion; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.message.BasicHeader; +import org.apache.http.message.BasicStatusLine; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.dstu2016may.model.Extension; +import org.hl7.fhir.dstu2016may.model.Location; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Count; +import ca.uhn.fhir.rest.annotation.OptionalParam; +import ca.uhn.fhir.rest.annotation.RequiredParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.annotation.Sort; +import ca.uhn.fhir.rest.api.SortOrderEnum; +import ca.uhn.fhir.rest.api.SortSpec; +import ca.uhn.fhir.rest.client.api.IRestfulClient; +import ca.uhn.fhir.rest.param.StringParam; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.util.TestUtil; +import ca.uhn.fhir.util.UrlUtil; + +public class SearchClientDstu3Test { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchClientDstu3Test.class); + private FhirContext ourCtx; + private HttpClient ourHttpClient; + private HttpResponse ourHttpResponse; + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @Before + public void before() { + ourCtx = FhirContext.forDstu2_1(); + + ourHttpClient = mock(HttpClient.class, new ReturnsDeepStubs()); + ourCtx.getRestfulClientFactory().setHttpClient(ourHttpClient); + ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); + + ourHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); + } + + /** + * See #299 + */ + @Test + public void testListResponseWithSearchExtension() throws Exception { + + final String response = createBundleWithSearchExtension(); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(ourHttpClient.execute(capt.capture())).thenReturn(ourHttpResponse); + when(ourHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(ourHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(ourHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(response), Charset.forName("UTF-8")); + } + }); + + ILocationClient client = ourCtx.newRestfulClient(ILocationClient.class, "http://localhost:8081/hapi-fhir/fhir"); + + List matches = client.getMatches(new StringParam("smith"), 100); + assertEquals(1, matches.size()); + assertEquals("Sample Clinic", matches.get(0).getName()); + + HttpGet value = (HttpGet) capt.getValue(); + assertEquals("http://localhost:8081/hapi-fhir/fhir/Location?_query=match&name=smith&_count=100", value.getURI().toString()); + } + + /** + * See #371 + */ + @Test + public void testSortForDstu3() throws Exception { + + final String response = createBundleWithSearchExtension(); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(ourHttpClient.execute(capt.capture())).thenReturn(ourHttpResponse); + when(ourHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(ourHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(ourHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(response), Charset.forName("UTF-8")); + } + }); + + ILocationClient client = ourCtx.newRestfulClient(ILocationClient.class, "http://localhost/fhir"); + + int idx = 0; + + client.search(new SortSpec("param1", SortOrderEnum.ASC)); + assertEquals("http://localhost/fhir/Bundle?_sort=param1", ((HttpGet) capt.getAllValues().get(idx++)).getURI().toString()); + + client.search(new SortSpec("param1", SortOrderEnum.ASC).setChain(new SortSpec("param2", SortOrderEnum.DESC))); + assertEquals("http://localhost/fhir/Bundle?_sort=param1%2C-param2", ((HttpGet) capt.getAllValues().get(idx++)).getURI().toString()); + } + + @Test + public void testSearchWithPrimitiveTypes() throws Exception { + TimeZone tz = TimeZone.getDefault(); + try { + TimeZone.setDefault(TimeZone.getTimeZone("America/Toronto")); + + Date date = new Date(23898235986L); + Calendar cal = new GregorianCalendar(); + cal.setTime(date); + ; + + final String response = createBundleWithSearchExtension(); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(ourHttpClient.execute(capt.capture())).thenReturn(ourHttpResponse); + when(ourHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(ourHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(ourHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(response), Charset.forName("UTF-8")); + } + }); + + ILocationClient client = ourCtx.newRestfulClient(ILocationClient.class, "http://localhost/fhir"); + + int idx = 0; + + client.search("STRING1", new StringType("STRING2"), date, cal); + assertEquals("http://localhost/fhir/Bundle?stringParam=STRING1&stringTypeParam=STRING2&dateParam=1970-10-04T10:23:55.986-04:00&calParam=1970-10-04T10:23:55.986-04:00", + UrlUtil.unescape(((HttpGet) capt.getAllValues().get(idx++)).getURI().toString())); + + client.search(null, null, null, null); + assertEquals("http://localhost/fhir/Bundle", + UrlUtil.unescape(((HttpGet) capt.getAllValues().get(idx++)).getURI().toString())); + } finally { + TimeZone.setDefault(tz); + } + } + + /** + * See #299 + */ + @Test + public void testBundleResponseWithSearchExtension() throws Exception { + + final String response = createBundleWithSearchExtension(); + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(ourHttpClient.execute(capt.capture())).thenReturn(ourHttpResponse); + when(ourHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); + when(ourHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(ourHttpResponse.getEntity().getContent()).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock theInvocation) throws Throwable { + return new ReaderInputStream(new StringReader(response), Charset.forName("UTF-8")); + } + }); + + ILocationClient client = ourCtx.newRestfulClient(ILocationClient.class, "http://localhost:8081/hapi-fhir/fhir"); + + Bundle matches = client.getMatchesReturnBundle(new StringParam("smith"), 100); + + assertEquals(1, matches.getEntry().size()); + BundleEntryComponent entry = matches.getEntry().get(0); + assertEquals("Sample Clinic", ((Location) entry.getResource()).getName()); + + List ext = entry.getSearch().getExtensionsByUrl("http://hl7.org/fhir/StructureDefinition/algorithmic-match"); + assertEquals(1, ext.size()); + + HttpGet value = (HttpGet) capt.getValue(); + assertEquals("http://localhost:8081/hapi-fhir/fhir/Location?_query=match&name=smith&_count=100", value.getURI().toString()); + } + + private String createBundleWithSearchExtension() { + //@formatter:off + final String response = "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; + //@formatter:on + return response; + } + + public interface ILocationClient extends IRestfulClient { + @Search(queryName = "match") + public List getMatches(final @RequiredParam(name = Location.SP_NAME) StringParam name, final @Count Integer count); + + @Search(queryName = "match", type = Location.class) + public Bundle getMatchesReturnBundle(final @RequiredParam(name = Location.SP_NAME) StringParam name, final @Count Integer count); + + @Search + public Bundle search(@Sort SortSpec theSort); + + @Search + public Bundle search(@OptionalParam(name = "stringParam") String theString, @OptionalParam(name = "stringTypeParam") StringType theStringDt, @OptionalParam(name = "dateParam") Date theDate, + @OptionalParam(name = "calParam") Calendar theCal); + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CreateBinaryDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CreateBinaryDstu3Test.java new file mode 100644 index 00000000000..1e81d0056be --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CreateBinaryDstu3Test.java @@ -0,0 +1,172 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.Binary; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Create; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class CreateBinaryDstu3Test { + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static Binary ourLastBinary; + private static byte[] ourLastBinaryBytes; + private static String ourLastBinaryString; + private static int ourPort; + private static Server ourServer; + + @Before + public void before() { + ourLastBinary = null; + ourLastBinaryBytes = null; + ourLastBinaryString = null; + } + + @Test + public void testRawBytesBinaryContentType() throws Exception { + HttpPost post = new HttpPost("http://localhost:" + ourPort + "/Binary"); + post.setEntity(new ByteArrayEntity(new byte[] { 0, 1, 2, 3, 4 })); + post.addHeader("Content-Type", "application/foo"); + CloseableHttpResponse status = ourClient.execute(post); + try { + assertEquals("application/foo", ourLastBinary.getContentType()); + assertArrayEquals(new byte[] { 0, 1, 2, 3, 4 }, ourLastBinary.getContent()); + assertArrayEquals(new byte[] { 0, 1, 2, 3, 4 }, ourLastBinaryBytes); + } finally { + IOUtils.closeQuietly(status); + } + } + + /** + * Technically the client shouldn't be doing it this way, but we'll be accepting + */ + @Test + public void testRawBytesFhirContentType() throws Exception { + + Binary b = new Binary(); + b.setContentType("application/foo"); + b.setContent(new byte[] { 0, 1, 2, 3, 4 }); + String encoded = ourCtx.newJsonParser().encodeResourceToString(b); + + HttpPost post = new HttpPost("http://localhost:" + ourPort + "/Binary"); + post.setEntity(new StringEntity(encoded)); + post.addHeader("Content-Type", Constants.CT_FHIR_JSON); + CloseableHttpResponse status = ourClient.execute(post); + try { + assertEquals("application/foo", ourLastBinary.getContentType()); + assertArrayEquals(new byte[] { 0, 1, 2, 3, 4 }, ourLastBinary.getContent()); + } finally { + IOUtils.closeQuietly(status); + } + } + + @Test + public void testRawBytesFhirContentTypeContainingFhir() throws Exception { + + Patient p = new Patient(); + p.getText().setDivAsString("A PATIENT"); + + Binary b = new Binary(); + b.setContentType("application/xml+fhir"); + b.setContent(ourCtx.newXmlParser().encodeResourceToString(p).getBytes("UTF-8")); + String encoded = ourCtx.newJsonParser().encodeResourceToString(b); + + HttpPost post = new HttpPost("http://localhost:" + ourPort + "/Binary"); + post.setEntity(new StringEntity(encoded)); + post.addHeader("Content-Type", Constants.CT_FHIR_JSON); + CloseableHttpResponse status = ourClient.execute(post); + try { + assertEquals("application/xml+fhir", ourLastBinary.getContentType()); + assertArrayEquals(b.getContent(), ourLastBinary.getContent()); + assertEquals(encoded, ourLastBinaryString); + assertArrayEquals(encoded.getBytes("UTF-8"), ourLastBinaryBytes); + } finally { + IOUtils.closeQuietly(status); + } + } + + @Test + public void testRawBytesNoContentType() throws Exception { + HttpPost post = new HttpPost("http://localhost:" + ourPort + "/Binary"); + post.setEntity(new ByteArrayEntity(new byte[] { 0, 1, 2, 3, 4 })); + CloseableHttpResponse status = ourClient.execute(post); + try { + assertNull(ourLastBinary.getContentType()); + assertArrayEquals(new byte[] { 0, 1, 2, 3, 4 }, ourLastBinary.getContent()); + } finally { + IOUtils.closeQuietly(status); + } + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + BinaryProvider binaryProvider = new BinaryProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(binaryProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + } + + public static class BinaryProvider implements IResourceProvider { + + @Create() + public MethodOutcome createBinary(@ResourceParam Binary theBinary, @ResourceParam String theBinaryString, @ResourceParam byte[] theBinaryBytes) { + ourLastBinary = theBinary; + ourLastBinaryString = theBinaryString; + ourLastBinaryBytes = theBinaryBytes; + return new MethodOutcome(new IdType("Binary/001/_history/002")); + } + + @Override + public Class getResourceType() { + return Binary.class; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CreateDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CreateDstu3Test.java new file mode 100644 index 00000000000..1393ce86931 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CreateDstu3Test.java @@ -0,0 +1,279 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.DateType; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Create; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.client.MyPatientWithExtensions; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class CreateDstu3Test { + private static CloseableHttpClient ourClient; + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CreateDstu3Test.class); + private static int ourPort; + private static Server ourServer; + public static IBaseOperationOutcome ourReturnOo; + + @Before + public void before() { + ourReturnOo = null; + } + + /** + * #472 + */ + @Test + public void testCreateReturnsLocationHeader() throws Exception { + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity("{\"resourceType\":\"Patient\", \"status\":\"active\"}", ContentType.parse("application/fhir+json; charset=utf-8"))); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + + assertEquals(1, status.getHeaders("Location").length); + assertEquals(1, status.getHeaders("Content-Location").length); + assertEquals("http://localhost:" + ourPort + "/Patient/1", status.getFirstHeader("Location").getValue()); + + } + + @Test + public void testCreateReturnsOperationOutcome() throws Exception { + ourReturnOo = new OperationOutcome().addIssue(new OperationOutcomeIssueComponent().setDiagnostics("DIAG")); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity("{\"resourceType\":\"Patient\", \"status\":\"active\"}", ContentType.parse("application/fhir+json; charset=utf-8"))); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + + assertThat(responseContent, containsString("DIAG")); + } + + /** + * #342 + */ + @Test + public void testCreateWithInvalidContent() throws Exception { + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity("FOO", ContentType.parse("application/xml+fhir; charset=utf-8"))); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(400, status.getStatusLine().getStatusCode()); + + assertThat(responseContent, containsString("", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + assertThat(responseContent, not(containsString("http://hl7.org/fhir/"))); + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Create() + public MethodOutcome create(@ResourceParam Patient theIdParam) { + return new MethodOutcome(new IdType("Patient", "1"), true).setOperationOutcome(ourReturnOo); + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Read() + public MyPatientWithExtensions read(@IdParam IdType theIdParam) { + MyPatientWithExtensions p0 = new MyPatientWithExtensions(); + p0.setId(theIdParam); + p0.setDateExt(new DateType("2011-01-01")); + return p0; + } + + @Search + public List search() { + ArrayList retVal = new ArrayList(); + + MyPatientWithExtensions p0 = new MyPatientWithExtensions(); + p0.setId(new IdType("Patient/0")); + p0.setDateExt(new DateType("2011-01-01")); + retVal.add(p0); + + Patient p1 = new Patient(); + p1.setId(new IdType("Patient/1")); + p1.addName().addFamily("The Family"); + retVal.add(p1); + + return retVal; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CustomTypeServerDstu3.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CustomTypeServerDstu3.java new file mode 100644 index 00000000000..e63890bccff --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/CustomTypeServerDstu3.java @@ -0,0 +1,180 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.rest.annotation.ConditionalUrlParam; +import ca.uhn.fhir.rest.annotation.Create; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.OptionalParam; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class CustomTypeServerDstu3 { + private static CloseableHttpClient ourClient; + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static String ourLastConditionalUrl; + private static IdType ourLastId; + private static IdType ourLastIdParam; + private static boolean ourLastRequestWasSearch; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CustomTypeServerDstu3.class); + private static int ourPort; + private static Server ourServer; + + @Before + public void before() { + ourLastId = null; + ourLastConditionalUrl = null; + ourLastIdParam = null; + ourLastRequestWasSearch = false; + } + + + @Test + public void testCreateWithIdInBody() throws Exception { + + Patient patient = new Patient(); + patient.setId("2"); + patient.addIdentifier().setValue("002"); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); +// httpPost.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=system%7C001"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(400, status.getStatusLine().getStatusCode()); + } + + @Test + public void testCreateWithIdInUrl() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/2"); +// httpPost.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=system%7C001"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(400, status.getStatusLine().getStatusCode()); + OperationOutcome oo = ourCtx.newXmlParser().parseResource(OperationOutcome.class, responseContent); + assertEquals("Can not create resource with ID \"2\", ID must not be supplied on a create (POST) operation (use an HTTP PUT / update operation if you wish to supply an ID)", oo.getIssue().get(0).getDiagnostics()); + } + + @Test + public void testCreateWithIdInUrlForConditional() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/2"); + httpPost.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=system%7C001"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(400, status.getStatusLine().getStatusCode()); + OperationOutcome oo = ourCtx.newXmlParser().parseResource(OperationOutcome.class, responseContent); + assertEquals("Can not create resource with ID \"2\", ID must not be supplied on a create (POST) operation (use an HTTP PUT / update operation if you wish to supply an ID)", oo.getIssue().get(0).getDiagnostics()); + } + + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Create() + public MethodOutcome createPatient(@ResourceParam Patient thePatient, @ConditionalUrlParam String theConditional, @IdParam IdType theIdParam) { + ourLastConditionalUrl = theConditional; + ourLastId = thePatient.getIdElement(); + ourLastIdParam = theIdParam; + return new MethodOutcome(new IdType("Patient/001/_history/002")); + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Search + public List search(@OptionalParam(name = "foo") StringDt theString) { + ourLastRequestWasSearch = true; + return new ArrayList(); + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/DateRangeParamSearchDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/DateRangeParamSearchDstu3Test.java new file mode 100644 index 00000000000..a88305127d2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/DateRangeParamSearchDstu3Test.java @@ -0,0 +1,233 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; +import ca.uhn.fhir.rest.annotation.RequiredParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.param.DateRangeParam; +import ca.uhn.fhir.rest.param.ParamPrefixEnum; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class DateRangeParamSearchDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static DateRangeParam ourLastDateRange; + private static int ourPort; + + private static Server ourServer; + private static SimpleDateFormat ourFmt; + private static String ourBaseUrl; + + @Before + public void before() { + ourLastDateRange = null; + } + + @Test + public void testSearchForMultipleUnqualifiedDate() throws Exception { + String baseUrl = "http://localhost:" + ourPort + "/Patient?" + Patient.SP_BIRTHDATE + "="; + HttpGet httpGet = new HttpGet(baseUrl + "2012-01-01&" + Patient.SP_BIRTHDATE + "=2012-02-03"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(400, status.getStatusLine().getStatusCode()); + + } + + + @Test + public void testSearchForOneUnqualifiedDate() throws Exception { + HttpGet httpGet = new HttpGet(ourBaseUrl + "?birthdate=2012-01-01"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("2012-01-01", ourLastDateRange.getLowerBound().getValueAsString()); + assertEquals("2012-01-01", ourLastDateRange.getUpperBound().getValueAsString()); + + assertEquals(parse("2012-01-01 00:00:00.0000"), ourLastDateRange.getLowerBoundAsInstant()); + assertEquals(parseM1("2012-01-02 00:00:00.0000"), ourLastDateRange.getUpperBoundAsInstant()); + assertEquals(ParamPrefixEnum.EQUAL, ourLastDateRange.getLowerBound().getPrefix()); + assertEquals(ParamPrefixEnum.EQUAL, ourLastDateRange.getUpperBound().getPrefix()); + } + + @Test + public void testSearchForOneQualifiedDateEq() throws Exception { + HttpGet httpGet = new HttpGet(ourBaseUrl + "?birthdate=eq2012-01-01"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("2012-01-01", ourLastDateRange.getLowerBound().getValueAsString()); + assertEquals("2012-01-01", ourLastDateRange.getUpperBound().getValueAsString()); + + assertEquals(parse("2012-01-01 00:00:00.0000"), ourLastDateRange.getLowerBoundAsInstant()); + assertEquals(parseM1("2012-01-02 00:00:00.0000"), ourLastDateRange.getUpperBoundAsInstant()); + assertEquals(ParamPrefixEnum.EQUAL, ourLastDateRange.getLowerBound().getPrefix()); + assertEquals(ParamPrefixEnum.EQUAL, ourLastDateRange.getUpperBound().getPrefix()); + } + + @Test + public void testSearchForOneQualifiedDateGt() throws Exception { + HttpGet httpGet = new HttpGet(ourBaseUrl + "?birthdate=gt2012-01-01"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("2012-01-01", ourLastDateRange.getLowerBound().getValueAsString()); + assertEquals(null, ourLastDateRange.getUpperBound()); + + assertEquals(parse("2012-01-02 00:00:00.0000"), ourLastDateRange.getLowerBoundAsInstant()); + assertEquals(null, ourLastDateRange.getUpperBoundAsInstant()); + assertEquals(ParamPrefixEnum.GREATERTHAN, ourLastDateRange.getLowerBound().getPrefix()); + assertEquals(null, ourLastDateRange.getUpperBound()); + } + + @Test + public void testSearchForOneQualifiedDateLt() throws Exception { + HttpGet httpGet = new HttpGet(ourBaseUrl + "?birthdate=lt2012-01-01"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals(null, ourLastDateRange.getLowerBound()); + assertEquals("2012-01-01", ourLastDateRange.getUpperBound().getValueAsString()); + + assertEquals(null, ourLastDateRange.getLowerBoundAsInstant()); + assertEquals(parseM1("2012-01-01 00:00:00.0000"), ourLastDateRange.getUpperBoundAsInstant()); + assertEquals(null, ourLastDateRange.getLowerBound()); + assertEquals(ParamPrefixEnum.LESSTHAN, ourLastDateRange.getUpperBound().getPrefix()); + } + + @Test + public void testSearchForOneQualifiedDateGe() throws Exception { + HttpGet httpGet = new HttpGet(ourBaseUrl + "?birthdate=ge2012-01-01"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("2012-01-01", ourLastDateRange.getLowerBound().getValueAsString()); + assertEquals(null, ourLastDateRange.getUpperBound()); + + assertEquals(parse("2012-01-01 00:00:00.0000"), ourLastDateRange.getLowerBoundAsInstant()); + assertEquals(null, ourLastDateRange.getUpperBoundAsInstant()); + assertEquals(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, ourLastDateRange.getLowerBound().getPrefix()); + assertEquals(null, ourLastDateRange.getUpperBound()); + } + + @Test + public void testSearchForOneQualifiedDateLe() throws Exception { + HttpGet httpGet = new HttpGet(ourBaseUrl + "?birthdate=le2012-01-01"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals(null, ourLastDateRange.getLowerBound()); + assertEquals("2012-01-01", ourLastDateRange.getUpperBound().getValueAsString()); + + assertEquals(null, ourLastDateRange.getLowerBoundAsInstant()); + assertEquals(parseM1("2012-01-02 00:00:00.0000"), ourLastDateRange.getUpperBoundAsInstant()); + assertEquals(null, ourLastDateRange.getLowerBound()); + assertEquals(ParamPrefixEnum.LESSTHAN_OR_EQUALS, ourLastDateRange.getUpperBound().getPrefix()); + } + + + public static Date parse(String theString) throws ParseException { + return ourFmt.parse(theString); + } + + public static Date parseM1(String theString) throws ParseException { + return new Date(ourFmt.parse(theString).getTime() - 1L); + } + static { + ourFmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS"); + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + ourBaseUrl = "http://localhost:" + ourPort + "/Patient"; + } + + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + + @Search() + public List search(@RequiredParam(name=Patient.SP_BIRTHDATE) DateRangeParam theDateRange) { + ourLastDateRange = theDateRange; + + ArrayList retVal = new ArrayList(); + + Patient patient = new Patient(); + patient.setId("1"); + patient.addIdentifier().setSystem("system").setValue("hello"); + retVal.add(patient); + return retVal; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalDstu3Test.java new file mode 100644 index 00000000000..88081898819 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalDstu3Test.java @@ -0,0 +1,133 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.concurrent.TimeUnit; + +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.ConditionalUrlParam; +import ca.uhn.fhir.rest.annotation.Delete; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.client.IGenericClient; +import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class DeleteConditionalDstu3Test { + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static IGenericClient ourHapiClient; + private static String ourLastConditionalUrl; + private static IdType ourLastIdParam; + private static boolean ourLastRequestWasDelete; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(DeleteConditionalDstu3Test.class); + private static int ourPort; + private static Server ourServer; + + + @Before + public void before() { + ourLastConditionalUrl = null; + ourLastIdParam = null; + ourLastRequestWasDelete = false; + } + + + + @Test + public void testSearchStillWorks() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + +// HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_pretty=true"); +// +// HttpResponse status = ourClient.execute(httpGet); +// +// String responseContent = IOUtils.toString(status.getEntity().getContent()); +// IOUtils.closeQuietly(status.getEntity().getContent()); +// +// ourLog.info("Response was:\n{}", responseContent); + + //@formatter:off + ourHapiClient + .delete() + .resourceConditionalByType(Patient.class) + .where(Patient.IDENTIFIER.exactly().systemAndIdentifier("SOMESYS","SOMEID")) + .execute(); + //@formatter:on + + assertTrue(ourLastRequestWasDelete); + assertEquals(null, ourLastIdParam); + assertEquals("Patient?identifier=SOMESYS%7CSOMEID", ourLastConditionalUrl); + + } + + + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + ourCtx.getRestfulClientFactory().setSocketTimeout(500 * 1000); + ourHapiClient = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort + "/"); + ourHapiClient.registerInterceptor(new LoggingInterceptor()); + } + + public static class PatientProvider implements IResourceProvider { + + @Delete() + public MethodOutcome deletePatient(@IdParam IdType theIdParam, @ConditionalUrlParam String theConditional) { + ourLastRequestWasDelete = true; + ourLastConditionalUrl = theConditional; + ourLastIdParam = theIdParam; + return new MethodOutcome(new IdType("Patient/001/_history/002")); + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/FormatParameterDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/FormatParameterDstu3Test.java new file mode 100644 index 00000000000..88330505426 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/FormatParameterDstu3Test.java @@ -0,0 +1,256 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; + +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class FormatParameterDstu3Test { + + private static final String VALUE_XML = ""; + private static final String VALUE_JSON = "{\"resourceType\":\"Patient\",\"id\":\"p1ReadId\",\"meta\":{\"profile\":[\"http://foo_profile\"]},\"identifier\":[{\"value\":\"p1ReadValue\"}]}"; + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FormatParameterDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static RestfulServer ourServlet; + + /** + * See #346 + */ + @Test + public void testFormatXml() throws Exception { + ourServlet.setDefaultResponseEncoding(EncodingEnum.JSON); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123?_format=xml"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(VALUE_XML, responseContent); + } finally { + IOUtils.closeQuietly(status); + } + } + + /** + * See #346 + */ + @Test + public void testFormatApplicationXml() throws Exception { + ourServlet.setDefaultResponseEncoding(EncodingEnum.JSON); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123?_format=application/xml"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(VALUE_XML, responseContent); + } finally { + IOUtils.closeQuietly(status); + } + } + + /** + * See #346 + */ + @Test + public void testFormatApplicationXmlFhir() throws Exception { + ourServlet.setDefaultResponseEncoding(EncodingEnum.JSON); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123?_format=application/xml%2Bfhir"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(VALUE_XML, responseContent); + } finally { + IOUtils.closeQuietly(status); + } + } + + /** + * See #346 + */ + @Test + public void testFormatApplicationXmlFhirUnescaped() throws Exception { + ourServlet.setDefaultResponseEncoding(EncodingEnum.JSON); + + // The plus isn't escaped here, and it should be.. but we'll be lenient + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123?_format=application/xml+fhir"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(VALUE_XML, responseContent); + } finally { + IOUtils.closeQuietly(status); + } + } + + /** + * See #346 + */ + @Test + public void testFormatJson() throws Exception { + ourServlet.setDefaultResponseEncoding(EncodingEnum.XML); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123?_format=json"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(VALUE_JSON, responseContent); + } finally { + IOUtils.closeQuietly(status); + } + } + + /** + * See #346 + */ + @Test + public void testFormatApplicationJson() throws Exception { + ourServlet.setDefaultResponseEncoding(EncodingEnum.XML); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123?_format=application/json"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(VALUE_JSON, responseContent); + } finally { + IOUtils.closeQuietly(status); + } + } + + /** + * See #346 + */ + @Test + public void testFormatApplicationJsonFhir() throws Exception { + ourServlet.setDefaultResponseEncoding(EncodingEnum.XML); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123?_format=application/json%2Bfhir"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(VALUE_JSON, responseContent); + } finally { + IOUtils.closeQuietly(status); + } + } + + /** + * See #346 + */ + @Test + public void testFormatApplicationJsonFhirUnescaped() throws Exception { + ourServlet.setDefaultResponseEncoding(EncodingEnum.XML); + + // The plus isn't escaped here, and it should be.. but we'll be lenient + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123?_format=application/json+fhir"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(VALUE_JSON, responseContent); + } finally { + IOUtils.closeQuietly(status); + } + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + ourServlet = new RestfulServer(ourCtx); + ourServlet.setFhirContext(ourCtx); + ourServlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(ourServlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Read(version = true) + public Patient read(@IdParam IdType theId) { + Patient p1 = new MyPatient(); + p1.setId("p1ReadId"); + p1.addIdentifier().setValue("p1ReadValue"); + return p1; + } + + } + + @ResourceDef(name = "Patient", profile = "http://foo_profile") + public static class MyPatient extends Patient { + + private static final long serialVersionUID = 1L; + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/InterceptorDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/InterceptorDstu3Test.java new file mode 100644 index 00000000000..d2e356c7b9c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/InterceptorDstu3Test.java @@ -0,0 +1,177 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +import java.util.ArrayList; +import java.util.concurrent.TimeUnit; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.InOrder; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Validate; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.api.RestOperationTypeEnum; +import ca.uhn.fhir.rest.method.RequestDetails; +import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; +import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails; +import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class InterceptorDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static int ourPort; + private static Server ourServer; + private static RestfulServer ourServlet; + private IServerInterceptor myInterceptor1; + private IServerInterceptor myInterceptor2; + + @Before + public void before() { + myInterceptor1 = mock(IServerInterceptor.class); + myInterceptor2 = mock(IServerInterceptor.class); + ourServlet.setInterceptors(myInterceptor1, myInterceptor2); + } + + + @Test + public void testValidate() throws Exception { + when(myInterceptor1.incomingRequestPreProcessed(any(HttpServletRequest.class), any(HttpServletResponse.class))).thenReturn(true); + when(myInterceptor1.incomingRequestPostProcessed(any(RequestDetails.class), any(HttpServletRequest.class), any(HttpServletResponse.class))).thenReturn(true); + when(myInterceptor1.outgoingResponse(any(RequestDetails.class), any(IResource.class))).thenReturn(true); + when(myInterceptor2.incomingRequestPreProcessed(any(HttpServletRequest.class), any(HttpServletResponse.class))).thenReturn(true); + when(myInterceptor2.incomingRequestPostProcessed(any(RequestDetails.class), any(HttpServletRequest.class), any(HttpServletResponse.class))).thenReturn(true); + when(myInterceptor2.outgoingResponse(any(RequestDetails.class), any(IResource.class))).thenReturn(true); + + //@formatter:off + String input = + "{\n" + + " \"resourceType\":\"Observation\",\n" + + " \"id\":\"1855669\",\n" + + " \"meta\":{\n" + + " \"versionId\":\"1\",\n" + + " \"lastUpdated\":\"2016-02-18T07:41:35.953-05:00\"\n" + + " },\n" + + " \"status\":\"final\",\n" + + " \"subject\":{\n" + + " \"reference\":\"Patient/1\"\n" + + " },\n" + + " \"effectiveDateTime\":\"2016-02-18T07:45:36-05:00\",\n" + + " \"valueQuantity\":{\n" + + " \"value\":57,\n" + + " \"system\":\"http://unitsofmeasure.org\",\n" + + " \"code\":\"{Beats}/min\"\n" + + " }\n" + + "}"; + //@formatter:on + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$validate"); + httpPost.setEntity(new StringEntity(input, ContentType.create(Constants.CT_FHIR_JSON, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + IOUtils.closeQuietly(status.getEntity().getContent()); + + InOrder order = inOrder(myInterceptor1, myInterceptor2); + order.verify(myInterceptor1, times(1)).incomingRequestPreProcessed(any(HttpServletRequest.class), any(HttpServletResponse.class)); + order.verify(myInterceptor2, times(1)).incomingRequestPreProcessed(any(HttpServletRequest.class), any(HttpServletResponse.class)); + order.verify(myInterceptor1, times(1)).incomingRequestPostProcessed(any(RequestDetails.class), any(HttpServletRequest.class), any(HttpServletResponse.class)); + order.verify(myInterceptor2, times(1)).incomingRequestPostProcessed(any(RequestDetails.class), any(HttpServletRequest.class), any(HttpServletResponse.class)); + ArgumentCaptor opTypeCapt = ArgumentCaptor.forClass(RestOperationTypeEnum.class); + ArgumentCaptor arTypeCapt = ArgumentCaptor.forClass(ActionRequestDetails.class); + order.verify(myInterceptor1, times(1)).incomingRequestPreHandled(opTypeCapt.capture(), arTypeCapt.capture()); + order.verify(myInterceptor2, times(1)).incomingRequestPreHandled(any(RestOperationTypeEnum.class), any(ActionRequestDetails.class)); + order.verify(myInterceptor2, times(1)).outgoingResponse(any(RequestDetails.class), any(IResource.class)); + order.verify(myInterceptor1, times(1)).outgoingResponse(any(RequestDetails.class), any(IResource.class)); + + // Avoid concurrency issues + Thread.sleep(500); + + order.verify(myInterceptor2, times(1)).processingCompletedNormally(any(ServletRequestDetails.class)); + order.verify(myInterceptor1, times(1)).processingCompletedNormally(any(ServletRequestDetails.class)); + verifyNoMoreInteractions(myInterceptor1); + verifyNoMoreInteractions(myInterceptor2); + + assertEquals(RestOperationTypeEnum.EXTENDED_OPERATION_TYPE, opTypeCapt.getValue()); + assertNotNull(arTypeCapt.getValue().getResource()); + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @After + public void after() { + for (IServerInterceptor next : new ArrayList(ourServlet.getInterceptors())) { + ourServlet.unregisterInterceptor(next); + } + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + ourServlet = new RestfulServer(ourCtx); + ourServlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(ourServlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Validate() + public MethodOutcome validate(@ResourceParam Patient theResource) { + return new MethodOutcome(); + } + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/MetadataConformanceDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/MetadataConformanceDstu3Test.java new file mode 100644 index 00000000000..bed0c2b6968 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/MetadataConformanceDstu3Test.java @@ -0,0 +1,190 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.hapi.rest.server.ServerConformanceProvider; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.rest.annotation.OptionalParam; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.annotation.Validate; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.param.StringParam; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; +import ca.uhn.fhir.util.VersionUtil; + +@SuppressWarnings("deprecation") +public class MetadataConformanceDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static int ourPort; + private static Server ourServer; + private static RestfulServer ourServlet; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(MetadataConformanceDstu3Test.class); + + + @Test + public void testSummary() throws Exception { + String output; + + // With + HttpRequestBase httpPost = new HttpGet("http://localhost:" + ourPort + "/metadata?_summary=true&_pretty=true"); + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + output = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + assertEquals(200, status.getStatusLine().getStatusCode()); + ourLog.info(output); + assertThat(output, containsString("", "SUBSETTED", "")); + assertThat(output, not(stringContainsInOrder("searchParam"))); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + // Without + httpPost = new HttpGet("http://localhost:" + ourPort + "/metadata?_pretty=true"); + status = ourClient.execute(httpPost); + try { + output = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + assertEquals(200, status.getStatusLine().getStatusCode()); + ourLog.info(output); + assertThat(output, containsString("", "SUBSETTED", ""))); + assertThat(output, stringContainsInOrder("searchParam")); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + } + + @Test + public void testElements() throws Exception { + String output; + + HttpRequestBase httpPost = new HttpGet("http://localhost:" + ourPort + "/metadata?_elements=fhirVersion&_pretty=true"); + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + output = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + assertEquals(200, status.getStatusLine().getStatusCode()); + ourLog.info(output); + assertThat(output, containsString("", "SUBSETTED", "")); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + } + + @Test + public void testHttpMethods() throws Exception { + String output; + + HttpRequestBase httpPost = new HttpGet("http://localhost:" + ourPort + "/metadata"); + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + output = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(output, containsString("", output); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + /* + * There is no @read on the RP below, so this should fail. Otherwise it + * would be interpreted as a read on ID "metadata" + */ + try { + httpPost = new HttpGet("http://localhost:" + ourPort + "/Patient/metadata"); + status = ourClient.execute(httpPost); + output = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + assertEquals(400, status.getStatusLine().getStatusCode()); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + ourServlet = new RestfulServer(ourCtx); + ourServlet.setServerConformanceProvider(new ServerConformanceProvider(ourServlet)); + ourServlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(ourServlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + @SuppressWarnings("unused") + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Search + public List search(@OptionalParam(name="foo") StringParam theFoo) { + throw new UnsupportedOperationException(); + } + + @Validate() + public MethodOutcome validate(@ResourceParam Patient theResource) { + return new MethodOutcome(); + } + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/OperationServerDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/OperationServerDstu3Test.java new file mode 100644 index 00000000000..7b952fe9aaa --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/OperationServerDstu3Test.java @@ -0,0 +1,784 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.containsInRelativeOrder; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.startsWith; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent; +import org.hl7.fhir.dstu2016may.model.DateTimeType; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.IntegerType; +import org.hl7.fhir.dstu2016may.model.Money; +import org.hl7.fhir.dstu2016may.model.OperationDefinition; +import org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse; +import org.hl7.fhir.dstu2016may.model.Parameters; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.hl7.fhir.dstu2016may.model.UnsignedIntType; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Operation; +import ca.uhn.fhir.rest.annotation.OperationParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.client.IGenericClient; +import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class OperationServerDstu3Test { + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx; + + private static IdType ourLastId; + private static String ourLastMethod; + private static StringType ourLastParam1; + private static Patient ourLastParam2; + private static List ourLastParam3; + private static Money ourLastParamMoney1; + private static UnsignedIntType ourLastParamUnsignedInt1; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(OperationServerDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private IGenericClient myFhirClient; + + @Before + public void before() { + ourLastParam1 = null; + ourLastParam2 = null; + ourLastParam3 = null; + ourLastParamUnsignedInt1 = null; + ourLastParamMoney1 = null; + ourLastId = null; + ourLastMethod = ""; + + myFhirClient = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort); + } + + + @Test + public void testConformance() throws Exception { + LoggingInterceptor loggingInterceptor = new LoggingInterceptor(); + loggingInterceptor.setLogResponseBody(true); + myFhirClient.registerInterceptor(loggingInterceptor); + + Conformance p = myFhirClient.fetchConformance().ofType(Conformance.class).prettyPrint().execute(); + ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p)); + + List ops = p.getRest().get(0).getOperation(); + assertThat(ops.size(), greaterThan(1)); + + List opNames = toOpNames(ops); + assertThat(opNames, containsInRelativeOrder("OP_TYPE")); + +// OperationDefinition def = (OperationDefinition) ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getResource(); + OperationDefinition def = myFhirClient.read().resource(OperationDefinition.class).withId(ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getReferenceElement()).execute(); + assertEquals("OP_TYPE", def.getCode()); + } + + /** + * See #380 + */ + @Test + public void testOperationDefinition() { + OperationDefinition def = myFhirClient.read().resource(OperationDefinition.class).withId("OperationDefinition/Patient--OP_TYPE").execute(); + + ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(def)); + +// @OperationParam(name="PARAM1") StringType theParam1, +// @OperationParam(name="PARAM2") Patient theParam2, +// @OperationParam(name="PARAM3", min=2, max=5) List theParam3, +// @OperationParam(name="PARAM4", min=1) List theParam4, + + assertEquals(4, def.getParameter().size()); + assertEquals("PARAM1", def.getParameter().get(0).getName()); + assertEquals(OperationParameterUse.IN, def.getParameter().get(0).getUse()); + assertEquals(0, def.getParameter().get(0).getMin()); + assertEquals("1", def.getParameter().get(0).getMax()); + + assertEquals("PARAM2", def.getParameter().get(1).getName()); + assertEquals(OperationParameterUse.IN, def.getParameter().get(1).getUse()); + assertEquals(0, def.getParameter().get(1).getMin()); + assertEquals("1", def.getParameter().get(1).getMax()); + + assertEquals("PARAM3", def.getParameter().get(2).getName()); + assertEquals(OperationParameterUse.IN, def.getParameter().get(2).getUse()); + assertEquals(2, def.getParameter().get(2).getMin()); + assertEquals("5", def.getParameter().get(2).getMax()); + + assertEquals("PARAM4", def.getParameter().get(3).getName()); + assertEquals(OperationParameterUse.IN, def.getParameter().get(3).getUse()); + assertEquals(1, def.getParameter().get(3).getMin()); + assertEquals("*", def.getParameter().get(3).getMax()); + + } + + private List toOpNames(List theOps) { + ArrayList retVal = new ArrayList(); + for (ConformanceRestOperationComponent next : theOps) { + retVal.add(next.getName()); + } + return retVal; + } + + @Test + public void testInstanceEverythingGet() throws Exception { + + // Try with a GET + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123/$everything"); + CloseableHttpResponse status = ourClient.execute(httpGet); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("instance $everything", ourLastMethod); + assertThat(response, startsWith(" getResourceType() { + return Patient.class; + } + + //@formatter:off + @Operation(name="$OP_INSTANCE") + public Parameters opInstance( + @IdParam IdType theId, + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2 + ) { + //@formatter:on + + ourLastMethod = "$OP_INSTANCE"; + ourLastId = theId; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_INSTANCE_OR_TYPE") + public Parameters opInstanceOrType( + @IdParam(optional=true) IdType theId, + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2 + ) { + //@formatter:on + + ourLastMethod = "$OP_INSTANCE_OR_TYPE"; + ourLastId = theId; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_PROFILE_DT2", idempotent=true) + public Bundle opProfileType( + @OperationParam(name="PARAM1") Money theParam1 + ) { + //@formatter:on + + ourLastMethod = "$OP_PROFILE_DT2"; + ourLastParamMoney1 = theParam1; + + Bundle retVal = new Bundle(); + retVal.addEntry().getResponse().setStatus("100"); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_PROFILE_DT", idempotent=true) + public Bundle opProfileType( + @OperationParam(name="PARAM1") UnsignedIntType theParam1 + ) { + //@formatter:on + + ourLastMethod = "$OP_PROFILE_DT"; + ourLastParamUnsignedInt1 = theParam1; + + Bundle retVal = new Bundle(); + retVal.addEntry().getResponse().setStatus("100"); + return retVal; + } + + //@formatter:off + @SuppressWarnings("unused") + @Operation(name="$OP_TYPE", idempotent=true) + public Parameters opType( + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2, + @OperationParam(name="PARAM3", min=2, max=5) List theParam3, + @OperationParam(name="PARAM4", min=1) List theParam4 + ) { + //@formatter:on + + ourLastMethod = "$OP_TYPE"; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_TYPE_ONLY_STRING", idempotent=true) + public Parameters opTypeOnlyString( + @OperationParam(name="PARAM1") StringType theParam1 + ) { + //@formatter:on + + ourLastMethod = "$OP_TYPE"; + ourLastParam1 = theParam1; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_TYPE_RET_BUNDLE") + public Bundle opTypeRetBundle( + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2 + ) { + //@formatter:on + + ourLastMethod = "$OP_TYPE_RET_BUNDLE"; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Bundle retVal = new Bundle(); + retVal.addEntry().getResponse().setStatus("100"); + return retVal; + } + + @Operation(name = "$everything", idempotent=true) + public Bundle patientEverything(@IdParam IdType thePatientId) { + ourLastMethod = "instance $everything"; + ourLastId = thePatientId; + return new Bundle(); + } + + /** + * Just to make sure this method doesn't "steal" calls + */ + @Read + public Patient read(@IdParam IdType theId) { + ourLastMethod = "read"; + Patient retVal = new Patient(); + retVal.setId(theId); + return retVal; + } + + } + + public static class PlainProvider { + + //@formatter:off + @Operation(name="$OP_INSTANCE_BUNDLE_PROVIDER", idempotent=true) + public IBundleProvider opInstanceReturnsBundleProvider() { + ourLastMethod = "$OP_INSTANCE_BUNDLE_PROVIDER"; + + List resources = new ArrayList(); + for (int i =0; i < 100;i++) { + Patient p = new Patient(); + p.setId("Patient/" + i); + p.addName().addFamily("Patient " + i); + resources.add(p); + } + + return new SimpleBundleProvider(resources); + } + + //@formatter:off + @Operation(name="$OP_SERVER") + public Parameters opServer( + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2 + ) { + //@formatter:on + + ourLastMethod = "$OP_SERVER"; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_SERVER_LIST_PARAM") + public Parameters opServerListParam( + @OperationParam(name="PARAM2") Patient theParam2, + @OperationParam(name="PARAM3") List theParam3 + ) { + //@formatter:on + + ourLastMethod = "$OP_SERVER_LIST_PARAM"; + ourLastParam2 = theParam2; + ourLastParam3 = theParam3; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/OperationServerWithSearchParamTypesDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/OperationServerWithSearchParamTypesDstu3Test.java new file mode 100644 index 00000000000..104187e4edc --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/OperationServerWithSearchParamTypesDstu3Test.java @@ -0,0 +1,505 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.Collections; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import javax.servlet.ServletConfig; +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.hapi.rest.server.ServerConformanceProvider; +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationDefinition; +import org.hl7.fhir.dstu2016may.model.Parameters; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Operation; +import ca.uhn.fhir.rest.annotation.OperationParam; +import ca.uhn.fhir.rest.param.StringAndListParam; +import ca.uhn.fhir.rest.param.StringOrListParam; +import ca.uhn.fhir.rest.param.StringParam; +import ca.uhn.fhir.rest.param.TokenAndListParam; +import ca.uhn.fhir.rest.param.TokenOrListParam; +import ca.uhn.fhir.rest.param.TokenParam; +import ca.uhn.fhir.rest.param.TokenParamModifier; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; +import ca.uhn.fhir.util.UrlUtil; + +public class OperationServerWithSearchParamTypesDstu3Test { + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx; + + private static String ourLastMethod; + private static List ourLastParamValStr; + private static List ourLastParamValTok; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(OperationServerWithSearchParamTypesDstu3Test.class); + private static int ourPort; + private static Server ourServer; + @Before + public void before() { + ourLastMethod = ""; + ourLastParamValStr = null; + ourLastParamValTok = null; + } + + private HttpServletRequest createHttpServletRequest() { + HttpServletRequest req = mock(HttpServletRequest.class); + when(req.getRequestURI()).thenReturn("/FhirStorm/fhir/Patient/_search"); + when(req.getServletPath()).thenReturn("/fhir"); + when(req.getRequestURL()).thenReturn(new StringBuffer().append("http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Patient/_search")); + when(req.getContextPath()).thenReturn("/FhirStorm"); + return req; + } + + private ServletConfig createServletConfig() { + ServletConfig sc = mock(ServletConfig.class); + when(sc.getServletContext()).thenReturn(null); + return sc; + } + + @Test + public void testAndListWithParameters() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("valstr").setValue(new StringType("VALSTR1A,VALSTR1B")); + p.addParameter().setName("valstr").setValue(new StringType("VALSTR2A,VALSTR2B")); + p.addParameter().setName("valtok").setValue(new StringType("VALTOK1A|VALTOK1B")); + p.addParameter().setName("valtok").setValue(new StringType("VALTOK2A|VALTOK2B")); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$andlist"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(response); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(2, ourLastParamValStr.size()); + assertEquals(2, ourLastParamValStr.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALSTR1A", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALSTR1B", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(1).getValue()); + assertEquals("VALSTR2A", ourLastParamValStr.get(1).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALSTR2B", ourLastParamValStr.get(1).getValuesAsQueryTokens().get(1).getValue()); + assertEquals(2, ourLastParamValTok.size()); + assertEquals(1, ourLastParamValTok.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALTOK1A", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOK1B", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALTOK2A", ourLastParamValTok.get(1).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOK2B", ourLastParamValTok.get(1).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("type $orlist", ourLastMethod); + } + + @Test + public void testEscapedOperationName() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/%24andlist?valstr=VALSTR1A,VALSTR1B&valstr=VALSTR2A,VALSTR2B&valtok=" + UrlUtil.escape("VALTOK1A|VALTOK1B") + "&valtok=" + UrlUtil.escape("VALTOK2A|VALTOK2B")); + HttpResponse status = ourClient.execute(httpGet); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(response); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(2, ourLastParamValStr.size()); + } + + @Test + public void testAndListWithUrl() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/$andlist?valstr=VALSTR1A,VALSTR1B&valstr=VALSTR2A,VALSTR2B&valtok=" + UrlUtil.escape("VALTOK1A|VALTOK1B") + "&valtok=" + UrlUtil.escape("VALTOK2A|VALTOK2B")); + HttpResponse status = ourClient.execute(httpGet); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(response); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(2, ourLastParamValStr.size()); + assertEquals(2, ourLastParamValStr.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALSTR1A", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALSTR1B", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(1).getValue()); + assertEquals("VALSTR2A", ourLastParamValStr.get(1).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALSTR2B", ourLastParamValStr.get(1).getValuesAsQueryTokens().get(1).getValue()); + assertEquals(2, ourLastParamValTok.size()); + assertEquals(1, ourLastParamValTok.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALTOK1A", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOK1B", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALTOK2A", ourLastParamValTok.get(1).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOK2B", ourLastParamValTok.get(1).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("type $orlist", ourLastMethod); + } + + @Test + public void testGenerateConformance() throws Exception { + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new PatientProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + //@formatter:off + assertThat(conf, stringContainsInOrder( + "", + "", + "", + "" + )); + assertThat(conf, stringContainsInOrder( + "", + "", + "" + )); + assertThat(conf, stringContainsInOrder( + "", + "", + "" + )); + //@formatter:on + + /* + * Check the operation definitions themselves + */ + OperationDefinition andListDef = sc.readOperationDefinition(new IdType("OperationDefinition/Patient--andlist")); + String def = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(andListDef); + ourLog.info(def); + //@formatter:off + assertThat(def, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "" + )); + //@formatter:on + + andListDef = sc.readOperationDefinition(new IdType("OperationDefinition/Patient--andlist-withnomax")); + def = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(andListDef); + ourLog.info(def); + //@formatter:off + assertThat(def, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "" + )); + //@formatter:on + + OperationDefinition orListDef = sc.readOperationDefinition(new IdType("OperationDefinition/Patient--orlist")); + def = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(orListDef); + ourLog.info(def); + //@formatter:off + assertThat(def, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "" + )); + //@formatter:on + + orListDef = sc.readOperationDefinition(new IdType("OperationDefinition/Patient--orlist-withnomax")); + def = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(orListDef); + ourLog.info(def); + //@formatter:off + assertThat(def, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "" + )); + //@formatter:on + + } + + @Test + public void testNonRepeatingWithParams() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("valstr").setValue(new StringType("VALSTR")); + p.addParameter().setName("valtok").setValue(new StringType("VALTOKA|VALTOKB")); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$nonrepeating"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(response); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(1, ourLastParamValStr.size()); + assertEquals(1, ourLastParamValStr.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALSTR", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals(1, ourLastParamValTok.size()); + assertEquals(1, ourLastParamValTok.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALTOKA", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOKB", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("type $nonrepeating", ourLastMethod); + } + @Test + public void testNonRepeatingWithUrl() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/$nonrepeating?valstr=VALSTR&valtok=" + UrlUtil.escape("VALTOKA|VALTOKB")); + HttpResponse status = ourClient.execute(httpGet); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(response); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(1, ourLastParamValStr.size()); + assertEquals(1, ourLastParamValStr.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALSTR", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals(1, ourLastParamValTok.size()); + assertEquals(1, ourLastParamValTok.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALTOKA", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOKB", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("type $nonrepeating", ourLastMethod); + } + + @Test + public void testNonRepeatingWithUrlQualified() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/$nonrepeating?valstr:exact=VALSTR&valtok:not=" + UrlUtil.escape("VALTOKA|VALTOKB")); + HttpResponse status = ourClient.execute(httpGet); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(response); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(1, ourLastParamValStr.size()); + assertEquals(1, ourLastParamValStr.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALSTR", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertTrue(ourLastParamValStr.get(0).getValuesAsQueryTokens().get(0).isExact()); + assertEquals(1, ourLastParamValTok.size()); + assertEquals(1, ourLastParamValTok.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALTOKA", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOKB", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals(TokenParamModifier.NOT, ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getModifier()); + assertEquals("type $nonrepeating", ourLastMethod); + } + + @Test + public void testOrListWithParameters() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("valstr").setValue(new StringType("VALSTR1A,VALSTR1B")); + p.addParameter().setName("valstr").setValue(new StringType("VALSTR2A,VALSTR2B")); + p.addParameter().setName("valtok").setValue(new StringType("VALTOK1A|VALTOK1B")); + p.addParameter().setName("valtok").setValue(new StringType("VALTOK2A|VALTOK2B")); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$orlist"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(response); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(2, ourLastParamValStr.size()); + assertEquals(2, ourLastParamValStr.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALSTR1A", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALSTR1B", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(1).getValue()); + assertEquals("VALSTR2A", ourLastParamValStr.get(1).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALSTR2B", ourLastParamValStr.get(1).getValuesAsQueryTokens().get(1).getValue()); + assertEquals(2, ourLastParamValTok.size()); + assertEquals(1, ourLastParamValTok.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALTOK1A", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOK1B", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALTOK2A", ourLastParamValTok.get(1).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOK2B", ourLastParamValTok.get(1).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("type $orlist", ourLastMethod); + } + + @Test + public void testOrListWithUrl() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/$orlist?valstr=VALSTR1A,VALSTR1B&valstr=VALSTR2A,VALSTR2B&valtok=" + UrlUtil.escape("VALTOK1A|VALTOK1B") + "&valtok=" + UrlUtil.escape("VALTOK2A|VALTOK2B")); + HttpResponse status = ourClient.execute(httpGet); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(response); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(2, ourLastParamValStr.size()); + assertEquals(2, ourLastParamValStr.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALSTR1A", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALSTR1B", ourLastParamValStr.get(0).getValuesAsQueryTokens().get(1).getValue()); + assertEquals("VALSTR2A", ourLastParamValStr.get(1).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALSTR2B", ourLastParamValStr.get(1).getValuesAsQueryTokens().get(1).getValue()); + assertEquals(2, ourLastParamValTok.size()); + assertEquals(1, ourLastParamValTok.get(0).getValuesAsQueryTokens().size()); + assertEquals("VALTOK1A", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOK1B", ourLastParamValTok.get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("VALTOK2A", ourLastParamValTok.get(1).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("VALTOK2B", ourLastParamValTok.get(1).getValuesAsQueryTokens().get(0).getValue()); + assertEquals("type $orlist", ourLastMethod); + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + @BeforeClass + public static void beforeClass() throws Exception { + ourCtx = FhirContext.forDstu2_1(); + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + + servlet.setPagingProvider(new FifoMemoryPagingProvider(10).setDefaultPageSize(2)); + + servlet.setFhirContext(ourCtx); + servlet.setResourceProviders(new PatientProvider()); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + + @Operation(name = "$andlist", idempotent = true) + public Parameters andlist( + //@formatter:off + @OperationParam(name="valstr", max=10) StringAndListParam theValStr, + @OperationParam(name="valtok", max=10) TokenAndListParam theValTok + //@formatter:on + ) { + ourLastMethod = "type $orlist"; + ourLastParamValStr = theValStr.getValuesAsQueryTokens(); + ourLastParamValTok = theValTok.getValuesAsQueryTokens(); + + return createEmptyParams(); + } + + @Operation(name = "$andlist-withnomax", idempotent = true) + public Parameters andlistWithNoMax( + //@formatter:off + @OperationParam(name="valstr") StringAndListParam theValStr, + @OperationParam(name="valtok") TokenAndListParam theValTok + //@formatter:on + ) { + ourLastMethod = "type $orlist"; + ourLastParamValStr = theValStr.getValuesAsQueryTokens(); + ourLastParamValTok = theValTok.getValuesAsQueryTokens(); + + return createEmptyParams(); + } + + /** + * Just so we have something to return + */ + private Parameters createEmptyParams() { + Parameters retVal = new Parameters(); + retVal.setId("100"); + return retVal; + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Operation(name = "$nonrepeating", idempotent = true) + public Parameters nonrepeating( + //@formatter:off + @OperationParam(name="valstr") StringParam theValStr, + @OperationParam(name="valtok") TokenParam theValTok + //@formatter:on + ) { + ourLastMethod = "type $nonrepeating"; + ourLastParamValStr = Collections.singletonList(new StringOrListParam().add(theValStr)); + ourLastParamValTok = Collections.singletonList(new TokenOrListParam().add(theValTok)); + + return createEmptyParams(); + } + + @Operation(name = "$orlist", idempotent = true) + public Parameters orlist( + //@formatter:off + @OperationParam(name="valstr", max=10) List theValStr, + @OperationParam(name="valtok", max=10) List theValTok + //@formatter:on + ) { + ourLastMethod = "type $orlist"; + ourLastParamValStr = theValStr; + ourLastParamValTok = theValTok; + + return createEmptyParams(); + } + + @Operation(name = "$orlist-withnomax", idempotent = true) + public Parameters orlistWithNoMax( + //@formatter:off + @OperationParam(name="valstr") List theValStr, + @OperationParam(name="valtok") List theValTok + //@formatter:on + ) { + ourLastMethod = "type $orlist"; + ourLastParamValStr = theValStr; + ourLastParamValTok = theValTok; + + return createEmptyParams(); + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/PatchDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/PatchDstu3Test.java new file mode 100644 index 00000000000..4163638ac17 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/PatchDstu3Test.java @@ -0,0 +1,191 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPatch; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Patch; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.api.PatchTypeEnum; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class PatchDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(PatchDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static String ourLastMethod; + private static PatchTypeEnum ourLastPatchType; + + @Before + public void before() { + ourLastMethod = null; + ourLastBody = null; + ourLastId = null; + } + + @Test + public void testPatchValidJson() throws Exception { + String requestContents = "[ { \"op\": \"add\", \"path\": \"/a/b/c\", \"value\": [ \"foo\", \"bar\" ] } ]"; + HttpPatch httpPatch = new HttpPatch("http://localhost:" + ourPort + "/Patient/123"); + httpPatch.setEntity(new StringEntity(requestContents, ContentType.parse(Constants.CT_JSON_PATCH))); + CloseableHttpResponse status = ourClient.execute(httpPatch); + + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("
OK
", responseContent); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + assertEquals("patientPatch", ourLastMethod); + assertEquals("Patient/123", ourLastId.getValue()); + assertEquals(requestContents, ourLastBody); + assertEquals(PatchTypeEnum.JSON_PATCH, ourLastPatchType); + } + + @Test + public void testPatchValidXml() throws Exception { + String requestContents = ""; + HttpPatch httpPatch = new HttpPatch("http://localhost:" + ourPort + "/Patient/123"); + httpPatch.setEntity(new StringEntity(requestContents, ContentType.parse(Constants.CT_XML_PATCH))); + CloseableHttpResponse status = ourClient.execute(httpPatch); + + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("
OK
", responseContent); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + assertEquals("patientPatch", ourLastMethod); + assertEquals("Patient/123", ourLastId.getValue()); + assertEquals(requestContents, ourLastBody); + assertEquals(PatchTypeEnum.XML_PATCH, ourLastPatchType); + } + + @Test + public void testPatchValidJsonWithCharset() throws Exception { + String requestContents = "[ { \"op\": \"add\", \"path\": \"/a/b/c\", \"value\": [ \"foo\", \"bar\" ] } ]"; + HttpPatch httpPatch = new HttpPatch("http://localhost:" + ourPort + "/Patient/123"); + httpPatch.setEntity(new StringEntity(requestContents, ContentType.parse(Constants.CT_JSON_PATCH + Constants.CHARSET_UTF8_CTSUFFIX))); + CloseableHttpResponse status = ourClient.execute(httpPatch); + + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + assertEquals("patientPatch", ourLastMethod); + assertEquals("Patient/123", ourLastId.getValue()); + assertEquals(requestContents, ourLastBody); + } + + @Test + public void testPatchInvalidMimeType() throws Exception { + String requestContents = "[ { \"op\": \"add\", \"path\": \"/a/b/c\", \"value\": [ \"foo\", \"bar\" ] } ]"; + HttpPatch httpPatch = new HttpPatch("http://localhost:" + ourPort + "/Patient/123"); + httpPatch.setEntity(new StringEntity(requestContents, ContentType.parse("text/plain; charset=UTF-8"))); + CloseableHttpResponse status = ourClient.execute(httpPatch); + + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(400, status.getStatusLine().getStatusCode()); + assertEquals("", responseContent); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + private static String ourLastBody; + private static IdType ourLastId; + public static class DummyPatientResourceProvider implements IResourceProvider { + + + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @Patch + public OperationOutcome patientPatch(@IdParam IdType theId, PatchTypeEnum thePatchType, @ResourceParam String theBody) { + ourLastMethod = "patientPatch"; + ourLastBody = theBody; + ourLastId = theId; + ourLastPatchType = thePatchType; + OperationOutcome retVal = new OperationOutcome(); + retVal.getText().setDivAsString("
OK
"); + return retVal; + } + //@formatter:on + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ReadDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ReadDstu3Test.java new file mode 100644 index 00000000000..46f0c3a4976 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ReadDstu3Test.java @@ -0,0 +1,122 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.DateType; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.client.MyPatientWithExtensions; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class ReadDstu3Test { + private static CloseableHttpClient ourClient; + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ReadDstu3Test.class); + private static int ourPort; + private static Server ourServer; + + + @Test + public void testRead() throws Exception { + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/2?_format=xml&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("http://localhost:" + ourPort + "/Patient/2/_history/2", status.getFirstHeader(Constants.HEADER_LOCATION).getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/2/_history/2", status.getFirstHeader(Constants.HEADER_CONTENT_LOCATION).getValue()); + + //@formatter:off + assertThat(responseContent, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + } + + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Read(version=true) + public MyPatientWithExtensions read(@IdParam IdType theIdParam) { + MyPatientWithExtensions p0 = new MyPatientWithExtensions(); + p0.setId(theIdParam); + if (theIdParam.hasVersionIdPart() == false) { + p0.setIdElement(p0.getIdElement().withVersion("2")); + } + p0.setDateExt(new DateType("2011-01-01")); + return p0; + } + + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchCountParamDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchCountParamDstu3Test.java new file mode 100644 index 00000000000..0880cdf4e96 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchCountParamDstu3Test.java @@ -0,0 +1,183 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Count; +import ca.uhn.fhir.rest.annotation.OptionalParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.param.TokenParam; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class SearchCountParamDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchCountParamDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static String ourLastMethod; + private static Integer ourLastParam; + + @Before + public void before() { + ourLastMethod = null; + ourLastParam = null; + } + + @Test + public void testSearch() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_count=2"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("search", ourLastMethod); + assertEquals(new Integer(2), ourLastParam); + + //@formatter:off + assertThat(responseContent, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + /** + * See #372 + */ + @Test + public void testSearchWithNoCountParam() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=searchWithNoCountParam&_count=2"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("searchWithNoCountParam", ourLastMethod); + assertEquals(null, ourLastParam); + + //@formatter:off + assertThat(responseContent, stringContainsInOrder( + "", + "", + "", + "", + "", + "", + "", + "")); + //@formatter:on + + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @SuppressWarnings("rawtypes") + @Search() + public List search( + @OptionalParam(name=Patient.SP_IDENTIFIER) TokenParam theIdentifier, + @Count() Integer theParam + ) { + ourLastMethod = "search"; + ourLastParam = theParam; + ArrayList retVal = new ArrayList(); + for (int i = 1; i < 100; i++) { + retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("" + i)); + } + return retVal; + } + //@formatter:on + + //@formatter:off + @SuppressWarnings("rawtypes") + @Search(queryName="searchWithNoCountParam") + public List searchWithNoCountParam() { + ourLastMethod = "searchWithNoCountParam"; + ourLastParam = null; + ArrayList retVal = new ArrayList(); + for (int i = 1; i < 100; i++) { + retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("" + i)); + } + return retVal; + } + //@formatter:on + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchDstu3Test.java new file mode 100644 index 00000000000..7c49ef938de --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchDstu3Test.java @@ -0,0 +1,140 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.OptionalParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.param.TokenAndListParam; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class SearchDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static String ourLastMethod; + private static TokenAndListParam ourIdentifiers; + + @Before + public void before() { + ourLastMethod = null; + ourIdentifiers = null; + } + + @Test + public void testSearchNormal() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?identifier=foo%7Cbar"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("search", ourLastMethod); + + assertEquals("foo", ourIdentifiers.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().get(0).getSystem()); + assertEquals("bar", ourIdentifiers.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().get(0).getValue()); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @Test + public void testSearchWithInvalidChain() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?identifier.chain=foo%7Cbar"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(400, status.getStatusLine().getStatusCode()); + + OperationOutcome oo = (OperationOutcome) ourCtx.newXmlParser().parseResource(responseContent); + assertEquals("Invalid search parameter \"identifier.chain\". Parameter contains a chain (.chain) and chains are not supported for this parameter (chaining is only allowed on reference parameters)", oo.getIssue().get(0).getDiagnostics()); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @SuppressWarnings("rawtypes") + @Search() + public List search( + @OptionalParam(name=Patient.SP_IDENTIFIER) TokenAndListParam theIdentifiers + ) { + ourLastMethod = "search"; + ourIdentifiers = theIdentifiers; + ArrayList retVal = new ArrayList(); + retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("1")); + return retVal; + } + //@formatter:on + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchHasParamDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchHasParamDstu3Test.java new file mode 100644 index 00000000000..4e528965689 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchHasParamDstu3Test.java @@ -0,0 +1,122 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.OptionalParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.param.HasAndListParam; +import ca.uhn.fhir.rest.param.HasParam; +import ca.uhn.fhir.rest.param.TokenParam; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class SearchHasParamDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchHasParamDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static String ourLastMethod; + private static HasAndListParam ourLastParam; + + @Before + public void before() { + ourLastMethod = null; + ourLastParam = null; + } + + @Test + public void testSearch() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_has:Encounter:patient:type=SURG"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("search", ourLastMethod); + + HasParam param = ourLastParam.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().get(0); + assertEquals("Encounter", param.getTargetResourceType()); + assertEquals("patient", param.getOwningFieldName()); + assertEquals("type", param.getParameterName()); + assertEquals("SURG", param.getParameterValue()); + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @SuppressWarnings("rawtypes") + @Search() + public List search( + @OptionalParam(name=Patient.SP_IDENTIFIER) TokenParam theIdentifier, + @OptionalParam(name="_has") HasAndListParam theParam + ) { + ourLastMethod = "search"; + ourLastParam = theParam; + ArrayList retVal = new ArrayList(); + retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("1")); + return retVal; + } + //@formatter:on + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchPostDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchPostDstu3Test.java new file mode 100644 index 00000000000..8476dd14c7f --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchPostDstu3Test.java @@ -0,0 +1,264 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.IOUtils; +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.message.BasicNameValuePair; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.google.common.collect.Lists; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.OptionalParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.annotation.Sort; +import ca.uhn.fhir.rest.api.SortSpec; +import ca.uhn.fhir.rest.param.StringAndListParam; +import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; +import ca.uhn.fhir.rest.server.interceptor.InterceptorAdapter; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class SearchPostDstu3Test { + + public class ParamLoggingInterceptor extends InterceptorAdapter { + + @Override + public boolean incomingRequestPreProcessed(HttpServletRequest theRequest, HttpServletResponse theResponse) { + ourLog.info("Params: {}", theRequest.getParameterMap()); + return true; + } + + + } + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchPostDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static String ourLastMethod; + private static SortSpec ourLastSortSpec; + private static StringAndListParam ourLastName; + private static RestfulServer ourServlet; + + @Before + public void before() { + ourLastMethod = null; + ourLastSortSpec = null; + ourLastName = null; + + for (IServerInterceptor next : new ArrayList<>(ourServlet.getInterceptors())) { + ourServlet.unregisterInterceptor(next); + } + } + + /** + * See #411 + */ + @Test + public void testSearchWithMixedParamsNoInterceptorsYesParams() throws Exception { + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/_search?_format=application/fhir+json"); + httpPost.addHeader("Cache-Control","no-cache"); + List parameters = Lists.newArrayList(); + parameters.add(new BasicNameValuePair("name", "Smith")); + httpPost.setEntity(new UrlEncodedFormEntity(parameters)); + + ourLog.info("Outgoing post: {}", httpPost); + + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("search", ourLastMethod); + assertEquals(null, ourLastSortSpec); + assertEquals(1, ourLastName.getValuesAsQueryTokens().size()); + assertEquals(1, ourLastName.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().size()); + assertEquals("Smith", ourLastName.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals(Constants.CT_FHIR_JSON_NEW, status.getEntity().getContentType().getValue().replaceAll(";.*", "")); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + /** + * See #411 + */ + @Test + public void testSearchWithMixedParamsNoInterceptorsNoParams() throws Exception { + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/_search"); + httpPost.addHeader("Cache-Control","no-cache"); + List parameters = Lists.newArrayList(); + parameters.add(new BasicNameValuePair("name", "Smith")); + httpPost.setEntity(new UrlEncodedFormEntity(parameters)); + + ourLog.info("Outgoing post: {}", httpPost); + + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("search", ourLastMethod); + assertEquals(null, ourLastSortSpec); + assertEquals(1, ourLastName.getValuesAsQueryTokens().size()); + assertEquals(1, ourLastName.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().size()); + assertEquals("Smith", ourLastName.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals(Constants.CT_FHIR_XML, status.getEntity().getContentType().getValue().replaceAll(";.*", "")); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + /** + * See #411 + */ + @Test + public void testSearchWithMixedParamsYesInterceptorsYesParams() throws Exception { + ourServlet.registerInterceptor(new ParamLoggingInterceptor()); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/_search?_format=application/fhir+json"); + httpPost.addHeader("Cache-Control","no-cache"); + List parameters = Lists.newArrayList(); + parameters.add(new BasicNameValuePair("name", "Smith")); + httpPost.setEntity(new UrlEncodedFormEntity(parameters)); + + ourLog.info("Outgoing post: {}", httpPost); + + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("search", ourLastMethod); + assertEquals(null, ourLastSortSpec); + assertEquals(1, ourLastName.getValuesAsQueryTokens().size()); + assertEquals(1, ourLastName.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().size()); + assertEquals("Smith", ourLastName.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals(Constants.CT_FHIR_JSON_NEW, status.getEntity().getContentType().getValue().replaceAll(";.*", "")); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + /** + * See #411 + */ + @Test + public void testSearchWithMixedParamsYesInterceptorsNoParams() throws Exception { + ourServlet.registerInterceptor(new ParamLoggingInterceptor()); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/_search"); + httpPost.addHeader("Cache-Control","no-cache"); + List parameters = Lists.newArrayList(); + parameters.add(new BasicNameValuePair("name", "Smith")); + httpPost.setEntity(new UrlEncodedFormEntity(parameters)); + + ourLog.info("Outgoing post: {}", httpPost); + + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("search", ourLastMethod); + assertEquals(null, ourLastSortSpec); + assertEquals(1, ourLastName.getValuesAsQueryTokens().size()); + assertEquals(1, ourLastName.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().size()); + assertEquals("Smith", ourLastName.getValuesAsQueryTokens().get(0).getValuesAsQueryTokens().get(0).getValue()); + assertEquals(Constants.CT_FHIR_XML, status.getEntity().getContentType().getValue().replaceAll(";.*", "")); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + ourServlet = new RestfulServer(ourCtx); + ourServlet.setDefaultResponseEncoding(EncodingEnum.XML); + ourServlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + ourServlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(ourServlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @SuppressWarnings("rawtypes") + @Search() + public List search( + @Sort SortSpec theSortSpec, + @OptionalParam(name=Patient.SP_NAME) StringAndListParam theName + ) { + ourLastMethod = "search"; + ourLastSortSpec = theSortSpec; + ourLastName = theName; + ArrayList retVal = new ArrayList(); + retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("foo")); + return retVal; + } + //@formatter:on + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchSortDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchSortDstu3Test.java new file mode 100644 index 00000000000..3311a81097c --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchSortDstu3Test.java @@ -0,0 +1,133 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.annotation.Sort; +import ca.uhn.fhir.rest.api.SortOrderEnum; +import ca.uhn.fhir.rest.api.SortSpec; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class SearchSortDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchSortDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static String ourLastMethod; + private static SortSpec ourLastSortSpec; + + @Before + public void before() { + ourLastMethod = null; + ourLastSortSpec = null; + } + + @Test + public void testSearch() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_sort=param1,-param2,param3,-param4"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("search", ourLastMethod); + + assertEquals("param1", ourLastSortSpec.getParamName()); + assertEquals(SortOrderEnum.ASC, ourLastSortSpec.getOrder()); + + assertEquals("param2", ourLastSortSpec.getChain().getParamName()); + assertEquals(SortOrderEnum.DESC, ourLastSortSpec.getChain().getOrder()); + + assertEquals("param3", ourLastSortSpec.getChain().getChain().getParamName()); + assertEquals(SortOrderEnum.ASC, ourLastSortSpec.getChain().getChain().getOrder()); + + assertEquals("param4", ourLastSortSpec.getChain().getChain().getChain().getParamName()); + assertEquals(SortOrderEnum.DESC, ourLastSortSpec.getChain().getChain().getChain().getOrder()); + + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @SuppressWarnings("rawtypes") + @Search() + public List search( + @Sort SortSpec theSortSpec + ) { + ourLastMethod = "search"; + ourLastSortSpec = theSortSpec; + ArrayList retVal = new ArrayList(); + for (int i = 1; i < 100; i++) { + retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("" + i)); + } + return retVal; + } + //@formatter:on + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithGenericListDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithGenericListDstu3Test.java new file mode 100644 index 00000000000..d5ff77f39a4 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithGenericListDstu3Test.java @@ -0,0 +1,120 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.RequiredParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.param.TokenParam; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class SearchWithGenericListDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchWithGenericListDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static String ourLastMethod; + + @Before + public void before() { + ourLastMethod = null; + } + + /** + * See #291 + */ + @Test + public void testSearch() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?identifier=foo&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("searchByIdentifier", ourLastMethod); + assertThat(responseContent, containsString("")); + } + + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @SuppressWarnings("rawtypes") + @Search() + public List searchByIdentifier( + @RequiredParam(name=Patient.SP_IDENTIFIER) TokenParam theIdentifier) { + ourLastMethod = "searchByIdentifier"; + ArrayList retVal = new ArrayList(); + retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("1")); + return retVal; + } + //@formatter:on + + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithIncludesDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithIncludesDstu3Test.java new file mode 100644 index 00000000000..a033464d811 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithIncludesDstu3Test.java @@ -0,0 +1,134 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.Organization; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.Include; +import ca.uhn.fhir.rest.annotation.IncludeParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class SearchWithIncludesDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchWithIncludesDstu3Test.class); + private static int ourPort; + private static Server ourServer; + + @Test + public void testSearchIncludesReferences() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_pretty=true&_include=Patient:organization&_include=Organization:" + Organization.SP_PARTOF); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + + // Response should include both the patient, and the organization that was referred to + // by a linked resource + + assertThat(responseContent, containsString("")); + assertThat(responseContent, containsString("")); + assertThat(responseContent, containsString("")); + assertThat(responseContent, containsString("")); + + } + + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @Search() + public List search(@IncludeParam() Set theIncludes) { + ourLog.info("Includes: {}", theIncludes); + + // Grandparent has ID, other orgs don't + Organization gp = new Organization(); + gp.setId("Organization/GP"); + gp.setName("grandparent"); + + Organization parent = new Organization(); + parent.setName("parent"); + parent.getPartOf().setResource(gp); + + Organization child = new Organization(); + child.setName("child"); + child.getPartOf().setResource(parent); + + Patient patient = new Patient(); + patient.setId("Patient/FOO"); + patient.getManagingOrganization().setResource(child); + + ArrayList retVal = new ArrayList(); + retVal.add(patient); + return retVal; + } + //@formatter:on + + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithServerAddressStrategyDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithServerAddressStrategyDstu3Test.java new file mode 100644 index 00000000000..bad5074d565 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/SearchWithServerAddressStrategyDstu3Test.java @@ -0,0 +1,171 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.HumanName; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class SearchWithServerAddressStrategyDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchWithServerAddressStrategyDstu3Test.class); + private static int ourPort; + private static Server ourServer; + private static RestfulServer ourServlet; + + @Test + public void testIncomingRequestAddressStrategy() throws Exception { + ourServlet.setServerAddressStrategy(new IncomingRequestAddressStrategy()); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + } + + @Test + public void testApacheProxyAddressStrategy() throws Exception { + + ourServlet.setServerAddressStrategy(ApacheProxyAddressStrategy.forHttp()); + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + + ourServlet.setServerAddressStrategy(new ApacheProxyAddressStrategy(false)); + httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + httpGet.addHeader("x-forwarded-host", "foo.com"); + status = ourClient.execute(httpGet); + responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + + ourServlet.setServerAddressStrategy(ApacheProxyAddressStrategy.forHttps()); + httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + httpGet.addHeader("x-forwarded-host", "foo.com"); + status = ourClient.execute(httpGet); + responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + + ourServlet.setServerAddressStrategy(new ApacheProxyAddressStrategy(false)); + httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + httpGet.addHeader("x-forwarded-host", "foo.com"); + httpGet.addHeader("x-forwarded-proto", "https"); + status = ourClient.execute(httpGet); + responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + + } + + @Test + public void testHardcodedAddressStrategy() throws Exception { + ourServlet.setServerAddressStrategy(new HardcodedServerAddressStrategy("http://example.com/fhir/base")); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + } + + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + ourServlet = new RestfulServer(ourCtx); + ourServlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + ourServlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(ourServlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + //@formatter:off + @Search() + public List searchByIdentifier() { + ArrayList retVal = new ArrayList(); + retVal.add((Patient) new Patient().addName(new HumanName().addGiven("FAMILY")).setId("1")); + retVal.add((Patient) new Patient().addName(new HumanName().addGiven("FAMILY")).setId("2")); + return retVal; + } + //@formatter:on + + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerExceptionDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerExceptionDstu3Test.java new file mode 100644 index 00000000000..c0f35b76224 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerExceptionDstu3Test.java @@ -0,0 +1,138 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; +import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; +import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class ServerExceptionDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ServerExceptionDstu3Test.class); + private static int ourPort; + private static Server ourServer; + public static BaseServerResponseException ourException; + + @Test + public void testAddHeadersNotFound() throws Exception { + + OperationOutcome operationOutcome = new OperationOutcome(); + operationOutcome.addIssue().setCode(IssueType.BUSINESSRULE); + + ourException = new ResourceNotFoundException("SOME MESSAGE"); + ourException.addResponseHeader("X-Foo", "BAR BAR"); + + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(status.getStatusLine().toString()); + ourLog.info(responseContent); + + assertEquals(404, status.getStatusLine().getStatusCode()); + assertEquals("BAR BAR", status.getFirstHeader("X-Foo").getValue()); + assertThat(status.getFirstHeader("X-Powered-By").getValue(), containsString("HAPI FHIR")); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @Test + public void testAuthorize() throws Exception { + + OperationOutcome operationOutcome = new OperationOutcome(); + operationOutcome.addIssue().setCode(IssueType.BUSINESSRULE); + + ourException = new AuthenticationException().addAuthenticateHeaderForRealm("REALM"); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(status.getStatusLine().toString()); + ourLog.info(responseContent); + + assertEquals(401, status.getStatusLine().getStatusCode()); + assertEquals("Basic realm=\"REALM\"", status.getFirstHeader("WWW-Authenticate").getValue()); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Search() + public List search() { + throw ourException; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerMimetypeDstu21Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerMimetypeDstu21Test.java new file mode 100644 index 00000000000..d132ba15a95 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerMimetypeDstu21Test.java @@ -0,0 +1,410 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.client.methods.HttpTrace; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.CodeType; +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.hl7.fhir.dstu2016may.model.DateType; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Create; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.client.MyPatientWithExtensions; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class ServerMimetypeDstu21Test { + private static CloseableHttpClient ourClient; + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ServerMimetypeDstu21Test.class); + private static int ourPort; + private static Server ourServer; + + @Test + public void testConformanceMetadataUsesNewMimetypes() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/metadata"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String content = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(content); + Conformance conf = ourCtx.newXmlParser().parseResource(Conformance.class, content); + List strings = toStrings(conf.getFormat()); + assertThat(strings, contains(Constants.CT_FHIR_XML_NEW, Constants.CT_FHIR_JSON_NEW)); + } finally { + status.close(); + } + } + + + + private List toStrings(List theFormat) { + ArrayList retVal = new ArrayList<>(); + for (CodeType next : theFormat) { + retVal.add(next.asStringValue()); + } + return retVal; + } + + + + @Test + public void testCreateWithXmlLegacyNoAcceptHeader() throws Exception { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + String enc = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity(enc, ContentType.parse(Constants.CT_FHIR_XML + "; charset=utf-8"))); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals(Constants.CT_FHIR_XML, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + assertEquals("", responseContent); + } + + @Test + public void testHttpTraceNotEnabled() throws Exception { + HttpTrace req = new HttpTrace("http://localhost:" + ourPort + "/Patient"); + CloseableHttpResponse status = ourClient.execute(req); + try { + ourLog.info(status.toString()); + assertEquals(400, status.getStatusLine().getStatusCode()); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + } + + @Test + public void testHttpTrackNotEnabled() throws Exception { + HttpRequestBase req = new HttpRequestBase() { + @Override + public String getMethod() { + return "TRACK"; + }}; + req.setURI(new URI("http://localhost:" + ourPort + "/Patient")); + + CloseableHttpResponse status = ourClient.execute(req); + try { + ourLog.info(status.toString()); + assertEquals(400, status.getStatusLine().getStatusCode()); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + } + + @Test + public void testCreateWithXmlNewNoAcceptHeader() throws Exception { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + String enc = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity(enc, ContentType.parse(Constants.CT_FHIR_XML_NEW + "; charset=utf-8"))); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals(Constants.CT_FHIR_XML_NEW, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + assertEquals("", responseContent); + } + + @Test + public void testCreateWithXmlNewWithAcceptHeader() throws Exception { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + String enc = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity(enc, ContentType.parse(Constants.CT_FHIR_XML + "; charset=utf-8"))); + httpPost.addHeader(Constants.HEADER_ACCEPT, Constants.CT_FHIR_XML_NEW); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals(Constants.CT_FHIR_XML_NEW, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + assertEquals("", responseContent); + } + + @Test + public void testCreateWithJsonLegacyNoAcceptHeader() throws Exception { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + String enc = ourCtx.newJsonParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity(enc, ContentType.parse(Constants.CT_FHIR_JSON + "; charset=utf-8"))); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals(Constants.CT_FHIR_JSON, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + assertEquals("{\"resourceType\":\"OperationOutcome\",\"issue\":[{\"diagnostics\":\"FAMILY\"}]}", responseContent); + } + + @Test + public void testCreateWithJsonNewNoAcceptHeader() throws Exception { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + String enc = ourCtx.newJsonParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity(enc, ContentType.parse(Constants.CT_FHIR_JSON_NEW + "; charset=utf-8"))); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals(Constants.CT_FHIR_JSON_NEW, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + assertEquals("{\"resourceType\":\"OperationOutcome\",\"issue\":[{\"diagnostics\":\"FAMILY\"}]}", responseContent); + } + + @Test + public void testCreateWithJsonNewWithAcceptHeader() throws Exception { + Patient p = new Patient(); + p.addName().addFamily("FAMILY"); + String enc = ourCtx.newJsonParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity(enc, ContentType.parse(Constants.CT_FHIR_JSON + "; charset=utf-8"))); + httpPost.addHeader(Constants.HEADER_ACCEPT, Constants.CT_FHIR_JSON_NEW); + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals(Constants.CT_FHIR_JSON_NEW, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + assertEquals("{\"resourceType\":\"OperationOutcome\",\"issue\":[{\"diagnostics\":\"FAMILY\"}]}", responseContent); + } + + @Test + public void testSearchWithFormatXmlSimple() throws Exception { + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_format=xml"); + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + assertThat(responseContent, not(containsString("http://hl7.org/fhir/"))); + assertEquals(Constants.CT_FHIR_XML, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + } + + @Test + public void testSearchWithFormatXmlLegacy() throws Exception { + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_format=" + Constants.CT_FHIR_XML); + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + assertThat(responseContent, not(containsString("http://hl7.org/fhir/"))); + assertEquals(Constants.CT_FHIR_XML, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + } + + @Test + public void testSearchWithFormatXmlNew() throws Exception { + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_format=" + Constants.CT_FHIR_XML_NEW); + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("")); + assertThat(responseContent, not(containsString("http://hl7.org/fhir/"))); + assertEquals(Constants.CT_FHIR_XML_NEW, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + } + + + + @Test + public void testSearchWithFormatJsonSimple() throws Exception { + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_format=json"); + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("\"resourceType\"")); + assertEquals(Constants.CT_FHIR_JSON, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + } + + @Test + public void testSearchWithFormatJsonLegacy() throws Exception { + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_format=" + Constants.CT_FHIR_JSON); + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("\"resourceType\"")); + assertEquals(Constants.CT_FHIR_JSON, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + } + + @Test + public void testSearchWithFormatJsonNew() throws Exception { + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_format=" + Constants.CT_FHIR_JSON_NEW); + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("\"resourceType\"")); + assertEquals(Constants.CT_FHIR_JSON_NEW, status.getFirstHeader("content-type").getValue().replaceAll(";.*", "")); + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Create() + public MethodOutcome create(@ResourceParam Patient theIdParam) { + OperationOutcome oo = new OperationOutcome(); + oo.addIssue().setDiagnostics(theIdParam.getName().get(0).getFamilyAsSingleString()); + return new MethodOutcome(new IdType("Patient", "1"), true).setOperationOutcome(oo); + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Read() + public MyPatientWithExtensions read(@IdParam IdType theIdParam) { + MyPatientWithExtensions p0 = new MyPatientWithExtensions(); + p0.setId(theIdParam); + p0.setDateExt(new DateType("2011-01-01")); + return p0; + } + + @Search + public List search() { + ArrayList retVal = new ArrayList(); + + MyPatientWithExtensions p0 = new MyPatientWithExtensions(); + p0.setId(new IdType("Patient/0")); + p0.setDateExt(new DateType("2011-01-01")); + retVal.add(p0); + + Patient p1 = new Patient(); + p1.setId(new IdType("Patient/1")); + p1.addName().addFamily("The Family"); + retVal.add(p1); + + return retVal; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerUsingOldTypesDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerUsingOldTypesDstu3Test.java new file mode 100644 index 00000000000..ae059cf0cd1 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ServerUsingOldTypesDstu3Test.java @@ -0,0 +1,115 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; + +import javax.servlet.ServletException; + +import org.hamcrest.core.StringContains; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.IntegerDt; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Operation; +import ca.uhn.fhir.rest.annotation.OperationParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.util.TestUtil; + +public class ServerUsingOldTypesDstu3Test { + + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @Test + public void testReadProviderString() { + RestfulServer srv = new RestfulServer(ourCtx); + srv.setFhirContext(ourCtx); + srv.setResourceProviders(new ReadProviderString()); + + try { + srv.init(); + fail(); + } catch (ServletException e) { + assertThat(e.getCause().toString(), StringContains.containsString("ConfigurationException")); + } + } + + @Test + public void testReadProviderIdDt() { + RestfulServer srv = new RestfulServer(ourCtx); + srv.setFhirContext(ourCtx); + srv.setResourceProviders(new ReadProviderIdDt()); + + try { + srv.init(); + fail(); + } catch (ServletException e) { + assertThat(e.getCause().toString(), StringContains.containsString("ConfigurationException")); + } + } + + @Test + public void testOperationProvider() { + RestfulServer srv = new RestfulServer(ourCtx); + srv.setFhirContext(ourCtx); + srv.setResourceProviders(new OperationProvider()); + + try { + srv.init(); + fail(); + } catch (ServletException e) { + assertThat(e.getCause().toString(), StringContains.containsString("Incorrect use of type")); + } + } + + public static class ReadProviderString implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Read + public Patient opTypeRetOldBundle(@IdParam String theId) { + return null; + } + + } + + public static class ReadProviderIdDt implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Read + public Patient opTypeRetOldBundle(@IdParam IdDt theId) { + return null; + } + + } + + public static class OperationProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Operation(name = "foo") + public Patient opTypeRetOldBundle(@OperationParam(name = "foo") IntegerDt theId) { + return null; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/UnclassifiedServerExceptionDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/UnclassifiedServerExceptionDstu3Test.java new file mode 100644 index 00000000000..f3871de4946 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/UnclassifiedServerExceptionDstu3Test.java @@ -0,0 +1,109 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.server.exceptions.UnclassifiedServerFailureException; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class UnclassifiedServerExceptionDstu3Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(UnclassifiedServerExceptionDstu3Test.class); + private static int ourPort; + private static Server ourServer; + public static UnclassifiedServerFailureException ourException; + + @Test + public void testSearch() throws Exception { + + OperationOutcome operationOutcome = new OperationOutcome(); + operationOutcome.addIssue().setCode(IssueType.BUSINESSRULE); + ourException = new UnclassifiedServerFailureException(477, "SOME MESSAGE", operationOutcome); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + CloseableHttpResponse status = ourClient.execute(httpGet); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info(status.getStatusLine().toString()); + ourLog.info(responseContent); + assertEquals(477, status.getStatusLine().getStatusCode()); + //assertEquals("SOME MESSAGE", status.getStatusLine().getReasonPhrase()); + assertThat(responseContent, stringContainsInOrder("business-rule")); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setPagingProvider(new FifoMemoryPagingProvider(10)); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Search() + public List search() { + throw ourException; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/UpdateDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/UpdateDstu3Test.java new file mode 100644 index 00000000000..e37c5c8e7a2 --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/UpdateDstu3Test.java @@ -0,0 +1,194 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.ConditionalUrlParam; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Update; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class UpdateDstu3Test { + private static CloseableHttpClient ourClient; + private static String ourConditionalUrl; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static IdType ourId; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(UpdateDstu3Test.class); + private static int ourPort; + private static Server ourServer; + + @Before + public void before() { + ourConditionalUrl = null; + ourId = null; + } + + @Test + public void testUpdateConditional() throws Exception { + + Patient patient = new Patient(); + patient.setId("001"); + patient.addIdentifier().setValue("002"); + + HttpPut httpPost = new HttpPut("http://localhost:" + ourPort + "/Patient?_id=001"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info("Response was:\n{}", responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertEquals("Patient?_id=001",ourConditionalUrl); + assertEquals(null, ourId); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @Test + public void testUpdateMissingIdInBody() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpPut httpPost = new HttpPut("http://localhost:" + ourPort + "/Patient/001"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(400, status.getStatusLine().getStatusCode()); + + OperationOutcome oo = ourCtx.newXmlParser().parseResource(OperationOutcome.class, responseContent); + assertEquals("Can not update resource, resource body must contain an ID element for update (PUT) operation", oo.getIssue().get(0).getDiagnostics()); + } + + @Test + public void testUpdateNormal() throws Exception { + + Patient patient = new Patient(); + patient.setId("001"); + patient.addIdentifier().setValue("002"); + + HttpPut httpPost = new HttpPut("http://localhost:" + ourPort + "/Patient/001"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + CloseableHttpResponse status = ourClient.execute(httpPost); + try { + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info("Response was:\n{}", responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertNull(ourConditionalUrl); + assertEquals("Patient/001", ourId.getValue()); + } finally { + IOUtils.closeQuietly(status.getEntity().getContent()); + } + + } + + @Test + public void testUpdateWrongIdInBody() throws Exception { + + Patient patient = new Patient(); + patient.setId("Patient/3/_history/4"); + patient.addIdentifier().setValue("002"); + + HttpPut httpPost = new HttpPut("http://localhost:" + ourPort + "/Patient/1/_history/2"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(400, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("Resource body ID of "3" does not match")); + } + + @AfterClass + public static void afterClassClearContext() throws Exception { + ourServer.stop(); + TestUtil.clearAllStaticFieldsForUnitTest(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(new PatientProvider()); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Update() + public MethodOutcome updatePatient(@IdParam IdType theId, @ResourceParam Patient thePatient, @ConditionalUrlParam String theConditionalUrl) { + ourId = theId; + ourConditionalUrl = theConditionalUrl; + IdType id = theId != null ? theId.withVersion(thePatient.getIdentifier().get(0).getValue()) : new IdType("Patient/1"); + OperationOutcome oo = new OperationOutcome(); + oo.addIssue().setDiagnostics("OODETAILS"); + if (id.getValueAsString().contains("CREATE")) { + return new MethodOutcome(id, oo, true); + } + + return new MethodOutcome(id, oo); + } + + } +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ValidateDstu3Test.java b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ValidateDstu3Test.java new file mode 100644 index 00000000000..0afa2b2d47b --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/java/ca/uhn/fhir/rest/server/ValidateDstu3Test.java @@ -0,0 +1,321 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.dstu2016may.model.CodeType; +import org.hl7.fhir.dstu2016may.model.IdType; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; +import org.hl7.fhir.dstu2016may.model.Organization; +import org.hl7.fhir.dstu2016may.model.Parameters; +import org.hl7.fhir.dstu2016may.model.Patient; +import org.hl7.fhir.dstu2016may.model.StringType; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Validate; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.api.ValidationModeEnum; +import ca.uhn.fhir.util.PortUtil; +import ca.uhn.fhir.util.TestUtil; + +public class ValidateDstu3Test { + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2_1(); + private static EncodingEnum ourLastEncoding; + private static IdType ourLastId; + private static ValidationModeEnum ourLastMode; + public static Patient ourLastPatient; + private static String ourLastProfile; + private static String ourLastResourceBody; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ValidateDstu3Test.class); + private static OperationOutcome ourOutcomeToReturn; + private static int ourPort; + + private static Server ourServer; + + @Before() + public void before() { + ourLastResourceBody = null; + ourLastEncoding = null; + ourOutcomeToReturn = null; + ourLastMode = null; + ourLastProfile = null; + } + + @Test + public void testValidate() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("001"); + patient.addIdentifier().setValue("002"); + + Parameters params = new Parameters(); + params.addParameter().setName("resource").setResource(patient); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$validate"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(params), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + String resp = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertThat(resp, stringContainsInOrder(" getResourceType() { + return Organization.class; + } + + @Validate() + public MethodOutcome validate(@ResourceParam String theResourceBody, @ResourceParam EncodingEnum theEncoding) { + ourLastResourceBody = theResourceBody; + ourLastEncoding = theEncoding; + + return new MethodOutcome(new IdType("001")); + } + + } + + public static class PatientProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Validate() + public MethodOutcome validatePatient(@ResourceParam Patient thePatient, @IdParam(optional=true) IdType theId, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile) { + + ourLastPatient = thePatient; + ourLastId = theId; + IdType id; + if (thePatient != null) { + id = new IdType(thePatient.getIdentifier().get(0).getValue()); + if (thePatient.getIdElement().isEmpty() == false) { + id = thePatient.getIdElement(); + } + } else { + id = new IdType("1"); + } + ourLastMode = theMode; + ourLastProfile = theProfile; + + MethodOutcome outcome = new MethodOutcome(id.withVersion("002")); + outcome.setOperationOutcome(ourOutcomeToReturn); + return outcome; + } + + } + +} diff --git a/hapi-fhir-structures-dstu2.1/src/test/resources/.keep b/hapi-fhir-structures-dstu2.1/src/test/resources/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-structures-dstu2.1/src/test/resources/logback-test.xml b/hapi-fhir-structures-dstu2.1/src/test/resources/logback-test.xml new file mode 100644 index 00000000000..e5cbbb9c22e --- /dev/null +++ b/hapi-fhir-structures-dstu2.1/src/test/resources/logback-test.xml @@ -0,0 +1,30 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] - %msg%n + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/conformance/ProfileUtilities.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/conformance/ProfileUtilities.java index 68acbd3b4ee..97d7c2d3c50 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/conformance/ProfileUtilities.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/conformance/ProfileUtilities.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.dstu3.conformance.ProfileUtilities.ProfileKnowledgeProvider.BindingResolution; import org.hl7.fhir.dstu3.context.IWorkerContext; import org.hl7.fhir.dstu3.elementmodel.ObjectConverter; @@ -23,8 +24,10 @@ import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.Element; import org.hl7.fhir.dstu3.model.ElementDefinition; import org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode; +import org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionBaseComponent; import org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionBindingComponent; import org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionConstraintComponent; +import org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionExampleComponent; import org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent; import org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent; import org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules; @@ -51,6 +54,7 @@ import org.hl7.fhir.dstu3.model.ValueSet; import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent; import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent; import org.hl7.fhir.dstu3.terminologies.ValueSetExpander.ValueSetExpansionOutcome; +import org.hl7.fhir.dstu3.utils.NarrativeGenerator; import org.hl7.fhir.dstu3.utils.ToolingExtensions; import org.hl7.fhir.dstu3.validation.ValidationMessage; import org.hl7.fhir.dstu3.validation.ValidationMessage.Source; @@ -502,10 +506,10 @@ public class ProfileUtilities { boolean isExtension = cpath.endsWith(".extension") || cpath.endsWith(".modifierExtension"); if (diffMatches.get(0).hasSlicing()) { // it might be null if the differential doesn't want to say anything about slicing if (!isExtension) - diffpos++; // if there's a slice on the first, we'll ignore any content it has + diffpos++; // if there's a slice on the first, we'll ignore any content it has ElementDefinitionSlicingComponent dSlice = diffMatches.get(0).getSlicing(); ElementDefinitionSlicingComponent bSlice = currentBase.getSlicing(); - if (!orderMatches(dSlice.getOrderedElement(), bSlice.getOrderedElement())) + if (dSlice.hasOrderedElement() && bSlice.hasOrderedElement() && !orderMatches(dSlice.getOrderedElement(), bSlice.getOrderedElement())) throw new DefinitionException("Slicing rules on differential ("+summariseSlicing(dSlice)+") do not match those on base ("+summariseSlicing(bSlice)+") - order @ "+path+" ("+contextName+")"); if (!discriminatorMatches(dSlice.getDiscriminator(), bSlice.getDiscriminator())) throw new DefinitionException("Slicing rules on differential ("+summariseSlicing(dSlice)+") do not match those on base ("+summariseSlicing(bSlice)+") - disciminator @ "+path+" ("+contextName+")"); @@ -519,8 +523,11 @@ public class ProfileUtilities { updateFromSlicing(outcome.getSlicing(), diffMatches.get(0).getSlicing()); updateFromDefinition(outcome, diffMatches.get(0), profileName, closed, url); // if there's no slice, we don't want to update the unsliced description } - if (diffMatches.get(0).hasSlicing() && !diffMatches.get(0).hasSliceName()) - diffpos++; + if (diffMatches.get(0).hasSlicing() && !diffMatches.get(0).hasSliceName()) { + if (isExtension) + diffpos++; +// throw new Error("fhir diffpos++ at "+diffpos); + } result.getElement().add(outcome); @@ -569,7 +576,7 @@ public class ProfileUtilities { for (ElementDefinition baseItem : baseMatches) if (baseItem.getSliceName().equals(diffItem.getSliceName())) throw new DefinitionException("Named items are out of order in the slice"); - outcome = updateURLs(url, original.copy()); + outcome = updateURLs(url, diffItem.copy()); outcome.setPath(fixedPath(contextPathDst, outcome.getPath())); updateFromBase(outcome, currentBase); outcome.setSlicing(null); @@ -579,7 +586,7 @@ public class ProfileUtilities { updateFromDefinition(outcome, diffItem, profileName, trimDifferential, url); // --- LM Added this diffCursor = differential.getElement().indexOf(diffItem)+1; - if ((outcome.getType().get(0).getCode().equals("Extension") || differential.getElement().size() > diffCursor) && outcome.getPath().contains(".") && isDataType(outcome.getType())) { // don't want to do this for the root, since that's base, and we're already processing it + if (!outcome.getType().isEmpty() && (outcome.getType().get(0).getCode().equals("Extension") || differential.getElement().size() > diffCursor) && outcome.getPath().contains(".") && isDataType(outcome.getType())) { // don't want to do this for the root, since that's base, and we're already processing it if (!baseWalksInto(base.getElement(), baseCursor)) { if (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath()+".")) { if (outcome.getType().size() > 1) @@ -599,11 +606,10 @@ public class ProfileUtilities { for (ElementDefinition extEd : dt.getSnapshot().getElement()) { ElementDefinition extUrlEd = updateURLs(url, extEd.copy()); extUrlEd.setPath(fixedPath(contextPathDst, extUrlEd.getPath())); - updateFromBase(extUrlEd, currentBase); +// updateFromBase(extUrlEd, currentBase); markDerived(extUrlEd); result.getElement().add(extUrlEd); - } - + } } } } @@ -613,6 +619,13 @@ public class ProfileUtilities { } } } + + int i = 0; + for (ElementDefinition e : result.getElement()) { + i++; + if (e.hasMinElement() && e.getMinElement().getValue()==null) + throw new Error("null min"); + } } @@ -729,10 +742,14 @@ public class ProfileUtilities { private void updateFromBase(ElementDefinition derived, ElementDefinition base) { if (base.hasBase()) { + if (!derived.hasBase()) + derived.setBase(new ElementDefinitionBaseComponent()); derived.getBase().setPath(base.getBase().getPath()); derived.getBase().setMin(base.getBase().getMin()); derived.getBase().setMax(base.getBase().getMax()); } else { + if (!derived.hasBase()) + derived.setBase(new ElementDefinitionBaseComponent()); derived.getBase().setPath(base.getPath()); derived.getBase().setMin(base.getMin()); derived.getBase().setMax(base.getMax()); @@ -952,8 +969,10 @@ public class ProfileUtilities { ElementDefinition e = profile.getSnapshot().getElement().get(0); base.setDefinition(e.getDefinition()); base.setShort(e.getShort()); - base.setCommentsElement(e.getCommentsElement()); - base.setRequirementsElement(e.getRequirementsElement()); + if (e.hasCommentsElement()) + base.setCommentsElement(e.getCommentsElement()); + if (e.hasRequirementsElement()) + base.setRequirementsElement(e.getRequirementsElement()); base.getAlias().clear(); base.getAlias().addAll(e.getAlias()); base.getMapping().clear(); @@ -990,7 +1009,7 @@ public class ProfileUtilities { if (derived.hasCommentsElement()) { if (derived.getComments().startsWith("...")) base.setComments(base.getComments()+"\r\n"+derived.getComments().substring(3)); - else if (!Base.compareDeep(derived.getCommentsElement(), base.getCommentsElement(), false)) + else if (derived.hasCommentsElement()!= base.hasCommentsElement() || !Base.compareDeep(derived.getCommentsElement(), base.getCommentsElement(), false)) base.setCommentsElement(derived.getCommentsElement().copy()); else if (trimDifferential) base.setCommentsElement(derived.getCommentsElement().copy()); @@ -1001,7 +1020,7 @@ public class ProfileUtilities { if (derived.hasLabelElement()) { if (derived.getLabel().startsWith("...")) base.setLabel(base.getLabel()+"\r\n"+derived.getLabel().substring(3)); - else if (!Base.compareDeep(derived.getLabelElement(), base.getLabelElement(), false)) + else if (!base.hasLabelElement() || !Base.compareDeep(derived.getLabelElement(), base.getLabelElement(), false)) base.setLabelElement(derived.getLabelElement().copy()); else if (trimDifferential) base.setLabelElement(derived.getLabelElement().copy()); @@ -1012,7 +1031,7 @@ public class ProfileUtilities { if (derived.hasRequirementsElement()) { if (derived.getRequirements().startsWith("...")) base.setRequirements(base.getRequirements()+"\r\n"+derived.getRequirements().substring(3)); - else if (!Base.compareDeep(derived.getRequirementsElement(), base.getRequirementsElement(), false)) + else if (!base.hasRequirementsElement() || !Base.compareDeep(derived.getRequirementsElement(), base.getRequirementsElement(), false)) base.setRequirementsElement(derived.getRequirementsElement().copy()); else if (trimDifferential) base.setRequirementsElement(derived.getRequirementsElement().copy()); @@ -1079,13 +1098,17 @@ public class ProfileUtilities { derived.getPattern().setUserData(DERIVATION_EQUALS, true); } - if (derived.hasExample()) { - if (!Base.compareDeep(derived.getExample(), base.getExample(), false)) - base.setExample(derived.getExample().copy()); + for (ElementDefinitionExampleComponent ex : derived.getExample()) { + boolean found = false; + for (ElementDefinitionExampleComponent exS : base.getExample()) + if (Base.compareDeep(ex, exS, false)) + found = true; + if (!found) + base.addExample(ex.copy()); else if (trimDifferential) - derived.setExample(null); + derived.getExample().remove(ex); else - derived.getExample().setUserData(DERIVATION_EQUALS, true); + ex.setUserData(DERIVATION_EQUALS, true); } if (derived.hasMaxLengthElement()) { @@ -1101,7 +1124,7 @@ public class ProfileUtilities { // condition : id 0..* if (derived.hasMustSupportElement()) { - if (!Base.compareDeep(derived.getMustSupportElement(), base.getMustSupportElement(), false)) + if (!(base.hasMustSupportElement() && Base.compareDeep(derived.getMustSupportElement(), base.getMustSupportElement(), false))) base.setMustSupportElement(derived.getMustSupportElement().copy()); else if (trimDifferential) derived.setMustSupportElement(null); @@ -1113,16 +1136,16 @@ public class ProfileUtilities { // profiles cannot change : isModifier, defaultValue, meaningWhenMissing // but extensions can change isModifier if (isExtension) { - if (!Base.compareDeep(derived.getIsModifierElement(), base.getIsModifierElement(), false)) + if (derived.hasIsModifierElement() && !(base.hasIsModifierElement() && Base.compareDeep(derived.getIsModifierElement(), base.getIsModifierElement(), false))) base.setIsModifierElement(derived.getIsModifierElement().copy()); else if (trimDifferential) derived.setIsModifierElement(null); - else + else if (derived.hasIsModifierElement()) derived.getIsModifierElement().setUserData(DERIVATION_EQUALS, true); } if (derived.hasBinding()) { - if (!Base.compareDeep(derived.getBinding(), base.getBinding(), false)) { + if (!base.hasBinding() || !Base.compareDeep(derived.getBinding(), base.getBinding(), false)) { if (base.hasBinding() && base.getBinding().getStrength() == BindingStrength.REQUIRED && derived.getBinding().getStrength() != BindingStrength.REQUIRED) messages.add(new ValidationMessage(Source.ProfileValidator, IssueType.BUSINESSRULE, pn+"."+derived.getPath(), "illegal attempt to change the binding on "+derived.getPath()+" from "+base.getBinding().getStrength().toCode()+" to "+derived.getBinding().getStrength().toCode(), IssueSeverity.ERROR)); // throw new DefinitionException("StructureDefinition "+pn+" at "+derived.getPath()+": illegal attempt to change a binding from "+base.getBinding().getStrength().toCode()+" to "+derived.getBinding().getStrength().toCode()); @@ -1159,7 +1182,7 @@ public class ProfileUtilities { for (TypeRefComponent ts : derived.getType()) { boolean ok = false; CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); - for (TypeRefComponent td : base.getType()) { + for (TypeRefComponent td : base.getType()) {; b.append(td.getCode()); if (td.hasCode() && (td.getCode().equals(ts.getCode()) || td.getCode().equals("Extension") || td.getCode().equals("Element") || td.getCode().equals("*") || @@ -1216,6 +1239,10 @@ public class ProfileUtilities { } } + // now, check that we still have a bindable type; if not, delete the binding - see task 8477 + if (dest.hasBinding() && !hasBindableType(dest)) + dest.setBinding(null); + // finally, we copy any extensions from source to dest for (Extension ex : base.getExtension()) { StructureDefinition sd = context.fetchResource(StructureDefinition.class, ex.getUrl()); @@ -1226,6 +1253,15 @@ public class ProfileUtilities { } } + private boolean hasBindableType(ElementDefinition ed) { + for (TypeRefComponent tr : ed.getType()) { + if (Utilities.existsInList(tr.getCode(), "Coding", "CodeableConcept", "Quantity", "url", "string", "code")) + return true; + } + return false; + } + + private boolean isLargerMax(String derived, String base) { if ("*".equals(base)) return false; @@ -1414,7 +1450,7 @@ public class ProfileUtilities { try { - return gen.generate(model, corePath); + return gen.generate(model, corePath, 0); } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e.getMessage(), e); } @@ -1651,13 +1687,17 @@ public class ProfileUtilities { StringType max = !hasDef ? new StringType() : definition.hasMaxElement() ? definition.getMaxElement() : new StringType(); if (min.isEmpty() && definition.getUserData(DERIVATION_POINTER) != null) { ElementDefinition base = (ElementDefinition) definition.getUserData(DERIVATION_POINTER); - min = base.getMinElement().copy(); - min.setUserData(DERIVATION_EQUALS, true); + if (base.hasMinElement()) { + min = base.getMinElement().copy(); + min.setUserData(DERIVATION_EQUALS, true); + } } if (max.isEmpty() && definition.getUserData(DERIVATION_POINTER) != null) { ElementDefinition base = (ElementDefinition) definition.getUserData(DERIVATION_POINTER); - max = base.getMaxElement().copy(); - max.setUserData(DERIVATION_EQUALS, true); + if (base.hasMaxElement()) { + max = base.getMaxElement().copy(); + max.setUserData(DERIVATION_EQUALS, true); + } } if (min.isEmpty() && fallback != null) min = fallback.getMinElement(); @@ -1700,12 +1740,28 @@ public class ProfileUtilities { profiles.add(profile); genElement(defFile == null ? null : defFile+"#", gen, model.getRows(), list.get(0), list, profiles, diff, profileBaseFileName, null, snapshot, corePath, imagePath, true, logicalModel, profile.getDerivation() == TypeDerivationRule.CONSTRAINT && usesMustSupport(list), allInvariants); try { - return gen.generate(model, imagePath); + return gen.generate(model, imagePath, 0); } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e.getMessage(), e); } } + + public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath) throws IOException, FHIRException { + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics); + TableModel model = gen.initGridTable(corePath); + List list = profile.getSnapshot().getElement(); + List profiles = new ArrayList(); + profiles.add(profile); + genGridElement(defFile == null ? null : defFile+"#", gen, model.getRows(), list.get(0), list, profiles, true, profileBaseFileName, null, corePath, imagePath, true, profile.getDerivation() == TypeDerivationRule.CONSTRAINT && usesMustSupport(list)); + try { + return gen.generate(model, imagePath, 1); + } catch (org.hl7.fhir.exceptions.FHIRException e) { + throw new FHIRException(e.getMessage(), e); + } + } + + private boolean usesMustSupport(List list) { for (ElementDefinition ed : list) if (ed.hasMustSupport() && ed.getMustSupport()) @@ -1843,6 +1899,59 @@ public class ProfileUtilities { } } + private void genGridElement(String defPath, HierarchicalTableGenerator gen, List rows, ElementDefinition element, List all, List profiles, boolean showMissing, String profileBaseFileName, Boolean extensions, String corePath, String imagePath, boolean root, boolean isConstraintMode) throws IOException { + StructureDefinition profile = profiles == null ? null : profiles.get(profiles.size()-1); + String s = tail(element.getPath()); + List children = getChildren(all, element); + boolean isExtension = (s.equals("extension") || s.equals("modifierExtension")); + + if (!onlyInformationIsMapping(all, element)) { + Row row = gen.new Row(); + row.setAnchor(element.getPath()); + row.setColor(getRowColor(element, isConstraintMode)); + boolean hasDef = element != null; + String ref = defPath == null ? null : defPath + element.getId(); + UnusedTracker used = new UnusedTracker(); + used.used = true; + Cell left = gen.new Cell(); + if (element.getType().size() == 1 && element.getType().get(0).isPrimitive()) + left.getPieces().add(gen.new Piece(ref, "\u00A0\u00A0" + s, !hasDef ? null : element.getDefinition()).addStyle("font-weight:bold")); + else + left.getPieces().add(gen.new Piece(ref, "\u00A0\u00A0" + s, !hasDef ? null : element.getDefinition())); + if (element.hasSliceName()) { + left.getPieces().add(gen.new Piece("br")); + String indent = StringUtils.repeat('\u00A0', 1+2*(element.getPath().split("\\.").length)); + left.getPieces().add(gen.new Piece(null, indent + "("+element.getSliceName() + ")", null)); + } + row.getCells().add(left); + + ExtensionContext extDefn = null; + genCardinality(gen, element, row, hasDef, used, null); + if (hasDef && !"0".equals(element.getMax())) + genTypes(gen, row, element, profileBaseFileName, profile, corePath, imagePath); + else + row.getCells().add(gen.new Cell()); + generateGridDescription(gen, row, element, null, used.used, null, null, profile, corePath, imagePath, root, null); +/* if (element.hasSlicing()) { + if (standardExtensionSlicing(element)) { + used.used = element.hasType() && element.getType().get(0).hasProfile(); + showMissing = false; + } else { + row.setIcon("icon_slice.png", HierarchicalTableGenerator.TEXT_ICON_SLICE); + row.getCells().get(2).getPieces().clear(); + for (Cell cell : row.getCells()) + for (Piece p : cell.getPieces()) { + p.addStyle("font-style: italic"); + } + } + }*/ + rows.add(row); + for (ElementDefinition child : children) + if (child.getMustSupport()) + genGridElement(defPath, gen, row.getSubRows(), child, all, profiles, showMissing, profileBaseFileName, isExtension, corePath, imagePath, false, isConstraintMode); + } + } + private ExtensionContext locateExtension(Class class1, String value) { if (value.contains("#")) { @@ -1986,7 +2095,7 @@ public class ProfileUtilities { ElementDefinitionBindingComponent binding = null; if (valueDefn != null && valueDefn.hasBinding() && !valueDefn.getBinding().isEmpty()) binding = valueDefn.getBinding(); - else + else if (definition.hasBinding()) binding = definition.getBinding(); if (binding!=null && !binding.isEmpty()) { if (!c.getPieces().isEmpty()) @@ -2016,9 +2125,11 @@ public class ProfileUtilities { c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, "Required Pattern: ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, buildJson(definition.getPattern()), null).addStyle("color: darkgreen"))); } else if (definition.hasExample()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - c.getPieces().add(checkForNoChange(definition.getExample(), gen.new Piece(null, "Example: ", null).addStyle("font-weight:bold"))); - c.getPieces().add(checkForNoChange(definition.getExample(), gen.new Piece(null, buildJson(definition.getExample()), null).addStyle("color: darkgreen"))); + for (ElementDefinitionExampleComponent ex : definition.getExample()) { + if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, "Example'"+("".equals("General")? "" : " "+ex.getLabel()+"'")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, buildJson(ex.getValue()), null).addStyle("color: darkgreen"))); + } } if (profile != null) { for (StructureDefinitionMappingComponent md : profile.getMapping()) { @@ -2042,6 +2153,122 @@ public class ProfileUtilities { return c; } + private Cell generateGridDescription(HierarchicalTableGenerator gen, Row row, ElementDefinition definition, ElementDefinition fallback, boolean used, String baseURL, String url, StructureDefinition profile, String corePath, String imagePath, boolean root, ElementDefinition valueDefn) throws IOException { + Cell c = gen.new Cell(); + row.getCells().add(c); + + if (used) { + if (definition.hasContentReference()) { + ElementDefinition ed = getElementByName(profile.getSnapshot().getElement(), definition.getContentReference()); + if (ed == null) + c.getPieces().add(gen.new Piece(null, "Unknown reference to "+definition.getContentReference(), null)); + else + c.getPieces().add(gen.new Piece("#"+ed.getPath(), "See "+ed.getPath(), null)); + } + if (definition.getPath().endsWith("url") && definition.hasFixed()) { + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "\""+buildJson(definition.getFixed())+"\"", null).addStyle("color: darkgreen"))); + } else { + if (url != null) { + if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); + String fullUrl = url.startsWith("#") ? baseURL+url : url; + StructureDefinition ed = context.fetchResource(StructureDefinition.class, url); + String ref = null; + if (ed != null) { + String p = ed.getUserString("path"); + if (p != null) { + ref = p.startsWith("http:") || igmode ? p : Utilities.pathReverse(corePath, p); + } + } + c.getPieces().add(gen.new Piece(null, "URL: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(ref, fullUrl, null)); + } + + if (definition.hasSlicing()) { + if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); + c.getPieces().add(gen.new Piece(null, "Slice: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, describeSlice(definition.getSlicing()), null)); + } + if (definition != null) { + ElementDefinitionBindingComponent binding = null; + if (valueDefn != null && valueDefn.hasBinding() && !valueDefn.getBinding().isEmpty()) + binding = valueDefn.getBinding(); + else if (definition.hasBinding()) + binding = definition.getBinding(); + if (binding!=null && !binding.isEmpty()) { + if (!c.getPieces().isEmpty()) + c.addPiece(gen.new Piece("br")); + BindingResolution br = pkp.resolveBinding(profile, binding, definition.getPath()); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, "Binding: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !pkp.prependLinks() ? br.url : corePath+br.url, br.display, null))); + if (binding.hasStrength()) { + c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, " (", null))); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(corePath+"terminologies.html#"+binding.getStrength().toCode(), binding.getStrength().toCode(), binding.getStrength().getDefinition()))); c.getPieces().add(gen.new Piece(null, ")", null)); + } + } + for (ElementDefinitionConstraintComponent inv : definition.getConstraint()) { + if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); + c.getPieces().add(checkForNoChange(inv, gen.new Piece(null, inv.getKey()+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(inv, gen.new Piece(null, inv.getHuman(), null))); + } + if (definition.hasFixed()) { + if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, buildJson(definition.getFixed()), null).addStyle("color: darkgreen"))); + } else if (definition.hasPattern()) { + if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, "Required Pattern: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, buildJson(definition.getPattern()), null).addStyle("color: darkgreen"))); + } else if (definition.hasExample()) { + for (ElementDefinitionExampleComponent ex : definition.getExample()) { + if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, "Example'"+("".equals("General")? "" : " "+ex.getLabel()+"'")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, buildJson(ex.getValue()), null).addStyle("color: darkgreen"))); + } + } + if (profile != null) { + for (StructureDefinitionMappingComponent md : profile.getMapping()) { + if (md.hasExtension(ToolingExtensions.EXT_TABLE_NAME)) { + ElementDefinitionMappingComponent map = null; + for (ElementDefinitionMappingComponent m : definition.getMapping()) + if (m.getIdentity().equals(md.getIdentity())) + map = m; + if (map != null) { + for (int i = 0; i markdownToPieces(String markdown) throws FHIRException { + String htmlString = Processor.process(markdown); + XhtmlParser parser = new XhtmlParser(); + try { + XhtmlNode node = parser.parseFragment(htmlString); + return htmlToPieces(node); + } catch (IOException e) { + } + return null; + } + + private List htmlToPieces(XhtmlNode n) { + + }*/ + private String buildJson(Type value) throws IOException { if (value instanceof PrimitiveType) return ((PrimitiveType) value).asStringValue(); @@ -2145,16 +2372,16 @@ public class ProfileUtilities { public StructureDefinition getProfile(StructureDefinition source, String url) { - StructureDefinition profile; - String code; + StructureDefinition profile = null; + String code = null; if (url.startsWith("#")) { profile = source; code = url.substring(1); - } else { + } else if (context != null) { String[] parts = url.split("\\#"); profile = context.fetchResource(StructureDefinition.class, parts[0]); code = parts.length == 1 ? null : parts[1]; - } + } if (profile == null) return null; if (code == null) @@ -2270,6 +2497,8 @@ public class ProfileUtilities { final List diffList = diff.getDifferential().getElement(); // first, we move the differential elements into a tree + if (diffList.isEmpty()) + return; ElementDefinitionHolder edh = new ElementDefinitionHolder(diffList.get(0)); boolean hasSlicing = false; @@ -2419,6 +2648,7 @@ public class ProfileUtilities { } + private class Slicer extends ElementDefinitionSlicingComponent { String criteria = ""; String name = ""; @@ -2433,7 +2663,7 @@ public class ProfileUtilities { // given a child in a structure, it's sliced. figure out the slicing xpath if (child.getPath().endsWith(".extension")) { ElementDefinition ued = getUrlFor(structure, child); - if ((ued == null || !ued.hasFixed()) && !(child.getType().get(0).hasProfile())) + if ((ued == null || !ued.hasFixed()) && !(child.hasType() && (child.getType().get(0).hasProfile()))) return new Slicer(false); else { Slicer s = new Slicer(true); @@ -2461,7 +2691,7 @@ public class ProfileUtilities { ElementDefinition based = getByPath(base, child.getPath()); boolean doMin = (child.getMin() > 0) && (based == null || (child.getMin() != based.getMin())); - boolean doMax = !child.getMax().equals("*") && (based == null || (!child.getMax().equals(based.getMax()))); + boolean doMax = child.hasMax() && !child.getMax().equals("*") && (based == null || (!child.getMax().equals(based.getMax()))); Slicer slicer = slicing == null ? new Slicer(true) : generateSlicer(child, slicing, structure); if (slicer.check) { if (doMin || doMax) { @@ -2502,10 +2732,16 @@ public class ProfileUtilities { public void setIds(StructureDefinition sd, boolean checkFirst) throws DefinitionException { - if (!checkFirst || hasMissingIds(sd.getDifferential().getElement())) + if (!checkFirst || !sd.hasDifferential() || hasMissingIds(sd.getDifferential().getElement())) { + if (!sd.hasDifferential()) + sd.setDifferential(new StructureDefinitionDifferentialComponent()); generateIds(sd.getDifferential().getElement(), sd.getName()); - if (!checkFirst || hasMissingIds(sd.getSnapshot().getElement())) - generateIds(sd.getSnapshot().getElement(), sd.getName()); + } + if (!checkFirst || !sd.hasSnapshot() || hasMissingIds(sd.getSnapshot().getElement())) { + if (!sd.hasSnapshot()) + sd.setSnapshot(new StructureDefinitionSnapshotComponent()); + generateIds(sd.getSnapshot().getElement(), sd.getName()); + } } @@ -2613,8 +2849,10 @@ public class ProfileUtilities { public Type getExampleValue(ElementDefinition ed) { if (ed.hasFixed()) return ed.getFixed(); + if (ed.hasExample()) + return ed.getExample().get(0).getValue(); else - return ed.getExample(); + return null; } @Override @@ -2905,7 +3143,7 @@ public class ProfileUtilities { SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix); genSpanEntry(gen, model.getRows(), span); - return gen.generate(model, ""); + return gen.generate(model, "", 0); } private SpanEntry buildSpanningTable(String name, String cardinality, StructureDefinition profile, Set processed, boolean onlyConstraints, String constraintPrefix) throws IOException { @@ -2937,7 +3175,7 @@ public class ProfileUtilities { private String getCardinality(ElementDefinition ed, List list) { int min = ed.getMin(); - int max = ed.getMax().equals("*") ? Integer.MAX_VALUE : Integer.parseInt(ed.getMax()); + int max = !ed.hasMax() || ed.getMax().equals("*") ? Integer.MAX_VALUE : Integer.parseInt(ed.getMax()); while (ed != null && ed.getPath().contains(".")) { ed = findParent(ed, list); if (ed.getMax().equals("0")) @@ -3030,7 +3268,7 @@ public class ProfileUtilities { private String summariseCoding(Coding value) { String uri = value.getSystem(); - String system = (uri); + String system = NarrativeGenerator.describeSystem(uri); if (Utilities.isURL(system)) { if (system.equals("http://cap.org/protocols")) system = "CAP Code"; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/JsonParser.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/JsonParser.java index ad91c46e4ec..b2508b4209b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/JsonParser.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/JsonParser.java @@ -5,13 +5,17 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.math.BigDecimal; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Set; +import org.hl7.fhir.dstu3.context.IWorkerContext; import org.hl7.fhir.dstu3.elementmodel.Element.SpecialElement; -import org.hl7.fhir.exceptions.DefinitionException; -import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.dstu3.formats.IParser.OutputStyle; +import org.hl7.fhir.dstu3.formats.FormatUtilities; import org.hl7.fhir.dstu3.formats.JsonCreator; import org.hl7.fhir.dstu3.formats.JsonCreatorCanonical; import org.hl7.fhir.dstu3.formats.JsonCreatorGson; @@ -19,14 +23,19 @@ import org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent; import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity; import org.hl7.fhir.dstu3.model.OperationOutcome.IssueType; import org.hl7.fhir.dstu3.model.StructureDefinition; -import org.hl7.fhir.dstu3.context.IWorkerContext; -import org.hl7.fhir.dstu3.utils.JsonTrackingParser; -import org.hl7.fhir.dstu3.utils.JsonTrackingParser.LocationData; +import org.hl7.fhir.dstu3.utils.formats.JsonTrackingParser; +import org.hl7.fhir.dstu3.utils.formats.JsonTrackingParser.LocationData; +import org.hl7.fhir.exceptions.DefinitionException; +import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.xhtml.XhtmlParser; -import com.google.gson.*; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonNull; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; public class JsonParser extends ParserBase { @@ -37,17 +46,50 @@ public class JsonParser extends ParserBase { super(context); } + public Element parse(String source, String type) throws Exception { + JsonObject obj = (JsonObject) new com.google.gson.JsonParser().parse(source); + String path = "/"+type; + StructureDefinition sd = getDefinition(-1, -1, type); + if (sd == null) + return null; + + Element result = new Element(type, new Property(context, sd.getSnapshot().getElement().get(0), sd)); + checkObject(obj, path); + result.setType(type); + parseChildren(path, obj, result, true); + result.numberChildren(); + return result; + } + + @Override - public Element parse(InputStream stream) { - throw new UnsupportedOperationException(); + public Element parse(InputStream stream) throws IOException, FHIRFormatError, DefinitionException { + // if we're parsing at this point, then we're going to use the custom parser + map = new HashMap(); + String source = TextFile.streamToString(stream); + if (policy == ValidationPolicy.EVERYTHING) { + JsonObject obj = null; + try { + obj = JsonTrackingParser.parse(source, map); + } catch (Exception e) { + logError(-1, -1, "(document)", IssueType.INVALID, "Error parsing JSON: "+e.getMessage(), IssueSeverity.FATAL); + return null; + } + assert (map.containsKey(obj)); + return parse(obj); + } else { + JsonObject obj = (JsonObject) new com.google.gson.JsonParser().parse(source); + assert (map.containsKey(obj)); + return parse(obj); + } } - public Element parse(JsonObject object, Map map) throws Exception { + public Element parse(JsonObject object, Map map) throws FHIRFormatError, DefinitionException { this.map = map; return parse(object); } - public Element parse(JsonObject object) throws Exception { + public Element parse(JsonObject object) throws FHIRFormatError, DefinitionException { JsonElement rt = object.get("resourceType"); if (rt == null) { logError(line(object), col(object), "$", IssueType.INVALID, "Unable to find resourceType property", IssueSeverity.FATAL); @@ -311,7 +353,7 @@ public class JsonParser extends ParserBase { this.json = json; json.beginObject(); - prop("resourceType", e.getType(), linkResolver == null ? null : linkResolver.resolveType(e.getType())); + prop("resourceType", e.getType(), linkResolver == null ? null : linkResolver.resolveProperty(e.getProperty())); Set done = new HashSet(); for (Element child : e.getChildren()) { compose(e.getName(), e, done, child); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/XmlParser.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/XmlParser.java index 43a4de1df94..243f91a0557 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/XmlParser.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/XmlParser.java @@ -14,8 +14,8 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.sax.SAXSource; +import org.hl7.fhir.dstu3.context.IWorkerContext; import org.hl7.fhir.dstu3.elementmodel.Element.SpecialElement; -import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.dstu3.formats.FormatUtilities; import org.hl7.fhir.dstu3.formats.IParser.OutputStyle; import org.hl7.fhir.dstu3.model.DateTimeType; @@ -24,11 +24,12 @@ import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity; import org.hl7.fhir.dstu3.model.OperationOutcome.IssueType; import org.hl7.fhir.dstu3.model.StructureDefinition; -import org.hl7.fhir.dstu3.context.IWorkerContext; import org.hl7.fhir.dstu3.utils.ToolingExtensions; -import org.hl7.fhir.dstu3.utils.XmlLocationAnnotator; -import org.hl7.fhir.dstu3.utils.XmlLocationData; +import org.hl7.fhir.dstu3.utils.formats.XmlLocationAnnotator; +import org.hl7.fhir.dstu3.utils.formats.XmlLocationData; +import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.xhtml.XhtmlComposer; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -58,7 +59,7 @@ public class XmlParser extends ParserBase { } - public Element parse(InputStream stream) throws Exception { + public Element parse(InputStream stream) throws FHIRFormatError, DefinitionException, FHIRException, IOException { Document doc = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); @@ -130,13 +131,13 @@ public class XmlParser extends ParserBase { return loc == null ? 0 : loc.getStartColumn(); } - public Element parse(Document doc) throws Exception { + public Element parse(Document doc) throws FHIRFormatError, DefinitionException, FHIRException, IOException { checkForProcessingInstruction(doc); org.w3c.dom.Element element = doc.getDocumentElement(); return parse(element); } - public Element parse(org.w3c.dom.Element element) throws Exception { + public Element parse(org.w3c.dom.Element element) throws FHIRFormatError, DefinitionException, FHIRException, IOException { String ns = element.getNamespaceURI(); String name = element.getLocalName(); String path = "/"+pathPrefix(ns)+name; @@ -209,7 +210,7 @@ public class XmlParser extends ParserBase { return result; } - private void parseChildren(String path, org.w3c.dom.Element node, Element context) throws Exception { + private void parseChildren(String path, org.w3c.dom.Element node, Element context) throws FHIRFormatError, FHIRException, IOException, DefinitionException { // this parsing routine retains the original order in a the XML file, to support validation reapComments(node, context); List properties = context.getProperty().getChildProperties(context.getName(), XMLUtil.getXsiType(node)); @@ -321,7 +322,7 @@ public class XmlParser extends ParserBase { throw new FHIRException("Unknown Data format '"+fmt+"'"); } - private void parseResource(String string, org.w3c.dom.Element container, Element parent, Property elementProperty) throws Exception { + private void parseResource(String string, org.w3c.dom.Element container, Element parent, Property elementProperty) throws FHIRFormatError, DefinitionException, FHIRException, IOException { org.w3c.dom.Element res = XMLUtil.getFirstChild(container); String name = res.getLocalName(); StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+name); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/formats/XmlParserBase.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/formats/XmlParserBase.java index aef72f3bd7c..decc2b3af48 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/formats/XmlParserBase.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/formats/XmlParserBase.java @@ -32,6 +32,9 @@ import java.io.*; import java.util.ArrayList; import java.util.List; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLStreamException; + import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.dstu3.model.*; import org.hl7.fhir.instance.model.api.IIdType; @@ -259,7 +262,7 @@ public abstract class XmlParserBase extends ParserBase implements IParser { throw new FHIRFormatError("Unknown Content "+xpp.getName()+" @ "+pathForLocation(xpp)); } - protected XhtmlNode parseXhtml(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError { + protected XhtmlNode parseXhtml(XMLEventReader xpp) throws IOException, FHIRFormatError, XMLStreamException { XhtmlParser prsr = new XhtmlParser(); try { return prsr.parseHtmlNode(xpp); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/fluentpath/FluentPathDstu3.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/fluentpath/FluentPathDstu3.java index 75219a42c1e..c07199589df 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/fluentpath/FluentPathDstu3.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/fluentpath/FluentPathDstu3.java @@ -5,7 +5,7 @@ import java.util.List; import org.hl7.fhir.dstu3.hapi.validation.HapiWorkerContext; import org.hl7.fhir.dstu3.hapi.validation.IValidationSupport; import org.hl7.fhir.dstu3.model.Base; -import org.hl7.fhir.dstu3.utils.FluentPathEngine; +import org.hl7.fhir.dstu3.utils.FHIRPathEngine; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.instance.model.api.IBase; @@ -15,14 +15,14 @@ import ca.uhn.fhir.fluentpath.IFluentPath; public class FluentPathDstu3 implements IFluentPath { - private FluentPathEngine myEngine; + private FHIRPathEngine myEngine; public FluentPathDstu3(FhirContext theCtx) { if (!(theCtx.getValidationSupport() instanceof IValidationSupport)) { throw new IllegalStateException("Validation support module configured on context appears to be for the wrong FHIR version- Does not extend " + IValidationSupport.class.getName()); } IValidationSupport validationSupport = (IValidationSupport) theCtx.getValidationSupport(); - myEngine = new FluentPathEngine(new HapiWorkerContext(theCtx, validationSupport)); + myEngine = new FHIRPathEngine(new HapiWorkerContext(theCtx, validationSupport)); } @SuppressWarnings("unchecked") diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProvider.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProvider.java index 1604313e83d..94b2fc6a199 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProvider.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProvider.java @@ -449,17 +449,18 @@ public class ServerCapabilityStatementProvider implements IServerConformanceProv CapabilityStatementRestResourceSearchParamComponent param = resource.addSearchParam(); param.setName(nextParamUnchainedName); - if (StringUtils.isNotBlank(chain)) { - param.addChain(chain); - } - - if (nextParameter.getParamType() == RestSearchParameterTypeEnum.REFERENCE) { - for (String nextWhitelist : new TreeSet(nextParameter.getQualifierWhitelist())) { - if (nextWhitelist.startsWith(".")) { - param.addChain(nextWhitelist.substring(1)); - } - } - } + +// if (StringUtils.isNotBlank(chain)) { +// param.addChain(chain); +// } +// +// if (nextParameter.getParamType() == RestSearchParameterTypeEnum.REFERENCE) { +// for (String nextWhitelist : new TreeSet(nextParameter.getQualifierWhitelist())) { +// if (nextWhitelist.startsWith(".")) { +// param.addChain(nextWhitelist.substring(1)); +// } +// } +// } param.setDocumentation(nextParamDescription); if (nextParameter.getParamType() != null) { @@ -474,9 +475,9 @@ public class ServerCapabilityStatementProvider implements IServerConformanceProv } catch (FHIRException e) { code = null; } - if (code != null) { - param.addTarget(targetDef.getName()); - } +// if (code != null) { +// param.addTarget(targetDef.getName()); +// } } } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Account.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Account.java index 08224b4760d..8075d98712e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Account.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Account.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -154,6 +154,275 @@ public class Account extends DomainResource { } } + @Block() + public static class GuarantorComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The entity who is responsible. + */ + @Child(name = "party", type = {Patient.class, RelatedPerson.class, Organization.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Responsible entity", formalDefinition="The entity who is responsible." ) + protected Reference party; + + /** + * The actual object that is the target of the reference (The entity who is responsible.) + */ + protected Resource partyTarget; + + /** + * A guarantor may be placed on credit hold or otherwise have their role temporarily suspended. + */ + @Child(name = "onHold", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Credit or other hold applied", formalDefinition="A guarantor may be placed on credit hold or otherwise have their role temporarily suspended." ) + protected BooleanType onHold; + + /** + * The timeframe during which the guarantor accepts responsibility for the account. + */ + @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Guarrantee account during", formalDefinition="The timeframe during which the guarantor accepts responsibility for the account." ) + protected Period period; + + private static final long serialVersionUID = -1012345396L; + + /** + * Constructor + */ + public GuarantorComponent() { + super(); + } + + /** + * Constructor + */ + public GuarantorComponent(Reference party) { + super(); + this.party = party; + } + + /** + * @return {@link #party} (The entity who is responsible.) + */ + public Reference getParty() { + if (this.party == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuarantorComponent.party"); + else if (Configuration.doAutoCreate()) + this.party = new Reference(); // cc + return this.party; + } + + public boolean hasParty() { + return this.party != null && !this.party.isEmpty(); + } + + /** + * @param value {@link #party} (The entity who is responsible.) + */ + public GuarantorComponent setParty(Reference value) { + this.party = value; + return this; + } + + /** + * @return {@link #party} 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 who is responsible.) + */ + public Resource getPartyTarget() { + return this.partyTarget; + } + + /** + * @param value {@link #party} 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 who is responsible.) + */ + public GuarantorComponent setPartyTarget(Resource value) { + this.partyTarget = value; + return this; + } + + /** + * @return {@link #onHold} (A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.). This is the underlying object with id, value and extensions. The accessor "getOnHold" gives direct access to the value + */ + public BooleanType getOnHoldElement() { + if (this.onHold == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuarantorComponent.onHold"); + else if (Configuration.doAutoCreate()) + this.onHold = new BooleanType(); // bb + return this.onHold; + } + + public boolean hasOnHoldElement() { + return this.onHold != null && !this.onHold.isEmpty(); + } + + public boolean hasOnHold() { + return this.onHold != null && !this.onHold.isEmpty(); + } + + /** + * @param value {@link #onHold} (A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.). This is the underlying object with id, value and extensions. The accessor "getOnHold" gives direct access to the value + */ + public GuarantorComponent setOnHoldElement(BooleanType value) { + this.onHold = value; + return this; + } + + /** + * @return A guarantor may be placed on credit hold or otherwise have their role temporarily suspended. + */ + public boolean getOnHold() { + return this.onHold == null || this.onHold.isEmpty() ? false : this.onHold.getValue(); + } + + /** + * @param value A guarantor may be placed on credit hold or otherwise have their role temporarily suspended. + */ + public GuarantorComponent setOnHold(boolean value) { + if (this.onHold == null) + this.onHold = new BooleanType(); + this.onHold.setValue(value); + return this; + } + + /** + * @return {@link #period} (The timeframe during which the guarantor accepts responsibility for the account.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GuarantorComponent.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The timeframe during which the guarantor accepts responsibility for the account.) + */ + public GuarantorComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("party", "Reference(Patient|RelatedPerson|Organization)", "The entity who is responsible.", 0, java.lang.Integer.MAX_VALUE, party)); + childrenList.add(new Property("onHold", "boolean", "A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.", 0, java.lang.Integer.MAX_VALUE, onHold)); + childrenList.add(new Property("period", "Period", "The timeframe during which the guarantor accepts responsibility for the account.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference + case -1013289154: /*onHold*/ return this.onHold == null ? new Base[0] : new Base[] {this.onHold}; // BooleanType + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 106437350: // party + this.party = castToReference(value); // Reference + break; + case -1013289154: // onHold + this.onHold = castToBoolean(value); // BooleanType + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("party")) + this.party = castToReference(value); // Reference + else if (name.equals("onHold")) + this.onHold = castToBoolean(value); // BooleanType + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 106437350: return getParty(); // Reference + case -1013289154: throw new FHIRException("Cannot make property onHold as it is not a complex type"); // BooleanType + case -991726143: return getPeriod(); // Period + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("party")) { + this.party = new Reference(); + return this.party; + } + else if (name.equals("onHold")) { + throw new FHIRException("Cannot call addChild on a primitive type Account.onHold"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else + return super.addChild(name); + } + + public GuarantorComponent copy() { + GuarantorComponent dst = new GuarantorComponent(); + copyValues(dst); + dst.party = party == null ? null : party.copy(); + dst.onHold = onHold == null ? null : onHold.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GuarantorComponent)) + return false; + GuarantorComponent o = (GuarantorComponent) other; + return compareDeep(party, o.party, true) && compareDeep(onHold, o.onHold, true) && compareDeep(period, o.period, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GuarantorComponent)) + return false; + GuarantorComponent o = (GuarantorComponent) other; + return compareValues(onHold, o.onHold, true); + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(party, onHold, period); + } + + public String fhirType() { + return "Account.guarantor"; + + } + + } + /** * Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number). */ @@ -259,7 +528,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc @Description(shortDefinition="Explanation of purpose/use", formalDefinition="Provides additional information about what the account tracks and how it is used." ) protected StringType description; - private static final long serialVersionUID = -143220425L; + /** + * Parties financially responsible for the account. + */ + @Child(name = "guarantor", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Responsible for the account", formalDefinition="Parties financially responsible for the account." ) + protected List guarantor; + + private static final long serialVersionUID = -124781610L; /** * Constructor @@ -750,6 +1026,59 @@ A coverage may only be resposible for specific types of charges, and the sequenc return this; } + /** + * @return {@link #guarantor} (Parties financially responsible for the account.) + */ + public List getGuarantor() { + if (this.guarantor == null) + this.guarantor = new ArrayList(); + return this.guarantor; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public Account setGuarantor(List theGuarantor) { + this.guarantor = theGuarantor; + return this; + } + + public boolean hasGuarantor() { + if (this.guarantor == null) + return false; + for (GuarantorComponent item : this.guarantor) + if (!item.isEmpty()) + return true; + return false; + } + + public GuarantorComponent addGuarantor() { //3 + GuarantorComponent t = new GuarantorComponent(); + if (this.guarantor == null) + this.guarantor = new ArrayList(); + this.guarantor.add(t); + return t; + } + + public Account addGuarantor(GuarantorComponent t) { //3 + if (t == null) + return this; + if (this.guarantor == null) + this.guarantor = new ArrayList(); + this.guarantor.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #guarantor}, creating it if it does not already exist + */ + public GuarantorComponent getGuarantorFirstRep() { + if (getGuarantor().isEmpty()) { + addGuarantor(); + } + return getGuarantor().get(0); + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number).", 0, java.lang.Integer.MAX_VALUE, identifier)); @@ -764,6 +1093,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc childrenList.add(new Property("subject", "Reference(Patient|Device|Practitioner|Location|HealthcareService|Organization)", "Identifies the patient, device, practitioner, location or other object the account is associated with.", 0, java.lang.Integer.MAX_VALUE, subject)); childrenList.add(new Property("owner", "Reference(Organization)", "Indicates the organization, department, etc. with responsibility for the account.", 0, java.lang.Integer.MAX_VALUE, owner)); childrenList.add(new Property("description", "string", "Provides additional information about what the account tracks and how it is used.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("guarantor", "", "Parties financially responsible for the account.", 0, java.lang.Integer.MAX_VALUE, guarantor)); } @Override @@ -781,6 +1111,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -188629045: /*guarantor*/ return this.guarantor == null ? new Base[0] : this.guarantor.toArray(new Base[this.guarantor.size()]); // GuarantorComponent default: return super.getProperty(hash, name, checkValid); } @@ -825,6 +1156,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc case -1724546052: // description this.description = castToString(value); // StringType break; + case -188629045: // guarantor + this.getGuarantor().add((GuarantorComponent) value); // GuarantorComponent + break; default: super.setProperty(hash, name, value); } @@ -856,6 +1190,8 @@ A coverage may only be resposible for specific types of charges, and the sequenc this.owner = castToReference(value); // Reference else if (name.equals("description")) this.description = castToString(value); // StringType + else if (name.equals("guarantor")) + this.getGuarantor().add((GuarantorComponent) value); else super.setProperty(name, value); } @@ -875,6 +1211,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc case -1867885268: return getSubject(); // Reference case 106164915: return getOwner(); // Reference case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -188629045: return addGuarantor(); // GuarantorComponent default: return super.makeProperty(hash, name); } @@ -925,6 +1262,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc else if (name.equals("description")) { throw new FHIRException("Cannot call addChild on a primitive type Account.description"); } + else if (name.equals("guarantor")) { + return addGuarantor(); + } else return super.addChild(name); } @@ -957,6 +1297,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc dst.subject = subject == null ? null : subject.copy(); dst.owner = owner == null ? null : owner.copy(); dst.description = description == null ? null : description.copy(); + if (guarantor != null) { + dst.guarantor = new ArrayList(); + for (GuarantorComponent i : guarantor) + dst.guarantor.add(i.copy()); + }; return dst; } @@ -975,7 +1320,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc && compareDeep(status, o.status, true) && compareDeep(active, o.active, true) && compareDeep(currency, o.currency, true) && compareDeep(balance, o.balance, true) && compareDeep(coverage, o.coverage, true) && compareDeep(coveragePeriod, o.coveragePeriod, true) && compareDeep(subject, o.subject, true) && compareDeep(owner, o.owner, true) && compareDeep(description, o.description, true) - ; + && compareDeep(guarantor, o.guarantor, true); } @Override @@ -992,7 +1337,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, type, status , active, currency, balance, coverage, coveragePeriod, subject, owner, description - ); + , guarantor); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ActivityDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ActivityDefinition.java index eefefd5f44b..a0cd654ea5a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ActivityDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ActivityDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -47,7 +47,7 @@ import org.hl7.fhir.exceptions.FHIRException; * This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. */ @ResourceDef(name="ActivityDefinition", profile="http://hl7.org/fhir/Profile/ActivityDefinition") -@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "publisher", "contact", "copyright", "relatedArtifact", "library", "category", "code", "timing[x]", "location", "participantType", "product[x]", "quantity", "dosageInstruction", "transform", "dynamicValue"}) +@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "publisher", "contact", "copyright", "relatedArtifact", "library", "category", "code", "timing[x]", "location", "participantType", "product[x]", "quantity", "dosageInstruction", "bodySite", "transform", "dynamicValue"}) public class ActivityDefinition extends MetadataResource { public enum ActivityDefinitionCategory { @@ -930,10 +930,18 @@ public class ActivityDefinition extends MetadataResource { @Description(shortDefinition="Detailed dosage instructions", formalDefinition="Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources." ) protected List dosageInstruction; + /** + * Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites). + */ + @Child(name = "bodySite", type = {CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="What part of body to perform on", formalDefinition="Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites)." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site") + protected List bodySite; + /** * A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input. */ - @Child(name = "transform", type = {StructureMap.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Child(name = "transform", type = {StructureMap.class}, order=20, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Transform to apply the template", formalDefinition="A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input." ) protected Reference transform; @@ -945,11 +953,11 @@ public class ActivityDefinition extends MetadataResource { /** * Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the intent resource that would contain the result. */ - @Child(name = "dynamicValue", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "dynamicValue", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Dynamic aspects of the definition", formalDefinition="Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the intent resource that would contain the result." ) protected List dynamicValue; - private static final long serialVersionUID = -1095058297L; + private static final long serialVersionUID = -199666299L; /** * Constructor @@ -2459,6 +2467,59 @@ public class ActivityDefinition extends MetadataResource { return getDosageInstruction().get(0); } + /** + * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ActivityDefinition setBodySite(List theBodySite) { + this.bodySite = theBodySite; + return this; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (CodeableConcept item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + public CodeableConcept addBodySite() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + public ActivityDefinition addBodySite(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #bodySite}, creating it if it does not already exist + */ + public CodeableConcept getBodySiteFirstRep() { + if (getBodySite().isEmpty()) { + addBodySite(); + } + return getBodySite().get(0); + } + /** * @return {@link #transform} (A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.) */ @@ -2589,6 +2650,7 @@ public class ActivityDefinition extends MetadataResource { childrenList.add(new Property("product[x]", "Reference(Medication|Substance)|CodeableConcept", "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("quantity", "SimpleQuantity", "Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).", 0, java.lang.Integer.MAX_VALUE, quantity)); childrenList.add(new Property("dosageInstruction", "DosageInstruction", "Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, bodySite)); childrenList.add(new Property("transform", "Reference(StructureMap)", "A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.", 0, java.lang.Integer.MAX_VALUE, transform)); childrenList.add(new Property("dynamicValue", "", "Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the intent resource that would contain the result.", 0, java.lang.Integer.MAX_VALUE, dynamicValue)); } @@ -2627,6 +2689,7 @@ public class ActivityDefinition extends MetadataResource { case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Type case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity case -1201373865: /*dosageInstruction*/ return this.dosageInstruction == null ? new Base[0] : this.dosageInstruction.toArray(new Base[this.dosageInstruction.size()]); // DosageInstruction + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept case 1052666732: /*transform*/ return this.transform == null ? new Base[0] : new Base[] {this.transform}; // Reference case 572625010: /*dynamicValue*/ return this.dynamicValue == null ? new Base[0] : this.dynamicValue.toArray(new Base[this.dynamicValue.size()]); // ActivityDefinitionDynamicValueComponent default: return super.getProperty(hash, name, checkValid); @@ -2730,6 +2793,9 @@ public class ActivityDefinition extends MetadataResource { case -1201373865: // dosageInstruction this.getDosageInstruction().add(castToDosageInstruction(value)); // DosageInstruction break; + case 1702620169: // bodySite + this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept + break; case 1052666732: // transform this.transform = castToReference(value); // Reference break; @@ -2805,6 +2871,8 @@ public class ActivityDefinition extends MetadataResource { this.quantity = castToSimpleQuantity(value); // SimpleQuantity else if (name.equals("dosageInstruction")) this.getDosageInstruction().add(castToDosageInstruction(value)); + else if (name.equals("bodySite")) + this.getBodySite().add(castToCodeableConcept(value)); else if (name.equals("transform")) this.transform = castToReference(value); // Reference else if (name.equals("dynamicValue")) @@ -2847,6 +2915,7 @@ public class ActivityDefinition extends MetadataResource { case 1753005361: return getProduct(); // Type case -1285004149: return getQuantity(); // SimpleQuantity case -1201373865: return addDosageInstruction(); // DosageInstruction + case 1702620169: return addBodySite(); // CodeableConcept case 1052666732: return getTransform(); // Reference case 572625010: return addDynamicValue(); // ActivityDefinitionDynamicValueComponent default: return super.makeProperty(hash, name); @@ -2963,6 +3032,9 @@ public class ActivityDefinition extends MetadataResource { else if (name.equals("dosageInstruction")) { return addDosageInstruction(); } + else if (name.equals("bodySite")) { + return addBodySite(); + } else if (name.equals("transform")) { this.transform = new Reference(); return this.transform; @@ -3053,6 +3125,11 @@ public class ActivityDefinition extends MetadataResource { for (DosageInstruction i : dosageInstruction) dst.dosageInstruction.add(i.copy()); }; + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (CodeableConcept i : bodySite) + dst.bodySite.add(i.copy()); + }; dst.transform = transform == null ? null : transform.copy(); if (dynamicValue != null) { dst.dynamicValue = new ArrayList(); @@ -3080,7 +3157,7 @@ public class ActivityDefinition extends MetadataResource { && compareDeep(library, o.library, true) && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(timing, o.timing, true) && compareDeep(location, o.location, true) && compareDeep(participantType, o.participantType, true) && compareDeep(product, o.product, true) && compareDeep(quantity, o.quantity, true) && compareDeep(dosageInstruction, o.dosageInstruction, true) - && compareDeep(transform, o.transform, true) && compareDeep(dynamicValue, o.dynamicValue, true) + && compareDeep(bodySite, o.bodySite, true) && compareDeep(transform, o.transform, true) && compareDeep(dynamicValue, o.dynamicValue, true) ; } @@ -3101,7 +3178,7 @@ public class ActivityDefinition extends MetadataResource { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, purpose, usage , approvalDate, lastReviewDate, effectivePeriod, topic, contributor, copyright, relatedArtifact , library, category, code, timing, location, participantType, product, quantity - , dosageInstruction, transform, dynamicValue); + , dosageInstruction, bodySite, transform, dynamicValue); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Address.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Address.java index bdf3b63296c..92be51cf86a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Address.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Address.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -337,7 +337,7 @@ public class Address extends Type implements ICompositeType { * Country - a nation as commonly understood or generally accepted. */ @Child(name = "country", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." ) + @Description(shortDefinition="Country (e.g. can be ISO 3166 2 or 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." ) protected StringType country; /** diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Age.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Age.java index 42fd4664f02..b1dd1ffd7f5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Age.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Age.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AllergyIntolerance.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AllergyIntolerance.java index d88709b008a..6405a453e13 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AllergyIntolerance.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AllergyIntolerance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -48,23 +48,121 @@ import org.hl7.fhir.exceptions.FHIRException; @ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance") public class AllergyIntolerance extends DomainResource { - public enum AllergyIntoleranceStatus { + public enum AllergyIntoleranceClinicalStatus { /** * An active record of a risk of a reaction to the identified substance. */ ACTIVE, /** - * A high level of certainty about the propensity for a reaction to the identified substance, which may include clinical evidence by testing or rechallenge. - */ - ACTIVECONFIRMED, - /** - * An inactivated record of a risk of a reaction to the identified substance + * An inactivated record of a risk of a reaction to the identified substance. */ INACTIVE, /** - * A reaction to the identified substance has been clinically reassessed by testing or re-exposure and considered to be resolved + * A reaction to the identified substance has been clinically reassessed by testing or re-exposure and considered to be resolved. */ RESOLVED, + /** + * added to help the parsers with the generic types + */ + NULL; + public static AllergyIntoleranceClinicalStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("inactive".equals(codeString)) + return INACTIVE; + if ("resolved".equals(codeString)) + return RESOLVED; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown AllergyIntoleranceClinicalStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + case RESOLVED: return "resolved"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return "http://hl7.org/fhir/allergy-clinical-status"; + case INACTIVE: return "http://hl7.org/fhir/allergy-clinical-status"; + case RESOLVED: return "http://hl7.org/fhir/allergy-clinical-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "An active record of a risk of a reaction to the identified substance."; + case INACTIVE: return "An inactivated record of a risk of a reaction to the identified substance."; + case RESOLVED: return "A reaction to the identified substance has been clinically reassessed by testing or re-exposure and considered to be resolved."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case INACTIVE: return "Inactive"; + case RESOLVED: return "Resolved"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceClinicalStatusEnumFactory implements EnumFactory { + public AllergyIntoleranceClinicalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return AllergyIntoleranceClinicalStatus.ACTIVE; + if ("inactive".equals(codeString)) + return AllergyIntoleranceClinicalStatus.INACTIVE; + if ("resolved".equals(codeString)) + return AllergyIntoleranceClinicalStatus.RESOLVED; + throw new IllegalArgumentException("Unknown AllergyIntoleranceClinicalStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceClinicalStatus.ACTIVE); + if ("inactive".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceClinicalStatus.INACTIVE); + if ("resolved".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceClinicalStatus.RESOLVED); + throw new FHIRException("Unknown AllergyIntoleranceClinicalStatus code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceClinicalStatus code) { + if (code == AllergyIntoleranceClinicalStatus.ACTIVE) + return "active"; + if (code == AllergyIntoleranceClinicalStatus.INACTIVE) + return "inactive"; + if (code == AllergyIntoleranceClinicalStatus.RESOLVED) + return "resolved"; + return "?"; + } + public String toSystem(AllergyIntoleranceClinicalStatus code) { + return code.getSystem(); + } + } + + public enum AllergyIntoleranceVerificationStatus { + /** + * A low level of certainty about the propensity for a reaction to the identified substance. + */ + UNCONFIRMED, + /** + * A high level of certainty about the propensity for a reaction to the identified substance, which may include clinical evidence by testing or rechallenge. + */ + CONFIRMED, /** * A propensity for a reaction to the identified substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. */ @@ -77,17 +175,13 @@ public class AllergyIntolerance extends DomainResource { * added to help the parsers with the generic types */ NULL; - public static AllergyIntoleranceStatus fromCode(String codeString) throws FHIRException { + public static AllergyIntoleranceVerificationStatus fromCode(String codeString) throws FHIRException { if (codeString == null || "".equals(codeString)) return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("active-confirmed".equals(codeString)) - return ACTIVECONFIRMED; - if ("inactive".equals(codeString)) - return INACTIVE; - if ("resolved".equals(codeString)) - return RESOLVED; + if ("unconfirmed".equals(codeString)) + return UNCONFIRMED; + if ("confirmed".equals(codeString)) + return CONFIRMED; if ("refuted".equals(codeString)) return REFUTED; if ("entered-in-error".equals(codeString)) @@ -95,14 +189,12 @@ public class AllergyIntolerance extends DomainResource { if (Configuration.isAcceptInvalidEnums()) return null; else - throw new FHIRException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + throw new FHIRException("Unknown AllergyIntoleranceVerificationStatus code '"+codeString+"'"); } public String toCode() { switch (this) { - case ACTIVE: return "active"; - case ACTIVECONFIRMED: return "active-confirmed"; - case INACTIVE: return "inactive"; - case RESOLVED: return "resolved"; + case UNCONFIRMED: return "unconfirmed"; + case CONFIRMED: return "confirmed"; case REFUTED: return "refuted"; case ENTEREDINERROR: return "entered-in-error"; default: return "?"; @@ -110,21 +202,17 @@ public class AllergyIntolerance extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/allergy-intolerance-status"; - case ACTIVECONFIRMED: return "http://hl7.org/fhir/allergy-intolerance-status"; - case INACTIVE: return "http://hl7.org/fhir/allergy-intolerance-status"; - case RESOLVED: return "http://hl7.org/fhir/allergy-intolerance-status"; - case REFUTED: return "http://hl7.org/fhir/allergy-intolerance-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/allergy-intolerance-status"; + case UNCONFIRMED: return "http://hl7.org/fhir/allergy-verification-status"; + case CONFIRMED: return "http://hl7.org/fhir/allergy-verification-status"; + case REFUTED: return "http://hl7.org/fhir/allergy-verification-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/allergy-verification-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "An active record of a risk of a reaction to the identified substance."; - case ACTIVECONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified substance, which may include clinical evidence by testing or rechallenge."; - case INACTIVE: return "An inactivated record of a risk of a reaction to the identified substance"; - case RESOLVED: return "A reaction to the identified substance has been clinically reassessed by testing or re-exposure and considered to be resolved"; + case UNCONFIRMED: return "A low level of certainty about the propensity for a reaction to the identified substance."; + case CONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified substance, which may include clinical evidence by testing or rechallenge."; case REFUTED: return "A propensity for a reaction to the identified substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted."; case ENTEREDINERROR: return "The statement was entered in error and is not valid."; default: return "?"; @@ -132,10 +220,8 @@ public class AllergyIntolerance extends DomainResource { } public String getDisplay() { switch (this) { - case ACTIVE: return "Active"; - case ACTIVECONFIRMED: return "Active Confirmed"; - case INACTIVE: return "Inactive"; - case RESOLVED: return "Resolved"; + case UNCONFIRMED: return "Unconfirmed"; + case CONFIRMED: return "Confirmed"; case REFUTED: return "Refuted"; case ENTEREDINERROR: return "Entered In Error"; default: return "?"; @@ -143,61 +229,49 @@ public class AllergyIntolerance extends DomainResource { } } - public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory { - public AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException { + public static class AllergyIntoleranceVerificationStatusEnumFactory implements EnumFactory { + public AllergyIntoleranceVerificationStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; - if ("active".equals(codeString)) - return AllergyIntoleranceStatus.ACTIVE; - if ("active-confirmed".equals(codeString)) - return AllergyIntoleranceStatus.ACTIVECONFIRMED; - if ("inactive".equals(codeString)) - return AllergyIntoleranceStatus.INACTIVE; - if ("resolved".equals(codeString)) - return AllergyIntoleranceStatus.RESOLVED; + if ("unconfirmed".equals(codeString)) + return AllergyIntoleranceVerificationStatus.UNCONFIRMED; + if ("confirmed".equals(codeString)) + return AllergyIntoleranceVerificationStatus.CONFIRMED; if ("refuted".equals(codeString)) - return AllergyIntoleranceStatus.REFUTED; + return AllergyIntoleranceVerificationStatus.REFUTED; if ("entered-in-error".equals(codeString)) - return AllergyIntoleranceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + return AllergyIntoleranceVerificationStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown AllergyIntoleranceVerificationStatus code '"+codeString+"'"); } - public Enumeration fromType(Base code) throws FHIRException { + public Enumeration fromType(Base code) throws FHIRException { if (code == null || code.isEmpty()) return null; String codeString = ((PrimitiveType) code).asStringValue(); if (codeString == null || "".equals(codeString)) return null; - if ("active".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.ACTIVE); - if ("active-confirmed".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.ACTIVECONFIRMED); - if ("inactive".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.INACTIVE); - if ("resolved".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.RESOLVED); + if ("unconfirmed".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceVerificationStatus.UNCONFIRMED); + if ("confirmed".equals(codeString)) + return new Enumeration(this, AllergyIntoleranceVerificationStatus.CONFIRMED); if ("refuted".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.REFUTED); + return new Enumeration(this, AllergyIntoleranceVerificationStatus.REFUTED); if ("entered-in-error".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.ENTEREDINERROR); - throw new FHIRException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + return new Enumeration(this, AllergyIntoleranceVerificationStatus.ENTEREDINERROR); + throw new FHIRException("Unknown AllergyIntoleranceVerificationStatus code '"+codeString+"'"); } - public String toCode(AllergyIntoleranceStatus code) { - if (code == AllergyIntoleranceStatus.ACTIVE) - return "active"; - if (code == AllergyIntoleranceStatus.ACTIVECONFIRMED) - return "active-confirmed"; - if (code == AllergyIntoleranceStatus.INACTIVE) - return "inactive"; - if (code == AllergyIntoleranceStatus.RESOLVED) - return "resolved"; - if (code == AllergyIntoleranceStatus.REFUTED) + public String toCode(AllergyIntoleranceVerificationStatus code) { + if (code == AllergyIntoleranceVerificationStatus.UNCONFIRMED) + return "unconfirmed"; + if (code == AllergyIntoleranceVerificationStatus.CONFIRMED) + return "confirmed"; + if (code == AllergyIntoleranceVerificationStatus.REFUTED) return "refuted"; - if (code == AllergyIntoleranceStatus.ENTEREDINERROR) + if (code == AllergyIntoleranceVerificationStatus.ENTEREDINERROR) return "entered-in-error"; return "?"; } - public String toSystem(AllergyIntoleranceStatus code) { + public String toSystem(AllergyIntoleranceVerificationStatus code) { return code.getSystem(); } } @@ -1364,18 +1438,26 @@ public class AllergyIntolerance extends DomainResource { @Description(shortDefinition="External ids for this item", formalDefinition="This records identifiers associated with this allergy/intolerance concern 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 clinical status of the allergy or intolerance. + */ + @Child(name = "clinicalStatus", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | inactive | resolved", formalDefinition="The clinical status of the allergy or intolerance." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-clinical-status") + protected Enumeration clinicalStatus; + /** * Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product). */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | active-confirmed | inactive | resolved | refuted | entered-in-error", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product)." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-intolerance-status") - protected Enumeration status; + @Child(name = "verificationStatus", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="unconfirmed | confirmed | refuted | entered-in-error", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product)." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-verification-status") + protected Enumeration verificationStatus; /** * Identification of the underlying physiological mechanism for the reaction risk. */ - @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Child(name = "type", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="allergy | intolerance - Underlying mechanism (if known)", formalDefinition="Identification of the underlying physiological mechanism for the reaction risk." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-intolerance-type") protected Enumeration type; @@ -1383,7 +1465,7 @@ public class AllergyIntolerance extends DomainResource { /** * Category of the identified substance. */ - @Child(name = "category", type = {CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "category", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="food | medication | biologic | environment", formalDefinition="Category of the identified substance." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-intolerance-category") protected List> category; @@ -1391,7 +1473,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=4, min=0, max=1, modifier=false, summary=true) + @Child(name = "criticality", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="low | high | unable-to-assess", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality") protected Enumeration criticality; @@ -1399,7 +1481,7 @@ public class AllergyIntolerance extends DomainResource { /** * Code for an allergy or intolerance statement (either a positive or a negated/excluded statement). This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., "Latex"), an allergy or intolerance condition (e.g., "Latex allergy"), or a negated/excluded code for a specific substance or class (e.g., "No latex allergy") or a general or categorical negated statement (e.g., "No known allergy", "No known drug allergies"). */ - @Child(name = "code", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Child(name = "code", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Allergy or intolerance code", formalDefinition="Code for an allergy or intolerance statement (either a positive or a negated/excluded statement). This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance condition (e.g., \"Latex allergy\"), or a negated/excluded code for a specific substance or class (e.g., \"No latex allergy\") or a general or categorical negated statement (e.g., \"No known allergy\", \"No known drug allergies\")." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergyintolerance-code") protected CodeableConcept code; @@ -1407,7 +1489,7 @@ public class AllergyIntolerance extends DomainResource { /** * The patient who has the allergy or intolerance. */ - @Child(name = "patient", type = {Patient.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Child(name = "patient", type = {Patient.class}, order=7, min=1, max=1, modifier=false, summary=true) @Description(shortDefinition="Who the sensitivity is for", formalDefinition="The patient who has the allergy or intolerance." ) protected Reference patient; @@ -1417,23 +1499,23 @@ public class AllergyIntolerance extends DomainResource { protected Patient patientTarget; /** - * Record of the date and/or time of the onset of the Allergy or Intolerance. + * Estimated or actual date, date-time, or age when allergy or intolerance was identified. */ - @Child(name = "onset", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Date(/time) when allergy or intolerance was identified", formalDefinition="Record of the date and/or time of the onset of the Allergy or Intolerance." ) - protected DateTimeType onset; + @Child(name = "onset", type = {DateTimeType.class, Age.class, Period.class, Range.class, StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="When allergy or intolerance was identified", formalDefinition="Estimated or actual date, date-time, or age when allergy or intolerance was identified." ) + protected Type onset; /** - * Indicates the most recent date on which the recorder has asserted that the information represented by this AllergyIntolerance record is accurate. + * The date on which the existance of the AllergyIntolerance was first asserted or acknowledged. */ - @Child(name = "attestedDate", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Date record was believed accurate", formalDefinition="Indicates the most recent date on which the recorder has asserted that the information represented by this AllergyIntolerance record is accurate." ) - protected DateTimeType attestedDate; + @Child(name = "assertedDate", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Date record was believed accurate", formalDefinition="The date on which the existance of the AllergyIntolerance was first asserted or acknowledged." ) + protected DateTimeType assertedDate; /** * Individual who recorded the record and takes responsibility for its content. */ - @Child(name = "recorder", type = {Practitioner.class, Patient.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "recorder", type = {Practitioner.class, Patient.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Who recorded the sensitivity", formalDefinition="Individual who recorded the record and takes responsibility for its content." ) protected Reference recorder; @@ -1445,37 +1527,37 @@ public class AllergyIntolerance extends DomainResource { /** * The source of the information about the allergy that is recorded. */ - @Child(name = "reporter", type = {Patient.class, RelatedPerson.class, Practitioner.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Child(name = "asserter", type = {Patient.class, RelatedPerson.class, Practitioner.class}, order=11, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Source of the information about the allergy", formalDefinition="The source of the information about the allergy that is recorded." ) - protected Reference reporter; + protected Reference asserter; /** * The actual object that is the target of the reference (The source of the information about the allergy that is recorded.) */ - protected Resource reporterTarget; + protected Resource asserterTarget; /** * Represents the date and/or time of the last known occurrence of a reaction event. */ - @Child(name = "lastOccurrence", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "lastOccurrence", type = {DateTimeType.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Date(/time) of last known occurrence of a reaction", formalDefinition="Represents the date and/or time of the last known occurrence of a reaction event." ) protected DateTimeType lastOccurrence; /** * Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. */ - @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "note", type = {Annotation.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Additional text not captured in other fields", formalDefinition="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." ) protected List note; /** * Details about each adverse reaction event linked to exposure to the identified substance. */ - @Child(name = "reaction", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "reaction", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Details about each adverse reaction event linked to exposure to the identified substance." ) protected List reaction; - private static final long serialVersionUID = -294433080L; + private static final long serialVersionUID = 948924623L; /** * Constructor @@ -1487,8 +1569,9 @@ public class AllergyIntolerance extends DomainResource { /** * Constructor */ - public AllergyIntolerance(Reference patient) { + public AllergyIntolerance(Enumeration verificationStatus, Reference patient) { super(); + this.verificationStatus = verificationStatus; this.patient = patient; } @@ -1546,51 +1629,96 @@ public class AllergyIntolerance extends DomainResource { } /** - * @return {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + * @return {@link #clinicalStatus} (The clinical status of the allergy or intolerance.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value */ - public Enumeration getStatusElement() { - if (this.status == null) + public Enumeration getClinicalStatusElement() { + if (this.clinicalStatus == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.status"); + throw new Error("Attempt to auto-create AllergyIntolerance.clinicalStatus"); else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); // bb - return this.status; + this.clinicalStatus = new Enumeration(new AllergyIntoleranceClinicalStatusEnumFactory()); // bb + return this.clinicalStatus; } - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); + public boolean hasClinicalStatusElement() { + return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); } - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); + public boolean hasClinicalStatus() { + return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); } /** - * @param value {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + * @param value {@link #clinicalStatus} (The clinical status of the allergy or intolerance.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value */ - public AllergyIntolerance setStatusElement(Enumeration value) { - this.status = value; + public AllergyIntolerance setClinicalStatusElement(Enumeration value) { + this.clinicalStatus = value; + return this; + } + + /** + * @return The clinical status of the allergy or intolerance. + */ + public AllergyIntoleranceClinicalStatus getClinicalStatus() { + return this.clinicalStatus == null ? null : this.clinicalStatus.getValue(); + } + + /** + * @param value The clinical status of the allergy or intolerance. + */ + public AllergyIntolerance setClinicalStatus(AllergyIntoleranceClinicalStatus value) { + if (value == null) + this.clinicalStatus = null; + else { + if (this.clinicalStatus == null) + this.clinicalStatus = new Enumeration(new AllergyIntoleranceClinicalStatusEnumFactory()); + this.clinicalStatus.setValue(value); + } + return this; + } + + /** + * @return {@link #verificationStatus} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).). This is the underlying object with id, value and extensions. The accessor "getVerificationStatus" gives direct access to the value + */ + public Enumeration getVerificationStatusElement() { + if (this.verificationStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.verificationStatus"); + else if (Configuration.doAutoCreate()) + this.verificationStatus = new Enumeration(new AllergyIntoleranceVerificationStatusEnumFactory()); // bb + return this.verificationStatus; + } + + public boolean hasVerificationStatusElement() { + return this.verificationStatus != null && !this.verificationStatus.isEmpty(); + } + + public boolean hasVerificationStatus() { + return this.verificationStatus != null && !this.verificationStatus.isEmpty(); + } + + /** + * @param value {@link #verificationStatus} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).). This is the underlying object with id, value and extensions. The accessor "getVerificationStatus" gives direct access to the value + */ + public AllergyIntolerance setVerificationStatusElement(Enumeration value) { + this.verificationStatus = value; return this; } /** * @return Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product). */ - public AllergyIntoleranceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); + public AllergyIntoleranceVerificationStatus getVerificationStatus() { + return this.verificationStatus == null ? null : this.verificationStatus.getValue(); } /** * @param value Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product). */ - public AllergyIntolerance setStatus(AllergyIntoleranceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); - this.status.setValue(value); - } + public AllergyIntolerance setVerificationStatus(AllergyIntoleranceVerificationStatus value) { + if (this.verificationStatus == null) + this.verificationStatus = new Enumeration(new AllergyIntoleranceVerificationStatusEnumFactory()); + this.verificationStatus.setValue(value); return this; } @@ -1822,19 +1950,75 @@ public class AllergyIntolerance extends DomainResource { } /** - * @return {@link #onset} (Record of the date and/or time of the onset of the Allergy or Intolerance.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + * @return {@link #onset} (Estimated or actual date, date-time, or age when allergy or intolerance was identified.) */ - public DateTimeType getOnsetElement() { - if (this.onset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.onset"); - else if (Configuration.doAutoCreate()) - this.onset = new DateTimeType(); // bb + public Type getOnset() { return this.onset; } - public boolean hasOnsetElement() { - return this.onset != null && !this.onset.isEmpty(); + /** + * @return {@link #onset} (Estimated or actual date, date-time, or age when allergy or intolerance was identified.) + */ + public DateTimeType getOnsetDateTimeType() throws FHIRException { + if (!(this.onset instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (DateTimeType) this.onset; + } + + public boolean hasOnsetDateTimeType() { + return this.onset instanceof DateTimeType; + } + + /** + * @return {@link #onset} (Estimated or actual date, date-time, or age when allergy or intolerance was identified.) + */ + public Age getOnsetAge() throws FHIRException { + if (!(this.onset instanceof Age)) + throw new FHIRException("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Age) this.onset; + } + + public boolean hasOnsetAge() { + return this.onset instanceof Age; + } + + /** + * @return {@link #onset} (Estimated or actual date, date-time, or age when allergy or intolerance was identified.) + */ + public Period getOnsetPeriod() throws FHIRException { + if (!(this.onset instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Period) this.onset; + } + + public boolean hasOnsetPeriod() { + return this.onset instanceof Period; + } + + /** + * @return {@link #onset} (Estimated or actual date, date-time, or age when allergy or intolerance was identified.) + */ + public Range getOnsetRange() throws FHIRException { + if (!(this.onset instanceof Range)) + throw new FHIRException("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Range) this.onset; + } + + public boolean hasOnsetRange() { + return this.onset instanceof Range; + } + + /** + * @return {@link #onset} (Estimated or actual date, date-time, or age when allergy or intolerance was identified.) + */ + public StringType getOnsetStringType() throws FHIRException { + if (!(this.onset instanceof StringType)) + throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (StringType) this.onset; + } + + public boolean hasOnsetStringType() { + return this.onset instanceof StringType; } public boolean hasOnset() { @@ -1842,79 +2026,58 @@ public class AllergyIntolerance extends DomainResource { } /** - * @param value {@link #onset} (Record of the date and/or time of the onset of the Allergy or Intolerance.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + * @param value {@link #onset} (Estimated or actual date, date-time, or age when allergy or intolerance was identified.) */ - public AllergyIntolerance setOnsetElement(DateTimeType value) { + public AllergyIntolerance setOnset(Type value) { this.onset = value; return this; } /** - * @return Record of the date and/or time of the onset of the Allergy or Intolerance. + * @return {@link #assertedDate} (The date on which the existance of the AllergyIntolerance was first asserted or acknowledged.). This is the underlying object with id, value and extensions. The accessor "getAssertedDate" gives direct access to the value */ - 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 Allergy or Intolerance. - */ - public AllergyIntolerance setOnset(Date value) { - if (value == null) - this.onset = null; - else { - if (this.onset == null) - this.onset = new DateTimeType(); - this.onset.setValue(value); - } - return this; - } - - /** - * @return {@link #attestedDate} (Indicates the most recent date on which the recorder has asserted that the information represented by this AllergyIntolerance record is accurate.). This is the underlying object with id, value and extensions. The accessor "getAttestedDate" gives direct access to the value - */ - public DateTimeType getAttestedDateElement() { - if (this.attestedDate == null) + public DateTimeType getAssertedDateElement() { + if (this.assertedDate == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.attestedDate"); + throw new Error("Attempt to auto-create AllergyIntolerance.assertedDate"); else if (Configuration.doAutoCreate()) - this.attestedDate = new DateTimeType(); // bb - return this.attestedDate; + this.assertedDate = new DateTimeType(); // bb + return this.assertedDate; } - public boolean hasAttestedDateElement() { - return this.attestedDate != null && !this.attestedDate.isEmpty(); + public boolean hasAssertedDateElement() { + return this.assertedDate != null && !this.assertedDate.isEmpty(); } - public boolean hasAttestedDate() { - return this.attestedDate != null && !this.attestedDate.isEmpty(); + public boolean hasAssertedDate() { + return this.assertedDate != null && !this.assertedDate.isEmpty(); } /** - * @param value {@link #attestedDate} (Indicates the most recent date on which the recorder has asserted that the information represented by this AllergyIntolerance record is accurate.). This is the underlying object with id, value and extensions. The accessor "getAttestedDate" gives direct access to the value + * @param value {@link #assertedDate} (The date on which the existance of the AllergyIntolerance was first asserted or acknowledged.). This is the underlying object with id, value and extensions. The accessor "getAssertedDate" gives direct access to the value */ - public AllergyIntolerance setAttestedDateElement(DateTimeType value) { - this.attestedDate = value; + public AllergyIntolerance setAssertedDateElement(DateTimeType value) { + this.assertedDate = value; return this; } /** - * @return Indicates the most recent date on which the recorder has asserted that the information represented by this AllergyIntolerance record is accurate. + * @return The date on which the existance of the AllergyIntolerance was first asserted or acknowledged. */ - public Date getAttestedDate() { - return this.attestedDate == null ? null : this.attestedDate.getValue(); + public Date getAssertedDate() { + return this.assertedDate == null ? null : this.assertedDate.getValue(); } /** - * @param value Indicates the most recent date on which the recorder has asserted that the information represented by this AllergyIntolerance record is accurate. + * @param value The date on which the existance of the AllergyIntolerance was first asserted or acknowledged. */ - public AllergyIntolerance setAttestedDate(Date value) { + public AllergyIntolerance setAssertedDate(Date value) { if (value == null) - this.attestedDate = null; + this.assertedDate = null; else { - if (this.attestedDate == null) - this.attestedDate = new DateTimeType(); - this.attestedDate.setValue(value); + if (this.assertedDate == null) + this.assertedDate = new DateTimeType(); + this.assertedDate.setValue(value); } return this; } @@ -1959,41 +2122,41 @@ public class AllergyIntolerance extends DomainResource { } /** - * @return {@link #reporter} (The source of the information about the allergy that is recorded.) + * @return {@link #asserter} (The source of the information about the allergy that is recorded.) */ - public Reference getReporter() { - if (this.reporter == null) + public Reference getAsserter() { + if (this.asserter == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.reporter"); + throw new Error("Attempt to auto-create AllergyIntolerance.asserter"); else if (Configuration.doAutoCreate()) - this.reporter = new Reference(); // cc - return this.reporter; + this.asserter = new Reference(); // cc + return this.asserter; } - public boolean hasReporter() { - return this.reporter != null && !this.reporter.isEmpty(); + public boolean hasAsserter() { + return this.asserter != null && !this.asserter.isEmpty(); } /** - * @param value {@link #reporter} (The source of the information about the allergy that is recorded.) + * @param value {@link #asserter} (The source of the information about the allergy that is recorded.) */ - public AllergyIntolerance setReporter(Reference value) { - this.reporter = value; + public AllergyIntolerance setAsserter(Reference value) { + this.asserter = value; return this; } /** - * @return {@link #reporter} 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 source of the information about the allergy that is recorded.) + * @return {@link #asserter} 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 source of the information about the allergy that is recorded.) */ - public Resource getReporterTarget() { - return this.reporterTarget; + public Resource getAsserterTarget() { + return this.asserterTarget; } /** - * @param value {@link #reporter} 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 source of the information about the allergy that is recorded.) + * @param value {@link #asserter} 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 source of the information about the allergy that is recorded.) */ - public AllergyIntolerance setReporterTarget(Resource value) { - this.reporterTarget = value; + public AllergyIntolerance setAsserterTarget(Resource value) { + this.asserterTarget = value; return this; } @@ -2155,16 +2318,17 @@ public class AllergyIntolerance extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this allergy/intolerance concern 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("status", "code", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("clinicalStatus", "code", "The clinical status of the allergy or intolerance.", 0, java.lang.Integer.MAX_VALUE, clinicalStatus)); + childrenList.add(new Property("verificationStatus", "code", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).", 0, java.lang.Integer.MAX_VALUE, verificationStatus)); childrenList.add(new Property("type", "code", "Identification of the underlying physiological mechanism for the reaction risk.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("category", "code", "Category of the identified substance.", 0, java.lang.Integer.MAX_VALUE, category)); childrenList.add(new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.", 0, java.lang.Integer.MAX_VALUE, criticality)); childrenList.add(new Property("code", "CodeableConcept", "Code for an allergy or intolerance statement (either a positive or a negated/excluded statement). This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance condition (e.g., \"Latex allergy\"), or a negated/excluded code for a specific substance or class (e.g., \"No latex allergy\") or a general or categorical negated statement (e.g., \"No known allergy\", \"No known drug allergies\").", 0, java.lang.Integer.MAX_VALUE, code)); childrenList.add(new Property("patient", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Allergy or Intolerance.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("attestedDate", "dateTime", "Indicates the most recent date on which the recorder has asserted that the information represented by this AllergyIntolerance record is accurate.", 0, java.lang.Integer.MAX_VALUE, attestedDate)); + childrenList.add(new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date, date-time, or age when allergy or intolerance was identified.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("assertedDate", "dateTime", "The date on which the existance of the AllergyIntolerance was first asserted or acknowledged.", 0, java.lang.Integer.MAX_VALUE, assertedDate)); childrenList.add(new Property("recorder", "Reference(Practitioner|Patient)", "Individual who recorded the record and takes responsibility for its content.", 0, java.lang.Integer.MAX_VALUE, recorder)); - childrenList.add(new Property("reporter", "Reference(Patient|RelatedPerson|Practitioner)", "The source of the information about the allergy that is recorded.", 0, java.lang.Integer.MAX_VALUE, reporter)); + childrenList.add(new Property("asserter", "Reference(Patient|RelatedPerson|Practitioner)", "The source of the information about the allergy that is recorded.", 0, java.lang.Integer.MAX_VALUE, asserter)); childrenList.add(new Property("lastOccurrence", "dateTime", "Represents the date and/or time of the last known occurrence of a reaction event.", 0, java.lang.Integer.MAX_VALUE, lastOccurrence)); childrenList.add(new Property("note", "Annotation", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note)); childrenList.add(new Property("reaction", "", "Details about each adverse reaction event linked to exposure to the identified substance.", 0, java.lang.Integer.MAX_VALUE, reaction)); @@ -2174,16 +2338,17 @@ public class AllergyIntolerance extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -462853915: /*clinicalStatus*/ return this.clinicalStatus == null ? new Base[0] : new Base[] {this.clinicalStatus}; // Enumeration + case -842509843: /*verificationStatus*/ return this.verificationStatus == null ? new Base[0] : new Base[] {this.verificationStatus}; // Enumeration case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // Enumeration case -1608054609: /*criticality*/ return this.criticality == null ? new Base[0] : new Base[] {this.criticality}; // Enumeration case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // DateTimeType - case -424886158: /*attestedDate*/ return this.attestedDate == null ? new Base[0] : new Base[] {this.attestedDate}; // DateTimeType + case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // Type + case -174231629: /*assertedDate*/ return this.assertedDate == null ? new Base[0] : new Base[] {this.assertedDate}; // DateTimeType case -799233858: /*recorder*/ return this.recorder == null ? new Base[0] : new Base[] {this.recorder}; // Reference - case -427039519: /*reporter*/ return this.reporter == null ? new Base[0] : new Base[] {this.reporter}; // Reference + case -373242253: /*asserter*/ return this.asserter == null ? new Base[0] : new Base[] {this.asserter}; // Reference case 1896977671: /*lastOccurrence*/ return this.lastOccurrence == null ? new Base[0] : new Base[] {this.lastOccurrence}; // DateTimeType case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation case -867509719: /*reaction*/ return this.reaction == null ? new Base[0] : this.reaction.toArray(new Base[this.reaction.size()]); // AllergyIntoleranceReactionComponent @@ -2198,8 +2363,11 @@ public class AllergyIntolerance extends DomainResource { case -1618432855: // identifier this.getIdentifier().add(castToIdentifier(value)); // Identifier break; - case -892481550: // status - this.status = new AllergyIntoleranceStatusEnumFactory().fromType(value); // Enumeration + case -462853915: // clinicalStatus + this.clinicalStatus = new AllergyIntoleranceClinicalStatusEnumFactory().fromType(value); // Enumeration + break; + case -842509843: // verificationStatus + this.verificationStatus = new AllergyIntoleranceVerificationStatusEnumFactory().fromType(value); // Enumeration break; case 3575610: // type this.type = new AllergyIntoleranceTypeEnumFactory().fromType(value); // Enumeration @@ -2217,16 +2385,16 @@ public class AllergyIntolerance extends DomainResource { this.patient = castToReference(value); // Reference break; case 105901603: // onset - this.onset = castToDateTime(value); // DateTimeType + this.onset = castToType(value); // Type break; - case -424886158: // attestedDate - this.attestedDate = castToDateTime(value); // DateTimeType + case -174231629: // assertedDate + this.assertedDate = castToDateTime(value); // DateTimeType break; case -799233858: // recorder this.recorder = castToReference(value); // Reference break; - case -427039519: // reporter - this.reporter = castToReference(value); // Reference + case -373242253: // asserter + this.asserter = castToReference(value); // Reference break; case 1896977671: // lastOccurrence this.lastOccurrence = castToDateTime(value); // DateTimeType @@ -2246,8 +2414,10 @@ public class AllergyIntolerance extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("identifier")) this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new AllergyIntoleranceStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("clinicalStatus")) + this.clinicalStatus = new AllergyIntoleranceClinicalStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("verificationStatus")) + this.verificationStatus = new AllergyIntoleranceVerificationStatusEnumFactory().fromType(value); // Enumeration else if (name.equals("type")) this.type = new AllergyIntoleranceTypeEnumFactory().fromType(value); // Enumeration else if (name.equals("category")) @@ -2258,14 +2428,14 @@ public class AllergyIntolerance extends DomainResource { this.code = castToCodeableConcept(value); // CodeableConcept else if (name.equals("patient")) this.patient = castToReference(value); // Reference - else if (name.equals("onset")) - this.onset = castToDateTime(value); // DateTimeType - else if (name.equals("attestedDate")) - this.attestedDate = castToDateTime(value); // DateTimeType + else if (name.equals("onset[x]")) + this.onset = castToType(value); // Type + else if (name.equals("assertedDate")) + this.assertedDate = castToDateTime(value); // DateTimeType else if (name.equals("recorder")) this.recorder = castToReference(value); // Reference - else if (name.equals("reporter")) - this.reporter = castToReference(value); // Reference + else if (name.equals("asserter")) + this.asserter = castToReference(value); // Reference else if (name.equals("lastOccurrence")) this.lastOccurrence = castToDateTime(value); // DateTimeType else if (name.equals("note")) @@ -2280,16 +2450,17 @@ public class AllergyIntolerance extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -462853915: throw new FHIRException("Cannot make property clinicalStatus as it is not a complex type"); // Enumeration + case -842509843: throw new FHIRException("Cannot make property verificationStatus as it is not a complex type"); // Enumeration case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration case -1608054609: throw new FHIRException("Cannot make property criticality as it is not a complex type"); // Enumeration case 3059181: return getCode(); // CodeableConcept case -791418107: return getPatient(); // Reference - case 105901603: throw new FHIRException("Cannot make property onset as it is not a complex type"); // DateTimeType - case -424886158: throw new FHIRException("Cannot make property attestedDate as it is not a complex type"); // DateTimeType + case -1886216323: return getOnset(); // Type + case -174231629: throw new FHIRException("Cannot make property assertedDate as it is not a complex type"); // DateTimeType case -799233858: return getRecorder(); // Reference - case -427039519: return getReporter(); // Reference + case -373242253: return getAsserter(); // Reference case 1896977671: throw new FHIRException("Cannot make property lastOccurrence as it is not a complex type"); // DateTimeType case 3387378: return addNote(); // Annotation case -867509719: return addReaction(); // AllergyIntoleranceReactionComponent @@ -2303,8 +2474,11 @@ public class AllergyIntolerance extends DomainResource { if (name.equals("identifier")) { return addIdentifier(); } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.status"); + else if (name.equals("clinicalStatus")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.clinicalStatus"); + } + else if (name.equals("verificationStatus")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.verificationStatus"); } else if (name.equals("type")) { throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.type"); @@ -2323,19 +2497,36 @@ public class AllergyIntolerance extends DomainResource { this.patient = new Reference(); return this.patient; } - else if (name.equals("onset")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.onset"); + else if (name.equals("onsetDateTime")) { + this.onset = new DateTimeType(); + return this.onset; } - else if (name.equals("attestedDate")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.attestedDate"); + else if (name.equals("onsetAge")) { + this.onset = new Age(); + return this.onset; + } + else if (name.equals("onsetPeriod")) { + this.onset = new Period(); + return this.onset; + } + else if (name.equals("onsetRange")) { + this.onset = new Range(); + return this.onset; + } + else if (name.equals("onsetString")) { + this.onset = new StringType(); + return this.onset; + } + else if (name.equals("assertedDate")) { + throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.assertedDate"); } else if (name.equals("recorder")) { this.recorder = new Reference(); return this.recorder; } - else if (name.equals("reporter")) { - this.reporter = new Reference(); - return this.reporter; + else if (name.equals("asserter")) { + this.asserter = new Reference(); + return this.asserter; } else if (name.equals("lastOccurrence")) { throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.lastOccurrence"); @@ -2363,7 +2554,8 @@ public class AllergyIntolerance extends DomainResource { for (Identifier i : identifier) dst.identifier.add(i.copy()); }; - dst.status = status == null ? null : status.copy(); + dst.clinicalStatus = clinicalStatus == null ? null : clinicalStatus.copy(); + dst.verificationStatus = verificationStatus == null ? null : verificationStatus.copy(); dst.type = type == null ? null : type.copy(); if (category != null) { dst.category = new ArrayList>(); @@ -2374,9 +2566,9 @@ public class AllergyIntolerance extends DomainResource { dst.code = code == null ? null : code.copy(); dst.patient = patient == null ? null : patient.copy(); dst.onset = onset == null ? null : onset.copy(); - dst.attestedDate = attestedDate == null ? null : attestedDate.copy(); + dst.assertedDate = assertedDate == null ? null : assertedDate.copy(); dst.recorder = recorder == null ? null : recorder.copy(); - dst.reporter = reporter == null ? null : reporter.copy(); + dst.asserter = asserter == null ? null : asserter.copy(); dst.lastOccurrence = lastOccurrence == null ? null : lastOccurrence.copy(); if (note != null) { dst.note = new ArrayList(); @@ -2402,10 +2594,11 @@ public class AllergyIntolerance extends DomainResource { if (!(other instanceof AllergyIntolerance)) return false; AllergyIntolerance o = (AllergyIntolerance) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(clinicalStatus, o.clinicalStatus, true) + && compareDeep(verificationStatus, o.verificationStatus, true) && compareDeep(type, o.type, true) && compareDeep(category, o.category, true) && compareDeep(criticality, o.criticality, true) && compareDeep(code, o.code, true) - && compareDeep(patient, o.patient, true) && compareDeep(onset, o.onset, true) && compareDeep(attestedDate, o.attestedDate, true) - && compareDeep(recorder, o.recorder, true) && compareDeep(reporter, o.reporter, true) && compareDeep(lastOccurrence, o.lastOccurrence, true) + && compareDeep(patient, o.patient, true) && compareDeep(onset, o.onset, true) && compareDeep(assertedDate, o.assertedDate, true) + && compareDeep(recorder, o.recorder, true) && compareDeep(asserter, o.asserter, true) && compareDeep(lastOccurrence, o.lastOccurrence, true) && compareDeep(note, o.note, true) && compareDeep(reaction, o.reaction, true); } @@ -2416,15 +2609,16 @@ public class AllergyIntolerance extends DomainResource { if (!(other instanceof AllergyIntolerance)) return false; AllergyIntolerance o = (AllergyIntolerance) other; - return compareValues(status, o.status, true) && compareValues(type, o.type, true) && compareValues(category, o.category, true) - && compareValues(criticality, o.criticality, true) && compareValues(onset, o.onset, true) && compareValues(attestedDate, o.attestedDate, true) - && compareValues(lastOccurrence, o.lastOccurrence, true); + return compareValues(clinicalStatus, o.clinicalStatus, true) && compareValues(verificationStatus, o.verificationStatus, true) + && compareValues(type, o.type, true) && compareValues(category, o.category, true) && compareValues(criticality, o.criticality, true) + && compareValues(assertedDate, o.assertedDate, true) && compareValues(lastOccurrence, o.lastOccurrence, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type - , category, criticality, code, patient, onset, attestedDate, recorder, reporter - , lastOccurrence, note, reaction); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, clinicalStatus + , verificationStatus, type, category, criticality, code, patient, onset, assertedDate + , recorder, asserter, lastOccurrence, note, reaction); } @Override @@ -2457,17 +2651,17 @@ public class AllergyIntolerance extends DomainResource { *

* Description: Date record was believed accurate
* Type: date
- * Path: AllergyIntolerance.attestedDate
+ * Path: AllergyIntolerance.assertedDate
*

*/ - @SearchParamDefinition(name="date", path="AllergyIntolerance.attestedDate", description="Date record was believed accurate", type="date" ) + @SearchParamDefinition(name="date", path="AllergyIntolerance.assertedDate", description="Date record was believed accurate", type="date" ) public static final String SP_DATE = "date"; /** * Fluent Client search parameter constant for date *

* Description: Date record was believed accurate
* Type: date
- * Path: AllergyIntolerance.attestedDate
+ * Path: AllergyIntolerance.assertedDate
*

*/ public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); @@ -2558,6 +2752,26 @@ public class AllergyIntolerance extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); + /** + * Search parameter: verification-status + *

+ * Description: unconfirmed | confirmed | refuted | entered-in-error
+ * Type: token
+ * Path: AllergyIntolerance.verificationStatus
+ *

+ */ + @SearchParamDefinition(name="verification-status", path="AllergyIntolerance.verificationStatus", description="unconfirmed | confirmed | refuted | entered-in-error", type="token" ) + public static final String SP_VERIFICATION_STATUS = "verification-status"; + /** + * Fluent Client search parameter constant for verification-status + *

+ * Description: unconfirmed | confirmed | refuted | entered-in-error
+ * Type: token
+ * Path: AllergyIntolerance.verificationStatus
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERIFICATION_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERIFICATION_STATUS); + /** * Search parameter: criticality *

@@ -2579,30 +2793,24 @@ public class AllergyIntolerance extends DomainResource { public static final ca.uhn.fhir.rest.gclient.TokenClientParam CRITICALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CRITICALITY); /** - * Search parameter: reporter + * Search parameter: clinical-status *

- * Description: Source of the information about the allergy
- * Type: reference
- * Path: AllergyIntolerance.reporter
+ * Description: active | inactive | resolved
+ * Type: token
+ * Path: AllergyIntolerance.clinicalStatus
*

*/ - @SearchParamDefinition(name="reporter", path="AllergyIntolerance.reporter", description="Source of the information about the allergy", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Patient.class, Practitioner.class, RelatedPerson.class } ) - public static final String SP_REPORTER = "reporter"; + @SearchParamDefinition(name="clinical-status", path="AllergyIntolerance.clinicalStatus", description="active | inactive | resolved", type="token" ) + public static final String SP_CLINICAL_STATUS = "clinical-status"; /** - * Fluent Client search parameter constant for reporter + * Fluent Client search parameter constant for clinical-status *

- * Description: Source of the information about the allergy
- * Type: reference
- * Path: AllergyIntolerance.reporter
+ * Description: active | inactive | resolved
+ * Type: token
+ * Path: AllergyIntolerance.clinicalStatus
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPORTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPORTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AllergyIntolerance:reporter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REPORTER = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:reporter").toLocked(); + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLINICAL_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLINICAL_STATUS); /** * Search parameter: type @@ -2664,6 +2872,32 @@ public class AllergyIntolerance extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROUTE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROUTE); + /** + * Search parameter: asserter + *

+ * Description: Source of the information about the allergy
+ * Type: reference
+ * Path: AllergyIntolerance.asserter
+ *

+ */ + @SearchParamDefinition(name="asserter", path="AllergyIntolerance.asserter", description="Source of the information about the allergy", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Patient.class, Practitioner.class, RelatedPerson.class } ) + public static final String SP_ASSERTER = "asserter"; + /** + * Fluent Client search parameter constant for asserter + *

+ * Description: Source of the information about the allergy
+ * Type: reference
+ * Path: AllergyIntolerance.asserter
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ASSERTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ASSERTER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "AllergyIntolerance:asserter". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ASSERTER = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:asserter").toLocked(); + /** * Search parameter: patient *

@@ -2730,26 +2964,6 @@ public class AllergyIntolerance extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.DateClientParam LAST_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_LAST_DATE); - /** - * Search parameter: status - *

- * Description: active | active-confirmed | inactive | resolved | refuted | entered-in-error
- * Type: token
- * Path: AllergyIntolerance.status
- *

- */ - @SearchParamDefinition(name="status", path="AllergyIntolerance.status", description="active | active-confirmed | inactive | resolved | refuted | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: active | active-confirmed | inactive | resolved | refuted | entered-in-error
- * Type: token
- * Path: AllergyIntolerance.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Annotation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Annotation.java index 5dc5def8f1a..3b57ae243bd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Annotation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Annotation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Appointment.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Appointment.java index 24598e1e301..830cd273ff4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Appointment.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Appointment.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AppointmentResponse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AppointmentResponse.java index ba8b97c9629..37275a49f96 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AppointmentResponse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AppointmentResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Attachment.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Attachment.java index bc0d7946b52..27bbe38cea1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Attachment.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Attachment.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -78,10 +78,10 @@ public class Attachment extends Type implements ICompositeType { protected UriType url; /** - * The number of bytes of data that make up this attachment. + * The number of bytes of data that make up this attachment (before base64 encoding, if that is done). */ @Child(name = "size", type = {UnsignedIntType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) + @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment (before base64 encoding, if that is done)." ) protected UnsignedIntType size; /** @@ -311,7 +311,7 @@ public class Attachment extends Type implements ICompositeType { } /** - * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + * @return {@link #size} (The number of bytes of data that make up this attachment (before base64 encoding, if that is done).). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value */ public UnsignedIntType getSizeElement() { if (this.size == null) @@ -331,7 +331,7 @@ public class Attachment extends Type implements ICompositeType { } /** - * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + * @param value {@link #size} (The number of bytes of data that make up this attachment (before base64 encoding, if that is done).). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value */ public Attachment setSizeElement(UnsignedIntType value) { this.size = value; @@ -339,14 +339,14 @@ public class Attachment extends Type implements ICompositeType { } /** - * @return The number of bytes of data that make up this attachment. + * @return The number of bytes of data that make up this attachment (before base64 encoding, if that is done). */ public int getSize() { return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); } /** - * @param value The number of bytes of data that make up this attachment. + * @param value The number of bytes of data that make up this attachment (before base64 encoding, if that is done). */ public Attachment setSize(int value) { if (this.size == null) @@ -508,7 +508,7 @@ public class Attachment extends Type implements ICompositeType { childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language)); childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data)); childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); + childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment (before base64 encoding, if that is done).", 0, java.lang.Integer.MAX_VALUE, size)); childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash)); childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); childrenList.add(new Property("creation", "dateTime", "The date that the attachment was first created.", 0, java.lang.Integer.MAX_VALUE, creation)); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AuditEvent.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AuditEvent.java index 75b2467c6f8..a956b0d0779 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AuditEvent.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/AuditEvent.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -534,12 +534,12 @@ public class AuditEvent extends DomainResource { /** * The reason (purpose of use), specific to this agent, that was used during the event being recorded. */ - @Child(name = "purposeOfUse", type = {Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "purposeOfUse", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Reason given for this user", formalDefinition="The reason (purpose of use), specific to this agent, that was used during the event being recorded." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-PurposeOfUse") - protected List purposeOfUse; + protected List purposeOfUse; - private static final long serialVersionUID = 1802747339L; + private static final long serialVersionUID = 1205071410L; /** * Constructor @@ -971,16 +971,16 @@ public class AuditEvent extends DomainResource { /** * @return {@link #purposeOfUse} (The reason (purpose of use), specific to this agent, that was used during the event being recorded.) */ - public List getPurposeOfUse() { + public List getPurposeOfUse() { if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); + this.purposeOfUse = new ArrayList(); return this.purposeOfUse; } /** * @return Returns a reference to this for easy method chaining */ - public AuditEventAgentComponent setPurposeOfUse(List thePurposeOfUse) { + public AuditEventAgentComponent setPurposeOfUse(List thePurposeOfUse) { this.purposeOfUse = thePurposeOfUse; return this; } @@ -988,25 +988,25 @@ public class AuditEvent extends DomainResource { public boolean hasPurposeOfUse() { if (this.purposeOfUse == null) return false; - for (Coding item : this.purposeOfUse) + for (CodeableConcept item : this.purposeOfUse) if (!item.isEmpty()) return true; return false; } - public Coding addPurposeOfUse() { //3 - Coding t = new Coding(); + public CodeableConcept addPurposeOfUse() { //3 + CodeableConcept t = new CodeableConcept(); if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); + this.purposeOfUse = new ArrayList(); this.purposeOfUse.add(t); return t; } - public AuditEventAgentComponent addPurposeOfUse(Coding t) { //3 + public AuditEventAgentComponent addPurposeOfUse(CodeableConcept t) { //3 if (t == null) return this; if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); + this.purposeOfUse = new ArrayList(); this.purposeOfUse.add(t); return this; } @@ -1014,7 +1014,7 @@ public class AuditEvent extends DomainResource { /** * @return The first repetition of repeating field {@link #purposeOfUse}, creating it if it does not already exist */ - public Coding getPurposeOfUseFirstRep() { + public CodeableConcept getPurposeOfUseFirstRep() { if (getPurposeOfUse().isEmpty()) { addPurposeOfUse(); } @@ -1033,7 +1033,7 @@ public class AuditEvent extends DomainResource { childrenList.add(new Property("policy", "uri", "The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.", 0, java.lang.Integer.MAX_VALUE, policy)); childrenList.add(new Property("media", "Coding", "Type of media involved. Used when the event is about exporting/importing onto media.", 0, java.lang.Integer.MAX_VALUE, media)); childrenList.add(new Property("network", "", "Logical network location for application activity, if the activity has a network location.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("purposeOfUse", "Coding", "The reason (purpose of use), specific to this agent, that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfUse)); + childrenList.add(new Property("purposeOfUse", "CodeableConcept", "The reason (purpose of use), specific to this agent, that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfUse)); } @Override @@ -1049,7 +1049,7 @@ public class AuditEvent extends DomainResource { case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // UriType case 103772132: /*media*/ return this.media == null ? new Base[0] : new Base[] {this.media}; // Coding case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // AuditEventAgentNetworkComponent - case -1881902670: /*purposeOfUse*/ return this.purposeOfUse == null ? new Base[0] : this.purposeOfUse.toArray(new Base[this.purposeOfUse.size()]); // Coding + case -1881902670: /*purposeOfUse*/ return this.purposeOfUse == null ? new Base[0] : this.purposeOfUse.toArray(new Base[this.purposeOfUse.size()]); // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -1089,7 +1089,7 @@ public class AuditEvent extends DomainResource { this.network = (AuditEventAgentNetworkComponent) value; // AuditEventAgentNetworkComponent break; case -1881902670: // purposeOfUse - this.getPurposeOfUse().add(castToCoding(value)); // Coding + this.getPurposeOfUse().add(castToCodeableConcept(value)); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -1119,7 +1119,7 @@ public class AuditEvent extends DomainResource { else if (name.equals("network")) this.network = (AuditEventAgentNetworkComponent) value; // AuditEventAgentNetworkComponent else if (name.equals("purposeOfUse")) - this.getPurposeOfUse().add(castToCoding(value)); + this.getPurposeOfUse().add(castToCodeableConcept(value)); else super.setProperty(name, value); } @@ -1137,7 +1137,7 @@ public class AuditEvent extends DomainResource { case -982670030: throw new FHIRException("Cannot make property policy as it is not a complex type"); // UriType case 103772132: return getMedia(); // Coding case 1843485230: return getNetwork(); // AuditEventAgentNetworkComponent - case -1881902670: return addPurposeOfUse(); // Coding + case -1881902670: return addPurposeOfUse(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -1209,8 +1209,8 @@ public class AuditEvent extends DomainResource { dst.media = media == null ? null : media.copy(); dst.network = network == null ? null : network.copy(); if (purposeOfUse != null) { - dst.purposeOfUse = new ArrayList(); - for (Coding i : purposeOfUse) + dst.purposeOfUse = new ArrayList(); + for (CodeableConcept i : purposeOfUse) dst.purposeOfUse.add(i.copy()); }; return dst; @@ -2730,10 +2730,10 @@ public class AuditEvent extends DomainResource { /** * The purposeOfUse (reason) that was used during the event being recorded. */ - @Child(name = "purposeOfEvent", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "purposeOfEvent", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="The purposeOfUse of the event", formalDefinition="The purposeOfUse (reason) that was used during the event being recorded." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-PurposeOfUse") - protected List purposeOfEvent; + protected List purposeOfEvent; /** * An actor taking an active role in the event or activity that is logged. @@ -2756,7 +2756,7 @@ public class AuditEvent extends DomainResource { @Description(shortDefinition="Data or objects used", formalDefinition="Specific instances of data or objects that have been accessed." ) protected List entity; - private static final long serialVersionUID = 945153702L; + private static final long serialVersionUID = 2102955199L; /** * Constructor @@ -3047,16 +3047,16 @@ public class AuditEvent extends DomainResource { /** * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) */ - public List getPurposeOfEvent() { + public List getPurposeOfEvent() { if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); + this.purposeOfEvent = new ArrayList(); return this.purposeOfEvent; } /** * @return Returns a reference to this for easy method chaining */ - public AuditEvent setPurposeOfEvent(List thePurposeOfEvent) { + public AuditEvent setPurposeOfEvent(List thePurposeOfEvent) { this.purposeOfEvent = thePurposeOfEvent; return this; } @@ -3064,25 +3064,25 @@ public class AuditEvent extends DomainResource { public boolean hasPurposeOfEvent() { if (this.purposeOfEvent == null) return false; - for (Coding item : this.purposeOfEvent) + for (CodeableConcept item : this.purposeOfEvent) if (!item.isEmpty()) return true; return false; } - public Coding addPurposeOfEvent() { //3 - Coding t = new Coding(); + public CodeableConcept addPurposeOfEvent() { //3 + CodeableConcept t = new CodeableConcept(); if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); + this.purposeOfEvent = new ArrayList(); this.purposeOfEvent.add(t); return t; } - public AuditEvent addPurposeOfEvent(Coding t) { //3 + public AuditEvent addPurposeOfEvent(CodeableConcept t) { //3 if (t == null) return this; if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); + this.purposeOfEvent = new ArrayList(); this.purposeOfEvent.add(t); return this; } @@ -3090,7 +3090,7 @@ public class AuditEvent extends DomainResource { /** * @return The first repetition of repeating field {@link #purposeOfEvent}, creating it if it does not already exist */ - public Coding getPurposeOfEventFirstRep() { + public CodeableConcept getPurposeOfEventFirstRep() { if (getPurposeOfEvent().isEmpty()) { addPurposeOfEvent(); } @@ -3235,7 +3235,7 @@ public class AuditEvent extends DomainResource { childrenList.add(new Property("recorded", "instant", "The time when the event occurred on the source.", 0, java.lang.Integer.MAX_VALUE, recorded)); childrenList.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, java.lang.Integer.MAX_VALUE, outcome)); childrenList.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, java.lang.Integer.MAX_VALUE, outcomeDesc)); - childrenList.add(new Property("purposeOfEvent", "Coding", "The purposeOfUse (reason) that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfEvent)); + childrenList.add(new Property("purposeOfEvent", "CodeableConcept", "The purposeOfUse (reason) that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfEvent)); childrenList.add(new Property("agent", "", "An actor taking an active role in the event or activity that is logged.", 0, java.lang.Integer.MAX_VALUE, agent)); childrenList.add(new Property("source", "", "The system that is reporting the event.", 0, java.lang.Integer.MAX_VALUE, source)); childrenList.add(new Property("entity", "", "Specific instances of data or objects that have been accessed.", 0, java.lang.Integer.MAX_VALUE, entity)); @@ -3250,7 +3250,7 @@ public class AuditEvent extends DomainResource { case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // InstantType case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration case 1062502659: /*outcomeDesc*/ return this.outcomeDesc == null ? new Base[0] : new Base[] {this.outcomeDesc}; // StringType - case -341917691: /*purposeOfEvent*/ return this.purposeOfEvent == null ? new Base[0] : this.purposeOfEvent.toArray(new Base[this.purposeOfEvent.size()]); // Coding + case -341917691: /*purposeOfEvent*/ return this.purposeOfEvent == null ? new Base[0] : this.purposeOfEvent.toArray(new Base[this.purposeOfEvent.size()]); // CodeableConcept case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // AuditEventAgentComponent case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // AuditEventSourceComponent case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : this.entity.toArray(new Base[this.entity.size()]); // AuditEventEntityComponent @@ -3281,7 +3281,7 @@ public class AuditEvent extends DomainResource { this.outcomeDesc = castToString(value); // StringType break; case -341917691: // purposeOfEvent - this.getPurposeOfEvent().add(castToCoding(value)); // Coding + this.getPurposeOfEvent().add(castToCodeableConcept(value)); // CodeableConcept break; case 92750597: // agent this.getAgent().add((AuditEventAgentComponent) value); // AuditEventAgentComponent @@ -3312,7 +3312,7 @@ public class AuditEvent extends DomainResource { else if (name.equals("outcomeDesc")) this.outcomeDesc = castToString(value); // StringType else if (name.equals("purposeOfEvent")) - this.getPurposeOfEvent().add(castToCoding(value)); + this.getPurposeOfEvent().add(castToCodeableConcept(value)); else if (name.equals("agent")) this.getAgent().add((AuditEventAgentComponent) value); else if (name.equals("source")) @@ -3332,7 +3332,7 @@ public class AuditEvent extends DomainResource { case -799233872: throw new FHIRException("Cannot make property recorded as it is not a complex type"); // InstantType case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration case 1062502659: throw new FHIRException("Cannot make property outcomeDesc as it is not a complex type"); // StringType - case -341917691: return addPurposeOfEvent(); // Coding + case -341917691: return addPurposeOfEvent(); // CodeableConcept case 92750597: return addAgent(); // AuditEventAgentComponent case -896505829: return getSource(); // AuditEventSourceComponent case -1298275357: return addEntity(); // AuditEventEntityComponent @@ -3398,8 +3398,8 @@ public class AuditEvent extends DomainResource { dst.outcome = outcome == null ? null : outcome.copy(); dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy(); if (purposeOfEvent != null) { - dst.purposeOfEvent = new ArrayList(); - for (Coding i : purposeOfEvent) + dst.purposeOfEvent = new ArrayList(); + for (CodeableConcept i : purposeOfEvent) dst.purposeOfEvent.add(i.copy()); }; if (agent != null) { diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BackboneElement.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BackboneElement.java index 3f0a9dd2daa..73d6bc60450 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BackboneElement.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BackboneElement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Basic.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Basic.java index 1fa983104c4..678486f6918 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Basic.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Basic.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Binary.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Binary.java index cd9ec6a0e94..7f797ccba59 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Binary.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Binary.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -56,14 +56,26 @@ public class Binary extends BaseBinary implements IBaseBinary { @Description(shortDefinition="MimeType of the binary content", formalDefinition="MimeType of the binary content represented as a standard MimeType (BCP 13)." ) protected CodeType contentType; + /** + * Treat this binary as if it was this other resource for access control purposes. + */ + @Child(name = "securityContext", type = {Reference.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Access Control Management", formalDefinition="Treat this binary as if it was this other resource for access control purposes." ) + protected Reference securityContext; + + /** + * The actual object that is the target of the reference (Treat this binary as if it was this other resource for access control purposes.) + */ + protected Resource securityContextTarget; + /** * The actual content, base64 encoded. */ - @Child(name = "content", type = {Base64BinaryType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "content", type = {Base64BinaryType.class}, order=2, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." ) protected Base64BinaryType content; - private static final long serialVersionUID = 974764407L; + private static final long serialVersionUID = 1111991335L; /** * Constructor @@ -126,6 +138,45 @@ public class Binary extends BaseBinary implements IBaseBinary { return this; } + /** + * @return {@link #securityContext} (Treat this binary as if it was this other resource for access control purposes.) + */ + public Reference getSecurityContext() { + if (this.securityContext == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Binary.securityContext"); + else if (Configuration.doAutoCreate()) + this.securityContext = new Reference(); // cc + return this.securityContext; + } + + public boolean hasSecurityContext() { + return this.securityContext != null && !this.securityContext.isEmpty(); + } + + /** + * @param value {@link #securityContext} (Treat this binary as if it was this other resource for access control purposes.) + */ + public Binary setSecurityContext(Reference value) { + this.securityContext = value; + return this; + } + + /** + * @return {@link #securityContext} 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. (Treat this binary as if it was this other resource for access control purposes.) + */ + public Resource getSecurityContextTarget() { + return this.securityContextTarget; + } + + /** + * @param value {@link #securityContext} 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. (Treat this binary as if it was this other resource for access control purposes.) + */ + public Binary setSecurityContextTarget(Resource value) { + this.securityContextTarget = value; + return this; + } + /** * @return {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value */ @@ -174,6 +225,7 @@ public class Binary extends BaseBinary implements IBaseBinary { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("contentType", "code", "MimeType of the binary content represented as a standard MimeType (BCP 13).", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("securityContext", "Reference(Any)", "Treat this binary as if it was this other resource for access control purposes.", 0, java.lang.Integer.MAX_VALUE, securityContext)); childrenList.add(new Property("content", "base64Binary", "The actual content, base64 encoded.", 0, java.lang.Integer.MAX_VALUE, content)); } @@ -181,6 +233,7 @@ public class Binary extends BaseBinary implements IBaseBinary { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType + case -1622888881: /*securityContext*/ return this.securityContext == null ? new Base[0] : new Base[] {this.securityContext}; // Reference case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Base64BinaryType default: return super.getProperty(hash, name, checkValid); } @@ -193,6 +246,9 @@ public class Binary extends BaseBinary implements IBaseBinary { case -389131437: // contentType this.contentType = castToCode(value); // CodeType break; + case -1622888881: // securityContext + this.securityContext = castToReference(value); // Reference + break; case 951530617: // content this.content = castToBase64Binary(value); // Base64BinaryType break; @@ -205,6 +261,8 @@ public class Binary extends BaseBinary implements IBaseBinary { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("contentType")) this.contentType = castToCode(value); // CodeType + else if (name.equals("securityContext")) + this.securityContext = castToReference(value); // Reference else if (name.equals("content")) this.content = castToBase64Binary(value); // Base64BinaryType else @@ -215,6 +273,7 @@ public class Binary extends BaseBinary implements IBaseBinary { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType + case -1622888881: return getSecurityContext(); // Reference case 951530617: throw new FHIRException("Cannot make property content as it is not a complex type"); // Base64BinaryType default: return super.makeProperty(hash, name); } @@ -226,6 +285,10 @@ public class Binary extends BaseBinary implements IBaseBinary { if (name.equals("contentType")) { throw new FHIRException("Cannot call addChild on a primitive type Binary.contentType"); } + else if (name.equals("securityContext")) { + this.securityContext = new Reference(); + return this.securityContext; + } else if (name.equals("content")) { throw new FHIRException("Cannot call addChild on a primitive type Binary.content"); } @@ -242,6 +305,7 @@ public class Binary extends BaseBinary implements IBaseBinary { Binary dst = new Binary(); copyValues(dst); dst.contentType = contentType == null ? null : contentType.copy(); + dst.securityContext = securityContext == null ? null : securityContext.copy(); dst.content = content == null ? null : content.copy(); return dst; } @@ -257,7 +321,8 @@ public class Binary extends BaseBinary implements IBaseBinary { if (!(other instanceof Binary)) return false; Binary o = (Binary) other; - return compareDeep(contentType, o.contentType, true) && compareDeep(content, o.content, true); + return compareDeep(contentType, o.contentType, true) && compareDeep(securityContext, o.securityContext, true) + && compareDeep(content, o.content, true); } @Override @@ -271,7 +336,8 @@ public class Binary extends BaseBinary implements IBaseBinary { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(contentType, content); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(contentType, securityContext + , content); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BodySite.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BodySite.java index 9325125c3c5..d62daf032de 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BodySite.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BodySite.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Bundle.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Bundle.java index cc4460ba727..3970bb1799e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Bundle.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Bundle.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -83,7 +83,7 @@ public class Bundle extends Resource implements IBaseBundle { */ SEARCHSET, /** - * The bundle is a set of resources collected into a single document for ease of distribution. + * The bundle is a set of resources collected into a single package for ease of distribution. */ COLLECTION, /** @@ -154,7 +154,7 @@ public class Bundle extends Resource implements IBaseBundle { case BATCHRESPONSE: return "The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success."; case HISTORY: return "The bundle is a list of resources from a history interaction on a server."; case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; - case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; + case COLLECTION: return "The bundle is a set of resources collected into a single package for ease of distribution."; default: return "?"; } } @@ -482,10 +482,10 @@ public class Bundle extends Resource implements IBaseBundle { @Block() public static class BundleLinkComponent extends BackboneElement implements IBaseBackboneElement { /** - * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + * A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1). */ @Child(name = "relation", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="http://www.iana.org/assignments/link-relations/link-relations.xhtml", formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." ) + @Description(shortDefinition="See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1", formalDefinition="A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1)." ) protected StringType relation; /** @@ -514,7 +514,7 @@ public class Bundle extends Resource implements IBaseBundle { } /** - * @return {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value + * @return {@link #relation} (A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value */ public StringType getRelationElement() { if (this.relation == null) @@ -534,7 +534,7 @@ public class Bundle extends Resource implements IBaseBundle { } /** - * @param value {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value + * @param value {@link #relation} (A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value */ public BundleLinkComponent setRelationElement(StringType value) { this.relation = value; @@ -542,14 +542,14 @@ public class Bundle extends Resource implements IBaseBundle { } /** - * @return A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + * @return A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1). */ public String getRelation() { return this.relation == null ? null : this.relation.getValue(); } /** - * @param value A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + * @param value A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1). */ public BundleLinkComponent setRelation(String value) { if (this.relation == null) @@ -605,7 +605,7 @@ public class Bundle extends Resource implements IBaseBundle { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].", 0, java.lang.Integer.MAX_VALUE, relation)); + childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).", 0, java.lang.Integer.MAX_VALUE, relation)); childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url)); } @@ -1929,10 +1929,10 @@ public class Bundle extends Resource implements IBaseBundle { protected UriType location; /** - * The etag for the resource, it the operation for the entry produced a versioned resource. + * The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)). */ @Child(name = "etag", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The etag for the resource (if relevant)", formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource." ) + @Description(shortDefinition="The etag for the resource (if relevant)", formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency))." ) protected StringType etag; /** @@ -2061,7 +2061,7 @@ public class Bundle extends Resource implements IBaseBundle { } /** - * @return {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value + * @return {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value */ public StringType getEtagElement() { if (this.etag == null) @@ -2081,7 +2081,7 @@ public class Bundle extends Resource implements IBaseBundle { } /** - * @param value {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value + * @param value {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value */ public BundleEntryResponseComponent setEtagElement(StringType value) { this.etag = value; @@ -2089,14 +2089,14 @@ public class Bundle extends Resource implements IBaseBundle { } /** - * @return The etag for the resource, it the operation for the entry produced a versioned resource. + * @return The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)). */ public String getEtag() { return this.etag == null ? null : this.etag.getValue(); } /** - * @param value The etag for the resource, it the operation for the entry produced a versioned resource. + * @param value The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)). */ public BundleEntryResponseComponent setEtag(String value) { if (Utilities.noString(value)) @@ -2181,7 +2181,7 @@ public class Bundle extends Resource implements IBaseBundle { super.listChildren(childrenList); childrenList.add(new Property("status", "string", "The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.", 0, java.lang.Integer.MAX_VALUE, status)); childrenList.add(new Property("location", "uri", "The location header created by processing this operation.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("etag", "string", "The etag for the resource, it the operation for the entry produced a versioned resource.", 0, java.lang.Integer.MAX_VALUE, etag)); + childrenList.add(new Property("etag", "string", "The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).", 0, java.lang.Integer.MAX_VALUE, etag)); childrenList.add(new Property("lastModified", "instant", "The date/time that the resource was modified on the server.", 0, java.lang.Integer.MAX_VALUE, lastModified)); childrenList.add(new Property("outcome", "Resource", "An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.", 0, java.lang.Integer.MAX_VALUE, outcome)); } @@ -2325,35 +2325,42 @@ public class Bundle extends Resource implements IBaseBundle { @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/bundle-type") protected Enumeration type; + /** + * A persistent identifier for the batch that won't change as a batch is copied from server to server. + */ + @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Persistent identifier for the bundle", formalDefinition="A persistent identifier for the batch that won't change as a batch is copied from server to server." ) + protected Identifier identifier; + /** * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). */ - @Child(name = "total", type = {UnsignedIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Child(name = "total", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." ) protected UnsignedIntType total; /** * A series of links that provide context to this bundle. */ - @Child(name = "link", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "link", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." ) protected List link; /** * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). */ - @Child(name = "entry", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "entry", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Entry in the bundle - will have a resource, or information", formalDefinition="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." ) protected List entry; /** * Digital Signature - base64 encoded. XML DigSIg or a JWT. */ - @Child(name = "signature", type = {Signature.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Child(name = "signature", type = {Signature.class}, order=5, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Digital Signature", formalDefinition="Digital Signature - base64 encoded. XML DigSIg or a JWT." ) protected Signature signature; - private static final long serialVersionUID = -2041954721L; + private static final long serialVersionUID = -1833647607L; /** * Constructor @@ -2415,6 +2422,30 @@ public class Bundle extends Resource implements IBaseBundle { return this; } + /** + * @return {@link #identifier} (A persistent identifier for the batch that won't change as a batch is copied from server to server.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A persistent identifier for the batch that won't change as a batch is copied from server to server.) + */ + public Bundle setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + /** * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value */ @@ -2640,6 +2671,7 @@ public class Bundle extends Resource implements IBaseBundle { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle- how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "A persistent identifier for the batch that won't change as a batch is copied from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("total", "unsignedInt", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total)); childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link)); childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).", 0, java.lang.Integer.MAX_VALUE, entry)); @@ -2650,6 +2682,7 @@ public class Bundle extends Resource implements IBaseBundle { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // UnsignedIntType case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // BundleEntryComponent @@ -2665,6 +2698,9 @@ public class Bundle extends Resource implements IBaseBundle { case 3575610: // type this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration break; + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; case 110549828: // total this.total = castToUnsignedInt(value); // UnsignedIntType break; @@ -2686,6 +2722,8 @@ public class Bundle extends Resource implements IBaseBundle { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier else if (name.equals("total")) this.total = castToUnsignedInt(value); // UnsignedIntType else if (name.equals("link")) @@ -2702,6 +2740,7 @@ public class Bundle extends Resource implements IBaseBundle { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case -1618432855: return getIdentifier(); // Identifier case 110549828: throw new FHIRException("Cannot make property total as it is not a complex type"); // UnsignedIntType case 3321850: return addLink(); // BundleLinkComponent case 96667762: return addEntry(); // BundleEntryComponent @@ -2716,6 +2755,10 @@ public class Bundle extends Resource implements IBaseBundle { if (name.equals("type")) { throw new FHIRException("Cannot call addChild on a primitive type Bundle.type"); } + else if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } else if (name.equals("total")) { throw new FHIRException("Cannot call addChild on a primitive type Bundle.total"); } @@ -2742,6 +2785,7 @@ public class Bundle extends Resource implements IBaseBundle { Bundle dst = new Bundle(); copyValues(dst); dst.type = type == null ? null : type.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); dst.total = total == null ? null : total.copy(); if (link != null) { dst.link = new ArrayList(); @@ -2768,8 +2812,9 @@ public class Bundle extends Resource implements IBaseBundle { if (!(other instanceof Bundle)) return false; Bundle o = (Bundle) other; - return compareDeep(type, o.type, true) && compareDeep(total, o.total, true) && compareDeep(link, o.link, true) - && compareDeep(entry, o.entry, true) && compareDeep(signature, o.signature, true); + return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(total, o.total, true) + && compareDeep(link, o.link, true) && compareDeep(entry, o.entry, true) && compareDeep(signature, o.signature, true) + ; } @Override @@ -2783,8 +2828,8 @@ public class Bundle extends Resource implements IBaseBundle { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, total, link, entry - , signature); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, identifier, total + , link, entry, signature); } @Override @@ -2792,6 +2837,26 @@ public class Bundle extends Resource implements IBaseBundle { return ResourceType.Bundle; } + /** + * Search parameter: identifier + *

+ * Description: Persistent identifier for the bundle
+ * Type: token
+ * Path: Bundle.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Bundle.identifier", description="Persistent identifier for the bundle", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Persistent identifier for the bundle
+ * Type: token
+ * Path: Bundle.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + /** * Search parameter: composition *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CapabilityStatement.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CapabilityStatement.java index 565913623a0..048bd162f26 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CapabilityStatement.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CapabilityStatement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -47,7 +47,7 @@ import org.hl7.fhir.exceptions.FHIRException; * A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. */ @ResourceDef(name="CapabilityStatement", profile="http://hl7.org/fhir/Profile/CapabilityStatement") -@ChildOrder(names={"url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "kind", "instantiates", "software", "implementation", "fhirVersion", "acceptUnknown", "format", "profile", "rest", "messaging", "document"}) +@ChildOrder(names={"url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "kind", "instantiates", "software", "implementation", "fhirVersion", "acceptUnknown", "format", "patchFormat", "implementationGuide", "profile", "rest", "messaging", "document"}) public class CapabilityStatement extends MetadataResource implements IBaseConformance { public enum CapabilityStatementKind { @@ -381,6 +381,10 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor * null */ UPDATE, + /** + * null + */ + PATCH, /** * null */ @@ -414,6 +418,8 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor return VREAD; if ("update".equals(codeString)) return UPDATE; + if ("patch".equals(codeString)) + return PATCH; if ("delete".equals(codeString)) return DELETE; if ("history-instance".equals(codeString)) @@ -434,6 +440,7 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case READ: return "read"; case VREAD: return "vread"; case UPDATE: return "update"; + case PATCH: return "patch"; case DELETE: return "delete"; case HISTORYINSTANCE: return "history-instance"; case HISTORYTYPE: return "history-type"; @@ -447,6 +454,7 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case READ: return "http://hl7.org/fhir/restful-interaction"; case VREAD: return "http://hl7.org/fhir/restful-interaction"; case UPDATE: return "http://hl7.org/fhir/restful-interaction"; + case PATCH: return "http://hl7.org/fhir/restful-interaction"; case DELETE: return "http://hl7.org/fhir/restful-interaction"; case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction"; case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction"; @@ -460,6 +468,7 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case READ: return ""; case VREAD: return ""; case UPDATE: return ""; + case PATCH: return ""; case DELETE: return ""; case HISTORYINSTANCE: return ""; case HISTORYTYPE: return ""; @@ -473,6 +482,7 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case READ: return "read"; case VREAD: return "vread"; case UPDATE: return "update"; + case PATCH: return "patch"; case DELETE: return "delete"; case HISTORYINSTANCE: return "history-instance"; case HISTORYTYPE: return "history-type"; @@ -494,6 +504,8 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor return TypeRestfulInteraction.VREAD; if ("update".equals(codeString)) return TypeRestfulInteraction.UPDATE; + if ("patch".equals(codeString)) + return TypeRestfulInteraction.PATCH; if ("delete".equals(codeString)) return TypeRestfulInteraction.DELETE; if ("history-instance".equals(codeString)) @@ -518,6 +530,8 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor return new Enumeration(this, TypeRestfulInteraction.VREAD); if ("update".equals(codeString)) return new Enumeration(this, TypeRestfulInteraction.UPDATE); + if ("patch".equals(codeString)) + return new Enumeration(this, TypeRestfulInteraction.PATCH); if ("delete".equals(codeString)) return new Enumeration(this, TypeRestfulInteraction.DELETE); if ("history-instance".equals(codeString)) @@ -537,6 +551,8 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor return "vread"; if (code == TypeRestfulInteraction.UPDATE) return "update"; + if (code == TypeRestfulInteraction.PATCH) + return "patch"; if (code == TypeRestfulInteraction.DELETE) return "delete"; if (code == TypeRestfulInteraction.HISTORYINSTANCE) @@ -1026,224 +1042,6 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor } } - public enum SearchModifierCode { - /** - * The search parameter returns resources that have a value or not. - */ - MISSING, - /** - * The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents). - */ - EXACT, - /** - * The search parameter returns resources that include the supplied parameter value anywhere within the field being searched. - */ - CONTAINS, - /** - * The search parameter returns resources that do not contain a match . - */ - NOT, - /** - * The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text. - */ - TEXT, - /** - * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set. - */ - IN, - /** - * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set. - */ - NOTIN, - /** - * The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships). - */ - BELOW, - /** - * The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships). - */ - ABOVE, - /** - * The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.). - */ - TYPE, - /** - * added to help the parsers with the generic types - */ - NULL; - public static SearchModifierCode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("missing".equals(codeString)) - return MISSING; - if ("exact".equals(codeString)) - return EXACT; - if ("contains".equals(codeString)) - return CONTAINS; - if ("not".equals(codeString)) - return NOT; - if ("text".equals(codeString)) - return TEXT; - if ("in".equals(codeString)) - return IN; - if ("not-in".equals(codeString)) - return NOTIN; - if ("below".equals(codeString)) - return BELOW; - if ("above".equals(codeString)) - return ABOVE; - if ("type".equals(codeString)) - return TYPE; - if (Configuration.isAcceptInvalidEnums()) - return null; - else - throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MISSING: return "missing"; - case EXACT: return "exact"; - case CONTAINS: return "contains"; - case NOT: return "not"; - case TEXT: return "text"; - case IN: return "in"; - case NOTIN: return "not-in"; - case BELOW: return "below"; - case ABOVE: return "above"; - case TYPE: return "type"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MISSING: return "http://hl7.org/fhir/search-modifier-code"; - case EXACT: return "http://hl7.org/fhir/search-modifier-code"; - case CONTAINS: return "http://hl7.org/fhir/search-modifier-code"; - case NOT: return "http://hl7.org/fhir/search-modifier-code"; - case TEXT: return "http://hl7.org/fhir/search-modifier-code"; - case IN: return "http://hl7.org/fhir/search-modifier-code"; - case NOTIN: return "http://hl7.org/fhir/search-modifier-code"; - case BELOW: return "http://hl7.org/fhir/search-modifier-code"; - case ABOVE: return "http://hl7.org/fhir/search-modifier-code"; - case TYPE: return "http://hl7.org/fhir/search-modifier-code"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MISSING: return "The search parameter returns resources that have a value or not."; - case EXACT: return "The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents)."; - case CONTAINS: return "The search parameter returns resources that include the supplied parameter value anywhere within the field being searched."; - case NOT: return "The search parameter returns resources that do not contain a match ."; - case TEXT: return "The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text."; - case IN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set."; - case NOTIN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set."; - case BELOW: return "The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships)."; - case ABOVE: return "The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships)."; - case TYPE: return "The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MISSING: return "Missing"; - case EXACT: return "Exact"; - case CONTAINS: return "Contains"; - case NOT: return "Not"; - case TEXT: return "Text"; - case IN: return "In"; - case NOTIN: return "Not In"; - case BELOW: return "Below"; - case ABOVE: return "Above"; - case TYPE: return "Type"; - default: return "?"; - } - } - } - - public static class SearchModifierCodeEnumFactory implements EnumFactory { - public SearchModifierCode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("missing".equals(codeString)) - return SearchModifierCode.MISSING; - if ("exact".equals(codeString)) - return SearchModifierCode.EXACT; - if ("contains".equals(codeString)) - return SearchModifierCode.CONTAINS; - if ("not".equals(codeString)) - return SearchModifierCode.NOT; - if ("text".equals(codeString)) - return SearchModifierCode.TEXT; - if ("in".equals(codeString)) - return SearchModifierCode.IN; - if ("not-in".equals(codeString)) - return SearchModifierCode.NOTIN; - if ("below".equals(codeString)) - return SearchModifierCode.BELOW; - if ("above".equals(codeString)) - return SearchModifierCode.ABOVE; - if ("type".equals(codeString)) - return SearchModifierCode.TYPE; - throw new IllegalArgumentException("Unknown SearchModifierCode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("missing".equals(codeString)) - return new Enumeration(this, SearchModifierCode.MISSING); - if ("exact".equals(codeString)) - return new Enumeration(this, SearchModifierCode.EXACT); - if ("contains".equals(codeString)) - return new Enumeration(this, SearchModifierCode.CONTAINS); - if ("not".equals(codeString)) - return new Enumeration(this, SearchModifierCode.NOT); - if ("text".equals(codeString)) - return new Enumeration(this, SearchModifierCode.TEXT); - if ("in".equals(codeString)) - return new Enumeration(this, SearchModifierCode.IN); - if ("not-in".equals(codeString)) - return new Enumeration(this, SearchModifierCode.NOTIN); - if ("below".equals(codeString)) - return new Enumeration(this, SearchModifierCode.BELOW); - if ("above".equals(codeString)) - return new Enumeration(this, SearchModifierCode.ABOVE); - if ("type".equals(codeString)) - return new Enumeration(this, SearchModifierCode.TYPE); - throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); - } - public String toCode(SearchModifierCode code) { - if (code == SearchModifierCode.MISSING) - return "missing"; - if (code == SearchModifierCode.EXACT) - return "exact"; - if (code == SearchModifierCode.CONTAINS) - return "contains"; - if (code == SearchModifierCode.NOT) - return "not"; - if (code == SearchModifierCode.TEXT) - return "text"; - if (code == SearchModifierCode.IN) - return "in"; - if (code == SearchModifierCode.NOTIN) - return "not-in"; - if (code == SearchModifierCode.BELOW) - return "below"; - if (code == SearchModifierCode.ABOVE) - return "above"; - if (code == SearchModifierCode.TYPE) - return "type"; - return "?"; - } - public String toSystem(SearchModifierCode code) { - return code.getSystem(); - } - } - public enum SystemRestfulInteraction { /** * null @@ -4630,7 +4428,7 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor * Coded identifier of the operation, supported by the system resource. */ @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="read | vread | update | delete | history-instance | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." ) + @Description(shortDefinition="read | vread | update | patch | delete | history-instance | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/type-restful-interaction") protected Enumeration code; @@ -4884,30 +4682,7 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor @Description(shortDefinition="Server-specific usage", formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms." ) protected StringType documentation; - /** - * Types of resource (if a resource is referenced). - */ - @Child(name = "target", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types") - protected List target; - - /** - * A modifier supported for the search parameter. - */ - @Child(name = "modifier", type = {CodeType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="missing | exact | contains | not | text | in | not-in | below | above | type", formalDefinition="A modifier supported for the search parameter." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-modifier-code") - protected List> modifier; - - /** - * Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from CapabilityStatement.rest.resource.searchParam.name on the target resource type. - */ - @Child(name = "chain", type = {StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Chained names supported", formalDefinition="Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from CapabilityStatement.rest.resource.searchParam.name on the target resource type." ) - protected List chain; - - private static final long serialVersionUID = -1020405086L; + private static final long serialVersionUID = 72133006L; /** * Constructor @@ -5113,198 +4888,12 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor return this; } - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - /** - * @return Returns a reference to this for easy method chaining - */ - public CapabilityStatementRestResourceSearchParamComponent setTarget(List theTarget) { - this.target = theTarget; - return this; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (CodeType item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - public CodeType addTargetElement() {//2 - CodeType t = new CodeType(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public CapabilityStatementRestResourceSearchParamComponent addTarget(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public boolean hasTarget(String value) { - if (this.target == null) - return false; - for (CodeType v : this.target) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #modifier} (A modifier supported for the search parameter.) - */ - public List> getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList>(); - return this.modifier; - } - - /** - * @return Returns a reference to this for easy method chaining - */ - public CapabilityStatementRestResourceSearchParamComponent setModifier(List> theModifier) { - this.modifier = theModifier; - return this; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Enumeration item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (A modifier supported for the search parameter.) - */ - public Enumeration addModifierElement() {//2 - Enumeration t = new Enumeration(new SearchModifierCodeEnumFactory()); - if (this.modifier == null) - this.modifier = new ArrayList>(); - this.modifier.add(t); - return t; - } - - /** - * @param value {@link #modifier} (A modifier supported for the search parameter.) - */ - public CapabilityStatementRestResourceSearchParamComponent addModifier(SearchModifierCode value) { //1 - Enumeration t = new Enumeration(new SearchModifierCodeEnumFactory()); - t.setValue(value); - if (this.modifier == null) - this.modifier = new ArrayList>(); - this.modifier.add(t); - return this; - } - - /** - * @param value {@link #modifier} (A modifier supported for the search parameter.) - */ - public boolean hasModifier(SearchModifierCode value) { - if (this.modifier == null) - return false; - for (Enumeration v : this.modifier) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from CapabilityStatement.rest.resource.searchParam.name on the target resource type.) - */ - public List getChain() { - if (this.chain == null) - this.chain = new ArrayList(); - return this.chain; - } - - /** - * @return Returns a reference to this for easy method chaining - */ - public CapabilityStatementRestResourceSearchParamComponent setChain(List theChain) { - this.chain = theChain; - return this; - } - - public boolean hasChain() { - if (this.chain == null) - return false; - for (StringType item : this.chain) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from CapabilityStatement.rest.resource.searchParam.name on the target resource type.) - */ - public StringType addChainElement() {//2 - StringType t = new StringType(); - if (this.chain == null) - this.chain = new ArrayList(); - this.chain.add(t); - return t; - } - - /** - * @param value {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from CapabilityStatement.rest.resource.searchParam.name on the target resource type.) - */ - public CapabilityStatementRestResourceSearchParamComponent addChain(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.chain == null) - this.chain = new ArrayList(); - this.chain.add(t); - return this; - } - - /** - * @param value {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from CapabilityStatement.rest.resource.searchParam.name on the target resource type.) - */ - public boolean hasChain(String value) { - if (this.chain == null) - return false; - for (StringType v : this.chain) - if (v.equals(value)) // string - return true; - return false; - } - protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, java.lang.Integer.MAX_VALUE, name)); childrenList.add(new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, java.lang.Integer.MAX_VALUE, definition)); childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("modifier", "code", "A modifier supported for the search parameter.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("chain", "string", "Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from CapabilityStatement.rest.resource.searchParam.name on the target resource type.", 0, java.lang.Integer.MAX_VALUE, chain)); } @Override @@ -5314,9 +4903,6 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // CodeType - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Enumeration - case 94623425: /*chain*/ return this.chain == null ? new Base[0] : this.chain.toArray(new Base[this.chain.size()]); // StringType default: return super.getProperty(hash, name, checkValid); } @@ -5337,15 +4923,6 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case 1587405498: // documentation this.documentation = castToString(value); // StringType break; - case -880905839: // target - this.getTarget().add(castToCode(value)); // CodeType - break; - case -615513385: // modifier - this.getModifier().add(new SearchModifierCodeEnumFactory().fromType(value)); // Enumeration - break; - case 94623425: // chain - this.getChain().add(castToString(value)); // StringType - break; default: super.setProperty(hash, name, value); } @@ -5361,12 +4938,6 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration else if (name.equals("documentation")) this.documentation = castToString(value); // StringType - else if (name.equals("target")) - this.getTarget().add(castToCode(value)); - else if (name.equals("modifier")) - this.getModifier().add(new SearchModifierCodeEnumFactory().fromType(value)); - else if (name.equals("chain")) - this.getChain().add(castToString(value)); else super.setProperty(name, value); } @@ -5378,9 +4949,6 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // UriType case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // CodeType - case -615513385: throw new FHIRException("Cannot make property modifier as it is not a complex type"); // Enumeration - case 94623425: throw new FHIRException("Cannot make property chain as it is not a complex type"); // StringType default: return super.makeProperty(hash, name); } @@ -5400,15 +4968,6 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor else if (name.equals("documentation")) { throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation"); } - else if (name.equals("target")) { - throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.target"); - } - else if (name.equals("modifier")) { - throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.modifier"); - } - else if (name.equals("chain")) { - throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.chain"); - } else return super.addChild(name); } @@ -5420,21 +4979,6 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor dst.definition = definition == null ? null : definition.copy(); dst.type = type == null ? null : type.copy(); dst.documentation = documentation == null ? null : documentation.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (CodeType i : target) - dst.target.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList>(); - for (Enumeration i : modifier) - dst.modifier.add(i.copy()); - }; - if (chain != null) { - dst.chain = new ArrayList(); - for (StringType i : chain) - dst.chain.add(i.copy()); - }; return dst; } @@ -5446,8 +4990,7 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor return false; CapabilityStatementRestResourceSearchParamComponent o = (CapabilityStatementRestResourceSearchParamComponent) other; return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(type, o.type, true) - && compareDeep(documentation, o.documentation, true) && compareDeep(target, o.target, true) && compareDeep(modifier, o.modifier, true) - && compareDeep(chain, o.chain, true); + && compareDeep(documentation, o.documentation, true); } @Override @@ -5458,13 +5001,12 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor return false; CapabilityStatementRestResourceSearchParamComponent o = (CapabilityStatementRestResourceSearchParamComponent) other; return compareValues(name, o.name, true) && compareValues(definition, o.definition, true) && compareValues(type, o.type, true) - && compareValues(documentation, o.documentation, true) && compareValues(target, o.target, true) && compareValues(modifier, o.modifier, true) - && compareValues(chain, o.chain, true); + && compareValues(documentation, o.documentation, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, definition, type, documentation - , target, modifier, chain); + ); } public String fhirType() { @@ -7395,7 +6937,7 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor * Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so. */ @Child(name = "instantiates", type = {UriType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Canonical URL of service implemented/used by software", formalDefinition="Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so." ) + @Description(shortDefinition="Canonical URL of another capability statement this implements", formalDefinition="Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so." ) protected List instantiates; /** @@ -7435,13 +6977,27 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor protected List format; /** - * A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}. + * A list of the patch formats supported by this implementation using their content types. */ - @Child(name = "profile", type = {StructureDefinition.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Profiles for use cases supported", formalDefinition="A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}." ) + @Child(name = "patchFormat", type = {CodeType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Patch formats supported", formalDefinition="A list of the patch formats supported by this implementation using their content types." ) + protected List patchFormat; + + /** + * A list of implementation guides that the server does (or should) support in their entirety. + */ + @Child(name = "implementationGuide", type = {UriType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Implementation Guide supported", formalDefinition="A list of implementation guides that the server does (or should) support in their entirety." ) + protected List implementationGuide; + + /** + * A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses). + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Profiles for use cases supported", formalDefinition="A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses)." ) protected List profile; /** - * The actual objects that are the target of the reference (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + * The actual objects that are the target of the reference (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).) */ protected List profileTarget; @@ -7449,25 +7005,25 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor /** * A definition of the restful capabilities of the solution, if any. */ - @Child(name = "rest", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "rest", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." ) protected List rest; /** * A description of the messaging capabilities of the solution. */ - @Child(name = "messaging", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "messaging", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." ) protected List messaging; /** * A document definition. */ - @Child(name = "document", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "document", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Document definition", formalDefinition="A document definition." ) protected List document; - private static final long serialVersionUID = 1423369803L; + private static final long serialVersionUID = 227177541L; /** * Constructor @@ -8480,7 +8036,129 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor } /** - * @return {@link #profile} (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) + * @return {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.) + */ + public List getPatchFormat() { + if (this.patchFormat == null) + this.patchFormat = new ArrayList(); + return this.patchFormat; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public CapabilityStatement setPatchFormat(List thePatchFormat) { + this.patchFormat = thePatchFormat; + return this; + } + + public boolean hasPatchFormat() { + if (this.patchFormat == null) + return false; + for (CodeType item : this.patchFormat) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.) + */ + public CodeType addPatchFormatElement() {//2 + CodeType t = new CodeType(); + if (this.patchFormat == null) + this.patchFormat = new ArrayList(); + this.patchFormat.add(t); + return t; + } + + /** + * @param value {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.) + */ + public CapabilityStatement addPatchFormat(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.patchFormat == null) + this.patchFormat = new ArrayList(); + this.patchFormat.add(t); + return this; + } + + /** + * @param value {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.) + */ + public boolean hasPatchFormat(String value) { + if (this.patchFormat == null) + return false; + for (CodeType v : this.patchFormat) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.) + */ + public List getImplementationGuide() { + if (this.implementationGuide == null) + this.implementationGuide = new ArrayList(); + return this.implementationGuide; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public CapabilityStatement setImplementationGuide(List theImplementationGuide) { + this.implementationGuide = theImplementationGuide; + return this; + } + + public boolean hasImplementationGuide() { + if (this.implementationGuide == null) + return false; + for (UriType item : this.implementationGuide) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.) + */ + public UriType addImplementationGuideElement() {//2 + UriType t = new UriType(); + if (this.implementationGuide == null) + this.implementationGuide = new ArrayList(); + this.implementationGuide.add(t); + return t; + } + + /** + * @param value {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.) + */ + public CapabilityStatement addImplementationGuide(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.implementationGuide == null) + this.implementationGuide = new ArrayList(); + this.implementationGuide.add(t); + return this; + } + + /** + * @param value {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.) + */ + public boolean hasImplementationGuide(String value) { + if (this.implementationGuide == null) + return false; + for (UriType v : this.implementationGuide) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).) */ public List getProfile() { if (this.profile == null) @@ -8736,7 +8414,9 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this capability statement is based.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); childrenList.add(new Property("acceptUnknown", "code", "A code that indicates whether the application accepts unknown elements or extensions when reading resources.", 0, java.lang.Integer.MAX_VALUE, acceptUnknown)); childrenList.add(new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("patchFormat", "code", "A list of the patch formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, patchFormat)); + childrenList.add(new Property("implementationGuide", "uri", "A list of implementation guides that the server does (or should) support in their entirety.", 0, java.lang.Integer.MAX_VALUE, implementationGuide)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, java.lang.Integer.MAX_VALUE, profile)); childrenList.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest)); childrenList.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging)); childrenList.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document)); @@ -8766,6 +8446,8 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType case -1862642142: /*acceptUnknown*/ return this.acceptUnknown == null ? new Base[0] : new Base[] {this.acceptUnknown}; // Enumeration case -1268779017: /*format*/ return this.format == null ? new Base[0] : this.format.toArray(new Base[this.format.size()]); // CodeType + case 172338783: /*patchFormat*/ return this.patchFormat == null ? new Base[0] : this.patchFormat.toArray(new Base[this.patchFormat.size()]); // CodeType + case 156966506: /*implementationGuide*/ return this.implementationGuide == null ? new Base[0] : this.implementationGuide.toArray(new Base[this.implementationGuide.size()]); // UriType case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference case 3496916: /*rest*/ return this.rest == null ? new Base[0] : this.rest.toArray(new Base[this.rest.size()]); // CapabilityStatementRestComponent case -1440008444: /*messaging*/ return this.messaging == null ? new Base[0] : this.messaging.toArray(new Base[this.messaging.size()]); // CapabilityStatementMessagingComponent @@ -8841,6 +8523,12 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case -1268779017: // format this.getFormat().add(castToCode(value)); // CodeType break; + case 172338783: // patchFormat + this.getPatchFormat().add(castToCode(value)); // CodeType + break; + case 156966506: // implementationGuide + this.getImplementationGuide().add(castToUri(value)); // UriType + break; case -309425751: // profile this.getProfile().add(castToReference(value)); // Reference break; @@ -8902,6 +8590,10 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor this.acceptUnknown = new UnknownContentCodeEnumFactory().fromType(value); // Enumeration else if (name.equals("format")) this.getFormat().add(castToCode(value)); + else if (name.equals("patchFormat")) + this.getPatchFormat().add(castToCode(value)); + else if (name.equals("implementationGuide")) + this.getImplementationGuide().add(castToUri(value)); else if (name.equals("profile")) this.getProfile().add(castToReference(value)); else if (name.equals("rest")) @@ -8938,6 +8630,8 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor case 461006061: throw new FHIRException("Cannot make property fhirVersion as it is not a complex type"); // IdType case -1862642142: throw new FHIRException("Cannot make property acceptUnknown as it is not a complex type"); // Enumeration case -1268779017: throw new FHIRException("Cannot make property format as it is not a complex type"); // CodeType + case 172338783: throw new FHIRException("Cannot make property patchFormat as it is not a complex type"); // CodeType + case 156966506: throw new FHIRException("Cannot make property implementationGuide as it is not a complex type"); // UriType case -309425751: return addProfile(); // Reference case 3496916: return addRest(); // CapabilityStatementRestComponent case -1440008444: return addMessaging(); // CapabilityStatementMessagingComponent @@ -9014,6 +8708,12 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor else if (name.equals("format")) { throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.format"); } + else if (name.equals("patchFormat")) { + throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.patchFormat"); + } + else if (name.equals("implementationGuide")) { + throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.implementationGuide"); + } else if (name.equals("profile")) { return addProfile(); } @@ -9079,6 +8779,16 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor for (CodeType i : format) dst.format.add(i.copy()); }; + if (patchFormat != null) { + dst.patchFormat = new ArrayList(); + for (CodeType i : patchFormat) + dst.patchFormat.add(i.copy()); + }; + if (implementationGuide != null) { + dst.implementationGuide = new ArrayList(); + for (UriType i : implementationGuide) + dst.implementationGuide.add(i.copy()); + }; if (profile != null) { dst.profile = new ArrayList(); for (Reference i : profile) @@ -9116,8 +8826,9 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor return compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true) && compareDeep(kind, o.kind, true) && compareDeep(instantiates, o.instantiates, true) && compareDeep(software, o.software, true) && compareDeep(implementation, o.implementation, true) && compareDeep(fhirVersion, o.fhirVersion, true) && compareDeep(acceptUnknown, o.acceptUnknown, true) - && compareDeep(format, o.format, true) && compareDeep(profile, o.profile, true) && compareDeep(rest, o.rest, true) - && compareDeep(messaging, o.messaging, true) && compareDeep(document, o.document, true); + && compareDeep(format, o.format, true) && compareDeep(patchFormat, o.patchFormat, true) && compareDeep(implementationGuide, o.implementationGuide, true) + && compareDeep(profile, o.profile, true) && compareDeep(rest, o.rest, true) && compareDeep(messaging, o.messaging, true) + && compareDeep(document, o.document, true); } @Override @@ -9129,13 +8840,14 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor CapabilityStatement o = (CapabilityStatement) other; return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(kind, o.kind, true) && compareValues(instantiates, o.instantiates, true) && compareValues(fhirVersion, o.fhirVersion, true) - && compareValues(acceptUnknown, o.acceptUnknown, true) && compareValues(format, o.format, true); + && compareValues(acceptUnknown, o.acceptUnknown, true) && compareValues(format, o.format, true) && compareValues(patchFormat, o.patchFormat, true) + && compareValues(implementationGuide, o.implementationGuide, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(purpose, copyright, kind - , instantiates, software, implementation, fhirVersion, acceptUnknown, format, profile - , rest, messaging, document); + , instantiates, software, implementation, fhirVersion, acceptUnknown, format, patchFormat + , implementationGuide, profile, rest, messaging, document); } @Override @@ -9495,6 +9207,26 @@ public class CapabilityStatement extends MetadataResource implements IBaseConfor */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT); + /** + * Search parameter: guide + *

+ * Description: Implementation Guide supported
+ * Type: uri
+ * Path: CapabilityStatement.implementationGuide
+ *

+ */ + @SearchParamDefinition(name="guide", path="CapabilityStatement.implementationGuide", description="Implementation Guide supported", type="uri" ) + public static final String SP_GUIDE = "guide"; + /** + * Fluent Client search parameter constant for guide + *

+ * Description: Implementation Guide supported
+ * Type: uri
+ * Path: CapabilityStatement.implementationGuide
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam GUIDE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_GUIDE); + /** * Search parameter: status *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CarePlan.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CarePlan.java index a0bcc578fba..05119018a9d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CarePlan.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CarePlan.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -2374,7 +2374,7 @@ public class CarePlan extends DomainResource { /** * Identifies the patient or group whose intended care is described by the plan. */ - @Child(name = "subject", type = {Patient.class, Group.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Child(name = "subject", type = {Patient.class, Group.class}, order=4, min=1, max=1, modifier=false, summary=true) @Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient or group whose intended care is described by the plan." ) protected Reference subject; @@ -2514,9 +2514,10 @@ public class CarePlan extends DomainResource { /** * Constructor */ - public CarePlan(Enumeration status) { + public CarePlan(Enumeration status, Reference subject) { super(); this.status = status; + this.subject = subject; } /** @@ -4018,7 +4019,7 @@ public class CarePlan extends DomainResource { * Path:
*

*/ - @SearchParamDefinition(name="related", path="", description="A combination of the type of relationship and the related plan", type="composite", compositeOf={"relatedcode", "relatedplan"} ) + @SearchParamDefinition(name="related", path="CarePlan.relatedPlan", description="A combination of the type of relationship and the related plan", type="composite", compositeOf={"relatedcode", "relatedplan"} ) public static final String SP_RELATED = "related"; /** * Fluent Client search parameter constant for related diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CareTeam.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CareTeam.java index d9b11ca1a79..db5142ead95 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CareTeam.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CareTeam.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Claim.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Claim.java index 1d4bd91f088..f23a4e80276 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Claim.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Claim.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -52,19 +52,19 @@ public class Claim extends DomainResource { public enum ClaimStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -98,19 +98,19 @@ public class Claim extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/claim-status"; - case CANCELLED: return "http://hl7.org/fhir/claim-status"; - case DRAFT: return "http://hl7.org/fhir/claim-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/claim-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -119,7 +119,7 @@ public class Claim extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -311,10 +311,10 @@ public class Claim extends DomainResource { /** * For example prior or umbrella. */ - @Child(name = "relationship", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "relationship", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="How the reference claim is related", formalDefinition="For example prior or umbrella." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/related-claim-relationship") - protected Coding relationship; + protected CodeableConcept relationship; /** * An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # . @@ -323,7 +323,7 @@ public class Claim extends DomainResource { @Description(shortDefinition="Related file or case reference", formalDefinition="An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # ." ) protected Identifier reference; - private static final long serialVersionUID = -515151214L; + private static final long serialVersionUID = -379338905L; /** * Constructor @@ -379,12 +379,12 @@ public class Claim extends DomainResource { /** * @return {@link #relationship} (For example prior or umbrella.) */ - public Coding getRelationship() { + public CodeableConcept getRelationship() { if (this.relationship == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create RelatedClaimComponent.relationship"); else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc + this.relationship = new CodeableConcept(); // cc return this.relationship; } @@ -395,7 +395,7 @@ public class Claim extends DomainResource { /** * @param value {@link #relationship} (For example prior or umbrella.) */ - public RelatedClaimComponent setRelationship(Coding value) { + public RelatedClaimComponent setRelationship(CodeableConcept value) { this.relationship = value; return this; } @@ -427,7 +427,7 @@ public class Claim extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("claim", "Reference(Claim)", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, claim)); - childrenList.add(new Property("relationship", "Coding", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("relationship", "CodeableConcept", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship)); childrenList.add(new Property("reference", "Identifier", "An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .", 0, java.lang.Integer.MAX_VALUE, reference)); } @@ -435,7 +435,7 @@ public class Claim extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Reference - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Identifier default: return super.getProperty(hash, name, checkValid); } @@ -449,7 +449,7 @@ public class Claim extends DomainResource { this.claim = castToReference(value); // Reference break; case -261851592: // relationship - this.relationship = castToCoding(value); // Coding + this.relationship = castToCodeableConcept(value); // CodeableConcept break; case -925155509: // reference this.reference = castToIdentifier(value); // Identifier @@ -464,7 +464,7 @@ public class Claim extends DomainResource { if (name.equals("claim")) this.claim = castToReference(value); // Reference else if (name.equals("relationship")) - this.relationship = castToCoding(value); // Coding + this.relationship = castToCodeableConcept(value); // CodeableConcept else if (name.equals("reference")) this.reference = castToIdentifier(value); // Identifier else @@ -475,7 +475,7 @@ public class Claim extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 94742588: return getClaim(); // Reference - case -261851592: return getRelationship(); // Coding + case -261851592: return getRelationship(); // CodeableConcept case -925155509: return getReference(); // Identifier default: return super.makeProperty(hash, name); } @@ -489,7 +489,7 @@ public class Claim extends DomainResource { return this.claim; } else if (name.equals("relationship")) { - this.relationship = new Coding(); + this.relationship = new CodeableConcept(); return this.relationship; } else if (name.equals("reference")) { @@ -547,10 +547,10 @@ public class Claim extends DomainResource { /** * Type of Party to be reimbursed: Subscriber, provider, other. */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of party: Subscriber, Provider, other", formalDefinition="Type of Party to be reimbursed: Subscriber, provider, other." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payeetype") - protected Coding type; + protected CodeableConcept type; /** * organization | patient | practitioner | relatedperson. @@ -572,7 +572,7 @@ public class Claim extends DomainResource { */ protected Resource partyTarget; - private static final long serialVersionUID = 140598850L; + private static final long serialVersionUID = -1395150769L; /** * Constructor @@ -584,7 +584,7 @@ public class Claim extends DomainResource { /** * Constructor */ - public PayeeComponent(Coding type) { + public PayeeComponent(CodeableConcept type) { super(); this.type = type; } @@ -592,12 +592,12 @@ public class Claim extends DomainResource { /** * @return {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) */ - public Coding getType() { + public CodeableConcept 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(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -608,7 +608,7 @@ public class Claim extends DomainResource { /** * @param value {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) */ - public PayeeComponent setType(Coding value) { + public PayeeComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -678,7 +678,7 @@ public class Claim extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("resourceType", "Coding", "organization | patient | practitioner | relatedperson.", 0, java.lang.Integer.MAX_VALUE, resourceType)); childrenList.add(new Property("party", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, party)); } @@ -686,7 +686,7 @@ public class Claim extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case -384364440: /*resourceType*/ return this.resourceType == null ? new Base[0] : new Base[] {this.resourceType}; // Coding case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference default: return super.getProperty(hash, name, checkValid); @@ -698,7 +698,7 @@ public class Claim extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case -384364440: // resourceType this.resourceType = castToCoding(value); // Coding @@ -714,7 +714,7 @@ public class Claim extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("resourceType")) this.resourceType = castToCoding(value); // Coding else if (name.equals("party")) @@ -726,7 +726,7 @@ public class Claim extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case -384364440: return getResourceType(); // Coding case 106437350: return getParty(); // Reference default: return super.makeProperty(hash, name); @@ -737,7 +737,7 @@ public class Claim extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("resourceType")) { @@ -792,6 +792,388 @@ public class Claim extends DomainResource { } + } + + @Block() + public static class CareTeamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Sequence of the careTeam which serves to order and provide a link. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Number to covey order of careTeam", formalDefinition="Sequence of the careTeam which serves to order and provide a link." ) + protected PositiveIntType sequence; + + /** + * Member of the team who provided the overall service. + */ + @Child(name = "provider", type = {Practitioner.class, Organization.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Provider individual or organization", formalDefinition="Member of the team who provided the overall service." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (Member of the team who provided the overall service.) + */ + protected Resource providerTarget; + + /** + * The party who is billing and responsible for the claimed good or service rendered to the patient. + */ + @Child(name = "responsible", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Billing provider", formalDefinition="The party who is billing and responsible for the claimed good or service rendered to the patient." ) + protected BooleanType responsible; + + /** + * The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Role on the team", formalDefinition="The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-careteamrole") + protected CodeableConcept role; + + /** + * The qualification which is applicable for this service. + */ + @Child(name = "qualification", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provider-qualification") + protected CodeableConcept qualification; + + private static final long serialVersionUID = 1758966968L; + + /** + * Constructor + */ + public CareTeamComponent() { + super(); + } + + /** + * Constructor + */ + public CareTeamComponent(PositiveIntType sequence, Reference provider) { + super(); + this.sequence = sequence; + this.provider = provider; + } + + /** + * @return {@link #sequence} (Sequence of the careTeam which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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 the careTeam which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CareTeamComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of the careTeam which serves to order and provide a link. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value Sequence of the careTeam which serves to order and provide a link. + */ + public CareTeamComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #provider} (Member of the team who provided the overall service.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (Member of the team who provided the overall service.) + */ + public CareTeamComponent 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. (Member of the team who provided the overall service.) + */ + public Resource getProviderTarget() { + 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. (Member of the team who provided the overall service.) + */ + public CareTeamComponent setProviderTarget(Resource value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #responsible} (The party who is billing and responsible for the claimed good or service rendered to the patient.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public BooleanType getResponsibleElement() { + if (this.responsible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.responsible"); + else if (Configuration.doAutoCreate()) + this.responsible = new BooleanType(); // bb + return this.responsible; + } + + public boolean hasResponsibleElement() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + public boolean hasResponsible() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + /** + * @param value {@link #responsible} (The party who is billing and responsible for the claimed good or service rendered to the patient.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public CareTeamComponent setResponsibleElement(BooleanType value) { + this.responsible = value; + return this; + } + + /** + * @return The party who is billing and responsible for the claimed good or service rendered to the patient. + */ + public boolean getResponsible() { + return this.responsible == null || this.responsible.isEmpty() ? false : this.responsible.getValue(); + } + + /** + * @param value The party who is billing and responsible for the claimed good or service rendered to the patient. + */ + public CareTeamComponent setResponsible(boolean value) { + if (this.responsible == null) + this.responsible = new BooleanType(); + this.responsible.setValue(value); + return this; + } + + /** + * @return {@link #role} (The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.) + */ + public CareTeamComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + /** + * @return {@link #qualification} (The qualification which is applicable for this service.) + */ + public CodeableConcept getQualification() { + if (this.qualification == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.qualification"); + else if (Configuration.doAutoCreate()) + this.qualification = new CodeableConcept(); // cc + return this.qualification; + } + + public boolean hasQualification() { + return this.qualification != null && !this.qualification.isEmpty(); + } + + /** + * @param value {@link #qualification} (The qualification which is applicable for this service.) + */ + public CareTeamComponent setQualification(CodeableConcept value) { + this.qualification = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "Sequence of the careTeam which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("provider", "Reference(Practitioner|Organization)", "Member of the team who provided the overall service.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("responsible", "boolean", "The party who is billing and responsible for the claimed good or service rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, responsible)); + childrenList.add(new Property("role", "CodeableConcept", "The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("qualification", "CodeableConcept", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, qualification)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference + case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // BooleanType + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept + case -631333393: /*qualification*/ return this.qualification == null ? new Base[0] : new Base[] {this.qualification}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case -987494927: // provider + this.provider = castToReference(value); // Reference + break; + case 1847674614: // responsible + this.responsible = castToBoolean(value); // BooleanType + break; + case 3506294: // role + this.role = castToCodeableConcept(value); // CodeableConcept + break; + case -631333393: // qualification + this.qualification = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("provider")) + this.provider = castToReference(value); // Reference + else if (name.equals("responsible")) + this.responsible = castToBoolean(value); // BooleanType + else if (name.equals("role")) + this.role = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("qualification")) + this.qualification = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case -987494927: return getProvider(); // Reference + case 1847674614: throw new FHIRException("Cannot make property responsible as it is not a complex type"); // BooleanType + case 3506294: return getRole(); // CodeableConcept + case -631333393: return getQualification(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); + } + else if (name.equals("provider")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("responsible")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.responsible"); + } + else if (name.equals("role")) { + this.role = new CodeableConcept(); + return this.role; + } + else if (name.equals("qualification")) { + this.qualification = new CodeableConcept(); + return this.qualification; + } + else + return super.addChild(name); + } + + public CareTeamComponent copy() { + CareTeamComponent dst = new CareTeamComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.responsible = responsible == null ? null : responsible.copy(); + dst.role = role == null ? null : role.copy(); + dst.qualification = qualification == null ? null : qualification.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CareTeamComponent)) + return false; + CareTeamComponent o = (CareTeamComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(provider, o.provider, true) && compareDeep(responsible, o.responsible, true) + && compareDeep(role, o.role, true) && compareDeep(qualification, o.qualification, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CareTeamComponent)) + return false; + CareTeamComponent o = (CareTeamComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(responsible, o.responsible, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, provider, responsible + , role, qualification); + } + + public String fhirType() { + return "Claim.careTeam"; + + } + } @Block() @@ -799,18 +1181,18 @@ public class Claim extends DomainResource { /** * The general class of the information supplied: information; exception; accident, employment; onset, etc. */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Category of information", formalDefinition="The general class of the information supplied: information; exception; accident, employment; onset, etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-informationcategory") - protected Coding category; + protected CodeableConcept category; /** * System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication. */ - @Child(name = "code", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of information", formalDefinition="System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-exception") - protected Coding code; + protected CodeableConcept code; /** * The date when or period to which this information refers. @@ -820,13 +1202,21 @@ public class Claim extends DomainResource { protected Type timing; /** - * Additional data. + * Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. */ - @Child(name = "value", type = {StringType.class, Quantity.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Additional Data", formalDefinition="Additional data." ) + @Child(name = "value", type = {StringType.class, Quantity.class, Attachment.class, Reference.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Additional Data or supporting information", formalDefinition="Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data." ) protected Type value; - private static final long serialVersionUID = 1771573412L; + /** + * For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content. + */ + @Child(name = "reason", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reason associated with the information", formalDefinition="For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/missing-tooth-reason") + protected CodeableConcept reason; + + private static final long serialVersionUID = -1504794861L; /** * Constructor @@ -838,7 +1228,7 @@ public class Claim extends DomainResource { /** * Constructor */ - public SpecialConditionComponent(Coding category) { + public SpecialConditionComponent(CodeableConcept category) { super(); this.category = category; } @@ -846,12 +1236,12 @@ public class Claim extends DomainResource { /** * @return {@link #category} (The general class of the information supplied: information; exception; accident, employment; onset, etc.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create SpecialConditionComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -862,7 +1252,7 @@ public class Claim extends DomainResource { /** * @param value {@link #category} (The general class of the information supplied: information; exception; accident, employment; onset, etc.) */ - public SpecialConditionComponent setCategory(Coding value) { + public SpecialConditionComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -870,12 +1260,12 @@ public class Claim extends DomainResource { /** * @return {@link #code} (System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) */ - public Coding getCode() { + public CodeableConcept getCode() { if (this.code == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create SpecialConditionComponent.code"); else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc + this.code = new CodeableConcept(); // cc return this.code; } @@ -886,7 +1276,7 @@ public class Claim extends DomainResource { /** * @param value {@link #code} (System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) */ - public SpecialConditionComponent setCode(Coding value) { + public SpecialConditionComponent setCode(CodeableConcept value) { this.code = value; return this; } @@ -937,14 +1327,14 @@ public class Claim extends DomainResource { } /** - * @return {@link #value} (Additional data.) + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) */ public Type getValue() { return this.value; } /** - * @return {@link #value} (Additional data.) + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) */ public StringType getValueStringType() throws FHIRException { if (!(this.value instanceof StringType)) @@ -957,7 +1347,7 @@ public class Claim extends DomainResource { } /** - * @return {@link #value} (Additional data.) + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) */ public Quantity getValueQuantity() throws FHIRException { if (!(this.value instanceof Quantity)) @@ -969,33 +1359,85 @@ public class Claim extends DomainResource { return this.value instanceof Quantity; } + /** + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) + */ + public Attachment getValueAttachment() throws FHIRException { + if (!(this.value instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + public boolean hasValueAttachment() { + return this.value instanceof Attachment; + } + + /** + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) + */ + public Reference getValueReference() throws FHIRException { + if (!(this.value instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Reference) this.value; + } + + public boolean hasValueReference() { + return this.value instanceof Reference; + } + public boolean hasValue() { return this.value != null && !this.value.isEmpty(); } /** - * @param value {@link #value} (Additional data.) + * @param value {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) */ public SpecialConditionComponent setValue(Type value) { this.value = value; return this; } + /** + * @return {@link #reason} (For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecialConditionComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content.) + */ + public SpecialConditionComponent setReason(CodeableConcept value) { + this.reason = value; + return this; + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "The general class of the information supplied: information; exception; accident, employment; onset, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "Coding", "System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "CodeableConcept", "The general class of the information supplied: information; exception; accident, employment; onset, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, code)); childrenList.add(new Property("timing[x]", "date|Period", "The date when or period to which this information refers.", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("value[x]", "string|Quantity", "Additional data.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("value[x]", "string|Quantity|Attachment|Reference(Any)", "Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("reason", "CodeableConcept", "For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content.", 0, java.lang.Integer.MAX_VALUE, reason)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -1005,10 +1447,10 @@ public class Claim extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 3059181: // code - this.code = castToCoding(value); // Coding + this.code = castToCodeableConcept(value); // CodeableConcept break; case -873664438: // timing this.timing = castToType(value); // Type @@ -1016,6 +1458,9 @@ public class Claim extends DomainResource { case 111972721: // value this.value = castToType(value); // Type break; + case -934964668: // reason + this.reason = castToCodeableConcept(value); // CodeableConcept + break; default: super.setProperty(hash, name, value); } @@ -1024,13 +1469,15 @@ public class Claim extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("code")) - this.code = castToCoding(value); // Coding + this.code = castToCodeableConcept(value); // CodeableConcept else if (name.equals("timing[x]")) this.timing = castToType(value); // Type else if (name.equals("value[x]")) this.value = castToType(value); // Type + else if (name.equals("reason")) + this.reason = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -1038,10 +1485,11 @@ public class Claim extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 50511102: return getCategory(); // Coding - case 3059181: return getCode(); // Coding + case 50511102: return getCategory(); // CodeableConcept + case 3059181: return getCode(); // CodeableConcept case 164632566: return getTiming(); // Type case -1410166417: return getValue(); // Type + case -934964668: return getReason(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -1050,11 +1498,11 @@ public class Claim extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("code")) { - this.code = new Coding(); + this.code = new CodeableConcept(); return this.code; } else if (name.equals("timingDate")) { @@ -1073,6 +1521,18 @@ public class Claim extends DomainResource { this.value = new Quantity(); return this.value; } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueReference")) { + this.value = new Reference(); + return this.value; + } + else if (name.equals("reason")) { + this.reason = new CodeableConcept(); + return this.reason; + } else return super.addChild(name); } @@ -1084,6 +1544,7 @@ public class Claim extends DomainResource { dst.code = code == null ? null : code.copy(); dst.timing = timing == null ? null : timing.copy(); dst.value = value == null ? null : value.copy(); + dst.reason = reason == null ? null : reason.copy(); return dst; } @@ -1095,7 +1556,7 @@ public class Claim extends DomainResource { return false; SpecialConditionComponent o = (SpecialConditionComponent) other; return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(timing, o.timing, true) - && compareDeep(value, o.value, true); + && compareDeep(value, o.value, true) && compareDeep(reason, o.reason, true); } @Override @@ -1110,7 +1571,7 @@ public class Claim extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, code, timing, value - ); + , reason); } public String fhirType() { @@ -1132,28 +1593,28 @@ public class Claim extends DomainResource { /** * The diagnosis. */ - @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Child(name = "diagnosis", type = {CodeableConcept.class, Condition.class}, order=2, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Patient's diagnosis", formalDefinition="The diagnosis." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/icd-10") - protected Coding diagnosis; + protected Type diagnosis; /** * The type of the Diagnosis, for example: admitting,. */ - @Child(name = "type", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Type of Diagnosis", formalDefinition="The type of the Diagnosis, for example: admitting,." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-diagnosistype") - protected List type; + protected List type; /** - * The Diagnosis Related Group (DRG) code based on the assigned grouping code system. + * The package billing code, for example DRG, based on the assigned grouping code system. */ - @Child(name = "drg", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Diagnosis Related Group", formalDefinition="The Diagnosis Related Group (DRG) code based on the assigned grouping code system." ) + @Child(name = "packageCode", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Package billing code", formalDefinition="The package billing code, for example DRG, based on the assigned grouping code system." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-diagnosisrelatedgroup") - protected Coding drg; + protected CodeableConcept packageCode; - private static final long serialVersionUID = 135693095L; + private static final long serialVersionUID = -350960873L; /** * Constructor @@ -1165,7 +1626,7 @@ public class Claim extends DomainResource { /** * Constructor */ - public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) { + public DiagnosisComponent(PositiveIntType sequence, Type diagnosis) { super(); this.sequence = sequence; this.diagnosis = diagnosis; @@ -1219,15 +1680,36 @@ public class Claim extends DomainResource { /** * @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(); // cc + public Type getDiagnosis() { return this.diagnosis; } + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public CodeableConcept getDiagnosisCodeableConcept() throws FHIRException { + if (!(this.diagnosis instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.diagnosis.getClass().getName()+" was encountered"); + return (CodeableConcept) this.diagnosis; + } + + public boolean hasDiagnosisCodeableConcept() { + return this.diagnosis instanceof CodeableConcept; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Reference getDiagnosisReference() throws FHIRException { + if (!(this.diagnosis instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.diagnosis.getClass().getName()+" was encountered"); + return (Reference) this.diagnosis; + } + + public boolean hasDiagnosisReference() { + return this.diagnosis instanceof Reference; + } + public boolean hasDiagnosis() { return this.diagnosis != null && !this.diagnosis.isEmpty(); } @@ -1235,7 +1717,7 @@ public class Claim extends DomainResource { /** * @param value {@link #diagnosis} (The diagnosis.) */ - public DiagnosisComponent setDiagnosis(Coding value) { + public DiagnosisComponent setDiagnosis(Type value) { this.diagnosis = value; return this; } @@ -1243,16 +1725,16 @@ public class Claim extends DomainResource { /** * @return {@link #type} (The type of the Diagnosis, for example: admitting,.) */ - public List getType() { + public List getType() { if (this.type == null) - this.type = new ArrayList(); + this.type = new ArrayList(); return this.type; } /** * @return Returns a reference to this for easy method chaining */ - public DiagnosisComponent setType(List theType) { + public DiagnosisComponent setType(List theType) { this.type = theType; return this; } @@ -1260,25 +1742,25 @@ public class Claim extends DomainResource { public boolean hasType() { if (this.type == null) return false; - for (Coding item : this.type) + for (CodeableConcept item : this.type) if (!item.isEmpty()) return true; return false; } - public Coding addType() { //3 - Coding t = new Coding(); + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); if (this.type == null) - this.type = new ArrayList(); + this.type = new ArrayList(); this.type.add(t); return t; } - public DiagnosisComponent addType(Coding t) { //3 + public DiagnosisComponent addType(CodeableConcept t) { //3 if (t == null) return this; if (this.type == null) - this.type = new ArrayList(); + this.type = new ArrayList(); this.type.add(t); return this; } @@ -1286,7 +1768,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist */ - public Coding getTypeFirstRep() { + public CodeableConcept getTypeFirstRep() { if (getType().isEmpty()) { addType(); } @@ -1294,44 +1776,44 @@ public class Claim extends DomainResource { } /** - * @return {@link #drg} (The Diagnosis Related Group (DRG) code based on the assigned grouping code system.) + * @return {@link #packageCode} (The package billing code, for example DRG, based on the assigned grouping code system.) */ - public Coding getDrg() { - if (this.drg == null) + public CodeableConcept getPackageCode() { + if (this.packageCode == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.drg"); + throw new Error("Attempt to auto-create DiagnosisComponent.packageCode"); else if (Configuration.doAutoCreate()) - this.drg = new Coding(); // cc - return this.drg; + this.packageCode = new CodeableConcept(); // cc + return this.packageCode; } - public boolean hasDrg() { - return this.drg != null && !this.drg.isEmpty(); + public boolean hasPackageCode() { + return this.packageCode != null && !this.packageCode.isEmpty(); } /** - * @param value {@link #drg} (The Diagnosis Related Group (DRG) code based on the assigned grouping code system.) + * @param value {@link #packageCode} (The package billing code, for example DRG, based on the assigned grouping code system.) */ - public DiagnosisComponent setDrg(Coding value) { - this.drg = value; + public DiagnosisComponent setPackageCode(CodeableConcept value) { + this.packageCode = value; return this; } protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("type", "Coding", "The type of the Diagnosis, for example: admitting,.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("drg", "Coding", "The Diagnosis Related Group (DRG) code based on the assigned grouping code system.", 0, java.lang.Integer.MAX_VALUE, drg)); + childrenList.add(new Property("diagnosis[x]", "CodeableConcept|Reference(Condition)", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("type", "CodeableConcept", "The type of the Diagnosis, for example: admitting,.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("packageCode", "CodeableConcept", "The package billing code, for example DRG, based on the assigned grouping code system.", 0, java.lang.Integer.MAX_VALUE, packageCode)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Coding - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Coding - case 99737: /*drg*/ return this.drg == null ? new Base[0] : new Base[] {this.drg}; // Coding + case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Type + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept + case 908444499: /*packageCode*/ return this.packageCode == null ? new Base[0] : new Base[] {this.packageCode}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -1344,13 +1826,13 @@ public class Claim extends DomainResource { this.sequence = castToPositiveInt(value); // PositiveIntType break; case 1196993265: // diagnosis - this.diagnosis = castToCoding(value); // Coding + this.diagnosis = castToType(value); // Type break; case 3575610: // type - this.getType().add(castToCoding(value)); // Coding + this.getType().add(castToCodeableConcept(value)); // CodeableConcept break; - case 99737: // drg - this.drg = castToCoding(value); // Coding + case 908444499: // packageCode + this.packageCode = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -1361,12 +1843,12 @@ public class Claim extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("sequence")) this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("diagnosis")) - this.diagnosis = castToCoding(value); // Coding + else if (name.equals("diagnosis[x]")) + this.diagnosis = castToType(value); // Type else if (name.equals("type")) - this.getType().add(castToCoding(value)); - else if (name.equals("drg")) - this.drg = castToCoding(value); // Coding + this.getType().add(castToCodeableConcept(value)); + else if (name.equals("packageCode")) + this.packageCode = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -1375,9 +1857,9 @@ public class Claim extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 1196993265: return getDiagnosis(); // Coding - case 3575610: return addType(); // Coding - case 99737: return getDrg(); // Coding + case -1487009809: return getDiagnosis(); // Type + case 3575610: return addType(); // CodeableConcept + case 908444499: return getPackageCode(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -1388,16 +1870,20 @@ public class Claim extends DomainResource { if (name.equals("sequence")) { throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); } - else if (name.equals("diagnosis")) { - this.diagnosis = new Coding(); + else if (name.equals("diagnosisCodeableConcept")) { + this.diagnosis = new CodeableConcept(); + return this.diagnosis; + } + else if (name.equals("diagnosisReference")) { + this.diagnosis = new Reference(); return this.diagnosis; } else if (name.equals("type")) { return addType(); } - else if (name.equals("drg")) { - this.drg = new Coding(); - return this.drg; + else if (name.equals("packageCode")) { + this.packageCode = new CodeableConcept(); + return this.packageCode; } else return super.addChild(name); @@ -1409,11 +1895,11 @@ public class Claim extends DomainResource { dst.sequence = sequence == null ? null : sequence.copy(); dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); if (type != null) { - dst.type = new ArrayList(); - for (Coding i : type) + dst.type = new ArrayList(); + for (CodeableConcept i : type) dst.type.add(i.copy()); }; - dst.drg = drg == null ? null : drg.copy(); + dst.packageCode = packageCode == null ? null : packageCode.copy(); return dst; } @@ -1425,7 +1911,7 @@ public class Claim extends DomainResource { return false; DiagnosisComponent o = (DiagnosisComponent) other; return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(type, o.type, true) - && compareDeep(drg, o.drg, true); + && compareDeep(packageCode, o.packageCode, true); } @Override @@ -1440,7 +1926,7 @@ public class Claim extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, diagnosis, type - , drg); + , packageCode); } public String fhirType() { @@ -1469,7 +1955,7 @@ public class Claim extends DomainResource { /** * The procedure code. */ - @Child(name = "procedure", type = {Coding.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Child(name = "procedure", type = {CodeableConcept.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Patient's list of procedures performed", formalDefinition="The procedure code." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/icd-10-procedures") protected Type procedure; @@ -1596,14 +2082,14 @@ public class Claim extends DomainResource { /** * @return {@link #procedure} (The procedure code.) */ - public Coding getProcedureCoding() throws FHIRException { - if (!(this.procedure instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.procedure.getClass().getName()+" was encountered"); - return (Coding) this.procedure; + public CodeableConcept getProcedureCodeableConcept() throws FHIRException { + if (!(this.procedure instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.procedure.getClass().getName()+" was encountered"); + return (CodeableConcept) this.procedure; } - public boolean hasProcedureCoding() { - return this.procedure instanceof Coding; + public boolean hasProcedureCodeableConcept() { + return this.procedure instanceof CodeableConcept; } /** @@ -1635,7 +2121,7 @@ public class Claim extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "Sequence of procedures which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); childrenList.add(new Property("date", "dateTime", "Date and optionally time the procedure was performed .", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("procedure[x]", "Coding|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("procedure[x]", "CodeableConcept|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure)); } @Override @@ -1697,8 +2183,8 @@ public class Claim extends DomainResource { else if (name.equals("date")) { throw new FHIRException("Cannot call addChild on a primitive type Claim.date"); } - else if (name.equals("procedureCoding")) { - this.procedure = new Coding(); + else if (name.equals("procedureCodeableConcept")) { + this.procedure = new CodeableConcept(); return this.procedure; } else if (name.equals("procedureReference")) { @@ -1752,7 +2238,7 @@ public class Claim extends DomainResource { } @Block() - public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { + public static class InsuranceComponent extends BackboneElement implements IBaseBackboneElement { /** * A service line item. */ @@ -1761,10 +2247,10 @@ public class Claim extends DomainResource { protected PositiveIntType sequence; /** - * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + * A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated. */ @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) protected BooleanType focal; /** @@ -1805,27 +2291,19 @@ public class Claim extends DomainResource { */ 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=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - - private static final long serialVersionUID = -1003564312L; + private static final long serialVersionUID = -1216535489L; /** * Constructor */ - public CoverageComponent() { + public InsuranceComponent() { super(); } /** * Constructor */ - public CoverageComponent(PositiveIntType sequence, BooleanType focal, Reference coverage) { + public InsuranceComponent(PositiveIntType sequence, BooleanType focal, Reference coverage) { super(); this.sequence = sequence; this.focal = focal; @@ -1838,7 +2316,7 @@ public class Claim extends DomainResource { public PositiveIntType getSequenceElement() { if (this.sequence == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); + throw new Error("Attempt to auto-create InsuranceComponent.sequence"); else if (Configuration.doAutoCreate()) this.sequence = new PositiveIntType(); // bb return this.sequence; @@ -1855,7 +2333,7 @@ public class Claim extends DomainResource { /** * @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(PositiveIntType value) { + public InsuranceComponent setSequenceElement(PositiveIntType value) { this.sequence = value; return this; } @@ -1870,7 +2348,7 @@ public class Claim extends DomainResource { /** * @param value A service line item. */ - public CoverageComponent setSequence(int value) { + public InsuranceComponent setSequence(int value) { if (this.sequence == null) this.sequence = new PositiveIntType(); this.sequence.setValue(value); @@ -1878,12 +2356,12 @@ public class Claim extends DomainResource { } /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + * @return {@link #focal} (A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). 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"); + throw new Error("Attempt to auto-create InsuranceComponent.focal"); else if (Configuration.doAutoCreate()) this.focal = new BooleanType(); // bb return this.focal; @@ -1898,24 +2376,24 @@ public class Claim extends DomainResource { } /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + * @param value {@link #focal} (A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value */ - public CoverageComponent setFocalElement(BooleanType value) { + public InsuranceComponent setFocalElement(BooleanType value) { this.focal = value; return this; } /** - * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + * @return A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated. */ public boolean getFocal() { return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); } /** - * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + * @param value A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated. */ - public CoverageComponent setFocal(boolean value) { + public InsuranceComponent setFocal(boolean value) { if (this.focal == null) this.focal = new BooleanType(); this.focal.setValue(value); @@ -1928,7 +2406,7 @@ public class Claim extends DomainResource { public Reference getCoverage() { if (this.coverage == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); + throw new Error("Attempt to auto-create InsuranceComponent.coverage"); else if (Configuration.doAutoCreate()) this.coverage = new Reference(); // cc return this.coverage; @@ -1941,7 +2419,7 @@ public class Claim extends DomainResource { /** * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) */ - public CoverageComponent setCoverage(Reference value) { + public InsuranceComponent setCoverage(Reference value) { this.coverage = value; return this; } @@ -1952,7 +2430,7 @@ public class Claim extends DomainResource { public Coverage getCoverageTarget() { if (this.coverageTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); + throw new Error("Attempt to auto-create InsuranceComponent.coverage"); else if (Configuration.doAutoCreate()) this.coverageTarget = new Coverage(); // aa return this.coverageTarget; @@ -1961,7 +2439,7 @@ public class Claim 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 CoverageComponent setCoverageTarget(Coverage value) { + public InsuranceComponent setCoverageTarget(Coverage value) { this.coverageTarget = value; return this; } @@ -1972,7 +2450,7 @@ public class Claim extends DomainResource { public StringType getBusinessArrangementElement() { if (this.businessArrangement == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + throw new Error("Attempt to auto-create InsuranceComponent.businessArrangement"); else if (Configuration.doAutoCreate()) this.businessArrangement = new StringType(); // bb return this.businessArrangement; @@ -1989,7 +2467,7 @@ public class Claim extends DomainResource { /** * @param value {@link #businessArrangement} (The contract number of a business agreement 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) { + public InsuranceComponent setBusinessArrangementElement(StringType value) { this.businessArrangement = value; return this; } @@ -2004,7 +2482,7 @@ public class Claim extends DomainResource { /** * @param value The contract number of a business agreement which describes the terms and conditions. */ - public CoverageComponent setBusinessArrangement(String value) { + public InsuranceComponent setBusinessArrangement(String value) { if (Utilities.noString(value)) this.businessArrangement = null; else { @@ -2027,7 +2505,7 @@ public class Claim extends DomainResource { /** * @return Returns a reference to this for easy method chaining */ - public CoverageComponent setPreAuthRef(List thePreAuthRef) { + public InsuranceComponent setPreAuthRef(List thePreAuthRef) { this.preAuthRef = thePreAuthRef; return this; } @@ -2055,7 +2533,7 @@ public class Claim extends DomainResource { /** * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) */ - public CoverageComponent addPreAuthRef(String value) { //1 + public InsuranceComponent addPreAuthRef(String value) { //1 StringType t = new StringType(); t.setValue(value); if (this.preAuthRef == null) @@ -2082,7 +2560,7 @@ public class Claim extends DomainResource { public Reference getClaimResponse() { if (this.claimResponse == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + throw new Error("Attempt to auto-create InsuranceComponent.claimResponse"); else if (Configuration.doAutoCreate()) this.claimResponse = new Reference(); // cc return this.claimResponse; @@ -2095,7 +2573,7 @@ public class Claim extends DomainResource { /** * @param value {@link #claimResponse} (The Coverages adjudication details.) */ - public CoverageComponent setClaimResponse(Reference value) { + public InsuranceComponent setClaimResponse(Reference value) { this.claimResponse = value; return this; } @@ -2106,7 +2584,7 @@ public class Claim extends DomainResource { public ClaimResponse getClaimResponseTarget() { if (this.claimResponseTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + throw new Error("Attempt to auto-create InsuranceComponent.claimResponse"); else if (Configuration.doAutoCreate()) this.claimResponseTarget = new ClaimResponse(); // aa return this.claimResponseTarget; @@ -2115,44 +2593,19 @@ public class Claim extends DomainResource { /** * @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) { + public InsuranceComponent 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(); // cc - 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", "positiveInt", "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. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("focal", "boolean", "A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 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 agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); 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)); } @Override @@ -2164,7 +2617,6 @@ public class Claim extends DomainResource { case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding default: return super.getProperty(hash, name, checkValid); } @@ -2191,9 +2643,6 @@ public class Claim extends DomainResource { case 689513629: // claimResponse this.claimResponse = castToReference(value); // Reference break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; default: super.setProperty(hash, name, value); } @@ -2213,8 +2662,6 @@ public class Claim extends DomainResource { this.getPreAuthRef().add(castToString(value)); else if (name.equals("claimResponse")) this.claimResponse = castToReference(value); // Reference - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding else super.setProperty(name, value); } @@ -2228,7 +2675,6 @@ public class Claim extends DomainResource { case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType case 689513629: return getClaimResponse(); // Reference - case 1089373397: return getOriginalRuleset(); // Coding default: return super.makeProperty(hash, name); } @@ -2256,16 +2702,12 @@ public class Claim extends DomainResource { this.claimResponse = new Reference(); return this.claimResponse; } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } else return super.addChild(name); } - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); + public InsuranceComponent copy() { + InsuranceComponent dst = new InsuranceComponent(); copyValues(dst); dst.sequence = sequence == null ? null : sequence.copy(); dst.focal = focal == null ? null : focal.copy(); @@ -2277,7 +2719,6 @@ public class Claim extends DomainResource { dst.preAuthRef.add(i.copy()); }; dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); return dst; } @@ -2285,33 +2726,32 @@ public class Claim extends DomainResource { public boolean equalsDeep(Base other) { if (!super.equalsDeep(other)) return false; - if (!(other instanceof CoverageComponent)) + if (!(other instanceof InsuranceComponent)) return false; - CoverageComponent o = (CoverageComponent) other; + InsuranceComponent o = (InsuranceComponent) other; return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true) - && compareDeep(claimResponse, o.claimResponse, true) && compareDeep(originalRuleset, o.originalRuleset, true) - ; + && compareDeep(claimResponse, o.claimResponse, true); } @Override public boolean equalsShallow(Base other) { if (!super.equalsShallow(other)) return false; - if (!(other instanceof CoverageComponent)) + if (!(other instanceof InsuranceComponent)) return false; - CoverageComponent o = (CoverageComponent) other; + InsuranceComponent o = (InsuranceComponent) other; return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) && compareValues(preAuthRef, o.preAuthRef, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, focal, coverage - , businessArrangement, preAuthRef, claimResponse, originalRuleset); + , businessArrangement, preAuthRef, claimResponse); } public String fhirType() { - return "Claim.coverage"; + return "Claim.insurance"; } @@ -2329,10 +2769,10 @@ public class Claim extends DomainResource { /** * Type of accident: work, auto, etc. */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="The nature of the accident", formalDefinition="Type of accident: work, auto, etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-ActIncidentCode") - protected Coding type; + protected CodeableConcept type; /** * Accident Place. @@ -2341,7 +2781,7 @@ public class Claim extends DomainResource { @Description(shortDefinition="Accident Place", formalDefinition="Accident Place." ) protected Type location; - private static final long serialVersionUID = -242365747L; + private static final long serialVersionUID = 622904984L; /** * Constructor @@ -2406,12 +2846,12 @@ public class Claim extends DomainResource { /** * @return {@link #type} (Type of accident: work, auto, etc.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AccidentComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -2422,7 +2862,7 @@ public class Claim extends DomainResource { /** * @param value {@link #type} (Type of accident: work, auto, etc.) */ - public AccidentComponent setType(Coding value) { + public AccidentComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -2475,7 +2915,7 @@ public class Claim extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("date", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("type", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("location[x]", "Address|Reference(Location)", "Accident Place.", 0, java.lang.Integer.MAX_VALUE, location)); } @@ -2483,7 +2923,7 @@ public class Claim extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Type default: return super.getProperty(hash, name, checkValid); } @@ -2497,7 +2937,7 @@ public class Claim extends DomainResource { this.date = castToDate(value); // DateType break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 1901043637: // location this.location = castToType(value); // Type @@ -2512,7 +2952,7 @@ public class Claim extends DomainResource { if (name.equals("date")) this.date = castToDate(value); // DateType else if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("location[x]")) this.location = castToType(value); // Type else @@ -2523,7 +2963,7 @@ public class Claim extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateType - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 552316075: return getLocation(); // Type default: return super.makeProperty(hash, name); } @@ -2536,7 +2976,7 @@ public class Claim extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type Claim.date"); } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("locationAddress")) { @@ -2602,11 +3042,11 @@ public class Claim extends DomainResource { protected PositiveIntType sequence; /** - * The members of the team who provided the overall service as well as their role and whether responsible and qualifications. + * CareTeam applicable for this service or product line. */ - @Child(name = "careTeam", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Members of the care team", formalDefinition="The members of the team who provided the overall service as well as their role and whether responsible and qualifications." ) - protected List careTeam; + @Child(name = "careTeamLinkId", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Applicable careTeam members", formalDefinition="CareTeam applicable for this service or product line." ) + protected List careTeamLinkId; /** * Diagnosis applicable for this service or product line. @@ -2615,57 +3055,71 @@ public class Claim extends DomainResource { @Description(shortDefinition="Applicable diagnoses", formalDefinition="Diagnosis applicable for this service or product line." ) protected List diagnosisLinkId; + /** + * Procedures applicable for this service or product line. + */ + @Child(name = "procedureLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Applicable procedures", formalDefinition="Procedures applicable for this service or product line." ) + protected List procedureLinkId; + + /** + * Exceptions, special conditions and supporting information pplicable for this service or product line. + */ + @Child(name = "informationLinkId", type = {PositiveIntType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Applicable exception and supporting information", formalDefinition="Exceptions, special conditions and supporting information pplicable for this service or product line." ) + protected List informationLinkId; + /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** - * If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. + * If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. */ - @Child(name = "service", type = {Coding.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Billing Code", formalDefinition="If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'." ) + @Child(name = "service", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Billing Code", formalDefinition="If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * For programs which require reason codes for the inclusion or covering of this billed item under the program or sub-program. */ - @Child(name = "programCode", type = {Coding.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "programCode", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reason codes for the inclusion or covering of this billed item under the program or sub-program." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-program-code") - protected List programCode; + protected List programCode; /** * The date or dates when the enclosed suite of services were performed or completed. */ - @Child(name = "serviced", type = {DateType.class, Period.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "serviced", type = {DateType.class, Period.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) protected Type serviced; /** * Where the service was provided. */ - @Child(name = "location", type = {Coding.class, Address.class, Location.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "location", type = {CodeableConcept.class, Address.class, Location.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Place of service", formalDefinition="Where the service was provided." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-place") protected Type location; @@ -2673,42 +3127,35 @@ public class Claim extends DomainResource { /** * The number of repetitions of a service or product. */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "quantity", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) protected SimpleQuantity 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=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "unitPrice", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=false) @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=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "factor", type = {DecimalType.class}, order=15, min=0, max=1, modifier=false, summary=false) @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=14, min=0, max=1, modifier=false, summary=false) - @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 addittional 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=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "net", type = {Money.class}, order=16, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "udi", type = {Device.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) protected List udi; /** @@ -2720,34 +3167,34 @@ public class Claim extends DomainResource { /** * Physical service site on the patient (limb, tooth, etc). */ - @Child(name = "bodySite", type = {Coding.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Child(name = "bodySite", type = {CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/tooth") - protected Coding bodySite; + protected CodeableConcept bodySite; /** * A region or surface of the site, eg. limb region or tooth surface(s). */ - @Child(name = "subSite", type = {Coding.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "subSite", type = {CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/surface") - protected List subSite; + protected List subSite; /** * Second tier of goods and services. */ - @Child(name = "detail", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "detail", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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=20, min=0, max=1, modifier=false, summary=false) + @Child(name = "prosthesis", type = {}, order=21, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) protected ProsthesisComponent prosthesis; - private static final long serialVersionUID = 749339585L; + private static final long serialVersionUID = 2102127643L; /** * Constructor @@ -2810,56 +3257,64 @@ public class Claim extends DomainResource { } /** - * @return {@link #careTeam} (The members of the team who provided the overall service as well as their role and whether responsible and qualifications.) + * @return {@link #careTeamLinkId} (CareTeam applicable for this service or product line.) */ - public List getCareTeam() { - if (this.careTeam == null) - this.careTeam = new ArrayList(); - return this.careTeam; + public List getCareTeamLinkId() { + if (this.careTeamLinkId == null) + this.careTeamLinkId = new ArrayList(); + return this.careTeamLinkId; } /** * @return Returns a reference to this for easy method chaining */ - public ItemComponent setCareTeam(List theCareTeam) { - this.careTeam = theCareTeam; + public ItemComponent setCareTeamLinkId(List theCareTeamLinkId) { + this.careTeamLinkId = theCareTeamLinkId; return this; } - public boolean hasCareTeam() { - if (this.careTeam == null) + public boolean hasCareTeamLinkId() { + if (this.careTeamLinkId == null) return false; - for (CareTeamComponent item : this.careTeam) + for (PositiveIntType item : this.careTeamLinkId) if (!item.isEmpty()) return true; return false; } - public CareTeamComponent addCareTeam() { //3 - CareTeamComponent t = new CareTeamComponent(); - if (this.careTeam == null) - this.careTeam = new ArrayList(); - this.careTeam.add(t); + /** + * @return {@link #careTeamLinkId} (CareTeam applicable for this service or product line.) + */ + public PositiveIntType addCareTeamLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.careTeamLinkId == null) + this.careTeamLinkId = new ArrayList(); + this.careTeamLinkId.add(t); return t; } - public ItemComponent addCareTeam(CareTeamComponent t) { //3 - if (t == null) - return this; - if (this.careTeam == null) - this.careTeam = new ArrayList(); - this.careTeam.add(t); + /** + * @param value {@link #careTeamLinkId} (CareTeam applicable for this service or product line.) + */ + public ItemComponent addCareTeamLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.careTeamLinkId == null) + this.careTeamLinkId = new ArrayList(); + this.careTeamLinkId.add(t); return this; } /** - * @return The first repetition of repeating field {@link #careTeam}, creating it if it does not already exist + * @param value {@link #careTeamLinkId} (CareTeam applicable for this service or product line.) */ - public CareTeamComponent getCareTeamFirstRep() { - if (getCareTeam().isEmpty()) { - addCareTeam(); - } - return getCareTeam().get(0); + public boolean hasCareTeamLinkId(int value) { + if (this.careTeamLinkId == null) + return false; + for (PositiveIntType v : this.careTeamLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; } /** @@ -2923,15 +3378,137 @@ public class Claim extends DomainResource { return false; } + /** + * @return {@link #procedureLinkId} (Procedures applicable for this service or product line.) + */ + public List getProcedureLinkId() { + if (this.procedureLinkId == null) + this.procedureLinkId = new ArrayList(); + return this.procedureLinkId; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ItemComponent setProcedureLinkId(List theProcedureLinkId) { + this.procedureLinkId = theProcedureLinkId; + return this; + } + + public boolean hasProcedureLinkId() { + if (this.procedureLinkId == null) + return false; + for (PositiveIntType item : this.procedureLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #procedureLinkId} (Procedures applicable for this service or product line.) + */ + public PositiveIntType addProcedureLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.procedureLinkId == null) + this.procedureLinkId = new ArrayList(); + this.procedureLinkId.add(t); + return t; + } + + /** + * @param value {@link #procedureLinkId} (Procedures applicable for this service or product line.) + */ + public ItemComponent addProcedureLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.procedureLinkId == null) + this.procedureLinkId = new ArrayList(); + this.procedureLinkId.add(t); + return this; + } + + /** + * @param value {@link #procedureLinkId} (Procedures applicable for this service or product line.) + */ + public boolean hasProcedureLinkId(int value) { + if (this.procedureLinkId == null) + return false; + for (PositiveIntType v : this.procedureLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #informationLinkId} (Exceptions, special conditions and supporting information pplicable for this service or product line.) + */ + public List getInformationLinkId() { + if (this.informationLinkId == null) + this.informationLinkId = new ArrayList(); + return this.informationLinkId; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ItemComponent setInformationLinkId(List theInformationLinkId) { + this.informationLinkId = theInformationLinkId; + return this; + } + + public boolean hasInformationLinkId() { + if (this.informationLinkId == null) + return false; + for (PositiveIntType item : this.informationLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #informationLinkId} (Exceptions, special conditions and supporting information pplicable for this service or product line.) + */ + public PositiveIntType addInformationLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.informationLinkId == null) + this.informationLinkId = new ArrayList(); + this.informationLinkId.add(t); + return t; + } + + /** + * @param value {@link #informationLinkId} (Exceptions, special conditions and supporting information pplicable for this service or product line.) + */ + public ItemComponent addInformationLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.informationLinkId == null) + this.informationLinkId = new ArrayList(); + this.informationLinkId.add(t); + return this; + } + + /** + * @param value {@link #informationLinkId} (Exceptions, special conditions and supporting information pplicable for this service or product line.) + */ + public boolean hasInformationLinkId(int value) { + if (this.informationLinkId == null) + return false; + for (PositiveIntType v : this.informationLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ItemComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -2942,7 +3519,7 @@ public class Claim extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public ItemComponent setRevenue(Coding value) { + public ItemComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -2950,12 +3527,12 @@ public class Claim extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ItemComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -2966,20 +3543,20 @@ public class Claim extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public ItemComponent setCategory(Coding value) { + public ItemComponent setCategory(CodeableConcept value) { this.category = value; return this; } /** - * @return {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) + * @return {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public Coding getService() { + public CodeableConcept getService() { if (this.service == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ItemComponent.service"); else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -2988,9 +3565,9 @@ public class Claim extends DomainResource { } /** - * @param value {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) + * @param value {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public ItemComponent setService(Coding value) { + public ItemComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -2998,16 +3575,16 @@ public class Claim extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public ItemComponent setModifier(List theModifier) { + public ItemComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -3015,25 +3592,25 @@ public class Claim extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public ItemComponent addModifier(Coding t) { //3 + public ItemComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -3041,7 +3618,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -3051,16 +3628,16 @@ public class Claim extends DomainResource { /** * @return {@link #programCode} (For programs which require reason codes for the inclusion or covering of this billed item under the program or sub-program.) */ - public List getProgramCode() { + public List getProgramCode() { if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); return this.programCode; } /** * @return Returns a reference to this for easy method chaining */ - public ItemComponent setProgramCode(List theProgramCode) { + public ItemComponent setProgramCode(List theProgramCode) { this.programCode = theProgramCode; return this; } @@ -3068,25 +3645,25 @@ public class Claim extends DomainResource { public boolean hasProgramCode() { if (this.programCode == null) return false; - for (Coding item : this.programCode) + for (CodeableConcept item : this.programCode) if (!item.isEmpty()) return true; return false; } - public Coding addProgramCode() { //3 - Coding t = new Coding(); + public CodeableConcept addProgramCode() { //3 + CodeableConcept t = new CodeableConcept(); if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return t; } - public ItemComponent addProgramCode(Coding t) { //3 + public ItemComponent addProgramCode(CodeableConcept t) { //3 if (t == null) return this; if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return this; } @@ -3094,7 +3671,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #programCode}, creating it if it does not already exist */ - public Coding getProgramCodeFirstRep() { + public CodeableConcept getProgramCodeFirstRep() { if (getProgramCode().isEmpty()) { addProgramCode(); } @@ -3156,14 +3733,14 @@ public class Claim extends DomainResource { /** * @return {@link #location} (Where the service was provided.) */ - public Coding getLocationCoding() throws FHIRException { - if (!(this.location instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.location.getClass().getName()+" was encountered"); - return (Coding) this.location; + public CodeableConcept getLocationCodeableConcept() throws FHIRException { + if (!(this.location instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.location.getClass().getName()+" was encountered"); + return (CodeableConcept) this.location; } - public boolean hasLocationCoding() { - return this.location instanceof Coding; + public boolean hasLocationCodeableConcept() { + return this.location instanceof CodeableConcept; } /** @@ -3319,73 +3896,6 @@ public class Claim extends DomainResource { 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 ItemComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - 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 ItemComponent 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 ItemComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @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 ItemComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @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 ItemComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - /** * @return {@link #net} (The quantity times the unit price for an addittional 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.) */ @@ -3488,12 +3998,12 @@ public class Claim extends DomainResource { /** * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) */ - public Coding getBodySite() { + public CodeableConcept getBodySite() { if (this.bodySite == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ItemComponent.bodySite"); else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); // cc + this.bodySite = new CodeableConcept(); // cc return this.bodySite; } @@ -3504,7 +4014,7 @@ public class Claim extends DomainResource { /** * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) */ - public ItemComponent setBodySite(Coding value) { + public ItemComponent setBodySite(CodeableConcept value) { this.bodySite = value; return this; } @@ -3512,16 +4022,16 @@ public class Claim extends DomainResource { /** * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) */ - public List getSubSite() { + public List getSubSite() { if (this.subSite == null) - this.subSite = new ArrayList(); + this.subSite = new ArrayList(); return this.subSite; } /** * @return Returns a reference to this for easy method chaining */ - public ItemComponent setSubSite(List theSubSite) { + public ItemComponent setSubSite(List theSubSite) { this.subSite = theSubSite; return this; } @@ -3529,25 +4039,25 @@ public class Claim extends DomainResource { public boolean hasSubSite() { if (this.subSite == null) return false; - for (Coding item : this.subSite) + for (CodeableConcept item : this.subSite) if (!item.isEmpty()) return true; return false; } - public Coding addSubSite() { //3 - Coding t = new Coding(); + public CodeableConcept addSubSite() { //3 + CodeableConcept t = new CodeableConcept(); if (this.subSite == null) - this.subSite = new ArrayList(); + this.subSite = new ArrayList(); this.subSite.add(t); return t; } - public ItemComponent addSubSite(Coding t) { //3 + public ItemComponent addSubSite(CodeableConcept t) { //3 if (t == null) return this; if (this.subSite == null) - this.subSite = new ArrayList(); + this.subSite = new ArrayList(); this.subSite.add(t); return this; } @@ -3555,7 +4065,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #subSite}, creating it if it does not already exist */ - public Coding getSubSiteFirstRep() { + public CodeableConcept getSubSiteFirstRep() { if (getSubSite().isEmpty()) { addSubSite(); } @@ -3642,23 +4152,24 @@ public class Claim extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("careTeam", "", "The members of the team who provided the overall service as well as their role and whether responsible and qualifications.", 0, java.lang.Integer.MAX_VALUE, careTeam)); + childrenList.add(new Property("careTeamLinkId", "positiveInt", "CareTeam applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, careTeamLinkId)); childrenList.add(new Property("diagnosisLinkId", "positiveInt", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); - childrenList.add(new Property("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reason codes for the inclusion or covering of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("procedureLinkId", "positiveInt", "Procedures applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, procedureLinkId)); + childrenList.add(new Property("informationLinkId", "positiveInt", "Exceptions, special conditions and supporting information pplicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, informationLinkId)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("programCode", "CodeableConcept", "For programs which require reason codes for the inclusion or covering of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); - childrenList.add(new Property("location[x]", "Coding|Address|Reference(Location)", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("location[x]", "CodeableConcept|Address|Reference(Location)", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, location)); childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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", "Reference(Device)", "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("bodySite", "CodeableConcept", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subSite", "CodeableConcept", "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("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); } @@ -3667,23 +4178,24 @@ public class Claim extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case -7323378: /*careTeam*/ return this.careTeam == null ? new Base[0] : this.careTeam.toArray(new Base[this.careTeam.size()]); // CareTeamComponent + case -186757789: /*careTeamLinkId*/ return this.careTeamLinkId == null ? new Base[0] : this.careTeamLinkId.toArray(new Base[this.careTeamLinkId.size()]); // PositiveIntType case -1659207418: /*diagnosisLinkId*/ return this.diagnosisLinkId == null ? new Base[0] : this.diagnosisLinkId.toArray(new Base[this.diagnosisLinkId.size()]); // PositiveIntType - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case -532846744: /*procedureLinkId*/ return this.procedureLinkId == null ? new Base[0] : this.procedureLinkId.toArray(new Base[this.procedureLinkId.size()]); // PositiveIntType + case 1965585153: /*informationLinkId*/ return this.informationLinkId == null ? new Base[0] : this.informationLinkId.toArray(new Base[this.informationLinkId.size()]); // PositiveIntType + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // CodeableConcept case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Type case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding - case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // Coding + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept + case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // CodeableConcept case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailComponent case -2138744398: /*prosthesis*/ return this.prosthesis == null ? new Base[0] : new Base[] {this.prosthesis}; // ProsthesisComponent default: return super.getProperty(hash, name, checkValid); @@ -3697,26 +4209,32 @@ public class Claim extends DomainResource { case 1349547969: // sequence this.sequence = castToPositiveInt(value); // PositiveIntType break; - case -7323378: // careTeam - this.getCareTeam().add((CareTeamComponent) value); // CareTeamComponent + case -186757789: // careTeamLinkId + this.getCareTeamLinkId().add(castToPositiveInt(value)); // PositiveIntType break; case -1659207418: // diagnosisLinkId this.getDiagnosisLinkId().add(castToPositiveInt(value)); // PositiveIntType break; + case -532846744: // procedureLinkId + this.getProcedureLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; + case 1965585153: // informationLinkId + this.getInformationLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding + this.getProgramCode().add(castToCodeableConcept(value)); // CodeableConcept break; case 1379209295: // serviced this.serviced = castToType(value); // Type @@ -3733,9 +4251,6 @@ public class Claim extends DomainResource { case -1282148017: // factor this.factor = castToDecimal(value); // DecimalType break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; case 108957: // net this.net = castToMoney(value); // Money break; @@ -3743,10 +4258,10 @@ public class Claim extends DomainResource { this.getUdi().add(castToReference(value)); // Reference break; case 1702620169: // bodySite - this.bodySite = castToCoding(value); // Coding + this.bodySite = castToCodeableConcept(value); // CodeableConcept break; case -1868566105: // subSite - this.getSubSite().add(castToCoding(value)); // Coding + this.getSubSite().add(castToCodeableConcept(value)); // CodeableConcept break; case -1335224239: // detail this.getDetail().add((DetailComponent) value); // DetailComponent @@ -3763,20 +4278,24 @@ public class Claim extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("sequence")) this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("careTeam")) - this.getCareTeam().add((CareTeamComponent) value); + else if (name.equals("careTeamLinkId")) + this.getCareTeamLinkId().add(castToPositiveInt(value)); else if (name.equals("diagnosisLinkId")) this.getDiagnosisLinkId().add(castToPositiveInt(value)); + else if (name.equals("procedureLinkId")) + this.getProcedureLinkId().add(castToPositiveInt(value)); + else if (name.equals("informationLinkId")) + this.getInformationLinkId().add(castToPositiveInt(value)); else if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); + this.getProgramCode().add(castToCodeableConcept(value)); else if (name.equals("serviced[x]")) this.serviced = castToType(value); // Type else if (name.equals("location[x]")) @@ -3787,16 +4306,14 @@ public class Claim extends DomainResource { this.unitPrice = castToMoney(value); // Money else if (name.equals("factor")) this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType else if (name.equals("net")) this.net = castToMoney(value); // Money else if (name.equals("udi")) this.getUdi().add(castToReference(value)); else if (name.equals("bodySite")) - this.bodySite = castToCoding(value); // Coding + this.bodySite = castToCodeableConcept(value); // CodeableConcept else if (name.equals("subSite")) - this.getSubSite().add(castToCoding(value)); + this.getSubSite().add(castToCodeableConcept(value)); else if (name.equals("detail")) this.getDetail().add((DetailComponent) value); else if (name.equals("prosthesis")) @@ -3809,23 +4326,24 @@ public class Claim extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case -7323378: return addCareTeam(); // CareTeamComponent + case -186757789: throw new FHIRException("Cannot make property careTeamLinkId as it is not a complex type"); // PositiveIntType case -1659207418: throw new FHIRException("Cannot make property diagnosisLinkId as it is not a complex type"); // PositiveIntType - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding - case 1010065041: return addProgramCode(); // Coding + case -532846744: throw new FHIRException("Cannot make property procedureLinkId as it is not a complex type"); // PositiveIntType + case 1965585153: throw new FHIRException("Cannot make property informationLinkId as it is not a complex type"); // PositiveIntType + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept + case 1010065041: return addProgramCode(); // CodeableConcept case -1927922223: return getServiced(); // Type case 552316075: return getLocation(); // Type case -1285004149: return getQuantity(); // SimpleQuantity case -486196699: return getUnitPrice(); // Money case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType case 108957: return getNet(); // Money case 115642: return addUdi(); // Reference - case 1702620169: return getBodySite(); // Coding - case -1868566105: return addSubSite(); // Coding + case 1702620169: return getBodySite(); // CodeableConcept + case -1868566105: return addSubSite(); // CodeableConcept case -1335224239: return addDetail(); // DetailComponent case -2138744398: return getProsthesis(); // ProsthesisComponent default: return super.makeProperty(hash, name); @@ -3838,22 +4356,28 @@ public class Claim extends DomainResource { if (name.equals("sequence")) { throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); } - else if (name.equals("careTeam")) { - return addCareTeam(); + else if (name.equals("careTeamLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.careTeamLinkId"); } else if (name.equals("diagnosisLinkId")) { throw new FHIRException("Cannot call addChild on a primitive type Claim.diagnosisLinkId"); } + else if (name.equals("procedureLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.procedureLinkId"); + } + else if (name.equals("informationLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.informationLinkId"); + } else if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -3870,8 +4394,8 @@ public class Claim extends DomainResource { this.serviced = new Period(); return this.serviced; } - else if (name.equals("locationCoding")) { - this.location = new Coding(); + else if (name.equals("locationCodeableConcept")) { + this.location = new CodeableConcept(); return this.location; } else if (name.equals("locationAddress")) { @@ -3893,9 +4417,6 @@ public class Claim extends DomainResource { else if (name.equals("factor")) { throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); - } else if (name.equals("net")) { this.net = new Money(); return this.net; @@ -3904,7 +4425,7 @@ public class Claim extends DomainResource { return addUdi(); } else if (name.equals("bodySite")) { - this.bodySite = new Coding(); + this.bodySite = new CodeableConcept(); return this.bodySite; } else if (name.equals("subSite")) { @@ -3925,27 +4446,37 @@ public class Claim extends DomainResource { ItemComponent dst = new ItemComponent(); copyValues(dst); dst.sequence = sequence == null ? null : sequence.copy(); - if (careTeam != null) { - dst.careTeam = new ArrayList(); - for (CareTeamComponent i : careTeam) - dst.careTeam.add(i.copy()); + if (careTeamLinkId != null) { + dst.careTeamLinkId = new ArrayList(); + for (PositiveIntType i : careTeamLinkId) + dst.careTeamLinkId.add(i.copy()); }; if (diagnosisLinkId != null) { dst.diagnosisLinkId = new ArrayList(); for (PositiveIntType i : diagnosisLinkId) dst.diagnosisLinkId.add(i.copy()); }; + if (procedureLinkId != null) { + dst.procedureLinkId = new ArrayList(); + for (PositiveIntType i : procedureLinkId) + dst.procedureLinkId.add(i.copy()); + }; + if (informationLinkId != null) { + dst.informationLinkId = new ArrayList(); + for (PositiveIntType i : informationLinkId) + dst.informationLinkId.add(i.copy()); + }; dst.revenue = revenue == null ? null : revenue.copy(); dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) + dst.programCode = new ArrayList(); + for (CodeableConcept i : programCode) dst.programCode.add(i.copy()); }; dst.serviced = serviced == null ? null : serviced.copy(); @@ -3953,7 +4484,6 @@ public class Claim extends DomainResource { 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(); if (udi != null) { dst.udi = new ArrayList(); @@ -3962,8 +4492,8 @@ public class Claim extends DomainResource { }; dst.bodySite = bodySite == null ? null : bodySite.copy(); if (subSite != null) { - dst.subSite = new ArrayList(); - for (Coding i : subSite) + dst.subSite = new ArrayList(); + for (CodeableConcept i : subSite) dst.subSite.add(i.copy()); }; if (detail != null) { @@ -3982,13 +4512,15 @@ public class Claim extends DomainResource { if (!(other instanceof ItemComponent)) return false; ItemComponent o = (ItemComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(careTeam, o.careTeam, true) && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) - && compareDeep(revenue, o.revenue, true) && compareDeep(category, o.category, true) && compareDeep(service, o.service, true) - && compareDeep(modifier, o.modifier, true) && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) - && compareDeep(location, o.location, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) - && compareDeep(detail, o.detail, true) && compareDeep(prosthesis, o.prosthesis, true); + return compareDeep(sequence, o.sequence, true) && compareDeep(careTeamLinkId, o.careTeamLinkId, true) + && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(procedureLinkId, o.procedureLinkId, true) + && compareDeep(informationLinkId, o.informationLinkId, true) && compareDeep(revenue, o.revenue, true) + && compareDeep(category, o.category, true) && compareDeep(service, o.service, true) && compareDeep(modifier, o.modifier, true) + && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) && compareDeep(location, o.location, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(subSite, o.subSite, true) && compareDeep(detail, o.detail, true) && compareDeep(prosthesis, o.prosthesis, true) + ; } @Override @@ -3998,15 +4530,17 @@ public class Claim extends DomainResource { if (!(other instanceof ItemComponent)) return false; ItemComponent o = (ItemComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) - && compareValues(factor, o.factor, true) && compareValues(points, o.points, true); + return compareValues(sequence, o.sequence, true) && compareValues(careTeamLinkId, o.careTeamLinkId, true) + && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) && compareValues(procedureLinkId, o.procedureLinkId, true) + && compareValues(informationLinkId, o.informationLinkId, true) && compareValues(factor, o.factor, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, careTeam, diagnosisLinkId - , revenue, category, service, modifier, programCode, serviced, location, quantity - , unitPrice, factor, points, net, udi, bodySite, subSite, detail, prosthesis - ); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, careTeamLinkId, diagnosisLinkId + , procedureLinkId, informationLinkId, revenue, category, service, modifier, programCode + , serviced, location, quantity, unitPrice, factor, net, udi, bodySite, subSite + , detail, prosthesis); } public String fhirType() { @@ -4014,322 +4548,6 @@ public class Claim extends DomainResource { } - } - - @Block() - public static class CareTeamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Member of the team who provided the overall service. - */ - @Child(name = "provider", type = {Practitioner.class, Organization.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Provider individual or organization", formalDefinition="Member of the team who provided the overall service." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (Member of the team who provided the overall service.) - */ - protected Resource providerTarget; - - /** - * The party who is billing and responsible for the claimed good or service rendered to the patient. - */ - @Child(name = "responsible", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Billing provider", formalDefinition="The party who is billing and responsible for the claimed good or service rendered to the patient." ) - protected BooleanType responsible; - - /** - * The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team. - */ - @Child(name = "role", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Role on the team", formalDefinition="The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-careteamrole") - protected Coding role; - - /** - * The qualification which is applicable for this service. - */ - @Child(name = "qualification", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provider-qualification") - protected Coding qualification; - - private static final long serialVersionUID = 2022321671L; - - /** - * Constructor - */ - public CareTeamComponent() { - super(); - } - - /** - * Constructor - */ - public CareTeamComponent(Reference provider) { - super(); - this.provider = provider; - } - - /** - * @return {@link #provider} (Member of the team who provided the overall service.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (Member of the team who provided the overall service.) - */ - public CareTeamComponent 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. (Member of the team who provided the overall service.) - */ - public Resource getProviderTarget() { - 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. (Member of the team who provided the overall service.) - */ - public CareTeamComponent setProviderTarget(Resource value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #responsible} (The party who is billing and responsible for the claimed good or service rendered to the patient.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public BooleanType getResponsibleElement() { - if (this.responsible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamComponent.responsible"); - else if (Configuration.doAutoCreate()) - this.responsible = new BooleanType(); // bb - return this.responsible; - } - - public boolean hasResponsibleElement() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - public boolean hasResponsible() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - /** - * @param value {@link #responsible} (The party who is billing and responsible for the claimed good or service rendered to the patient.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public CareTeamComponent setResponsibleElement(BooleanType value) { - this.responsible = value; - return this; - } - - /** - * @return The party who is billing and responsible for the claimed good or service rendered to the patient. - */ - public boolean getResponsible() { - return this.responsible == null || this.responsible.isEmpty() ? false : this.responsible.getValue(); - } - - /** - * @param value The party who is billing and responsible for the claimed good or service rendered to the patient. - */ - public CareTeamComponent setResponsible(boolean value) { - if (this.responsible == null) - this.responsible = new BooleanType(); - this.responsible.setValue(value); - return this; - } - - /** - * @return {@link #role} (The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.) - */ - public Coding getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Coding(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.) - */ - public CareTeamComponent setRole(Coding value) { - this.role = value; - return this; - } - - /** - * @return {@link #qualification} (The qualification which is applicable for this service.) - */ - public Coding getQualification() { - if (this.qualification == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamComponent.qualification"); - else if (Configuration.doAutoCreate()) - this.qualification = new Coding(); // cc - return this.qualification; - } - - public boolean hasQualification() { - return this.qualification != null && !this.qualification.isEmpty(); - } - - /** - * @param value {@link #qualification} (The qualification which is applicable for this service.) - */ - public CareTeamComponent setQualification(Coding value) { - this.qualification = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("provider", "Reference(Practitioner|Organization)", "Member of the team who provided the overall service.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("responsible", "boolean", "The party who is billing and responsible for the claimed good or service rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, responsible)); - childrenList.add(new Property("role", "Coding", "The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("qualification", "Coding", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, qualification)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference - case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // BooleanType - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding - case -631333393: /*qualification*/ return this.qualification == null ? new Base[0] : new Base[] {this.qualification}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -987494927: // provider - this.provider = castToReference(value); // Reference - break; - case 1847674614: // responsible - this.responsible = castToBoolean(value); // BooleanType - break; - case 3506294: // role - this.role = castToCoding(value); // Coding - break; - case -631333393: // qualification - this.qualification = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("provider")) - this.provider = castToReference(value); // Reference - else if (name.equals("responsible")) - this.responsible = castToBoolean(value); // BooleanType - else if (name.equals("role")) - this.role = castToCoding(value); // Coding - else if (name.equals("qualification")) - this.qualification = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -987494927: return getProvider(); // Reference - case 1847674614: throw new FHIRException("Cannot make property responsible as it is not a complex type"); // BooleanType - case 3506294: return getRole(); // Coding - case -631333393: return getQualification(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("provider")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("responsible")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.responsible"); - } - else if (name.equals("role")) { - this.role = new Coding(); - return this.role; - } - else if (name.equals("qualification")) { - this.qualification = new Coding(); - return this.qualification; - } - else - return super.addChild(name); - } - - public CareTeamComponent copy() { - CareTeamComponent dst = new CareTeamComponent(); - copyValues(dst); - dst.provider = provider == null ? null : provider.copy(); - dst.responsible = responsible == null ? null : responsible.copy(); - dst.role = role == null ? null : role.copy(); - dst.qualification = qualification == null ? null : qualification.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CareTeamComponent)) - return false; - CareTeamComponent o = (CareTeamComponent) other; - return compareDeep(provider, o.provider, true) && compareDeep(responsible, o.responsible, true) - && compareDeep(role, o.role, true) && compareDeep(qualification, o.qualification, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CareTeamComponent)) - return false; - CareTeamComponent o = (CareTeamComponent) other; - return compareValues(responsible, o.responsible, true); - } - - public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(provider, responsible, role - , qualification); - } - - public String fhirType() { - return "Claim.item.careTeam"; - - } - } @Block() @@ -4344,42 +4562,42 @@ public class Claim extends DomainResource { /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. */ - @Child(name = "service", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Billing Code", formalDefinition="If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. */ - @Child(name = "programCode", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "programCode", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-program-code") - protected List programCode; + protected List programCode; /** * The number of repetitions of a service or product. @@ -4402,24 +4620,17 @@ public class Claim extends DomainResource { @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, modifier=false, summary=false) - @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 addittional 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, modifier=false, summary=false) + @Child(name = "net", type = {Money.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "udi", type = {Device.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) protected List udi; /** @@ -4431,11 +4642,11 @@ public class Claim extends DomainResource { /** * Third tier of goods and services. */ - @Child(name = "subDetail", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "subDetail", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) protected List subDetail; - private static final long serialVersionUID = -753919335L; + private static final long serialVersionUID = 718584656L; /** * Constructor @@ -4500,12 +4711,12 @@ public class Claim extends DomainResource { /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create DetailComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -4516,7 +4727,7 @@ public class Claim extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public DetailComponent setRevenue(Coding value) { + public DetailComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -4524,12 +4735,12 @@ public class Claim extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create DetailComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -4540,7 +4751,7 @@ public class Claim extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public DetailComponent setCategory(Coding value) { + public DetailComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -4548,12 +4759,12 @@ public class Claim extends DomainResource { /** * @return {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public Coding getService() { + public CodeableConcept 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(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -4564,7 +4775,7 @@ public class Claim extends DomainResource { /** * @param value {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public DetailComponent setService(Coding value) { + public DetailComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -4572,16 +4783,16 @@ public class Claim extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public DetailComponent setModifier(List theModifier) { + public DetailComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -4589,25 +4800,25 @@ public class Claim extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public DetailComponent addModifier(Coding t) { //3 + public DetailComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -4615,7 +4826,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -4625,16 +4836,16 @@ public class Claim extends DomainResource { /** * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) */ - public List getProgramCode() { + public List getProgramCode() { if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); return this.programCode; } /** * @return Returns a reference to this for easy method chaining */ - public DetailComponent setProgramCode(List theProgramCode) { + public DetailComponent setProgramCode(List theProgramCode) { this.programCode = theProgramCode; return this; } @@ -4642,25 +4853,25 @@ public class Claim extends DomainResource { public boolean hasProgramCode() { if (this.programCode == null) return false; - for (Coding item : this.programCode) + for (CodeableConcept item : this.programCode) if (!item.isEmpty()) return true; return false; } - public Coding addProgramCode() { //3 - Coding t = new Coding(); + public CodeableConcept addProgramCode() { //3 + CodeableConcept t = new CodeableConcept(); if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return t; } - public DetailComponent addProgramCode(Coding t) { //3 + public DetailComponent addProgramCode(CodeableConcept t) { //3 if (t == null) return this; if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return this; } @@ -4668,7 +4879,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #programCode}, creating it if it does not already exist */ - public Coding getProgramCodeFirstRep() { + public CodeableConcept getProgramCodeFirstRep() { if (getProgramCode().isEmpty()) { addProgramCode(); } @@ -4790,73 +5001,6 @@ public class Claim extends DomainResource { 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(); // bb - 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; - } - - /** - * @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(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @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(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - /** * @return {@link #net} (The quantity times the unit price for an addittional 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.) */ @@ -5012,15 +5156,14 @@ public class Claim extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("programCode", "CodeableConcept", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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", "Reference(Device)", "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)); @@ -5030,15 +5173,14 @@ public class Claim extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // CodeableConcept case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent @@ -5054,19 +5196,19 @@ public class Claim extends DomainResource { this.sequence = castToPositiveInt(value); // PositiveIntType break; case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding + this.getProgramCode().add(castToCodeableConcept(value)); // CodeableConcept break; case -1285004149: // quantity this.quantity = castToSimpleQuantity(value); // SimpleQuantity @@ -5077,9 +5219,6 @@ public class Claim extends DomainResource { case -1282148017: // factor this.factor = castToDecimal(value); // DecimalType break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; case 108957: // net this.net = castToMoney(value); // Money break; @@ -5099,23 +5238,21 @@ public class Claim extends DomainResource { if (name.equals("sequence")) this.sequence = castToPositiveInt(value); // PositiveIntType else if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); + this.getProgramCode().add(castToCodeableConcept(value)); else if (name.equals("quantity")) this.quantity = castToSimpleQuantity(value); // SimpleQuantity else if (name.equals("unitPrice")) this.unitPrice = castToMoney(value); // Money else if (name.equals("factor")) this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType else if (name.equals("net")) this.net = castToMoney(value); // Money else if (name.equals("udi")) @@ -5130,15 +5267,14 @@ public class Claim extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding - case 1010065041: return addProgramCode(); // Coding + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept + case 1010065041: return addProgramCode(); // CodeableConcept case -1285004149: return getQuantity(); // SimpleQuantity case -486196699: return getUnitPrice(); // Money case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType case 108957: return getNet(); // Money case 115642: return addUdi(); // Reference case -828829007: return addSubDetail(); // SubDetailComponent @@ -5153,15 +5289,15 @@ public class Claim extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); } else if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -5181,9 +5317,6 @@ public class Claim extends DomainResource { else if (name.equals("factor")) { throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); - } else if (name.equals("net")) { this.net = new Money(); return this.net; @@ -5206,19 +5339,18 @@ public class Claim extends DomainResource { dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) + dst.programCode = new ArrayList(); + for (CodeableConcept i : programCode) dst.programCode.add(i.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(); if (udi != null) { dst.udi = new ArrayList(); @@ -5243,8 +5375,8 @@ public class Claim extends DomainResource { return compareDeep(sequence, o.sequence, true) && compareDeep(revenue, o.revenue, true) && compareDeep(category, o.category, true) && compareDeep(service, o.service, true) && compareDeep(modifier, o.modifier, true) && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) - && compareDeep(subDetail, o.subDetail, true); + && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) && compareDeep(subDetail, o.subDetail, true) + ; } @Override @@ -5254,14 +5386,13 @@ public class Claim extends DomainResource { if (!(other instanceof DetailComponent)) return false; DetailComponent o = (DetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, revenue, category - , service, modifier, programCode, quantity, unitPrice, factor, points, net, udi - , subDetail); + , service, modifier, programCode, quantity, unitPrice, factor, net, udi, subDetail + ); } public String fhirType() { @@ -5283,42 +5414,42 @@ public class Claim extends DomainResource { /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). */ - @Child(name = "service", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Billing Code", formalDefinition="A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. */ - @Child(name = "programCode", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "programCode", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-program-code") - protected List programCode; + protected List programCode; /** * The number of repetitions of a service or product. @@ -5341,24 +5472,17 @@ public class Claim extends DomainResource { @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, modifier=false, summary=false) - @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 addittional 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, modifier=false, summary=false) + @Child(name = "net", type = {Money.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "udi", type = {Device.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) protected List udi; /** @@ -5367,7 +5491,7 @@ public class Claim extends DomainResource { protected List udiTarget; - private static final long serialVersionUID = 1424899208L; + private static final long serialVersionUID = -1210367567L; /** * Constructor @@ -5432,12 +5556,12 @@ public class Claim extends DomainResource { /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create SubDetailComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -5448,7 +5572,7 @@ public class Claim extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public SubDetailComponent setRevenue(Coding value) { + public SubDetailComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -5456,12 +5580,12 @@ public class Claim extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create SubDetailComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -5472,7 +5596,7 @@ public class Claim extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public SubDetailComponent setCategory(Coding value) { + public SubDetailComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -5480,12 +5604,12 @@ public class Claim extends DomainResource { /** * @return {@link #service} (A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).) */ - public Coding getService() { + public CodeableConcept 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(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -5496,7 +5620,7 @@ public class Claim extends DomainResource { /** * @param value {@link #service} (A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).) */ - public SubDetailComponent setService(Coding value) { + public SubDetailComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -5504,16 +5628,16 @@ public class Claim extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public SubDetailComponent setModifier(List theModifier) { + public SubDetailComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -5521,25 +5645,25 @@ public class Claim extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public SubDetailComponent addModifier(Coding t) { //3 + public SubDetailComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -5547,7 +5671,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -5557,16 +5681,16 @@ public class Claim extends DomainResource { /** * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) */ - public List getProgramCode() { + public List getProgramCode() { if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); return this.programCode; } /** * @return Returns a reference to this for easy method chaining */ - public SubDetailComponent setProgramCode(List theProgramCode) { + public SubDetailComponent setProgramCode(List theProgramCode) { this.programCode = theProgramCode; return this; } @@ -5574,25 +5698,25 @@ public class Claim extends DomainResource { public boolean hasProgramCode() { if (this.programCode == null) return false; - for (Coding item : this.programCode) + for (CodeableConcept item : this.programCode) if (!item.isEmpty()) return true; return false; } - public Coding addProgramCode() { //3 - Coding t = new Coding(); + public CodeableConcept addProgramCode() { //3 + CodeableConcept t = new CodeableConcept(); if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return t; } - public SubDetailComponent addProgramCode(Coding t) { //3 + public SubDetailComponent addProgramCode(CodeableConcept t) { //3 if (t == null) return this; if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return this; } @@ -5600,7 +5724,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #programCode}, creating it if it does not already exist */ - public Coding getProgramCodeFirstRep() { + public CodeableConcept getProgramCodeFirstRep() { if (getProgramCode().isEmpty()) { addProgramCode(); } @@ -5722,73 +5846,6 @@ public class Claim extends DomainResource { 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(); // bb - 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; - } - - /** - * @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(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @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(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - /** * @return {@link #net} (The quantity times the unit price for an addittional 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.) */ @@ -5891,15 +5948,14 @@ public class Claim extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("programCode", "CodeableConcept", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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 addittional 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", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); } @@ -5908,15 +5964,14 @@ public class Claim extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // CodeableConcept case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference default: return super.getProperty(hash, name, checkValid); @@ -5931,19 +5986,19 @@ public class Claim extends DomainResource { this.sequence = castToPositiveInt(value); // PositiveIntType break; case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding + this.getProgramCode().add(castToCodeableConcept(value)); // CodeableConcept break; case -1285004149: // quantity this.quantity = castToSimpleQuantity(value); // SimpleQuantity @@ -5954,9 +6009,6 @@ public class Claim extends DomainResource { case -1282148017: // factor this.factor = castToDecimal(value); // DecimalType break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; case 108957: // net this.net = castToMoney(value); // Money break; @@ -5973,23 +6025,21 @@ public class Claim extends DomainResource { if (name.equals("sequence")) this.sequence = castToPositiveInt(value); // PositiveIntType else if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); + this.getProgramCode().add(castToCodeableConcept(value)); else if (name.equals("quantity")) this.quantity = castToSimpleQuantity(value); // SimpleQuantity else if (name.equals("unitPrice")) this.unitPrice = castToMoney(value); // Money else if (name.equals("factor")) this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType else if (name.equals("net")) this.net = castToMoney(value); // Money else if (name.equals("udi")) @@ -6002,15 +6052,14 @@ public class Claim extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding - case 1010065041: return addProgramCode(); // Coding + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept + case 1010065041: return addProgramCode(); // CodeableConcept case -1285004149: return getQuantity(); // SimpleQuantity case -486196699: return getUnitPrice(); // Money case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType case 108957: return getNet(); // Money case 115642: return addUdi(); // Reference default: return super.makeProperty(hash, name); @@ -6024,15 +6073,15 @@ public class Claim extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); } else if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -6052,9 +6101,6 @@ public class Claim extends DomainResource { else if (name.equals("factor")) { throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); - } else if (name.equals("net")) { this.net = new Money(); return this.net; @@ -6074,19 +6120,18 @@ public class Claim extends DomainResource { dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) + dst.programCode = new ArrayList(); + for (CodeableConcept i : programCode) dst.programCode.add(i.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(); if (udi != null) { dst.udi = new ArrayList(); @@ -6106,8 +6151,7 @@ public class Claim extends DomainResource { return compareDeep(sequence, o.sequence, true) && compareDeep(revenue, o.revenue, true) && compareDeep(category, o.category, true) && compareDeep(service, o.service, true) && compareDeep(modifier, o.modifier, true) && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) - ; + && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true); } @Override @@ -6117,14 +6161,12 @@ public class Claim extends DomainResource { if (!(other instanceof SubDetailComponent)) return false; SubDetailComponent o = (SubDetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, revenue, category - , service, modifier, programCode, quantity, unitPrice, factor, points, net, udi - ); + , service, modifier, programCode, quantity, unitPrice, factor, net, udi); } public String fhirType() { @@ -6153,12 +6195,12 @@ public class Claim extends DomainResource { /** * Material of the prior denture or bridge prosthesis. (Oral). */ - @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "priorMaterial", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/oral-prosthodontic-material") - protected Coding priorMaterial; + protected CodeableConcept priorMaterial; - private static final long serialVersionUID = 1739349641L; + private static final long serialVersionUID = -539400614L; /** * Constructor @@ -6264,12 +6306,12 @@ public class Claim extends DomainResource { /** * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) */ - public Coding getPriorMaterial() { + public CodeableConcept getPriorMaterial() { if (this.priorMaterial == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); else if (Configuration.doAutoCreate()) - this.priorMaterial = new Coding(); // cc + this.priorMaterial = new CodeableConcept(); // cc return this.priorMaterial; } @@ -6280,7 +6322,7 @@ public class Claim extends DomainResource { /** * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) */ - public ProsthesisComponent setPriorMaterial(Coding value) { + public ProsthesisComponent setPriorMaterial(CodeableConcept value) { this.priorMaterial = value; return this; } @@ -6289,7 +6331,7 @@ public class Claim extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial)); childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); - childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); + childrenList.add(new Property("priorMaterial", "CodeableConcept", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); } @Override @@ -6297,7 +6339,7 @@ public class Claim extends DomainResource { switch (hash) { case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // BooleanType case -1770675816: /*priorDate*/ return this.priorDate == null ? new Base[0] : new Base[] {this.priorDate}; // DateType - case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // Coding + case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -6313,7 +6355,7 @@ public class Claim extends DomainResource { this.priorDate = castToDate(value); // DateType break; case -532999663: // priorMaterial - this.priorMaterial = castToCoding(value); // Coding + this.priorMaterial = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -6327,7 +6369,7 @@ public class Claim extends DomainResource { else if (name.equals("priorDate")) this.priorDate = castToDate(value); // DateType else if (name.equals("priorMaterial")) - this.priorMaterial = castToCoding(value); // Coding + this.priorMaterial = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -6337,7 +6379,7 @@ public class Claim extends DomainResource { switch (hash) { case 1948342084: throw new FHIRException("Cannot make property initial as it is not a complex type"); // BooleanType case -1770675816: throw new FHIRException("Cannot make property priorDate as it is not a complex type"); // DateType - case -532999663: return getPriorMaterial(); // Coding + case -532999663: return getPriorMaterial(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -6352,7 +6394,7 @@ public class Claim extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type Claim.priorDate"); } else if (name.equals("priorMaterial")) { - this.priorMaterial = new Coding(); + this.priorMaterial = new CodeableConcept(); return this.priorMaterial; } else @@ -6399,262 +6441,6 @@ public class Claim extends DomainResource { } - } - - @Block() - public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The code identifying which tooth is missing. - */ - @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/teeth") - protected Coding tooth; - - /** - * Missing reason may be: E-extraction, O-other. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Indicates whether it was extracted or other reason", formalDefinition="Missing reason may be: E-extraction, O-other." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/missing-tooth-reason") - protected Coding reason; - - /** - * The date of the extraction either known from records or patient reported estimate. - */ - @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Date tooth was extracted if known", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) - protected DateType extractionDate; - - private static final long serialVersionUID = 352913313L; - - /** - * Constructor - */ - public MissingTeethComponent() { - super(); - } - - /** - * Constructor - */ - public MissingTeethComponent(Coding tooth) { - super(); - this.tooth = tooth; - } - - /** - * @return {@link #tooth} (The code identifying which tooth is missing.) - */ - public Coding getTooth() { - if (this.tooth == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); - else if (Configuration.doAutoCreate()) - this.tooth = new Coding(); // cc - return this.tooth; - } - - public boolean hasTooth() { - return this.tooth != null && !this.tooth.isEmpty(); - } - - /** - * @param value {@link #tooth} (The code identifying which tooth is missing.) - */ - public MissingTeethComponent setTooth(Coding value) { - this.tooth = value; - return this; - } - - /** - * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public MissingTeethComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public DateType getExtractionDateElement() { - if (this.extractionDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate"); - else if (Configuration.doAutoCreate()) - this.extractionDate = new DateType(); // bb - return this.extractionDate; - } - - public boolean hasExtractionDateElement() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - public boolean hasExtractionDate() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - /** - * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public MissingTeethComponent setExtractionDateElement(DateType value) { - this.extractionDate = value; - return this; - } - - /** - * @return The date of the extraction either known from records or patient reported estimate. - */ - 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(Date value) { - if (value == null) - this.extractionDate = null; - else { - if (this.extractionDate == null) - this.extractionDate = new DateType(); - this.extractionDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); - childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 110545608: /*tooth*/ return this.tooth == null ? new Base[0] : new Base[] {this.tooth}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case 580646965: /*extractionDate*/ return this.extractionDate == null ? new Base[0] : new Base[] {this.extractionDate}; // DateType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 110545608: // tooth - this.tooth = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case 580646965: // extractionDate - this.extractionDate = castToDate(value); // DateType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("tooth")) - this.tooth = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("extractionDate")) - this.extractionDate = castToDate(value); // DateType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 110545608: return getTooth(); // Coding - case -934964668: return getReason(); // Coding - case 580646965: throw new FHIRException("Cannot make property extractionDate as it is not a complex type"); // DateType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("tooth")) { - this.tooth = new Coding(); - return this.tooth; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("extractionDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.extractionDate"); - } - else - return super.addChild(name); - } - - public MissingTeethComponent copy() { - MissingTeethComponent dst = new MissingTeethComponent(); - copyValues(dst); - dst.tooth = tooth == null ? null : tooth.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.extractionDate = extractionDate == null ? null : extractionDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareValues(extractionDate, o.extractionDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(tooth, reason, extractionDate - ); - } - - public String fhirType() { - return "Claim.missingTeeth"; - - } - } /** @@ -6667,73 +6453,89 @@ public class Claim extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; /** * The category of claim, eg, oral, pharmacy, vision, insitutional, professional. */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type or discipline", formalDefinition="The category of claim, eg, oral, pharmacy, vision, insitutional, professional." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-type") - protected Coding type; + protected CodeableConcept type; /** * A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType. */ - @Child(name = "subType", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "subType", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Finer grained claim type information", formalDefinition="A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-subtype") - protected List subType; + protected List subType; /** - * The version of the specification on which this instance relies. + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; + @Child(name = "use", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-use") + protected Enumeration use; /** - * The version of the specification from which the original instance was created. + * Patient Resource. */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; + @Child(name = "patient", type = {Patient.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; /** - * The date when the enclosed suite of services were performed or completed. + * The actual object that is the target of the reference (Patient Resource.) */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; + protected Patient patientTarget; /** * The billable period for which charges are being submitted. */ - @Child(name = "billablePeriod", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "billablePeriod", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Period for charge submission", formalDefinition="The billable period for which charges are being submitted." ) protected Period billablePeriod; /** - * The Insurer who is target of the request. + * The date when the enclosed suite of services were performed or completed. */ - @Child(name = "insurer", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Target", formalDefinition="The Insurer who is target of the request." ) + @Child(name = "created", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name = "enterer", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=false) + @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; + + /** + * The Insurer who is target of the request. + */ + @Child(name = "insurer", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Target", formalDefinition="The Insurer who is target of the request." ) protected Reference insurer; /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) + * The actual object that is the target of the reference (The Insurer who is target of the request.) */ protected Organization insurerTarget; /** * The provider which is responsible for the bill, claim pre-determination, pre-authorization. */ - @Child(name = "provider", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "provider", type = {Practitioner.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) protected Reference provider; @@ -6745,7 +6547,7 @@ public class Claim extends DomainResource { /** * The organization which is responsible for the bill, claim pre-determination, pre-authorization. */ - @Child(name = "organization", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "organization", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) protected Reference organization; @@ -6754,65 +6556,33 @@ public class Claim extends DomainResource { */ protected Organization organizationTarget; - /** - * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - @Child(name = "use", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-use") - protected Enumeration use; - /** * Immediate (STAT), best effort (NORMAL), deferred (DEFER). */ - @Child(name = "priority", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "priority", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/process-priority") - protected Coding priority; + protected CodeableConcept 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=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "fundsReserve", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false) @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." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fundsreserve") - protected Coding fundsReserve; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name = "enterer", type = {Practitioner.class}, order=14, min=0, max=1, modifier=false, summary=false) - @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=15, min=0, max=1, modifier=false, summary=false) - @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; + protected CodeableConcept fundsReserve; /** * Other claims which are related to this claim such as prior claim versions or for related services. */ - @Child(name = "related", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "related", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Related Claims which may be revelant to processing this claimn", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) protected List related; /** * Prescription to support the dispensing of Pharmacy or Vision products. */ - @Child(name = "prescription", type = {MedicationRequest.class, VisionPrescription.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Child(name = "prescription", type = {MedicationRequest.class, VisionPrescription.class}, order=15, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) protected Reference prescription; @@ -6822,28 +6592,28 @@ public class Claim extends DomainResource { protected Resource prescriptionTarget; /** - * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. + * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'. */ - @Child(name = "originalPrescription", type = {MedicationRequest.class}, order=18, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products." ) + @Child(name = "originalPrescription", type = {MedicationRequest.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'." ) protected Reference originalPrescription; /** - * The actual object that is the target of the reference (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * The actual object that is the target of the reference (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ protected MedicationRequest originalPrescriptionTarget; /** * The party to be reimbursed for the services. */ - @Child(name = "payee", type = {}, order=19, min=0, max=1, modifier=false, summary=false) + @Child(name = "payee", type = {}, order=17, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="The party to be reimbursed 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=20, min=0, max=1, modifier=false, summary=false) + @Child(name = "referral", type = {ReferralRequest.class}, order=18, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) protected Reference referral; @@ -6852,6 +6622,25 @@ public class Claim extends DomainResource { */ protected ReferralRequest referralTarget; + /** + * Facility where the services were provided. + */ + @Child(name = "facility", type = {Location.class}, order=19, min=0, max=1, modifier=false, summary=false) + @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; + + /** + * The members of the team who provided the overall service as well as their role and whether responsible and qualifications. + */ + @Child(name = "careTeam", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Members of the care team", formalDefinition="The members of the team who provided the overall service as well as their role and whether responsible and qualifications." ) + protected List careTeam; + /** * Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required. */ @@ -6873,68 +6662,49 @@ public class Claim extends DomainResource { @Description(shortDefinition="Procedures performed", formalDefinition="Ordered list of patient procedures performed to support the adjudication." ) protected List procedure; - /** - * Patient Resource. - */ - @Child(name = "patient", type = {Patient.class}, order=24, min=1, max=1, modifier=false, summary=false) - @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=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "insurance", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; + protected List insurance; /** * An accident which resulted in the need for healthcare services. */ - @Child(name = "accident", type = {}, order=26, min=0, max=1, modifier=false, summary=false) + @Child(name = "accident", type = {}, order=25, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Details about an accident", formalDefinition="An accident which resulted in the need for healthcare services." ) protected AccidentComponent accident; /** * The start and optional end dates of when the patient was precluded from working due to the treatable condition(s). */ - @Child(name = "employmentImpacted", type = {Period.class}, order=27, min=0, max=1, modifier=false, summary=false) + @Child(name = "employmentImpacted", type = {Period.class}, order=26, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Period unable to work", formalDefinition="The start and optional end dates of when the patient was precluded from working due to the treatable condition(s)." ) protected Period employmentImpacted; /** * The start and optional end dates of when the patient was confined to a treatment center. */ - @Child(name = "hospitalization", type = {Period.class}, order=28, min=0, max=1, modifier=false, summary=false) + @Child(name = "hospitalization", type = {Period.class}, order=27, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Period in hospital", formalDefinition="The start and optional end dates of when the patient was confined to a treatment center." ) protected Period hospitalization; /** * First tier of goods and services. */ - @Child(name = "item", type = {}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "item", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Goods and Services", formalDefinition="First tier of goods and services." ) protected List item; /** * The total value of the claim. */ - @Child(name = "total", type = {Money.class}, order=30, min=0, max=1, modifier=false, summary=false) + @Child(name = "total", type = {Money.class}, order=29, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total claim cost", formalDefinition="The total value of the claim." ) protected Money total; - /** - * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. - */ - @Child(name = "missingTeeth", type = {}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) - protected List missingTeeth; - - private static final long serialVersionUID = -587280853L; + private static final long serialVersionUID = 1731171342L; /** * Constructor @@ -6943,16 +6713,6 @@ public class Claim extends DomainResource { super(); } - /** - * Constructor - */ - public Claim(Enumeration status, Coding type, Reference patient) { - super(); - this.status = status; - this.type = type; - this.patient = patient; - } - /** * @return {@link #identifier} (The business identifier for the instance: claim number, pre-determination or pre-authorization number.) */ @@ -7045,21 +6805,25 @@ public class Claim extends DomainResource { * @param value The status of the resource instance. */ public Claim setStatus(ClaimStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new ClaimStatusEnumFactory()); this.status.setValue(value); + } return this; } /** * @return {@link #type} (The category of claim, eg, oral, pharmacy, vision, insitutional, professional.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Claim.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -7070,7 +6834,7 @@ public class Claim extends DomainResource { /** * @param value {@link #type} (The category of claim, eg, oral, pharmacy, vision, insitutional, professional.) */ - public Claim setType(Coding value) { + public Claim setType(CodeableConcept value) { this.type = value; return this; } @@ -7078,16 +6842,16 @@ public class Claim extends DomainResource { /** * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) */ - public List getSubType() { + public List getSubType() { if (this.subType == null) - this.subType = new ArrayList(); + this.subType = new ArrayList(); return this.subType; } /** * @return Returns a reference to this for easy method chaining */ - public Claim setSubType(List theSubType) { + public Claim setSubType(List theSubType) { this.subType = theSubType; return this; } @@ -7095,25 +6859,25 @@ public class Claim extends DomainResource { public boolean hasSubType() { if (this.subType == null) return false; - for (Coding item : this.subType) + for (CodeableConcept item : this.subType) if (!item.isEmpty()) return true; return false; } - public Coding addSubType() { //3 - Coding t = new Coding(); + public CodeableConcept addSubType() { //3 + CodeableConcept t = new CodeableConcept(); if (this.subType == null) - this.subType = new ArrayList(); + this.subType = new ArrayList(); this.subType.add(t); return t; } - public Claim addSubType(Coding t) { //3 + public Claim addSubType(CodeableConcept t) { //3 if (t == null) return this; if (this.subType == null) - this.subType = new ArrayList(); + this.subType = new ArrayList(); this.subType.add(t); return this; } @@ -7121,7 +6885,7 @@ public class Claim extends DomainResource { /** * @return The first repetition of repeating field {@link #subType}, creating it if it does not already exist */ - public Coding getSubTypeFirstRep() { + public CodeableConcept getSubTypeFirstRep() { if (getSubType().isEmpty()) { addSubType(); } @@ -7129,50 +6893,119 @@ public class Claim extends DomainResource { } /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) + * @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 Coding getRuleset() { - if (this.ruleset == null) + public Enumeration getUseElement() { + if (this.use == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.ruleset"); + throw new Error("Attempt to auto-create Claim.use"); else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; + this.use = new Enumeration(new UseEnumFactory()); // bb + return this.use; } - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); } /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + * @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 Claim setRuleset(Coding value) { - this.ruleset = value; + public Claim setUseElement(Enumeration value) { + this.use = value; return this; } /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + public Use getUse() { + return this.use == null ? null : this.use.getValue(); } /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). */ - public Claim setOriginalRuleset(Coding value) { - this.originalRuleset = value; + public Claim setUse(Use value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(new UseEnumFactory()); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public Claim 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 Claim.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 Claim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #billablePeriod} (The billable period for which charges are being submitted.) + */ + public Period getBillablePeriod() { + if (this.billablePeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Claim.billablePeriod"); + else if (Configuration.doAutoCreate()) + this.billablePeriod = new Period(); // cc + return this.billablePeriod; + } + + public boolean hasBillablePeriod() { + return this.billablePeriod != null && !this.billablePeriod.isEmpty(); + } + + /** + * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.) + */ + public Claim setBillablePeriod(Period value) { + this.billablePeriod = value; return this; } @@ -7226,31 +7059,51 @@ public class Claim extends DomainResource { } /** - * @return {@link #billablePeriod} (The billable period for which charges are being submitted.) + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) */ - public Period getBillablePeriod() { - if (this.billablePeriod == null) + public Reference getEnterer() { + if (this.enterer == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.billablePeriod"); + throw new Error("Attempt to auto-create Claim.enterer"); else if (Configuration.doAutoCreate()) - this.billablePeriod = new Period(); // cc - return this.billablePeriod; + this.enterer = new Reference(); // cc + return this.enterer; } - public boolean hasBillablePeriod() { - return this.billablePeriod != null && !this.billablePeriod.isEmpty(); + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); } /** - * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.) + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) */ - public Claim setBillablePeriod(Period value) { - this.billablePeriod = value; + public Claim setEnterer(Reference value) { + this.enterer = value; return this; } /** - * @return {@link #insurer} (The Insurer who is target of the request.) + * @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 Claim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); // aa + 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 Claim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #insurer} (The Insurer who is target of the request.) */ public Reference getInsurer() { if (this.insurer == null) @@ -7266,7 +7119,7 @@ public class Claim extends DomainResource { } /** - * @param value {@link #insurer} (The Insurer who is target of the request.) + * @param value {@link #insurer} (The Insurer who is target of the request.) */ public Claim setInsurer(Reference value) { this.insurer = value; @@ -7274,7 +7127,7 @@ public class Claim extends DomainResource { } /** - * @return {@link #insurer} 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 Insurer who is target of the request.) + * @return {@link #insurer} 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 Insurer who is target of the request.) */ public Organization getInsurerTarget() { if (this.insurerTarget == null) @@ -7286,7 +7139,7 @@ public class Claim extends DomainResource { } /** - * @param value {@link #insurer} 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.) + * @param value {@link #insurer} 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 Claim setInsurerTarget(Organization value) { this.insurerTarget = value; @@ -7381,64 +7234,15 @@ public class Claim extends DomainResource { 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 Claim.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new UseEnumFactory()); // bb - 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 Claim setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public Use getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public Claim setUse(Use value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new UseEnumFactory()); - this.use.setValue(value); - } - return this; - } - /** * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) */ - public Coding getPriority() { + public CodeableConcept getPriority() { if (this.priority == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Claim.priority"); else if (Configuration.doAutoCreate()) - this.priority = new Coding(); // cc + this.priority = new CodeableConcept(); // cc return this.priority; } @@ -7449,7 +7253,7 @@ public class Claim extends DomainResource { /** * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) */ - public Claim setPriority(Coding value) { + public Claim setPriority(CodeableConcept value) { this.priority = value; return this; } @@ -7457,12 +7261,12 @@ public class Claim extends DomainResource { /** * @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() { + public CodeableConcept getFundsReserve() { if (this.fundsReserve == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Claim.fundsReserve"); else if (Configuration.doAutoCreate()) - this.fundsReserve = new Coding(); // cc + this.fundsReserve = new CodeableConcept(); // cc return this.fundsReserve; } @@ -7473,99 +7277,11 @@ public class Claim extends DomainResource { /** * @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 Claim setFundsReserve(Coding value) { + public Claim setFundsReserve(CodeableConcept 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 Claim.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); // cc - 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 Claim 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 Claim.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); // aa - 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 Claim 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 Claim.facility"); - else if (Configuration.doAutoCreate()) - this.facility = new Reference(); // cc - return this.facility; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public Claim 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 Claim.facility"); - else if (Configuration.doAutoCreate()) - this.facilityTarget = new Location(); // aa - 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 Claim setFacilityTarget(Location value) { - this.facilityTarget = value; - return this; - } - /** * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) */ @@ -7659,7 +7375,7 @@ public class Claim extends DomainResource { } /** - * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ public Reference getOriginalPrescription() { if (this.originalPrescription == null) @@ -7675,7 +7391,7 @@ public class Claim extends DomainResource { } /** - * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ public Claim setOriginalPrescription(Reference value) { this.originalPrescription = value; @@ -7683,7 +7399,7 @@ public class Claim extends DomainResource { } /** - * @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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * @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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ public MedicationRequest getOriginalPrescriptionTarget() { if (this.originalPrescriptionTarget == null) @@ -7695,7 +7411,7 @@ public class Claim extends DomainResource { } /** - * @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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * @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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ public Claim setOriginalPrescriptionTarget(MedicationRequest value) { this.originalPrescriptionTarget = value; @@ -7770,6 +7486,103 @@ public class Claim extends DomainResource { 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 Claim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); // cc + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public Claim 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 Claim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); // aa + 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 Claim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #careTeam} (The members of the team who provided the overall service as well as their role and whether responsible and qualifications.) + */ + public List getCareTeam() { + if (this.careTeam == null) + this.careTeam = new ArrayList(); + return this.careTeam; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public Claim setCareTeam(List theCareTeam) { + this.careTeam = theCareTeam; + return this; + } + + public boolean hasCareTeam() { + if (this.careTeam == null) + return false; + for (CareTeamComponent item : this.careTeam) + if (!item.isEmpty()) + return true; + return false; + } + + public CareTeamComponent addCareTeam() { //3 + CareTeamComponent t = new CareTeamComponent(); + if (this.careTeam == null) + this.careTeam = new ArrayList(); + this.careTeam.add(t); + return t; + } + + public Claim addCareTeam(CareTeamComponent t) { //3 + if (t == null) + return this; + if (this.careTeam == null) + this.careTeam = new ArrayList(); + this.careTeam.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #careTeam}, creating it if it does not already exist + */ + public CareTeamComponent getCareTeamFirstRep() { + if (getCareTeam().isEmpty()) { + addCareTeam(); + } + return getCareTeam().get(0); + } + /** * @return {@link #information} (Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required.) */ @@ -7930,100 +7743,56 @@ public class Claim extends DomainResource { } /** - * @return {@link #patient} (Patient Resource.) + * @return {@link #insurance} (Financial instrument by which payment information for health care.) */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient Resource.) - */ - public Claim 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 Claim.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - 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 Claim 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 List getInsurance() { + if (this.insurance == null) + this.insurance = new ArrayList(); + return this.insurance; } /** * @return Returns a reference to this for easy method chaining */ - public Claim setCoverage(List theCoverage) { - this.coverage = theCoverage; + public Claim setInsurance(List theInsurance) { + this.insurance = theInsurance; return this; } - public boolean hasCoverage() { - if (this.coverage == null) + public boolean hasInsurance() { + if (this.insurance == null) return false; - for (CoverageComponent item : this.coverage) + for (InsuranceComponent item : this.insurance) if (!item.isEmpty()) return true; return false; } - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); + public InsuranceComponent addInsurance() { //3 + InsuranceComponent t = new InsuranceComponent(); + if (this.insurance == null) + this.insurance = new ArrayList(); + this.insurance.add(t); return t; } - public Claim addCoverage(CoverageComponent t) { //3 + public Claim addInsurance(InsuranceComponent t) { //3 if (t == null) return this; - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); + if (this.insurance == null) + this.insurance = new ArrayList(); + this.insurance.add(t); return this; } /** - * @return The first repetition of repeating field {@link #coverage}, creating it if it does not already exist + * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist */ - public CoverageComponent getCoverageFirstRep() { - if (getCoverage().isEmpty()) { - addCoverage(); + public InsuranceComponent getInsuranceFirstRep() { + if (getInsurance().isEmpty()) { + addInsurance(); } - return getCoverage().get(0); + return getInsurance().get(0); } /** @@ -8175,93 +7944,38 @@ public class Claim extends DomainResource { return this; } - /** - * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - public List getMissingTeeth() { - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - return this.missingTeeth; - } - - /** - * @return Returns a reference to this for easy method chaining - */ - public Claim setMissingTeeth(List theMissingTeeth) { - this.missingTeeth = theMissingTeeth; - return this; - } - - public boolean hasMissingTeeth() { - if (this.missingTeeth == null) - return false; - for (MissingTeethComponent item : this.missingTeeth) - if (!item.isEmpty()) - return true; - return false; - } - - public MissingTeethComponent addMissingTeeth() { //3 - MissingTeethComponent t = new MissingTeethComponent(); - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return t; - } - - public Claim addMissingTeeth(MissingTeethComponent t) { //3 - if (t == null) - return this; - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return this; - } - - /** - * @return The first repetition of repeating field {@link #missingTeeth}, creating it if it does not already exist - */ - public MissingTeethComponent getMissingTeethFirstRep() { - if (getMissingTeeth().isEmpty()) { - addMissingTeeth(); - } - return getMissingTeeth().get(0); - } - protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "Coding", "The category of claim, eg, oral, pharmacy, vision, insitutional, professional.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subType", "Coding", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType)); - 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("type", "CodeableConcept", "The category of claim, eg, oral, pharmacy, vision, insitutional, professional.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subType", "CodeableConcept", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType)); + 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("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); childrenList.add(new Property("billablePeriod", "Period", "The billable period for which charges are being submitted.", 0, java.lang.Integer.MAX_VALUE, billablePeriod)); - childrenList.add(new Property("insurer", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, insurer)); + 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("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("insurer", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, insurer)); 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("priority", "CodeableConcept", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "CodeableConcept", "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("related", "", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, related)); childrenList.add(new Property("prescription", "Reference(MedicationRequest|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("originalPrescription", "Reference(MedicationRequest)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); + childrenList.add(new Property("originalPrescription", "Reference(MedicationRequest)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); childrenList.add(new Property("payee", "", "The party to be reimbursed 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("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("careTeam", "", "The members of the team who provided the overall service as well as their role and whether responsible and qualifications.", 0, java.lang.Integer.MAX_VALUE, careTeam)); childrenList.add(new Property("information", "", "Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required.", 0, java.lang.Integer.MAX_VALUE, information)); 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("procedure", "", "Ordered list of patient procedures performed to support the adjudication.", 0, java.lang.Integer.MAX_VALUE, procedure)); - 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("insurance", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, insurance)); childrenList.add(new Property("accident", "", "An accident which resulted in the need for healthcare services.", 0, java.lang.Integer.MAX_VALUE, accident)); childrenList.add(new Property("employmentImpacted", "Period", "The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).", 0, java.lang.Integer.MAX_VALUE, employmentImpacted)); childrenList.add(new Property("hospitalization", "Period", "The start and optional end dates of when the patient was confined to a treatment center.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); childrenList.add(new Property("total", "Money", "The total value of the claim.", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth)); } @Override @@ -8269,36 +7983,34 @@ public class Claim extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // Coding - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // CodeableConcept + case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference case -332066046: /*billablePeriod*/ return this.billablePeriod == null ? new Base[0] : new Base[] {this.billablePeriod}; // Period + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Coding - case 1314609806: /*fundsReserve*/ return this.fundsReserve == null ? new Base[0] : new Base[] {this.fundsReserve}; // Coding - case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference - case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Reference + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept + case 1314609806: /*fundsReserve*/ return this.fundsReserve == null ? new Base[0] : new Base[] {this.fundsReserve}; // CodeableConcept case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // RelatedClaimComponent case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Reference case -1814015861: /*originalPrescription*/ return this.originalPrescription == null ? new Base[0] : new Base[] {this.originalPrescription}; // Reference case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // PayeeComponent case -722568291: /*referral*/ return this.referral == null ? new Base[0] : new Base[] {this.referral}; // Reference + case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Reference + case -7323378: /*careTeam*/ return this.careTeam == null ? new Base[0] : this.careTeam.toArray(new Base[this.careTeam.size()]); // CareTeamComponent case 1968600364: /*information*/ return this.information == null ? new Base[0] : this.information.toArray(new Base[this.information.size()]); // SpecialConditionComponent case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // ProcedureComponent - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent + case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // InsuranceComponent case -2143202801: /*accident*/ return this.accident == null ? new Base[0] : new Base[] {this.accident}; // AccidentComponent case 1051487345: /*employmentImpacted*/ return this.employmentImpacted == null ? new Base[0] : new Base[] {this.employmentImpacted}; // Period case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // Period case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemComponent case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // Money - case -1157130302: /*missingTeeth*/ return this.missingTeeth == null ? new Base[0] : this.missingTeeth.toArray(new Base[this.missingTeeth.size()]); // MissingTeethComponent default: return super.getProperty(hash, name, checkValid); } @@ -8314,22 +8026,25 @@ public class Claim extends DomainResource { this.status = new ClaimStatusEnumFactory().fromType(value); // Enumeration break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case -1868521062: // subType - this.getSubType().add(castToCoding(value)); // Coding + this.getSubType().add(castToCodeableConcept(value)); // CodeableConcept break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding + case 116103: // use + this.use = new UseEnumFactory().fromType(value); // Enumeration break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case -332066046: // billablePeriod + this.billablePeriod = castToPeriod(value); // Period break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType break; - case -332066046: // billablePeriod - this.billablePeriod = castToPeriod(value); // Period + case -1591951995: // enterer + this.enterer = castToReference(value); // Reference break; case 1957615864: // insurer this.insurer = castToReference(value); // Reference @@ -8340,20 +8055,11 @@ public class Claim extends DomainResource { case 1178922291: // organization this.organization = castToReference(value); // Reference break; - case 116103: // use - this.use = new UseEnumFactory().fromType(value); // Enumeration - break; case -1165461084: // priority - this.priority = castToCoding(value); // Coding + this.priority = castToCodeableConcept(value); // CodeableConcept break; case 1314609806: // fundsReserve - this.fundsReserve = castToCoding(value); // Coding - break; - case -1591951995: // enterer - this.enterer = castToReference(value); // Reference - break; - case 501116579: // facility - this.facility = castToReference(value); // Reference + this.fundsReserve = castToCodeableConcept(value); // CodeableConcept break; case 1090493483: // related this.getRelated().add((RelatedClaimComponent) value); // RelatedClaimComponent @@ -8370,6 +8076,12 @@ public class Claim extends DomainResource { case -722568291: // referral this.referral = castToReference(value); // Reference break; + case 501116579: // facility + this.facility = castToReference(value); // Reference + break; + case -7323378: // careTeam + this.getCareTeam().add((CareTeamComponent) value); // CareTeamComponent + break; case 1968600364: // information this.getInformation().add((SpecialConditionComponent) value); // SpecialConditionComponent break; @@ -8379,11 +8091,8 @@ public class Claim extends DomainResource { case -1095204141: // procedure this.getProcedure().add((ProcedureComponent) value); // ProcedureComponent break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -351767064: // coverage - this.getCoverage().add((CoverageComponent) value); // CoverageComponent + case 73049818: // insurance + this.getInsurance().add((InsuranceComponent) value); // InsuranceComponent break; case -2143202801: // accident this.accident = (AccidentComponent) value; // AccidentComponent @@ -8400,9 +8109,6 @@ public class Claim extends DomainResource { case 110549828: // total this.total = castToMoney(value); // Money break; - case -1157130302: // missingTeeth - this.getMissingTeeth().add((MissingTeethComponent) value); // MissingTeethComponent - break; default: super.setProperty(hash, name, value); } @@ -8415,33 +8121,29 @@ public class Claim extends DomainResource { else if (name.equals("status")) this.status = new ClaimStatusEnumFactory().fromType(value); // Enumeration else if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("subType")) - this.getSubType().add(castToCoding(value)); - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType + this.getSubType().add(castToCodeableConcept(value)); + else if (name.equals("use")) + this.use = new UseEnumFactory().fromType(value); // Enumeration + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference else if (name.equals("billablePeriod")) this.billablePeriod = castToPeriod(value); // Period + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("enterer")) + this.enterer = castToReference(value); // Reference else if (name.equals("insurer")) this.insurer = castToReference(value); // Reference else if (name.equals("provider")) this.provider = castToReference(value); // Reference else if (name.equals("organization")) this.organization = castToReference(value); // Reference - else if (name.equals("use")) - this.use = new UseEnumFactory().fromType(value); // Enumeration else if (name.equals("priority")) - this.priority = castToCoding(value); // Coding + this.priority = castToCodeableConcept(value); // CodeableConcept else if (name.equals("fundsReserve")) - this.fundsReserve = castToCoding(value); // Coding - else if (name.equals("enterer")) - this.enterer = castToReference(value); // Reference - else if (name.equals("facility")) - this.facility = castToReference(value); // Reference + this.fundsReserve = castToCodeableConcept(value); // CodeableConcept else if (name.equals("related")) this.getRelated().add((RelatedClaimComponent) value); else if (name.equals("prescription")) @@ -8452,16 +8154,18 @@ public class Claim extends DomainResource { this.payee = (PayeeComponent) value; // PayeeComponent else if (name.equals("referral")) this.referral = castToReference(value); // Reference + else if (name.equals("facility")) + this.facility = castToReference(value); // Reference + else if (name.equals("careTeam")) + this.getCareTeam().add((CareTeamComponent) value); else if (name.equals("information")) this.getInformation().add((SpecialConditionComponent) value); else if (name.equals("diagnosis")) this.getDiagnosis().add((DiagnosisComponent) value); else if (name.equals("procedure")) this.getProcedure().add((ProcedureComponent) value); - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("coverage")) - this.getCoverage().add((CoverageComponent) value); + else if (name.equals("insurance")) + this.getInsurance().add((InsuranceComponent) value); else if (name.equals("accident")) this.accident = (AccidentComponent) value; // AccidentComponent else if (name.equals("employmentImpacted")) @@ -8472,8 +8176,6 @@ public class Claim extends DomainResource { this.getItem().add((ItemComponent) value); else if (name.equals("total")) this.total = castToMoney(value); // Money - else if (name.equals("missingTeeth")) - this.getMissingTeeth().add((MissingTeethComponent) value); else super.setProperty(name, value); } @@ -8483,36 +8185,34 @@ public class Claim extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3575610: return getType(); // Coding - case -1868521062: return addSubType(); // Coding - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 3575610: return getType(); // CodeableConcept + case -1868521062: return addSubType(); // CodeableConcept + case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration + case -791418107: return getPatient(); // Reference case -332066046: return getBillablePeriod(); // Period + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -1591951995: return getEnterer(); // Reference case 1957615864: return getInsurer(); // Reference case -987494927: return getProvider(); // Reference case 1178922291: return getOrganization(); // Reference - case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration - case -1165461084: return getPriority(); // Coding - case 1314609806: return getFundsReserve(); // Coding - case -1591951995: return getEnterer(); // Reference - case 501116579: return getFacility(); // Reference + case -1165461084: return getPriority(); // CodeableConcept + case 1314609806: return getFundsReserve(); // CodeableConcept case 1090493483: return addRelated(); // RelatedClaimComponent case 460301338: return getPrescription(); // Reference case -1814015861: return getOriginalPrescription(); // Reference case 106443592: return getPayee(); // PayeeComponent case -722568291: return getReferral(); // Reference + case 501116579: return getFacility(); // Reference + case -7323378: return addCareTeam(); // CareTeamComponent case 1968600364: return addInformation(); // SpecialConditionComponent case 1196993265: return addDiagnosis(); // DiagnosisComponent case -1095204141: return addProcedure(); // ProcedureComponent - case -791418107: return getPatient(); // Reference - case -351767064: return addCoverage(); // CoverageComponent + case 73049818: return addInsurance(); // InsuranceComponent case -2143202801: return getAccident(); // AccidentComponent case 1051487345: return getEmploymentImpacted(); // Period case 1057894634: return getHospitalization(); // Period case 3242771: return addItem(); // ItemComponent case 110549828: return getTotal(); // Money - case -1157130302: return addMissingTeeth(); // MissingTeethComponent default: return super.makeProperty(hash, name); } @@ -8527,27 +8227,30 @@ public class Claim extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type Claim.status"); } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("subType")) { return addSubType(); } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; + else if (name.equals("use")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.use"); } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.created"); + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; } else if (name.equals("billablePeriod")) { this.billablePeriod = new Period(); return this.billablePeriod; } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type Claim.created"); + } + else if (name.equals("enterer")) { + this.enterer = new Reference(); + return this.enterer; + } else if (name.equals("insurer")) { this.insurer = new Reference(); return this.insurer; @@ -8560,25 +8263,14 @@ public class Claim extends DomainResource { this.organization = new Reference(); return this.organization; } - else if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.use"); - } else if (name.equals("priority")) { - this.priority = new Coding(); + this.priority = new CodeableConcept(); return this.priority; } else if (name.equals("fundsReserve")) { - this.fundsReserve = new Coding(); + this.fundsReserve = new CodeableConcept(); return this.fundsReserve; } - else if (name.equals("enterer")) { - this.enterer = new Reference(); - return this.enterer; - } - else if (name.equals("facility")) { - this.facility = new Reference(); - return this.facility; - } else if (name.equals("related")) { return addRelated(); } @@ -8598,6 +8290,13 @@ public class Claim extends DomainResource { this.referral = new Reference(); return this.referral; } + else if (name.equals("facility")) { + this.facility = new Reference(); + return this.facility; + } + else if (name.equals("careTeam")) { + return addCareTeam(); + } else if (name.equals("information")) { return addInformation(); } @@ -8607,12 +8306,8 @@ public class Claim extends DomainResource { else if (name.equals("procedure")) { return addProcedure(); } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("coverage")) { - return addCoverage(); + else if (name.equals("insurance")) { + return addInsurance(); } else if (name.equals("accident")) { this.accident = new AccidentComponent(); @@ -8633,9 +8328,6 @@ public class Claim extends DomainResource { this.total = new Money(); return this.total; } - else if (name.equals("missingTeeth")) { - return addMissingTeeth(); - } else return super.addChild(name); } @@ -8656,22 +8348,20 @@ public class Claim extends DomainResource { dst.status = status == null ? null : status.copy(); dst.type = type == null ? null : type.copy(); if (subType != null) { - dst.subType = new ArrayList(); - for (Coding i : subType) + dst.subType = new ArrayList(); + for (CodeableConcept i : subType) dst.subType.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.use = use == null ? null : use.copy(); + dst.patient = patient == null ? null : patient.copy(); dst.billablePeriod = billablePeriod == null ? null : billablePeriod.copy(); + dst.created = created == null ? null : created.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); dst.insurer = insurer == null ? null : insurer.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(); if (related != null) { dst.related = new ArrayList(); for (RelatedClaimComponent i : related) @@ -8681,6 +8371,12 @@ public class Claim extends DomainResource { dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy(); dst.payee = payee == null ? null : payee.copy(); dst.referral = referral == null ? null : referral.copy(); + dst.facility = facility == null ? null : facility.copy(); + if (careTeam != null) { + dst.careTeam = new ArrayList(); + for (CareTeamComponent i : careTeam) + dst.careTeam.add(i.copy()); + }; if (information != null) { dst.information = new ArrayList(); for (SpecialConditionComponent i : information) @@ -8696,11 +8392,10 @@ public class Claim extends DomainResource { for (ProcedureComponent i : procedure) dst.procedure.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 (insurance != null) { + dst.insurance = new ArrayList(); + for (InsuranceComponent i : insurance) + dst.insurance.add(i.copy()); }; dst.accident = accident == null ? null : accident.copy(); dst.employmentImpacted = employmentImpacted == null ? null : employmentImpacted.copy(); @@ -8711,11 +8406,6 @@ public class Claim extends DomainResource { dst.item.add(i.copy()); }; dst.total = total == null ? null : total.copy(); - if (missingTeeth != null) { - dst.missingTeeth = new ArrayList(); - for (MissingTeethComponent i : missingTeeth) - dst.missingTeeth.add(i.copy()); - }; return dst; } @@ -8731,17 +8421,16 @@ public class Claim extends DomainResource { return false; Claim o = (Claim) other; return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) - && compareDeep(subType, o.subType, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(billablePeriod, o.billablePeriod, true) - && compareDeep(insurer, o.insurer, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(use, o.use, true) && compareDeep(priority, o.priority, true) && compareDeep(fundsReserve, o.fundsReserve, true) - && compareDeep(enterer, o.enterer, true) && compareDeep(facility, o.facility, true) && compareDeep(related, o.related, true) - && compareDeep(prescription, o.prescription, true) && compareDeep(originalPrescription, o.originalPrescription, true) - && compareDeep(payee, o.payee, true) && compareDeep(referral, o.referral, true) && compareDeep(information, o.information, true) - && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(patient, o.patient, true) - && compareDeep(coverage, o.coverage, true) && compareDeep(accident, o.accident, true) && compareDeep(employmentImpacted, o.employmentImpacted, true) - && compareDeep(hospitalization, o.hospitalization, true) && compareDeep(item, o.item, true) && compareDeep(total, o.total, true) - && compareDeep(missingTeeth, o.missingTeeth, true); + && compareDeep(subType, o.subType, true) && compareDeep(use, o.use, true) && compareDeep(patient, o.patient, true) + && compareDeep(billablePeriod, o.billablePeriod, true) && compareDeep(created, o.created, true) + && compareDeep(enterer, o.enterer, true) && compareDeep(insurer, o.insurer, true) && compareDeep(provider, o.provider, true) + && compareDeep(organization, o.organization, true) && compareDeep(priority, o.priority, true) && compareDeep(fundsReserve, o.fundsReserve, true) + && compareDeep(related, o.related, true) && compareDeep(prescription, o.prescription, true) && compareDeep(originalPrescription, o.originalPrescription, true) + && compareDeep(payee, o.payee, true) && compareDeep(referral, o.referral, true) && compareDeep(facility, o.facility, true) + && compareDeep(careTeam, o.careTeam, true) && compareDeep(information, o.information, true) && compareDeep(diagnosis, o.diagnosis, true) + && compareDeep(procedure, o.procedure, true) && compareDeep(insurance, o.insurance, true) && compareDeep(accident, o.accident, true) + && compareDeep(employmentImpacted, o.employmentImpacted, true) && compareDeep(hospitalization, o.hospitalization, true) + && compareDeep(item, o.item, true) && compareDeep(total, o.total, true); } @Override @@ -8751,17 +8440,16 @@ public class Claim extends DomainResource { if (!(other instanceof Claim)) return false; Claim o = (Claim) other; - return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(use, o.use, true) + return compareValues(status, o.status, true) && compareValues(use, o.use, true) && compareValues(created, o.created, true) ; } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type - , subType, ruleset, originalRuleset, created, billablePeriod, insurer, provider - , organization, use, priority, fundsReserve, enterer, facility, related, prescription - , originalPrescription, payee, referral, information, diagnosis, procedure, patient - , coverage, accident, employmentImpacted, hospitalization, item, total, missingTeeth - ); + , subType, use, patient, billablePeriod, created, enterer, insurer, provider + , organization, priority, fundsReserve, related, prescription, originalPrescription + , payee, referral, facility, careTeam, information, diagnosis, procedure, insurance + , accident, employmentImpacted, hospitalization, item, total); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ClaimResponse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ClaimResponse.java index ad80128d86f..8825cca91d0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ClaimResponse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ClaimResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -52,19 +52,19 @@ public class ClaimResponse extends DomainResource { public enum ClaimResponseStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -98,19 +98,19 @@ public class ClaimResponse extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/claimresponse-status"; - case CANCELLED: return "http://hl7.org/fhir/claimresponse-status"; - case DRAFT: return "http://hl7.org/fhir/claimresponse-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/claimresponse-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -119,7 +119,7 @@ public class ClaimResponse extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -576,18 +576,18 @@ public class ClaimResponse extends DomainResource { /** * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication") - protected Coding category; + protected CodeableConcept category; /** * Adjudication reason such as limit reached. */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-reason") - protected Coding reason; + protected CodeableConcept reason; /** * Monetary amount associated with the code. @@ -603,7 +603,7 @@ public class ClaimResponse extends DomainResource { @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) protected DecimalType value; - private static final long serialVersionUID = -1926987562L; + private static final long serialVersionUID = 1559898786L; /** * Constructor @@ -615,7 +615,7 @@ public class ClaimResponse extends DomainResource { /** * Constructor */ - public AdjudicationComponent(Coding category) { + public AdjudicationComponent(CodeableConcept category) { super(); this.category = category; } @@ -623,12 +623,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AdjudicationComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -639,7 +639,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) */ - public AdjudicationComponent setCategory(Coding value) { + public AdjudicationComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -647,12 +647,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #reason} (Adjudication reason such as limit reached.) */ - public Coding getReason() { + public CodeableConcept getReason() { if (this.reason == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AdjudicationComponent.reason"); else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc + this.reason = new CodeableConcept(); // cc return this.reason; } @@ -663,7 +663,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #reason} (Adjudication reason such as limit reached.) */ - public AdjudicationComponent setReason(Coding value) { + public AdjudicationComponent setReason(CodeableConcept value) { this.reason = value; return this; } @@ -761,8 +761,8 @@ public class ClaimResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("category", "CodeableConcept", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "CodeableConcept", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); } @@ -770,8 +770,8 @@ public class ClaimResponse extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType default: return super.getProperty(hash, name, checkValid); @@ -783,10 +783,10 @@ public class ClaimResponse extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case -934964668: // reason - this.reason = castToCoding(value); // Coding + this.reason = castToCodeableConcept(value); // CodeableConcept break; case -1413853096: // amount this.amount = castToMoney(value); // Money @@ -802,9 +802,9 @@ public class ClaimResponse extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding + this.reason = castToCodeableConcept(value); // CodeableConcept else if (name.equals("amount")) this.amount = castToMoney(value); // Money else if (name.equals("value")) @@ -816,8 +816,8 @@ public class ClaimResponse extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding + case 50511102: return getCategory(); // CodeableConcept + case -934964668: return getReason(); // CodeableConcept case -1413853096: return getAmount(); // Money case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType default: return super.makeProperty(hash, name); @@ -828,11 +828,11 @@ public class ClaimResponse extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("reason")) { - this.reason = new Coding(); + this.reason = new CodeableConcept(); return this.reason; } else if (name.equals("amount")) { @@ -1624,34 +1624,34 @@ public class ClaimResponse extends DomainResource { /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * A code to indicate the Professional Service or Product supplied. */ - @Child(name = "service", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * The fee charged for the professional service or product.. @@ -1681,7 +1681,7 @@ public class ClaimResponse extends DomainResource { @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) protected List detail; - private static final long serialVersionUID = -1130048899L; + private static final long serialVersionUID = 1969703165L; /** * Constructor @@ -1754,12 +1754,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -1770,7 +1770,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public AddedItemComponent setRevenue(Coding value) { + public AddedItemComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -1778,12 +1778,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -1794,7 +1794,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public AddedItemComponent setCategory(Coding value) { + public AddedItemComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -1802,12 +1802,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) */ - public Coding getService() { + public CodeableConcept getService() { if (this.service == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemComponent.service"); else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -1818,7 +1818,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) */ - public AddedItemComponent setService(Coding value) { + public AddedItemComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -1826,16 +1826,16 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public AddedItemComponent setModifier(List theModifier) { + public AddedItemComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -1843,25 +1843,25 @@ public class ClaimResponse extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public AddedItemComponent addModifier(Coding t) { //3 + public AddedItemComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -1869,7 +1869,7 @@ public class ClaimResponse extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -2070,10 +2070,10 @@ public class ClaimResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); childrenList.add(new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); @@ -2084,10 +2084,10 @@ public class ClaimResponse extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : this.sequenceLinkId.toArray(new Base[this.sequenceLinkId.size()]); // PositiveIntType - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent @@ -2104,16 +2104,16 @@ public class ClaimResponse extends DomainResource { this.getSequenceLinkId().add(castToPositiveInt(value)); // PositiveIntType break; case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 101254: // fee this.fee = castToMoney(value); // Money @@ -2137,13 +2137,13 @@ public class ClaimResponse extends DomainResource { if (name.equals("sequenceLinkId")) this.getSequenceLinkId().add(castToPositiveInt(value)); else if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("fee")) this.fee = castToMoney(value); // Money else if (name.equals("noteNumber")) @@ -2160,10 +2160,10 @@ public class ClaimResponse extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept case 101254: return getFee(); // Money case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType case -231349275: return addAdjudication(); // AdjudicationComponent @@ -2179,15 +2179,15 @@ public class ClaimResponse extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); } else if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -2222,8 +2222,8 @@ public class ClaimResponse extends DomainResource { dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; dst.fee = fee == null ? null : fee.copy(); @@ -2286,34 +2286,34 @@ public class ClaimResponse extends DomainResource { /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * A code to indicate the Professional Service or Product supplied. */ - @Child(name = "service", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * The fee charged for the professional service or product.. @@ -2336,7 +2336,7 @@ public class ClaimResponse extends DomainResource { @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) protected List adjudication; - private static final long serialVersionUID = -1633143220L; + private static final long serialVersionUID = -311484980L; /** * Constructor @@ -2348,12 +2348,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemsDetailComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -2364,7 +2364,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public AddedItemsDetailComponent setRevenue(Coding value) { + public AddedItemsDetailComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -2372,12 +2372,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemsDetailComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -2388,7 +2388,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public AddedItemsDetailComponent setCategory(Coding value) { + public AddedItemsDetailComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -2396,12 +2396,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) */ - public Coding getService() { + public CodeableConcept getService() { if (this.service == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemsDetailComponent.service"); else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -2412,7 +2412,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) */ - public AddedItemsDetailComponent setService(Coding value) { + public AddedItemsDetailComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -2420,16 +2420,16 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public AddedItemsDetailComponent setModifier(List theModifier) { + public AddedItemsDetailComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -2437,25 +2437,25 @@ public class ClaimResponse extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public AddedItemsDetailComponent addModifier(Coding t) { //3 + public AddedItemsDetailComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -2463,7 +2463,7 @@ public class ClaimResponse extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -2610,10 +2610,10 @@ public class ClaimResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); childrenList.add(new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); @@ -2622,10 +2622,10 @@ public class ClaimResponse extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent @@ -2638,16 +2638,16 @@ public class ClaimResponse extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 101254: // fee this.fee = castToMoney(value); // Money @@ -2666,13 +2666,13 @@ public class ClaimResponse extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("fee")) this.fee = castToMoney(value); // Money else if (name.equals("noteNumber")) @@ -2686,10 +2686,10 @@ public class ClaimResponse extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept case 101254: return getFee(); // Money case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType case -231349275: return addAdjudication(); // AdjudicationComponent @@ -2701,15 +2701,15 @@ public class ClaimResponse extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -2736,8 +2736,8 @@ public class ClaimResponse extends DomainResource { dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; dst.fee = fee == null ? null : fee.copy(); @@ -2814,12 +2814,12 @@ public class ClaimResponse extends DomainResource { /** * An error code,from a specified code system, which details why the claim could not be adjudicated. */ - @Child(name = "code", type = {Coding.class}, order=4, min=1, max=1, modifier=false, summary=false) + @Child(name = "code", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,from a specified code system, which details why the claim could not be adjudicated." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-error") - protected Coding code; + protected CodeableConcept code; - private static final long serialVersionUID = -1893641175L; + private static final long serialVersionUID = -1379670472L; /** * Constructor @@ -2831,7 +2831,7 @@ public class ClaimResponse extends DomainResource { /** * Constructor */ - public ErrorComponent(Coding code) { + public ErrorComponent(CodeableConcept code) { super(); this.code = code; } @@ -2974,12 +2974,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #code} (An error code,from a specified code system, which details why the claim could not be adjudicated.) */ - public Coding getCode() { + public CodeableConcept getCode() { if (this.code == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ErrorComponent.code"); else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc + this.code = new CodeableConcept(); // cc return this.code; } @@ -2990,7 +2990,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #code} (An error code,from a specified code system, which details why the claim could not be adjudicated.) */ - public ErrorComponent setCode(Coding value) { + public ErrorComponent setCode(CodeableConcept value) { this.code = value; return this; } @@ -3000,7 +3000,7 @@ public class ClaimResponse extends DomainResource { childrenList.add(new Property("sequenceLinkId", "positiveInt", "The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); childrenList.add(new Property("detailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, detailSequenceLinkId)); childrenList.add(new Property("subdetailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, subdetailSequenceLinkId)); - childrenList.add(new Property("code", "Coding", "An error code,from a specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("code", "CodeableConcept", "An error code,from a specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code)); } @Override @@ -3009,7 +3009,7 @@ public class ClaimResponse extends DomainResource { case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType case 516748423: /*detailSequenceLinkId*/ return this.detailSequenceLinkId == null ? new Base[0] : new Base[] {this.detailSequenceLinkId}; // PositiveIntType case -1061088569: /*subdetailSequenceLinkId*/ return this.subdetailSequenceLinkId == null ? new Base[0] : new Base[] {this.subdetailSequenceLinkId}; // PositiveIntType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -3028,7 +3028,7 @@ public class ClaimResponse extends DomainResource { this.subdetailSequenceLinkId = castToPositiveInt(value); // PositiveIntType break; case 3059181: // code - this.code = castToCoding(value); // Coding + this.code = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -3044,7 +3044,7 @@ public class ClaimResponse extends DomainResource { else if (name.equals("subdetailSequenceLinkId")) this.subdetailSequenceLinkId = castToPositiveInt(value); // PositiveIntType else if (name.equals("code")) - this.code = castToCoding(value); // Coding + this.code = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -3055,7 +3055,7 @@ public class ClaimResponse extends DomainResource { case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType case 516748423: throw new FHIRException("Cannot make property detailSequenceLinkId as it is not a complex type"); // PositiveIntType case -1061088569: throw new FHIRException("Cannot make property subdetailSequenceLinkId as it is not a complex type"); // PositiveIntType - case 3059181: return getCode(); // Coding + case 3059181: return getCode(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -3073,7 +3073,7 @@ public class ClaimResponse extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.subdetailSequenceLinkId"); } else if (name.equals("code")) { - this.code = new Coding(); + this.code = new CodeableConcept(); return this.code; } else @@ -3130,10 +3130,10 @@ public class ClaimResponse extends DomainResource { /** * Whether this represents partial or complete payment of the claim. */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Partial or Complete", formalDefinition="Whether this represents partial or complete payment of the claim." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-paymenttype") - protected Coding type; + protected CodeableConcept type; /** * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. @@ -3145,10 +3145,10 @@ public class ClaimResponse extends DomainResource { /** * Reason for the payment adjustment. */ - @Child(name = "adjustmentReason", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "adjustmentReason", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-adjustment-reason") - protected Coding adjustmentReason; + protected CodeableConcept adjustmentReason; /** * Estimated payment data. @@ -3171,7 +3171,7 @@ public class ClaimResponse extends DomainResource { @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifier." ) protected Identifier identifier; - private static final long serialVersionUID = -803665422L; + private static final long serialVersionUID = 1539906026L; /** * Constructor @@ -3183,12 +3183,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #type} (Whether this represents partial or complete payment of the claim.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PaymentComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -3199,7 +3199,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #type} (Whether this represents partial or complete payment of the claim.) */ - public PaymentComponent setType(Coding value) { + public PaymentComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -3231,12 +3231,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #adjustmentReason} (Reason for the payment adjustment.) */ - public Coding getAdjustmentReason() { + public CodeableConcept getAdjustmentReason() { if (this.adjustmentReason == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PaymentComponent.adjustmentReason"); else if (Configuration.doAutoCreate()) - this.adjustmentReason = new Coding(); // cc + this.adjustmentReason = new CodeableConcept(); // cc return this.adjustmentReason; } @@ -3247,7 +3247,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #adjustmentReason} (Reason for the payment adjustment.) */ - public PaymentComponent setAdjustmentReason(Coding value) { + public PaymentComponent setAdjustmentReason(CodeableConcept value) { this.adjustmentReason = value; return this; } @@ -3351,9 +3351,9 @@ public class ClaimResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Whether this represents partial or complete payment of the claim.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "Whether this represents partial or complete payment of the claim.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("adjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, adjustment)); - childrenList.add(new Property("adjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, adjustmentReason)); + childrenList.add(new Property("adjustmentReason", "CodeableConcept", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, adjustmentReason)); childrenList.add(new Property("date", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, date)); childrenList.add(new Property("amount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, amount)); childrenList.add(new Property("identifier", "Identifier", "Payment identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); @@ -3362,9 +3362,9 @@ public class ClaimResponse extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 1977085293: /*adjustment*/ return this.adjustment == null ? new Base[0] : new Base[] {this.adjustment}; // Money - case -1255938543: /*adjustmentReason*/ return this.adjustmentReason == null ? new Base[0] : new Base[] {this.adjustmentReason}; // Coding + case -1255938543: /*adjustmentReason*/ return this.adjustmentReason == null ? new Base[0] : new Base[] {this.adjustmentReason}; // CodeableConcept case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier @@ -3377,13 +3377,13 @@ public class ClaimResponse extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 1977085293: // adjustment this.adjustment = castToMoney(value); // Money break; case -1255938543: // adjustmentReason - this.adjustmentReason = castToCoding(value); // Coding + this.adjustmentReason = castToCodeableConcept(value); // CodeableConcept break; case 3076014: // date this.date = castToDate(value); // DateType @@ -3402,11 +3402,11 @@ public class ClaimResponse extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("adjustment")) this.adjustment = castToMoney(value); // Money else if (name.equals("adjustmentReason")) - this.adjustmentReason = castToCoding(value); // Coding + this.adjustmentReason = castToCodeableConcept(value); // CodeableConcept else if (name.equals("date")) this.date = castToDate(value); // DateType else if (name.equals("amount")) @@ -3420,9 +3420,9 @@ public class ClaimResponse extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 1977085293: return getAdjustment(); // Money - case -1255938543: return getAdjustmentReason(); // Coding + case -1255938543: return getAdjustmentReason(); // CodeableConcept case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateType case -1413853096: return getAmount(); // Money case -1618432855: return getIdentifier(); // Identifier @@ -3434,7 +3434,7 @@ public class ClaimResponse extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("adjustment")) { @@ -3442,7 +3442,7 @@ public class ClaimResponse extends DomainResource { return this.adjustment; } else if (name.equals("adjustmentReason")) { - this.adjustmentReason = new Coding(); + this.adjustmentReason = new CodeableConcept(); return this.adjustmentReason; } else if (name.equals("date")) { @@ -3518,10 +3518,10 @@ public class ClaimResponse extends DomainResource { /** * The note purpose: Print/Display. */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type") - protected Coding type; + protected CodeableConcept type; /** * The note text. @@ -3533,12 +3533,12 @@ public class ClaimResponse extends DomainResource { /** * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. */ - @Child(name = "language", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "language", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Language", formalDefinition="The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages") - protected Coding language; + protected CodeableConcept language; - private static final long serialVersionUID = -1578585461L; + private static final long serialVersionUID = -944255449L; /** * Constructor @@ -3595,12 +3595,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #type} (The note purpose: Print/Display.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create NoteComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -3611,7 +3611,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #type} (The note purpose: Print/Display.) */ - public NoteComponent setType(Coding value) { + public NoteComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -3668,12 +3668,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) */ - public Coding getLanguage() { + public CodeableConcept getLanguage() { if (this.language == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create NoteComponent.language"); else if (Configuration.doAutoCreate()) - this.language = new Coding(); // cc + this.language = new CodeableConcept(); // cc return this.language; } @@ -3684,7 +3684,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) */ - public NoteComponent setLanguage(Coding value) { + public NoteComponent setLanguage(CodeableConcept value) { this.language = value; return this; } @@ -3692,18 +3692,18 @@ public class ClaimResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("language", "Coding", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("language", "CodeableConcept", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.", 0, java.lang.Integer.MAX_VALUE, language)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // Coding + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -3716,13 +3716,13 @@ public class ClaimResponse extends DomainResource { this.number = castToPositiveInt(value); // PositiveIntType break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 3556653: // text this.text = castToString(value); // StringType break; case -1613589672: // language - this.language = castToCoding(value); // Coding + this.language = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -3734,11 +3734,11 @@ public class ClaimResponse extends DomainResource { if (name.equals("number")) this.number = castToPositiveInt(value); // PositiveIntType else if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("text")) this.text = castToString(value); // StringType else if (name.equals("language")) - this.language = castToCoding(value); // Coding + this.language = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -3747,9 +3747,9 @@ public class ClaimResponse extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case -1613589672: return getLanguage(); // Coding + case -1613589672: return getLanguage(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -3761,14 +3761,14 @@ public class ClaimResponse extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.number"); } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("text")) { throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.text"); } else if (name.equals("language")) { - this.language = new Coding(); + this.language = new CodeableConcept(); return this.language; } else @@ -3819,7 +3819,7 @@ public class ClaimResponse extends DomainResource { } @Block() - public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { + public static class InsuranceComponent extends BackboneElement implements IBaseBackboneElement { /** * A service line item. */ @@ -3877,14 +3877,14 @@ public class ClaimResponse extends DomainResource { /** * Constructor */ - public CoverageComponent() { + public InsuranceComponent() { super(); } /** * Constructor */ - public CoverageComponent(PositiveIntType sequence, BooleanType focal, Reference coverage) { + public InsuranceComponent(PositiveIntType sequence, BooleanType focal, Reference coverage) { super(); this.sequence = sequence; this.focal = focal; @@ -3897,7 +3897,7 @@ public class ClaimResponse extends DomainResource { public PositiveIntType getSequenceElement() { if (this.sequence == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); + throw new Error("Attempt to auto-create InsuranceComponent.sequence"); else if (Configuration.doAutoCreate()) this.sequence = new PositiveIntType(); // bb return this.sequence; @@ -3914,7 +3914,7 @@ public class ClaimResponse extends DomainResource { /** * @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(PositiveIntType value) { + public InsuranceComponent setSequenceElement(PositiveIntType value) { this.sequence = value; return this; } @@ -3929,7 +3929,7 @@ public class ClaimResponse extends DomainResource { /** * @param value A service line item. */ - public CoverageComponent setSequence(int value) { + public InsuranceComponent setSequence(int value) { if (this.sequence == null) this.sequence = new PositiveIntType(); this.sequence.setValue(value); @@ -3942,7 +3942,7 @@ public class ClaimResponse extends DomainResource { public BooleanType getFocalElement() { if (this.focal == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); + throw new Error("Attempt to auto-create InsuranceComponent.focal"); else if (Configuration.doAutoCreate()) this.focal = new BooleanType(); // bb return this.focal; @@ -3959,7 +3959,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value */ - public CoverageComponent setFocalElement(BooleanType value) { + public InsuranceComponent setFocalElement(BooleanType value) { this.focal = value; return this; } @@ -3974,7 +3974,7 @@ public class ClaimResponse extends DomainResource { /** * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. */ - public CoverageComponent setFocal(boolean value) { + public InsuranceComponent setFocal(boolean value) { if (this.focal == null) this.focal = new BooleanType(); this.focal.setValue(value); @@ -3987,7 +3987,7 @@ public class ClaimResponse extends DomainResource { public Reference getCoverage() { if (this.coverage == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); + throw new Error("Attempt to auto-create InsuranceComponent.coverage"); else if (Configuration.doAutoCreate()) this.coverage = new Reference(); // cc return this.coverage; @@ -4000,7 +4000,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) */ - public CoverageComponent setCoverage(Reference value) { + public InsuranceComponent setCoverage(Reference value) { this.coverage = value; return this; } @@ -4011,7 +4011,7 @@ public class ClaimResponse extends DomainResource { public Coverage getCoverageTarget() { if (this.coverageTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); + throw new Error("Attempt to auto-create InsuranceComponent.coverage"); else if (Configuration.doAutoCreate()) this.coverageTarget = new Coverage(); // aa return this.coverageTarget; @@ -4020,7 +4020,7 @@ public class ClaimResponse 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 CoverageComponent setCoverageTarget(Coverage value) { + public InsuranceComponent setCoverageTarget(Coverage value) { this.coverageTarget = value; return this; } @@ -4031,7 +4031,7 @@ public class ClaimResponse extends DomainResource { public StringType getBusinessArrangementElement() { if (this.businessArrangement == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + throw new Error("Attempt to auto-create InsuranceComponent.businessArrangement"); else if (Configuration.doAutoCreate()) this.businessArrangement = new StringType(); // bb return this.businessArrangement; @@ -4048,7 +4048,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #businessArrangement} (The contract number of a business agreement 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) { + public InsuranceComponent setBusinessArrangementElement(StringType value) { this.businessArrangement = value; return this; } @@ -4063,7 +4063,7 @@ public class ClaimResponse extends DomainResource { /** * @param value The contract number of a business agreement which describes the terms and conditions. */ - public CoverageComponent setBusinessArrangement(String value) { + public InsuranceComponent setBusinessArrangement(String value) { if (Utilities.noString(value)) this.businessArrangement = null; else { @@ -4086,7 +4086,7 @@ public class ClaimResponse extends DomainResource { /** * @return Returns a reference to this for easy method chaining */ - public CoverageComponent setPreAuthRef(List thePreAuthRef) { + public InsuranceComponent setPreAuthRef(List thePreAuthRef) { this.preAuthRef = thePreAuthRef; return this; } @@ -4114,7 +4114,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) */ - public CoverageComponent addPreAuthRef(String value) { //1 + public InsuranceComponent addPreAuthRef(String value) { //1 StringType t = new StringType(); t.setValue(value); if (this.preAuthRef == null) @@ -4141,7 +4141,7 @@ public class ClaimResponse extends DomainResource { public Reference getClaimResponse() { if (this.claimResponse == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + throw new Error("Attempt to auto-create InsuranceComponent.claimResponse"); else if (Configuration.doAutoCreate()) this.claimResponse = new Reference(); // cc return this.claimResponse; @@ -4154,7 +4154,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #claimResponse} (The Coverages adjudication details.) */ - public CoverageComponent setClaimResponse(Reference value) { + public InsuranceComponent setClaimResponse(Reference value) { this.claimResponse = value; return this; } @@ -4165,7 +4165,7 @@ public class ClaimResponse extends DomainResource { public ClaimResponse getClaimResponseTarget() { if (this.claimResponseTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + throw new Error("Attempt to auto-create InsuranceComponent.claimResponse"); else if (Configuration.doAutoCreate()) this.claimResponseTarget = new ClaimResponse(); // aa return this.claimResponseTarget; @@ -4174,7 +4174,7 @@ public class ClaimResponse extends DomainResource { /** * @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) { + public InsuranceComponent setClaimResponseTarget(ClaimResponse value) { this.claimResponseTarget = value; return this; } @@ -4287,8 +4287,8 @@ public class ClaimResponse extends DomainResource { return super.addChild(name); } - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); + public InsuranceComponent copy() { + InsuranceComponent dst = new InsuranceComponent(); copyValues(dst); dst.sequence = sequence == null ? null : sequence.copy(); dst.focal = focal == null ? null : focal.copy(); @@ -4307,9 +4307,9 @@ public class ClaimResponse extends DomainResource { public boolean equalsDeep(Base other) { if (!super.equalsDeep(other)) return false; - if (!(other instanceof CoverageComponent)) + if (!(other instanceof InsuranceComponent)) return false; - CoverageComponent o = (CoverageComponent) other; + InsuranceComponent o = (InsuranceComponent) other; return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true) && compareDeep(claimResponse, o.claimResponse, true); @@ -4319,9 +4319,9 @@ public class ClaimResponse extends DomainResource { public boolean equalsShallow(Base other) { if (!super.equalsShallow(other)) return false; - if (!(other instanceof CoverageComponent)) + if (!(other instanceof InsuranceComponent)) return false; - CoverageComponent o = (CoverageComponent) other; + InsuranceComponent o = (InsuranceComponent) other; return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) && compareValues(preAuthRef, o.preAuthRef, true); } @@ -4332,7 +4332,7 @@ public class ClaimResponse extends DomainResource { } public String fhirType() { - return "ClaimResponse.coverage"; + return "ClaimResponse.insurance"; } @@ -4348,62 +4348,34 @@ public class ClaimResponse extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claimresponse-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; - /** - * Original request resource referrence. - */ - @Child(name = "request", type = {Claim.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource referrence.) - */ - protected Claim requestTarget; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "created", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) protected DateTimeType created; /** * The Insurer who produced this adjudicated response. */ - @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Child(name = "insurer", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; + protected Reference insurer; /** * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) */ - protected Organization organizationTarget; + protected Organization insurerTarget; /** * The practitioner who is responsible for the services rendered to the patient. */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestProvider", type = {Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) protected Reference requestProvider; @@ -4415,7 +4387,7 @@ public class ClaimResponse 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, modifier=false, summary=false) + @Child(name = "requestOrganization", type = {Organization.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) protected Reference requestOrganization; @@ -4424,82 +4396,94 @@ public class ClaimResponse extends DomainResource { */ protected Organization requestOrganizationTarget; + /** + * Original request resource referrence. + */ + @Child(name = "request", type = {Claim.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource referrence.) + */ + protected Claim requestTarget; + /** * Processing outcome errror, partial or complete processing. */ - @Child(name = "outcome", type = {Coding.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "outcome", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="complete | error | partial", formalDefinition="Processing outcome errror, partial or complete processing." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome") - protected Coding outcome; + protected CodeableConcept outcome; /** * A description of the status of the adjudication. */ - @Child(name = "disposition", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "disposition", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) protected StringType disposition; /** * Party to be reimbursed: Subscriber, provider, other. */ - @Child(name = "payeeType", type = {Coding.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "payeeType", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payeetype") - protected Coding payeeType; + protected CodeableConcept payeeType; /** * The first tier service adjudications for submitted services. */ - @Child(name = "item", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "item", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Line items", formalDefinition="The first tier service adjudications for submitted services." ) protected List item; /** * The first tier service adjudications for payor added services. */ - @Child(name = "addItem", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "addItem", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) protected List addItem; /** * Mutually exclusive with Services Provided (Item). */ - @Child(name = "error", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "error", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) protected List error; /** * The total cost of the services reported. */ - @Child(name = "totalCost", type = {Money.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "totalCost", type = {Money.class}, order=13, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) protected Money totalCost; /** * The amount of deductible applied which was not allocated to any particular service line. */ - @Child(name = "unallocDeductable", type = {Money.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Child(name = "unallocDeductable", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Unallocated deductible", formalDefinition="The amount of deductible applied which was not allocated to any particular service line." ) protected Money unallocDeductable; /** * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible). */ - @Child(name = "totalBenefit", type = {Money.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Child(name = "totalBenefit", type = {Money.class}, order=15, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible)." ) protected Money totalBenefit; /** * Payment details for the claim if the claim has been paid. */ - @Child(name = "payment", type = {}, order=18, min=0, max=1, modifier=false, summary=false) + @Child(name = "payment", type = {}, order=16, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Payment details, if paid", formalDefinition="Payment details for the claim if the claim has been paid." ) protected PaymentComponent payment; /** * Status of funds reservation (For provider, for Patient, None). */ - @Child(name = "reserved", type = {Coding.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Child(name = "reserved", type = {Coding.class}, order=17, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fundsreserve") protected Coding reserved; @@ -4507,26 +4491,38 @@ public class ClaimResponse extends DomainResource { /** * The form to be used for printing the content. */ - @Child(name = "form", type = {Coding.class}, order=20, min=0, max=1, modifier=false, summary=false) + @Child(name = "form", type = {CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms") - protected Coding form; + protected CodeableConcept form; /** * Note text. */ - @Child(name = "note", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "note", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) protected List note; + /** + * Request for additional supporting or authorizing information, such as: documents, images or resources. + */ + @Child(name = "communicationRequest", type = {CommunicationRequest.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Request for additional information", formalDefinition="Request for additional supporting or authorizing information, such as: documents, images or resources." ) + protected List communicationRequest; + /** + * The actual objects that are the target of the reference (Request for additional supporting or authorizing information, such as: documents, images or resources.) + */ + protected List communicationRequestTarget; + + /** * Financial instrument by which payment information for health care. */ - @Child(name = "coverage", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "insurance", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; + protected List insurance; - private static final long serialVersionUID = -1923433424L; + private static final long serialVersionUID = 1883063635L; /** * Constructor @@ -4535,14 +4531,6 @@ public class ClaimResponse extends DomainResource { super(); } - /** - * Constructor - */ - public ClaimResponse(Enumeration status) { - super(); - this.status = status; - } - /** * @return {@link #identifier} (The Response business identifier.) */ @@ -4635,101 +4623,13 @@ public class ClaimResponse extends DomainResource { * @param value The status of the resource instance. */ public ClaimResponse setStatus(ClaimResponseStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new ClaimResponseStatusEnumFactory()); this.status.setValue(value); - return this; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public ClaimResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 Claim getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new Claim(); // aa - 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 ClaimResponse setRequestTarget(Claim value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 ClaimResponse setRuleset(Coding value) { - this.ruleset = 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 ClaimResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - 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 ClaimResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; + } return this; } @@ -4783,46 +4683,46 @@ public class ClaimResponse extends DomainResource { } /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) + * @return {@link #insurer} (The Insurer who produced this adjudicated response.) */ - public Reference getOrganization() { - if (this.organization == null) + public Reference getInsurer() { + if (this.insurer == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.organization"); + throw new Error("Attempt to auto-create ClaimResponse.insurer"); else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; + this.insurer = new Reference(); // cc + return this.insurer; } - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); + public boolean hasInsurer() { + return this.insurer != null && !this.insurer.isEmpty(); } /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + * @param value {@link #insurer} (The Insurer who produced this adjudicated response.) */ - public ClaimResponse setOrganization(Reference value) { - this.organization = value; + public ClaimResponse setInsurer(Reference value) { + this.insurer = 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 Insurer who produced this adjudicated response.) + * @return {@link #insurer} 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 Insurer who produced this adjudicated response.) */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) + public Organization getInsurerTarget() { + if (this.insurerTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.organization"); + throw new Error("Attempt to auto-create ClaimResponse.insurer"); else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; + this.insurerTarget = new Organization(); // aa + return this.insurerTarget; } /** - * @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 Insurer who produced this adjudicated response.) + * @param value {@link #insurer} 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 produced this adjudicated response.) */ - public ClaimResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; + public ClaimResponse setInsurerTarget(Organization value) { + this.insurerTarget = value; return this; } @@ -4914,15 +4814,59 @@ public class ClaimResponse extends DomainResource { return this; } + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public ClaimResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 Claim getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new Claim(); // aa + 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 ClaimResponse setRequestTarget(Claim value) { + this.requestTarget = value; + return this; + } + /** * @return {@link #outcome} (Processing outcome errror, partial or complete processing.) */ - public Coding getOutcome() { + public CodeableConcept getOutcome() { if (this.outcome == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ClaimResponse.outcome"); else if (Configuration.doAutoCreate()) - this.outcome = new Coding(); // cc + this.outcome = new CodeableConcept(); // cc return this.outcome; } @@ -4933,7 +4877,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #outcome} (Processing outcome errror, partial or complete processing.) */ - public ClaimResponse setOutcome(Coding value) { + public ClaimResponse setOutcome(CodeableConcept value) { this.outcome = value; return this; } @@ -4990,12 +4934,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) */ - public Coding getPayeeType() { + public CodeableConcept getPayeeType() { if (this.payeeType == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ClaimResponse.payeeType"); else if (Configuration.doAutoCreate()) - this.payeeType = new Coding(); // cc + this.payeeType = new CodeableConcept(); // cc return this.payeeType; } @@ -5006,7 +4950,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) */ - public ClaimResponse setPayeeType(Coding value) { + public ClaimResponse setPayeeType(CodeableConcept value) { this.payeeType = value; return this; } @@ -5293,12 +5237,12 @@ public class ClaimResponse extends DomainResource { /** * @return {@link #form} (The form to be used for printing the content.) */ - public Coding getForm() { + public CodeableConcept getForm() { if (this.form == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ClaimResponse.form"); else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc + this.form = new CodeableConcept(); // cc return this.form; } @@ -5309,7 +5253,7 @@ public class ClaimResponse extends DomainResource { /** * @param value {@link #form} (The form to be used for printing the content.) */ - public ClaimResponse setForm(Coding value) { + public ClaimResponse setForm(CodeableConcept value) { this.form = value; return this; } @@ -5368,72 +5312,145 @@ public class ClaimResponse extends DomainResource { } /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) + * @return {@link #communicationRequest} (Request for additional supporting or authorizing information, such as: documents, images or resources.) */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; + public List getCommunicationRequest() { + if (this.communicationRequest == null) + this.communicationRequest = new ArrayList(); + return this.communicationRequest; } /** * @return Returns a reference to this for easy method chaining */ - public ClaimResponse setCoverage(List theCoverage) { - this.coverage = theCoverage; + public ClaimResponse setCommunicationRequest(List theCommunicationRequest) { + this.communicationRequest = theCommunicationRequest; return this; } - public boolean hasCoverage() { - if (this.coverage == null) + public boolean hasCommunicationRequest() { + if (this.communicationRequest == null) return false; - for (CoverageComponent item : this.coverage) + for (Reference item : this.communicationRequest) if (!item.isEmpty()) return true; return false; } - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); + public Reference addCommunicationRequest() { //3 + Reference t = new Reference(); + if (this.communicationRequest == null) + this.communicationRequest = new ArrayList(); + this.communicationRequest.add(t); return t; } - public ClaimResponse addCoverage(CoverageComponent t) { //3 + public ClaimResponse addCommunicationRequest(Reference t) { //3 if (t == null) return this; - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); + if (this.communicationRequest == null) + this.communicationRequest = new ArrayList(); + this.communicationRequest.add(t); return this; } /** - * @return The first repetition of repeating field {@link #coverage}, creating it if it does not already exist + * @return The first repetition of repeating field {@link #communicationRequest}, creating it if it does not already exist */ - public CoverageComponent getCoverageFirstRep() { - if (getCoverage().isEmpty()) { - addCoverage(); + public Reference getCommunicationRequestFirstRep() { + if (getCommunicationRequest().isEmpty()) { + addCommunicationRequest(); } - return getCoverage().get(0); + return getCommunicationRequest().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getCommunicationRequestTarget() { + if (this.communicationRequestTarget == null) + this.communicationRequestTarget = new ArrayList(); + return this.communicationRequestTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public CommunicationRequest addCommunicationRequestTarget() { + CommunicationRequest r = new CommunicationRequest(); + if (this.communicationRequestTarget == null) + this.communicationRequestTarget = new ArrayList(); + this.communicationRequestTarget.add(r); + return r; + } + + /** + * @return {@link #insurance} (Financial instrument by which payment information for health care.) + */ + public List getInsurance() { + if (this.insurance == null) + this.insurance = new ArrayList(); + return this.insurance; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ClaimResponse setInsurance(List theInsurance) { + this.insurance = theInsurance; + return this; + } + + public boolean hasInsurance() { + if (this.insurance == null) + return false; + for (InsuranceComponent item : this.insurance) + if (!item.isEmpty()) + return true; + return false; + } + + public InsuranceComponent addInsurance() { //3 + InsuranceComponent t = new InsuranceComponent(); + if (this.insurance == null) + this.insurance = new ArrayList(); + this.insurance.add(t); + return t; + } + + public ClaimResponse addInsurance(InsuranceComponent t) { //3 + if (t == null) + return this; + if (this.insurance == null) + this.insurance = new ArrayList(); + this.insurance.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist + */ + public InsuranceComponent getInsuranceFirstRep() { + if (getInsurance().isEmpty()) { + addInsurance(); + } + return getInsurance().get(0); } 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("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("request", "Reference(Claim)", "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("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("insurer", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, insurer)); 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)); - childrenList.add(new Property("outcome", "Coding", "Processing outcome errror, partial or complete processing.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("request", "Reference(Claim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "CodeableConcept", "Processing outcome errror, partial or complete processing.", 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("payeeType", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType)); + childrenList.add(new Property("payeeType", "CodeableConcept", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType)); childrenList.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item)); childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem)); childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); @@ -5442,9 +5459,10 @@ public class ClaimResponse extends DomainResource { childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); childrenList.add(new Property("payment", "", "Payment details for the claim if the claim has been paid.", 0, java.lang.Integer.MAX_VALUE, payment)); childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); - 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("communicationRequest", "Reference(CommunicationRequest)", "Request for additional supporting or authorizing information, such as: documents, images or resources.", 0, java.lang.Integer.MAX_VALUE, communicationRequest)); + childrenList.add(new Property("insurance", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, insurance)); } @Override @@ -5452,16 +5470,14 @@ public class ClaimResponse extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Coding + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case -316321118: /*payeeType*/ return this.payeeType == null ? new Base[0] : new Base[] {this.payeeType}; // Coding + case -316321118: /*payeeType*/ return this.payeeType == null ? new Base[0] : new Base[] {this.payeeType}; // CodeableConcept case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemComponent case -1148899500: /*addItem*/ return this.addItem == null ? new Base[0] : this.addItem.toArray(new Base[this.addItem.size()]); // AddedItemComponent case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorComponent @@ -5470,9 +5486,10 @@ public class ClaimResponse extends DomainResource { case 332332211: /*totalBenefit*/ return this.totalBenefit == null ? new Base[0] : new Base[] {this.totalBenefit}; // Money case -786681338: /*payment*/ return this.payment == null ? new Base[0] : new Base[] {this.payment}; // PaymentComponent case -350385368: /*reserved*/ return this.reserved == null ? new Base[0] : new Base[] {this.reserved}; // Coding - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NoteComponent - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent + case -2071896615: /*communicationRequest*/ return this.communicationRequest == null ? new Base[0] : this.communicationRequest.toArray(new Base[this.communicationRequest.size()]); // Reference + case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // InsuranceComponent default: return super.getProperty(hash, name, checkValid); } @@ -5487,20 +5504,11 @@ public class ClaimResponse extends DomainResource { case -892481550: // status this.status = new ClaimResponseStatusEnumFactory().fromType(value); // Enumeration break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType break; - case 1178922291: // organization - this.organization = castToReference(value); // Reference + case 1957615864: // insurer + this.insurer = castToReference(value); // Reference break; case 1601527200: // requestProvider this.requestProvider = castToReference(value); // Reference @@ -5508,14 +5516,17 @@ public class ClaimResponse extends DomainResource { case 599053666: // requestOrganization this.requestOrganization = castToReference(value); // Reference break; + case 1095692943: // request + this.request = castToReference(value); // Reference + break; case -1106507950: // outcome - this.outcome = castToCoding(value); // Coding + this.outcome = castToCodeableConcept(value); // CodeableConcept break; case 583380919: // disposition this.disposition = castToString(value); // StringType break; case -316321118: // payeeType - this.payeeType = castToCoding(value); // Coding + this.payeeType = castToCodeableConcept(value); // CodeableConcept break; case 3242771: // item this.getItem().add((ItemComponent) value); // ItemComponent @@ -5542,13 +5553,16 @@ public class ClaimResponse extends DomainResource { this.reserved = castToCoding(value); // Coding break; case 3148996: // form - this.form = castToCoding(value); // Coding + this.form = castToCodeableConcept(value); // CodeableConcept break; case 3387378: // note this.getNote().add((NoteComponent) value); // NoteComponent break; - case -351767064: // coverage - this.getCoverage().add((CoverageComponent) value); // CoverageComponent + case -2071896615: // communicationRequest + this.getCommunicationRequest().add(castToReference(value)); // Reference + break; + case 73049818: // insurance + this.getInsurance().add((InsuranceComponent) value); // InsuranceComponent break; default: super.setProperty(hash, name, value); } @@ -5561,26 +5575,22 @@ public class ClaimResponse extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new ClaimResponseStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("request")) - this.request = castToReference(value); // Reference - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding else if (name.equals("created")) this.created = castToDateTime(value); // DateTimeType - else if (name.equals("organization")) - this.organization = castToReference(value); // Reference + else if (name.equals("insurer")) + this.insurer = castToReference(value); // Reference else if (name.equals("requestProvider")) this.requestProvider = castToReference(value); // Reference else if (name.equals("requestOrganization")) this.requestOrganization = castToReference(value); // Reference + else if (name.equals("request")) + this.request = castToReference(value); // Reference else if (name.equals("outcome")) - this.outcome = castToCoding(value); // Coding + this.outcome = castToCodeableConcept(value); // CodeableConcept else if (name.equals("disposition")) this.disposition = castToString(value); // StringType else if (name.equals("payeeType")) - this.payeeType = castToCoding(value); // Coding + this.payeeType = castToCodeableConcept(value); // CodeableConcept else if (name.equals("item")) this.getItem().add((ItemComponent) value); else if (name.equals("addItem")) @@ -5598,11 +5608,13 @@ public class ClaimResponse extends DomainResource { else if (name.equals("reserved")) this.reserved = castToCoding(value); // Coding else if (name.equals("form")) - this.form = castToCoding(value); // Coding + this.form = castToCodeableConcept(value); // CodeableConcept else if (name.equals("note")) this.getNote().add((NoteComponent) value); - else if (name.equals("coverage")) - this.getCoverage().add((CoverageComponent) value); + else if (name.equals("communicationRequest")) + this.getCommunicationRequest().add(castToReference(value)); + else if (name.equals("insurance")) + this.getInsurance().add((InsuranceComponent) value); else super.setProperty(name, value); } @@ -5612,16 +5624,14 @@ public class ClaimResponse extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1095692943: return getRequest(); // Reference - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1178922291: return getOrganization(); // Reference + case 1957615864: return getInsurer(); // Reference case 1601527200: return getRequestProvider(); // Reference case 599053666: return getRequestOrganization(); // Reference - case -1106507950: return getOutcome(); // Coding + case 1095692943: return getRequest(); // Reference + case -1106507950: return getOutcome(); // CodeableConcept case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case -316321118: return getPayeeType(); // Coding + case -316321118: return getPayeeType(); // CodeableConcept case 3242771: return addItem(); // ItemComponent case -1148899500: return addAddItem(); // AddedItemComponent case 96784904: return addError(); // ErrorComponent @@ -5630,9 +5640,10 @@ public class ClaimResponse extends DomainResource { case 332332211: return getTotalBenefit(); // Money case -786681338: return getPayment(); // PaymentComponent case -350385368: return getReserved(); // Coding - case 3148996: return getForm(); // Coding + case 3148996: return getForm(); // CodeableConcept case 3387378: return addNote(); // NoteComponent - case -351767064: return addCoverage(); // CoverageComponent + case -2071896615: return addCommunicationRequest(); // Reference + case 73049818: return addInsurance(); // InsuranceComponent default: return super.makeProperty(hash, name); } @@ -5646,24 +5657,12 @@ public class ClaimResponse extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.status"); } - else if (name.equals("request")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } else if (name.equals("created")) { throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.created"); } - else if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; + else if (name.equals("insurer")) { + this.insurer = new Reference(); + return this.insurer; } else if (name.equals("requestProvider")) { this.requestProvider = new Reference(); @@ -5673,15 +5672,19 @@ public class ClaimResponse extends DomainResource { this.requestOrganization = new Reference(); return this.requestOrganization; } + else if (name.equals("request")) { + this.request = new Reference(); + return this.request; + } else if (name.equals("outcome")) { - this.outcome = new Coding(); + this.outcome = new CodeableConcept(); return this.outcome; } else if (name.equals("disposition")) { throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.disposition"); } else if (name.equals("payeeType")) { - this.payeeType = new Coding(); + this.payeeType = new CodeableConcept(); return this.payeeType; } else if (name.equals("item")) { @@ -5714,14 +5717,17 @@ public class ClaimResponse extends DomainResource { return this.reserved; } else if (name.equals("form")) { - this.form = new Coding(); + this.form = new CodeableConcept(); return this.form; } else if (name.equals("note")) { return addNote(); } - else if (name.equals("coverage")) { - return addCoverage(); + else if (name.equals("communicationRequest")) { + return addCommunicationRequest(); + } + else if (name.equals("insurance")) { + return addInsurance(); } else return super.addChild(name); @@ -5741,13 +5747,11 @@ public class ClaimResponse extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); - dst.request = request == null ? null : request.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); + dst.insurer = insurer == null ? null : insurer.copy(); dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); + dst.request = request == null ? null : request.copy(); dst.outcome = outcome == null ? null : outcome.copy(); dst.disposition = disposition == null ? null : disposition.copy(); dst.payeeType = payeeType == null ? null : payeeType.copy(); @@ -5777,10 +5781,15 @@ public class ClaimResponse extends DomainResource { for (NoteComponent i : note) dst.note.add(i.copy()); }; - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); + if (communicationRequest != null) { + dst.communicationRequest = new ArrayList(); + for (Reference i : communicationRequest) + dst.communicationRequest.add(i.copy()); + }; + if (insurance != null) { + dst.insurance = new ArrayList(); + for (InsuranceComponent i : insurance) + dst.insurance.add(i.copy()); }; return dst; } @@ -5796,15 +5805,15 @@ public class ClaimResponse extends DomainResource { if (!(other instanceof ClaimResponse)) return false; ClaimResponse o = (ClaimResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true) - && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(payeeType, o.payeeType, true) && compareDeep(item, o.item, true) - && compareDeep(addItem, o.addItem, true) && compareDeep(error, o.error, true) && compareDeep(totalCost, o.totalCost, true) - && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true) - && compareDeep(payment, o.payment, true) && compareDeep(reserved, o.reserved, true) && compareDeep(form, o.form, true) - && compareDeep(note, o.note, true) && compareDeep(coverage, o.coverage, true); + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(created, o.created, true) + && compareDeep(insurer, o.insurer, true) && compareDeep(requestProvider, o.requestProvider, true) + && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(request, o.request, true) + && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(payeeType, o.payeeType, true) + && compareDeep(item, o.item, true) && compareDeep(addItem, o.addItem, true) && compareDeep(error, o.error, true) + && compareDeep(totalCost, o.totalCost, true) && compareDeep(unallocDeductable, o.unallocDeductable, true) + && compareDeep(totalBenefit, o.totalBenefit, true) && compareDeep(payment, o.payment, true) && compareDeep(reserved, o.reserved, true) + && compareDeep(form, o.form, true) && compareDeep(note, o.note, true) && compareDeep(communicationRequest, o.communicationRequest, true) + && compareDeep(insurance, o.insurance, true); } @Override @@ -5819,10 +5828,10 @@ public class ClaimResponse extends DomainResource { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request - , ruleset, originalRuleset, created, organization, requestProvider, requestOrganization - , outcome, disposition, payeeType, item, addItem, error, totalCost, unallocDeductable - , totalBenefit, payment, reserved, form, note, coverage); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, created + , insurer, requestProvider, requestOrganization, request, outcome, disposition, payeeType + , item, addItem, error, totalCost, unallocDeductable, totalBenefit, payment, reserved + , form, note, communicationRequest, insurance); } @Override @@ -5833,17 +5842,17 @@ public class ClaimResponse extends DomainResource { /** * Search parameter: identifier *

- * Description: The identity of the insurer
+ * Description: The identity of the claimresponse
* Type: token
* Path: ClaimResponse.identifier
*

*/ - @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the insurer", type="token" ) + @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the claimresponse", type="token" ) public static final String SP_IDENTIFIER = "identifier"; /** * Fluent Client search parameter constant for identifier *

- * Description: The identity of the insurer
+ * Description: The identity of the claimresponse
* Type: token
* Path: ClaimResponse.identifier
*

@@ -5897,24 +5906,30 @@ public class ClaimResponse extends DomainResource { public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); /** - * Search parameter: paymentdate + * Search parameter: insurer *

- * Description: The expected paymentDate
- * Type: date
- * Path: ClaimResponse.payment.date
+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: ClaimResponse.insurer
*

*/ - @SearchParamDefinition(name="paymentdate", path="ClaimResponse.payment.date", description="The expected paymentDate", type="date" ) - public static final String SP_PAYMENTDATE = "paymentdate"; + @SearchParamDefinition(name="insurer", path="ClaimResponse.insurer", description="The organization who generated this resource", type="reference", target={Organization.class } ) + public static final String SP_INSURER = "insurer"; /** - * Fluent Client search parameter constant for paymentdate + * Fluent Client search parameter constant for insurer *

- * Description: The expected paymentDate
- * Type: date
- * Path: ClaimResponse.payment.date
+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: ClaimResponse.insurer
*

*/ - public static final ca.uhn.fhir.rest.gclient.DateClientParam PAYMENTDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PAYMENTDATE); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSURER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ClaimResponse:insurer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INSURER = new ca.uhn.fhir.model.api.Include("ClaimResponse:insurer").toLocked(); /** * Search parameter: created @@ -5937,30 +5952,24 @@ public class ClaimResponse extends DomainResource { public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); /** - * Search parameter: organization + * Search parameter: payment-date *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: ClaimResponse.organization
+ * Description: The expected paymentDate
+ * Type: date
+ * Path: ClaimResponse.payment.date
*

*/ - @SearchParamDefinition(name="organization", path="ClaimResponse.organization", description="The organization who generated this resource", type="reference", target={Organization.class } ) - public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="payment-date", path="ClaimResponse.payment.date", description="The expected paymentDate", type="date" ) + public static final String SP_PAYMENT_DATE = "payment-date"; /** - * Fluent Client search parameter constant for organization + * Fluent Client search parameter constant for payment-date *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: ClaimResponse.organization
+ * Description: The expected paymentDate
+ * Type: date
+ * Path: ClaimResponse.payment.date
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClaimResponse:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("ClaimResponse:organization").toLocked(); + public static final ca.uhn.fhir.rest.gclient.DateClientParam PAYMENT_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PAYMENT_DATE); /** * Search parameter: outcome diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ClinicalImpression.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ClinicalImpression.java index abd8f4b58c8..3ff1177563a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ClinicalImpression.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ClinicalImpression.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -772,13 +772,13 @@ public class ClinicalImpression extends DomainResource { /** - * Actions taken during assessment. + * Action taken as part of assessment procedure. */ - @Child(name = "action", type = {ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationRequest.class, DiagnosticRequest.class, NutritionRequest.class, DeviceUseRequest.class, Appointment.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Actions taken during assessment", formalDefinition="Actions taken during assessment." ) + @Child(name = "action", type = {ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationRequest.class, DiagnosticRequest.class, Appointment.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Action taken as part of assessment procedure", formalDefinition="Action taken as part of assessment procedure." ) protected List action; /** - * The actual objects that are the target of the reference (Actions taken during assessment.) + * The actual objects that are the target of the reference (Action taken as part of assessment procedure.) */ protected List actionTarget; @@ -1647,7 +1647,7 @@ public class ClinicalImpression extends DomainResource { } /** - * @return {@link #action} (Actions taken during assessment.) + * @return {@link #action} (Action taken as part of assessment procedure.) */ public List getAction() { if (this.action == null) @@ -1781,7 +1781,7 @@ public class ClinicalImpression extends DomainResource { childrenList.add(new Property("finding", "", "Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, finding)); childrenList.add(new Property("prognosisCodeableConcept", "CodeableConcept", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosisCodeableConcept)); childrenList.add(new Property("prognosisReference", "Reference(RiskAssessment)", "RiskAssessment expressing likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosisReference)); - childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationRequest|DiagnosticRequest|NutritionRequest|DeviceUseRequest|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationRequest|DiagnosticRequest|Appointment)", "Action taken as part of assessment procedure.", 0, java.lang.Integer.MAX_VALUE, action)); childrenList.add(new Property("note", "Annotation", "Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear.", 0, java.lang.Integer.MAX_VALUE, note)); } @@ -2355,17 +2355,17 @@ public class ClinicalImpression extends DomainResource { /** * Search parameter: action *

- * Description: Actions taken during assessment
+ * Description: Action taken as part of assessment procedure
* Type: reference
* Path: ClinicalImpression.action
*

*/ - @SearchParamDefinition(name="action", path="ClinicalImpression.action", description="Actions taken during assessment", type="reference", target={Appointment.class, DeviceUseRequest.class, DiagnosticRequest.class, MedicationRequest.class, NutritionRequest.class, Procedure.class, ProcedureRequest.class, ReferralRequest.class } ) + @SearchParamDefinition(name="action", path="ClinicalImpression.action", description="Action taken as part of assessment procedure", type="reference", target={Appointment.class, DiagnosticRequest.class, MedicationRequest.class, Procedure.class, ProcedureRequest.class, ReferralRequest.class } ) public static final String SP_ACTION = "action"; /** * Fluent Client search parameter constant for action *

- * Description: Actions taken during assessment
+ * Description: Action taken as part of assessment procedure
* Type: reference
* Path: ClinicalImpression.action
*

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CodeSystem.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CodeSystem.java index 3da3e15a200..9ab38e40cfc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CodeSystem.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CodeSystem.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -56,9 +56,9 @@ public class CodeSystem extends MetadataResource { */ GROUPEDBY, /** - * A hierarchy where the child concepts are "a kind of" the parent (typically an IS-A relationship.) + * A hierarchy where the child concepts have an IS-A relationship with the parents - that is, all the properties of the parent are also true for it's child concepts */ - SUBSUMES, + ISA, /** * Child elements list the individual parts of a composite whole (e.g. bodysite) */ @@ -76,8 +76,8 @@ public class CodeSystem extends MetadataResource { return null; if ("grouped-by".equals(codeString)) return GROUPEDBY; - if ("subsumes".equals(codeString)) - return SUBSUMES; + if ("is-a".equals(codeString)) + return ISA; if ("part-of".equals(codeString)) return PARTOF; if ("classified-with".equals(codeString)) @@ -90,7 +90,7 @@ public class CodeSystem extends MetadataResource { public String toCode() { switch (this) { case GROUPEDBY: return "grouped-by"; - case SUBSUMES: return "subsumes"; + case ISA: return "is-a"; case PARTOF: return "part-of"; case CLASSIFIEDWITH: return "classified-with"; default: return "?"; @@ -99,7 +99,7 @@ public class CodeSystem extends MetadataResource { public String getSystem() { switch (this) { case GROUPEDBY: return "http://hl7.org/fhir/codesystem-hierarchy-meaning"; - case SUBSUMES: return "http://hl7.org/fhir/codesystem-hierarchy-meaning"; + case ISA: return "http://hl7.org/fhir/codesystem-hierarchy-meaning"; case PARTOF: return "http://hl7.org/fhir/codesystem-hierarchy-meaning"; case CLASSIFIEDWITH: return "http://hl7.org/fhir/codesystem-hierarchy-meaning"; default: return "?"; @@ -108,7 +108,7 @@ public class CodeSystem extends MetadataResource { public String getDefinition() { switch (this) { case GROUPEDBY: return "No particular relationship between the concepts can be assumed, except what can be determined by inspection of the definitions of the elements (possible reasons to use this: importing from a source where this is not defined, or where various parts of the heirarchy have different meanings)"; - case SUBSUMES: return "A hierarchy where the child concepts are \"a kind of\" the parent (typically an IS-A relationship.)"; + case ISA: return "A hierarchy where the child concepts have an IS-A relationship with the parents - that is, all the properties of the parent are also true for it's child concepts"; case PARTOF: return "Child elements list the individual parts of a composite whole (e.g. bodysite)"; case CLASSIFIEDWITH: return "Child concepts in the hierarchy may have only one parent and there is a presumption that the code system is a \"closed world\" meaning all things must be in the hierarchy. This results in concepts such as \"not otherwise clasified.\""; default: return "?"; @@ -117,7 +117,7 @@ public class CodeSystem extends MetadataResource { public String getDisplay() { switch (this) { case GROUPEDBY: return "Grouped By"; - case SUBSUMES: return "Subsumes"; + case ISA: return "Is-A"; case PARTOF: return "Part Of"; case CLASSIFIEDWITH: return "Classified With"; default: return "?"; @@ -132,8 +132,8 @@ public class CodeSystem extends MetadataResource { return null; if ("grouped-by".equals(codeString)) return CodeSystemHierarchyMeaning.GROUPEDBY; - if ("subsumes".equals(codeString)) - return CodeSystemHierarchyMeaning.SUBSUMES; + if ("is-a".equals(codeString)) + return CodeSystemHierarchyMeaning.ISA; if ("part-of".equals(codeString)) return CodeSystemHierarchyMeaning.PARTOF; if ("classified-with".equals(codeString)) @@ -148,8 +148,8 @@ public class CodeSystem extends MetadataResource { return null; if ("grouped-by".equals(codeString)) return new Enumeration(this, CodeSystemHierarchyMeaning.GROUPEDBY); - if ("subsumes".equals(codeString)) - return new Enumeration(this, CodeSystemHierarchyMeaning.SUBSUMES); + if ("is-a".equals(codeString)) + return new Enumeration(this, CodeSystemHierarchyMeaning.ISA); if ("part-of".equals(codeString)) return new Enumeration(this, CodeSystemHierarchyMeaning.PARTOF); if ("classified-with".equals(codeString)) @@ -159,8 +159,8 @@ public class CodeSystem extends MetadataResource { public String toCode(CodeSystemHierarchyMeaning code) { if (code == CodeSystemHierarchyMeaning.GROUPEDBY) return "grouped-by"; - if (code == CodeSystemHierarchyMeaning.SUBSUMES) - return "subsumes"; + if (code == CodeSystemHierarchyMeaning.ISA) + return "is-a"; if (code == CodeSystemHierarchyMeaning.PARTOF) return "part-of"; if (code == CodeSystemHierarchyMeaning.CLASSIFIEDWITH) @@ -303,6 +303,10 @@ public class CodeSystem extends MetadataResource { * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (i.e. include child codes) */ ISA, + /** + * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include child codes) + */ + DESCENDENTOF, /** * The specified property of the code does not have an is-a relationship with the provided value. */ @@ -323,6 +327,10 @@ public class CodeSystem extends MetadataResource { * Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (e.g. include parent codes) */ GENERALIZES, + /** + * The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values) + */ + EXISTS, /** * added to help the parsers with the generic types */ @@ -334,6 +342,8 @@ public class CodeSystem extends MetadataResource { return EQUAL; if ("is-a".equals(codeString)) return ISA; + if ("descendent-of".equals(codeString)) + return DESCENDENTOF; if ("is-not-a".equals(codeString)) return ISNOTA; if ("regex".equals(codeString)) @@ -344,6 +354,8 @@ public class CodeSystem extends MetadataResource { return NOTIN; if ("generalizes".equals(codeString)) return GENERALIZES; + if ("exists".equals(codeString)) + return EXISTS; if (Configuration.isAcceptInvalidEnums()) return null; else @@ -353,11 +365,13 @@ public class CodeSystem extends MetadataResource { switch (this) { case EQUAL: return "="; case ISA: return "is-a"; + case DESCENDENTOF: return "descendent-of"; case ISNOTA: return "is-not-a"; case REGEX: return "regex"; case IN: return "in"; case NOTIN: return "not-in"; case GENERALIZES: return "generalizes"; + case EXISTS: return "exists"; default: return "?"; } } @@ -365,11 +379,13 @@ public class CodeSystem extends MetadataResource { switch (this) { case EQUAL: return "http://hl7.org/fhir/filter-operator"; case ISA: return "http://hl7.org/fhir/filter-operator"; + case DESCENDENTOF: return "http://hl7.org/fhir/filter-operator"; case ISNOTA: return "http://hl7.org/fhir/filter-operator"; case REGEX: return "http://hl7.org/fhir/filter-operator"; case IN: return "http://hl7.org/fhir/filter-operator"; case NOTIN: return "http://hl7.org/fhir/filter-operator"; case GENERALIZES: return "http://hl7.org/fhir/filter-operator"; + case EXISTS: return "http://hl7.org/fhir/filter-operator"; default: return "?"; } } @@ -377,11 +393,13 @@ public class CodeSystem extends MetadataResource { switch (this) { case EQUAL: return "The specified property of the code equals the provided value."; case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (i.e. include child codes)"; + case DESCENDENTOF: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include child codes)"; case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; case REGEX: return "The specified property of the code matches the regex specified in the provided value."; case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; case GENERALIZES: return "Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (e.g. include parent codes)"; + case EXISTS: return "The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values)"; default: return "?"; } } @@ -389,11 +407,13 @@ public class CodeSystem extends MetadataResource { switch (this) { case EQUAL: return "Equals"; case ISA: return "Is A (by subsumption)"; + case DESCENDENTOF: return "Descendent Of (by subsumption)"; case ISNOTA: return "Not (Is A) (by subsumption)"; case REGEX: return "Regular Expression"; case IN: return "In Set"; case NOTIN: return "Not in Set"; case GENERALIZES: return "Generalizes (by Subsumption)"; + case EXISTS: return "Exists"; default: return "?"; } } @@ -408,6 +428,8 @@ public class CodeSystem extends MetadataResource { return FilterOperator.EQUAL; if ("is-a".equals(codeString)) return FilterOperator.ISA; + if ("descendent-of".equals(codeString)) + return FilterOperator.DESCENDENTOF; if ("is-not-a".equals(codeString)) return FilterOperator.ISNOTA; if ("regex".equals(codeString)) @@ -418,6 +440,8 @@ public class CodeSystem extends MetadataResource { return FilterOperator.NOTIN; if ("generalizes".equals(codeString)) return FilterOperator.GENERALIZES; + if ("exists".equals(codeString)) + return FilterOperator.EXISTS; throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); } public Enumeration fromType(Base code) throws FHIRException { @@ -430,6 +454,8 @@ public class CodeSystem extends MetadataResource { return new Enumeration(this, FilterOperator.EQUAL); if ("is-a".equals(codeString)) return new Enumeration(this, FilterOperator.ISA); + if ("descendent-of".equals(codeString)) + return new Enumeration(this, FilterOperator.DESCENDENTOF); if ("is-not-a".equals(codeString)) return new Enumeration(this, FilterOperator.ISNOTA); if ("regex".equals(codeString)) @@ -440,6 +466,8 @@ public class CodeSystem extends MetadataResource { return new Enumeration(this, FilterOperator.NOTIN); if ("generalizes".equals(codeString)) return new Enumeration(this, FilterOperator.GENERALIZES); + if ("exists".equals(codeString)) + return new Enumeration(this, FilterOperator.EXISTS); throw new FHIRException("Unknown FilterOperator code '"+codeString+"'"); } public String toCode(FilterOperator code) { @@ -447,6 +475,8 @@ public class CodeSystem extends MetadataResource { return "="; if (code == FilterOperator.ISA) return "is-a"; + if (code == FilterOperator.DESCENDENTOF) + return "descendent-of"; if (code == FilterOperator.ISNOTA) return "is-not-a"; if (code == FilterOperator.REGEX) @@ -457,6 +487,8 @@ public class CodeSystem extends MetadataResource { return "not-in"; if (code == FilterOperator.GENERALIZES) return "generalizes"; + if (code == FilterOperator.EXISTS) + return "exists"; return "?"; } public String toSystem(FilterOperator code) { @@ -1402,10 +1434,10 @@ public class CodeSystem extends MetadataResource { protected List property; /** - * Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts. + * Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning. */ @Child(name = "concept", type = {ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Child Concepts (is-a/contains/categorizes)", formalDefinition="Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts." ) + @Description(shortDefinition="Child Concepts (is-a/contains/categorizes)", formalDefinition="Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning." ) protected List concept; private static final long serialVersionUID = 878320988L; @@ -1675,7 +1707,7 @@ public class CodeSystem extends MetadataResource { } /** - * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.) + * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.) */ public List getConcept() { if (this.concept == null) @@ -1734,7 +1766,7 @@ public class CodeSystem extends MetadataResource { childrenList.add(new Property("definition", "string", "The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition)); childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); childrenList.add(new Property("property", "", "A property value for this concept.", 0, java.lang.Integer.MAX_VALUE, property)); - childrenList.add(new Property("concept", "@CodeSystem.concept", "Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("concept", "@CodeSystem.concept", "Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.", 0, java.lang.Integer.MAX_VALUE, concept)); } @Override @@ -2504,7 +2536,7 @@ public class CodeSystem extends MetadataResource { * The meaning of the heirarchy of concepts. */ @Child(name = "hierarchyMeaning", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="grouped-by | subsumes | part-of | classified-with", formalDefinition="The meaning of the heirarchy of concepts." ) + @Description(shortDefinition="grouped-by | is-a | part-of | classified-with", formalDefinition="The meaning of the heirarchy of concepts." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning") protected Enumeration hierarchyMeaning; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CodeableConcept.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CodeableConcept.java index be045702d0e..ba7c1bc3304 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CodeableConcept.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CodeableConcept.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Coding.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Coding.java index 7644961b49b..2986c29c36e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Coding.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Coding.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Communication.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Communication.java index 118ea65a4d1..e18805b06d5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Communication.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Communication.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CommunicationRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CommunicationRequest.java index 6ccbe33ba77..d963ac99604 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CommunicationRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CommunicationRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CompartmentDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CompartmentDefinition.java index 21f24542693..09f8e888d54 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CompartmentDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/CompartmentDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Composition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Composition.java index 43e31159bd5..74f29b155ed 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Composition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Composition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ConceptMap.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ConceptMap.java index 65ec52195a9..001ae54bd5b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ConceptMap.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ConceptMap.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -1493,14 +1493,14 @@ public class ConceptMap extends MetadataResource { /** * The source value set that specifies the concepts that are being mapped. */ - @Child(name = "source", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Child(name = "source", type = {UriType.class, ValueSet.class}, order=3, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Identifies the source of the concepts which are being mapped", formalDefinition="The source value set that specifies the concepts that are being mapped." ) protected Type source; /** * The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. */ - @Child(name = "target", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Child(name = "target", type = {UriType.class, ValueSet.class}, order=4, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Provides context to the mappings", formalDefinition="The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made." ) protected Type target; @@ -1523,11 +1523,9 @@ public class ConceptMap extends MetadataResource { /** * Constructor */ - public ConceptMap(Enumeration status, Type source, Type target) { + public ConceptMap(Enumeration status) { super(); this.status = status; - this.source = source; - this.target = target; } /** @@ -2404,8 +2402,8 @@ public class ConceptMap extends MetadataResource { childrenList.add(new Property("jurisdiction", "CodeableConcept", "A jurisdiction in which the concept map is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction)); childrenList.add(new Property("purpose", "markdown", "Explains why this concept map is needed and why it has been designed as it has.", 0, java.lang.Integer.MAX_VALUE, purpose)); childrenList.add(new Property("copyright", "markdown", "A copyright statement relating to the concept map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the concept map.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("source[x]", "uri|Reference(ValueSet|StructureDefinition)", "The source value set that specifies the concepts that are being mapped.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("target[x]", "uri|Reference(ValueSet|StructureDefinition)", "The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("source[x]", "uri|Reference(ValueSet)", "The source value set that specifies the concepts that are being mapped.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target[x]", "uri|Reference(ValueSet)", "The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("group", "", "A group of mappings that all have the same source and target system.", 0, java.lang.Integer.MAX_VALUE, group)); } @@ -2865,7 +2863,7 @@ public class ConceptMap extends MetadataResource { * Path: ConceptMap.sourceReference
*

*/ - @SearchParamDefinition(name="source", path="ConceptMap.source.as(Reference)", description="Identifies the source of the concepts which are being mapped", type="reference", target={StructureDefinition.class, ValueSet.class } ) + @SearchParamDefinition(name="source", path="ConceptMap.source.as(Reference)", description="Identifies the source of the concepts which are being mapped", type="reference", target={ValueSet.class } ) public static final String SP_SOURCE = "source"; /** * Fluent Client search parameter constant for source @@ -2951,7 +2949,7 @@ public class ConceptMap extends MetadataResource { * Path: ConceptMap.targetReference
*

*/ - @SearchParamDefinition(name="target", path="ConceptMap.target.as(Reference)", description="Provides context to the mappings", type="reference", target={StructureDefinition.class, ValueSet.class } ) + @SearchParamDefinition(name="target", path="ConceptMap.target.as(Reference)", description="Provides context to the mappings", type="reference", target={ValueSet.class } ) public static final String SP_TARGET = "target"; /** * Fluent Client search parameter constant for target @@ -2997,7 +2995,7 @@ public class ConceptMap extends MetadataResource { * Path: ConceptMap.sourceUri
*

*/ - @SearchParamDefinition(name="source-uri", path="ConceptMap.source.as(Uri)", description="Identifies the source of the concepts which are being mapped", type="reference", target={StructureDefinition.class, ValueSet.class } ) + @SearchParamDefinition(name="source-uri", path="ConceptMap.source.as(Uri)", description="Identifies the source of the concepts which are being mapped", type="reference", target={ValueSet.class } ) public static final String SP_SOURCE_URI = "source-uri"; /** * Fluent Client search parameter constant for source-uri @@ -3123,7 +3121,7 @@ public class ConceptMap extends MetadataResource { * Path: ConceptMap.targetUri
*

*/ - @SearchParamDefinition(name="target-uri", path="ConceptMap.target.as(Uri)", description="Provides context to the mappings", type="reference", target={StructureDefinition.class, ValueSet.class } ) + @SearchParamDefinition(name="target-uri", path="ConceptMap.target.as(Uri)", description="Provides context to the mappings", type="reference", target={ValueSet.class } ) public static final String SP_TARGET_URI = "target-uri"; /** * Fluent Client search parameter constant for target-uri diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Condition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Condition.java index 82025e65dfb..df5733ecbdb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Condition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Condition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -50,19 +50,23 @@ public class Condition extends DomainResource { public enum ConditionClinicalStatus { /** - * The subject is currently experiencing the symptoms of the condition. + * The subject is currently experiencing the symptoms of the condition or there is evidence of the condition. */ ACTIVE, /** - * The subject is re-experiencing the symptoms of the condition after a period of remission or presumed resolution. + * The subject is having a relapse or re-experiencing the condition after a period of remission or presumed resolution. */ - RELAPSE, + RECURRENCE, + /** + * The subject is no longer experiencing the symptoms of the condition or there is no longer evidence of the condition. + */ + INACTIVE, /** * The subject is no longer experiencing the symptoms of the condition, but there is a risk of the symptoms returning. */ REMISSION, /** - * The subject is no longer experiencing the symptoms of the condition and there is no perceived risk of the symptoms returning. + * The subject is no longer experiencing the symptoms of the condition and there is a negligible perceived risk of the symptoms returning. */ RESOLVED, /** @@ -74,8 +78,10 @@ public class Condition extends DomainResource { return null; if ("active".equals(codeString)) return ACTIVE; - if ("relapse".equals(codeString)) - return RELAPSE; + if ("recurrence".equals(codeString)) + return RECURRENCE; + if ("inactive".equals(codeString)) + return INACTIVE; if ("remission".equals(codeString)) return REMISSION; if ("resolved".equals(codeString)) @@ -88,7 +94,8 @@ public class Condition extends DomainResource { public String toCode() { switch (this) { case ACTIVE: return "active"; - case RELAPSE: return "relapse"; + case RECURRENCE: return "recurrence"; + case INACTIVE: return "inactive"; case REMISSION: return "remission"; case RESOLVED: return "resolved"; default: return "?"; @@ -97,7 +104,8 @@ public class Condition extends DomainResource { public String getSystem() { switch (this) { case ACTIVE: return "http://hl7.org/fhir/condition-clinical"; - case RELAPSE: return "http://hl7.org/fhir/condition-clinical"; + case RECURRENCE: return "http://hl7.org/fhir/condition-clinical"; + case INACTIVE: return "http://hl7.org/fhir/condition-clinical"; case REMISSION: return "http://hl7.org/fhir/condition-clinical"; case RESOLVED: return "http://hl7.org/fhir/condition-clinical"; default: return "?"; @@ -105,17 +113,19 @@ public class Condition extends DomainResource { } public String getDefinition() { switch (this) { - case ACTIVE: return "The subject is currently experiencing the symptoms of the condition."; - case RELAPSE: return "The subject is re-experiencing the symptoms of the condition after a period of remission or presumed resolution."; + case ACTIVE: return "The subject is currently experiencing the symptoms of the condition or there is evidence of the condition."; + case RECURRENCE: return "The subject is having a relapse or re-experiencing the condition after a period of remission or presumed resolution."; + case INACTIVE: return "The subject is no longer experiencing the symptoms of the condition or there is no longer evidence of the condition."; case REMISSION: return "The subject is no longer experiencing the symptoms of the condition, but there is a risk of the symptoms returning."; - case RESOLVED: return "The subject is no longer experiencing the symptoms of the condition and there is no perceived risk of the symptoms returning."; + case RESOLVED: return "The subject is no longer experiencing the symptoms of the condition and there is a negligible perceived risk of the symptoms returning."; default: return "?"; } } public String getDisplay() { switch (this) { case ACTIVE: return "Active"; - case RELAPSE: return "Relapse"; + case RECURRENCE: return "Recurrence"; + case INACTIVE: return "Inactive"; case REMISSION: return "Remission"; case RESOLVED: return "Resolved"; default: return "?"; @@ -130,8 +140,10 @@ public class Condition extends DomainResource { return null; if ("active".equals(codeString)) return ConditionClinicalStatus.ACTIVE; - if ("relapse".equals(codeString)) - return ConditionClinicalStatus.RELAPSE; + if ("recurrence".equals(codeString)) + return ConditionClinicalStatus.RECURRENCE; + if ("inactive".equals(codeString)) + return ConditionClinicalStatus.INACTIVE; if ("remission".equals(codeString)) return ConditionClinicalStatus.REMISSION; if ("resolved".equals(codeString)) @@ -146,8 +158,10 @@ public class Condition extends DomainResource { return null; if ("active".equals(codeString)) return new Enumeration(this, ConditionClinicalStatus.ACTIVE); - if ("relapse".equals(codeString)) - return new Enumeration(this, ConditionClinicalStatus.RELAPSE); + if ("recurrence".equals(codeString)) + return new Enumeration(this, ConditionClinicalStatus.RECURRENCE); + if ("inactive".equals(codeString)) + return new Enumeration(this, ConditionClinicalStatus.INACTIVE); if ("remission".equals(codeString)) return new Enumeration(this, ConditionClinicalStatus.REMISSION); if ("resolved".equals(codeString)) @@ -157,8 +171,10 @@ public class Condition extends DomainResource { public String toCode(ConditionClinicalStatus code) { if (code == ConditionClinicalStatus.ACTIVE) return "active"; - if (code == ConditionClinicalStatus.RELAPSE) - return "relapse"; + if (code == ConditionClinicalStatus.RECURRENCE) + return "recurrence"; + if (code == ConditionClinicalStatus.INACTIVE) + return "inactive"; if (code == ConditionClinicalStatus.REMISSION) return "remission"; if (code == ConditionClinicalStatus.RESOLVED) @@ -783,14 +799,14 @@ public class Condition extends DomainResource { * The clinical status of the condition. */ @Child(name = "clinicalStatus", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | relapse | remission | resolved", formalDefinition="The clinical status of the condition." ) + @Description(shortDefinition="active | recurrence | inactive | remission | resolved", formalDefinition="The clinical status of the condition." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-clinical") protected Enumeration clinicalStatus; /** * The verification status to support the clinical status of the condition. */ - @Child(name = "verificationStatus", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) + @Child(name = "verificationStatus", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="provisional | differential | confirmed | refuted | entered-in-error | unknown", formalDefinition="The verification status to support the clinical status of the condition." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-ver-status") protected Enumeration verificationStatus; @@ -866,16 +882,16 @@ public class Condition extends DomainResource { protected Type abatement; /** - * A date, when the Condition statement was documented. + * The date on which the existance of the Condition was first asserted or acknowledged. */ - @Child(name = "dateRecorded", type = {DateType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="When first entered", formalDefinition="A date, when the Condition statement was documented." ) - protected DateType dateRecorded; + @Child(name = "assertedDate", type = {DateType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Date record was believed accurate", formalDefinition="The date on which the existance of the Condition was first asserted or acknowledged." ) + protected DateType assertedDate; /** * Individual who is making the condition statement. */ - @Child(name = "asserter", type = {Practitioner.class, Patient.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Child(name = "asserter", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=12, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Person who asserts this condition", formalDefinition="Individual who is making the condition statement." ) protected Reference asserter; @@ -905,7 +921,7 @@ public class Condition extends DomainResource { @Description(shortDefinition="Additional information about the Condition", formalDefinition="Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis." ) protected List note; - private static final long serialVersionUID = 1440494416L; + private static final long serialVersionUID = 1960151813L; /** * Constructor @@ -917,9 +933,8 @@ public class Condition extends DomainResource { /** * Constructor */ - public Condition(Enumeration verificationStatus, CodeableConcept code, Reference subject) { + public Condition(CodeableConcept code, Reference subject) { super(); - this.verificationStatus = verificationStatus; this.code = code; this.subject = subject; } @@ -1065,9 +1080,13 @@ public class Condition extends DomainResource { * @param value The verification status to support the clinical status of the condition. */ public Condition setVerificationStatus(ConditionVerificationStatus value) { + if (value == null) + this.verificationStatus = null; + else { if (this.verificationStatus == null) this.verificationStatus = new Enumeration(new ConditionVerificationStatusEnumFactory()); this.verificationStatus.setValue(value); + } return this; } @@ -1485,50 +1504,50 @@ public class Condition extends DomainResource { } /** - * @return {@link #dateRecorded} (A date, when the Condition statement was documented.). This is the underlying object with id, value and extensions. The accessor "getDateRecorded" gives direct access to the value + * @return {@link #assertedDate} (The date on which the existance of the Condition was first asserted or acknowledged.). This is the underlying object with id, value and extensions. The accessor "getAssertedDate" gives direct access to the value */ - public DateType getDateRecordedElement() { - if (this.dateRecorded == null) + public DateType getAssertedDateElement() { + if (this.assertedDate == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.dateRecorded"); + throw new Error("Attempt to auto-create Condition.assertedDate"); else if (Configuration.doAutoCreate()) - this.dateRecorded = new DateType(); // bb - return this.dateRecorded; + this.assertedDate = new DateType(); // bb + return this.assertedDate; } - public boolean hasDateRecordedElement() { - return this.dateRecorded != null && !this.dateRecorded.isEmpty(); + public boolean hasAssertedDateElement() { + return this.assertedDate != null && !this.assertedDate.isEmpty(); } - public boolean hasDateRecorded() { - return this.dateRecorded != null && !this.dateRecorded.isEmpty(); + public boolean hasAssertedDate() { + return this.assertedDate != null && !this.assertedDate.isEmpty(); } /** - * @param value {@link #dateRecorded} (A date, when the Condition statement was documented.). This is the underlying object with id, value and extensions. The accessor "getDateRecorded" gives direct access to the value + * @param value {@link #assertedDate} (The date on which the existance of the Condition was first asserted or acknowledged.). This is the underlying object with id, value and extensions. The accessor "getAssertedDate" gives direct access to the value */ - public Condition setDateRecordedElement(DateType value) { - this.dateRecorded = value; + public Condition setAssertedDateElement(DateType value) { + this.assertedDate = value; return this; } /** - * @return A date, when the Condition statement was documented. + * @return The date on which the existance of the Condition was first asserted or acknowledged. */ - public Date getDateRecorded() { - return this.dateRecorded == null ? null : this.dateRecorded.getValue(); + public Date getAssertedDate() { + return this.assertedDate == null ? null : this.assertedDate.getValue(); } /** - * @param value A date, when the Condition statement was documented. + * @param value The date on which the existance of the Condition was first asserted or acknowledged. */ - public Condition setDateRecorded(Date value) { + public Condition setAssertedDate(Date value) { if (value == null) - this.dateRecorded = null; + this.assertedDate = null; else { - if (this.dateRecorded == null) - this.dateRecorded = new DateType(); - this.dateRecorded.setValue(value); + if (this.assertedDate == null) + this.assertedDate = new DateType(); + this.assertedDate.setValue(value); } return this; } @@ -1715,8 +1734,8 @@ public class Condition extends DomainResource { childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "Encounter during which the condition was first asserted.", 0, java.lang.Integer.MAX_VALUE, context)); childrenList.add(new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date or date-time the condition began, in the opinion of the clinician.", 0, java.lang.Integer.MAX_VALUE, onset)); childrenList.add(new Property("abatement[x]", "dateTime|Age|boolean|Period|Range|string", "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.", 0, java.lang.Integer.MAX_VALUE, abatement)); - childrenList.add(new Property("dateRecorded", "date", "A date, when the Condition statement was documented.", 0, java.lang.Integer.MAX_VALUE, dateRecorded)); - childrenList.add(new Property("asserter", "Reference(Practitioner|Patient)", "Individual who is making the condition statement.", 0, java.lang.Integer.MAX_VALUE, asserter)); + childrenList.add(new Property("assertedDate", "date", "The date on which the existance of the Condition was first asserted or acknowledged.", 0, java.lang.Integer.MAX_VALUE, assertedDate)); + childrenList.add(new Property("asserter", "Reference(Practitioner|Patient|RelatedPerson)", "Individual who is making the condition statement.", 0, java.lang.Integer.MAX_VALUE, asserter)); childrenList.add(new Property("stage", "", "Clinical stage or grade of a condition. May include formal severity assessments.", 0, java.lang.Integer.MAX_VALUE, stage)); childrenList.add(new Property("evidence", "", "Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.", 0, java.lang.Integer.MAX_VALUE, evidence)); childrenList.add(new Property("note", "Annotation", "Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.", 0, java.lang.Integer.MAX_VALUE, note)); @@ -1736,7 +1755,7 @@ public class Condition extends DomainResource { case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // Type case -921554001: /*abatement*/ return this.abatement == null ? new Base[0] : new Base[] {this.abatement}; // Type - case 1888120446: /*dateRecorded*/ return this.dateRecorded == null ? new Base[0] : new Base[] {this.dateRecorded}; // DateType + case -174231629: /*assertedDate*/ return this.assertedDate == null ? new Base[0] : new Base[] {this.assertedDate}; // DateType case -373242253: /*asserter*/ return this.asserter == null ? new Base[0] : new Base[] {this.asserter}; // Reference case 109757182: /*stage*/ return this.stage == null ? new Base[0] : new Base[] {this.stage}; // ConditionStageComponent case 382967383: /*evidence*/ return this.evidence == null ? new Base[0] : this.evidence.toArray(new Base[this.evidence.size()]); // ConditionEvidenceComponent @@ -1782,8 +1801,8 @@ public class Condition extends DomainResource { case -921554001: // abatement this.abatement = castToType(value); // Type break; - case 1888120446: // dateRecorded - this.dateRecorded = castToDate(value); // DateType + case -174231629: // assertedDate + this.assertedDate = castToDate(value); // DateType break; case -373242253: // asserter this.asserter = castToReference(value); // Reference @@ -1826,8 +1845,8 @@ public class Condition extends DomainResource { this.onset = castToType(value); // Type else if (name.equals("abatement[x]")) this.abatement = castToType(value); // Type - else if (name.equals("dateRecorded")) - this.dateRecorded = castToDate(value); // DateType + else if (name.equals("assertedDate")) + this.assertedDate = castToDate(value); // DateType else if (name.equals("asserter")) this.asserter = castToReference(value); // Reference else if (name.equals("stage")) @@ -1854,7 +1873,7 @@ public class Condition extends DomainResource { case 951530927: return getContext(); // Reference case -1886216323: return getOnset(); // Type case -584196495: return getAbatement(); // Type - case 1888120446: throw new FHIRException("Cannot make property dateRecorded as it is not a complex type"); // DateType + case -174231629: throw new FHIRException("Cannot make property assertedDate as it is not a complex type"); // DateType case -373242253: return getAsserter(); // Reference case 109757182: return getStage(); // ConditionStageComponent case 382967383: return addEvidence(); // ConditionEvidenceComponent @@ -1941,8 +1960,8 @@ public class Condition extends DomainResource { this.abatement = new StringType(); return this.abatement; } - else if (name.equals("dateRecorded")) { - throw new FHIRException("Cannot call addChild on a primitive type Condition.dateRecorded"); + else if (name.equals("assertedDate")) { + throw new FHIRException("Cannot call addChild on a primitive type Condition.assertedDate"); } else if (name.equals("asserter")) { this.asserter = new Reference(); @@ -1993,7 +2012,7 @@ public class Condition extends DomainResource { dst.context = context == null ? null : context.copy(); dst.onset = onset == null ? null : onset.copy(); dst.abatement = abatement == null ? null : abatement.copy(); - dst.dateRecorded = dateRecorded == null ? null : dateRecorded.copy(); + dst.assertedDate = assertedDate == null ? null : assertedDate.copy(); dst.asserter = asserter == null ? null : asserter.copy(); dst.stage = stage == null ? null : stage.copy(); if (evidence != null) { @@ -2024,7 +2043,7 @@ public class Condition extends DomainResource { && compareDeep(verificationStatus, o.verificationStatus, true) && compareDeep(category, o.category, true) && compareDeep(severity, o.severity, true) && compareDeep(code, o.code, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(subject, o.subject, true) && compareDeep(context, o.context, true) && compareDeep(onset, o.onset, true) - && compareDeep(abatement, o.abatement, true) && compareDeep(dateRecorded, o.dateRecorded, true) + && compareDeep(abatement, o.abatement, true) && compareDeep(assertedDate, o.assertedDate, true) && compareDeep(asserter, o.asserter, true) && compareDeep(stage, o.stage, true) && compareDeep(evidence, o.evidence, true) && compareDeep(note, o.note, true); } @@ -2037,13 +2056,13 @@ public class Condition extends DomainResource { return false; Condition o = (Condition) other; return compareValues(clinicalStatus, o.clinicalStatus, true) && compareValues(verificationStatus, o.verificationStatus, true) - && compareValues(dateRecorded, o.dateRecorded, true); + && compareValues(assertedDate, o.assertedDate, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, clinicalStatus , verificationStatus, category, severity, code, bodySite, subject, context, onset - , abatement, dateRecorded, asserter, stage, evidence, note); + , abatement, assertedDate, asserter, stage, evidence, note); } @Override @@ -2265,7 +2284,7 @@ public class Condition extends DomainResource { * Path: Condition.asserter
*

*/ - @SearchParamDefinition(name="asserter", path="Condition.asserter", description="Person who asserts this condition", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Patient.class, Practitioner.class } ) + @SearchParamDefinition(name="asserter", path="Condition.asserter", description="Person who asserts this condition", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Patient.class, Practitioner.class, RelatedPerson.class } ) public static final String SP_ASSERTER = "asserter"; /** * Fluent Client search parameter constant for asserter @@ -2283,26 +2302,6 @@ public class Condition extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_ASSERTER = new ca.uhn.fhir.model.api.Include("Condition:asserter").toLocked(); - /** - * Search parameter: date-recorded - *

- * Description: A date, when the Condition statement was documented
- * Type: date
- * Path: Condition.dateRecorded
- *

- */ - @SearchParamDefinition(name="date-recorded", path="Condition.dateRecorded", description="A date, when the Condition statement was documented", type="date" ) - public static final String SP_DATE_RECORDED = "date-recorded"; - /** - * Fluent Client search parameter constant for date-recorded - *

- * Description: A date, when the Condition statement was documented
- * Type: date
- * Path: Condition.dateRecorded
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE_RECORDED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE_RECORDED); - /** * Search parameter: stage *

@@ -2435,6 +2434,26 @@ public class Condition extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.QuantityClientParam ABATEMENT_AGE = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_ABATEMENT_AGE); + /** + * Search parameter: asserted-date + *

+ * Description: Date record was believed accurate
+ * Type: date
+ * Path: Condition.assertedDate
+ *

+ */ + @SearchParamDefinition(name="asserted-date", path="Condition.assertedDate", description="Date record was believed accurate", type="date" ) + public static final String SP_ASSERTED_DATE = "asserted-date"; + /** + * Fluent Client search parameter constant for asserted-date + *

+ * Description: Date record was believed accurate
+ * Type: date
+ * Path: Condition.assertedDate
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam ASSERTED_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ASSERTED_DATE); + /** * Search parameter: category *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Consent.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Consent.java index c6d460d3dea..cb19e3dc8c0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Consent.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Consent.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Constants.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Constants.java index ab46356163e..87d464339a0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Constants.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Constants.java @@ -29,12 +29,12 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 public class Constants { - public final static String VERSION = "1.7.0"; - public final static String REVISION = "10131"; - public final static String DATE = "Sat Nov 05 10:42:18 EDT 2016"; + public final static String VERSION = "1.8.0"; + public final static String REVISION = "10528"; + public final static String DATE = "Tue Dec 06 09:42:48 EST 2016"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ContactDetail.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ContactDetail.java index d86e56a553d..f883a7c98ab 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ContactDetail.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ContactDetail.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ContactPoint.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ContactPoint.java index 4d0e3b51df9..136b2b1f7a6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ContactPoint.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ContactPoint.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -65,7 +65,11 @@ public class ContactPoint extends Type implements ICompositeType { */ PAGER, /** - * A contact that is not a phone, fax, or email address. The format of the value SHOULD be a URL. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. If this is not a URL, then it will require human interpretation. + * A contact that is not a phone, fax, pager or email address and is expressed as a URL. This is intended for various personal contacts including blogs, Skype, Twitter, Facebook, etc. Do not use for email addresses. + */ + URL, + /** + * A contact that is not a phone, fax, page or email address and is not expressible as a URL. E.g. Internal mail address. This SHOULD NOT be used for contacts that are expressible as a URL (e.g. Skype, Twitter, Facebook, etc.) Extensions may be used to distinguish "other" contact types. */ OTHER, /** @@ -83,6 +87,8 @@ public class ContactPoint extends Type implements ICompositeType { return EMAIL; if ("pager".equals(codeString)) return PAGER; + if ("url".equals(codeString)) + return URL; if ("other".equals(codeString)) return OTHER; if (Configuration.isAcceptInvalidEnums()) @@ -96,6 +102,7 @@ public class ContactPoint extends Type implements ICompositeType { case FAX: return "fax"; case EMAIL: return "email"; case PAGER: return "pager"; + case URL: return "url"; case OTHER: return "other"; default: return "?"; } @@ -106,6 +113,7 @@ public class ContactPoint extends Type implements ICompositeType { case FAX: return "http://hl7.org/fhir/contact-point-system"; case EMAIL: return "http://hl7.org/fhir/contact-point-system"; case PAGER: return "http://hl7.org/fhir/contact-point-system"; + case URL: return "http://hl7.org/fhir/contact-point-system"; case OTHER: return "http://hl7.org/fhir/contact-point-system"; default: return "?"; } @@ -116,7 +124,8 @@ public class ContactPoint extends Type implements ICompositeType { case FAX: return "The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; case EMAIL: return "The value is an email address."; case PAGER: return "The value is a pager number. These may be local pager numbers that are only usable on a particular pager system."; - case OTHER: return "A contact that is not a phone, fax, or email address. The format of the value SHOULD be a URL. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. If this is not a URL, then it will require human interpretation."; + case URL: return "A contact that is not a phone, fax, pager or email address and is expressed as a URL. This is intended for various personal contacts including blogs, Skype, Twitter, Facebook, etc. Do not use for email addresses."; + case OTHER: return "A contact that is not a phone, fax, page or email address and is not expressible as a URL. E.g. Internal mail address. This SHOULD NOT be used for contacts that are expressible as a URL (e.g. Skype, Twitter, Facebook, etc.) Extensions may be used to distinguish \"other\" contact types."; default: return "?"; } } @@ -126,7 +135,8 @@ public class ContactPoint extends Type implements ICompositeType { case FAX: return "Fax"; case EMAIL: return "Email"; case PAGER: return "Pager"; - case OTHER: return "URL"; + case URL: return "URL"; + case OTHER: return "Other"; default: return "?"; } } @@ -145,6 +155,8 @@ public class ContactPoint extends Type implements ICompositeType { return ContactPointSystem.EMAIL; if ("pager".equals(codeString)) return ContactPointSystem.PAGER; + if ("url".equals(codeString)) + return ContactPointSystem.URL; if ("other".equals(codeString)) return ContactPointSystem.OTHER; throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); @@ -163,6 +175,8 @@ public class ContactPoint extends Type implements ICompositeType { return new Enumeration(this, ContactPointSystem.EMAIL); if ("pager".equals(codeString)) return new Enumeration(this, ContactPointSystem.PAGER); + if ("url".equals(codeString)) + return new Enumeration(this, ContactPointSystem.URL); if ("other".equals(codeString)) return new Enumeration(this, ContactPointSystem.OTHER); throw new FHIRException("Unknown ContactPointSystem code '"+codeString+"'"); @@ -176,6 +190,8 @@ public class ContactPoint extends Type implements ICompositeType { return "email"; if (code == ContactPointSystem.PAGER) return "pager"; + if (code == ContactPointSystem.URL) + return "url"; if (code == ContactPointSystem.OTHER) return "other"; return "?"; @@ -327,7 +343,7 @@ public class ContactPoint extends Type implements ICompositeType { * Telecommunications form for contact point - what communications system is required to make use of the contact. */ @Child(name = "system", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="phone | fax | email | pager | other", formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact." ) + @Description(shortDefinition="phone | fax | email | pager | url | other", formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contact-point-system") protected Enumeration system; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Contract.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Contract.java index 8233444b0a7..d739026473e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Contract.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Contract.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -49,6 +49,128 @@ import org.hl7.fhir.exceptions.FHIRException; @ResourceDef(name="Contract", profile="http://hl7.org/fhir/Profile/Contract") public class Contract extends DomainResource { + public enum ContractStatus { + /** + * The instance is currently in-force. + */ + ACTIVE, + /** + * The instance is withdrawn, rescinded or reversed. + */ + CANCELLED, + /** + * A new instance the contents of which is not complete. + */ + DRAFT, + /** + * The instance was entered in error. + */ + ENTEREDINERROR, + /** + * added to help the parsers with the generic types + */ + NULL; + public static ContractStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("draft".equals(codeString)) + return DRAFT; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown ContractStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case CANCELLED: return "cancelled"; + case DRAFT: return "draft"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case CANCELLED: return "Cancelled"; + case DRAFT: return "Draft"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + } + + public static class ContractStatusEnumFactory implements EnumFactory { + public ContractStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ContractStatus.ACTIVE; + if ("cancelled".equals(codeString)) + return ContractStatus.CANCELLED; + if ("draft".equals(codeString)) + return ContractStatus.DRAFT; + if ("entered-in-error".equals(codeString)) + return ContractStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ContractStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return new Enumeration(this, ContractStatus.ACTIVE); + if ("cancelled".equals(codeString)) + return new Enumeration(this, ContractStatus.CANCELLED); + if ("draft".equals(codeString)) + return new Enumeration(this, ContractStatus.DRAFT); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, ContractStatus.ENTEREDINERROR); + throw new FHIRException("Unknown ContractStatus code '"+codeString+"'"); + } + public String toCode(ContractStatus code) { + if (code == ContractStatus.ACTIVE) + return "active"; + if (code == ContractStatus.CANCELLED) + return "cancelled"; + if (code == ContractStatus.DRAFT) + return "draft"; + if (code == ContractStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(ContractStatus code) { + return code.getSystem(); + } + } + @Block() public static class AgentComponent extends BackboneElement implements IBaseBackboneElement { /** @@ -3343,24 +3465,32 @@ public class Contract extends DomainResource { @Description(shortDefinition="Contract identifier", formalDefinition="Unique identifier for this Contract." ) protected Identifier identifier; + /** + * The status of the resource instance. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) + @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") + protected Enumeration status; + /** * When this Contract was issued. */ - @Child(name = "issued", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Child(name = "issued", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="When this Contract was issued", formalDefinition="When this Contract was issued." ) protected DateTimeType issued; /** * Relevant time or time-period when this Contract is applicable. */ - @Child(name = "applies", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Child(name = "applies", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Effective time", formalDefinition="Relevant time or time-period when this Contract is applicable." ) protected Period applies; /** * The target entity impacted by or of interest to parties to the agreement. */ - @Child(name = "subject", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "subject", type = {Reference.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Contract Target Entity", formalDefinition="The target entity impacted by or of interest to parties to the agreement." ) protected List subject; /** @@ -3372,7 +3502,7 @@ public class Contract extends DomainResource { /** * The matter of concern in the context of this agreement. */ - @Child(name = "topic", type = {Reference.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "topic", type = {Reference.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Context of the Contract", formalDefinition="The matter of concern in the context of this agreement." ) protected List topic; /** @@ -3384,7 +3514,7 @@ public class Contract extends DomainResource { /** * A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies. */ - @Child(name = "authority", type = {Organization.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "authority", type = {Organization.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Authority under which this Contract has standing", formalDefinition="A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies." ) protected List authority; /** @@ -3396,7 +3526,7 @@ public class Contract extends DomainResource { /** * Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources. */ - @Child(name = "domain", type = {Location.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "domain", type = {Location.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Domain in which this Contract applies", formalDefinition="Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources." ) protected List domain; /** @@ -3408,7 +3538,7 @@ public class Contract extends DomainResource { /** * Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc. */ - @Child(name = "type", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Child(name = "type", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Contract Type", formalDefinition="Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-type") protected CodeableConcept type; @@ -3416,7 +3546,7 @@ public class Contract extends DomainResource { /** * More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent. */ - @Child(name = "subType", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "subType", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Contract Subtype", formalDefinition="More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-subtype") protected List subType; @@ -3424,7 +3554,7 @@ public class Contract extends DomainResource { /** * Action stipulated by this Contract. */ - @Child(name = "action", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "action", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract Action", formalDefinition="Action stipulated by this Contract." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-action") protected List action; @@ -3432,7 +3562,7 @@ public class Contract extends DomainResource { /** * Reason for action stipulated by this Contract. */ - @Child(name = "actionReason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "actionReason", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract Action Reason", formalDefinition="Reason for action stipulated by this Contract." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-PurposeOfUse") protected List actionReason; @@ -3440,60 +3570,60 @@ public class Contract extends DomainResource { /** * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. */ - @Child(name = "agent", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "agent", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract Agent", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." ) protected List agent; /** * Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness. */ - @Child(name = "signer", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "signer", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract Signer", formalDefinition="Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness." ) protected List signer; /** * Contract Valued Item List. */ - @Child(name = "valuedItem", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "valuedItem", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract Valued Item", formalDefinition="Contract Valued Item List." ) protected List valuedItem; /** * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. */ - @Child(name = "term", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "term", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract Term List", formalDefinition="One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups." ) protected List term; /** * Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract. */ - @Child(name = "binding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "binding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=16, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract." ) protected Type binding; /** * The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. */ - @Child(name = "friendly", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "friendly", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract Friendly Language", formalDefinition="The \"patient friendly language\" versionof the Contract in whole or in parts. \"Patient friendly language\" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement." ) protected List friendly; /** * List of Legal expressions or representations of this Contract. */ - @Child(name = "legal", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "legal", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract Legal Language", formalDefinition="List of Legal expressions or representations of this Contract." ) protected List legal; /** * List of Computable Policy Rule Language Representations of this Contract. */ - @Child(name = "rule", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "rule", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Computable Contract Language", formalDefinition="List of Computable Policy Rule Language Representations of this Contract." ) protected List rule; - private static final long serialVersionUID = -1116217303L; + private static final long serialVersionUID = 90292068L; /** * Constructor @@ -3526,6 +3656,55 @@ public class Contract extends DomainResource { return this; } + /** + * @return {@link #status} (The status of the resource instance.). 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 Contract.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ContractStatusEnumFactory()); // bb + 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 resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Contract setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the resource instance. + */ + public ContractStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the resource instance. + */ + public Contract setStatus(ContractStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new ContractStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + /** * @return {@link #issued} (When this Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value */ @@ -4477,6 +4656,7 @@ public class Contract extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this Contract.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); childrenList.add(new Property("issued", "dateTime", "When this Contract was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); childrenList.add(new Property("subject", "Reference(Any)", "The target entity impacted by or of interest to parties to the agreement.", 0, java.lang.Integer.MAX_VALUE, subject)); @@ -4501,6 +4681,7 @@ public class Contract extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference @@ -4530,6 +4711,9 @@ public class Contract extends DomainResource { case -1618432855: // identifier this.identifier = castToIdentifier(value); // Identifier break; + case -892481550: // status + this.status = new ContractStatusEnumFactory().fromType(value); // Enumeration + break; case -1179159893: // issued this.issued = castToDateTime(value); // DateTimeType break; @@ -4593,6 +4777,8 @@ public class Contract extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("identifier")) this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("status")) + this.status = new ContractStatusEnumFactory().fromType(value); // Enumeration else if (name.equals("issued")) this.issued = castToDateTime(value); // DateTimeType else if (name.equals("applies")) @@ -4637,6 +4823,7 @@ public class Contract extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return getIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // DateTimeType case -793235316: return getApplies(); // Period case -1867885268: return addSubject(); // Reference @@ -4666,6 +4853,9 @@ public class Contract extends DomainResource { this.identifier = new Identifier(); return this.identifier; } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type Contract.status"); + } else if (name.equals("issued")) { throw new FHIRException("Cannot call addChild on a primitive type Contract.issued"); } @@ -4740,6 +4930,7 @@ public class Contract extends DomainResource { Contract dst = new Contract(); copyValues(dst); dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); dst.issued = issued == null ? null : issued.copy(); dst.applies = applies == null ? null : applies.copy(); if (subject != null) { @@ -4828,13 +5019,13 @@ public class Contract extends DomainResource { if (!(other instanceof Contract)) return false; Contract o = (Contract) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) - && compareDeep(subject, o.subject, true) && compareDeep(topic, o.topic, true) && compareDeep(authority, o.authority, true) - && compareDeep(domain, o.domain, true) && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) - && compareDeep(action, o.action, true) && compareDeep(actionReason, o.actionReason, true) && compareDeep(agent, o.agent, true) - && compareDeep(signer, o.signer, true) && compareDeep(valuedItem, o.valuedItem, true) && compareDeep(term, o.term, true) - && compareDeep(binding, o.binding, true) && compareDeep(friendly, o.friendly, true) && compareDeep(legal, o.legal, true) - && compareDeep(rule, o.rule, true); + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(issued, o.issued, true) + && compareDeep(applies, o.applies, true) && compareDeep(subject, o.subject, true) && compareDeep(topic, o.topic, true) + && compareDeep(authority, o.authority, true) && compareDeep(domain, o.domain, true) && compareDeep(type, o.type, true) + && compareDeep(subType, o.subType, true) && compareDeep(action, o.action, true) && compareDeep(actionReason, o.actionReason, true) + && compareDeep(agent, o.agent, true) && compareDeep(signer, o.signer, true) && compareDeep(valuedItem, o.valuedItem, true) + && compareDeep(term, o.term, true) && compareDeep(binding, o.binding, true) && compareDeep(friendly, o.friendly, true) + && compareDeep(legal, o.legal, true) && compareDeep(rule, o.rule, true); } @Override @@ -4844,13 +5035,13 @@ public class Contract extends DomainResource { if (!(other instanceof Contract)) return false; Contract o = (Contract) other; - return compareValues(issued, o.issued, true); + return compareValues(status, o.status, true) && compareValues(issued, o.issued, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, issued, applies - , subject, topic, authority, domain, type, subType, action, actionReason, agent - , signer, valuedItem, term, binding, friendly, legal, rule); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, issued + , applies, subject, topic, authority, domain, type, subType, action, actionReason + , agent, signer, valuedItem, term, binding, friendly, legal, rule); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Contributor.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Contributor.java index ae170afe0e7..ac10bf724c0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Contributor.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Contributor.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Count.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Count.java index 2eab2da88d2..c9430508323 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Count.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Count.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Coverage.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Coverage.java index 724e5244632..542796d2d63 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Coverage.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Coverage.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -50,19 +50,19 @@ public class Coverage extends DomainResource { public enum CoverageStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -96,19 +96,19 @@ public class Coverage extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/coverage-status"; - case CANCELLED: return "http://hl7.org/fhir/coverage-status"; - case DRAFT: return "http://hl7.org/fhir/coverage-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/coverage-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -117,7 +117,7 @@ public class Coverage extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -170,120 +170,1052 @@ public class Coverage extends DomainResource { } } + @Block() + public static class GroupComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID. + */ + @Child(name = "group", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the group", formalDefinition="Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID." ) + protected StringType group; + + /** + * A short description for the group. + */ + @Child(name = "groupDisplay", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Display text for an identifier for the group", formalDefinition="A short description for the group." ) + protected StringType groupDisplay; + + /** + * Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group. + */ + @Child(name = "subGroup", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the subsection of the group", formalDefinition="Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group." ) + protected StringType subGroup; + + /** + * A short description for the subgroup. + */ + @Child(name = "subGroupDisplay", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Display text for the subsection of the group", formalDefinition="A short description for the subgroup." ) + protected StringType subGroupDisplay; + + /** + * Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID. + */ + @Child(name = "plan", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the plan", formalDefinition="Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID." ) + protected StringType plan; + + /** + * A short description for the plan. + */ + @Child(name = "planDisplay", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Display text for the plan", formalDefinition="A short description for the plan." ) + protected StringType planDisplay; + + /** + * Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees. + */ + @Child(name = "subPlan", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the subsection of the plan", formalDefinition="Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees." ) + protected StringType subPlan; + + /** + * A short description for the subplan. + */ + @Child(name = "subPlanDisplay", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Display text for the subsection of the plan", formalDefinition="A short description for the subplan." ) + protected StringType subPlanDisplay; + + /** + * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. + */ + @Child(name = "class", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the class", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group." ) + protected StringType class_; + + /** + * A short description for the class. + */ + @Child(name = "classDisplay", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Display text for the class", formalDefinition="A short description for the class." ) + protected StringType classDisplay; + + /** + * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage or employer group. + */ + @Child(name = "subClass", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="An identifier for the subsection of the class", formalDefinition="Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage or employer group." ) + protected StringType subClass; + + /** + * A short description for the subclass. + */ + @Child(name = "subClassDisplay", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Display text for the subsection of the subclass", formalDefinition="A short description for the subclass." ) + protected StringType subClassDisplay; + + private static final long serialVersionUID = -13147121L; + + /** + * Constructor + */ + public GroupComponent() { + super(); + } + + /** + * @return {@link #group} (Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value + */ + public StringType getGroupElement() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.group"); + else if (Configuration.doAutoCreate()) + this.group = new StringType(); // bb + return this.group; + } + + public boolean hasGroupElement() { + return this.group != null && !this.group.isEmpty(); + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value + */ + public GroupComponent setGroupElement(StringType value) { + this.group = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID. + */ + public String getGroup() { + return this.group == null ? null : this.group.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID. + */ + public GroupComponent setGroup(String value) { + if (Utilities.noString(value)) + this.group = null; + else { + if (this.group == null) + this.group = new StringType(); + this.group.setValue(value); + } + return this; + } + + /** + * @return {@link #groupDisplay} (A short description for the group.). This is the underlying object with id, value and extensions. The accessor "getGroupDisplay" gives direct access to the value + */ + public StringType getGroupDisplayElement() { + if (this.groupDisplay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.groupDisplay"); + else if (Configuration.doAutoCreate()) + this.groupDisplay = new StringType(); // bb + return this.groupDisplay; + } + + public boolean hasGroupDisplayElement() { + return this.groupDisplay != null && !this.groupDisplay.isEmpty(); + } + + public boolean hasGroupDisplay() { + return this.groupDisplay != null && !this.groupDisplay.isEmpty(); + } + + /** + * @param value {@link #groupDisplay} (A short description for the group.). This is the underlying object with id, value and extensions. The accessor "getGroupDisplay" gives direct access to the value + */ + public GroupComponent setGroupDisplayElement(StringType value) { + this.groupDisplay = value; + return this; + } + + /** + * @return A short description for the group. + */ + public String getGroupDisplay() { + return this.groupDisplay == null ? null : this.groupDisplay.getValue(); + } + + /** + * @param value A short description for the group. + */ + public GroupComponent setGroupDisplay(String value) { + if (Utilities.noString(value)) + this.groupDisplay = null; + else { + if (this.groupDisplay == null) + this.groupDisplay = new StringType(); + this.groupDisplay.setValue(value); + } + return this; + } + + /** + * @return {@link #subGroup} (Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group.). This is the underlying object with id, value and extensions. The accessor "getSubGroup" gives direct access to the value + */ + public StringType getSubGroupElement() { + if (this.subGroup == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.subGroup"); + else if (Configuration.doAutoCreate()) + this.subGroup = new StringType(); // bb + return this.subGroup; + } + + public boolean hasSubGroupElement() { + return this.subGroup != null && !this.subGroup.isEmpty(); + } + + public boolean hasSubGroup() { + return this.subGroup != null && !this.subGroup.isEmpty(); + } + + /** + * @param value {@link #subGroup} (Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group.). This is the underlying object with id, value and extensions. The accessor "getSubGroup" gives direct access to the value + */ + public GroupComponent setSubGroupElement(StringType value) { + this.subGroup = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group. + */ + public String getSubGroup() { + return this.subGroup == null ? null : this.subGroup.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group. + */ + public GroupComponent setSubGroup(String value) { + if (Utilities.noString(value)) + this.subGroup = null; + else { + if (this.subGroup == null) + this.subGroup = new StringType(); + this.subGroup.setValue(value); + } + return this; + } + + /** + * @return {@link #subGroupDisplay} (A short description for the subgroup.). This is the underlying object with id, value and extensions. The accessor "getSubGroupDisplay" gives direct access to the value + */ + public StringType getSubGroupDisplayElement() { + if (this.subGroupDisplay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.subGroupDisplay"); + else if (Configuration.doAutoCreate()) + this.subGroupDisplay = new StringType(); // bb + return this.subGroupDisplay; + } + + public boolean hasSubGroupDisplayElement() { + return this.subGroupDisplay != null && !this.subGroupDisplay.isEmpty(); + } + + public boolean hasSubGroupDisplay() { + return this.subGroupDisplay != null && !this.subGroupDisplay.isEmpty(); + } + + /** + * @param value {@link #subGroupDisplay} (A short description for the subgroup.). This is the underlying object with id, value and extensions. The accessor "getSubGroupDisplay" gives direct access to the value + */ + public GroupComponent setSubGroupDisplayElement(StringType value) { + this.subGroupDisplay = value; + return this; + } + + /** + * @return A short description for the subgroup. + */ + public String getSubGroupDisplay() { + return this.subGroupDisplay == null ? null : this.subGroupDisplay.getValue(); + } + + /** + * @param value A short description for the subgroup. + */ + public GroupComponent setSubGroupDisplay(String value) { + if (Utilities.noString(value)) + this.subGroupDisplay = null; + else { + if (this.subGroupDisplay == null) + this.subGroupDisplay = new StringType(); + this.subGroupDisplay.setValue(value); + } + return this; + } + + /** + * @return {@link #plan} (Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value + */ + public StringType getPlanElement() { + if (this.plan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.plan"); + else if (Configuration.doAutoCreate()) + this.plan = new StringType(); // bb + return this.plan; + } + + public boolean hasPlanElement() { + return this.plan != null && !this.plan.isEmpty(); + } + + public boolean hasPlan() { + return this.plan != null && !this.plan.isEmpty(); + } + + /** + * @param value {@link #plan} (Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value + */ + public GroupComponent setPlanElement(StringType value) { + this.plan = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID. + */ + public String getPlan() { + return this.plan == null ? null : this.plan.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID. + */ + public GroupComponent setPlan(String value) { + if (Utilities.noString(value)) + this.plan = null; + else { + if (this.plan == null) + this.plan = new StringType(); + this.plan.setValue(value); + } + return this; + } + + /** + * @return {@link #planDisplay} (A short description for the plan.). This is the underlying object with id, value and extensions. The accessor "getPlanDisplay" gives direct access to the value + */ + public StringType getPlanDisplayElement() { + if (this.planDisplay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.planDisplay"); + else if (Configuration.doAutoCreate()) + this.planDisplay = new StringType(); // bb + return this.planDisplay; + } + + public boolean hasPlanDisplayElement() { + return this.planDisplay != null && !this.planDisplay.isEmpty(); + } + + public boolean hasPlanDisplay() { + return this.planDisplay != null && !this.planDisplay.isEmpty(); + } + + /** + * @param value {@link #planDisplay} (A short description for the plan.). This is the underlying object with id, value and extensions. The accessor "getPlanDisplay" gives direct access to the value + */ + public GroupComponent setPlanDisplayElement(StringType value) { + this.planDisplay = value; + return this; + } + + /** + * @return A short description for the plan. + */ + public String getPlanDisplay() { + return this.planDisplay == null ? null : this.planDisplay.getValue(); + } + + /** + * @param value A short description for the plan. + */ + public GroupComponent setPlanDisplay(String value) { + if (Utilities.noString(value)) + this.planDisplay = null; + else { + if (this.planDisplay == null) + this.planDisplay = new StringType(); + this.planDisplay.setValue(value); + } + return this; + } + + /** + * @return {@link #subPlan} (Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value + */ + public StringType getSubPlanElement() { + if (this.subPlan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.subPlan"); + else if (Configuration.doAutoCreate()) + this.subPlan = new StringType(); // bb + return this.subPlan; + } + + public boolean hasSubPlanElement() { + return this.subPlan != null && !this.subPlan.isEmpty(); + } + + public boolean hasSubPlan() { + return this.subPlan != null && !this.subPlan.isEmpty(); + } + + /** + * @param value {@link #subPlan} (Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value + */ + public GroupComponent setSubPlanElement(StringType value) { + this.subPlan = value; + return this; + } + + /** + * @return Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees. + */ + public String getSubPlan() { + return this.subPlan == null ? null : this.subPlan.getValue(); + } + + /** + * @param value Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees. + */ + public GroupComponent setSubPlan(String value) { + if (Utilities.noString(value)) + this.subPlan = null; + else { + if (this.subPlan == null) + this.subPlan = new StringType(); + this.subPlan.setValue(value); + } + return this; + } + + /** + * @return {@link #subPlanDisplay} (A short description for the subplan.). This is the underlying object with id, value and extensions. The accessor "getSubPlanDisplay" gives direct access to the value + */ + public StringType getSubPlanDisplayElement() { + if (this.subPlanDisplay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.subPlanDisplay"); + else if (Configuration.doAutoCreate()) + this.subPlanDisplay = new StringType(); // bb + return this.subPlanDisplay; + } + + public boolean hasSubPlanDisplayElement() { + return this.subPlanDisplay != null && !this.subPlanDisplay.isEmpty(); + } + + public boolean hasSubPlanDisplay() { + return this.subPlanDisplay != null && !this.subPlanDisplay.isEmpty(); + } + + /** + * @param value {@link #subPlanDisplay} (A short description for the subplan.). This is the underlying object with id, value and extensions. The accessor "getSubPlanDisplay" gives direct access to the value + */ + public GroupComponent setSubPlanDisplayElement(StringType value) { + this.subPlanDisplay = value; + return this; + } + + /** + * @return A short description for the subplan. + */ + public String getSubPlanDisplay() { + return this.subPlanDisplay == null ? null : this.subPlanDisplay.getValue(); + } + + /** + * @param value A short description for the subplan. + */ + public GroupComponent setSubPlanDisplay(String value) { + if (Utilities.noString(value)) + this.subPlanDisplay = null; + else { + if (this.subPlanDisplay == null) + this.subPlanDisplay = new StringType(); + this.subPlanDisplay.setValue(value); + } + return this; + } + + /** + * @return {@link #class_} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value + */ + public StringType getClass_Element() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new StringType(); // bb + return this.class_; + } + + public boolean hasClass_Element() { + return this.class_ != null && !this.class_.isEmpty(); + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value + */ + public GroupComponent setClass_Element(StringType value) { + this.class_ = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. + */ + public String getClass_() { + return this.class_ == null ? null : this.class_.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. + */ + public GroupComponent setClass_(String value) { + if (Utilities.noString(value)) + this.class_ = null; + else { + if (this.class_ == null) + this.class_ = new StringType(); + this.class_.setValue(value); + } + return this; + } + + /** + * @return {@link #classDisplay} (A short description for the class.). This is the underlying object with id, value and extensions. The accessor "getClassDisplay" gives direct access to the value + */ + public StringType getClassDisplayElement() { + if (this.classDisplay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.classDisplay"); + else if (Configuration.doAutoCreate()) + this.classDisplay = new StringType(); // bb + return this.classDisplay; + } + + public boolean hasClassDisplayElement() { + return this.classDisplay != null && !this.classDisplay.isEmpty(); + } + + public boolean hasClassDisplay() { + return this.classDisplay != null && !this.classDisplay.isEmpty(); + } + + /** + * @param value {@link #classDisplay} (A short description for the class.). This is the underlying object with id, value and extensions. The accessor "getClassDisplay" gives direct access to the value + */ + public GroupComponent setClassDisplayElement(StringType value) { + this.classDisplay = value; + return this; + } + + /** + * @return A short description for the class. + */ + public String getClassDisplay() { + return this.classDisplay == null ? null : this.classDisplay.getValue(); + } + + /** + * @param value A short description for the class. + */ + public GroupComponent setClassDisplay(String value) { + if (Utilities.noString(value)) + this.classDisplay = null; + else { + if (this.classDisplay == null) + this.classDisplay = new StringType(); + this.classDisplay.setValue(value); + } + return this; + } + + /** + * @return {@link #subClass} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage or employer group.). This is the underlying object with id, value and extensions. The accessor "getSubClass" gives direct access to the value + */ + public StringType getSubClassElement() { + if (this.subClass == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.subClass"); + else if (Configuration.doAutoCreate()) + this.subClass = new StringType(); // bb + return this.subClass; + } + + public boolean hasSubClassElement() { + return this.subClass != null && !this.subClass.isEmpty(); + } + + public boolean hasSubClass() { + return this.subClass != null && !this.subClass.isEmpty(); + } + + /** + * @param value {@link #subClass} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage or employer group.). This is the underlying object with id, value and extensions. The accessor "getSubClass" gives direct access to the value + */ + public GroupComponent setSubClassElement(StringType value) { + this.subClass = value; + return this; + } + + /** + * @return Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage or employer group. + */ + public String getSubClass() { + return this.subClass == null ? null : this.subClass.getValue(); + } + + /** + * @param value Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage or employer group. + */ + public GroupComponent setSubClass(String value) { + if (Utilities.noString(value)) + this.subClass = null; + else { + if (this.subClass == null) + this.subClass = new StringType(); + this.subClass.setValue(value); + } + return this; + } + + /** + * @return {@link #subClassDisplay} (A short description for the subclass.). This is the underlying object with id, value and extensions. The accessor "getSubClassDisplay" gives direct access to the value + */ + public StringType getSubClassDisplayElement() { + if (this.subClassDisplay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.subClassDisplay"); + else if (Configuration.doAutoCreate()) + this.subClassDisplay = new StringType(); // bb + return this.subClassDisplay; + } + + public boolean hasSubClassDisplayElement() { + return this.subClassDisplay != null && !this.subClassDisplay.isEmpty(); + } + + public boolean hasSubClassDisplay() { + return this.subClassDisplay != null && !this.subClassDisplay.isEmpty(); + } + + /** + * @param value {@link #subClassDisplay} (A short description for the subclass.). This is the underlying object with id, value and extensions. The accessor "getSubClassDisplay" gives direct access to the value + */ + public GroupComponent setSubClassDisplayElement(StringType value) { + this.subClassDisplay = value; + return this; + } + + /** + * @return A short description for the subclass. + */ + public String getSubClassDisplay() { + return this.subClassDisplay == null ? null : this.subClassDisplay.getValue(); + } + + /** + * @param value A short description for the subclass. + */ + public GroupComponent setSubClassDisplay(String value) { + if (Utilities.noString(value)) + this.subClassDisplay = null; + else { + if (this.subClassDisplay == null) + this.subClassDisplay = new StringType(); + this.subClassDisplay.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("group", "string", "Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("groupDisplay", "string", "A short description for the group.", 0, java.lang.Integer.MAX_VALUE, groupDisplay)); + childrenList.add(new Property("subGroup", "string", "Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group.", 0, java.lang.Integer.MAX_VALUE, subGroup)); + childrenList.add(new Property("subGroupDisplay", "string", "A short description for the subgroup.", 0, java.lang.Integer.MAX_VALUE, subGroupDisplay)); + childrenList.add(new Property("plan", "string", "Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID.", 0, java.lang.Integer.MAX_VALUE, plan)); + childrenList.add(new Property("planDisplay", "string", "A short description for the plan.", 0, java.lang.Integer.MAX_VALUE, planDisplay)); + childrenList.add(new Property("subPlan", "string", "Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees.", 0, java.lang.Integer.MAX_VALUE, subPlan)); + childrenList.add(new Property("subPlanDisplay", "string", "A short description for the subplan.", 0, java.lang.Integer.MAX_VALUE, subPlanDisplay)); + childrenList.add(new Property("class", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("classDisplay", "string", "A short description for the class.", 0, java.lang.Integer.MAX_VALUE, classDisplay)); + childrenList.add(new Property("subClass", "string", "Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage or employer group.", 0, java.lang.Integer.MAX_VALUE, subClass)); + childrenList.add(new Property("subClassDisplay", "string", "A short description for the subclass.", 0, java.lang.Integer.MAX_VALUE, subClassDisplay)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 98629247: /*group*/ return this.group == null ? new Base[0] : new Base[] {this.group}; // StringType + case 1322335555: /*groupDisplay*/ return this.groupDisplay == null ? new Base[0] : new Base[] {this.groupDisplay}; // StringType + case -2101792737: /*subGroup*/ return this.subGroup == null ? new Base[0] : new Base[] {this.subGroup}; // StringType + case 1051914147: /*subGroupDisplay*/ return this.subGroupDisplay == null ? new Base[0] : new Base[] {this.subGroupDisplay}; // StringType + case 3443497: /*plan*/ return this.plan == null ? new Base[0] : new Base[] {this.plan}; // StringType + case -896076455: /*planDisplay*/ return this.planDisplay == null ? new Base[0] : new Base[] {this.planDisplay}; // StringType + case -1868653175: /*subPlan*/ return this.subPlan == null ? new Base[0] : new Base[] {this.subPlan}; // StringType + case -1736083719: /*subPlanDisplay*/ return this.subPlanDisplay == null ? new Base[0] : new Base[] {this.subPlanDisplay}; // StringType + case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // StringType + case 1707405354: /*classDisplay*/ return this.classDisplay == null ? new Base[0] : new Base[] {this.classDisplay}; // StringType + case -2105679080: /*subClass*/ return this.subClass == null ? new Base[0] : new Base[] {this.subClass}; // StringType + case 1436983946: /*subClassDisplay*/ return this.subClassDisplay == null ? new Base[0] : new Base[] {this.subClassDisplay}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 98629247: // group + this.group = castToString(value); // StringType + break; + case 1322335555: // groupDisplay + this.groupDisplay = castToString(value); // StringType + break; + case -2101792737: // subGroup + this.subGroup = castToString(value); // StringType + break; + case 1051914147: // subGroupDisplay + this.subGroupDisplay = castToString(value); // StringType + break; + case 3443497: // plan + this.plan = castToString(value); // StringType + break; + case -896076455: // planDisplay + this.planDisplay = castToString(value); // StringType + break; + case -1868653175: // subPlan + this.subPlan = castToString(value); // StringType + break; + case -1736083719: // subPlanDisplay + this.subPlanDisplay = castToString(value); // StringType + break; + case 94742904: // class + this.class_ = castToString(value); // StringType + break; + case 1707405354: // classDisplay + this.classDisplay = castToString(value); // StringType + break; + case -2105679080: // subClass + this.subClass = castToString(value); // StringType + break; + case 1436983946: // subClassDisplay + this.subClassDisplay = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("group")) + this.group = castToString(value); // StringType + else if (name.equals("groupDisplay")) + this.groupDisplay = castToString(value); // StringType + else if (name.equals("subGroup")) + this.subGroup = castToString(value); // StringType + else if (name.equals("subGroupDisplay")) + this.subGroupDisplay = castToString(value); // StringType + else if (name.equals("plan")) + this.plan = castToString(value); // StringType + else if (name.equals("planDisplay")) + this.planDisplay = castToString(value); // StringType + else if (name.equals("subPlan")) + this.subPlan = castToString(value); // StringType + else if (name.equals("subPlanDisplay")) + this.subPlanDisplay = castToString(value); // StringType + else if (name.equals("class")) + this.class_ = castToString(value); // StringType + else if (name.equals("classDisplay")) + this.classDisplay = castToString(value); // StringType + else if (name.equals("subClass")) + this.subClass = castToString(value); // StringType + else if (name.equals("subClassDisplay")) + this.subClassDisplay = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 98629247: throw new FHIRException("Cannot make property group as it is not a complex type"); // StringType + case 1322335555: throw new FHIRException("Cannot make property groupDisplay as it is not a complex type"); // StringType + case -2101792737: throw new FHIRException("Cannot make property subGroup as it is not a complex type"); // StringType + case 1051914147: throw new FHIRException("Cannot make property subGroupDisplay as it is not a complex type"); // StringType + case 3443497: throw new FHIRException("Cannot make property plan as it is not a complex type"); // StringType + case -896076455: throw new FHIRException("Cannot make property planDisplay as it is not a complex type"); // StringType + case -1868653175: throw new FHIRException("Cannot make property subPlan as it is not a complex type"); // StringType + case -1736083719: throw new FHIRException("Cannot make property subPlanDisplay as it is not a complex type"); // StringType + case 94742904: throw new FHIRException("Cannot make property class as it is not a complex type"); // StringType + case 1707405354: throw new FHIRException("Cannot make property classDisplay as it is not a complex type"); // StringType + case -2105679080: throw new FHIRException("Cannot make property subClass as it is not a complex type"); // StringType + case 1436983946: throw new FHIRException("Cannot make property subClassDisplay as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("group")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.group"); + } + else if (name.equals("groupDisplay")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.groupDisplay"); + } + else if (name.equals("subGroup")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.subGroup"); + } + else if (name.equals("subGroupDisplay")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.subGroupDisplay"); + } + else if (name.equals("plan")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.plan"); + } + else if (name.equals("planDisplay")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.planDisplay"); + } + else if (name.equals("subPlan")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.subPlan"); + } + else if (name.equals("subPlanDisplay")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.subPlanDisplay"); + } + else if (name.equals("class")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.class"); + } + else if (name.equals("classDisplay")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.classDisplay"); + } + else if (name.equals("subClass")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.subClass"); + } + else if (name.equals("subClassDisplay")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.subClassDisplay"); + } + else + return super.addChild(name); + } + + public GroupComponent copy() { + GroupComponent dst = new GroupComponent(); + copyValues(dst); + dst.group = group == null ? null : group.copy(); + dst.groupDisplay = groupDisplay == null ? null : groupDisplay.copy(); + dst.subGroup = subGroup == null ? null : subGroup.copy(); + dst.subGroupDisplay = subGroupDisplay == null ? null : subGroupDisplay.copy(); + dst.plan = plan == null ? null : plan.copy(); + dst.planDisplay = planDisplay == null ? null : planDisplay.copy(); + dst.subPlan = subPlan == null ? null : subPlan.copy(); + dst.subPlanDisplay = subPlanDisplay == null ? null : subPlanDisplay.copy(); + dst.class_ = class_ == null ? null : class_.copy(); + dst.classDisplay = classDisplay == null ? null : classDisplay.copy(); + dst.subClass = subClass == null ? null : subClass.copy(); + dst.subClassDisplay = subClassDisplay == null ? null : subClassDisplay.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof GroupComponent)) + return false; + GroupComponent o = (GroupComponent) other; + return compareDeep(group, o.group, true) && compareDeep(groupDisplay, o.groupDisplay, true) && compareDeep(subGroup, o.subGroup, true) + && compareDeep(subGroupDisplay, o.subGroupDisplay, true) && compareDeep(plan, o.plan, true) && compareDeep(planDisplay, o.planDisplay, true) + && compareDeep(subPlan, o.subPlan, true) && compareDeep(subPlanDisplay, o.subPlanDisplay, true) + && compareDeep(class_, o.class_, true) && compareDeep(classDisplay, o.classDisplay, true) && compareDeep(subClass, o.subClass, true) + && compareDeep(subClassDisplay, o.subClassDisplay, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof GroupComponent)) + return false; + GroupComponent o = (GroupComponent) other; + return compareValues(group, o.group, true) && compareValues(groupDisplay, o.groupDisplay, true) && compareValues(subGroup, o.subGroup, true) + && compareValues(subGroupDisplay, o.subGroupDisplay, true) && compareValues(plan, o.plan, true) && compareValues(planDisplay, o.planDisplay, true) + && compareValues(subPlan, o.subPlan, true) && compareValues(subPlanDisplay, o.subPlanDisplay, true) + && compareValues(class_, o.class_, true) && compareValues(classDisplay, o.classDisplay, true) && compareValues(subClass, o.subClass, true) + && compareValues(subClassDisplay, o.subClassDisplay, true); + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(group, groupDisplay, subGroup + , subGroupDisplay, plan, planDisplay, subPlan, subPlanDisplay, class_, classDisplay + , subClass, subClassDisplay); + } + + public String fhirType() { + return "Coverage.group"; + + } + + } + + /** + * The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Certificate number, Personal Health Number or Case ID. May be constructed as the concatination of the Coverage.SubscriberID and the Coverage.dependant. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The primary coverage ID", formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Certificate number, Personal Health Number or Case ID. May be constructed as the concatination of the Coverage.SubscriberID and the Coverage.dependant." ) + protected List identifier; + /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=0, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; /** - * The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. + * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization. */ - @Child(name = "issuer", type = {Organization.class, Patient.class, RelatedPerson.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier for the plan or agreement issuer", formalDefinition="The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements." ) - protected Reference issuer; + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of coverage", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-type") + protected CodeableConcept type; /** - * The actual object that is the target of the reference (The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.) + * The party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer. */ - protected Resource issuerTarget; + @Child(name = "policyHolder", type = {Patient.class, RelatedPerson.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Owner of the policy", formalDefinition="The party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer." ) + protected Reference policyHolder; /** - * A self, or other, payment agreement not an insurance policy. + * The actual object that is the target of the reference (The party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer.) */ - @Child(name = "isAgreement", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Is a Payment Agreement", formalDefinition="A self, or other, payment agreement not an insurance policy." ) - protected BooleanType isAgreement; + protected Resource policyHolderTarget; /** - * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. + * The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due. */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Coverage start and end dates", formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." ) - protected Period period; + @Child(name = "subscriber", type = {Patient.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Subscriber to the policy", formalDefinition="The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due." ) + protected Reference subscriber; /** - * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. + * The actual object that is the target of the reference (The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.) */ - @Child(name = "type", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of coverage", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-ActCoverageTypeCode") - protected Coding type; + protected Resource subscriberTarget; /** - * The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. + * The insurer assigned ID for the Subscriber. */ - @Child(name = "planholder", type = {Patient.class, Organization.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Plan holder", formalDefinition="The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due." ) - protected Reference planholder; + @Child(name = "subscriberId", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="ID assigned to the Subscriber", formalDefinition="The insurer assigned ID for the Subscriber." ) + protected StringType subscriberId; /** - * The actual object that is the target of the reference (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + * The party who benefits from the insurance coverage., the patient when services are provided. */ - protected Resource planholderTarget; - - /** - * The party who benefits from the insurance coverage. - */ - @Child(name = "beneficiary", type = {Patient.class}, order=6, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Plan Beneficiary", formalDefinition="The party who benefits from the insurance coverage." ) + @Child(name = "beneficiary", type = {Patient.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Plan Beneficiary", formalDefinition="The party who benefits from the insurance coverage., the patient when services are provided." ) protected Reference beneficiary; /** - * The actual object that is the target of the reference (The party who benefits from the insurance coverage.) + * The actual object that is the target of the reference (The party who benefits from the insurance coverage., the patient when services are provided.) */ protected Patient beneficiaryTarget; /** - * The relationship of beneficiary (patient) (subscriber) to the the planholder. + * The relationship of beneficiary (patient) to the subscriber. */ - @Child(name = "relationship", type = {Coding.class}, order=7, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Beneficiary relationship to Planholder", formalDefinition="The relationship of beneficiary (patient) (subscriber) to the the planholder." ) + @Child(name = "relationship", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Beneficiary relationship to the Subscriber", formalDefinition="The relationship of beneficiary (patient) to the subscriber." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/policyholder-relationship") - protected Coding relationship; + protected CodeableConcept relationship; /** - * The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID. + * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. */ - @Child(name = "identifier", type = {Identifier.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The primary coverage ID", formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID." ) - protected List identifier; + @Child(name = "period", type = {Period.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Coverage start and end dates", formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." ) + protected Period period; + + /** + * The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. May provide multiple identifiers such as insurance company identifier or business identifier (BIN number). + */ + @Child(name = "payor", type = {Organization.class, Patient.class, RelatedPerson.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Identifier for the plan or agreement issuer", formalDefinition="The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. May provide multiple identifiers such as insurance company identifier or business identifier (BIN number)." ) + protected List payor; + /** + * The actual objects that are the target of the reference (The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. May provide multiple identifiers such as insurance company identifier or business identifier (BIN number).) + */ + protected List payorTarget; + /** * A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan. */ - @Child(name = "level", type = {Coding.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "group", type = {}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Additional coverage classifications", formalDefinition="A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-level") - protected List level; + protected GroupComponent group; /** * A unique identifier for a dependent under the coverage. */ - @Child(name = "dependent", type = {PositiveIntType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Child(name = "dependent", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Dependent number", formalDefinition="A unique identifier for a dependent under the coverage." ) - protected PositiveIntType dependent; + protected StringType dependent; /** * An optional counter for a particular instance of the identified coverage which increments upon each renewal. */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Child(name = "sequence", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="The plan instance or sequence counter", formalDefinition="An optional counter for a particular instance of the identified coverage which increments upon each renewal." ) - protected PositiveIntType sequence; + protected StringType sequence; /** - * The identifier for a community of providers. + * The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care. */ - @Child(name = "network", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer network", formalDefinition="The identifier for a community of providers." ) + @Child(name = "order", type = {PositiveIntType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Relative order of the coverage", formalDefinition="The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care." ) + protected PositiveIntType order; + + /** + * The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply. + */ + @Child(name = "network", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Insurer network", formalDefinition="The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply." ) protected StringType network; /** * The policy(s) which constitute this insurance coverage. */ - @Child(name = "contract", type = {Contract.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "contract", type = {Contract.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." ) protected List contract; /** @@ -292,7 +1224,7 @@ public class Coverage extends DomainResource { protected List contractTarget; - private static final long serialVersionUID = -945846441L; + private static final long serialVersionUID = -2003248518L; /** * Constructor @@ -301,304 +1233,8 @@ public class Coverage extends DomainResource { super(); } - /** - * Constructor - */ - public Coverage(Enumeration status, Reference issuer, Reference planholder, Reference beneficiary, Coding relationship) { - super(); - this.status = status; - this.issuer = issuer; - this.planholder = planholder; - this.beneficiary = beneficiary; - this.relationship = relationship; - } - /** - * @return {@link #status} (The status of the resource instance.). 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 Coverage.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CoverageStatusEnumFactory()); // bb - 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 resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Coverage setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the resource instance. - */ - public CoverageStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the resource instance. - */ - public Coverage setStatus(CoverageStatus value) { - if (this.status == null) - this.status = new Enumeration(new CoverageStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #issuer} (The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.) - */ - public Reference getIssuer() { - if (this.issuer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.issuer"); - else if (Configuration.doAutoCreate()) - this.issuer = new Reference(); // cc - return this.issuer; - } - - public boolean hasIssuer() { - return this.issuer != null && !this.issuer.isEmpty(); - } - - /** - * @param value {@link #issuer} (The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.) - */ - public Coverage setIssuer(Reference value) { - this.issuer = value; - return this; - } - - /** - * @return {@link #issuer} 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 program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.) - */ - public Resource getIssuerTarget() { - return this.issuerTarget; - } - - /** - * @param value {@link #issuer} 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 program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.) - */ - public Coverage setIssuerTarget(Resource value) { - this.issuerTarget = value; - return this; - } - - /** - * @return {@link #isAgreement} (A self, or other, payment agreement not an insurance policy.). This is the underlying object with id, value and extensions. The accessor "getIsAgreement" gives direct access to the value - */ - public BooleanType getIsAgreementElement() { - if (this.isAgreement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.isAgreement"); - else if (Configuration.doAutoCreate()) - this.isAgreement = new BooleanType(); // bb - return this.isAgreement; - } - - public boolean hasIsAgreementElement() { - return this.isAgreement != null && !this.isAgreement.isEmpty(); - } - - public boolean hasIsAgreement() { - return this.isAgreement != null && !this.isAgreement.isEmpty(); - } - - /** - * @param value {@link #isAgreement} (A self, or other, payment agreement not an insurance policy.). This is the underlying object with id, value and extensions. The accessor "getIsAgreement" gives direct access to the value - */ - public Coverage setIsAgreementElement(BooleanType value) { - this.isAgreement = value; - return this; - } - - /** - * @return A self, or other, payment agreement not an insurance policy. - */ - public boolean getIsAgreement() { - return this.isAgreement == null || this.isAgreement.isEmpty() ? false : this.isAgreement.getValue(); - } - - /** - * @param value A self, or other, payment agreement not an insurance policy. - */ - public Coverage setIsAgreement(boolean value) { - if (this.isAgreement == null) - this.isAgreement = new BooleanType(); - this.isAgreement.setValue(value); - return this; - } - - /** - * @return {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) - */ - public Coverage setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) - */ - public Coverage setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Reference getPlanholder() { - if (this.planholder == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.planholder"); - else if (Configuration.doAutoCreate()) - this.planholder = new Reference(); // cc - return this.planholder; - } - - public boolean hasPlanholder() { - return this.planholder != null && !this.planholder.isEmpty(); - } - - /** - * @param value {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Coverage setPlanholder(Reference value) { - this.planholder = value; - return this; - } - - /** - * @return {@link #planholder} 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Resource getPlanholderTarget() { - return this.planholderTarget; - } - - /** - * @param value {@link #planholder} 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Coverage setPlanholderTarget(Resource value) { - this.planholderTarget = value; - return this; - } - - /** - * @return {@link #beneficiary} (The party who benefits from the insurance coverage.) - */ - public Reference getBeneficiary() { - if (this.beneficiary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.beneficiary"); - else if (Configuration.doAutoCreate()) - this.beneficiary = new Reference(); // cc - return this.beneficiary; - } - - public boolean hasBeneficiary() { - return this.beneficiary != null && !this.beneficiary.isEmpty(); - } - - /** - * @param value {@link #beneficiary} (The party who benefits from the insurance coverage.) - */ - public Coverage setBeneficiary(Reference value) { - this.beneficiary = value; - return this; - } - - /** - * @return {@link #beneficiary} 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 party who benefits from the insurance coverage.) - */ - public Patient getBeneficiaryTarget() { - if (this.beneficiaryTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.beneficiary"); - else if (Configuration.doAutoCreate()) - this.beneficiaryTarget = new Patient(); // aa - return this.beneficiaryTarget; - } - - /** - * @param value {@link #beneficiary} 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 party who benefits from the insurance coverage.) - */ - public Coverage setBeneficiaryTarget(Patient value) { - this.beneficiaryTarget = value; - return this; - } - - /** - * @return {@link #relationship} (The relationship of beneficiary (patient) (subscriber) to the the planholder.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of beneficiary (patient) (subscriber) to the the planholder.) - */ - public Coverage setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) + * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Certificate number, Personal Health Number or Case ID. May be constructed as the concatination of the Coverage.SubscriberID and the Coverage.dependant.) */ public List getIdentifier() { if (this.identifier == null) @@ -651,67 +1287,393 @@ public class Coverage extends DomainResource { } /** - * @return {@link #level} (A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan.) + * @return {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value */ - public List getLevel() { - if (this.level == null) - this.level = new ArrayList(); - return this.level; + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new CoverageStatusEnumFactory()); // bb + 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 resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Coverage setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the resource instance. + */ + public CoverageStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the resource instance. + */ + public Coverage setStatus(CoverageStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(new CoverageStatusEnumFactory()); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); // cc + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.) + */ + public Coverage setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #policyHolder} (The party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer.) + */ + public Reference getPolicyHolder() { + if (this.policyHolder == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.policyHolder"); + else if (Configuration.doAutoCreate()) + this.policyHolder = new Reference(); // cc + return this.policyHolder; + } + + public boolean hasPolicyHolder() { + return this.policyHolder != null && !this.policyHolder.isEmpty(); + } + + /** + * @param value {@link #policyHolder} (The party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer.) + */ + public Coverage setPolicyHolder(Reference value) { + this.policyHolder = value; + return this; + } + + /** + * @return {@link #policyHolder} 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 party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer.) + */ + public Resource getPolicyHolderTarget() { + return this.policyHolderTarget; + } + + /** + * @param value {@link #policyHolder} 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 party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer.) + */ + public Coverage setPolicyHolderTarget(Resource value) { + this.policyHolderTarget = value; + return this; + } + + /** + * @return {@link #subscriber} (The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.) + */ + public Reference getSubscriber() { + if (this.subscriber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subscriber"); + else if (Configuration.doAutoCreate()) + this.subscriber = new Reference(); // cc + return this.subscriber; + } + + public boolean hasSubscriber() { + return this.subscriber != null && !this.subscriber.isEmpty(); + } + + /** + * @param value {@link #subscriber} (The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.) + */ + public Coverage setSubscriber(Reference value) { + this.subscriber = value; + return this; + } + + /** + * @return {@link #subscriber} 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 party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.) + */ + public Resource getSubscriberTarget() { + return this.subscriberTarget; + } + + /** + * @param value {@link #subscriber} 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 party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.) + */ + public Coverage setSubscriberTarget(Resource value) { + this.subscriberTarget = value; + return this; + } + + /** + * @return {@link #subscriberId} (The insurer assigned ID for the Subscriber.). This is the underlying object with id, value and extensions. The accessor "getSubscriberId" gives direct access to the value + */ + public StringType getSubscriberIdElement() { + if (this.subscriberId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subscriberId"); + else if (Configuration.doAutoCreate()) + this.subscriberId = new StringType(); // bb + return this.subscriberId; + } + + public boolean hasSubscriberIdElement() { + return this.subscriberId != null && !this.subscriberId.isEmpty(); + } + + public boolean hasSubscriberId() { + return this.subscriberId != null && !this.subscriberId.isEmpty(); + } + + /** + * @param value {@link #subscriberId} (The insurer assigned ID for the Subscriber.). This is the underlying object with id, value and extensions. The accessor "getSubscriberId" gives direct access to the value + */ + public Coverage setSubscriberIdElement(StringType value) { + this.subscriberId = value; + return this; + } + + /** + * @return The insurer assigned ID for the Subscriber. + */ + public String getSubscriberId() { + return this.subscriberId == null ? null : this.subscriberId.getValue(); + } + + /** + * @param value The insurer assigned ID for the Subscriber. + */ + public Coverage setSubscriberId(String value) { + if (Utilities.noString(value)) + this.subscriberId = null; + else { + if (this.subscriberId == null) + this.subscriberId = new StringType(); + this.subscriberId.setValue(value); + } + return this; + } + + /** + * @return {@link #beneficiary} (The party who benefits from the insurance coverage., the patient when services are provided.) + */ + public Reference getBeneficiary() { + if (this.beneficiary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.beneficiary"); + else if (Configuration.doAutoCreate()) + this.beneficiary = new Reference(); // cc + return this.beneficiary; + } + + public boolean hasBeneficiary() { + return this.beneficiary != null && !this.beneficiary.isEmpty(); + } + + /** + * @param value {@link #beneficiary} (The party who benefits from the insurance coverage., the patient when services are provided.) + */ + public Coverage setBeneficiary(Reference value) { + this.beneficiary = value; + return this; + } + + /** + * @return {@link #beneficiary} 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 party who benefits from the insurance coverage., the patient when services are provided.) + */ + public Patient getBeneficiaryTarget() { + if (this.beneficiaryTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.beneficiary"); + else if (Configuration.doAutoCreate()) + this.beneficiaryTarget = new Patient(); // aa + return this.beneficiaryTarget; + } + + /** + * @param value {@link #beneficiary} 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 party who benefits from the insurance coverage., the patient when services are provided.) + */ + public Coverage setBeneficiaryTarget(Patient value) { + this.beneficiaryTarget = value; + return this; + } + + /** + * @return {@link #relationship} (The relationship of beneficiary (patient) to the subscriber.) + */ + public CodeableConcept getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new CodeableConcept(); // cc + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of beneficiary (patient) to the subscriber.) + */ + public Coverage setRelationship(CodeableConcept value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) + */ + public Coverage setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #payor} (The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. May provide multiple identifiers such as insurance company identifier or business identifier (BIN number).) + */ + public List getPayor() { + if (this.payor == null) + this.payor = new ArrayList(); + return this.payor; } /** * @return Returns a reference to this for easy method chaining */ - public Coverage setLevel(List theLevel) { - this.level = theLevel; + public Coverage setPayor(List thePayor) { + this.payor = thePayor; return this; } - public boolean hasLevel() { - if (this.level == null) + public boolean hasPayor() { + if (this.payor == null) return false; - for (Coding item : this.level) + for (Reference item : this.payor) if (!item.isEmpty()) return true; return false; } - public Coding addLevel() { //3 - Coding t = new Coding(); - if (this.level == null) - this.level = new ArrayList(); - this.level.add(t); + public Reference addPayor() { //3 + Reference t = new Reference(); + if (this.payor == null) + this.payor = new ArrayList(); + this.payor.add(t); return t; } - public Coverage addLevel(Coding t) { //3 + public Coverage addPayor(Reference t) { //3 if (t == null) return this; - if (this.level == null) - this.level = new ArrayList(); - this.level.add(t); + if (this.payor == null) + this.payor = new ArrayList(); + this.payor.add(t); return this; } /** - * @return The first repetition of repeating field {@link #level}, creating it if it does not already exist + * @return The first repetition of repeating field {@link #payor}, creating it if it does not already exist */ - public Coding getLevelFirstRep() { - if (getLevel().isEmpty()) { - addLevel(); + public Reference getPayorFirstRep() { + if (getPayor().isEmpty()) { + addPayor(); } - return getLevel().get(0); + return getPayor().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getPayorTarget() { + if (this.payorTarget == null) + this.payorTarget = new ArrayList(); + return this.payorTarget; + } + + /** + * @return {@link #group} (A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan.) + */ + public GroupComponent getGroup() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.group"); + else if (Configuration.doAutoCreate()) + this.group = new GroupComponent(); // cc + return this.group; + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan.) + */ + public Coverage setGroup(GroupComponent value) { + this.group = value; + return this; } /** * @return {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value */ - public PositiveIntType getDependentElement() { + public StringType getDependentElement() { if (this.dependent == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Coverage.dependent"); else if (Configuration.doAutoCreate()) - this.dependent = new PositiveIntType(); // bb + this.dependent = new StringType(); // bb return this.dependent; } @@ -726,7 +1688,7 @@ public class Coverage extends DomainResource { /** * @param value {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value */ - public Coverage setDependentElement(PositiveIntType value) { + public Coverage setDependentElement(StringType value) { this.dependent = value; return this; } @@ -734,29 +1696,33 @@ public class Coverage extends DomainResource { /** * @return A unique identifier for a dependent under the coverage. */ - public int getDependent() { - return this.dependent == null || this.dependent.isEmpty() ? 0 : this.dependent.getValue(); + public String getDependent() { + return this.dependent == null ? null : this.dependent.getValue(); } /** * @param value A unique identifier for a dependent under the coverage. */ - public Coverage setDependent(int value) { + public Coverage setDependent(String value) { + if (Utilities.noString(value)) + this.dependent = null; + else { if (this.dependent == null) - this.dependent = new PositiveIntType(); + this.dependent = new StringType(); this.dependent.setValue(value); + } return this; } /** * @return {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value */ - public PositiveIntType getSequenceElement() { + public StringType getSequenceElement() { if (this.sequence == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Coverage.sequence"); else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb + this.sequence = new StringType(); // bb return this.sequence; } @@ -771,7 +1737,7 @@ public class Coverage extends DomainResource { /** * @param value {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value */ - public Coverage setSequenceElement(PositiveIntType value) { + public Coverage setSequenceElement(StringType value) { this.sequence = value; return this; } @@ -779,22 +1745,71 @@ public class Coverage extends DomainResource { /** * @return An optional counter for a particular instance of the identified coverage which increments upon each renewal. */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + public String getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); } /** * @param value An optional counter for a particular instance of the identified coverage which increments upon each renewal. */ - public Coverage setSequence(int value) { + public Coverage setSequence(String value) { + if (Utilities.noString(value)) + this.sequence = null; + else { if (this.sequence == null) - this.sequence = new PositiveIntType(); + this.sequence = new StringType(); this.sequence.setValue(value); + } return this; } /** - * @return {@link #network} (The identifier for a community of providers.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value + * @return {@link #order} (The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care.). This is the underlying object with id, value and extensions. The accessor "getOrder" gives direct access to the value + */ + public PositiveIntType getOrderElement() { + if (this.order == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.order"); + else if (Configuration.doAutoCreate()) + this.order = new PositiveIntType(); // bb + return this.order; + } + + public boolean hasOrderElement() { + return this.order != null && !this.order.isEmpty(); + } + + public boolean hasOrder() { + return this.order != null && !this.order.isEmpty(); + } + + /** + * @param value {@link #order} (The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care.). This is the underlying object with id, value and extensions. The accessor "getOrder" gives direct access to the value + */ + public Coverage setOrderElement(PositiveIntType value) { + this.order = value; + return this; + } + + /** + * @return The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care. + */ + public int getOrder() { + return this.order == null || this.order.isEmpty() ? 0 : this.order.getValue(); + } + + /** + * @param value The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care. + */ + public Coverage setOrder(int value) { + if (this.order == null) + this.order = new PositiveIntType(); + this.order.setValue(value); + return this; + } + + /** + * @return {@link #network} (The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value */ public StringType getNetworkElement() { if (this.network == null) @@ -814,7 +1829,7 @@ public class Coverage extends DomainResource { } /** - * @param value {@link #network} (The identifier for a community of providers.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value + * @param value {@link #network} (The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value */ public Coverage setNetworkElement(StringType value) { this.network = value; @@ -822,14 +1837,14 @@ public class Coverage extends DomainResource { } /** - * @return The identifier for a community of providers. + * @return The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply. */ public String getNetwork() { return this.network == null ? null : this.network.getValue(); } /** - * @param value The identifier for a community of providers. + * @param value The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply. */ public Coverage setNetwork(String value) { if (Utilities.noString(value)) @@ -919,37 +1934,41 @@ public class Coverage extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Certificate number, Personal Health Number or Case ID. May be constructed as the concatination of the Coverage.SubscriberID and the Coverage.dependant.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("issuer", "Reference(Organization|Patient|RelatedPerson)", "The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.", 0, java.lang.Integer.MAX_VALUE, issuer)); - childrenList.add(new Property("isAgreement", "boolean", "A self, or other, payment agreement not an insurance policy.", 0, java.lang.Integer.MAX_VALUE, isAgreement)); + childrenList.add(new Property("type", "CodeableConcept", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("policyHolder", "Reference(Patient|RelatedPerson|Organization)", "The party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer.", 0, java.lang.Integer.MAX_VALUE, policyHolder)); + childrenList.add(new Property("subscriber", "Reference(Patient|RelatedPerson)", "The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.", 0, java.lang.Integer.MAX_VALUE, subscriber)); + childrenList.add(new Property("subscriberId", "string", "The insurer assigned ID for the Subscriber.", 0, java.lang.Integer.MAX_VALUE, subscriberId)); + childrenList.add(new Property("beneficiary", "Reference(Patient)", "The party who benefits from the insurance coverage., the patient when services are provided.", 0, java.lang.Integer.MAX_VALUE, beneficiary)); + childrenList.add(new Property("relationship", "CodeableConcept", "The relationship of beneficiary (patient) to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); childrenList.add(new Property("period", "Period", "Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("type", "Coding", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("planholder", "Reference(Patient|Organization)", "The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.", 0, java.lang.Integer.MAX_VALUE, planholder)); - childrenList.add(new Property("beneficiary", "Reference(Patient)", "The party who benefits from the insurance coverage.", 0, java.lang.Integer.MAX_VALUE, beneficiary)); - childrenList.add(new Property("relationship", "Coding", "The relationship of beneficiary (patient) (subscriber) to the the planholder.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("identifier", "Identifier", "The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("level", "Coding", "A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan.", 0, java.lang.Integer.MAX_VALUE, level)); - childrenList.add(new Property("dependent", "positiveInt", "A unique identifier for a dependent under the coverage.", 0, java.lang.Integer.MAX_VALUE, dependent)); - childrenList.add(new Property("sequence", "positiveInt", "An optional counter for a particular instance of the identified coverage which increments upon each renewal.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("network", "string", "The identifier for a community of providers.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("payor", "Reference(Organization|Patient|RelatedPerson)", "The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. May provide multiple identifiers such as insurance company identifier or business identifier (BIN number).", 0, java.lang.Integer.MAX_VALUE, payor)); + childrenList.add(new Property("group", "", "A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("dependent", "string", "A unique identifier for a dependent under the coverage.", 0, java.lang.Integer.MAX_VALUE, dependent)); + childrenList.add(new Property("sequence", "string", "An optional counter for a particular instance of the identified coverage which increments upon each renewal.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("order", "positiveInt", "The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care.", 0, java.lang.Integer.MAX_VALUE, order)); + childrenList.add(new Property("network", "string", "The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.", 0, java.lang.Integer.MAX_VALUE, network)); childrenList.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // Reference - case -2140761088: /*isAgreement*/ return this.isAgreement == null ? new Base[0] : new Base[] {this.isAgreement}; // BooleanType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1007064597: /*planholder*/ return this.planholder == null ? new Base[0] : new Base[] {this.planholder}; // Reference - case -565102875: /*beneficiary*/ return this.beneficiary == null ? new Base[0] : new Base[] {this.beneficiary}; // Reference - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 102865796: /*level*/ return this.level == null ? new Base[0] : this.level.toArray(new Base[this.level.size()]); // Coding - case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : new Base[] {this.dependent}; // PositiveIntType - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case 2046898558: /*policyHolder*/ return this.policyHolder == null ? new Base[0] : new Base[] {this.policyHolder}; // Reference + case -1219769240: /*subscriber*/ return this.subscriber == null ? new Base[0] : new Base[] {this.subscriber}; // Reference + case 327834531: /*subscriberId*/ return this.subscriberId == null ? new Base[0] : new Base[] {this.subscriberId}; // StringType + case -565102875: /*beneficiary*/ return this.beneficiary == null ? new Base[0] : new Base[] {this.beneficiary}; // Reference + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 106443915: /*payor*/ return this.payor == null ? new Base[0] : this.payor.toArray(new Base[this.payor.size()]); // Reference + case 98629247: /*group*/ return this.group == null ? new Base[0] : new Base[] {this.group}; // GroupComponent + case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : new Base[] {this.dependent}; // StringType + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // StringType + case 106006350: /*order*/ return this.order == null ? new Base[0] : new Base[] {this.order}; // PositiveIntType case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // StringType case -566947566: /*contract*/ return this.contract == null ? new Base[0] : this.contract.toArray(new Base[this.contract.size()]); // Reference default: return super.getProperty(hash, name, checkValid); @@ -960,41 +1979,47 @@ public class Coverage extends DomainResource { @Override public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; case -892481550: // status this.status = new CoverageStatusEnumFactory().fromType(value); // Enumeration break; - case -1179159879: // issuer - this.issuer = castToReference(value); // Reference - break; - case -2140761088: // isAgreement - this.isAgreement = castToBoolean(value); // BooleanType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; - case 1007064597: // planholder - this.planholder = castToReference(value); // Reference + case 2046898558: // policyHolder + this.policyHolder = castToReference(value); // Reference + break; + case -1219769240: // subscriber + this.subscriber = castToReference(value); // Reference + break; + case 327834531: // subscriberId + this.subscriberId = castToString(value); // StringType break; case -565102875: // beneficiary this.beneficiary = castToReference(value); // Reference break; case -261851592: // relationship - this.relationship = castToCoding(value); // Coding + this.relationship = castToCodeableConcept(value); // CodeableConcept break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier + case -991726143: // period + this.period = castToPeriod(value); // Period break; - case 102865796: // level - this.getLevel().add(castToCoding(value)); // Coding + case 106443915: // payor + this.getPayor().add(castToReference(value)); // Reference + break; + case 98629247: // group + this.group = (GroupComponent) value; // GroupComponent break; case -1109226753: // dependent - this.dependent = castToPositiveInt(value); // PositiveIntType + this.dependent = castToString(value); // StringType break; case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType + this.sequence = castToString(value); // StringType + break; + case 106006350: // order + this.order = castToPositiveInt(value); // PositiveIntType break; case 1843485230: // network this.network = castToString(value); // StringType @@ -1009,30 +2034,34 @@ public class Coverage extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("status")) + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("status")) this.status = new CoverageStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("issuer")) - this.issuer = castToReference(value); // Reference - else if (name.equals("isAgreement")) - this.isAgreement = castToBoolean(value); // BooleanType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("planholder")) - this.planholder = castToReference(value); // Reference + this.type = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("policyHolder")) + this.policyHolder = castToReference(value); // Reference + else if (name.equals("subscriber")) + this.subscriber = castToReference(value); // Reference + else if (name.equals("subscriberId")) + this.subscriberId = castToString(value); // StringType else if (name.equals("beneficiary")) this.beneficiary = castToReference(value); // Reference else if (name.equals("relationship")) - this.relationship = castToCoding(value); // Coding - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("level")) - this.getLevel().add(castToCoding(value)); + this.relationship = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("payor")) + this.getPayor().add(castToReference(value)); + else if (name.equals("group")) + this.group = (GroupComponent) value; // GroupComponent else if (name.equals("dependent")) - this.dependent = castToPositiveInt(value); // PositiveIntType + this.dependent = castToString(value); // StringType else if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType + this.sequence = castToString(value); // StringType + else if (name.equals("order")) + this.order = castToPositiveInt(value); // PositiveIntType else if (name.equals("network")) this.network = castToString(value); // StringType else if (name.equals("contract")) @@ -1044,18 +2073,20 @@ public class Coverage extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1179159879: return getIssuer(); // Reference - case -2140761088: throw new FHIRException("Cannot make property isAgreement as it is not a complex type"); // BooleanType - case -991726143: return getPeriod(); // Period - case 3575610: return getType(); // Coding - case 1007064597: return getPlanholder(); // Reference - case -565102875: return getBeneficiary(); // Reference - case -261851592: return getRelationship(); // Coding case -1618432855: return addIdentifier(); // Identifier - case 102865796: return addLevel(); // Coding - case -1109226753: throw new FHIRException("Cannot make property dependent as it is not a complex type"); // PositiveIntType - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 3575610: return getType(); // CodeableConcept + case 2046898558: return getPolicyHolder(); // Reference + case -1219769240: return getSubscriber(); // Reference + case 327834531: throw new FHIRException("Cannot make property subscriberId as it is not a complex type"); // StringType + case -565102875: return getBeneficiary(); // Reference + case -261851592: return getRelationship(); // CodeableConcept + case -991726143: return getPeriod(); // Period + case 106443915: return addPayor(); // Reference + case 98629247: return getGroup(); // GroupComponent + case -1109226753: throw new FHIRException("Cannot make property dependent as it is not a complex type"); // StringType + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // StringType + case 106006350: throw new FHIRException("Cannot make property order as it is not a complex type"); // PositiveIntType case 1843485230: throw new FHIRException("Cannot make property network as it is not a complex type"); // StringType case -566947566: return addContract(); // Reference default: return super.makeProperty(hash, name); @@ -1065,41 +2096,45 @@ public class Coverage extends DomainResource { @Override public Base addChild(String name) throws FHIRException { - if (name.equals("status")) { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type Coverage.status"); } - else if (name.equals("issuer")) { - this.issuer = new Reference(); - return this.issuer; - } - else if (name.equals("isAgreement")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.isAgreement"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } - else if (name.equals("planholder")) { - this.planholder = new Reference(); - return this.planholder; + else if (name.equals("policyHolder")) { + this.policyHolder = new Reference(); + return this.policyHolder; + } + else if (name.equals("subscriber")) { + this.subscriber = new Reference(); + return this.subscriber; + } + else if (name.equals("subscriberId")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.subscriberId"); } else if (name.equals("beneficiary")) { this.beneficiary = new Reference(); return this.beneficiary; } else if (name.equals("relationship")) { - this.relationship = new Coding(); + this.relationship = new CodeableConcept(); return this.relationship; } - else if (name.equals("identifier")) { - return addIdentifier(); + else if (name.equals("period")) { + this.period = new Period(); + return this.period; } - else if (name.equals("level")) { - return addLevel(); + else if (name.equals("payor")) { + return addPayor(); + } + else if (name.equals("group")) { + this.group = new GroupComponent(); + return this.group; } else if (name.equals("dependent")) { throw new FHIRException("Cannot call addChild on a primitive type Coverage.dependent"); @@ -1107,6 +2142,9 @@ public class Coverage extends DomainResource { else if (name.equals("sequence")) { throw new FHIRException("Cannot call addChild on a primitive type Coverage.sequence"); } + else if (name.equals("order")) { + throw new FHIRException("Cannot call addChild on a primitive type Coverage.order"); + } else if (name.equals("network")) { throw new FHIRException("Cannot call addChild on a primitive type Coverage.network"); } @@ -1125,26 +2163,28 @@ public class Coverage extends DomainResource { public Coverage copy() { Coverage dst = new Coverage(); copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.issuer = issuer == null ? null : issuer.copy(); - dst.isAgreement = isAgreement == null ? null : isAgreement.copy(); - dst.period = period == null ? null : period.copy(); - dst.type = type == null ? null : type.copy(); - dst.planholder = planholder == null ? null : planholder.copy(); - dst.beneficiary = beneficiary == null ? null : beneficiary.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); if (identifier != null) { dst.identifier = new ArrayList(); for (Identifier i : identifier) dst.identifier.add(i.copy()); }; - if (level != null) { - dst.level = new ArrayList(); - for (Coding i : level) - dst.level.add(i.copy()); + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.policyHolder = policyHolder == null ? null : policyHolder.copy(); + dst.subscriber = subscriber == null ? null : subscriber.copy(); + dst.subscriberId = subscriberId == null ? null : subscriberId.copy(); + dst.beneficiary = beneficiary == null ? null : beneficiary.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.period = period == null ? null : period.copy(); + if (payor != null) { + dst.payor = new ArrayList(); + for (Reference i : payor) + dst.payor.add(i.copy()); }; + dst.group = group == null ? null : group.copy(); dst.dependent = dependent == null ? null : dependent.copy(); dst.sequence = sequence == null ? null : sequence.copy(); + dst.order = order == null ? null : order.copy(); dst.network = network == null ? null : network.copy(); if (contract != null) { dst.contract = new ArrayList(); @@ -1165,11 +2205,12 @@ public class Coverage extends DomainResource { if (!(other instanceof Coverage)) return false; Coverage o = (Coverage) other; - return compareDeep(status, o.status, true) && compareDeep(issuer, o.issuer, true) && compareDeep(isAgreement, o.isAgreement, true) - && compareDeep(period, o.period, true) && compareDeep(type, o.type, true) && compareDeep(planholder, o.planholder, true) - && compareDeep(beneficiary, o.beneficiary, true) && compareDeep(relationship, o.relationship, true) - && compareDeep(identifier, o.identifier, true) && compareDeep(level, o.level, true) && compareDeep(dependent, o.dependent, true) - && compareDeep(sequence, o.sequence, true) && compareDeep(network, o.network, true) && compareDeep(contract, o.contract, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) + && compareDeep(policyHolder, o.policyHolder, true) && compareDeep(subscriber, o.subscriber, true) + && compareDeep(subscriberId, o.subscriberId, true) && compareDeep(beneficiary, o.beneficiary, true) + && compareDeep(relationship, o.relationship, true) && compareDeep(period, o.period, true) && compareDeep(payor, o.payor, true) + && compareDeep(group, o.group, true) && compareDeep(dependent, o.dependent, true) && compareDeep(sequence, o.sequence, true) + && compareDeep(order, o.order, true) && compareDeep(network, o.network, true) && compareDeep(contract, o.contract, true) ; } @@ -1180,14 +2221,15 @@ public class Coverage extends DomainResource { if (!(other instanceof Coverage)) return false; Coverage o = (Coverage) other; - return compareValues(status, o.status, true) && compareValues(isAgreement, o.isAgreement, true) && compareValues(dependent, o.dependent, true) - && compareValues(sequence, o.sequence, true) && compareValues(network, o.network, true); + return compareValues(status, o.status, true) && compareValues(subscriberId, o.subscriberId, true) && compareValues(dependent, o.dependent, true) + && compareValues(sequence, o.sequence, true) && compareValues(order, o.order, true) && compareValues(network, o.network, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(status, issuer, isAgreement - , period, type, planholder, beneficiary, relationship, identifier, level, dependent - , sequence, network, contract); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type + , policyHolder, subscriber, subscriberId, beneficiary, relationship, period, payor + , group, dependent, sequence, order, network, contract); } @Override @@ -1215,51 +2257,163 @@ public class Coverage extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + /** + * Search parameter: policyholder + *

+ * Description: Reference to the policyholder
+ * Type: reference
+ * Path: Coverage.policyHolder
+ *

+ */ + @SearchParamDefinition(name="policyholder", path="Coverage.policyHolder", description="Reference to the policyholder", type="reference", target={Organization.class, Patient.class, RelatedPerson.class } ) + public static final String SP_POLICYHOLDER = "policyholder"; + /** + * Fluent Client search parameter constant for policyholder + *

+ * Description: Reference to the policyholder
+ * Type: reference
+ * Path: Coverage.policyHolder
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam POLICYHOLDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_POLICYHOLDER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Coverage:policyholder". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_POLICYHOLDER = new ca.uhn.fhir.model.api.Include("Coverage:policyholder").toLocked(); + + /** + * Search parameter: subgroup + *

+ * Description: Sub-group identifier
+ * Type: string
+ * Path: Coverage.group.subGroup
+ *

+ */ + @SearchParamDefinition(name="subgroup", path="Coverage.group.subGroup", description="Sub-group identifier", type="string" ) + public static final String SP_SUBGROUP = "subgroup"; + /** + * Fluent Client search parameter constant for subgroup + *

+ * Description: Sub-group identifier
+ * Type: string
+ * Path: Coverage.group.subGroup
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam SUBGROUP = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SUBGROUP); + + /** + * Search parameter: subscriber + *

+ * Description: Reference to the subscriber
+ * Type: reference
+ * Path: Coverage.subscriber
+ *

+ */ + @SearchParamDefinition(name="subscriber", path="Coverage.subscriber", description="Reference to the subscriber", type="reference", target={Patient.class, RelatedPerson.class } ) + public static final String SP_SUBSCRIBER = "subscriber"; + /** + * Fluent Client search parameter constant for subscriber + *

+ * Description: Reference to the subscriber
+ * Type: reference
+ * Path: Coverage.subscriber
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBSCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBSCRIBER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Coverage:subscriber". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBSCRIBER = new ca.uhn.fhir.model.api.Include("Coverage:subscriber").toLocked(); + + /** + * Search parameter: subplan + *

+ * Description: Sub-plan identifier
+ * Type: string
+ * Path: Coverage.group.subPlan
+ *

+ */ + @SearchParamDefinition(name="subplan", path="Coverage.group.subPlan", description="Sub-plan identifier", type="string" ) + public static final String SP_SUBPLAN = "subplan"; + /** + * Fluent Client search parameter constant for subplan + *

+ * Description: Sub-plan identifier
+ * Type: string
+ * Path: Coverage.group.subPlan
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam SUBPLAN = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SUBPLAN); + + /** + * Search parameter: type + *

+ * Description: The kind of coverage (health plan, auto, Workers Compensation)
+ * Type: token
+ * Path: Coverage.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage (health plan, auto, Workers Compensation)", type="token" ) + public static final String SP_TYPE = "type"; + /** + * Fluent Client search parameter constant for type + *

+ * Description: The kind of coverage (health plan, auto, Workers Compensation)
+ * Type: token
+ * Path: Coverage.type
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + /** * Search parameter: sequence *

* Description: Sequence number
- * Type: number
+ * Type: string
* Path: Coverage.sequence
*

*/ - @SearchParamDefinition(name="sequence", path="Coverage.sequence", description="Sequence number", type="number" ) + @SearchParamDefinition(name="sequence", path="Coverage.sequence", description="Sequence number", type="string" ) public static final String SP_SEQUENCE = "sequence"; /** * Fluent Client search parameter constant for sequence *

* Description: Sequence number
- * Type: number
+ * Type: string
* Path: Coverage.sequence
*

*/ - public static final ca.uhn.fhir.rest.gclient.NumberClientParam SEQUENCE = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_SEQUENCE); + public static final ca.uhn.fhir.rest.gclient.StringClientParam SEQUENCE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SEQUENCE); /** - * Search parameter: planholder + * Search parameter: payor *

- * Description: Reference to the planholder
+ * Description: The identity of the insurer or party paying for services
* Type: reference
- * Path: Coverage.planholder
+ * Path: Coverage.payor
*

*/ - @SearchParamDefinition(name="planholder", path="Coverage.planholder", description="Reference to the planholder", type="reference", target={Organization.class, Patient.class } ) - public static final String SP_PLANHOLDER = "planholder"; + @SearchParamDefinition(name="payor", path="Coverage.payor", description="The identity of the insurer or party paying for services", type="reference", target={Organization.class, Patient.class, RelatedPerson.class } ) + public static final String SP_PAYOR = "payor"; /** - * Fluent Client search parameter constant for planholder + * Fluent Client search parameter constant for payor *

- * Description: Reference to the planholder
+ * Description: The identity of the insurer or party paying for services
* Type: reference
- * Path: Coverage.planholder
+ * Path: Coverage.payor
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PLANHOLDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PLANHOLDER); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PAYOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PAYOR); /** * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Coverage:planholder". + * the path value of "Coverage:payor". */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PLANHOLDER = new ca.uhn.fhir.model.api.Include("Coverage:planholder").toLocked(); + public static final ca.uhn.fhir.model.api.Include INCLUDE_PAYOR = new ca.uhn.fhir.model.api.Include("Coverage:payor").toLocked(); /** * Search parameter: beneficiary @@ -1288,70 +2442,104 @@ public class Coverage extends DomainResource { public static final ca.uhn.fhir.model.api.Include INCLUDE_BENEFICIARY = new ca.uhn.fhir.model.api.Include("Coverage:beneficiary").toLocked(); /** - * Search parameter: type + * Search parameter: subclass *

- * Description: The kind of coverage (health plan, auto, Workers Compensation)
- * Type: token
- * Path: Coverage.type
+ * Description: Sub-class identifier
+ * Type: string
+ * Path: Coverage.group.subClass
*

*/ - @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage (health plan, auto, Workers Compensation)", type="token" ) - public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="subclass", path="Coverage.group.subClass", description="Sub-class identifier", type="string" ) + public static final String SP_SUBCLASS = "subclass"; /** - * Fluent Client search parameter constant for type + * Fluent Client search parameter constant for subclass *

- * Description: The kind of coverage (health plan, auto, Workers Compensation)
- * Type: token
- * Path: Coverage.type
+ * Description: Sub-class identifier
+ * Type: string
+ * Path: Coverage.group.subClass
*

*/ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); + public static final ca.uhn.fhir.rest.gclient.StringClientParam SUBCLASS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SUBCLASS); + + /** + * Search parameter: plan + *

+ * Description: A plan or policy identifier
+ * Type: string
+ * Path: Coverage.group.plan
+ *

+ */ + @SearchParamDefinition(name="plan", path="Coverage.group.plan", description="A plan or policy identifier", type="string" ) + public static final String SP_PLAN = "plan"; + /** + * Fluent Client search parameter constant for plan + *

+ * Description: A plan or policy identifier
+ * Type: string
+ * Path: Coverage.group.plan
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PLAN = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PLAN); + + /** + * Search parameter: class + *

+ * Description: Class identifier
+ * Type: string
+ * Path: Coverage.group.class
+ *

+ */ + @SearchParamDefinition(name="class", path="Coverage.group.class", description="Class identifier", type="string" ) + public static final String SP_CLASS = "class"; + /** + * Fluent Client search parameter constant for class + *

+ * Description: Class identifier
+ * Type: string
+ * Path: Coverage.group.class
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam CLASS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_CLASS); /** * Search parameter: dependent *

* Description: Dependent number
- * Type: number
+ * Type: string
* Path: Coverage.dependent
*

*/ - @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="number" ) + @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="string" ) public static final String SP_DEPENDENT = "dependent"; /** * Fluent Client search parameter constant for dependent *

* Description: Dependent number
- * Type: number
+ * Type: string
* Path: Coverage.dependent
*

*/ - public static final ca.uhn.fhir.rest.gclient.NumberClientParam DEPENDENT = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_DEPENDENT); + public static final ca.uhn.fhir.rest.gclient.StringClientParam DEPENDENT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DEPENDENT); /** - * Search parameter: issuer + * Search parameter: group *

- * Description: The identity of the insurer
- * Type: reference
- * Path: Coverage.issuer
+ * Description: Group identifier
+ * Type: string
+ * Path: Coverage.group.group
*

*/ - @SearchParamDefinition(name="issuer", path="Coverage.issuer", description="The identity of the insurer", type="reference", target={Organization.class, Patient.class, RelatedPerson.class } ) - public static final String SP_ISSUER = "issuer"; + @SearchParamDefinition(name="group", path="Coverage.group.group", description="Group identifier", type="string" ) + public static final String SP_GROUP = "group"; /** - * Fluent Client search parameter constant for issuer + * Fluent Client search parameter constant for group *

- * Description: The identity of the insurer
- * Type: reference
- * Path: Coverage.issuer
+ * Description: Group identifier
+ * Type: string
+ * Path: Coverage.group.group
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ISSUER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ISSUER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Coverage:issuer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ISSUER = new ca.uhn.fhir.model.api.Include("Coverage:issuer").toLocked(); + public static final ca.uhn.fhir.rest.gclient.StringClientParam GROUP = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_GROUP); } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DataElement.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DataElement.java index 14ba99d44ba..4afb26504ed 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DataElement.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DataElement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DataRequirement.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DataRequirement.java index f8fea7ec11a..2f1a05974fd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DataRequirement.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DataRequirement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -773,14 +773,9 @@ public class DataRequirement extends Type implements ICompositeType { /** * The profile of the required data, specified as the uri of the profile definition. */ - @Child(name = "profile", type = {StructureDefinition.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "profile", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="The profile of the required data", formalDefinition="The profile of the required data, specified as the uri of the profile definition." ) - protected List profile; - /** - * The actual objects that are the target of the reference (The profile of the required data, specified as the uri of the profile definition.) - */ - protected List profileTarget; - + protected List profile; /** * Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. @@ -803,7 +798,7 @@ public class DataRequirement extends Type implements ICompositeType { @Description(shortDefinition="Date filters for the data", formalDefinition="Date filters specify additional constraints on the data in terms of the applicable date range for specific elements." ) protected List dateFilter; - private static final long serialVersionUID = -953492266L; + private static final long serialVersionUID = 274786645L; /** * Constructor @@ -868,16 +863,16 @@ public class DataRequirement extends Type implements ICompositeType { /** * @return {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) */ - public List getProfile() { + public List getProfile() { if (this.profile == null) - this.profile = new ArrayList(); + this.profile = new ArrayList(); return this.profile; } /** * @return Returns a reference to this for easy method chaining */ - public DataRequirement setProfile(List theProfile) { + public DataRequirement setProfile(List theProfile) { this.profile = theProfile; return this; } @@ -885,59 +880,45 @@ public class DataRequirement extends Type implements ICompositeType { public boolean hasProfile() { if (this.profile == null) return false; - for (Reference item : this.profile) + for (UriType item : this.profile) if (!item.isEmpty()) return true; return false; } - public Reference addProfile() { //3 - Reference t = new Reference(); + /** + * @return {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) + */ + public UriType addProfileElement() {//2 + UriType t = new UriType(); if (this.profile == null) - this.profile = new ArrayList(); + this.profile = new ArrayList(); this.profile.add(t); return t; } - public DataRequirement addProfile(Reference t) { //3 - if (t == null) - return this; + /** + * @param value {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) + */ + public DataRequirement addProfile(String value) { //1 + UriType t = new UriType(); + t.setValue(value); if (this.profile == null) - this.profile = new ArrayList(); + this.profile = new ArrayList(); this.profile.add(t); return this; } /** - * @return The first repetition of repeating field {@link #profile}, creating it if it does not already exist + * @param value {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) */ - public Reference getProfileFirstRep() { - if (getProfile().isEmpty()) { - addProfile(); - } - return getProfile().get(0); - } - - /** - * @deprecated Use Reference#setResource(IBaseResource) instead - */ - @Deprecated - public List getProfileTarget() { - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - return this.profileTarget; - } - - /** - * @deprecated Use Reference#setResource(IBaseResource) instead - */ - @Deprecated - public StructureDefinition addProfileTarget() { - StructureDefinition r = new StructureDefinition(); - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - this.profileTarget.add(r); - return r; + public boolean hasProfile(String value) { + if (this.profile == null) + return false; + for (UriType v : this.profile) + if (v.equals(value)) // uri + return true; + return false; } /** @@ -1110,7 +1091,7 @@ public class DataRequirement extends Type implements ICompositeType { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("type", "code", "The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "The profile of the required data, specified as the uri of the profile definition.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("profile", "uri", "The profile of the required data, specified as the uri of the profile definition.", 0, java.lang.Integer.MAX_VALUE, profile)); childrenList.add(new Property("mustSupport", "string", "Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); childrenList.add(new Property("codeFilter", "", "Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data.", 0, java.lang.Integer.MAX_VALUE, codeFilter)); childrenList.add(new Property("dateFilter", "", "Date filters specify additional constraints on the data in terms of the applicable date range for specific elements.", 0, java.lang.Integer.MAX_VALUE, dateFilter)); @@ -1120,7 +1101,7 @@ public class DataRequirement extends Type implements ICompositeType { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // UriType case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : this.mustSupport.toArray(new Base[this.mustSupport.size()]); // StringType case -1303674939: /*codeFilter*/ return this.codeFilter == null ? new Base[0] : this.codeFilter.toArray(new Base[this.codeFilter.size()]); // DataRequirementCodeFilterComponent case 149531846: /*dateFilter*/ return this.dateFilter == null ? new Base[0] : this.dateFilter.toArray(new Base[this.dateFilter.size()]); // DataRequirementDateFilterComponent @@ -1136,7 +1117,7 @@ public class DataRequirement extends Type implements ICompositeType { this.type = castToCode(value); // CodeType break; case -309425751: // profile - this.getProfile().add(castToReference(value)); // Reference + this.getProfile().add(castToUri(value)); // UriType break; case -1402857082: // mustSupport this.getMustSupport().add(castToString(value)); // StringType @@ -1157,7 +1138,7 @@ public class DataRequirement extends Type implements ICompositeType { if (name.equals("type")) this.type = castToCode(value); // CodeType else if (name.equals("profile")) - this.getProfile().add(castToReference(value)); + this.getProfile().add(castToUri(value)); else if (name.equals("mustSupport")) this.getMustSupport().add(castToString(value)); else if (name.equals("codeFilter")) @@ -1172,7 +1153,7 @@ public class DataRequirement extends Type implements ICompositeType { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -309425751: return addProfile(); // Reference + case -309425751: throw new FHIRException("Cannot make property profile as it is not a complex type"); // UriType case -1402857082: throw new FHIRException("Cannot make property mustSupport as it is not a complex type"); // StringType case -1303674939: return addCodeFilter(); // DataRequirementCodeFilterComponent case 149531846: return addDateFilter(); // DataRequirementDateFilterComponent @@ -1187,7 +1168,7 @@ public class DataRequirement extends Type implements ICompositeType { throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.type"); } else if (name.equals("profile")) { - return addProfile(); + throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.profile"); } else if (name.equals("mustSupport")) { throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.mustSupport"); @@ -1212,8 +1193,8 @@ public class DataRequirement extends Type implements ICompositeType { copyValues(dst); dst.type = type == null ? null : type.copy(); if (profile != null) { - dst.profile = new ArrayList(); - for (Reference i : profile) + dst.profile = new ArrayList(); + for (UriType i : profile) dst.profile.add(i.copy()); }; if (mustSupport != null) { @@ -1256,7 +1237,8 @@ public class DataRequirement extends Type implements ICompositeType { if (!(other instanceof DataRequirement)) return false; DataRequirement o = (DataRequirement) other; - return compareValues(type, o.type, true) && compareValues(mustSupport, o.mustSupport, true); + return compareValues(type, o.type, true) && compareValues(profile, o.profile, true) && compareValues(mustSupport, o.mustSupport, true) + ; } public boolean isEmpty() { diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DetectedIssue.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DetectedIssue.java index e820185ebcd..3ab17a85e7f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DetectedIssue.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DetectedIssue.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Device.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Device.java index 13f7b8e6916..8e38c2bd91f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Device.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Device.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -179,7 +179,7 @@ public class Device extends DomainResource { /** * Code or identifier to identify a kind of device. */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="What kind of device this is", formalDefinition="Code or identifier to identify a kind of device." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-kind") protected CodeableConcept type; @@ -292,14 +292,6 @@ public class Device extends DomainResource { super(); } - /** - * Constructor - */ - public Device(CodeableConcept type) { - super(); - this.type = type; - } - /** * @return {@link #identifier} (Unique instance identifiers assigned to a device by manufacturers other organizations or owners.) */ diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceComponent.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceComponent.java index 99cd2bae68f..ea600ada653 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceComponent.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceComponent.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceMetric.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceMetric.java index 941eb5f916b..d31396b4532 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceMetric.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceMetric.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceUseRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceUseRequest.java index 048506f1f1f..0db833d7cc8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceUseRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceUseRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -50,29 +50,33 @@ public class DeviceUseRequest extends DomainResource { public enum DeviceUseRequestStatus { /** - * The request is in preliminary form prior to being sent. + * The request has been created but is not yet complete or ready for action */ DRAFT, /** - * The request is complete and is ready for fulfillment. + * The request is ready to be acted upon */ ACTIVE, /** - * The request has been held by originating system/user request. + * The authorization/request to act has been temporarily withdrawn but is expected to resume in the future */ SUSPENDED, /** - * The work has been completed, the report(s) released, and no further work is planned. + * The authorization/request to act has been terminated prior to the full completion of the intended actions. No further activity should occur. + */ + CANCELLED, + /** + * Activity against the request has been sufficiently completed to the satisfaction of the requester */ COMPLETED, /** - * The request was entered in error and voided. + * This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be "cancelled" rather than "entered-in-error".) */ ENTEREDINERROR, /** - * The request has been withdrawn. + * The authoring system does not know which of the status values currently applies for this request */ - CANCELLED, + UNKNOWN, /** * added to help the parsers with the generic types */ @@ -86,12 +90,14 @@ public class DeviceUseRequest extends DomainResource { return ACTIVE; if ("suspended".equals(codeString)) return SUSPENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; if ("completed".equals(codeString)) return COMPLETED; if ("entered-in-error".equals(codeString)) return ENTEREDINERROR; - if ("cancelled".equals(codeString)) - return CANCELLED; + if ("unknown".equals(codeString)) + return UNKNOWN; if (Configuration.isAcceptInvalidEnums()) return null; else @@ -102,9 +108,10 @@ public class DeviceUseRequest extends DomainResource { case DRAFT: return "draft"; case ACTIVE: return "active"; case SUSPENDED: return "suspended"; + case CANCELLED: return "cancelled"; case COMPLETED: return "completed"; case ENTEREDINERROR: return "entered-in-error"; - case CANCELLED: return "cancelled"; + case UNKNOWN: return "unknown"; default: return "?"; } } @@ -113,20 +120,22 @@ public class DeviceUseRequest extends DomainResource { case DRAFT: return "http://hl7.org/fhir/request-status"; case ACTIVE: return "http://hl7.org/fhir/request-status"; case SUSPENDED: return "http://hl7.org/fhir/request-status"; + case CANCELLED: return "http://hl7.org/fhir/request-status"; case COMPLETED: return "http://hl7.org/fhir/request-status"; case ENTEREDINERROR: return "http://hl7.org/fhir/request-status"; - case CANCELLED: return "http://hl7.org/fhir/request-status"; + case UNKNOWN: return "http://hl7.org/fhir/request-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case DRAFT: return "The request is in preliminary form prior to being sent."; - case ACTIVE: return "The request is complete and is ready for fulfillment."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case COMPLETED: return "The work has been completed, the report(s) released, and no further work is planned."; - case ENTEREDINERROR: return "The request was entered in error and voided."; - case CANCELLED: return "The request has been withdrawn."; + case DRAFT: return "The request has been created but is not yet complete or ready for action"; + case ACTIVE: return "The request is ready to be acted upon"; + case SUSPENDED: return "The authorization/request to act has been temporarily withdrawn but is expected to resume in the future"; + case CANCELLED: return "The authorization/request to act has been terminated prior to the full completion of the intended actions. No further activity should occur."; + case COMPLETED: return "Activity against the request has been sufficiently completed to the satisfaction of the requester"; + case ENTEREDINERROR: return "This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".)"; + case UNKNOWN: return "The authoring system does not know which of the status values currently applies for this request"; default: return "?"; } } @@ -135,9 +144,10 @@ public class DeviceUseRequest extends DomainResource { case DRAFT: return "Draft"; case ACTIVE: return "Active"; case SUSPENDED: return "Suspended"; + case CANCELLED: return "Cancelled"; case COMPLETED: return "Completed"; case ENTEREDINERROR: return "Entered in Error"; - case CANCELLED: return "Cancelled"; + case UNKNOWN: return "Unknown"; default: return "?"; } } @@ -154,12 +164,14 @@ public class DeviceUseRequest extends DomainResource { return DeviceUseRequestStatus.ACTIVE; if ("suspended".equals(codeString)) return DeviceUseRequestStatus.SUSPENDED; + if ("cancelled".equals(codeString)) + return DeviceUseRequestStatus.CANCELLED; if ("completed".equals(codeString)) return DeviceUseRequestStatus.COMPLETED; if ("entered-in-error".equals(codeString)) return DeviceUseRequestStatus.ENTEREDINERROR; - if ("cancelled".equals(codeString)) - return DeviceUseRequestStatus.CANCELLED; + if ("unknown".equals(codeString)) + return DeviceUseRequestStatus.UNKNOWN; throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); } public Enumeration fromType(Base code) throws FHIRException { @@ -174,12 +186,14 @@ public class DeviceUseRequest extends DomainResource { return new Enumeration(this, DeviceUseRequestStatus.ACTIVE); if ("suspended".equals(codeString)) return new Enumeration(this, DeviceUseRequestStatus.SUSPENDED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.CANCELLED); if ("completed".equals(codeString)) return new Enumeration(this, DeviceUseRequestStatus.COMPLETED); if ("entered-in-error".equals(codeString)) return new Enumeration(this, DeviceUseRequestStatus.ENTEREDINERROR); - if ("cancelled".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.CANCELLED); + if ("unknown".equals(codeString)) + return new Enumeration(this, DeviceUseRequestStatus.UNKNOWN); throw new FHIRException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); } public String toCode(DeviceUseRequestStatus code) { @@ -189,12 +203,14 @@ public class DeviceUseRequest extends DomainResource { return "active"; if (code == DeviceUseRequestStatus.SUSPENDED) return "suspended"; + if (code == DeviceUseRequestStatus.CANCELLED) + return "cancelled"; if (code == DeviceUseRequestStatus.COMPLETED) return "completed"; if (code == DeviceUseRequestStatus.ENTEREDINERROR) return "entered-in-error"; - if (code == DeviceUseRequestStatus.CANCELLED) - return "cancelled"; + if (code == DeviceUseRequestStatus.UNKNOWN) + return "unknown"; return "?"; } public String toSystem(DeviceUseRequestStatus code) { diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceUseStatement.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceUseStatement.java index 1033e11c4d2..06bfba2f22c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceUseStatement.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DeviceUseStatement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -51,9 +51,10 @@ public class DeviceUseStatement extends DomainResource { /** * Indicates the site on the subject's body where the device was used ( i.e. the target site). */ - @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Child(name = "bodySite", type = {CodeableConcept.class}, order=0, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device was used ( i.e. the target site)." ) - protected Type bodySite; + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site") + protected CodeableConcept bodySite; /** * The time period over which the device was used. @@ -121,7 +122,7 @@ public class DeviceUseStatement extends DomainResource { @Description(shortDefinition="How often the device was used", formalDefinition="How often the device was used." ) protected Type timing; - private static final long serialVersionUID = -1668571635L; + private static final long serialVersionUID = -456851478L; /** * Constructor @@ -142,36 +143,15 @@ public class DeviceUseStatement extends DomainResource { /** * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) */ - public Type getBodySite() { + public CodeableConcept getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new CodeableConcept(); // cc return this.bodySite; } - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public CodeableConcept getBodySiteCodeableConcept() throws FHIRException { - if (!(this.bodySite instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (CodeableConcept) this.bodySite; - } - - public boolean hasBodySiteCodeableConcept() { - return this.bodySite instanceof CodeableConcept; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public Reference getBodySiteReference() throws FHIRException { - if (!(this.bodySite instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (Reference) this.bodySite; - } - - public boolean hasBodySiteReference() { - return this.bodySite instanceof Reference; - } - public boolean hasBodySite() { return this.bodySite != null && !this.bodySite.isEmpty(); } @@ -179,7 +159,7 @@ public class DeviceUseStatement extends DomainResource { /** * @param value {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) */ - public DeviceUseStatement setBodySite(Type value) { + public DeviceUseStatement setBodySite(CodeableConcept value) { this.bodySite = value; return this; } @@ -572,7 +552,7 @@ public class DeviceUseStatement extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device was used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the device was used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); childrenList.add(new Property("whenUsed", "Period", "The time period over which the device was used.", 0, java.lang.Integer.MAX_VALUE, whenUsed)); childrenList.add(new Property("device", "Reference(Device)", "The details of the device used.", 0, java.lang.Integer.MAX_VALUE, device)); childrenList.add(new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier)); @@ -586,7 +566,7 @@ public class DeviceUseStatement extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Type + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept case 2042879511: /*whenUsed*/ return this.whenUsed == null ? new Base[0] : new Base[] {this.whenUsed}; // Period case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier @@ -604,7 +584,7 @@ public class DeviceUseStatement extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 1702620169: // bodySite - this.bodySite = castToType(value); // Type + this.bodySite = castToCodeableConcept(value); // CodeableConcept break; case 2042879511: // whenUsed this.whenUsed = castToPeriod(value); // Period @@ -637,8 +617,8 @@ public class DeviceUseStatement extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("bodySite[x]")) - this.bodySite = castToType(value); // Type + if (name.equals("bodySite")) + this.bodySite = castToCodeableConcept(value); // CodeableConcept else if (name.equals("whenUsed")) this.whenUsed = castToPeriod(value); // Period else if (name.equals("device")) @@ -662,7 +642,7 @@ public class DeviceUseStatement extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case -806219817: return getBodySite(); // Type + case 1702620169: return getBodySite(); // CodeableConcept case 2042879511: return getWhenUsed(); // Period case -1335157162: return getDevice(); // Reference case -1618432855: return addIdentifier(); // Identifier @@ -678,14 +658,10 @@ public class DeviceUseStatement extends DomainResource { @Override public Base addChild(String name) throws FHIRException { - if (name.equals("bodySiteCodeableConcept")) { + if (name.equals("bodySite")) { this.bodySite = new CodeableConcept(); return this.bodySite; } - else if (name.equals("bodySiteReference")) { - this.bodySite = new Reference(); - return this.bodySite; - } else if (name.equals("whenUsed")) { this.whenUsed = new Period(); return this.whenUsed; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DiagnosticReport.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DiagnosticReport.java index 2e1a3eb3247..c0ba01a94df 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DiagnosticReport.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DiagnosticReport.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -485,7 +485,7 @@ public class DiagnosticReport extends DomainResource { /** * The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources. */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=4, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="The subject of the report, usually, but not always, the patient", formalDefinition="The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources." ) protected Reference subject; @@ -509,21 +509,21 @@ public class DiagnosticReport extends DomainResource { /** * The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. */ - @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Clinically Relevant time/time-period for report", formalDefinition="The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself." ) protected Type effective; /** * The date and time that this version of the report was released from the source diagnostic service. */ - @Child(name = "issued", type = {InstantType.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Child(name = "issued", type = {InstantType.class}, order=7, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="DateTime this version was released", formalDefinition="The date and time that this version of the report was released from the source diagnostic service." ) protected InstantType issued; /** * The diagnostic service that is responsible for issuing the report. */ - @Child(name = "performer", type = {Practitioner.class, Organization.class}, order=8, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "performer", type = {Practitioner.class, Organization.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." ) protected List performer; /** @@ -621,13 +621,10 @@ public class DiagnosticReport extends DomainResource { /** * Constructor */ - public DiagnosticReport(Enumeration status, CodeableConcept code, Reference subject, Type effective, InstantType issued) { + public DiagnosticReport(Enumeration status, CodeableConcept code) { super(); this.status = status; this.code = code; - this.subject = subject; - this.effective = effective; - this.issued = issued; } /** @@ -943,9 +940,13 @@ public class DiagnosticReport extends DomainResource { * @param value The date and time that this version of the report was released from the source diagnostic service. */ public DiagnosticReport setIssued(Date value) { + if (value == null) + this.issued = null; + else { if (this.issued == null) this.issued = new InstantType(); this.issued.setValue(value); + } return this; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DiagnosticRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DiagnosticRequest.java index 791607f0709..227931c10a0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DiagnosticRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DiagnosticRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -50,29 +50,33 @@ public class DiagnosticRequest extends DomainResource { public enum DiagnosticRequestStatus { /** - * The request is in preliminary form prior to being sent. + * The request has been created but is not yet complete or ready for action */ DRAFT, /** - * The request is complete and is ready for fulfillment. + * The request is ready to be acted upon */ ACTIVE, /** - * The request has been held by originating system/user request. + * The authorization/request to act has been temporarily withdrawn but is expected to resume in the future */ SUSPENDED, /** - * The work has been completed, the report(s) released, and no further work is planned. + * The authorization/request to act has been terminated prior to the full completion of the intended actions. No further activity should occur. + */ + CANCELLED, + /** + * Activity against the request has been sufficiently completed to the satisfaction of the requester */ COMPLETED, /** - * The request was entered in error and voided. + * This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be "cancelled" rather than "entered-in-error".) */ ENTEREDINERROR, /** - * The request has been withdrawn. + * The authoring system does not know which of the status values currently applies for this request */ - CANCELLED, + UNKNOWN, /** * added to help the parsers with the generic types */ @@ -86,12 +90,14 @@ public class DiagnosticRequest extends DomainResource { return ACTIVE; if ("suspended".equals(codeString)) return SUSPENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; if ("completed".equals(codeString)) return COMPLETED; if ("entered-in-error".equals(codeString)) return ENTEREDINERROR; - if ("cancelled".equals(codeString)) - return CANCELLED; + if ("unknown".equals(codeString)) + return UNKNOWN; if (Configuration.isAcceptInvalidEnums()) return null; else @@ -102,9 +108,10 @@ public class DiagnosticRequest extends DomainResource { case DRAFT: return "draft"; case ACTIVE: return "active"; case SUSPENDED: return "suspended"; + case CANCELLED: return "cancelled"; case COMPLETED: return "completed"; case ENTEREDINERROR: return "entered-in-error"; - case CANCELLED: return "cancelled"; + case UNKNOWN: return "unknown"; default: return "?"; } } @@ -113,20 +120,22 @@ public class DiagnosticRequest extends DomainResource { case DRAFT: return "http://hl7.org/fhir/request-status"; case ACTIVE: return "http://hl7.org/fhir/request-status"; case SUSPENDED: return "http://hl7.org/fhir/request-status"; + case CANCELLED: return "http://hl7.org/fhir/request-status"; case COMPLETED: return "http://hl7.org/fhir/request-status"; case ENTEREDINERROR: return "http://hl7.org/fhir/request-status"; - case CANCELLED: return "http://hl7.org/fhir/request-status"; + case UNKNOWN: return "http://hl7.org/fhir/request-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case DRAFT: return "The request is in preliminary form prior to being sent."; - case ACTIVE: return "The request is complete and is ready for fulfillment."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case COMPLETED: return "The work has been completed, the report(s) released, and no further work is planned."; - case ENTEREDINERROR: return "The request was entered in error and voided."; - case CANCELLED: return "The request has been withdrawn."; + case DRAFT: return "The request has been created but is not yet complete or ready for action"; + case ACTIVE: return "The request is ready to be acted upon"; + case SUSPENDED: return "The authorization/request to act has been temporarily withdrawn but is expected to resume in the future"; + case CANCELLED: return "The authorization/request to act has been terminated prior to the full completion of the intended actions. No further activity should occur."; + case COMPLETED: return "Activity against the request has been sufficiently completed to the satisfaction of the requester"; + case ENTEREDINERROR: return "This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".)"; + case UNKNOWN: return "The authoring system does not know which of the status values currently applies for this request"; default: return "?"; } } @@ -135,9 +144,10 @@ public class DiagnosticRequest extends DomainResource { case DRAFT: return "Draft"; case ACTIVE: return "Active"; case SUSPENDED: return "Suspended"; + case CANCELLED: return "Cancelled"; case COMPLETED: return "Completed"; case ENTEREDINERROR: return "Entered in Error"; - case CANCELLED: return "Cancelled"; + case UNKNOWN: return "Unknown"; default: return "?"; } } @@ -154,12 +164,14 @@ public class DiagnosticRequest extends DomainResource { return DiagnosticRequestStatus.ACTIVE; if ("suspended".equals(codeString)) return DiagnosticRequestStatus.SUSPENDED; + if ("cancelled".equals(codeString)) + return DiagnosticRequestStatus.CANCELLED; if ("completed".equals(codeString)) return DiagnosticRequestStatus.COMPLETED; if ("entered-in-error".equals(codeString)) return DiagnosticRequestStatus.ENTEREDINERROR; - if ("cancelled".equals(codeString)) - return DiagnosticRequestStatus.CANCELLED; + if ("unknown".equals(codeString)) + return DiagnosticRequestStatus.UNKNOWN; throw new IllegalArgumentException("Unknown DiagnosticRequestStatus code '"+codeString+"'"); } public Enumeration fromType(Base code) throws FHIRException { @@ -174,12 +186,14 @@ public class DiagnosticRequest extends DomainResource { return new Enumeration(this, DiagnosticRequestStatus.ACTIVE); if ("suspended".equals(codeString)) return new Enumeration(this, DiagnosticRequestStatus.SUSPENDED); + if ("cancelled".equals(codeString)) + return new Enumeration(this, DiagnosticRequestStatus.CANCELLED); if ("completed".equals(codeString)) return new Enumeration(this, DiagnosticRequestStatus.COMPLETED); if ("entered-in-error".equals(codeString)) return new Enumeration(this, DiagnosticRequestStatus.ENTEREDINERROR); - if ("cancelled".equals(codeString)) - return new Enumeration(this, DiagnosticRequestStatus.CANCELLED); + if ("unknown".equals(codeString)) + return new Enumeration(this, DiagnosticRequestStatus.UNKNOWN); throw new FHIRException("Unknown DiagnosticRequestStatus code '"+codeString+"'"); } public String toCode(DiagnosticRequestStatus code) { @@ -189,12 +203,14 @@ public class DiagnosticRequest extends DomainResource { return "active"; if (code == DiagnosticRequestStatus.SUSPENDED) return "suspended"; + if (code == DiagnosticRequestStatus.CANCELLED) + return "cancelled"; if (code == DiagnosticRequestStatus.COMPLETED) return "completed"; if (code == DiagnosticRequestStatus.ENTEREDINERROR) return "entered-in-error"; - if (code == DiagnosticRequestStatus.CANCELLED) - return "cancelled"; + if (code == DiagnosticRequestStatus.UNKNOWN) + return "unknown"; return "?"; } public String toSystem(DiagnosticRequestStatus code) { @@ -202,6 +218,316 @@ public class DiagnosticRequest extends DomainResource { } } + public enum DiagnosticRequestIntent { + /** + * The request is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act + */ + PROPOSAL, + /** + * The request represents an intension to ensure something occurs without providing an authorization for others to act + */ + PLAN, + /** + * The request represents a request/demand and authorization for action + */ + ORDER, + /** + * The request represents an original authorization for action + */ + ORIGINALORDER, + /** + * The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization + */ + REFLEXORDER, + /** + * The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order + */ + FILLERORDER, + /** + * An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence. E.g. The administration of a single dose of a drug. + */ + INSTANCEORDER, + /** + * The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests. + +Refer to [[[RequestGroup]]] for additional information on how this status is used + */ + OPTION, + /** + * added to help the parsers with the generic types + */ + NULL; + public static DiagnosticRequestIntent fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return PROPOSAL; + if ("plan".equals(codeString)) + return PLAN; + if ("order".equals(codeString)) + return ORDER; + if ("original-order".equals(codeString)) + return ORIGINALORDER; + if ("reflex-order".equals(codeString)) + return REFLEXORDER; + if ("filler-order".equals(codeString)) + return FILLERORDER; + if ("instance-order".equals(codeString)) + return INSTANCEORDER; + if ("option".equals(codeString)) + return OPTION; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown DiagnosticRequestIntent code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSAL: return "proposal"; + case PLAN: return "plan"; + case ORDER: return "order"; + case ORIGINALORDER: return "original-order"; + case REFLEXORDER: return "reflex-order"; + case FILLERORDER: return "filler-order"; + case INSTANCEORDER: return "instance-order"; + case OPTION: return "option"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSAL: return "http://hl7.org/fhir/request-intent"; + case PLAN: return "http://hl7.org/fhir/request-intent"; + case ORDER: return "http://hl7.org/fhir/request-intent"; + case ORIGINALORDER: return "http://hl7.org/fhir/request-intent"; + case REFLEXORDER: return "http://hl7.org/fhir/request-intent"; + case FILLERORDER: return "http://hl7.org/fhir/request-intent"; + case INSTANCEORDER: return "http://hl7.org/fhir/request-intent"; + case OPTION: return "http://hl7.org/fhir/request-intent"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSAL: return "The request is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act"; + case PLAN: return "The request represents an intension to ensure something occurs without providing an authorization for others to act"; + case ORDER: return "The request represents a request/demand and authorization for action"; + case ORIGINALORDER: return "The request represents an original authorization for action"; + case REFLEXORDER: return "The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization"; + case FILLERORDER: return "The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order"; + case INSTANCEORDER: return "An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence. E.g. The administration of a single dose of a drug."; + case OPTION: return "The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.\n\nRefer to [[[RequestGroup]]] for additional information on how this status is used"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSAL: return "Proposal"; + case PLAN: return "Plan"; + case ORDER: return "Order"; + case ORIGINALORDER: return "Original Order"; + case REFLEXORDER: return "Reflex Order"; + case FILLERORDER: return "Filler Order"; + case INSTANCEORDER: return "Instance Order"; + case OPTION: return "Option"; + default: return "?"; + } + } + } + + public static class DiagnosticRequestIntentEnumFactory implements EnumFactory { + public DiagnosticRequestIntent fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return DiagnosticRequestIntent.PROPOSAL; + if ("plan".equals(codeString)) + return DiagnosticRequestIntent.PLAN; + if ("order".equals(codeString)) + return DiagnosticRequestIntent.ORDER; + if ("original-order".equals(codeString)) + return DiagnosticRequestIntent.ORIGINALORDER; + if ("reflex-order".equals(codeString)) + return DiagnosticRequestIntent.REFLEXORDER; + if ("filler-order".equals(codeString)) + return DiagnosticRequestIntent.FILLERORDER; + if ("instance-order".equals(codeString)) + return DiagnosticRequestIntent.INSTANCEORDER; + if ("option".equals(codeString)) + return DiagnosticRequestIntent.OPTION; + throw new IllegalArgumentException("Unknown DiagnosticRequestIntent code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return new Enumeration(this, DiagnosticRequestIntent.PROPOSAL); + if ("plan".equals(codeString)) + return new Enumeration(this, DiagnosticRequestIntent.PLAN); + if ("order".equals(codeString)) + return new Enumeration(this, DiagnosticRequestIntent.ORDER); + if ("original-order".equals(codeString)) + return new Enumeration(this, DiagnosticRequestIntent.ORIGINALORDER); + if ("reflex-order".equals(codeString)) + return new Enumeration(this, DiagnosticRequestIntent.REFLEXORDER); + if ("filler-order".equals(codeString)) + return new Enumeration(this, DiagnosticRequestIntent.FILLERORDER); + if ("instance-order".equals(codeString)) + return new Enumeration(this, DiagnosticRequestIntent.INSTANCEORDER); + if ("option".equals(codeString)) + return new Enumeration(this, DiagnosticRequestIntent.OPTION); + throw new FHIRException("Unknown DiagnosticRequestIntent code '"+codeString+"'"); + } + public String toCode(DiagnosticRequestIntent code) { + if (code == DiagnosticRequestIntent.PROPOSAL) + return "proposal"; + if (code == DiagnosticRequestIntent.PLAN) + return "plan"; + if (code == DiagnosticRequestIntent.ORDER) + return "order"; + if (code == DiagnosticRequestIntent.ORIGINALORDER) + return "original-order"; + if (code == DiagnosticRequestIntent.REFLEXORDER) + return "reflex-order"; + if (code == DiagnosticRequestIntent.FILLERORDER) + return "filler-order"; + if (code == DiagnosticRequestIntent.INSTANCEORDER) + return "instance-order"; + if (code == DiagnosticRequestIntent.OPTION) + return "option"; + return "?"; + } + public String toSystem(DiagnosticRequestIntent code) { + return code.getSystem(); + } + } + + public enum DiagnosticRequestSPriority { + /** + * The order has a normal priority . + */ + ROUTINE, + /** + * The order should be urgently. + */ + URGENT, + /** + * The order is time-critical. + */ + STAT, + /** + * The order should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers with the generic types + */ + NULL; + public static DiagnosticRequestSPriority fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown DiagnosticRequestSPriority code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return "http://hl7.org/fhir/request-priority"; + case URGENT: return "http://hl7.org/fhir/request-priority"; + case STAT: return "http://hl7.org/fhir/request-priority"; + case ASAP: return "http://hl7.org/fhir/request-priority"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The order has a normal priority ."; + case URGENT: return "The order should be urgently."; + case STAT: return "The order is time-critical."; + case ASAP: return "The order should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "ASAP"; + default: return "?"; + } + } + } + + public static class DiagnosticRequestSPriorityEnumFactory implements EnumFactory { + public DiagnosticRequestSPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return DiagnosticRequestSPriority.ROUTINE; + if ("urgent".equals(codeString)) + return DiagnosticRequestSPriority.URGENT; + if ("stat".equals(codeString)) + return DiagnosticRequestSPriority.STAT; + if ("asap".equals(codeString)) + return DiagnosticRequestSPriority.ASAP; + throw new IllegalArgumentException("Unknown DiagnosticRequestSPriority code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return new Enumeration(this, DiagnosticRequestSPriority.ROUTINE); + if ("urgent".equals(codeString)) + return new Enumeration(this, DiagnosticRequestSPriority.URGENT); + if ("stat".equals(codeString)) + return new Enumeration(this, DiagnosticRequestSPriority.STAT); + if ("asap".equals(codeString)) + return new Enumeration(this, DiagnosticRequestSPriority.ASAP); + throw new FHIRException("Unknown DiagnosticRequestSPriority code '"+codeString+"'"); + } + public String toCode(DiagnosticRequestSPriority code) { + if (code == DiagnosticRequestSPriority.ROUTINE) + return "routine"; + if (code == DiagnosticRequestSPriority.URGENT) + return "urgent"; + if (code == DiagnosticRequestSPriority.STAT) + return "stat"; + if (code == DiagnosticRequestSPriority.ASAP) + return "asap"; + return "?"; + } + public String toSystem(DiagnosticRequestSPriority code) { + return code.getSystem(); + } + } + /** * Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller. */ @@ -246,16 +572,16 @@ public class DiagnosticRequest extends DomainResource { /** - * Composite request this is part of. + * A shared identifier common to all diagnostic requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier. */ @Child(name = "requisition", type = {Identifier.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier of composite request", formalDefinition="Composite request this is part of." ) + @Description(shortDefinition="Composite Request ID", formalDefinition="A shared identifier common to all diagnostic requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier." ) protected Identifier requisition; /** * The status of the order. */ - @Child(name = "status", type = {CodeType.class}, order=5, min=0, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true) @Description(shortDefinition="draft | active | suspended | completed | entered-in-error | cancelled", formalDefinition="The status of the order." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-status") protected Enumeration status; @@ -263,15 +589,23 @@ public class DiagnosticRequest extends DomainResource { /** * Whether the request is a proposal, plan, an original order or a reflex order. */ - @Child(name = "stage", type = {CodeableConcept.class}, order=6, min=1, max=1, modifier=true, summary=true) + @Child(name = "intent", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true) @Description(shortDefinition="proposal | plan | original-order | reflex-order", formalDefinition="Whether the request is a proposal, plan, an original order or a reflex order." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnostic-request-stage") - protected CodeableConcept stage; + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-intent") + protected Enumeration intent; + + /** + * Indicates how quickly the {{title}} should be addressed with respect to other requests. + */ + @Child(name = "priority", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Indicates how quickly the {{title}} should be addressed with respect to other requests." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority") + protected Enumeration priority; /** * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. */ - @Child(name = "code", type = {CodeableConcept.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Child(name = "code", type = {CodeableConcept.class}, order=8, min=1, max=1, modifier=false, summary=true) @Description(shortDefinition="What’s being requested/ordered", formalDefinition="A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnostic-requests") protected CodeableConcept code; @@ -279,7 +613,7 @@ public class DiagnosticRequest extends DomainResource { /** * On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). */ - @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=8, min=1, max=1, modifier=false, summary=true) + @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=9, min=1, max=1, modifier=false, summary=true) @Description(shortDefinition="Individual the test is ordered for", formalDefinition="On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)." ) protected Reference subject; @@ -291,7 +625,7 @@ public class DiagnosticRequest extends DomainResource { /** * An encounter or episode of care that provides additional information about the healthcare context in which this request is made. */ - @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=10, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Encounter or Episode during which request was created", formalDefinition="An encounter or episode of care that provides additional information about the healthcare context in which this request is made." ) protected Reference context; @@ -303,21 +637,21 @@ public class DiagnosticRequest extends DomainResource { /** * The date/time at which the diagnostic testing should occur. */ - @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=11, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="When testing should occur", formalDefinition="The date/time at which the diagnostic testing should occur." ) protected Type occurrence; /** * When the request transitioned to being actionable. */ - @Child(name = "authored", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Child(name = "authoredOn", type = {DateTimeType.class}, order=12, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Date request signed", formalDefinition="When the request transitioned to being actionable." ) - protected DateTimeType authored; + protected DateTimeType authoredOn; /** * Who/what is requesting diagnostics. The practitioner that holds legal responsibility for ordering the investigation. */ - @Child(name = "requester", type = {Device.class, Practitioner.class, Organization.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Child(name = "requester", type = {Device.class, Practitioner.class, Organization.class}, order=13, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Who/what is requesting diagnostics", formalDefinition="Who/what is requesting diagnostics. The practitioner that holds legal responsibility for ordering the investigation." ) protected Reference requester; @@ -329,7 +663,7 @@ public class DiagnosticRequest extends DomainResource { /** * Desired type of performer for doing the diagnostic testing. (. */ - @Child(name = "performerType", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Child(name = "performerType", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Performer role", formalDefinition="Desired type of performer for doing the diagnostic testing. (." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participant-role") protected CodeableConcept performerType; @@ -337,7 +671,7 @@ public class DiagnosticRequest extends DomainResource { /** * The desired perfomer for doing the diagnostic testing. */ - @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, Device.class, RelatedPerson.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, Device.class, RelatedPerson.class}, order=15, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Requested perfomer", formalDefinition="The desired perfomer for doing the diagnostic testing." ) protected Reference performer; @@ -347,17 +681,29 @@ public class DiagnosticRequest extends DomainResource { protected Resource performerTarget; /** - * An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation. + * An explanation or justification for why this diagnostic investigation is being requested in coded or textual form. This is often for billing purposes. May relate to the resources referred to in supportingInformation. */ - @Child(name = "reason", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Explanation/Justification for test", formalDefinition="An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation." ) + @Child(name = "reasonCode", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Explanation/Justification for test", formalDefinition="An explanation or justification for why this diagnostic investigation is being requested in coded or textual form. This is often for billing purposes. May relate to the resources referred to in supportingInformation." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code") - protected List reason; + protected List reasonCode; + + /** + * Indicates another resource that provides a justification for why this diagnostic investigation is being requested. May relate to the resources referred to in supportingInformation. + */ + @Child(name = "reasonReference", type = {Condition.class, Observation.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Explanation/Justification for test", formalDefinition="Indicates another resource that provides a justification for why this diagnostic investigation is being requested. May relate to the resources referred to in supportingInformation." ) + protected List reasonReference; + /** + * The actual objects that are the target of the reference (Indicates another resource that provides a justification for why this diagnostic investigation is being requested. May relate to the resources referred to in supportingInformation.) + */ + protected List reasonReferenceTarget; + /** * Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order. */ - @Child(name = "supportingInformation", type = {Reference.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "supportingInformation", type = {Reference.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Additional clinical information", formalDefinition="Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order." ) protected List supportingInformation; /** @@ -369,14 +715,14 @@ public class DiagnosticRequest extends DomainResource { /** * Any other notes and comments made about the service request. (e.g. "patient hates needles"). */ - @Child(name = "note", type = {Annotation.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "note", type = {Annotation.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Comments", formalDefinition="Any other notes and comments made about the service request. (e.g. \"patient hates needles\")." ) protected List note; /** * Key events in the history of the request. */ - @Child(name = "relevantHistory", type = {Provenance.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "relevantHistory", type = {Provenance.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Request provenance", formalDefinition="Key events in the history of the request." ) protected List relevantHistory; /** @@ -385,7 +731,7 @@ public class DiagnosticRequest extends DomainResource { protected List relevantHistoryTarget; - private static final long serialVersionUID = -372674491L; + private static final long serialVersionUID = -2142319333L; /** * Constructor @@ -397,9 +743,10 @@ public class DiagnosticRequest extends DomainResource { /** * Constructor */ - public DiagnosticRequest(CodeableConcept stage, CodeableConcept code, Reference subject) { + public DiagnosticRequest(Enumeration status, Enumeration intent, CodeableConcept code, Reference subject) { super(); - this.stage = stage; + this.status = status; + this.intent = intent; this.code = code; this.subject = subject; } @@ -647,7 +994,7 @@ public class DiagnosticRequest extends DomainResource { } /** - * @return {@link #requisition} (Composite request this is part of.) + * @return {@link #requisition} (A shared identifier common to all diagnostic requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.) */ public Identifier getRequisition() { if (this.requisition == null) @@ -663,7 +1010,7 @@ public class DiagnosticRequest extends DomainResource { } /** - * @param value {@link #requisition} (Composite request this is part of.) + * @param value {@link #requisition} (A shared identifier common to all diagnostic requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.) */ public DiagnosticRequest setRequisition(Identifier value) { this.requisition = value; @@ -709,37 +1056,103 @@ public class DiagnosticRequest extends DomainResource { * @param value The status of the order. */ public DiagnosticRequest setStatus(DiagnosticRequestStatus value) { - if (value == null) - this.status = null; - else { if (this.status == null) this.status = new Enumeration(new DiagnosticRequestStatusEnumFactory()); this.status.setValue(value); - } return this; } /** - * @return {@link #stage} (Whether the request is a proposal, plan, an original order or a reflex order.) + * @return {@link #intent} (Whether the request is a proposal, plan, an original order or a reflex order.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value */ - public CodeableConcept getStage() { - if (this.stage == null) + public Enumeration getIntentElement() { + if (this.intent == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticRequest.stage"); + throw new Error("Attempt to auto-create DiagnosticRequest.intent"); else if (Configuration.doAutoCreate()) - this.stage = new CodeableConcept(); // cc - return this.stage; + this.intent = new Enumeration(new DiagnosticRequestIntentEnumFactory()); // bb + return this.intent; } - public boolean hasStage() { - return this.stage != null && !this.stage.isEmpty(); + public boolean hasIntentElement() { + return this.intent != null && !this.intent.isEmpty(); + } + + public boolean hasIntent() { + return this.intent != null && !this.intent.isEmpty(); } /** - * @param value {@link #stage} (Whether the request is a proposal, plan, an original order or a reflex order.) + * @param value {@link #intent} (Whether the request is a proposal, plan, an original order or a reflex order.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value */ - public DiagnosticRequest setStage(CodeableConcept value) { - this.stage = value; + public DiagnosticRequest setIntentElement(Enumeration value) { + this.intent = value; + return this; + } + + /** + * @return Whether the request is a proposal, plan, an original order or a reflex order. + */ + public DiagnosticRequestIntent getIntent() { + return this.intent == null ? null : this.intent.getValue(); + } + + /** + * @param value Whether the request is a proposal, plan, an original order or a reflex order. + */ + public DiagnosticRequest setIntent(DiagnosticRequestIntent value) { + if (this.intent == null) + this.intent = new Enumeration(new DiagnosticRequestIntentEnumFactory()); + this.intent.setValue(value); + return this; + } + + /** + * @return {@link #priority} (Indicates how quickly the {{title}} should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new DiagnosticRequestSPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Indicates how quickly the {{title}} should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public DiagnosticRequest setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return Indicates how quickly the {{title}} should be addressed with respect to other requests. + */ + public DiagnosticRequestSPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value Indicates how quickly the {{title}} should be addressed with respect to other requests. + */ + public DiagnosticRequest setPriority(DiagnosticRequestSPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new DiagnosticRequestSPriorityEnumFactory()); + this.priority.setValue(value); + } return this; } @@ -904,50 +1317,50 @@ public class DiagnosticRequest extends DomainResource { } /** - * @return {@link #authored} (When the request transitioned to being actionable.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + * @return {@link #authoredOn} (When the request transitioned to being actionable.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value */ - public DateTimeType getAuthoredElement() { - if (this.authored == null) + public DateTimeType getAuthoredOnElement() { + if (this.authoredOn == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticRequest.authored"); + throw new Error("Attempt to auto-create DiagnosticRequest.authoredOn"); else if (Configuration.doAutoCreate()) - this.authored = new DateTimeType(); // bb - return this.authored; + this.authoredOn = new DateTimeType(); // bb + return this.authoredOn; } - public boolean hasAuthoredElement() { - return this.authored != null && !this.authored.isEmpty(); + public boolean hasAuthoredOnElement() { + return this.authoredOn != null && !this.authoredOn.isEmpty(); } - public boolean hasAuthored() { - return this.authored != null && !this.authored.isEmpty(); + public boolean hasAuthoredOn() { + return this.authoredOn != null && !this.authoredOn.isEmpty(); } /** - * @param value {@link #authored} (When the request transitioned to being actionable.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + * @param value {@link #authoredOn} (When the request transitioned to being actionable.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value */ - public DiagnosticRequest setAuthoredElement(DateTimeType value) { - this.authored = value; + public DiagnosticRequest setAuthoredOnElement(DateTimeType value) { + this.authoredOn = value; return this; } /** * @return When the request transitioned to being actionable. */ - public Date getAuthored() { - return this.authored == null ? null : this.authored.getValue(); + public Date getAuthoredOn() { + return this.authoredOn == null ? null : this.authoredOn.getValue(); } /** * @param value When the request transitioned to being actionable. */ - public DiagnosticRequest setAuthored(Date value) { + public DiagnosticRequest setAuthoredOn(Date value) { if (value == null) - this.authored = null; + this.authoredOn = null; else { - if (this.authored == null) - this.authored = new DateTimeType(); - this.authored.setValue(value); + if (this.authoredOn == null) + this.authoredOn = new DateTimeType(); + this.authoredOn.setValue(value); } return this; } @@ -1055,56 +1468,119 @@ public class DiagnosticRequest extends DomainResource { } /** - * @return {@link #reason} (An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation.) + * @return {@link #reasonCode} (An explanation or justification for why this diagnostic investigation is being requested in coded or textual form. This is often for billing purposes. May relate to the resources referred to in supportingInformation.) */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; + public List getReasonCode() { + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + return this.reasonCode; } /** * @return Returns a reference to this for easy method chaining */ - public DiagnosticRequest setReason(List theReason) { - this.reason = theReason; + public DiagnosticRequest setReasonCode(List theReasonCode) { + this.reasonCode = theReasonCode; return this; } - public boolean hasReason() { - if (this.reason == null) + public boolean hasReasonCode() { + if (this.reasonCode == null) return false; - for (CodeableConcept item : this.reason) + for (CodeableConcept item : this.reasonCode) if (!item.isEmpty()) return true; return false; } - public CodeableConcept addReason() { //3 + public CodeableConcept addReasonCode() { //3 CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + this.reasonCode.add(t); return t; } - public DiagnosticRequest addReason(CodeableConcept t) { //3 + public DiagnosticRequest addReasonCode(CodeableConcept t) { //3 if (t == null) return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); + if (this.reasonCode == null) + this.reasonCode = new ArrayList(); + this.reasonCode.add(t); return this; } /** - * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist + * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist */ - public CodeableConcept getReasonFirstRep() { - if (getReason().isEmpty()) { - addReason(); + public CodeableConcept getReasonCodeFirstRep() { + if (getReasonCode().isEmpty()) { + addReasonCode(); } - return getReason().get(0); + return getReasonCode().get(0); + } + + /** + * @return {@link #reasonReference} (Indicates another resource that provides a justification for why this diagnostic investigation is being requested. May relate to the resources referred to in supportingInformation.) + */ + public List getReasonReference() { + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + return this.reasonReference; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public DiagnosticRequest setReasonReference(List theReasonReference) { + this.reasonReference = theReasonReference; + return this; + } + + public boolean hasReasonReference() { + if (this.reasonReference == null) + return false; + for (Reference item : this.reasonReference) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addReasonReference() { //3 + Reference t = new Reference(); + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + this.reasonReference.add(t); + return t; + } + + public DiagnosticRequest addReasonReference(Reference t) { //3 + if (t == null) + return this; + if (this.reasonReference == null) + this.reasonReference = new ArrayList(); + this.reasonReference.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist + */ + public Reference getReasonReferenceFirstRep() { + if (getReasonReference().isEmpty()) { + addReasonReference(); + } + return getReasonReference().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getReasonReferenceTarget() { + if (this.reasonReferenceTarget == null) + this.reasonReferenceTarget = new ArrayList(); + return this.reasonReferenceTarget; } /** @@ -1304,18 +1780,20 @@ public class DiagnosticRequest extends DomainResource { childrenList.add(new Property("definition", "Reference(Any)", "Protocol or definition followed by this request.", 0, java.lang.Integer.MAX_VALUE, definition)); childrenList.add(new Property("basedOn", "Reference(Any)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn)); childrenList.add(new Property("replaces", "Reference(Any)", "The request takes the place of the referenced completed or terminated request(s).", 0, java.lang.Integer.MAX_VALUE, replaces)); - childrenList.add(new Property("requisition", "Identifier", "Composite request this is part of.", 0, java.lang.Integer.MAX_VALUE, requisition)); + childrenList.add(new Property("requisition", "Identifier", "A shared identifier common to all diagnostic requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.", 0, java.lang.Integer.MAX_VALUE, requisition)); childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("stage", "CodeableConcept", "Whether the request is a proposal, plan, an original order or a reflex order.", 0, java.lang.Integer.MAX_VALUE, stage)); + childrenList.add(new Property("intent", "code", "Whether the request is a proposal, plan, an original order or a reflex order.", 0, java.lang.Integer.MAX_VALUE, intent)); + childrenList.add(new Property("priority", "code", "Indicates how quickly the {{title}} should be addressed with respect to other requests.", 0, java.lang.Integer.MAX_VALUE, priority)); childrenList.add(new Property("code", "CodeableConcept", "A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.", 0, java.lang.Integer.MAX_VALUE, code)); childrenList.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "On whom or what the investigation is to be performed. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).", 0, java.lang.Integer.MAX_VALUE, subject)); childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "An encounter or episode of care that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, context)); childrenList.add(new Property("occurrence[x]", "dateTime|Period|Timing", "The date/time at which the diagnostic testing should occur.", 0, java.lang.Integer.MAX_VALUE, occurrence)); - childrenList.add(new Property("authored", "dateTime", "When the request transitioned to being actionable.", 0, java.lang.Integer.MAX_VALUE, authored)); + childrenList.add(new Property("authoredOn", "dateTime", "When the request transitioned to being actionable.", 0, java.lang.Integer.MAX_VALUE, authoredOn)); childrenList.add(new Property("requester", "Reference(Device|Practitioner|Organization)", "Who/what is requesting diagnostics. The practitioner that holds legal responsibility for ordering the investigation.", 0, java.lang.Integer.MAX_VALUE, requester)); childrenList.add(new Property("performerType", "CodeableConcept", "Desired type of performer for doing the diagnostic testing. (.", 0, java.lang.Integer.MAX_VALUE, performerType)); childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|Device|RelatedPerson)", "The desired perfomer for doing the diagnostic testing.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("reason", "CodeableConcept", "An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("reasonCode", "CodeableConcept", "An explanation or justification for why this diagnostic investigation is being requested in coded or textual form. This is often for billing purposes. May relate to the resources referred to in supportingInformation.", 0, java.lang.Integer.MAX_VALUE, reasonCode)); + childrenList.add(new Property("reasonReference", "Reference(Condition|Observation)", "Indicates another resource that provides a justification for why this diagnostic investigation is being requested. May relate to the resources referred to in supportingInformation.", 0, java.lang.Integer.MAX_VALUE, reasonReference)); childrenList.add(new Property("supportingInformation", "Reference(Any)", "Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); childrenList.add(new Property("note", "Annotation", "Any other notes and comments made about the service request. (e.g. \"patient hates needles\").", 0, java.lang.Integer.MAX_VALUE, note)); childrenList.add(new Property("relevantHistory", "Reference(Provenance)", "Key events in the history of the request.", 0, java.lang.Integer.MAX_VALUE, relevantHistory)); @@ -1330,16 +1808,18 @@ public class DiagnosticRequest extends DomainResource { case -430332865: /*replaces*/ return this.replaces == null ? new Base[0] : this.replaces.toArray(new Base[this.replaces.size()]); // Reference case 395923612: /*requisition*/ return this.requisition == null ? new Base[0] : new Base[] {this.requisition}; // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 109757182: /*stage*/ return this.stage == null ? new Base[0] : new Base[] {this.stage}; // CodeableConcept + case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // Type - case 1433073514: /*authored*/ return this.authored == null ? new Base[0] : new Base[] {this.authored}; // DateTimeType + case -1500852503: /*authoredOn*/ return this.authoredOn == null ? new Base[0] : new Base[] {this.authoredOn}; // DateTimeType case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : new Base[] {this.performerType}; // CodeableConcept case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept + case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept + case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference @@ -1369,8 +1849,11 @@ public class DiagnosticRequest extends DomainResource { case -892481550: // status this.status = new DiagnosticRequestStatusEnumFactory().fromType(value); // Enumeration break; - case 109757182: // stage - this.stage = castToCodeableConcept(value); // CodeableConcept + case -1183762788: // intent + this.intent = new DiagnosticRequestIntentEnumFactory().fromType(value); // Enumeration + break; + case -1165461084: // priority + this.priority = new DiagnosticRequestSPriorityEnumFactory().fromType(value); // Enumeration break; case 3059181: // code this.code = castToCodeableConcept(value); // CodeableConcept @@ -1384,8 +1867,8 @@ public class DiagnosticRequest extends DomainResource { case 1687874001: // occurrence this.occurrence = castToType(value); // Type break; - case 1433073514: // authored - this.authored = castToDateTime(value); // DateTimeType + case -1500852503: // authoredOn + this.authoredOn = castToDateTime(value); // DateTimeType break; case 693933948: // requester this.requester = castToReference(value); // Reference @@ -1396,8 +1879,11 @@ public class DiagnosticRequest extends DomainResource { case 481140686: // performer this.performer = castToReference(value); // Reference break; - case -934964668: // reason - this.getReason().add(castToCodeableConcept(value)); // CodeableConcept + case 722137681: // reasonCode + this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1146218137: // reasonReference + this.getReasonReference().add(castToReference(value)); // Reference break; case -1248768647: // supportingInformation this.getSupportingInformation().add(castToReference(value)); // Reference @@ -1427,8 +1913,10 @@ public class DiagnosticRequest extends DomainResource { this.requisition = castToIdentifier(value); // Identifier else if (name.equals("status")) this.status = new DiagnosticRequestStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("stage")) - this.stage = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("intent")) + this.intent = new DiagnosticRequestIntentEnumFactory().fromType(value); // Enumeration + else if (name.equals("priority")) + this.priority = new DiagnosticRequestSPriorityEnumFactory().fromType(value); // Enumeration else if (name.equals("code")) this.code = castToCodeableConcept(value); // CodeableConcept else if (name.equals("subject")) @@ -1437,16 +1925,18 @@ public class DiagnosticRequest extends DomainResource { this.context = castToReference(value); // Reference else if (name.equals("occurrence[x]")) this.occurrence = castToType(value); // Type - else if (name.equals("authored")) - this.authored = castToDateTime(value); // DateTimeType + else if (name.equals("authoredOn")) + this.authoredOn = castToDateTime(value); // DateTimeType else if (name.equals("requester")) this.requester = castToReference(value); // Reference else if (name.equals("performerType")) this.performerType = castToCodeableConcept(value); // CodeableConcept else if (name.equals("performer")) this.performer = castToReference(value); // Reference - else if (name.equals("reason")) - this.getReason().add(castToCodeableConcept(value)); + else if (name.equals("reasonCode")) + this.getReasonCode().add(castToCodeableConcept(value)); + else if (name.equals("reasonReference")) + this.getReasonReference().add(castToReference(value)); else if (name.equals("supportingInformation")) this.getSupportingInformation().add(castToReference(value)); else if (name.equals("note")) @@ -1466,16 +1956,18 @@ public class DiagnosticRequest extends DomainResource { case -430332865: return addReplaces(); // Reference case 395923612: return getRequisition(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 109757182: return getStage(); // CodeableConcept + case -1183762788: throw new FHIRException("Cannot make property intent as it is not a complex type"); // Enumeration + case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration case 3059181: return getCode(); // CodeableConcept case -1867885268: return getSubject(); // Reference case 951530927: return getContext(); // Reference case -2022646513: return getOccurrence(); // Type - case 1433073514: throw new FHIRException("Cannot make property authored as it is not a complex type"); // DateTimeType + case -1500852503: throw new FHIRException("Cannot make property authoredOn as it is not a complex type"); // DateTimeType case 693933948: return getRequester(); // Reference case -901444568: return getPerformerType(); // CodeableConcept case 481140686: return getPerformer(); // Reference - case -934964668: return addReason(); // CodeableConcept + case 722137681: return addReasonCode(); // CodeableConcept + case -1146218137: return addReasonReference(); // Reference case -1248768647: return addSupportingInformation(); // Reference case 3387378: return addNote(); // Annotation case 1538891575: return addRelevantHistory(); // Reference @@ -1505,9 +1997,11 @@ public class DiagnosticRequest extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type DiagnosticRequest.status"); } - else if (name.equals("stage")) { - this.stage = new CodeableConcept(); - return this.stage; + else if (name.equals("intent")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticRequest.intent"); + } + else if (name.equals("priority")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticRequest.priority"); } else if (name.equals("code")) { this.code = new CodeableConcept(); @@ -1533,8 +2027,8 @@ public class DiagnosticRequest extends DomainResource { this.occurrence = new Timing(); return this.occurrence; } - else if (name.equals("authored")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticRequest.authored"); + else if (name.equals("authoredOn")) { + throw new FHIRException("Cannot call addChild on a primitive type DiagnosticRequest.authoredOn"); } else if (name.equals("requester")) { this.requester = new Reference(); @@ -1548,8 +2042,11 @@ public class DiagnosticRequest extends DomainResource { this.performer = new Reference(); return this.performer; } - else if (name.equals("reason")) { - return addReason(); + else if (name.equals("reasonCode")) { + return addReasonCode(); + } + else if (name.equals("reasonReference")) { + return addReasonReference(); } else if (name.equals("supportingInformation")) { return addSupportingInformation(); @@ -1594,19 +2091,25 @@ public class DiagnosticRequest extends DomainResource { }; dst.requisition = requisition == null ? null : requisition.copy(); dst.status = status == null ? null : status.copy(); - dst.stage = stage == null ? null : stage.copy(); + dst.intent = intent == null ? null : intent.copy(); + dst.priority = priority == null ? null : priority.copy(); dst.code = code == null ? null : code.copy(); dst.subject = subject == null ? null : subject.copy(); dst.context = context == null ? null : context.copy(); dst.occurrence = occurrence == null ? null : occurrence.copy(); - dst.authored = authored == null ? null : authored.copy(); + dst.authoredOn = authoredOn == null ? null : authoredOn.copy(); dst.requester = requester == null ? null : requester.copy(); dst.performerType = performerType == null ? null : performerType.copy(); dst.performer = performer == null ? null : performer.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); + if (reasonCode != null) { + dst.reasonCode = new ArrayList(); + for (CodeableConcept i : reasonCode) + dst.reasonCode.add(i.copy()); + }; + if (reasonReference != null) { + dst.reasonReference = new ArrayList(); + for (Reference i : reasonReference) + dst.reasonReference.add(i.copy()); }; if (supportingInformation != null) { dst.supportingInformation = new ArrayList(); @@ -1639,11 +2142,13 @@ public class DiagnosticRequest extends DomainResource { DiagnosticRequest o = (DiagnosticRequest) other; return compareDeep(identifier, o.identifier, true) && compareDeep(definition, o.definition, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(replaces, o.replaces, true) && compareDeep(requisition, o.requisition, true) - && compareDeep(status, o.status, true) && compareDeep(stage, o.stage, true) && compareDeep(code, o.code, true) - && compareDeep(subject, o.subject, true) && compareDeep(context, o.context, true) && compareDeep(occurrence, o.occurrence, true) - && compareDeep(authored, o.authored, true) && compareDeep(requester, o.requester, true) && compareDeep(performerType, o.performerType, true) - && compareDeep(performer, o.performer, true) && compareDeep(reason, o.reason, true) && compareDeep(supportingInformation, o.supportingInformation, true) - && compareDeep(note, o.note, true) && compareDeep(relevantHistory, o.relevantHistory, true); + && compareDeep(status, o.status, true) && compareDeep(intent, o.intent, true) && compareDeep(priority, o.priority, true) + && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) && compareDeep(context, o.context, true) + && compareDeep(occurrence, o.occurrence, true) && compareDeep(authoredOn, o.authoredOn, true) && compareDeep(requester, o.requester, true) + && compareDeep(performerType, o.performerType, true) && compareDeep(performer, o.performer, true) + && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true) + && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(note, o.note, true) + && compareDeep(relevantHistory, o.relevantHistory, true); } @Override @@ -1653,14 +2158,15 @@ public class DiagnosticRequest extends DomainResource { if (!(other instanceof DiagnosticRequest)) return false; DiagnosticRequest o = (DiagnosticRequest) other; - return compareValues(status, o.status, true) && compareValues(authored, o.authored, true); + return compareValues(status, o.status, true) && compareValues(intent, o.intent, true) && compareValues(priority, o.priority, true) + && compareValues(authoredOn, o.authoredOn, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, definition, basedOn - , replaces, requisition, status, stage, code, subject, context, occurrence, authored - , requester, performerType, performer, reason, supportingInformation, note, relevantHistory - ); + , replaces, requisition, status, intent, priority, code, subject, context, occurrence + , authoredOn, requester, performerType, performer, reasonCode, reasonReference, supportingInformation + , note, relevantHistory); } @Override @@ -1831,17 +2337,17 @@ public class DiagnosticRequest extends DomainResource { *

* Description: When the request transitioned to being actionable
* Type: date
- * Path: DiagnosticRequest.authored
+ * Path: DiagnosticRequest.authoredOn
*

*/ - @SearchParamDefinition(name="author-date", path="DiagnosticRequest.authored", description="When the request transitioned to being actionable", type="date" ) + @SearchParamDefinition(name="author-date", path="DiagnosticRequest.authoredOn", description="When the request transitioned to being actionable", type="date" ) public static final String SP_AUTHOR_DATE = "author-date"; /** * Fluent Client search parameter constant for author-date *

* Description: When the request transitioned to being actionable
* Type: date
- * Path: DiagnosticRequest.authored
+ * Path: DiagnosticRequest.authoredOn
*

*/ public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHOR_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHOR_DATE); @@ -1872,6 +2378,46 @@ public class DiagnosticRequest extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DiagnosticRequest:encounter").toLocked(); + /** + * Search parameter: priority + *

+ * Description: routine | urgent | asap | stat
+ * Type: token
+ * Path: DiagnosticRequest.priority
+ *

+ */ + @SearchParamDefinition(name="priority", path="DiagnosticRequest.priority", description="routine | urgent | asap | stat", type="token" ) + public static final String SP_PRIORITY = "priority"; + /** + * Fluent Client search parameter constant for priority + *

+ * Description: routine | urgent | asap | stat
+ * Type: token
+ * Path: DiagnosticRequest.priority
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); + + /** + * Search parameter: intent + *

+ * Description: proposal | plan | original-order |reflex-order
+ * Type: token
+ * Path: DiagnosticRequest.intent
+ *

+ */ + @SearchParamDefinition(name="intent", path="DiagnosticRequest.intent", description="proposal | plan | original-order |reflex-order", type="token" ) + public static final String SP_INTENT = "intent"; + /** + * Fluent Client search parameter constant for intent + *

+ * Description: proposal | plan | original-order |reflex-order
+ * Type: token
+ * Path: DiagnosticRequest.intent
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTENT); + /** * Search parameter: based-on *

@@ -1898,26 +2444,6 @@ public class DiagnosticRequest extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("DiagnosticRequest:based-on").toLocked(); - /** - * Search parameter: stage - *

- * Description: proposal | plan | original-order |reflex-order
- * Type: token
- * Path: DiagnosticRequest.stage
- *

- */ - @SearchParamDefinition(name="stage", path="DiagnosticRequest.stage", description="proposal | plan | original-order |reflex-order", type="token" ) - public static final String SP_STAGE = "stage"; - /** - * Fluent Client search parameter constant for stage - *

- * Description: proposal | plan | original-order |reflex-order
- * Type: token
- * Path: DiagnosticRequest.stage
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STAGE); - /** * Search parameter: patient *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Distance.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Distance.java index 7f647cbc001..a217fd5df69 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Distance.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Distance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DocumentManifest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DocumentManifest.java index 9405b93c55a..fd1b9143048 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DocumentManifest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DocumentManifest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DocumentReference.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DocumentReference.java index f5ccd6b1e37..e41a23052c7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DocumentReference.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DocumentReference.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -2705,7 +2705,7 @@ public class DocumentReference extends DomainResource { * Path:
*

*/ - @SearchParamDefinition(name="relationship", path="", description="Combination of relation and relatesTo", type="composite", compositeOf={"relatesto", "relation"} ) + @SearchParamDefinition(name="relationship", path="DocumentReference.relatesTo", description="Combination of relation and relatesTo", type="composite", compositeOf={"relatesto", "relation"} ) public static final String SP_RELATIONSHIP = "relationship"; /** * Fluent Client search parameter constant for relationship diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DomainResource.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DomainResource.java index ad8a4a18ac2..787735c1955 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DomainResource.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DomainResource.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DosageInstruction.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DosageInstruction.java index 011ca7d7d3b..ca0fb46c77d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DosageInstruction.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/DosageInstruction.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -87,10 +87,10 @@ public class DosageInstruction extends Type implements ICompositeType { /** * Body site to administer to. */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Child(name = "site", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Body site to administer to", formalDefinition="Body site to administer to." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/approach-site-codes") - protected Type site; + protected CodeableConcept site; /** * How drug should enter body. @@ -143,7 +143,7 @@ public class DosageInstruction extends Type implements ICompositeType { @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Amount of medication per unit of time." ) protected Type rate; - private static final long serialVersionUID = -1392288530L; + private static final long serialVersionUID = 1097478883L; /** * Constructor @@ -371,36 +371,15 @@ public class DosageInstruction extends Type implements ICompositeType { /** * @return {@link #site} (Body site to administer to.) */ - public Type getSite() { + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DosageInstruction.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); // cc return this.site; } - /** - * @return {@link #site} (Body site to administer to.) - */ - public CodeableConcept getSiteCodeableConcept() throws FHIRException { - if (!(this.site instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - public boolean hasSiteCodeableConcept() { - return this.site instanceof CodeableConcept; - } - - /** - * @return {@link #site} (Body site to administer to.) - */ - public Reference getSiteReference() throws FHIRException { - if (!(this.site instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSiteReference() { - return this.site instanceof Reference; - } - public boolean hasSite() { return this.site != null && !this.site.isEmpty(); } @@ -408,7 +387,7 @@ public class DosageInstruction extends Type implements ICompositeType { /** * @param value {@link #site} (Body site to administer to.) */ - public DosageInstruction setSite(Type value) { + public DosageInstruction setSite(CodeableConcept value) { this.site = value; return this; } @@ -643,7 +622,7 @@ public class DosageInstruction extends Type implements ICompositeType { childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Supplemental instructions - e.g. \"with meals\".", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); childrenList.add(new Property("timing", "Timing", "When medication should be administered.", 0, java.lang.Integer.MAX_VALUE, timing)); childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "Take \"as needed\" (for x).", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "Body site to administer to.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("site", "CodeableConcept", "Body site to administer to.", 0, java.lang.Integer.MAX_VALUE, site)); childrenList.add(new Property("route", "CodeableConcept", "How drug should enter body.", 0, java.lang.Integer.MAX_VALUE, route)); childrenList.add(new Property("method", "CodeableConcept", "Technique for administering medication.", 0, java.lang.Integer.MAX_VALUE, method)); childrenList.add(new Property("dose[x]", "Range|SimpleQuantity", "Amount of medication per dose.", 0, java.lang.Integer.MAX_VALUE, dose)); @@ -661,7 +640,7 @@ public class DosageInstruction extends Type implements ICompositeType { case -1206718612: /*additionalInstructions*/ return this.additionalInstructions == null ? new Base[0] : this.additionalInstructions.toArray(new Base[this.additionalInstructions.size()]); // CodeableConcept case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Timing case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type - case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type + case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // CodeableConcept case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept case 3089437: /*dose*/ return this.dose == null ? new Base[0] : new Base[] {this.dose}; // Type @@ -693,7 +672,7 @@ public class DosageInstruction extends Type implements ICompositeType { this.asNeeded = castToType(value); // Type break; case 3530567: // site - this.site = castToType(value); // Type + this.site = castToCodeableConcept(value); // CodeableConcept break; case 108704329: // route this.route = castToCodeableConcept(value); // CodeableConcept @@ -733,8 +712,8 @@ public class DosageInstruction extends Type implements ICompositeType { this.timing = castToTiming(value); // Timing else if (name.equals("asNeeded[x]")) this.asNeeded = castToType(value); // Type - else if (name.equals("site[x]")) - this.site = castToType(value); // Type + else if (name.equals("site")) + this.site = castToCodeableConcept(value); // CodeableConcept else if (name.equals("route")) this.route = castToCodeableConcept(value); // CodeableConcept else if (name.equals("method")) @@ -761,7 +740,7 @@ public class DosageInstruction extends Type implements ICompositeType { case -1206718612: return addAdditionalInstructions(); // CodeableConcept case -873664438: return getTiming(); // Timing case -544329575: return getAsNeeded(); // Type - case 2099997657: return getSite(); // Type + case 3530567: return getSite(); // CodeableConcept case 108704329: return getRoute(); // CodeableConcept case -1077554975: return getMethod(); // CodeableConcept case 1843195715: return getDose(); // Type @@ -797,14 +776,10 @@ public class DosageInstruction extends Type implements ICompositeType { this.asNeeded = new CodeableConcept(); return this.asNeeded; } - else if (name.equals("siteCodeableConcept")) { + else if (name.equals("site")) { this.site = new CodeableConcept(); return this.site; } - else if (name.equals("siteReference")) { - this.site = new Reference(); - return this.site; - } else if (name.equals("route")) { this.route = new CodeableConcept(); return this.route; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Duration.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Duration.java index a1b0381474d..294ef808262 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Duration.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Duration.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Element.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Element.java index 4260928019f..0c0df873a9d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Element.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Element.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -314,6 +314,16 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE public void setIdBase(String value) { setId(value); } +// added from java-adornments.txt: + public void addExtension(String url, Type value) { + Extension ex = new Extension(); + ex.setUrl(url); + ex.setValue(value); + getExtension().add(ex); + } + + +// end addition } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ElementDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ElementDefinition.java index 82caf0a7b03..7b687309410 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ElementDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ElementDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -1720,6 +1720,334 @@ public class ElementDefinition extends Type implements ICompositeType { } + } + + @Block() + public static class ElementDefinitionExampleComponent extends Element implements IBaseDatatypeElement { + /** + * Describes the purpose of this example amoung the set of examples. + */ + @Child(name = "label", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Describes the purpose of this example", formalDefinition="Describes the purpose of this example amoung the set of examples." ) + protected StringType label; + + /** + * The actual value for the element, which must be one of the types allowed for this element. + */ + @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Value of Example (one of allowed types)", formalDefinition="The actual value for the element, which must be one of the types allowed for this element." ) + protected org.hl7.fhir.dstu3.model.Type value; + + private static final long serialVersionUID = 1346348024L; + + /** + * Constructor + */ + public ElementDefinitionExampleComponent() { + super(); + } + + /** + * Constructor + */ + public ElementDefinitionExampleComponent(StringType label, org.hl7.fhir.dstu3.model.Type value) { + super(); + this.label = label; + this.value = value; + } + + /** + * @return {@link #label} (Describes the purpose of this example amoung the set of examples.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public StringType getLabelElement() { + if (this.label == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionExampleComponent.label"); + else if (Configuration.doAutoCreate()) + this.label = new StringType(); // bb + return this.label; + } + + public boolean hasLabelElement() { + return this.label != null && !this.label.isEmpty(); + } + + public boolean hasLabel() { + return this.label != null && !this.label.isEmpty(); + } + + /** + * @param value {@link #label} (Describes the purpose of this example amoung the set of examples.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public ElementDefinitionExampleComponent setLabelElement(StringType value) { + this.label = value; + return this; + } + + /** + * @return Describes the purpose of this example amoung the set of examples. + */ + public String getLabel() { + return this.label == null ? null : this.label.getValue(); + } + + /** + * @param value Describes the purpose of this example amoung the set of examples. + */ + public ElementDefinitionExampleComponent setLabel(String value) { + if (this.label == null) + this.label = new StringType(); + this.label.setValue(value); + return this; + } + + /** + * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.) + */ + public org.hl7.fhir.dstu3.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The actual value for the element, which must be one of the types allowed for this element.) + */ + public ElementDefinitionExampleComponent setValue(org.hl7.fhir.dstu3.model.Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("label", "string", "Describes the purpose of this example amoung the set of examples.", 0, java.lang.Integer.MAX_VALUE, label)); + childrenList.add(new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType + case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu3.model.Type + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 102727412: // label + this.label = castToString(value); // StringType + break; + case 111972721: // value + this.value = castToType(value); // org.hl7.fhir.dstu3.model.Type + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("label")) + this.label = castToString(value); // StringType + else if (name.equals("value[x]")) + this.value = castToType(value); // org.hl7.fhir.dstu3.model.Type + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType + case -1410166417: return getValue(); // org.hl7.fhir.dstu3.model.Type + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("label")) { + throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.label"); + } + else if (name.equals("valueBoolean")) { + this.value = new BooleanType(); + return this.value; + } + else if (name.equals("valueInteger")) { + this.value = new IntegerType(); + return this.value; + } + else if (name.equals("valueDecimal")) { + this.value = new DecimalType(); + return this.value; + } + else if (name.equals("valueBase64Binary")) { + this.value = new Base64BinaryType(); + return this.value; + } + else if (name.equals("valueInstant")) { + this.value = new InstantType(); + return this.value; + } + else if (name.equals("valueString")) { + this.value = new StringType(); + return this.value; + } + else if (name.equals("valueUri")) { + this.value = new UriType(); + return this.value; + } + else if (name.equals("valueDate")) { + this.value = new DateType(); + return this.value; + } + else if (name.equals("valueDateTime")) { + this.value = new DateTimeType(); + return this.value; + } + else if (name.equals("valueTime")) { + this.value = new TimeType(); + return this.value; + } + else if (name.equals("valueCode")) { + this.value = new CodeType(); + return this.value; + } + else if (name.equals("valueOid")) { + this.value = new OidType(); + return this.value; + } + else if (name.equals("valueId")) { + this.value = new IdType(); + return this.value; + } + else if (name.equals("valueUnsignedInt")) { + this.value = new UnsignedIntType(); + return this.value; + } + else if (name.equals("valuePositiveInt")) { + this.value = new PositiveIntType(); + return this.value; + } + else if (name.equals("valueMarkdown")) { + this.value = new MarkdownType(); + return this.value; + } + else if (name.equals("valueAnnotation")) { + this.value = new Annotation(); + return this.value; + } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueIdentifier")) { + this.value = new Identifier(); + return this.value; + } + else if (name.equals("valueCodeableConcept")) { + this.value = new CodeableConcept(); + return this.value; + } + else if (name.equals("valueCoding")) { + this.value = new Coding(); + return this.value; + } + else if (name.equals("valueQuantity")) { + this.value = new Quantity(); + return this.value; + } + else if (name.equals("valueRange")) { + this.value = new Range(); + return this.value; + } + else if (name.equals("valuePeriod")) { + this.value = new Period(); + return this.value; + } + else if (name.equals("valueRatio")) { + this.value = new Ratio(); + return this.value; + } + else if (name.equals("valueSampledData")) { + this.value = new SampledData(); + return this.value; + } + else if (name.equals("valueSignature")) { + this.value = new Signature(); + return this.value; + } + else if (name.equals("valueHumanName")) { + this.value = new HumanName(); + return this.value; + } + else if (name.equals("valueAddress")) { + this.value = new Address(); + return this.value; + } + else if (name.equals("valueContactPoint")) { + this.value = new ContactPoint(); + return this.value; + } + else if (name.equals("valueTiming")) { + this.value = new Timing(); + return this.value; + } + else if (name.equals("valueReference")) { + this.value = new Reference(); + return this.value; + } + else if (name.equals("valueMeta")) { + this.value = new Meta(); + return this.value; + } + else + return super.addChild(name); + } + + public ElementDefinitionExampleComponent copy() { + ElementDefinitionExampleComponent dst = new ElementDefinitionExampleComponent(); + copyValues(dst); + dst.label = label == null ? null : label.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ElementDefinitionExampleComponent)) + return false; + ElementDefinitionExampleComponent o = (ElementDefinitionExampleComponent) other; + return compareDeep(label, o.label, true) && compareDeep(value, o.value, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ElementDefinitionExampleComponent)) + return false; + ElementDefinitionExampleComponent o = (ElementDefinitionExampleComponent) other; + return compareValues(label, o.label, true); + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(label, value); + } + + public String fhirType() { + return "ElementDefinition.example"; + + } + } @Block() @@ -3027,11 +3355,11 @@ public class ElementDefinition extends Type implements ICompositeType { protected org.hl7.fhir.dstu3.model.Type pattern; /** - * A sample value for this element demonstrating the type of information that would typically be captured. + * A sample value for this element demonstrating the type of information that would typically be found in the element. */ - @Child(name = "example", type = {}, order=20, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Example value (as defined for type)", formalDefinition="A sample value for this element demonstrating the type of information that would typically be captured." ) - protected org.hl7.fhir.dstu3.model.Type example; + @Child(name = "example", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Example value (as defined for type)", formalDefinition="A sample value for this element demonstrating the type of information that would typically be found in the element." ) + protected List example; /** * The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. @@ -3103,7 +3431,7 @@ public class ElementDefinition extends Type implements ICompositeType { @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) protected List mapping; - private static final long serialVersionUID = 1950918913L; + private static final long serialVersionUID = -976239057L; /** * Constructor @@ -3985,22 +4313,56 @@ public class ElementDefinition extends Type implements ICompositeType { } /** - * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) + * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be found in the element.) */ - public org.hl7.fhir.dstu3.model.Type getExample() { + public List getExample() { + if (this.example == null) + this.example = new ArrayList(); return this.example; } + /** + * @return Returns a reference to this for easy method chaining + */ + public ElementDefinition setExample(List theExample) { + this.example = theExample; + return this; + } + public boolean hasExample() { - return this.example != null && !this.example.isEmpty(); + if (this.example == null) + return false; + for (ElementDefinitionExampleComponent item : this.example) + if (!item.isEmpty()) + return true; + return false; + } + + public ElementDefinitionExampleComponent addExample() { //3 + ElementDefinitionExampleComponent t = new ElementDefinitionExampleComponent(); + if (this.example == null) + this.example = new ArrayList(); + this.example.add(t); + return t; + } + + public ElementDefinition addExample(ElementDefinitionExampleComponent t) { //3 + if (t == null) + return this; + if (this.example == null) + this.example = new ArrayList(); + this.example.add(t); + return this; } /** - * @param value {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) + * @return The first repetition of repeating field {@link #example}, creating it if it does not already exist */ - public ElementDefinition setExample(org.hl7.fhir.dstu3.model.Type value) { - this.example = value; - return this; + public ElementDefinitionExampleComponent getExampleFirstRep() { + if (getExample().isEmpty()) { + addExample(); + } + return getExample().get(0); } /** @@ -4668,7 +5030,7 @@ public class ElementDefinition extends Type implements ICompositeType { childrenList.add(new Property("meaningWhenMissing", "markdown", "The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.", 0, java.lang.Integer.MAX_VALUE, meaningWhenMissing)); childrenList.add(new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, java.lang.Integer.MAX_VALUE, fixed)); childrenList.add(new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, java.lang.Integer.MAX_VALUE, pattern)); - childrenList.add(new Property("example[x]", "*", "A 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("example", "", "A sample value for this element demonstrating the type of information that would typically be found in the element.", 0, java.lang.Integer.MAX_VALUE, example)); childrenList.add(new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, java.lang.Integer.MAX_VALUE, minValue)); childrenList.add(new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, java.lang.Integer.MAX_VALUE, maxValue)); childrenList.add(new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, java.lang.Integer.MAX_VALUE, maxLength)); @@ -4704,7 +5066,7 @@ public class ElementDefinition extends Type implements ICompositeType { case 1857257103: /*meaningWhenMissing*/ return this.meaningWhenMissing == null ? new Base[0] : new Base[] {this.meaningWhenMissing}; // MarkdownType case 97445748: /*fixed*/ return this.fixed == null ? new Base[0] : new Base[] {this.fixed}; // org.hl7.fhir.dstu3.model.Type case -791090288: /*pattern*/ return this.pattern == null ? new Base[0] : new Base[] {this.pattern}; // org.hl7.fhir.dstu3.model.Type - case -1322970774: /*example*/ return this.example == null ? new Base[0] : new Base[] {this.example}; // org.hl7.fhir.dstu3.model.Type + case -1322970774: /*example*/ return this.example == null ? new Base[0] : this.example.toArray(new Base[this.example.size()]); // ElementDefinitionExampleComponent case -1376969153: /*minValue*/ return this.minValue == null ? new Base[0] : new Base[] {this.minValue}; // Type case 399227501: /*maxValue*/ return this.maxValue == null ? new Base[0] : new Base[] {this.maxValue}; // Type case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType @@ -4784,7 +5146,7 @@ public class ElementDefinition extends Type implements ICompositeType { this.pattern = castToType(value); // org.hl7.fhir.dstu3.model.Type break; case -1322970774: // example - this.example = castToType(value); // org.hl7.fhir.dstu3.model.Type + this.getExample().add((ElementDefinitionExampleComponent) value); // ElementDefinitionExampleComponent break; case -1376969153: // minValue this.minValue = castToType(value); // Type @@ -4863,8 +5225,8 @@ public class ElementDefinition extends Type implements ICompositeType { this.fixed = castToType(value); // org.hl7.fhir.dstu3.model.Type else if (name.equals("pattern[x]")) this.pattern = castToType(value); // org.hl7.fhir.dstu3.model.Type - else if (name.equals("example[x]")) - this.example = castToType(value); // org.hl7.fhir.dstu3.model.Type + else if (name.equals("example")) + this.getExample().add((ElementDefinitionExampleComponent) value); else if (name.equals("minValue[x]")) this.minValue = castToType(value); // Type else if (name.equals("maxValue[x]")) @@ -4912,7 +5274,7 @@ public class ElementDefinition extends Type implements ICompositeType { case 1857257103: throw new FHIRException("Cannot make property meaningWhenMissing as it is not a complex type"); // MarkdownType case -391522164: return getFixed(); // org.hl7.fhir.dstu3.model.Type case -885125392: return getPattern(); // org.hl7.fhir.dstu3.model.Type - case -2002328874: return getExample(); // org.hl7.fhir.dstu3.model.Type + case -1322970774: return addExample(); // ElementDefinitionExampleComponent case -55301663: return getMinValue(); // Type case 622130931: return getMaxValue(); // Type case -791400086: throw new FHIRException("Cannot make property maxLength as it is not a complex type"); // IntegerType @@ -5379,137 +5741,8 @@ public class ElementDefinition extends Type implements ICompositeType { this.pattern = new Meta(); return this.pattern; } - else if (name.equals("exampleBoolean")) { - this.example = new BooleanType(); - return this.example; - } - else if (name.equals("exampleInteger")) { - this.example = new IntegerType(); - return this.example; - } - else if (name.equals("exampleDecimal")) { - this.example = new DecimalType(); - return this.example; - } - else if (name.equals("exampleBase64Binary")) { - this.example = new Base64BinaryType(); - return this.example; - } - else if (name.equals("exampleInstant")) { - this.example = new InstantType(); - return this.example; - } - else if (name.equals("exampleString")) { - this.example = new StringType(); - return this.example; - } - else if (name.equals("exampleUri")) { - this.example = new UriType(); - return this.example; - } - else if (name.equals("exampleDate")) { - this.example = new DateType(); - return this.example; - } - else if (name.equals("exampleDateTime")) { - this.example = new DateTimeType(); - return this.example; - } - else if (name.equals("exampleTime")) { - this.example = new TimeType(); - return this.example; - } - else if (name.equals("exampleCode")) { - this.example = new CodeType(); - return this.example; - } - else if (name.equals("exampleOid")) { - this.example = new OidType(); - return this.example; - } - else if (name.equals("exampleId")) { - this.example = new IdType(); - return this.example; - } - else if (name.equals("exampleUnsignedInt")) { - this.example = new UnsignedIntType(); - return this.example; - } - else if (name.equals("examplePositiveInt")) { - this.example = new PositiveIntType(); - return this.example; - } - else if (name.equals("exampleMarkdown")) { - this.example = new MarkdownType(); - return this.example; - } - else if (name.equals("exampleAnnotation")) { - this.example = new Annotation(); - return this.example; - } - else if (name.equals("exampleAttachment")) { - this.example = new Attachment(); - return this.example; - } - else if (name.equals("exampleIdentifier")) { - this.example = new Identifier(); - return this.example; - } - else if (name.equals("exampleCodeableConcept")) { - this.example = new CodeableConcept(); - return this.example; - } - else if (name.equals("exampleCoding")) { - this.example = new Coding(); - return this.example; - } - else if (name.equals("exampleQuantity")) { - this.example = new Quantity(); - return this.example; - } - else if (name.equals("exampleRange")) { - this.example = new Range(); - return this.example; - } - else if (name.equals("examplePeriod")) { - this.example = new Period(); - return this.example; - } - else if (name.equals("exampleRatio")) { - this.example = new Ratio(); - return this.example; - } - else if (name.equals("exampleSampledData")) { - this.example = new SampledData(); - return this.example; - } - else if (name.equals("exampleSignature")) { - this.example = new Signature(); - return this.example; - } - else if (name.equals("exampleHumanName")) { - this.example = new HumanName(); - return this.example; - } - else if (name.equals("exampleAddress")) { - this.example = new Address(); - return this.example; - } - else if (name.equals("exampleContactPoint")) { - this.example = new ContactPoint(); - return this.example; - } - else if (name.equals("exampleTiming")) { - this.example = new Timing(); - return this.example; - } - else if (name.equals("exampleReference")) { - this.example = new Reference(); - return this.example; - } - else if (name.equals("exampleMeta")) { - this.example = new Meta(); - return this.example; + else if (name.equals("example")) { + return addExample(); } else if (name.equals("minValueDate")) { this.minValue = new DateType(); @@ -5656,7 +5889,11 @@ public class ElementDefinition extends Type implements ICompositeType { dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy(); dst.fixed = fixed == null ? null : fixed.copy(); dst.pattern = pattern == null ? null : pattern.copy(); - dst.example = example == null ? null : example.copy(); + if (example != null) { + dst.example = new ArrayList(); + for (ElementDefinitionExampleComponent i : example) + dst.example.add(i.copy()); + }; dst.minValue = minValue == null ? null : minValue.copy(); dst.maxValue = maxValue == null ? null : maxValue.copy(); dst.maxLength = maxLength == null ? null : maxLength.copy(); @@ -5741,6 +5978,13 @@ public class ElementDefinition extends Type implements ICompositeType { return getPath(); } + public void makeBase(String path, int min, String max) { + ElementDefinitionBaseComponent self = getBase(); + self.setPath(path); + self.setMin(min); + self.setMax(max); + } + // end addition diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EligibilityRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EligibilityRequest.java index bfd83bd265e..b4bab31662f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EligibilityRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EligibilityRequest.java @@ -29,12 +29,11 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.dstu3.model.Enumerations.*; import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.api.annotation.Child; @@ -44,26 +43,26 @@ import ca.uhn.fhir.model.api.annotation.Block; import org.hl7.fhir.instance.model.api.*; import org.hl7.fhir.exceptions.FHIRException; /** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + * This resource provides the details from the insurer to identify a specified coverage and optionally some class of service. */ @ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest") public class EligibilityRequest extends DomainResource { public enum EligibilityRequestStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +96,19 @@ public class EligibilityRequest extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/eligibilityrequest-status"; - case CANCELLED: return "http://hl7.org/fhir/eligibilityrequest-status"; - case DRAFT: return "http://hl7.org/fhir/eligibilityrequest-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/eligibilityrequest-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +117,7 @@ public class EligibilityRequest extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -181,50 +180,61 @@ public class EligibilityRequest extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/eligibilityrequest-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; + @Child(name = "priority", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/process-priority") + protected CodeableConcept priority; /** - * The style (standard) and version of the original material which was converted into this resource. + * Patient Resource. */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; + @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=false) + @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; + + /** + * The date or dates when the enclosed suite of services were performed or completed. + */ + @Child(name = "serviced", type = {DateType.class, Period.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Estimated date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) + protected Type serviced; /** * The date when this resource was created. */ - @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) protected DateTimeType created; /** - * The Insurer who is target of the request. + * Person who created the invoice/claim/pre-determination or pre-authorization. */ - @Child(name = "insurer", type = {Organization.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Target", formalDefinition="The Insurer who is target of the request." ) - protected Reference insurer; + @Child(name = "enterer", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=false) + @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 (The Insurer who is target of the request.) + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) */ - protected Organization insurerTarget; + protected Practitioner entererTarget; /** * The practitioner who is responsible for the services rendered to the patient. */ - @Child(name = "provider", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Child(name = "provider", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) protected Reference provider; @@ -236,7 +246,7 @@ public class EligibilityRequest extends DomainResource { /** * The organization which is responsible for the services rendered to the patient. */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "organization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) protected Reference organization; @@ -246,24 +256,16 @@ public class EligibilityRequest extends DomainResource { protected Organization organizationTarget; /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + * The Insurer who is target of the request. */ - @Child(name = "priority", type = {Coding.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/process-priority") - protected Coding priority; + @Child(name = "insurer", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Target", formalDefinition="The Insurer who is target of the request." ) + protected Reference insurer; /** - * Person who created the invoice/claim/pre-determination or pre-authorization. + * The actual object that is the target of the reference (The Insurer who is target of the request.) */ - @Child(name = "enterer", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) - @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; + protected Organization insurerTarget; /** * Facility where the services were provided. @@ -277,22 +279,10 @@ public class EligibilityRequest extends DomainResource { */ protected Location facilityTarget; - /** - * Patient Resource. - */ - @Child(name = "patient", type = {Patient.class}, order=11, min=0, max=1, modifier=false, summary=false) - @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 = {Coverage.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "coverage", type = {Coverage.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) protected Reference coverage; @@ -304,34 +294,27 @@ public class EligibilityRequest extends DomainResource { /** * The contract number of a business agreement which describes the terms and conditions. */ - @Child(name = "businessArrangement", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "businessArrangement", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) protected StringType businessArrangement; - /** - * The date or dates when the enclosed suite of services were performed or completed. - */ - @Child(name = "serviced", type = {DateType.class, Period.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Estimated date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) - protected Type serviced; - /** * Dental, Vision, Medical, Pharmacy, Rehab etc. */ - @Child(name = "benefitCategory", type = {Coding.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "benefitCategory", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-category") - protected Coding benefitCategory; + protected CodeableConcept benefitCategory; /** * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. */ - @Child(name = "benefitSubCategory", type = {Coding.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Child(name = "benefitSubCategory", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding benefitSubCategory; + protected CodeableConcept benefitSubCategory; - private static final long serialVersionUID = 1887582857L; + private static final long serialVersionUID = 899259023L; /** * Constructor @@ -340,14 +323,6 @@ public class EligibilityRequest extends DomainResource { super(); } - /** - * Constructor - */ - public EligibilityRequest(Enumeration status) { - super(); - this.status = status; - } - /** * @return {@link #identifier} (The Response business identifier.) */ @@ -440,57 +415,126 @@ public class EligibilityRequest extends DomainResource { * @param value The status of the resource instance. */ public EligibilityRequest setStatus(EligibilityRequestStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new EligibilityRequestStatusEnumFactory()); this.status.setValue(value); + } return this; } /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) */ - public Coding getRuleset() { - if (this.ruleset == null) + public CodeableConcept getPriority() { + if (this.priority == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.ruleset"); + throw new Error("Attempt to auto-create EligibilityRequest.priority"); else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; + this.priority = new CodeableConcept(); // cc + return this.priority; } - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); } /** - * @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.) + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) */ - public EligibilityRequest setRuleset(Coding value) { - this.ruleset = value; + public EligibilityRequest setPriority(CodeableConcept value) { + this.priority = value; return this; } /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + * @return {@link #patient} (Patient Resource.) */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) + public Reference getPatient() { + if (this.patient == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.originalRuleset"); + throw new Error("Attempt to auto-create EligibilityRequest.patient"); else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; + this.patient = new Reference(); // cc + return this.patient; } - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); } /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + * @param value {@link #patient} (Patient Resource.) */ - public EligibilityRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; + public EligibilityRequest 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 EligibilityRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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 EligibilityRequest setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public Type getServiced() { + return this.serviced; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public DateType getServicedDateType() throws FHIRException { + if (!(this.serviced instanceof DateType)) + throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered"); + return (DateType) this.serviced; + } + + public boolean hasServicedDateType() { + return this.serviced instanceof DateType; + } + + /** + * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public Period getServicedPeriod() throws FHIRException { + if (!(this.serviced instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered"); + return (Period) this.serviced; + } + + public boolean hasServicedPeriod() { + return this.serviced instanceof Period; + } + + public boolean hasServiced() { + return this.serviced != null && !this.serviced.isEmpty(); + } + + /** + * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) + */ + public EligibilityRequest setServiced(Type value) { + this.serviced = value; return this; } @@ -544,46 +588,46 @@ public class EligibilityRequest extends DomainResource { } /** - * @return {@link #insurer} (The Insurer who is target of the request.) + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) */ - public Reference getInsurer() { - if (this.insurer == null) + public Reference getEnterer() { + if (this.enterer == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.insurer"); + throw new Error("Attempt to auto-create EligibilityRequest.enterer"); else if (Configuration.doAutoCreate()) - this.insurer = new Reference(); // cc - return this.insurer; + this.enterer = new Reference(); // cc + return this.enterer; } - public boolean hasInsurer() { - return this.insurer != null && !this.insurer.isEmpty(); + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); } /** - * @param value {@link #insurer} (The Insurer who is target of the request.) + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) */ - public EligibilityRequest setInsurer(Reference value) { - this.insurer = value; + public EligibilityRequest setEnterer(Reference value) { + this.enterer = value; return this; } /** - * @return {@link #insurer} 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 Insurer who is target of the request.) + * @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 Organization getInsurerTarget() { - if (this.insurerTarget == null) + public Practitioner getEntererTarget() { + if (this.entererTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.insurer"); + throw new Error("Attempt to auto-create EligibilityRequest.enterer"); else if (Configuration.doAutoCreate()) - this.insurerTarget = new Organization(); // aa - return this.insurerTarget; + this.entererTarget = new Practitioner(); // aa + return this.entererTarget; } /** - * @param value {@link #insurer} 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.) + * @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 EligibilityRequest setInsurerTarget(Organization value) { - this.insurerTarget = value; + public EligibilityRequest setEntererTarget(Practitioner value) { + this.entererTarget = value; return this; } @@ -676,70 +720,46 @@ public class EligibilityRequest extends DomainResource { } /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + * @return {@link #insurer} (The Insurer who is target of the request.) */ - public Coding getPriority() { - if (this.priority == null) + public Reference getInsurer() { + if (this.insurer == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.priority"); + throw new Error("Attempt to auto-create EligibilityRequest.insurer"); else if (Configuration.doAutoCreate()) - this.priority = new Coding(); // cc - return this.priority; + this.insurer = new Reference(); // cc + return this.insurer; } - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); + public boolean hasInsurer() { + return this.insurer != null && !this.insurer.isEmpty(); } /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + * @param value {@link #insurer} (The Insurer who is target of the request.) */ - public EligibilityRequest setPriority(Coding value) { - this.priority = value; + public EligibilityRequest setInsurer(Reference value) { + this.insurer = value; return this; } /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + * @return {@link #insurer} 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 Insurer who is target of the request.) */ - public Reference getEnterer() { - if (this.enterer == null) + public Organization getInsurerTarget() { + if (this.insurerTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.enterer"); + throw new Error("Attempt to auto-create EligibilityRequest.insurer"); else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); // cc - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); + this.insurerTarget = new Organization(); // aa + return this.insurerTarget; } /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + * @param value {@link #insurer} 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 EligibilityRequest 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 EligibilityRequest.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); // aa - 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 EligibilityRequest setEntererTarget(Practitioner value) { - this.entererTarget = value; + public EligibilityRequest setInsurerTarget(Organization value) { + this.insurerTarget = value; return this; } @@ -787,50 +807,6 @@ public class EligibilityRequest extends DomainResource { return this; } - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient Resource.) - */ - public EligibilityRequest 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 EligibilityRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - 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 EligibilityRequest setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - /** * @return {@link #coverage} (Financial instrument by which payment information for health care.) */ @@ -924,60 +900,15 @@ public class EligibilityRequest extends DomainResource { return this; } - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public Type getServiced() { - return this.serviced; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public DateType getServicedDateType() throws FHIRException { - if (!(this.serviced instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered"); - return (DateType) this.serviced; - } - - public boolean hasServicedDateType() { - return this.serviced instanceof DateType; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public Period getServicedPeriod() throws FHIRException { - if (!(this.serviced instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered"); - return (Period) this.serviced; - } - - public boolean hasServicedPeriod() { - return this.serviced instanceof Period; - } - - public boolean hasServiced() { - return this.serviced != null && !this.serviced.isEmpty(); - } - - /** - * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public EligibilityRequest setServiced(Type value) { - this.serviced = value; - return this; - } - /** * @return {@link #benefitCategory} (Dental, Vision, Medical, Pharmacy, Rehab etc.) */ - public Coding getBenefitCategory() { + public CodeableConcept getBenefitCategory() { if (this.benefitCategory == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create EligibilityRequest.benefitCategory"); else if (Configuration.doAutoCreate()) - this.benefitCategory = new Coding(); // cc + this.benefitCategory = new CodeableConcept(); // cc return this.benefitCategory; } @@ -988,7 +919,7 @@ public class EligibilityRequest extends DomainResource { /** * @param value {@link #benefitCategory} (Dental, Vision, Medical, Pharmacy, Rehab etc.) */ - public EligibilityRequest setBenefitCategory(Coding value) { + public EligibilityRequest setBenefitCategory(CodeableConcept value) { this.benefitCategory = value; return this; } @@ -996,12 +927,12 @@ public class EligibilityRequest extends DomainResource { /** * @return {@link #benefitSubCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) */ - public Coding getBenefitSubCategory() { + public CodeableConcept getBenefitSubCategory() { if (this.benefitSubCategory == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create EligibilityRequest.benefitSubCategory"); else if (Configuration.doAutoCreate()) - this.benefitSubCategory = new Coding(); // cc + this.benefitSubCategory = new CodeableConcept(); // cc return this.benefitSubCategory; } @@ -1012,7 +943,7 @@ public class EligibilityRequest extends DomainResource { /** * @param value {@link #benefitSubCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) */ - public EligibilityRequest setBenefitSubCategory(Coding value) { + public EligibilityRequest setBenefitSubCategory(CodeableConcept value) { this.benefitSubCategory = value; return this; } @@ -1021,21 +952,19 @@ public class EligibilityRequest extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - 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("priority", "CodeableConcept", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("insurer", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, insurer)); + 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("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("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - 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("insurer", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, insurer)); childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); childrenList.add(new Property("coverage", "Reference(Coverage)", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); - childrenList.add(new Property("benefitCategory", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, benefitCategory)); - childrenList.add(new Property("benefitSubCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, benefitSubCategory)); + childrenList.add(new Property("benefitCategory", "CodeableConcept", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, benefitCategory)); + childrenList.add(new Property("benefitSubCategory", "CodeableConcept", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, benefitSubCategory)); } @Override @@ -1043,21 +972,19 @@ public class EligibilityRequest extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference + case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Coding - case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference + case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Reference - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType - case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type - case -1023390027: /*benefitCategory*/ return this.benefitCategory == null ? new Base[0] : new Base[] {this.benefitCategory}; // Coding - case 1987878471: /*benefitSubCategory*/ return this.benefitSubCategory == null ? new Base[0] : new Base[] {this.benefitSubCategory}; // Coding + case -1023390027: /*benefitCategory*/ return this.benefitCategory == null ? new Base[0] : new Base[] {this.benefitCategory}; // CodeableConcept + case 1987878471: /*benefitSubCategory*/ return this.benefitSubCategory == null ? new Base[0] : new Base[] {this.benefitSubCategory}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -1072,17 +999,20 @@ public class EligibilityRequest extends DomainResource { case -892481550: // status this.status = new EligibilityRequestStatusEnumFactory().fromType(value); // Enumeration break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding + case -1165461084: // priority + this.priority = castToCodeableConcept(value); // CodeableConcept break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding + case -791418107: // patient + this.patient = castToReference(value); // Reference + break; + case 1379209295: // serviced + this.serviced = castToType(value); // Type break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType break; - case 1957615864: // insurer - this.insurer = castToReference(value); // Reference + case -1591951995: // enterer + this.enterer = castToReference(value); // Reference break; case -987494927: // provider this.provider = castToReference(value); // Reference @@ -1090,32 +1020,23 @@ public class EligibilityRequest extends DomainResource { case 1178922291: // organization this.organization = castToReference(value); // Reference break; - case -1165461084: // priority - this.priority = castToCoding(value); // Coding - break; - case -1591951995: // enterer - this.enterer = castToReference(value); // Reference + case 1957615864: // insurer + this.insurer = castToReference(value); // Reference break; case 501116579: // facility this.facility = castToReference(value); // Reference break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; case -351767064: // coverage this.coverage = castToReference(value); // Reference break; case 259920682: // businessArrangement this.businessArrangement = castToString(value); // StringType break; - case 1379209295: // serviced - this.serviced = castToType(value); // Type - break; case -1023390027: // benefitCategory - this.benefitCategory = castToCoding(value); // Coding + this.benefitCategory = castToCodeableConcept(value); // CodeableConcept break; case 1987878471: // benefitSubCategory - this.benefitSubCategory = castToCoding(value); // Coding + this.benefitSubCategory = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -1128,36 +1049,32 @@ public class EligibilityRequest extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new EligibilityRequestStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("priority")) + this.priority = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference + else if (name.equals("serviced[x]")) + this.serviced = castToType(value); // Type else if (name.equals("created")) this.created = castToDateTime(value); // DateTimeType - else if (name.equals("insurer")) - this.insurer = castToReference(value); // Reference + else if (name.equals("enterer")) + this.enterer = castToReference(value); // Reference else if (name.equals("provider")) this.provider = castToReference(value); // Reference else if (name.equals("organization")) this.organization = castToReference(value); // Reference - else if (name.equals("priority")) - this.priority = castToCoding(value); // Coding - else if (name.equals("enterer")) - this.enterer = castToReference(value); // Reference + else if (name.equals("insurer")) + this.insurer = castToReference(value); // Reference else if (name.equals("facility")) this.facility = castToReference(value); // Reference - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference else if (name.equals("coverage")) this.coverage = castToReference(value); // Reference else if (name.equals("businessArrangement")) this.businessArrangement = castToString(value); // StringType - else if (name.equals("serviced[x]")) - this.serviced = castToType(value); // Type else if (name.equals("benefitCategory")) - this.benefitCategory = castToCoding(value); // Coding + this.benefitCategory = castToCodeableConcept(value); // CodeableConcept else if (name.equals("benefitSubCategory")) - this.benefitSubCategory = castToCoding(value); // Coding + this.benefitSubCategory = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -1167,21 +1084,19 @@ public class EligibilityRequest extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding + case -1165461084: return getPriority(); // CodeableConcept + case -791418107: return getPatient(); // Reference + case -1927922223: return getServiced(); // Type case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1957615864: return getInsurer(); // Reference + case -1591951995: return getEnterer(); // Reference case -987494927: return getProvider(); // Reference case 1178922291: return getOrganization(); // Reference - case -1165461084: return getPriority(); // Coding - case -1591951995: return getEnterer(); // Reference + case 1957615864: return getInsurer(); // Reference case 501116579: return getFacility(); // Reference - case -791418107: return getPatient(); // Reference case -351767064: return getCoverage(); // Reference case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType - case -1927922223: return getServiced(); // Type - case -1023390027: return getBenefitCategory(); // Coding - case 1987878471: return getBenefitSubCategory(); // Coding + case -1023390027: return getBenefitCategory(); // CodeableConcept + case 1987878471: return getBenefitSubCategory(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -1195,52 +1110,14 @@ public class EligibilityRequest extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.status"); } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.created"); - } - else if (name.equals("insurer")) { - this.insurer = new Reference(); - return this.insurer; - } - else if (name.equals("provider")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; - } else if (name.equals("priority")) { - this.priority = new Coding(); + this.priority = new CodeableConcept(); return this.priority; } - else if (name.equals("enterer")) { - this.enterer = new Reference(); - return this.enterer; - } - else if (name.equals("facility")) { - this.facility = new Reference(); - return this.facility; - } else if (name.equals("patient")) { this.patient = new Reference(); return this.patient; } - else if (name.equals("coverage")) { - this.coverage = new Reference(); - return this.coverage; - } - else if (name.equals("businessArrangement")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.businessArrangement"); - } else if (name.equals("servicedDate")) { this.serviced = new DateType(); return this.serviced; @@ -1249,12 +1126,42 @@ public class EligibilityRequest extends DomainResource { this.serviced = new Period(); return this.serviced; } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.created"); + } + else if (name.equals("enterer")) { + this.enterer = new Reference(); + return this.enterer; + } + else if (name.equals("provider")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("organization")) { + this.organization = new Reference(); + return this.organization; + } + else if (name.equals("insurer")) { + this.insurer = new Reference(); + return this.insurer; + } + else if (name.equals("facility")) { + this.facility = new Reference(); + return this.facility; + } + else if (name.equals("coverage")) { + this.coverage = new Reference(); + return this.coverage; + } + else if (name.equals("businessArrangement")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.businessArrangement"); + } else if (name.equals("benefitCategory")) { - this.benefitCategory = new Coding(); + this.benefitCategory = new CodeableConcept(); return this.benefitCategory; } else if (name.equals("benefitSubCategory")) { - this.benefitSubCategory = new Coding(); + this.benefitSubCategory = new CodeableConcept(); return this.benefitSubCategory; } else @@ -1275,19 +1182,17 @@ public class EligibilityRequest extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.serviced = serviced == null ? null : serviced.copy(); dst.created = created == null ? null : created.copy(); - dst.insurer = insurer == null ? null : insurer.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); + dst.insurer = insurer == null ? null : insurer.copy(); dst.facility = facility == null ? null : facility.copy(); - dst.patient = patient == null ? null : patient.copy(); dst.coverage = coverage == null ? null : coverage.copy(); dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.serviced = serviced == null ? null : serviced.copy(); dst.benefitCategory = benefitCategory == null ? null : benefitCategory.copy(); dst.benefitSubCategory = benefitSubCategory == null ? null : benefitSubCategory.copy(); return dst; @@ -1304,12 +1209,11 @@ public class EligibilityRequest extends DomainResource { if (!(other instanceof EligibilityRequest)) return false; EligibilityRequest o = (EligibilityRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(insurer, o.insurer, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(priority, o.priority, true) && compareDeep(enterer, o.enterer, true) && compareDeep(facility, o.facility, true) - && compareDeep(patient, o.patient, true) && compareDeep(coverage, o.coverage, true) && compareDeep(businessArrangement, o.businessArrangement, true) - && compareDeep(serviced, o.serviced, true) && compareDeep(benefitCategory, o.benefitCategory, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(priority, o.priority, true) + && compareDeep(patient, o.patient, true) && compareDeep(serviced, o.serviced, true) && compareDeep(created, o.created, true) + && compareDeep(enterer, o.enterer, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) + && compareDeep(insurer, o.insurer, true) && compareDeep(facility, o.facility, true) && compareDeep(coverage, o.coverage, true) + && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(benefitCategory, o.benefitCategory, true) && compareDeep(benefitSubCategory, o.benefitSubCategory, true); } @@ -1325,10 +1229,9 @@ public class EligibilityRequest extends DomainResource { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, ruleset - , originalRuleset, created, insurer, provider, organization, priority, enterer - , facility, patient, coverage, businessArrangement, serviced, benefitCategory, benefitSubCategory - ); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, priority + , patient, serviced, created, enterer, provider, organization, insurer, facility + , coverage, businessArrangement, benefitCategory, benefitSubCategory); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EligibilityResponse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EligibilityResponse.java index 714435e518d..f4ed3570b72 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EligibilityResponse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EligibilityResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -51,19 +51,19 @@ public class EligibilityResponse extends DomainResource { public enum EligibilityResponseStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +97,19 @@ public class EligibilityResponse extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/eligibilityresponse-status"; - case CANCELLED: return "http://hl7.org/fhir/eligibilityresponse-status"; - case DRAFT: return "http://hl7.org/fhir/eligibilityresponse-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/eligibilityresponse-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +118,7 @@ public class EligibilityResponse extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -171,70 +171,381 @@ public class EligibilityResponse extends DomainResource { } } + @Block() + public static class InsuranceComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A suite of updated or additional Coverages from the Insurer. + */ + @Child(name = "coverage", type = {Coverage.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Updated Coverage details", formalDefinition="A suite of updated or additional Coverages from the Insurer." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (A suite of updated or additional Coverages from the Insurer.) + */ + protected Coverage coverageTarget; + + /** + * The contract resource which may provide more detailed information. + */ + @Child(name = "contract", type = {Contract.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Contract details", formalDefinition="The contract resource which may provide more detailed information." ) + protected Reference contract; + + /** + * The actual object that is the target of the reference (The contract resource which may provide more detailed information.) + */ + protected Contract contractTarget; + + /** + * Benefits and optionally current balances by Category. + */ + @Child(name = "benefitBalance", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Benefits by Category", formalDefinition="Benefits and optionally current balances by Category." ) + protected List benefitBalance; + + private static final long serialVersionUID = 821384102L; + + /** + * Constructor + */ + public InsuranceComponent() { + super(); + } + + /** + * @return {@link #coverage} (A suite of updated or additional Coverages from the Insurer.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InsuranceComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); // cc + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (A suite of updated or additional Coverages from the Insurer.) + */ + public InsuranceComponent 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. (A suite of updated or additional Coverages from the Insurer.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InsuranceComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); // aa + 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. (A suite of updated or additional Coverages from the Insurer.) + */ + public InsuranceComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #contract} (The contract resource which may provide more detailed information.) + */ + public Reference getContract() { + if (this.contract == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InsuranceComponent.contract"); + else if (Configuration.doAutoCreate()) + this.contract = new Reference(); // cc + return this.contract; + } + + public boolean hasContract() { + return this.contract != null && !this.contract.isEmpty(); + } + + /** + * @param value {@link #contract} (The contract resource which may provide more detailed information.) + */ + public InsuranceComponent setContract(Reference value) { + this.contract = value; + return this; + } + + /** + * @return {@link #contract} 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 contract resource which may provide more detailed information.) + */ + public Contract getContractTarget() { + if (this.contractTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InsuranceComponent.contract"); + else if (Configuration.doAutoCreate()) + this.contractTarget = new Contract(); // aa + return this.contractTarget; + } + + /** + * @param value {@link #contract} 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 contract resource which may provide more detailed information.) + */ + public InsuranceComponent setContractTarget(Contract value) { + this.contractTarget = value; + return this; + } + + /** + * @return {@link #benefitBalance} (Benefits and optionally current balances by Category.) + */ + public List getBenefitBalance() { + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + return this.benefitBalance; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public InsuranceComponent setBenefitBalance(List theBenefitBalance) { + this.benefitBalance = theBenefitBalance; + return this; + } + + public boolean hasBenefitBalance() { + if (this.benefitBalance == null) + return false; + for (BenefitsComponent item : this.benefitBalance) + if (!item.isEmpty()) + return true; + return false; + } + + public BenefitsComponent addBenefitBalance() { //3 + BenefitsComponent t = new BenefitsComponent(); + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + this.benefitBalance.add(t); + return t; + } + + public InsuranceComponent addBenefitBalance(BenefitsComponent t) { //3 + if (t == null) + return this; + if (this.benefitBalance == null) + this.benefitBalance = new ArrayList(); + this.benefitBalance.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #benefitBalance}, creating it if it does not already exist + */ + public BenefitsComponent getBenefitBalanceFirstRep() { + if (getBenefitBalance().isEmpty()) { + addBenefitBalance(); + } + return getBenefitBalance().get(0); + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("coverage", "Reference(Coverage)", "A suite of updated or additional Coverages from the Insurer.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("contract", "Reference(Contract)", "The contract resource which may provide more detailed information.", 0, java.lang.Integer.MAX_VALUE, contract)); + childrenList.add(new Property("benefitBalance", "", "Benefits and optionally current balances by Category.", 0, java.lang.Integer.MAX_VALUE, benefitBalance)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference + case -566947566: /*contract*/ return this.contract == null ? new Base[0] : new Base[] {this.contract}; // Reference + case 596003397: /*benefitBalance*/ return this.benefitBalance == null ? new Base[0] : this.benefitBalance.toArray(new Base[this.benefitBalance.size()]); // BenefitsComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -351767064: // coverage + this.coverage = castToReference(value); // Reference + break; + case -566947566: // contract + this.contract = castToReference(value); // Reference + break; + case 596003397: // benefitBalance + this.getBenefitBalance().add((BenefitsComponent) value); // BenefitsComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("coverage")) + this.coverage = castToReference(value); // Reference + else if (name.equals("contract")) + this.contract = castToReference(value); // Reference + else if (name.equals("benefitBalance")) + this.getBenefitBalance().add((BenefitsComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -351767064: return getCoverage(); // Reference + case -566947566: return getContract(); // Reference + case 596003397: return addBenefitBalance(); // BenefitsComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("coverage")) { + this.coverage = new Reference(); + return this.coverage; + } + else if (name.equals("contract")) { + this.contract = new Reference(); + return this.contract; + } + else if (name.equals("benefitBalance")) { + return addBenefitBalance(); + } + else + return super.addChild(name); + } + + public InsuranceComponent copy() { + InsuranceComponent dst = new InsuranceComponent(); + copyValues(dst); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.contract = contract == null ? null : contract.copy(); + if (benefitBalance != null) { + dst.benefitBalance = new ArrayList(); + for (BenefitsComponent i : benefitBalance) + dst.benefitBalance.add(i.copy()); + }; + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof InsuranceComponent)) + return false; + InsuranceComponent o = (InsuranceComponent) other; + return compareDeep(coverage, o.coverage, true) && compareDeep(contract, o.contract, true) && compareDeep(benefitBalance, o.benefitBalance, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof InsuranceComponent)) + return false; + InsuranceComponent o = (InsuranceComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(coverage, contract, benefitBalance + ); + } + + public String fhirType() { + return "EligibilityResponse.insurance"; + + } + + } + @Block() public static class BenefitsComponent extends BackboneElement implements IBaseBackboneElement { /** * Dental, Vision, Medical, Pharmacy, Rehab etc. */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-category") - protected Coding category; + protected CodeableConcept category; /** * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. */ - @Child(name = "subCategory", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "subCategory", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding subCategory; + protected CodeableConcept subCategory; + + /** + * True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage. + */ + @Child(name = "excluded", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Excluded from the plan", formalDefinition="True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage." ) + protected BooleanType excluded; /** * A short name or tag for the benefit, for example MED01, or DENT2. */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "name", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Short name for the benefit", formalDefinition="A short name or tag for the benefit, for example MED01, or DENT2." ) protected StringType name; /** * A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'. */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Description of the benefit", formalDefinition="A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'." ) protected StringType description; /** * Network designation. */ - @Child(name = "network", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "network", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="In or out of network", formalDefinition="Network designation." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-network") - protected Coding network; + protected CodeableConcept network; /** * Unit designation: individual or family. */ - @Child(name = "unit", type = {Coding.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Child(name = "unit", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Individual or family", formalDefinition="Unit designation: individual or family." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-unit") - protected Coding unit; + protected CodeableConcept unit; /** * The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'. */ - @Child(name = "term", type = {Coding.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "term", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Annual or lifetime", formalDefinition="The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-term") - protected Coding term; + protected CodeableConcept term; /** * Benefits Used to date. */ - @Child(name = "financial", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "financial", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Benefit Summary", formalDefinition="Benefits Used to date." ) protected List financial; - private static final long serialVersionUID = -1090359286L; + private static final long serialVersionUID = 833826021L; /** * Constructor @@ -246,7 +557,7 @@ public class EligibilityResponse extends DomainResource { /** * Constructor */ - public BenefitsComponent(Coding category) { + public BenefitsComponent(CodeableConcept category) { super(); this.category = category; } @@ -254,12 +565,12 @@ public class EligibilityResponse extends DomainResource { /** * @return {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitsComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -270,7 +581,7 @@ public class EligibilityResponse extends DomainResource { /** * @param value {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) */ - public BenefitsComponent setCategory(Coding value) { + public BenefitsComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -278,12 +589,12 @@ public class EligibilityResponse extends DomainResource { /** * @return {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) */ - public Coding getSubCategory() { + public CodeableConcept getSubCategory() { if (this.subCategory == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitsComponent.subCategory"); else if (Configuration.doAutoCreate()) - this.subCategory = new Coding(); // cc + this.subCategory = new CodeableConcept(); // cc return this.subCategory; } @@ -294,11 +605,56 @@ public class EligibilityResponse extends DomainResource { /** * @param value {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) */ - public BenefitsComponent setSubCategory(Coding value) { + public BenefitsComponent setSubCategory(CodeableConcept value) { this.subCategory = value; return this; } + /** + * @return {@link #excluded} (True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.). This is the underlying object with id, value and extensions. The accessor "getExcluded" gives direct access to the value + */ + public BooleanType getExcludedElement() { + if (this.excluded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitsComponent.excluded"); + else if (Configuration.doAutoCreate()) + this.excluded = new BooleanType(); // bb + return this.excluded; + } + + public boolean hasExcludedElement() { + return this.excluded != null && !this.excluded.isEmpty(); + } + + public boolean hasExcluded() { + return this.excluded != null && !this.excluded.isEmpty(); + } + + /** + * @param value {@link #excluded} (True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.). This is the underlying object with id, value and extensions. The accessor "getExcluded" gives direct access to the value + */ + public BenefitsComponent setExcludedElement(BooleanType value) { + this.excluded = value; + return this; + } + + /** + * @return True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage. + */ + public boolean getExcluded() { + return this.excluded == null || this.excluded.isEmpty() ? false : this.excluded.getValue(); + } + + /** + * @param value True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage. + */ + public BenefitsComponent setExcluded(boolean value) { + if (this.excluded == null) + this.excluded = new BooleanType(); + this.excluded.setValue(value); + return this; + } + /** * @return {@link #name} (A short name or tag for the benefit, for example MED01, or DENT2.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value */ @@ -400,12 +756,12 @@ public class EligibilityResponse extends DomainResource { /** * @return {@link #network} (Network designation.) */ - public Coding getNetwork() { + public CodeableConcept getNetwork() { if (this.network == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitsComponent.network"); else if (Configuration.doAutoCreate()) - this.network = new Coding(); // cc + this.network = new CodeableConcept(); // cc return this.network; } @@ -416,7 +772,7 @@ public class EligibilityResponse extends DomainResource { /** * @param value {@link #network} (Network designation.) */ - public BenefitsComponent setNetwork(Coding value) { + public BenefitsComponent setNetwork(CodeableConcept value) { this.network = value; return this; } @@ -424,12 +780,12 @@ public class EligibilityResponse extends DomainResource { /** * @return {@link #unit} (Unit designation: individual or family.) */ - public Coding getUnit() { + public CodeableConcept getUnit() { if (this.unit == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitsComponent.unit"); else if (Configuration.doAutoCreate()) - this.unit = new Coding(); // cc + this.unit = new CodeableConcept(); // cc return this.unit; } @@ -440,7 +796,7 @@ public class EligibilityResponse extends DomainResource { /** * @param value {@link #unit} (Unit designation: individual or family.) */ - public BenefitsComponent setUnit(Coding value) { + public BenefitsComponent setUnit(CodeableConcept value) { this.unit = value; return this; } @@ -448,12 +804,12 @@ public class EligibilityResponse extends DomainResource { /** * @return {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) */ - public Coding getTerm() { + public CodeableConcept getTerm() { if (this.term == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitsComponent.term"); else if (Configuration.doAutoCreate()) - this.term = new Coding(); // cc + this.term = new CodeableConcept(); // cc return this.term; } @@ -464,7 +820,7 @@ public class EligibilityResponse extends DomainResource { /** * @param value {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) */ - public BenefitsComponent setTerm(Coding value) { + public BenefitsComponent setTerm(CodeableConcept value) { this.term = value; return this; } @@ -524,26 +880,28 @@ public class EligibilityResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("subCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, subCategory)); + childrenList.add(new Property("category", "CodeableConcept", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("subCategory", "CodeableConcept", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, subCategory)); + childrenList.add(new Property("excluded", "boolean", "True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.", 0, java.lang.Integer.MAX_VALUE, excluded)); childrenList.add(new Property("name", "string", "A short name or tag for the benefit, for example MED01, or DENT2.", 0, java.lang.Integer.MAX_VALUE, name)); childrenList.add(new Property("description", "string", "A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("network", "Coding", "Network designation.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("unit", "Coding", "Unit designation: individual or family.", 0, java.lang.Integer.MAX_VALUE, unit)); - childrenList.add(new Property("term", "Coding", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("network", "CodeableConcept", "Network designation.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("unit", "CodeableConcept", "Unit designation: individual or family.", 0, java.lang.Integer.MAX_VALUE, unit)); + childrenList.add(new Property("term", "CodeableConcept", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.", 0, java.lang.Integer.MAX_VALUE, term)); childrenList.add(new Property("financial", "", "Benefits Used to date.", 0, java.lang.Integer.MAX_VALUE, financial)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1365024606: /*subCategory*/ return this.subCategory == null ? new Base[0] : new Base[] {this.subCategory}; // Coding + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1365024606: /*subCategory*/ return this.subCategory == null ? new Base[0] : new Base[] {this.subCategory}; // CodeableConcept + case 1994055114: /*excluded*/ return this.excluded == null ? new Base[0] : new Base[] {this.excluded}; // BooleanType case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // Coding - case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // Coding - case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // Coding + case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // CodeableConcept + case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // CodeableConcept + case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // CodeableConcept case 357555337: /*financial*/ return this.financial == null ? new Base[0] : this.financial.toArray(new Base[this.financial.size()]); // BenefitComponent default: return super.getProperty(hash, name, checkValid); } @@ -554,10 +912,13 @@ public class EligibilityResponse extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1365024606: // subCategory - this.subCategory = castToCoding(value); // Coding + this.subCategory = castToCodeableConcept(value); // CodeableConcept + break; + case 1994055114: // excluded + this.excluded = castToBoolean(value); // BooleanType break; case 3373707: // name this.name = castToString(value); // StringType @@ -566,13 +927,13 @@ public class EligibilityResponse extends DomainResource { this.description = castToString(value); // StringType break; case 1843485230: // network - this.network = castToCoding(value); // Coding + this.network = castToCodeableConcept(value); // CodeableConcept break; case 3594628: // unit - this.unit = castToCoding(value); // Coding + this.unit = castToCodeableConcept(value); // CodeableConcept break; case 3556460: // term - this.term = castToCoding(value); // Coding + this.term = castToCodeableConcept(value); // CodeableConcept break; case 357555337: // financial this.getFinancial().add((BenefitComponent) value); // BenefitComponent @@ -585,19 +946,21 @@ public class EligibilityResponse extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("subCategory")) - this.subCategory = castToCoding(value); // Coding + this.subCategory = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("excluded")) + this.excluded = castToBoolean(value); // BooleanType else if (name.equals("name")) this.name = castToString(value); // StringType else if (name.equals("description")) this.description = castToString(value); // StringType else if (name.equals("network")) - this.network = castToCoding(value); // Coding + this.network = castToCodeableConcept(value); // CodeableConcept else if (name.equals("unit")) - this.unit = castToCoding(value); // Coding + this.unit = castToCodeableConcept(value); // CodeableConcept else if (name.equals("term")) - this.term = castToCoding(value); // Coding + this.term = castToCodeableConcept(value); // CodeableConcept else if (name.equals("financial")) this.getFinancial().add((BenefitComponent) value); else @@ -607,13 +970,14 @@ public class EligibilityResponse extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 50511102: return getCategory(); // Coding - case 1365024606: return getSubCategory(); // Coding + case 50511102: return getCategory(); // CodeableConcept + case 1365024606: return getSubCategory(); // CodeableConcept + case 1994055114: throw new FHIRException("Cannot make property excluded as it is not a complex type"); // BooleanType case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 1843485230: return getNetwork(); // Coding - case 3594628: return getUnit(); // Coding - case 3556460: return getTerm(); // Coding + case 1843485230: return getNetwork(); // CodeableConcept + case 3594628: return getUnit(); // CodeableConcept + case 3556460: return getTerm(); // CodeableConcept case 357555337: return addFinancial(); // BenefitComponent default: return super.makeProperty(hash, name); } @@ -623,13 +987,16 @@ public class EligibilityResponse extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("subCategory")) { - this.subCategory = new Coding(); + this.subCategory = new CodeableConcept(); return this.subCategory; } + else if (name.equals("excluded")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.excluded"); + } else if (name.equals("name")) { throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.name"); } @@ -637,15 +1004,15 @@ public class EligibilityResponse extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.description"); } else if (name.equals("network")) { - this.network = new Coding(); + this.network = new CodeableConcept(); return this.network; } else if (name.equals("unit")) { - this.unit = new Coding(); + this.unit = new CodeableConcept(); return this.unit; } else if (name.equals("term")) { - this.term = new Coding(); + this.term = new CodeableConcept(); return this.term; } else if (name.equals("financial")) { @@ -660,6 +1027,7 @@ public class EligibilityResponse extends DomainResource { copyValues(dst); dst.category = category == null ? null : category.copy(); dst.subCategory = subCategory == null ? null : subCategory.copy(); + dst.excluded = excluded == null ? null : excluded.copy(); dst.name = name == null ? null : name.copy(); dst.description = description == null ? null : description.copy(); dst.network = network == null ? null : network.copy(); @@ -681,9 +1049,9 @@ public class EligibilityResponse extends DomainResource { return false; BenefitsComponent o = (BenefitsComponent) other; return compareDeep(category, o.category, true) && compareDeep(subCategory, o.subCategory, true) - && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(network, o.network, true) - && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) && compareDeep(financial, o.financial, true) - ; + && compareDeep(excluded, o.excluded, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) + && compareDeep(network, o.network, true) && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) + && compareDeep(financial, o.financial, true); } @Override @@ -693,16 +1061,17 @@ public class EligibilityResponse extends DomainResource { if (!(other instanceof BenefitsComponent)) return false; BenefitsComponent o = (BenefitsComponent) other; - return compareValues(name, o.name, true) && compareValues(description, o.description, true); + return compareValues(excluded, o.excluded, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, subCategory, name - , description, network, unit, term, financial); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, subCategory, excluded + , name, description, network, unit, term, financial); } public String fhirType() { - return "EligibilityResponse.benefitBalance"; + return "EligibilityResponse.insurance.benefitBalance"; } @@ -713,10 +1082,10 @@ public class EligibilityResponse extends DomainResource { /** * Deductable, visits, benefit amount. */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Deductable, visits, benefit amount", formalDefinition="Deductable, visits, benefit amount." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-type") - protected Coding type; + protected CodeableConcept type; /** * Benefits allowed. @@ -732,7 +1101,7 @@ public class EligibilityResponse extends DomainResource { @Description(shortDefinition="Benefits used", formalDefinition="Benefits used." ) protected Type benefitUsed; - private static final long serialVersionUID = 1742418909L; + private static final long serialVersionUID = -1013861008L; /** * Constructor @@ -744,7 +1113,7 @@ public class EligibilityResponse extends DomainResource { /** * Constructor */ - public BenefitComponent(Coding type) { + public BenefitComponent(CodeableConcept type) { super(); this.type = type; } @@ -752,12 +1121,12 @@ public class EligibilityResponse extends DomainResource { /** * @return {@link #type} (Deductable, visits, benefit amount.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -768,7 +1137,7 @@ public class EligibilityResponse extends DomainResource { /** * @param value {@link #type} (Deductable, visits, benefit amount.) */ - public BenefitComponent setType(Coding value) { + public BenefitComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -878,7 +1247,7 @@ public class EligibilityResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Deductable, visits, benefit amount.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "Deductable, visits, benefit amount.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("benefit[x]", "unsignedInt|string|Money", "Benefits allowed.", 0, java.lang.Integer.MAX_VALUE, benefit)); childrenList.add(new Property("benefitUsed[x]", "unsignedInt|Money", "Benefits used.", 0, java.lang.Integer.MAX_VALUE, benefitUsed)); } @@ -886,7 +1255,7 @@ public class EligibilityResponse extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : new Base[] {this.benefit}; // Type case -549981964: /*benefitUsed*/ return this.benefitUsed == null ? new Base[0] : new Base[] {this.benefitUsed}; // Type default: return super.getProperty(hash, name, checkValid); @@ -898,7 +1267,7 @@ public class EligibilityResponse extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case -222710633: // benefit this.benefit = castToType(value); // Type @@ -914,7 +1283,7 @@ public class EligibilityResponse extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("benefit[x]")) this.benefit = castToType(value); // Type else if (name.equals("benefitUsed[x]")) @@ -926,7 +1295,7 @@ public class EligibilityResponse extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 952095881: return getBenefit(); // Type case 787635980: return getBenefitUsed(); // Type default: return super.makeProperty(hash, name); @@ -937,7 +1306,7 @@ public class EligibilityResponse extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("benefitUnsignedInt")) { @@ -1000,7 +1369,7 @@ public class EligibilityResponse extends DomainResource { } public String fhirType() { - return "EligibilityResponse.benefitBalance.financial"; + return "EligibilityResponse.insurance.benefitBalance.financial"; } @@ -1011,12 +1380,12 @@ public class EligibilityResponse extends DomainResource { /** * An error code,from a specified code system, which details why the eligibility check could not be performed. */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,from a specified code system, which details why the eligibility check could not be performed." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-error") - protected Coding code; + protected CodeableConcept code; - private static final long serialVersionUID = -739538393L; + private static final long serialVersionUID = -1048343046L; /** * Constructor @@ -1028,7 +1397,7 @@ public class EligibilityResponse extends DomainResource { /** * Constructor */ - public ErrorsComponent(Coding code) { + public ErrorsComponent(CodeableConcept code) { super(); this.code = code; } @@ -1036,12 +1405,12 @@ public class EligibilityResponse extends DomainResource { /** * @return {@link #code} (An error code,from a specified code system, which details why the eligibility check could not be performed.) */ - public Coding getCode() { + public CodeableConcept getCode() { if (this.code == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ErrorsComponent.code"); else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc + this.code = new CodeableConcept(); // cc return this.code; } @@ -1052,20 +1421,20 @@ public class EligibilityResponse extends DomainResource { /** * @param value {@link #code} (An error code,from a specified code system, which details why the eligibility check could not be performed.) */ - public ErrorsComponent setCode(Coding value) { + public ErrorsComponent setCode(CodeableConcept value) { this.code = value; return this; } protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "An error code,from a specified code system, which details why the eligibility check could not be performed.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("code", "CodeableConcept", "An error code,from a specified code system, which details why the eligibility check could not be performed.", 0, java.lang.Integer.MAX_VALUE, code)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -1075,7 +1444,7 @@ public class EligibilityResponse extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3059181: // code - this.code = castToCoding(value); // Coding + this.code = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -1085,7 +1454,7 @@ public class EligibilityResponse extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("code")) - this.code = castToCoding(value); // Coding + this.code = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -1093,7 +1462,7 @@ public class EligibilityResponse extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3059181: return getCode(); // Coding + case 3059181: return getCode(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -1102,7 +1471,7 @@ public class EligibilityResponse extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("code")) { - this.code = new Coding(); + this.code = new CodeableConcept(); return this.code; } else @@ -1157,77 +1526,22 @@ public class EligibilityResponse extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/eligibilityresponse-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; - /** - * Original request resource reference. - */ - @Child(name = "request", type = {EligibilityRequest.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource reference.) - */ - protected EligibilityRequest requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="complete | error | partial", formalDefinition="Transaction status: error, complete." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome") - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name = "created", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "created", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) protected DateTimeType created; - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - /** * The practitioner who is responsible for the services rendered to the patient. */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestProvider", type = {Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) protected Reference requestProvider; @@ -1239,7 +1553,7 @@ public class EligibilityResponse extends DomainResource { /** * The organization which is responsible for the services rendered to the patient. */ - @Child(name = "requestOrganization", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestOrganization", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) protected Reference requestOrganization; @@ -1248,48 +1562,75 @@ public class EligibilityResponse extends DomainResource { */ protected Organization requestOrganizationTarget; + /** + * Original request resource reference. + */ + @Child(name = "request", type = {EligibilityRequest.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Eligibility reference", formalDefinition="Original request resource reference." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource reference.) + */ + protected EligibilityRequest requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name = "outcome", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="complete | error | partial", formalDefinition="Transaction status: error, complete." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome") + protected CodeableConcept outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "insurer", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference insurer; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization insurerTarget; + /** * Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. */ - @Child(name = "inforce", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "inforce", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Coverage inforce", formalDefinition="Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates." ) protected BooleanType inforce; /** - * The contract resource which may provide more detailed information. + * The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer. */ - @Child(name = "contract", type = {Contract.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract details", formalDefinition="The contract resource which may provide more detailed information." ) - protected Reference contract; - - /** - * The actual object that is the target of the reference (The contract resource which may provide more detailed information.) - */ - protected Contract contractTarget; + @Child(name = "insurance", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Details by insurance coverage", formalDefinition="The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer." ) + protected List insurance; /** * The form to be used for printing the content. */ - @Child(name = "form", type = {Coding.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "form", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms") - protected Coding form; - - /** - * Benefits and optionally current balances by Category. - */ - @Child(name = "benefitBalance", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Benefits by Category", formalDefinition="Benefits and optionally current balances by Category." ) - protected List benefitBalance; + protected CodeableConcept form; /** * Mutually exclusive with Services Provided (Item). */ - @Child(name = "error", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "error", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) protected List error; - private static final long serialVersionUID = 710154036L; + private static final long serialVersionUID = 954270539L; /** * Constructor @@ -1298,14 +1639,6 @@ public class EligibilityResponse extends DomainResource { super(); } - /** - * Constructor - */ - public EligibilityResponse(Enumeration status) { - super(); - this.status = status; - } - /** * @return {@link #identifier} (The Response business identifier.) */ @@ -1398,202 +1731,16 @@ public class EligibilityResponse extends DomainResource { * @param value The status of the resource instance. */ public EligibilityResponse setStatus(EligibilityResponseStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new EligibilityResponseStatusEnumFactory()); this.status.setValue(value); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public EligibilityResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 reference.) - */ - 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 EligibilityRequest(); // aa - 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 reference.) - */ - public EligibilityResponse setRequestTarget(EligibilityRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). 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 EligibilityResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb - 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} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public EligibilityResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RemittanceOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public EligibilityResponse setOutcome(RemittanceOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); - this.outcome.setValue(value); } return this; } - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public EligibilityResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public EligibilityResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 EligibilityResponse setRuleset(Coding value) { - this.ruleset = 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 EligibilityResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - 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 EligibilityResponse 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 */ @@ -1643,50 +1790,6 @@ public class EligibilityResponse extends DomainResource { return this; } - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public EligibilityResponse 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 Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - 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 Insurer who produced this adjudicated response.) - */ - public EligibilityResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - /** * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) */ @@ -1775,6 +1878,167 @@ public class EligibilityResponse extends DomainResource { return this; } + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public EligibilityResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 reference.) + */ + 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 EligibilityRequest(); // aa + 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 reference.) + */ + public EligibilityResponse setRequestTarget(EligibilityRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.) + */ + public EligibilityResponse setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public EligibilityResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public EligibilityResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #insurer} (The Insurer who produced this adjudicated response.) + */ + public Reference getInsurer() { + if (this.insurer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.insurer"); + else if (Configuration.doAutoCreate()) + this.insurer = new Reference(); // cc + return this.insurer; + } + + public boolean hasInsurer() { + return this.insurer != null && !this.insurer.isEmpty(); + } + + /** + * @param value {@link #insurer} (The Insurer who produced this adjudicated response.) + */ + public EligibilityResponse setInsurer(Reference value) { + this.insurer = value; + return this; + } + + /** + * @return {@link #insurer} 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 Insurer who produced this adjudicated response.) + */ + public Organization getInsurerTarget() { + if (this.insurerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.insurer"); + else if (Configuration.doAutoCreate()) + this.insurerTarget = new Organization(); // aa + return this.insurerTarget; + } + + /** + * @param value {@link #insurer} 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 produced this adjudicated response.) + */ + public EligibilityResponse setInsurerTarget(Organization value) { + this.insurerTarget = value; + return this; + } + /** * @return {@link #inforce} (Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.). This is the underlying object with id, value and extensions. The accessor "getInforce" gives direct access to the value */ @@ -1821,58 +2085,67 @@ public class EligibilityResponse extends DomainResource { } /** - * @return {@link #contract} (The contract resource which may provide more detailed information.) + * @return {@link #insurance} (The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer.) */ - public Reference getContract() { - if (this.contract == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.contract"); - else if (Configuration.doAutoCreate()) - this.contract = new Reference(); // cc - return this.contract; - } - - public boolean hasContract() { - return this.contract != null && !this.contract.isEmpty(); + public List getInsurance() { + if (this.insurance == null) + this.insurance = new ArrayList(); + return this.insurance; } /** - * @param value {@link #contract} (The contract resource which may provide more detailed information.) + * @return Returns a reference to this for easy method chaining */ - public EligibilityResponse setContract(Reference value) { - this.contract = value; + public EligibilityResponse setInsurance(List theInsurance) { + this.insurance = theInsurance; + return this; + } + + public boolean hasInsurance() { + if (this.insurance == null) + return false; + for (InsuranceComponent item : this.insurance) + if (!item.isEmpty()) + return true; + return false; + } + + public InsuranceComponent addInsurance() { //3 + InsuranceComponent t = new InsuranceComponent(); + if (this.insurance == null) + this.insurance = new ArrayList(); + this.insurance.add(t); + return t; + } + + public EligibilityResponse addInsurance(InsuranceComponent t) { //3 + if (t == null) + return this; + if (this.insurance == null) + this.insurance = new ArrayList(); + this.insurance.add(t); return this; } /** - * @return {@link #contract} 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 contract resource which may provide more detailed information.) + * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist */ - public Contract getContractTarget() { - if (this.contractTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.contract"); - else if (Configuration.doAutoCreate()) - this.contractTarget = new Contract(); // aa - return this.contractTarget; - } - - /** - * @param value {@link #contract} 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 contract resource which may provide more detailed information.) - */ - public EligibilityResponse setContractTarget(Contract value) { - this.contractTarget = value; - return this; + public InsuranceComponent getInsuranceFirstRep() { + if (getInsurance().isEmpty()) { + addInsurance(); + } + return getInsurance().get(0); } /** * @return {@link #form} (The form to be used for printing the content.) */ - public Coding getForm() { + public CodeableConcept getForm() { if (this.form == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create EligibilityResponse.form"); else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc + this.form = new CodeableConcept(); // cc return this.form; } @@ -1883,64 +2156,11 @@ public class EligibilityResponse extends DomainResource { /** * @param value {@link #form} (The form to be used for printing the content.) */ - public EligibilityResponse setForm(Coding value) { + public EligibilityResponse setForm(CodeableConcept value) { this.form = value; return this; } - /** - * @return {@link #benefitBalance} (Benefits and optionally current balances by Category.) - */ - public List getBenefitBalance() { - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - return this.benefitBalance; - } - - /** - * @return Returns a reference to this for easy method chaining - */ - public EligibilityResponse setBenefitBalance(List theBenefitBalance) { - this.benefitBalance = theBenefitBalance; - return this; - } - - public boolean hasBenefitBalance() { - if (this.benefitBalance == null) - return false; - for (BenefitsComponent item : this.benefitBalance) - if (!item.isEmpty()) - return true; - return false; - } - - public BenefitsComponent addBenefitBalance() { //3 - BenefitsComponent t = new BenefitsComponent(); - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - this.benefitBalance.add(t); - return t; - } - - public EligibilityResponse addBenefitBalance(BenefitsComponent t) { //3 - if (t == null) - return this; - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - this.benefitBalance.add(t); - return this; - } - - /** - * @return The first repetition of repeating field {@link #benefitBalance}, creating it if it does not already exist - */ - public BenefitsComponent getBenefitBalanceFirstRep() { - if (getBenefitBalance().isEmpty()) { - addBenefitBalance(); - } - return getBenefitBalance().get(0); - } - /** * @return {@link #error} (Mutually exclusive with Services Provided (Item).) */ @@ -1998,19 +2218,16 @@ public class EligibilityResponse extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("request", "Reference(EligibilityRequest)", "Original request resource reference.", 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("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)); + childrenList.add(new Property("request", "Reference(EligibilityRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "CodeableConcept", "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("insurer", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, insurer)); childrenList.add(new Property("inforce", "boolean", "Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.", 0, java.lang.Integer.MAX_VALUE, inforce)); - childrenList.add(new Property("contract", "Reference(Contract)", "The contract resource which may provide more detailed information.", 0, java.lang.Integer.MAX_VALUE, contract)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("benefitBalance", "", "Benefits and optionally current balances by Category.", 0, java.lang.Integer.MAX_VALUE, benefitBalance)); + childrenList.add(new Property("insurance", "", "The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer.", 0, java.lang.Integer.MAX_VALUE, insurance)); + childrenList.add(new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); } @@ -2019,19 +2236,16 @@ public class EligibilityResponse extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType + case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference case 1945431270: /*inforce*/ return this.inforce == null ? new Base[0] : new Base[] {this.inforce}; // BooleanType - case -566947566: /*contract*/ return this.contract == null ? new Base[0] : new Base[] {this.contract}; // Reference - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding - case 596003397: /*benefitBalance*/ return this.benefitBalance == null ? new Base[0] : this.benefitBalance.toArray(new Base[this.benefitBalance.size()]); // BenefitsComponent + case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // InsuranceComponent + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorsComponent default: return super.getProperty(hash, name, checkValid); } @@ -2047,44 +2261,35 @@ public class EligibilityResponse extends DomainResource { case -892481550: // status this.status = new EligibilityResponseStatusEnumFactory().fromType(value); // Enumeration break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case -1106507950: // outcome - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType break; - case 1178922291: // organization - this.organization = castToReference(value); // Reference - break; case 1601527200: // requestProvider this.requestProvider = castToReference(value); // Reference break; case 599053666: // requestOrganization this.requestOrganization = castToReference(value); // Reference break; + case 1095692943: // request + this.request = castToReference(value); // Reference + break; + case -1106507950: // outcome + this.outcome = castToCodeableConcept(value); // CodeableConcept + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; + case 1957615864: // insurer + this.insurer = castToReference(value); // Reference + break; case 1945431270: // inforce this.inforce = castToBoolean(value); // BooleanType break; - case -566947566: // contract - this.contract = castToReference(value); // Reference + case 73049818: // insurance + this.getInsurance().add((InsuranceComponent) value); // InsuranceComponent break; case 3148996: // form - this.form = castToCoding(value); // Coding - break; - case 596003397: // benefitBalance - this.getBenefitBalance().add((BenefitsComponent) value); // BenefitsComponent + this.form = castToCodeableConcept(value); // CodeableConcept break; case 96784904: // error this.getError().add((ErrorsComponent) value); // ErrorsComponent @@ -2100,32 +2305,26 @@ public class EligibilityResponse extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new EligibilityResponseStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("request")) - this.request = castToReference(value); // Reference - else if (name.equals("outcome")) - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding else if (name.equals("created")) this.created = castToDateTime(value); // DateTimeType - else if (name.equals("organization")) - this.organization = castToReference(value); // Reference else if (name.equals("requestProvider")) this.requestProvider = castToReference(value); // Reference else if (name.equals("requestOrganization")) this.requestOrganization = castToReference(value); // Reference + else if (name.equals("request")) + this.request = castToReference(value); // Reference + else if (name.equals("outcome")) + this.outcome = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType + else if (name.equals("insurer")) + this.insurer = castToReference(value); // Reference else if (name.equals("inforce")) this.inforce = castToBoolean(value); // BooleanType - else if (name.equals("contract")) - this.contract = castToReference(value); // Reference + else if (name.equals("insurance")) + this.getInsurance().add((InsuranceComponent) value); else if (name.equals("form")) - this.form = castToCoding(value); // Coding - else if (name.equals("benefitBalance")) - this.getBenefitBalance().add((BenefitsComponent) value); + this.form = castToCodeableConcept(value); // CodeableConcept else if (name.equals("error")) this.getError().add((ErrorsComponent) value); else @@ -2137,19 +2336,16 @@ public class EligibilityResponse extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1095692943: return getRequest(); // Reference - case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1178922291: return getOrganization(); // Reference case 1601527200: return getRequestProvider(); // Reference case 599053666: return getRequestOrganization(); // Reference + case 1095692943: return getRequest(); // Reference + case -1106507950: return getOutcome(); // CodeableConcept + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType + case 1957615864: return getInsurer(); // Reference case 1945431270: throw new FHIRException("Cannot make property inforce as it is not a complex type"); // BooleanType - case -566947566: return getContract(); // Reference - case 3148996: return getForm(); // Coding - case 596003397: return addBenefitBalance(); // BenefitsComponent + case 73049818: return addInsurance(); // InsuranceComponent + case 3148996: return getForm(); // CodeableConcept case 96784904: return addError(); // ErrorsComponent default: return super.makeProperty(hash, name); } @@ -2164,31 +2360,9 @@ public class EligibilityResponse extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.status"); } - else if (name.equals("request")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("outcome")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.outcome"); - } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.disposition"); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } else if (name.equals("created")) { throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.created"); } - else if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; - } else if (name.equals("requestProvider")) { this.requestProvider = new Reference(); return this.requestProvider; @@ -2197,20 +2371,31 @@ public class EligibilityResponse extends DomainResource { this.requestOrganization = new Reference(); return this.requestOrganization; } + else if (name.equals("request")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("outcome")) { + this.outcome = new CodeableConcept(); + return this.outcome; + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.disposition"); + } + else if (name.equals("insurer")) { + this.insurer = new Reference(); + return this.insurer; + } else if (name.equals("inforce")) { throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.inforce"); } - else if (name.equals("contract")) { - this.contract = new Reference(); - return this.contract; + else if (name.equals("insurance")) { + return addInsurance(); } else if (name.equals("form")) { - this.form = new Coding(); + this.form = new CodeableConcept(); return this.form; } - else if (name.equals("benefitBalance")) { - return addBenefitBalance(); - } else if (name.equals("error")) { return addError(); } @@ -2232,23 +2417,20 @@ public class EligibilityResponse extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); + dst.created = created == null ? null : created.copy(); + dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); + dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); dst.request = request == null ? null : request.copy(); dst.outcome = outcome == null ? null : outcome.copy(); dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.insurer = insurer == null ? null : insurer.copy(); dst.inforce = inforce == null ? null : inforce.copy(); - dst.contract = contract == null ? null : contract.copy(); - dst.form = form == null ? null : form.copy(); - if (benefitBalance != null) { - dst.benefitBalance = new ArrayList(); - for (BenefitsComponent i : benefitBalance) - dst.benefitBalance.add(i.copy()); + if (insurance != null) { + dst.insurance = new ArrayList(); + for (InsuranceComponent i : insurance) + dst.insurance.add(i.copy()); }; + dst.form = form == null ? null : form.copy(); if (error != null) { dst.error = new ArrayList(); for (ErrorsComponent i : error) @@ -2268,13 +2450,11 @@ public class EligibilityResponse extends DomainResource { if (!(other instanceof EligibilityResponse)) return false; EligibilityResponse o = (EligibilityResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true) - && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(inforce, o.inforce, true) - && compareDeep(contract, o.contract, true) && compareDeep(form, o.form, true) && compareDeep(benefitBalance, o.benefitBalance, true) - && compareDeep(error, o.error, true); + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(created, o.created, true) + && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(requestOrganization, o.requestOrganization, true) + && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) + && compareDeep(insurer, o.insurer, true) && compareDeep(inforce, o.inforce, true) && compareDeep(insurance, o.insurance, true) + && compareDeep(form, o.form, true) && compareDeep(error, o.error, true); } @Override @@ -2284,14 +2464,14 @@ public class EligibilityResponse extends DomainResource { if (!(other instanceof EligibilityResponse)) return false; EligibilityResponse o = (EligibilityResponse) other; - return compareValues(status, o.status, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) - && compareValues(created, o.created, true) && compareValues(inforce, o.inforce, true); + return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(disposition, o.disposition, true) + && compareValues(inforce, o.inforce, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request - , outcome, disposition, ruleset, originalRuleset, created, organization, requestProvider - , requestOrganization, inforce, contract, form, benefitBalance, error); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, created + , requestProvider, requestOrganization, request, outcome, disposition, insurer, inforce + , insurance, form, error); } @Override @@ -2365,6 +2545,32 @@ public class EligibilityResponse extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); + /** + * Search parameter: insurer + *

+ * Description: The organization which generated this resource
+ * Type: reference
+ * Path: EligibilityResponse.insurer
+ *

+ */ + @SearchParamDefinition(name="insurer", path="EligibilityResponse.insurer", description="The organization which generated this resource", type="reference", target={Organization.class } ) + public static final String SP_INSURER = "insurer"; + /** + * Fluent Client search parameter constant for insurer + *

+ * Description: The organization which generated this resource
+ * Type: reference
+ * Path: EligibilityResponse.insurer
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSURER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EligibilityResponse:insurer". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INSURER = new ca.uhn.fhir.model.api.Include("EligibilityResponse:insurer").toLocked(); + /** * Search parameter: created *

@@ -2385,32 +2591,6 @@ public class EligibilityResponse extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - /** - * Search parameter: organization - *

- * Description: The organization which generated this resource
- * Type: reference
- * Path: EligibilityResponse.organization
- *

- */ - @SearchParamDefinition(name="organization", path="EligibilityResponse.organization", description="The organization which generated this resource", type="reference", target={Organization.class } ) - public static final String SP_ORGANIZATION = "organization"; - /** - * Fluent Client search parameter constant for organization - *

- * Description: The organization which generated this resource
- * Type: reference
- * Path: EligibilityResponse.organization
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityResponse:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EligibilityResponse:organization").toLocked(); - /** * Search parameter: request-organization *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Encounter.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Encounter.java index cb76782035e..ec66b04657a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Encounter.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Encounter.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -3882,6 +3882,32 @@ public class Encounter extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Encounter:location").toLocked(); + /** + * Search parameter: service-provider + *

+ * Description: The custodian organization of this Encounter record
+ * Type: reference
+ * Path: Encounter.serviceProvider
+ *

+ */ + @SearchParamDefinition(name="service-provider", path="Encounter.serviceProvider", description="The custodian organization of this Encounter record", type="reference", target={Organization.class } ) + public static final String SP_SERVICE_PROVIDER = "service-provider"; + /** + * Fluent Client search parameter constant for service-provider + *

+ * Description: The custodian organization of this Encounter record
+ * Type: reference
+ * Path: Encounter.serviceProvider
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SERVICE_PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SERVICE_PROVIDER); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Encounter:service-provider". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SERVICE_PROVIDER = new ca.uhn.fhir.model.api.Include("Encounter:service-provider").toLocked(); + /** * Search parameter: indication *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Endpoint.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Endpoint.java index c6e5acd784c..5e3ae3bec46 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Endpoint.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Endpoint.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EnrollmentRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EnrollmentRequest.java index 530ce5cfdc2..d967e5c1d49 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EnrollmentRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EnrollmentRequest.java @@ -29,12 +29,11 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.dstu3.model.Enumerations.*; import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.api.annotation.Child; @@ -51,19 +50,19 @@ public class EnrollmentRequest extends DomainResource { public enum EnrollmentRequestStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +96,19 @@ public class EnrollmentRequest extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/enrollmentrequest-status"; - case CANCELLED: return "http://hl7.org/fhir/enrollmentrequest-status"; - case DRAFT: return "http://hl7.org/fhir/enrollmentrequest-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/enrollmentrequest-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +117,7 @@ public class EnrollmentRequest extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -181,66 +180,70 @@ public class EnrollmentRequest extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/enrollmentrequest-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - /** * The date when this resource was created. */ - @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "created", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) protected DateTimeType created; /** * The Insurer who is target of the request. */ - @Child(name = "insurer", type = {Identifier.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "insurer", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Target", formalDefinition="The Insurer who is target of the request." ) - protected Type insurer; + protected Reference insurer; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization insurerTarget; /** * The practitioner who is responsible for the services rendered to the patient. */ - @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Child(name = "provider", type = {Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type provider; + 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; /** * The organization which is responsible for the services rendered to the patient. */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "organization", type = {Organization.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Type organization; + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; /** * Patient Resource. */ - @Child(name = "subject", type = {Identifier.class, Patient.class}, order=8, min=1, max=1, modifier=false, summary=false) + @Child(name = "subject", type = {Patient.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Type subject; + protected Reference subject; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient subjectTarget; /** * Reference to the program or plan identification, underwriter or payor. */ - @Child(name = "coverage", type = {Coverage.class}, order=9, min=1, max=1, modifier=false, summary=false) + @Child(name = "coverage", type = {Coverage.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) protected Reference coverage; @@ -249,7 +252,7 @@ public class EnrollmentRequest extends DomainResource { */ protected Coverage coverageTarget; - private static final long serialVersionUID = -1340468824L; + private static final long serialVersionUID = -214445454L; /** * Constructor @@ -258,16 +261,6 @@ public class EnrollmentRequest extends DomainResource { super(); } - /** - * Constructor - */ - public EnrollmentRequest(Enumeration status, Type subject, Reference coverage) { - super(); - this.status = status; - this.subject = subject; - this.coverage = coverage; - } - /** * @return {@link #identifier} (The Response business identifier.) */ @@ -360,57 +353,13 @@ public class EnrollmentRequest extends DomainResource { * @param value The status of the resource instance. */ public EnrollmentRequest setStatus(EnrollmentRequestStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new EnrollmentRequestStatusEnumFactory()); this.status.setValue(value); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 EnrollmentRequest setRuleset(Coding value) { - this.ruleset = 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 EnrollmentRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - 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 EnrollmentRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; + } return this; } @@ -466,36 +415,15 @@ public class EnrollmentRequest extends DomainResource { /** * @return {@link #insurer} (The Insurer who is target of the request.) */ - public Type getInsurer() { + public Reference getInsurer() { + if (this.insurer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.insurer"); + else if (Configuration.doAutoCreate()) + this.insurer = new Reference(); // cc return this.insurer; } - /** - * @return {@link #insurer} (The Insurer who is target of the request.) - */ - public Identifier getInsurerIdentifier() throws FHIRException { - if (!(this.insurer instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.insurer.getClass().getName()+" was encountered"); - return (Identifier) this.insurer; - } - - public boolean hasInsurerIdentifier() { - return this.insurer instanceof Identifier; - } - - /** - * @return {@link #insurer} (The Insurer who is target of the request.) - */ - public Reference getInsurerReference() throws FHIRException { - if (!(this.insurer instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.insurer.getClass().getName()+" was encountered"); - return (Reference) this.insurer; - } - - public boolean hasInsurerReference() { - return this.insurer instanceof Reference; - } - public boolean hasInsurer() { return this.insurer != null && !this.insurer.isEmpty(); } @@ -503,44 +431,43 @@ public class EnrollmentRequest extends DomainResource { /** * @param value {@link #insurer} (The Insurer who is target of the request.) */ - public EnrollmentRequest setInsurer(Type value) { + public EnrollmentRequest setInsurer(Reference value) { this.insurer = value; return this; } + /** + * @return {@link #insurer} 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 Insurer who is target of the request.) + */ + public Organization getInsurerTarget() { + if (this.insurerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.insurer"); + else if (Configuration.doAutoCreate()) + this.insurerTarget = new Organization(); // aa + return this.insurerTarget; + } + + /** + * @param value {@link #insurer} 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 EnrollmentRequest setInsurerTarget(Organization value) { + this.insurerTarget = value; + return this; + } + /** * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) */ - public Type getProvider() { + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc return this.provider; } - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getProviderIdentifier() throws FHIRException { - if (!(this.provider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Identifier) this.provider; - } - - public boolean hasProviderIdentifier() { - return this.provider instanceof Identifier; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProviderReference() throws FHIRException { - if (!(this.provider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Reference) this.provider; - } - - public boolean hasProviderReference() { - return this.provider instanceof Reference; - } - public boolean hasProvider() { return this.provider != null && !this.provider.isEmpty(); } @@ -548,44 +475,43 @@ public class EnrollmentRequest extends DomainResource { /** * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) */ - public EnrollmentRequest setProvider(Type value) { + public EnrollmentRequest 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 EnrollmentRequest.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); // aa + 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 EnrollmentRequest setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + /** * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) */ - public Type getOrganization() { + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc return this.organization; } - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - public boolean hasOrganization() { return this.organization != null && !this.organization.isEmpty(); } @@ -593,44 +519,43 @@ public class EnrollmentRequest extends DomainResource { /** * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) */ - public EnrollmentRequest setOrganization(Type value) { + public EnrollmentRequest 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 services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + 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 services rendered to the patient.) + */ + public EnrollmentRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + /** * @return {@link #subject} (Patient Resource.) */ - public Type getSubject() { + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); // cc return this.subject; } - /** - * @return {@link #subject} (Patient Resource.) - */ - public Identifier getSubjectIdentifier() throws FHIRException { - if (!(this.subject instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.subject.getClass().getName()+" was encountered"); - return (Identifier) this.subject; - } - - public boolean hasSubjectIdentifier() { - return this.subject instanceof Identifier; - } - - /** - * @return {@link #subject} (Patient Resource.) - */ - public Reference getSubjectReference() throws FHIRException { - if (!(this.subject instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.subject.getClass().getName()+" was encountered"); - return (Reference) this.subject; - } - - public boolean hasSubjectReference() { - return this.subject instanceof Reference; - } - public boolean hasSubject() { return this.subject != null && !this.subject.isEmpty(); } @@ -638,11 +563,31 @@ public class EnrollmentRequest extends DomainResource { /** * @param value {@link #subject} (Patient Resource.) */ - public EnrollmentRequest setSubject(Type value) { + public EnrollmentRequest 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. (Patient Resource.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); // aa + 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. (Patient Resource.) + */ + public EnrollmentRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + /** * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) */ @@ -691,13 +636,11 @@ public class EnrollmentRequest extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - 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("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("insurer[x]", "Identifier|Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, insurer)); - childrenList.add(new Property("provider[x]", "Identifier|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[x]", "Identifier|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("subject[x]", "Identifier|Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("insurer", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, insurer)); + 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("subject", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject)); childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); } @@ -706,13 +649,11 @@ public class EnrollmentRequest extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Type - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Type + case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference default: return super.getProperty(hash, name, checkValid); } @@ -728,26 +669,20 @@ public class EnrollmentRequest extends DomainResource { case -892481550: // status this.status = new EnrollmentRequestStatusEnumFactory().fromType(value); // Enumeration break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType break; case 1957615864: // insurer - this.insurer = castToType(value); // Type + this.insurer = castToReference(value); // Reference break; case -987494927: // provider - this.provider = castToType(value); // Type + this.provider = castToReference(value); // Reference break; case 1178922291: // organization - this.organization = castToType(value); // Type + this.organization = castToReference(value); // Reference break; case -1867885268: // subject - this.subject = castToType(value); // Type + this.subject = castToReference(value); // Reference break; case -351767064: // coverage this.coverage = castToReference(value); // Reference @@ -763,20 +698,16 @@ public class EnrollmentRequest extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new EnrollmentRequestStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding else if (name.equals("created")) this.created = castToDateTime(value); // DateTimeType - else if (name.equals("insurer[x]")) - this.insurer = castToType(value); // Type - else if (name.equals("provider[x]")) - this.provider = castToType(value); // Type - else if (name.equals("organization[x]")) - this.organization = castToType(value); // Type - else if (name.equals("subject[x]")) - this.subject = castToType(value); // Type + else if (name.equals("insurer")) + this.insurer = castToReference(value); // Reference + else if (name.equals("provider")) + this.provider = castToReference(value); // Reference + else if (name.equals("organization")) + this.organization = castToReference(value); // Reference + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference else if (name.equals("coverage")) this.coverage = castToReference(value); // Reference else @@ -788,13 +719,11 @@ public class EnrollmentRequest extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -2026616696: return getInsurer(); // Type - case 2064698607: return getProvider(); // Type - case 1326483053: return getOrganization(); // Type - case -573640748: return getSubject(); // Type + case 1957615864: return getInsurer(); // Reference + case -987494927: return getProvider(); // Reference + case 1178922291: return getOrganization(); // Reference + case -1867885268: return getSubject(); // Reference case -351767064: return getCoverage(); // Reference default: return super.makeProperty(hash, name); } @@ -809,46 +738,22 @@ public class EnrollmentRequest extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type EnrollmentRequest.status"); } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } else if (name.equals("created")) { throw new FHIRException("Cannot call addChild on a primitive type EnrollmentRequest.created"); } - else if (name.equals("insurerIdentifier")) { - this.insurer = new Identifier(); - return this.insurer; - } - else if (name.equals("insurerReference")) { + else if (name.equals("insurer")) { this.insurer = new Reference(); return this.insurer; } - else if (name.equals("providerIdentifier")) { - this.provider = new Identifier(); - return this.provider; - } - else if (name.equals("providerReference")) { + else if (name.equals("provider")) { this.provider = new Reference(); return this.provider; } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { + else if (name.equals("organization")) { this.organization = new Reference(); return this.organization; } - else if (name.equals("subjectIdentifier")) { - this.subject = new Identifier(); - return this.subject; - } - else if (name.equals("subjectReference")) { + else if (name.equals("subject")) { this.subject = new Reference(); return this.subject; } @@ -874,8 +779,6 @@ public class EnrollmentRequest extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); dst.created = created == null ? null : created.copy(); dst.insurer = insurer == null ? null : insurer.copy(); dst.provider = provider == null ? null : provider.copy(); @@ -896,8 +799,7 @@ public class EnrollmentRequest extends DomainResource { if (!(other instanceof EnrollmentRequest)) return false; EnrollmentRequest o = (EnrollmentRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(created, o.created, true) && compareDeep(insurer, o.insurer, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) && compareDeep(subject, o.subject, true) && compareDeep(coverage, o.coverage, true); } @@ -913,9 +815,8 @@ public class EnrollmentRequest extends DomainResource { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, ruleset - , originalRuleset, created, insurer, provider, organization, subject, coverage - ); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, created + , insurer, provider, organization, subject, coverage); } @Override @@ -944,96 +845,82 @@ public class EnrollmentRequest extends DomainResource { public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); /** - * Search parameter: patient-reference + * Search parameter: subject *

* Description: The party to be enrolled
* Type: reference
- * Path: EnrollmentRequest.subjectreference
+ * Path: EnrollmentRequest.subject
*

*/ - @SearchParamDefinition(name="patient-reference", path="EnrollmentRequest.subject.as(reference)", description="The party to be enrolled", type="reference", target={Patient.class } ) - public static final String SP_PATIENT_REFERENCE = "patient-reference"; + @SearchParamDefinition(name="subject", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } ) + public static final String SP_SUBJECT = "subject"; /** - * Fluent Client search parameter constant for patient-reference + * Fluent Client search parameter constant for subject *

* Description: The party to be enrolled
* Type: reference
- * Path: EnrollmentRequest.subjectreference
+ * Path: EnrollmentRequest.subject
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT_REFERENCE); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); /** * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EnrollmentRequest:patient-reference". + * the path value of "EnrollmentRequest:subject". */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT_REFERENCE = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:patient-reference").toLocked(); + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:subject").toLocked(); /** - * Search parameter: subject-identifier - *

- * Description: The party to be enrolled
- * Type: token
- * Path: EnrollmentRequest.subjectidentifier
- *

- */ - @SearchParamDefinition(name="subject-identifier", path="EnrollmentRequest.subject.as(identifier)", description="The party to be enrolled", type="token" ) - public static final String SP_SUBJECT_IDENTIFIER = "subject-identifier"; - /** - * Fluent Client search parameter constant for subject-identifier - *

- * Description: The party to be enrolled
- * Type: token
- * Path: EnrollmentRequest.subjectidentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBJECT_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBJECT_IDENTIFIER); - - /** - * Search parameter: subject-reference + * Search parameter: patient *

* Description: The party to be enrolled
* Type: reference
- * Path: EnrollmentRequest.subjectreference
+ * Path: EnrollmentRequest.subject
*

*/ - @SearchParamDefinition(name="subject-reference", path="EnrollmentRequest.subject.as(reference)", description="The party to be enrolled", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } ) - public static final String SP_SUBJECT_REFERENCE = "subject-reference"; + @SearchParamDefinition(name="patient", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference", target={Patient.class } ) + public static final String SP_PATIENT = "patient"; /** - * Fluent Client search parameter constant for subject-reference + * Fluent Client search parameter constant for patient *

* Description: The party to be enrolled
* Type: reference
- * Path: EnrollmentRequest.subjectreference
+ * Path: EnrollmentRequest.subject
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT_REFERENCE); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); /** * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EnrollmentRequest:subject-reference". + * the path value of "EnrollmentRequest:patient". */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT_REFERENCE = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:subject-reference").toLocked(); + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:patient").toLocked(); /** - * Search parameter: patient-identifier + * Search parameter: organization *

- * Description: The party to be enrolled
- * Type: token
- * Path: EnrollmentRequest.subjectidentifier
+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: EnrollmentRequest.organization
*

*/ - @SearchParamDefinition(name="patient-identifier", path="EnrollmentRequest.subject.as(identifier)", description="The party to be enrolled", type="token" ) - public static final String SP_PATIENT_IDENTIFIER = "patient-identifier"; + @SearchParamDefinition(name="organization", path="EnrollmentRequest.organization", description="The organization who generated this resource", type="reference", target={Organization.class } ) + public static final String SP_ORGANIZATION = "organization"; /** - * Fluent Client search parameter constant for patient-identifier + * Fluent Client search parameter constant for organization *

- * Description: The party to be enrolled
- * Type: token
- * Path: EnrollmentRequest.subjectidentifier
+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: EnrollmentRequest.organization
*

*/ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATIENT_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATIENT_IDENTIFIER); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EnrollmentRequest:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:organization").toLocked(); } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EnrollmentResponse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EnrollmentResponse.java index 5f9b2eb7eae..86c4d78d088 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EnrollmentResponse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EnrollmentResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -51,19 +51,19 @@ public class EnrollmentResponse extends DomainResource { public enum EnrollmentResponseStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +97,19 @@ public class EnrollmentResponse extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/enrollmentresponse-status"; - case CANCELLED: return "http://hl7.org/fhir/enrollmentresponse-status"; - case DRAFT: return "http://hl7.org/fhir/enrollmentresponse-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/enrollmentresponse-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +118,7 @@ public class EnrollmentResponse extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -181,25 +181,30 @@ public class EnrollmentResponse extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/enrollmentresponse-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; /** * Original request resource reference. */ - @Child(name = "request", type = {Identifier.class, EnrollmentRequest.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "request", type = {EnrollmentRequest.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Type request; + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource reference.) + */ + protected EnrollmentRequest requestTarget; /** * Processing status: error, complete. */ - @Child(name = "outcome", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "outcome", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="complete | error | partial", formalDefinition="Processing status: error, complete." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome") - protected Enumeration outcome; + protected CodeableConcept outcome; /** * A description of the status of the adjudication. @@ -208,51 +213,50 @@ public class EnrollmentResponse extends DomainResource { @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) protected StringType disposition; - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name = "created", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) protected DateTimeType created; /** * The Insurer who produced this adjudicated response. */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Type organization; + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; /** * The practitioner who is responsible for the services rendered to the patient. */ - @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestProvider", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type requestProvider; + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; /** * The organization which is responsible for the services rendered to the patient. */ - @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestOrganization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Type requestOrganization; + protected Reference requestOrganization; - private static final long serialVersionUID = -1774170871L; + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + private static final long serialVersionUID = -386781115L; /** * Constructor @@ -261,14 +265,6 @@ public class EnrollmentResponse extends DomainResource { super(); } - /** - * Constructor - */ - public EnrollmentResponse(Enumeration status) { - super(); - this.status = status; - } - /** * @return {@link #identifier} (The Response business identifier.) */ @@ -361,45 +357,28 @@ public class EnrollmentResponse extends DomainResource { * @param value The status of the resource instance. */ public EnrollmentResponse setStatus(EnrollmentResponseStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new EnrollmentResponseStatusEnumFactory()); this.status.setValue(value); + } return this; } /** * @return {@link #request} (Original request resource reference.) */ - public Type getRequest() { + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc return this.request; } - /** - * @return {@link #request} (Original request resource reference.) - */ - public Identifier getRequestIdentifier() throws FHIRException { - if (!(this.request instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Identifier) this.request; - } - - public boolean hasRequestIdentifier() { - return this.request instanceof Identifier; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequestReference() throws FHIRException { - if (!(this.request instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Reference) this.request; - } - - public boolean hasRequestReference() { - return this.request instanceof Reference; - } - public boolean hasRequest() { return this.request != null && !this.request.isEmpty(); } @@ -407,60 +386,55 @@ public class EnrollmentResponse extends DomainResource { /** * @param value {@link #request} (Original request resource reference.) */ - public EnrollmentResponse setRequest(Type value) { + public EnrollmentResponse setRequest(Reference value) { this.request = value; return this; } /** - * @return {@link #outcome} (Processing status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + * @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 reference.) */ - public Enumeration getOutcomeElement() { + 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 EnrollmentRequest(); // aa + 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 reference.) + */ + public EnrollmentResponse setRequestTarget(EnrollmentRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Processing status: error, complete.) + */ + public CodeableConcept getOutcome() { if (this.outcome == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create EnrollmentResponse.outcome"); else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb + this.outcome = new CodeableConcept(); // cc 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} (Processing status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + * @param value {@link #outcome} (Processing status: error, complete.) */ - public EnrollmentResponse setOutcomeElement(Enumeration value) { + public EnrollmentResponse setOutcome(CodeableConcept value) { this.outcome = value; return this; } - /** - * @return Processing status: error, complete. - */ - public RemittanceOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Processing status: error, complete. - */ - public EnrollmentResponse setOutcome(RemittanceOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - /** * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value */ @@ -510,54 +484,6 @@ public class EnrollmentResponse extends DomainResource { return this; } - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 EnrollmentResponse setRuleset(Coding value) { - this.ruleset = 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 EnrollmentResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - 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 EnrollmentResponse 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 */ @@ -610,36 +536,15 @@ public class EnrollmentResponse extends DomainResource { /** * @return {@link #organization} (The Insurer who produced this adjudicated response.) */ - public Type getOrganization() { + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); // cc return this.organization; } - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - public boolean hasOrganization() { return this.organization != null && !this.organization.isEmpty(); } @@ -647,44 +552,43 @@ public class EnrollmentResponse extends DomainResource { /** * @param value {@link #organization} (The Insurer who produced this adjudicated response.) */ - public EnrollmentResponse setOrganization(Type value) { + public EnrollmentResponse 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 Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); // aa + 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 Insurer who produced this adjudicated response.) + */ + public EnrollmentResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + /** * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) */ - public Type getRequestProvider() { + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); // cc return this.requestProvider; } - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getRequestProviderIdentifier() throws FHIRException { - if (!(this.requestProvider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Identifier) this.requestProvider; - } - - public boolean hasRequestProviderIdentifier() { - return this.requestProvider instanceof Identifier; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProviderReference() throws FHIRException { - if (!(this.requestProvider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Reference) this.requestProvider; - } - - public boolean hasRequestProviderReference() { - return this.requestProvider instanceof Reference; - } - public boolean hasRequestProvider() { return this.requestProvider != null && !this.requestProvider.isEmpty(); } @@ -692,44 +596,43 @@ public class EnrollmentResponse extends DomainResource { /** * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) */ - public EnrollmentResponse setRequestProvider(Type value) { + public EnrollmentResponse setRequestProvider(Reference value) { this.requestProvider = value; return this; } + /** + * @return {@link #requestProvider} 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 getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); // aa + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} 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 EnrollmentResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + /** * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) */ - public Type getRequestOrganization() { + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); // cc return this.requestOrganization; } - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Identifier getRequestOrganizationIdentifier() throws FHIRException { - if (!(this.requestOrganization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Identifier) this.requestOrganization; - } - - public boolean hasRequestOrganizationIdentifier() { - return this.requestOrganization instanceof Identifier; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganizationReference() throws FHIRException { - if (!(this.requestOrganization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Reference) this.requestOrganization; - } - - public boolean hasRequestOrganizationReference() { - return this.requestOrganization instanceof Reference; - } - public boolean hasRequestOrganization() { return this.requestOrganization != null && !this.requestOrganization.isEmpty(); } @@ -737,24 +640,42 @@ public class EnrollmentResponse extends DomainResource { /** * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) */ - public EnrollmentResponse setRequestOrganization(Type value) { + public EnrollmentResponse setRequestOrganization(Reference value) { this.requestOrganization = value; return this; } + /** + * @return {@link #requestOrganization} 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 services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); // aa + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} 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 EnrollmentResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = 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("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("request[x]", "Identifier|Reference(EnrollmentRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "code", "Processing status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "CodeableConcept", "Processing 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("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[x]", "Identifier|Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider[x]", "Identifier|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[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); + 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)); } @Override @@ -762,15 +683,13 @@ public class EnrollmentResponse extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type - case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type + case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference + case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference default: return super.getProperty(hash, name, checkValid); } @@ -786,31 +705,25 @@ public class EnrollmentResponse extends DomainResource { this.status = new EnrollmentResponseStatusEnumFactory().fromType(value); // Enumeration break; case 1095692943: // request - this.request = castToType(value); // Type + this.request = castToReference(value); // Reference break; case -1106507950: // outcome - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + this.outcome = castToCodeableConcept(value); // CodeableConcept break; case 583380919: // disposition this.disposition = castToString(value); // StringType break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType break; case 1178922291: // organization - this.organization = castToType(value); // Type + this.organization = castToReference(value); // Reference break; case 1601527200: // requestProvider - this.requestProvider = castToType(value); // Type + this.requestProvider = castToReference(value); // Reference break; case 599053666: // requestOrganization - this.requestOrganization = castToType(value); // Type + this.requestOrganization = castToReference(value); // Reference break; default: super.setProperty(hash, name, value); } @@ -823,24 +736,20 @@ public class EnrollmentResponse extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new EnrollmentResponseStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("request[x]")) - this.request = castToType(value); // Type + else if (name.equals("request")) + this.request = castToReference(value); // Reference else if (name.equals("outcome")) - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + this.outcome = castToCodeableConcept(value); // CodeableConcept else if (name.equals("disposition")) this.disposition = castToString(value); // StringType - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding else if (name.equals("created")) this.created = castToDateTime(value); // DateTimeType - else if (name.equals("organization[x]")) - this.organization = castToType(value); // Type - else if (name.equals("requestProvider[x]")) - this.requestProvider = castToType(value); // Type - else if (name.equals("requestOrganization[x]")) - this.requestOrganization = castToType(value); // Type + else if (name.equals("organization")) + this.organization = castToReference(value); // Reference + else if (name.equals("requestProvider")) + this.requestProvider = castToReference(value); // Reference + else if (name.equals("requestOrganization")) + this.requestOrganization = castToReference(value); // Reference else super.setProperty(name, value); } @@ -850,15 +759,13 @@ public class EnrollmentResponse extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 37106577: return getRequest(); // Type - case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration + case 1095692943: return getRequest(); // Reference + case -1106507950: return getOutcome(); // CodeableConcept case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1326483053: return getOrganization(); // Type - case -1694784800: return getRequestProvider(); // Type - case 818740190: return getRequestOrganization(); // Type + case 1178922291: return getOrganization(); // Reference + case 1601527200: return getRequestProvider(); // Reference + case 599053666: return getRequestOrganization(); // Reference default: return super.makeProperty(hash, name); } @@ -872,52 +779,29 @@ public class EnrollmentResponse extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.status"); } - else if (name.equals("requestIdentifier")) { - this.request = new Identifier(); - return this.request; - } - else if (name.equals("requestReference")) { + else if (name.equals("request")) { this.request = new Reference(); return this.request; } else if (name.equals("outcome")) { - throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.outcome"); + this.outcome = new CodeableConcept(); + return this.outcome; } else if (name.equals("disposition")) { throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.disposition"); } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } else if (name.equals("created")) { throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.created"); } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { + else if (name.equals("organization")) { this.organization = new Reference(); return this.organization; } - else if (name.equals("requestProviderIdentifier")) { - this.requestProvider = new Identifier(); - return this.requestProvider; - } - else if (name.equals("requestProviderReference")) { + else if (name.equals("requestProvider")) { this.requestProvider = new Reference(); return this.requestProvider; } - else if (name.equals("requestOrganizationIdentifier")) { - this.requestOrganization = new Identifier(); - return this.requestOrganization; - } - else if (name.equals("requestOrganizationReference")) { + else if (name.equals("requestOrganization")) { this.requestOrganization = new Reference(); return this.requestOrganization; } @@ -942,8 +826,6 @@ public class EnrollmentResponse extends DomainResource { dst.request = request == null ? null : request.copy(); dst.outcome = outcome == null ? null : outcome.copy(); dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); dst.created = created == null ? null : created.copy(); dst.organization = organization == null ? null : organization.copy(); dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); @@ -963,8 +845,7 @@ public class EnrollmentResponse extends DomainResource { return false; EnrollmentResponse o = (EnrollmentResponse) other; return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true) - && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) + && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(requestOrganization, o.requestOrganization, true); } @@ -976,14 +857,14 @@ public class EnrollmentResponse extends DomainResource { if (!(other instanceof EnrollmentResponse)) return false; EnrollmentResponse o = (EnrollmentResponse) other; - return compareValues(status, o.status, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) - && compareValues(created, o.created, true); + return compareValues(status, o.status, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + ; } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request - , outcome, disposition, ruleset, originalRuleset, created, organization, requestProvider - , requestOrganization); + , outcome, disposition, created, organization, requestProvider, requestOrganization + ); } @Override @@ -1011,6 +892,58 @@ public class EnrollmentResponse extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + /** + * Search parameter: request + *

+ * Description: The reference to the claim
+ * Type: reference
+ * Path: EnrollmentResponse.request
+ *

+ */ + @SearchParamDefinition(name="request", path="EnrollmentResponse.request", description="The reference to the claim", type="reference", target={EnrollmentRequest.class } ) + public static final String SP_REQUEST = "request"; + /** + * Fluent Client search parameter constant for request + *

+ * Description: The reference to the claim
+ * Type: reference
+ * Path: EnrollmentResponse.request
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EnrollmentResponse:request". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("EnrollmentResponse:request").toLocked(); + + /** + * Search parameter: organization + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: EnrollmentResponse.organization
+ *

+ */ + @SearchParamDefinition(name="organization", path="EnrollmentResponse.organization", description="The organization who generated this resource", type="reference", target={Organization.class } ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: The organization who generated this resource
+ * Type: reference
+ * Path: EnrollmentResponse.organization
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "EnrollmentResponse:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EnrollmentResponse:organization").toLocked(); + } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Enumerations.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Enumerations.java index e3ea29ab0ff..60ed383603d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Enumerations.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Enumerations.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.instance.model.api.*; @@ -2355,7 +2355,7 @@ public class Enumerations { */ DOMAINRESOURCE, /** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + * This resource provides the details from the insurer to identify a specified coverage and optionally some class of service. */ ELIGIBILITYREQUEST, /** @@ -2482,6 +2482,10 @@ public class Enumerations { * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. */ MEDICATIONSTATEMENT, + /** + * Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + */ + MESSAGEDEFINITION, /** * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. */ @@ -2582,6 +2586,14 @@ public class Enumerations { * A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". */ REQUESTGROUP, + /** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ + RESEARCHSTUDY, + /** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ + RESEARCHSUBJECT, /** * This is the base resource type for everything. */ @@ -2921,6 +2933,8 @@ public class Enumerations { return MEDICATIONREQUEST; if ("MedicationStatement".equals(codeString)) return MEDICATIONSTATEMENT; + if ("MessageDefinition".equals(codeString)) + return MESSAGEDEFINITION; if ("MessageHeader".equals(codeString)) return MESSAGEHEADER; if ("NamingSystem".equals(codeString)) @@ -2971,6 +2985,10 @@ public class Enumerations { return RELATEDPERSON; if ("RequestGroup".equals(codeString)) return REQUESTGROUP; + if ("ResearchStudy".equals(codeString)) + return RESEARCHSTUDY; + if ("ResearchSubject".equals(codeString)) + return RESEARCHSUBJECT; if ("Resource".equals(codeString)) return RESOURCE; if ("RiskAssessment".equals(codeString)) @@ -3141,6 +3159,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "MedicationDispense"; case MEDICATIONREQUEST: return "MedicationRequest"; case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEDEFINITION: return "MessageDefinition"; case MESSAGEHEADER: return "MessageHeader"; case NAMINGSYSTEM: return "NamingSystem"; case NUTRITIONREQUEST: return "NutritionRequest"; @@ -3166,6 +3185,8 @@ public class Enumerations { case REFERRALREQUEST: return "ReferralRequest"; case RELATEDPERSON: return "RelatedPerson"; case REQUESTGROUP: return "RequestGroup"; + case RESEARCHSTUDY: return "ResearchStudy"; + case RESEARCHSUBJECT: return "ResearchSubject"; case RESOURCE: return "Resource"; case RISKASSESSMENT: return "RiskAssessment"; case SCHEDULE: return "Schedule"; @@ -3316,6 +3337,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; case MEDICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; + case MESSAGEDEFINITION: return "http://hl7.org/fhir/resource-types"; case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; case NUTRITIONREQUEST: return "http://hl7.org/fhir/resource-types"; @@ -3341,6 +3363,8 @@ public class Enumerations { case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; case REQUESTGROUP: return "http://hl7.org/fhir/resource-types"; + case RESEARCHSTUDY: return "http://hl7.org/fhir/resource-types"; + case RESEARCHSUBJECT: return "http://hl7.org/fhir/resource-types"; case RESOURCE: return "http://hl7.org/fhir/resource-types"; case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; case SCHEDULE: return "http://hl7.org/fhir/resource-types"; @@ -3459,7 +3483,7 @@ public class Enumerations { case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; case DOCUMENTREFERENCE: return "A reference to a document ."; case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; - case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; + case ELIGIBILITYREQUEST: return "This resource provides the details from the insurer to identify a specified coverage and optionally some class of service."; case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."; case ENDPOINT: return "The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information."; @@ -3491,6 +3515,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; case MEDICATIONREQUEST: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationRequest\" rather than \"MedicationPrescription\" or \"MedicationOrder\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc and to harmonize with workflow patterns."; case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; + case MESSAGEDEFINITION: return "Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted."; case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle."; case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; case NUTRITIONREQUEST: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; @@ -3516,6 +3541,8 @@ public class Enumerations { case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process."; case REQUESTGROUP: return "A group of related requests that can be used to capture intended activities that have inter-dependencies such as \"give this medication after that one\"."; + case RESEARCHSTUDY: return "A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects."; + case RESEARCHSUBJECT: return "A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects."; case RESOURCE: return "This is the base resource type for everything."; case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; @@ -3666,6 +3693,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "MedicationDispense"; case MEDICATIONREQUEST: return "MedicationRequest"; case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEDEFINITION: return "MessageDefinition"; case MESSAGEHEADER: return "MessageHeader"; case NAMINGSYSTEM: return "NamingSystem"; case NUTRITIONREQUEST: return "NutritionRequest"; @@ -3691,6 +3719,8 @@ public class Enumerations { case REFERRALREQUEST: return "ReferralRequest"; case RELATEDPERSON: return "RelatedPerson"; case REQUESTGROUP: return "RequestGroup"; + case RESEARCHSTUDY: return "ResearchStudy"; + case RESEARCHSUBJECT: return "ResearchSubject"; case RESOURCE: return "Resource"; case RISKASSESSMENT: return "RiskAssessment"; case SCHEDULE: return "Schedule"; @@ -3970,6 +4000,8 @@ public class Enumerations { return FHIRAllTypes.MEDICATIONREQUEST; if ("MedicationStatement".equals(codeString)) return FHIRAllTypes.MEDICATIONSTATEMENT; + if ("MessageDefinition".equals(codeString)) + return FHIRAllTypes.MESSAGEDEFINITION; if ("MessageHeader".equals(codeString)) return FHIRAllTypes.MESSAGEHEADER; if ("NamingSystem".equals(codeString)) @@ -4020,6 +4052,10 @@ public class Enumerations { return FHIRAllTypes.RELATEDPERSON; if ("RequestGroup".equals(codeString)) return FHIRAllTypes.REQUESTGROUP; + if ("ResearchStudy".equals(codeString)) + return FHIRAllTypes.RESEARCHSTUDY; + if ("ResearchSubject".equals(codeString)) + return FHIRAllTypes.RESEARCHSUBJECT; if ("Resource".equals(codeString)) return FHIRAllTypes.RESOURCE; if ("RiskAssessment".equals(codeString)) @@ -4318,6 +4354,8 @@ public class Enumerations { return new Enumeration(this, FHIRAllTypes.MEDICATIONREQUEST); if ("MedicationStatement".equals(codeString)) return new Enumeration(this, FHIRAllTypes.MEDICATIONSTATEMENT); + if ("MessageDefinition".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.MESSAGEDEFINITION); if ("MessageHeader".equals(codeString)) return new Enumeration(this, FHIRAllTypes.MESSAGEHEADER); if ("NamingSystem".equals(codeString)) @@ -4368,6 +4406,10 @@ public class Enumerations { return new Enumeration(this, FHIRAllTypes.RELATEDPERSON); if ("RequestGroup".equals(codeString)) return new Enumeration(this, FHIRAllTypes.REQUESTGROUP); + if ("ResearchStudy".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.RESEARCHSTUDY); + if ("ResearchSubject".equals(codeString)) + return new Enumeration(this, FHIRAllTypes.RESEARCHSUBJECT); if ("Resource".equals(codeString)) return new Enumeration(this, FHIRAllTypes.RESOURCE); if ("RiskAssessment".equals(codeString)) @@ -4661,6 +4703,8 @@ public class Enumerations { return "MedicationRequest"; if (code == FHIRAllTypes.MEDICATIONSTATEMENT) return "MedicationStatement"; + if (code == FHIRAllTypes.MESSAGEDEFINITION) + return "MessageDefinition"; if (code == FHIRAllTypes.MESSAGEHEADER) return "MessageHeader"; if (code == FHIRAllTypes.NAMINGSYSTEM) @@ -4711,6 +4755,10 @@ public class Enumerations { return "RelatedPerson"; if (code == FHIRAllTypes.REQUESTGROUP) return "RequestGroup"; + if (code == FHIRAllTypes.RESEARCHSTUDY) + return "ResearchStudy"; + if (code == FHIRAllTypes.RESEARCHSUBJECT) + return "ResearchSubject"; if (code == FHIRAllTypes.RESOURCE) return "Resource"; if (code == FHIRAllTypes.RISKASSESSMENT) @@ -5130,7 +5178,7 @@ public class Enumerations { */ DOMAINRESOURCE, /** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + * This resource provides the details from the insurer to identify a specified coverage and optionally some class of service. */ ELIGIBILITYREQUEST, /** @@ -5257,6 +5305,10 @@ public class Enumerations { * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. */ MEDICATIONSTATEMENT, + /** + * Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + */ + MESSAGEDEFINITION, /** * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. */ @@ -5357,6 +5409,14 @@ public class Enumerations { * A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". */ REQUESTGROUP, + /** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ + RESEARCHSTUDY, + /** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ + RESEARCHSUBJECT, /** * This is the base resource type for everything. */ @@ -5688,6 +5748,8 @@ public class Enumerations { return MEDICATIONREQUEST; if ("MedicationStatement".equals(codeString)) return MEDICATIONSTATEMENT; + if ("MessageDefinition".equals(codeString)) + return MESSAGEDEFINITION; if ("MessageHeader".equals(codeString)) return MESSAGEHEADER; if ("NamingSystem".equals(codeString)) @@ -5738,6 +5800,10 @@ public class Enumerations { return RELATEDPERSON; if ("RequestGroup".equals(codeString)) return REQUESTGROUP; + if ("ResearchStudy".equals(codeString)) + return RESEARCHSTUDY; + if ("ResearchSubject".equals(codeString)) + return RESEARCHSUBJECT; if ("Resource".equals(codeString)) return RESOURCE; if ("RiskAssessment".equals(codeString)) @@ -5904,6 +5970,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "MedicationDispense"; case MEDICATIONREQUEST: return "MedicationRequest"; case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEDEFINITION: return "MessageDefinition"; case MESSAGEHEADER: return "MessageHeader"; case NAMINGSYSTEM: return "NamingSystem"; case NUTRITIONREQUEST: return "NutritionRequest"; @@ -5929,6 +5996,8 @@ public class Enumerations { case REFERRALREQUEST: return "ReferralRequest"; case RELATEDPERSON: return "RelatedPerson"; case REQUESTGROUP: return "RequestGroup"; + case RESEARCHSTUDY: return "ResearchStudy"; + case RESEARCHSUBJECT: return "ResearchSubject"; case RESOURCE: return "Resource"; case RISKASSESSMENT: return "RiskAssessment"; case SCHEDULE: return "Schedule"; @@ -6077,6 +6146,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; case MEDICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; + case MESSAGEDEFINITION: return "http://hl7.org/fhir/resource-types"; case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; case NUTRITIONREQUEST: return "http://hl7.org/fhir/resource-types"; @@ -6102,6 +6172,8 @@ public class Enumerations { case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; case REQUESTGROUP: return "http://hl7.org/fhir/resource-types"; + case RESEARCHSTUDY: return "http://hl7.org/fhir/resource-types"; + case RESEARCHSUBJECT: return "http://hl7.org/fhir/resource-types"; case RESOURCE: return "http://hl7.org/fhir/resource-types"; case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; case SCHEDULE: return "http://hl7.org/fhir/resource-types"; @@ -6218,7 +6290,7 @@ public class Enumerations { case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; case DOCUMENTREFERENCE: return "A reference to a document ."; case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; - case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; + case ELIGIBILITYREQUEST: return "This resource provides the details from the insurer to identify a specified coverage and optionally some class of service."; case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."; case ENDPOINT: return "The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information."; @@ -6250,6 +6322,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; case MEDICATIONREQUEST: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationRequest\" rather than \"MedicationPrescription\" or \"MedicationOrder\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc and to harmonize with workflow patterns."; case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; + case MESSAGEDEFINITION: return "Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted."; case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle."; case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; case NUTRITIONREQUEST: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; @@ -6275,6 +6348,8 @@ public class Enumerations { case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process."; case REQUESTGROUP: return "A group of related requests that can be used to capture intended activities that have inter-dependencies such as \"give this medication after that one\"."; + case RESEARCHSTUDY: return "A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects."; + case RESEARCHSUBJECT: return "A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects."; case RESOURCE: return "This is the base resource type for everything."; case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; @@ -6423,6 +6498,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "MedicationDispense"; case MEDICATIONREQUEST: return "MedicationRequest"; case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEDEFINITION: return "MessageDefinition"; case MESSAGEHEADER: return "MessageHeader"; case NAMINGSYSTEM: return "NamingSystem"; case NUTRITIONREQUEST: return "NutritionRequest"; @@ -6448,6 +6524,8 @@ public class Enumerations { case REFERRALREQUEST: return "ReferralRequest"; case RELATEDPERSON: return "RelatedPerson"; case REQUESTGROUP: return "RequestGroup"; + case RESEARCHSTUDY: return "ResearchStudy"; + case RESEARCHSUBJECT: return "ResearchSubject"; case RESOURCE: return "Resource"; case RISKASSESSMENT: return "RiskAssessment"; case SCHEDULE: return "Schedule"; @@ -6725,6 +6803,8 @@ public class Enumerations { return FHIRDefinedType.MEDICATIONREQUEST; if ("MedicationStatement".equals(codeString)) return FHIRDefinedType.MEDICATIONSTATEMENT; + if ("MessageDefinition".equals(codeString)) + return FHIRDefinedType.MESSAGEDEFINITION; if ("MessageHeader".equals(codeString)) return FHIRDefinedType.MESSAGEHEADER; if ("NamingSystem".equals(codeString)) @@ -6775,6 +6855,10 @@ public class Enumerations { return FHIRDefinedType.RELATEDPERSON; if ("RequestGroup".equals(codeString)) return FHIRDefinedType.REQUESTGROUP; + if ("ResearchStudy".equals(codeString)) + return FHIRDefinedType.RESEARCHSTUDY; + if ("ResearchSubject".equals(codeString)) + return FHIRDefinedType.RESEARCHSUBJECT; if ("Resource".equals(codeString)) return FHIRDefinedType.RESOURCE; if ("RiskAssessment".equals(codeString)) @@ -7069,6 +7153,8 @@ public class Enumerations { return new Enumeration(this, FHIRDefinedType.MEDICATIONREQUEST); if ("MedicationStatement".equals(codeString)) return new Enumeration(this, FHIRDefinedType.MEDICATIONSTATEMENT); + if ("MessageDefinition".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.MESSAGEDEFINITION); if ("MessageHeader".equals(codeString)) return new Enumeration(this, FHIRDefinedType.MESSAGEHEADER); if ("NamingSystem".equals(codeString)) @@ -7119,6 +7205,10 @@ public class Enumerations { return new Enumeration(this, FHIRDefinedType.RELATEDPERSON); if ("RequestGroup".equals(codeString)) return new Enumeration(this, FHIRDefinedType.REQUESTGROUP); + if ("ResearchStudy".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.RESEARCHSTUDY); + if ("ResearchSubject".equals(codeString)) + return new Enumeration(this, FHIRDefinedType.RESEARCHSUBJECT); if ("Resource".equals(codeString)) return new Enumeration(this, FHIRDefinedType.RESOURCE); if ("RiskAssessment".equals(codeString)) @@ -7408,6 +7498,8 @@ public class Enumerations { return "MedicationRequest"; if (code == FHIRDefinedType.MEDICATIONSTATEMENT) return "MedicationStatement"; + if (code == FHIRDefinedType.MESSAGEDEFINITION) + return "MessageDefinition"; if (code == FHIRDefinedType.MESSAGEHEADER) return "MessageHeader"; if (code == FHIRDefinedType.NAMINGSYSTEM) @@ -7458,6 +7550,10 @@ public class Enumerations { return "RelatedPerson"; if (code == FHIRDefinedType.REQUESTGROUP) return "RequestGroup"; + if (code == FHIRDefinedType.RESEARCHSTUDY) + return "ResearchStudy"; + if (code == FHIRDefinedType.RESEARCHSUBJECT) + return "ResearchSubject"; if (code == FHIRDefinedType.RESOURCE) return "Resource"; if (code == FHIRDefinedType.RISKASSESSMENT) @@ -7529,7 +7625,7 @@ public class Enumerations { */ ADMINNOTIFY, /** - * null + * Notification to convey information. */ COMMUNICATIONREQUEST, /** @@ -7627,7 +7723,7 @@ public class Enumerations { case MEDICATIONADMINISTRATIONRECORDING: return "Indicates that a medication has been recorded against the patient's record."; case MEDICATIONADMINISTRATIONUPDATE: return "Update a Medication Administration record."; case ADMINNOTIFY: return "Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use."; - case COMMUNICATIONREQUEST: return ""; + case COMMUNICATIONREQUEST: return "Notification to convey information."; case DIAGNOSTICREPORTPROVIDE: return "Provide a diagnostic report, or update a previously provided diagnostic report."; case OBSERVATIONPROVIDE: return "Provide a simple observation or update a previously provided simple observation."; case PATIENTLINK: return "Notification that two patient records actually identify the same patient."; @@ -8213,7 +8309,7 @@ public class Enumerations { */ DOMAINRESOURCE, /** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + * This resource provides the details from the insurer to identify a specified coverage and optionally some class of service. */ ELIGIBILITYREQUEST, /** @@ -8340,6 +8436,10 @@ public class Enumerations { * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. */ MEDICATIONSTATEMENT, + /** + * Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + */ + MESSAGEDEFINITION, /** * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. */ @@ -8440,6 +8540,14 @@ public class Enumerations { * A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". */ REQUESTGROUP, + /** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ + RESEARCHSTUDY, + /** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ + RESEARCHSUBJECT, /** * This is the base resource type for everything. */ @@ -8663,6 +8771,8 @@ public class Enumerations { return MEDICATIONREQUEST; if ("MedicationStatement".equals(codeString)) return MEDICATIONSTATEMENT; + if ("MessageDefinition".equals(codeString)) + return MESSAGEDEFINITION; if ("MessageHeader".equals(codeString)) return MESSAGEHEADER; if ("NamingSystem".equals(codeString)) @@ -8713,6 +8823,10 @@ public class Enumerations { return RELATEDPERSON; if ("RequestGroup".equals(codeString)) return REQUESTGROUP; + if ("ResearchStudy".equals(codeString)) + return RESEARCHSTUDY; + if ("ResearchSubject".equals(codeString)) + return RESEARCHSUBJECT; if ("Resource".equals(codeString)) return RESOURCE; if ("RiskAssessment".equals(codeString)) @@ -8825,6 +8939,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "MedicationDispense"; case MEDICATIONREQUEST: return "MedicationRequest"; case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEDEFINITION: return "MessageDefinition"; case MESSAGEHEADER: return "MessageHeader"; case NAMINGSYSTEM: return "NamingSystem"; case NUTRITIONREQUEST: return "NutritionRequest"; @@ -8850,6 +8965,8 @@ public class Enumerations { case REFERRALREQUEST: return "ReferralRequest"; case RELATEDPERSON: return "RelatedPerson"; case REQUESTGROUP: return "RequestGroup"; + case RESEARCHSTUDY: return "ResearchStudy"; + case RESEARCHSUBJECT: return "ResearchSubject"; case RESOURCE: return "Resource"; case RISKASSESSMENT: return "RiskAssessment"; case SCHEDULE: return "Schedule"; @@ -8944,6 +9061,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; case MEDICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; + case MESSAGEDEFINITION: return "http://hl7.org/fhir/resource-types"; case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; case NUTRITIONREQUEST: return "http://hl7.org/fhir/resource-types"; @@ -8969,6 +9087,8 @@ public class Enumerations { case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; case REQUESTGROUP: return "http://hl7.org/fhir/resource-types"; + case RESEARCHSTUDY: return "http://hl7.org/fhir/resource-types"; + case RESEARCHSUBJECT: return "http://hl7.org/fhir/resource-types"; case RESOURCE: return "http://hl7.org/fhir/resource-types"; case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; case SCHEDULE: return "http://hl7.org/fhir/resource-types"; @@ -9031,7 +9151,7 @@ public class Enumerations { case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; case DOCUMENTREFERENCE: return "A reference to a document ."; case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; - case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; + case ELIGIBILITYREQUEST: return "This resource provides the details from the insurer to identify a specified coverage and optionally some class of service."; case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."; case ENDPOINT: return "The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information."; @@ -9063,6 +9183,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; case MEDICATIONREQUEST: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationRequest\" rather than \"MedicationPrescription\" or \"MedicationOrder\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc and to harmonize with workflow patterns."; case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; + case MESSAGEDEFINITION: return "Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted."; case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle."; case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; case NUTRITIONREQUEST: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; @@ -9088,6 +9209,8 @@ public class Enumerations { case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process."; case REQUESTGROUP: return "A group of related requests that can be used to capture intended activities that have inter-dependencies such as \"give this medication after that one\"."; + case RESEARCHSTUDY: return "A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects."; + case RESEARCHSUBJECT: return "A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects."; case RESOURCE: return "This is the base resource type for everything."; case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; @@ -9182,6 +9305,7 @@ public class Enumerations { case MEDICATIONDISPENSE: return "MedicationDispense"; case MEDICATIONREQUEST: return "MedicationRequest"; case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEDEFINITION: return "MessageDefinition"; case MESSAGEHEADER: return "MessageHeader"; case NAMINGSYSTEM: return "NamingSystem"; case NUTRITIONREQUEST: return "NutritionRequest"; @@ -9207,6 +9331,8 @@ public class Enumerations { case REFERRALREQUEST: return "ReferralRequest"; case RELATEDPERSON: return "RelatedPerson"; case REQUESTGROUP: return "RequestGroup"; + case RESEARCHSTUDY: return "ResearchStudy"; + case RESEARCHSUBJECT: return "ResearchSubject"; case RESOURCE: return "Resource"; case RISKASSESSMENT: return "RiskAssessment"; case SCHEDULE: return "Schedule"; @@ -9376,6 +9502,8 @@ public class Enumerations { return ResourceType.MEDICATIONREQUEST; if ("MedicationStatement".equals(codeString)) return ResourceType.MEDICATIONSTATEMENT; + if ("MessageDefinition".equals(codeString)) + return ResourceType.MESSAGEDEFINITION; if ("MessageHeader".equals(codeString)) return ResourceType.MESSAGEHEADER; if ("NamingSystem".equals(codeString)) @@ -9426,6 +9554,10 @@ public class Enumerations { return ResourceType.RELATEDPERSON; if ("RequestGroup".equals(codeString)) return ResourceType.REQUESTGROUP; + if ("ResearchStudy".equals(codeString)) + return ResourceType.RESEARCHSTUDY; + if ("ResearchSubject".equals(codeString)) + return ResourceType.RESEARCHSUBJECT; if ("Resource".equals(codeString)) return ResourceType.RESOURCE; if ("RiskAssessment".equals(codeString)) @@ -9612,6 +9744,8 @@ public class Enumerations { return new Enumeration(this, ResourceType.MEDICATIONREQUEST); if ("MedicationStatement".equals(codeString)) return new Enumeration(this, ResourceType.MEDICATIONSTATEMENT); + if ("MessageDefinition".equals(codeString)) + return new Enumeration(this, ResourceType.MESSAGEDEFINITION); if ("MessageHeader".equals(codeString)) return new Enumeration(this, ResourceType.MESSAGEHEADER); if ("NamingSystem".equals(codeString)) @@ -9662,6 +9796,10 @@ public class Enumerations { return new Enumeration(this, ResourceType.RELATEDPERSON); if ("RequestGroup".equals(codeString)) return new Enumeration(this, ResourceType.REQUESTGROUP); + if ("ResearchStudy".equals(codeString)) + return new Enumeration(this, ResourceType.RESEARCHSTUDY); + if ("ResearchSubject".equals(codeString)) + return new Enumeration(this, ResourceType.RESEARCHSUBJECT); if ("Resource".equals(codeString)) return new Enumeration(this, ResourceType.RESOURCE); if ("RiskAssessment".equals(codeString)) @@ -9843,6 +9981,8 @@ public class Enumerations { return "MedicationRequest"; if (code == ResourceType.MEDICATIONSTATEMENT) return "MedicationStatement"; + if (code == ResourceType.MESSAGEDEFINITION) + return "MessageDefinition"; if (code == ResourceType.MESSAGEHEADER) return "MessageHeader"; if (code == ResourceType.NAMINGSYSTEM) @@ -9893,6 +10033,10 @@ public class Enumerations { return "RelatedPerson"; if (code == ResourceType.REQUESTGROUP) return "RequestGroup"; + if (code == ResourceType.RESEARCHSTUDY) + return "ResearchStudy"; + if (code == ResourceType.RESEARCHSUBJECT) + return "ResearchSubject"; if (code == ResourceType.RESOURCE) return "Resource"; if (code == ResourceType.RISKASSESSMENT) diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EpisodeOfCare.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EpisodeOfCare.java index fc46bf81104..fafc69a72a5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EpisodeOfCare.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/EpisodeOfCare.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ExpansionProfile.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ExpansionProfile.java index 0e75c007330..f8554e96881 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ExpansionProfile.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ExpansionProfile.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -1635,10 +1635,10 @@ public class ExpansionProfile extends MetadataResource { protected BooleanType activeOnly; /** - * Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). + * Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains). */ @Child(name = "excludeNested", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Include or exclude nested codes in the value set expansion", formalDefinition="Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains)." ) + @Description(shortDefinition="Nested codes in the expansion or not", formalDefinition="Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains)." ) protected BooleanType excludeNested; /** @@ -2491,7 +2491,7 @@ public class ExpansionProfile extends MetadataResource { } /** - * @return {@link #excludeNested} (Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).). This is the underlying object with id, value and extensions. The accessor "getExcludeNested" gives direct access to the value + * @return {@link #excludeNested} (Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains).). This is the underlying object with id, value and extensions. The accessor "getExcludeNested" gives direct access to the value */ public BooleanType getExcludeNestedElement() { if (this.excludeNested == null) @@ -2511,7 +2511,7 @@ public class ExpansionProfile extends MetadataResource { } /** - * @param value {@link #excludeNested} (Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).). This is the underlying object with id, value and extensions. The accessor "getExcludeNested" gives direct access to the value + * @param value {@link #excludeNested} (Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains).). This is the underlying object with id, value and extensions. The accessor "getExcludeNested" gives direct access to the value */ public ExpansionProfile setExcludeNestedElement(BooleanType value) { this.excludeNested = value; @@ -2519,14 +2519,14 @@ public class ExpansionProfile extends MetadataResource { } /** - * @return Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). + * @return Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains). */ public boolean getExcludeNested() { return this.excludeNested == null || this.excludeNested.isEmpty() ? false : this.excludeNested.getValue(); } /** - * @param value Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). + * @param value Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains). */ public ExpansionProfile setExcludeNested(boolean value) { if (this.excludeNested == null) @@ -2739,7 +2739,7 @@ public class ExpansionProfile extends MetadataResource { childrenList.add(new Property("designation", "", "A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations.", 0, java.lang.Integer.MAX_VALUE, designation)); childrenList.add(new Property("includeDefinition", "boolean", "Controls whether the value set definition is included or excluded in value set expansions.", 0, java.lang.Integer.MAX_VALUE, includeDefinition)); childrenList.add(new Property("activeOnly", "boolean", "Controls whether inactive concepts are included or excluded in value set expansions.", 0, java.lang.Integer.MAX_VALUE, activeOnly)); - childrenList.add(new Property("excludeNested", "boolean", "Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).", 0, java.lang.Integer.MAX_VALUE, excludeNested)); + childrenList.add(new Property("excludeNested", "boolean", "Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains).", 0, java.lang.Integer.MAX_VALUE, excludeNested)); childrenList.add(new Property("excludeNotForUI", "boolean", "Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces.", 0, java.lang.Integer.MAX_VALUE, excludeNotForUI)); childrenList.add(new Property("excludePostCoordinated", "boolean", "Controls whether or not the value set expansion includes post coordinated codes.", 0, java.lang.Integer.MAX_VALUE, excludePostCoordinated)); childrenList.add(new Property("displayLanguage", "code", "Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.", 0, java.lang.Integer.MAX_VALUE, displayLanguage)); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ExplanationOfBenefit.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ExplanationOfBenefit.java index c6459deeade..5d2dcc12fbd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ExplanationOfBenefit.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ExplanationOfBenefit.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -189,10 +189,10 @@ public class ExplanationOfBenefit extends DomainResource { /** * For example prior or umbrella. */ - @Child(name = "relationship", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "relationship", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="How the reference claim is related", formalDefinition="For example prior or umbrella." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/related-claim-relationship") - protected Coding relationship; + protected CodeableConcept relationship; /** * An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # . @@ -201,7 +201,7 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Related file or case reference", formalDefinition="An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # ." ) protected Identifier reference; - private static final long serialVersionUID = -515151214L; + private static final long serialVersionUID = -379338905L; /** * Constructor @@ -257,12 +257,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #relationship} (For example prior or umbrella.) */ - public Coding getRelationship() { + public CodeableConcept getRelationship() { if (this.relationship == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create RelatedClaimComponent.relationship"); else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc + this.relationship = new CodeableConcept(); // cc return this.relationship; } @@ -273,7 +273,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #relationship} (For example prior or umbrella.) */ - public RelatedClaimComponent setRelationship(Coding value) { + public RelatedClaimComponent setRelationship(CodeableConcept value) { this.relationship = value; return this; } @@ -305,7 +305,7 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("claim", "Reference(Claim)", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, claim)); - childrenList.add(new Property("relationship", "Coding", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("relationship", "CodeableConcept", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship)); childrenList.add(new Property("reference", "Identifier", "An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .", 0, java.lang.Integer.MAX_VALUE, reference)); } @@ -313,7 +313,7 @@ public class ExplanationOfBenefit extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Reference - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding + case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Identifier default: return super.getProperty(hash, name, checkValid); } @@ -327,7 +327,7 @@ public class ExplanationOfBenefit extends DomainResource { this.claim = castToReference(value); // Reference break; case -261851592: // relationship - this.relationship = castToCoding(value); // Coding + this.relationship = castToCodeableConcept(value); // CodeableConcept break; case -925155509: // reference this.reference = castToIdentifier(value); // Identifier @@ -342,7 +342,7 @@ public class ExplanationOfBenefit extends DomainResource { if (name.equals("claim")) this.claim = castToReference(value); // Reference else if (name.equals("relationship")) - this.relationship = castToCoding(value); // Coding + this.relationship = castToCodeableConcept(value); // CodeableConcept else if (name.equals("reference")) this.reference = castToIdentifier(value); // Identifier else @@ -353,7 +353,7 @@ public class ExplanationOfBenefit extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 94742588: return getClaim(); // Reference - case -261851592: return getRelationship(); // Coding + case -261851592: return getRelationship(); // CodeableConcept case -925155509: return getReference(); // Identifier default: return super.makeProperty(hash, name); } @@ -367,7 +367,7 @@ public class ExplanationOfBenefit extends DomainResource { return this.claim; } else if (name.equals("relationship")) { - this.relationship = new Coding(); + this.relationship = new CodeableConcept(); return this.relationship; } else if (name.equals("reference")) { @@ -425,18 +425,18 @@ public class ExplanationOfBenefit extends DomainResource { /** * Type of Party to be reimbursed: Subscriber, provider, other. */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of party: Subscriber, Provider, other", formalDefinition="Type of Party to be reimbursed: Subscriber, provider, other." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payeetype") - protected Coding type; + protected CodeableConcept type; /** * organization | patient | practitioner | relatedperson. */ - @Child(name = "resourceType", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "resourceType", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="organization | patient | practitioner | relatedperson", formalDefinition="organization | patient | practitioner | relatedperson." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-type-link") - protected Coding resourceType; + protected CodeableConcept resourceType; /** * Party to be reimbursed: Subscriber, provider, other. @@ -445,7 +445,7 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Party to receive the payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) protected Type party; - private static final long serialVersionUID = -385798848L; + private static final long serialVersionUID = 1171160212L; /** * Constructor @@ -457,12 +457,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) */ - public Coding getType() { + public CodeableConcept 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(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -473,7 +473,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) */ - public PayeeComponent setType(Coding value) { + public PayeeComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -481,12 +481,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #resourceType} (organization | patient | practitioner | relatedperson.) */ - public Coding getResourceType() { + public CodeableConcept getResourceType() { if (this.resourceType == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PayeeComponent.resourceType"); else if (Configuration.doAutoCreate()) - this.resourceType = new Coding(); // cc + this.resourceType = new CodeableConcept(); // cc return this.resourceType; } @@ -497,7 +497,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #resourceType} (organization | patient | practitioner | relatedperson.) */ - public PayeeComponent setResourceType(Coding value) { + public PayeeComponent setResourceType(CodeableConcept value) { this.resourceType = value; return this; } @@ -549,16 +549,16 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("resourceType", "Coding", "organization | patient | practitioner | relatedperson.", 0, java.lang.Integer.MAX_VALUE, resourceType)); + childrenList.add(new Property("type", "CodeableConcept", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("resourceType", "CodeableConcept", "organization | patient | practitioner | relatedperson.", 0, java.lang.Integer.MAX_VALUE, resourceType)); childrenList.add(new Property("party[x]", "Identifier|Reference(Practitioner|Organization|Patient|RelatedPerson)", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, party)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -384364440: /*resourceType*/ return this.resourceType == null ? new Base[0] : new Base[] {this.resourceType}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -384364440: /*resourceType*/ return this.resourceType == null ? new Base[0] : new Base[] {this.resourceType}; // CodeableConcept case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Type default: return super.getProperty(hash, name, checkValid); } @@ -569,10 +569,10 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case -384364440: // resourceType - this.resourceType = castToCoding(value); // Coding + this.resourceType = castToCodeableConcept(value); // CodeableConcept break; case 106437350: // party this.party = castToType(value); // Type @@ -585,9 +585,9 @@ public class ExplanationOfBenefit extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("resourceType")) - this.resourceType = castToCoding(value); // Coding + this.resourceType = castToCodeableConcept(value); // CodeableConcept else if (name.equals("party[x]")) this.party = castToType(value); // Type else @@ -597,8 +597,8 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding - case -384364440: return getResourceType(); // Coding + case 3575610: return getType(); // CodeableConcept + case -384364440: return getResourceType(); // CodeableConcept case 1189320666: return getParty(); // Type default: return super.makeProperty(hash, name); } @@ -608,11 +608,11 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("resourceType")) { - this.resourceType = new Coding(); + this.resourceType = new CodeableConcept(); return this.resourceType; } else if (name.equals("partyIdentifier")) { @@ -670,22 +670,22 @@ public class ExplanationOfBenefit extends DomainResource { } @Block() - public static class SpecialConditionComponent extends BackboneElement implements IBaseBackboneElement { + public static class SupportingInformationComponent extends BackboneElement implements IBaseBackboneElement { /** * The general class of the information supplied: information; exception; accident, employment; onset, etc. */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Category of information", formalDefinition="The general class of the information supplied: information; exception; accident, employment; onset, etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-informationcategory") - protected Coding category; + protected CodeableConcept category; /** * System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication. */ - @Child(name = "code", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of information", formalDefinition="System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-exception") - protected Coding code; + protected CodeableConcept code; /** * The date when or period to which this information refers. @@ -695,25 +695,33 @@ public class ExplanationOfBenefit extends DomainResource { protected Type timing; /** - * Additional data. + * Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. */ - @Child(name = "value", type = {StringType.class, Quantity.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Additional Data", formalDefinition="Additional data." ) + @Child(name = "value", type = {StringType.class, Quantity.class, Attachment.class, Reference.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Additional Data or supporting information", formalDefinition="Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data." ) protected Type value; - private static final long serialVersionUID = 1771573412L; + /** + * For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content. + */ + @Child(name = "reason", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Reason associated with the information", formalDefinition="For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/missing-tooth-reason") + protected Coding reason; + + private static final long serialVersionUID = 825886944L; /** * Constructor */ - public SpecialConditionComponent() { + public SupportingInformationComponent() { super(); } /** * Constructor */ - public SpecialConditionComponent(Coding category) { + public SupportingInformationComponent(CodeableConcept category) { super(); this.category = category; } @@ -721,12 +729,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #category} (The general class of the information supplied: information; exception; accident, employment; onset, etc.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecialConditionComponent.category"); + throw new Error("Attempt to auto-create SupportingInformationComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -737,7 +745,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #category} (The general class of the information supplied: information; exception; accident, employment; onset, etc.) */ - public SpecialConditionComponent setCategory(Coding value) { + public SupportingInformationComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -745,12 +753,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #code} (System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) */ - public Coding getCode() { + public CodeableConcept getCode() { if (this.code == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecialConditionComponent.code"); + throw new Error("Attempt to auto-create SupportingInformationComponent.code"); else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc + this.code = new CodeableConcept(); // cc return this.code; } @@ -761,7 +769,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #code} (System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) */ - public SpecialConditionComponent setCode(Coding value) { + public SupportingInformationComponent setCode(CodeableConcept value) { this.code = value; return this; } @@ -806,20 +814,20 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #timing} (The date when or period to which this information refers.) */ - public SpecialConditionComponent setTiming(Type value) { + public SupportingInformationComponent setTiming(Type value) { this.timing = value; return this; } /** - * @return {@link #value} (Additional data.) + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) */ public Type getValue() { return this.value; } /** - * @return {@link #value} (Additional data.) + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) */ public StringType getValueStringType() throws FHIRException { if (!(this.value instanceof StringType)) @@ -832,7 +840,7 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @return {@link #value} (Additional data.) + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) */ public Quantity getValueQuantity() throws FHIRException { if (!(this.value instanceof Quantity)) @@ -844,33 +852,85 @@ public class ExplanationOfBenefit extends DomainResource { return this.value instanceof Quantity; } + /** + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) + */ + public Attachment getValueAttachment() throws FHIRException { + if (!(this.value instanceof Attachment)) + throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + public boolean hasValueAttachment() { + return this.value instanceof Attachment; + } + + /** + * @return {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) + */ + public Reference getValueReference() throws FHIRException { + if (!(this.value instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Reference) this.value; + } + + public boolean hasValueReference() { + return this.value instanceof Reference; + } + public boolean hasValue() { return this.value != null && !this.value.isEmpty(); } /** - * @param value {@link #value} (Additional data.) + * @param value {@link #value} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.) */ - public SpecialConditionComponent setValue(Type value) { + public SupportingInformationComponent setValue(Type value) { this.value = value; return this; } + /** + * @return {@link #reason} (For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingInformationComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); // cc + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content.) + */ + public SupportingInformationComponent setReason(Coding value) { + this.reason = value; + return this; + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "The general class of the information supplied: information; exception; accident, employment; onset, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "Coding", "System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "CodeableConcept", "The general class of the information supplied: information; exception; accident, employment; onset, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, code)); childrenList.add(new Property("timing[x]", "date|Period", "The date when or period to which this information refers.", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("value[x]", "string|Quantity", "Additional data.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("value[x]", "string|Quantity|Attachment|Reference(Any)", "Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("reason", "Coding", "For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content.", 0, java.lang.Integer.MAX_VALUE, reason)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding default: return super.getProperty(hash, name, checkValid); } @@ -880,10 +940,10 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 3059181: // code - this.code = castToCoding(value); // Coding + this.code = castToCodeableConcept(value); // CodeableConcept break; case -873664438: // timing this.timing = castToType(value); // Type @@ -891,6 +951,9 @@ public class ExplanationOfBenefit extends DomainResource { case 111972721: // value this.value = castToType(value); // Type break; + case -934964668: // reason + this.reason = castToCoding(value); // Coding + break; default: super.setProperty(hash, name, value); } @@ -899,13 +962,15 @@ public class ExplanationOfBenefit extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("code")) - this.code = castToCoding(value); // Coding + this.code = castToCodeableConcept(value); // CodeableConcept else if (name.equals("timing[x]")) this.timing = castToType(value); // Type else if (name.equals("value[x]")) this.value = castToType(value); // Type + else if (name.equals("reason")) + this.reason = castToCoding(value); // Coding else super.setProperty(name, value); } @@ -913,10 +978,11 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 50511102: return getCategory(); // Coding - case 3059181: return getCode(); // Coding + case 50511102: return getCategory(); // CodeableConcept + case 3059181: return getCode(); // CodeableConcept case 164632566: return getTiming(); // Type case -1410166417: return getValue(); // Type + case -934964668: return getReason(); // Coding default: return super.makeProperty(hash, name); } @@ -925,11 +991,11 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("code")) { - this.code = new Coding(); + this.code = new CodeableConcept(); return this.code; } else if (name.equals("timingDate")) { @@ -948,17 +1014,30 @@ public class ExplanationOfBenefit extends DomainResource { this.value = new Quantity(); return this.value; } + else if (name.equals("valueAttachment")) { + this.value = new Attachment(); + return this.value; + } + else if (name.equals("valueReference")) { + this.value = new Reference(); + return this.value; + } + else if (name.equals("reason")) { + this.reason = new Coding(); + return this.reason; + } else return super.addChild(name); } - public SpecialConditionComponent copy() { - SpecialConditionComponent dst = new SpecialConditionComponent(); + public SupportingInformationComponent copy() { + SupportingInformationComponent dst = new SupportingInformationComponent(); copyValues(dst); dst.category = category == null ? null : category.copy(); dst.code = code == null ? null : code.copy(); dst.timing = timing == null ? null : timing.copy(); dst.value = value == null ? null : value.copy(); + dst.reason = reason == null ? null : reason.copy(); return dst; } @@ -966,26 +1045,26 @@ public class ExplanationOfBenefit extends DomainResource { public boolean equalsDeep(Base other) { if (!super.equalsDeep(other)) return false; - if (!(other instanceof SpecialConditionComponent)) + if (!(other instanceof SupportingInformationComponent)) return false; - SpecialConditionComponent o = (SpecialConditionComponent) other; + SupportingInformationComponent o = (SupportingInformationComponent) other; return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(timing, o.timing, true) - && compareDeep(value, o.value, true); + && compareDeep(value, o.value, true) && compareDeep(reason, o.reason, true); } @Override public boolean equalsShallow(Base other) { if (!super.equalsShallow(other)) return false; - if (!(other instanceof SpecialConditionComponent)) + if (!(other instanceof SupportingInformationComponent)) return false; - SpecialConditionComponent o = (SpecialConditionComponent) other; + SupportingInformationComponent o = (SupportingInformationComponent) other; return true; } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, code, timing, value - ); + , reason); } public String fhirType() { @@ -993,6 +1072,388 @@ public class ExplanationOfBenefit extends DomainResource { } + } + + @Block() + public static class CareTeamComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Sequence of careteam which serves to order and provide a link. + */ + @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Number to covey order of careteam", formalDefinition="Sequence of careteam which serves to order and provide a link." ) + protected PositiveIntType sequence; + + /** + * The members of the team who provided the overall service. + */ + @Child(name = "provider", type = {Practitioner.class, Organization.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Member of the Care Team", formalDefinition="The members of the team who provided the overall service." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The members of the team who provided the overall service.) + */ + protected Resource providerTarget; + + /** + * The practitioner who is billing and responsible for the claimed services rendered to the patient. + */ + @Child(name = "responsible", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Billing practitioner", formalDefinition="The practitioner who is billing and responsible for the claimed services rendered to the patient." ) + protected BooleanType responsible; + + /** + * The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team. + */ + @Child(name = "role", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Role on the team", formalDefinition="The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-careteamrole") + protected CodeableConcept role; + + /** + * The qualification which is applicable for this service. + */ + @Child(name = "qualification", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provider-qualification") + protected CodeableConcept qualification; + + private static final long serialVersionUID = 1758966968L; + + /** + * Constructor + */ + public CareTeamComponent() { + super(); + } + + /** + * Constructor + */ + public CareTeamComponent(PositiveIntType sequence, Reference provider) { + super(); + this.sequence = sequence; + this.provider = provider; + } + + /** + * @return {@link #sequence} (Sequence of careteam which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public PositiveIntType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new PositiveIntType(); // bb + 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 careteam which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CareTeamComponent setSequenceElement(PositiveIntType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of careteam which serves to order and provide a link. + */ + public int getSequence() { + return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); + } + + /** + * @param value Sequence of careteam which serves to order and provide a link. + */ + public CareTeamComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new PositiveIntType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #provider} (The members of the team who provided the overall service.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); // cc + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The members of the team who provided the overall service.) + */ + public CareTeamComponent 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 members of the team who provided the overall service.) + */ + public Resource getProviderTarget() { + 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 members of the team who provided the overall service.) + */ + public CareTeamComponent setProviderTarget(Resource value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #responsible} (The practitioner who is billing and responsible for the claimed services rendered to the patient.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public BooleanType getResponsibleElement() { + if (this.responsible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.responsible"); + else if (Configuration.doAutoCreate()) + this.responsible = new BooleanType(); // bb + return this.responsible; + } + + public boolean hasResponsibleElement() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + public boolean hasResponsible() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + /** + * @param value {@link #responsible} (The practitioner who is billing and responsible for the claimed services rendered to the patient.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public CareTeamComponent setResponsibleElement(BooleanType value) { + this.responsible = value; + return this; + } + + /** + * @return The practitioner who is billing and responsible for the claimed services rendered to the patient. + */ + public boolean getResponsible() { + return this.responsible == null || this.responsible.isEmpty() ? false : this.responsible.getValue(); + } + + /** + * @param value The practitioner who is billing and responsible for the claimed services rendered to the patient. + */ + public CareTeamComponent setResponsible(boolean value) { + if (this.responsible == null) + this.responsible = new BooleanType(); + this.responsible.setValue(value); + return this; + } + + /** + * @return {@link #role} (The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); // cc + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.) + */ + public CareTeamComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + /** + * @return {@link #qualification} (The qualification which is applicable for this service.) + */ + public CodeableConcept getQualification() { + if (this.qualification == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareTeamComponent.qualification"); + else if (Configuration.doAutoCreate()) + this.qualification = new CodeableConcept(); // cc + return this.qualification; + } + + public boolean hasQualification() { + return this.qualification != null && !this.qualification.isEmpty(); + } + + /** + * @param value {@link #qualification} (The qualification which is applicable for this service.) + */ + public CareTeamComponent setQualification(CodeableConcept value) { + this.qualification = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "positiveInt", "Sequence of careteam which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("provider", "Reference(Practitioner|Organization)", "The members of the team who provided the overall service.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("responsible", "boolean", "The practitioner who is billing and responsible for the claimed services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, responsible)); + childrenList.add(new Property("role", "CodeableConcept", "The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("qualification", "CodeableConcept", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, qualification)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType + case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference + case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // BooleanType + case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept + case -631333393: /*qualification*/ return this.qualification == null ? new Base[0] : new Base[] {this.qualification}; // CodeableConcept + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 1349547969: // sequence + this.sequence = castToPositiveInt(value); // PositiveIntType + break; + case -987494927: // provider + this.provider = castToReference(value); // Reference + break; + case 1847674614: // responsible + this.responsible = castToBoolean(value); // BooleanType + break; + case 3506294: // role + this.role = castToCodeableConcept(value); // CodeableConcept + break; + case -631333393: // qualification + this.qualification = castToCodeableConcept(value); // CodeableConcept + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("sequence")) + this.sequence = castToPositiveInt(value); // PositiveIntType + else if (name.equals("provider")) + this.provider = castToReference(value); // Reference + else if (name.equals("responsible")) + this.responsible = castToBoolean(value); // BooleanType + else if (name.equals("role")) + this.role = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("qualification")) + this.qualification = castToCodeableConcept(value); // CodeableConcept + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType + case -987494927: return getProvider(); // Reference + case 1847674614: throw new FHIRException("Cannot make property responsible as it is not a complex type"); // BooleanType + case 3506294: return getRole(); // CodeableConcept + case -631333393: return getQualification(); // CodeableConcept + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("sequence")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); + } + else if (name.equals("provider")) { + this.provider = new Reference(); + return this.provider; + } + else if (name.equals("responsible")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.responsible"); + } + else if (name.equals("role")) { + this.role = new CodeableConcept(); + return this.role; + } + else if (name.equals("qualification")) { + this.qualification = new CodeableConcept(); + return this.qualification; + } + else + return super.addChild(name); + } + + public CareTeamComponent copy() { + CareTeamComponent dst = new CareTeamComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.responsible = responsible == null ? null : responsible.copy(); + dst.role = role == null ? null : role.copy(); + dst.qualification = qualification == null ? null : qualification.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof CareTeamComponent)) + return false; + CareTeamComponent o = (CareTeamComponent) other; + return compareDeep(sequence, o.sequence, true) && compareDeep(provider, o.provider, true) && compareDeep(responsible, o.responsible, true) + && compareDeep(role, o.role, true) && compareDeep(qualification, o.qualification, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof CareTeamComponent)) + return false; + CareTeamComponent o = (CareTeamComponent) other; + return compareValues(sequence, o.sequence, true) && compareValues(responsible, o.responsible, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, provider, responsible + , role, qualification); + } + + public String fhirType() { + return "ExplanationOfBenefit.careTeam"; + + } + } @Block() @@ -1007,28 +1468,28 @@ public class ExplanationOfBenefit extends DomainResource { /** * The diagnosis. */ - @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Child(name = "diagnosis", type = {CodeableConcept.class, Condition.class}, order=2, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/icd-10") - protected Coding diagnosis; + protected Type diagnosis; /** * The type of the Diagnosis, for example: admitting,. */ - @Child(name = "type", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Type of Diagnosis", formalDefinition="The type of the Diagnosis, for example: admitting,." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-diagnosistype") - protected List type; + protected List type; /** - * The Diagnosis Related Group (DRG) code based on the assigned grouping code system. + * The package billing code, for example DRG, based on the assigned grouping code system. */ - @Child(name = "drg", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Diagnosis Related Group", formalDefinition="The Diagnosis Related Group (DRG) code based on the assigned grouping code system." ) + @Child(name = "packageCode", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Package billing code", formalDefinition="The package billing code, for example DRG, based on the assigned grouping code system." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-diagnosisrelatedgroup") - protected Coding drg; + protected CodeableConcept packageCode; - private static final long serialVersionUID = 135693095L; + private static final long serialVersionUID = -350960873L; /** * Constructor @@ -1040,7 +1501,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * Constructor */ - public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) { + public DiagnosisComponent(PositiveIntType sequence, Type diagnosis) { super(); this.sequence = sequence; this.diagnosis = diagnosis; @@ -1094,15 +1555,36 @@ public class ExplanationOfBenefit extends DomainResource { /** * @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(); // cc + public Type getDiagnosis() { return this.diagnosis; } + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public CodeableConcept getDiagnosisCodeableConcept() throws FHIRException { + if (!(this.diagnosis instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.diagnosis.getClass().getName()+" was encountered"); + return (CodeableConcept) this.diagnosis; + } + + public boolean hasDiagnosisCodeableConcept() { + return this.diagnosis instanceof CodeableConcept; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Reference getDiagnosisReference() throws FHIRException { + if (!(this.diagnosis instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.diagnosis.getClass().getName()+" was encountered"); + return (Reference) this.diagnosis; + } + + public boolean hasDiagnosisReference() { + return this.diagnosis instanceof Reference; + } + public boolean hasDiagnosis() { return this.diagnosis != null && !this.diagnosis.isEmpty(); } @@ -1110,7 +1592,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #diagnosis} (The diagnosis.) */ - public DiagnosisComponent setDiagnosis(Coding value) { + public DiagnosisComponent setDiagnosis(Type value) { this.diagnosis = value; return this; } @@ -1118,16 +1600,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #type} (The type of the Diagnosis, for example: admitting,.) */ - public List getType() { + public List getType() { if (this.type == null) - this.type = new ArrayList(); + this.type = new ArrayList(); return this.type; } /** * @return Returns a reference to this for easy method chaining */ - public DiagnosisComponent setType(List theType) { + public DiagnosisComponent setType(List theType) { this.type = theType; return this; } @@ -1135,25 +1617,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasType() { if (this.type == null) return false; - for (Coding item : this.type) + for (CodeableConcept item : this.type) if (!item.isEmpty()) return true; return false; } - public Coding addType() { //3 - Coding t = new Coding(); + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); if (this.type == null) - this.type = new ArrayList(); + this.type = new ArrayList(); this.type.add(t); return t; } - public DiagnosisComponent addType(Coding t) { //3 + public DiagnosisComponent addType(CodeableConcept t) { //3 if (t == null) return this; if (this.type == null) - this.type = new ArrayList(); + this.type = new ArrayList(); this.type.add(t); return this; } @@ -1161,7 +1643,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist */ - public Coding getTypeFirstRep() { + public CodeableConcept getTypeFirstRep() { if (getType().isEmpty()) { addType(); } @@ -1169,44 +1651,44 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @return {@link #drg} (The Diagnosis Related Group (DRG) code based on the assigned grouping code system.) + * @return {@link #packageCode} (The package billing code, for example DRG, based on the assigned grouping code system.) */ - public Coding getDrg() { - if (this.drg == null) + public CodeableConcept getPackageCode() { + if (this.packageCode == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.drg"); + throw new Error("Attempt to auto-create DiagnosisComponent.packageCode"); else if (Configuration.doAutoCreate()) - this.drg = new Coding(); // cc - return this.drg; + this.packageCode = new CodeableConcept(); // cc + return this.packageCode; } - public boolean hasDrg() { - return this.drg != null && !this.drg.isEmpty(); + public boolean hasPackageCode() { + return this.packageCode != null && !this.packageCode.isEmpty(); } /** - * @param value {@link #drg} (The Diagnosis Related Group (DRG) code based on the assigned grouping code system.) + * @param value {@link #packageCode} (The package billing code, for example DRG, based on the assigned grouping code system.) */ - public DiagnosisComponent setDrg(Coding value) { - this.drg = value; + public DiagnosisComponent setPackageCode(CodeableConcept value) { + this.packageCode = value; return this; } protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("type", "Coding", "The type of the Diagnosis, for example: admitting,.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("drg", "Coding", "The Diagnosis Related Group (DRG) code based on the assigned grouping code system.", 0, java.lang.Integer.MAX_VALUE, drg)); + childrenList.add(new Property("diagnosis[x]", "CodeableConcept|Reference(Condition)", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("type", "CodeableConcept", "The type of the Diagnosis, for example: admitting,.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("packageCode", "CodeableConcept", "The package billing code, for example DRG, based on the assigned grouping code system.", 0, java.lang.Integer.MAX_VALUE, packageCode)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Coding - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Coding - case 99737: /*drg*/ return this.drg == null ? new Base[0] : new Base[] {this.drg}; // Coding + case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Type + case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept + case 908444499: /*packageCode*/ return this.packageCode == null ? new Base[0] : new Base[] {this.packageCode}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -1219,13 +1701,13 @@ public class ExplanationOfBenefit extends DomainResource { this.sequence = castToPositiveInt(value); // PositiveIntType break; case 1196993265: // diagnosis - this.diagnosis = castToCoding(value); // Coding + this.diagnosis = castToType(value); // Type break; case 3575610: // type - this.getType().add(castToCoding(value)); // Coding + this.getType().add(castToCodeableConcept(value)); // CodeableConcept break; - case 99737: // drg - this.drg = castToCoding(value); // Coding + case 908444499: // packageCode + this.packageCode = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -1236,12 +1718,12 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("sequence")) this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("diagnosis")) - this.diagnosis = castToCoding(value); // Coding + else if (name.equals("diagnosis[x]")) + this.diagnosis = castToType(value); // Type else if (name.equals("type")) - this.getType().add(castToCoding(value)); - else if (name.equals("drg")) - this.drg = castToCoding(value); // Coding + this.getType().add(castToCodeableConcept(value)); + else if (name.equals("packageCode")) + this.packageCode = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -1250,9 +1732,9 @@ public class ExplanationOfBenefit extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 1196993265: return getDiagnosis(); // Coding - case 3575610: return addType(); // Coding - case 99737: return getDrg(); // Coding + case -1487009809: return getDiagnosis(); // Type + case 3575610: return addType(); // CodeableConcept + case 908444499: return getPackageCode(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -1263,16 +1745,20 @@ public class ExplanationOfBenefit extends DomainResource { if (name.equals("sequence")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); } - else if (name.equals("diagnosis")) { - this.diagnosis = new Coding(); + else if (name.equals("diagnosisCodeableConcept")) { + this.diagnosis = new CodeableConcept(); + return this.diagnosis; + } + else if (name.equals("diagnosisReference")) { + this.diagnosis = new Reference(); return this.diagnosis; } else if (name.equals("type")) { return addType(); } - else if (name.equals("drg")) { - this.drg = new Coding(); - return this.drg; + else if (name.equals("packageCode")) { + this.packageCode = new CodeableConcept(); + return this.packageCode; } else return super.addChild(name); @@ -1284,11 +1770,11 @@ public class ExplanationOfBenefit extends DomainResource { dst.sequence = sequence == null ? null : sequence.copy(); dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); if (type != null) { - dst.type = new ArrayList(); - for (Coding i : type) + dst.type = new ArrayList(); + for (CodeableConcept i : type) dst.type.add(i.copy()); }; - dst.drg = drg == null ? null : drg.copy(); + dst.packageCode = packageCode == null ? null : packageCode.copy(); return dst; } @@ -1300,7 +1786,7 @@ public class ExplanationOfBenefit extends DomainResource { return false; DiagnosisComponent o = (DiagnosisComponent) other; return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(type, o.type, true) - && compareDeep(drg, o.drg, true); + && compareDeep(packageCode, o.packageCode, true); } @Override @@ -1315,7 +1801,7 @@ public class ExplanationOfBenefit extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, diagnosis, type - , drg); + , packageCode); } public String fhirType() { @@ -1344,7 +1830,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * The procedure code. */ - @Child(name = "procedure", type = {Coding.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=false) + @Child(name = "procedure", type = {CodeableConcept.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Patient's list of procedures performed", formalDefinition="The procedure code." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/icd-10-procedures") protected Type procedure; @@ -1471,14 +1957,14 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #procedure} (The procedure code.) */ - public Coding getProcedureCoding() throws FHIRException { - if (!(this.procedure instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.procedure.getClass().getName()+" was encountered"); - return (Coding) this.procedure; + public CodeableConcept getProcedureCodeableConcept() throws FHIRException { + if (!(this.procedure instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.procedure.getClass().getName()+" was encountered"); + return (CodeableConcept) this.procedure; } - public boolean hasProcedureCoding() { - return this.procedure instanceof Coding; + public boolean hasProcedureCodeableConcept() { + return this.procedure instanceof CodeableConcept; } /** @@ -1510,7 +1996,7 @@ public class ExplanationOfBenefit extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "Sequence of procedures which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); childrenList.add(new Property("date", "dateTime", "Date and optionally time the procedure was performed .", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("procedure[x]", "Coding|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("procedure[x]", "CodeableConcept|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure)); } @Override @@ -1572,8 +2058,8 @@ public class ExplanationOfBenefit extends DomainResource { else if (name.equals("date")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.date"); } - else if (name.equals("procedureCoding")) { - this.procedure = new Coding(); + else if (name.equals("procedureCodeableConcept")) { + this.procedure = new CodeableConcept(); return this.procedure; } else if (name.equals("procedureReference")) { @@ -1627,7 +2113,7 @@ public class ExplanationOfBenefit extends DomainResource { } @Block() - public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { + public static class InsuranceComponent extends BackboneElement implements IBaseBackboneElement { /** * Reference to the program or plan identification, underwriter or payor. */ @@ -1652,7 +2138,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * Constructor */ - public CoverageComponent() { + public InsuranceComponent() { super(); } @@ -1662,7 +2148,7 @@ public class ExplanationOfBenefit extends DomainResource { public Reference getCoverage() { if (this.coverage == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); + throw new Error("Attempt to auto-create InsuranceComponent.coverage"); else if (Configuration.doAutoCreate()) this.coverage = new Reference(); // cc return this.coverage; @@ -1675,7 +2161,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) */ - public CoverageComponent setCoverage(Reference value) { + public InsuranceComponent setCoverage(Reference value) { this.coverage = value; return this; } @@ -1686,7 +2172,7 @@ public class ExplanationOfBenefit extends DomainResource { public Coverage getCoverageTarget() { if (this.coverageTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); + throw new Error("Attempt to auto-create InsuranceComponent.coverage"); else if (Configuration.doAutoCreate()) this.coverageTarget = new Coverage(); // aa return this.coverageTarget; @@ -1695,7 +2181,7 @@ public class ExplanationOfBenefit 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 CoverageComponent setCoverageTarget(Coverage value) { + public InsuranceComponent setCoverageTarget(Coverage value) { this.coverageTarget = value; return this; } @@ -1712,7 +2198,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return Returns a reference to this for easy method chaining */ - public CoverageComponent setPreAuthRef(List thePreAuthRef) { + public InsuranceComponent setPreAuthRef(List thePreAuthRef) { this.preAuthRef = thePreAuthRef; return this; } @@ -1740,7 +2226,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) */ - public CoverageComponent addPreAuthRef(String value) { //1 + public InsuranceComponent addPreAuthRef(String value) { //1 StringType t = new StringType(); t.setValue(value); if (this.preAuthRef == null) @@ -1824,8 +2310,8 @@ public class ExplanationOfBenefit extends DomainResource { return super.addChild(name); } - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); + public InsuranceComponent copy() { + InsuranceComponent dst = new InsuranceComponent(); copyValues(dst); dst.coverage = coverage == null ? null : coverage.copy(); if (preAuthRef != null) { @@ -1840,9 +2326,9 @@ public class ExplanationOfBenefit extends DomainResource { public boolean equalsDeep(Base other) { if (!super.equalsDeep(other)) return false; - if (!(other instanceof CoverageComponent)) + if (!(other instanceof InsuranceComponent)) return false; - CoverageComponent o = (CoverageComponent) other; + InsuranceComponent o = (InsuranceComponent) other; return compareDeep(coverage, o.coverage, true) && compareDeep(preAuthRef, o.preAuthRef, true); } @@ -1850,9 +2336,9 @@ public class ExplanationOfBenefit extends DomainResource { public boolean equalsShallow(Base other) { if (!super.equalsShallow(other)) return false; - if (!(other instanceof CoverageComponent)) + if (!(other instanceof InsuranceComponent)) return false; - CoverageComponent o = (CoverageComponent) other; + InsuranceComponent o = (InsuranceComponent) other; return compareValues(preAuthRef, o.preAuthRef, true); } @@ -1861,7 +2347,7 @@ public class ExplanationOfBenefit extends DomainResource { } public String fhirType() { - return "ExplanationOfBenefit.coverage"; + return "ExplanationOfBenefit.insurance"; } @@ -1879,10 +2365,10 @@ public class ExplanationOfBenefit extends DomainResource { /** * Type of accident: work, auto, etc. */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="The nature of the accident", formalDefinition="Type of accident: work, auto, etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-ActIncidentCode") - protected Coding type; + protected CodeableConcept type; /** * Where the accident occurred. @@ -1891,7 +2377,7 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Accident Place", formalDefinition="Where the accident occurred." ) protected Type location; - private static final long serialVersionUID = -242365747L; + private static final long serialVersionUID = 622904984L; /** * Constructor @@ -1952,12 +2438,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #type} (Type of accident: work, auto, etc.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AccidentComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -1968,7 +2454,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #type} (Type of accident: work, auto, etc.) */ - public AccidentComponent setType(Coding value) { + public AccidentComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -2021,7 +2507,7 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("date", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("type", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("location[x]", "Address|Reference(Location)", "Where the accident occurred.", 0, java.lang.Integer.MAX_VALUE, location)); } @@ -2029,7 +2515,7 @@ public class ExplanationOfBenefit extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Type default: return super.getProperty(hash, name, checkValid); } @@ -2043,7 +2529,7 @@ public class ExplanationOfBenefit extends DomainResource { this.date = castToDate(value); // DateType break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 1901043637: // location this.location = castToType(value); // Type @@ -2058,7 +2544,7 @@ public class ExplanationOfBenefit extends DomainResource { if (name.equals("date")) this.date = castToDate(value); // DateType else if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("location[x]")) this.location = castToType(value); // Type else @@ -2069,7 +2555,7 @@ public class ExplanationOfBenefit extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateType - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 552316075: return getLocation(); // Type default: return super.makeProperty(hash, name); } @@ -2082,7 +2568,7 @@ public class ExplanationOfBenefit extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.date"); } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("locationAddress")) { @@ -2148,11 +2634,11 @@ public class ExplanationOfBenefit extends DomainResource { protected PositiveIntType sequence; /** - * The members of the team who provided the overall service as well as their role and whether responsible and qualifications. + * Careteam applicable for this service or product line. */ - @Child(name = "careTeam", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Care Team members", formalDefinition="The members of the team who provided the overall service as well as their role and whether responsible and qualifications." ) - protected List careTeam; + @Child(name = "careTeamLinkId", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Applicable careteam members", formalDefinition="Careteam applicable for this service or product line." ) + protected List careTeamLinkId; /** * Diagnosis applicable for this service or product line. @@ -2161,57 +2647,71 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Applicable diagnoses", formalDefinition="Diagnosis applicable for this service or product line." ) protected List diagnosisLinkId; + /** + * Procedures applicable for this service or product line. + */ + @Child(name = "procedureLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Applicable procedures", formalDefinition="Procedures applicable for this service or product line." ) + protected List procedureLinkId; + + /** + * Exceptions, special conditions and supporting information pplicable for this service or product line. + */ + @Child(name = "informationLinkId", type = {PositiveIntType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Applicable exception and supporting information", formalDefinition="Exceptions, special conditions and supporting information pplicable for this service or product line." ) + protected List informationLinkId; + /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. */ - @Child(name = "service", type = {Coding.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Billing Code", formalDefinition="If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. */ - @Child(name = "programCode", type = {Coding.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "programCode", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-program-code") - protected List programCode; + protected List programCode; /** * The date or dates when the enclosed suite of services were performed or completed. */ - @Child(name = "serviced", type = {DateType.class, Period.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "serviced", type = {DateType.class, Period.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) protected Type serviced; /** * Where the service was provided. */ - @Child(name = "location", type = {Coding.class, Address.class, Location.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "location", type = {CodeableConcept.class, Address.class, Location.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Place of service", formalDefinition="Where the service was provided." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-place") protected Type location; @@ -2219,42 +2719,35 @@ public class ExplanationOfBenefit extends DomainResource { /** * The number of repetitions of a service or product. */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "quantity", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) protected SimpleQuantity 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=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "unitPrice", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=false) @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=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "factor", type = {DecimalType.class}, order=15, min=0, max=1, modifier=false, summary=false) @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=14, min=0, max=1, modifier=false, summary=false) - @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 addittional 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=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "net", type = {Money.class}, order=16, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "udi", type = {Device.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) protected List udi; /** @@ -2266,48 +2759,48 @@ public class ExplanationOfBenefit extends DomainResource { /** * Physical service site on the patient (limb, tooth, etc). */ - @Child(name = "bodySite", type = {Coding.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Child(name = "bodySite", type = {CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/tooth") - protected Coding bodySite; + protected CodeableConcept bodySite; /** * A region or surface of the site, eg. limb region or tooth surface(s). */ - @Child(name = "subSite", type = {Coding.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "subSite", type = {CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/surface") - protected List subSite; + protected List subSite; /** * A list of note references to the notes provided below. */ - @Child(name = "noteNumber", type = {PositiveIntType.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "noteNumber", type = {PositiveIntType.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) protected List noteNumber; /** * The adjudications results. */ - @Child(name = "adjudication", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "adjudication", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) protected List adjudication; /** * Second tier of goods and services. */ - @Child(name = "detail", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "detail", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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=22, min=0, max=1, modifier=false, summary=false) + @Child(name = "prosthesis", type = {}, order=23, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) protected ProsthesisComponent prosthesis; - private static final long serialVersionUID = 1963166863L; + private static final long serialVersionUID = 283646569L; /** * Constructor @@ -2370,56 +2863,64 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @return {@link #careTeam} (The members of the team who provided the overall service as well as their role and whether responsible and qualifications.) + * @return {@link #careTeamLinkId} (Careteam applicable for this service or product line.) */ - public List getCareTeam() { - if (this.careTeam == null) - this.careTeam = new ArrayList(); - return this.careTeam; + public List getCareTeamLinkId() { + if (this.careTeamLinkId == null) + this.careTeamLinkId = new ArrayList(); + return this.careTeamLinkId; } /** * @return Returns a reference to this for easy method chaining */ - public ItemComponent setCareTeam(List theCareTeam) { - this.careTeam = theCareTeam; + public ItemComponent setCareTeamLinkId(List theCareTeamLinkId) { + this.careTeamLinkId = theCareTeamLinkId; return this; } - public boolean hasCareTeam() { - if (this.careTeam == null) + public boolean hasCareTeamLinkId() { + if (this.careTeamLinkId == null) return false; - for (CareTeamComponent item : this.careTeam) + for (PositiveIntType item : this.careTeamLinkId) if (!item.isEmpty()) return true; return false; } - public CareTeamComponent addCareTeam() { //3 - CareTeamComponent t = new CareTeamComponent(); - if (this.careTeam == null) - this.careTeam = new ArrayList(); - this.careTeam.add(t); + /** + * @return {@link #careTeamLinkId} (Careteam applicable for this service or product line.) + */ + public PositiveIntType addCareTeamLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.careTeamLinkId == null) + this.careTeamLinkId = new ArrayList(); + this.careTeamLinkId.add(t); return t; } - public ItemComponent addCareTeam(CareTeamComponent t) { //3 - if (t == null) - return this; - if (this.careTeam == null) - this.careTeam = new ArrayList(); - this.careTeam.add(t); + /** + * @param value {@link #careTeamLinkId} (Careteam applicable for this service or product line.) + */ + public ItemComponent addCareTeamLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.careTeamLinkId == null) + this.careTeamLinkId = new ArrayList(); + this.careTeamLinkId.add(t); return this; } /** - * @return The first repetition of repeating field {@link #careTeam}, creating it if it does not already exist + * @param value {@link #careTeamLinkId} (Careteam applicable for this service or product line.) */ - public CareTeamComponent getCareTeamFirstRep() { - if (getCareTeam().isEmpty()) { - addCareTeam(); - } - return getCareTeam().get(0); + public boolean hasCareTeamLinkId(int value) { + if (this.careTeamLinkId == null) + return false; + for (PositiveIntType v : this.careTeamLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; } /** @@ -2483,15 +2984,137 @@ public class ExplanationOfBenefit extends DomainResource { return false; } + /** + * @return {@link #procedureLinkId} (Procedures applicable for this service or product line.) + */ + public List getProcedureLinkId() { + if (this.procedureLinkId == null) + this.procedureLinkId = new ArrayList(); + return this.procedureLinkId; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ItemComponent setProcedureLinkId(List theProcedureLinkId) { + this.procedureLinkId = theProcedureLinkId; + return this; + } + + public boolean hasProcedureLinkId() { + if (this.procedureLinkId == null) + return false; + for (PositiveIntType item : this.procedureLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #procedureLinkId} (Procedures applicable for this service or product line.) + */ + public PositiveIntType addProcedureLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.procedureLinkId == null) + this.procedureLinkId = new ArrayList(); + this.procedureLinkId.add(t); + return t; + } + + /** + * @param value {@link #procedureLinkId} (Procedures applicable for this service or product line.) + */ + public ItemComponent addProcedureLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.procedureLinkId == null) + this.procedureLinkId = new ArrayList(); + this.procedureLinkId.add(t); + return this; + } + + /** + * @param value {@link #procedureLinkId} (Procedures applicable for this service or product line.) + */ + public boolean hasProcedureLinkId(int value) { + if (this.procedureLinkId == null) + return false; + for (PositiveIntType v : this.procedureLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + + /** + * @return {@link #informationLinkId} (Exceptions, special conditions and supporting information pplicable for this service or product line.) + */ + public List getInformationLinkId() { + if (this.informationLinkId == null) + this.informationLinkId = new ArrayList(); + return this.informationLinkId; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ItemComponent setInformationLinkId(List theInformationLinkId) { + this.informationLinkId = theInformationLinkId; + return this; + } + + public boolean hasInformationLinkId() { + if (this.informationLinkId == null) + return false; + for (PositiveIntType item : this.informationLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #informationLinkId} (Exceptions, special conditions and supporting information pplicable for this service or product line.) + */ + public PositiveIntType addInformationLinkIdElement() {//2 + PositiveIntType t = new PositiveIntType(); + if (this.informationLinkId == null) + this.informationLinkId = new ArrayList(); + this.informationLinkId.add(t); + return t; + } + + /** + * @param value {@link #informationLinkId} (Exceptions, special conditions and supporting information pplicable for this service or product line.) + */ + public ItemComponent addInformationLinkId(int value) { //1 + PositiveIntType t = new PositiveIntType(); + t.setValue(value); + if (this.informationLinkId == null) + this.informationLinkId = new ArrayList(); + this.informationLinkId.add(t); + return this; + } + + /** + * @param value {@link #informationLinkId} (Exceptions, special conditions and supporting information pplicable for this service or product line.) + */ + public boolean hasInformationLinkId(int value) { + if (this.informationLinkId == null) + return false; + for (PositiveIntType v : this.informationLinkId) + if (v.equals(value)) // positiveInt + return true; + return false; + } + /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ItemComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -2502,7 +3125,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public ItemComponent setRevenue(Coding value) { + public ItemComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -2510,12 +3133,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ItemComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -2526,7 +3149,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public ItemComponent setCategory(Coding value) { + public ItemComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -2534,12 +3157,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public Coding getService() { + public CodeableConcept getService() { if (this.service == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ItemComponent.service"); else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -2550,7 +3173,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public ItemComponent setService(Coding value) { + public ItemComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -2558,16 +3181,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public ItemComponent setModifier(List theModifier) { + public ItemComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -2575,25 +3198,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public ItemComponent addModifier(Coding t) { //3 + public ItemComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -2601,7 +3224,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -2611,16 +3234,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) */ - public List getProgramCode() { + public List getProgramCode() { if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); return this.programCode; } /** * @return Returns a reference to this for easy method chaining */ - public ItemComponent setProgramCode(List theProgramCode) { + public ItemComponent setProgramCode(List theProgramCode) { this.programCode = theProgramCode; return this; } @@ -2628,25 +3251,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasProgramCode() { if (this.programCode == null) return false; - for (Coding item : this.programCode) + for (CodeableConcept item : this.programCode) if (!item.isEmpty()) return true; return false; } - public Coding addProgramCode() { //3 - Coding t = new Coding(); + public CodeableConcept addProgramCode() { //3 + CodeableConcept t = new CodeableConcept(); if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return t; } - public ItemComponent addProgramCode(Coding t) { //3 + public ItemComponent addProgramCode(CodeableConcept t) { //3 if (t == null) return this; if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return this; } @@ -2654,7 +3277,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #programCode}, creating it if it does not already exist */ - public Coding getProgramCodeFirstRep() { + public CodeableConcept getProgramCodeFirstRep() { if (getProgramCode().isEmpty()) { addProgramCode(); } @@ -2716,14 +3339,14 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #location} (Where the service was provided.) */ - public Coding getLocationCoding() throws FHIRException { - if (!(this.location instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.location.getClass().getName()+" was encountered"); - return (Coding) this.location; + public CodeableConcept getLocationCodeableConcept() throws FHIRException { + if (!(this.location instanceof CodeableConcept)) + throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.location.getClass().getName()+" was encountered"); + return (CodeableConcept) this.location; } - public boolean hasLocationCoding() { - return this.location instanceof Coding; + public boolean hasLocationCodeableConcept() { + return this.location instanceof CodeableConcept; } /** @@ -2879,73 +3502,6 @@ public class ExplanationOfBenefit extends DomainResource { 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 ItemComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - 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 ItemComponent 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 ItemComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @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 ItemComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @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 ItemComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - /** * @return {@link #net} (The quantity times the unit price for an addittional 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.) */ @@ -3048,12 +3604,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) */ - public Coding getBodySite() { + public CodeableConcept getBodySite() { if (this.bodySite == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ItemComponent.bodySite"); else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); // cc + this.bodySite = new CodeableConcept(); // cc return this.bodySite; } @@ -3064,7 +3620,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) */ - public ItemComponent setBodySite(Coding value) { + public ItemComponent setBodySite(CodeableConcept value) { this.bodySite = value; return this; } @@ -3072,16 +3628,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) */ - public List getSubSite() { + public List getSubSite() { if (this.subSite == null) - this.subSite = new ArrayList(); + this.subSite = new ArrayList(); return this.subSite; } /** * @return Returns a reference to this for easy method chaining */ - public ItemComponent setSubSite(List theSubSite) { + public ItemComponent setSubSite(List theSubSite) { this.subSite = theSubSite; return this; } @@ -3089,25 +3645,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasSubSite() { if (this.subSite == null) return false; - for (Coding item : this.subSite) + for (CodeableConcept item : this.subSite) if (!item.isEmpty()) return true; return false; } - public Coding addSubSite() { //3 - Coding t = new Coding(); + public CodeableConcept addSubSite() { //3 + CodeableConcept t = new CodeableConcept(); if (this.subSite == null) - this.subSite = new ArrayList(); + this.subSite = new ArrayList(); this.subSite.add(t); return t; } - public ItemComponent addSubSite(Coding t) { //3 + public ItemComponent addSubSite(CodeableConcept t) { //3 if (t == null) return this; if (this.subSite == null) - this.subSite = new ArrayList(); + this.subSite = new ArrayList(); this.subSite.add(t); return this; } @@ -3115,7 +3671,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #subSite}, creating it if it does not already exist */ - public Coding getSubSiteFirstRep() { + public CodeableConcept getSubSiteFirstRep() { if (getSubSite().isEmpty()) { addSubSite(); } @@ -3316,23 +3872,24 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("careTeam", "", "The members of the team who provided the overall service as well as their role and whether responsible and qualifications.", 0, java.lang.Integer.MAX_VALUE, careTeam)); + childrenList.add(new Property("careTeamLinkId", "positiveInt", "Careteam applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, careTeamLinkId)); childrenList.add(new Property("diagnosisLinkId", "positiveInt", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); - childrenList.add(new Property("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("procedureLinkId", "positiveInt", "Procedures applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, procedureLinkId)); + childrenList.add(new Property("informationLinkId", "positiveInt", "Exceptions, special conditions and supporting information pplicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, informationLinkId)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("programCode", "CodeableConcept", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); - childrenList.add(new Property("location[x]", "Coding|Address|Reference(Location)", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("location[x]", "CodeableConcept|Address|Reference(Location)", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, location)); childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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", "Reference(Device)", "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("bodySite", "CodeableConcept", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subSite", "CodeableConcept", "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("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); @@ -3343,23 +3900,24 @@ public class ExplanationOfBenefit extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case -7323378: /*careTeam*/ return this.careTeam == null ? new Base[0] : this.careTeam.toArray(new Base[this.careTeam.size()]); // CareTeamComponent + case -186757789: /*careTeamLinkId*/ return this.careTeamLinkId == null ? new Base[0] : this.careTeamLinkId.toArray(new Base[this.careTeamLinkId.size()]); // PositiveIntType case -1659207418: /*diagnosisLinkId*/ return this.diagnosisLinkId == null ? new Base[0] : this.diagnosisLinkId.toArray(new Base[this.diagnosisLinkId.size()]); // PositiveIntType - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case -532846744: /*procedureLinkId*/ return this.procedureLinkId == null ? new Base[0] : this.procedureLinkId.toArray(new Base[this.procedureLinkId.size()]); // PositiveIntType + case 1965585153: /*informationLinkId*/ return this.informationLinkId == null ? new Base[0] : this.informationLinkId.toArray(new Base[this.informationLinkId.size()]); // PositiveIntType + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // CodeableConcept case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Type case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding - case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // Coding + case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept + case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // CodeableConcept case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailComponent @@ -3375,26 +3933,32 @@ public class ExplanationOfBenefit extends DomainResource { case 1349547969: // sequence this.sequence = castToPositiveInt(value); // PositiveIntType break; - case -7323378: // careTeam - this.getCareTeam().add((CareTeamComponent) value); // CareTeamComponent + case -186757789: // careTeamLinkId + this.getCareTeamLinkId().add(castToPositiveInt(value)); // PositiveIntType break; case -1659207418: // diagnosisLinkId this.getDiagnosisLinkId().add(castToPositiveInt(value)); // PositiveIntType break; + case -532846744: // procedureLinkId + this.getProcedureLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; + case 1965585153: // informationLinkId + this.getInformationLinkId().add(castToPositiveInt(value)); // PositiveIntType + break; case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding + this.getProgramCode().add(castToCodeableConcept(value)); // CodeableConcept break; case 1379209295: // serviced this.serviced = castToType(value); // Type @@ -3411,9 +3975,6 @@ public class ExplanationOfBenefit extends DomainResource { case -1282148017: // factor this.factor = castToDecimal(value); // DecimalType break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; case 108957: // net this.net = castToMoney(value); // Money break; @@ -3421,10 +3982,10 @@ public class ExplanationOfBenefit extends DomainResource { this.getUdi().add(castToReference(value)); // Reference break; case 1702620169: // bodySite - this.bodySite = castToCoding(value); // Coding + this.bodySite = castToCodeableConcept(value); // CodeableConcept break; case -1868566105: // subSite - this.getSubSite().add(castToCoding(value)); // Coding + this.getSubSite().add(castToCodeableConcept(value)); // CodeableConcept break; case -1110033957: // noteNumber this.getNoteNumber().add(castToPositiveInt(value)); // PositiveIntType @@ -3447,20 +4008,24 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("sequence")) this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("careTeam")) - this.getCareTeam().add((CareTeamComponent) value); + else if (name.equals("careTeamLinkId")) + this.getCareTeamLinkId().add(castToPositiveInt(value)); else if (name.equals("diagnosisLinkId")) this.getDiagnosisLinkId().add(castToPositiveInt(value)); + else if (name.equals("procedureLinkId")) + this.getProcedureLinkId().add(castToPositiveInt(value)); + else if (name.equals("informationLinkId")) + this.getInformationLinkId().add(castToPositiveInt(value)); else if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); + this.getProgramCode().add(castToCodeableConcept(value)); else if (name.equals("serviced[x]")) this.serviced = castToType(value); // Type else if (name.equals("location[x]")) @@ -3471,16 +4036,14 @@ public class ExplanationOfBenefit extends DomainResource { this.unitPrice = castToMoney(value); // Money else if (name.equals("factor")) this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType else if (name.equals("net")) this.net = castToMoney(value); // Money else if (name.equals("udi")) this.getUdi().add(castToReference(value)); else if (name.equals("bodySite")) - this.bodySite = castToCoding(value); // Coding + this.bodySite = castToCodeableConcept(value); // CodeableConcept else if (name.equals("subSite")) - this.getSubSite().add(castToCoding(value)); + this.getSubSite().add(castToCodeableConcept(value)); else if (name.equals("noteNumber")) this.getNoteNumber().add(castToPositiveInt(value)); else if (name.equals("adjudication")) @@ -3497,23 +4060,24 @@ public class ExplanationOfBenefit extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case -7323378: return addCareTeam(); // CareTeamComponent + case -186757789: throw new FHIRException("Cannot make property careTeamLinkId as it is not a complex type"); // PositiveIntType case -1659207418: throw new FHIRException("Cannot make property diagnosisLinkId as it is not a complex type"); // PositiveIntType - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding - case 1010065041: return addProgramCode(); // Coding + case -532846744: throw new FHIRException("Cannot make property procedureLinkId as it is not a complex type"); // PositiveIntType + case 1965585153: throw new FHIRException("Cannot make property informationLinkId as it is not a complex type"); // PositiveIntType + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept + case 1010065041: return addProgramCode(); // CodeableConcept case -1927922223: return getServiced(); // Type case 552316075: return getLocation(); // Type case -1285004149: return getQuantity(); // SimpleQuantity case -486196699: return getUnitPrice(); // Money case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType case 108957: return getNet(); // Money case 115642: return addUdi(); // Reference - case 1702620169: return getBodySite(); // Coding - case -1868566105: return addSubSite(); // Coding + case 1702620169: return getBodySite(); // CodeableConcept + case -1868566105: return addSubSite(); // CodeableConcept case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType case -231349275: return addAdjudication(); // AdjudicationComponent case -1335224239: return addDetail(); // DetailComponent @@ -3528,22 +4092,28 @@ public class ExplanationOfBenefit extends DomainResource { if (name.equals("sequence")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); } - else if (name.equals("careTeam")) { - return addCareTeam(); + else if (name.equals("careTeamLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.careTeamLinkId"); } else if (name.equals("diagnosisLinkId")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.diagnosisLinkId"); } + else if (name.equals("procedureLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.procedureLinkId"); + } + else if (name.equals("informationLinkId")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.informationLinkId"); + } else if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -3560,8 +4130,8 @@ public class ExplanationOfBenefit extends DomainResource { this.serviced = new Period(); return this.serviced; } - else if (name.equals("locationCoding")) { - this.location = new Coding(); + else if (name.equals("locationCodeableConcept")) { + this.location = new CodeableConcept(); return this.location; } else if (name.equals("locationAddress")) { @@ -3583,9 +4153,6 @@ public class ExplanationOfBenefit extends DomainResource { else if (name.equals("factor")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); - } else if (name.equals("net")) { this.net = new Money(); return this.net; @@ -3594,7 +4161,7 @@ public class ExplanationOfBenefit extends DomainResource { return addUdi(); } else if (name.equals("bodySite")) { - this.bodySite = new Coding(); + this.bodySite = new CodeableConcept(); return this.bodySite; } else if (name.equals("subSite")) { @@ -3621,27 +4188,37 @@ public class ExplanationOfBenefit extends DomainResource { ItemComponent dst = new ItemComponent(); copyValues(dst); dst.sequence = sequence == null ? null : sequence.copy(); - if (careTeam != null) { - dst.careTeam = new ArrayList(); - for (CareTeamComponent i : careTeam) - dst.careTeam.add(i.copy()); + if (careTeamLinkId != null) { + dst.careTeamLinkId = new ArrayList(); + for (PositiveIntType i : careTeamLinkId) + dst.careTeamLinkId.add(i.copy()); }; if (diagnosisLinkId != null) { dst.diagnosisLinkId = new ArrayList(); for (PositiveIntType i : diagnosisLinkId) dst.diagnosisLinkId.add(i.copy()); }; + if (procedureLinkId != null) { + dst.procedureLinkId = new ArrayList(); + for (PositiveIntType i : procedureLinkId) + dst.procedureLinkId.add(i.copy()); + }; + if (informationLinkId != null) { + dst.informationLinkId = new ArrayList(); + for (PositiveIntType i : informationLinkId) + dst.informationLinkId.add(i.copy()); + }; dst.revenue = revenue == null ? null : revenue.copy(); dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) + dst.programCode = new ArrayList(); + for (CodeableConcept i : programCode) dst.programCode.add(i.copy()); }; dst.serviced = serviced == null ? null : serviced.copy(); @@ -3649,7 +4226,6 @@ public class ExplanationOfBenefit extends DomainResource { 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(); if (udi != null) { dst.udi = new ArrayList(); @@ -3658,8 +4234,8 @@ public class ExplanationOfBenefit extends DomainResource { }; dst.bodySite = bodySite == null ? null : bodySite.copy(); if (subSite != null) { - dst.subSite = new ArrayList(); - for (Coding i : subSite) + dst.subSite = new ArrayList(); + for (CodeableConcept i : subSite) dst.subSite.add(i.copy()); }; if (noteNumber != null) { @@ -3688,13 +4264,14 @@ public class ExplanationOfBenefit extends DomainResource { if (!(other instanceof ItemComponent)) return false; ItemComponent o = (ItemComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(careTeam, o.careTeam, true) && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) - && compareDeep(revenue, o.revenue, true) && compareDeep(category, o.category, true) && compareDeep(service, o.service, true) - && compareDeep(modifier, o.modifier, true) && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) - && compareDeep(location, o.location, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) - && compareDeep(noteNumber, o.noteNumber, true) && compareDeep(adjudication, o.adjudication, true) + return compareDeep(sequence, o.sequence, true) && compareDeep(careTeamLinkId, o.careTeamLinkId, true) + && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(procedureLinkId, o.procedureLinkId, true) + && compareDeep(informationLinkId, o.informationLinkId, true) && compareDeep(revenue, o.revenue, true) + && compareDeep(category, o.category, true) && compareDeep(service, o.service, true) && compareDeep(modifier, o.modifier, true) + && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) && compareDeep(location, o.location, true) + && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) + && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) && compareDeep(bodySite, o.bodySite, true) + && compareDeep(subSite, o.subSite, true) && compareDeep(noteNumber, o.noteNumber, true) && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true) && compareDeep(prosthesis, o.prosthesis, true); } @@ -3705,16 +4282,17 @@ public class ExplanationOfBenefit extends DomainResource { if (!(other instanceof ItemComponent)) return false; ItemComponent o = (ItemComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) - && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) && compareValues(noteNumber, o.noteNumber, true) - ; + return compareValues(sequence, o.sequence, true) && compareValues(careTeamLinkId, o.careTeamLinkId, true) + && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) && compareValues(procedureLinkId, o.procedureLinkId, true) + && compareValues(informationLinkId, o.informationLinkId, true) && compareValues(factor, o.factor, true) + && compareValues(noteNumber, o.noteNumber, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, careTeam, diagnosisLinkId - , revenue, category, service, modifier, programCode, serviced, location, quantity - , unitPrice, factor, points, net, udi, bodySite, subSite, noteNumber, adjudication - , detail, prosthesis); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, careTeamLinkId, diagnosisLinkId + , procedureLinkId, informationLinkId, revenue, category, service, modifier, programCode + , serviced, location, quantity, unitPrice, factor, net, udi, bodySite, subSite + , noteNumber, adjudication, detail, prosthesis); } public String fhirType() { @@ -3722,322 +4300,6 @@ public class ExplanationOfBenefit extends DomainResource { } - } - - @Block() - public static class CareTeamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The members of the team who provided the overall service. - */ - @Child(name = "provider", type = {Practitioner.class, Organization.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Member of the Care Team", formalDefinition="The members of the team who provided the overall service." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The members of the team who provided the overall service.) - */ - protected Resource providerTarget; - - /** - * The practitioner who is billing and responsible for the claimed services rendered to the patient. - */ - @Child(name = "responsible", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Billing practitioner", formalDefinition="The practitioner who is billing and responsible for the claimed services rendered to the patient." ) - protected BooleanType responsible; - - /** - * The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team. - */ - @Child(name = "role", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Role on the team", formalDefinition="The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-careteamrole") - protected Coding role; - - /** - * The qualification which is applicable for this service. - */ - @Child(name = "qualification", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provider-qualification") - protected Coding qualification; - - private static final long serialVersionUID = 2022321671L; - - /** - * Constructor - */ - public CareTeamComponent() { - super(); - } - - /** - * Constructor - */ - public CareTeamComponent(Reference provider) { - super(); - this.provider = provider; - } - - /** - * @return {@link #provider} (The members of the team who provided the overall service.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The members of the team who provided the overall service.) - */ - public CareTeamComponent 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 members of the team who provided the overall service.) - */ - public Resource getProviderTarget() { - 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 members of the team who provided the overall service.) - */ - public CareTeamComponent setProviderTarget(Resource value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #responsible} (The practitioner who is billing and responsible for the claimed services rendered to the patient.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public BooleanType getResponsibleElement() { - if (this.responsible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamComponent.responsible"); - else if (Configuration.doAutoCreate()) - this.responsible = new BooleanType(); // bb - return this.responsible; - } - - public boolean hasResponsibleElement() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - public boolean hasResponsible() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - /** - * @param value {@link #responsible} (The practitioner who is billing and responsible for the claimed services rendered to the patient.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public CareTeamComponent setResponsibleElement(BooleanType value) { - this.responsible = value; - return this; - } - - /** - * @return The practitioner who is billing and responsible for the claimed services rendered to the patient. - */ - public boolean getResponsible() { - return this.responsible == null || this.responsible.isEmpty() ? false : this.responsible.getValue(); - } - - /** - * @param value The practitioner who is billing and responsible for the claimed services rendered to the patient. - */ - public CareTeamComponent setResponsible(boolean value) { - if (this.responsible == null) - this.responsible = new BooleanType(); - this.responsible.setValue(value); - return this; - } - - /** - * @return {@link #role} (The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.) - */ - public Coding getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Coding(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.) - */ - public CareTeamComponent setRole(Coding value) { - this.role = value; - return this; - } - - /** - * @return {@link #qualification} (The qualification which is applicable for this service.) - */ - public Coding getQualification() { - if (this.qualification == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamComponent.qualification"); - else if (Configuration.doAutoCreate()) - this.qualification = new Coding(); // cc - return this.qualification; - } - - public boolean hasQualification() { - return this.qualification != null && !this.qualification.isEmpty(); - } - - /** - * @param value {@link #qualification} (The qualification which is applicable for this service.) - */ - public CareTeamComponent setQualification(Coding value) { - this.qualification = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("provider", "Reference(Practitioner|Organization)", "The members of the team who provided the overall service.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("responsible", "boolean", "The practitioner who is billing and responsible for the claimed services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, responsible)); - childrenList.add(new Property("role", "Coding", "The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("qualification", "Coding", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, qualification)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference - case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // BooleanType - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding - case -631333393: /*qualification*/ return this.qualification == null ? new Base[0] : new Base[] {this.qualification}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -987494927: // provider - this.provider = castToReference(value); // Reference - break; - case 1847674614: // responsible - this.responsible = castToBoolean(value); // BooleanType - break; - case 3506294: // role - this.role = castToCoding(value); // Coding - break; - case -631333393: // qualification - this.qualification = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("provider")) - this.provider = castToReference(value); // Reference - else if (name.equals("responsible")) - this.responsible = castToBoolean(value); // BooleanType - else if (name.equals("role")) - this.role = castToCoding(value); // Coding - else if (name.equals("qualification")) - this.qualification = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -987494927: return getProvider(); // Reference - case 1847674614: throw new FHIRException("Cannot make property responsible as it is not a complex type"); // BooleanType - case 3506294: return getRole(); // Coding - case -631333393: return getQualification(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("provider")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("responsible")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.responsible"); - } - else if (name.equals("role")) { - this.role = new Coding(); - return this.role; - } - else if (name.equals("qualification")) { - this.qualification = new Coding(); - return this.qualification; - } - else - return super.addChild(name); - } - - public CareTeamComponent copy() { - CareTeamComponent dst = new CareTeamComponent(); - copyValues(dst); - dst.provider = provider == null ? null : provider.copy(); - dst.responsible = responsible == null ? null : responsible.copy(); - dst.role = role == null ? null : role.copy(); - dst.qualification = qualification == null ? null : qualification.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CareTeamComponent)) - return false; - CareTeamComponent o = (CareTeamComponent) other; - return compareDeep(provider, o.provider, true) && compareDeep(responsible, o.responsible, true) - && compareDeep(role, o.role, true) && compareDeep(qualification, o.qualification, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CareTeamComponent)) - return false; - CareTeamComponent o = (CareTeamComponent) other; - return compareValues(responsible, o.responsible, true); - } - - public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(provider, responsible, role - , qualification); - } - - public String fhirType() { - return "ExplanationOfBenefit.item.careTeam"; - - } - } @Block() @@ -4045,18 +4307,18 @@ public class ExplanationOfBenefit extends DomainResource { /** * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication") - protected Coding category; + protected CodeableConcept category; /** * Adjudication reason such as limit reached. */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-reason") - protected Coding reason; + protected CodeableConcept reason; /** * Monitory amount associated with the code. @@ -4072,7 +4334,7 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) protected DecimalType value; - private static final long serialVersionUID = -1926987562L; + private static final long serialVersionUID = 1559898786L; /** * Constructor @@ -4084,7 +4346,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * Constructor */ - public AdjudicationComponent(Coding category) { + public AdjudicationComponent(CodeableConcept category) { super(); this.category = category; } @@ -4092,12 +4354,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AdjudicationComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -4108,7 +4370,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) */ - public AdjudicationComponent setCategory(Coding value) { + public AdjudicationComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -4116,12 +4378,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #reason} (Adjudication reason such as limit reached.) */ - public Coding getReason() { + public CodeableConcept getReason() { if (this.reason == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AdjudicationComponent.reason"); else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc + this.reason = new CodeableConcept(); // cc return this.reason; } @@ -4132,7 +4394,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #reason} (Adjudication reason such as limit reached.) */ - public AdjudicationComponent setReason(Coding value) { + public AdjudicationComponent setReason(CodeableConcept value) { this.reason = value; return this; } @@ -4230,8 +4492,8 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("category", "CodeableConcept", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("reason", "CodeableConcept", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); } @@ -4239,8 +4501,8 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType default: return super.getProperty(hash, name, checkValid); @@ -4252,10 +4514,10 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case -934964668: // reason - this.reason = castToCoding(value); // Coding + this.reason = castToCodeableConcept(value); // CodeableConcept break; case -1413853096: // amount this.amount = castToMoney(value); // Money @@ -4271,9 +4533,9 @@ public class ExplanationOfBenefit extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding + this.reason = castToCodeableConcept(value); // CodeableConcept else if (name.equals("amount")) this.amount = castToMoney(value); // Money else if (name.equals("value")) @@ -4285,8 +4547,8 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding + case 50511102: return getCategory(); // CodeableConcept + case -934964668: return getReason(); // CodeableConcept case -1413853096: return getAmount(); // Money case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType default: return super.makeProperty(hash, name); @@ -4297,11 +4559,11 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("reason")) { - this.reason = new Coding(); + this.reason = new CodeableConcept(); return this.reason; } else if (name.equals("amount")) { @@ -4370,50 +4632,50 @@ public class ExplanationOfBenefit extends DomainResource { /** * The type of product or service. */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-ActInvoiceGroupCode") - protected Coding type; + protected CodeableConcept type; /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. */ - @Child(name = "service", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Billing Code", formalDefinition="If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. */ - @Child(name = "programCode", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "programCode", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-program-code") - protected List programCode; + protected List programCode; /** * The number of repetitions of a service or product. @@ -4436,24 +4698,17 @@ public class ExplanationOfBenefit extends DomainResource { @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, modifier=false, summary=false) - @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 addittional 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, modifier=false, summary=false) + @Child(name = "net", type = {Money.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "udi", type = {Device.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) protected List udi; /** @@ -4465,25 +4720,25 @@ public class ExplanationOfBenefit extends DomainResource { /** * A list of note references to the notes provided below. */ - @Child(name = "noteNumber", type = {PositiveIntType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "noteNumber", type = {PositiveIntType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) protected List noteNumber; /** * The adjudications results. */ - @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) protected List adjudication; /** * Third tier of goods and services. */ - @Child(name = "subDetail", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "subDetail", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) protected List subDetail; - private static final long serialVersionUID = 1205021905L; + private static final long serialVersionUID = -276371489L; /** * Constructor @@ -4495,7 +4750,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * Constructor */ - public DetailComponent(PositiveIntType sequence, Coding type) { + public DetailComponent(PositiveIntType sequence, CodeableConcept type) { super(); this.sequence = sequence; this.type = type; @@ -4549,12 +4804,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #type} (The type of product or service.) */ - public Coding getType() { + public CodeableConcept 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(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -4565,7 +4820,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #type} (The type of product or service.) */ - public DetailComponent setType(Coding value) { + public DetailComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -4573,12 +4828,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create DetailComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -4589,7 +4844,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public DetailComponent setRevenue(Coding value) { + public DetailComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -4597,12 +4852,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create DetailComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -4613,7 +4868,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public DetailComponent setCategory(Coding value) { + public DetailComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -4621,12 +4876,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public Coding getService() { + public CodeableConcept 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(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -4637,7 +4892,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public DetailComponent setService(Coding value) { + public DetailComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -4645,16 +4900,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public DetailComponent setModifier(List theModifier) { + public DetailComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -4662,25 +4917,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public DetailComponent addModifier(Coding t) { //3 + public DetailComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -4688,7 +4943,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -4698,16 +4953,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) */ - public List getProgramCode() { + public List getProgramCode() { if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); return this.programCode; } /** * @return Returns a reference to this for easy method chaining */ - public DetailComponent setProgramCode(List theProgramCode) { + public DetailComponent setProgramCode(List theProgramCode) { this.programCode = theProgramCode; return this; } @@ -4715,25 +4970,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasProgramCode() { if (this.programCode == null) return false; - for (Coding item : this.programCode) + for (CodeableConcept item : this.programCode) if (!item.isEmpty()) return true; return false; } - public Coding addProgramCode() { //3 - Coding t = new Coding(); + public CodeableConcept addProgramCode() { //3 + CodeableConcept t = new CodeableConcept(); if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return t; } - public DetailComponent addProgramCode(Coding t) { //3 + public DetailComponent addProgramCode(CodeableConcept t) { //3 if (t == null) return this; if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return this; } @@ -4741,7 +4996,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #programCode}, creating it if it does not already exist */ - public Coding getProgramCodeFirstRep() { + public CodeableConcept getProgramCodeFirstRep() { if (getProgramCode().isEmpty()) { addProgramCode(); } @@ -4863,73 +5118,6 @@ public class ExplanationOfBenefit extends DomainResource { 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(); // bb - 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; - } - - /** - * @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(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @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(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - /** * @return {@link #net} (The quantity times the unit price for an addittional 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.) */ @@ -5199,16 +5387,15 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "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("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("type", "CodeableConcept", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("programCode", "CodeableConcept", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); @@ -5220,16 +5407,15 @@ public class ExplanationOfBenefit extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // CodeableConcept case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType @@ -5247,22 +5433,22 @@ public class ExplanationOfBenefit extends DomainResource { this.sequence = castToPositiveInt(value); // PositiveIntType break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding + this.getProgramCode().add(castToCodeableConcept(value)); // CodeableConcept break; case -1285004149: // quantity this.quantity = castToSimpleQuantity(value); // SimpleQuantity @@ -5273,9 +5459,6 @@ public class ExplanationOfBenefit extends DomainResource { case -1282148017: // factor this.factor = castToDecimal(value); // DecimalType break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; case 108957: // net this.net = castToMoney(value); // Money break; @@ -5301,25 +5484,23 @@ public class ExplanationOfBenefit extends DomainResource { if (name.equals("sequence")) this.sequence = castToPositiveInt(value); // PositiveIntType else if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); + this.getProgramCode().add(castToCodeableConcept(value)); else if (name.equals("quantity")) this.quantity = castToSimpleQuantity(value); // SimpleQuantity else if (name.equals("unitPrice")) this.unitPrice = castToMoney(value); // Money else if (name.equals("factor")) this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType else if (name.equals("net")) this.net = castToMoney(value); // Money else if (name.equals("udi")) @@ -5338,16 +5519,15 @@ public class ExplanationOfBenefit extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding - case 1010065041: return addProgramCode(); // Coding + case 3575610: return getType(); // CodeableConcept + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept + case 1010065041: return addProgramCode(); // CodeableConcept case -1285004149: return getQuantity(); // SimpleQuantity case -486196699: return getUnitPrice(); // Money case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType case 108957: return getNet(); // Money case 115642: return addUdi(); // Reference case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType @@ -5364,19 +5544,19 @@ public class ExplanationOfBenefit extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -5396,9 +5576,6 @@ public class ExplanationOfBenefit extends DomainResource { else if (name.equals("factor")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); - } else if (name.equals("net")) { this.net = new Money(); return this.net; @@ -5428,19 +5605,18 @@ public class ExplanationOfBenefit extends DomainResource { dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) + dst.programCode = new ArrayList(); + for (CodeableConcept i : programCode) dst.programCode.add(i.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(); if (udi != null) { dst.udi = new ArrayList(); @@ -5475,8 +5651,8 @@ public class ExplanationOfBenefit extends DomainResource { return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(revenue, o.revenue, true) && compareDeep(category, o.category, true) && compareDeep(service, o.service, true) && compareDeep(modifier, o.modifier, true) && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true) && compareDeep(noteNumber, o.noteNumber, true) && compareDeep(adjudication, o.adjudication, true) + && compareDeep(factor, o.factor, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) + && compareDeep(noteNumber, o.noteNumber, true) && compareDeep(adjudication, o.adjudication, true) && compareDeep(subDetail, o.subDetail, true); } @@ -5487,14 +5663,14 @@ public class ExplanationOfBenefit extends DomainResource { if (!(other instanceof DetailComponent)) return false; DetailComponent o = (DetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - && compareValues(noteNumber, o.noteNumber, true); + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(noteNumber, o.noteNumber, true) + ; } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, type, revenue - , category, service, modifier, programCode, quantity, unitPrice, factor, points - , net, udi, noteNumber, adjudication, subDetail); + , category, service, modifier, programCode, quantity, unitPrice, factor, net + , udi, noteNumber, adjudication, subDetail); } public String fhirType() { @@ -5516,50 +5692,50 @@ public class ExplanationOfBenefit extends DomainResource { /** * The type of product or service. */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-ActInvoiceGroupCode") - protected Coding type; + protected CodeableConcept type; /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). */ - @Child(name = "service", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Billing Code", formalDefinition="A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. */ - @Child(name = "programCode", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "programCode", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-program-code") - protected List programCode; + protected List programCode; /** * The number of repetitions of a service or product. @@ -5582,24 +5758,17 @@ public class ExplanationOfBenefit extends DomainResource { @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, modifier=false, summary=false) - @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 addittional 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, modifier=false, summary=false) + @Child(name = "net", type = {Money.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional 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 = {Device.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "udi", type = {Device.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) protected List udi; /** @@ -5611,18 +5780,18 @@ public class ExplanationOfBenefit extends DomainResource { /** * A list of note references to the notes provided below. */ - @Child(name = "noteNumber", type = {PositiveIntType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "noteNumber", type = {PositiveIntType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) protected List noteNumber; /** * The adjudications results. */ - @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="SubDetail adjudication", formalDefinition="The adjudications results." ) protected List adjudication; - private static final long serialVersionUID = -547722928L; + private static final long serialVersionUID = 1621872130L; /** * Constructor @@ -5634,7 +5803,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * Constructor */ - public SubDetailComponent(PositiveIntType sequence, Coding type) { + public SubDetailComponent(PositiveIntType sequence, CodeableConcept type) { super(); this.sequence = sequence; this.type = type; @@ -5688,12 +5857,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #type} (The type of product or service.) */ - public Coding getType() { + public CodeableConcept 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(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -5704,7 +5873,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #type} (The type of product or service.) */ - public SubDetailComponent setType(Coding value) { + public SubDetailComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -5712,12 +5881,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create SubDetailComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -5728,7 +5897,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public SubDetailComponent setRevenue(Coding value) { + public SubDetailComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -5736,12 +5905,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create SubDetailComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -5752,7 +5921,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public SubDetailComponent setCategory(Coding value) { + public SubDetailComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -5760,12 +5929,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #service} (A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).) */ - public Coding getService() { + public CodeableConcept 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(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -5776,7 +5945,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #service} (A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).) */ - public SubDetailComponent setService(Coding value) { + public SubDetailComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -5784,16 +5953,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public SubDetailComponent setModifier(List theModifier) { + public SubDetailComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -5801,25 +5970,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public SubDetailComponent addModifier(Coding t) { //3 + public SubDetailComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -5827,7 +5996,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -5837,16 +6006,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) */ - public List getProgramCode() { + public List getProgramCode() { if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); return this.programCode; } /** * @return Returns a reference to this for easy method chaining */ - public SubDetailComponent setProgramCode(List theProgramCode) { + public SubDetailComponent setProgramCode(List theProgramCode) { this.programCode = theProgramCode; return this; } @@ -5854,25 +6023,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasProgramCode() { if (this.programCode == null) return false; - for (Coding item : this.programCode) + for (CodeableConcept item : this.programCode) if (!item.isEmpty()) return true; return false; } - public Coding addProgramCode() { //3 - Coding t = new Coding(); + public CodeableConcept addProgramCode() { //3 + CodeableConcept t = new CodeableConcept(); if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return t; } - public SubDetailComponent addProgramCode(Coding t) { //3 + public SubDetailComponent addProgramCode(CodeableConcept t) { //3 if (t == null) return this; if (this.programCode == null) - this.programCode = new ArrayList(); + this.programCode = new ArrayList(); this.programCode.add(t); return this; } @@ -5880,7 +6049,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #programCode}, creating it if it does not already exist */ - public Coding getProgramCodeFirstRep() { + public CodeableConcept getProgramCodeFirstRep() { if (getProgramCode().isEmpty()) { addProgramCode(); } @@ -6002,73 +6171,6 @@ public class ExplanationOfBenefit extends DomainResource { 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(); // bb - 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; - } - - /** - * @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(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @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(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - /** * @return {@link #net} (The quantity times the unit price for an addittional 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.) */ @@ -6285,16 +6387,15 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequence", "positiveInt", "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("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); + childrenList.add(new Property("type", "CodeableConcept", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("programCode", "CodeableConcept", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); childrenList.add(new Property("quantity", "SimpleQuantity", "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 addittional 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 addittional 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", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); @@ -6305,16 +6406,15 @@ public class ExplanationOfBenefit extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept + case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // CodeableConcept case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType @@ -6331,22 +6431,22 @@ public class ExplanationOfBenefit extends DomainResource { this.sequence = castToPositiveInt(value); // PositiveIntType break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding + this.getProgramCode().add(castToCodeableConcept(value)); // CodeableConcept break; case -1285004149: // quantity this.quantity = castToSimpleQuantity(value); // SimpleQuantity @@ -6357,9 +6457,6 @@ public class ExplanationOfBenefit extends DomainResource { case -1282148017: // factor this.factor = castToDecimal(value); // DecimalType break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; case 108957: // net this.net = castToMoney(value); // Money break; @@ -6382,25 +6479,23 @@ public class ExplanationOfBenefit extends DomainResource { if (name.equals("sequence")) this.sequence = castToPositiveInt(value); // PositiveIntType else if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); + this.getProgramCode().add(castToCodeableConcept(value)); else if (name.equals("quantity")) this.quantity = castToSimpleQuantity(value); // SimpleQuantity else if (name.equals("unitPrice")) this.unitPrice = castToMoney(value); // Money else if (name.equals("factor")) this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType else if (name.equals("net")) this.net = castToMoney(value); // Money else if (name.equals("udi")) @@ -6417,16 +6512,15 @@ public class ExplanationOfBenefit extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding - case 1010065041: return addProgramCode(); // Coding + case 3575610: return getType(); // CodeableConcept + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept + case 1010065041: return addProgramCode(); // CodeableConcept case -1285004149: return getQuantity(); // SimpleQuantity case -486196699: return getUnitPrice(); // Money case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType case 108957: return getNet(); // Money case 115642: return addUdi(); // Reference case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType @@ -6442,19 +6536,19 @@ public class ExplanationOfBenefit extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -6474,9 +6568,6 @@ public class ExplanationOfBenefit extends DomainResource { else if (name.equals("factor")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); - } else if (name.equals("net")) { this.net = new Money(); return this.net; @@ -6503,19 +6594,18 @@ public class ExplanationOfBenefit extends DomainResource { dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) + dst.programCode = new ArrayList(); + for (CodeableConcept i : programCode) dst.programCode.add(i.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(); if (udi != null) { dst.udi = new ArrayList(); @@ -6545,8 +6635,8 @@ public class ExplanationOfBenefit extends DomainResource { return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(revenue, o.revenue, true) && compareDeep(category, o.category, true) && compareDeep(service, o.service, true) && compareDeep(modifier, o.modifier, true) && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true) && compareDeep(noteNumber, o.noteNumber, true) && compareDeep(adjudication, o.adjudication, true) + && compareDeep(factor, o.factor, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) + && compareDeep(noteNumber, o.noteNumber, true) && compareDeep(adjudication, o.adjudication, true) ; } @@ -6557,14 +6647,14 @@ public class ExplanationOfBenefit extends DomainResource { if (!(other instanceof SubDetailComponent)) return false; SubDetailComponent o = (SubDetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - && compareValues(noteNumber, o.noteNumber, true); + return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(noteNumber, o.noteNumber, true) + ; } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, type, revenue - , category, service, modifier, programCode, quantity, unitPrice, factor, points - , net, udi, noteNumber, adjudication); + , category, service, modifier, programCode, quantity, unitPrice, factor, net + , udi, noteNumber, adjudication); } public String fhirType() { @@ -6593,12 +6683,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * Material of the prior denture or bridge prosthesis (Oral). */ - @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "priorMaterial", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis (Oral)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/oral-prosthodontic-material") - protected Coding priorMaterial; + protected CodeableConcept priorMaterial; - private static final long serialVersionUID = 1739349641L; + private static final long serialVersionUID = -539400614L; /** * Constructor @@ -6704,12 +6794,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis (Oral).) */ - public Coding getPriorMaterial() { + public CodeableConcept getPriorMaterial() { if (this.priorMaterial == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); else if (Configuration.doAutoCreate()) - this.priorMaterial = new Coding(); // cc + this.priorMaterial = new CodeableConcept(); // cc return this.priorMaterial; } @@ -6720,7 +6810,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis (Oral).) */ - public ProsthesisComponent setPriorMaterial(Coding value) { + public ProsthesisComponent setPriorMaterial(CodeableConcept value) { this.priorMaterial = value; return this; } @@ -6729,7 +6819,7 @@ public class ExplanationOfBenefit extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial)); childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); - childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); + childrenList.add(new Property("priorMaterial", "CodeableConcept", "Material of the prior denture or bridge prosthesis (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); } @Override @@ -6737,7 +6827,7 @@ public class ExplanationOfBenefit extends DomainResource { switch (hash) { case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // BooleanType case -1770675816: /*priorDate*/ return this.priorDate == null ? new Base[0] : new Base[] {this.priorDate}; // DateType - case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // Coding + case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -6753,7 +6843,7 @@ public class ExplanationOfBenefit extends DomainResource { this.priorDate = castToDate(value); // DateType break; case -532999663: // priorMaterial - this.priorMaterial = castToCoding(value); // Coding + this.priorMaterial = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -6767,7 +6857,7 @@ public class ExplanationOfBenefit extends DomainResource { else if (name.equals("priorDate")) this.priorDate = castToDate(value); // DateType else if (name.equals("priorMaterial")) - this.priorMaterial = castToCoding(value); // Coding + this.priorMaterial = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -6777,7 +6867,7 @@ public class ExplanationOfBenefit extends DomainResource { switch (hash) { case 1948342084: throw new FHIRException("Cannot make property initial as it is not a complex type"); // BooleanType case -1770675816: throw new FHIRException("Cannot make property priorDate as it is not a complex type"); // DateType - case -532999663: return getPriorMaterial(); // Coding + case -532999663: return getPriorMaterial(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -6792,7 +6882,7 @@ public class ExplanationOfBenefit extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.priorDate"); } else if (name.equals("priorMaterial")) { - this.priorMaterial = new Coding(); + this.priorMaterial = new CodeableConcept(); return this.priorMaterial; } else @@ -6853,34 +6943,34 @@ public class ExplanationOfBenefit extends DomainResource { /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. */ - @Child(name = "service", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Billing Code", formalDefinition="If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * The fee charged for the professional service or product. @@ -6910,7 +7000,7 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) protected List detail; - private static final long serialVersionUID = -1130048899L; + private static final long serialVersionUID = 1969703165L; /** * Constructor @@ -6983,12 +7073,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -6999,7 +7089,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public AddedItemComponent setRevenue(Coding value) { + public AddedItemComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -7007,12 +7097,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -7023,7 +7113,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public AddedItemComponent setCategory(Coding value) { + public AddedItemComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -7031,12 +7121,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public Coding getService() { + public CodeableConcept getService() { if (this.service == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemComponent.service"); else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -7047,7 +7137,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #service} (If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.) */ - public AddedItemComponent setService(Coding value) { + public AddedItemComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -7055,16 +7145,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public AddedItemComponent setModifier(List theModifier) { + public AddedItemComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -7072,25 +7162,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public AddedItemComponent addModifier(Coding t) { //3 + public AddedItemComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -7098,7 +7188,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -7299,10 +7389,10 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product.", 0, java.lang.Integer.MAX_VALUE, fee)); childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); childrenList.add(new Property("adjudication", "@ExplanationOfBenefit.item.adjudication", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); @@ -7313,10 +7403,10 @@ public class ExplanationOfBenefit extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : this.sequenceLinkId.toArray(new Base[this.sequenceLinkId.size()]); // PositiveIntType - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent @@ -7333,16 +7423,16 @@ public class ExplanationOfBenefit extends DomainResource { this.getSequenceLinkId().add(castToPositiveInt(value)); // PositiveIntType break; case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 101254: // fee this.fee = castToMoney(value); // Money @@ -7366,13 +7456,13 @@ public class ExplanationOfBenefit extends DomainResource { if (name.equals("sequenceLinkId")) this.getSequenceLinkId().add(castToPositiveInt(value)); else if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("fee")) this.fee = castToMoney(value); // Money else if (name.equals("noteNumber")) @@ -7389,10 +7479,10 @@ public class ExplanationOfBenefit extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept case 101254: return getFee(); // Money case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType case -231349275: return addAdjudication(); // AdjudicationComponent @@ -7408,15 +7498,15 @@ public class ExplanationOfBenefit extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequenceLinkId"); } else if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -7451,8 +7541,8 @@ public class ExplanationOfBenefit extends DomainResource { dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; dst.fee = fee == null ? null : fee.copy(); @@ -7515,34 +7605,34 @@ public class ExplanationOfBenefit extends DomainResource { /** * The type of reveneu or cost center providing the product and/or service. */ - @Child(name = "revenue", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Child(name = "revenue", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of reveneu or cost center providing the product and/or service." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center") - protected Coding revenue; + protected CodeableConcept revenue; /** * Health Care Service Type Codes to identify the classification of service or benefits. */ - @Child(name = "category", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type of service or product", formalDefinition="Health Care Service Type Codes to identify the classification of service or benefits." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding category; + protected CodeableConcept category; /** * A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). */ - @Child(name = "service", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "service", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Billing Code", formalDefinition="A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls") - protected Coding service; + protected CodeableConcept service; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. */ - @Child(name = "modifier", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "modifier", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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 for medical whether the treatment was outside the clinic or out of office hours." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers") - protected List modifier; + protected List modifier; /** * The fee charged for the professional service or product. @@ -7565,7 +7655,7 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) protected List adjudication; - private static final long serialVersionUID = -1633143220L; + private static final long serialVersionUID = -311484980L; /** * Constructor @@ -7577,12 +7667,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public Coding getRevenue() { + public CodeableConcept getRevenue() { if (this.revenue == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemsDetailComponent.revenue"); else if (Configuration.doAutoCreate()) - this.revenue = new Coding(); // cc + this.revenue = new CodeableConcept(); // cc return this.revenue; } @@ -7593,7 +7683,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #revenue} (The type of reveneu or cost center providing the product and/or service.) */ - public AddedItemsDetailComponent setRevenue(Coding value) { + public AddedItemsDetailComponent setRevenue(CodeableConcept value) { this.revenue = value; return this; } @@ -7601,12 +7691,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemsDetailComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -7617,7 +7707,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #category} (Health Care Service Type Codes to identify the classification of service or benefits.) */ - public AddedItemsDetailComponent setCategory(Coding value) { + public AddedItemsDetailComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -7625,12 +7715,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #service} (A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).) */ - public Coding getService() { + public CodeableConcept getService() { if (this.service == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create AddedItemsDetailComponent.service"); else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc + this.service = new CodeableConcept(); // cc return this.service; } @@ -7641,7 +7731,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #service} (A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).) */ - public AddedItemsDetailComponent setService(Coding value) { + public AddedItemsDetailComponent setService(CodeableConcept value) { this.service = value; return this; } @@ -7649,16 +7739,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.) */ - public List getModifier() { + public List getModifier() { if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); return this.modifier; } /** * @return Returns a reference to this for easy method chaining */ - public AddedItemsDetailComponent setModifier(List theModifier) { + public AddedItemsDetailComponent setModifier(List theModifier) { this.modifier = theModifier; return this; } @@ -7666,25 +7756,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasModifier() { if (this.modifier == null) return false; - for (Coding item : this.modifier) + for (CodeableConcept item : this.modifier) if (!item.isEmpty()) return true; return false; } - public Coding addModifier() { //3 - Coding t = new Coding(); + public CodeableConcept addModifier() { //3 + CodeableConcept t = new CodeableConcept(); if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return t; } - public AddedItemsDetailComponent addModifier(Coding t) { //3 + public AddedItemsDetailComponent addModifier(CodeableConcept t) { //3 if (t == null) return this; if (this.modifier == null) - this.modifier = new ArrayList(); + this.modifier = new ArrayList(); this.modifier.add(t); return this; } @@ -7692,7 +7782,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist */ - public Coding getModifierFirstRep() { + public CodeableConcept getModifierFirstRep() { if (getModifier().isEmpty()) { addModifier(); } @@ -7839,10 +7929,10 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("revenue", "Coding", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); - childrenList.add(new Property("category", "Coding", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("revenue", "CodeableConcept", "The type of reveneu or cost center providing the product and/or service.", 0, java.lang.Integer.MAX_VALUE, revenue)); + childrenList.add(new Property("category", "CodeableConcept", "Health Care Service Type Codes to identify the classification of service or benefits.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("service", "CodeableConcept", "A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.", 0, java.lang.Integer.MAX_VALUE, modifier)); childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product.", 0, java.lang.Integer.MAX_VALUE, fee)); childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); childrenList.add(new Property("adjudication", "@ExplanationOfBenefit.item.adjudication", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); @@ -7851,10 +7941,10 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding + case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // CodeableConcept + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent @@ -7867,16 +7957,16 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 1099842588: // revenue - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept break; case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1984153269: // service - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept break; case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding + this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept break; case 101254: // fee this.fee = castToMoney(value); // Money @@ -7895,13 +7985,13 @@ public class ExplanationOfBenefit extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("revenue")) - this.revenue = castToCoding(value); // Coding + this.revenue = castToCodeableConcept(value); // CodeableConcept else if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("service")) - this.service = castToCoding(value); // Coding + this.service = castToCodeableConcept(value); // CodeableConcept else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); + this.getModifier().add(castToCodeableConcept(value)); else if (name.equals("fee")) this.fee = castToMoney(value); // Money else if (name.equals("noteNumber")) @@ -7915,10 +8005,10 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 1099842588: return getRevenue(); // Coding - case 50511102: return getCategory(); // Coding - case 1984153269: return getService(); // Coding - case -615513385: return addModifier(); // Coding + case 1099842588: return getRevenue(); // CodeableConcept + case 50511102: return getCategory(); // CodeableConcept + case 1984153269: return getService(); // CodeableConcept + case -615513385: return addModifier(); // CodeableConcept case 101254: return getFee(); // Money case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType case -231349275: return addAdjudication(); // AdjudicationComponent @@ -7930,15 +8020,15 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("revenue")) { - this.revenue = new Coding(); + this.revenue = new CodeableConcept(); return this.revenue; } else if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("service")) { - this.service = new Coding(); + this.service = new CodeableConcept(); return this.service; } else if (name.equals("modifier")) { @@ -7965,8 +8055,8 @@ public class ExplanationOfBenefit extends DomainResource { dst.category = category == null ? null : category.copy(); dst.service = service == null ? null : service.copy(); if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) + dst.modifier = new ArrayList(); + for (CodeableConcept i : modifier) dst.modifier.add(i.copy()); }; dst.fee = fee == null ? null : fee.copy(); @@ -8015,262 +8105,6 @@ public class ExplanationOfBenefit extends DomainResource { } - } - - @Block() - public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The code identifying which tooth is missing. - */ - @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/teeth") - protected Coding tooth; - - /** - * Missing reason may be: E-extraction, O-other. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reason for missing", formalDefinition="Missing reason may be: E-extraction, O-other." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/missing-tooth-reason") - protected Coding reason; - - /** - * The date of the extraction either known from records or patient reported estimate. - */ - @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Date of Extraction", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) - protected DateType extractionDate; - - private static final long serialVersionUID = 352913313L; - - /** - * Constructor - */ - public MissingTeethComponent() { - super(); - } - - /** - * Constructor - */ - public MissingTeethComponent(Coding tooth) { - super(); - this.tooth = tooth; - } - - /** - * @return {@link #tooth} (The code identifying which tooth is missing.) - */ - public Coding getTooth() { - if (this.tooth == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); - else if (Configuration.doAutoCreate()) - this.tooth = new Coding(); // cc - return this.tooth; - } - - public boolean hasTooth() { - return this.tooth != null && !this.tooth.isEmpty(); - } - - /** - * @param value {@link #tooth} (The code identifying which tooth is missing.) - */ - public MissingTeethComponent setTooth(Coding value) { - this.tooth = value; - return this; - } - - /** - * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public MissingTeethComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public DateType getExtractionDateElement() { - if (this.extractionDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate"); - else if (Configuration.doAutoCreate()) - this.extractionDate = new DateType(); // bb - return this.extractionDate; - } - - public boolean hasExtractionDateElement() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - public boolean hasExtractionDate() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - /** - * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public MissingTeethComponent setExtractionDateElement(DateType value) { - this.extractionDate = value; - return this; - } - - /** - * @return The date of the extraction either known from records or patient reported estimate. - */ - 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(Date value) { - if (value == null) - this.extractionDate = null; - else { - if (this.extractionDate == null) - this.extractionDate = new DateType(); - this.extractionDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); - childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 110545608: /*tooth*/ return this.tooth == null ? new Base[0] : new Base[] {this.tooth}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case 580646965: /*extractionDate*/ return this.extractionDate == null ? new Base[0] : new Base[] {this.extractionDate}; // DateType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 110545608: // tooth - this.tooth = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case 580646965: // extractionDate - this.extractionDate = castToDate(value); // DateType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("tooth")) - this.tooth = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("extractionDate")) - this.extractionDate = castToDate(value); // DateType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 110545608: return getTooth(); // Coding - case -934964668: return getReason(); // Coding - case 580646965: throw new FHIRException("Cannot make property extractionDate as it is not a complex type"); // DateType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("tooth")) { - this.tooth = new Coding(); - return this.tooth; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("extractionDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.extractionDate"); - } - else - return super.addChild(name); - } - - public MissingTeethComponent copy() { - MissingTeethComponent dst = new MissingTeethComponent(); - copyValues(dst); - dst.tooth = tooth == null ? null : tooth.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.extractionDate = extractionDate == null ? null : extractionDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareValues(extractionDate, o.extractionDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(tooth, reason, extractionDate - ); - } - - public String fhirType() { - return "ExplanationOfBenefit.missingTeeth"; - - } - } @Block() @@ -8278,10 +8112,10 @@ public class ExplanationOfBenefit extends DomainResource { /** * Whether this represents partial or complete payment of the claim. */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Partial or Complete", formalDefinition="Whether this represents partial or complete payment of the claim." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-paymenttype") - protected Coding type; + protected CodeableConcept type; /** * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. @@ -8293,10 +8127,10 @@ public class ExplanationOfBenefit extends DomainResource { /** * Reason for the payment adjustment. */ - @Child(name = "adjustmentReason", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "adjustmentReason", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-adjustment-reason") - protected Coding adjustmentReason; + protected CodeableConcept adjustmentReason; /** * Estimated payment date. @@ -8319,7 +8153,7 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifer." ) protected Identifier identifier; - private static final long serialVersionUID = -803665422L; + private static final long serialVersionUID = 1539906026L; /** * Constructor @@ -8331,12 +8165,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #type} (Whether this represents partial or complete payment of the claim.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PaymentComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -8347,7 +8181,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #type} (Whether this represents partial or complete payment of the claim.) */ - public PaymentComponent setType(Coding value) { + public PaymentComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -8379,12 +8213,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #adjustmentReason} (Reason for the payment adjustment.) */ - public Coding getAdjustmentReason() { + public CodeableConcept getAdjustmentReason() { if (this.adjustmentReason == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PaymentComponent.adjustmentReason"); else if (Configuration.doAutoCreate()) - this.adjustmentReason = new Coding(); // cc + this.adjustmentReason = new CodeableConcept(); // cc return this.adjustmentReason; } @@ -8395,7 +8229,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #adjustmentReason} (Reason for the payment adjustment.) */ - public PaymentComponent setAdjustmentReason(Coding value) { + public PaymentComponent setAdjustmentReason(CodeableConcept value) { this.adjustmentReason = value; return this; } @@ -8499,9 +8333,9 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Whether this represents partial or complete payment of the claim.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "Whether this represents partial or complete payment of the claim.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("adjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, adjustment)); - childrenList.add(new Property("adjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, adjustmentReason)); + childrenList.add(new Property("adjustmentReason", "CodeableConcept", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, adjustmentReason)); childrenList.add(new Property("date", "date", "Estimated payment date.", 0, java.lang.Integer.MAX_VALUE, date)); childrenList.add(new Property("amount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, amount)); childrenList.add(new Property("identifier", "Identifier", "Payment identifer.", 0, java.lang.Integer.MAX_VALUE, identifier)); @@ -8510,9 +8344,9 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 1977085293: /*adjustment*/ return this.adjustment == null ? new Base[0] : new Base[] {this.adjustment}; // Money - case -1255938543: /*adjustmentReason*/ return this.adjustmentReason == null ? new Base[0] : new Base[] {this.adjustmentReason}; // Coding + case -1255938543: /*adjustmentReason*/ return this.adjustmentReason == null ? new Base[0] : new Base[] {this.adjustmentReason}; // CodeableConcept case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier @@ -8525,13 +8359,13 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 1977085293: // adjustment this.adjustment = castToMoney(value); // Money break; case -1255938543: // adjustmentReason - this.adjustmentReason = castToCoding(value); // Coding + this.adjustmentReason = castToCodeableConcept(value); // CodeableConcept break; case 3076014: // date this.date = castToDate(value); // DateType @@ -8550,11 +8384,11 @@ public class ExplanationOfBenefit extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("adjustment")) this.adjustment = castToMoney(value); // Money else if (name.equals("adjustmentReason")) - this.adjustmentReason = castToCoding(value); // Coding + this.adjustmentReason = castToCodeableConcept(value); // CodeableConcept else if (name.equals("date")) this.date = castToDate(value); // DateType else if (name.equals("amount")) @@ -8568,9 +8402,9 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 1977085293: return getAdjustment(); // Money - case -1255938543: return getAdjustmentReason(); // Coding + case -1255938543: return getAdjustmentReason(); // CodeableConcept case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateType case -1413853096: return getAmount(); // Money case -1618432855: return getIdentifier(); // Identifier @@ -8582,7 +8416,7 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("adjustment")) { @@ -8590,7 +8424,7 @@ public class ExplanationOfBenefit extends DomainResource { return this.adjustment; } else if (name.equals("adjustmentReason")) { - this.adjustmentReason = new Coding(); + this.adjustmentReason = new CodeableConcept(); return this.adjustmentReason; } else if (name.equals("date")) { @@ -8666,10 +8500,10 @@ public class ExplanationOfBenefit extends DomainResource { /** * The note purpose: Print/Display. */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type") - protected Coding type; + protected CodeableConcept type; /** * The note text. @@ -8681,12 +8515,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. */ - @Child(name = "language", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "language", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Language", formalDefinition="The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages") - protected Coding language; + protected CodeableConcept language; - private static final long serialVersionUID = -1578585461L; + private static final long serialVersionUID = -944255449L; /** * Constructor @@ -8743,12 +8577,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #type} (The note purpose: Print/Display.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create NoteComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -8759,7 +8593,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #type} (The note purpose: Print/Display.) */ - public NoteComponent setType(Coding value) { + public NoteComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -8816,12 +8650,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) */ - public Coding getLanguage() { + public CodeableConcept getLanguage() { if (this.language == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create NoteComponent.language"); else if (Configuration.doAutoCreate()) - this.language = new Coding(); // cc + this.language = new CodeableConcept(); // cc return this.language; } @@ -8832,7 +8666,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) */ - public NoteComponent setLanguage(Coding value) { + public NoteComponent setLanguage(CodeableConcept value) { this.language = value; return this; } @@ -8840,18 +8674,18 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("language", "Coding", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("language", "CodeableConcept", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.", 0, java.lang.Integer.MAX_VALUE, language)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // Coding + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -8864,13 +8698,13 @@ public class ExplanationOfBenefit extends DomainResource { this.number = castToPositiveInt(value); // PositiveIntType break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 3556653: // text this.text = castToString(value); // StringType break; case -1613589672: // language - this.language = castToCoding(value); // Coding + this.language = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -8882,11 +8716,11 @@ public class ExplanationOfBenefit extends DomainResource { if (name.equals("number")) this.number = castToPositiveInt(value); // PositiveIntType else if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("text")) this.text = castToString(value); // StringType else if (name.equals("language")) - this.language = castToCoding(value); // Coding + this.language = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -8895,9 +8729,9 @@ public class ExplanationOfBenefit extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case -1613589672: return getLanguage(); // Coding + case -1613589672: return getLanguage(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -8909,14 +8743,14 @@ public class ExplanationOfBenefit extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.number"); } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("text")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.text"); } else if (name.equals("language")) { - this.language = new Coding(); + this.language = new CodeableConcept(); return this.language; } else @@ -8971,65 +8805,72 @@ public class ExplanationOfBenefit extends DomainResource { /** * Dental, Vision, Medical, Pharmacy, Rehab etc. */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-category") - protected Coding category; + protected CodeableConcept category; /** * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. */ - @Child(name = "subCategory", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "subCategory", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory") - protected Coding subCategory; + protected CodeableConcept subCategory; + + /** + * True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage. + */ + @Child(name = "excluded", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Excluded from the plan", formalDefinition="True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage." ) + protected BooleanType excluded; /** * A short name or tag for the benefit, for example MED01, or DENT2. */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "name", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Short name for the benefit", formalDefinition="A short name or tag for the benefit, for example MED01, or DENT2." ) protected StringType name; /** * A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'. */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Description of the benefit", formalDefinition="A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'." ) protected StringType description; /** * Network designation. */ - @Child(name = "network", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "network", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="In or out of network", formalDefinition="Network designation." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-network") - protected Coding network; + protected CodeableConcept network; /** * Unit designation: individual or family. */ - @Child(name = "unit", type = {Coding.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Child(name = "unit", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Individual or family", formalDefinition="Unit designation: individual or family." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-unit") - protected Coding unit; + protected CodeableConcept unit; /** * The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'. */ - @Child(name = "term", type = {Coding.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "term", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Annual or lifetime", formalDefinition="The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-term") - protected Coding term; + protected CodeableConcept term; /** * Benefits Used to date. */ - @Child(name = "financial", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "financial", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Benefit Summary", formalDefinition="Benefits Used to date." ) protected List financial; - private static final long serialVersionUID = -1090359286L; + private static final long serialVersionUID = 833826021L; /** * Constructor @@ -9041,7 +8882,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * Constructor */ - public BenefitBalanceComponent(Coding category) { + public BenefitBalanceComponent(CodeableConcept category) { super(); this.category = category; } @@ -9049,12 +8890,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) */ - public Coding getCategory() { + public CodeableConcept getCategory() { if (this.category == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitBalanceComponent.category"); else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc + this.category = new CodeableConcept(); // cc return this.category; } @@ -9065,7 +8906,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) */ - public BenefitBalanceComponent setCategory(Coding value) { + public BenefitBalanceComponent setCategory(CodeableConcept value) { this.category = value; return this; } @@ -9073,12 +8914,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) */ - public Coding getSubCategory() { + public CodeableConcept getSubCategory() { if (this.subCategory == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitBalanceComponent.subCategory"); else if (Configuration.doAutoCreate()) - this.subCategory = new Coding(); // cc + this.subCategory = new CodeableConcept(); // cc return this.subCategory; } @@ -9089,11 +8930,56 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) */ - public BenefitBalanceComponent setSubCategory(Coding value) { + public BenefitBalanceComponent setSubCategory(CodeableConcept value) { this.subCategory = value; return this; } + /** + * @return {@link #excluded} (True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.). This is the underlying object with id, value and extensions. The accessor "getExcluded" gives direct access to the value + */ + public BooleanType getExcludedElement() { + if (this.excluded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BenefitBalanceComponent.excluded"); + else if (Configuration.doAutoCreate()) + this.excluded = new BooleanType(); // bb + return this.excluded; + } + + public boolean hasExcludedElement() { + return this.excluded != null && !this.excluded.isEmpty(); + } + + public boolean hasExcluded() { + return this.excluded != null && !this.excluded.isEmpty(); + } + + /** + * @param value {@link #excluded} (True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.). This is the underlying object with id, value and extensions. The accessor "getExcluded" gives direct access to the value + */ + public BenefitBalanceComponent setExcludedElement(BooleanType value) { + this.excluded = value; + return this; + } + + /** + * @return True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage. + */ + public boolean getExcluded() { + return this.excluded == null || this.excluded.isEmpty() ? false : this.excluded.getValue(); + } + + /** + * @param value True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage. + */ + public BenefitBalanceComponent setExcluded(boolean value) { + if (this.excluded == null) + this.excluded = new BooleanType(); + this.excluded.setValue(value); + return this; + } + /** * @return {@link #name} (A short name or tag for the benefit, for example MED01, or DENT2.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value */ @@ -9195,12 +9081,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #network} (Network designation.) */ - public Coding getNetwork() { + public CodeableConcept getNetwork() { if (this.network == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitBalanceComponent.network"); else if (Configuration.doAutoCreate()) - this.network = new Coding(); // cc + this.network = new CodeableConcept(); // cc return this.network; } @@ -9211,7 +9097,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #network} (Network designation.) */ - public BenefitBalanceComponent setNetwork(Coding value) { + public BenefitBalanceComponent setNetwork(CodeableConcept value) { this.network = value; return this; } @@ -9219,12 +9105,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #unit} (Unit designation: individual or family.) */ - public Coding getUnit() { + public CodeableConcept getUnit() { if (this.unit == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitBalanceComponent.unit"); else if (Configuration.doAutoCreate()) - this.unit = new Coding(); // cc + this.unit = new CodeableConcept(); // cc return this.unit; } @@ -9235,7 +9121,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #unit} (Unit designation: individual or family.) */ - public BenefitBalanceComponent setUnit(Coding value) { + public BenefitBalanceComponent setUnit(CodeableConcept value) { this.unit = value; return this; } @@ -9243,12 +9129,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) */ - public Coding getTerm() { + public CodeableConcept getTerm() { if (this.term == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitBalanceComponent.term"); else if (Configuration.doAutoCreate()) - this.term = new Coding(); // cc + this.term = new CodeableConcept(); // cc return this.term; } @@ -9259,7 +9145,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) */ - public BenefitBalanceComponent setTerm(Coding value) { + public BenefitBalanceComponent setTerm(CodeableConcept value) { this.term = value; return this; } @@ -9319,26 +9205,28 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("subCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, subCategory)); + childrenList.add(new Property("category", "CodeableConcept", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("subCategory", "CodeableConcept", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, subCategory)); + childrenList.add(new Property("excluded", "boolean", "True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.", 0, java.lang.Integer.MAX_VALUE, excluded)); childrenList.add(new Property("name", "string", "A short name or tag for the benefit, for example MED01, or DENT2.", 0, java.lang.Integer.MAX_VALUE, name)); childrenList.add(new Property("description", "string", "A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("network", "Coding", "Network designation.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("unit", "Coding", "Unit designation: individual or family.", 0, java.lang.Integer.MAX_VALUE, unit)); - childrenList.add(new Property("term", "Coding", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("network", "CodeableConcept", "Network designation.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("unit", "CodeableConcept", "Unit designation: individual or family.", 0, java.lang.Integer.MAX_VALUE, unit)); + childrenList.add(new Property("term", "CodeableConcept", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.", 0, java.lang.Integer.MAX_VALUE, term)); childrenList.add(new Property("financial", "", "Benefits Used to date.", 0, java.lang.Integer.MAX_VALUE, financial)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1365024606: /*subCategory*/ return this.subCategory == null ? new Base[0] : new Base[] {this.subCategory}; // Coding + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept + case 1365024606: /*subCategory*/ return this.subCategory == null ? new Base[0] : new Base[] {this.subCategory}; // CodeableConcept + case 1994055114: /*excluded*/ return this.excluded == null ? new Base[0] : new Base[] {this.excluded}; // BooleanType case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // Coding - case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // Coding - case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // Coding + case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // CodeableConcept + case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // CodeableConcept + case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // CodeableConcept case 357555337: /*financial*/ return this.financial == null ? new Base[0] : this.financial.toArray(new Base[this.financial.size()]); // BenefitComponent default: return super.getProperty(hash, name, checkValid); } @@ -9349,10 +9237,13 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 50511102: // category - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept break; case 1365024606: // subCategory - this.subCategory = castToCoding(value); // Coding + this.subCategory = castToCodeableConcept(value); // CodeableConcept + break; + case 1994055114: // excluded + this.excluded = castToBoolean(value); // BooleanType break; case 3373707: // name this.name = castToString(value); // StringType @@ -9361,13 +9252,13 @@ public class ExplanationOfBenefit extends DomainResource { this.description = castToString(value); // StringType break; case 1843485230: // network - this.network = castToCoding(value); // Coding + this.network = castToCodeableConcept(value); // CodeableConcept break; case 3594628: // unit - this.unit = castToCoding(value); // Coding + this.unit = castToCodeableConcept(value); // CodeableConcept break; case 3556460: // term - this.term = castToCoding(value); // Coding + this.term = castToCodeableConcept(value); // CodeableConcept break; case 357555337: // financial this.getFinancial().add((BenefitComponent) value); // BenefitComponent @@ -9380,19 +9271,21 @@ public class ExplanationOfBenefit extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("category")) - this.category = castToCoding(value); // Coding + this.category = castToCodeableConcept(value); // CodeableConcept else if (name.equals("subCategory")) - this.subCategory = castToCoding(value); // Coding + this.subCategory = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("excluded")) + this.excluded = castToBoolean(value); // BooleanType else if (name.equals("name")) this.name = castToString(value); // StringType else if (name.equals("description")) this.description = castToString(value); // StringType else if (name.equals("network")) - this.network = castToCoding(value); // Coding + this.network = castToCodeableConcept(value); // CodeableConcept else if (name.equals("unit")) - this.unit = castToCoding(value); // Coding + this.unit = castToCodeableConcept(value); // CodeableConcept else if (name.equals("term")) - this.term = castToCoding(value); // Coding + this.term = castToCodeableConcept(value); // CodeableConcept else if (name.equals("financial")) this.getFinancial().add((BenefitComponent) value); else @@ -9402,13 +9295,14 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 50511102: return getCategory(); // Coding - case 1365024606: return getSubCategory(); // Coding + case 50511102: return getCategory(); // CodeableConcept + case 1365024606: return getSubCategory(); // CodeableConcept + case 1994055114: throw new FHIRException("Cannot make property excluded as it is not a complex type"); // BooleanType case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 1843485230: return getNetwork(); // Coding - case 3594628: return getUnit(); // Coding - case 3556460: return getTerm(); // Coding + case 1843485230: return getNetwork(); // CodeableConcept + case 3594628: return getUnit(); // CodeableConcept + case 3556460: return getTerm(); // CodeableConcept case 357555337: return addFinancial(); // BenefitComponent default: return super.makeProperty(hash, name); } @@ -9418,13 +9312,16 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("category")) { - this.category = new Coding(); + this.category = new CodeableConcept(); return this.category; } else if (name.equals("subCategory")) { - this.subCategory = new Coding(); + this.subCategory = new CodeableConcept(); return this.subCategory; } + else if (name.equals("excluded")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.excluded"); + } else if (name.equals("name")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.name"); } @@ -9432,15 +9329,15 @@ public class ExplanationOfBenefit extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.description"); } else if (name.equals("network")) { - this.network = new Coding(); + this.network = new CodeableConcept(); return this.network; } else if (name.equals("unit")) { - this.unit = new Coding(); + this.unit = new CodeableConcept(); return this.unit; } else if (name.equals("term")) { - this.term = new Coding(); + this.term = new CodeableConcept(); return this.term; } else if (name.equals("financial")) { @@ -9455,6 +9352,7 @@ public class ExplanationOfBenefit extends DomainResource { copyValues(dst); dst.category = category == null ? null : category.copy(); dst.subCategory = subCategory == null ? null : subCategory.copy(); + dst.excluded = excluded == null ? null : excluded.copy(); dst.name = name == null ? null : name.copy(); dst.description = description == null ? null : description.copy(); dst.network = network == null ? null : network.copy(); @@ -9476,9 +9374,9 @@ public class ExplanationOfBenefit extends DomainResource { return false; BenefitBalanceComponent o = (BenefitBalanceComponent) other; return compareDeep(category, o.category, true) && compareDeep(subCategory, o.subCategory, true) - && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(network, o.network, true) - && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) && compareDeep(financial, o.financial, true) - ; + && compareDeep(excluded, o.excluded, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) + && compareDeep(network, o.network, true) && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) + && compareDeep(financial, o.financial, true); } @Override @@ -9488,12 +9386,13 @@ public class ExplanationOfBenefit extends DomainResource { if (!(other instanceof BenefitBalanceComponent)) return false; BenefitBalanceComponent o = (BenefitBalanceComponent) other; - return compareValues(name, o.name, true) && compareValues(description, o.description, true); + return compareValues(excluded, o.excluded, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, subCategory, name - , description, network, unit, term, financial); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, subCategory, excluded + , name, description, network, unit, term, financial); } public String fhirType() { @@ -9508,10 +9407,10 @@ public class ExplanationOfBenefit extends DomainResource { /** * Deductable, visits, benefit amount. */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Deductable, visits, benefit amount", formalDefinition="Deductable, visits, benefit amount." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-type") - protected Coding type; + protected CodeableConcept type; /** * Benefits allowed. @@ -9527,7 +9426,7 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Benefits used", formalDefinition="Benefits used." ) protected Type benefitUsed; - private static final long serialVersionUID = 1742418909L; + private static final long serialVersionUID = -1013861008L; /** * Constructor @@ -9539,7 +9438,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * Constructor */ - public BenefitComponent(Coding type) { + public BenefitComponent(CodeableConcept type) { super(); this.type = type; } @@ -9547,12 +9446,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #type} (Deductable, visits, benefit amount.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create BenefitComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -9563,7 +9462,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #type} (Deductable, visits, benefit amount.) */ - public BenefitComponent setType(Coding value) { + public BenefitComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -9673,7 +9572,7 @@ public class ExplanationOfBenefit extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Deductable, visits, benefit amount.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "Deductable, visits, benefit amount.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("benefit[x]", "unsignedInt|string|Money", "Benefits allowed.", 0, java.lang.Integer.MAX_VALUE, benefit)); childrenList.add(new Property("benefitUsed[x]", "unsignedInt|Money", "Benefits used.", 0, java.lang.Integer.MAX_VALUE, benefitUsed)); } @@ -9681,7 +9580,7 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : new Base[] {this.benefit}; // Type case -549981964: /*benefitUsed*/ return this.benefitUsed == null ? new Base[0] : new Base[] {this.benefitUsed}; // Type default: return super.getProperty(hash, name, checkValid); @@ -9693,7 +9592,7 @@ public class ExplanationOfBenefit extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case -222710633: // benefit this.benefit = castToType(value); // Type @@ -9709,7 +9608,7 @@ public class ExplanationOfBenefit extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("benefit[x]")) this.benefit = castToType(value); // Type else if (name.equals("benefitUsed[x]")) @@ -9721,7 +9620,7 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 952095881: return getBenefit(); // Type case 787635980: return getBenefitUsed(); // Type default: return super.makeProperty(hash, name); @@ -9732,7 +9631,7 @@ public class ExplanationOfBenefit extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("benefitUnsignedInt")) { @@ -9811,112 +9710,81 @@ public class ExplanationOfBenefit extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/explanationofbenefit-status") protected Enumeration status; - /** - * The insurer which is responsible for the explanation of benefit. - */ - @Child(name = "author", type = {Organization.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Insurer", formalDefinition="The insurer which is responsible for the explanation of benefit." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (The insurer which is responsible for the explanation of benefit.) - */ - protected Organization authorTarget; - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name = "claim", type = {Claim.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Claim reference", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected Reference claim; - - /** - * The actual object that is the target of the reference (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - protected Claim claimTarget; - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name = "claimResponse", type = {ClaimResponse.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Claim response reference", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - protected ClaimResponse claimResponseTarget; - /** * The category of claim, eg, oral, pharmacy, vision, insitutional, professional. */ - @Child(name = "type", type = {Coding.class}, order=5, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Type or discipline", formalDefinition="The category of claim, eg, oral, pharmacy, vision, insitutional, professional." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-type") - protected Coding type; + protected CodeableConcept type; /** * A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType. */ - @Child(name = "subType", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "subType", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Finer grained claim type information", formalDefinition="A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-subtype") - protected List subType; + protected List subType; /** - * The version of the specification on which this instance relies. + * Patient Resource. */ - @Child(name = "ruleset", type = {Coding.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; + @Child(name = "patient", type = {Patient.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; /** - * The version of the specification from which the original instance was created. + * The actual object that is the target of the reference (Patient Resource.) */ - @Child(name = "originalRuleset", type = {Coding.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - - /** - * The date when the EOB was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Creation date", formalDefinition="The date when the EOB was created." ) - protected DateTimeType created; + protected Patient patientTarget; /** * The billable period for which charges are being submitted. */ - @Child(name = "billablePeriod", type = {Period.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "billablePeriod", type = {Period.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Period for charge submission", formalDefinition="The billable period for which charges are being submitted." ) protected Period billablePeriod; /** - * Processing outcome errror, partial or complete processing. + * The date when the EOB was created. */ - @Child(name = "outcome", type = {Coding.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="complete | error | partial", formalDefinition="Processing outcome errror, partial or complete processing." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome") - protected Coding outcome; + @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Creation date", formalDefinition="The date when the EOB was created." ) + protected DateTimeType created; /** - * A description of the status of the adjudication. + * The person who created the explanation of benefit. */ - @Child(name = "disposition", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; + @Child(name = "enterer", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Author", formalDefinition="The person who created the explanation of benefit." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (The person who created the explanation of benefit.) + */ + protected Practitioner entererTarget; + + /** + * The insurer which is responsible for the explanation of benefit. + */ + @Child(name = "insurer", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Insurer", formalDefinition="The insurer which is responsible for the explanation of benefit." ) + protected Reference insurer; + + /** + * The actual object that is the target of the reference (The insurer which is responsible for the explanation of benefit.) + */ + protected Organization insurerTarget; /** * The provider which is responsible for the claim. */ - @Child(name = "provider", type = {Practitioner.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "provider", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible provider for the claim", formalDefinition="The provider which is responsible for the claim." ) protected Reference provider; @@ -9928,7 +9796,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * The provider which is responsible for the claim. */ - @Child(name = "organization", type = {Organization.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Child(name = "organization", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization for the claim", formalDefinition="The provider which is responsible for the claim." ) protected Reference organization; @@ -9937,60 +9805,10 @@ public class ExplanationOfBenefit extends DomainResource { */ protected Organization organizationTarget; - /** - * Facility where the services were provided. - */ - @Child(name = "facility", type = {Location.class}, order=15, min=0, max=1, modifier=false, summary=false) - @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; - - /** - * Other claims which are related to this claim such as prior claim versions or for related services. - */ - @Child(name = "related", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Related Claims which may be revelant to processing this claimn", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) - protected List related; - - /** - * Prescription to support the dispensing of Pharmacy or Vision products. - */ - @Child(name = "prescription", type = {MedicationRequest.class, VisionPrescription.class}, order=17, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) - protected Reference prescription; - - /** - * The actual object that is the target of the reference (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - protected Resource prescriptionTarget; - - /** - * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. - */ - @Child(name = "originalPrescription", type = {MedicationRequest.class}, order=18, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this 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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - protected MedicationRequest originalPrescriptionTarget; - - /** - * The party to be reimbursed for the services. - */ - @Child(name = "payee", type = {}, order=19, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Payee", formalDefinition="The party to be reimbursed 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=20, min=0, max=1, modifier=false, summary=false) + @Child(name = "referral", type = {ReferralRequest.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) protected Reference referral; @@ -9999,39 +9817,123 @@ public class ExplanationOfBenefit extends DomainResource { */ protected ReferralRequest referralTarget; + /** + * Facility where the services were provided. + */ + @Child(name = "facility", type = {Location.class}, order=12, min=0, max=1, modifier=false, summary=false) + @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; + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name = "claim", type = {Claim.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Claim reference", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected Reference claim; + + /** + * The actual object that is the target of the reference (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + protected Claim claimTarget; + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name = "claimResponse", type = {ClaimResponse.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Claim response reference", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * Processing outcome errror, partial or complete processing. + */ + @Child(name = "outcome", type = {CodeableConcept.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="complete | error | partial", formalDefinition="Processing outcome errror, partial or complete processing." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome") + protected CodeableConcept outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name = "disposition", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * Other claims which are related to this claim such as prior claim versions or for related services. + */ + @Child(name = "related", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Related Claims which may be revelant to processing this claim", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) + protected List related; + + /** + * Prescription to support the dispensing of Pharmacy or Vision products. + */ + @Child(name = "prescription", type = {MedicationRequest.class, VisionPrescription.class}, order=18, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) + protected Reference prescription; + + /** + * The actual object that is the target of the reference (Prescription to support the dispensing of Pharmacy or Vision products.) + */ + protected Resource prescriptionTarget; + + /** + * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'. + */ + @Child(name = "originalPrescription", type = {MedicationRequest.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'." ) + protected Reference originalPrescription; + + /** + * The actual object that is the target of the reference (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) + */ + protected MedicationRequest originalPrescriptionTarget; + + /** + * The party to be reimbursed for the services. + */ + @Child(name = "payee", type = {}, order=20, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Payee", formalDefinition="The party to be reimbursed for the services." ) + protected PayeeComponent payee; + /** * Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required. */ @Child(name = "information", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Exceptions, special considerations, the condition, situation, prior or concurrent issues", formalDefinition="Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required." ) - protected List information; + protected List information; + + /** + * The members of the team who provided the overall service as well as their role and whether responsible and qualifications. + */ + @Child(name = "careTeam", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Care Team members", formalDefinition="The members of the team who provided the overall service as well as their role and whether responsible and qualifications." ) + protected List careTeam; /** * Ordered list of patient diagnosis for which care is sought. */ - @Child(name = "diagnosis", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "diagnosis", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) protected List diagnosis; /** * Ordered list of patient procedures performed to support the adjudication. */ - @Child(name = "procedure", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "procedure", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Procedures performed", formalDefinition="Ordered list of patient procedures performed to support the adjudication." ) protected List procedure; - /** - * Patient Resource. - */ - @Child(name = "patient", type = {Patient.class}, order=24, min=1, max=1, modifier=false, summary=false) - @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; - /** * Precedence (primary, secondary, etc.). */ @@ -10042,9 +9944,9 @@ public class ExplanationOfBenefit extends DomainResource { /** * Financial instrument by which payment information for health care. */ - @Child(name = "coverage", type = {}, order=26, min=1, max=1, modifier=false, summary=false) + @Child(name = "insurance", type = {}, order=26, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected CoverageComponent coverage; + protected InsuranceComponent insurance; /** * An accident which resulted in the need for healthcare services. @@ -10081,64 +9983,57 @@ public class ExplanationOfBenefit extends DomainResource { @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) protected List addItem; - /** - * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. - */ - @Child(name = "missingTeeth", type = {}, order=32, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) - protected List missingTeeth; - /** * The total cost of the services reported. */ - @Child(name = "totalCost", type = {Money.class}, order=33, min=0, max=1, modifier=false, summary=false) + @Child(name = "totalCost", type = {Money.class}, order=32, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) protected Money totalCost; /** * The amount of deductable applied which was not allocated to any particular service line. */ - @Child(name = "unallocDeductable", type = {Money.class}, order=34, min=0, max=1, modifier=false, summary=false) + @Child(name = "unallocDeductable", type = {Money.class}, order=33, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Unallocated deductable", formalDefinition="The amount of deductable applied which was not allocated to any particular service line." ) protected Money unallocDeductable; /** * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable). */ - @Child(name = "totalBenefit", type = {Money.class}, order=35, min=0, max=1, modifier=false, summary=false) + @Child(name = "totalBenefit", type = {Money.class}, order=34, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable)." ) protected Money totalBenefit; /** * Payment details for the claim if the claim has been paid. */ - @Child(name = "payment", type = {}, order=36, min=0, max=1, modifier=false, summary=false) + @Child(name = "payment", type = {}, order=35, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Payment (if paid)", formalDefinition="Payment details for the claim if the claim has been paid." ) protected PaymentComponent payment; /** * The form to be used for printing the content. */ - @Child(name = "form", type = {Coding.class}, order=37, min=0, max=1, modifier=false, summary=false) + @Child(name = "form", type = {CodeableConcept.class}, order=36, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms") - protected Coding form; + protected CodeableConcept form; /** * Note text. */ - @Child(name = "note", type = {}, order=38, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "note", type = {}, order=37, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) protected List note; /** * Balance by Benefit Category. */ - @Child(name = "benefitBalance", type = {}, order=39, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "benefitBalance", type = {}, order=38, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Balance by Benefit Category", formalDefinition="Balance by Benefit Category." ) protected List benefitBalance; - private static final long serialVersionUID = -937727986L; + private static final long serialVersionUID = 1629577854L; /** * Constructor @@ -10147,17 +10042,6 @@ public class ExplanationOfBenefit extends DomainResource { super(); } - /** - * Constructor - */ - public ExplanationOfBenefit(Enumeration status, Coding type, Reference patient, CoverageComponent coverage) { - super(); - this.status = status; - this.type = type; - this.patient = patient; - this.coverage = coverage; - } - /** * @return {@link #identifier} (The EOB Business Identifier.) */ @@ -10250,153 +10134,25 @@ public class ExplanationOfBenefit extends DomainResource { * @param value The status of the resource instance. */ public ExplanationOfBenefit setStatus(ExplanationOfBenefitStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new ExplanationOfBenefitStatusEnumFactory()); this.status.setValue(value); - return this; - } - - /** - * @return {@link #author} (The insurer which is responsible for the explanation of benefit.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (The insurer which is responsible for the explanation of benefit.) - */ - public ExplanationOfBenefit setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} 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 insurer which is responsible for the explanation of benefit.) - */ - public Organization getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Organization(); // aa - return this.authorTarget; - } - - /** - * @param value {@link #author} 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 which is responsible for the explanation of benefit.) - */ - public ExplanationOfBenefit setAuthorTarget(Organization value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Reference getClaim() { - if (this.claim == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.claim"); - else if (Configuration.doAutoCreate()) - this.claim = new Reference(); // cc - return this.claim; - } - - public boolean hasClaim() { - return this.claim != null && !this.claim.isEmpty(); - } - - /** - * @param value {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public ExplanationOfBenefit setClaim(Reference value) { - this.claim = value; - return this; - } - - /** - * @return {@link #claim} 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 business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Claim getClaimTarget() { - if (this.claimTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.claim"); - else if (Configuration.doAutoCreate()) - this.claimTarget = new Claim(); // aa - return this.claimTarget; - } - - /** - * @param value {@link #claim} 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 business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public ExplanationOfBenefit setClaimTarget(Claim value) { - this.claimTarget = value; - return this; - } - - /** - * @return {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); // cc - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public ExplanationOfBenefit 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 business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); // aa - 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 business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public ExplanationOfBenefit setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; + } return this; } /** * @return {@link #type} (The category of claim, eg, oral, pharmacy, vision, insitutional, professional.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ExplanationOfBenefit.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -10407,7 +10163,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #type} (The category of claim, eg, oral, pharmacy, vision, insitutional, professional.) */ - public ExplanationOfBenefit setType(Coding value) { + public ExplanationOfBenefit setType(CodeableConcept value) { this.type = value; return this; } @@ -10415,16 +10171,16 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) */ - public List getSubType() { + public List getSubType() { if (this.subType == null) - this.subType = new ArrayList(); + this.subType = new ArrayList(); return this.subType; } /** * @return Returns a reference to this for easy method chaining */ - public ExplanationOfBenefit setSubType(List theSubType) { + public ExplanationOfBenefit setSubType(List theSubType) { this.subType = theSubType; return this; } @@ -10432,25 +10188,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasSubType() { if (this.subType == null) return false; - for (Coding item : this.subType) + for (CodeableConcept item : this.subType) if (!item.isEmpty()) return true; return false; } - public Coding addSubType() { //3 - Coding t = new Coding(); + public CodeableConcept addSubType() { //3 + CodeableConcept t = new CodeableConcept(); if (this.subType == null) - this.subType = new ArrayList(); + this.subType = new ArrayList(); this.subType.add(t); return t; } - public ExplanationOfBenefit addSubType(Coding t) { //3 + public ExplanationOfBenefit addSubType(CodeableConcept t) { //3 if (t == null) return this; if (this.subType == null) - this.subType = new ArrayList(); + this.subType = new ArrayList(); this.subType.add(t); return this; } @@ -10458,7 +10214,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #subType}, creating it if it does not already exist */ - public Coding getSubTypeFirstRep() { + public CodeableConcept getSubTypeFirstRep() { if (getSubType().isEmpty()) { addSubType(); } @@ -10466,50 +10222,70 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) + * @return {@link #patient} (Patient Resource.) */ - public Coding getRuleset() { - if (this.ruleset == null) + public Reference getPatient() { + if (this.patient == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.ruleset"); + throw new Error("Attempt to auto-create ExplanationOfBenefit.patient"); else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; + this.patient = new Reference(); // cc + return this.patient; } - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); } /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + * @param value {@link #patient} (Patient Resource.) */ - public ExplanationOfBenefit setRuleset(Coding value) { - this.ruleset = value; + public ExplanationOfBenefit setPatient(Reference value) { + this.patient = value; return this; } /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + * @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 Coding getOriginalRuleset() { - if (this.originalRuleset == null) + public Patient getPatientTarget() { + if (this.patientTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.originalRuleset"); + throw new Error("Attempt to auto-create ExplanationOfBenefit.patient"); else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + this.patientTarget = new Patient(); // aa + return this.patientTarget; } /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + * @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 ExplanationOfBenefit setOriginalRuleset(Coding value) { - this.originalRuleset = value; + public ExplanationOfBenefit setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #billablePeriod} (The billable period for which charges are being submitted.) + */ + public Period getBillablePeriod() { + if (this.billablePeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.billablePeriod"); + else if (Configuration.doAutoCreate()) + this.billablePeriod = new Period(); // cc + return this.billablePeriod; + } + + public boolean hasBillablePeriod() { + return this.billablePeriod != null && !this.billablePeriod.isEmpty(); + } + + /** + * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.) + */ + public ExplanationOfBenefit setBillablePeriod(Period value) { + this.billablePeriod = value; return this; } @@ -10563,99 +10339,90 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @return {@link #billablePeriod} (The billable period for which charges are being submitted.) + * @return {@link #enterer} (The person who created the explanation of benefit.) */ - public Period getBillablePeriod() { - if (this.billablePeriod == null) + public Reference getEnterer() { + if (this.enterer == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.billablePeriod"); + throw new Error("Attempt to auto-create ExplanationOfBenefit.enterer"); else if (Configuration.doAutoCreate()) - this.billablePeriod = new Period(); // cc - return this.billablePeriod; + this.enterer = new Reference(); // cc + return this.enterer; } - public boolean hasBillablePeriod() { - return this.billablePeriod != null && !this.billablePeriod.isEmpty(); + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); } /** - * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.) + * @param value {@link #enterer} (The person who created the explanation of benefit.) */ - public ExplanationOfBenefit setBillablePeriod(Period value) { - this.billablePeriod = value; + public ExplanationOfBenefit setEnterer(Reference value) { + this.enterer = value; return this; } /** - * @return {@link #outcome} (Processing outcome errror, partial or complete processing.) + * @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. (The person who created the explanation of benefit.) */ - public Coding getOutcome() { - if (this.outcome == null) + public Practitioner getEntererTarget() { + if (this.entererTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.outcome"); + throw new Error("Attempt to auto-create ExplanationOfBenefit.enterer"); else if (Configuration.doAutoCreate()) - this.outcome = new Coding(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); + this.entererTarget = new Practitioner(); // aa + return this.entererTarget; } /** - * @param value {@link #outcome} (Processing outcome errror, partial or complete processing.) + * @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. (The person who created the explanation of benefit.) */ - public ExplanationOfBenefit setOutcome(Coding value) { - this.outcome = value; + public ExplanationOfBenefit setEntererTarget(Practitioner value) { + this.entererTarget = value; return this; } /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + * @return {@link #insurer} (The insurer which is responsible for the explanation of benefit.) */ - public StringType getDispositionElement() { - if (this.disposition == null) + public Reference getInsurer() { + if (this.insurer == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.disposition"); + throw new Error("Attempt to auto-create ExplanationOfBenefit.insurer"); else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; + this.insurer = new Reference(); // cc + return this.insurer; } - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); + public boolean hasInsurer() { + return this.insurer != null && !this.insurer.isEmpty(); } /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + * @param value {@link #insurer} (The insurer which is responsible for the explanation of benefit.) */ - public ExplanationOfBenefit setDispositionElement(StringType value) { - this.disposition = value; + public ExplanationOfBenefit setInsurer(Reference value) { + this.insurer = value; return this; } /** - * @return A description of the status of the adjudication. + * @return {@link #insurer} 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 insurer which is responsible for the explanation of benefit.) */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); + public Organization getInsurerTarget() { + if (this.insurerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.insurer"); + else if (Configuration.doAutoCreate()) + this.insurerTarget = new Organization(); // aa + return this.insurerTarget; } /** - * @param value A description of the status of the adjudication. + * @param value {@link #insurer} 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 which is responsible for the explanation of benefit.) */ - public ExplanationOfBenefit setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } + public ExplanationOfBenefit setInsurerTarget(Organization value) { + this.insurerTarget = value; return this; } @@ -10747,6 +10514,50 @@ public class ExplanationOfBenefit extends DomainResource { 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 ExplanationOfBenefit.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); // cc + 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 ExplanationOfBenefit 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 ExplanationOfBenefit.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); // aa + 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 ExplanationOfBenefit setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + /** * @return {@link #facility} (Facility where the services were provided.) */ @@ -10791,6 +10602,167 @@ public class ExplanationOfBenefit extends DomainResource { return this; } + /** + * @return {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Reference getClaim() { + if (this.claim == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.claim"); + else if (Configuration.doAutoCreate()) + this.claim = new Reference(); // cc + return this.claim; + } + + public boolean hasClaim() { + return this.claim != null && !this.claim.isEmpty(); + } + + /** + * @param value {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public ExplanationOfBenefit setClaim(Reference value) { + this.claim = value; + return this; + } + + /** + * @return {@link #claim} 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 business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Claim getClaimTarget() { + if (this.claimTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.claim"); + else if (Configuration.doAutoCreate()) + this.claimTarget = new Claim(); // aa + return this.claimTarget; + } + + /** + * @param value {@link #claim} 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 business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public ExplanationOfBenefit setClaimTarget(Claim value) { + this.claimTarget = value; + return this; + } + + /** + * @return {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); // cc + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public ExplanationOfBenefit 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 business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); // aa + 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 business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public ExplanationOfBenefit setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Processing outcome errror, partial or complete processing.) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Processing outcome errror, partial or complete processing.) + */ + public ExplanationOfBenefit setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ExplanationOfBenefit setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public ExplanationOfBenefit setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + /** * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) */ @@ -10884,7 +10856,7 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ public Reference getOriginalPrescription() { if (this.originalPrescription == null) @@ -10900,7 +10872,7 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ public ExplanationOfBenefit setOriginalPrescription(Reference value) { this.originalPrescription = value; @@ -10908,7 +10880,7 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * @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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ public MedicationRequest getOriginalPrescriptionTarget() { if (this.originalPrescriptionTarget == null) @@ -10920,7 +10892,7 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) + * @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 which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.) */ public ExplanationOfBenefit setOriginalPrescriptionTarget(MedicationRequest value) { this.originalPrescriptionTarget = value; @@ -10951,63 +10923,19 @@ public class ExplanationOfBenefit extends DomainResource { 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 ExplanationOfBenefit.referral"); - else if (Configuration.doAutoCreate()) - this.referral = new Reference(); // cc - 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 ExplanationOfBenefit 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 ExplanationOfBenefit.referral"); - else if (Configuration.doAutoCreate()) - this.referralTarget = new ReferralRequest(); // aa - 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 ExplanationOfBenefit setReferralTarget(ReferralRequest value) { - this.referralTarget = value; - return this; - } - /** * @return {@link #information} (Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required.) */ - public List getInformation() { + public List getInformation() { if (this.information == null) - this.information = new ArrayList(); + this.information = new ArrayList(); return this.information; } /** * @return Returns a reference to this for easy method chaining */ - public ExplanationOfBenefit setInformation(List theInformation) { + public ExplanationOfBenefit setInformation(List theInformation) { this.information = theInformation; return this; } @@ -11015,25 +10943,25 @@ public class ExplanationOfBenefit extends DomainResource { public boolean hasInformation() { if (this.information == null) return false; - for (SpecialConditionComponent item : this.information) + for (SupportingInformationComponent item : this.information) if (!item.isEmpty()) return true; return false; } - public SpecialConditionComponent addInformation() { //3 - SpecialConditionComponent t = new SpecialConditionComponent(); + public SupportingInformationComponent addInformation() { //3 + SupportingInformationComponent t = new SupportingInformationComponent(); if (this.information == null) - this.information = new ArrayList(); + this.information = new ArrayList(); this.information.add(t); return t; } - public ExplanationOfBenefit addInformation(SpecialConditionComponent t) { //3 + public ExplanationOfBenefit addInformation(SupportingInformationComponent t) { //3 if (t == null) return this; if (this.information == null) - this.information = new ArrayList(); + this.information = new ArrayList(); this.information.add(t); return this; } @@ -11041,13 +10969,66 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return The first repetition of repeating field {@link #information}, creating it if it does not already exist */ - public SpecialConditionComponent getInformationFirstRep() { + public SupportingInformationComponent getInformationFirstRep() { if (getInformation().isEmpty()) { addInformation(); } return getInformation().get(0); } + /** + * @return {@link #careTeam} (The members of the team who provided the overall service as well as their role and whether responsible and qualifications.) + */ + public List getCareTeam() { + if (this.careTeam == null) + this.careTeam = new ArrayList(); + return this.careTeam; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ExplanationOfBenefit setCareTeam(List theCareTeam) { + this.careTeam = theCareTeam; + return this; + } + + public boolean hasCareTeam() { + if (this.careTeam == null) + return false; + for (CareTeamComponent item : this.careTeam) + if (!item.isEmpty()) + return true; + return false; + } + + public CareTeamComponent addCareTeam() { //3 + CareTeamComponent t = new CareTeamComponent(); + if (this.careTeam == null) + this.careTeam = new ArrayList(); + this.careTeam.add(t); + return t; + } + + public ExplanationOfBenefit addCareTeam(CareTeamComponent t) { //3 + if (t == null) + return this; + if (this.careTeam == null) + this.careTeam = new ArrayList(); + this.careTeam.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #careTeam}, creating it if it does not already exist + */ + public CareTeamComponent getCareTeamFirstRep() { + if (getCareTeam().isEmpty()) { + addCareTeam(); + } + return getCareTeam().get(0); + } + /** * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) */ @@ -11154,50 +11135,6 @@ public class ExplanationOfBenefit extends DomainResource { return getProcedure().get(0); } - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient Resource.) - */ - public ExplanationOfBenefit 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 ExplanationOfBenefit.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - 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 ExplanationOfBenefit setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - /** * @return {@link #precedence} (Precedence (primary, secondary, etc.).). This is the underlying object with id, value and extensions. The accessor "getPrecedence" gives direct access to the value */ @@ -11244,26 +11181,26 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) + * @return {@link #insurance} (Financial instrument by which payment information for health care.) */ - public CoverageComponent getCoverage() { - if (this.coverage == null) + public InsuranceComponent getInsurance() { + if (this.insurance == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.coverage"); + throw new Error("Attempt to auto-create ExplanationOfBenefit.insurance"); else if (Configuration.doAutoCreate()) - this.coverage = new CoverageComponent(); // cc - return this.coverage; + this.insurance = new InsuranceComponent(); // cc + return this.insurance; } - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); + public boolean hasInsurance() { + return this.insurance != null && !this.insurance.isEmpty(); } /** - * @param value {@link #coverage} (Financial instrument by which payment information for health care.) + * @param value {@link #insurance} (Financial instrument by which payment information for health care.) */ - public ExplanationOfBenefit setCoverage(CoverageComponent value) { - this.coverage = value; + public ExplanationOfBenefit setInsurance(InsuranceComponent value) { + this.insurance = value; return this; } @@ -11445,59 +11382,6 @@ public class ExplanationOfBenefit extends DomainResource { return getAddItem().get(0); } - /** - * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - public List getMissingTeeth() { - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - return this.missingTeeth; - } - - /** - * @return Returns a reference to this for easy method chaining - */ - public ExplanationOfBenefit setMissingTeeth(List theMissingTeeth) { - this.missingTeeth = theMissingTeeth; - return this; - } - - public boolean hasMissingTeeth() { - if (this.missingTeeth == null) - return false; - for (MissingTeethComponent item : this.missingTeeth) - if (!item.isEmpty()) - return true; - return false; - } - - public MissingTeethComponent addMissingTeeth() { //3 - MissingTeethComponent t = new MissingTeethComponent(); - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return t; - } - - public ExplanationOfBenefit addMissingTeeth(MissingTeethComponent t) { //3 - if (t == null) - return this; - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return this; - } - - /** - * @return The first repetition of repeating field {@link #missingTeeth}, creating it if it does not already exist - */ - public MissingTeethComponent getMissingTeethFirstRep() { - if (getMissingTeeth().isEmpty()) { - addMissingTeeth(); - } - return getMissingTeeth().get(0); - } - /** * @return {@link #totalCost} (The total cost of the services reported.) */ @@ -11597,12 +11481,12 @@ public class ExplanationOfBenefit extends DomainResource { /** * @return {@link #form} (The form to be used for printing the content.) */ - public Coding getForm() { + public CodeableConcept getForm() { if (this.form == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ExplanationOfBenefit.form"); else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc + this.form = new CodeableConcept(); // cc return this.form; } @@ -11613,7 +11497,7 @@ public class ExplanationOfBenefit extends DomainResource { /** * @param value {@link #form} (The form to be used for printing the content.) */ - public ExplanationOfBenefit setForm(Coding value) { + public ExplanationOfBenefit setForm(CodeableConcept value) { this.form = value; return this; } @@ -11728,42 +11612,41 @@ public class ExplanationOfBenefit extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The EOB Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("author", "Reference(Organization)", "The insurer which is responsible for the explanation of benefit.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("claim", "Reference(Claim)", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, claim)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - childrenList.add(new Property("type", "Coding", "The category of claim, eg, oral, pharmacy, vision, insitutional, professional.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subType", "Coding", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType)); - 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 EOB was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("type", "CodeableConcept", "The category of claim, eg, oral, pharmacy, vision, insitutional, professional.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subType", "CodeableConcept", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); childrenList.add(new Property("billablePeriod", "Period", "The billable period for which charges are being submitted.", 0, java.lang.Integer.MAX_VALUE, billablePeriod)); - childrenList.add(new Property("outcome", "Coding", "Processing outcome errror, partial or complete processing.", 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("created", "dateTime", "The date when the EOB was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "The person who created the explanation of benefit.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("insurer", "Reference(Organization)", "The insurer which is responsible for the explanation of benefit.", 0, java.lang.Integer.MAX_VALUE, insurer)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the claim.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The provider which is responsible for the claim.", 0, java.lang.Integer.MAX_VALUE, organization)); + 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("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("claim", "Reference(Claim)", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, claim)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + childrenList.add(new Property("outcome", "CodeableConcept", "Processing outcome errror, partial or complete processing.", 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("related", "", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, related)); childrenList.add(new Property("prescription", "Reference(MedicationRequest|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("originalPrescription", "Reference(MedicationRequest)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); + childrenList.add(new Property("originalPrescription", "Reference(MedicationRequest)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); childrenList.add(new Property("payee", "", "The party to be reimbursed 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("information", "", "Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required.", 0, java.lang.Integer.MAX_VALUE, information)); + childrenList.add(new Property("careTeam", "", "The members of the team who provided the overall service as well as their role and whether responsible and qualifications.", 0, java.lang.Integer.MAX_VALUE, careTeam)); 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("procedure", "", "Ordered list of patient procedures performed to support the adjudication.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); childrenList.add(new Property("precedence", "positiveInt", "Precedence (primary, secondary, etc.).", 0, java.lang.Integer.MAX_VALUE, precedence)); - 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("insurance", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, insurance)); childrenList.add(new Property("accident", "", "An accident which resulted in the need for healthcare services.", 0, java.lang.Integer.MAX_VALUE, accident)); childrenList.add(new Property("employmentImpacted", "Period", "The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).", 0, java.lang.Integer.MAX_VALUE, employmentImpacted)); childrenList.add(new Property("hospitalization", "Period", "The start and optional end dates of when the patient was confined to a treatment center.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem)); - childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth)); childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductable applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); childrenList.add(new Property("payment", "", "Payment details for the claim if the claim has been paid.", 0, java.lang.Integer.MAX_VALUE, payment)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); childrenList.add(new Property("benefitBalance", "", "Balance by Benefit Category.", 0, java.lang.Integer.MAX_VALUE, benefitBalance)); } @@ -11773,42 +11656,41 @@ public class ExplanationOfBenefit extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Reference - case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // Coding - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept + case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // CodeableConcept + case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference case -332066046: /*billablePeriod*/ return this.billablePeriod == null ? new Base[0] : new Base[] {this.billablePeriod}; // Period - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Coding - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference + case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case -722568291: /*referral*/ return this.referral == null ? new Base[0] : new Base[] {this.referral}; // Reference case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Reference + case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Reference + case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // RelatedClaimComponent case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Reference case -1814015861: /*originalPrescription*/ return this.originalPrescription == null ? new Base[0] : new Base[] {this.originalPrescription}; // Reference case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // PayeeComponent - case -722568291: /*referral*/ return this.referral == null ? new Base[0] : new Base[] {this.referral}; // Reference - case 1968600364: /*information*/ return this.information == null ? new Base[0] : this.information.toArray(new Base[this.information.size()]); // SpecialConditionComponent + case 1968600364: /*information*/ return this.information == null ? new Base[0] : this.information.toArray(new Base[this.information.size()]); // SupportingInformationComponent + case -7323378: /*careTeam*/ return this.careTeam == null ? new Base[0] : this.careTeam.toArray(new Base[this.careTeam.size()]); // CareTeamComponent case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // ProcedureComponent - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference case 159695370: /*precedence*/ return this.precedence == null ? new Base[0] : new Base[] {this.precedence}; // PositiveIntType - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // CoverageComponent + case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : new Base[] {this.insurance}; // InsuranceComponent case -2143202801: /*accident*/ return this.accident == null ? new Base[0] : new Base[] {this.accident}; // AccidentComponent case 1051487345: /*employmentImpacted*/ return this.employmentImpacted == null ? new Base[0] : new Base[] {this.employmentImpacted}; // Period case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // Period case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemComponent case -1148899500: /*addItem*/ return this.addItem == null ? new Base[0] : this.addItem.toArray(new Base[this.addItem.size()]); // AddedItemComponent - case -1157130302: /*missingTeeth*/ return this.missingTeeth == null ? new Base[0] : this.missingTeeth.toArray(new Base[this.missingTeeth.size()]); // MissingTeethComponent case -577782479: /*totalCost*/ return this.totalCost == null ? new Base[0] : new Base[] {this.totalCost}; // Money case 2096309753: /*unallocDeductable*/ return this.unallocDeductable == null ? new Base[0] : new Base[] {this.unallocDeductable}; // Money case 332332211: /*totalBenefit*/ return this.totalBenefit == null ? new Base[0] : new Base[] {this.totalBenefit}; // Money case -786681338: /*payment*/ return this.payment == null ? new Base[0] : new Base[] {this.payment}; // PaymentComponent - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NoteComponent case 596003397: /*benefitBalance*/ return this.benefitBalance == null ? new Base[0] : this.benefitBalance.toArray(new Base[this.benefitBalance.size()]); // BenefitBalanceComponent default: return super.getProperty(hash, name, checkValid); @@ -11825,38 +11707,26 @@ public class ExplanationOfBenefit extends DomainResource { case -892481550: // status this.status = new ExplanationOfBenefitStatusEnumFactory().fromType(value); // Enumeration break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case 94742588: // claim - this.claim = castToReference(value); // Reference - break; - case 689513629: // claimResponse - this.claimResponse = castToReference(value); // Reference - break; case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case -1868521062: // subType - this.getSubType().add(castToCoding(value)); // Coding + this.getSubType().add(castToCodeableConcept(value)); // CodeableConcept break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType + case -791418107: // patient + this.patient = castToReference(value); // Reference break; case -332066046: // billablePeriod this.billablePeriod = castToPeriod(value); // Period break; - case -1106507950: // outcome - this.outcome = castToCoding(value); // Coding + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType + case -1591951995: // enterer + this.enterer = castToReference(value); // Reference + break; + case 1957615864: // insurer + this.insurer = castToReference(value); // Reference break; case -987494927: // provider this.provider = castToReference(value); // Reference @@ -11864,9 +11734,24 @@ public class ExplanationOfBenefit extends DomainResource { case 1178922291: // organization this.organization = castToReference(value); // Reference break; + case -722568291: // referral + this.referral = castToReference(value); // Reference + break; case 501116579: // facility this.facility = castToReference(value); // Reference break; + case 94742588: // claim + this.claim = castToReference(value); // Reference + break; + case 689513629: // claimResponse + this.claimResponse = castToReference(value); // Reference + break; + case -1106507950: // outcome + this.outcome = castToCodeableConcept(value); // CodeableConcept + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; case 1090493483: // related this.getRelated().add((RelatedClaimComponent) value); // RelatedClaimComponent break; @@ -11879,11 +11764,11 @@ public class ExplanationOfBenefit extends DomainResource { case 106443592: // payee this.payee = (PayeeComponent) value; // PayeeComponent break; - case -722568291: // referral - this.referral = castToReference(value); // Reference - break; case 1968600364: // information - this.getInformation().add((SpecialConditionComponent) value); // SpecialConditionComponent + this.getInformation().add((SupportingInformationComponent) value); // SupportingInformationComponent + break; + case -7323378: // careTeam + this.getCareTeam().add((CareTeamComponent) value); // CareTeamComponent break; case 1196993265: // diagnosis this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent @@ -11891,14 +11776,11 @@ public class ExplanationOfBenefit extends DomainResource { case -1095204141: // procedure this.getProcedure().add((ProcedureComponent) value); // ProcedureComponent break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; case 159695370: // precedence this.precedence = castToPositiveInt(value); // PositiveIntType break; - case -351767064: // coverage - this.coverage = (CoverageComponent) value; // CoverageComponent + case 73049818: // insurance + this.insurance = (InsuranceComponent) value; // InsuranceComponent break; case -2143202801: // accident this.accident = (AccidentComponent) value; // AccidentComponent @@ -11915,9 +11797,6 @@ public class ExplanationOfBenefit extends DomainResource { case -1148899500: // addItem this.getAddItem().add((AddedItemComponent) value); // AddedItemComponent break; - case -1157130302: // missingTeeth - this.getMissingTeeth().add((MissingTeethComponent) value); // MissingTeethComponent - break; case -577782479: // totalCost this.totalCost = castToMoney(value); // Money break; @@ -11931,7 +11810,7 @@ public class ExplanationOfBenefit extends DomainResource { this.payment = (PaymentComponent) value; // PaymentComponent break; case 3148996: // form - this.form = castToCoding(value); // Coding + this.form = castToCodeableConcept(value); // CodeableConcept break; case 3387378: // note this.getNote().add((NoteComponent) value); // NoteComponent @@ -11950,34 +11829,36 @@ public class ExplanationOfBenefit extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new ExplanationOfBenefitStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("claim")) - this.claim = castToReference(value); // Reference - else if (name.equals("claimResponse")) - this.claimResponse = castToReference(value); // Reference else if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("subType")) - this.getSubType().add(castToCoding(value)); - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType + this.getSubType().add(castToCodeableConcept(value)); + else if (name.equals("patient")) + this.patient = castToReference(value); // Reference else if (name.equals("billablePeriod")) this.billablePeriod = castToPeriod(value); // Period - else if (name.equals("outcome")) - this.outcome = castToCoding(value); // Coding - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("enterer")) + this.enterer = castToReference(value); // Reference + else if (name.equals("insurer")) + this.insurer = castToReference(value); // Reference else if (name.equals("provider")) this.provider = castToReference(value); // Reference else if (name.equals("organization")) this.organization = castToReference(value); // Reference + else if (name.equals("referral")) + this.referral = castToReference(value); // Reference else if (name.equals("facility")) this.facility = castToReference(value); // Reference + else if (name.equals("claim")) + this.claim = castToReference(value); // Reference + else if (name.equals("claimResponse")) + this.claimResponse = castToReference(value); // Reference + else if (name.equals("outcome")) + this.outcome = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType else if (name.equals("related")) this.getRelated().add((RelatedClaimComponent) value); else if (name.equals("prescription")) @@ -11986,20 +11867,18 @@ public class ExplanationOfBenefit extends DomainResource { this.originalPrescription = castToReference(value); // Reference else if (name.equals("payee")) this.payee = (PayeeComponent) value; // PayeeComponent - else if (name.equals("referral")) - this.referral = castToReference(value); // Reference else if (name.equals("information")) - this.getInformation().add((SpecialConditionComponent) value); + this.getInformation().add((SupportingInformationComponent) value); + else if (name.equals("careTeam")) + this.getCareTeam().add((CareTeamComponent) value); else if (name.equals("diagnosis")) this.getDiagnosis().add((DiagnosisComponent) value); else if (name.equals("procedure")) this.getProcedure().add((ProcedureComponent) value); - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference else if (name.equals("precedence")) this.precedence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("coverage")) - this.coverage = (CoverageComponent) value; // CoverageComponent + else if (name.equals("insurance")) + this.insurance = (InsuranceComponent) value; // InsuranceComponent else if (name.equals("accident")) this.accident = (AccidentComponent) value; // AccidentComponent else if (name.equals("employmentImpacted")) @@ -12010,8 +11889,6 @@ public class ExplanationOfBenefit extends DomainResource { this.getItem().add((ItemComponent) value); else if (name.equals("addItem")) this.getAddItem().add((AddedItemComponent) value); - else if (name.equals("missingTeeth")) - this.getMissingTeeth().add((MissingTeethComponent) value); else if (name.equals("totalCost")) this.totalCost = castToMoney(value); // Money else if (name.equals("unallocDeductable")) @@ -12021,7 +11898,7 @@ public class ExplanationOfBenefit extends DomainResource { else if (name.equals("payment")) this.payment = (PaymentComponent) value; // PaymentComponent else if (name.equals("form")) - this.form = castToCoding(value); // Coding + this.form = castToCodeableConcept(value); // CodeableConcept else if (name.equals("note")) this.getNote().add((NoteComponent) value); else if (name.equals("benefitBalance")) @@ -12035,42 +11912,41 @@ public class ExplanationOfBenefit extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1406328437: return getAuthor(); // Reference - case 94742588: return getClaim(); // Reference - case 689513629: return getClaimResponse(); // Reference - case 3575610: return getType(); // Coding - case -1868521062: return addSubType(); // Coding - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 3575610: return getType(); // CodeableConcept + case -1868521062: return addSubType(); // CodeableConcept + case -791418107: return getPatient(); // Reference case -332066046: return getBillablePeriod(); // Period - case -1106507950: return getOutcome(); // Coding - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case -1591951995: return getEnterer(); // Reference + case 1957615864: return getInsurer(); // Reference case -987494927: return getProvider(); // Reference case 1178922291: return getOrganization(); // Reference + case -722568291: return getReferral(); // Reference case 501116579: return getFacility(); // Reference + case 94742588: return getClaim(); // Reference + case 689513629: return getClaimResponse(); // Reference + case -1106507950: return getOutcome(); // CodeableConcept + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType case 1090493483: return addRelated(); // RelatedClaimComponent case 460301338: return getPrescription(); // Reference case -1814015861: return getOriginalPrescription(); // Reference case 106443592: return getPayee(); // PayeeComponent - case -722568291: return getReferral(); // Reference - case 1968600364: return addInformation(); // SpecialConditionComponent + case 1968600364: return addInformation(); // SupportingInformationComponent + case -7323378: return addCareTeam(); // CareTeamComponent case 1196993265: return addDiagnosis(); // DiagnosisComponent case -1095204141: return addProcedure(); // ProcedureComponent - case -791418107: return getPatient(); // Reference case 159695370: throw new FHIRException("Cannot make property precedence as it is not a complex type"); // PositiveIntType - case -351767064: return getCoverage(); // CoverageComponent + case 73049818: return getInsurance(); // InsuranceComponent case -2143202801: return getAccident(); // AccidentComponent case 1051487345: return getEmploymentImpacted(); // Period case 1057894634: return getHospitalization(); // Period case 3242771: return addItem(); // ItemComponent case -1148899500: return addAddItem(); // AddedItemComponent - case -1157130302: return addMissingTeeth(); // MissingTeethComponent case -577782479: return getTotalCost(); // Money case 2096309753: return getUnallocDeductable(); // Money case 332332211: return getTotalBenefit(); // Money case -786681338: return getPayment(); // PaymentComponent - case 3148996: return getForm(); // Coding + case 3148996: return getForm(); // CodeableConcept case 3387378: return addNote(); // NoteComponent case 596003397: return addBenefitBalance(); // BenefitBalanceComponent default: return super.makeProperty(hash, name); @@ -12086,46 +11962,31 @@ public class ExplanationOfBenefit extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.status"); } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("claim")) { - this.claim = new Reference(); - return this.claim; - } - else if (name.equals("claimResponse")) { - this.claimResponse = new Reference(); - return this.claimResponse; - } else if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("subType")) { return addSubType(); } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.created"); + else if (name.equals("patient")) { + this.patient = new Reference(); + return this.patient; } else if (name.equals("billablePeriod")) { this.billablePeriod = new Period(); return this.billablePeriod; } - else if (name.equals("outcome")) { - this.outcome = new Coding(); - return this.outcome; + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.created"); } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.disposition"); + else if (name.equals("enterer")) { + this.enterer = new Reference(); + return this.enterer; + } + else if (name.equals("insurer")) { + this.insurer = new Reference(); + return this.insurer; } else if (name.equals("provider")) { this.provider = new Reference(); @@ -12135,10 +11996,29 @@ public class ExplanationOfBenefit extends DomainResource { this.organization = new Reference(); return this.organization; } + else if (name.equals("referral")) { + this.referral = new Reference(); + return this.referral; + } else if (name.equals("facility")) { this.facility = new Reference(); return this.facility; } + else if (name.equals("claim")) { + this.claim = new Reference(); + return this.claim; + } + else if (name.equals("claimResponse")) { + this.claimResponse = new Reference(); + return this.claimResponse; + } + else if (name.equals("outcome")) { + this.outcome = new CodeableConcept(); + return this.outcome; + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.disposition"); + } else if (name.equals("related")) { return addRelated(); } @@ -12154,29 +12034,24 @@ public class ExplanationOfBenefit extends DomainResource { this.payee = new PayeeComponent(); return this.payee; } - else if (name.equals("referral")) { - this.referral = new Reference(); - return this.referral; - } else if (name.equals("information")) { return addInformation(); } + else if (name.equals("careTeam")) { + return addCareTeam(); + } else if (name.equals("diagnosis")) { return addDiagnosis(); } else if (name.equals("procedure")) { return addProcedure(); } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } else if (name.equals("precedence")) { throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.precedence"); } - else if (name.equals("coverage")) { - this.coverage = new CoverageComponent(); - return this.coverage; + else if (name.equals("insurance")) { + this.insurance = new InsuranceComponent(); + return this.insurance; } else if (name.equals("accident")) { this.accident = new AccidentComponent(); @@ -12196,9 +12071,6 @@ public class ExplanationOfBenefit extends DomainResource { else if (name.equals("addItem")) { return addAddItem(); } - else if (name.equals("missingTeeth")) { - return addMissingTeeth(); - } else if (name.equals("totalCost")) { this.totalCost = new Money(); return this.totalCost; @@ -12216,7 +12088,7 @@ public class ExplanationOfBenefit extends DomainResource { return this.payment; } else if (name.equals("form")) { - this.form = new Coding(); + this.form = new CodeableConcept(); return this.form; } else if (name.equals("note")) { @@ -12243,24 +12115,25 @@ public class ExplanationOfBenefit extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); - dst.author = author == null ? null : author.copy(); - dst.claim = claim == null ? null : claim.copy(); - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); dst.type = type == null ? null : type.copy(); if (subType != null) { - dst.subType = new ArrayList(); - for (Coding i : subType) + dst.subType = new ArrayList(); + for (CodeableConcept i : subType) dst.subType.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.patient = patient == null ? null : patient.copy(); dst.billablePeriod = billablePeriod == null ? null : billablePeriod.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); + dst.created = created == null ? null : created.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.insurer = insurer == null ? null : insurer.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); + dst.referral = referral == null ? null : referral.copy(); dst.facility = facility == null ? null : facility.copy(); + dst.claim = claim == null ? null : claim.copy(); + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); if (related != null) { dst.related = new ArrayList(); for (RelatedClaimComponent i : related) @@ -12269,12 +12142,16 @@ public class ExplanationOfBenefit extends DomainResource { 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 (information != null) { - dst.information = new ArrayList(); - for (SpecialConditionComponent i : information) + dst.information = new ArrayList(); + for (SupportingInformationComponent i : information) dst.information.add(i.copy()); }; + if (careTeam != null) { + dst.careTeam = new ArrayList(); + for (CareTeamComponent i : careTeam) + dst.careTeam.add(i.copy()); + }; if (diagnosis != null) { dst.diagnosis = new ArrayList(); for (DiagnosisComponent i : diagnosis) @@ -12285,9 +12162,8 @@ public class ExplanationOfBenefit extends DomainResource { for (ProcedureComponent i : procedure) dst.procedure.add(i.copy()); }; - dst.patient = patient == null ? null : patient.copy(); dst.precedence = precedence == null ? null : precedence.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); + dst.insurance = insurance == null ? null : insurance.copy(); dst.accident = accident == null ? null : accident.copy(); dst.employmentImpacted = employmentImpacted == null ? null : employmentImpacted.copy(); dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); @@ -12301,11 +12177,6 @@ public class ExplanationOfBenefit extends DomainResource { for (AddedItemComponent i : addItem) dst.addItem.add(i.copy()); }; - if (missingTeeth != null) { - dst.missingTeeth = new ArrayList(); - for (MissingTeethComponent i : missingTeeth) - dst.missingTeeth.add(i.copy()); - }; dst.totalCost = totalCost == null ? null : totalCost.copy(); dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); @@ -12335,18 +12206,17 @@ public class ExplanationOfBenefit extends DomainResource { if (!(other instanceof ExplanationOfBenefit)) return false; ExplanationOfBenefit o = (ExplanationOfBenefit) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(author, o.author, true) - && compareDeep(claim, o.claim, true) && compareDeep(claimResponse, o.claimResponse, true) && compareDeep(type, o.type, true) - && compareDeep(subType, o.subType, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(billablePeriod, o.billablePeriod, true) - && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(provider, o.provider, true) - && compareDeep(organization, o.organization, true) && compareDeep(facility, o.facility, true) && compareDeep(related, o.related, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) + && compareDeep(subType, o.subType, true) && compareDeep(patient, o.patient, true) && compareDeep(billablePeriod, o.billablePeriod, true) + && compareDeep(created, o.created, true) && compareDeep(enterer, o.enterer, true) && compareDeep(insurer, o.insurer, true) + && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) && compareDeep(referral, o.referral, true) + && compareDeep(facility, o.facility, true) && compareDeep(claim, o.claim, true) && compareDeep(claimResponse, o.claimResponse, true) + && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(related, o.related, true) && compareDeep(prescription, o.prescription, true) && compareDeep(originalPrescription, o.originalPrescription, true) - && compareDeep(payee, o.payee, true) && compareDeep(referral, o.referral, true) && compareDeep(information, o.information, true) - && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(patient, o.patient, true) - && compareDeep(precedence, o.precedence, true) && compareDeep(coverage, o.coverage, true) && compareDeep(accident, o.accident, true) - && compareDeep(employmentImpacted, o.employmentImpacted, true) && compareDeep(hospitalization, o.hospitalization, true) - && compareDeep(item, o.item, true) && compareDeep(addItem, o.addItem, true) && compareDeep(missingTeeth, o.missingTeeth, true) + && compareDeep(payee, o.payee, true) && compareDeep(information, o.information, true) && compareDeep(careTeam, o.careTeam, true) + && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(precedence, o.precedence, true) + && compareDeep(insurance, o.insurance, true) && compareDeep(accident, o.accident, true) && compareDeep(employmentImpacted, o.employmentImpacted, true) + && compareDeep(hospitalization, o.hospitalization, true) && compareDeep(item, o.item, true) && compareDeep(addItem, o.addItem, true) && compareDeep(totalCost, o.totalCost, true) && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true) && compareDeep(payment, o.payment, true) && compareDeep(form, o.form, true) && compareDeep(note, o.note, true) && compareDeep(benefitBalance, o.benefitBalance, true); @@ -12364,13 +12234,12 @@ public class ExplanationOfBenefit extends DomainResource { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, author - , claim, claimResponse, type, subType, ruleset, originalRuleset, created, billablePeriod - , outcome, disposition, provider, organization, facility, related, prescription - , originalPrescription, payee, referral, information, diagnosis, procedure, patient - , precedence, coverage, accident, employmentImpacted, hospitalization, item, addItem - , missingTeeth, totalCost, unallocDeductable, totalBenefit, payment, form, note - , benefitBalance); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type + , subType, patient, billablePeriod, created, enterer, insurer, provider, organization + , referral, facility, claim, claimResponse, outcome, disposition, related, prescription + , originalPrescription, payee, information, careTeam, diagnosis, procedure, precedence + , insurance, accident, employmentImpacted, hospitalization, item, addItem, totalCost + , unallocDeductable, totalBenefit, payment, form, note, benefitBalance); } @Override @@ -12378,6 +12247,32 @@ public class ExplanationOfBenefit extends DomainResource { return ResourceType.ExplanationOfBenefit; } + /** + * Search parameter: coverage + *

+ * Description: The plan under which the claim was adjudicated
+ * Type: reference
+ * Path: ExplanationOfBenefit.insurance.coverage
+ *

+ */ + @SearchParamDefinition(name="coverage", path="ExplanationOfBenefit.insurance.coverage", description="The plan under which the claim was adjudicated", type="reference", target={Coverage.class } ) + public static final String SP_COVERAGE = "coverage"; + /** + * Fluent Client search parameter constant for coverage + *

+ * Description: The plan under which the claim was adjudicated
+ * Type: reference
+ * Path: ExplanationOfBenefit.insurance.coverage
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COVERAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COVERAGE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ExplanationOfBenefit:coverage". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_COVERAGE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:coverage").toLocked(); + /** * Search parameter: identifier *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Extension.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Extension.java index 403293a08d0..f92233fcc93 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Extension.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Extension.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/FamilyMemberHistory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/FamilyMemberHistory.java index aac48bac20c..56f763e2e32 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/FamilyMemberHistory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/FamilyMemberHistory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Flag.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Flag.java index 0c9d8079dd7..233a26e87a9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Flag.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Flag.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Goal.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Goal.java index 0ee967bd809..dc95fcccda0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Goal.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Goal.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Group.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Group.java index d0496e64376..76f088981ab 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Group.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Group.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -1579,7 +1579,7 @@ public class Group extends DomainResource { * Path:
*

*/ - @SearchParamDefinition(name="characteristic-value", path="", description="A composite of both characteristic and value", type="composite", compositeOf={"characteristic", "value"} ) + @SearchParamDefinition(name="characteristic-value", path="Group.characteristic", description="A composite of both characteristic and value", type="composite", compositeOf={"characteristic", "value"} ) public static final String SP_CHARACTERISTIC_VALUE = "characteristic-value"; /** * Fluent Client search parameter constant for characteristic-value diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/GuidanceResponse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/GuidanceResponse.java index c3f6c9a6e8d..bbfbd2c7d13 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/GuidanceResponse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/GuidanceResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -304,14 +304,14 @@ public class GuidanceResponse extends DomainResource { /** * The actions, if any, produced by the evaluation of the artifact. */ - @Child(name = "requestGroup", type = {RequestGroup.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "result", type = {CarePlan.class, RequestGroup.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Proposed actions, if any", formalDefinition="The actions, if any, produced by the evaluation of the artifact." ) - protected Reference requestGroup; + protected Reference result; /** * The actual object that is the target of the reference (The actions, if any, produced by the evaluation of the artifact.) */ - protected RequestGroup requestGroupTarget; + protected Resource resultTarget; /** * If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data. @@ -320,7 +320,7 @@ public class GuidanceResponse extends DomainResource { @Description(shortDefinition="Additional required data", formalDefinition="If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data." ) protected List dataRequirement; - private static final long serialVersionUID = 1805393200L; + private static final long serialVersionUID = -2107029772L; /** * Constructor @@ -889,46 +889,41 @@ public class GuidanceResponse extends DomainResource { } /** - * @return {@link #requestGroup} (The actions, if any, produced by the evaluation of the artifact.) + * @return {@link #result} (The actions, if any, produced by the evaluation of the artifact.) */ - public Reference getRequestGroup() { - if (this.requestGroup == null) + public Reference getResult() { + if (this.result == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponse.requestGroup"); + throw new Error("Attempt to auto-create GuidanceResponse.result"); else if (Configuration.doAutoCreate()) - this.requestGroup = new Reference(); // cc - return this.requestGroup; + this.result = new Reference(); // cc + return this.result; } - public boolean hasRequestGroup() { - return this.requestGroup != null && !this.requestGroup.isEmpty(); + public boolean hasResult() { + return this.result != null && !this.result.isEmpty(); } /** - * @param value {@link #requestGroup} (The actions, if any, produced by the evaluation of the artifact.) + * @param value {@link #result} (The actions, if any, produced by the evaluation of the artifact.) */ - public GuidanceResponse setRequestGroup(Reference value) { - this.requestGroup = value; + public GuidanceResponse setResult(Reference value) { + this.result = value; return this; } /** - * @return {@link #requestGroup} 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 actions, if any, produced by the evaluation of the artifact.) + * @return {@link #result} 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 actions, if any, produced by the evaluation of the artifact.) */ - public RequestGroup getRequestGroupTarget() { - if (this.requestGroupTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponse.requestGroup"); - else if (Configuration.doAutoCreate()) - this.requestGroupTarget = new RequestGroup(); // aa - return this.requestGroupTarget; + public Resource getResultTarget() { + return this.resultTarget; } /** - * @param value {@link #requestGroup} 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 actions, if any, produced by the evaluation of the artifact.) + * @param value {@link #result} 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 actions, if any, produced by the evaluation of the artifact.) */ - public GuidanceResponse setRequestGroupTarget(RequestGroup value) { - this.requestGroupTarget = value; + public GuidanceResponse setResultTarget(Resource value) { + this.resultTarget = value; return this; } @@ -999,7 +994,7 @@ public class GuidanceResponse extends DomainResource { childrenList.add(new Property("note", "Annotation", "Provides a mechanism to communicate additional information about the response.", 0, java.lang.Integer.MAX_VALUE, note)); childrenList.add(new Property("evaluationMessage", "Reference(OperationOutcome)", "Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.", 0, java.lang.Integer.MAX_VALUE, evaluationMessage)); childrenList.add(new Property("outputParameters", "Reference(Parameters)", "The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.", 0, java.lang.Integer.MAX_VALUE, outputParameters)); - childrenList.add(new Property("requestGroup", "Reference(RequestGroup)", "The actions, if any, produced by the evaluation of the artifact.", 0, java.lang.Integer.MAX_VALUE, requestGroup)); + childrenList.add(new Property("result", "Reference(CarePlan|RequestGroup)", "The actions, if any, produced by the evaluation of the artifact.", 0, java.lang.Integer.MAX_VALUE, result)); childrenList.add(new Property("dataRequirement", "DataRequirement", "If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.", 0, java.lang.Integer.MAX_VALUE, dataRequirement)); } @@ -1018,7 +1013,7 @@ public class GuidanceResponse extends DomainResource { case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation case 1081619755: /*evaluationMessage*/ return this.evaluationMessage == null ? new Base[0] : this.evaluationMessage.toArray(new Base[this.evaluationMessage.size()]); // Reference case 525609419: /*outputParameters*/ return this.outputParameters == null ? new Base[0] : new Base[] {this.outputParameters}; // Reference - case 1281054000: /*requestGroup*/ return this.requestGroup == null ? new Base[0] : new Base[] {this.requestGroup}; // Reference + case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Reference case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement default: return super.getProperty(hash, name, checkValid); } @@ -1064,8 +1059,8 @@ public class GuidanceResponse extends DomainResource { case 525609419: // outputParameters this.outputParameters = castToReference(value); // Reference break; - case 1281054000: // requestGroup - this.requestGroup = castToReference(value); // Reference + case -934426595: // result + this.result = castToReference(value); // Reference break; case 629147193: // dataRequirement this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement @@ -1101,8 +1096,8 @@ public class GuidanceResponse extends DomainResource { this.getEvaluationMessage().add(castToReference(value)); else if (name.equals("outputParameters")) this.outputParameters = castToReference(value); // Reference - else if (name.equals("requestGroup")) - this.requestGroup = castToReference(value); // Reference + else if (name.equals("result")) + this.result = castToReference(value); // Reference else if (name.equals("dataRequirement")) this.getDataRequirement().add(castToDataRequirement(value)); else @@ -1124,7 +1119,7 @@ public class GuidanceResponse extends DomainResource { case 3387378: return addNote(); // Annotation case 1081619755: return addEvaluationMessage(); // Reference case 525609419: return getOutputParameters(); // Reference - case 1281054000: return getRequestGroup(); // Reference + case -934426595: return getResult(); // Reference case 629147193: return addDataRequirement(); // DataRequirement default: return super.makeProperty(hash, name); } @@ -1180,9 +1175,9 @@ public class GuidanceResponse extends DomainResource { this.outputParameters = new Reference(); return this.outputParameters; } - else if (name.equals("requestGroup")) { - this.requestGroup = new Reference(); - return this.requestGroup; + else if (name.equals("result")) { + this.result = new Reference(); + return this.result; } else if (name.equals("dataRequirement")) { return addDataRequirement(); @@ -1219,7 +1214,7 @@ public class GuidanceResponse extends DomainResource { dst.evaluationMessage.add(i.copy()); }; dst.outputParameters = outputParameters == null ? null : outputParameters.copy(); - dst.requestGroup = requestGroup == null ? null : requestGroup.copy(); + dst.result = result == null ? null : result.copy(); if (dataRequirement != null) { dst.dataRequirement = new ArrayList(); for (DataRequirement i : dataRequirement) @@ -1244,7 +1239,7 @@ public class GuidanceResponse extends DomainResource { && compareDeep(context, o.context, true) && compareDeep(occurrenceDateTime, o.occurrenceDateTime, true) && compareDeep(performer, o.performer, true) && compareDeep(reason, o.reason, true) && compareDeep(note, o.note, true) && compareDeep(evaluationMessage, o.evaluationMessage, true) && compareDeep(outputParameters, o.outputParameters, true) - && compareDeep(requestGroup, o.requestGroup, true) && compareDeep(dataRequirement, o.dataRequirement, true) + && compareDeep(result, o.result, true) && compareDeep(dataRequirement, o.dataRequirement, true) ; } @@ -1262,7 +1257,7 @@ public class GuidanceResponse extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(requestId, identifier, module , status, subject, context, occurrenceDateTime, performer, reason, note, evaluationMessage - , outputParameters, requestGroup, dataRequirement); + , outputParameters, result, dataRequirement); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/HealthcareService.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/HealthcareService.java index 27ed00ed5b4..74ef58490be 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/HealthcareService.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/HealthcareService.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -986,7 +986,19 @@ public class HealthcareService extends DomainResource { @Description(shortDefinition="Description of availability exceptions", formalDefinition="A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times." ) protected StringType availabilityExceptions; - private static final long serialVersionUID = 250295170L; + /** + * Technical endpoints providing access to services operated for the specific healthcare services defined at this resource. + */ + @Child(name = "endpoint", type = {Endpoint.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Technical endpoints providing access to services operated for the location", formalDefinition="Technical endpoints providing access to services operated for the specific healthcare services defined at this resource." ) + protected List endpoint; + /** + * The actual objects that are the target of the reference (Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.) + */ + protected List endpointTarget; + + + private static final long serialVersionUID = -57560049L; /** * Constructor @@ -2183,6 +2195,81 @@ public class HealthcareService extends DomainResource { return this; } + /** + * @return {@link #endpoint} (Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.) + */ + public List getEndpoint() { + if (this.endpoint == null) + this.endpoint = new ArrayList(); + return this.endpoint; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public HealthcareService setEndpoint(List theEndpoint) { + this.endpoint = theEndpoint; + return this; + } + + public boolean hasEndpoint() { + if (this.endpoint == null) + return false; + for (Reference item : this.endpoint) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addEndpoint() { //3 + Reference t = new Reference(); + if (this.endpoint == null) + this.endpoint = new ArrayList(); + this.endpoint.add(t); + return t; + } + + public HealthcareService addEndpoint(Reference t) { //3 + if (t == null) + return this; + if (this.endpoint == null) + this.endpoint = new ArrayList(); + this.endpoint.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist + */ + public Reference getEndpointFirstRep() { + if (getEndpoint().isEmpty()) { + addEndpoint(); + } + return getEndpoint().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getEndpointTarget() { + if (this.endpointTarget == null) + this.endpointTarget = new ArrayList(); + return this.endpointTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public Endpoint addEndpointTarget() { + Endpoint r = new Endpoint(); + if (this.endpointTarget == null) + this.endpointTarget = new ArrayList(); + this.endpointTarget.add(r); + return r; + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "External identifiers for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); @@ -2209,6 +2296,7 @@ public class HealthcareService extends DomainResource { childrenList.add(new Property("availableTime", "", "A collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); childrenList.add(new Property("notAvailable", "", "The HealthcareService is not available during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable)); childrenList.add(new Property("availabilityExceptions", "string", "A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); + childrenList.add(new Property("endpoint", "Reference(Endpoint)", "Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.", 0, java.lang.Integer.MAX_VALUE, endpoint)); } @Override @@ -2238,6 +2326,7 @@ public class HealthcareService extends DomainResource { case 1873069366: /*availableTime*/ return this.availableTime == null ? new Base[0] : this.availableTime.toArray(new Base[this.availableTime.size()]); // HealthcareServiceAvailableTimeComponent case -629572298: /*notAvailable*/ return this.notAvailable == null ? new Base[0] : this.notAvailable.toArray(new Base[this.notAvailable.size()]); // HealthcareServiceNotAvailableComponent case -1149143617: /*availabilityExceptions*/ return this.availabilityExceptions == null ? new Base[0] : new Base[] {this.availabilityExceptions}; // StringType + case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference default: return super.getProperty(hash, name, checkValid); } @@ -2318,6 +2407,9 @@ public class HealthcareService extends DomainResource { case -1149143617: // availabilityExceptions this.availabilityExceptions = castToString(value); // StringType break; + case 1741102485: // endpoint + this.getEndpoint().add(castToReference(value)); // Reference + break; default: super.setProperty(hash, name, value); } @@ -2373,6 +2465,8 @@ public class HealthcareService extends DomainResource { this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value); else if (name.equals("availabilityExceptions")) this.availabilityExceptions = castToString(value); // StringType + else if (name.equals("endpoint")) + this.getEndpoint().add(castToReference(value)); else super.setProperty(name, value); } @@ -2404,6 +2498,7 @@ public class HealthcareService extends DomainResource { case 1873069366: return addAvailableTime(); // HealthcareServiceAvailableTimeComponent case -629572298: return addNotAvailable(); // HealthcareServiceNotAvailableComponent case -1149143617: throw new FHIRException("Cannot make property availabilityExceptions as it is not a complex type"); // StringType + case 1741102485: return addEndpoint(); // Reference default: return super.makeProperty(hash, name); } @@ -2487,6 +2582,9 @@ public class HealthcareService extends DomainResource { else if (name.equals("availabilityExceptions")) { throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.availabilityExceptions"); } + else if (name.equals("endpoint")) { + return addEndpoint(); + } else return super.addChild(name); } @@ -2571,6 +2669,11 @@ public class HealthcareService extends DomainResource { dst.notAvailable.add(i.copy()); }; dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); + if (endpoint != null) { + dst.endpoint = new ArrayList(); + for (Reference i : endpoint) + dst.endpoint.add(i.copy()); + }; return dst; } @@ -2595,7 +2698,7 @@ public class HealthcareService extends DomainResource { && compareDeep(referralMethod, o.referralMethod, true) && compareDeep(publicKey, o.publicKey, true) && compareDeep(appointmentRequired, o.appointmentRequired, true) && compareDeep(availableTime, o.availableTime, true) && compareDeep(notAvailable, o.notAvailable, true) && compareDeep(availabilityExceptions, o.availabilityExceptions, true) - ; + && compareDeep(endpoint, o.endpoint, true); } @Override @@ -2616,7 +2719,7 @@ public class HealthcareService extends DomainResource { , serviceCategory, serviceType, specialty, location, serviceName, comment, extraDetails , photo, telecom, coverageArea, serviceProvisionCode, eligibility, eligibilityNote , programName, characteristic, referralMethod, publicKey, appointmentRequired, availableTime - , notAvailable, availabilityExceptions); + , notAvailable, availabilityExceptions, endpoint); } @Override @@ -2684,6 +2787,32 @@ public class HealthcareService extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICETYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICETYPE); + /** + * Search parameter: endpoint + *

+ * Description: Technical endpoints providing access to services operated for the location
+ * Type: reference
+ * Path: HealthcareService.endpoint
+ *

+ */ + @SearchParamDefinition(name="endpoint", path="HealthcareService.endpoint", description="Technical endpoints providing access to services operated for the location", type="reference", target={Endpoint.class } ) + public static final String SP_ENDPOINT = "endpoint"; + /** + * Fluent Client search parameter constant for endpoint + *

+ * Description: Technical endpoints providing access to services operated for the location
+ * Type: reference
+ * Path: HealthcareService.endpoint
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENDPOINT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "HealthcareService:endpoint". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include("HealthcareService:endpoint").toLocked(); + /** * Search parameter: organization *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/HumanName.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/HumanName.java index 843e5b509a6..338987f0a80 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/HumanName.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/HumanName.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -73,7 +73,7 @@ public class HumanName extends Type implements ICompositeType { */ OLD, /** - * A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically. + * A name used prior to changing name because of marriage. This name use is for use by applications that collect and store names that were used prior to a marriage. Marriage naming customs vary greatly around the world, and are constantly changing. This term is not gender specific. The use of this term does not imply any particular history for a person's name */ MAIDEN, /** @@ -134,7 +134,7 @@ public class HumanName extends Type implements ICompositeType { case NICKNAME: return "A name that is used to address the person in an informal manner, but is not part of their formal or usual name"; case ANONYMOUS: return "Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons)"; case OLD: return "This name is no longer in use (or was never correct, but retained for records)"; - case MAIDEN: return "A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store \"maiden\" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically."; + case MAIDEN: return "A name used prior to changing name because of marriage. This name use is for use by applications that collect and store names that were used prior to a marriage. Marriage naming customs vary greatly around the world, and are constantly changing. This term is not gender specific. The use of this term does not imply any particular history for a person's name"; default: return "?"; } } @@ -146,7 +146,7 @@ public class HumanName extends Type implements ICompositeType { case NICKNAME: return "Nickname"; case ANONYMOUS: return "Anonymous"; case OLD: return "Old"; - case MAIDEN: return "Maiden"; + case MAIDEN: return "Name changed for Marriage"; default: return "?"; } } @@ -235,9 +235,9 @@ public class HumanName extends Type implements ICompositeType { /** * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. */ - @Child(name = "family", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "family", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Family name (often called 'Surname')", formalDefinition="The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father." ) - protected List family; + protected StringType family; /** * Given name. @@ -267,7 +267,7 @@ public class HumanName extends Type implements ICompositeType { @Description(shortDefinition="Time period when name was/is in use", formalDefinition="Indicates the period of time when this name was valid for the named person." ) protected Period period; - private static final long serialVersionUID = -210174642L; + private static final long serialVersionUID = -507469160L; /** * Constructor @@ -375,64 +375,52 @@ public class HumanName extends Type implements ICompositeType { } /** - * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.). This is the underlying object with id, value and extensions. The accessor "getFamily" gives direct access to the value */ - public List getFamily() { + public StringType getFamilyElement() { if (this.family == null) - this.family = new ArrayList(); + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.family"); + else if (Configuration.doAutoCreate()) + this.family = new StringType(); // bb return this.family; } - /** - * @return Returns a reference to this for easy method chaining - */ - public HumanName setFamily(List theFamily) { - this.family = theFamily; - return this; + public boolean hasFamilyElement() { + return this.family != null && !this.family.isEmpty(); } public boolean hasFamily() { - if (this.family == null) - return false; - for (StringType item : this.family) - if (!item.isEmpty()) - return true; - return false; + return this.family != null && !this.family.isEmpty(); } /** - * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.). This is the underlying object with id, value and extensions. The accessor "getFamily" gives direct access to the value */ - public StringType addFamilyElement() {//2 - StringType t = new StringType(); - if (this.family == null) - this.family = new ArrayList(); - this.family.add(t); - return t; - } - - /** - * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public HumanName addFamily(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.family == null) - this.family = new ArrayList(); - this.family.add(t); + public HumanName setFamilyElement(StringType value) { + this.family = value; return this; } /** - * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + * @return The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. */ - public boolean hasFamily(String value) { - if (this.family == null) - return false; - for (StringType v : this.family) - if (v.equals(value)) // string - return true; - return false; + public String getFamily() { + return this.family == null ? null : this.family.getValue(); + } + + /** + * @param value The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. + */ + public HumanName setFamily(String value) { + if (Utilities.noString(value)) + this.family = null; + else { + if (this.family == null) + this.family = new StringType(); + this.family.setValue(value); + } + return this; } /** @@ -643,14 +631,6 @@ public class HumanName extends Type implements ICompositeType { } /** - * Returns all repetitions of {@link #getFamily() family name} as a space separated string - * - * @see DatatypeUtil#joinStringsSpaceSeparated(List) - */ - public String getFamilyAsSingleString() { - return joinStringsSpaceSeparated(getFamily()); - } - /** * Returns all repetitions of {@link #getGiven() given name} as a space separated string * @@ -689,7 +669,7 @@ public class HumanName extends Type implements ICompositeType { List nameParts = new ArrayList(); nameParts.addAll(getPrefix()); nameParts.addAll(getGiven()); - nameParts.addAll(getFamily()); + nameParts.add(getFamilyElement()); nameParts.addAll(getSuffix()); if (nameParts.size() > 0) { return joinStringsSpaceSeparated(nameParts); @@ -732,7 +712,7 @@ public class HumanName extends Type implements ICompositeType { switch (hash) { case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case -1281860764: /*family*/ return this.family == null ? new Base[0] : this.family.toArray(new Base[this.family.size()]); // StringType + case -1281860764: /*family*/ return this.family == null ? new Base[0] : new Base[] {this.family}; // StringType case 98367357: /*given*/ return this.given == null ? new Base[0] : this.given.toArray(new Base[this.given.size()]); // StringType case -980110702: /*prefix*/ return this.prefix == null ? new Base[0] : this.prefix.toArray(new Base[this.prefix.size()]); // StringType case -891422895: /*suffix*/ return this.suffix == null ? new Base[0] : this.suffix.toArray(new Base[this.suffix.size()]); // StringType @@ -752,7 +732,7 @@ public class HumanName extends Type implements ICompositeType { this.text = castToString(value); // StringType break; case -1281860764: // family - this.getFamily().add(castToString(value)); // StringType + this.family = castToString(value); // StringType break; case 98367357: // given this.getGiven().add(castToString(value)); // StringType @@ -778,7 +758,7 @@ public class HumanName extends Type implements ICompositeType { else if (name.equals("text")) this.text = castToString(value); // StringType else if (name.equals("family")) - this.getFamily().add(castToString(value)); + this.family = castToString(value); // StringType else if (name.equals("given")) this.getGiven().add(castToString(value)); else if (name.equals("prefix")) @@ -844,11 +824,7 @@ public class HumanName extends Type implements ICompositeType { copyValues(dst); dst.use = use == null ? null : use.copy(); dst.text = text == null ? null : text.copy(); - if (family != null) { - dst.family = new ArrayList(); - for (StringType i : family) - dst.family.add(i.copy()); - }; + dst.family = family == null ? null : family.copy(); if (given != null) { dst.given = new ArrayList(); for (StringType i : given) diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Identifier.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Identifier.java index 04d1bd2c855..de4f7053b73 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Identifier.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Identifier.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImagingManifest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImagingManifest.java index f55db516a59..62d0d192ed0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImagingManifest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImagingManifest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImagingStudy.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImagingStudy.java index 95d79b4fbe0..98db2181db1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImagingStudy.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImagingStudy.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Immunization.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Immunization.java index d124338eab5..3a0149d7c5d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Immunization.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Immunization.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -1322,16 +1322,24 @@ public class Immunization extends DomainResource { protected BooleanType wasNotGiven; /** - * True if this administration was reported rather than directly administered. + * An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded. */ - @Child(name = "reported", type = {BooleanType.class}, order=6, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Indicates a self-reported record", formalDefinition="True if this administration was reported rather than directly administered." ) - protected BooleanType reported; + @Child(name = "primarySource", type = {BooleanType.class}, order=6, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Indicates context the data was recorded in", formalDefinition="An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded." ) + protected BooleanType primarySource; + + /** + * The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine. + */ + @Child(name = "reportOrigin", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Indicates the source of a secondarily reported record", formalDefinition="The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-origin") + protected CodeableConcept reportOrigin; /** * Clinician who administered the vaccine. */ - @Child(name = "performer", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "performer", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Who administered vaccine", formalDefinition="Clinician who administered the vaccine." ) protected Reference performer; @@ -1343,7 +1351,7 @@ public class Immunization extends DomainResource { /** * Clinician who ordered the vaccination. */ - @Child(name = "requester", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Child(name = "requester", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Who ordered vaccination", formalDefinition="Clinician who ordered the vaccination." ) protected Reference requester; @@ -1355,7 +1363,7 @@ public class Immunization extends DomainResource { /** * The visit or admission or other contact between patient and health care provider the immunization was performed as part of. */ - @Child(name = "encounter", type = {Encounter.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "encounter", type = {Encounter.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission or other contact between patient and health care provider the immunization was performed as part of." ) protected Reference encounter; @@ -1367,7 +1375,7 @@ public class Immunization extends DomainResource { /** * Name of vaccine manufacturer. */ - @Child(name = "manufacturer", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "manufacturer", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Vaccine manufacturer", formalDefinition="Name of vaccine manufacturer." ) protected Reference manufacturer; @@ -1379,7 +1387,7 @@ public class Immunization extends DomainResource { /** * The service delivery location where the vaccine administration occurred. */ - @Child(name = "location", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "location", type = {Location.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Where vaccination occurred", formalDefinition="The service delivery location where the vaccine administration occurred." ) protected Reference location; @@ -1391,21 +1399,21 @@ public class Immunization extends DomainResource { /** * Lot number of the vaccine product. */ - @Child(name = "lotNumber", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "lotNumber", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Vaccine lot number", formalDefinition="Lot number of the vaccine product." ) protected StringType lotNumber; /** * Date vaccine batch expires. */ - @Child(name = "expirationDate", type = {DateType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "expirationDate", type = {DateType.class}, order=14, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Vaccine expiration date", formalDefinition="Date vaccine batch expires." ) protected DateType expirationDate; /** * Body site where vaccine was administered. */ - @Child(name = "site", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Child(name = "site", type = {CodeableConcept.class}, order=15, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Body site vaccine was administered", formalDefinition="Body site where vaccine was administered." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-site") protected CodeableConcept site; @@ -1413,7 +1421,7 @@ public class Immunization extends DomainResource { /** * The path by which the vaccine product is taken into the body. */ - @Child(name = "route", type = {CodeableConcept.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "route", type = {CodeableConcept.class}, order=16, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="How vaccine entered body", formalDefinition="The path by which the vaccine product is taken into the body." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-route") protected CodeableConcept route; @@ -1421,39 +1429,39 @@ public class Immunization extends DomainResource { /** * The quantity of vaccine product that was administered. */ - @Child(name = "doseQuantity", type = {SimpleQuantity.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Child(name = "doseQuantity", type = {SimpleQuantity.class}, order=17, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Amount of vaccine administered", formalDefinition="The quantity of vaccine product that was administered." ) protected SimpleQuantity doseQuantity; /** * Extra information about the immunization that is not conveyed by the other attributes. */ - @Child(name = "note", type = {Annotation.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "note", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Vaccination notes", formalDefinition="Extra information about the immunization that is not conveyed by the other attributes." ) protected List note; /** * Reasons why a vaccine was or was not administered. */ - @Child(name = "explanation", type = {}, order=18, min=0, max=1, modifier=false, summary=false) + @Child(name = "explanation", type = {}, order=19, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Administration/non-administration reasons", formalDefinition="Reasons why a vaccine was or was not administered." ) protected ImmunizationExplanationComponent explanation; /** * Categorical data indicating that an adverse event is associated in time to an immunization. */ - @Child(name = "reaction", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "reaction", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Details of a reaction that follows immunization", formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization." ) protected List reaction; /** * Contains information about the protocol(s) under which the vaccine was administered. */ - @Child(name = "vaccinationProtocol", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "vaccinationProtocol", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="What protocol was followed", formalDefinition="Contains information about the protocol(s) under which the vaccine was administered." ) protected List vaccinationProtocol; - private static final long serialVersionUID = -1984038638L; + private static final long serialVersionUID = -526769563L; /** * Constructor @@ -1465,13 +1473,13 @@ public class Immunization extends DomainResource { /** * Constructor */ - public Immunization(Enumeration status, CodeableConcept vaccineCode, Reference patient, BooleanType wasNotGiven, BooleanType reported) { + public Immunization(Enumeration status, CodeableConcept vaccineCode, Reference patient, BooleanType wasNotGiven, BooleanType primarySource) { super(); this.status = status; this.vaccineCode = vaccineCode; this.patient = patient; this.wasNotGiven = wasNotGiven; - this.reported = reported; + this.primarySource = primarySource; } /** @@ -1735,47 +1743,71 @@ public class Immunization extends DomainResource { } /** - * @return {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + * @return {@link #primarySource} (An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.). This is the underlying object with id, value and extensions. The accessor "getPrimarySource" gives direct access to the value */ - public BooleanType getReportedElement() { - if (this.reported == null) + public BooleanType getPrimarySourceElement() { + if (this.primarySource == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.reported"); + throw new Error("Attempt to auto-create Immunization.primarySource"); else if (Configuration.doAutoCreate()) - this.reported = new BooleanType(); // bb - return this.reported; + this.primarySource = new BooleanType(); // bb + return this.primarySource; } - public boolean hasReportedElement() { - return this.reported != null && !this.reported.isEmpty(); + public boolean hasPrimarySourceElement() { + return this.primarySource != null && !this.primarySource.isEmpty(); } - public boolean hasReported() { - return this.reported != null && !this.reported.isEmpty(); + public boolean hasPrimarySource() { + return this.primarySource != null && !this.primarySource.isEmpty(); } /** - * @param value {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + * @param value {@link #primarySource} (An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.). This is the underlying object with id, value and extensions. The accessor "getPrimarySource" gives direct access to the value */ - public Immunization setReportedElement(BooleanType value) { - this.reported = value; + public Immunization setPrimarySourceElement(BooleanType value) { + this.primarySource = value; return this; } /** - * @return True if this administration was reported rather than directly administered. + * @return An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded. */ - public boolean getReported() { - return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); + public boolean getPrimarySource() { + return this.primarySource == null || this.primarySource.isEmpty() ? false : this.primarySource.getValue(); } /** - * @param value True if this administration was reported rather than directly administered. + * @param value An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded. */ - public Immunization setReported(boolean value) { - if (this.reported == null) - this.reported = new BooleanType(); - this.reported.setValue(value); + public Immunization setPrimarySource(boolean value) { + if (this.primarySource == null) + this.primarySource = new BooleanType(); + this.primarySource.setValue(value); + return this; + } + + /** + * @return {@link #reportOrigin} (The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.) + */ + public CodeableConcept getReportOrigin() { + if (this.reportOrigin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.reportOrigin"); + else if (Configuration.doAutoCreate()) + this.reportOrigin = new CodeableConcept(); // cc + return this.reportOrigin; + } + + public boolean hasReportOrigin() { + return this.reportOrigin != null && !this.reportOrigin.isEmpty(); + } + + /** + * @param value {@link #reportOrigin} (The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.) + */ + public Immunization setReportOrigin(CodeableConcept value) { + this.reportOrigin = value; return this; } @@ -2360,7 +2392,8 @@ public class Immunization extends DomainResource { childrenList.add(new Property("vaccineCode", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, vaccineCode)); childrenList.add(new Property("patient", "Reference(Patient)", "The patient who either received or did not receive the immunization.", 0, java.lang.Integer.MAX_VALUE, patient)); childrenList.add(new Property("wasNotGiven", "boolean", "Indicates if the vaccination was or was not given.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); - childrenList.add(new Property("reported", "boolean", "True if this administration was reported rather than directly administered.", 0, java.lang.Integer.MAX_VALUE, reported)); + childrenList.add(new Property("primarySource", "boolean", "An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.", 0, java.lang.Integer.MAX_VALUE, primarySource)); + childrenList.add(new Property("reportOrigin", "CodeableConcept", "The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.", 0, java.lang.Integer.MAX_VALUE, reportOrigin)); childrenList.add(new Property("performer", "Reference(Practitioner)", "Clinician who administered the vaccine.", 0, java.lang.Integer.MAX_VALUE, performer)); childrenList.add(new Property("requester", "Reference(Practitioner)", "Clinician who ordered the vaccination.", 0, java.lang.Integer.MAX_VALUE, requester)); childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission or other contact between patient and health care provider the immunization was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); @@ -2386,7 +2419,8 @@ public class Immunization extends DomainResource { case 664556354: /*vaccineCode*/ return this.vaccineCode == null ? new Base[0] : new Base[] {this.vaccineCode}; // CodeableConcept case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference case -1050911117: /*wasNotGiven*/ return this.wasNotGiven == null ? new Base[0] : new Base[] {this.wasNotGiven}; // BooleanType - case -427039533: /*reported*/ return this.reported == null ? new Base[0] : new Base[] {this.reported}; // BooleanType + case -528721731: /*primarySource*/ return this.primarySource == null ? new Base[0] : new Base[] {this.primarySource}; // BooleanType + case 486750586: /*reportOrigin*/ return this.reportOrigin == null ? new Base[0] : new Base[] {this.reportOrigin}; // CodeableConcept case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference @@ -2427,8 +2461,11 @@ public class Immunization extends DomainResource { case -1050911117: // wasNotGiven this.wasNotGiven = castToBoolean(value); // BooleanType break; - case -427039533: // reported - this.reported = castToBoolean(value); // BooleanType + case -528721731: // primarySource + this.primarySource = castToBoolean(value); // BooleanType + break; + case 486750586: // reportOrigin + this.reportOrigin = castToCodeableConcept(value); // CodeableConcept break; case 481140686: // performer this.performer = castToReference(value); // Reference @@ -2491,8 +2528,10 @@ public class Immunization extends DomainResource { this.patient = castToReference(value); // Reference else if (name.equals("wasNotGiven")) this.wasNotGiven = castToBoolean(value); // BooleanType - else if (name.equals("reported")) - this.reported = castToBoolean(value); // BooleanType + else if (name.equals("primarySource")) + this.primarySource = castToBoolean(value); // BooleanType + else if (name.equals("reportOrigin")) + this.reportOrigin = castToCodeableConcept(value); // CodeableConcept else if (name.equals("performer")) this.performer = castToReference(value); // Reference else if (name.equals("requester")) @@ -2534,7 +2573,8 @@ public class Immunization extends DomainResource { case 664556354: return getVaccineCode(); // CodeableConcept case -791418107: return getPatient(); // Reference case -1050911117: throw new FHIRException("Cannot make property wasNotGiven as it is not a complex type"); // BooleanType - case -427039533: throw new FHIRException("Cannot make property reported as it is not a complex type"); // BooleanType + case -528721731: throw new FHIRException("Cannot make property primarySource as it is not a complex type"); // BooleanType + case 486750586: return getReportOrigin(); // CodeableConcept case 481140686: return getPerformer(); // Reference case 693933948: return getRequester(); // Reference case 1524132147: return getEncounter(); // Reference @@ -2576,8 +2616,12 @@ public class Immunization extends DomainResource { else if (name.equals("wasNotGiven")) { throw new FHIRException("Cannot call addChild on a primitive type Immunization.wasNotGiven"); } - else if (name.equals("reported")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.reported"); + else if (name.equals("primarySource")) { + throw new FHIRException("Cannot call addChild on a primitive type Immunization.primarySource"); + } + else if (name.equals("reportOrigin")) { + this.reportOrigin = new CodeableConcept(); + return this.reportOrigin; } else if (name.equals("performer")) { this.performer = new Reference(); @@ -2652,7 +2696,8 @@ public class Immunization extends DomainResource { dst.vaccineCode = vaccineCode == null ? null : vaccineCode.copy(); dst.patient = patient == null ? null : patient.copy(); dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); - dst.reported = reported == null ? null : reported.copy(); + dst.primarySource = primarySource == null ? null : primarySource.copy(); + dst.reportOrigin = reportOrigin == null ? null : reportOrigin.copy(); dst.performer = performer == null ? null : performer.copy(); dst.requester = requester == null ? null : requester.copy(); dst.encounter = encounter == null ? null : encounter.copy(); @@ -2695,12 +2740,13 @@ public class Immunization extends DomainResource { Immunization o = (Immunization) other; return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) && compareDeep(vaccineCode, o.vaccineCode, true) && compareDeep(patient, o.patient, true) && compareDeep(wasNotGiven, o.wasNotGiven, true) - && compareDeep(reported, o.reported, true) && compareDeep(performer, o.performer, true) && compareDeep(requester, o.requester, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(manufacturer, o.manufacturer, true) - && compareDeep(location, o.location, true) && compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true) - && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) && compareDeep(doseQuantity, o.doseQuantity, true) - && compareDeep(note, o.note, true) && compareDeep(explanation, o.explanation, true) && compareDeep(reaction, o.reaction, true) - && compareDeep(vaccinationProtocol, o.vaccinationProtocol, true); + && compareDeep(primarySource, o.primarySource, true) && compareDeep(reportOrigin, o.reportOrigin, true) + && compareDeep(performer, o.performer, true) && compareDeep(requester, o.requester, true) && compareDeep(encounter, o.encounter, true) + && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(location, o.location, true) && compareDeep(lotNumber, o.lotNumber, true) + && compareDeep(expirationDate, o.expirationDate, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) + && compareDeep(doseQuantity, o.doseQuantity, true) && compareDeep(note, o.note, true) && compareDeep(explanation, o.explanation, true) + && compareDeep(reaction, o.reaction, true) && compareDeep(vaccinationProtocol, o.vaccinationProtocol, true) + ; } @Override @@ -2711,14 +2757,14 @@ public class Immunization extends DomainResource { return false; Immunization o = (Immunization) other; return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(wasNotGiven, o.wasNotGiven, true) - && compareValues(reported, o.reported, true) && compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) - ; + && compareValues(primarySource, o.primarySource, true) && compareValues(lotNumber, o.lotNumber, true) + && compareValues(expirationDate, o.expirationDate, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, date - , vaccineCode, patient, wasNotGiven, reported, performer, requester, encounter - , manufacturer, location, lotNumber, expirationDate, site, route, doseQuantity + , vaccineCode, patient, wasNotGiven, primarySource, reportOrigin, performer, requester + , encounter, manufacturer, location, lotNumber, expirationDate, site, route, doseQuantity , note, explanation, reaction, vaccinationProtocol); } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImmunizationRecommendation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImmunizationRecommendation.java index 2b91d472b81..adf65d71f89 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImmunizationRecommendation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImmunizationRecommendation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImplementationGuide.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImplementationGuide.java index dcf7e1aa89d..5e69dc019de 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImplementationGuide.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ImplementationGuide.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -2213,10 +2213,10 @@ public class ImplementationGuide extends MetadataResource { protected MarkdownType copyright; /** - * The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version. + * The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version. */ @Child(name = "fhirVersion", type = {IdType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="FHIR Version this Implementation Guide targets", formalDefinition="The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version." ) + @Description(shortDefinition="FHIR Version this Implementation Guide targets", formalDefinition="The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version." ) protected IdType fhirVersion; /** @@ -2858,7 +2858,7 @@ public class ImplementationGuide extends MetadataResource { } /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + * @return {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value */ public IdType getFhirVersionElement() { if (this.fhirVersion == null) @@ -2878,7 +2878,7 @@ public class ImplementationGuide extends MetadataResource { } /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value */ public ImplementationGuide setFhirVersionElement(IdType value) { this.fhirVersion = value; @@ -2886,14 +2886,14 @@ public class ImplementationGuide extends MetadataResource { } /** - * @return The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version. + * @return The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version. */ public String getFhirVersion() { return this.fhirVersion == null ? null : this.fhirVersion.getValue(); } /** - * @param value The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version. + * @param value The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version. */ public ImplementationGuide setFhirVersion(String value) { if (Utilities.noString(value)) @@ -3164,7 +3164,7 @@ public class ImplementationGuide extends MetadataResource { childrenList.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); childrenList.add(new Property("jurisdiction", "CodeableConcept", "A jurisdiction in which the implementation guide is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction)); childrenList.add(new Property("copyright", "markdown", "A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); childrenList.add(new Property("dependency", "", "Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.", 0, java.lang.Integer.MAX_VALUE, dependency)); childrenList.add(new Property("package", "", "A logical group of resources. Logical groups can be used when building pages.", 0, java.lang.Integer.MAX_VALUE, package_)); childrenList.add(new Property("global", "", "A set of profiles that all resources covered by this implementation guide must conform to.", 0, java.lang.Integer.MAX_VALUE, global)); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Library.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Library.java index 2de80601227..5e228c3ec33 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Library.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Library.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -145,11 +145,11 @@ public class Library extends MetadataResource { /** * The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content. */ - @Child(name = "content", type = {Attachment.class}, order=13, min=1, max=1, modifier=false, summary=false) + @Child(name = "content", type = {Attachment.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="The content of the library", formalDefinition="The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content." ) - protected Attachment content; + protected List content; - private static final long serialVersionUID = -1781432837L; + private static final long serialVersionUID = -39463327L; /** * Constructor @@ -161,11 +161,10 @@ public class Library extends MetadataResource { /** * Constructor */ - public Library(CodeableConcept type, Enumeration status, Attachment content) { + public Library(CodeableConcept type, Enumeration status) { super(); this.type = type; this.status = status; - this.content = content; } /** @@ -1374,25 +1373,54 @@ public class Library extends MetadataResource { /** * @return {@link #content} (The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content.) */ - public Attachment getContent() { + public List getContent() { if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Library.content"); - else if (Configuration.doAutoCreate()) - this.content = new Attachment(); // cc + this.content = new ArrayList(); return this.content; } + /** + * @return Returns a reference to this for easy method chaining + */ + public Library setContent(List theContent) { + this.content = theContent; + return this; + } + public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); + if (this.content == null) + return false; + for (Attachment item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + public Attachment addContent() { //3 + Attachment t = new Attachment(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + public Library addContent(Attachment t) { //3 + if (t == null) + return this; + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return this; } /** - * @param value {@link #content} (The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content.) + * @return The first repetition of repeating field {@link #content}, creating it if it does not already exist */ - public Library setContent(Attachment value) { - this.content = value; - return this; + public Attachment getContentFirstRep() { + if (getContent().isEmpty()) { + addContent(); + } + return getContent().get(0); } protected void listChildren(List childrenList) { @@ -1453,7 +1481,7 @@ public class Library extends MetadataResource { case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParameterDefinition case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Attachment + case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // Attachment default: return super.getProperty(hash, name, checkValid); } @@ -1538,7 +1566,7 @@ public class Library extends MetadataResource { this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement break; case 951530617: // content - this.content = castToAttachment(value); // Attachment + this.getContent().add(castToAttachment(value)); // Attachment break; default: super.setProperty(hash, name, value); } @@ -1598,7 +1626,7 @@ public class Library extends MetadataResource { else if (name.equals("dataRequirement")) this.getDataRequirement().add(castToDataRequirement(value)); else if (name.equals("content")) - this.content = castToAttachment(value); // Attachment + this.getContent().add(castToAttachment(value)); else super.setProperty(name, value); } @@ -1631,7 +1659,7 @@ public class Library extends MetadataResource { case 666807069: return addRelatedArtifact(); // RelatedArtifact case 1954460585: return addParameter(); // ParameterDefinition case 629147193: return addDataRequirement(); // DataRequirement - case 951530617: return getContent(); // Attachment + case 951530617: return addContent(); // Attachment default: return super.makeProperty(hash, name); } @@ -1717,8 +1745,7 @@ public class Library extends MetadataResource { return addDataRequirement(); } else if (name.equals("content")) { - this.content = new Attachment(); - return this.content; + return addContent(); } else return super.addChild(name); @@ -1793,7 +1820,11 @@ public class Library extends MetadataResource { for (DataRequirement i : dataRequirement) dst.dataRequirement.add(i.copy()); }; - dst.content = content == null ? null : content.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (Attachment i : content) + dst.content.add(i.copy()); + }; return dst; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Linkage.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Linkage.java index 817f580528f..8dcefaf1015 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Linkage.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Linkage.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ListResource.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ListResource.java index d23319bf8b7..45c6b729b2a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ListResource.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ListResource.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Location.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Location.java index e8281ded8aa..403cbd8a5ed 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Location.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Location.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -1794,6 +1794,32 @@ Requires the near parameter to be included also
*/ public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + /** + * Search parameter: endpoint + *

+ * Description: Technical endpoints providing access to services operated for the location
+ * Type: reference
+ * Path: Location.endpoint
+ *

+ */ + @SearchParamDefinition(name="endpoint", path="Location.endpoint", description="Technical endpoints providing access to services operated for the location", type="reference", target={Endpoint.class } ) + public static final String SP_ENDPOINT = "endpoint"; + /** + * Fluent Client search parameter constant for endpoint + *

+ * Description: Technical endpoints providing access to services operated for the location
+ * Type: reference
+ * Path: Location.endpoint
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENDPOINT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Location:endpoint". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include("Location:endpoint").toLocked(); + /** * Search parameter: organization *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Measure.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Measure.java index 1c33fff062b..7af8f9c75f3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Measure.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Measure.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -47,7 +47,7 @@ import org.hl7.fhir.exceptions.FHIRException; * The Measure resource provides the definition of a quality measure. */ @ResourceDef(name="Measure", profile="http://hl7.org/fhir/Profile/Measure") -@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "publisher", "contact", "copyright", "relatedArtifact", "library", "disclaimer", "scoring", "type", "riskAdjustment", "rateAggregation", "rationale", "clinicalRecommendationStatement", "improvementNotation", "definition", "guidance", "set", "group", "supplementalData"}) +@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "publisher", "contact", "copyright", "relatedArtifact", "library", "disclaimer", "scoring", "compositeScoring", "type", "riskAdjustment", "rateAggregation", "rationale", "clinicalRecommendationStatement", "improvementNotation", "definition", "guidance", "set", "group", "supplementalData"}) public class Measure extends MetadataResource { public enum MeasureScoring { @@ -172,15 +172,149 @@ public class Measure extends MetadataResource { } } + public enum CompositeMeasureScoring { + /** + * Opportunity scoring combines the scores from component measures by combining the numerators and denominators for each component + */ + OPPORTUNITY, + /** + * All-or-nothing scoring includes an individual in the numerator of the composite measure if they are in the numerators of all of the component measures in which they are in the denominator + */ + ALLORNOTHING, + /** + * Linear scoring gives an individual a score based on the number of numerators in which they appear + */ + LINEAR, + /** + * Weighted scoring gives an individual a score based on a weigthed factor for each component numerator in which they appear + */ + WEIGHTED, + /** + * added to help the parsers with the generic types + */ + NULL; + public static CompositeMeasureScoring fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("opportunity".equals(codeString)) + return OPPORTUNITY; + if ("all-or-nothing".equals(codeString)) + return ALLORNOTHING; + if ("linear".equals(codeString)) + return LINEAR; + if ("weighted".equals(codeString)) + return WEIGHTED; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown CompositeMeasureScoring code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case OPPORTUNITY: return "opportunity"; + case ALLORNOTHING: return "all-or-nothing"; + case LINEAR: return "linear"; + case WEIGHTED: return "weighted"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OPPORTUNITY: return "http://hl7.org/fhir/composite-measure-scoring"; + case ALLORNOTHING: return "http://hl7.org/fhir/composite-measure-scoring"; + case LINEAR: return "http://hl7.org/fhir/composite-measure-scoring"; + case WEIGHTED: return "http://hl7.org/fhir/composite-measure-scoring"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OPPORTUNITY: return "Opportunity scoring combines the scores from component measures by combining the numerators and denominators for each component"; + case ALLORNOTHING: return "All-or-nothing scoring includes an individual in the numerator of the composite measure if they are in the numerators of all of the component measures in which they are in the denominator"; + case LINEAR: return "Linear scoring gives an individual a score based on the number of numerators in which they appear"; + case WEIGHTED: return "Weighted scoring gives an individual a score based on a weigthed factor for each component numerator in which they appear"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OPPORTUNITY: return "Opportunity"; + case ALLORNOTHING: return "All-or-nothing"; + case LINEAR: return "Linear"; + case WEIGHTED: return "Weighted"; + default: return "?"; + } + } + } + + public static class CompositeMeasureScoringEnumFactory implements EnumFactory { + public CompositeMeasureScoring fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("opportunity".equals(codeString)) + return CompositeMeasureScoring.OPPORTUNITY; + if ("all-or-nothing".equals(codeString)) + return CompositeMeasureScoring.ALLORNOTHING; + if ("linear".equals(codeString)) + return CompositeMeasureScoring.LINEAR; + if ("weighted".equals(codeString)) + return CompositeMeasureScoring.WEIGHTED; + throw new IllegalArgumentException("Unknown CompositeMeasureScoring code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("opportunity".equals(codeString)) + return new Enumeration(this, CompositeMeasureScoring.OPPORTUNITY); + if ("all-or-nothing".equals(codeString)) + return new Enumeration(this, CompositeMeasureScoring.ALLORNOTHING); + if ("linear".equals(codeString)) + return new Enumeration(this, CompositeMeasureScoring.LINEAR); + if ("weighted".equals(codeString)) + return new Enumeration(this, CompositeMeasureScoring.WEIGHTED); + throw new FHIRException("Unknown CompositeMeasureScoring code '"+codeString+"'"); + } + public String toCode(CompositeMeasureScoring code) { + if (code == CompositeMeasureScoring.OPPORTUNITY) + return "opportunity"; + if (code == CompositeMeasureScoring.ALLORNOTHING) + return "all-or-nothing"; + if (code == CompositeMeasureScoring.LINEAR) + return "linear"; + if (code == CompositeMeasureScoring.WEIGHTED) + return "weighted"; + return "?"; + } + public String toSystem(CompositeMeasureScoring code) { + return code.getSystem(); + } + } + public enum MeasureType { /** - * The measure is a process measure + * A measure which focuses on a process which leads to a certain outcome, meaning that a scientific basis exists for believing that the process, when executed well, will increase the probability of achieving a desired outcome */ PROCESS, /** - * The measure is an outcome measure + * A measure that indicates the result of the performance (or non-performance) of a function or process */ OUTCOME, + /** + * A measure that focuses on a health care provider's capacity, systems, and processes to provide high-quality care + */ + STRUCTURE, + /** + * A measure that focuses on patient-reported information + */ + PATIENTREPORTEDOUTCOME, + /** + * A measure that combines multiple component measures in to a single quality measure + */ + COMPOSITE, /** * added to help the parsers with the generic types */ @@ -192,6 +326,12 @@ public class Measure extends MetadataResource { return PROCESS; if ("outcome".equals(codeString)) return OUTCOME; + if ("structure".equals(codeString)) + return STRUCTURE; + if ("patient-reported-outcome".equals(codeString)) + return PATIENTREPORTEDOUTCOME; + if ("composite".equals(codeString)) + return COMPOSITE; if (Configuration.isAcceptInvalidEnums()) return null; else @@ -201,6 +341,9 @@ public class Measure extends MetadataResource { switch (this) { case PROCESS: return "process"; case OUTCOME: return "outcome"; + case STRUCTURE: return "structure"; + case PATIENTREPORTEDOUTCOME: return "patient-reported-outcome"; + case COMPOSITE: return "composite"; default: return "?"; } } @@ -208,13 +351,19 @@ public class Measure extends MetadataResource { switch (this) { case PROCESS: return "http://hl7.org/fhir/measure-type"; case OUTCOME: return "http://hl7.org/fhir/measure-type"; + case STRUCTURE: return "http://hl7.org/fhir/measure-type"; + case PATIENTREPORTEDOUTCOME: return "http://hl7.org/fhir/measure-type"; + case COMPOSITE: return "http://hl7.org/fhir/measure-type"; default: return "?"; } } public String getDefinition() { switch (this) { - case PROCESS: return "The measure is a process measure"; - case OUTCOME: return "The measure is an outcome measure"; + case PROCESS: return "A measure which focuses on a process which leads to a certain outcome, meaning that a scientific basis exists for believing that the process, when executed well, will increase the probability of achieving a desired outcome"; + case OUTCOME: return "A measure that indicates the result of the performance (or non-performance) of a function or process"; + case STRUCTURE: return "A measure that focuses on a health care provider's capacity, systems, and processes to provide high-quality care"; + case PATIENTREPORTEDOUTCOME: return "A measure that focuses on patient-reported information"; + case COMPOSITE: return "A measure that combines multiple component measures in to a single quality measure"; default: return "?"; } } @@ -222,6 +371,9 @@ public class Measure extends MetadataResource { switch (this) { case PROCESS: return "Process"; case OUTCOME: return "Outcome"; + case STRUCTURE: return "Structure"; + case PATIENTREPORTEDOUTCOME: return "Patient Reported Outcome"; + case COMPOSITE: return "Composite"; default: return "?"; } } @@ -236,6 +388,12 @@ public class Measure extends MetadataResource { return MeasureType.PROCESS; if ("outcome".equals(codeString)) return MeasureType.OUTCOME; + if ("structure".equals(codeString)) + return MeasureType.STRUCTURE; + if ("patient-reported-outcome".equals(codeString)) + return MeasureType.PATIENTREPORTEDOUTCOME; + if ("composite".equals(codeString)) + return MeasureType.COMPOSITE; throw new IllegalArgumentException("Unknown MeasureType code '"+codeString+"'"); } public Enumeration fromType(Base code) throws FHIRException { @@ -248,6 +406,12 @@ public class Measure extends MetadataResource { return new Enumeration(this, MeasureType.PROCESS); if ("outcome".equals(codeString)) return new Enumeration(this, MeasureType.OUTCOME); + if ("structure".equals(codeString)) + return new Enumeration(this, MeasureType.STRUCTURE); + if ("patient-reported-outcome".equals(codeString)) + return new Enumeration(this, MeasureType.PATIENTREPORTEDOUTCOME); + if ("composite".equals(codeString)) + return new Enumeration(this, MeasureType.COMPOSITE); throw new FHIRException("Unknown MeasureType code '"+codeString+"'"); } public String toCode(MeasureType code) { @@ -255,6 +419,12 @@ public class Measure extends MetadataResource { return "process"; if (code == MeasureType.OUTCOME) return "outcome"; + if (code == MeasureType.STRUCTURE) + return "structure"; + if (code == MeasureType.PATIENTREPORTEDOUTCOME) + return "patient-reported-outcome"; + if (code == MeasureType.COMPOSITE) + return "composite"; return "?"; } public String toSystem(MeasureType code) { @@ -2121,97 +2291,105 @@ public class Measure extends MetadataResource { /** * A disclaimer for the use of the measure. */ - @Child(name = "disclaimer", type = {MarkdownType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "disclaimer", type = {MarkdownType.class}, order=11, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Disclaimer for the measure", formalDefinition="A disclaimer for the use of the measure." ) protected MarkdownType disclaimer; /** * The measure scoring type, e.g. proportion, CV. */ - @Child(name = "scoring", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "scoring", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="proportion | ratio | continuous-variable | cohort", formalDefinition="The measure scoring type, e.g. proportion, CV." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-scoring") protected Enumeration scoring; + /** + * If this is a composite measure, the scoring method used to combine the component measures to determine the composite score. + */ + @Child(name = "compositeScoring", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="opportunity | all-or-nothing | linear | weighted", formalDefinition="If this is a composite measure, the scoring method used to combine the component measures to determine the composite score." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/composite-measure-scoring") + protected Enumeration compositeScoring; + /** * The measure type, e.g. process, outcome. */ - @Child(name = "type", type = {CodeType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="process | outcome", formalDefinition="The measure type, e.g. process, outcome." ) + @Child(name = "type", type = {CodeType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="process | outcome | structure | patient-reported-outcome | composite", formalDefinition="The measure type, e.g. process, outcome." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-type") protected List> type; /** * A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. */ - @Child(name = "riskAdjustment", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Child(name = "riskAdjustment", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="How is risk adjustment applied for this measure", formalDefinition="A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results." ) protected StringType riskAdjustment; /** * A description of the rate aggregation for the measure. */ - @Child(name = "rateAggregation", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "rateAggregation", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="How is rate aggregation performed for this measure", formalDefinition="A description of the rate aggregation for the measure." ) protected StringType rateAggregation; /** * The rationale for the measure. */ - @Child(name = "rationale", type = {MarkdownType.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Child(name = "rationale", type = {MarkdownType.class}, order=17, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Why does this measure exist", formalDefinition="The rationale for the measure." ) protected MarkdownType rationale; /** * The clinical recommendation statement for the measure. */ - @Child(name = "clinicalRecommendationStatement", type = {MarkdownType.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Child(name = "clinicalRecommendationStatement", type = {MarkdownType.class}, order=18, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Clinical recommendation", formalDefinition="The clinical recommendation statement for the measure." ) protected MarkdownType clinicalRecommendationStatement; /** * Improvement notation for the measure, e.g. higher score indicates better quality. */ - @Child(name = "improvementNotation", type = {StringType.class}, order=18, min=0, max=1, modifier=false, summary=false) + @Child(name = "improvementNotation", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Improvement notation for the measure, e.g. higher score indicates better quality", formalDefinition="Improvement notation for the measure, e.g. higher score indicates better quality." ) protected StringType improvementNotation; /** * A narrative description of the complete measure calculation. */ - @Child(name = "definition", type = {MarkdownType.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Child(name = "definition", type = {MarkdownType.class}, order=20, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="A natural language definition of the measure", formalDefinition="A narrative description of the complete measure calculation." ) protected MarkdownType definition; /** * Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. */ - @Child(name = "guidance", type = {MarkdownType.class}, order=20, min=0, max=1, modifier=false, summary=false) + @Child(name = "guidance", type = {MarkdownType.class}, order=21, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="The guidance for the measure", formalDefinition="Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure." ) protected MarkdownType guidance; /** * The measure set, e.g. Preventive Care and Screening. */ - @Child(name = "set", type = {StringType.class}, order=21, min=0, max=1, modifier=false, summary=false) + @Child(name = "set", type = {StringType.class}, order=22, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="The measure set, e.g. Preventive Care and Screening", formalDefinition="The measure set, e.g. Preventive Care and Screening." ) protected StringType set; /** * A group of population criteria for the measure. */ - @Child(name = "group", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "group", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Population criteria group", formalDefinition="A group of population criteria for the measure." ) protected List group; /** * The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path. */ - @Child(name = "supplementalData", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "supplementalData", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Supplemental data", formalDefinition="The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path." ) protected List supplementalData; - private static final long serialVersionUID = -590779721L; + private static final long serialVersionUID = 2104944282L; /** * Constructor @@ -3474,6 +3652,55 @@ public class Measure extends MetadataResource { return this; } + /** + * @return {@link #compositeScoring} (If this is a composite measure, the scoring method used to combine the component measures to determine the composite score.). This is the underlying object with id, value and extensions. The accessor "getCompositeScoring" gives direct access to the value + */ + public Enumeration getCompositeScoringElement() { + if (this.compositeScoring == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Measure.compositeScoring"); + else if (Configuration.doAutoCreate()) + this.compositeScoring = new Enumeration(new CompositeMeasureScoringEnumFactory()); // bb + return this.compositeScoring; + } + + public boolean hasCompositeScoringElement() { + return this.compositeScoring != null && !this.compositeScoring.isEmpty(); + } + + public boolean hasCompositeScoring() { + return this.compositeScoring != null && !this.compositeScoring.isEmpty(); + } + + /** + * @param value {@link #compositeScoring} (If this is a composite measure, the scoring method used to combine the component measures to determine the composite score.). This is the underlying object with id, value and extensions. The accessor "getCompositeScoring" gives direct access to the value + */ + public Measure setCompositeScoringElement(Enumeration value) { + this.compositeScoring = value; + return this; + } + + /** + * @return If this is a composite measure, the scoring method used to combine the component measures to determine the composite score. + */ + public CompositeMeasureScoring getCompositeScoring() { + return this.compositeScoring == null ? null : this.compositeScoring.getValue(); + } + + /** + * @param value If this is a composite measure, the scoring method used to combine the component measures to determine the composite score. + */ + public Measure setCompositeScoring(CompositeMeasureScoring value) { + if (value == null) + this.compositeScoring = null; + else { + if (this.compositeScoring == null) + this.compositeScoring = new Enumeration(new CompositeMeasureScoringEnumFactory()); + this.compositeScoring.setValue(value); + } + return this; + } + /** * @return {@link #type} (The measure type, e.g. process, outcome.) */ @@ -4060,6 +4287,7 @@ public class Measure extends MetadataResource { childrenList.add(new Property("library", "Reference(Library)", "A reference to a Library resource containing the formal logic used by the measure.", 0, java.lang.Integer.MAX_VALUE, library)); childrenList.add(new Property("disclaimer", "markdown", "A disclaimer for the use of the measure.", 0, java.lang.Integer.MAX_VALUE, disclaimer)); childrenList.add(new Property("scoring", "code", "The measure scoring type, e.g. proportion, CV.", 0, java.lang.Integer.MAX_VALUE, scoring)); + childrenList.add(new Property("compositeScoring", "code", "If this is a composite measure, the scoring method used to combine the component measures to determine the composite score.", 0, java.lang.Integer.MAX_VALUE, compositeScoring)); childrenList.add(new Property("type", "code", "The measure type, e.g. process, outcome.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("riskAdjustment", "string", "A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.", 0, java.lang.Integer.MAX_VALUE, riskAdjustment)); childrenList.add(new Property("rateAggregation", "string", "A description of the rate aggregation for the measure.", 0, java.lang.Integer.MAX_VALUE, rateAggregation)); @@ -4101,6 +4329,7 @@ public class Measure extends MetadataResource { case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // Reference case 432371099: /*disclaimer*/ return this.disclaimer == null ? new Base[0] : new Base[] {this.disclaimer}; // MarkdownType case 1924005583: /*scoring*/ return this.scoring == null ? new Base[0] : new Base[] {this.scoring}; // Enumeration + case 569347656: /*compositeScoring*/ return this.compositeScoring == null ? new Base[0] : new Base[] {this.compositeScoring}; // Enumeration case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Enumeration case 93273500: /*riskAdjustment*/ return this.riskAdjustment == null ? new Base[0] : new Base[] {this.riskAdjustment}; // StringType case 1254503906: /*rateAggregation*/ return this.rateAggregation == null ? new Base[0] : new Base[] {this.rateAggregation}; // StringType @@ -4195,6 +4424,9 @@ public class Measure extends MetadataResource { case 1924005583: // scoring this.scoring = new MeasureScoringEnumFactory().fromType(value); // Enumeration break; + case 569347656: // compositeScoring + this.compositeScoring = new CompositeMeasureScoringEnumFactory().fromType(value); // Enumeration + break; case 3575610: // type this.getType().add(new MeasureTypeEnumFactory().fromType(value)); // Enumeration break; @@ -4285,6 +4517,8 @@ public class Measure extends MetadataResource { this.disclaimer = castToMarkdown(value); // MarkdownType else if (name.equals("scoring")) this.scoring = new MeasureScoringEnumFactory().fromType(value); // Enumeration + else if (name.equals("compositeScoring")) + this.compositeScoring = new CompositeMeasureScoringEnumFactory().fromType(value); // Enumeration else if (name.equals("type")) this.getType().add(new MeasureTypeEnumFactory().fromType(value)); else if (name.equals("riskAdjustment")) @@ -4339,6 +4573,7 @@ public class Measure extends MetadataResource { case 166208699: return addLibrary(); // Reference case 432371099: throw new FHIRException("Cannot make property disclaimer as it is not a complex type"); // MarkdownType case 1924005583: throw new FHIRException("Cannot make property scoring as it is not a complex type"); // Enumeration + case 569347656: throw new FHIRException("Cannot make property compositeScoring as it is not a complex type"); // Enumeration case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration case 93273500: throw new FHIRException("Cannot make property riskAdjustment as it is not a complex type"); // StringType case 1254503906: throw new FHIRException("Cannot make property rateAggregation as it is not a complex type"); // StringType @@ -4433,6 +4668,9 @@ public class Measure extends MetadataResource { else if (name.equals("scoring")) { throw new FHIRException("Cannot call addChild on a primitive type Measure.scoring"); } + else if (name.equals("compositeScoring")) { + throw new FHIRException("Cannot call addChild on a primitive type Measure.compositeScoring"); + } else if (name.equals("type")) { throw new FHIRException("Cannot call addChild on a primitive type Measure.type"); } @@ -4535,6 +4773,7 @@ public class Measure extends MetadataResource { }; dst.disclaimer = disclaimer == null ? null : disclaimer.copy(); dst.scoring = scoring == null ? null : scoring.copy(); + dst.compositeScoring = compositeScoring == null ? null : compositeScoring.copy(); if (type != null) { dst.type = new ArrayList>(); for (Enumeration i : type) @@ -4577,11 +4816,12 @@ public class Measure extends MetadataResource { && compareDeep(effectivePeriod, o.effectivePeriod, true) && compareDeep(topic, o.topic, true) && compareDeep(contributor, o.contributor, true) && compareDeep(copyright, o.copyright, true) && compareDeep(relatedArtifact, o.relatedArtifact, true) && compareDeep(library, o.library, true) && compareDeep(disclaimer, o.disclaimer, true) && compareDeep(scoring, o.scoring, true) - && compareDeep(type, o.type, true) && compareDeep(riskAdjustment, o.riskAdjustment, true) && compareDeep(rateAggregation, o.rateAggregation, true) - && compareDeep(rationale, o.rationale, true) && compareDeep(clinicalRecommendationStatement, o.clinicalRecommendationStatement, true) - && compareDeep(improvementNotation, o.improvementNotation, true) && compareDeep(definition, o.definition, true) - && compareDeep(guidance, o.guidance, true) && compareDeep(set, o.set, true) && compareDeep(group, o.group, true) - && compareDeep(supplementalData, o.supplementalData, true); + && compareDeep(compositeScoring, o.compositeScoring, true) && compareDeep(type, o.type, true) && compareDeep(riskAdjustment, o.riskAdjustment, true) + && compareDeep(rateAggregation, o.rateAggregation, true) && compareDeep(rationale, o.rationale, true) + && compareDeep(clinicalRecommendationStatement, o.clinicalRecommendationStatement, true) && compareDeep(improvementNotation, o.improvementNotation, true) + && compareDeep(definition, o.definition, true) && compareDeep(guidance, o.guidance, true) && compareDeep(set, o.set, true) + && compareDeep(group, o.group, true) && compareDeep(supplementalData, o.supplementalData, true) + ; } @Override @@ -4593,8 +4833,8 @@ public class Measure extends MetadataResource { Measure o = (Measure) other; return compareValues(purpose, o.purpose, true) && compareValues(usage, o.usage, true) && compareValues(approvalDate, o.approvalDate, true) && compareValues(lastReviewDate, o.lastReviewDate, true) && compareValues(copyright, o.copyright, true) - && compareValues(disclaimer, o.disclaimer, true) && compareValues(scoring, o.scoring, true) && compareValues(type, o.type, true) - && compareValues(riskAdjustment, o.riskAdjustment, true) && compareValues(rateAggregation, o.rateAggregation, true) + && compareValues(disclaimer, o.disclaimer, true) && compareValues(scoring, o.scoring, true) && compareValues(compositeScoring, o.compositeScoring, true) + && compareValues(type, o.type, true) && compareValues(riskAdjustment, o.riskAdjustment, true) && compareValues(rateAggregation, o.rateAggregation, true) && compareValues(rationale, o.rationale, true) && compareValues(clinicalRecommendationStatement, o.clinicalRecommendationStatement, true) && compareValues(improvementNotation, o.improvementNotation, true) && compareValues(definition, o.definition, true) && compareValues(guidance, o.guidance, true) && compareValues(set, o.set, true); @@ -4603,9 +4843,9 @@ public class Measure extends MetadataResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, purpose, usage , approvalDate, lastReviewDate, effectivePeriod, topic, contributor, copyright, relatedArtifact - , library, disclaimer, scoring, type, riskAdjustment, rateAggregation, rationale - , clinicalRecommendationStatement, improvementNotation, definition, guidance, set - , group, supplementalData); + , library, disclaimer, scoring, compositeScoring, type, riskAdjustment, rateAggregation + , rationale, clinicalRecommendationStatement, improvementNotation, definition, guidance + , set, group, supplementalData); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MeasureReport.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MeasureReport.java index c117d84a237..f155484ef62 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MeasureReport.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MeasureReport.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -266,35 +266,35 @@ public class MeasureReport extends DomainResource { /** * The identifier of the population group as defined in the measure definition. */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Identifier of the population group being reported", formalDefinition="The identifier of the population group as defined in the measure definition." ) protected Identifier identifier; /** * The populations that make up the population group, one for each type of population appropriate for the measure. */ - @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="The populations in the group", formalDefinition="The populations that make up the population group, one for each type of population appropriate for the measure." ) protected List population; /** * The measure score. */ - @Child(name = "measureScore", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Child(name = "measureScore", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="The measure score", formalDefinition="The measure score." ) protected DecimalType measureScore; /** * When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure. */ - @Child(name = "stratifier", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "stratifier", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Stratification results", formalDefinition="When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure." ) protected List stratifier; /** * Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations. */ - @Child(name = "supplementalData", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "supplementalData", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Supplemental data elements for the measure", formalDefinition="Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations." ) protected List supplementalData; @@ -723,7 +723,7 @@ public class MeasureReport extends DomainResource { /** * The type of the population. */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score", formalDefinition="The type of the population." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-population") protected CodeType type; @@ -731,14 +731,14 @@ public class MeasureReport extends DomainResource { /** * The number of members of the population. */ - @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population." ) protected IntegerType count; /** * This element refers to a List of patient level MeasureReport resources, one for each patient in this population. */ - @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population." ) protected Reference patients; @@ -1018,14 +1018,14 @@ public class MeasureReport extends DomainResource { /** * The identifier of this stratifier, as defined in the measure definition. */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Identifier of the stratifier", formalDefinition="The identifier of this stratifier, as defined in the measure definition." ) protected Identifier identifier; /** * This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value. */ - @Child(name = "group", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "group", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Stratum results, one for each unique value in the stratifier", formalDefinition="This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value." ) protected List group; @@ -1234,21 +1234,21 @@ public class MeasureReport extends DomainResource { /** * The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. */ - @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="The stratum value, e.g. male", formalDefinition="The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique." ) protected StringType value; /** * The populations that make up the stratum, one for each type of population appropriate to the measure. */ - @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Population results in this stratum", formalDefinition="The populations that make up the stratum, one for each type of population appropriate to the measure." ) protected List population; /** * The measure score for this stratum. */ - @Child(name = "measureScore", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Child(name = "measureScore", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="The measure score", formalDefinition="The measure score for this stratum." ) protected DecimalType measureScore; @@ -1558,7 +1558,7 @@ public class MeasureReport extends DomainResource { /** * The type of the population. */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score", formalDefinition="The type of the population." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-population") protected CodeType type; @@ -1566,14 +1566,14 @@ public class MeasureReport extends DomainResource { /** * The number of members of the population in this stratum. */ - @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population in this stratum." ) protected IntegerType count; /** * This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum. */ - @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum." ) protected Reference patients; @@ -1853,14 +1853,14 @@ public class MeasureReport extends DomainResource { /** * The identifier of the supplemental data element as defined in the measure. */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Identifier of the supplemental data element", formalDefinition="The identifier of the supplemental data element as defined in the measure." ) protected Identifier identifier; /** * This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value. */ - @Child(name = "group", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "group", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Supplemental data results, one for each unique supplemental data value", formalDefinition="This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value." ) protected List group; @@ -2069,21 +2069,21 @@ public class MeasureReport extends DomainResource { /** * The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique. */ - @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="The data value, e.g. male", formalDefinition="The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique." ) protected StringType value; /** * The number of members in the supplemental data group. */ - @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Number of members in the group", formalDefinition="The number of members in the supplemental data group." ) protected IntegerType count; /** * This element refers to a List of patient level MeasureReport resources, one for each patient in this population. */ - @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population." ) protected Reference patients; @@ -2427,14 +2427,14 @@ public class MeasureReport extends DomainResource { /** * The results of the calculation, one for each population group in the measure. */ - @Child(name = "group", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "group", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Measure results for each group", formalDefinition="The results of the calculation, one for each population group in the measure." ) protected List group; /** * A reference to a Bundle containing the Resources that were used in the evaluation of this report. */ - @Child(name = "evaluatedResources", type = {Bundle.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Child(name = "evaluatedResources", type = {Bundle.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Evaluated Resources", formalDefinition="A reference to a Bundle containing the Resources that were used in the evaluation of this report." ) protected Reference evaluatedResources; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Media.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Media.java index fe9a2f3ae62..38ecfddd907 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Media.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Media.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Medication.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Medication.java index 002d7ba5c13..6dfedcc8235 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Medication.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Medication.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationAdministration.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationAdministration.java index 2f97facad31..6a62ae41750 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationAdministration.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationAdministration.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -198,10 +198,10 @@ public class MedicationAdministration extends DomainResource { /** * A coded specification of the anatomic site where the medication first entered the body. For example, "left arm". */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "site", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Body site administered to", formalDefinition="A coded specification of the anatomic site where the medication first entered the body. For example, \"left arm\"." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/approach-site-codes") - protected Type site; + protected CodeableConcept site; /** * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc. @@ -233,7 +233,7 @@ public class MedicationAdministration extends DomainResource { @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) protected Type rate; - private static final long serialVersionUID = -1359632689L; + private static final long serialVersionUID = 1316915516L; /** * Constructor @@ -294,36 +294,15 @@ public class MedicationAdministration extends DomainResource { /** * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) */ - public Type getSite() { + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); // cc return this.site; } - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) - */ - public CodeableConcept getSiteCodeableConcept() throws FHIRException { - if (!(this.site instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - public boolean hasSiteCodeableConcept() { - return this.site instanceof CodeableConcept; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) - */ - public Reference getSiteReference() throws FHIRException { - if (!(this.site instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSiteReference() { - return this.site instanceof Reference; - } - public boolean hasSite() { return this.site != null && !this.site.isEmpty(); } @@ -331,7 +310,7 @@ public class MedicationAdministration extends DomainResource { /** * @param value {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) */ - public MedicationAdministrationDosageComponent setSite(Type value) { + public MedicationAdministrationDosageComponent setSite(CodeableConcept value) { this.site = value; return this; } @@ -456,7 +435,7 @@ public class MedicationAdministration extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("text", "string", "Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.\r\rThe dosage instructions should reflect the dosage of the medication that was administered.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of the anatomic site where the medication first entered the body. For example, \"left arm\".", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first entered the body. For example, \"left arm\".", 0, java.lang.Integer.MAX_VALUE, site)); childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc.", 0, java.lang.Integer.MAX_VALUE, route)); childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.", 0, java.lang.Integer.MAX_VALUE, method)); childrenList.add(new Property("dose", "SimpleQuantity", "The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.", 0, java.lang.Integer.MAX_VALUE, dose)); @@ -467,7 +446,7 @@ public class MedicationAdministration extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type + case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // CodeableConcept case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept case 3089437: /*dose*/ return this.dose == null ? new Base[0] : new Base[] {this.dose}; // SimpleQuantity @@ -484,7 +463,7 @@ public class MedicationAdministration extends DomainResource { this.text = castToString(value); // StringType break; case 3530567: // site - this.site = castToType(value); // Type + this.site = castToCodeableConcept(value); // CodeableConcept break; case 108704329: // route this.route = castToCodeableConcept(value); // CodeableConcept @@ -507,8 +486,8 @@ public class MedicationAdministration extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("text")) this.text = castToString(value); // StringType - else if (name.equals("site[x]")) - this.site = castToType(value); // Type + else if (name.equals("site")) + this.site = castToCodeableConcept(value); // CodeableConcept else if (name.equals("route")) this.route = castToCodeableConcept(value); // CodeableConcept else if (name.equals("method")) @@ -525,7 +504,7 @@ public class MedicationAdministration extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case 2099997657: return getSite(); // Type + case 3530567: return getSite(); // CodeableConcept case 108704329: return getRoute(); // CodeableConcept case -1077554975: return getMethod(); // CodeableConcept case 3089437: return getDose(); // SimpleQuantity @@ -540,14 +519,10 @@ public class MedicationAdministration extends DomainResource { if (name.equals("text")) { throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.text"); } - else if (name.equals("siteCodeableConcept")) { + else if (name.equals("site")) { this.site = new CodeableConcept(); return this.site; } - else if (name.equals("siteReference")) { - this.site = new Reference(); - return this.site; - } else if (name.equals("route")) { this.route = new CodeableConcept(); return this.route; @@ -680,9 +655,9 @@ public class MedicationAdministration extends DomainResource { /** * A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. */ - @Child(name = "effectiveTime", type = {DateTimeType.class, Period.class}, order=6, min=1, max=1, modifier=false, summary=true) + @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=1, max=1, modifier=false, summary=true) @Description(shortDefinition="Start and end time of administration", formalDefinition="A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate." ) - protected Type effectiveTime; + protected Type effective; /** * The individual who was responsible for giving the medication to the patient. @@ -781,7 +756,7 @@ public class MedicationAdministration extends DomainResource { protected List eventHistoryTarget; - private static final long serialVersionUID = 195298312L; + private static final long serialVersionUID = -1414601061L; /** * Constructor @@ -793,12 +768,12 @@ public class MedicationAdministration extends DomainResource { /** * Constructor */ - public MedicationAdministration(Enumeration status, Type medication, Reference patient, Type effectiveTime) { + public MedicationAdministration(Enumeration status, Type medication, Reference patient, Type effective) { super(); this.status = status; this.medication = medication; this.patient = patient; - this.effectiveTime = effectiveTime; + this.effective = effective; } /** @@ -1096,47 +1071,47 @@ public class MedicationAdministration extends DomainResource { } /** - * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + * @return {@link #effective} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) */ - public Type getEffectiveTime() { - return this.effectiveTime; + public Type getEffective() { + return this.effective; } /** - * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + * @return {@link #effective} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) */ - public DateTimeType getEffectiveTimeDateTimeType() throws FHIRException { - if (!(this.effectiveTime instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); - return (DateTimeType) this.effectiveTime; + public DateTimeType getEffectiveDateTimeType() throws FHIRException { + if (!(this.effective instanceof DateTimeType)) + throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (DateTimeType) this.effective; } - public boolean hasEffectiveTimeDateTimeType() { - return this.effectiveTime instanceof DateTimeType; + public boolean hasEffectiveDateTimeType() { + return this.effective instanceof DateTimeType; } /** - * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + * @return {@link #effective} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) */ - public Period getEffectiveTimePeriod() throws FHIRException { - if (!(this.effectiveTime instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); - return (Period) this.effectiveTime; + public Period getEffectivePeriod() throws FHIRException { + if (!(this.effective instanceof Period)) + throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); + return (Period) this.effective; } - public boolean hasEffectiveTimePeriod() { - return this.effectiveTime instanceof Period; + public boolean hasEffectivePeriod() { + return this.effective instanceof Period; } - public boolean hasEffectiveTime() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + public boolean hasEffective() { + return this.effective != null && !this.effective.isEmpty(); } /** - * @param value {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) + * @param value {@link #effective} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) */ - public MedicationAdministration setEffectiveTime(Type value) { - this.effectiveTime = value; + public MedicationAdministration setEffective(Type value) { + this.effective = value; return this; } @@ -1672,7 +1647,7 @@ public class MedicationAdministration extends DomainResource { childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal receiving the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); childrenList.add(new Property("supportingInformation", "Reference(Any)", "Additional information (for example, patient height and weight) that supports the administration of the medication.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); - childrenList.add(new Property("effectiveTime[x]", "dateTime|Period", "A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); + childrenList.add(new Property("effective[x]", "dateTime|Period", "A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, java.lang.Integer.MAX_VALUE, effective)); childrenList.add(new Property("performer", "Reference(Practitioner|Patient|RelatedPerson)", "The individual who was responsible for giving the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, performer)); childrenList.add(new Property("reasonReference", "Reference(Condition|Observation)", "Condition or observation that supports why the medication was administered.", 0, java.lang.Integer.MAX_VALUE, reasonReference)); childrenList.add(new Property("prescription", "Reference(MedicationRequest)", "The original request, instruction or authority to perform the administration.", 0, java.lang.Integer.MAX_VALUE, prescription)); @@ -1694,7 +1669,7 @@ public class MedicationAdministration extends DomainResource { case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference - case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // Type + case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Reference @@ -1731,8 +1706,8 @@ public class MedicationAdministration extends DomainResource { case -1248768647: // supportingInformation this.getSupportingInformation().add(castToReference(value)); // Reference break; - case -929905388: // effectiveTime - this.effectiveTime = castToType(value); // Type + case -1468651097: // effective + this.effective = castToType(value); // Type break; case 481140686: // performer this.performer = castToReference(value); // Reference @@ -1783,8 +1758,8 @@ public class MedicationAdministration extends DomainResource { this.encounter = castToReference(value); // Reference else if (name.equals("supportingInformation")) this.getSupportingInformation().add(castToReference(value)); - else if (name.equals("effectiveTime[x]")) - this.effectiveTime = castToType(value); // Type + else if (name.equals("effective[x]")) + this.effective = castToType(value); // Type else if (name.equals("performer")) this.performer = castToReference(value); // Reference else if (name.equals("reasonReference")) @@ -1818,7 +1793,7 @@ public class MedicationAdministration extends DomainResource { case -791418107: return getPatient(); // Reference case 1524132147: return getEncounter(); // Reference case -1248768647: return addSupportingInformation(); // Reference - case -272263444: return getEffectiveTime(); // Type + case 247104889: return getEffective(); // Type case 481140686: return getPerformer(); // Reference case -1146218137: return addReasonReference(); // Reference case 460301338: return getPrescription(); // Reference @@ -1861,13 +1836,13 @@ public class MedicationAdministration extends DomainResource { else if (name.equals("supportingInformation")) { return addSupportingInformation(); } - else if (name.equals("effectiveTimeDateTime")) { - this.effectiveTime = new DateTimeType(); - return this.effectiveTime; + else if (name.equals("effectiveDateTime")) { + this.effective = new DateTimeType(); + return this.effective; } - else if (name.equals("effectiveTimePeriod")) { - this.effectiveTime = new Period(); - return this.effectiveTime; + else if (name.equals("effectivePeriod")) { + this.effective = new Period(); + return this.effective; } else if (name.equals("performer")) { this.performer = new Reference(); @@ -1928,7 +1903,7 @@ public class MedicationAdministration extends DomainResource { for (Reference i : supportingInformation) dst.supportingInformation.add(i.copy()); }; - dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); + dst.effective = effective == null ? null : effective.copy(); dst.performer = performer == null ? null : performer.copy(); if (reasonReference != null) { dst.reasonReference = new ArrayList(); @@ -1979,9 +1954,8 @@ public class MedicationAdministration extends DomainResource { MedicationAdministration o = (MedicationAdministration) other; return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) && compareDeep(supportingInformation, o.supportingInformation, true) - && compareDeep(effectiveTime, o.effectiveTime, true) && compareDeep(performer, o.performer, true) - && compareDeep(reasonReference, o.reasonReference, true) && compareDeep(prescription, o.prescription, true) - && compareDeep(notGiven, o.notGiven, true) && compareDeep(reasonNotGiven, o.reasonNotGiven, true) + && compareDeep(effective, o.effective, true) && compareDeep(performer, o.performer, true) && compareDeep(reasonReference, o.reasonReference, true) + && compareDeep(prescription, o.prescription, true) && compareDeep(notGiven, o.notGiven, true) && compareDeep(reasonNotGiven, o.reasonNotGiven, true) && compareDeep(reasonGiven, o.reasonGiven, true) && compareDeep(device, o.device, true) && compareDeep(note, o.note, true) && compareDeep(dosage, o.dosage, true) && compareDeep(eventHistory, o.eventHistory, true); } @@ -1998,7 +1972,7 @@ public class MedicationAdministration extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, medication - , patient, encounter, supportingInformation, effectiveTime, performer, reasonReference + , patient, encounter, supportingInformation, effective, performer, reasonReference , prescription, notGiven, reasonNotGiven, reasonGiven, device, note, dosage, eventHistory ); } @@ -2223,17 +2197,17 @@ public class MedicationAdministration extends DomainResource { *

* Description: Date administration happened (or did not happen)
* Type: date
- * Path: MedicationAdministration.effectiveTime[x]
+ * Path: MedicationAdministration.effective[x]
*

*/ - @SearchParamDefinition(name="effective-time", path="MedicationAdministration.effectiveTime", description="Date administration happened (or did not happen)", type="date" ) + @SearchParamDefinition(name="effective-time", path="MedicationAdministration.effective", description="Date administration happened (or did not happen)", type="date" ) public static final String SP_EFFECTIVE_TIME = "effective-time"; /** * Fluent Client search parameter constant for effective-time *

* Description: Date administration happened (or did not happen)
* Type: date
- * Path: MedicationAdministration.effectiveTime[x]
+ * Path: MedicationAdministration.effective[x]
*

*/ public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE_TIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVE_TIME); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationDispense.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationDispense.java index dc555d27973..3afa0dab0a6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationDispense.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationDispense.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationRequest.java index 24ac4ccfa54..495137be13a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -887,14 +887,14 @@ public class MedicationRequest extends DomainResource { /** * The healthcare professional responsible for authorizing the initial prescription. */ - @Child(name = "prescriber", type = {Practitioner.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Child(name = "requester", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class, Device.class}, order=11, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Who ordered the initial medication(s)", formalDefinition="The healthcare professional responsible for authorizing the initial prescription." ) - protected Reference prescriber; + protected Reference requester; /** * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the initial prescription.) */ - protected Practitioner prescriberTarget; + protected Resource requesterTarget; /** * Can be the reason or the indication for writing the prescription. @@ -976,7 +976,7 @@ public class MedicationRequest extends DomainResource { protected List eventHistoryTarget; - private static final long serialVersionUID = 1722417294L; + private static final long serialVersionUID = -478447012L; /** * Constructor @@ -1512,46 +1512,41 @@ public class MedicationRequest extends DomainResource { } /** - * @return {@link #prescriber} (The healthcare professional responsible for authorizing the initial prescription.) + * @return {@link #requester} (The healthcare professional responsible for authorizing the initial prescription.) */ - public Reference getPrescriber() { - if (this.prescriber == null) + public Reference getRequester() { + if (this.requester == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationRequest.prescriber"); + throw new Error("Attempt to auto-create MedicationRequest.requester"); else if (Configuration.doAutoCreate()) - this.prescriber = new Reference(); // cc - return this.prescriber; + this.requester = new Reference(); // cc + return this.requester; } - public boolean hasPrescriber() { - return this.prescriber != null && !this.prescriber.isEmpty(); + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); } /** - * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the initial prescription.) + * @param value {@link #requester} (The healthcare professional responsible for authorizing the initial prescription.) */ - public MedicationRequest setPrescriber(Reference value) { - this.prescriber = value; + public MedicationRequest setRequester(Reference value) { + this.requester = value; return this; } /** - * @return {@link #prescriber} 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 healthcare professional responsible for authorizing the initial prescription.) + * @return {@link #requester} 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 healthcare professional responsible for authorizing the initial prescription.) */ - public Practitioner getPrescriberTarget() { - if (this.prescriberTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationRequest.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriberTarget = new Practitioner(); // aa - return this.prescriberTarget; + public Resource getRequesterTarget() { + return this.requesterTarget; } /** - * @param value {@link #prescriber} 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 healthcare professional responsible for authorizing the initial prescription.) + * @param value {@link #requester} 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 healthcare professional responsible for authorizing the initial prescription.) */ - public MedicationRequest setPrescriberTarget(Practitioner value) { - this.prescriberTarget = value; + public MedicationRequest setRequesterTarget(Resource value) { + this.requesterTarget = value; return this; } @@ -1981,7 +1976,7 @@ public class MedicationRequest extends DomainResource { childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "A link to a resource that identifies the particular occurrence or set oc occurences of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, context)); childrenList.add(new Property("supportingInformation", "Reference(Any)", "Include additional information (for example, patient height and weight) that supports the ordering of the medication.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was initially written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); - childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the initial prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); + childrenList.add(new Property("requester", "Reference(Practitioner|Organization|Patient|RelatedPerson|Device)", "The healthcare professional responsible for authorizing the initial prescription.", 0, java.lang.Integer.MAX_VALUE, requester)); childrenList.add(new Property("reasonCode", "CodeableConcept", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reasonCode)); childrenList.add(new Property("reasonReference", "Reference(Condition|Observation)", "Condition or observation that supports why the prescription is being written.", 0, java.lang.Integer.MAX_VALUE, reasonReference)); childrenList.add(new Property("note", "Annotation", "Extra information about the prescription that could not be conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); @@ -2007,7 +2002,7 @@ public class MedicationRequest extends DomainResource { case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference case -1496880759: /*dateWritten*/ return this.dateWritten == null ? new Base[0] : new Base[] {this.dateWritten}; // DateTimeType - case 1430631077: /*prescriber*/ return this.prescriber == null ? new Base[0] : new Base[] {this.prescriber}; // Reference + case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation @@ -2058,8 +2053,8 @@ public class MedicationRequest extends DomainResource { case -1496880759: // dateWritten this.dateWritten = castToDateTime(value); // DateTimeType break; - case 1430631077: // prescriber - this.prescriber = castToReference(value); // Reference + case 693933948: // requester + this.requester = castToReference(value); // Reference break; case 722137681: // reasonCode this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept @@ -2117,8 +2112,8 @@ public class MedicationRequest extends DomainResource { this.getSupportingInformation().add(castToReference(value)); else if (name.equals("dateWritten")) this.dateWritten = castToDateTime(value); // DateTimeType - else if (name.equals("prescriber")) - this.prescriber = castToReference(value); // Reference + else if (name.equals("requester")) + this.requester = castToReference(value); // Reference else if (name.equals("reasonCode")) this.getReasonCode().add(castToCodeableConcept(value)); else if (name.equals("reasonReference")) @@ -2155,7 +2150,7 @@ public class MedicationRequest extends DomainResource { case 951530927: return getContext(); // Reference case -1248768647: return addSupportingInformation(); // Reference case -1496880759: throw new FHIRException("Cannot make property dateWritten as it is not a complex type"); // DateTimeType - case 1430631077: return getPrescriber(); // Reference + case 693933948: return getRequester(); // Reference case 722137681: return addReasonCode(); // CodeableConcept case -1146218137: return addReasonReference(); // Reference case 3387378: return addNote(); // Annotation @@ -2214,9 +2209,9 @@ public class MedicationRequest extends DomainResource { else if (name.equals("dateWritten")) { throw new FHIRException("Cannot call addChild on a primitive type MedicationRequest.dateWritten"); } - else if (name.equals("prescriber")) { - this.prescriber = new Reference(); - return this.prescriber; + else if (name.equals("requester")) { + this.requester = new Reference(); + return this.requester; } else if (name.equals("reasonCode")) { return addReasonCode(); @@ -2288,7 +2283,7 @@ public class MedicationRequest extends DomainResource { dst.supportingInformation.add(i.copy()); }; dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); - dst.prescriber = prescriber == null ? null : prescriber.copy(); + dst.requester = requester == null ? null : requester.copy(); if (reasonCode != null) { dst.reasonCode = new ArrayList(); for (CodeableConcept i : reasonCode) @@ -2336,12 +2331,11 @@ public class MedicationRequest extends DomainResource { && compareDeep(basedOn, o.basedOn, true) && compareDeep(requisition, o.requisition, true) && compareDeep(status, o.status, true) && compareDeep(stage, o.stage, true) && compareDeep(medication, o.medication, true) && compareDeep(patient, o.patient, true) && compareDeep(context, o.context, true) && compareDeep(supportingInformation, o.supportingInformation, true) - && compareDeep(dateWritten, o.dateWritten, true) && compareDeep(prescriber, o.prescriber, true) - && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true) - && compareDeep(note, o.note, true) && compareDeep(category, o.category, true) && compareDeep(dosageInstruction, o.dosageInstruction, true) - && compareDeep(dispenseRequest, o.dispenseRequest, true) && compareDeep(substitution, o.substitution, true) - && compareDeep(priorPrescription, o.priorPrescription, true) && compareDeep(eventHistory, o.eventHistory, true) - ; + && compareDeep(dateWritten, o.dateWritten, true) && compareDeep(requester, o.requester, true) && compareDeep(reasonCode, o.reasonCode, true) + && compareDeep(reasonReference, o.reasonReference, true) && compareDeep(note, o.note, true) && compareDeep(category, o.category, true) + && compareDeep(dosageInstruction, o.dosageInstruction, true) && compareDeep(dispenseRequest, o.dispenseRequest, true) + && compareDeep(substitution, o.substitution, true) && compareDeep(priorPrescription, o.priorPrescription, true) + && compareDeep(eventHistory, o.eventHistory, true); } @Override @@ -2357,7 +2351,7 @@ public class MedicationRequest extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, definition, basedOn , requisition, status, stage, medication, patient, context, supportingInformation - , dateWritten, prescriber, reasonCode, reasonReference, note, category, dosageInstruction + , dateWritten, requester, reasonCode, reasonReference, note, category, dosageInstruction , dispenseRequest, substitution, priorPrescription, eventHistory); } @@ -2367,30 +2361,30 @@ public class MedicationRequest extends DomainResource { } /** - * Search parameter: prescriber + * Search parameter: requester *

* Description: Returns prescriptions prescribed by this prescriber
* Type: reference
- * Path: MedicationRequest.prescriber
+ * Path: MedicationRequest.requester
*

*/ - @SearchParamDefinition(name="prescriber", path="MedicationRequest.prescriber", description="Returns prescriptions prescribed by this prescriber", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } ) - public static final String SP_PRESCRIBER = "prescriber"; + @SearchParamDefinition(name="requester", path="MedicationRequest.requester", description="Returns prescriptions prescribed by this prescriber", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } ) + public static final String SP_REQUESTER = "requester"; /** - * Fluent Client search parameter constant for prescriber + * Fluent Client search parameter constant for requester *

* Description: Returns prescriptions prescribed by this prescriber
* Type: reference
- * Path: MedicationRequest.prescriber
+ * Path: MedicationRequest.requester
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIBER); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER); /** * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationRequest:prescriber". + * the path value of "MedicationRequest:requester". */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIBER = new ca.uhn.fhir.model.api.Include("MedicationRequest:prescriber").toLocked(); + public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("MedicationRequest:requester").toLocked(); /** * Search parameter: identifier @@ -2556,6 +2550,26 @@ public class MedicationRequest extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationRequest:medication").toLocked(); + /** + * Search parameter: category + *

+ * Description: Returns prescriptions with different categories
+ * Type: token
+ * Path: MedicationRequest.category
+ *

+ */ + @SearchParamDefinition(name="category", path="MedicationRequest.category", description="Returns prescriptions with different categories", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: Returns prescriptions with different categories
+ * Type: token
+ * Path: MedicationRequest.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + /** * Search parameter: status *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationStatement.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationStatement.java index 85f2e3eb64f..1f4c3f06f4f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationStatement.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MedicationStatement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -454,16 +454,16 @@ public class MedicationStatement extends DomainResource { protected Type medication; /** - * The person or animal who is/was taking the medication. + * The person, animal or group who is/was taking the medication. */ - @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who is/was taking the medication", formalDefinition="The person or animal who is/was taking the medication." ) - protected Reference patient; + @Child(name = "subject", type = {Patient.class, Group.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who is/was taking the medication", formalDefinition="The person, animal or group who is/was taking the medication." ) + protected Reference subject; /** - * The actual object that is the target of the reference (The person or animal who is/was taking the medication.) + * The actual object that is the target of the reference (The person, animal or group who is/was taking the medication.) */ - protected Patient patientTarget; + protected Resource subjectTarget; /** * The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true). @@ -516,26 +516,27 @@ public class MedicationStatement extends DomainResource { */ @Child(name = "reasonNotTaken", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="True if asserting medication was not given", formalDefinition="A code indicating why the medication was not taken." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reason-medication-not-taken-codes") protected List reasonNotTaken; /** * A reason for why the medication is being/was taken. */ - @Child(name = "reasonForUseCode", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "reasonForUseCodeableConcept", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Reason for why the medication is being/was taken", formalDefinition="A reason for why the medication is being/was taken." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code") - protected List reasonForUseCode; + protected List reasonForUseCodeableConcept; /** - * Condition that supports why the medication is being/was taken. + * Condition or observation that supports why the medication is being/was taken. */ - @Child(name = "reasonForUseReference", type = {Condition.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Condition that supports why the medication is being/was taken", formalDefinition="Condition that supports why the medication is being/was taken." ) + @Child(name = "reasonForUseReference", type = {Condition.class, Observation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Condition or observation that supports why the medication is being/was taken", formalDefinition="Condition or observation that supports why the medication is being/was taken." ) protected List reasonForUseReference; /** - * The actual objects that are the target of the reference (Condition that supports why the medication is being/was taken.) + * The actual objects that are the target of the reference (Condition or observation that supports why the medication is being/was taken.) */ - protected List reasonForUseReferenceTarget; + protected List reasonForUseReferenceTarget; /** @@ -560,7 +561,7 @@ public class MedicationStatement extends DomainResource { @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) protected List dosage; - private static final long serialVersionUID = -2066984119L; + private static final long serialVersionUID = 556528083L; /** * Constructor @@ -572,11 +573,11 @@ public class MedicationStatement extends DomainResource { /** * Constructor */ - public MedicationStatement(Enumeration status, Type medication, Reference patient) { + public MedicationStatement(Enumeration status, Type medication, Reference subject) { super(); this.status = status; this.medication = medication; - this.patient = patient; + this.subject = subject; } /** @@ -723,46 +724,41 @@ public class MedicationStatement extends DomainResource { } /** - * @return {@link #patient} (The person or animal who is/was taking the medication.) + * @return {@link #subject} (The person, animal or group who is/was taking the medication.) */ - public Reference getPatient() { - if (this.patient == null) + public Reference getSubject() { + if (this.subject == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.patient"); + throw new Error("Attempt to auto-create MedicationStatement.subject"); else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; + this.subject = new Reference(); // cc + return this.subject; } - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); } /** - * @param value {@link #patient} (The person or animal who is/was taking the medication.) + * @param value {@link #subject} (The person, animal or group who is/was taking the medication.) */ - public MedicationStatement setPatient(Reference value) { - this.patient = value; + public MedicationStatement setSubject(Reference value) { + this.subject = 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 person or animal who is/was taking the medication.) + * @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 person, animal or group who is/was taking the medication.) */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; + public Resource getSubjectTarget() { + return this.subjectTarget; } /** - * @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 person or animal who is/was taking the medication.) + * @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 person, animal or group who is/was taking the medication.) */ - public MedicationStatement setPatientTarget(Patient value) { - this.patientTarget = value; + public MedicationStatement setSubjectTarget(Resource value) { + this.subjectTarget = value; return this; } @@ -1065,60 +1061,60 @@ public class MedicationStatement extends DomainResource { } /** - * @return {@link #reasonForUseCode} (A reason for why the medication is being/was taken.) + * @return {@link #reasonForUseCodeableConcept} (A reason for why the medication is being/was taken.) */ - public List getReasonForUseCode() { - if (this.reasonForUseCode == null) - this.reasonForUseCode = new ArrayList(); - return this.reasonForUseCode; + public List getReasonForUseCodeableConcept() { + if (this.reasonForUseCodeableConcept == null) + this.reasonForUseCodeableConcept = new ArrayList(); + return this.reasonForUseCodeableConcept; } /** * @return Returns a reference to this for easy method chaining */ - public MedicationStatement setReasonForUseCode(List theReasonForUseCode) { - this.reasonForUseCode = theReasonForUseCode; + public MedicationStatement setReasonForUseCodeableConcept(List theReasonForUseCodeableConcept) { + this.reasonForUseCodeableConcept = theReasonForUseCodeableConcept; return this; } - public boolean hasReasonForUseCode() { - if (this.reasonForUseCode == null) + public boolean hasReasonForUseCodeableConcept() { + if (this.reasonForUseCodeableConcept == null) return false; - for (CodeableConcept item : this.reasonForUseCode) + for (CodeableConcept item : this.reasonForUseCodeableConcept) if (!item.isEmpty()) return true; return false; } - public CodeableConcept addReasonForUseCode() { //3 + public CodeableConcept addReasonForUseCodeableConcept() { //3 CodeableConcept t = new CodeableConcept(); - if (this.reasonForUseCode == null) - this.reasonForUseCode = new ArrayList(); - this.reasonForUseCode.add(t); + if (this.reasonForUseCodeableConcept == null) + this.reasonForUseCodeableConcept = new ArrayList(); + this.reasonForUseCodeableConcept.add(t); return t; } - public MedicationStatement addReasonForUseCode(CodeableConcept t) { //3 + public MedicationStatement addReasonForUseCodeableConcept(CodeableConcept t) { //3 if (t == null) return this; - if (this.reasonForUseCode == null) - this.reasonForUseCode = new ArrayList(); - this.reasonForUseCode.add(t); + if (this.reasonForUseCodeableConcept == null) + this.reasonForUseCodeableConcept = new ArrayList(); + this.reasonForUseCodeableConcept.add(t); return this; } /** - * @return The first repetition of repeating field {@link #reasonForUseCode}, creating it if it does not already exist + * @return The first repetition of repeating field {@link #reasonForUseCodeableConcept}, creating it if it does not already exist */ - public CodeableConcept getReasonForUseCodeFirstRep() { - if (getReasonForUseCode().isEmpty()) { - addReasonForUseCode(); + public CodeableConcept getReasonForUseCodeableConceptFirstRep() { + if (getReasonForUseCodeableConcept().isEmpty()) { + addReasonForUseCodeableConcept(); } - return getReasonForUseCode().get(0); + return getReasonForUseCodeableConcept().get(0); } /** - * @return {@link #reasonForUseReference} (Condition that supports why the medication is being/was taken.) + * @return {@link #reasonForUseReference} (Condition or observation that supports why the medication is being/was taken.) */ public List getReasonForUseReference() { if (this.reasonForUseReference == null) @@ -1174,24 +1170,12 @@ public class MedicationStatement extends DomainResource { * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated - public List getReasonForUseReferenceTarget() { + public List getReasonForUseReferenceTarget() { if (this.reasonForUseReferenceTarget == null) - this.reasonForUseReferenceTarget = new ArrayList(); + this.reasonForUseReferenceTarget = new ArrayList(); return this.reasonForUseReferenceTarget; } - /** - * @deprecated Use Reference#setResource(IBaseResource) instead - */ - @Deprecated - public Condition addReasonForUseReferenceTarget() { - Condition r = new Condition(); - if (this.reasonForUseReferenceTarget == null) - this.reasonForUseReferenceTarget = new ArrayList(); - this.reasonForUseReferenceTarget.add(r); - return r; - } - /** * @return {@link #note} (Provides extra information about the medication statement that is not conveyed by the other attributes.) */ @@ -1352,15 +1336,15 @@ public class MedicationStatement extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.", 0, java.lang.Integer.MAX_VALUE, status)); childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal who is/was taking the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("subject", "Reference(Patient|Group)", "The person, animal or group who is/was taking the medication.", 0, java.lang.Integer.MAX_VALUE, subject)); childrenList.add(new Property("effective[x]", "dateTime|Period", "The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).", 0, java.lang.Integer.MAX_VALUE, effective)); childrenList.add(new Property("informationSource", "Reference(Patient|Practitioner|RelatedPerson|Organization)", "The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g Claim or MedicationRequest.", 0, java.lang.Integer.MAX_VALUE, informationSource)); childrenList.add(new Property("derivedFrom", "Reference(Any)", "Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement.", 0, java.lang.Integer.MAX_VALUE, derivedFrom)); childrenList.add(new Property("dateAsserted", "dateTime", "The date when the medication statement was asserted by the information source.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); childrenList.add(new Property("notTaken", "code", "Indicator of the certainty of whether the medication was taken by the patient.", 0, java.lang.Integer.MAX_VALUE, notTaken)); childrenList.add(new Property("reasonNotTaken", "CodeableConcept", "A code indicating why the medication was not taken.", 0, java.lang.Integer.MAX_VALUE, reasonNotTaken)); - childrenList.add(new Property("reasonForUseCode", "CodeableConcept", "A reason for why the medication is being/was taken.", 0, java.lang.Integer.MAX_VALUE, reasonForUseCode)); - childrenList.add(new Property("reasonForUseReference", "Reference(Condition)", "Condition that supports why the medication is being/was taken.", 0, java.lang.Integer.MAX_VALUE, reasonForUseReference)); + childrenList.add(new Property("reasonForUseCodeableConcept", "CodeableConcept", "A reason for why the medication is being/was taken.", 0, java.lang.Integer.MAX_VALUE, reasonForUseCodeableConcept)); + childrenList.add(new Property("reasonForUseReference", "Reference(Condition|Observation)", "Condition or observation that supports why the medication is being/was taken.", 0, java.lang.Integer.MAX_VALUE, reasonForUseReference)); childrenList.add(new Property("note", "Annotation", "Provides extra information about the medication statement that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); childrenList.add(new Property("category", "code", "Indicates where type of medication statement and where the medication is expected to be consumed or administered.", 0, java.lang.Integer.MAX_VALUE, category)); childrenList.add(new Property("dosage", "DosageInstruction", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); @@ -1372,14 +1356,14 @@ public class MedicationStatement extends DomainResource { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference + case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type case -2123220889: /*informationSource*/ return this.informationSource == null ? new Base[0] : new Base[] {this.informationSource}; // Reference case 1077922663: /*derivedFrom*/ return this.derivedFrom == null ? new Base[0] : this.derivedFrom.toArray(new Base[this.derivedFrom.size()]); // Reference case -1980855245: /*dateAsserted*/ return this.dateAsserted == null ? new Base[0] : new Base[] {this.dateAsserted}; // DateTimeType case 1565822388: /*notTaken*/ return this.notTaken == null ? new Base[0] : new Base[] {this.notTaken}; // Enumeration case 2112880664: /*reasonNotTaken*/ return this.reasonNotTaken == null ? new Base[0] : this.reasonNotTaken.toArray(new Base[this.reasonNotTaken.size()]); // CodeableConcept - case -1558446993: /*reasonForUseCode*/ return this.reasonForUseCode == null ? new Base[0] : this.reasonForUseCode.toArray(new Base[this.reasonForUseCode.size()]); // CodeableConcept + case 909630431: /*reasonForUseCodeableConcept*/ return this.reasonForUseCodeableConcept == null ? new Base[0] : this.reasonForUseCodeableConcept.toArray(new Base[this.reasonForUseCodeableConcept.size()]); // CodeableConcept case -370888183: /*reasonForUseReference*/ return this.reasonForUseReference == null ? new Base[0] : this.reasonForUseReference.toArray(new Base[this.reasonForUseReference.size()]); // Reference case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration @@ -1401,8 +1385,8 @@ public class MedicationStatement extends DomainResource { case 1998965455: // medication this.medication = castToType(value); // Type break; - case -791418107: // patient - this.patient = castToReference(value); // Reference + case -1867885268: // subject + this.subject = castToReference(value); // Reference break; case -1468651097: // effective this.effective = castToType(value); // Type @@ -1422,8 +1406,8 @@ public class MedicationStatement extends DomainResource { case 2112880664: // reasonNotTaken this.getReasonNotTaken().add(castToCodeableConcept(value)); // CodeableConcept break; - case -1558446993: // reasonForUseCode - this.getReasonForUseCode().add(castToCodeableConcept(value)); // CodeableConcept + case 909630431: // reasonForUseCodeableConcept + this.getReasonForUseCodeableConcept().add(castToCodeableConcept(value)); // CodeableConcept break; case -370888183: // reasonForUseReference this.getReasonForUseReference().add(castToReference(value)); // Reference @@ -1450,8 +1434,8 @@ public class MedicationStatement extends DomainResource { this.status = new MedicationStatementStatusEnumFactory().fromType(value); // Enumeration else if (name.equals("medication[x]")) this.medication = castToType(value); // Type - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference + else if (name.equals("subject")) + this.subject = castToReference(value); // Reference else if (name.equals("effective[x]")) this.effective = castToType(value); // Type else if (name.equals("informationSource")) @@ -1464,8 +1448,8 @@ public class MedicationStatement extends DomainResource { this.notTaken = new MedicationStatementNotTakenEnumFactory().fromType(value); // Enumeration else if (name.equals("reasonNotTaken")) this.getReasonNotTaken().add(castToCodeableConcept(value)); - else if (name.equals("reasonForUseCode")) - this.getReasonForUseCode().add(castToCodeableConcept(value)); + else if (name.equals("reasonForUseCodeableConcept")) + this.getReasonForUseCodeableConcept().add(castToCodeableConcept(value)); else if (name.equals("reasonForUseReference")) this.getReasonForUseReference().add(castToReference(value)); else if (name.equals("note")) @@ -1484,14 +1468,14 @@ public class MedicationStatement extends DomainResource { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration case 1458402129: return getMedication(); // Type - case -791418107: return getPatient(); // Reference + case -1867885268: return getSubject(); // Reference case 247104889: return getEffective(); // Type case -2123220889: return getInformationSource(); // Reference case 1077922663: return addDerivedFrom(); // Reference case -1980855245: throw new FHIRException("Cannot make property dateAsserted as it is not a complex type"); // DateTimeType case 1565822388: throw new FHIRException("Cannot make property notTaken as it is not a complex type"); // Enumeration case 2112880664: return addReasonNotTaken(); // CodeableConcept - case -1558446993: return addReasonForUseCode(); // CodeableConcept + case 909630431: return addReasonForUseCodeableConcept(); // CodeableConcept case -370888183: return addReasonForUseReference(); // Reference case 3387378: return addNote(); // Annotation case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration @@ -1517,9 +1501,9 @@ public class MedicationStatement extends DomainResource { this.medication = new Reference(); return this.medication; } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; + else if (name.equals("subject")) { + this.subject = new Reference(); + return this.subject; } else if (name.equals("effectiveDateTime")) { this.effective = new DateTimeType(); @@ -1545,8 +1529,8 @@ public class MedicationStatement extends DomainResource { else if (name.equals("reasonNotTaken")) { return addReasonNotTaken(); } - else if (name.equals("reasonForUseCode")) { - return addReasonForUseCode(); + else if (name.equals("reasonForUseCodeableConcept")) { + return addReasonForUseCodeableConcept(); } else if (name.equals("reasonForUseReference")) { return addReasonForUseReference(); @@ -1579,7 +1563,7 @@ public class MedicationStatement extends DomainResource { }; dst.status = status == null ? null : status.copy(); dst.medication = medication == null ? null : medication.copy(); - dst.patient = patient == null ? null : patient.copy(); + dst.subject = subject == null ? null : subject.copy(); dst.effective = effective == null ? null : effective.copy(); dst.informationSource = informationSource == null ? null : informationSource.copy(); if (derivedFrom != null) { @@ -1594,10 +1578,10 @@ public class MedicationStatement extends DomainResource { for (CodeableConcept i : reasonNotTaken) dst.reasonNotTaken.add(i.copy()); }; - if (reasonForUseCode != null) { - dst.reasonForUseCode = new ArrayList(); - for (CodeableConcept i : reasonForUseCode) - dst.reasonForUseCode.add(i.copy()); + if (reasonForUseCodeableConcept != null) { + dst.reasonForUseCodeableConcept = new ArrayList(); + for (CodeableConcept i : reasonForUseCodeableConcept) + dst.reasonForUseCodeableConcept.add(i.copy()); }; if (reasonForUseReference != null) { dst.reasonForUseReference = new ArrayList(); @@ -1630,10 +1614,10 @@ public class MedicationStatement extends DomainResource { return false; MedicationStatement o = (MedicationStatement) other; return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) - && compareDeep(patient, o.patient, true) && compareDeep(effective, o.effective, true) && compareDeep(informationSource, o.informationSource, true) + && compareDeep(subject, o.subject, true) && compareDeep(effective, o.effective, true) && compareDeep(informationSource, o.informationSource, true) && compareDeep(derivedFrom, o.derivedFrom, true) && compareDeep(dateAsserted, o.dateAsserted, true) && compareDeep(notTaken, o.notTaken, true) && compareDeep(reasonNotTaken, o.reasonNotTaken, true) - && compareDeep(reasonForUseCode, o.reasonForUseCode, true) && compareDeep(reasonForUseReference, o.reasonForUseReference, true) + && compareDeep(reasonForUseCodeableConcept, o.reasonForUseCodeableConcept, true) && compareDeep(reasonForUseReference, o.reasonForUseReference, true) && compareDeep(note, o.note, true) && compareDeep(category, o.category, true) && compareDeep(dosage, o.dosage, true) ; } @@ -1651,8 +1635,8 @@ public class MedicationStatement extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, medication - , patient, effective, informationSource, derivedFrom, dateAsserted, notTaken, reasonNotTaken - , reasonForUseCode, reasonForUseReference, note, category, dosage); + , subject, effective, informationSource, derivedFrom, dateAsserted, notTaken, reasonNotTaken + , reasonForUseCodeableConcept, reasonForUseReference, note, category, dosage); } @Override @@ -1721,30 +1705,30 @@ public class MedicationStatement extends DomainResource { public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); /** - * Search parameter: patient + * Search parameter: subject *

- * Description: The identity of a patient to list statements for
+ * Description: The identity of a patient, animal or group to list statements for
* Type: reference
- * Path: MedicationStatement.patient
+ * Path: MedicationStatement.subject
*

*/ - @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list statements for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } ) - public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="subject", path="MedicationStatement.subject", description="The identity of a patient, animal or group to list statements for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Group.class, Patient.class } ) + public static final String SP_SUBJECT = "subject"; /** - * Fluent Client search parameter constant for patient + * Fluent Client search parameter constant for subject *

- * Description: The identity of a patient to list statements for
+ * Description: The identity of a patient, animal or group to list statements for
* Type: reference
- * Path: MedicationStatement.patient
+ * Path: MedicationStatement.subject
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); /** * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationStatement:patient". + * the path value of "MedicationStatement:subject". */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationStatement:patient").toLocked(); + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MedicationStatement:subject").toLocked(); /** * Search parameter: medication @@ -1780,7 +1764,7 @@ public class MedicationStatement extends DomainResource { * Path: MedicationStatement.informationSource
*

*/ - @SearchParamDefinition(name="source", path="MedicationStatement.informationSource", description="Who or where the information in the statement came from", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } ) + @SearchParamDefinition(name="source", path="MedicationStatement.informationSource", description="Who or where the information in the statement came from", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } ) public static final String SP_SOURCE = "source"; /** * Fluent Client search parameter constant for source @@ -1798,6 +1782,26 @@ public class MedicationStatement extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("MedicationStatement:source").toLocked(); + /** + * Search parameter: category + *

+ * Description: Returns statements of this category of medicationstatement
+ * Type: token
+ * Path: MedicationStatement.category
+ *

+ */ + @SearchParamDefinition(name="category", path="MedicationStatement.category", description="Returns statements of this category of medicationstatement", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: Returns statements of this category of medicationstatement
+ * Type: token
+ * Path: MedicationStatement.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + /** * Search parameter: status *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MessageDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MessageDefinition.java new file mode 100644 index 00000000000..2bad052f529 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MessageDefinition.java @@ -0,0 +1,2581 @@ +package org.hl7.fhir.dstu3.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 6, 2016 09:42-0500 for FHIR v1.8.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.dstu3.model.Enumerations.*; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.ChildOrder; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Block; +import org.hl7.fhir.instance.model.api.*; +import org.hl7.fhir.exceptions.FHIRException; +/** + * Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + */ +@ResourceDef(name="MessageDefinition", profile="http://hl7.org/fhir/Profile/MessageDefinition") +@ChildOrder(names={"url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "base", "parent", "replaces", "event", "category", "focus", "responseRequired", "allowedResponse"}) +public class MessageDefinition extends MetadataResource { + + public enum MessageSignificanceCategory { + /** + * The message represents/requests a change that should not be processed more than once; e.g. Making a booking for an appointment. + */ + CONSEQUENCE, + /** + * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful. + */ + CURRENCY, + /** + * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications. + */ + NOTIFICATION, + /** + * added to help the parsers with the generic types + */ + NULL; + public static MessageSignificanceCategory fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("Consequence".equals(codeString)) + return CONSEQUENCE; + if ("Currency".equals(codeString)) + return CURRENCY; + if ("Notification".equals(codeString)) + return NOTIFICATION; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CONSEQUENCE: return "Consequence"; + case CURRENCY: return "Currency"; + case NOTIFICATION: return "Notification"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CONSEQUENCE: return "http://hl7.org/fhir/message-significance-category"; + case CURRENCY: return "http://hl7.org/fhir/message-significance-category"; + case NOTIFICATION: return "http://hl7.org/fhir/message-significance-category"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once; e.g. Making a booking for an appointment."; + case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful."; + case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CONSEQUENCE: return "Consequence"; + case CURRENCY: return "Currency"; + case NOTIFICATION: return "Notification"; + default: return "?"; + } + } + } + + 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; + if ("Consequence".equals(codeString)) + return MessageSignificanceCategory.CONSEQUENCE; + if ("Currency".equals(codeString)) + return MessageSignificanceCategory.CURRENCY; + if ("Notification".equals(codeString)) + return MessageSignificanceCategory.NOTIFICATION; + throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("Consequence".equals(codeString)) + return new Enumeration(this, MessageSignificanceCategory.CONSEQUENCE); + if ("Currency".equals(codeString)) + return new Enumeration(this, MessageSignificanceCategory.CURRENCY); + if ("Notification".equals(codeString)) + return new Enumeration(this, MessageSignificanceCategory.NOTIFICATION); + throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public String toCode(MessageSignificanceCategory code) { + if (code == MessageSignificanceCategory.CONSEQUENCE) + return "Consequence"; + if (code == MessageSignificanceCategory.CURRENCY) + return "Currency"; + if (code == MessageSignificanceCategory.NOTIFICATION) + return "Notification"; + return "?"; + } + public String toSystem(MessageSignificanceCategory code) { + return code.getSystem(); + } + } + + @Block() + public static class MessageDefinitionFocusComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of resource that must be the focus for this message. + */ + @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type of resource", formalDefinition="The kind of resource that must be the focus for this message." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types") + protected CodeType code; + + /** + * A profile that reflects constraints for the focal resource (and potentially for related resources). + */ + @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Profile that must be adhered to by focus", formalDefinition="A profile that reflects constraints for the focal resource (and potentially for related resources)." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A profile that reflects constraints for the focal resource (and potentially for related resources).) + */ + protected StructureDefinition profileTarget; + + /** + * Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. + */ + @Child(name = "min", type = {UnsignedIntType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Minimum number of focuses of this type", formalDefinition="Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition." ) + protected UnsignedIntType min; + + /** + * Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. + */ + @Child(name = "max", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Maximum number of focuses of this type", formalDefinition="Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition." ) + protected StringType max; + + private static final long serialVersionUID = 35658543L; + + /** + * Constructor + */ + public MessageDefinitionFocusComponent() { + super(); + } + + /** + * Constructor + */ + public MessageDefinitionFocusComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (The kind of resource that must be the focus for this message.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinitionFocusComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); // bb + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The kind of resource that must be the focus for this message.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public MessageDefinitionFocusComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return The kind of resource that must be the focus for this message. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The kind of resource that must be the focus for this message. + */ + public MessageDefinitionFocusComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #profile} (A profile that reflects constraints for the focal resource (and potentially for related resources).) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinitionFocusComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); // cc + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A profile that reflects constraints for the focal resource (and potentially for related resources).) + */ + public MessageDefinitionFocusComponent 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 that reflects constraints for the focal resource (and potentially for related resources).) + */ + public StructureDefinition getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinitionFocusComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new StructureDefinition(); // aa + 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 that reflects constraints for the focal resource (and potentially for related resources).) + */ + public MessageDefinitionFocusComponent setProfileTarget(StructureDefinition value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #min} (Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public UnsignedIntType getMinElement() { + if (this.min == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinitionFocusComponent.min"); + else if (Configuration.doAutoCreate()) + this.min = new UnsignedIntType(); // bb + 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} (Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public MessageDefinitionFocusComponent setMinElement(UnsignedIntType value) { + this.min = value; + return this; + } + + /** + * @return Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. + */ + public int getMin() { + return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. + */ + public MessageDefinitionFocusComponent setMin(int value) { + if (this.min == null) + this.min = new UnsignedIntType(); + this.min.setValue(value); + return this; + } + + /** + * @return {@link #max} (Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.). 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 MessageDefinitionFocusComponent.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + 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} (Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public MessageDefinitionFocusComponent setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. + */ + public String getMax() { + return this.max == null ? null : this.max.getValue(); + } + + /** + * @param value Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. + */ + public MessageDefinitionFocusComponent setMax(String value) { + if (Utilities.noString(value)) + this.max = null; + else { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "The kind of resource that must be the focus for this message.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A profile that reflects constraints for the focal resource (and potentially for related resources).", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("min", "unsignedInt", "Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.", 0, java.lang.Integer.MAX_VALUE, min)); + childrenList.add(new Property("max", "string", "Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.", 0, java.lang.Integer.MAX_VALUE, max)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType + case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference + case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // UnsignedIntType + case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3059181: // code + this.code = castToCode(value); // CodeType + break; + case -309425751: // profile + this.profile = castToReference(value); // Reference + break; + case 108114: // min + this.min = castToUnsignedInt(value); // UnsignedIntType + break; + case 107876: // max + this.max = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("code")) + this.code = castToCode(value); // CodeType + else if (name.equals("profile")) + this.profile = castToReference(value); // Reference + else if (name.equals("min")) + this.min = castToUnsignedInt(value); // UnsignedIntType + else if (name.equals("max")) + this.max = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType + case -309425751: return getProfile(); // Reference + case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // UnsignedIntType + case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("code")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.code"); + } + else if (name.equals("profile")) { + this.profile = new Reference(); + return this.profile; + } + else if (name.equals("min")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.min"); + } + else if (name.equals("max")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.max"); + } + else + return super.addChild(name); + } + + public MessageDefinitionFocusComponent copy() { + MessageDefinitionFocusComponent dst = new MessageDefinitionFocusComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.profile = profile == null ? null : profile.copy(); + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageDefinitionFocusComponent)) + return false; + MessageDefinitionFocusComponent o = (MessageDefinitionFocusComponent) other; + return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(min, o.min, true) + && compareDeep(max, o.max, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageDefinitionFocusComponent)) + return false; + MessageDefinitionFocusComponent o = (MessageDefinitionFocusComponent) other; + return compareValues(code, o.code, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, profile, min, max + ); + } + + public String fhirType() { + return "MessageDefinition.focus"; + + } + + } + + @Block() + public static class MessageDefinitionAllowedResponseComponent extends BackboneElement implements IBaseBackboneElement { + /** + * A reference to the message definition that must be adhered to by this supported response. + */ + @Child(name = "message", type = {MessageDefinition.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="MessageDefinition for response", formalDefinition="A reference to the message definition that must be adhered to by this supported response." ) + protected Reference message; + + /** + * The actual object that is the target of the reference (A reference to the message definition that must be adhered to by this supported response.) + */ + protected MessageDefinition messageTarget; + + /** + * Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses). + */ + @Child(name = "situation", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="When should this response be used", formalDefinition="Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses)." ) + protected MarkdownType situation; + + private static final long serialVersionUID = 825230127L; + + /** + * Constructor + */ + public MessageDefinitionAllowedResponseComponent() { + super(); + } + + /** + * Constructor + */ + public MessageDefinitionAllowedResponseComponent(Reference message) { + super(); + this.message = message; + } + + /** + * @return {@link #message} (A reference to the message definition that must be adhered to by this supported response.) + */ + public Reference getMessage() { + if (this.message == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinitionAllowedResponseComponent.message"); + else if (Configuration.doAutoCreate()) + this.message = new Reference(); // cc + return this.message; + } + + public boolean hasMessage() { + return this.message != null && !this.message.isEmpty(); + } + + /** + * @param value {@link #message} (A reference to the message definition that must be adhered to by this supported response.) + */ + public MessageDefinitionAllowedResponseComponent setMessage(Reference value) { + this.message = value; + return this; + } + + /** + * @return {@link #message} 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 message definition that must be adhered to by this supported response.) + */ + public MessageDefinition getMessageTarget() { + if (this.messageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinitionAllowedResponseComponent.message"); + else if (Configuration.doAutoCreate()) + this.messageTarget = new MessageDefinition(); // aa + return this.messageTarget; + } + + /** + * @param value {@link #message} 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 message definition that must be adhered to by this supported response.) + */ + public MessageDefinitionAllowedResponseComponent setMessageTarget(MessageDefinition value) { + this.messageTarget = value; + return this; + } + + /** + * @return {@link #situation} (Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).). This is the underlying object with id, value and extensions. The accessor "getSituation" gives direct access to the value + */ + public MarkdownType getSituationElement() { + if (this.situation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinitionAllowedResponseComponent.situation"); + else if (Configuration.doAutoCreate()) + this.situation = new MarkdownType(); // bb + return this.situation; + } + + public boolean hasSituationElement() { + return this.situation != null && !this.situation.isEmpty(); + } + + public boolean hasSituation() { + return this.situation != null && !this.situation.isEmpty(); + } + + /** + * @param value {@link #situation} (Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).). This is the underlying object with id, value and extensions. The accessor "getSituation" gives direct access to the value + */ + public MessageDefinitionAllowedResponseComponent setSituationElement(MarkdownType value) { + this.situation = value; + return this; + } + + /** + * @return Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses). + */ + public String getSituation() { + return this.situation == null ? null : this.situation.getValue(); + } + + /** + * @param value Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses). + */ + public MessageDefinitionAllowedResponseComponent setSituation(String value) { + if (value == null) + this.situation = null; + else { + if (this.situation == null) + this.situation = new MarkdownType(); + this.situation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("message", "Reference(MessageDefinition)", "A reference to the message definition that must be adhered to by this supported response.", 0, java.lang.Integer.MAX_VALUE, message)); + childrenList.add(new Property("situation", "markdown", "Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).", 0, java.lang.Integer.MAX_VALUE, situation)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 954925063: /*message*/ return this.message == null ? new Base[0] : new Base[] {this.message}; // Reference + case -73377282: /*situation*/ return this.situation == null ? new Base[0] : new Base[] {this.situation}; // MarkdownType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 954925063: // message + this.message = castToReference(value); // Reference + break; + case -73377282: // situation + this.situation = castToMarkdown(value); // MarkdownType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("message")) + this.message = castToReference(value); // Reference + else if (name.equals("situation")) + this.situation = castToMarkdown(value); // MarkdownType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 954925063: return getMessage(); // Reference + case -73377282: throw new FHIRException("Cannot make property situation as it is not a complex type"); // MarkdownType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("message")) { + this.message = new Reference(); + return this.message; + } + else if (name.equals("situation")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.situation"); + } + else + return super.addChild(name); + } + + public MessageDefinitionAllowedResponseComponent copy() { + MessageDefinitionAllowedResponseComponent dst = new MessageDefinitionAllowedResponseComponent(); + copyValues(dst); + dst.message = message == null ? null : message.copy(); + dst.situation = situation == null ? null : situation.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageDefinitionAllowedResponseComponent)) + return false; + MessageDefinitionAllowedResponseComponent o = (MessageDefinitionAllowedResponseComponent) other; + return compareDeep(message, o.message, true) && compareDeep(situation, o.situation, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageDefinitionAllowedResponseComponent)) + return false; + MessageDefinitionAllowedResponseComponent o = (MessageDefinitionAllowedResponseComponent) other; + return compareValues(situation, o.situation, true); + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(message, situation); + } + + public String fhirType() { + return "MessageDefinition.allowedResponse"; + + } + + } + + /** + * Explains why this message definition is needed and why it has been designed as it has. + */ + @Child(name = "purpose", type = {MarkdownType.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Why this message definition is defined", formalDefinition="Explains why this message definition is needed and why it has been designed as it has." ) + protected MarkdownType purpose; + + /** + * A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition. + */ + @Child(name = "copyright", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition." ) + protected MarkdownType copyright; + + /** + * The MessageDefinition this new definition is a profile of. + */ + @Child(name = "base", type = {MessageDefinition.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Definition this one is based on", formalDefinition="The MessageDefinition this new definition is a profile of." ) + protected Reference base; + + /** + * The actual object that is the target of the reference (The MessageDefinition this new definition is a profile of.) + */ + protected MessageDefinition baseTarget; + + /** + * Identifies a protocol or workflow that this MessageDefinition represents a step in. + */ + @Child(name = "parent", type = {ActivityDefinition.class, PlanDefinition.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Protocol/workflow this is part of", formalDefinition="Identifies a protocol or workflow that this MessageDefinition represents a step in." ) + protected List parent; + /** + * The actual objects that are the target of the reference (Identifies a protocol or workflow that this MessageDefinition represents a step in.) + */ + protected List parentTarget; + + + /** + * A MessageDefinition that is superseded by this definition. + */ + @Child(name = "replaces", type = {MessageDefinition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Takes the place of", formalDefinition="A MessageDefinition that is superseded by this definition." ) + protected List replaces; + /** + * The actual objects that are the target of the reference (A MessageDefinition that is superseded by this definition.) + */ + protected List replacesTarget; + + + /** + * A coded identifier of a supported messaging event. + */ + @Child(name = "event", type = {Coding.class}, order=5, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-events") + protected Coding event; + + /** + * The impact of the content of the message. + */ + @Child(name = "category", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-significance-category") + protected Enumeration category; + + /** + * Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge. + */ + @Child(name = "focus", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Resource(s) that are the subject of the event", formalDefinition="Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge." ) + protected List focus; + + /** + * Indicates whether a response is required for this message. + */ + @Child(name = "responseRequired", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Is a response required?", formalDefinition="Indicates whether a response is required for this message." ) + protected BooleanType responseRequired; + + /** + * Indicates what types of messages may be sent as an application-level response to this message. + */ + @Child(name = "allowedResponse", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Responses to this message", formalDefinition="Indicates what types of messages may be sent as an application-level response to this message." ) + protected List allowedResponse; + + private static final long serialVersionUID = -372176378L; + + /** + * Constructor + */ + public MessageDefinition() { + super(); + } + + /** + * Constructor + */ + public MessageDefinition(Enumeration status, DateTimeType date, Coding event) { + super(); + this.status = status; + this.date = date; + this.event = event; + } + + /** + * @return {@link #url} (An absolute URL that is used to identify this message definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this message definition is (or will be) published. The URL SHOULD include the major version of the message definition. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); // bb + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An absolute URL that is used to identify this message definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this message definition is (or will be) published. The URL SHOULD include the major version of the message definition. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public MessageDefinition setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An absolute URL that is used to identify this message definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this message definition is (or will be) published. The URL SHOULD include the major version of the message definition. For more information see [Technical and Business Versions](resource.html#versions). + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An absolute URL that is used to identify this message definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this message definition is (or will be) published. The URL SHOULD include the major version of the message definition. For more information see [Technical and Business Versions](resource.html#versions). + */ + public MessageDefinition setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); // bb + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public MessageDefinition setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable. + */ + public MessageDefinition setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). 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 MessageDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MessageDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. + */ + public MessageDefinition setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (A short, descriptive, user-friendly title for the message definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A short, descriptive, user-friendly title for the message definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public MessageDefinition setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A short, descriptive, user-friendly title for the message definition. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A short, descriptive, user-friendly title for the message definition. + */ + public MessageDefinition setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of this message definition. Enables tracking the life-cycle of the content.). 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 MessageDefinition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new PublicationStatusEnumFactory()); // bb + 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 this message definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MessageDefinition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this message definition. Enables tracking the life-cycle of the content. + */ + public PublicationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this message definition. Enables tracking the life-cycle of the content. + */ + public MessageDefinition setStatus(PublicationStatus value) { + if (this.status == null) + this.status = new Enumeration(new PublicationStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); // bb + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public MessageDefinition setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public MessageDefinition setExperimental(boolean value) { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the message definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.). 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 MessageDefinition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); // bb + 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 date (and optionally time) when the message definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public MessageDefinition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the message definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and optionally time) when the message definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes. + */ + public MessageDefinition setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the message definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); // bb + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the message definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public MessageDefinition setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the message definition. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the message definition. + */ + public MessageDefinition setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public MessageDefinition setContact(List theContact) { + this.contact = theContact; + return this; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactDetail item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + public ContactDetail addContact() { //3 + ContactDetail t = new ContactDetail(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + public MessageDefinition addContact(ContactDetail t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist + */ + public ContactDetail getContactFirstRep() { + if (getContact().isEmpty()) { + addContact(); + } + return getContact().get(0); + } + + /** + * @return {@link #description} (A free text natural language description of the message definition from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public MarkdownType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.description"); + else if (Configuration.doAutoCreate()) + this.description = new MarkdownType(); // bb + 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 free text natural language description of the message definition from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public MessageDefinition setDescriptionElement(MarkdownType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the message definition from the consumer's perspective. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the message definition from the consumer's perspective. + */ + public MessageDefinition setDescription(String value) { + if (value == null) + this.description = null; + else { + if (this.description == null) + this.description = new MarkdownType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.) + */ + public List getUseContext() { + if (this.useContext == null) + this.useContext = new ArrayList(); + return this.useContext; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public MessageDefinition setUseContext(List theUseContext) { + this.useContext = theUseContext; + return this; + } + + public boolean hasUseContext() { + if (this.useContext == null) + return false; + for (UsageContext item : this.useContext) + if (!item.isEmpty()) + return true; + return false; + } + + public UsageContext addUseContext() { //3 + UsageContext t = new UsageContext(); + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return t; + } + + public MessageDefinition addUseContext(UsageContext t) { //3 + if (t == null) + return this; + if (this.useContext == null) + this.useContext = new ArrayList(); + this.useContext.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist + */ + public UsageContext getUseContextFirstRep() { + if (getUseContext().isEmpty()) { + addUseContext(); + } + return getUseContext().get(0); + } + + /** + * @return {@link #jurisdiction} (A jurisdiction in which the message definition is intended to be used.) + */ + public List getJurisdiction() { + if (this.jurisdiction == null) + this.jurisdiction = new ArrayList(); + return this.jurisdiction; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public MessageDefinition setJurisdiction(List theJurisdiction) { + this.jurisdiction = theJurisdiction; + return this; + } + + public boolean hasJurisdiction() { + if (this.jurisdiction == null) + return false; + for (CodeableConcept item : this.jurisdiction) + if (!item.isEmpty()) + return true; + return false; + } + + public CodeableConcept addJurisdiction() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.jurisdiction == null) + this.jurisdiction = new ArrayList(); + this.jurisdiction.add(t); + return t; + } + + public MessageDefinition addJurisdiction(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.jurisdiction == null) + this.jurisdiction = new ArrayList(); + this.jurisdiction.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist + */ + public CodeableConcept getJurisdictionFirstRep() { + if (getJurisdiction().isEmpty()) { + addJurisdiction(); + } + return getJurisdiction().get(0); + } + + /** + * @return {@link #purpose} (Explains why this message definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value + */ + public MarkdownType getPurposeElement() { + if (this.purpose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.purpose"); + else if (Configuration.doAutoCreate()) + this.purpose = new MarkdownType(); // bb + return this.purpose; + } + + public boolean hasPurposeElement() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + public boolean hasPurpose() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + /** + * @param value {@link #purpose} (Explains why this message definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value + */ + public MessageDefinition setPurposeElement(MarkdownType value) { + this.purpose = value; + return this; + } + + /** + * @return Explains why this message definition is needed and why it has been designed as it has. + */ + public String getPurpose() { + return this.purpose == null ? null : this.purpose.getValue(); + } + + /** + * @param value Explains why this message definition is needed and why it has been designed as it has. + */ + public MessageDefinition setPurpose(String value) { + if (value == null) + this.purpose = null; + else { + if (this.purpose == null) + this.purpose = new MarkdownType(); + this.purpose.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public MarkdownType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new MarkdownType(); // bb + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public MessageDefinition setCopyrightElement(MarkdownType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition. + */ + public MessageDefinition setCopyright(String value) { + if (value == null) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new MarkdownType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #base} (The MessageDefinition this new definition is a profile of.) + */ + public Reference getBase() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.base"); + else if (Configuration.doAutoCreate()) + this.base = new Reference(); // cc + return this.base; + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The MessageDefinition this new definition is a profile of.) + */ + public MessageDefinition setBase(Reference value) { + this.base = value; + return this; + } + + /** + * @return {@link #base} 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 MessageDefinition this new definition is a profile of.) + */ + public MessageDefinition getBaseTarget() { + if (this.baseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.base"); + else if (Configuration.doAutoCreate()) + this.baseTarget = new MessageDefinition(); // aa + return this.baseTarget; + } + + /** + * @param value {@link #base} 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 MessageDefinition this new definition is a profile of.) + */ + public MessageDefinition setBaseTarget(MessageDefinition value) { + this.baseTarget = value; + return this; + } + + /** + * @return {@link #parent} (Identifies a protocol or workflow that this MessageDefinition represents a step in.) + */ + public List getParent() { + if (this.parent == null) + this.parent = new ArrayList(); + return this.parent; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public MessageDefinition setParent(List theParent) { + this.parent = theParent; + return this; + } + + public boolean hasParent() { + if (this.parent == null) + return false; + for (Reference item : this.parent) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addParent() { //3 + Reference t = new Reference(); + if (this.parent == null) + this.parent = new ArrayList(); + this.parent.add(t); + return t; + } + + public MessageDefinition addParent(Reference t) { //3 + if (t == null) + return this; + if (this.parent == null) + this.parent = new ArrayList(); + this.parent.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #parent}, creating it if it does not already exist + */ + public Reference getParentFirstRep() { + if (getParent().isEmpty()) { + addParent(); + } + return getParent().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getParentTarget() { + if (this.parentTarget == null) + this.parentTarget = new ArrayList(); + return this.parentTarget; + } + + /** + * @return {@link #replaces} (A MessageDefinition that is superseded by this definition.) + */ + public List getReplaces() { + if (this.replaces == null) + this.replaces = new ArrayList(); + return this.replaces; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public MessageDefinition setReplaces(List theReplaces) { + this.replaces = theReplaces; + return this; + } + + public boolean hasReplaces() { + if (this.replaces == null) + return false; + for (Reference item : this.replaces) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addReplaces() { //3 + Reference t = new Reference(); + if (this.replaces == null) + this.replaces = new ArrayList(); + this.replaces.add(t); + return t; + } + + public MessageDefinition addReplaces(Reference t) { //3 + if (t == null) + return this; + if (this.replaces == null) + this.replaces = new ArrayList(); + this.replaces.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #replaces}, creating it if it does not already exist + */ + public Reference getReplacesFirstRep() { + if (getReplaces().isEmpty()) { + addReplaces(); + } + return getReplaces().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getReplacesTarget() { + if (this.replacesTarget == null) + this.replacesTarget = new ArrayList(); + return this.replacesTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public MessageDefinition addReplacesTarget() { + MessageDefinition r = new MessageDefinition(); + if (this.replacesTarget == null) + this.replacesTarget = new ArrayList(); + this.replacesTarget.add(r); + return r; + } + + /** + * @return {@link #event} (A coded identifier of a supported messaging event.) + */ + public Coding getEvent() { + if (this.event == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.event"); + else if (Configuration.doAutoCreate()) + this.event = new Coding(); // cc + return this.event; + } + + public boolean hasEvent() { + return this.event != null && !this.event.isEmpty(); + } + + /** + * @param value {@link #event} (A coded identifier of a supported messaging event.) + */ + public MessageDefinition setEvent(Coding value) { + this.event = value; + return this; + } + + /** + * @return {@link #category} (The impact of the content of the message.). 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 MessageDefinition.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); // bb + 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} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public MessageDefinition setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return The impact of the content of the message. + */ + public MessageSignificanceCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value The impact of the content of the message. + */ + public MessageDefinition setCategory(MessageSignificanceCategory value) { + if (value == null) + this.category = null; + else { + if (this.category == null) + this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); + this.category.setValue(value); + } + return this; + } + + /** + * @return {@link #focus} (Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge.) + */ + public List getFocus() { + if (this.focus == null) + this.focus = new ArrayList(); + return this.focus; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public MessageDefinition setFocus(List theFocus) { + this.focus = theFocus; + return this; + } + + public boolean hasFocus() { + if (this.focus == null) + return false; + for (MessageDefinitionFocusComponent item : this.focus) + if (!item.isEmpty()) + return true; + return false; + } + + public MessageDefinitionFocusComponent addFocus() { //3 + MessageDefinitionFocusComponent t = new MessageDefinitionFocusComponent(); + if (this.focus == null) + this.focus = new ArrayList(); + this.focus.add(t); + return t; + } + + public MessageDefinition addFocus(MessageDefinitionFocusComponent t) { //3 + if (t == null) + return this; + if (this.focus == null) + this.focus = new ArrayList(); + this.focus.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist + */ + public MessageDefinitionFocusComponent getFocusFirstRep() { + if (getFocus().isEmpty()) { + addFocus(); + } + return getFocus().get(0); + } + + /** + * @return {@link #responseRequired} (Indicates whether a response is required for this message.). This is the underlying object with id, value and extensions. The accessor "getResponseRequired" gives direct access to the value + */ + public BooleanType getResponseRequiredElement() { + if (this.responseRequired == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDefinition.responseRequired"); + else if (Configuration.doAutoCreate()) + this.responseRequired = new BooleanType(); // bb + return this.responseRequired; + } + + public boolean hasResponseRequiredElement() { + return this.responseRequired != null && !this.responseRequired.isEmpty(); + } + + public boolean hasResponseRequired() { + return this.responseRequired != null && !this.responseRequired.isEmpty(); + } + + /** + * @param value {@link #responseRequired} (Indicates whether a response is required for this message.). This is the underlying object with id, value and extensions. The accessor "getResponseRequired" gives direct access to the value + */ + public MessageDefinition setResponseRequiredElement(BooleanType value) { + this.responseRequired = value; + return this; + } + + /** + * @return Indicates whether a response is required for this message. + */ + public boolean getResponseRequired() { + return this.responseRequired == null || this.responseRequired.isEmpty() ? false : this.responseRequired.getValue(); + } + + /** + * @param value Indicates whether a response is required for this message. + */ + public MessageDefinition setResponseRequired(boolean value) { + if (this.responseRequired == null) + this.responseRequired = new BooleanType(); + this.responseRequired.setValue(value); + return this; + } + + /** + * @return {@link #allowedResponse} (Indicates what types of messages may be sent as an application-level response to this message.) + */ + public List getAllowedResponse() { + if (this.allowedResponse == null) + this.allowedResponse = new ArrayList(); + return this.allowedResponse; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public MessageDefinition setAllowedResponse(List theAllowedResponse) { + this.allowedResponse = theAllowedResponse; + return this; + } + + public boolean hasAllowedResponse() { + if (this.allowedResponse == null) + return false; + for (MessageDefinitionAllowedResponseComponent item : this.allowedResponse) + if (!item.isEmpty()) + return true; + return false; + } + + public MessageDefinitionAllowedResponseComponent addAllowedResponse() { //3 + MessageDefinitionAllowedResponseComponent t = new MessageDefinitionAllowedResponseComponent(); + if (this.allowedResponse == null) + this.allowedResponse = new ArrayList(); + this.allowedResponse.add(t); + return t; + } + + public MessageDefinition addAllowedResponse(MessageDefinitionAllowedResponseComponent t) { //3 + if (t == null) + return this; + if (this.allowedResponse == null) + this.allowedResponse = new ArrayList(); + this.allowedResponse.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #allowedResponse}, creating it if it does not already exist + */ + public MessageDefinitionAllowedResponseComponent getAllowedResponseFirstRep() { + if (getAllowedResponse().isEmpty()) { + addAllowedResponse(); + } + return getAllowedResponse().get(0); + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this message definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this message definition is (or will be) published. The URL SHOULD include the major version of the message definition. For more information see [Technical and Business Versions](resource.html#versions).", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("title", "string", "A short, descriptive, user-friendly title for the message definition.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("status", "code", "The status of this message definition. Enables tracking the life-cycle of the content.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the message definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the message definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("description", "markdown", "A free text natural language description of the message definition from the consumer's perspective.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); + childrenList.add(new Property("jurisdiction", "CodeableConcept", "A jurisdiction in which the message definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction)); + childrenList.add(new Property("purpose", "markdown", "Explains why this message definition is needed and why it has been designed as it has.", 0, java.lang.Integer.MAX_VALUE, purpose)); + childrenList.add(new Property("copyright", "markdown", "A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("base", "Reference(MessageDefinition)", "The MessageDefinition this new definition is a profile of.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("parent", "Reference(ActivityDefinition|PlanDefinition)", "Identifies a protocol or workflow that this MessageDefinition represents a step in.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("replaces", "Reference(MessageDefinition)", "A MessageDefinition that is superseded by this definition.", 0, java.lang.Integer.MAX_VALUE, replaces)); + childrenList.add(new Property("event", "Coding", "A coded identifier of a supported messaging event.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("category", "code", "The impact of the content of the message.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("focus", "", "Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge.", 0, java.lang.Integer.MAX_VALUE, focus)); + childrenList.add(new Property("responseRequired", "boolean", "Indicates whether a response is required for this message.", 0, java.lang.Integer.MAX_VALUE, responseRequired)); + childrenList.add(new Property("allowedResponse", "", "Indicates what types of messages may be sent as an application-level response to this message.", 0, java.lang.Integer.MAX_VALUE, allowedResponse)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType + case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType + case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType + case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType + case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext + case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept + case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType + case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType + case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // Reference + case -995424086: /*parent*/ return this.parent == null ? new Base[0] : this.parent.toArray(new Base[this.parent.size()]); // Reference + case -430332865: /*replaces*/ return this.replaces == null ? new Base[0] : this.replaces.toArray(new Base[this.replaces.size()]); // Reference + case 96891546: /*event*/ return this.event == null ? new Base[0] : new Base[] {this.event}; // Coding + case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration + case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // MessageDefinitionFocusComponent + case 791597824: /*responseRequired*/ return this.responseRequired == null ? new Base[0] : new Base[] {this.responseRequired}; // BooleanType + case -1130933751: /*allowedResponse*/ return this.allowedResponse == null ? new Base[0] : this.allowedResponse.toArray(new Base[this.allowedResponse.size()]); // MessageDefinitionAllowedResponseComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 116079: // url + this.url = castToUri(value); // UriType + break; + case 351608024: // version + this.version = castToString(value); // StringType + break; + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case -892481550: // status + this.status = new PublicationStatusEnumFactory().fromType(value); // Enumeration + break; + case -404562712: // experimental + this.experimental = castToBoolean(value); // BooleanType + break; + case 3076014: // date + this.date = castToDateTime(value); // DateTimeType + break; + case 1447404028: // publisher + this.publisher = castToString(value); // StringType + break; + case 951526432: // contact + this.getContact().add(castToContactDetail(value)); // ContactDetail + break; + case -1724546052: // description + this.description = castToMarkdown(value); // MarkdownType + break; + case -669707736: // useContext + this.getUseContext().add(castToUsageContext(value)); // UsageContext + break; + case -507075711: // jurisdiction + this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -220463842: // purpose + this.purpose = castToMarkdown(value); // MarkdownType + break; + case 1522889671: // copyright + this.copyright = castToMarkdown(value); // MarkdownType + break; + case 3016401: // base + this.base = castToReference(value); // Reference + break; + case -995424086: // parent + this.getParent().add(castToReference(value)); // Reference + break; + case -430332865: // replaces + this.getReplaces().add(castToReference(value)); // Reference + break; + case 96891546: // event + this.event = castToCoding(value); // Coding + break; + case 50511102: // category + this.category = new MessageSignificanceCategoryEnumFactory().fromType(value); // Enumeration + break; + case 97604824: // focus + this.getFocus().add((MessageDefinitionFocusComponent) value); // MessageDefinitionFocusComponent + break; + case 791597824: // responseRequired + this.responseRequired = castToBoolean(value); // BooleanType + break; + case -1130933751: // allowedResponse + this.getAllowedResponse().add((MessageDefinitionAllowedResponseComponent) value); // MessageDefinitionAllowedResponseComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("url")) + this.url = castToUri(value); // UriType + else if (name.equals("version")) + this.version = castToString(value); // StringType + else if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("status")) + this.status = new PublicationStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("experimental")) + this.experimental = castToBoolean(value); // BooleanType + else if (name.equals("date")) + this.date = castToDateTime(value); // DateTimeType + else if (name.equals("publisher")) + this.publisher = castToString(value); // StringType + else if (name.equals("contact")) + this.getContact().add(castToContactDetail(value)); + else if (name.equals("description")) + this.description = castToMarkdown(value); // MarkdownType + else if (name.equals("useContext")) + this.getUseContext().add(castToUsageContext(value)); + else if (name.equals("jurisdiction")) + this.getJurisdiction().add(castToCodeableConcept(value)); + else if (name.equals("purpose")) + this.purpose = castToMarkdown(value); // MarkdownType + else if (name.equals("copyright")) + this.copyright = castToMarkdown(value); // MarkdownType + else if (name.equals("base")) + this.base = castToReference(value); // Reference + else if (name.equals("parent")) + this.getParent().add(castToReference(value)); + else if (name.equals("replaces")) + this.getReplaces().add(castToReference(value)); + else if (name.equals("event")) + this.event = castToCoding(value); // Coding + else if (name.equals("category")) + this.category = new MessageSignificanceCategoryEnumFactory().fromType(value); // Enumeration + else if (name.equals("focus")) + this.getFocus().add((MessageDefinitionFocusComponent) value); + else if (name.equals("responseRequired")) + this.responseRequired = castToBoolean(value); // BooleanType + else if (name.equals("allowedResponse")) + this.getAllowedResponse().add((MessageDefinitionAllowedResponseComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType + case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType + case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType + case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType + case 951526432: return addContact(); // ContactDetail + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // MarkdownType + case -669707736: return addUseContext(); // UsageContext + case -507075711: return addJurisdiction(); // CodeableConcept + case -220463842: throw new FHIRException("Cannot make property purpose as it is not a complex type"); // MarkdownType + case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // MarkdownType + case 3016401: return getBase(); // Reference + case -995424086: return addParent(); // Reference + case -430332865: return addReplaces(); // Reference + case 96891546: return getEvent(); // Coding + case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration + case 97604824: return addFocus(); // MessageDefinitionFocusComponent + case 791597824: throw new FHIRException("Cannot make property responseRequired as it is not a complex type"); // BooleanType + case -1130933751: return addAllowedResponse(); // MessageDefinitionAllowedResponseComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("url")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.url"); + } + else if (name.equals("version")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.version"); + } + else if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.name"); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.title"); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.status"); + } + else if (name.equals("experimental")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.experimental"); + } + else if (name.equals("date")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.date"); + } + else if (name.equals("publisher")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.publisher"); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.description"); + } + else if (name.equals("useContext")) { + return addUseContext(); + } + else if (name.equals("jurisdiction")) { + return addJurisdiction(); + } + else if (name.equals("purpose")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.purpose"); + } + else if (name.equals("copyright")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.copyright"); + } + else if (name.equals("base")) { + this.base = new Reference(); + return this.base; + } + else if (name.equals("parent")) { + return addParent(); + } + else if (name.equals("replaces")) { + return addReplaces(); + } + else if (name.equals("event")) { + this.event = new Coding(); + return this.event; + } + else if (name.equals("category")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.category"); + } + else if (name.equals("focus")) { + return addFocus(); + } + else if (name.equals("responseRequired")) { + throw new FHIRException("Cannot call addChild on a primitive type MessageDefinition.responseRequired"); + } + else if (name.equals("allowedResponse")) { + return addAllowedResponse(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "MessageDefinition"; + + } + + public MessageDefinition copy() { + MessageDefinition dst = new MessageDefinition(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.title = title == null ? null : title.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactDetail i : contact) + dst.contact.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (useContext != null) { + dst.useContext = new ArrayList(); + for (UsageContext i : useContext) + dst.useContext.add(i.copy()); + }; + if (jurisdiction != null) { + dst.jurisdiction = new ArrayList(); + for (CodeableConcept i : jurisdiction) + dst.jurisdiction.add(i.copy()); + }; + dst.purpose = purpose == null ? null : purpose.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.base = base == null ? null : base.copy(); + if (parent != null) { + dst.parent = new ArrayList(); + for (Reference i : parent) + dst.parent.add(i.copy()); + }; + if (replaces != null) { + dst.replaces = new ArrayList(); + for (Reference i : replaces) + dst.replaces.add(i.copy()); + }; + dst.event = event == null ? null : event.copy(); + dst.category = category == null ? null : category.copy(); + if (focus != null) { + dst.focus = new ArrayList(); + for (MessageDefinitionFocusComponent i : focus) + dst.focus.add(i.copy()); + }; + dst.responseRequired = responseRequired == null ? null : responseRequired.copy(); + if (allowedResponse != null) { + dst.allowedResponse = new ArrayList(); + for (MessageDefinitionAllowedResponseComponent i : allowedResponse) + dst.allowedResponse.add(i.copy()); + }; + return dst; + } + + protected MessageDefinition typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof MessageDefinition)) + return false; + MessageDefinition o = (MessageDefinition) other; + return compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true) && compareDeep(base, o.base, true) + && compareDeep(parent, o.parent, true) && compareDeep(replaces, o.replaces, true) && compareDeep(event, o.event, true) + && compareDeep(category, o.category, true) && compareDeep(focus, o.focus, true) && compareDeep(responseRequired, o.responseRequired, true) + && compareDeep(allowedResponse, o.allowedResponse, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof MessageDefinition)) + return false; + MessageDefinition o = (MessageDefinition) other; + return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(category, o.category, true) + && compareValues(responseRequired, o.responseRequired, true); + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(purpose, copyright, base + , parent, replaces, event, category, focus, responseRequired, allowedResponse + ); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MessageDefinition; + } + + /** + * Search parameter: date + *

+ * Description: The message definition publication date
+ * Type: date
+ * Path: MessageDefinition.date
+ *

+ */ + @SearchParamDefinition(name="date", path="MessageDefinition.date", description="The message definition publication date", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: The message definition publication date
+ * Type: date
+ * Path: MessageDefinition.date
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: jurisdiction + *

+ * Description: Intended jurisdiction for message definition
+ * Type: token
+ * Path: MessageDefinition.jurisdiction
+ *

+ */ + @SearchParamDefinition(name="jurisdiction", path="MessageDefinition.jurisdiction", description="Intended jurisdiction for message definition", type="token" ) + public static final String SP_JURISDICTION = "jurisdiction"; + /** + * Fluent Client search parameter constant for jurisdiction + *

+ * Description: Intended jurisdiction for message definition
+ * Type: token
+ * Path: MessageDefinition.jurisdiction
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION); + + /** + * Search parameter: name + *

+ * Description: Name of the message definition
+ * Type: string
+ * Path: MessageDefinition.name
+ *

+ */ + @SearchParamDefinition(name="name", path="MessageDefinition.name", description="Name of the message definition", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the message definition
+ * Type: string
+ * Path: MessageDefinition.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: description + *

+ * Description: Text search against the description of the message definition
+ * Type: string
+ * Path: MessageDefinition.description
+ *

+ */ + @SearchParamDefinition(name="description", path="MessageDefinition.description", description="Text search against the description of the message definition", type="string" ) + public static final String SP_DESCRIPTION = "description"; + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search against the description of the message definition
+ * Type: string
+ * Path: MessageDefinition.description
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter: publisher + *

+ * Description: Name of the publisher of the message definition
+ * Type: string
+ * Path: MessageDefinition.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="MessageDefinition.publisher", description="Name of the publisher of the message definition", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the message definition
+ * Type: string
+ * Path: MessageDefinition.publisher
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); + + /** + * Search parameter: focus + *

+ * Description: A resource that is a permitted focus of the message
+ * Type: token
+ * Path: MessageDefinition.focus.code
+ *

+ */ + @SearchParamDefinition(name="focus", path="MessageDefinition.focus.code", description="A resource that is a permitted focus of the message", type="token" ) + public static final String SP_FOCUS = "focus"; + /** + * Fluent Client search parameter constant for focus + *

+ * Description: A resource that is a permitted focus of the message
+ * Type: token
+ * Path: MessageDefinition.focus.code
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FOCUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FOCUS); + + /** + * Search parameter: title + *

+ * Description: Text search against the title of the message definition
+ * Type: string
+ * Path: MessageDefinition.title
+ *

+ */ + @SearchParamDefinition(name="title", path="MessageDefinition.title", description="Text search against the title of the message definition", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Text search against the title of the message definition
+ * Type: string
+ * Path: MessageDefinition.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: event + *

+ * Description: The event that triggers the message
+ * Type: token
+ * Path: MessageDefinition.event
+ *

+ */ + @SearchParamDefinition(name="event", path="MessageDefinition.event", description="The event that triggers the message", type="token" ) + public static final String SP_EVENT = "event"; + /** + * Fluent Client search parameter constant for event + *

+ * Description: The event that triggers the message
+ * Type: token
+ * Path: MessageDefinition.event
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT); + + /** + * Search parameter: category + *

+ * Description: The behavior associated with the message
+ * Type: token
+ * Path: MessageDefinition.category
+ *

+ */ + @SearchParamDefinition(name="category", path="MessageDefinition.category", description="The behavior associated with the message", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: The behavior associated with the message
+ * Type: token
+ * Path: MessageDefinition.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: version + *

+ * Description: The version identifier of the message definition
+ * Type: token
+ * Path: MessageDefinition.version
+ *

+ */ + @SearchParamDefinition(name="version", path="MessageDefinition.version", description="The version identifier of the message definition", type="token" ) + public static final String SP_VERSION = "version"; + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the message definition
+ * Type: token
+ * Path: MessageDefinition.version
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); + + /** + * Search parameter: url + *

+ * Description: The uri that identifies the message definition
+ * Type: uri
+ * Path: MessageDefinition.url
+ *

+ */ + @SearchParamDefinition(name="url", path="MessageDefinition.url", description="The uri that identifies the message definition", type="uri" ) + public static final String SP_URL = "url"; + /** + * Fluent Client search parameter constant for url + *

+ * Description: The uri that identifies the message definition
+ * Type: uri
+ * Path: MessageDefinition.url
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); + + /** + * Search parameter: status + *

+ * Description: The current status of the message definition
+ * Type: token
+ * Path: MessageDefinition.status
+ *

+ */ + @SearchParamDefinition(name="status", path="MessageDefinition.status", description="The current status of the message definition", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the message definition
+ * Type: token
+ * Path: MessageDefinition.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MessageHeader.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MessageHeader.java index 183d67ea222..40fc18f153d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MessageHeader.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MessageHeader.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Meta.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Meta.java index 648f5dcc9a3..04c2073d54d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Meta.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Meta.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -63,10 +63,10 @@ public class Meta extends Type implements IBaseMetaType { protected InstantType lastUpdated; /** - * A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. + * A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. */ @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]." ) + @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]." ) protected List profile; /** @@ -193,7 +193,7 @@ public class Meta extends Type implements IBaseMetaType { } /** - * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + * @return {@link #profile} (A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) */ public List getProfile() { if (this.profile == null) @@ -219,7 +219,7 @@ public class Meta extends Type implements IBaseMetaType { } /** - * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + * @return {@link #profile} (A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) */ public UriType addProfileElement() {//2 UriType t = new UriType(); @@ -230,7 +230,7 @@ public class Meta extends Type implements IBaseMetaType { } /** - * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + * @param value {@link #profile} (A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) */ public Meta addProfile(String value) { //1 UriType t = new UriType(); @@ -242,7 +242,7 @@ public class Meta extends Type implements IBaseMetaType { } /** - * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) + * @param value {@link #profile} (A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) */ public boolean hasProfile(String value) { if (this.profile == null) @@ -412,7 +412,7 @@ public class Meta extends Type implements IBaseMetaType { super.listChildren(childrenList); childrenList.add(new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.", 0, java.lang.Integer.MAX_VALUE, versionId)); childrenList.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, java.lang.Integer.MAX_VALUE, lastUpdated)); - childrenList.add(new Property("profile", "uri", "A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("profile", "uri", "A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].", 0, java.lang.Integer.MAX_VALUE, profile)); childrenList.add(new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security)); childrenList.add(new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag)); } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MetadataResource.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MetadataResource.java index da9464fc828..f15a3aa03e7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MetadataResource.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/MetadataResource.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Money.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Money.java index c163a58ff7f..594a20571fd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Money.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Money.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/NamingSystem.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/NamingSystem.java index 5066522aef1..23a0188074d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/NamingSystem.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/NamingSystem.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Narrative.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Narrative.java index 596ecd726f8..36a1555dc7d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Narrative.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Narrative.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; import org.hl7.fhir.utilities.xhtml.XhtmlNode; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/NutritionRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/NutritionRequest.java index 83c8a4081b8..36a8e61219e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/NutritionRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/NutritionRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Observation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Observation.java index ff5d2fbf8ed..b0c827512a4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Observation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Observation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -3094,86 +3094,6 @@ public class Observation extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - /** - * Search parameter: code-value-quantity - *

- * Description: Code and value parameter pair
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="code-value-quantity", path="", description="Code and value parameter pair", type="composite", compositeOf={"code", "value-quantity"} ) - public static final String SP_CODE_VALUE_QUANTITY = "code-value-quantity"; - /** - * Fluent Client search parameter constant for code-value-quantity - *

- * Description: Code and value parameter pair
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_QUANTITY); - - /** - * Search parameter: code-value-concept - *

- * Description: Code and value parameter pair
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="code-value-concept", path="", description="Code and value parameter pair", type="composite", compositeOf={"code", "value-concept"} ) - public static final String SP_CODE_VALUE_CONCEPT = "code-value-concept"; - /** - * Fluent Client search parameter constant for code-value-concept - *

- * Description: Code and value parameter pair
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_CONCEPT); - - /** - * Search parameter: code-value-date - *

- * Description: Code and value parameter pair
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="code-value-date", path="", description="Code and value parameter pair", type="composite", compositeOf={"code", "value-date"} ) - public static final String SP_CODE_VALUE_DATE = "code-value-date"; - /** - * Fluent Client search parameter constant for code-value-date - *

- * Description: Code and value parameter pair
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_DATE); - - /** - * Search parameter: code-value-string - *

- * Description: Code and value parameter pair
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="code-value-string", path="", description="Code and value parameter pair", type="composite", compositeOf={"code", "value-string"} ) - public static final String SP_CODE_VALUE_STRING = "code-value-string"; - /** - * Fluent Client search parameter constant for code-value-string - *

- * Description: Code and value parameter pair
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_STRING = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_STRING); - /** * Search parameter: performer *

@@ -3398,6 +3318,46 @@ public class Observation extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATED_TARGET = new ca.uhn.fhir.model.api.Include("Observation:related-target").toLocked(); + /** + * Search parameter: code-value-concept + *

+ * Description: Code and coded value parameter pair, including in components
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="code-value-concept", path="Observation | Observation.component", description="Code and coded value parameter pair, including in components", type="composite", compositeOf={"code", "value-concept"} ) + public static final String SP_CODE_VALUE_CONCEPT = "code-value-concept"; + /** + * Fluent Client search parameter constant for code-value-concept + *

+ * Description: Code and coded value parameter pair, including in components
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_CONCEPT); + + /** + * Search parameter: code-value-string + *

+ * Description: Code and string value parameter pair, including in components
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="code-value-string", path="Observation | Observation.component", description="Code and string value parameter pair, including in components", type="composite", compositeOf={"code", "value-string"} ) + public static final String SP_CODE_VALUE_STRING = "code-value-string"; + /** + * Fluent Client search parameter constant for code-value-string + *

+ * Description: Code and string value parameter pair, including in components
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_STRING = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_STRING); + /** * Search parameter: related *

@@ -3406,7 +3366,7 @@ public class Observation extends DomainResource { * Path:
*

*/ - @SearchParamDefinition(name="related", path="", description="Related Observations - search on related-type and related-target together", type="composite", compositeOf={"related-target", "related-type"} ) + @SearchParamDefinition(name="related", path="Observation.related", description="Related Observations - search on related-type and related-target together", type="composite", compositeOf={"related-target", "related-type"} ) public static final String SP_RELATED = "related"; /** * Fluent Client search parameter constant for related @@ -3418,6 +3378,26 @@ public class Observation extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.CompositeClientParam RELATED = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_RELATED); + /** + * Search parameter: code-value-date + *

+ * Description: Code and date/time value parameter pair, including in components
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="code-value-date", path="Observation | Observation.component", description="Code and date/time value parameter pair, including in components", type="composite", compositeOf={"code", "value-date"} ) + public static final String SP_CODE_VALUE_DATE = "code-value-date"; + /** + * Fluent Client search parameter constant for code-value-date + *

+ * Description: Code and date/time value parameter pair, including in components
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_DATE); + /** * Search parameter: patient *

@@ -3470,6 +3450,26 @@ public class Observation extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("Observation:specimen").toLocked(); + /** + * Search parameter: code-value-quantity + *

+ * Description: Code and quantity value parameter pair, including in components
+ * Type: composite
+ * Path:
+ *

+ */ + @SearchParamDefinition(name="code-value-quantity", path="Observation | Observation.component", description="Code and quantity value parameter pair, including in components", type="composite", compositeOf={"code", "value-quantity"} ) + public static final String SP_CODE_VALUE_QUANTITY = "code-value-quantity"; + /** + * Fluent Client search parameter constant for code-value-quantity + *

+ * Description: Code and quantity value parameter pair, including in components
+ * Type: composite
+ * Path:
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_QUANTITY); + /** * Search parameter: category *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/OperationDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/OperationDefinition.java index 6f000744ef7..9bbfbf10148 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/OperationDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/OperationDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/OperationOutcome.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/OperationOutcome.java index c0d633b4b6d..94b583caaeb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/OperationOutcome.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/OperationOutcome.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Organization.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Organization.java index be6e3cd1843..d153f33fdb9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Organization.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Organization.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -1228,26 +1228,6 @@ public class Organization extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("Organization:partof").toLocked(); - /** - * Search parameter: phonetic - *

- * Description: A portion of the organization's name using some kind of phonetic matching algorithm
- * Type: string
- * Path: Organization.name
- *

- */ - @SearchParamDefinition(name="phonetic", path="Organization.name", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - /** - * Fluent Client search parameter constant for phonetic - *

- * Description: A portion of the organization's name using some kind of phonetic matching algorithm
- * Type: string
- * Path: Organization.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); - /** * Search parameter: address *

@@ -1288,46 +1268,6 @@ public class Organization extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); - /** - * Search parameter: name - *

- * Description: A portion of the organization's name, or alias
- * Type: string
- * Path: Organization.name, Organization.alias
- *

- */ - @SearchParamDefinition(name="name", path="Organization.name or Organization.alias", description="A portion of the organization's name, or alias", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: A portion of the organization's name, or alias
- * Type: string
- * Path: Organization.name, Organization.alias
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Organization.address.use
- *

- */ - @SearchParamDefinition(name="address-use", path="Organization.address.use", description="A use code specified in an address", type="token" ) - public static final String SP_ADDRESS_USE = "address-use"; - /** - * Fluent Client search parameter constant for address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Organization.address.use
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); - /** * Search parameter: active *

@@ -1368,26 +1308,6 @@ public class Organization extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - /** - * Search parameter: address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Organization.address.city
- *

- */ - @SearchParamDefinition(name="address-city", path="Organization.address.city", description="A city specified in an address", type="string" ) - public static final String SP_ADDRESS_CITY = "address-city"; - /** - * Fluent Client search parameter constant for address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Organization.address.city
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); - /** * Search parameter: address-postalcode *

@@ -1428,6 +1348,112 @@ public class Organization extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + /** + * Search parameter: endpoint + *

+ * Description: Technical endpoints providing access to services operated for the organization
+ * Type: reference
+ * Path: Organization.endpoint
+ *

+ */ + @SearchParamDefinition(name="endpoint", path="Organization.endpoint", description="Technical endpoints providing access to services operated for the organization", type="reference", target={Endpoint.class } ) + public static final String SP_ENDPOINT = "endpoint"; + /** + * Fluent Client search parameter constant for endpoint + *

+ * Description: Technical endpoints providing access to services operated for the organization
+ * Type: reference
+ * Path: Organization.endpoint
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENDPOINT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Organization:endpoint". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include("Organization:endpoint").toLocked(); + + /** + * Search parameter: phonetic + *

+ * Description: A portion of the organization's name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Organization.name
+ *

+ */ + @SearchParamDefinition(name="phonetic", path="Organization.name", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + /** + * Fluent Client search parameter constant for phonetic + *

+ * Description: A portion of the organization's name using some kind of phonetic matching algorithm
+ * Type: string
+ * Path: Organization.name
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); + + /** + * Search parameter: name + *

+ * Description: A portion of the organization's name, or alias
+ * Type: string
+ * Path: Organization.name, Organization.alias
+ *

+ */ + @SearchParamDefinition(name="name", path="Organization.name or Organization.alias", description="A portion of the organization's name, or alias", type="string" ) + public static final String SP_NAME = "name"; + /** + * Fluent Client search parameter constant for name + *

+ * Description: A portion of the organization's name, or alias
+ * Type: string
+ * Path: Organization.name, Organization.alias
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); + + /** + * Search parameter: address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Organization.address.use
+ *

+ */ + @SearchParamDefinition(name="address-use", path="Organization.address.use", description="A use code specified in an address", type="token" ) + public static final String SP_ADDRESS_USE = "address-use"; + /** + * Fluent Client search parameter constant for address-use + *

+ * Description: A use code specified in an address
+ * Type: token
+ * Path: Organization.address.use
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); + + /** + * Search parameter: address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Organization.address.city
+ *

+ */ + @SearchParamDefinition(name="address-city", path="Organization.address.city", description="A city specified in an address", type="string" ) + public static final String SP_ADDRESS_CITY = "address-city"; + /** + * Fluent Client search parameter constant for address-city + *

+ * Description: A city specified in an address
+ * Type: string
+ * Path: Organization.address.city
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); + } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ParameterDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ParameterDefinition.java index 47460eda7d0..56eb714db03 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ParameterDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ParameterDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Parameters.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Parameters.java index dbdbfd75108..4fdba458d9f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Parameters.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Parameters.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Patient.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Patient.java index 2f5587b390b..9e04c290a01 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Patient.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Patient.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PaymentNotice.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PaymentNotice.java index fb42f783f61..575be8f5da6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PaymentNotice.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PaymentNotice.java @@ -29,12 +29,11 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.dstu3.model.Enumerations.*; import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.api.annotation.Child; @@ -51,19 +50,19 @@ public class PaymentNotice extends DomainResource { public enum PaymentNoticeStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +96,19 @@ public class PaymentNotice extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/paymentnotice-status"; - case CANCELLED: return "http://hl7.org/fhir/paymentnotice-status"; - case DRAFT: return "http://hl7.org/fhir/paymentnotice-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/paymentnotice-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +117,7 @@ public class PaymentNotice extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -181,74 +180,15 @@ public class PaymentNotice extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/paymentnotice-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name = "target", type = {Organization.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=false) - @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; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - /** * Reference of resource for which payment is being made. */ - @Child(name = "request", type = {Reference.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Child(name = "request", type = {Reference.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Request reference", formalDefinition="Reference of resource for which payment is being made." ) protected Reference request; @@ -260,7 +200,7 @@ public class PaymentNotice extends DomainResource { /** * Reference of response to resource for which payment is being made. */ - @Child(name = "response", type = {Reference.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "response", type = {Reference.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource for which payment is being made." ) protected Reference response; @@ -269,22 +209,65 @@ public class PaymentNotice extends DomainResource { */ protected Resource responseTarget; - /** - * The payment status, typically paid: payment sent, cleared: payment received. - */ - @Child(name = "paymentStatus", type = {Coding.class}, order=10, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-status") - protected Coding paymentStatus; - /** * The date when the above payment action occurrred. */ - @Child(name = "statusDate", type = {DateType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "statusDate", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Payment or clearing date", formalDefinition="The date when the above payment action occurrred." ) protected DateType statusDate; - private static final long serialVersionUID = 1753882909L; + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name = "target", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name = "provider", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) + @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; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name = "organization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * The payment status, typically paid: payment sent, cleared: payment received. + */ + @Child(name = "paymentStatus", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-status") + protected CodeableConcept paymentStatus; + + private static final long serialVersionUID = 37278603L; /** * Constructor @@ -293,15 +276,6 @@ public class PaymentNotice extends DomainResource { super(); } - /** - * Constructor - */ - public PaymentNotice(Enumeration status, Coding paymentStatus) { - super(); - this.status = status; - this.paymentStatus = paymentStatus; - } - /** * @return {@link #identifier} (The notice business identifier.) */ @@ -394,57 +368,140 @@ public class PaymentNotice extends DomainResource { * @param value The status of the resource instance. */ public PaymentNotice setStatus(PaymentNoticeStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new PaymentNoticeStatusEnumFactory()); this.status.setValue(value); + } return this; } /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + * @return {@link #request} (Reference of resource for which payment is being made.) */ - public Coding getRuleset() { - if (this.ruleset == null) + public Reference getRequest() { + if (this.request == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.ruleset"); + throw new Error("Attempt to auto-create PaymentNotice.request"); else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; + this.request = new Reference(); // cc + return this.request; } - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); } /** - * @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.) + * @param value {@link #request} (Reference of resource for which payment is being made.) */ - public PaymentNotice setRuleset(Coding value) { - this.ruleset = value; + public PaymentNotice setRequest(Reference value) { + this.request = value; return this; } /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + * @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. (Reference of resource for which payment is being made.) */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + public Resource getRequestTarget() { + return this.requestTarget; } /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + * @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. (Reference of resource for which payment is being made.) */ - public PaymentNotice setOriginalRuleset(Coding value) { - this.originalRuleset = value; + public PaymentNotice setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Reference of response to resource for which payment is being made.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); // cc + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of response to resource for which payment is being made.) + */ + public PaymentNotice setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} 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 of response to resource for which payment is being made.) + */ + public Resource getResponseTarget() { + return this.responseTarget; + } + + /** + * @param value {@link #response} 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 of response to resource for which payment is being made.) + */ + public PaymentNotice setResponseTarget(Resource value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value + */ + public DateType getStatusDateElement() { + if (this.statusDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.statusDate"); + else if (Configuration.doAutoCreate()) + this.statusDate = new DateType(); // bb + return this.statusDate; + } + + public boolean hasStatusDateElement() { + return this.statusDate != null && !this.statusDate.isEmpty(); + } + + public boolean hasStatusDate() { + return this.statusDate != null && !this.statusDate.isEmpty(); + } + + /** + * @param value {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value + */ + public PaymentNotice setStatusDateElement(DateType value) { + this.statusDate = value; + return this; + } + + /** + * @return The date when the above payment action occurrred. + */ + public Date getStatusDate() { + return this.statusDate == null ? null : this.statusDate.getValue(); + } + + /** + * @param value The date when the above payment action occurrred. + */ + public PaymentNotice setStatusDate(Date value) { + if (value == null) + this.statusDate = null; + else { + if (this.statusDate == null) + this.statusDate = new DateType(); + this.statusDate.setValue(value); + } return this; } @@ -629,93 +686,15 @@ public class PaymentNotice extends DomainResource { return this; } - /** - * @return {@link #request} (Reference of resource for which payment is being made.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource for which payment is being made.) - */ - public PaymentNotice setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (Reference of resource for which payment is being made.) - */ - public Resource getRequestTarget() { - 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. (Reference of resource for which payment is being made.) - */ - public PaymentNotice setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Reference of response to resource for which payment is being made.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); // cc - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of response to resource for which payment is being made.) - */ - public PaymentNotice setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} 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 of response to resource for which payment is being made.) - */ - public Resource getResponseTarget() { - return this.responseTarget; - } - - /** - * @param value {@link #response} 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 of response to resource for which payment is being made.) - */ - public PaymentNotice setResponseTarget(Resource value) { - this.responseTarget = value; - return this; - } - /** * @return {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) */ - public Coding getPaymentStatus() { + public CodeableConcept getPaymentStatus() { if (this.paymentStatus == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PaymentNotice.paymentStatus"); else if (Configuration.doAutoCreate()) - this.paymentStatus = new Coding(); // cc + this.paymentStatus = new CodeableConcept(); // cc return this.paymentStatus; } @@ -726,74 +705,23 @@ public class PaymentNotice extends DomainResource { /** * @param value {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) */ - public PaymentNotice setPaymentStatus(Coding value) { + public PaymentNotice setPaymentStatus(CodeableConcept value) { this.paymentStatus = value; return this; } - /** - * @return {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value - */ - public DateType getStatusDateElement() { - if (this.statusDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.statusDate"); - else if (Configuration.doAutoCreate()) - this.statusDate = new DateType(); // bb - return this.statusDate; - } - - public boolean hasStatusDateElement() { - return this.statusDate != null && !this.statusDate.isEmpty(); - } - - public boolean hasStatusDate() { - return this.statusDate != null && !this.statusDate.isEmpty(); - } - - /** - * @param value {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value - */ - public PaymentNotice setStatusDateElement(DateType value) { - this.statusDate = value; - return this; - } - - /** - * @return The date when the above payment action occurrred. - */ - public Date getStatusDate() { - return this.statusDate == null ? null : this.statusDate.getValue(); - } - - /** - * @param value The date when the above payment action occurrred. - */ - public PaymentNotice setStatusDate(Date value) { - if (value == null) - this.statusDate = null; - else { - if (this.statusDate == null) - this.statusDate = new DateType(); - this.statusDate.setValue(value); - } - return this; - } - protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The notice business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - 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("request", "Reference(Any)", "Reference of resource for which payment is being made.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource for which payment is being made.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("statusDate", "date", "The date when the above payment action occurrred.", 0, java.lang.Integer.MAX_VALUE, statusDate)); 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 for which payment is being made.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource for which payment is being made.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("paymentStatus", "Coding", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus)); - childrenList.add(new Property("statusDate", "date", "The date when the above payment action occurrred.", 0, java.lang.Integer.MAX_VALUE, statusDate)); + childrenList.add(new Property("paymentStatus", "CodeableConcept", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus)); } @Override @@ -801,16 +729,14 @@ public class PaymentNotice extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference + case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateType case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference - case 1430704536: /*paymentStatus*/ return this.paymentStatus == null ? new Base[0] : new Base[] {this.paymentStatus}; // Coding - case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateType + case 1430704536: /*paymentStatus*/ return this.paymentStatus == null ? new Base[0] : new Base[] {this.paymentStatus}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -825,11 +751,14 @@ public class PaymentNotice extends DomainResource { case -892481550: // status this.status = new PaymentNoticeStatusEnumFactory().fromType(value); // Enumeration break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding + case 1095692943: // request + this.request = castToReference(value); // Reference break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding + case -340323263: // response + this.response = castToReference(value); // Reference + break; + case 247524032: // statusDate + this.statusDate = castToDate(value); // DateType break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType @@ -843,17 +772,8 @@ public class PaymentNotice extends DomainResource { case 1178922291: // organization this.organization = castToReference(value); // Reference break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case -340323263: // response - this.response = castToReference(value); // Reference - break; case 1430704536: // paymentStatus - this.paymentStatus = castToCoding(value); // Coding - break; - case 247524032: // statusDate - this.statusDate = castToDate(value); // DateType + this.paymentStatus = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -866,10 +786,12 @@ public class PaymentNotice extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new PaymentNoticeStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding + else if (name.equals("request")) + this.request = castToReference(value); // Reference + else if (name.equals("response")) + this.response = castToReference(value); // Reference + else if (name.equals("statusDate")) + this.statusDate = castToDate(value); // DateType else if (name.equals("created")) this.created = castToDateTime(value); // DateTimeType else if (name.equals("target")) @@ -878,14 +800,8 @@ public class PaymentNotice extends DomainResource { this.provider = castToReference(value); // Reference else if (name.equals("organization")) this.organization = castToReference(value); // Reference - else if (name.equals("request")) - this.request = castToReference(value); // Reference - else if (name.equals("response")) - this.response = castToReference(value); // Reference else if (name.equals("paymentStatus")) - this.paymentStatus = castToCoding(value); // Coding - else if (name.equals("statusDate")) - this.statusDate = castToDate(value); // DateType + this.paymentStatus = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -895,16 +811,14 @@ public class PaymentNotice extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding + case 1095692943: return getRequest(); // Reference + case -340323263: return getResponse(); // Reference + case 247524032: throw new FHIRException("Cannot make property statusDate as it is not a complex type"); // DateType case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType case -880905839: return getTarget(); // Reference case -987494927: return getProvider(); // Reference case 1178922291: return getOrganization(); // Reference - case 1095692943: return getRequest(); // Reference - case -340323263: return getResponse(); // Reference - case 1430704536: return getPaymentStatus(); // Coding - case 247524032: throw new FHIRException("Cannot make property statusDate as it is not a complex type"); // DateType + case 1430704536: return getPaymentStatus(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -918,13 +832,16 @@ public class PaymentNotice extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.status"); } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; + else if (name.equals("request")) { + this.request = new Reference(); + return this.request; } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; + else if (name.equals("response")) { + this.response = new Reference(); + return this.response; + } + else if (name.equals("statusDate")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.statusDate"); } else if (name.equals("created")) { throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.created"); @@ -941,21 +858,10 @@ public class PaymentNotice extends DomainResource { this.organization = new Reference(); return this.organization; } - else if (name.equals("request")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("response")) { - this.response = new Reference(); - return this.response; - } else if (name.equals("paymentStatus")) { - this.paymentStatus = new Coding(); + this.paymentStatus = new CodeableConcept(); return this.paymentStatus; } - else if (name.equals("statusDate")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.statusDate"); - } else return super.addChild(name); } @@ -974,16 +880,14 @@ public class PaymentNotice extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.statusDate = statusDate == null ? null : statusDate.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.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy(); - dst.statusDate = statusDate == null ? null : statusDate.copy(); return dst; } @@ -998,11 +902,10 @@ public class PaymentNotice extends DomainResource { if (!(other instanceof PaymentNotice)) return false; PaymentNotice o = (PaymentNotice) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true) + && compareDeep(response, o.response, true) && compareDeep(statusDate, o.statusDate, true) && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) && compareDeep(paymentStatus, o.paymentStatus, true) - && compareDeep(statusDate, o.statusDate, true); + && compareDeep(paymentStatus, o.paymentStatus, true); } @Override @@ -1012,14 +915,14 @@ public class PaymentNotice extends DomainResource { if (!(other instanceof PaymentNotice)) return false; PaymentNotice o = (PaymentNotice) other; - return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(statusDate, o.statusDate, true) + return compareValues(status, o.status, true) && compareValues(statusDate, o.statusDate, true) && compareValues(created, o.created, true) ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, ruleset - , originalRuleset, created, target, provider, organization, request, response - , paymentStatus, statusDate); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request + , response, statusDate, created, target, provider, organization, paymentStatus + ); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PaymentReconciliation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PaymentReconciliation.java index 2ce58cfc871..32d18e0d94b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PaymentReconciliation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PaymentReconciliation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -51,19 +51,19 @@ public class PaymentReconciliation extends DomainResource { public enum PaymentReconciliationStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +97,19 @@ public class PaymentReconciliation extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/paymentreconciliation-status"; - case CANCELLED: return "http://hl7.org/fhir/paymentreconciliation-status"; - case DRAFT: return "http://hl7.org/fhir/paymentreconciliation-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/paymentreconciliation-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +118,7 @@ public class PaymentReconciliation extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -176,10 +176,10 @@ public class PaymentReconciliation extends DomainResource { /** * Code to indicate the nature of the payment, adjustment, funds advance, etc. */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) @Description(shortDefinition="Type code", formalDefinition="Code to indicate the nature of the payment, adjustment, funds advance, etc." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-type") - protected Coding type; + protected CodeableConcept type; /** * The claim or financial resource. @@ -243,7 +243,7 @@ public class PaymentReconciliation extends DomainResource { @Description(shortDefinition="Detail amount", formalDefinition="Amount paid for this detail." ) protected Money amount; - private static final long serialVersionUID = 131938594L; + private static final long serialVersionUID = 661095855L; /** * Constructor @@ -255,7 +255,7 @@ public class PaymentReconciliation extends DomainResource { /** * Constructor */ - public DetailsComponent(Coding type) { + public DetailsComponent(CodeableConcept type) { super(); this.type = type; } @@ -263,12 +263,12 @@ public class PaymentReconciliation extends DomainResource { /** * @return {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create DetailsComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -279,7 +279,7 @@ public class PaymentReconciliation extends DomainResource { /** * @param value {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) */ - public DetailsComponent setType(Coding value) { + public DetailsComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -525,7 +525,7 @@ public class PaymentReconciliation extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Code to indicate the nature of the payment, adjustment, funds advance, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "Code to indicate the nature of the payment, adjustment, funds advance, etc.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("request", "Reference(Any)", "The claim or financial resource.", 0, java.lang.Integer.MAX_VALUE, request)); childrenList.add(new Property("response", "Reference(Any)", "The claim response resource.", 0, java.lang.Integer.MAX_VALUE, response)); childrenList.add(new Property("submitter", "Reference(Organization)", "The Organization which submitted the invoice or financial transaction.", 0, java.lang.Integer.MAX_VALUE, submitter)); @@ -537,7 +537,7 @@ public class PaymentReconciliation extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference case 348678409: /*submitter*/ return this.submitter == null ? new Base[0] : new Base[] {this.submitter}; // Reference @@ -553,7 +553,7 @@ public class PaymentReconciliation extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 1095692943: // request this.request = castToReference(value); // Reference @@ -581,7 +581,7 @@ public class PaymentReconciliation extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("request")) this.request = castToReference(value); // Reference else if (name.equals("response")) @@ -601,7 +601,7 @@ public class PaymentReconciliation extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 1095692943: return getRequest(); // Reference case -340323263: return getResponse(); // Reference case 348678409: return getSubmitter(); // Reference @@ -616,7 +616,7 @@ public class PaymentReconciliation extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("request")) { @@ -698,10 +698,10 @@ public class PaymentReconciliation extends DomainResource { /** * The note purpose: Print/Display. */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type") - protected Coding type; + protected CodeableConcept type; /** * The note text. @@ -710,7 +710,7 @@ public class PaymentReconciliation extends DomainResource { @Description(shortDefinition="Notes text", formalDefinition="The note text." ) protected StringType text; - private static final long serialVersionUID = 129959202L; + private static final long serialVersionUID = 874830709L; /** * Constructor @@ -722,12 +722,12 @@ public class PaymentReconciliation extends DomainResource { /** * @return {@link #type} (The note purpose: Print/Display.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create NotesComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -738,7 +738,7 @@ public class PaymentReconciliation extends DomainResource { /** * @param value {@link #type} (The note purpose: Print/Display.) */ - public NotesComponent setType(Coding value) { + public NotesComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -794,14 +794,14 @@ public class PaymentReconciliation extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType default: return super.getProperty(hash, name, checkValid); } @@ -812,7 +812,7 @@ public class PaymentReconciliation extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 3556653: // text this.text = castToString(value); // StringType @@ -825,7 +825,7 @@ public class PaymentReconciliation extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("text")) this.text = castToString(value); // StringType else @@ -835,7 +835,7 @@ public class PaymentReconciliation extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType default: return super.makeProperty(hash, name); } @@ -845,7 +845,7 @@ public class PaymentReconciliation extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("text")) { @@ -904,15 +904,41 @@ public class PaymentReconciliation extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/paymentreconciliation-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; + /** + * The period of time for which payments have been gathered into this bulk payment for settlement. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) + @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 date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + /** * Original request resource reference. */ - @Child(name = "request", type = {ProcessRequest.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "request", type = {ProcessRequest.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) protected Reference request; @@ -924,64 +950,22 @@ public class PaymentReconciliation extends DomainResource { /** * Transaction status: error, complete. */ - @Child(name = "outcome", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "outcome", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="complete | error | partial", formalDefinition="Transaction status: error, complete." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome") - protected Enumeration outcome; + protected CodeableConcept outcome; /** * A description of the status of the adjudication. */ - @Child(name = "disposition", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "disposition", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) protected StringType disposition; - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - 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=8, min=0, max=1, modifier=false, summary=false) - @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=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - /** * The practitioner who is responsible for the services rendered to the patient. */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) protected Reference requestProvider; @@ -993,7 +977,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=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) protected Reference requestOrganization; @@ -1005,33 +989,33 @@ public class PaymentReconciliation extends DomainResource { /** * List of individual settlement amounts and the corresponding transaction. */ - @Child(name = "detail", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "detail", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "form", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms") - protected Coding form; + protected CodeableConcept form; /** * Total payment amount. */ - @Child(name = "total", type = {Money.class}, order=14, min=1, max=1, modifier=false, summary=false) + @Child(name = "total", type = {Money.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount." ) protected Money total; /** * Suite of notes. */ - @Child(name = "note", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "note", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Note text", formalDefinition="Suite of notes." ) protected List note; - private static final long serialVersionUID = -1727108599L; + private static final long serialVersionUID = -358990199L; /** * Constructor @@ -1040,15 +1024,6 @@ public class PaymentReconciliation extends DomainResource { super(); } - /** - * Constructor - */ - public PaymentReconciliation(Enumeration status, Money total) { - super(); - this.status = status; - this.total = total; - } - /** * @return {@link #identifier} (The Response business identifier.) */ @@ -1141,199 +1116,37 @@ public class PaymentReconciliation extends DomainResource { * @param value The status of the resource instance. */ public PaymentReconciliation setStatus(PaymentReconciliationStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new PaymentReconciliationStatusEnumFactory()); this.status.setValue(value); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public PaymentReconciliation setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 reference.) - */ - public ProcessRequest getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new ProcessRequest(); // aa - 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 reference.) - */ - public PaymentReconciliation setRequestTarget(ProcessRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). 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 PaymentReconciliation.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb - 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} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public PaymentReconciliation setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RemittanceOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public PaymentReconciliation setOutcome(RemittanceOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); - this.outcome.setValue(value); } return this; } /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) */ - public StringType getDispositionElement() { - if (this.disposition == null) + public Period getPeriod() { + if (this.period == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.disposition"); + throw new Error("Attempt to auto-create PaymentReconciliation.period"); else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; + this.period = new Period(); // cc + return this.period; } - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); } /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + * @param value {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) */ - public PaymentReconciliation setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public PaymentReconciliation setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 PaymentReconciliation setRuleset(Coding value) { - this.ruleset = 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 PaymentReconciliation.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - 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 PaymentReconciliation setOriginalRuleset(Coding value) { - this.originalRuleset = value; + public PaymentReconciliation setPeriod(Period value) { + this.period = value; return this; } @@ -1386,30 +1199,6 @@ public class PaymentReconciliation extends DomainResource { 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(); // cc - 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.) */ @@ -1454,6 +1243,123 @@ public class PaymentReconciliation extends DomainResource { return this; } + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public PaymentReconciliation setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 reference.) + */ + public ProcessRequest getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new ProcessRequest(); // aa + 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 reference.) + */ + public PaymentReconciliation setRequestTarget(ProcessRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.) + */ + public PaymentReconciliation setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public PaymentReconciliation setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public PaymentReconciliation setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + /** * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) */ @@ -1598,12 +1504,12 @@ public class PaymentReconciliation extends DomainResource { /** * @return {@link #form} (The form to be used for printing the content.) */ - public Coding getForm() { + public CodeableConcept getForm() { if (this.form == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PaymentReconciliation.form"); else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc + this.form = new CodeableConcept(); // cc return this.form; } @@ -1614,7 +1520,7 @@ public class PaymentReconciliation extends DomainResource { /** * @param value {@link #form} (The form to be used for printing the content.) */ - public PaymentReconciliation setForm(Coding value) { + public PaymentReconciliation setForm(CodeableConcept value) { this.form = value; return this; } @@ -1700,18 +1606,16 @@ public class PaymentReconciliation extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("request", "Reference(ProcessRequest)", "Original request resource reference.", 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("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("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("request", "Reference(ProcessRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "CodeableConcept", "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("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)); childrenList.add(new Property("detail", "", "List of individual settlement amounts and the corresponding transaction.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); childrenList.add(new Property("total", "Money", "Total payment amount.", 0, java.lang.Integer.MAX_VALUE, total)); childrenList.add(new Property("note", "", "Suite of notes.", 0, java.lang.Integer.MAX_VALUE, note)); } @@ -1721,18 +1625,16 @@ public class PaymentReconciliation extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailsComponent - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // Money case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NotesComponent default: return super.getProperty(hash, name, checkValid); @@ -1749,30 +1651,24 @@ public class PaymentReconciliation extends DomainResource { case -892481550: // status this.status = new PaymentReconciliationStatusEnumFactory().fromType(value); // Enumeration break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case -1106507950: // outcome - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding + case -991726143: // period + this.period = castToPeriod(value); // Period break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; case 1178922291: // organization this.organization = castToReference(value); // Reference break; + case 1095692943: // request + this.request = castToReference(value); // Reference + break; + case -1106507950: // outcome + this.outcome = castToCodeableConcept(value); // CodeableConcept + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; case 1601527200: // requestProvider this.requestProvider = castToReference(value); // Reference break; @@ -1783,7 +1679,7 @@ public class PaymentReconciliation extends DomainResource { this.getDetail().add((DetailsComponent) value); // DetailsComponent break; case 3148996: // form - this.form = castToCoding(value); // Coding + this.form = castToCodeableConcept(value); // CodeableConcept break; case 110549828: // total this.total = castToMoney(value); // Money @@ -1802,22 +1698,18 @@ public class PaymentReconciliation extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new PaymentReconciliationStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType + else if (name.equals("organization")) + this.organization = castToReference(value); // Reference else if (name.equals("request")) this.request = castToReference(value); // Reference else if (name.equals("outcome")) - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration + this.outcome = castToCodeableConcept(value); // CodeableConcept else if (name.equals("disposition")) this.disposition = castToString(value); // StringType - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("organization")) - this.organization = castToReference(value); // Reference else if (name.equals("requestProvider")) this.requestProvider = castToReference(value); // Reference else if (name.equals("requestOrganization")) @@ -1825,7 +1717,7 @@ public class PaymentReconciliation extends DomainResource { else if (name.equals("detail")) this.getDetail().add((DetailsComponent) value); else if (name.equals("form")) - this.form = castToCoding(value); // Coding + this.form = castToCodeableConcept(value); // CodeableConcept else if (name.equals("total")) this.total = castToMoney(value); // Money else if (name.equals("note")) @@ -1839,18 +1731,16 @@ public class PaymentReconciliation extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1095692943: return getRequest(); // Reference - case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType case -991726143: return getPeriod(); // Period + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType case 1178922291: return getOrganization(); // Reference + case 1095692943: return getRequest(); // Reference + case -1106507950: return getOutcome(); // CodeableConcept + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType case 1601527200: return getRequestProvider(); // Reference case 599053666: return getRequestOrganization(); // Reference case -1335224239: return addDetail(); // DetailsComponent - case 3148996: return getForm(); // Coding + case 3148996: return getForm(); // CodeableConcept case 110549828: return getTotal(); // Money case 3387378: return addNote(); // NotesComponent default: return super.makeProperty(hash, name); @@ -1866,35 +1756,28 @@ public class PaymentReconciliation extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.status"); } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.created"); + } + else if (name.equals("organization")) { + this.organization = new Reference(); + return this.organization; + } else if (name.equals("request")) { this.request = new Reference(); return this.request; } else if (name.equals("outcome")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.outcome"); + this.outcome = new CodeableConcept(); + return this.outcome; } else if (name.equals("disposition")) { throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.disposition"); } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.created"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; - } else if (name.equals("requestProvider")) { this.requestProvider = new Reference(); return this.requestProvider; @@ -1907,7 +1790,7 @@ public class PaymentReconciliation extends DomainResource { return addDetail(); } else if (name.equals("form")) { - this.form = new Coding(); + this.form = new CodeableConcept(); return this.form; } else if (name.equals("total")) { @@ -1935,14 +1818,12 @@ public class PaymentReconciliation extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + dst.created = created == null ? null : created.copy(); + dst.organization = organization == null ? null : organization.copy(); dst.request = request == null ? null : request.copy(); dst.outcome = outcome == null ? null : outcome.copy(); dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); if (detail != null) { @@ -1971,10 +1852,9 @@ public class PaymentReconciliation extends DomainResource { if (!(other instanceof PaymentReconciliation)) return false; PaymentReconciliation o = (PaymentReconciliation) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true) - && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(period, o.period, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(period, o.period, true) + && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) + && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(detail, o.detail, true) && compareDeep(form, o.form, true) && compareDeep(total, o.total, true) && compareDeep(note, o.note, true) ; @@ -1987,14 +1867,14 @@ public class PaymentReconciliation extends DomainResource { if (!(other instanceof PaymentReconciliation)) return false; PaymentReconciliation o = (PaymentReconciliation) other; - return compareValues(status, o.status, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) - && compareValues(created, o.created, true); + return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(disposition, o.disposition, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request - , outcome, disposition, ruleset, originalRuleset, created, period, organization - , requestProvider, requestOrganization, detail, form, total, note); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, period + , created, organization, request, outcome, disposition, requestProvider, requestOrganization + , detail, form, total, note); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Period.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Period.java index 26e0bc89e58..66035d983ec 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Period.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Period.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Person.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Person.java index b5cfb8d54c6..0beaf188f1b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Person.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Person.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PlanDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PlanDefinition.java index 0a6ef3201cf..45bdf7d74b5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PlanDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PlanDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -50,6 +50,112 @@ import org.hl7.fhir.exceptions.FHIRException; @ChildOrder(names={"url", "identifier", "version", "name", "title", "type", "status", "experimental", "date", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "publisher", "contact", "copyright", "relatedArtifact", "library", "actionDefinition"}) public class PlanDefinition extends MetadataResource { + public enum PlanActionConditionKind { + /** + * The condition describes whether or not a given action is applicable + */ + APPLICABILITY, + /** + * The condition is a starting condition for the action + */ + START, + /** + * The condition is a stop, or exit condition for the action + */ + STOP, + /** + * added to help the parsers with the generic types + */ + NULL; + public static PlanActionConditionKind fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("applicability".equals(codeString)) + return APPLICABILITY; + if ("start".equals(codeString)) + return START; + if ("stop".equals(codeString)) + return STOP; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown PlanActionConditionKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case APPLICABILITY: return "applicability"; + case START: return "start"; + case STOP: return "stop"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case APPLICABILITY: return "http://hl7.org/fhir/action-condition-kind"; + case START: return "http://hl7.org/fhir/action-condition-kind"; + case STOP: return "http://hl7.org/fhir/action-condition-kind"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case APPLICABILITY: return "The condition describes whether or not a given action is applicable"; + case START: return "The condition is a starting condition for the action"; + case STOP: return "The condition is a stop, or exit condition for the action"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case APPLICABILITY: return "Applicability"; + case START: return "Start"; + case STOP: return "Stop"; + default: return "?"; + } + } + } + + public static class PlanActionConditionKindEnumFactory implements EnumFactory { + public PlanActionConditionKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("applicability".equals(codeString)) + return PlanActionConditionKind.APPLICABILITY; + if ("start".equals(codeString)) + return PlanActionConditionKind.START; + if ("stop".equals(codeString)) + return PlanActionConditionKind.STOP; + throw new IllegalArgumentException("Unknown PlanActionConditionKind code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("applicability".equals(codeString)) + return new Enumeration(this, PlanActionConditionKind.APPLICABILITY); + if ("start".equals(codeString)) + return new Enumeration(this, PlanActionConditionKind.START); + if ("stop".equals(codeString)) + return new Enumeration(this, PlanActionConditionKind.STOP); + throw new FHIRException("Unknown PlanActionConditionKind code '"+codeString+"'"); + } + public String toCode(PlanActionConditionKind code) { + if (code == PlanActionConditionKind.APPLICABILITY) + return "applicability"; + if (code == PlanActionConditionKind.START) + return "start"; + if (code == PlanActionConditionKind.STOP) + return "stop"; + return "?"; + } + public String toSystem(PlanActionConditionKind code) { + return code.getSystem(); + } + } + public enum PlanActionRelationshipType { /** * The action must be performed before the start of the related action @@ -963,30 +1069,44 @@ public class PlanDefinition extends MetadataResource { protected List triggerDefinition; /** - * An expression specifying whether or not the action is applicable in a given context. + * An expression that describes applicability criteria, or start/stop conditions for the action. */ - @Child(name = "condition", type = {}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether or not the action is applicable", formalDefinition="An expression specifying whether or not the action is applicable in a given context." ) - protected PlanDefinitionActionDefinitionConditionComponent condition; + @Child(name = "condition", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Whether or not the action is applicable", formalDefinition="An expression that describes applicability criteria, or start/stop conditions for the action." ) + protected List condition; + + /** + * Defines input data requirements for the action. + */ + @Child(name = "input", type = {DataRequirement.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Input data requirements", formalDefinition="Defines input data requirements for the action." ) + protected List input; + + /** + * Defines the outputs of the action, if any. + */ + @Child(name = "output", type = {DataRequirement.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Output data definition", formalDefinition="Defines the outputs of the action, if any." ) + protected List output; /** * A relationship to another action such as "before" or "30-60 minutes after start of". */ - @Child(name = "relatedAction", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "relatedAction", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." ) protected List relatedAction; /** * An optional value describing when the action should be performed. */ - @Child(name = "timing", type = {DateTimeType.class, Period.class, Duration.class, Range.class, Timing.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "timing", type = {DateTimeType.class, Period.class, Duration.class, Range.class, Timing.class}, order=13, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="When the action should take place", formalDefinition="An optional value describing when the action should be performed." ) protected Type timing; /** * The type of participant in the action. */ - @Child(name = "participantType", type = {CodeType.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "participantType", type = {CodeType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="patient | practitioner | related-person", formalDefinition="The type of participant in the action." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-participant-type") protected List> participantType; @@ -994,7 +1114,7 @@ public class PlanDefinition extends MetadataResource { /** * The type of action to perform (create, update, remove). */ - @Child(name = "type", type = {Coding.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {Coding.class}, order=15, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-type") protected Coding type; @@ -1002,7 +1122,7 @@ public class PlanDefinition extends MetadataResource { /** * Defines the grouping behavior for the action and its children. */ - @Child(name = "groupingBehavior", type = {CodeType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Child(name = "groupingBehavior", type = {CodeType.class}, order=16, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="visual-group | logical-group | sentence-group", formalDefinition="Defines the grouping behavior for the action and its children." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-grouping-behavior") protected Enumeration groupingBehavior; @@ -1010,7 +1130,7 @@ public class PlanDefinition extends MetadataResource { /** * Defines the selection behavior for the action and its children. */ - @Child(name = "selectionBehavior", type = {CodeType.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "selectionBehavior", type = {CodeType.class}, order=17, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="any | all | all-or-none | exactly-one | at-most-one | one-or-more", formalDefinition="Defines the selection behavior for the action and its children." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-selection-behavior") protected Enumeration selectionBehavior; @@ -1018,7 +1138,7 @@ public class PlanDefinition extends MetadataResource { /** * Defines the requiredness behavior for the action. */ - @Child(name = "requiredBehavior", type = {CodeType.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Child(name = "requiredBehavior", type = {CodeType.class}, order=18, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="must | could | must-unless-documented", formalDefinition="Defines the requiredness behavior for the action." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-required-behavior") protected Enumeration requiredBehavior; @@ -1026,7 +1146,7 @@ public class PlanDefinition extends MetadataResource { /** * Defines whether the action should usually be preselected. */ - @Child(name = "precheckBehavior", type = {CodeType.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Child(name = "precheckBehavior", type = {CodeType.class}, order=19, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="yes | no", formalDefinition="Defines whether the action should usually be preselected." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-precheck-behavior") protected Enumeration precheckBehavior; @@ -1034,7 +1154,7 @@ public class PlanDefinition extends MetadataResource { /** * Defines whether the action can be selected multiple times. */ - @Child(name = "cardinalityBehavior", type = {CodeType.class}, order=18, min=0, max=1, modifier=false, summary=false) + @Child(name = "cardinalityBehavior", type = {CodeType.class}, order=20, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="single | multiple", formalDefinition="Defines whether the action can be selected multiple times." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-cardinality-behavior") protected Enumeration cardinalityBehavior; @@ -1042,7 +1162,7 @@ public class PlanDefinition extends MetadataResource { /** * A reference to an ActivityDefinition that describes the action to be taken in detail. */ - @Child(name = "activityDefinition", type = {ActivityDefinition.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Child(name = "activityDefinition", type = {ActivityDefinition.class}, order=21, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Description of the activity to be performed", formalDefinition="A reference to an ActivityDefinition that describes the action to be taken in detail." ) protected Reference activityDefinition; @@ -1054,7 +1174,7 @@ public class PlanDefinition extends MetadataResource { /** * A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input. */ - @Child(name = "transform", type = {StructureMap.class}, order=20, min=0, max=1, modifier=false, summary=false) + @Child(name = "transform", type = {StructureMap.class}, order=22, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Transform to apply the template", formalDefinition="A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input." ) protected Reference transform; @@ -1066,18 +1186,18 @@ public class PlanDefinition extends MetadataResource { /** * Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. */ - @Child(name = "dynamicValue", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "dynamicValue", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Dynamic aspects of the definition", formalDefinition="Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result." ) protected List dynamicValue; /** * Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition. */ - @Child(name = "actionDefinition", type = {PlanDefinitionActionDefinitionComponent.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "actionDefinition", type = {PlanDefinitionActionDefinitionComponent.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="A sub-action", formalDefinition="Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition." ) protected List actionDefinition; - private static final long serialVersionUID = -1445789672L; + private static final long serialVersionUID = 2070255895L; /** * Constructor @@ -1466,29 +1586,164 @@ public class PlanDefinition extends MetadataResource { } /** - * @return {@link #condition} (An expression specifying whether or not the action is applicable in a given context.) + * @return {@link #condition} (An expression that describes applicability criteria, or start/stop conditions for the action.) */ - public PlanDefinitionActionDefinitionConditionComponent getCondition() { + public List getCondition() { if (this.condition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PlanDefinitionActionDefinitionComponent.condition"); - else if (Configuration.doAutoCreate()) - this.condition = new PlanDefinitionActionDefinitionConditionComponent(); // cc + this.condition = new ArrayList(); return this.condition; } + /** + * @return Returns a reference to this for easy method chaining + */ + public PlanDefinitionActionDefinitionComponent setCondition(List theCondition) { + this.condition = theCondition; + return this; + } + public boolean hasCondition() { - return this.condition != null && !this.condition.isEmpty(); + if (this.condition == null) + return false; + for (PlanDefinitionActionDefinitionConditionComponent item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + public PlanDefinitionActionDefinitionConditionComponent addCondition() { //3 + PlanDefinitionActionDefinitionConditionComponent t = new PlanDefinitionActionDefinitionConditionComponent(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + public PlanDefinitionActionDefinitionComponent addCondition(PlanDefinitionActionDefinitionConditionComponent t) { //3 + if (t == null) + return this; + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; } /** - * @param value {@link #condition} (An expression specifying whether or not the action is applicable in a given context.) + * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist */ - public PlanDefinitionActionDefinitionComponent setCondition(PlanDefinitionActionDefinitionConditionComponent value) { - this.condition = value; + public PlanDefinitionActionDefinitionConditionComponent getConditionFirstRep() { + if (getCondition().isEmpty()) { + addCondition(); + } + return getCondition().get(0); + } + + /** + * @return {@link #input} (Defines input data requirements for the action.) + */ + public List getInput() { + if (this.input == null) + this.input = new ArrayList(); + return this.input; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public PlanDefinitionActionDefinitionComponent setInput(List theInput) { + this.input = theInput; return this; } + public boolean hasInput() { + if (this.input == null) + return false; + for (DataRequirement item : this.input) + if (!item.isEmpty()) + return true; + return false; + } + + public DataRequirement addInput() { //3 + DataRequirement t = new DataRequirement(); + if (this.input == null) + this.input = new ArrayList(); + this.input.add(t); + return t; + } + + public PlanDefinitionActionDefinitionComponent addInput(DataRequirement t) { //3 + if (t == null) + return this; + if (this.input == null) + this.input = new ArrayList(); + this.input.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #input}, creating it if it does not already exist + */ + public DataRequirement getInputFirstRep() { + if (getInput().isEmpty()) { + addInput(); + } + return getInput().get(0); + } + + /** + * @return {@link #output} (Defines the outputs of the action, if any.) + */ + public List getOutput() { + if (this.output == null) + this.output = new ArrayList(); + return this.output; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public PlanDefinitionActionDefinitionComponent setOutput(List theOutput) { + this.output = theOutput; + return this; + } + + public boolean hasOutput() { + if (this.output == null) + return false; + for (DataRequirement item : this.output) + if (!item.isEmpty()) + return true; + return false; + } + + public DataRequirement addOutput() { //3 + DataRequirement t = new DataRequirement(); + if (this.output == null) + this.output = new ArrayList(); + this.output.add(t); + return t; + } + + public PlanDefinitionActionDefinitionComponent addOutput(DataRequirement t) { //3 + if (t == null) + return this; + if (this.output == null) + this.output = new ArrayList(); + this.output.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #output}, creating it if it does not already exist + */ + public DataRequirement getOutputFirstRep() { + if (getOutput().isEmpty()) { + addOutput(); + } + return getOutput().get(0); + } + /** * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) */ @@ -2160,7 +2415,9 @@ public class PlanDefinition extends MetadataResource { childrenList.add(new Property("code", "CodeableConcept", "The concept represented by this action or its sub-actions.", 0, java.lang.Integer.MAX_VALUE, code)); childrenList.add(new Property("documentation", "RelatedArtifact", "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation)); childrenList.add(new Property("triggerDefinition", "TriggerDefinition", "A description of when the action should be triggered.", 0, java.lang.Integer.MAX_VALUE, triggerDefinition)); - childrenList.add(new Property("condition", "", "An expression specifying whether or not the action is applicable in a given context.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("condition", "", "An expression that describes applicability criteria, or start/stop conditions for the action.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("input", "DataRequirement", "Defines input data requirements for the action.", 0, java.lang.Integer.MAX_VALUE, input)); + childrenList.add(new Property("output", "DataRequirement", "Defines the outputs of the action, if any.", 0, java.lang.Integer.MAX_VALUE, output)); childrenList.add(new Property("relatedAction", "", "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0, java.lang.Integer.MAX_VALUE, relatedAction)); childrenList.add(new Property("timing[x]", "dateTime|Period|Duration|Range|Timing", "An optional value describing when the action should be performed.", 0, java.lang.Integer.MAX_VALUE, timing)); childrenList.add(new Property("participantType", "code", "The type of participant in the action.", 0, java.lang.Integer.MAX_VALUE, participantType)); @@ -2187,7 +2444,9 @@ public class PlanDefinition extends MetadataResource { case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // RelatedArtifact case 1126736171: /*triggerDefinition*/ return this.triggerDefinition == null ? new Base[0] : this.triggerDefinition.toArray(new Base[this.triggerDefinition.size()]); // TriggerDefinition - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // PlanDefinitionActionDefinitionConditionComponent + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // PlanDefinitionActionDefinitionConditionComponent + case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // DataRequirement + case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // DataRequirement case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : this.relatedAction.toArray(new Base[this.relatedAction.size()]); // PlanDefinitionActionDefinitionRelatedActionComponent case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type case 841294093: /*participantType*/ return this.participantType == null ? new Base[0] : this.participantType.toArray(new Base[this.participantType.size()]); // Enumeration @@ -2234,7 +2493,13 @@ public class PlanDefinition extends MetadataResource { this.getTriggerDefinition().add(castToTriggerDefinition(value)); // TriggerDefinition break; case -861311717: // condition - this.condition = (PlanDefinitionActionDefinitionConditionComponent) value; // PlanDefinitionActionDefinitionConditionComponent + this.getCondition().add((PlanDefinitionActionDefinitionConditionComponent) value); // PlanDefinitionActionDefinitionConditionComponent + break; + case 100358090: // input + this.getInput().add(castToDataRequirement(value)); // DataRequirement + break; + case -1005512447: // output + this.getOutput().add(castToDataRequirement(value)); // DataRequirement break; case -384107967: // relatedAction this.getRelatedAction().add((PlanDefinitionActionDefinitionRelatedActionComponent) value); // PlanDefinitionActionDefinitionRelatedActionComponent @@ -2299,7 +2564,11 @@ public class PlanDefinition extends MetadataResource { else if (name.equals("triggerDefinition")) this.getTriggerDefinition().add(castToTriggerDefinition(value)); else if (name.equals("condition")) - this.condition = (PlanDefinitionActionDefinitionConditionComponent) value; // PlanDefinitionActionDefinitionConditionComponent + this.getCondition().add((PlanDefinitionActionDefinitionConditionComponent) value); + else if (name.equals("input")) + this.getInput().add(castToDataRequirement(value)); + else if (name.equals("output")) + this.getOutput().add(castToDataRequirement(value)); else if (name.equals("relatedAction")) this.getRelatedAction().add((PlanDefinitionActionDefinitionRelatedActionComponent) value); else if (name.equals("timing[x]")) @@ -2341,7 +2610,9 @@ public class PlanDefinition extends MetadataResource { case 3059181: return addCode(); // CodeableConcept case 1587405498: return addDocumentation(); // RelatedArtifact case 1126736171: return addTriggerDefinition(); // TriggerDefinition - case -861311717: return getCondition(); // PlanDefinitionActionDefinitionConditionComponent + case -861311717: return addCondition(); // PlanDefinitionActionDefinitionConditionComponent + case 100358090: return addInput(); // DataRequirement + case -1005512447: return addOutput(); // DataRequirement case -384107967: return addRelatedAction(); // PlanDefinitionActionDefinitionRelatedActionComponent case 164632566: return getTiming(); // Type case 841294093: throw new FHIRException("Cannot make property participantType as it is not a complex type"); // Enumeration @@ -2388,8 +2659,13 @@ public class PlanDefinition extends MetadataResource { return addTriggerDefinition(); } else if (name.equals("condition")) { - this.condition = new PlanDefinitionActionDefinitionConditionComponent(); - return this.condition; + return addCondition(); + } + else if (name.equals("input")) { + return addInput(); + } + else if (name.equals("output")) { + return addOutput(); } else if (name.equals("relatedAction")) { return addRelatedAction(); @@ -2477,7 +2753,21 @@ public class PlanDefinition extends MetadataResource { for (TriggerDefinition i : triggerDefinition) dst.triggerDefinition.add(i.copy()); }; - dst.condition = condition == null ? null : condition.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (PlanDefinitionActionDefinitionConditionComponent i : condition) + dst.condition.add(i.copy()); + }; + if (input != null) { + dst.input = new ArrayList(); + for (DataRequirement i : input) + dst.input.add(i.copy()); + }; + if (output != null) { + dst.output = new ArrayList(); + for (DataRequirement i : output) + dst.output.add(i.copy()); + }; if (relatedAction != null) { dst.relatedAction = new ArrayList(); for (PlanDefinitionActionDefinitionRelatedActionComponent i : relatedAction) @@ -2520,8 +2810,8 @@ public class PlanDefinition extends MetadataResource { return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(label, o.label, true) && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) && compareDeep(textEquivalent, o.textEquivalent, true) && compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true) && compareDeep(triggerDefinition, o.triggerDefinition, true) - && compareDeep(condition, o.condition, true) && compareDeep(relatedAction, o.relatedAction, true) - && compareDeep(timing, o.timing, true) && compareDeep(participantType, o.participantType, true) + && compareDeep(condition, o.condition, true) && compareDeep(input, o.input, true) && compareDeep(output, o.output, true) + && compareDeep(relatedAction, o.relatedAction, true) && compareDeep(timing, o.timing, true) && compareDeep(participantType, o.participantType, true) && compareDeep(type, o.type, true) && compareDeep(groupingBehavior, o.groupingBehavior, true) && compareDeep(selectionBehavior, o.selectionBehavior, true) && compareDeep(requiredBehavior, o.requiredBehavior, true) && compareDeep(precheckBehavior, o.precheckBehavior, true) && compareDeep(cardinalityBehavior, o.cardinalityBehavior, true) && compareDeep(activityDefinition, o.activityDefinition, true) @@ -2546,9 +2836,9 @@ public class PlanDefinition extends MetadataResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(actionIdentifier, label, title , description, textEquivalent, code, documentation, triggerDefinition, condition - , relatedAction, timing, participantType, type, groupingBehavior, selectionBehavior - , requiredBehavior, precheckBehavior, cardinalityBehavior, activityDefinition, transform - , dynamicValue, actionDefinition); + , input, output, relatedAction, timing, participantType, type, groupingBehavior + , selectionBehavior, requiredBehavior, precheckBehavior, cardinalityBehavior, activityDefinition + , transform, dynamicValue, actionDefinition); } public String fhirType() { @@ -2560,28 +2850,36 @@ public class PlanDefinition extends MetadataResource { @Block() public static class PlanDefinitionActionDefinitionConditionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of condition. + */ + @Child(name = "kind", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="applicability | start | stop", formalDefinition="The kind of condition." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-condition-kind") + protected Enumeration kind; + /** * A brief, natural language description of the condition that effectively communicates the intended semantics. */ - @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Natural language description of the condition", formalDefinition="A brief, natural language description of the condition that effectively communicates the intended semantics." ) protected StringType description; /** * The media type of the language for the expression. */ - @Child(name = "language", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "language", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Language of the expression", formalDefinition="The media type of the language for the expression." ) protected StringType language; /** * An expression that returns true or false, indicating whether or not the condition is satisfied. */ - @Child(name = "expression", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "expression", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Boolean-valued expression", formalDefinition="An expression that returns true or false, indicating whether or not the condition is satisfied." ) protected StringType expression; - private static final long serialVersionUID = 1354288281L; + private static final long serialVersionUID = 1111982240L; /** * Constructor @@ -2590,6 +2888,59 @@ public class PlanDefinition extends MetadataResource { super(); } + /** + * Constructor + */ + public PlanDefinitionActionDefinitionConditionComponent(Enumeration kind) { + super(); + this.kind = kind; + } + + /** + * @return {@link #kind} (The kind of condition.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PlanDefinitionActionDefinitionConditionComponent.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new PlanActionConditionKindEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (The kind of condition.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public PlanDefinitionActionDefinitionConditionComponent setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return The kind of condition. + */ + public PlanActionConditionKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value The kind of condition. + */ + public PlanDefinitionActionDefinitionConditionComponent setKind(PlanActionConditionKind value) { + if (this.kind == null) + this.kind = new Enumeration(new PlanActionConditionKindEnumFactory()); + this.kind.setValue(value); + return this; + } + /** * @return {@link #description} (A brief, natural language description of the condition that effectively communicates the intended semantics.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value */ @@ -2739,6 +3090,7 @@ public class PlanDefinition extends MetadataResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); + childrenList.add(new Property("kind", "code", "The kind of condition.", 0, java.lang.Integer.MAX_VALUE, kind)); childrenList.add(new Property("description", "string", "A brief, natural language description of the condition that effectively communicates the intended semantics.", 0, java.lang.Integer.MAX_VALUE, description)); childrenList.add(new Property("language", "string", "The media type of the language for the expression.", 0, java.lang.Integer.MAX_VALUE, language)); childrenList.add(new Property("expression", "string", "An expression that returns true or false, indicating whether or not the condition is satisfied.", 0, java.lang.Integer.MAX_VALUE, expression)); @@ -2747,6 +3099,7 @@ public class PlanDefinition extends MetadataResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { + case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // StringType case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType @@ -2758,6 +3111,9 @@ public class PlanDefinition extends MetadataResource { @Override public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { + case 3292052: // kind + this.kind = new PlanActionConditionKindEnumFactory().fromType(value); // Enumeration + break; case -1724546052: // description this.description = castToString(value); // StringType break; @@ -2774,7 +3130,9 @@ public class PlanDefinition extends MetadataResource { @Override public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("description")) + if (name.equals("kind")) + this.kind = new PlanActionConditionKindEnumFactory().fromType(value); // Enumeration + else if (name.equals("description")) this.description = castToString(value); // StringType else if (name.equals("language")) this.language = castToString(value); // StringType @@ -2787,6 +3145,7 @@ public class PlanDefinition extends MetadataResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { + case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // StringType case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType @@ -2797,7 +3156,10 @@ public class PlanDefinition extends MetadataResource { @Override public Base addChild(String name) throws FHIRException { - if (name.equals("description")) { + if (name.equals("kind")) { + throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.kind"); + } + else if (name.equals("description")) { throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.description"); } else if (name.equals("language")) { @@ -2813,6 +3175,7 @@ public class PlanDefinition extends MetadataResource { public PlanDefinitionActionDefinitionConditionComponent copy() { PlanDefinitionActionDefinitionConditionComponent dst = new PlanDefinitionActionDefinitionConditionComponent(); copyValues(dst); + dst.kind = kind == null ? null : kind.copy(); dst.description = description == null ? null : description.copy(); dst.language = language == null ? null : language.copy(); dst.expression = expression == null ? null : expression.copy(); @@ -2826,7 +3189,7 @@ public class PlanDefinition extends MetadataResource { if (!(other instanceof PlanDefinitionActionDefinitionConditionComponent)) return false; PlanDefinitionActionDefinitionConditionComponent o = (PlanDefinitionActionDefinitionConditionComponent) other; - return compareDeep(description, o.description, true) && compareDeep(language, o.language, true) + return compareDeep(kind, o.kind, true) && compareDeep(description, o.description, true) && compareDeep(language, o.language, true) && compareDeep(expression, o.expression, true); } @@ -2837,13 +3200,13 @@ public class PlanDefinition extends MetadataResource { if (!(other instanceof PlanDefinitionActionDefinitionConditionComponent)) return false; PlanDefinitionActionDefinitionConditionComponent o = (PlanDefinitionActionDefinitionConditionComponent) other; - return compareValues(description, o.description, true) && compareValues(language, o.language, true) + return compareValues(kind, o.kind, true) && compareValues(description, o.description, true) && compareValues(language, o.language, true) && compareValues(expression, o.expression, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, language, expression - ); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(kind, description, language + , expression); } public String fhirType() { diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Practitioner.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Practitioner.java index 16ee2fde617..c8d012f5f5b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Practitioner.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Practitioner.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -2279,6 +2279,32 @@ public class Practitioner extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); + /** + * Search parameter: endpoint + *

+ * Description: The endpoint of the practitioner for a role at an organization
+ * Type: reference
+ * Path: Practitioner.role.endpoint
+ *

+ */ + @SearchParamDefinition(name="endpoint", path="Practitioner.role.endpoint", description="The endpoint of the practitioner for a role at an organization", type="reference", target={Endpoint.class } ) + public static final String SP_ENDPOINT = "endpoint"; + /** + * Fluent Client search parameter constant for endpoint + *

+ * Description: The endpoint of the practitioner for a role at an organization
+ * Type: reference
+ * Path: Practitioner.role.endpoint
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENDPOINT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Practitioner:endpoint". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include("Practitioner:endpoint").toLocked(); + /** * Search parameter: phonetic *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PractitionerRole.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PractitionerRole.java index 574b22a40d3..e798dc4dca0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PractitionerRole.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/PractitionerRole.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -2020,6 +2020,32 @@ public class PractitionerRole extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY); + /** + * Search parameter: endpoint + *

+ * Description: Technical endpoints providing access to services operated for the practitioner with this role
+ * Type: reference
+ * Path: PractitionerRole.endpoint
+ *

+ */ + @SearchParamDefinition(name="endpoint", path="PractitionerRole.endpoint", description="Technical endpoints providing access to services operated for the practitioner with this role", type="reference", target={Endpoint.class } ) + public static final String SP_ENDPOINT = "endpoint"; + /** + * Fluent Client search parameter constant for endpoint + *

+ * Description: Technical endpoints providing access to services operated for the practitioner with this role
+ * Type: reference
+ * Path: PractitionerRole.endpoint
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENDPOINT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "PractitionerRole:endpoint". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include("PractitionerRole:endpoint").toLocked(); + /** * Search parameter: role *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Procedure.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Procedure.java index 9ddd08bc6c4..dc7e8b87cb5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Procedure.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Procedure.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcedureRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcedureRequest.java index adbf98fb217..3972f6a42ee 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcedureRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcedureRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcessRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcessRequest.java index 6a40baa97c6..465eef0a8e6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcessRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcessRequest.java @@ -29,12 +29,11 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.dstu3.model.Enumerations.*; import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.api.annotation.Child; @@ -51,19 +50,19 @@ public class ProcessRequest extends DomainResource { public enum ProcessRequestStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +96,19 @@ public class ProcessRequest extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/processrequest-status"; - case CANCELLED: return "http://hl7.org/fhir/processrequest-status"; - case DRAFT: return "http://hl7.org/fhir/processrequest-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/processrequest-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +117,7 @@ public class ProcessRequest extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -463,46 +462,23 @@ public class ProcessRequest extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/processrequest-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - /** * The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. */ - @Child(name = "action", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) + @Child(name = "action", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="cancel | poll | reprocess | status", formalDefinition="The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/actionlist") protected Enumeration action; - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - /** * The organization which is the target of the request. */ - @Child(name = "target", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Child(name = "target", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Target of the request", formalDefinition="The organization which is the target of the request." ) protected Reference target; @@ -511,10 +487,17 @@ public class ProcessRequest extends DomainResource { */ protected Organization targetTarget; + /** + * The date when this resource was created. + */ + @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) + protected DateTimeType created; + /** * The practitioner who is responsible for the action specified in this request. */ - @Child(name = "provider", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the action specified in this request." ) protected Reference provider; @@ -526,7 +509,7 @@ public class ProcessRequest extends DomainResource { /** * The organization which is responsible for the action speccified in this request. */ - @Child(name = "organization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the action speccified in this request." ) protected Reference organization; @@ -538,7 +521,7 @@ public class ProcessRequest extends DomainResource { /** * Reference of resource which is the target or subject of this action. */ - @Child(name = "request", type = {Reference.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "request", type = {Reference.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Request reference", formalDefinition="Reference of resource which is the target or subject of this action." ) protected Reference request; @@ -550,7 +533,7 @@ public class ProcessRequest extends DomainResource { /** * Reference of a prior response to resource which is the target or subject of this action. */ - @Child(name = "response", type = {Reference.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "response", type = {Reference.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Response reference", formalDefinition="Reference of a prior response to resource which is the target or subject of this action." ) protected Reference response; @@ -562,46 +545,46 @@ public class ProcessRequest extends DomainResource { /** * If true remove all history excluding audit. */ - @Child(name = "nullify", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "nullify", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Nullify", formalDefinition="If true remove all history excluding audit." ) protected BooleanType nullify; /** * A reference to supply which authenticates the process. */ - @Child(name = "reference", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "reference", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Reference number/string", formalDefinition="A reference to supply which authenticates the process." ) protected StringType reference; /** * List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. */ - @Child(name = "item", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "item", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Items to re-adjudicate", formalDefinition="List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated." ) protected List item; /** * Names of resource types to include. */ - @Child(name = "include", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "include", type = {StringType.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @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=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "exclude", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Resource type(s) to exclude", formalDefinition="Names of resource types to exclude." ) protected List exclude; /** * A period of time during which the fulfilling resources would have been created. */ - @Child(name = "period", type = {Period.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Child(name = "period", type = {Period.class}, order=14, min=0, max=1, modifier=false, summary=false) @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 = 1329951961L; + private static final long serialVersionUID = -346692020L; /** * Constructor @@ -610,15 +593,6 @@ public class ProcessRequest extends DomainResource { super(); } - /** - * Constructor - */ - public ProcessRequest(Enumeration status, Enumeration action) { - super(); - this.status = status; - this.action = action; - } - /** * @return {@link #identifier} (The ProcessRequest business identifier.) */ @@ -711,57 +685,13 @@ public class ProcessRequest extends DomainResource { * @param value The status of the resource instance. */ public ProcessRequest setStatus(ProcessRequestStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new ProcessRequestStatusEnumFactory()); this.status.setValue(value); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 ProcessRequest setRuleset(Coding value) { - this.ruleset = 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 ProcessRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - 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 ProcessRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; + } return this; } @@ -804,9 +734,57 @@ public class ProcessRequest extends DomainResource { * @param value The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. */ public ProcessRequest setAction(ActionList value) { + if (value == null) + this.action = null; + else { if (this.action == null) this.action = new Enumeration(new ActionListEnumFactory()); this.action.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The organization which is the target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); // cc + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The organization which is the target of the request.) + */ + public ProcessRequest 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. (The organization which is the target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessRequest.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); // aa + 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. (The organization which is the target of the request.) + */ + public ProcessRequest setTargetTarget(Organization value) { + this.targetTarget = value; return this; } @@ -859,50 +837,6 @@ public class ProcessRequest extends DomainResource { return this; } - /** - * @return {@link #target} (The organization which is the target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The organization which is the target of the request.) - */ - public ProcessRequest 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. (The organization which is the target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); // aa - 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. (The organization which is the target of the request.) - */ - public ProcessRequest setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - /** * @return {@link #provider} (The practitioner who is responsible for the action specified in this request.) */ @@ -1366,11 +1300,9 @@ public class ProcessRequest extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The ProcessRequest business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - 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("action", "code", "The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.", 0, java.lang.Integer.MAX_VALUE, action)); - 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 organization which is the target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the action specified in this request.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the action speccified in this request.", 0, java.lang.Integer.MAX_VALUE, organization)); childrenList.add(new Property("request", "Reference(Any)", "Reference of resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, request)); @@ -1388,11 +1320,9 @@ public class ProcessRequest extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // Enumeration - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference + case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference @@ -1417,21 +1347,15 @@ public class ProcessRequest extends DomainResource { case -892481550: // status this.status = new ProcessRequestStatusEnumFactory().fromType(value); // Enumeration break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; case -1422950858: // action this.action = new ActionListEnumFactory().fromType(value); // Enumeration break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; case -880905839: // target this.target = castToReference(value); // Reference break; + case 1028554472: // created + this.created = castToDateTime(value); // DateTimeType + break; case -987494927: // provider this.provider = castToReference(value); // Reference break; @@ -1473,16 +1397,12 @@ public class ProcessRequest extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new ProcessRequestStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding else if (name.equals("action")) this.action = new ActionListEnumFactory().fromType(value); // Enumeration - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType else if (name.equals("target")) this.target = castToReference(value); // Reference + else if (name.equals("created")) + this.created = castToDateTime(value); // DateTimeType else if (name.equals("provider")) this.provider = castToReference(value); // Reference else if (name.equals("organization")) @@ -1512,11 +1432,9 @@ public class ProcessRequest extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding case -1422950858: throw new FHIRException("Cannot make property action as it is not a complex type"); // Enumeration - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType case -880905839: return getTarget(); // Reference + case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType case -987494927: return getProvider(); // Reference case 1178922291: return getOrganization(); // Reference case 1095692943: return getRequest(); // Reference @@ -1540,24 +1458,16 @@ public class ProcessRequest extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.status"); } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } else if (name.equals("action")) { throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.action"); } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.created"); - } else if (name.equals("target")) { this.target = new Reference(); return this.target; } + else if (name.equals("created")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.created"); + } else if (name.equals("provider")) { this.provider = new Reference(); return this.provider; @@ -1611,11 +1521,9 @@ public class ProcessRequest extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); dst.action = action == null ? null : action.copy(); - dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); + dst.created = created == null ? null : created.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); dst.request = request == null ? null : request.copy(); @@ -1652,9 +1560,8 @@ public class ProcessRequest extends DomainResource { if (!(other instanceof ProcessRequest)) return false; ProcessRequest o = (ProcessRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(action, o.action, true) - && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(action, o.action, true) + && compareDeep(target, o.target, true) && compareDeep(created, o.created, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) && compareDeep(nullify, o.nullify, true) && compareDeep(reference, o.reference, true) && compareDeep(item, o.item, true) && compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true) && compareDeep(period, o.period, true) @@ -1674,9 +1581,9 @@ public class ProcessRequest extends DomainResource { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, ruleset - , originalRuleset, action, created, target, provider, organization, request, response - , nullify, reference, item, include, exclude, period); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, action + , target, created, provider, organization, request, response, nullify, reference + , item, include, exclude, period); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcessResponse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcessResponse.java index ca337cc68e5..b62fe75088c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcessResponse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ProcessResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -51,19 +51,19 @@ public class ProcessResponse extends DomainResource { public enum ProcessResponseStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +97,19 @@ public class ProcessResponse extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/processresponse-status"; - case CANCELLED: return "http://hl7.org/fhir/processresponse-status"; - case DRAFT: return "http://hl7.org/fhir/processresponse-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/processresponse-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +118,7 @@ public class ProcessResponse extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -172,14 +172,14 @@ public class ProcessResponse extends DomainResource { } @Block() - public static class ProcessResponseNotesComponent extends BackboneElement implements IBaseBackboneElement { + public static class ProcessResponseNoteComponent extends BackboneElement implements IBaseBackboneElement { /** * The note purpose: Print/Display. */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type") - protected Coding type; + protected CodeableConcept type; /** * The note text. @@ -188,24 +188,24 @@ public class ProcessResponse extends DomainResource { @Description(shortDefinition="Notes text", formalDefinition="The note text." ) protected StringType text; - private static final long serialVersionUID = 129959202L; + private static final long serialVersionUID = 874830709L; /** * Constructor */ - public ProcessResponseNotesComponent() { + public ProcessResponseNoteComponent() { super(); } /** * @return {@link #type} (The note purpose: Print/Display.) */ - public Coding getType() { + public CodeableConcept getType() { if (this.type == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponseNotesComponent.type"); + throw new Error("Attempt to auto-create ProcessResponseNoteComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc + this.type = new CodeableConcept(); // cc return this.type; } @@ -216,7 +216,7 @@ public class ProcessResponse extends DomainResource { /** * @param value {@link #type} (The note purpose: Print/Display.) */ - public ProcessResponseNotesComponent setType(Coding value) { + public ProcessResponseNoteComponent setType(CodeableConcept value) { this.type = value; return this; } @@ -227,7 +227,7 @@ public class ProcessResponse extends DomainResource { public StringType getTextElement() { if (this.text == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponseNotesComponent.text"); + throw new Error("Attempt to auto-create ProcessResponseNoteComponent.text"); else if (Configuration.doAutoCreate()) this.text = new StringType(); // bb return this.text; @@ -244,7 +244,7 @@ public class ProcessResponse extends DomainResource { /** * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value */ - public ProcessResponseNotesComponent setTextElement(StringType value) { + public ProcessResponseNoteComponent setTextElement(StringType value) { this.text = value; return this; } @@ -259,7 +259,7 @@ public class ProcessResponse extends DomainResource { /** * @param value The note text. */ - public ProcessResponseNotesComponent setText(String value) { + public ProcessResponseNoteComponent setText(String value) { if (Utilities.noString(value)) this.text = null; else { @@ -272,14 +272,14 @@ public class ProcessResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "CodeableConcept", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType default: return super.getProperty(hash, name, checkValid); } @@ -290,7 +290,7 @@ public class ProcessResponse extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3575610: // type - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept break; case 3556653: // text this.text = castToString(value); // StringType @@ -303,7 +303,7 @@ public class ProcessResponse extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) - this.type = castToCoding(value); // Coding + this.type = castToCodeableConcept(value); // CodeableConcept else if (name.equals("text")) this.text = castToString(value); // StringType else @@ -313,7 +313,7 @@ public class ProcessResponse extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case 3575610: return getType(); // Coding + case 3575610: return getType(); // CodeableConcept case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType default: return super.makeProperty(hash, name); } @@ -323,7 +323,7 @@ public class ProcessResponse extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("type")) { - this.type = new Coding(); + this.type = new CodeableConcept(); return this.type; } else if (name.equals("text")) { @@ -333,8 +333,8 @@ public class ProcessResponse extends DomainResource { return super.addChild(name); } - public ProcessResponseNotesComponent copy() { - ProcessResponseNotesComponent dst = new ProcessResponseNotesComponent(); + public ProcessResponseNoteComponent copy() { + ProcessResponseNoteComponent dst = new ProcessResponseNoteComponent(); copyValues(dst); dst.type = type == null ? null : type.copy(); dst.text = text == null ? null : text.copy(); @@ -345,9 +345,9 @@ public class ProcessResponse extends DomainResource { public boolean equalsDeep(Base other) { if (!super.equalsDeep(other)) return false; - if (!(other instanceof ProcessResponseNotesComponent)) + if (!(other instanceof ProcessResponseNoteComponent)) return false; - ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; + ProcessResponseNoteComponent o = (ProcessResponseNoteComponent) other; return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); } @@ -355,9 +355,9 @@ public class ProcessResponse extends DomainResource { public boolean equalsShallow(Base other) { if (!super.equalsShallow(other)) return false; - if (!(other instanceof ProcessResponseNotesComponent)) + if (!(other instanceof ProcessResponseNoteComponent)) return false; - ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; + ProcessResponseNoteComponent o = (ProcessResponseNoteComponent) other; return compareValues(text, o.text, true); } @@ -366,7 +366,7 @@ public class ProcessResponse extends DomainResource { } public String fhirType() { - return "ProcessResponse.notes"; + return "ProcessResponse.note"; } @@ -382,15 +382,34 @@ public class ProcessResponse extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/processresponse-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name = "created", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * The organization who produced this adjudicated response. + */ + @Child(name = "organization", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Authoring Organization", formalDefinition="The organization who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who produced this adjudicated response.) + */ + protected Organization organizationTarget; + /** * Original request resource reference. */ - @Child(name = "request", type = {Reference.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "request", type = {Reference.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Request reference", formalDefinition="Original request resource reference." ) protected Reference request; @@ -402,57 +421,22 @@ public class ProcessResponse extends DomainResource { /** * Transaction status: error, complete, held. */ - @Child(name = "outcome", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "outcome", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/process-outcome") - protected Coding outcome; + protected CodeableConcept outcome; /** * A description of the status of the adjudication or processing. */ - @Child(name = "disposition", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "disposition", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." ) protected StringType disposition; - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ruleset") - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The organization who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Authoring Organization", formalDefinition="The organization who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who produced this adjudicated response.) - */ - protected Organization organizationTarget; - /** * The practitioner who is responsible for the services rendered to the patient. */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestProvider", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible Practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) protected Reference requestProvider; @@ -464,7 +448,7 @@ public class ProcessResponse extends DomainResource { /** * The organization which is responsible for the services rendered to the patient. */ - @Child(name = "requestOrganization", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "requestOrganization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) protected Reference requestOrganization; @@ -476,27 +460,39 @@ public class ProcessResponse extends DomainResource { /** * The form to be used for printing the content. */ - @Child(name = "form", type = {Coding.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "form", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms") - protected Coding form; + protected CodeableConcept form; /** * Suite of processing note or additional requirements is the processing has been held. */ - @Child(name = "notes", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "note", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Notes", formalDefinition="Suite of processing note or additional requirements is the processing has been held." ) - protected List notes; + protected List note; /** * Processing errors. */ - @Child(name = "error", type = {Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "error", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Error code", formalDefinition="Processing errors." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-error") - protected List error; + protected List error; - private static final long serialVersionUID = -863829800L; + /** + * Request for additional supporting or authorizing information, such as: documents, images or resources. + */ + @Child(name = "communicationRequest", type = {CommunicationRequest.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Request for additional information", formalDefinition="Request for additional supporting or authorizing information, such as: documents, images or resources." ) + protected List communicationRequest; + /** + * The actual objects that are the target of the reference (Request for additional supporting or authorizing information, such as: documents, images or resources.) + */ + protected List communicationRequestTarget; + + + private static final long serialVersionUID = -184071719L; /** * Constructor @@ -505,14 +501,6 @@ public class ProcessResponse extends DomainResource { super(); } - /** - * Constructor - */ - public ProcessResponse(Enumeration status) { - super(); - this.status = status; - } - /** * @return {@link #identifier} (The Response business identifier.) */ @@ -605,172 +593,16 @@ public class ProcessResponse extends DomainResource { * @param value The status of the resource instance. */ public ProcessResponse setStatus(ProcessResponseStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new ProcessResponseStatusEnumFactory()); this.status.setValue(value); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public ProcessResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 reference.) - */ - public Resource getRequestTarget() { - 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 reference.) - */ - public ProcessResponse setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete, held.) - */ - public Coding getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Coding(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete, held.) - */ - public ProcessResponse setOutcome(Coding value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ProcessResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication or processing. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication or processing. - */ - public ProcessResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); } return this; } - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 ProcessResponse setRuleset(Coding value) { - this.ruleset = 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 ProcessResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - 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 ProcessResponse 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 */ @@ -864,6 +696,118 @@ public class ProcessResponse extends DomainResource { return this; } + /** + * @return {@link #request} (Original request resource reference.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); // cc + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource reference.) + */ + public ProcessResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 reference.) + */ + public Resource getRequestTarget() { + 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 reference.) + */ + public ProcessResponse setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete, held.) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); // cc + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete, held.) + */ + public ProcessResponse setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcessResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); // bb + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ProcessResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication or processing. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication or processing. + */ + public ProcessResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + /** * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) */ @@ -955,12 +899,12 @@ public class ProcessResponse extends DomainResource { /** * @return {@link #form} (The form to be used for printing the content.) */ - public Coding getForm() { + public CodeableConcept getForm() { if (this.form == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ProcessResponse.form"); else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc + this.form = new CodeableConcept(); // cc return this.form; } @@ -971,77 +915,77 @@ public class ProcessResponse extends DomainResource { /** * @param value {@link #form} (The form to be used for printing the content.) */ - public ProcessResponse setForm(Coding value) { + public ProcessResponse setForm(CodeableConcept value) { this.form = value; return this; } /** - * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) + * @return {@link #note} (Suite of processing note or additional requirements is the processing has been held.) */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; } /** * @return Returns a reference to this for easy method chaining */ - public ProcessResponse setNotes(List theNotes) { - this.notes = theNotes; + public ProcessResponse setNote(List theNote) { + this.note = theNote; return this; } - public boolean hasNotes() { - if (this.notes == null) + public boolean hasNote() { + if (this.note == null) return false; - for (ProcessResponseNotesComponent item : this.notes) + for (ProcessResponseNoteComponent item : this.note) if (!item.isEmpty()) return true; return false; } - public ProcessResponseNotesComponent addNotes() { //3 - ProcessResponseNotesComponent t = new ProcessResponseNotesComponent(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); + public ProcessResponseNoteComponent addNote() { //3 + ProcessResponseNoteComponent t = new ProcessResponseNoteComponent(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); return t; } - public ProcessResponse addNotes(ProcessResponseNotesComponent t) { //3 + public ProcessResponse addNote(ProcessResponseNoteComponent t) { //3 if (t == null) return this; - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); return this; } /** - * @return The first repetition of repeating field {@link #notes}, creating it if it does not already exist + * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist */ - public ProcessResponseNotesComponent getNotesFirstRep() { - if (getNotes().isEmpty()) { - addNotes(); + public ProcessResponseNoteComponent getNoteFirstRep() { + if (getNote().isEmpty()) { + addNote(); } - return getNotes().get(0); + return getNote().get(0); } /** * @return {@link #error} (Processing errors.) */ - public List getError() { + public List getError() { if (this.error == null) - this.error = new ArrayList(); + this.error = new ArrayList(); return this.error; } /** * @return Returns a reference to this for easy method chaining */ - public ProcessResponse setError(List theError) { + public ProcessResponse setError(List theError) { this.error = theError; return this; } @@ -1049,25 +993,25 @@ public class ProcessResponse extends DomainResource { public boolean hasError() { if (this.error == null) return false; - for (Coding item : this.error) + for (CodeableConcept item : this.error) if (!item.isEmpty()) return true; return false; } - public Coding addError() { //3 - Coding t = new Coding(); + public CodeableConcept addError() { //3 + CodeableConcept t = new CodeableConcept(); if (this.error == null) - this.error = new ArrayList(); + this.error = new ArrayList(); this.error.add(t); return t; } - public ProcessResponse addError(Coding t) { //3 + public ProcessResponse addError(CodeableConcept t) { //3 if (t == null) return this; if (this.error == null) - this.error = new ArrayList(); + this.error = new ArrayList(); this.error.add(t); return this; } @@ -1075,29 +1019,103 @@ public class ProcessResponse extends DomainResource { /** * @return The first repetition of repeating field {@link #error}, creating it if it does not already exist */ - public Coding getErrorFirstRep() { + public CodeableConcept getErrorFirstRep() { if (getError().isEmpty()) { addError(); } return getError().get(0); } + /** + * @return {@link #communicationRequest} (Request for additional supporting or authorizing information, such as: documents, images or resources.) + */ + public List getCommunicationRequest() { + if (this.communicationRequest == null) + this.communicationRequest = new ArrayList(); + return this.communicationRequest; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ProcessResponse setCommunicationRequest(List theCommunicationRequest) { + this.communicationRequest = theCommunicationRequest; + return this; + } + + public boolean hasCommunicationRequest() { + if (this.communicationRequest == null) + return false; + for (Reference item : this.communicationRequest) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addCommunicationRequest() { //3 + Reference t = new Reference(); + if (this.communicationRequest == null) + this.communicationRequest = new ArrayList(); + this.communicationRequest.add(t); + return t; + } + + public ProcessResponse addCommunicationRequest(Reference t) { //3 + if (t == null) + return this; + if (this.communicationRequest == null) + this.communicationRequest = new ArrayList(); + this.communicationRequest.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #communicationRequest}, creating it if it does not already exist + */ + public Reference getCommunicationRequestFirstRep() { + if (getCommunicationRequest().isEmpty()) { + addCommunicationRequest(); + } + return getCommunicationRequest().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getCommunicationRequestTarget() { + if (this.communicationRequestTarget == null) + this.communicationRequestTarget = new ArrayList(); + return this.communicationRequestTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public CommunicationRequest addCommunicationRequestTarget() { + CommunicationRequest r = new CommunicationRequest(); + if (this.communicationRequestTarget == null) + this.communicationRequestTarget = new ArrayList(); + this.communicationRequestTarget.add(r); + return r; + } + 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("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("request", "Reference(Any)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "Coding", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome)); - 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("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 organization who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("request", "Reference(Any)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "CodeableConcept", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome)); + 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("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)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("notes", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("error", "Coding", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("note", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("error", "CodeableConcept", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("communicationRequest", "Reference(CommunicationRequest)", "Request for additional supporting or authorizing information, such as: documents, images or resources.", 0, java.lang.Integer.MAX_VALUE, communicationRequest)); } @Override @@ -1105,18 +1123,17 @@ public class ProcessResponse extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Coding - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference + case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference + case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept + case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // ProcessResponseNotesComponent - case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // Coding + case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // ProcessResponseNoteComponent + case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // CodeableConcept + case -2071896615: /*communicationRequest*/ return this.communicationRequest == null ? new Base[0] : this.communicationRequest.toArray(new Base[this.communicationRequest.size()]); // Reference default: return super.getProperty(hash, name, checkValid); } @@ -1131,27 +1148,21 @@ public class ProcessResponse extends DomainResource { case -892481550: // status this.status = new ProcessResponseStatusEnumFactory().fromType(value); // Enumeration break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case -1106507950: // outcome - this.outcome = castToCoding(value); // Coding - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; case 1028554472: // created this.created = castToDateTime(value); // DateTimeType break; case 1178922291: // organization this.organization = castToReference(value); // Reference break; + case 1095692943: // request + this.request = castToReference(value); // Reference + break; + case -1106507950: // outcome + this.outcome = castToCodeableConcept(value); // CodeableConcept + break; + case 583380919: // disposition + this.disposition = castToString(value); // StringType + break; case 1601527200: // requestProvider this.requestProvider = castToReference(value); // Reference break; @@ -1159,13 +1170,16 @@ public class ProcessResponse extends DomainResource { this.requestOrganization = castToReference(value); // Reference break; case 3148996: // form - this.form = castToCoding(value); // Coding + this.form = castToCodeableConcept(value); // CodeableConcept break; - case 105008833: // notes - this.getNotes().add((ProcessResponseNotesComponent) value); // ProcessResponseNotesComponent + case 3387378: // note + this.getNote().add((ProcessResponseNoteComponent) value); // ProcessResponseNoteComponent break; case 96784904: // error - this.getError().add(castToCoding(value)); // Coding + this.getError().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -2071896615: // communicationRequest + this.getCommunicationRequest().add(castToReference(value)); // Reference break; default: super.setProperty(hash, name, value); } @@ -1178,30 +1192,28 @@ public class ProcessResponse extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new ProcessResponseStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("request")) - this.request = castToReference(value); // Reference - else if (name.equals("outcome")) - this.outcome = castToCoding(value); // Coding - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding else if (name.equals("created")) this.created = castToDateTime(value); // DateTimeType else if (name.equals("organization")) this.organization = castToReference(value); // Reference + else if (name.equals("request")) + this.request = castToReference(value); // Reference + else if (name.equals("outcome")) + this.outcome = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("disposition")) + this.disposition = castToString(value); // StringType else if (name.equals("requestProvider")) this.requestProvider = castToReference(value); // Reference else if (name.equals("requestOrganization")) this.requestOrganization = castToReference(value); // Reference else if (name.equals("form")) - this.form = castToCoding(value); // Coding - else if (name.equals("notes")) - this.getNotes().add((ProcessResponseNotesComponent) value); + this.form = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("note")) + this.getNote().add((ProcessResponseNoteComponent) value); else if (name.equals("error")) - this.getError().add(castToCoding(value)); + this.getError().add(castToCodeableConcept(value)); + else if (name.equals("communicationRequest")) + this.getCommunicationRequest().add(castToReference(value)); else super.setProperty(name, value); } @@ -1211,18 +1223,17 @@ public class ProcessResponse extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1095692943: return getRequest(); // Reference - case -1106507950: return getOutcome(); // Coding - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType case 1178922291: return getOrganization(); // Reference + case 1095692943: return getRequest(); // Reference + case -1106507950: return getOutcome(); // CodeableConcept + case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType case 1601527200: return getRequestProvider(); // Reference case 599053666: return getRequestOrganization(); // Reference - case 3148996: return getForm(); // Coding - case 105008833: return addNotes(); // ProcessResponseNotesComponent - case 96784904: return addError(); // Coding + case 3148996: return getForm(); // CodeableConcept + case 3387378: return addNote(); // ProcessResponseNoteComponent + case 96784904: return addError(); // CodeableConcept + case -2071896615: return addCommunicationRequest(); // Reference default: return super.makeProperty(hash, name); } @@ -1236,25 +1247,6 @@ public class ProcessResponse extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.status"); } - else if (name.equals("request")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("outcome")) { - this.outcome = new Coding(); - return this.outcome; - } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.disposition"); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } else if (name.equals("created")) { throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.created"); } @@ -1262,6 +1254,17 @@ public class ProcessResponse extends DomainResource { this.organization = new Reference(); return this.organization; } + else if (name.equals("request")) { + this.request = new Reference(); + return this.request; + } + else if (name.equals("outcome")) { + this.outcome = new CodeableConcept(); + return this.outcome; + } + else if (name.equals("disposition")) { + throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.disposition"); + } else if (name.equals("requestProvider")) { this.requestProvider = new Reference(); return this.requestProvider; @@ -1271,15 +1274,18 @@ public class ProcessResponse extends DomainResource { return this.requestOrganization; } else if (name.equals("form")) { - this.form = new Coding(); + this.form = new CodeableConcept(); return this.form; } - else if (name.equals("notes")) { - return addNotes(); + else if (name.equals("note")) { + return addNote(); } else if (name.equals("error")) { return addError(); } + else if (name.equals("communicationRequest")) { + return addCommunicationRequest(); + } else return super.addChild(name); } @@ -1298,26 +1304,29 @@ public class ProcessResponse extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); + dst.created = created == null ? null : created.copy(); + dst.organization = organization == null ? null : organization.copy(); dst.request = request == null ? null : request.copy(); dst.outcome = outcome == null ? null : outcome.copy(); dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); dst.form = form == null ? null : form.copy(); - if (notes != null) { - dst.notes = new ArrayList(); - for (ProcessResponseNotesComponent i : notes) - dst.notes.add(i.copy()); + if (note != null) { + dst.note = new ArrayList(); + for (ProcessResponseNoteComponent i : note) + dst.note.add(i.copy()); }; if (error != null) { - dst.error = new ArrayList(); - for (Coding i : error) + dst.error = new ArrayList(); + for (CodeableConcept i : error) dst.error.add(i.copy()); }; + if (communicationRequest != null) { + dst.communicationRequest = new ArrayList(); + for (Reference i : communicationRequest) + dst.communicationRequest.add(i.copy()); + }; return dst; } @@ -1332,12 +1341,12 @@ public class ProcessResponse extends DomainResource { if (!(other instanceof ProcessResponse)) return false; ProcessResponse o = (ProcessResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true) - && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(created, o.created, true) + && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) + && compareDeep(disposition, o.disposition, true) && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(form, o.form, true) - && compareDeep(notes, o.notes, true) && compareDeep(error, o.error, true); + && compareDeep(note, o.note, true) && compareDeep(error, o.error, true) && compareDeep(communicationRequest, o.communicationRequest, true) + ; } @Override @@ -1347,14 +1356,14 @@ public class ProcessResponse extends DomainResource { if (!(other instanceof ProcessResponse)) return false; ProcessResponse o = (ProcessResponse) other; - return compareValues(status, o.status, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) + return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(disposition, o.disposition, true) ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request - , outcome, disposition, ruleset, originalRuleset, created, organization, requestProvider - , requestOrganization, form, notes, error); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, created + , organization, request, outcome, disposition, requestProvider, requestOrganization + , form, note, error, communicationRequest); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Provenance.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Provenance.java index ebf1003436c..444f8e311e0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Provenance.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Provenance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -199,30 +199,26 @@ public class Provenance extends DomainResource { /** * The individual, device or organization that participated in the event. */ - @Child(name = "actor", type = {Practitioner.class, RelatedPerson.class, Patient.class, Device.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Individual, device or organization playing role", formalDefinition="The individual, device or organization that participated in the event." ) - protected Reference actor; + @Child(name = "who", type = {UriType.class, Practitioner.class, RelatedPerson.class, Patient.class, Device.class, Organization.class}, order=2, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who participated", formalDefinition="The individual, device or organization that participated in the event." ) + protected Type who; /** - * The actual object that is the target of the reference (The individual, device or organization that participated in the event.) + * A reference to an application-usable description of the identity that is represented by the signature. */ - protected Resource actorTarget; + @Child(name = "onBehalfOf", type = {UriType.class, Practitioner.class, RelatedPerson.class, Patient.class, Device.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="On behalf of", formalDefinition="A reference to an application-usable description of the identity that is represented by the signature." ) + protected Type onBehalfOf; /** - * The identity of the agent as known by the authorization system. + * The type of relationship between agents. */ - @Child(name = "userId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Authorization-system identifier for the agent", formalDefinition="The identity of the agent as known by the authorization system." ) - protected Identifier userId; + @Child(name = "relatedAgentType", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Type of relationship between agents", formalDefinition="The type of relationship between agents." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-RoleLinkType") + protected CodeableConcept relatedAgentType; - /** - * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest. - */ - @Child(name = "relatedAgent", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Track delegation between agents", formalDefinition="A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest." ) - protected List relatedAgent; - - private static final long serialVersionUID = 1792758952L; + private static final long serialVersionUID = 1272491531L; /** * Constructor @@ -234,9 +230,10 @@ public class Provenance extends DomainResource { /** * Constructor */ - public ProvenanceAgentComponent(Coding role) { + public ProvenanceAgentComponent(Coding role, Type who) { super(); this.role = role; + this.who = who; } /** @@ -264,136 +261,134 @@ public class Provenance extends DomainResource { } /** - * @return {@link #actor} (The individual, device or organization that participated in the event.) + * @return {@link #who} (The individual, device or organization that participated in the event.) */ - public Reference getActor() { - if (this.actor == null) + public Type getWho() { + return this.who; + } + + /** + * @return {@link #who} (The individual, device or organization that participated in the event.) + */ + public UriType getWhoUriType() throws FHIRException { + if (!(this.who instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.who.getClass().getName()+" was encountered"); + return (UriType) this.who; + } + + public boolean hasWhoUriType() { + return this.who instanceof UriType; + } + + /** + * @return {@link #who} (The individual, device or organization that participated in the event.) + */ + public Reference getWhoReference() throws FHIRException { + if (!(this.who instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.who.getClass().getName()+" was encountered"); + return (Reference) this.who; + } + + public boolean hasWhoReference() { + return this.who instanceof Reference; + } + + public boolean hasWho() { + return this.who != null && !this.who.isEmpty(); + } + + /** + * @param value {@link #who} (The individual, device or organization that participated in the event.) + */ + public ProvenanceAgentComponent setWho(Type value) { + this.who = value; + return this; + } + + /** + * @return {@link #onBehalfOf} (A reference to an application-usable description of the identity that is represented by the signature.) + */ + public Type getOnBehalfOf() { + return this.onBehalfOf; + } + + /** + * @return {@link #onBehalfOf} (A reference to an application-usable description of the identity that is represented by the signature.) + */ + public UriType getOnBehalfOfUriType() throws FHIRException { + if (!(this.onBehalfOf instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.onBehalfOf.getClass().getName()+" was encountered"); + return (UriType) this.onBehalfOf; + } + + public boolean hasOnBehalfOfUriType() { + return this.onBehalfOf instanceof UriType; + } + + /** + * @return {@link #onBehalfOf} (A reference to an application-usable description of the identity that is represented by the signature.) + */ + public Reference getOnBehalfOfReference() throws FHIRException { + if (!(this.onBehalfOf instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.onBehalfOf.getClass().getName()+" was encountered"); + return (Reference) this.onBehalfOf; + } + + public boolean hasOnBehalfOfReference() { + return this.onBehalfOf instanceof Reference; + } + + public boolean hasOnBehalfOf() { + return this.onBehalfOf != null && !this.onBehalfOf.isEmpty(); + } + + /** + * @param value {@link #onBehalfOf} (A reference to an application-usable description of the identity that is represented by the signature.) + */ + public ProvenanceAgentComponent setOnBehalfOf(Type value) { + this.onBehalfOf = value; + return this; + } + + /** + * @return {@link #relatedAgentType} (The type of relationship between agents.) + */ + public CodeableConcept getRelatedAgentType() { + if (this.relatedAgentType == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.actor"); + throw new Error("Attempt to auto-create ProvenanceAgentComponent.relatedAgentType"); else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; + this.relatedAgentType = new CodeableConcept(); // cc + return this.relatedAgentType; } - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); + public boolean hasRelatedAgentType() { + return this.relatedAgentType != null && !this.relatedAgentType.isEmpty(); } /** - * @param value {@link #actor} (The individual, device or organization that participated in the event.) + * @param value {@link #relatedAgentType} (The type of relationship between agents.) */ - public ProvenanceAgentComponent setActor(Reference value) { - this.actor = value; + public ProvenanceAgentComponent setRelatedAgentType(CodeableConcept value) { + this.relatedAgentType = value; return this; } - /** - * @return {@link #actor} 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 individual, device or organization that participated in the event.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} 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 individual, device or organization that participated in the event.) - */ - public ProvenanceAgentComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #userId} (The identity of the agent as known by the authorization system.) - */ - public Identifier getUserId() { - if (this.userId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.userId"); - else if (Configuration.doAutoCreate()) - this.userId = new Identifier(); // cc - return this.userId; - } - - public boolean hasUserId() { - return this.userId != null && !this.userId.isEmpty(); - } - - /** - * @param value {@link #userId} (The identity of the agent as known by the authorization system.) - */ - public ProvenanceAgentComponent setUserId(Identifier value) { - this.userId = value; - return this; - } - - /** - * @return {@link #relatedAgent} (A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest.) - */ - public List getRelatedAgent() { - if (this.relatedAgent == null) - this.relatedAgent = new ArrayList(); - return this.relatedAgent; - } - - /** - * @return Returns a reference to this for easy method chaining - */ - public ProvenanceAgentComponent setRelatedAgent(List theRelatedAgent) { - this.relatedAgent = theRelatedAgent; - return this; - } - - public boolean hasRelatedAgent() { - if (this.relatedAgent == null) - return false; - for (ProvenanceAgentRelatedAgentComponent item : this.relatedAgent) - if (!item.isEmpty()) - return true; - return false; - } - - public ProvenanceAgentRelatedAgentComponent addRelatedAgent() { //3 - ProvenanceAgentRelatedAgentComponent t = new ProvenanceAgentRelatedAgentComponent(); - if (this.relatedAgent == null) - this.relatedAgent = new ArrayList(); - this.relatedAgent.add(t); - return t; - } - - public ProvenanceAgentComponent addRelatedAgent(ProvenanceAgentRelatedAgentComponent t) { //3 - if (t == null) - return this; - if (this.relatedAgent == null) - this.relatedAgent = new ArrayList(); - this.relatedAgent.add(t); - return this; - } - - /** - * @return The first repetition of repeating field {@link #relatedAgent}, creating it if it does not already exist - */ - public ProvenanceAgentRelatedAgentComponent getRelatedAgentFirstRep() { - if (getRelatedAgent().isEmpty()) { - addRelatedAgent(); - } - return getRelatedAgent().get(0); - } - protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("role", "Coding", "The function of the agent with respect to the activity.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("actor", "Reference(Practitioner|RelatedPerson|Patient|Device|Organization)", "The individual, device or organization that participated in the event.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("userId", "Identifier", "The identity of the agent as known by the authorization system.", 0, java.lang.Integer.MAX_VALUE, userId)); - childrenList.add(new Property("relatedAgent", "", "A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest.", 0, java.lang.Integer.MAX_VALUE, relatedAgent)); + childrenList.add(new Property("who[x]", "uri|Reference(Practitioner|RelatedPerson|Patient|Device|Organization)", "The individual, device or organization that participated in the event.", 0, java.lang.Integer.MAX_VALUE, who)); + childrenList.add(new Property("onBehalfOf[x]", "uri|Reference(Practitioner|RelatedPerson|Patient|Device|Organization)", "A reference to an application-usable description of the identity that is represented by the signature.", 0, java.lang.Integer.MAX_VALUE, onBehalfOf)); + childrenList.add(new Property("relatedAgentType", "CodeableConcept", "The type of relationship between agents.", 0, java.lang.Integer.MAX_VALUE, relatedAgentType)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - case -836030906: /*userId*/ return this.userId == null ? new Base[0] : new Base[] {this.userId}; // Identifier - case 126261658: /*relatedAgent*/ return this.relatedAgent == null ? new Base[0] : this.relatedAgent.toArray(new Base[this.relatedAgent.size()]); // ProvenanceAgentRelatedAgentComponent + case 117694: /*who*/ return this.who == null ? new Base[0] : new Base[] {this.who}; // Type + case -14402964: /*onBehalfOf*/ return this.onBehalfOf == null ? new Base[0] : new Base[] {this.onBehalfOf}; // Type + case 1228161012: /*relatedAgentType*/ return this.relatedAgentType == null ? new Base[0] : new Base[] {this.relatedAgentType}; // CodeableConcept default: return super.getProperty(hash, name, checkValid); } @@ -405,14 +400,14 @@ public class Provenance extends DomainResource { case 3506294: // role this.role = castToCoding(value); // Coding break; - case 92645877: // actor - this.actor = castToReference(value); // Reference + case 117694: // who + this.who = castToType(value); // Type break; - case -836030906: // userId - this.userId = castToIdentifier(value); // Identifier + case -14402964: // onBehalfOf + this.onBehalfOf = castToType(value); // Type break; - case 126261658: // relatedAgent - this.getRelatedAgent().add((ProvenanceAgentRelatedAgentComponent) value); // ProvenanceAgentRelatedAgentComponent + case 1228161012: // relatedAgentType + this.relatedAgentType = castToCodeableConcept(value); // CodeableConcept break; default: super.setProperty(hash, name, value); } @@ -423,12 +418,12 @@ public class Provenance extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("role")) this.role = castToCoding(value); // Coding - else if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else if (name.equals("userId")) - this.userId = castToIdentifier(value); // Identifier - else if (name.equals("relatedAgent")) - this.getRelatedAgent().add((ProvenanceAgentRelatedAgentComponent) value); + else if (name.equals("who[x]")) + this.who = castToType(value); // Type + else if (name.equals("onBehalfOf[x]")) + this.onBehalfOf = castToType(value); // Type + else if (name.equals("relatedAgentType")) + this.relatedAgentType = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); } @@ -437,9 +432,9 @@ public class Provenance extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 3506294: return getRole(); // Coding - case 92645877: return getActor(); // Reference - case -836030906: return getUserId(); // Identifier - case 126261658: return addRelatedAgent(); // ProvenanceAgentRelatedAgentComponent + case -788654078: return getWho(); // Type + case 418120340: return getOnBehalfOf(); // Type + case 1228161012: return getRelatedAgentType(); // CodeableConcept default: return super.makeProperty(hash, name); } @@ -451,16 +446,25 @@ public class Provenance extends DomainResource { this.role = new Coding(); return this.role; } - else if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; + else if (name.equals("whoUri")) { + this.who = new UriType(); + return this.who; } - else if (name.equals("userId")) { - this.userId = new Identifier(); - return this.userId; + else if (name.equals("whoReference")) { + this.who = new Reference(); + return this.who; } - else if (name.equals("relatedAgent")) { - return addRelatedAgent(); + else if (name.equals("onBehalfOfUri")) { + this.onBehalfOf = new UriType(); + return this.onBehalfOf; + } + else if (name.equals("onBehalfOfReference")) { + this.onBehalfOf = new Reference(); + return this.onBehalfOf; + } + else if (name.equals("relatedAgentType")) { + this.relatedAgentType = new CodeableConcept(); + return this.relatedAgentType; } else return super.addChild(name); @@ -470,13 +474,9 @@ public class Provenance extends DomainResource { ProvenanceAgentComponent dst = new ProvenanceAgentComponent(); copyValues(dst); dst.role = role == null ? null : role.copy(); - dst.actor = actor == null ? null : actor.copy(); - dst.userId = userId == null ? null : userId.copy(); - if (relatedAgent != null) { - dst.relatedAgent = new ArrayList(); - for (ProvenanceAgentRelatedAgentComponent i : relatedAgent) - dst.relatedAgent.add(i.copy()); - }; + dst.who = who == null ? null : who.copy(); + dst.onBehalfOf = onBehalfOf == null ? null : onBehalfOf.copy(); + dst.relatedAgentType = relatedAgentType == null ? null : relatedAgentType.copy(); return dst; } @@ -487,8 +487,8 @@ public class Provenance extends DomainResource { if (!(other instanceof ProvenanceAgentComponent)) return false; ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; - return compareDeep(role, o.role, true) && compareDeep(actor, o.actor, true) && compareDeep(userId, o.userId, true) - && compareDeep(relatedAgent, o.relatedAgent, true); + return compareDeep(role, o.role, true) && compareDeep(who, o.who, true) && compareDeep(onBehalfOf, o.onBehalfOf, true) + && compareDeep(relatedAgentType, o.relatedAgentType, true); } @Override @@ -502,7 +502,7 @@ public class Provenance extends DomainResource { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, actor, userId, relatedAgent + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, who, onBehalfOf, relatedAgentType ); } @@ -511,212 +511,6 @@ public class Provenance extends DomainResource { } - } - - @Block() - public static class ProvenanceAgentRelatedAgentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of relationship between agents. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of relationship between agents", formalDefinition="The type of relationship between agents." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-RoleLinkType") - protected CodeableConcept type; - - /** - * An internal reference to another agent listed in this provenance by its identifier. - */ - @Child(name = "target", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to other agent in this resource by identifier", formalDefinition="An internal reference to another agent listed in this provenance by its identifier." ) - protected UriType target; - - private static final long serialVersionUID = 794181198L; - - /** - * Constructor - */ - public ProvenanceAgentRelatedAgentComponent() { - super(); - } - - /** - * Constructor - */ - public ProvenanceAgentRelatedAgentComponent(CodeableConcept type, UriType target) { - super(); - this.type = type; - this.target = target; - } - - /** - * @return {@link #type} (The type of relationship between agents.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentRelatedAgentComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of relationship between agents.) - */ - public ProvenanceAgentRelatedAgentComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #target} (An internal reference to another agent listed in this provenance by its identifier.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value - */ - public UriType getTargetElement() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentRelatedAgentComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new UriType(); // bb - return this.target; - } - - public boolean hasTargetElement() { - return this.target != null && !this.target.isEmpty(); - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (An internal reference to another agent listed in this provenance by its identifier.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value - */ - public ProvenanceAgentRelatedAgentComponent setTargetElement(UriType value) { - this.target = value; - return this; - } - - /** - * @return An internal reference to another agent listed in this provenance by its identifier. - */ - public String getTarget() { - return this.target == null ? null : this.target.getValue(); - } - - /** - * @param value An internal reference to another agent listed in this provenance by its identifier. - */ - public ProvenanceAgentRelatedAgentComponent setTarget(String value) { - if (this.target == null) - this.target = new UriType(); - this.target.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The type of relationship between agents.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("target", "uri", "An internal reference to another agent listed in this provenance by its identifier.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -880905839: // target - this.target = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("target")) - this.target = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // CodeableConcept - case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("target")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.target"); - } - else - return super.addChild(name); - } - - public ProvenanceAgentRelatedAgentComponent copy() { - ProvenanceAgentRelatedAgentComponent dst = new ProvenanceAgentRelatedAgentComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProvenanceAgentRelatedAgentComponent)) - return false; - ProvenanceAgentRelatedAgentComponent o = (ProvenanceAgentRelatedAgentComponent) other; - return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProvenanceAgentRelatedAgentComponent)) - return false; - ProvenanceAgentRelatedAgentComponent o = (ProvenanceAgentRelatedAgentComponent) other; - return compareValues(target, o.target, true); - } - - public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, target); - } - - public String fhirType() { - return "Provenance.agent.relatedAgent"; - - } - } @Block() @@ -729,36 +523,26 @@ public class Provenance extends DomainResource { @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provenance-entity-role") protected Enumeration role; - /** - * The type of the entity. If the entity is a resource, then this is a resource type. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The type of resource in this entity", formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types") - protected Coding type; - /** * Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. */ - @Child(name = "reference", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Child(name = "reference", type = {Reference.class}, order=2, min=1, max=1, modifier=false, summary=true) @Description(shortDefinition="Identity of entity", formalDefinition="Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative." ) - protected UriType reference; + protected Reference reference; /** - * Human-readable description of the entity. + * The actual object that is the target of the reference (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.) */ - @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human description of entity", formalDefinition="Human-readable description of the entity." ) - protected StringType display; + protected Resource referenceTarget; /** * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. */ - @Child(name = "agent", type = {ProvenanceAgentComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "agent", type = {ProvenanceAgentComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Entity is attributed to this agent", formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity." ) protected List agent; - private static final long serialVersionUID = 1066624051L; + private static final long serialVersionUID = 519286833L; /** * Constructor @@ -770,10 +554,9 @@ public class Provenance extends DomainResource { /** * Constructor */ - public ProvenanceEntityComponent(Enumeration role, Coding type, UriType reference) { + public ProvenanceEntityComponent(Enumeration role, Reference reference) { super(); this.role = role; - this.type = type; this.reference = reference; } @@ -823,120 +606,41 @@ public class Provenance extends DomainResource { } /** - * @return {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) + * @return {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.) */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) - */ - public ProvenanceEntityComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { + public Reference getReference() { if (this.reference == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ProvenanceEntityComponent.reference"); else if (Configuration.doAutoCreate()) - this.reference = new UriType(); // bb + this.reference = new Reference(); // cc return this.reference; } - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - public boolean hasReference() { return this.reference != null && !this.reference.isEmpty(); } /** - * @param value {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + * @param value {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.) */ - public ProvenanceEntityComponent setReferenceElement(UriType value) { + public ProvenanceEntityComponent setReference(Reference value) { this.reference = value; return this; } /** - * @return Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + * @return {@link #reference} 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. (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.) */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); + public Resource getReferenceTarget() { + return this.referenceTarget; } /** - * @param value Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + * @param value {@link #reference} 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. (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.) */ - public ProvenanceEntityComponent setReference(String value) { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - return this; - } - - /** - * @return {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ProvenanceEntityComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Human-readable description of the entity. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Human-readable description of the entity. - */ - public ProvenanceEntityComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } + public ProvenanceEntityComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; return this; } @@ -996,9 +700,7 @@ public class Provenance extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("role", "code", "How the entity was used during the activity.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("type", "Coding", "The type of the entity. If the entity is a resource, then this is a resource type.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reference", "uri", "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Human-readable description of the entity.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("reference", "Reference(Any)", "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); childrenList.add(new Property("agent", "@Provenance.agent", "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 0, java.lang.Integer.MAX_VALUE, agent)); } @@ -1006,9 +708,7 @@ public class Provenance extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType - case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType + case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // ProvenanceAgentComponent default: return super.getProperty(hash, name, checkValid); } @@ -1021,14 +721,8 @@ public class Provenance extends DomainResource { case 3506294: // role this.role = new ProvenanceEntityRoleEnumFactory().fromType(value); // Enumeration break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; case -925155509: // reference - this.reference = castToUri(value); // UriType - break; - case 1671764162: // display - this.display = castToString(value); // StringType + this.reference = castToReference(value); // Reference break; case 92750597: // agent this.getAgent().add((ProvenanceAgentComponent) value); // ProvenanceAgentComponent @@ -1042,12 +736,8 @@ public class Provenance extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("role")) this.role = new ProvenanceEntityRoleEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = castToCoding(value); // Coding else if (name.equals("reference")) - this.reference = castToUri(value); // UriType - else if (name.equals("display")) - this.display = castToString(value); // StringType + this.reference = castToReference(value); // Reference else if (name.equals("agent")) this.getAgent().add((ProvenanceAgentComponent) value); else @@ -1058,9 +748,7 @@ public class Provenance extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 3506294: throw new FHIRException("Cannot make property role as it is not a complex type"); // Enumeration - case 3575610: return getType(); // Coding - case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // UriType - case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType + case -925155509: return getReference(); // Reference case 92750597: return addAgent(); // ProvenanceAgentComponent default: return super.makeProperty(hash, name); } @@ -1072,15 +760,9 @@ public class Provenance extends DomainResource { if (name.equals("role")) { throw new FHIRException("Cannot call addChild on a primitive type Provenance.role"); } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } else if (name.equals("reference")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.reference"); - } - else if (name.equals("display")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.display"); + this.reference = new Reference(); + return this.reference; } else if (name.equals("agent")) { return addAgent(); @@ -1093,9 +775,7 @@ public class Provenance extends DomainResource { ProvenanceEntityComponent dst = new ProvenanceEntityComponent(); copyValues(dst); dst.role = role == null ? null : role.copy(); - dst.type = type == null ? null : type.copy(); dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); if (agent != null) { dst.agent = new ArrayList(); for (ProvenanceAgentComponent i : agent) @@ -1111,8 +791,8 @@ public class Provenance extends DomainResource { if (!(other instanceof ProvenanceEntityComponent)) return false; ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; - return compareDeep(role, o.role, true) && compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true) - && compareDeep(display, o.display, true) && compareDeep(agent, o.agent, true); + return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true) && compareDeep(agent, o.agent, true) + ; } @Override @@ -1122,13 +802,11 @@ public class Provenance extends DomainResource { if (!(other instanceof ProvenanceEntityComponent)) return false; ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; - return compareValues(role, o.role, true) && compareValues(reference, o.reference, true) && compareValues(display, o.display, true) - ; + return compareValues(role, o.role, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, type, reference, display - , agent); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, reference, agent); } public String fhirType() { @@ -1153,7 +831,7 @@ public class Provenance extends DomainResource { /** * The period during which the activity occurred. */ - @Child(name = "period", type = {Period.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Child(name = "period", type = {Period.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." ) protected Period period; @@ -1167,7 +845,7 @@ public class Provenance extends DomainResource { /** * The reason that the activity was taking place. */ - @Child(name = "reason", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "reason", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Reason the activity is occurring", formalDefinition="The reason that the activity was taking place." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-PurposeOfUse") protected List reason; @@ -1175,7 +853,7 @@ public class Provenance extends DomainResource { /** * An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities. */ - @Child(name = "activity", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Child(name = "activity", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Activity that occurred", formalDefinition="An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-ProvenanceEventCurrentState") protected Coding activity; @@ -1183,7 +861,7 @@ public class Provenance extends DomainResource { /** * Where the activity occurred, if relevant. */ - @Child(name = "location", type = {Location.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Child(name = "location", type = {Location.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Where the activity occurred, if relevant", formalDefinition="Where the activity occurred, if relevant." ) protected Reference location; @@ -1195,28 +873,28 @@ public class Provenance extends DomainResource { /** * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. */ - @Child(name = "policy", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "policy", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Policy or plan the activity was defined by", formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc." ) protected List policy; /** * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. */ - @Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Actor involved", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." ) protected List agent; /** * An entity used in this activity. */ - @Child(name = "entity", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "entity", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="An entity used in this activity", formalDefinition="An entity used in this activity." ) protected List entity; /** * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated. */ - @Child(name = "signature", type = {Signature.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "signature", type = {Signature.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Signature on target", formalDefinition="A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated." ) protected List signature; @@ -1965,42 +1643,22 @@ public class Provenance extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.TokenClientParam SIG = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SIG); - /** - * Search parameter: entity-type - *

- * Description: The type of resource in this entity
- * Type: token
- * Path: Provenance.entity.type
- *

- */ - @SearchParamDefinition(name="entity-type", path="Provenance.entity.type", description="The type of resource in this entity", type="token" ) - public static final String SP_ENTITY_TYPE = "entity-type"; - /** - * Fluent Client search parameter constant for entity-type - *

- * Description: The type of resource in this entity
- * Type: token
- * Path: Provenance.entity.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_TYPE); - /** * Search parameter: agent *

- * Description: Individual, device or organization playing role
+ * Description: Who participated
* Type: reference
- * Path: Provenance.agent.actor
+ * Path: Provenance.agent.who[x]
*

*/ - @SearchParamDefinition(name="agent", path="Provenance.agent.actor", description="Individual, device or organization playing role", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } ) + @SearchParamDefinition(name="agent", path="Provenance.agent.who", description="Who participated", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } ) public static final String SP_AGENT = "agent"; /** * Fluent Client search parameter constant for agent *

- * Description: Individual, device or organization playing role
+ * Description: Who participated
* Type: reference
- * Path: Provenance.agent.actor
+ * Path: Provenance.agent.who[x]
*

*/ public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT); @@ -2103,45 +1761,31 @@ public class Provenance extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Provenance:location").toLocked(); - /** - * Search parameter: userid - *

- * Description: Authorization-system identifier for the agent
- * Type: token
- * Path: Provenance.agent.userId
- *

- */ - @SearchParamDefinition(name="userid", path="Provenance.agent.userId", description="Authorization-system identifier for the agent", type="token" ) - public static final String SP_USERID = "userid"; - /** - * Fluent Client search parameter constant for userid - *

- * Description: Authorization-system identifier for the agent
- * Type: token
- * Path: Provenance.agent.userId
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam USERID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USERID); - /** * Search parameter: entity *

* Description: Identity of entity
- * Type: uri
+ * Type: reference
* Path: Provenance.entity.reference
*

*/ - @SearchParamDefinition(name="entity", path="Provenance.entity.reference", description="Identity of entity", type="uri" ) + @SearchParamDefinition(name="entity", path="Provenance.entity.reference", description="Identity of entity", type="reference" ) public static final String SP_ENTITY = "entity"; /** * Fluent Client search parameter constant for entity *

* Description: Identity of entity
- * Type: uri
+ * Type: reference
* Path: Provenance.entity.reference
*

*/ - public static final ca.uhn.fhir.rest.gclient.UriClientParam ENTITY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_ENTITY); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTITY); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Provenance:entity". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTITY = new ca.uhn.fhir.model.api.Include("Provenance:entity").toLocked(); /** * Search parameter: target diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Quantity.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Quantity.java index f3a10bfa7ac..66fc0aae1d0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Quantity.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Quantity.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Questionnaire.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Questionnaire.java index b85d81f00c0..2397d25c54d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Questionnaire.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Questionnaire.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -506,79 +506,95 @@ public class Questionnaire extends DomainResource { /** * An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. */ - @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="To link questionnaire with questionnaire response", formalDefinition="An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource." ) + @Child(name = "linkId", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Unique id for item in questionnaire", formalDefinition="An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource." ) protected StringType linkId; /** - * Identifies a how this group of questions is known in a particular terminology such as LOINC. + * A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: + +* concept (ElementDefinition.code) +* type (ElementDefinition.type) +* required (ElementDefinition.min) +* repeats (ElementDefinition.max) +* maxLength (ElementDefinition.maxLength) +* options (ElementDefinition.binding) + +Any information provided in these elements overrides the information from the definition. */ - @Child(name = "concept", type = {Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Concept that represents this item within in a questionnaire", formalDefinition="Identifies a how this group of questions is known in a particular terminology such as LOINC." ) + @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="ElementDefinition - details for the item", formalDefinition="A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: \n\n* concept (ElementDefinition.code)\n* type (ElementDefinition.type)\n* required (ElementDefinition.min)\n* repeats (ElementDefinition.max)\n* maxLength (ElementDefinition.maxLength)\n* options (ElementDefinition.binding)\n\nAny information provided in these elements overrides the information from the definition." ) + protected UriType definition; + + /** + * Terminology code that corresponds to this group or question (e.g. LOINC). + */ + @Child(name = "concept", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Concept that represents this item within in a questionnaire", formalDefinition="Terminology code that corresponds to this group or question (e.g. LOINC)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-questions") protected List concept; /** * A short label for a particular group, question or set of display text within the questionnaire. */ - @Child(name = "prefix", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "prefix", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="E.g. \"1(a)\", \"2.5.3\"", formalDefinition="A short label for a particular group, question or set of display text within the questionnaire." ) protected StringType prefix; /** * The name of a section, the text of a question or text content for a text item. */ - @Child(name = "text", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Child(name = "text", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Primary text for the item", formalDefinition="The name of a section, the text of a question or text content for a text item." ) protected StringType text; /** * Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). */ - @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="group | display | question | boolean | decimal | integer | date | dateTime +", formalDefinition="Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.)." ) + @Child(name = "type", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="group | display | boolean | decimal | integer | date | dateTime +", formalDefinition="Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/item-type") protected Enumeration type; /** * If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true. */ - @Child(name = "enableWhen", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) + @Child(name = "enableWhen", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) @Description(shortDefinition="Only allow data when:", formalDefinition="If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true." ) protected List enableWhen; /** * If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. */ - @Child(name = "required", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "required", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Whether the item must be included in data results", formalDefinition="If true, indicates that the item must be present in a \"completed\" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire." ) protected BooleanType required; /** * Whether the item may occur multiple times in the instance, containing multiple sets of answers. */ - @Child(name = "repeats", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) + @Child(name = "repeats", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Whether the item may repeat", formalDefinition="Whether the item may occur multiple times in the instance, containing multiple sets of answers." ) protected BooleanType repeats; /** * If true, the value cannot be changed by a human respondent to the Questionnaire. */ - @Child(name = "readOnly", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "readOnly", type = {BooleanType.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Don't allow human editing", formalDefinition="If true, the value cannot be changed by a human respondent to the Questionnaire." ) protected BooleanType readOnly; /** * The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. */ - @Child(name = "maxLength", type = {IntegerType.class}, order=10, min=0, max=1, modifier=false, summary=false) + @Child(name = "maxLength", type = {IntegerType.class}, order=11, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="No more than this many characters", formalDefinition="The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse." ) protected IntegerType maxLength; /** * Reference to a value set containing a list of codes representing permitted answers for the question. */ - @Child(name = "options", type = {ValueSet.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "options", type = {ValueSet.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Valueset containing permitted answers", formalDefinition="Reference to a value set containing a list of codes representing permitted answers for the question." ) protected Reference options; @@ -590,25 +606,25 @@ public class Questionnaire extends DomainResource { /** * For a "choice" question, identifies one of the permitted answers for the question. */ - @Child(name = "option", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "option", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Permitted answer", formalDefinition="For a \"choice\" question, identifies one of the permitted answers for the question." ) protected List option; /** - * The value that should be pre-populated when rendering the questionnaire for user input. + * The value that should be defaulted when rendering the questionnaire for user input. */ - @Child(name = "initial", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class, Reference.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Initial presumed answer for question", formalDefinition="The value that should be pre-populated when rendering the questionnaire for user input." ) + @Child(name = "initial", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class, Reference.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Default value when item is first rendered", formalDefinition="The value that should be defaulted when rendering the questionnaire for user input." ) protected Type initial; /** * Allows text, questions and other groups to be nested beneath a question or group. */ - @Child(name = "item", type = {QuestionnaireItemComponent.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "item", type = {QuestionnaireItemComponent.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Nested questionnaire items", formalDefinition="Allows text, questions and other groups to be nested beneath a question or group." ) protected List item; - private static final long serialVersionUID = -1787693458L; + private static final long serialVersionUID = 1410801685L; /** * Constructor @@ -620,9 +636,9 @@ public class Questionnaire extends DomainResource { /** * Constructor */ - public QuestionnaireItemComponent(Enumeration type) { + public QuestionnaireItemComponent(StringType linkId) { super(); - this.type = type; + this.linkId = linkId; } /** @@ -664,18 +680,99 @@ public class Questionnaire extends DomainResource { * @param value An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. */ public QuestionnaireItemComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { if (this.linkId == null) this.linkId = new StringType(); this.linkId.setValue(value); + return this; + } + + /** + * @return {@link #definition} (A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: + +* concept (ElementDefinition.code) +* type (ElementDefinition.type) +* required (ElementDefinition.min) +* repeats (ElementDefinition.max) +* maxLength (ElementDefinition.maxLength) +* options (ElementDefinition.binding) + +Any information provided in these elements overrides the information from the definition.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public UriType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireItemComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new UriType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: + +* concept (ElementDefinition.code) +* type (ElementDefinition.type) +* required (ElementDefinition.min) +* repeats (ElementDefinition.max) +* maxLength (ElementDefinition.maxLength) +* options (ElementDefinition.binding) + +Any information provided in these elements overrides the information from the definition.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public QuestionnaireItemComponent setDefinitionElement(UriType value) { + this.definition = value; + return this; + } + + /** + * @return A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: + +* concept (ElementDefinition.code) +* type (ElementDefinition.type) +* required (ElementDefinition.min) +* repeats (ElementDefinition.max) +* maxLength (ElementDefinition.maxLength) +* options (ElementDefinition.binding) + +Any information provided in these elements overrides the information from the definition. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: + +* concept (ElementDefinition.code) +* type (ElementDefinition.type) +* required (ElementDefinition.min) +* repeats (ElementDefinition.max) +* maxLength (ElementDefinition.maxLength) +* options (ElementDefinition.binding) + +Any information provided in these elements overrides the information from the definition. + */ + public QuestionnaireItemComponent setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new UriType(); + this.definition.setValue(value); } return this; } /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + * @return {@link #concept} (Terminology code that corresponds to this group or question (e.g. LOINC).) */ public List getConcept() { if (this.concept == null) @@ -864,9 +961,13 @@ public class Questionnaire extends DomainResource { * @param value Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). */ public QuestionnaireItemComponent setType(QuestionnaireItemType value) { + if (value == null) + this.type = null; + else { if (this.type == null) this.type = new Enumeration(new QuestionnaireItemTypeEnumFactory()); this.type.setValue(value); + } return this; } @@ -1201,14 +1302,14 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public Type getInitial() { return this.initial; } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public BooleanType getInitialBooleanType() throws FHIRException { if (!(this.initial instanceof BooleanType)) @@ -1221,7 +1322,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public DecimalType getInitialDecimalType() throws FHIRException { if (!(this.initial instanceof DecimalType)) @@ -1234,7 +1335,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public IntegerType getInitialIntegerType() throws FHIRException { if (!(this.initial instanceof IntegerType)) @@ -1247,7 +1348,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public DateType getInitialDateType() throws FHIRException { if (!(this.initial instanceof DateType)) @@ -1260,7 +1361,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public DateTimeType getInitialDateTimeType() throws FHIRException { if (!(this.initial instanceof DateTimeType)) @@ -1273,7 +1374,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public InstantType getInitialInstantType() throws FHIRException { if (!(this.initial instanceof InstantType)) @@ -1286,7 +1387,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public TimeType getInitialTimeType() throws FHIRException { if (!(this.initial instanceof TimeType)) @@ -1299,7 +1400,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public StringType getInitialStringType() throws FHIRException { if (!(this.initial instanceof StringType)) @@ -1312,7 +1413,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public UriType getInitialUriType() throws FHIRException { if (!(this.initial instanceof UriType)) @@ -1325,7 +1426,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public Attachment getInitialAttachment() throws FHIRException { if (!(this.initial instanceof Attachment)) @@ -1338,7 +1439,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public Coding getInitialCoding() throws FHIRException { if (!(this.initial instanceof Coding)) @@ -1351,7 +1452,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public Quantity getInitialQuantity() throws FHIRException { if (!(this.initial instanceof Quantity)) @@ -1364,7 +1465,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @return {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public Reference getInitialReference() throws FHIRException { if (!(this.initial instanceof Reference)) @@ -1381,7 +1482,7 @@ public class Questionnaire extends DomainResource { } /** - * @param value {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) + * @param value {@link #initial} (The value that should be defaulted when rendering the questionnaire for user input.) */ public QuestionnaireItemComponent setInitial(Type value) { this.initial = value; @@ -1444,7 +1545,8 @@ 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 item in a QuestionnaireResponse 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("definition", "uri", "A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: \n\n* concept (ElementDefinition.code)\n* type (ElementDefinition.type)\n* required (ElementDefinition.min)\n* repeats (ElementDefinition.max)\n* maxLength (ElementDefinition.maxLength)\n* options (ElementDefinition.binding)\n\nAny information provided in these elements overrides the information from the definition.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("concept", "Coding", "Terminology code that corresponds to this group or question (e.g. LOINC).", 0, java.lang.Integer.MAX_VALUE, concept)); childrenList.add(new Property("prefix", "string", "A short label for a particular group, question or set of display text within the questionnaire.", 0, java.lang.Integer.MAX_VALUE, prefix)); childrenList.add(new Property("text", "string", "The name of a section, the text of a question or text content for a text item.", 0, java.lang.Integer.MAX_VALUE, text)); childrenList.add(new Property("type", "code", "Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); @@ -1455,7 +1557,7 @@ public class Questionnaire extends DomainResource { childrenList.add(new Property("maxLength", "integer", "The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, maxLength)); childrenList.add(new Property("options", "Reference(ValueSet)", "Reference to a value set containing a list of codes representing permitted answers for the question.", 0, java.lang.Integer.MAX_VALUE, options)); childrenList.add(new Property("option", "", "For a \"choice\" question, identifies one of the permitted answers for the question.", 0, java.lang.Integer.MAX_VALUE, option)); - childrenList.add(new Property("initial[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be pre-populated when rendering the questionnaire for user input.", 0, java.lang.Integer.MAX_VALUE, initial)); + childrenList.add(new Property("initial[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when rendering the questionnaire for user input.", 0, java.lang.Integer.MAX_VALUE, initial)); childrenList.add(new Property("item", "@Questionnaire.item", "Allows text, questions and other groups to be nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item)); } @@ -1463,6 +1565,7 @@ public class Questionnaire extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // Coding case -980110702: /*prefix*/ return this.prefix == null ? new Base[0] : new Base[] {this.prefix}; // StringType case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType @@ -1487,6 +1590,9 @@ public class Questionnaire extends DomainResource { case -1102667083: // linkId this.linkId = castToString(value); // StringType break; + case -1014418093: // definition + this.definition = castToUri(value); // UriType + break; case 951024232: // concept this.getConcept().add(castToCoding(value)); // Coding break; @@ -1535,6 +1641,8 @@ public class Questionnaire extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("linkId")) this.linkId = castToString(value); // StringType + else if (name.equals("definition")) + this.definition = castToUri(value); // UriType else if (name.equals("concept")) this.getConcept().add(castToCoding(value)); else if (name.equals("prefix")) @@ -1569,6 +1677,7 @@ public class Questionnaire extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1102667083: throw new FHIRException("Cannot make property linkId as it is not a complex type"); // StringType + case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // UriType case 951024232: return addConcept(); // Coding case -980110702: throw new FHIRException("Cannot make property prefix as it is not a complex type"); // StringType case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType @@ -1592,6 +1701,9 @@ public class Questionnaire extends DomainResource { if (name.equals("linkId")) { throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.linkId"); } + else if (name.equals("definition")) { + throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.definition"); + } else if (name.equals("concept")) { return addConcept(); } @@ -1689,6 +1801,7 @@ public class Questionnaire extends DomainResource { QuestionnaireItemComponent dst = new QuestionnaireItemComponent(); copyValues(dst); dst.linkId = linkId == null ? null : linkId.copy(); + dst.definition = definition == null ? null : definition.copy(); if (concept != null) { dst.concept = new ArrayList(); for (Coding i : concept) @@ -1728,11 +1841,12 @@ public class Questionnaire extends DomainResource { if (!(other instanceof QuestionnaireItemComponent)) return false; QuestionnaireItemComponent o = (QuestionnaireItemComponent) other; - return compareDeep(linkId, o.linkId, true) && compareDeep(concept, o.concept, true) && compareDeep(prefix, o.prefix, true) - && compareDeep(text, o.text, true) && compareDeep(type, o.type, true) && compareDeep(enableWhen, o.enableWhen, true) - && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true) && compareDeep(readOnly, o.readOnly, true) - && compareDeep(maxLength, o.maxLength, true) && compareDeep(options, o.options, true) && compareDeep(option, o.option, true) - && compareDeep(initial, o.initial, true) && compareDeep(item, o.item, true); + return compareDeep(linkId, o.linkId, true) && compareDeep(definition, o.definition, true) && compareDeep(concept, o.concept, true) + && compareDeep(prefix, o.prefix, true) && compareDeep(text, o.text, true) && compareDeep(type, o.type, true) + && compareDeep(enableWhen, o.enableWhen, true) && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true) + && compareDeep(readOnly, o.readOnly, true) && compareDeep(maxLength, o.maxLength, true) && compareDeep(options, o.options, true) + && compareDeep(option, o.option, true) && compareDeep(initial, o.initial, true) && compareDeep(item, o.item, true) + ; } @Override @@ -1742,15 +1856,16 @@ public class Questionnaire extends DomainResource { if (!(other instanceof QuestionnaireItemComponent)) return false; QuestionnaireItemComponent o = (QuestionnaireItemComponent) other; - return compareValues(linkId, o.linkId, true) && compareValues(prefix, o.prefix, true) && compareValues(text, o.text, true) - && compareValues(type, o.type, true) && compareValues(required, o.required, true) && compareValues(repeats, o.repeats, true) - && compareValues(readOnly, o.readOnly, true) && compareValues(maxLength, o.maxLength, true); + return compareValues(linkId, o.linkId, true) && compareValues(definition, o.definition, true) && compareValues(prefix, o.prefix, true) + && compareValues(text, o.text, true) && compareValues(type, o.type, true) && compareValues(required, o.required, true) + && compareValues(repeats, o.repeats, true) && compareValues(readOnly, o.readOnly, true) && compareValues(maxLength, o.maxLength, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(linkId, concept, prefix - , text, type, enableWhen, required, repeats, readOnly, maxLength, options, option - , initial, item); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(linkId, definition, concept + , prefix, text, type, enableWhen, required, repeats, readOnly, maxLength, options + , option, initial, item); } public String fhirType() { @@ -2525,10 +2640,10 @@ public class Questionnaire extends DomainResource { protected StringType title; /** - * Identifies a how this question or group of questions is known in a particular terminology such as LOINC. + * Identifies how this question or group of questions is known in a particular terminology such as LOINC. */ @Child(name = "concept", type = {Coding.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Concept that represents the overall questionnaire", formalDefinition="Identifies a how this question or group of questions is known in a particular terminology such as LOINC." ) + @Description(shortDefinition="Concept that represents the overall questionnaire", formalDefinition="Identifies how this question or group of questions is known in a particular terminology such as LOINC." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-questions") protected List concept; @@ -3014,7 +3129,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #concept} (Identifies a how this question or group of questions is known in a particular terminology such as LOINC.) + * @return {@link #concept} (Identifies how this question or group of questions is known in a particular terminology such as LOINC.) */ public List getConcept() { if (this.concept == null) @@ -3191,7 +3306,7 @@ public class Questionnaire extends DomainResource { childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); childrenList.add(new Property("useContext", "CodeableConcept", "A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. \"Pediatric\", \"Admissions\", \"Research\", \"Demographic\", \"Opinion Survey\", etc.", 0, java.lang.Integer.MAX_VALUE, useContext)); childrenList.add(new Property("title", "string", "The name or label associated with this questionnaire.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("concept", "Coding", "Identifies a how this question or 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 how this question or group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); childrenList.add(new Property("subjectType", "code", "Identifies the types of subjects that can be the subject of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, subjectType)); childrenList.add(new Property("item", "", "The questions and groupings of questions that make up the questionnaire.", 0, java.lang.Integer.MAX_VALUE, item)); } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/QuestionnaireResponse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/QuestionnaireResponse.java index 9452ba8657d..7766d6f1d90 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/QuestionnaireResponse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/QuestionnaireResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -175,21 +175,28 @@ public class QuestionnaireResponse extends DomainResource { /** * Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. */ - @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Corresponding item within Questionnaire", formalDefinition="Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource." ) + @Child(name = "linkId", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Pointer to specific item from Questionnaire", formalDefinition="Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource." ) protected StringType linkId; + /** + * A reference to an [[[ElementDefinition]]] that provides the details for the item. + */ + @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="ElementDefinition - details for the item", formalDefinition="A reference to an [[[ElementDefinition]]] that provides the details for the item." ) + protected UriType definition; + /** * Text that is displayed above the contents of the group or as the text of the question being answered. */ - @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Name for group or question text", formalDefinition="Text that is displayed above the contents of the group or as the text of the question being answered." ) protected StringType text; /** * More specific subject this section's answers are about, details the subject given in QuestionnaireResponse. */ - @Child(name = "subject", type = {Reference.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "subject", type = {Reference.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="The subject this group's answers are about", formalDefinition="More specific subject this section's answers are about, details the subject given in QuestionnaireResponse." ) protected Reference subject; @@ -201,18 +208,18 @@ public class QuestionnaireResponse extends DomainResource { /** * The respondent's answer(s) to the question. */ - @Child(name = "answer", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "answer", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." ) protected List answer; /** * Questions or sub-groups nested beneath a question or group. */ - @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Nested questionnaire response items", formalDefinition="Questions or sub-groups nested beneath a question or group." ) protected List item; - private static final long serialVersionUID = 1059526517L; + private static final long serialVersionUID = -154786340L; /** * Constructor @@ -221,6 +228,14 @@ public class QuestionnaireResponse extends DomainResource { super(); } + /** + * Constructor + */ + public QuestionnaireResponseItemComponent(StringType linkId) { + super(); + this.linkId = linkId; + } + /** * @return {@link #linkId} (Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value */ @@ -260,12 +275,57 @@ public class QuestionnaireResponse extends DomainResource { * @param value Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. */ public QuestionnaireResponseItemComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { if (this.linkId == null) this.linkId = new StringType(); this.linkId.setValue(value); + return this; + } + + /** + * @return {@link #definition} (A reference to an [[[ElementDefinition]]] that provides the details for the item.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public UriType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new UriType(); // bb + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (A reference to an [[[ElementDefinition]]] that provides the details for the item.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public QuestionnaireResponseItemComponent setDefinitionElement(UriType value) { + this.definition = value; + return this; + } + + /** + * @return A reference to an [[[ElementDefinition]]] that provides the details for the item. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value A reference to an [[[ElementDefinition]]] that provides the details for the item. + */ + public QuestionnaireResponseItemComponent setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new UriType(); + this.definition.setValue(value); } return this; } @@ -467,6 +527,7 @@ public class QuestionnaireResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("linkId", "string", "Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("definition", "uri", "A reference to an [[[ElementDefinition]]] that provides the details for the item.", 0, java.lang.Integer.MAX_VALUE, definition)); childrenList.add(new Property("text", "string", "Text that is displayed above the contents of the group or as the text of the question being answered.", 0, java.lang.Integer.MAX_VALUE, text)); childrenList.add(new Property("subject", "Reference(Any)", "More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, subject)); childrenList.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer)); @@ -477,6 +538,7 @@ public class QuestionnaireResponse extends DomainResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // QuestionnaireResponseItemAnswerComponent @@ -492,6 +554,9 @@ public class QuestionnaireResponse extends DomainResource { case -1102667083: // linkId this.linkId = castToString(value); // StringType break; + case -1014418093: // definition + this.definition = castToUri(value); // UriType + break; case 3556653: // text this.text = castToString(value); // StringType break; @@ -513,6 +578,8 @@ public class QuestionnaireResponse extends DomainResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("linkId")) this.linkId = castToString(value); // StringType + else if (name.equals("definition")) + this.definition = castToUri(value); // UriType else if (name.equals("text")) this.text = castToString(value); // StringType else if (name.equals("subject")) @@ -529,6 +596,7 @@ public class QuestionnaireResponse extends DomainResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1102667083: throw new FHIRException("Cannot make property linkId as it is not a complex type"); // StringType + case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // UriType case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType case -1867885268: return getSubject(); // Reference case -1412808770: return addAnswer(); // QuestionnaireResponseItemAnswerComponent @@ -543,6 +611,9 @@ public class QuestionnaireResponse extends DomainResource { if (name.equals("linkId")) { throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.linkId"); } + else if (name.equals("definition")) { + throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.definition"); + } else if (name.equals("text")) { throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.text"); } @@ -564,6 +635,7 @@ public class QuestionnaireResponse extends DomainResource { QuestionnaireResponseItemComponent dst = new QuestionnaireResponseItemComponent(); copyValues(dst); dst.linkId = linkId == null ? null : linkId.copy(); + dst.definition = definition == null ? null : definition.copy(); dst.text = text == null ? null : text.copy(); dst.subject = subject == null ? null : subject.copy(); if (answer != null) { @@ -586,8 +658,9 @@ public class QuestionnaireResponse extends DomainResource { if (!(other instanceof QuestionnaireResponseItemComponent)) return false; QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other; - return compareDeep(linkId, o.linkId, true) && compareDeep(text, o.text, true) && compareDeep(subject, o.subject, true) - && compareDeep(answer, o.answer, true) && compareDeep(item, o.item, true); + return compareDeep(linkId, o.linkId, true) && compareDeep(definition, o.definition, true) && compareDeep(text, o.text, true) + && compareDeep(subject, o.subject, true) && compareDeep(answer, o.answer, true) && compareDeep(item, o.item, true) + ; } @Override @@ -597,12 +670,13 @@ public class QuestionnaireResponse extends DomainResource { if (!(other instanceof QuestionnaireResponseItemComponent)) return false; QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other; - return compareValues(linkId, o.linkId, true) && compareValues(text, o.text, true); + return compareValues(linkId, o.linkId, true) && compareValues(definition, o.definition, true) && compareValues(text, o.text, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(linkId, text, subject, answer - , item); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(linkId, definition, text + , subject, answer, item); } public String fhirType() { @@ -1040,13 +1114,13 @@ public class QuestionnaireResponse extends DomainResource { protected Identifier identifier; /** - * Identifies the order, proposal or plan that is fulfilled in whole or in part by this Questionnaire. + * Identifies the order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse. */ @Child(name = "basedOn", type = {DiagnosticRequest.class, ReferralRequest.class, CarePlan.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Request fulfilled by this Questionnaire", formalDefinition="Identifies the order, proposal or plan that is fulfilled in whole or in part by this Questionnaire." ) + @Description(shortDefinition="Request fulfilled by this QuestionnaireResponse", formalDefinition="Identifies the order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse." ) protected List basedOn; /** - * The actual objects that are the target of the reference (Identifies the order, proposal or plan that is fulfilled in whole or in part by this Questionnaire.) + * The actual objects that are the target of the reference (Identifies the order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.) */ protected List basedOnTarget; @@ -1187,7 +1261,7 @@ public class QuestionnaireResponse extends DomainResource { } /** - * @return {@link #basedOn} (Identifies the order, proposal or plan that is fulfilled in whole or in part by this Questionnaire.) + * @return {@link #basedOn} (Identifies the order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.) */ public List getBasedOn() { if (this.basedOn == null) @@ -1662,7 +1736,7 @@ public class QuestionnaireResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("basedOn", "Reference(DiagnosticRequest|ReferralRequest|CarePlan)", "Identifies the order, proposal or plan that is fulfilled in whole or in part by this Questionnaire.", 0, java.lang.Integer.MAX_VALUE, basedOn)); + childrenList.add(new Property("basedOn", "Reference(DiagnosticRequest|ReferralRequest|CarePlan)", "Identifies the order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, basedOn)); childrenList.add(new Property("parent", "Reference(Observation|Procedure)", "Identifies a procedure or observation that this questionnaire was performed as part of the execution of.", 0, java.lang.Integer.MAX_VALUE, parent)); childrenList.add(new Property("questionnaire", "Reference(Questionnaire)", "Indicates the Questionnaire resource that defines the form for which answers are being provided.", 0, java.lang.Integer.MAX_VALUE, questionnaire)); childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire response as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); @@ -1900,17 +1974,17 @@ public class QuestionnaireResponse extends DomainResource { /** * Search parameter: authored *

- * Description: When the questionnaire was authored
+ * Description: When the questionnaire response was authored
* Type: date
* Path: QuestionnaireResponse.authored
*

*/ - @SearchParamDefinition(name="authored", path="QuestionnaireResponse.authored", description="When the questionnaire was authored", type="date" ) + @SearchParamDefinition(name="authored", path="QuestionnaireResponse.authored", description="When the questionnaire response was authored", type="date" ) public static final String SP_AUTHORED = "authored"; /** * Fluent Client search parameter constant for authored *

- * Description: When the questionnaire was authored
+ * Description: When the questionnaire response was authored
* Type: date
* Path: QuestionnaireResponse.authored
*

@@ -2018,17 +2092,17 @@ public class QuestionnaireResponse extends DomainResource { /** * Search parameter: subject *

- * Description: The subject of the questionnaire
+ * Description: The subject of the questionnaire response
* Type: reference
* Path: QuestionnaireResponse.subject
*

*/ - @SearchParamDefinition(name="subject", path="QuestionnaireResponse.subject", description="The subject of the questionnaire", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") } ) + @SearchParamDefinition(name="subject", path="QuestionnaireResponse.subject", description="The subject of the questionnaire response", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") } ) public static final String SP_SUBJECT = "subject"; /** * Fluent Client search parameter constant for subject *

- * Description: The subject of the questionnaire
+ * Description: The subject of the questionnaire response
* Type: reference
* Path: QuestionnaireResponse.subject
*

@@ -2044,17 +2118,17 @@ public class QuestionnaireResponse extends DomainResource { /** * Search parameter: author *

- * Description: The author of the questionnaire
+ * Description: The author of the questionnaire response
* Type: reference
* Path: QuestionnaireResponse.author
*

*/ - @SearchParamDefinition(name="author", path="QuestionnaireResponse.author", description="The author of the questionnaire", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Patient.class, Practitioner.class, RelatedPerson.class } ) + @SearchParamDefinition(name="author", path="QuestionnaireResponse.author", description="The author of the questionnaire response", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Patient.class, Practitioner.class, RelatedPerson.class } ) public static final String SP_AUTHOR = "author"; /** * Fluent Client search parameter constant for author *

- * Description: The author of the questionnaire
+ * Description: The author of the questionnaire response
* Type: reference
* Path: QuestionnaireResponse.author
*

@@ -2070,17 +2144,17 @@ public class QuestionnaireResponse extends DomainResource { /** * Search parameter: patient *

- * Description: The patient that is the subject of the questionnaire
+ * Description: The patient that is the subject of the questionnaire response
* Type: reference
* Path: QuestionnaireResponse.subject
*

*/ - @SearchParamDefinition(name="patient", path="QuestionnaireResponse.subject", description="The patient that is the subject of the questionnaire", type="reference", target={Patient.class } ) + @SearchParamDefinition(name="patient", path="QuestionnaireResponse.subject", description="The patient that is the subject of the questionnaire response", type="reference", target={Patient.class } ) public static final String SP_PATIENT = "patient"; /** * Fluent Client search parameter constant for patient *

- * Description: The patient that is the subject of the questionnaire
+ * Description: The patient that is the subject of the questionnaire response
* Type: reference
* Path: QuestionnaireResponse.subject
*

@@ -2096,17 +2170,17 @@ public class QuestionnaireResponse extends DomainResource { /** * Search parameter: context *

- * Description: Encounter or episode during which questionnaire was authored
+ * Description: Encounter or episode during which questionnaire response was authored
* Type: reference
* Path: QuestionnaireResponse.context
*

*/ - @SearchParamDefinition(name="context", path="QuestionnaireResponse.context", description="Encounter or episode during which questionnaire was authored", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class, EpisodeOfCare.class } ) + @SearchParamDefinition(name="context", path="QuestionnaireResponse.context", description="Encounter or episode during which questionnaire response was authored", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class, EpisodeOfCare.class } ) public static final String SP_CONTEXT = "context"; /** * Fluent Client search parameter constant for context *

- * Description: Encounter or episode during which questionnaire was authored
+ * Description: Encounter or episode during which questionnaire response was authored
* Type: reference
* Path: QuestionnaireResponse.context
*

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Range.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Range.java index 7859b18784f..c3eeec59d3d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Range.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Range.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Ratio.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Ratio.java index 2d1835b9bb7..6ab029056c4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Ratio.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Ratio.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Reference.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Reference.java index 52bd793ce84..cbc9b591d18 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Reference.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Reference.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ReferralRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ReferralRequest.java index 321181c2b4f..65a4f32d0a4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ReferralRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ReferralRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RelatedArtifact.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RelatedArtifact.java index a2ed945e678..69e26b836d8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RelatedArtifact.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RelatedArtifact.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RelatedPerson.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RelatedPerson.java index 0793374ff6e..63ce8fdf2aa 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RelatedPerson.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RelatedPerson.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RequestGroup.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RequestGroup.java index 9d1553f3a87..ab9801f75d4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RequestGroup.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RequestGroup.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -48,6 +48,112 @@ import org.hl7.fhir.exceptions.FHIRException; @ResourceDef(name="RequestGroup", profile="http://hl7.org/fhir/Profile/RequestGroup") public class RequestGroup extends DomainResource { + public enum ActionConditionKind { + /** + * The condition describes whether or not a given action is applicable + */ + APPLICABILITY, + /** + * The condition is a starting condition for the action + */ + START, + /** + * The condition is a stop, or exit condition for the action + */ + STOP, + /** + * added to help the parsers with the generic types + */ + NULL; + public static ActionConditionKind fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("applicability".equals(codeString)) + return APPLICABILITY; + if ("start".equals(codeString)) + return START; + if ("stop".equals(codeString)) + return STOP; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown ActionConditionKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case APPLICABILITY: return "applicability"; + case START: return "start"; + case STOP: return "stop"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case APPLICABILITY: return "http://hl7.org/fhir/action-condition-kind"; + case START: return "http://hl7.org/fhir/action-condition-kind"; + case STOP: return "http://hl7.org/fhir/action-condition-kind"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case APPLICABILITY: return "The condition describes whether or not a given action is applicable"; + case START: return "The condition is a starting condition for the action"; + case STOP: return "The condition is a stop, or exit condition for the action"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case APPLICABILITY: return "Applicability"; + case START: return "Start"; + case STOP: return "Stop"; + default: return "?"; + } + } + } + + public static class ActionConditionKindEnumFactory implements EnumFactory { + public ActionConditionKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("applicability".equals(codeString)) + return ActionConditionKind.APPLICABILITY; + if ("start".equals(codeString)) + return ActionConditionKind.START; + if ("stop".equals(codeString)) + return ActionConditionKind.STOP; + throw new IllegalArgumentException("Unknown ActionConditionKind code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("applicability".equals(codeString)) + return new Enumeration(this, ActionConditionKind.APPLICABILITY); + if ("start".equals(codeString)) + return new Enumeration(this, ActionConditionKind.START); + if ("stop".equals(codeString)) + return new Enumeration(this, ActionConditionKind.STOP); + throw new FHIRException("Unknown ActionConditionKind code '"+codeString+"'"); + } + public String toCode(ActionConditionKind code) { + if (code == ActionConditionKind.APPLICABILITY) + return "applicability"; + if (code == ActionConditionKind.START) + return "start"; + if (code == ActionConditionKind.STOP) + return "stop"; + return "?"; + } + public String toSystem(ActionConditionKind code) { + return code.getSystem(); + } + } + public enum ActionRelationshipType { /** * The action must be performed before the start of the related action @@ -847,24 +953,31 @@ public class RequestGroup extends DomainResource { @Description(shortDefinition="Supporting documentation for the intended performer of the action", formalDefinition="Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources." ) protected List documentation; + /** + * An expression that describes applicability criteria, or start/stop conditions for the action. + */ + @Child(name = "condition", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Whether or not the action is applicable", formalDefinition="An expression that describes applicability criteria, or start/stop conditions for the action." ) + protected List condition; + /** * A relationship to another action such as "before" or "30-60 minutes after start of". */ - @Child(name = "relatedAction", type = {}, order=8, min=0, max=1, modifier=false, summary=false) + @Child(name = "relatedAction", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." ) - protected RequestGroupActionRelatedActionComponent relatedAction; + protected List relatedAction; /** * An optional value describing when the action should be performed. */ - @Child(name = "timing", type = {DateTimeType.class, Period.class, Duration.class, Range.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Child(name = "timing", type = {DateTimeType.class, Period.class, Duration.class, Range.class, Timing.class}, order=10, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="When the action should take place", formalDefinition="An optional value describing when the action should be performed." ) protected Type timing; /** * The participant in the action. */ - @Child(name = "participant", type = {Patient.class, Person.class, Practitioner.class, RelatedPerson.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "participant", type = {Patient.class, Person.class, Practitioner.class, RelatedPerson.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Participant", formalDefinition="The participant in the action." ) protected List participant; /** @@ -876,7 +989,7 @@ public class RequestGroup extends DomainResource { /** * The type of action to perform (create, update, remove). */ - @Child(name = "type", type = {Coding.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Child(name = "type", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-type") protected Coding type; @@ -884,7 +997,7 @@ public class RequestGroup extends DomainResource { /** * Defines the grouping behavior for the action and its children. */ - @Child(name = "groupingBehavior", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=false) + @Child(name = "groupingBehavior", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="visual-group | logical-group | sentence-group", formalDefinition="Defines the grouping behavior for the action and its children." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-grouping-behavior") protected Enumeration groupingBehavior; @@ -892,7 +1005,7 @@ public class RequestGroup extends DomainResource { /** * Defines the selection behavior for the action and its children. */ - @Child(name = "selectionBehavior", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=false) + @Child(name = "selectionBehavior", type = {CodeType.class}, order=14, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="any | all | all-or-none | exactly-one | at-most-one | one-or-more", formalDefinition="Defines the selection behavior for the action and its children." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-selection-behavior") protected Enumeration selectionBehavior; @@ -900,7 +1013,7 @@ public class RequestGroup extends DomainResource { /** * Defines the requiredness behavior for the action. */ - @Child(name = "requiredBehavior", type = {CodeType.class}, order=14, min=0, max=1, modifier=false, summary=false) + @Child(name = "requiredBehavior", type = {CodeType.class}, order=15, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="must | could | must-unless-documented", formalDefinition="Defines the requiredness behavior for the action." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-required-behavior") protected Enumeration requiredBehavior; @@ -908,7 +1021,7 @@ public class RequestGroup extends DomainResource { /** * Defines whether the action should usually be preselected. */ - @Child(name = "precheckBehavior", type = {CodeType.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "precheckBehavior", type = {CodeType.class}, order=16, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="yes | no", formalDefinition="Defines whether the action should usually be preselected." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-precheck-behavior") protected Enumeration precheckBehavior; @@ -916,7 +1029,7 @@ public class RequestGroup extends DomainResource { /** * Defines whether the action can be selected multiple times. */ - @Child(name = "cardinalityBehavior", type = {CodeType.class}, order=16, min=0, max=1, modifier=false, summary=false) + @Child(name = "cardinalityBehavior", type = {CodeType.class}, order=17, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="single | multiple", formalDefinition="Defines whether the action can be selected multiple times." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-cardinality-behavior") protected Enumeration cardinalityBehavior; @@ -924,7 +1037,7 @@ public class RequestGroup extends DomainResource { /** * The resource that is the target of the action (e.g. CommunicationRequest). */ - @Child(name = "resource", type = {Reference.class}, order=17, min=0, max=1, modifier=false, summary=false) + @Child(name = "resource", type = {Reference.class}, order=18, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="The target of the action", formalDefinition="The resource that is the target of the action (e.g. CommunicationRequest)." ) protected Reference resource; @@ -936,11 +1049,11 @@ public class RequestGroup extends DomainResource { /** * Sub actions. */ - @Child(name = "action", type = {RequestGroupActionComponent.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "action", type = {RequestGroupActionComponent.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Sub action", formalDefinition="Sub actions." ) protected List action; - private static final long serialVersionUID = 1707056341L; + private static final long serialVersionUID = -1273051530L; /** * Constructor @@ -1276,29 +1389,111 @@ public class RequestGroup extends DomainResource { } /** - * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) + * @return {@link #condition} (An expression that describes applicability criteria, or start/stop conditions for the action.) */ - public RequestGroupActionRelatedActionComponent getRelatedAction() { - if (this.relatedAction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RequestGroupActionComponent.relatedAction"); - else if (Configuration.doAutoCreate()) - this.relatedAction = new RequestGroupActionRelatedActionComponent(); // cc - return this.relatedAction; - } - - public boolean hasRelatedAction() { - return this.relatedAction != null && !this.relatedAction.isEmpty(); + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; } /** - * @param value {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) + * @return Returns a reference to this for easy method chaining */ - public RequestGroupActionComponent setRelatedAction(RequestGroupActionRelatedActionComponent value) { - this.relatedAction = value; + public RequestGroupActionComponent setCondition(List theCondition) { + this.condition = theCondition; return this; } + public boolean hasCondition() { + if (this.condition == null) + return false; + for (RequestGroupActionConditionComponent item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + public RequestGroupActionConditionComponent addCondition() { //3 + RequestGroupActionConditionComponent t = new RequestGroupActionConditionComponent(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + public RequestGroupActionComponent addCondition(RequestGroupActionConditionComponent t) { //3 + if (t == null) + return this; + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist + */ + public RequestGroupActionConditionComponent getConditionFirstRep() { + if (getCondition().isEmpty()) { + addCondition(); + } + return getCondition().get(0); + } + + /** + * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) + */ + public List getRelatedAction() { + if (this.relatedAction == null) + this.relatedAction = new ArrayList(); + return this.relatedAction; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public RequestGroupActionComponent setRelatedAction(List theRelatedAction) { + this.relatedAction = theRelatedAction; + return this; + } + + public boolean hasRelatedAction() { + if (this.relatedAction == null) + return false; + for (RequestGroupActionRelatedActionComponent item : this.relatedAction) + if (!item.isEmpty()) + return true; + return false; + } + + public RequestGroupActionRelatedActionComponent addRelatedAction() { //3 + RequestGroupActionRelatedActionComponent t = new RequestGroupActionRelatedActionComponent(); + if (this.relatedAction == null) + this.relatedAction = new ArrayList(); + this.relatedAction.add(t); + return t; + } + + public RequestGroupActionComponent addRelatedAction(RequestGroupActionRelatedActionComponent t) { //3 + if (t == null) + return this; + if (this.relatedAction == null) + this.relatedAction = new ArrayList(); + this.relatedAction.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #relatedAction}, creating it if it does not already exist + */ + public RequestGroupActionRelatedActionComponent getRelatedActionFirstRep() { + if (getRelatedAction().isEmpty()) { + addRelatedAction(); + } + return getRelatedAction().get(0); + } + /** * @return {@link #timing} (An optional value describing when the action should be performed.) */ @@ -1358,6 +1553,19 @@ public class RequestGroup extends DomainResource { return this.timing instanceof Range; } + /** + * @return {@link #timing} (An optional value describing when the action should be performed.) + */ + public Timing getTimingTiming() throws FHIRException { + if (!(this.timing instanceof Timing)) + throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + public boolean hasTimingTiming() { + return this.timing instanceof Timing; + } + public boolean hasTiming() { return this.timing != null && !this.timing.isEmpty(); } @@ -1803,8 +2011,9 @@ public class RequestGroup extends DomainResource { childrenList.add(new Property("textEquivalent", "string", "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.", 0, java.lang.Integer.MAX_VALUE, textEquivalent)); childrenList.add(new Property("code", "CodeableConcept", "The concept represented by this action or its sub-actions.", 0, java.lang.Integer.MAX_VALUE, code)); childrenList.add(new Property("documentation", "RelatedArtifact", "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("condition", "", "An expression that describes applicability criteria, or start/stop conditions for the action.", 0, java.lang.Integer.MAX_VALUE, condition)); childrenList.add(new Property("relatedAction", "", "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0, java.lang.Integer.MAX_VALUE, relatedAction)); - childrenList.add(new Property("timing[x]", "dateTime|Period|Duration|Range", "An optional value describing when the action should be performed.", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("timing[x]", "dateTime|Period|Duration|Range|Timing", "An optional value describing when the action should be performed.", 0, java.lang.Integer.MAX_VALUE, timing)); childrenList.add(new Property("participant", "Reference(Patient|Person|Practitioner|RelatedPerson)", "The participant in the action.", 0, java.lang.Integer.MAX_VALUE, participant)); childrenList.add(new Property("type", "Coding", "The type of action to perform (create, update, remove).", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("groupingBehavior", "code", "Defines the grouping behavior for the action and its children.", 0, java.lang.Integer.MAX_VALUE, groupingBehavior)); @@ -1826,7 +2035,8 @@ public class RequestGroup extends DomainResource { case -900391049: /*textEquivalent*/ return this.textEquivalent == null ? new Base[0] : new Base[] {this.textEquivalent}; // StringType case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // RelatedArtifact - case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : new Base[] {this.relatedAction}; // RequestGroupActionRelatedActionComponent + case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // RequestGroupActionConditionComponent + case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : this.relatedAction.toArray(new Base[this.relatedAction.size()]); // RequestGroupActionRelatedActionComponent case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // Reference case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding @@ -1866,8 +2076,11 @@ public class RequestGroup extends DomainResource { case 1587405498: // documentation this.getDocumentation().add(castToRelatedArtifact(value)); // RelatedArtifact break; + case -861311717: // condition + this.getCondition().add((RequestGroupActionConditionComponent) value); // RequestGroupActionConditionComponent + break; case -384107967: // relatedAction - this.relatedAction = (RequestGroupActionRelatedActionComponent) value; // RequestGroupActionRelatedActionComponent + this.getRelatedAction().add((RequestGroupActionRelatedActionComponent) value); // RequestGroupActionRelatedActionComponent break; case -873664438: // timing this.timing = castToType(value); // Type @@ -1920,8 +2133,10 @@ public class RequestGroup extends DomainResource { this.getCode().add(castToCodeableConcept(value)); else if (name.equals("documentation")) this.getDocumentation().add(castToRelatedArtifact(value)); + else if (name.equals("condition")) + this.getCondition().add((RequestGroupActionConditionComponent) value); else if (name.equals("relatedAction")) - this.relatedAction = (RequestGroupActionRelatedActionComponent) value; // RequestGroupActionRelatedActionComponent + this.getRelatedAction().add((RequestGroupActionRelatedActionComponent) value); else if (name.equals("timing[x]")) this.timing = castToType(value); // Type else if (name.equals("participant")) @@ -1956,7 +2171,8 @@ public class RequestGroup extends DomainResource { case -900391049: throw new FHIRException("Cannot make property textEquivalent as it is not a complex type"); // StringType case 3059181: return addCode(); // CodeableConcept case 1587405498: return addDocumentation(); // RelatedArtifact - case -384107967: return getRelatedAction(); // RequestGroupActionRelatedActionComponent + case -861311717: return addCondition(); // RequestGroupActionConditionComponent + case -384107967: return addRelatedAction(); // RequestGroupActionRelatedActionComponent case 164632566: return getTiming(); // Type case 767422259: return addParticipant(); // Reference case 3575610: return getType(); // Coding @@ -1996,9 +2212,11 @@ public class RequestGroup extends DomainResource { else if (name.equals("documentation")) { return addDocumentation(); } + else if (name.equals("condition")) { + return addCondition(); + } else if (name.equals("relatedAction")) { - this.relatedAction = new RequestGroupActionRelatedActionComponent(); - return this.relatedAction; + return addRelatedAction(); } else if (name.equals("timingDateTime")) { this.timing = new DateTimeType(); @@ -2016,6 +2234,10 @@ public class RequestGroup extends DomainResource { this.timing = new Range(); return this.timing; } + else if (name.equals("timingTiming")) { + this.timing = new Timing(); + return this.timing; + } else if (name.equals("participant")) { return addParticipant(); } @@ -2067,7 +2289,16 @@ public class RequestGroup extends DomainResource { for (RelatedArtifact i : documentation) dst.documentation.add(i.copy()); }; - dst.relatedAction = relatedAction == null ? null : relatedAction.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (RequestGroupActionConditionComponent i : condition) + dst.condition.add(i.copy()); + }; + if (relatedAction != null) { + dst.relatedAction = new ArrayList(); + for (RequestGroupActionRelatedActionComponent i : relatedAction) + dst.relatedAction.add(i.copy()); + }; dst.timing = timing == null ? null : timing.copy(); if (participant != null) { dst.participant = new ArrayList(); @@ -2098,9 +2329,9 @@ public class RequestGroup extends DomainResource { RequestGroupActionComponent o = (RequestGroupActionComponent) other; return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(label, o.label, true) && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) && compareDeep(textEquivalent, o.textEquivalent, true) - && compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true) && compareDeep(relatedAction, o.relatedAction, true) - && compareDeep(timing, o.timing, true) && compareDeep(participant, o.participant, true) && compareDeep(type, o.type, true) - && compareDeep(groupingBehavior, o.groupingBehavior, true) && compareDeep(selectionBehavior, o.selectionBehavior, true) + && compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true) && compareDeep(condition, o.condition, true) + && compareDeep(relatedAction, o.relatedAction, true) && compareDeep(timing, o.timing, true) && compareDeep(participant, o.participant, true) + && compareDeep(type, o.type, true) && compareDeep(groupingBehavior, o.groupingBehavior, true) && compareDeep(selectionBehavior, o.selectionBehavior, true) && compareDeep(requiredBehavior, o.requiredBehavior, true) && compareDeep(precheckBehavior, o.precheckBehavior, true) && compareDeep(cardinalityBehavior, o.cardinalityBehavior, true) && compareDeep(resource, o.resource, true) && compareDeep(action, o.action, true); @@ -2122,9 +2353,9 @@ public class RequestGroup extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(actionIdentifier, label, title - , description, textEquivalent, code, documentation, relatedAction, timing, participant - , type, groupingBehavior, selectionBehavior, requiredBehavior, precheckBehavior, cardinalityBehavior - , resource, action); + , description, textEquivalent, code, documentation, condition, relatedAction, timing + , participant, type, groupingBehavior, selectionBehavior, requiredBehavior, precheckBehavior + , cardinalityBehavior, resource, action); } public String fhirType() { @@ -2132,6 +2363,374 @@ public class RequestGroup extends DomainResource { } + } + + @Block() + public static class RequestGroupActionConditionComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The kind of condition. + */ + @Child(name = "kind", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="applicability | start | stop", formalDefinition="The kind of condition." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-condition-kind") + protected Enumeration kind; + + /** + * A brief, natural language description of the condition that effectively communicates the intended semantics. + */ + @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Natural language description of the condition", formalDefinition="A brief, natural language description of the condition that effectively communicates the intended semantics." ) + protected StringType description; + + /** + * The media type of the language for the expression. + */ + @Child(name = "language", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Language of the expression", formalDefinition="The media type of the language for the expression." ) + protected StringType language; + + /** + * An expression that returns true or false, indicating whether or not the condition is satisfied. + */ + @Child(name = "expression", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Boolean-valued expression", formalDefinition="An expression that returns true or false, indicating whether or not the condition is satisfied." ) + protected StringType expression; + + private static final long serialVersionUID = 944300105L; + + /** + * Constructor + */ + public RequestGroupActionConditionComponent() { + super(); + } + + /** + * Constructor + */ + public RequestGroupActionConditionComponent(Enumeration kind) { + super(); + this.kind = kind; + } + + /** + * @return {@link #kind} (The kind of condition.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RequestGroupActionConditionComponent.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(new ActionConditionKindEnumFactory()); // bb + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (The kind of condition.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public RequestGroupActionConditionComponent setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return The kind of condition. + */ + public ActionConditionKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value The kind of condition. + */ + public RequestGroupActionConditionComponent setKind(ActionConditionKind value) { + if (this.kind == null) + this.kind = new Enumeration(new ActionConditionKindEnumFactory()); + this.kind.setValue(value); + return this; + } + + /** + * @return {@link #description} (A brief, natural language description of the condition that effectively communicates the intended semantics.). 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 RequestGroupActionConditionComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 brief, natural language description of the condition that effectively communicates the intended semantics.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public RequestGroupActionConditionComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A brief, natural language description of the condition that effectively communicates the intended semantics. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A brief, natural language description of the condition that effectively communicates the intended semantics. + */ + public RequestGroupActionConditionComponent 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 #language} (The media type of the language for the expression.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public StringType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RequestGroupActionConditionComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new StringType(); // bb + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The media type of the language for the expression.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public RequestGroupActionConditionComponent setLanguageElement(StringType value) { + this.language = value; + return this; + } + + /** + * @return The media type of the language for the expression. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The media type of the language for the expression. + */ + public RequestGroupActionConditionComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new StringType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #expression} (An expression that returns true or false, indicating whether or not the condition is satisfied.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public StringType getExpressionElement() { + if (this.expression == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RequestGroupActionConditionComponent.expression"); + else if (Configuration.doAutoCreate()) + this.expression = new StringType(); // bb + return this.expression; + } + + public boolean hasExpressionElement() { + return this.expression != null && !this.expression.isEmpty(); + } + + public boolean hasExpression() { + return this.expression != null && !this.expression.isEmpty(); + } + + /** + * @param value {@link #expression} (An expression that returns true or false, indicating whether or not the condition is satisfied.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public RequestGroupActionConditionComponent setExpressionElement(StringType value) { + this.expression = value; + return this; + } + + /** + * @return An expression that returns true or false, indicating whether or not the condition is satisfied. + */ + public String getExpression() { + return this.expression == null ? null : this.expression.getValue(); + } + + /** + * @param value An expression that returns true or false, indicating whether or not the condition is satisfied. + */ + public RequestGroupActionConditionComponent setExpression(String value) { + if (Utilities.noString(value)) + this.expression = null; + else { + if (this.expression == null) + this.expression = new StringType(); + this.expression.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("kind", "code", "The kind of condition.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("description", "string", "A brief, natural language description of the condition that effectively communicates the intended semantics.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("language", "string", "The media type of the language for the expression.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("expression", "string", "An expression that returns true or false, indicating whether or not the condition is satisfied.", 0, java.lang.Integer.MAX_VALUE, expression)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // StringType + case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3292052: // kind + this.kind = new ActionConditionKindEnumFactory().fromType(value); // Enumeration + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + case -1613589672: // language + this.language = castToString(value); // StringType + break; + case -1795452264: // expression + this.expression = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("kind")) + this.kind = new ActionConditionKindEnumFactory().fromType(value); // Enumeration + else if (name.equals("description")) + this.description = castToString(value); // StringType + else if (name.equals("language")) + this.language = castToString(value); // StringType + else if (name.equals("expression")) + this.expression = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // StringType + case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("kind")) { + throw new FHIRException("Cannot call addChild on a primitive type RequestGroup.kind"); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type RequestGroup.description"); + } + else if (name.equals("language")) { + throw new FHIRException("Cannot call addChild on a primitive type RequestGroup.language"); + } + else if (name.equals("expression")) { + throw new FHIRException("Cannot call addChild on a primitive type RequestGroup.expression"); + } + else + return super.addChild(name); + } + + public RequestGroupActionConditionComponent copy() { + RequestGroupActionConditionComponent dst = new RequestGroupActionConditionComponent(); + copyValues(dst); + dst.kind = kind == null ? null : kind.copy(); + dst.description = description == null ? null : description.copy(); + dst.language = language == null ? null : language.copy(); + dst.expression = expression == null ? null : expression.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof RequestGroupActionConditionComponent)) + return false; + RequestGroupActionConditionComponent o = (RequestGroupActionConditionComponent) other; + return compareDeep(kind, o.kind, true) && compareDeep(description, o.description, true) && compareDeep(language, o.language, true) + && compareDeep(expression, o.expression, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof RequestGroupActionConditionComponent)) + return false; + RequestGroupActionConditionComponent o = (RequestGroupActionConditionComponent) other; + return compareValues(kind, o.kind, true) && compareValues(description, o.description, true) && compareValues(language, o.language, true) + && compareValues(expression, o.expression, true); + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(kind, description, language + , expression); + } + + public String fhirType() { + return "RequestGroup.action.condition"; + + } + } @Block() diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResearchStudy.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResearchStudy.java new file mode 100644 index 00000000000..4f1b029ae6c --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResearchStudy.java @@ -0,0 +1,2408 @@ +package org.hl7.fhir.dstu3.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 6, 2016 09:42-0500 for FHIR v1.8.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.dstu3.model.Enumerations.*; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.ChildOrder; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Block; +import org.hl7.fhir.instance.model.api.*; +import org.hl7.fhir.exceptions.FHIRException; +/** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ +@ResourceDef(name="ResearchStudy", profile="http://hl7.org/fhir/Profile/ResearchStudy") +public class ResearchStudy extends DomainResource { + + public enum ResearchStudyStatus { + /** + * The study is undergoing design but the process of selecting study subjects and capturing data has not yet begun. + */ + DRAFT, + /** + * The study is currently being executed + */ + INPROGRESS, + /** + * Execution of the study has been temporarily paused + */ + SUSPENDED, + /** + * The study was terminated prior to the final determination of results + */ + STOPPED, + /** + * The information sought by the study has been gathered and compiled and no further work is being performed + */ + COMPLETED, + /** + * This study never actually existed. The record is retained for tracking purposes in the event decisions may have been made based on this erroneous information. + */ + ENTEREDINERROR, + /** + * added to help the parsers with the generic types + */ + NULL; + public static ResearchStudyStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("stopped".equals(codeString)) + return STOPPED; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown ResearchStudyStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case INPROGRESS: return "in-progress"; + case SUSPENDED: return "suspended"; + case STOPPED: return "stopped"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return "http://hl7.org/fhir/research-study-status"; + case INPROGRESS: return "http://hl7.org/fhir/research-study-status"; + case SUSPENDED: return "http://hl7.org/fhir/research-study-status"; + case STOPPED: return "http://hl7.org/fhir/research-study-status"; + case COMPLETED: return "http://hl7.org/fhir/research-study-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/research-study-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "The study is undergoing design but the process of selecting study subjects and capturing data has not yet begun."; + case INPROGRESS: return "The study is currently being executed"; + case SUSPENDED: return "Execution of the study has been temporarily paused"; + case STOPPED: return "The study was terminated prior to the final determination of results"; + case COMPLETED: return "The information sought by the study has been gathered and compiled and no further work is being performed"; + case ENTEREDINERROR: return "This study never actually existed. The record is retained for tracking purposes in the event decisions may have been made based on this erroneous information."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case INPROGRESS: return "In-progress"; + case SUSPENDED: return "Suspended"; + case STOPPED: return "Stopped"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in error"; + default: return "?"; + } + } + } + + public static class ResearchStudyStatusEnumFactory implements EnumFactory { + public ResearchStudyStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ResearchStudyStatus.DRAFT; + if ("in-progress".equals(codeString)) + return ResearchStudyStatus.INPROGRESS; + if ("suspended".equals(codeString)) + return ResearchStudyStatus.SUSPENDED; + if ("stopped".equals(codeString)) + return ResearchStudyStatus.STOPPED; + if ("completed".equals(codeString)) + return ResearchStudyStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return ResearchStudyStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ResearchStudyStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return new Enumeration(this, ResearchStudyStatus.DRAFT); + if ("in-progress".equals(codeString)) + return new Enumeration(this, ResearchStudyStatus.INPROGRESS); + if ("suspended".equals(codeString)) + return new Enumeration(this, ResearchStudyStatus.SUSPENDED); + if ("stopped".equals(codeString)) + return new Enumeration(this, ResearchStudyStatus.STOPPED); + if ("completed".equals(codeString)) + return new Enumeration(this, ResearchStudyStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, ResearchStudyStatus.ENTEREDINERROR); + throw new FHIRException("Unknown ResearchStudyStatus code '"+codeString+"'"); + } + public String toCode(ResearchStudyStatus code) { + if (code == ResearchStudyStatus.DRAFT) + return "draft"; + if (code == ResearchStudyStatus.INPROGRESS) + return "in-progress"; + if (code == ResearchStudyStatus.SUSPENDED) + return "suspended"; + if (code == ResearchStudyStatus.STOPPED) + return "stopped"; + if (code == ResearchStudyStatus.COMPLETED) + return "completed"; + if (code == ResearchStudyStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + public String toSystem(ResearchStudyStatus code) { + return code.getSystem(); + } + } + + @Block() + public static class ResearchStudyArmComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Unique, human-readable label for this arm of the study. + */ + @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Label for study arm", formalDefinition="Unique, human-readable label for this arm of the study." ) + protected StringType name; + + /** + * E.g. Experimental, active comparator, placebo comparator. + */ + @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Categorization of arm", formalDefinition="E.g. Experimental, active comparator, placebo comparator." ) + protected CodeableConcept code; + + /** + * A succinct description of the path through the study that would be followed by a subject adhering to this arm. + */ + @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Short explanation of study path", formalDefinition="A succinct description of the path through the study that would be followed by a subject adhering to this arm." ) + protected StringType description; + + private static final long serialVersionUID = 1433183343L; + + /** + * Constructor + */ + public ResearchStudyArmComponent() { + super(); + } + + /** + * Constructor + */ + public ResearchStudyArmComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (Unique, human-readable label for this arm of the study.). 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 ResearchStudyArmComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); // bb + 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} (Unique, human-readable label for this arm of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ResearchStudyArmComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Unique, human-readable label for this arm of the study. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Unique, human-readable label for this arm of the study. + */ + public ResearchStudyArmComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #code} (E.g. Experimental, active comparator, placebo comparator.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudyArmComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); // cc + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (E.g. Experimental, active comparator, placebo comparator.) + */ + public ResearchStudyArmComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #description} (A succinct description of the path through the study that would be followed by a subject adhering to this arm.). 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 ResearchStudyArmComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); // bb + 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 succinct description of the path through the study that would be followed by a subject adhering to this arm.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ResearchStudyArmComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A succinct description of the path through the study that would be followed by a subject adhering to this arm. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A succinct description of the path through the study that would be followed by a subject adhering to this arm. + */ + public ResearchStudyArmComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Unique, human-readable label for this arm of the study.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("code", "CodeableConcept", "E.g. Experimental, active comparator, placebo comparator.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("description", "string", "A succinct description of the path through the study that would be followed by a subject adhering to this arm.", 0, java.lang.Integer.MAX_VALUE, description)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 3373707: // name + this.name = castToString(value); // StringType + break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; + case -1724546052: // description + this.description = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("name")) + this.name = castToString(value); // StringType + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("description")) + this.description = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType + case 3059181: return getCode(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("name")) { + throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.name"); + } + else if (name.equals("code")) { + this.code = new CodeableConcept(); + return this.code; + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.description"); + } + else + return super.addChild(name); + } + + public ResearchStudyArmComponent copy() { + ResearchStudyArmComponent dst = new ResearchStudyArmComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.code = code == null ? null : code.copy(); + dst.description = description == null ? null : description.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ResearchStudyArmComponent)) + return false; + ResearchStudyArmComponent o = (ResearchStudyArmComponent) other; + return compareDeep(name, o.name, true) && compareDeep(code, o.code, true) && compareDeep(description, o.description, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ResearchStudyArmComponent)) + return false; + ResearchStudyArmComponent o = (ResearchStudyArmComponent) other; + return compareValues(name, o.name, true) && compareValues(description, o.description, true); + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, code, description + ); + } + + public String fhirType() { + return "ResearchStudy.arm"; + + } + + } + + /** + * Identifiers assigned to this research study by the sponsor or other systems. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Business Identifer for study", formalDefinition="Identifiers assigned to this research study by the sponsor or other systems." ) + protected List identifier; + + /** + * A short, descriptive user-friendly label for the study. + */ + @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Name for this study", formalDefinition="A short, descriptive user-friendly label for the study." ) + protected StringType title; + + /** + * The set of steps expected to be performed as part of the execution of the study. + */ + @Child(name = "protocol", type = {PlanDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Steps followed in executing study", formalDefinition="The set of steps expected to be performed as part of the execution of the study." ) + protected List protocol; + /** + * The actual objects that are the target of the reference (The set of steps expected to be performed as part of the execution of the study.) + */ + protected List protocolTarget; + + + /** + * A larger research study of which this particular study is a component or step. + */ + @Child(name = "partOf", type = {ResearchStudy.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Part of larger study", formalDefinition="A larger research study of which this particular study is a component or step." ) + protected List partOf; + /** + * The actual objects that are the target of the reference (A larger research study of which this particular study is a component or step.) + */ + protected List partOfTarget; + + + /** + * The current state of the study. + */ + @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="draft | in-progress | suspended | stopped | completed | entered-in-error", formalDefinition="The current state of the study." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-status") + protected Enumeration status; + + /** + * Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc. + */ + @Child(name = "category", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Classifications for the study", formalDefinition="Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc." ) + protected List category; + + /** + * The condition(s), medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about. + */ + @Child(name = "focus", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Drugs, devices, conditions, etc. under study", formalDefinition="The condition(s), medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about." ) + protected List focus; + + /** + * Contact details to assist a user in learning more about or engaging with the study. + */ + @Child(name = "contact", type = {ContactDetail.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Contact details for the study", formalDefinition="Contact details to assist a user in learning more about or engaging with the study." ) + protected List contact; + + /** + * Citations, references and other related documents. + */ + @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="References and dependencies", formalDefinition="Citations, references and other related documents." ) + protected List relatedArtifact; + + /** + * Key terms to aid in searching for or filtering the study. + */ + @Child(name = "keyword", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Used to search for the study", formalDefinition="Key terms to aid in searching for or filtering the study." ) + protected List keyword; + + /** + * Indicates a country, state or other region where the study is taking place. + */ + @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Geographic region(s) for study", formalDefinition="Indicates a country, state or other region where the study is taking place." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction") + protected List jurisdiction; + + /** + * A full description of how the study is being conducted. + */ + @Child(name = "description", type = {MarkdownType.class}, order=11, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="What this is study doing", formalDefinition="A full description of how the study is being conducted." ) + protected MarkdownType description; + + /** + * Reference to a Group that defines the criteria for and quantity of subjects participating in the study. E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes". + */ + @Child(name = "enrollment", type = {Group.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Inclusion & exclusion criteria", formalDefinition="Reference to a Group that defines the criteria for and quantity of subjects participating in the study. E.g. \" 200 female Europeans between the ages of 20 and 45 with early onset diabetes\"." ) + protected List enrollment; + /** + * The actual objects that are the target of the reference (Reference to a Group that defines the criteria for and quantity of subjects participating in the study. E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes".) + */ + protected List enrollmentTarget; + + + /** + * Identifies the start date and the expected (or actual, depending on status) end date for the study. + */ + @Child(name = "period", type = {Period.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="When the study began and ended", formalDefinition="Identifies the start date and the expected (or actual, depending on status) end date for the study." ) + protected Period period; + + /** + * The organization responsible for the execution of the study. + */ + @Child(name = "sponsor", type = {Organization.class}, order=14, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Organization responsible for the study", formalDefinition="The organization responsible for the execution of the study." ) + protected Reference sponsor; + + /** + * The actual object that is the target of the reference (The organization responsible for the execution of the study.) + */ + protected Organization sponsorTarget; + + /** + * Indicates the individual who has primary oversite of the execution of the study. + */ + @Child(name = "principalInvestigator", type = {Practitioner.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Individual responsible for the study", formalDefinition="Indicates the individual who has primary oversite of the execution of the study." ) + protected Reference principalInvestigator; + + /** + * The actual object that is the target of the reference (Indicates the individual who has primary oversite of the execution of the study.) + */ + protected Practitioner principalInvestigatorTarget; + + /** + * Clinic, hospital or other healthcare location that is participating in the study. + */ + @Child(name = "site", type = {Location.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Location involved in study execution", formalDefinition="Clinic, hospital or other healthcare location that is participating in the study." ) + protected List site; + /** + * The actual objects that are the target of the reference (Clinic, hospital or other healthcare location that is participating in the study.) + */ + protected List siteTarget; + + + /** + * A description and/or code explaining the premature termination of the study. + */ + @Child(name = "reasonStopped", type = {CodeableConcept.class}, order=17, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reason for terminating study early", formalDefinition="A description and/or code explaining the premature termination of the study." ) + protected CodeableConcept reasonStopped; + + /** + * Comments made about the event by the performer, subject or other participants. + */ + @Child(name = "note", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Comments made about the event", formalDefinition="Comments made about the event by the performer, subject or other participants." ) + protected List note; + + /** + * Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. + */ + @Child(name = "arm", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Defined path through the study for a subject", formalDefinition="Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up." ) + protected List arm; + + private static final long serialVersionUID = -1804662501L; + + /** + * Constructor + */ + public ResearchStudy() { + super(); + } + + /** + * Constructor + */ + public ResearchStudy(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this research study by the sponsor or other systems.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setIdentifier(List theIdentifier) { + this.identifier = theIdentifier; + return this; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + public ResearchStudy addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist + */ + public Identifier getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + addIdentifier(); + } + return getIdentifier().get(0); + } + + /** + * @return {@link #title} (A short, descriptive user-friendly label for the study.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudy.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); // bb + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A short, descriptive user-friendly label for the study.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public ResearchStudy setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A short, descriptive user-friendly label for the study. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A short, descriptive user-friendly label for the study. + */ + public ResearchStudy setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #protocol} (The set of steps expected to be performed as part of the execution of the study.) + */ + public List getProtocol() { + if (this.protocol == null) + this.protocol = new ArrayList(); + return this.protocol; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setProtocol(List theProtocol) { + this.protocol = theProtocol; + return this; + } + + public boolean hasProtocol() { + if (this.protocol == null) + return false; + for (Reference item : this.protocol) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addProtocol() { //3 + Reference t = new Reference(); + if (this.protocol == null) + this.protocol = new ArrayList(); + this.protocol.add(t); + return t; + } + + public ResearchStudy addProtocol(Reference t) { //3 + if (t == null) + return this; + if (this.protocol == null) + this.protocol = new ArrayList(); + this.protocol.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #protocol}, creating it if it does not already exist + */ + public Reference getProtocolFirstRep() { + if (getProtocol().isEmpty()) { + addProtocol(); + } + return getProtocol().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getProtocolTarget() { + if (this.protocolTarget == null) + this.protocolTarget = new ArrayList(); + return this.protocolTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public PlanDefinition addProtocolTarget() { + PlanDefinition r = new PlanDefinition(); + if (this.protocolTarget == null) + this.protocolTarget = new ArrayList(); + this.protocolTarget.add(r); + return r; + } + + /** + * @return {@link #partOf} (A larger research study of which this particular study is a component or step.) + */ + public List getPartOf() { + if (this.partOf == null) + this.partOf = new ArrayList(); + return this.partOf; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setPartOf(List thePartOf) { + this.partOf = thePartOf; + return this; + } + + public boolean hasPartOf() { + if (this.partOf == null) + return false; + for (Reference item : this.partOf) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addPartOf() { //3 + Reference t = new Reference(); + if (this.partOf == null) + this.partOf = new ArrayList(); + this.partOf.add(t); + return t; + } + + public ResearchStudy addPartOf(Reference t) { //3 + if (t == null) + return this; + if (this.partOf == null) + this.partOf = new ArrayList(); + this.partOf.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist + */ + public Reference getPartOfFirstRep() { + if (getPartOf().isEmpty()) { + addPartOf(); + } + return getPartOf().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getPartOfTarget() { + if (this.partOfTarget == null) + this.partOfTarget = new ArrayList(); + return this.partOfTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public ResearchStudy addPartOfTarget() { + ResearchStudy r = new ResearchStudy(); + if (this.partOfTarget == null) + this.partOfTarget = new ArrayList(); + this.partOfTarget.add(r); + return r; + } + + /** + * @return {@link #status} (The current state of the study.). 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 ResearchStudy.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ResearchStudyStatusEnumFactory()); // bb + 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 current state of the study.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ResearchStudy setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The current state of the study. + */ + public ResearchStudyStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The current state of the study. + */ + public ResearchStudy setStatus(ResearchStudyStatus value) { + if (this.status == null) + this.status = new Enumeration(new ResearchStudyStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #category} (Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.) + */ + public List getCategory() { + if (this.category == null) + this.category = new ArrayList(); + return this.category; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setCategory(List theCategory) { + this.category = theCategory; + return this; + } + + public boolean hasCategory() { + if (this.category == null) + return false; + for (CodeableConcept item : this.category) + if (!item.isEmpty()) + return true; + return false; + } + + public CodeableConcept addCategory() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return t; + } + + public ResearchStudy addCategory(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist + */ + public CodeableConcept getCategoryFirstRep() { + if (getCategory().isEmpty()) { + addCategory(); + } + return getCategory().get(0); + } + + /** + * @return {@link #focus} (The condition(s), medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.) + */ + public List getFocus() { + if (this.focus == null) + this.focus = new ArrayList(); + return this.focus; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setFocus(List theFocus) { + this.focus = theFocus; + return this; + } + + public boolean hasFocus() { + if (this.focus == null) + return false; + for (CodeableConcept item : this.focus) + if (!item.isEmpty()) + return true; + return false; + } + + public CodeableConcept addFocus() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.focus == null) + this.focus = new ArrayList(); + this.focus.add(t); + return t; + } + + public ResearchStudy addFocus(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.focus == null) + this.focus = new ArrayList(); + this.focus.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist + */ + public CodeableConcept getFocusFirstRep() { + if (getFocus().isEmpty()) { + addFocus(); + } + return getFocus().get(0); + } + + /** + * @return {@link #contact} (Contact details to assist a user in learning more about or engaging with the study.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setContact(List theContact) { + this.contact = theContact; + return this; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactDetail item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + public ContactDetail addContact() { //3 + ContactDetail t = new ContactDetail(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + public ResearchStudy addContact(ContactDetail t) { //3 + if (t == null) + return this; + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist + */ + public ContactDetail getContactFirstRep() { + if (getContact().isEmpty()) { + addContact(); + } + return getContact().get(0); + } + + /** + * @return {@link #relatedArtifact} (Citations, references and other related documents.) + */ + public List getRelatedArtifact() { + if (this.relatedArtifact == null) + this.relatedArtifact = new ArrayList(); + return this.relatedArtifact; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setRelatedArtifact(List theRelatedArtifact) { + this.relatedArtifact = theRelatedArtifact; + return this; + } + + public boolean hasRelatedArtifact() { + if (this.relatedArtifact == null) + return false; + for (RelatedArtifact item : this.relatedArtifact) + if (!item.isEmpty()) + return true; + return false; + } + + public RelatedArtifact addRelatedArtifact() { //3 + RelatedArtifact t = new RelatedArtifact(); + if (this.relatedArtifact == null) + this.relatedArtifact = new ArrayList(); + this.relatedArtifact.add(t); + return t; + } + + public ResearchStudy addRelatedArtifact(RelatedArtifact t) { //3 + if (t == null) + return this; + if (this.relatedArtifact == null) + this.relatedArtifact = new ArrayList(); + this.relatedArtifact.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #relatedArtifact}, creating it if it does not already exist + */ + public RelatedArtifact getRelatedArtifactFirstRep() { + if (getRelatedArtifact().isEmpty()) { + addRelatedArtifact(); + } + return getRelatedArtifact().get(0); + } + + /** + * @return {@link #keyword} (Key terms to aid in searching for or filtering the study.) + */ + public List getKeyword() { + if (this.keyword == null) + this.keyword = new ArrayList(); + return this.keyword; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setKeyword(List theKeyword) { + this.keyword = theKeyword; + return this; + } + + public boolean hasKeyword() { + if (this.keyword == null) + return false; + for (CodeableConcept item : this.keyword) + if (!item.isEmpty()) + return true; + return false; + } + + public CodeableConcept addKeyword() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.keyword == null) + this.keyword = new ArrayList(); + this.keyword.add(t); + return t; + } + + public ResearchStudy addKeyword(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.keyword == null) + this.keyword = new ArrayList(); + this.keyword.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #keyword}, creating it if it does not already exist + */ + public CodeableConcept getKeywordFirstRep() { + if (getKeyword().isEmpty()) { + addKeyword(); + } + return getKeyword().get(0); + } + + /** + * @return {@link #jurisdiction} (Indicates a country, state or other region where the study is taking place.) + */ + public List getJurisdiction() { + if (this.jurisdiction == null) + this.jurisdiction = new ArrayList(); + return this.jurisdiction; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setJurisdiction(List theJurisdiction) { + this.jurisdiction = theJurisdiction; + return this; + } + + public boolean hasJurisdiction() { + if (this.jurisdiction == null) + return false; + for (CodeableConcept item : this.jurisdiction) + if (!item.isEmpty()) + return true; + return false; + } + + public CodeableConcept addJurisdiction() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.jurisdiction == null) + this.jurisdiction = new ArrayList(); + this.jurisdiction.add(t); + return t; + } + + public ResearchStudy addJurisdiction(CodeableConcept t) { //3 + if (t == null) + return this; + if (this.jurisdiction == null) + this.jurisdiction = new ArrayList(); + this.jurisdiction.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist + */ + public CodeableConcept getJurisdictionFirstRep() { + if (getJurisdiction().isEmpty()) { + addJurisdiction(); + } + return getJurisdiction().get(0); + } + + /** + * @return {@link #description} (A full description of how the study is being conducted.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public MarkdownType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudy.description"); + else if (Configuration.doAutoCreate()) + this.description = new MarkdownType(); // bb + 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 full description of how the study is being conducted.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ResearchStudy setDescriptionElement(MarkdownType value) { + this.description = value; + return this; + } + + /** + * @return A full description of how the study is being conducted. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A full description of how the study is being conducted. + */ + public ResearchStudy setDescription(String value) { + if (value == null) + this.description = null; + else { + if (this.description == null) + this.description = new MarkdownType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #enrollment} (Reference to a Group that defines the criteria for and quantity of subjects participating in the study. E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes".) + */ + public List getEnrollment() { + if (this.enrollment == null) + this.enrollment = new ArrayList(); + return this.enrollment; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setEnrollment(List theEnrollment) { + this.enrollment = theEnrollment; + return this; + } + + public boolean hasEnrollment() { + if (this.enrollment == null) + return false; + for (Reference item : this.enrollment) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addEnrollment() { //3 + Reference t = new Reference(); + if (this.enrollment == null) + this.enrollment = new ArrayList(); + this.enrollment.add(t); + return t; + } + + public ResearchStudy addEnrollment(Reference t) { //3 + if (t == null) + return this; + if (this.enrollment == null) + this.enrollment = new ArrayList(); + this.enrollment.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #enrollment}, creating it if it does not already exist + */ + public Reference getEnrollmentFirstRep() { + if (getEnrollment().isEmpty()) { + addEnrollment(); + } + return getEnrollment().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getEnrollmentTarget() { + if (this.enrollmentTarget == null) + this.enrollmentTarget = new ArrayList(); + return this.enrollmentTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public Group addEnrollmentTarget() { + Group r = new Group(); + if (this.enrollmentTarget == null) + this.enrollmentTarget = new ArrayList(); + this.enrollmentTarget.add(r); + return r; + } + + /** + * @return {@link #period} (Identifies the start date and the expected (or actual, depending on status) end date for the study.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudy.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Identifies the start date and the expected (or actual, depending on status) end date for the study.) + */ + public ResearchStudy setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #sponsor} (The organization responsible for the execution of the study.) + */ + public Reference getSponsor() { + if (this.sponsor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudy.sponsor"); + else if (Configuration.doAutoCreate()) + this.sponsor = new Reference(); // cc + return this.sponsor; + } + + public boolean hasSponsor() { + return this.sponsor != null && !this.sponsor.isEmpty(); + } + + /** + * @param value {@link #sponsor} (The organization responsible for the execution of the study.) + */ + public ResearchStudy setSponsor(Reference value) { + this.sponsor = value; + return this; + } + + /** + * @return {@link #sponsor} 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 responsible for the execution of the study.) + */ + public Organization getSponsorTarget() { + if (this.sponsorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudy.sponsor"); + else if (Configuration.doAutoCreate()) + this.sponsorTarget = new Organization(); // aa + return this.sponsorTarget; + } + + /** + * @param value {@link #sponsor} 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 responsible for the execution of the study.) + */ + public ResearchStudy setSponsorTarget(Organization value) { + this.sponsorTarget = value; + return this; + } + + /** + * @return {@link #principalInvestigator} (Indicates the individual who has primary oversite of the execution of the study.) + */ + public Reference getPrincipalInvestigator() { + if (this.principalInvestigator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudy.principalInvestigator"); + else if (Configuration.doAutoCreate()) + this.principalInvestigator = new Reference(); // cc + return this.principalInvestigator; + } + + public boolean hasPrincipalInvestigator() { + return this.principalInvestigator != null && !this.principalInvestigator.isEmpty(); + } + + /** + * @param value {@link #principalInvestigator} (Indicates the individual who has primary oversite of the execution of the study.) + */ + public ResearchStudy setPrincipalInvestigator(Reference value) { + this.principalInvestigator = value; + return this; + } + + /** + * @return {@link #principalInvestigator} 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. (Indicates the individual who has primary oversite of the execution of the study.) + */ + public Practitioner getPrincipalInvestigatorTarget() { + if (this.principalInvestigatorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudy.principalInvestigator"); + else if (Configuration.doAutoCreate()) + this.principalInvestigatorTarget = new Practitioner(); // aa + return this.principalInvestigatorTarget; + } + + /** + * @param value {@link #principalInvestigator} 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. (Indicates the individual who has primary oversite of the execution of the study.) + */ + public ResearchStudy setPrincipalInvestigatorTarget(Practitioner value) { + this.principalInvestigatorTarget = value; + return this; + } + + /** + * @return {@link #site} (Clinic, hospital or other healthcare location that is participating in the study.) + */ + public List getSite() { + if (this.site == null) + this.site = new ArrayList(); + return this.site; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setSite(List theSite) { + this.site = theSite; + return this; + } + + public boolean hasSite() { + if (this.site == null) + return false; + for (Reference item : this.site) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addSite() { //3 + Reference t = new Reference(); + if (this.site == null) + this.site = new ArrayList(); + this.site.add(t); + return t; + } + + public ResearchStudy addSite(Reference t) { //3 + if (t == null) + return this; + if (this.site == null) + this.site = new ArrayList(); + this.site.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #site}, creating it if it does not already exist + */ + public Reference getSiteFirstRep() { + if (getSite().isEmpty()) { + addSite(); + } + return getSite().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getSiteTarget() { + if (this.siteTarget == null) + this.siteTarget = new ArrayList(); + return this.siteTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public Location addSiteTarget() { + Location r = new Location(); + if (this.siteTarget == null) + this.siteTarget = new ArrayList(); + this.siteTarget.add(r); + return r; + } + + /** + * @return {@link #reasonStopped} (A description and/or code explaining the premature termination of the study.) + */ + public CodeableConcept getReasonStopped() { + if (this.reasonStopped == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchStudy.reasonStopped"); + else if (Configuration.doAutoCreate()) + this.reasonStopped = new CodeableConcept(); // cc + return this.reasonStopped; + } + + public boolean hasReasonStopped() { + return this.reasonStopped != null && !this.reasonStopped.isEmpty(); + } + + /** + * @param value {@link #reasonStopped} (A description and/or code explaining the premature termination of the study.) + */ + public ResearchStudy setReasonStopped(CodeableConcept value) { + this.reasonStopped = value; + return this; + } + + /** + * @return {@link #note} (Comments made about the event by the performer, subject or other participants.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setNote(List theNote) { + this.note = theNote; + return this; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (Annotation item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + public Annotation addNote() { //3 + Annotation t = new Annotation(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + public ResearchStudy addNote(Annotation t) { //3 + if (t == null) + return this; + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist + */ + public Annotation getNoteFirstRep() { + if (getNote().isEmpty()) { + addNote(); + } + return getNote().get(0); + } + + /** + * @return {@link #arm} (Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.) + */ + public List getArm() { + if (this.arm == null) + this.arm = new ArrayList(); + return this.arm; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public ResearchStudy setArm(List theArm) { + this.arm = theArm; + return this; + } + + public boolean hasArm() { + if (this.arm == null) + return false; + for (ResearchStudyArmComponent item : this.arm) + if (!item.isEmpty()) + return true; + return false; + } + + public ResearchStudyArmComponent addArm() { //3 + ResearchStudyArmComponent t = new ResearchStudyArmComponent(); + if (this.arm == null) + this.arm = new ArrayList(); + this.arm.add(t); + return t; + } + + public ResearchStudy addArm(ResearchStudyArmComponent t) { //3 + if (t == null) + return this; + if (this.arm == null) + this.arm = new ArrayList(); + this.arm.add(t); + return this; + } + + /** + * @return The first repetition of repeating field {@link #arm}, creating it if it does not already exist + */ + public ResearchStudyArmComponent getArmFirstRep() { + if (getArm().isEmpty()) { + addArm(); + } + return getArm().get(0); + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this research study by the sponsor or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("title", "string", "A short, descriptive user-friendly label for the study.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("protocol", "Reference(PlanDefinition)", "The set of steps expected to be performed as part of the execution of the study.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("partOf", "Reference(ResearchStudy)", "A larger research study of which this particular study is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf)); + childrenList.add(new Property("status", "code", "The current state of the study.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("category", "CodeableConcept", "Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("focus", "CodeableConcept", "The condition(s), medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.", 0, java.lang.Integer.MAX_VALUE, focus)); + childrenList.add(new Property("contact", "ContactDetail", "Contact details to assist a user in learning more about or engaging with the study.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("relatedArtifact", "RelatedArtifact", "Citations, references and other related documents.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact)); + childrenList.add(new Property("keyword", "CodeableConcept", "Key terms to aid in searching for or filtering the study.", 0, java.lang.Integer.MAX_VALUE, keyword)); + childrenList.add(new Property("jurisdiction", "CodeableConcept", "Indicates a country, state or other region where the study is taking place.", 0, java.lang.Integer.MAX_VALUE, jurisdiction)); + childrenList.add(new Property("description", "markdown", "A full description of how the study is being conducted.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("enrollment", "Reference(Group)", "Reference to a Group that defines the criteria for and quantity of subjects participating in the study. E.g. \" 200 female Europeans between the ages of 20 and 45 with early onset diabetes\".", 0, java.lang.Integer.MAX_VALUE, enrollment)); + childrenList.add(new Property("period", "Period", "Identifies the start date and the expected (or actual, depending on status) end date for the study.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("sponsor", "Reference(Organization)", "The organization responsible for the execution of the study.", 0, java.lang.Integer.MAX_VALUE, sponsor)); + childrenList.add(new Property("principalInvestigator", "Reference(Practitioner)", "Indicates the individual who has primary oversite of the execution of the study.", 0, java.lang.Integer.MAX_VALUE, principalInvestigator)); + childrenList.add(new Property("site", "Reference(Location)", "Clinic, hospital or other healthcare location that is participating in the study.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("reasonStopped", "CodeableConcept", "A description and/or code explaining the premature termination of the study.", 0, java.lang.Integer.MAX_VALUE, reasonStopped)); + childrenList.add(new Property("note", "Annotation", "Comments made about the event by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("arm", "", "Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.", 0, java.lang.Integer.MAX_VALUE, arm)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType + case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : this.protocol.toArray(new Base[this.protocol.size()]); // Reference + case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept + case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // CodeableConcept + case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail + case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact + case -814408215: /*keyword*/ return this.keyword == null ? new Base[0] : this.keyword.toArray(new Base[this.keyword.size()]); // CodeableConcept + case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept + case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType + case 116089604: /*enrollment*/ return this.enrollment == null ? new Base[0] : this.enrollment.toArray(new Base[this.enrollment.size()]); // Reference + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case -1998892262: /*sponsor*/ return this.sponsor == null ? new Base[0] : new Base[] {this.sponsor}; // Reference + case 1437117175: /*principalInvestigator*/ return this.principalInvestigator == null ? new Base[0] : new Base[] {this.principalInvestigator}; // Reference + case 3530567: /*site*/ return this.site == null ? new Base[0] : this.site.toArray(new Base[this.site.size()]); // Reference + case 1181369065: /*reasonStopped*/ return this.reasonStopped == null ? new Base[0] : new Base[] {this.reasonStopped}; // CodeableConcept + case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation + case 96860: /*arm*/ return this.arm == null ? new Base[0] : this.arm.toArray(new Base[this.arm.size()]); // ResearchStudyArmComponent + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case 110371416: // title + this.title = castToString(value); // StringType + break; + case -989163880: // protocol + this.getProtocol().add(castToReference(value)); // Reference + break; + case -995410646: // partOf + this.getPartOf().add(castToReference(value)); // Reference + break; + case -892481550: // status + this.status = new ResearchStudyStatusEnumFactory().fromType(value); // Enumeration + break; + case 50511102: // category + this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 97604824: // focus + this.getFocus().add(castToCodeableConcept(value)); // CodeableConcept + break; + case 951526432: // contact + this.getContact().add(castToContactDetail(value)); // ContactDetail + break; + case 666807069: // relatedArtifact + this.getRelatedArtifact().add(castToRelatedArtifact(value)); // RelatedArtifact + break; + case -814408215: // keyword + this.getKeyword().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -507075711: // jurisdiction + this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept + break; + case -1724546052: // description + this.description = castToMarkdown(value); // MarkdownType + break; + case 116089604: // enrollment + this.getEnrollment().add(castToReference(value)); // Reference + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case -1998892262: // sponsor + this.sponsor = castToReference(value); // Reference + break; + case 1437117175: // principalInvestigator + this.principalInvestigator = castToReference(value); // Reference + break; + case 3530567: // site + this.getSite().add(castToReference(value)); // Reference + break; + case 1181369065: // reasonStopped + this.reasonStopped = castToCodeableConcept(value); // CodeableConcept + break; + case 3387378: // note + this.getNote().add(castToAnnotation(value)); // Annotation + break; + case 96860: // arm + this.getArm().add((ResearchStudyArmComponent) value); // ResearchStudyArmComponent + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("title")) + this.title = castToString(value); // StringType + else if (name.equals("protocol")) + this.getProtocol().add(castToReference(value)); + else if (name.equals("partOf")) + this.getPartOf().add(castToReference(value)); + else if (name.equals("status")) + this.status = new ResearchStudyStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("category")) + this.getCategory().add(castToCodeableConcept(value)); + else if (name.equals("focus")) + this.getFocus().add(castToCodeableConcept(value)); + else if (name.equals("contact")) + this.getContact().add(castToContactDetail(value)); + else if (name.equals("relatedArtifact")) + this.getRelatedArtifact().add(castToRelatedArtifact(value)); + else if (name.equals("keyword")) + this.getKeyword().add(castToCodeableConcept(value)); + else if (name.equals("jurisdiction")) + this.getJurisdiction().add(castToCodeableConcept(value)); + else if (name.equals("description")) + this.description = castToMarkdown(value); // MarkdownType + else if (name.equals("enrollment")) + this.getEnrollment().add(castToReference(value)); + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("sponsor")) + this.sponsor = castToReference(value); // Reference + else if (name.equals("principalInvestigator")) + this.principalInvestigator = castToReference(value); // Reference + else if (name.equals("site")) + this.getSite().add(castToReference(value)); + else if (name.equals("reasonStopped")) + this.reasonStopped = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("note")) + this.getNote().add(castToAnnotation(value)); + else if (name.equals("arm")) + this.getArm().add((ResearchStudyArmComponent) value); + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return addIdentifier(); // Identifier + case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType + case -989163880: return addProtocol(); // Reference + case -995410646: return addPartOf(); // Reference + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case 50511102: return addCategory(); // CodeableConcept + case 97604824: return addFocus(); // CodeableConcept + case 951526432: return addContact(); // ContactDetail + case 666807069: return addRelatedArtifact(); // RelatedArtifact + case -814408215: return addKeyword(); // CodeableConcept + case -507075711: return addJurisdiction(); // CodeableConcept + case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // MarkdownType + case 116089604: return addEnrollment(); // Reference + case -991726143: return getPeriod(); // Period + case -1998892262: return getSponsor(); // Reference + case 1437117175: return getPrincipalInvestigator(); // Reference + case 3530567: return addSite(); // Reference + case 1181369065: return getReasonStopped(); // CodeableConcept + case 3387378: return addNote(); // Annotation + case 96860: return addArm(); // ResearchStudyArmComponent + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + return addIdentifier(); + } + else if (name.equals("title")) { + throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.title"); + } + else if (name.equals("protocol")) { + return addProtocol(); + } + else if (name.equals("partOf")) { + return addPartOf(); + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.status"); + } + else if (name.equals("category")) { + return addCategory(); + } + else if (name.equals("focus")) { + return addFocus(); + } + else if (name.equals("contact")) { + return addContact(); + } + else if (name.equals("relatedArtifact")) { + return addRelatedArtifact(); + } + else if (name.equals("keyword")) { + return addKeyword(); + } + else if (name.equals("jurisdiction")) { + return addJurisdiction(); + } + else if (name.equals("description")) { + throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.description"); + } + else if (name.equals("enrollment")) { + return addEnrollment(); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("sponsor")) { + this.sponsor = new Reference(); + return this.sponsor; + } + else if (name.equals("principalInvestigator")) { + this.principalInvestigator = new Reference(); + return this.principalInvestigator; + } + else if (name.equals("site")) { + return addSite(); + } + else if (name.equals("reasonStopped")) { + this.reasonStopped = new CodeableConcept(); + return this.reasonStopped; + } + else if (name.equals("note")) { + return addNote(); + } + else if (name.equals("arm")) { + return addArm(); + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ResearchStudy"; + + } + + public ResearchStudy copy() { + ResearchStudy dst = new ResearchStudy(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.title = title == null ? null : title.copy(); + if (protocol != null) { + dst.protocol = new ArrayList(); + for (Reference i : protocol) + dst.protocol.add(i.copy()); + }; + if (partOf != null) { + dst.partOf = new ArrayList(); + for (Reference i : partOf) + dst.partOf.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + if (category != null) { + dst.category = new ArrayList(); + for (CodeableConcept i : category) + dst.category.add(i.copy()); + }; + if (focus != null) { + dst.focus = new ArrayList(); + for (CodeableConcept i : focus) + dst.focus.add(i.copy()); + }; + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactDetail i : contact) + dst.contact.add(i.copy()); + }; + if (relatedArtifact != null) { + dst.relatedArtifact = new ArrayList(); + for (RelatedArtifact i : relatedArtifact) + dst.relatedArtifact.add(i.copy()); + }; + if (keyword != null) { + dst.keyword = new ArrayList(); + for (CodeableConcept i : keyword) + dst.keyword.add(i.copy()); + }; + if (jurisdiction != null) { + dst.jurisdiction = new ArrayList(); + for (CodeableConcept i : jurisdiction) + dst.jurisdiction.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (enrollment != null) { + dst.enrollment = new ArrayList(); + for (Reference i : enrollment) + dst.enrollment.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.sponsor = sponsor == null ? null : sponsor.copy(); + dst.principalInvestigator = principalInvestigator == null ? null : principalInvestigator.copy(); + if (site != null) { + dst.site = new ArrayList(); + for (Reference i : site) + dst.site.add(i.copy()); + }; + dst.reasonStopped = reasonStopped == null ? null : reasonStopped.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (Annotation i : note) + dst.note.add(i.copy()); + }; + if (arm != null) { + dst.arm = new ArrayList(); + for (ResearchStudyArmComponent i : arm) + dst.arm.add(i.copy()); + }; + return dst; + } + + protected ResearchStudy typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ResearchStudy)) + return false; + ResearchStudy o = (ResearchStudy) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true) && compareDeep(protocol, o.protocol, true) + && compareDeep(partOf, o.partOf, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) + && compareDeep(focus, o.focus, true) && compareDeep(contact, o.contact, true) && compareDeep(relatedArtifact, o.relatedArtifact, true) + && compareDeep(keyword, o.keyword, true) && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(description, o.description, true) + && compareDeep(enrollment, o.enrollment, true) && compareDeep(period, o.period, true) && compareDeep(sponsor, o.sponsor, true) + && compareDeep(principalInvestigator, o.principalInvestigator, true) && compareDeep(site, o.site, true) + && compareDeep(reasonStopped, o.reasonStopped, true) && compareDeep(note, o.note, true) && compareDeep(arm, o.arm, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ResearchStudy)) + return false; + ResearchStudy o = (ResearchStudy) other; + return compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(description, o.description, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, title, protocol + , partOf, status, category, focus, contact, relatedArtifact, keyword, jurisdiction + , description, enrollment, period, sponsor, principalInvestigator, site, reasonStopped + , note, arm); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ResearchStudy; + } + + /** + * Search parameter: date + *

+ * Description: When the study began and ended
+ * Type: date
+ * Path: ResearchStudy.period
+ *

+ */ + @SearchParamDefinition(name="date", path="ResearchStudy.period", description="When the study began and ended", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: When the study began and ended
+ * Type: date
+ * Path: ResearchStudy.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Business Identifer for study
+ * Type: token
+ * Path: ResearchStudy.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ResearchStudy.identifier", description="Business Identifer for study", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Business Identifer for study
+ * Type: token
+ * Path: ResearchStudy.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: partof + *

+ * Description: Part of larger study
+ * Type: reference
+ * Path: ResearchStudy.partOf
+ *

+ */ + @SearchParamDefinition(name="partof", path="ResearchStudy.partOf", description="Part of larger study", type="reference", target={ResearchStudy.class } ) + public static final String SP_PARTOF = "partof"; + /** + * Fluent Client search parameter constant for partof + *

+ * Description: Part of larger study
+ * Type: reference
+ * Path: ResearchStudy.partOf
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ResearchStudy:partof". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("ResearchStudy:partof").toLocked(); + + /** + * Search parameter: sponsor + *

+ * Description: Organization responsible for the study
+ * Type: reference
+ * Path: ResearchStudy.sponsor
+ *

+ */ + @SearchParamDefinition(name="sponsor", path="ResearchStudy.sponsor", description="Organization responsible for the study", type="reference", target={Organization.class } ) + public static final String SP_SPONSOR = "sponsor"; + /** + * Fluent Client search parameter constant for sponsor + *

+ * Description: Organization responsible for the study
+ * Type: reference
+ * Path: ResearchStudy.sponsor
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPONSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPONSOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ResearchStudy:sponsor". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SPONSOR = new ca.uhn.fhir.model.api.Include("ResearchStudy:sponsor").toLocked(); + + /** + * Search parameter: jurisdiction + *

+ * Description: Geographic region(s) for study
+ * Type: token
+ * Path: ResearchStudy.jurisdiction
+ *

+ */ + @SearchParamDefinition(name="jurisdiction", path="ResearchStudy.jurisdiction", description="Geographic region(s) for study", type="token" ) + public static final String SP_JURISDICTION = "jurisdiction"; + /** + * Fluent Client search parameter constant for jurisdiction + *

+ * Description: Geographic region(s) for study
+ * Type: token
+ * Path: ResearchStudy.jurisdiction
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION); + + /** + * Search parameter: focus + *

+ * Description: Drugs, devices, conditions, etc. under study
+ * Type: token
+ * Path: ResearchStudy.focus
+ *

+ */ + @SearchParamDefinition(name="focus", path="ResearchStudy.focus", description="Drugs, devices, conditions, etc. under study", type="token" ) + public static final String SP_FOCUS = "focus"; + /** + * Fluent Client search parameter constant for focus + *

+ * Description: Drugs, devices, conditions, etc. under study
+ * Type: token
+ * Path: ResearchStudy.focus
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam FOCUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FOCUS); + + /** + * Search parameter: principalinvestigator + *

+ * Description: Individual responsible for the study
+ * Type: reference
+ * Path: ResearchStudy.principalInvestigator
+ *

+ */ + @SearchParamDefinition(name="principalinvestigator", path="ResearchStudy.principalInvestigator", description="Individual responsible for the study", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } ) + public static final String SP_PRINCIPALINVESTIGATOR = "principalinvestigator"; + /** + * Fluent Client search parameter constant for principalinvestigator + *

+ * Description: Individual responsible for the study
+ * Type: reference
+ * Path: ResearchStudy.principalInvestigator
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRINCIPALINVESTIGATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRINCIPALINVESTIGATOR); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ResearchStudy:principalinvestigator". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PRINCIPALINVESTIGATOR = new ca.uhn.fhir.model.api.Include("ResearchStudy:principalinvestigator").toLocked(); + + /** + * Search parameter: title + *

+ * Description: Name for this study
+ * Type: string
+ * Path: ResearchStudy.title
+ *

+ */ + @SearchParamDefinition(name="title", path="ResearchStudy.title", description="Name for this study", type="string" ) + public static final String SP_TITLE = "title"; + /** + * Fluent Client search parameter constant for title + *

+ * Description: Name for this study
+ * Type: string
+ * Path: ResearchStudy.title
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); + + /** + * Search parameter: protocol + *

+ * Description: Steps followed in executing study
+ * Type: reference
+ * Path: ResearchStudy.protocol
+ *

+ */ + @SearchParamDefinition(name="protocol", path="ResearchStudy.protocol", description="Steps followed in executing study", type="reference", target={PlanDefinition.class } ) + public static final String SP_PROTOCOL = "protocol"; + /** + * Fluent Client search parameter constant for protocol + *

+ * Description: Steps followed in executing study
+ * Type: reference
+ * Path: ResearchStudy.protocol
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROTOCOL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROTOCOL); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ResearchStudy:protocol". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PROTOCOL = new ca.uhn.fhir.model.api.Include("ResearchStudy:protocol").toLocked(); + + /** + * Search parameter: site + *

+ * Description: Location involved in study execution
+ * Type: reference
+ * Path: ResearchStudy.site
+ *

+ */ + @SearchParamDefinition(name="site", path="ResearchStudy.site", description="Location involved in study execution", type="reference", target={Location.class } ) + public static final String SP_SITE = "site"; + /** + * Fluent Client search parameter constant for site + *

+ * Description: Location involved in study execution
+ * Type: reference
+ * Path: ResearchStudy.site
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SITE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SITE); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ResearchStudy:site". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SITE = new ca.uhn.fhir.model.api.Include("ResearchStudy:site").toLocked(); + + /** + * Search parameter: category + *

+ * Description: Classifications for the study
+ * Type: token
+ * Path: ResearchStudy.category
+ *

+ */ + @SearchParamDefinition(name="category", path="ResearchStudy.category", description="Classifications for the study", type="token" ) + public static final String SP_CATEGORY = "category"; + /** + * Fluent Client search parameter constant for category + *

+ * Description: Classifications for the study
+ * Type: token
+ * Path: ResearchStudy.category
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); + + /** + * Search parameter: keyword + *

+ * Description: Used to search for the study
+ * Type: token
+ * Path: ResearchStudy.keyword
+ *

+ */ + @SearchParamDefinition(name="keyword", path="ResearchStudy.keyword", description="Used to search for the study", type="token" ) + public static final String SP_KEYWORD = "keyword"; + /** + * Fluent Client search parameter constant for keyword + *

+ * Description: Used to search for the study
+ * Type: token
+ * Path: ResearchStudy.keyword
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam KEYWORD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KEYWORD); + + /** + * Search parameter: status + *

+ * Description: draft | in-progress | suspended | stopped | completed | entered-in-error
+ * Type: token
+ * Path: ResearchStudy.status
+ *

+ */ + @SearchParamDefinition(name="status", path="ResearchStudy.status", description="draft | in-progress | suspended | stopped | completed | entered-in-error", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: draft | in-progress | suspended | stopped | completed | entered-in-error
+ * Type: token
+ * Path: ResearchStudy.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResearchSubject.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResearchSubject.java new file mode 100644 index 00000000000..dea8ce5c799 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResearchSubject.java @@ -0,0 +1,922 @@ +package org.hl7.fhir.dstu3.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 6, 2016 09:42-0500 for FHIR v1.8.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.ChildOrder; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.Block; +import org.hl7.fhir.instance.model.api.*; +import org.hl7.fhir.exceptions.FHIRException; +/** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ +@ResourceDef(name="ResearchSubject", profile="http://hl7.org/fhir/Profile/ResearchSubject") +public class ResearchSubject extends DomainResource { + + public enum ResearchSubjectStatus { + /** + * The subject has been identified as a potential participant in the study but has not yet agreed to participate + */ + CANDIDATE, + /** + * The subject has agreed to participate in the study but has not yet begun performing any action within the study + */ + ENROLLED, + /** + * The subject is currently being monitored and/or subject to treatment as part of the study + */ + ACTIVE, + /** + * The subject has temporarily discontinued monitoring/treatment as part of the study + */ + SUSPENDED, + /** + * The subject has permanently ended participation in the study prior to completion of the intended monitoring/treatment + */ + WITHDRAWN, + /** + * All intended monitoring/treatment of the subject has been completed and their engagement with the study is now ended + */ + COMPLETED, + /** + * added to help the parsers with the generic types + */ + NULL; + public static ResearchSubjectStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("candidate".equals(codeString)) + return CANDIDATE; + if ("enrolled".equals(codeString)) + return ENROLLED; + if ("active".equals(codeString)) + return ACTIVE; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("withdrawn".equals(codeString)) + return WITHDRAWN; + if ("completed".equals(codeString)) + return COMPLETED; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown ResearchSubjectStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CANDIDATE: return "candidate"; + case ENROLLED: return "enrolled"; + case ACTIVE: return "active"; + case SUSPENDED: return "suspended"; + case WITHDRAWN: return "withdrawn"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CANDIDATE: return "http://hl7.org/fhir/research-subject-status"; + case ENROLLED: return "http://hl7.org/fhir/research-subject-status"; + case ACTIVE: return "http://hl7.org/fhir/research-subject-status"; + case SUSPENDED: return "http://hl7.org/fhir/research-subject-status"; + case WITHDRAWN: return "http://hl7.org/fhir/research-subject-status"; + case COMPLETED: return "http://hl7.org/fhir/research-subject-status"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CANDIDATE: return "The subject has been identified as a potential participant in the study but has not yet agreed to participate"; + case ENROLLED: return "The subject has agreed to participate in the study but has not yet begun performing any action within the study"; + case ACTIVE: return "The subject is currently being monitored and/or subject to treatment as part of the study"; + case SUSPENDED: return "The subject has temporarily discontinued monitoring/treatment as part of the study"; + case WITHDRAWN: return "The subject has permanently ended participation in the study prior to completion of the intended monitoring/treatment"; + case COMPLETED: return "All intended monitoring/treatment of the subject has been completed and their engagement with the study is now ended"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CANDIDATE: return "Candidate"; + case ENROLLED: return "Enrolled"; + case ACTIVE: return "Active"; + case SUSPENDED: return "Suspended"; + case WITHDRAWN: return "Withdrawn"; + case COMPLETED: return "Completed"; + default: return "?"; + } + } + } + + public static class ResearchSubjectStatusEnumFactory implements EnumFactory { + public ResearchSubjectStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("candidate".equals(codeString)) + return ResearchSubjectStatus.CANDIDATE; + if ("enrolled".equals(codeString)) + return ResearchSubjectStatus.ENROLLED; + if ("active".equals(codeString)) + return ResearchSubjectStatus.ACTIVE; + if ("suspended".equals(codeString)) + return ResearchSubjectStatus.SUSPENDED; + if ("withdrawn".equals(codeString)) + return ResearchSubjectStatus.WITHDRAWN; + if ("completed".equals(codeString)) + return ResearchSubjectStatus.COMPLETED; + throw new IllegalArgumentException("Unknown ResearchSubjectStatus code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("candidate".equals(codeString)) + return new Enumeration(this, ResearchSubjectStatus.CANDIDATE); + if ("enrolled".equals(codeString)) + return new Enumeration(this, ResearchSubjectStatus.ENROLLED); + if ("active".equals(codeString)) + return new Enumeration(this, ResearchSubjectStatus.ACTIVE); + if ("suspended".equals(codeString)) + return new Enumeration(this, ResearchSubjectStatus.SUSPENDED); + if ("withdrawn".equals(codeString)) + return new Enumeration(this, ResearchSubjectStatus.WITHDRAWN); + if ("completed".equals(codeString)) + return new Enumeration(this, ResearchSubjectStatus.COMPLETED); + throw new FHIRException("Unknown ResearchSubjectStatus code '"+codeString+"'"); + } + public String toCode(ResearchSubjectStatus code) { + if (code == ResearchSubjectStatus.CANDIDATE) + return "candidate"; + if (code == ResearchSubjectStatus.ENROLLED) + return "enrolled"; + if (code == ResearchSubjectStatus.ACTIVE) + return "active"; + if (code == ResearchSubjectStatus.SUSPENDED) + return "suspended"; + if (code == ResearchSubjectStatus.WITHDRAWN) + return "withdrawn"; + if (code == ResearchSubjectStatus.COMPLETED) + return "completed"; + return "?"; + } + public String toSystem(ResearchSubjectStatus code) { + return code.getSystem(); + } + } + + /** + * Identifiers assigned to this research study by the sponsor or other systems. + */ + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Business Identifer for event", formalDefinition="Identifiers assigned to this research study by the sponsor or other systems." ) + protected Identifier identifier; + + /** + * The current state of the event. + */ + @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Description(shortDefinition="candidate | enrolled | active | suspended | withdrawn | completed", formalDefinition="The current state of the event." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-subject-status") + protected Enumeration status; + + /** + * The dates the subject began and ended their participation in the study. + */ + @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Start and end of participation", formalDefinition="The dates the subject began and ended their participation in the study." ) + protected Period period; + + /** + * Reference to the study the subject is participating in. + */ + @Child(name = "study", type = {ResearchStudy.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Study subject is part of", formalDefinition="Reference to the study the subject is participating in." ) + protected Reference study; + + /** + * The actual object that is the target of the reference (Reference to the study the subject is participating in.) + */ + protected ResearchStudy studyTarget; + + /** + * The record of the person or animal who is involved in the study. + */ + @Child(name = "individual", type = {Patient.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who is part of study", formalDefinition="The record of the person or animal who is involved in the study." ) + protected Reference individual; + + /** + * The actual object that is the target of the reference (The record of the person or animal who is involved in the study.) + */ + protected Patient individualTarget; + + /** + * The name of the arm in the study the subject is expected to follow as part of this study. + */ + @Child(name = "assignedArm", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="What path should be followed", formalDefinition="The name of the arm in the study the subject is expected to follow as part of this study." ) + protected StringType assignedArm; + + /** + * The name of the arm in the study the subject actually followed as part of this study. + */ + @Child(name = "actualArm", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="What path was followed", formalDefinition="The name of the arm in the study the subject actually followed as part of this study." ) + protected StringType actualArm; + + /** + * A record of the patient's informed agreement to participate in the study. + */ + @Child(name = "consent", type = {Consent.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Agreement to participate in study", formalDefinition="A record of the patient's informed agreement to participate in the study." ) + protected Reference consent; + + /** + * The actual object that is the target of the reference (A record of the patient's informed agreement to participate in the study.) + */ + protected Consent consentTarget; + + private static final long serialVersionUID = -1730128953L; + + /** + * Constructor + */ + public ResearchSubject() { + super(); + } + + /** + * Constructor + */ + public ResearchSubject(Enumeration status, Reference study, Reference individual) { + super(); + this.status = status; + this.study = study; + this.individual = individual; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this research study by the sponsor or other systems.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); // cc + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifiers assigned to this research study by the sponsor or other systems.) + */ + public ResearchSubject setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (The current state of the event.). 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 ResearchSubject.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(new ResearchSubjectStatusEnumFactory()); // bb + 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 current state of the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ResearchSubject setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The current state of the event. + */ + public ResearchSubjectStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The current state of the event. + */ + public ResearchSubject setStatus(ResearchSubjectStatus value) { + if (this.status == null) + this.status = new Enumeration(new ResearchSubjectStatusEnumFactory()); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (The dates the subject began and ended their participation in the study.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); // cc + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The dates the subject began and ended their participation in the study.) + */ + public ResearchSubject setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #study} (Reference to the study the subject is participating in.) + */ + public Reference getStudy() { + if (this.study == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.study"); + else if (Configuration.doAutoCreate()) + this.study = new Reference(); // cc + return this.study; + } + + public boolean hasStudy() { + return this.study != null && !this.study.isEmpty(); + } + + /** + * @param value {@link #study} (Reference to the study the subject is participating in.) + */ + public ResearchSubject setStudy(Reference value) { + this.study = value; + return this; + } + + /** + * @return {@link #study} 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 study the subject is participating in.) + */ + public ResearchStudy getStudyTarget() { + if (this.studyTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.study"); + else if (Configuration.doAutoCreate()) + this.studyTarget = new ResearchStudy(); // aa + return this.studyTarget; + } + + /** + * @param value {@link #study} 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 study the subject is participating in.) + */ + public ResearchSubject setStudyTarget(ResearchStudy value) { + this.studyTarget = value; + return this; + } + + /** + * @return {@link #individual} (The record of the person or animal who is involved in the study.) + */ + public Reference getIndividual() { + if (this.individual == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.individual"); + else if (Configuration.doAutoCreate()) + this.individual = new Reference(); // cc + return this.individual; + } + + public boolean hasIndividual() { + return this.individual != null && !this.individual.isEmpty(); + } + + /** + * @param value {@link #individual} (The record of the person or animal who is involved in the study.) + */ + public ResearchSubject setIndividual(Reference value) { + this.individual = value; + return this; + } + + /** + * @return {@link #individual} 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 record of the person or animal who is involved in the study.) + */ + public Patient getIndividualTarget() { + if (this.individualTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.individual"); + else if (Configuration.doAutoCreate()) + this.individualTarget = new Patient(); // aa + return this.individualTarget; + } + + /** + * @param value {@link #individual} 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 record of the person or animal who is involved in the study.) + */ + public ResearchSubject setIndividualTarget(Patient value) { + this.individualTarget = value; + return this; + } + + /** + * @return {@link #assignedArm} (The name of the arm in the study the subject is expected to follow as part of this study.). This is the underlying object with id, value and extensions. The accessor "getAssignedArm" gives direct access to the value + */ + public StringType getAssignedArmElement() { + if (this.assignedArm == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.assignedArm"); + else if (Configuration.doAutoCreate()) + this.assignedArm = new StringType(); // bb + return this.assignedArm; + } + + public boolean hasAssignedArmElement() { + return this.assignedArm != null && !this.assignedArm.isEmpty(); + } + + public boolean hasAssignedArm() { + return this.assignedArm != null && !this.assignedArm.isEmpty(); + } + + /** + * @param value {@link #assignedArm} (The name of the arm in the study the subject is expected to follow as part of this study.). This is the underlying object with id, value and extensions. The accessor "getAssignedArm" gives direct access to the value + */ + public ResearchSubject setAssignedArmElement(StringType value) { + this.assignedArm = value; + return this; + } + + /** + * @return The name of the arm in the study the subject is expected to follow as part of this study. + */ + public String getAssignedArm() { + return this.assignedArm == null ? null : this.assignedArm.getValue(); + } + + /** + * @param value The name of the arm in the study the subject is expected to follow as part of this study. + */ + public ResearchSubject setAssignedArm(String value) { + if (Utilities.noString(value)) + this.assignedArm = null; + else { + if (this.assignedArm == null) + this.assignedArm = new StringType(); + this.assignedArm.setValue(value); + } + return this; + } + + /** + * @return {@link #actualArm} (The name of the arm in the study the subject actually followed as part of this study.). This is the underlying object with id, value and extensions. The accessor "getActualArm" gives direct access to the value + */ + public StringType getActualArmElement() { + if (this.actualArm == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.actualArm"); + else if (Configuration.doAutoCreate()) + this.actualArm = new StringType(); // bb + return this.actualArm; + } + + public boolean hasActualArmElement() { + return this.actualArm != null && !this.actualArm.isEmpty(); + } + + public boolean hasActualArm() { + return this.actualArm != null && !this.actualArm.isEmpty(); + } + + /** + * @param value {@link #actualArm} (The name of the arm in the study the subject actually followed as part of this study.). This is the underlying object with id, value and extensions. The accessor "getActualArm" gives direct access to the value + */ + public ResearchSubject setActualArmElement(StringType value) { + this.actualArm = value; + return this; + } + + /** + * @return The name of the arm in the study the subject actually followed as part of this study. + */ + public String getActualArm() { + return this.actualArm == null ? null : this.actualArm.getValue(); + } + + /** + * @param value The name of the arm in the study the subject actually followed as part of this study. + */ + public ResearchSubject setActualArm(String value) { + if (Utilities.noString(value)) + this.actualArm = null; + else { + if (this.actualArm == null) + this.actualArm = new StringType(); + this.actualArm.setValue(value); + } + return this; + } + + /** + * @return {@link #consent} (A record of the patient's informed agreement to participate in the study.) + */ + public Reference getConsent() { + if (this.consent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.consent"); + else if (Configuration.doAutoCreate()) + this.consent = new Reference(); // cc + return this.consent; + } + + public boolean hasConsent() { + return this.consent != null && !this.consent.isEmpty(); + } + + /** + * @param value {@link #consent} (A record of the patient's informed agreement to participate in the study.) + */ + public ResearchSubject setConsent(Reference value) { + this.consent = value; + return this; + } + + /** + * @return {@link #consent} 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 record of the patient's informed agreement to participate in the study.) + */ + public Consent getConsentTarget() { + if (this.consentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResearchSubject.consent"); + else if (Configuration.doAutoCreate()) + this.consentTarget = new Consent(); // aa + return this.consentTarget; + } + + /** + * @param value {@link #consent} 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 record of the patient's informed agreement to participate in the study.) + */ + public ResearchSubject setConsentTarget(Consent value) { + this.consentTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this research study by the sponsor or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "The current state of the event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "The dates the subject began and ended their participation in the study.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("study", "Reference(ResearchStudy)", "Reference to the study the subject is participating in.", 0, java.lang.Integer.MAX_VALUE, study)); + childrenList.add(new Property("individual", "Reference(Patient)", "The record of the person or animal who is involved in the study.", 0, java.lang.Integer.MAX_VALUE, individual)); + childrenList.add(new Property("assignedArm", "string", "The name of the arm in the study the subject is expected to follow as part of this study.", 0, java.lang.Integer.MAX_VALUE, assignedArm)); + childrenList.add(new Property("actualArm", "string", "The name of the arm in the study the subject actually followed as part of this study.", 0, java.lang.Integer.MAX_VALUE, actualArm)); + childrenList.add(new Property("consent", "Reference(Consent)", "A record of the patient's informed agreement to participate in the study.", 0, java.lang.Integer.MAX_VALUE, consent)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration + case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period + case 109776329: /*study*/ return this.study == null ? new Base[0] : new Base[] {this.study}; // Reference + case -46292327: /*individual*/ return this.individual == null ? new Base[0] : new Base[] {this.individual}; // Reference + case 1741912494: /*assignedArm*/ return this.assignedArm == null ? new Base[0] : new Base[] {this.assignedArm}; // StringType + case 528827886: /*actualArm*/ return this.actualArm == null ? new Base[0] : new Base[] {this.actualArm}; // StringType + case 951500826: /*consent*/ return this.consent == null ? new Base[0] : new Base[] {this.consent}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1618432855: // identifier + this.identifier = castToIdentifier(value); // Identifier + break; + case -892481550: // status + this.status = new ResearchSubjectStatusEnumFactory().fromType(value); // Enumeration + break; + case -991726143: // period + this.period = castToPeriod(value); // Period + break; + case 109776329: // study + this.study = castToReference(value); // Reference + break; + case -46292327: // individual + this.individual = castToReference(value); // Reference + break; + case 1741912494: // assignedArm + this.assignedArm = castToString(value); // StringType + break; + case 528827886: // actualArm + this.actualArm = castToString(value); // StringType + break; + case 951500826: // consent + this.consent = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("identifier")) + this.identifier = castToIdentifier(value); // Identifier + else if (name.equals("status")) + this.status = new ResearchSubjectStatusEnumFactory().fromType(value); // Enumeration + else if (name.equals("period")) + this.period = castToPeriod(value); // Period + else if (name.equals("study")) + this.study = castToReference(value); // Reference + else if (name.equals("individual")) + this.individual = castToReference(value); // Reference + else if (name.equals("assignedArm")) + this.assignedArm = castToString(value); // StringType + else if (name.equals("actualArm")) + this.actualArm = castToString(value); // StringType + else if (name.equals("consent")) + this.consent = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1618432855: return getIdentifier(); // Identifier + case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration + case -991726143: return getPeriod(); // Period + case 109776329: return getStudy(); // Reference + case -46292327: return getIndividual(); // Reference + case 1741912494: throw new FHIRException("Cannot make property assignedArm as it is not a complex type"); // StringType + case 528827886: throw new FHIRException("Cannot make property actualArm as it is not a complex type"); // StringType + case 951500826: return getConsent(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("identifier")) { + this.identifier = new Identifier(); + return this.identifier; + } + else if (name.equals("status")) { + throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.status"); + } + else if (name.equals("period")) { + this.period = new Period(); + return this.period; + } + else if (name.equals("study")) { + this.study = new Reference(); + return this.study; + } + else if (name.equals("individual")) { + this.individual = new Reference(); + return this.individual; + } + else if (name.equals("assignedArm")) { + throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.assignedArm"); + } + else if (name.equals("actualArm")) { + throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.actualArm"); + } + else if (name.equals("consent")) { + this.consent = new Reference(); + return this.consent; + } + else + return super.addChild(name); + } + + public String fhirType() { + return "ResearchSubject"; + + } + + public ResearchSubject copy() { + ResearchSubject dst = new ResearchSubject(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + dst.study = study == null ? null : study.copy(); + dst.individual = individual == null ? null : individual.copy(); + dst.assignedArm = assignedArm == null ? null : assignedArm.copy(); + dst.actualArm = actualArm == null ? null : actualArm.copy(); + dst.consent = consent == null ? null : consent.copy(); + return dst; + } + + protected ResearchSubject typedCopy() { + return copy(); + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof ResearchSubject)) + return false; + ResearchSubject o = (ResearchSubject) other; + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(period, o.period, true) + && compareDeep(study, o.study, true) && compareDeep(individual, o.individual, true) && compareDeep(assignedArm, o.assignedArm, true) + && compareDeep(actualArm, o.actualArm, true) && compareDeep(consent, o.consent, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof ResearchSubject)) + return false; + ResearchSubject o = (ResearchSubject) other; + return compareValues(status, o.status, true) && compareValues(assignedArm, o.assignedArm, true) && compareValues(actualArm, o.actualArm, true) + ; + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, period + , study, individual, assignedArm, actualArm, consent); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ResearchSubject; + } + + /** + * Search parameter: date + *

+ * Description: Start and end of participation
+ * Type: date
+ * Path: ResearchSubject.period
+ *

+ */ + @SearchParamDefinition(name="date", path="ResearchSubject.period", description="Start and end of participation", type="date" ) + public static final String SP_DATE = "date"; + /** + * Fluent Client search parameter constant for date + *

+ * Description: Start and end of participation
+ * Type: date
+ * Path: ResearchSubject.period
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); + + /** + * Search parameter: identifier + *

+ * Description: Business Identifer for event
+ * Type: token
+ * Path: ResearchSubject.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ResearchSubject.identifier", description="Business Identifer for event", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: Business Identifer for event
+ * Type: token
+ * Path: ResearchSubject.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter: individual + *

+ * Description: Who is part of study
+ * Type: reference
+ * Path: ResearchSubject.individual
+ *

+ */ + @SearchParamDefinition(name="individual", path="ResearchSubject.individual", description="Who is part of study", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } ) + public static final String SP_INDIVIDUAL = "individual"; + /** + * Fluent Client search parameter constant for individual + *

+ * Description: Who is part of study
+ * Type: reference
+ * Path: ResearchSubject.individual
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INDIVIDUAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INDIVIDUAL); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ResearchSubject:individual". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_INDIVIDUAL = new ca.uhn.fhir.model.api.Include("ResearchSubject:individual").toLocked(); + + /** + * Search parameter: patient + *

+ * Description: Who is part of study
+ * Type: reference
+ * Path: ResearchSubject.individual
+ *

+ */ + @SearchParamDefinition(name="patient", path="ResearchSubject.individual", description="Who is part of study", type="reference", target={Patient.class } ) + public static final String SP_PATIENT = "patient"; + /** + * Fluent Client search parameter constant for patient + *

+ * Description: Who is part of study
+ * Type: reference
+ * Path: ResearchSubject.individual
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "ResearchSubject:patient". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ResearchSubject:patient").toLocked(); + + /** + * Search parameter: status + *

+ * Description: candidate | enrolled | active | suspended | withdrawn | completed
+ * Type: token
+ * Path: ResearchSubject.status
+ *

+ */ + @SearchParamDefinition(name="status", path="ResearchSubject.status", description="candidate | enrolled | active | suspended | withdrawn | completed", type="token" ) + public static final String SP_STATUS = "status"; + /** + * Fluent Client search parameter constant for status + *

+ * Description: candidate | enrolled | active | suspended | withdrawn | completed
+ * Type: token
+ * Path: ResearchSubject.status
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Resource.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Resource.java index cc051cfa173..1384462da7a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Resource.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Resource.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResourceFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResourceFactory.java index 3af8dd4788e..42d679231eb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResourceFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResourceFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -44,6 +44,8 @@ public class ResourceFactory extends Factory { return new Account(); if ("DocumentManifest".equals(name)) return new DocumentManifest(); + if ("MessageDefinition".equals(name)) + return new MessageDefinition(); if ("Goal".equals(name)) return new Goal(); if ("Endpoint".equals(name)) @@ -58,6 +60,8 @@ public class ResourceFactory extends Factory { return new Medication(); if ("Measure".equals(name)) return new Measure(); + if ("ResearchSubject".equals(name)) + return new ResearchSubject(); if ("Subscription".equals(name)) return new Subscription(); if ("DocumentReference".equals(name)) @@ -134,6 +138,8 @@ public class ResourceFactory extends Factory { return new Questionnaire(); if ("ExplanationOfBenefit".equals(name)) return new ExplanationOfBenefit(); + if ("ResearchStudy".equals(name)) + return new ResearchStudy(); if ("Specimen".equals(name)) return new Specimen(); if ("AllergyIntolerance".equals(name)) @@ -346,6 +352,8 @@ public class ResourceFactory extends Factory { return new Account(); if ("DocumentManifest".equals(name)) return new DocumentManifest(); + if ("MessageDefinition".equals(name)) + return new MessageDefinition(); if ("Goal".equals(name)) return new Goal(); if ("Endpoint".equals(name)) @@ -360,6 +368,8 @@ public class ResourceFactory extends Factory { return new Medication(); if ("Measure".equals(name)) return new Measure(); + if ("ResearchSubject".equals(name)) + return new ResearchSubject(); if ("Subscription".equals(name)) return new Subscription(); if ("DocumentReference".equals(name)) @@ -436,6 +446,8 @@ public class ResourceFactory extends Factory { return new Questionnaire(); if ("ExplanationOfBenefit".equals(name)) return new ExplanationOfBenefit(); + if ("ResearchStudy".equals(name)) + return new ResearchStudy(); if ("Specimen".equals(name)) return new Specimen(); if ("AllergyIntolerance".equals(name)) diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResourceType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResourceType.java index 13d3184961a..aca3526e4f2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResourceType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ResourceType.java @@ -2,7 +2,7 @@ package org.hl7.fhir.dstu3.model; import org.hl7.fhir.exceptions.FHIRException; -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 public enum ResourceType { Account, @@ -74,6 +74,7 @@ public enum ResourceType { MedicationDispense, MedicationRequest, MedicationStatement, + MessageDefinition, MessageHeader, NamingSystem, NutritionRequest, @@ -99,6 +100,8 @@ public enum ResourceType { ReferralRequest, RelatedPerson, RequestGroup, + ResearchStudy, + ResearchSubject, RiskAssessment, Schedule, SearchParameter, @@ -259,6 +262,8 @@ public enum ResourceType { return "medicationrequest"; case MedicationStatement: return "medicationstatement"; + case MessageDefinition: + return "messagedefinition"; case MessageHeader: return "messageheader"; case NamingSystem: @@ -309,6 +314,10 @@ public enum ResourceType { return "relatedperson"; case RequestGroup: return "requestgroup"; + case ResearchStudy: + return "researchstudy"; + case ResearchSubject: + return "researchsubject"; case RiskAssessment: return "riskassessment"; case Schedule: @@ -489,6 +498,8 @@ public enum ResourceType { return MedicationRequest; if ("MedicationStatement".equals(code)) return MedicationStatement; + if ("MessageDefinition".equals(code)) + return MessageDefinition; if ("MessageHeader".equals(code)) return MessageHeader; if ("NamingSystem".equals(code)) @@ -539,6 +550,10 @@ public enum ResourceType { return RelatedPerson; if ("RequestGroup".equals(code)) return RequestGroup; + if ("ResearchStudy".equals(code)) + return ResearchStudy; + if ("ResearchSubject".equals(code)) + return ResearchSubject; if ("RiskAssessment".equals(code)) return RiskAssessment; if ("Schedule".equals(code)) diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RiskAssessment.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RiskAssessment.java index 143594eef80..a79a333868b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RiskAssessment.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/RiskAssessment.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SampledData.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SampledData.java index 31b9108647f..1a2d5cfe746 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SampledData.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SampledData.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Schedule.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Schedule.java index 737c0ae3b44..65feecd86f6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Schedule.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Schedule.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SearchParameter.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SearchParameter.java index 3b2383c796f..2be8c7d3bb8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SearchParameter.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SearchParameter.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -47,7 +47,7 @@ import org.hl7.fhir.exceptions.FHIRException; * A search parameter that defines a named search item that can be used to search/filter on a resource. */ @ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter") -@ChildOrder(names={"url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "purpose", "code", "base", "type", "description", "expression", "xpath", "xpathUsage", "target", "component"}) +@ChildOrder(names={"url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "purpose", "code", "base", "type", "derivedFrom", "description", "expression", "xpath", "xpathUsage", "target", "comparator", "modifier", "chain", "component"}) public class SearchParameter extends MetadataResource { public enum XPathUsageType { @@ -188,6 +188,657 @@ public class SearchParameter extends MetadataResource { } } + public enum SearchComparator { + /** + * the value for the parameter in the resource is equal to the provided value + */ + EQ, + /** + * the value for the parameter in the resource is not equal to the provided value + */ + NE, + /** + * the value for the parameter in the resource is greater than the provided value + */ + GT, + /** + * the value for the parameter in the resource is less than the provided value + */ + LT, + /** + * the value for the parameter in the resource is greater or equal to the provided value + */ + GE, + /** + * the value for the parameter in the resource is less or equal to the provided value + */ + LE, + /** + * the value for the parameter in the resource starts after the provided value + */ + SA, + /** + * the value for the parameter in the resource ends before the provided value + */ + EB, + /** + * the value for the parameter in the resource is approximately the same to the provided value. + */ + AP, + /** + * added to help the parsers with the generic types + */ + NULL; + public static SearchComparator fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("eq".equals(codeString)) + return EQ; + if ("ne".equals(codeString)) + return NE; + if ("gt".equals(codeString)) + return GT; + if ("lt".equals(codeString)) + return LT; + if ("ge".equals(codeString)) + return GE; + if ("le".equals(codeString)) + return LE; + if ("sa".equals(codeString)) + return SA; + if ("eb".equals(codeString)) + return EB; + if ("ap".equals(codeString)) + return AP; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown SearchComparator code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case EQ: return "eq"; + case NE: return "ne"; + case GT: return "gt"; + case LT: return "lt"; + case GE: return "ge"; + case LE: return "le"; + case SA: return "sa"; + case EB: return "eb"; + case AP: return "ap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EQ: return "http://hl7.org/fhir/search-comparator"; + case NE: return "http://hl7.org/fhir/search-comparator"; + case GT: return "http://hl7.org/fhir/search-comparator"; + case LT: return "http://hl7.org/fhir/search-comparator"; + case GE: return "http://hl7.org/fhir/search-comparator"; + case LE: return "http://hl7.org/fhir/search-comparator"; + case SA: return "http://hl7.org/fhir/search-comparator"; + case EB: return "http://hl7.org/fhir/search-comparator"; + case AP: return "http://hl7.org/fhir/search-comparator"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case EQ: return "the value for the parameter in the resource is equal to the provided value"; + case NE: return "the value for the parameter in the resource is not equal to the provided value"; + case GT: return "the value for the parameter in the resource is greater than the provided value"; + case LT: return "the value for the parameter in the resource is less than the provided value"; + case GE: return "the value for the parameter in the resource is greater or equal to the provided value"; + case LE: return "the value for the parameter in the resource is less or equal to the provided value"; + case SA: return "the value for the parameter in the resource starts after the provided value"; + case EB: return "the value for the parameter in the resource ends before the provided value"; + case AP: return "the value for the parameter in the resource is approximately the same to the provided value."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case EQ: return "Equals"; + case NE: return "Not Equals"; + case GT: return "Greater Than"; + case LT: return "Less Then"; + case GE: return "Greater or Equals"; + case LE: return "Less of Equal"; + case SA: return "Starts After"; + case EB: return "Ends Before"; + case AP: return "Approximately"; + default: return "?"; + } + } + } + + public static class SearchComparatorEnumFactory implements EnumFactory { + public SearchComparator fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("eq".equals(codeString)) + return SearchComparator.EQ; + if ("ne".equals(codeString)) + return SearchComparator.NE; + if ("gt".equals(codeString)) + return SearchComparator.GT; + if ("lt".equals(codeString)) + return SearchComparator.LT; + if ("ge".equals(codeString)) + return SearchComparator.GE; + if ("le".equals(codeString)) + return SearchComparator.LE; + if ("sa".equals(codeString)) + return SearchComparator.SA; + if ("eb".equals(codeString)) + return SearchComparator.EB; + if ("ap".equals(codeString)) + return SearchComparator.AP; + throw new IllegalArgumentException("Unknown SearchComparator code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("eq".equals(codeString)) + return new Enumeration(this, SearchComparator.EQ); + if ("ne".equals(codeString)) + return new Enumeration(this, SearchComparator.NE); + if ("gt".equals(codeString)) + return new Enumeration(this, SearchComparator.GT); + if ("lt".equals(codeString)) + return new Enumeration(this, SearchComparator.LT); + if ("ge".equals(codeString)) + return new Enumeration(this, SearchComparator.GE); + if ("le".equals(codeString)) + return new Enumeration(this, SearchComparator.LE); + if ("sa".equals(codeString)) + return new Enumeration(this, SearchComparator.SA); + if ("eb".equals(codeString)) + return new Enumeration(this, SearchComparator.EB); + if ("ap".equals(codeString)) + return new Enumeration(this, SearchComparator.AP); + throw new FHIRException("Unknown SearchComparator code '"+codeString+"'"); + } + public String toCode(SearchComparator code) { + if (code == SearchComparator.EQ) + return "eq"; + if (code == SearchComparator.NE) + return "ne"; + if (code == SearchComparator.GT) + return "gt"; + if (code == SearchComparator.LT) + return "lt"; + if (code == SearchComparator.GE) + return "ge"; + if (code == SearchComparator.LE) + return "le"; + if (code == SearchComparator.SA) + return "sa"; + if (code == SearchComparator.EB) + return "eb"; + if (code == SearchComparator.AP) + return "ap"; + return "?"; + } + public String toSystem(SearchComparator code) { + return code.getSystem(); + } + } + + public enum SearchModifierCode { + /** + * The search parameter returns resources that have a value or not. + */ + MISSING, + /** + * The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents). + */ + EXACT, + /** + * The search parameter returns resources that include the supplied parameter value anywhere within the field being searched. + */ + CONTAINS, + /** + * The search parameter returns resources that do not contain a match . + */ + NOT, + /** + * The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text. + */ + TEXT, + /** + * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set. + */ + IN, + /** + * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set. + */ + NOTIN, + /** + * The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships). + */ + BELOW, + /** + * The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships). + */ + ABOVE, + /** + * The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.). + */ + TYPE, + /** + * added to help the parsers with the generic types + */ + NULL; + public static SearchModifierCode fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("missing".equals(codeString)) + return MISSING; + if ("exact".equals(codeString)) + return EXACT; + if ("contains".equals(codeString)) + return CONTAINS; + if ("not".equals(codeString)) + return NOT; + if ("text".equals(codeString)) + return TEXT; + if ("in".equals(codeString)) + return IN; + if ("not-in".equals(codeString)) + return NOTIN; + if ("below".equals(codeString)) + return BELOW; + if ("above".equals(codeString)) + return ABOVE; + if ("type".equals(codeString)) + return TYPE; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MISSING: return "missing"; + case EXACT: return "exact"; + case CONTAINS: return "contains"; + case NOT: return "not"; + case TEXT: return "text"; + case IN: return "in"; + case NOTIN: return "not-in"; + case BELOW: return "below"; + case ABOVE: return "above"; + case TYPE: return "type"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MISSING: return "http://hl7.org/fhir/search-modifier-code"; + case EXACT: return "http://hl7.org/fhir/search-modifier-code"; + case CONTAINS: return "http://hl7.org/fhir/search-modifier-code"; + case NOT: return "http://hl7.org/fhir/search-modifier-code"; + case TEXT: return "http://hl7.org/fhir/search-modifier-code"; + case IN: return "http://hl7.org/fhir/search-modifier-code"; + case NOTIN: return "http://hl7.org/fhir/search-modifier-code"; + case BELOW: return "http://hl7.org/fhir/search-modifier-code"; + case ABOVE: return "http://hl7.org/fhir/search-modifier-code"; + case TYPE: return "http://hl7.org/fhir/search-modifier-code"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MISSING: return "The search parameter returns resources that have a value or not."; + case EXACT: return "The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents)."; + case CONTAINS: return "The search parameter returns resources that include the supplied parameter value anywhere within the field being searched."; + case NOT: return "The search parameter returns resources that do not contain a match ."; + case TEXT: return "The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text."; + case IN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set."; + case NOTIN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set."; + case BELOW: return "The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships)."; + case ABOVE: return "The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships)."; + case TYPE: return "The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MISSING: return "Missing"; + case EXACT: return "Exact"; + case CONTAINS: return "Contains"; + case NOT: return "Not"; + case TEXT: return "Text"; + case IN: return "In"; + case NOTIN: return "Not In"; + case BELOW: return "Below"; + case ABOVE: return "Above"; + case TYPE: return "Type"; + default: return "?"; + } + } + } + + public static class SearchModifierCodeEnumFactory implements EnumFactory { + public SearchModifierCode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("missing".equals(codeString)) + return SearchModifierCode.MISSING; + if ("exact".equals(codeString)) + return SearchModifierCode.EXACT; + if ("contains".equals(codeString)) + return SearchModifierCode.CONTAINS; + if ("not".equals(codeString)) + return SearchModifierCode.NOT; + if ("text".equals(codeString)) + return SearchModifierCode.TEXT; + if ("in".equals(codeString)) + return SearchModifierCode.IN; + if ("not-in".equals(codeString)) + return SearchModifierCode.NOTIN; + if ("below".equals(codeString)) + return SearchModifierCode.BELOW; + if ("above".equals(codeString)) + return SearchModifierCode.ABOVE; + if ("type".equals(codeString)) + return SearchModifierCode.TYPE; + throw new IllegalArgumentException("Unknown SearchModifierCode code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("missing".equals(codeString)) + return new Enumeration(this, SearchModifierCode.MISSING); + if ("exact".equals(codeString)) + return new Enumeration(this, SearchModifierCode.EXACT); + if ("contains".equals(codeString)) + return new Enumeration(this, SearchModifierCode.CONTAINS); + if ("not".equals(codeString)) + return new Enumeration(this, SearchModifierCode.NOT); + if ("text".equals(codeString)) + return new Enumeration(this, SearchModifierCode.TEXT); + if ("in".equals(codeString)) + return new Enumeration(this, SearchModifierCode.IN); + if ("not-in".equals(codeString)) + return new Enumeration(this, SearchModifierCode.NOTIN); + if ("below".equals(codeString)) + return new Enumeration(this, SearchModifierCode.BELOW); + if ("above".equals(codeString)) + return new Enumeration(this, SearchModifierCode.ABOVE); + if ("type".equals(codeString)) + return new Enumeration(this, SearchModifierCode.TYPE); + throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); + } + public String toCode(SearchModifierCode code) { + if (code == SearchModifierCode.MISSING) + return "missing"; + if (code == SearchModifierCode.EXACT) + return "exact"; + if (code == SearchModifierCode.CONTAINS) + return "contains"; + if (code == SearchModifierCode.NOT) + return "not"; + if (code == SearchModifierCode.TEXT) + return "text"; + if (code == SearchModifierCode.IN) + return "in"; + if (code == SearchModifierCode.NOTIN) + return "not-in"; + if (code == SearchModifierCode.BELOW) + return "below"; + if (code == SearchModifierCode.ABOVE) + return "above"; + if (code == SearchModifierCode.TYPE) + return "type"; + return "?"; + } + public String toSystem(SearchModifierCode code) { + return code.getSystem(); + } + } + + @Block() + public static class SearchParameterComponentComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The definition of the search parameter that describes this part. + */ + @Child(name = "definition", type = {SearchParameter.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Defines how the part works", formalDefinition="The definition of the search parameter that describes this part." ) + protected Reference definition; + + /** + * The actual object that is the target of the reference (The definition of the search parameter that describes this part.) + */ + protected SearchParameter definitionTarget; + + /** + * A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression. + */ + @Child(name = "expression", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) + @Description(shortDefinition="Subexpression relative to main expression", formalDefinition="A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression." ) + protected StringType expression; + + private static final long serialVersionUID = -1105563614L; + + /** + * Constructor + */ + public SearchParameterComponentComponent() { + super(); + } + + /** + * Constructor + */ + public SearchParameterComponentComponent(Reference definition, StringType expression) { + super(); + this.definition = definition; + this.expression = expression; + } + + /** + * @return {@link #definition} (The definition of the search parameter that describes this part.) + */ + public Reference getDefinition() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameterComponentComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new Reference(); // cc + return this.definition; + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (The definition of the search parameter that describes this part.) + */ + public SearchParameterComponentComponent setDefinition(Reference value) { + this.definition = value; + return this; + } + + /** + * @return {@link #definition} 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 definition of the search parameter that describes this part.) + */ + public SearchParameter getDefinitionTarget() { + if (this.definitionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameterComponentComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definitionTarget = new SearchParameter(); // aa + return this.definitionTarget; + } + + /** + * @param value {@link #definition} 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 definition of the search parameter that describes this part.) + */ + public SearchParameterComponentComponent setDefinitionTarget(SearchParameter value) { + this.definitionTarget = value; + return this; + } + + /** + * @return {@link #expression} (A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public StringType getExpressionElement() { + if (this.expression == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameterComponentComponent.expression"); + else if (Configuration.doAutoCreate()) + this.expression = new StringType(); // bb + return this.expression; + } + + public boolean hasExpressionElement() { + return this.expression != null && !this.expression.isEmpty(); + } + + public boolean hasExpression() { + return this.expression != null && !this.expression.isEmpty(); + } + + /** + * @param value {@link #expression} (A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value + */ + public SearchParameterComponentComponent setExpressionElement(StringType value) { + this.expression = value; + return this; + } + + /** + * @return A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression. + */ + public String getExpression() { + return this.expression == null ? null : this.expression.getValue(); + } + + /** + * @param value A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression. + */ + public SearchParameterComponentComponent setExpression(String value) { + if (this.expression == null) + this.expression = new StringType(); + this.expression.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("definition", "Reference(SearchParameter)", "The definition of the search parameter that describes this part.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("expression", "string", "A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.", 0, java.lang.Integer.MAX_VALUE, expression)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference + case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case -1014418093: // definition + this.definition = castToReference(value); // Reference + break; + case -1795452264: // expression + this.expression = castToString(value); // StringType + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("definition")) + this.definition = castToReference(value); // Reference + else if (name.equals("expression")) + this.expression = castToString(value); // StringType + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case -1014418093: return getDefinition(); // Reference + case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("definition")) { + this.definition = new Reference(); + return this.definition; + } + else if (name.equals("expression")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.expression"); + } + else + return super.addChild(name); + } + + public SearchParameterComponentComponent copy() { + SearchParameterComponentComponent dst = new SearchParameterComponentComponent(); + copyValues(dst); + dst.definition = definition == null ? null : definition.copy(); + dst.expression = expression == null ? null : expression.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof SearchParameterComponentComponent)) + return false; + SearchParameterComponentComponent o = (SearchParameterComponentComponent) other; + return compareDeep(definition, o.definition, true) && compareDeep(expression, o.expression, true) + ; + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof SearchParameterComponentComponent)) + return false; + SearchParameterComponentComponent o = (SearchParameterComponentComponent) other; + return compareValues(expression, o.expression, true); + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(definition, expression); + } + + public String fhirType() { + return "SearchParameter.component"; + + } + + } + /** * Explains why this search parameter is needed and why it has been designed as it has. */ @@ -203,12 +854,12 @@ public class SearchParameter extends MetadataResource { protected CodeType code; /** - * The base resource type that this search parameter refers to. + * The base resource type(s) that this search parameter can be used against. */ - @Child(name = "base", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The resource type this search parameter applies to", formalDefinition="The base resource type that this search parameter refers to." ) + @Child(name = "base", type = {CodeType.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="The resource type(s) this search parameter applies to", formalDefinition="The base resource type(s) that this search parameter can be used against." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types") - protected CodeType base; + protected List base; /** * The type of value a search parameter refers to, and how the content is interpreted. @@ -218,24 +869,31 @@ public class SearchParameter extends MetadataResource { @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-param-type") protected Enumeration type; + /** + * Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter. + */ + @Child(name = "derivedFrom", type = {UriType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Original Definition for the search parameter", formalDefinition="Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter." ) + protected UriType derivedFrom; + /** * A FluentPath expression that returns a set of elements for the search parameter. */ - @Child(name = "expression", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "expression", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="FluentPath expression that extracts the values", formalDefinition="A FluentPath expression that returns a set of elements for the search parameter." ) protected StringType expression; /** * An XPath expression that returns a set of elements for the search parameter. */ - @Child(name = "xpath", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "xpath", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="XPath that extracts the values", formalDefinition="An XPath expression that returns a set of elements for the search parameter." ) protected StringType xpath; /** * How the search parameter relates to the set of elements returned by evaluating the xpath query. */ - @Child(name = "xpathUsage", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) + @Child(name = "xpathUsage", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="normal | phonetic | nearby | distance | other", formalDefinition="How the search parameter relates to the set of elements returned by evaluating the xpath query." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-xpath-usage") protected Enumeration xpathUsage; @@ -243,24 +901,42 @@ public class SearchParameter extends MetadataResource { /** * Types of resource (if a resource is referenced). */ - @Child(name = "target", type = {CodeType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "target", type = {CodeType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types") protected List target; + /** + * Comparators supported for the search parameter. + */ + @Child(name = "comparator", type = {CodeType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="eq | ne | gt | lt | ge | le | sa | eb | ap", formalDefinition="Comparators supported for the search parameter." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-comparator") + protected List> comparator; + + /** + * A modifier supported for the search parameter. + */ + @Child(name = "modifier", type = {CodeType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="missing | exact | contains | not | text | in | not-in | below | above | type", formalDefinition="A modifier supported for the search parameter." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-modifier-code") + protected List> modifier; + + /** + * Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type. + */ + @Child(name = "chain", type = {StringType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Chained names supported", formalDefinition="Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type." ) + protected List chain; + /** * Used to define the parts of a composite search parameter. */ - @Child(name = "component", type = {SearchParameter.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "component", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="For Composite resources to define the parts", formalDefinition="Used to define the parts of a composite search parameter." ) - protected List component; - /** - * The actual objects that are the target of the reference (Used to define the parts of a composite search parameter.) - */ - protected List componentTarget; + protected List component; - - private static final long serialVersionUID = 295034946L; + private static final long serialVersionUID = -769368159L; /** * Constructor @@ -272,13 +948,12 @@ public class SearchParameter extends MetadataResource { /** * Constructor */ - public SearchParameter(UriType url, StringType name, Enumeration status, CodeType code, CodeType base, Enumeration type, MarkdownType description) { + public SearchParameter(UriType url, StringType name, Enumeration status, CodeType code, Enumeration type, MarkdownType description) { super(); this.url = url; this.name = name; this.status = status; this.code = code; - this.base = base; this.type = type; this.description = description; } @@ -864,48 +1539,64 @@ public class SearchParameter extends MetadataResource { } /** - * @return {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + * @return {@link #base} (The base resource type(s) that this search parameter can be used against.) */ - public CodeType getBaseElement() { + public List getBase() { if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.base"); - else if (Configuration.doAutoCreate()) - this.base = new CodeType(); // bb + this.base = new ArrayList(); return this.base; } - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); + /** + * @return Returns a reference to this for easy method chaining + */ + public SearchParameter setBase(List theBase) { + this.base = theBase; + return this; } public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); + if (this.base == null) + return false; + for (CodeType item : this.base) + if (!item.isEmpty()) + return true; + return false; } /** - * @param value {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + * @return {@link #base} (The base resource type(s) that this search parameter can be used against.) */ - public SearchParameter setBaseElement(CodeType value) { - this.base = value; + public CodeType addBaseElement() {//2 + CodeType t = new CodeType(); + if (this.base == null) + this.base = new ArrayList(); + this.base.add(t); + return t; + } + + /** + * @param value {@link #base} (The base resource type(s) that this search parameter can be used against.) + */ + public SearchParameter addBase(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.base == null) + this.base = new ArrayList(); + this.base.add(t); return this; } /** - * @return The base resource type that this search parameter refers to. + * @param value {@link #base} (The base resource type(s) that this search parameter can be used against.) */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The base resource type that this search parameter refers to. - */ - public SearchParameter setBase(String value) { - if (this.base == null) - this.base = new CodeType(); - this.base.setValue(value); - return this; + public boolean hasBase(String value) { + if (this.base == null) + return false; + for (CodeType v : this.base) + if (v.equals(value)) // code + return true; + return false; } /** @@ -953,6 +1644,55 @@ public class SearchParameter extends MetadataResource { return this; } + /** + * @return {@link #derivedFrom} (Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.). This is the underlying object with id, value and extensions. The accessor "getDerivedFrom" gives direct access to the value + */ + public UriType getDerivedFromElement() { + if (this.derivedFrom == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.derivedFrom"); + else if (Configuration.doAutoCreate()) + this.derivedFrom = new UriType(); // bb + return this.derivedFrom; + } + + public boolean hasDerivedFromElement() { + return this.derivedFrom != null && !this.derivedFrom.isEmpty(); + } + + public boolean hasDerivedFrom() { + return this.derivedFrom != null && !this.derivedFrom.isEmpty(); + } + + /** + * @param value {@link #derivedFrom} (Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.). This is the underlying object with id, value and extensions. The accessor "getDerivedFrom" gives direct access to the value + */ + public SearchParameter setDerivedFromElement(UriType value) { + this.derivedFrom = value; + return this; + } + + /** + * @return Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter. + */ + public String getDerivedFrom() { + return this.derivedFrom == null ? null : this.derivedFrom.getValue(); + } + + /** + * @param value Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter. + */ + public SearchParameter setDerivedFrom(String value) { + if (Utilities.noString(value)) + this.derivedFrom = null; + else { + if (this.derivedFrom == null) + this.derivedFrom = new UriType(); + this.derivedFrom.setValue(value); + } + return this; + } + /** * @return {@link #description} (A free text natural language description of the search parameter from the consumer's perspective. and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value */ @@ -1206,19 +1946,202 @@ public class SearchParameter extends MetadataResource { return false; } + /** + * @return {@link #comparator} (Comparators supported for the search parameter.) + */ + public List> getComparator() { + if (this.comparator == null) + this.comparator = new ArrayList>(); + return this.comparator; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public SearchParameter setComparator(List> theComparator) { + this.comparator = theComparator; + return this; + } + + public boolean hasComparator() { + if (this.comparator == null) + return false; + for (Enumeration item : this.comparator) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #comparator} (Comparators supported for the search parameter.) + */ + public Enumeration addComparatorElement() {//2 + Enumeration t = new Enumeration(new SearchComparatorEnumFactory()); + if (this.comparator == null) + this.comparator = new ArrayList>(); + this.comparator.add(t); + return t; + } + + /** + * @param value {@link #comparator} (Comparators supported for the search parameter.) + */ + public SearchParameter addComparator(SearchComparator value) { //1 + Enumeration t = new Enumeration(new SearchComparatorEnumFactory()); + t.setValue(value); + if (this.comparator == null) + this.comparator = new ArrayList>(); + this.comparator.add(t); + return this; + } + + /** + * @param value {@link #comparator} (Comparators supported for the search parameter.) + */ + public boolean hasComparator(SearchComparator value) { + if (this.comparator == null) + return false; + for (Enumeration v : this.comparator) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #modifier} (A modifier supported for the search parameter.) + */ + public List> getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList>(); + return this.modifier; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public SearchParameter setModifier(List> theModifier) { + this.modifier = theModifier; + return this; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Enumeration item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (A modifier supported for the search parameter.) + */ + public Enumeration addModifierElement() {//2 + Enumeration t = new Enumeration(new SearchModifierCodeEnumFactory()); + if (this.modifier == null) + this.modifier = new ArrayList>(); + this.modifier.add(t); + return t; + } + + /** + * @param value {@link #modifier} (A modifier supported for the search parameter.) + */ + public SearchParameter addModifier(SearchModifierCode value) { //1 + Enumeration t = new Enumeration(new SearchModifierCodeEnumFactory()); + t.setValue(value); + if (this.modifier == null) + this.modifier = new ArrayList>(); + this.modifier.add(t); + return this; + } + + /** + * @param value {@link #modifier} (A modifier supported for the search parameter.) + */ + public boolean hasModifier(SearchModifierCode value) { + if (this.modifier == null) + return false; + for (Enumeration v : this.modifier) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.) + */ + public List getChain() { + if (this.chain == null) + this.chain = new ArrayList(); + return this.chain; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public SearchParameter setChain(List theChain) { + this.chain = theChain; + return this; + } + + public boolean hasChain() { + if (this.chain == null) + return false; + for (StringType item : this.chain) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.) + */ + public StringType addChainElement() {//2 + StringType t = new StringType(); + if (this.chain == null) + this.chain = new ArrayList(); + this.chain.add(t); + return t; + } + + /** + * @param value {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.) + */ + public SearchParameter addChain(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.chain == null) + this.chain = new ArrayList(); + this.chain.add(t); + return this; + } + + /** + * @param value {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.) + */ + public boolean hasChain(String value) { + if (this.chain == null) + return false; + for (StringType v : this.chain) + if (v.equals(value)) // string + return true; + return false; + } + /** * @return {@link #component} (Used to define the parts of a composite search parameter.) */ - public List getComponent() { + public List getComponent() { if (this.component == null) - this.component = new ArrayList(); + this.component = new ArrayList(); return this.component; } /** * @return Returns a reference to this for easy method chaining */ - public SearchParameter setComponent(List theComponent) { + public SearchParameter setComponent(List theComponent) { this.component = theComponent; return this; } @@ -1226,25 +2149,25 @@ public class SearchParameter extends MetadataResource { public boolean hasComponent() { if (this.component == null) return false; - for (Reference item : this.component) + for (SearchParameterComponentComponent item : this.component) if (!item.isEmpty()) return true; return false; } - public Reference addComponent() { //3 - Reference t = new Reference(); + public SearchParameterComponentComponent addComponent() { //3 + SearchParameterComponentComponent t = new SearchParameterComponentComponent(); if (this.component == null) - this.component = new ArrayList(); + this.component = new ArrayList(); this.component.add(t); return t; } - public SearchParameter addComponent(Reference t) { //3 + public SearchParameter addComponent(SearchParameterComponentComponent t) { //3 if (t == null) return this; if (this.component == null) - this.component = new ArrayList(); + this.component = new ArrayList(); this.component.add(t); return this; } @@ -1252,35 +2175,13 @@ public class SearchParameter extends MetadataResource { /** * @return The first repetition of repeating field {@link #component}, creating it if it does not already exist */ - public Reference getComponentFirstRep() { + public SearchParameterComponentComponent getComponentFirstRep() { if (getComponent().isEmpty()) { addComponent(); } return getComponent().get(0); } - /** - * @deprecated Use Reference#setResource(IBaseResource) instead - */ - @Deprecated - public List getComponentTarget() { - if (this.componentTarget == null) - this.componentTarget = new ArrayList(); - return this.componentTarget; - } - - /** - * @deprecated Use Reference#setResource(IBaseResource) instead - */ - @Deprecated - public SearchParameter addComponentTarget() { - SearchParameter r = new SearchParameter(); - if (this.componentTarget == null) - this.componentTarget = new ArrayList(); - this.componentTarget.add(r); - return r; - } - protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published. The URL SHOULD include the major version of the search parameter. For more information see [Technical and Business Versions](resource.html#versions).", 0, java.lang.Integer.MAX_VALUE, url)); @@ -1295,14 +2196,18 @@ public class SearchParameter extends MetadataResource { childrenList.add(new Property("jurisdiction", "CodeableConcept", "A jurisdiction in which the search parameter is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction)); childrenList.add(new Property("purpose", "markdown", "Explains why this search parameter is needed and why it has been designed as it has.", 0, java.lang.Integer.MAX_VALUE, purpose)); childrenList.add(new Property("code", "code", "The code used in the URL or the parameter name in a parameters resource for this search parameter.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("base", "code", "The base resource type that this search parameter refers to.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("base", "code", "The base resource type(s) that this search parameter can be used against.", 0, java.lang.Integer.MAX_VALUE, base)); childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("derivedFrom", "uri", "Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.", 0, java.lang.Integer.MAX_VALUE, derivedFrom)); childrenList.add(new Property("description", "markdown", "A free text natural language description of the search parameter from the consumer's perspective. and how it used.", 0, java.lang.Integer.MAX_VALUE, description)); childrenList.add(new Property("expression", "string", "A FluentPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, expression)); childrenList.add(new Property("xpath", "string", "An XPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, xpath)); childrenList.add(new Property("xpathUsage", "code", "How the search parameter relates to the set of elements returned by evaluating the xpath query.", 0, java.lang.Integer.MAX_VALUE, xpathUsage)); childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("component", "Reference(SearchParameter)", "Used to define the parts of a composite search parameter.", 0, java.lang.Integer.MAX_VALUE, component)); + childrenList.add(new Property("comparator", "code", "Comparators supported for the search parameter.", 0, java.lang.Integer.MAX_VALUE, comparator)); + childrenList.add(new Property("modifier", "code", "A modifier supported for the search parameter.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("chain", "string", "Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.", 0, java.lang.Integer.MAX_VALUE, chain)); + childrenList.add(new Property("component", "", "Used to define the parts of a composite search parameter.", 0, java.lang.Integer.MAX_VALUE, component)); } @Override @@ -1320,14 +2225,18 @@ public class SearchParameter extends MetadataResource { case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // CodeType + case 3016401: /*base*/ return this.base == null ? new Base[0] : this.base.toArray(new Base[this.base.size()]); // CodeType case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration + case 1077922663: /*derivedFrom*/ return this.derivedFrom == null ? new Base[0] : new Base[] {this.derivedFrom}; // UriType case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType case 114256029: /*xpath*/ return this.xpath == null ? new Base[0] : new Base[] {this.xpath}; // StringType case 1801322244: /*xpathUsage*/ return this.xpathUsage == null ? new Base[0] : new Base[] {this.xpathUsage}; // Enumeration case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // CodeType - case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // Reference + case -844673834: /*comparator*/ return this.comparator == null ? new Base[0] : this.comparator.toArray(new Base[this.comparator.size()]); // Enumeration + case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Enumeration + case 94623425: /*chain*/ return this.chain == null ? new Base[0] : this.chain.toArray(new Base[this.chain.size()]); // StringType + case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // SearchParameterComponentComponent default: return super.getProperty(hash, name, checkValid); } @@ -1373,11 +2282,14 @@ public class SearchParameter extends MetadataResource { this.code = castToCode(value); // CodeType break; case 3016401: // base - this.base = castToCode(value); // CodeType + this.getBase().add(castToCode(value)); // CodeType break; case 3575610: // type this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration break; + case 1077922663: // derivedFrom + this.derivedFrom = castToUri(value); // UriType + break; case -1724546052: // description this.description = castToMarkdown(value); // MarkdownType break; @@ -1393,8 +2305,17 @@ public class SearchParameter extends MetadataResource { case -880905839: // target this.getTarget().add(castToCode(value)); // CodeType break; + case -844673834: // comparator + this.getComparator().add(new SearchComparatorEnumFactory().fromType(value)); // Enumeration + break; + case -615513385: // modifier + this.getModifier().add(new SearchModifierCodeEnumFactory().fromType(value)); // Enumeration + break; + case 94623425: // chain + this.getChain().add(castToString(value)); // StringType + break; case -1399907075: // component - this.getComponent().add(castToReference(value)); // Reference + this.getComponent().add((SearchParameterComponentComponent) value); // SearchParameterComponentComponent break; default: super.setProperty(hash, name, value); } @@ -1428,9 +2349,11 @@ public class SearchParameter extends MetadataResource { else if (name.equals("code")) this.code = castToCode(value); // CodeType else if (name.equals("base")) - this.base = castToCode(value); // CodeType + this.getBase().add(castToCode(value)); else if (name.equals("type")) this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("derivedFrom")) + this.derivedFrom = castToUri(value); // UriType else if (name.equals("description")) this.description = castToMarkdown(value); // MarkdownType else if (name.equals("expression")) @@ -1441,8 +2364,14 @@ public class SearchParameter extends MetadataResource { this.xpathUsage = new XPathUsageTypeEnumFactory().fromType(value); // Enumeration else if (name.equals("target")) this.getTarget().add(castToCode(value)); + else if (name.equals("comparator")) + this.getComparator().add(new SearchComparatorEnumFactory().fromType(value)); + else if (name.equals("modifier")) + this.getModifier().add(new SearchModifierCodeEnumFactory().fromType(value)); + else if (name.equals("chain")) + this.getChain().add(castToString(value)); else if (name.equals("component")) - this.getComponent().add(castToReference(value)); + this.getComponent().add((SearchParameterComponentComponent) value); else super.setProperty(name, value); } @@ -1464,12 +2393,16 @@ public class SearchParameter extends MetadataResource { case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType case 3016401: throw new FHIRException("Cannot make property base as it is not a complex type"); // CodeType case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration + case 1077922663: throw new FHIRException("Cannot make property derivedFrom as it is not a complex type"); // UriType case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // MarkdownType case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType case 114256029: throw new FHIRException("Cannot make property xpath as it is not a complex type"); // StringType case 1801322244: throw new FHIRException("Cannot make property xpathUsage as it is not a complex type"); // Enumeration case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // CodeType - case -1399907075: return addComponent(); // Reference + case -844673834: throw new FHIRException("Cannot make property comparator as it is not a complex type"); // Enumeration + case -615513385: throw new FHIRException("Cannot make property modifier as it is not a complex type"); // Enumeration + case 94623425: throw new FHIRException("Cannot make property chain as it is not a complex type"); // StringType + case -1399907075: return addComponent(); // SearchParameterComponentComponent default: return super.makeProperty(hash, name); } @@ -1519,6 +2452,9 @@ public class SearchParameter extends MetadataResource { else if (name.equals("type")) { throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.type"); } + else if (name.equals("derivedFrom")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.derivedFrom"); + } else if (name.equals("description")) { throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.description"); } @@ -1534,6 +2470,15 @@ public class SearchParameter extends MetadataResource { else if (name.equals("target")) { throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.target"); } + else if (name.equals("comparator")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.comparator"); + } + else if (name.equals("modifier")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.modifier"); + } + else if (name.equals("chain")) { + throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.chain"); + } else if (name.equals("component")) { return addComponent(); } @@ -1573,8 +2518,13 @@ public class SearchParameter extends MetadataResource { }; dst.purpose = purpose == null ? null : purpose.copy(); dst.code = code == null ? null : code.copy(); - dst.base = base == null ? null : base.copy(); + if (base != null) { + dst.base = new ArrayList(); + for (CodeType i : base) + dst.base.add(i.copy()); + }; dst.type = type == null ? null : type.copy(); + dst.derivedFrom = derivedFrom == null ? null : derivedFrom.copy(); dst.description = description == null ? null : description.copy(); dst.expression = expression == null ? null : expression.copy(); dst.xpath = xpath == null ? null : xpath.copy(); @@ -1584,9 +2534,24 @@ public class SearchParameter extends MetadataResource { for (CodeType i : target) dst.target.add(i.copy()); }; + if (comparator != null) { + dst.comparator = new ArrayList>(); + for (Enumeration i : comparator) + dst.comparator.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList>(); + for (Enumeration i : modifier) + dst.modifier.add(i.copy()); + }; + if (chain != null) { + dst.chain = new ArrayList(); + for (StringType i : chain) + dst.chain.add(i.copy()); + }; if (component != null) { - dst.component = new ArrayList(); - for (Reference i : component) + dst.component = new ArrayList(); + for (SearchParameterComponentComponent i : component) dst.component.add(i.copy()); }; return dst; @@ -1604,9 +2569,10 @@ public class SearchParameter extends MetadataResource { return false; SearchParameter o = (SearchParameter) other; return compareDeep(purpose, o.purpose, true) && compareDeep(code, o.code, true) && compareDeep(base, o.base, true) - && compareDeep(type, o.type, true) && compareDeep(expression, o.expression, true) && compareDeep(xpath, o.xpath, true) - && compareDeep(xpathUsage, o.xpathUsage, true) && compareDeep(target, o.target, true) && compareDeep(component, o.component, true) - ; + && compareDeep(type, o.type, true) && compareDeep(derivedFrom, o.derivedFrom, true) && compareDeep(expression, o.expression, true) + && compareDeep(xpath, o.xpath, true) && compareDeep(xpathUsage, o.xpathUsage, true) && compareDeep(target, o.target, true) + && compareDeep(comparator, o.comparator, true) && compareDeep(modifier, o.modifier, true) && compareDeep(chain, o.chain, true) + && compareDeep(component, o.component, true); } @Override @@ -1617,13 +2583,16 @@ public class SearchParameter extends MetadataResource { return false; SearchParameter o = (SearchParameter) other; return compareValues(purpose, o.purpose, true) && compareValues(code, o.code, true) && compareValues(base, o.base, true) - && compareValues(type, o.type, true) && compareValues(expression, o.expression, true) && compareValues(xpath, o.xpath, true) - && compareValues(xpathUsage, o.xpathUsage, true) && compareValues(target, o.target, true); + && compareValues(type, o.type, true) && compareValues(derivedFrom, o.derivedFrom, true) && compareValues(expression, o.expression, true) + && compareValues(xpath, o.xpath, true) && compareValues(xpathUsage, o.xpathUsage, true) && compareValues(target, o.target, true) + && compareValues(comparator, o.comparator, true) && compareValues(modifier, o.modifier, true) && compareValues(chain, o.chain, true) + ; } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(purpose, code, base, type - , expression, xpath, xpathUsage, target, component); + , derivedFrom, expression, xpath, xpathUsage, target, comparator, modifier, chain + , component); } @Override @@ -1711,6 +2680,26 @@ public class SearchParameter extends MetadataResource { */ public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); + /** + * Search parameter: derived-from + *

+ * Description: Original Definition for the search parameter
+ * Type: uri
+ * Path: SearchParameter.derivedFrom
+ *

+ */ + @SearchParamDefinition(name="derived-from", path="SearchParameter.derivedFrom", description="Original Definition for the search parameter", type="uri" ) + public static final String SP_DERIVED_FROM = "derived-from"; + /** + * Fluent Client search parameter constant for derived-from + *

+ * Description: Original Definition for the search parameter
+ * Type: uri
+ * Path: SearchParameter.derivedFrom
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.UriClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DERIVED_FROM); + /** * Search parameter: type *

@@ -1794,19 +2783,19 @@ public class SearchParameter extends MetadataResource { /** * Search parameter: component *

- * Description: For Composite resources to define the parts
+ * Description: Defines how the part works
* Type: reference
- * Path: SearchParameter.component
+ * Path: SearchParameter.component.definition
*

*/ - @SearchParamDefinition(name="component", path="SearchParameter.component", description="For Composite resources to define the parts", type="reference", target={SearchParameter.class } ) + @SearchParamDefinition(name="component", path="SearchParameter.component.definition", description="Defines how the part works", type="reference", target={SearchParameter.class } ) public static final String SP_COMPONENT = "component"; /** * Fluent Client search parameter constant for component *

- * Description: For Composite resources to define the parts
+ * Description: Defines how the part works
* Type: reference
- * Path: SearchParameter.component
+ * Path: SearchParameter.component.definition
*

*/ public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPONENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COMPONENT); @@ -1880,17 +2869,17 @@ public class SearchParameter extends MetadataResource { /** * Search parameter: base *

- * Description: The resource type this search parameter applies to
+ * Description: The resource type(s) this search parameter applies to
* Type: token
* Path: SearchParameter.base
*

*/ - @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type this search parameter applies to", type="token" ) + @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type(s) this search parameter applies to", type="token" ) public static final String SP_BASE = "base"; /** * Fluent Client search parameter constant for base *

- * Description: The resource type this search parameter applies to
+ * Description: The resource type(s) this search parameter applies to
* Type: token
* Path: SearchParameter.base
*

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Sequence.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Sequence.java index 9064874700a..8e18d14bcca 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Sequence.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Sequence.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -155,6 +155,250 @@ public class Sequence extends DomainResource { } } + public enum QualityType { + /** + * INDEL Comparison + */ + INDEL, + /** + * SNP Comparison + */ + SNP, + /** + * UNKNOWN Comparison + */ + UNKNOWN, + /** + * added to help the parsers with the generic types + */ + NULL; + public static QualityType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("INDEL".equals(codeString)) + return INDEL; + if ("SNP".equals(codeString)) + return SNP; + if ("UNKNOWN".equals(codeString)) + return UNKNOWN; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown QualityType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INDEL: return "INDEL"; + case SNP: return "SNP"; + case UNKNOWN: return "UNKNOWN"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INDEL: return "http://hl7.org/fhir/quality-type"; + case SNP: return "http://hl7.org/fhir/quality-type"; + case UNKNOWN: return "http://hl7.org/fhir/quality-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INDEL: return "INDEL Comparison"; + case SNP: return "SNP Comparison"; + case UNKNOWN: return "UNKNOWN Comparison"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INDEL: return "INDEL Comparison"; + case SNP: return "SNP Comparison"; + case UNKNOWN: return "UNKNOWN Comparison"; + default: return "?"; + } + } + } + + public static class QualityTypeEnumFactory implements EnumFactory { + public QualityType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("INDEL".equals(codeString)) + return QualityType.INDEL; + if ("SNP".equals(codeString)) + return QualityType.SNP; + if ("UNKNOWN".equals(codeString)) + return QualityType.UNKNOWN; + throw new IllegalArgumentException("Unknown QualityType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("INDEL".equals(codeString)) + return new Enumeration(this, QualityType.INDEL); + if ("SNP".equals(codeString)) + return new Enumeration(this, QualityType.SNP); + if ("UNKNOWN".equals(codeString)) + return new Enumeration(this, QualityType.UNKNOWN); + throw new FHIRException("Unknown QualityType code '"+codeString+"'"); + } + public String toCode(QualityType code) { + if (code == QualityType.INDEL) + return "INDEL"; + if (code == QualityType.SNP) + return "SNP"; + if (code == QualityType.UNKNOWN) + return "UNKNOWN"; + return "?"; + } + public String toSystem(QualityType code) { + return code.getSystem(); + } + } + + public enum RepositoryType { + /** + * When url is clicked, the resource can be seen directly (by webpage or by download link format) + */ + DIRECTLINK, + /** + * When the api method (e.g. [base_url]/[parameter]) related with the url website is executed, the resource can be seen directly (usually in json or xml format) + */ + OPENAPI, + /** + * When logged into the website, the resource can be seen. + */ + LOGIN, + /** + * When logged in and follow the API in the website related with url, the resource can be seen. + */ + OAUTH, + /** + * Some other complicated or particular way to get resource from url. + */ + OTHER, + /** + * added to help the parsers with the generic types + */ + NULL; + public static RepositoryType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("directlink".equals(codeString)) + return DIRECTLINK; + if ("openapi".equals(codeString)) + return OPENAPI; + if ("login".equals(codeString)) + return LOGIN; + if ("oauth".equals(codeString)) + return OAUTH; + if ("other".equals(codeString)) + return OTHER; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown RepositoryType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DIRECTLINK: return "directlink"; + case OPENAPI: return "openapi"; + case LOGIN: return "login"; + case OAUTH: return "oauth"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DIRECTLINK: return "http://hl7.org/fhir/repository-type"; + case OPENAPI: return "http://hl7.org/fhir/repository-type"; + case LOGIN: return "http://hl7.org/fhir/repository-type"; + case OAUTH: return "http://hl7.org/fhir/repository-type"; + case OTHER: return "http://hl7.org/fhir/repository-type"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DIRECTLINK: return "When url is clicked, the resource can be seen directly (by webpage or by download link format)"; + case OPENAPI: return "When the api method (e.g. [base_url]/[parameter]) related with the url website is executed, the resource can be seen directly (usually in json or xml format)"; + case LOGIN: return "When logged into the website, the resource can be seen."; + case OAUTH: return "When logged in and follow the API in the website related with url, the resource can be seen."; + case OTHER: return "Some other complicated or particular way to get resource from url."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DIRECTLINK: return "Click and see"; + case OPENAPI: return "The url is the RESTful or other kind of API that can get access to the result."; + case LOGIN: return "Result cannot be access unless an account is logged in"; + case OAUTH: return "Result need to be fetched with API and need LOGIN( or cookies is required when visit the link of resource)"; + case OTHER: return "Some other complicated or particular way to get resource from url."; + default: return "?"; + } + } + } + + public static class RepositoryTypeEnumFactory implements EnumFactory { + public RepositoryType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("directlink".equals(codeString)) + return RepositoryType.DIRECTLINK; + if ("openapi".equals(codeString)) + return RepositoryType.OPENAPI; + if ("login".equals(codeString)) + return RepositoryType.LOGIN; + if ("oauth".equals(codeString)) + return RepositoryType.OAUTH; + if ("other".equals(codeString)) + return RepositoryType.OTHER; + throw new IllegalArgumentException("Unknown RepositoryType code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("directlink".equals(codeString)) + return new Enumeration(this, RepositoryType.DIRECTLINK); + if ("openapi".equals(codeString)) + return new Enumeration(this, RepositoryType.OPENAPI); + if ("login".equals(codeString)) + return new Enumeration(this, RepositoryType.LOGIN); + if ("oauth".equals(codeString)) + return new Enumeration(this, RepositoryType.OAUTH); + if ("other".equals(codeString)) + return new Enumeration(this, RepositoryType.OTHER); + throw new FHIRException("Unknown RepositoryType code '"+codeString+"'"); + } + public String toCode(RepositoryType code) { + if (code == RepositoryType.DIRECTLINK) + return "directlink"; + if (code == RepositoryType.OPENAPI) + return "openapi"; + if (code == RepositoryType.LOGIN) + return "login"; + if (code == RepositoryType.OAUTH) + return "oauth"; + if (code == RepositoryType.OTHER) + return "other"; + return "?"; + } + public String toSystem(RepositoryType code) { + return code.getSystem(); + } + } + @Block() public static class SequenceReferenceSeqComponent extends BackboneElement implements IBaseBackboneElement { /** @@ -175,20 +419,20 @@ public class Sequence extends DomainResource { /** * Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences. */ - @Child(name = "referenceSeqId", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) + @Child(name = "referenceSeqId", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Reference identifier", formalDefinition="Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-referenceSeq") protected CodeableConcept referenceSeqId; /** - * A Pointer to another Sequence entity as refence sequence. + * A Pointer to another Sequence entity as reference sequence. */ @Child(name = "referenceSeqPointer", type = {Sequence.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A Pointer to another Sequence entity as refence sequence", formalDefinition="A Pointer to another Sequence entity as refence sequence." ) + @Description(shortDefinition="A Pointer to another Sequence entity as reference sequence", formalDefinition="A Pointer to another Sequence entity as reference sequence." ) protected Reference referenceSeqPointer; /** - * The actual object that is the target of the reference (A Pointer to another Sequence entity as refence sequence.) + * The actual object that is the target of the reference (A Pointer to another Sequence entity as reference sequence.) */ protected Sequence referenceSeqPointerTarget; @@ -200,24 +444,24 @@ public class Sequence extends DomainResource { protected StringType referenceSeqString; /** - * Strand of DNA. Available values are "1" for the plus strand and "-1" for the minus strand. + * Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative. */ - @Child(name = "strand", type = {IntegerType.class}, order=6, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Strand of DNA", formalDefinition="Strand of DNA. Available values are \"1\" for the plus strand and \"-1\" for the minus strand." ) + @Child(name = "strand", type = {IntegerType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Directionality of DNA ( +1/-1)", formalDefinition="Directionality of DNA sequence. Available values are \"1\" for the plus strand (5' to 3')/Watson/Sense/positive and \"-1\" for the minus strand(3' to 5')/Crick/Antisense/negative." ) protected IntegerType strand; /** - * Start position (inclusive) of the window on the reference sequence. + * Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ @Child(name = "windowStart", type = {IntegerType.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Start position (inclusive) of the window on the reference sequence", formalDefinition="Start position (inclusive) of the window on the reference sequence." ) + @Description(shortDefinition="Start position of the window on the reference sequence", formalDefinition="Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive." ) protected IntegerType windowStart; /** - * End position (exclusive) of the window on the reference sequence. + * End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ @Child(name = "windowEnd", type = {IntegerType.class}, order=8, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="End position (exclusive) of the window on the reference sequence", formalDefinition="End position (exclusive) of the window on the reference sequence." ) + @Description(shortDefinition="End position of the window on the reference sequence", formalDefinition="End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position." ) protected IntegerType windowEnd; private static final long serialVersionUID = -1675617731L; @@ -232,10 +476,8 @@ public class Sequence extends DomainResource { /** * Constructor */ - public SequenceReferenceSeqComponent(CodeableConcept referenceSeqId, IntegerType strand, IntegerType windowStart, IntegerType windowEnd) { + public SequenceReferenceSeqComponent(IntegerType windowStart, IntegerType windowEnd) { super(); - this.referenceSeqId = referenceSeqId; - this.strand = strand; this.windowStart = windowStart; this.windowEnd = windowEnd; } @@ -338,7 +580,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #referenceSeqPointer} (A Pointer to another Sequence entity as refence sequence.) + * @return {@link #referenceSeqPointer} (A Pointer to another Sequence entity as reference sequence.) */ public Reference getReferenceSeqPointer() { if (this.referenceSeqPointer == null) @@ -354,7 +596,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #referenceSeqPointer} (A Pointer to another Sequence entity as refence sequence.) + * @param value {@link #referenceSeqPointer} (A Pointer to another Sequence entity as reference sequence.) */ public SequenceReferenceSeqComponent setReferenceSeqPointer(Reference value) { this.referenceSeqPointer = value; @@ -362,7 +604,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #referenceSeqPointer} 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 Pointer to another Sequence entity as refence sequence.) + * @return {@link #referenceSeqPointer} 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 Pointer to another Sequence entity as reference sequence.) */ public Sequence getReferenceSeqPointerTarget() { if (this.referenceSeqPointerTarget == null) @@ -374,7 +616,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #referenceSeqPointer} 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 Pointer to another Sequence entity as refence sequence.) + * @param value {@link #referenceSeqPointer} 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 Pointer to another Sequence entity as reference sequence.) */ public SequenceReferenceSeqComponent setReferenceSeqPointerTarget(Sequence value) { this.referenceSeqPointerTarget = value; @@ -431,7 +673,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #strand} (Strand of DNA. Available values are "1" for the plus strand and "-1" for the minus strand.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value + * @return {@link #strand} (Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value */ public IntegerType getStrandElement() { if (this.strand == null) @@ -451,7 +693,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #strand} (Strand of DNA. Available values are "1" for the plus strand and "-1" for the minus strand.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value + * @param value {@link #strand} (Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value */ public SequenceReferenceSeqComponent setStrandElement(IntegerType value) { this.strand = value; @@ -459,14 +701,14 @@ public class Sequence extends DomainResource { } /** - * @return Strand of DNA. Available values are "1" for the plus strand and "-1" for the minus strand. + * @return Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative. */ public int getStrand() { return this.strand == null || this.strand.isEmpty() ? 0 : this.strand.getValue(); } /** - * @param value Strand of DNA. Available values are "1" for the plus strand and "-1" for the minus strand. + * @param value Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative. */ public SequenceReferenceSeqComponent setStrand(int value) { if (this.strand == null) @@ -476,7 +718,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #windowStart} (Start position (inclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value + * @return {@link #windowStart} (Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value */ public IntegerType getWindowStartElement() { if (this.windowStart == null) @@ -496,7 +738,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #windowStart} (Start position (inclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value + * @param value {@link #windowStart} (Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value */ public SequenceReferenceSeqComponent setWindowStartElement(IntegerType value) { this.windowStart = value; @@ -504,14 +746,14 @@ public class Sequence extends DomainResource { } /** - * @return Start position (inclusive) of the window on the reference sequence. + * @return Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public int getWindowStart() { return this.windowStart == null || this.windowStart.isEmpty() ? 0 : this.windowStart.getValue(); } /** - * @param value Start position (inclusive) of the window on the reference sequence. + * @param value Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public SequenceReferenceSeqComponent setWindowStart(int value) { if (this.windowStart == null) @@ -521,7 +763,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #windowEnd} (End position (exclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value + * @return {@link #windowEnd} (End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value */ public IntegerType getWindowEndElement() { if (this.windowEnd == null) @@ -541,7 +783,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #windowEnd} (End position (exclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value + * @param value {@link #windowEnd} (End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value */ public SequenceReferenceSeqComponent setWindowEndElement(IntegerType value) { this.windowEnd = value; @@ -549,14 +791,14 @@ public class Sequence extends DomainResource { } /** - * @return End position (exclusive) of the window on the reference sequence. + * @return End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public int getWindowEnd() { return this.windowEnd == null || this.windowEnd.isEmpty() ? 0 : this.windowEnd.getValue(); } /** - * @param value End position (exclusive) of the window on the reference sequence. + * @param value End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public SequenceReferenceSeqComponent setWindowEnd(int value) { if (this.windowEnd == null) @@ -570,11 +812,11 @@ public class Sequence extends DomainResource { childrenList.add(new Property("chromosome", "CodeableConcept", "Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).", 0, java.lang.Integer.MAX_VALUE, chromosome)); childrenList.add(new Property("genomeBuild", "string", "The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used.", 0, java.lang.Integer.MAX_VALUE, genomeBuild)); childrenList.add(new Property("referenceSeqId", "CodeableConcept", "Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.", 0, java.lang.Integer.MAX_VALUE, referenceSeqId)); - childrenList.add(new Property("referenceSeqPointer", "Reference(Sequence)", "A Pointer to another Sequence entity as refence sequence.", 0, java.lang.Integer.MAX_VALUE, referenceSeqPointer)); + childrenList.add(new Property("referenceSeqPointer", "Reference(Sequence)", "A Pointer to another Sequence entity as reference sequence.", 0, java.lang.Integer.MAX_VALUE, referenceSeqPointer)); childrenList.add(new Property("referenceSeqString", "string", "A Reference Sequence string.", 0, java.lang.Integer.MAX_VALUE, referenceSeqString)); - childrenList.add(new Property("strand", "integer", "Strand of DNA. Available values are \"1\" for the plus strand and \"-1\" for the minus strand.", 0, java.lang.Integer.MAX_VALUE, strand)); - childrenList.add(new Property("windowStart", "integer", "Start position (inclusive) of the window on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, windowStart)); - childrenList.add(new Property("windowEnd", "integer", "End position (exclusive) of the window on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, windowEnd)); + childrenList.add(new Property("strand", "integer", "Directionality of DNA sequence. Available values are \"1\" for the plus strand (5' to 3')/Watson/Sense/positive and \"-1\" for the minus strand(3' to 5')/Crick/Antisense/negative.", 0, java.lang.Integer.MAX_VALUE, strand)); + childrenList.add(new Property("windowStart", "integer", "Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, java.lang.Integer.MAX_VALUE, windowStart)); + childrenList.add(new Property("windowEnd", "integer", "End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.", 0, java.lang.Integer.MAX_VALUE, windowEnd)); } @Override @@ -750,31 +992,31 @@ public class Sequence extends DomainResource { @Block() public static class SequenceVariantComponent extends BackboneElement implements IBaseBackboneElement { /** - * Start position (inclusive) of the variant on the reference sequence. + * Start position of the variant on the reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Start position (inclusive) of the variant on the reference sequence", formalDefinition="Start position (inclusive) of the variant on the reference sequence." ) + @Description(shortDefinition="Start position of the variant on the reference sequence", formalDefinition="Start position of the variant on the reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive." ) protected IntegerType start; /** - * End position (exclusive) of the variant on the reference sequence. + * End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="End position (exclusive) of the variant on the reference sequence", formalDefinition="End position (exclusive) of the variant on the reference sequence." ) + @Description(shortDefinition="End position of the variant on the reference sequence", formalDefinition="End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position." ) protected IntegerType end; /** - * An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + * An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. */ @Child(name = "observedAllele", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Allele that was observed", formalDefinition="An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand." ) + @Description(shortDefinition="Allele that was observed", formalDefinition="An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end." ) protected StringType observedAllele; /** - * An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + * An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. */ @Child(name = "referenceAllele", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Allele of reference sequence", formalDefinition="An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand." ) + @Description(shortDefinition="Allele of reference sequence", formalDefinition="An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end." ) protected StringType referenceAllele; /** @@ -806,7 +1048,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #start} (Start position (inclusive) of the variant on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + * @return {@link #start} (Start position of the variant on the reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public IntegerType getStartElement() { if (this.start == null) @@ -826,7 +1068,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #start} (Start position (inclusive) of the variant on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + * @param value {@link #start} (Start position of the variant on the reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public SequenceVariantComponent setStartElement(IntegerType value) { this.start = value; @@ -834,14 +1076,14 @@ public class Sequence extends DomainResource { } /** - * @return Start position (inclusive) of the variant on the reference sequence. + * @return Start position of the variant on the reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public int getStart() { return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); } /** - * @param value Start position (inclusive) of the variant on the reference sequence. + * @param value Start position of the variant on the reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public SequenceVariantComponent setStart(int value) { if (this.start == null) @@ -851,7 +1093,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #end} (End position (exclusive) of the variant on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + * @return {@link #end} (End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public IntegerType getEndElement() { if (this.end == null) @@ -871,7 +1113,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #end} (End position (exclusive) of the variant on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + * @param value {@link #end} (End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public SequenceVariantComponent setEndElement(IntegerType value) { this.end = value; @@ -879,14 +1121,14 @@ public class Sequence extends DomainResource { } /** - * @return End position (exclusive) of the variant on the reference sequence. + * @return End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public int getEnd() { return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); } /** - * @param value End position (exclusive) of the variant on the reference sequence. + * @param value End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public SequenceVariantComponent setEnd(int value) { if (this.end == null) @@ -896,7 +1138,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #observedAllele} (An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value + * @return {@link #observedAllele} (An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value */ public StringType getObservedAlleleElement() { if (this.observedAllele == null) @@ -916,7 +1158,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #observedAllele} (An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value + * @param value {@link #observedAllele} (An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value */ public SequenceVariantComponent setObservedAlleleElement(StringType value) { this.observedAllele = value; @@ -924,14 +1166,14 @@ public class Sequence extends DomainResource { } /** - * @return An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + * @return An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. */ public String getObservedAllele() { return this.observedAllele == null ? null : this.observedAllele.getValue(); } /** - * @param value An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + * @param value An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. */ public SequenceVariantComponent setObservedAllele(String value) { if (Utilities.noString(value)) @@ -945,7 +1187,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #referenceAllele} (An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value + * @return {@link #referenceAllele} (An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value */ public StringType getReferenceAlleleElement() { if (this.referenceAllele == null) @@ -965,7 +1207,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #referenceAllele} (An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value + * @param value {@link #referenceAllele} (An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value */ public SequenceVariantComponent setReferenceAlleleElement(StringType value) { this.referenceAllele = value; @@ -973,14 +1215,14 @@ public class Sequence extends DomainResource { } /** - * @return An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + * @return An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. */ public String getReferenceAllele() { return this.referenceAllele == null ? null : this.referenceAllele.getValue(); } /** - * @param value An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + * @param value An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. */ public SequenceVariantComponent setReferenceAllele(String value) { if (Utilities.noString(value)) @@ -1088,10 +1330,10 @@ public class Sequence extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("start", "integer", "Start position (inclusive) of the variant on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "integer", "End position (exclusive) of the variant on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("observedAllele", "string", "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.", 0, java.lang.Integer.MAX_VALUE, observedAllele)); - childrenList.add(new Property("referenceAllele", "string", "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.", 0, java.lang.Integer.MAX_VALUE, referenceAllele)); + childrenList.add(new Property("start", "integer", "Start position of the variant on the reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "integer", "End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("observedAllele", "string", "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.", 0, java.lang.Integer.MAX_VALUE, observedAllele)); + childrenList.add(new Property("referenceAllele", "string", "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.", 0, java.lang.Integer.MAX_VALUE, referenceAllele)); childrenList.add(new Property("cigar", "string", "Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).", 0, java.lang.Integer.MAX_VALUE, cigar)); childrenList.add(new Property("variantPointer", "Reference(Observation)", "A pointer to an Observation containing variant information.", 0, java.lang.Integer.MAX_VALUE, variantPointer)); } @@ -1242,98 +1484,106 @@ public class Sequence extends DomainResource { @Block() public static class SequenceQualityComponent extends BackboneElement implements IBaseBackboneElement { + /** + * INDEL / SNP / Undefined variant. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="INDEL | SNP | UNKNOWN", formalDefinition="INDEL / SNP / Undefined variant." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/quality-type") + protected Enumeration type; + /** * Gold standard sequence used for comparing against. */ - @Child(name = "standardSequence", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Child(name = "standardSequence", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Standard sequence for comparison", formalDefinition="Gold standard sequence used for comparing against." ) protected CodeableConcept standardSequence; /** - * Start position (inclusive) of the sequence. + * Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ - @Child(name = "start", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Start position (inclusive) of the sequence", formalDefinition="Start position (inclusive) of the sequence." ) + @Child(name = "start", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Start position of the sequence", formalDefinition="Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive." ) protected IntegerType start; /** - * End position (exclusive) of the sequence. + * End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ - @Child(name = "end", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="End position (exclusive) of the sequence", formalDefinition="End position (exclusive) of the sequence." ) + @Child(name = "end", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="End position of the sequence", formalDefinition="End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position." ) protected IntegerType end; /** * The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)). */ - @Child(name = "score", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Child(name = "score", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Quality score", formalDefinition="The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685))." ) protected Quantity score; /** * Method for quality. */ - @Child(name = "method", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Method for quality", formalDefinition="Method for quality." ) protected CodeableConcept method; /** * True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event. */ - @Child(name = "truthTP", type = {DecimalType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Child(name = "truthTP", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="True positives from the perspective of the truth data", formalDefinition="True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event." ) protected DecimalType truthTP; /** * True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event. */ - @Child(name = "queryTP", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Child(name = "queryTP", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="True positives from the perspective of the query data", formalDefinition="True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event." ) protected DecimalType queryTP; /** * False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here. */ - @Child(name = "truthFN", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Child(name = "truthFN", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="False negatives", formalDefinition="False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here." ) protected DecimalType truthFN; /** * False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here. */ - @Child(name = "queryFP", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true) + @Child(name = "queryFP", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="False positives", formalDefinition="False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here." ) protected DecimalType queryFP; /** * The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar). */ - @Child(name = "gtFP", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Child(name = "gtFP", type = {DecimalType.class}, order=11, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="False positives where the non-REF alleles in the Truth and Query Call Sets match", formalDefinition="The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar)." ) protected DecimalType gtFP; /** * QUERY.TP / (QUERY.TP + QUERY.FP). */ - @Child(name = "precision", type = {DecimalType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Child(name = "precision", type = {DecimalType.class}, order=12, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Precision", formalDefinition="QUERY.TP / (QUERY.TP + QUERY.FP)." ) protected DecimalType precision; /** * TRUTH.TP / (TRUTH.TP + TRUTH.FN). */ - @Child(name = "recall", type = {DecimalType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Child(name = "recall", type = {DecimalType.class}, order=13, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Recall", formalDefinition="TRUTH.TP / (TRUTH.TP + TRUTH.FN)." ) protected DecimalType recall; /** * Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall). */ - @Child(name = "fScore", type = {DecimalType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Child(name = "fScore", type = {DecimalType.class}, order=14, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="F-score", formalDefinition="Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall)." ) protected DecimalType fScore; - private static final long serialVersionUID = 529445255L; + private static final long serialVersionUID = -383644463L; /** * Constructor @@ -1342,6 +1592,59 @@ public class Sequence extends DomainResource { super(); } + /** + * Constructor + */ + public SequenceQualityComponent(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (INDEL / SNP / Undefined variant.). 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 SequenceQualityComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new QualityTypeEnumFactory()); // bb + 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} (INDEL / SNP / Undefined variant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SequenceQualityComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return INDEL / SNP / Undefined variant. + */ + public QualityType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value INDEL / SNP / Undefined variant. + */ + public SequenceQualityComponent setType(QualityType value) { + if (this.type == null) + this.type = new Enumeration(new QualityTypeEnumFactory()); + this.type.setValue(value); + return this; + } + /** * @return {@link #standardSequence} (Gold standard sequence used for comparing against.) */ @@ -1367,7 +1670,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #start} (Start position (inclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + * @return {@link #start} (Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public IntegerType getStartElement() { if (this.start == null) @@ -1387,7 +1690,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #start} (Start position (inclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + * @param value {@link #start} (Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public SequenceQualityComponent setStartElement(IntegerType value) { this.start = value; @@ -1395,14 +1698,14 @@ public class Sequence extends DomainResource { } /** - * @return Start position (inclusive) of the sequence. + * @return Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public int getStart() { return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); } /** - * @param value Start position (inclusive) of the sequence. + * @param value Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public SequenceQualityComponent setStart(int value) { if (this.start == null) @@ -1412,7 +1715,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #end} (End position (exclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + * @return {@link #end} (End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public IntegerType getEndElement() { if (this.end == null) @@ -1432,7 +1735,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #end} (End position (exclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + * @param value {@link #end} (End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public SequenceQualityComponent setEndElement(IntegerType value) { this.end = value; @@ -1440,14 +1743,14 @@ public class Sequence extends DomainResource { } /** - * @return End position (exclusive) of the sequence. + * @return End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public int getEnd() { return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); } /** - * @param value End position (exclusive) of the sequence. + * @param value End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public SequenceQualityComponent setEnd(int value) { if (this.end == null) @@ -2042,9 +2345,10 @@ public class Sequence extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "INDEL / SNP / Undefined variant.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("standardSequence", "CodeableConcept", "Gold standard sequence used for comparing against.", 0, java.lang.Integer.MAX_VALUE, standardSequence)); - childrenList.add(new Property("start", "integer", "Start position (inclusive) of the sequence.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "integer", "End position (exclusive) of the sequence.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("start", "integer", "Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "integer", "End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.", 0, java.lang.Integer.MAX_VALUE, end)); childrenList.add(new Property("score", "Quantity", "The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).", 0, java.lang.Integer.MAX_VALUE, score)); childrenList.add(new Property("method", "CodeableConcept", "Method for quality.", 0, java.lang.Integer.MAX_VALUE, method)); childrenList.add(new Property("truthTP", "decimal", "True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.", 0, java.lang.Integer.MAX_VALUE, truthTP)); @@ -2060,6 +2364,7 @@ public class Sequence extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration case -1861227106: /*standardSequence*/ return this.standardSequence == null ? new Base[0] : new Base[] {this.standardSequence}; // CodeableConcept case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType @@ -2081,6 +2386,9 @@ public class Sequence extends DomainResource { @Override public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { + case 3575610: // type + this.type = new QualityTypeEnumFactory().fromType(value); // Enumeration + break; case -1861227106: // standardSequence this.standardSequence = castToCodeableConcept(value); // CodeableConcept break; @@ -2127,7 +2435,9 @@ public class Sequence extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("standardSequence")) + if (name.equals("type")) + this.type = new QualityTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("standardSequence")) this.standardSequence = castToCodeableConcept(value); // CodeableConcept else if (name.equals("start")) this.start = castToInteger(value); // IntegerType @@ -2160,6 +2470,7 @@ public class Sequence extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration case -1861227106: return getStandardSequence(); // CodeableConcept case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType @@ -2180,7 +2491,10 @@ public class Sequence extends DomainResource { @Override public Base addChild(String name) throws FHIRException { - if (name.equals("standardSequence")) { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.type"); + } + else if (name.equals("standardSequence")) { this.standardSequence = new CodeableConcept(); return this.standardSequence; } @@ -2229,6 +2543,7 @@ public class Sequence extends DomainResource { public SequenceQualityComponent copy() { SequenceQualityComponent dst = new SequenceQualityComponent(); copyValues(dst); + dst.type = type == null ? null : type.copy(); dst.standardSequence = standardSequence == null ? null : standardSequence.copy(); dst.start = start == null ? null : start.copy(); dst.end = end == null ? null : end.copy(); @@ -2252,11 +2567,12 @@ public class Sequence extends DomainResource { if (!(other instanceof SequenceQualityComponent)) return false; SequenceQualityComponent o = (SequenceQualityComponent) other; - return compareDeep(standardSequence, o.standardSequence, true) && compareDeep(start, o.start, true) - && compareDeep(end, o.end, true) && compareDeep(score, o.score, true) && compareDeep(method, o.method, true) - && compareDeep(truthTP, o.truthTP, true) && compareDeep(queryTP, o.queryTP, true) && compareDeep(truthFN, o.truthFN, true) - && compareDeep(queryFP, o.queryFP, true) && compareDeep(gtFP, o.gtFP, true) && compareDeep(precision, o.precision, true) - && compareDeep(recall, o.recall, true) && compareDeep(fScore, o.fScore, true); + return compareDeep(type, o.type, true) && compareDeep(standardSequence, o.standardSequence, true) + && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(score, o.score, true) + && compareDeep(method, o.method, true) && compareDeep(truthTP, o.truthTP, true) && compareDeep(queryTP, o.queryTP, true) + && compareDeep(truthFN, o.truthFN, true) && compareDeep(queryFP, o.queryFP, true) && compareDeep(gtFP, o.gtFP, true) + && compareDeep(precision, o.precision, true) && compareDeep(recall, o.recall, true) && compareDeep(fScore, o.fScore, true) + ; } @Override @@ -2266,16 +2582,16 @@ public class Sequence extends DomainResource { if (!(other instanceof SequenceQualityComponent)) return false; SequenceQualityComponent o = (SequenceQualityComponent) other; - return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(truthTP, o.truthTP, true) - && compareValues(queryTP, o.queryTP, true) && compareValues(truthFN, o.truthFN, true) && compareValues(queryFP, o.queryFP, true) - && compareValues(gtFP, o.gtFP, true) && compareValues(precision, o.precision, true) && compareValues(recall, o.recall, true) - && compareValues(fScore, o.fScore, true); + return compareValues(type, o.type, true) && compareValues(start, o.start, true) && compareValues(end, o.end, true) + && compareValues(truthTP, o.truthTP, true) && compareValues(queryTP, o.queryTP, true) && compareValues(truthFN, o.truthFN, true) + && compareValues(queryFP, o.queryFP, true) && compareValues(gtFP, o.gtFP, true) && compareValues(precision, o.precision, true) + && compareValues(recall, o.recall, true) && compareValues(fScore, o.fScore, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(standardSequence, start, end - , score, method, truthTP, queryTP, truthFN, queryFP, gtFP, precision, recall - , fScore); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, standardSequence, start + , end, score, method, truthTP, queryTP, truthFN, queryFP, gtFP, precision + , recall, fScore); } public String fhirType() { @@ -2287,35 +2603,50 @@ public class Sequence extends DomainResource { @Block() public static class SequenceRepositoryComponent extends BackboneElement implements IBaseBackboneElement { + /** + * Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource. + */ + @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="directlink | openapi | login | oauth | other", formalDefinition="Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/repository-type") + protected Enumeration type; + /** * URI of an external repository which contains further details about the genetics data. */ - @Child(name = "url", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="URI of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." ) protected UriType url; /** * URI of an external repository which contains further details about the genetics data. */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Name of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." ) protected StringType name; /** - * Id of the variant in this external repository. + * Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository. */ - @Child(name = "variantId", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Id of the variant", formalDefinition="Id of the variant in this external repository." ) - protected StringType variantId; + @Child(name = "datasetId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Id of the dataset that used to call for dataset in repository", formalDefinition="Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository." ) + protected StringType datasetId; + + /** + * Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository. + */ + @Child(name = "variantsetId", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Id of the variantset that used to call for variantset in repository", formalDefinition="Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository." ) + protected StringType variantsetId; /** * Id of the read in this external repository. */ - @Child(name = "readId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Child(name = "readsetId", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Id of the read", formalDefinition="Id of the read in this external repository." ) - protected StringType readId; + protected StringType readsetId; - private static final long serialVersionUID = 1218159360L; + private static final long serialVersionUID = -899243265L; /** * Constructor @@ -2324,6 +2655,59 @@ public class Sequence extends DomainResource { super(); } + /** + * Constructor + */ + public SequenceRepositoryComponent(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.). 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 SequenceRepositoryComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(new RepositoryTypeEnumFactory()); // bb + 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} (Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SequenceRepositoryComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource. + */ + public RepositoryType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource. + */ + public SequenceRepositoryComponent setType(RepositoryType value) { + if (this.type == null) + this.type = new Enumeration(new RepositoryTypeEnumFactory()); + this.type.setValue(value); + return this; + } + /** * @return {@link #url} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value */ @@ -2423,118 +2807,171 @@ public class Sequence extends DomainResource { } /** - * @return {@link #variantId} (Id of the variant in this external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantId" gives direct access to the value + * @return {@link #datasetId} (Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.). This is the underlying object with id, value and extensions. The accessor "getDatasetId" gives direct access to the value */ - public StringType getVariantIdElement() { - if (this.variantId == null) + public StringType getDatasetIdElement() { + if (this.datasetId == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceRepositoryComponent.variantId"); + throw new Error("Attempt to auto-create SequenceRepositoryComponent.datasetId"); else if (Configuration.doAutoCreate()) - this.variantId = new StringType(); // bb - return this.variantId; + this.datasetId = new StringType(); // bb + return this.datasetId; } - public boolean hasVariantIdElement() { - return this.variantId != null && !this.variantId.isEmpty(); + public boolean hasDatasetIdElement() { + return this.datasetId != null && !this.datasetId.isEmpty(); } - public boolean hasVariantId() { - return this.variantId != null && !this.variantId.isEmpty(); + public boolean hasDatasetId() { + return this.datasetId != null && !this.datasetId.isEmpty(); } /** - * @param value {@link #variantId} (Id of the variant in this external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantId" gives direct access to the value + * @param value {@link #datasetId} (Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.). This is the underlying object with id, value and extensions. The accessor "getDatasetId" gives direct access to the value */ - public SequenceRepositoryComponent setVariantIdElement(StringType value) { - this.variantId = value; + public SequenceRepositoryComponent setDatasetIdElement(StringType value) { + this.datasetId = value; return this; } /** - * @return Id of the variant in this external repository. + * @return Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository. */ - public String getVariantId() { - return this.variantId == null ? null : this.variantId.getValue(); + public String getDatasetId() { + return this.datasetId == null ? null : this.datasetId.getValue(); } /** - * @param value Id of the variant in this external repository. + * @param value Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository. */ - public SequenceRepositoryComponent setVariantId(String value) { + public SequenceRepositoryComponent setDatasetId(String value) { if (Utilities.noString(value)) - this.variantId = null; + this.datasetId = null; else { - if (this.variantId == null) - this.variantId = new StringType(); - this.variantId.setValue(value); + if (this.datasetId == null) + this.datasetId = new StringType(); + this.datasetId.setValue(value); } return this; } /** - * @return {@link #readId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadId" gives direct access to the value + * @return {@link #variantsetId} (Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantsetId" gives direct access to the value */ - public StringType getReadIdElement() { - if (this.readId == null) + public StringType getVariantsetIdElement() { + if (this.variantsetId == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceRepositoryComponent.readId"); + throw new Error("Attempt to auto-create SequenceRepositoryComponent.variantsetId"); else if (Configuration.doAutoCreate()) - this.readId = new StringType(); // bb - return this.readId; + this.variantsetId = new StringType(); // bb + return this.variantsetId; } - public boolean hasReadIdElement() { - return this.readId != null && !this.readId.isEmpty(); + public boolean hasVariantsetIdElement() { + return this.variantsetId != null && !this.variantsetId.isEmpty(); } - public boolean hasReadId() { - return this.readId != null && !this.readId.isEmpty(); + public boolean hasVariantsetId() { + return this.variantsetId != null && !this.variantsetId.isEmpty(); } /** - * @param value {@link #readId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadId" gives direct access to the value + * @param value {@link #variantsetId} (Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantsetId" gives direct access to the value */ - public SequenceRepositoryComponent setReadIdElement(StringType value) { - this.readId = value; + public SequenceRepositoryComponent setVariantsetIdElement(StringType value) { + this.variantsetId = value; + return this; + } + + /** + * @return Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository. + */ + public String getVariantsetId() { + return this.variantsetId == null ? null : this.variantsetId.getValue(); + } + + /** + * @param value Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository. + */ + public SequenceRepositoryComponent setVariantsetId(String value) { + if (Utilities.noString(value)) + this.variantsetId = null; + else { + if (this.variantsetId == null) + this.variantsetId = new StringType(); + this.variantsetId.setValue(value); + } + return this; + } + + /** + * @return {@link #readsetId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadsetId" gives direct access to the value + */ + public StringType getReadsetIdElement() { + if (this.readsetId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SequenceRepositoryComponent.readsetId"); + else if (Configuration.doAutoCreate()) + this.readsetId = new StringType(); // bb + return this.readsetId; + } + + public boolean hasReadsetIdElement() { + return this.readsetId != null && !this.readsetId.isEmpty(); + } + + public boolean hasReadsetId() { + return this.readsetId != null && !this.readsetId.isEmpty(); + } + + /** + * @param value {@link #readsetId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadsetId" gives direct access to the value + */ + public SequenceRepositoryComponent setReadsetIdElement(StringType value) { + this.readsetId = value; return this; } /** * @return Id of the read in this external repository. */ - public String getReadId() { - return this.readId == null ? null : this.readId.getValue(); + public String getReadsetId() { + return this.readsetId == null ? null : this.readsetId.getValue(); } /** * @param value Id of the read in this external repository. */ - public SequenceRepositoryComponent setReadId(String value) { + public SequenceRepositoryComponent setReadsetId(String value) { if (Utilities.noString(value)) - this.readId = null; + this.readsetId = null; else { - if (this.readId == null) - this.readId = new StringType(); - this.readId.setValue(value); + if (this.readsetId == null) + this.readsetId = new StringType(); + this.readsetId.setValue(value); } return this; } protected void listChildren(List childrenList) { super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("url", "uri", "URI of an external repository which contains further details about the genetics data.", 0, java.lang.Integer.MAX_VALUE, url)); childrenList.add(new Property("name", "string", "URI of an external repository which contains further details about the genetics data.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("variantId", "string", "Id of the variant in this external repository.", 0, java.lang.Integer.MAX_VALUE, variantId)); - childrenList.add(new Property("readId", "string", "Id of the read in this external repository.", 0, java.lang.Integer.MAX_VALUE, readId)); + childrenList.add(new Property("datasetId", "string", "Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.", 0, java.lang.Integer.MAX_VALUE, datasetId)); + childrenList.add(new Property("variantsetId", "string", "Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.", 0, java.lang.Integer.MAX_VALUE, variantsetId)); + childrenList.add(new Property("readsetId", "string", "Id of the read in this external repository.", 0, java.lang.Integer.MAX_VALUE, readsetId)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -82113408: /*variantId*/ return this.variantId == null ? new Base[0] : new Base[] {this.variantId}; // StringType - case -934980271: /*readId*/ return this.readId == null ? new Base[0] : new Base[] {this.readId}; // StringType + case -345342029: /*datasetId*/ return this.datasetId == null ? new Base[0] : new Base[] {this.datasetId}; // StringType + case 1929752504: /*variantsetId*/ return this.variantsetId == null ? new Base[0] : new Base[] {this.variantsetId}; // StringType + case -1095407289: /*readsetId*/ return this.readsetId == null ? new Base[0] : new Base[] {this.readsetId}; // StringType default: return super.getProperty(hash, name, checkValid); } @@ -2543,17 +2980,23 @@ public class Sequence extends DomainResource { @Override public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { + case 3575610: // type + this.type = new RepositoryTypeEnumFactory().fromType(value); // Enumeration + break; case 116079: // url this.url = castToUri(value); // UriType break; case 3373707: // name this.name = castToString(value); // StringType break; - case -82113408: // variantId - this.variantId = castToString(value); // StringType + case -345342029: // datasetId + this.datasetId = castToString(value); // StringType break; - case -934980271: // readId - this.readId = castToString(value); // StringType + case 1929752504: // variantsetId + this.variantsetId = castToString(value); // StringType + break; + case -1095407289: // readsetId + this.readsetId = castToString(value); // StringType break; default: super.setProperty(hash, name, value); } @@ -2562,14 +3005,18 @@ public class Sequence extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) + if (name.equals("type")) + this.type = new RepositoryTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("url")) this.url = castToUri(value); // UriType else if (name.equals("name")) this.name = castToString(value); // StringType - else if (name.equals("variantId")) - this.variantId = castToString(value); // StringType - else if (name.equals("readId")) - this.readId = castToString(value); // StringType + else if (name.equals("datasetId")) + this.datasetId = castToString(value); // StringType + else if (name.equals("variantsetId")) + this.variantsetId = castToString(value); // StringType + else if (name.equals("readsetId")) + this.readsetId = castToString(value); // StringType else super.setProperty(name, value); } @@ -2577,10 +3024,12 @@ public class Sequence extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -82113408: throw new FHIRException("Cannot make property variantId as it is not a complex type"); // StringType - case -934980271: throw new FHIRException("Cannot make property readId as it is not a complex type"); // StringType + case -345342029: throw new FHIRException("Cannot make property datasetId as it is not a complex type"); // StringType + case 1929752504: throw new FHIRException("Cannot make property variantsetId as it is not a complex type"); // StringType + case -1095407289: throw new FHIRException("Cannot make property readsetId as it is not a complex type"); // StringType default: return super.makeProperty(hash, name); } @@ -2588,17 +3037,23 @@ public class Sequence extends DomainResource { @Override public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { + if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.type"); + } + else if (name.equals("url")) { throw new FHIRException("Cannot call addChild on a primitive type Sequence.url"); } else if (name.equals("name")) { throw new FHIRException("Cannot call addChild on a primitive type Sequence.name"); } - else if (name.equals("variantId")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.variantId"); + else if (name.equals("datasetId")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.datasetId"); } - else if (name.equals("readId")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.readId"); + else if (name.equals("variantsetId")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.variantsetId"); + } + else if (name.equals("readsetId")) { + throw new FHIRException("Cannot call addChild on a primitive type Sequence.readsetId"); } else return super.addChild(name); @@ -2607,10 +3062,12 @@ public class Sequence extends DomainResource { public SequenceRepositoryComponent copy() { SequenceRepositoryComponent dst = new SequenceRepositoryComponent(); copyValues(dst); + dst.type = type == null ? null : type.copy(); dst.url = url == null ? null : url.copy(); dst.name = name == null ? null : name.copy(); - dst.variantId = variantId == null ? null : variantId.copy(); - dst.readId = readId == null ? null : readId.copy(); + dst.datasetId = datasetId == null ? null : datasetId.copy(); + dst.variantsetId = variantsetId == null ? null : variantsetId.copy(); + dst.readsetId = readsetId == null ? null : readsetId.copy(); return dst; } @@ -2621,8 +3078,9 @@ public class Sequence extends DomainResource { if (!(other instanceof SequenceRepositoryComponent)) return false; SequenceRepositoryComponent o = (SequenceRepositoryComponent) other; - return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(variantId, o.variantId, true) - && compareDeep(readId, o.readId, true); + return compareDeep(type, o.type, true) && compareDeep(url, o.url, true) && compareDeep(name, o.name, true) + && compareDeep(datasetId, o.datasetId, true) && compareDeep(variantsetId, o.variantsetId, true) + && compareDeep(readsetId, o.readsetId, true); } @Override @@ -2632,13 +3090,14 @@ public class Sequence extends DomainResource { if (!(other instanceof SequenceRepositoryComponent)) return false; SequenceRepositoryComponent o = (SequenceRepositoryComponent) other; - return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(variantId, o.variantId, true) - && compareValues(readId, o.readId, true); + return compareValues(type, o.type, true) && compareValues(url, o.url, true) && compareValues(name, o.name, true) + && compareValues(datasetId, o.datasetId, true) && compareValues(variantsetId, o.variantsetId, true) + && compareValues(readsetId, o.readsetId, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, name, variantId, readId - ); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, url, name, datasetId + , variantsetId, readsetId); } public String fhirType() { @@ -3049,17 +3508,17 @@ public class Sequence extends DomainResource { @Block() public static class SequenceStructureVariantOuterComponent extends BackboneElement implements IBaseBackboneElement { /** - * Structural Variant Outer Start-End. + * Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Outer Start-End", formalDefinition="Structural Variant Outer Start-End." ) + @Description(shortDefinition="Structural Variant Outer Start", formalDefinition="Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive." ) protected IntegerType start; /** - * Structural Variant Outer Start-End. + * Structural Variant Outer End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Outer Start-End", formalDefinition="Structural Variant Outer Start-End." ) + @Description(shortDefinition="Structural Variant Outer End", formalDefinition="Structural Variant Outer End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position." ) protected IntegerType end; private static final long serialVersionUID = -1798864889L; @@ -3072,7 +3531,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #start} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + * @return {@link #start} (Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public IntegerType getStartElement() { if (this.start == null) @@ -3092,7 +3551,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #start} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + * @param value {@link #start} (Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public SequenceStructureVariantOuterComponent setStartElement(IntegerType value) { this.start = value; @@ -3100,14 +3559,14 @@ public class Sequence extends DomainResource { } /** - * @return Structural Variant Outer Start-End. + * @return Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public int getStart() { return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); } /** - * @param value Structural Variant Outer Start-End. + * @param value Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public SequenceStructureVariantOuterComponent setStart(int value) { if (this.start == null) @@ -3117,7 +3576,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #end} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + * @return {@link #end} (Structural Variant Outer End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public IntegerType getEndElement() { if (this.end == null) @@ -3137,7 +3596,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #end} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + * @param value {@link #end} (Structural Variant Outer End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public SequenceStructureVariantOuterComponent setEndElement(IntegerType value) { this.end = value; @@ -3145,14 +3604,14 @@ public class Sequence extends DomainResource { } /** - * @return Structural Variant Outer Start-End. + * @return Structural Variant Outer End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public int getEnd() { return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); } /** - * @param value Structural Variant Outer Start-End. + * @param value Structural Variant Outer End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public SequenceStructureVariantOuterComponent setEnd(int value) { if (this.end == null) @@ -3163,8 +3622,8 @@ public class Sequence extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("start", "integer", "Structural Variant Outer Start-End.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "integer", "Structural Variant Outer Start-End.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("start", "integer", "Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "integer", "Structural Variant Outer End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.", 0, java.lang.Integer.MAX_VALUE, end)); } @Override @@ -3265,17 +3724,17 @@ public class Sequence extends DomainResource { @Block() public static class SequenceStructureVariantInnerComponent extends BackboneElement implements IBaseBackboneElement { /** - * Structural Variant Inner Start-End. + * Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Inner Start-End", formalDefinition="Structural Variant Inner Start-End." ) + @Description(shortDefinition="Structural Variant Inner Start", formalDefinition="Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive." ) protected IntegerType start; /** - * Structural Variant Inner Start-End. + * Structural Variant Inner End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Inner Start-End", formalDefinition="Structural Variant Inner Start-End." ) + @Description(shortDefinition="Structural Variant Inner End", formalDefinition="Structural Variant Inner End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position." ) protected IntegerType end; private static final long serialVersionUID = -1798864889L; @@ -3288,7 +3747,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #start} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + * @return {@link #start} (Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public IntegerType getStartElement() { if (this.start == null) @@ -3308,7 +3767,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #start} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + * @param value {@link #start} (Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public SequenceStructureVariantInnerComponent setStartElement(IntegerType value) { this.start = value; @@ -3316,14 +3775,14 @@ public class Sequence extends DomainResource { } /** - * @return Structural Variant Inner Start-End. + * @return Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public int getStart() { return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); } /** - * @param value Structural Variant Inner Start-End. + * @param value Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive. */ public SequenceStructureVariantInnerComponent setStart(int value) { if (this.start == null) @@ -3333,7 +3792,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #end} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + * @return {@link #end} (Structural Variant Inner End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public IntegerType getEndElement() { if (this.end == null) @@ -3353,7 +3812,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #end} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + * @param value {@link #end} (Structural Variant Inner End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public SequenceStructureVariantInnerComponent setEndElement(IntegerType value) { this.end = value; @@ -3361,14 +3820,14 @@ public class Sequence extends DomainResource { } /** - * @return Structural Variant Inner Start-End. + * @return Structural Variant Inner End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public int getEnd() { return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); } /** - * @param value Structural Variant Inner Start-End. + * @param value Structural Variant Inner End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. */ public SequenceStructureVariantInnerComponent setEnd(int value) { if (this.end == null) @@ -3379,8 +3838,8 @@ public class Sequence extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("start", "integer", "Structural Variant Inner Start-End.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "integer", "Structural Variant Inner Start-End.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("start", "integer", "Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "integer", "Structural Variant Inner End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.", 0, java.lang.Integer.MAX_VALUE, end)); } @Override @@ -3479,25 +3938,25 @@ public class Sequence extends DomainResource { } /** - * A unique identifier for this particular sequence instance. + * A unique identifier for this particular sequence instance. This is a FHIR-defined id. */ @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique ID for this particular sequence", formalDefinition="A unique identifier for this particular sequence instance." ) + @Description(shortDefinition="Unique ID for this particular sequence. This is a FHIR-defined id", formalDefinition="A unique identifier for this particular sequence instance. This is a FHIR-defined id." ) protected List identifier; /** - * Amino acid / cDNA transcript / RNA variant. + * Amino Acid Sequence/ DNA Sequence / RNA Sequence. */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="AA | DNA | RNA", formalDefinition="Amino acid / cDNA transcript / RNA variant." ) + @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="AA | DNA | RNA", formalDefinition="Amino Acid Sequence/ DNA Sequence / RNA Sequence." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-type") protected Enumeration type; /** - * Whether the sequence is numbered starting at 0 (0-based numbering or coordinates) or starting at 1 (1-based numbering). Values are "0" for 0-based numbering and "1" for one-based. + * Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end). */ @Child(name = "coordinateSystem", type = {IntegerType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Numbering used for sequence (0-based or 1-based)", formalDefinition="Whether the sequence is numbered starting at 0 (0-based numbering or coordinates) or starting at 1 (1-based numbering). Values are \"0\" for 0-based numbering and \"1\" for one-based." ) + @Description(shortDefinition="Base number of coordinate system (0 for 0-based numbering or coordinates, inclusive start, exclusive end, 1 for 1-based numbering, inclusive start, inclusive end)", formalDefinition="Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end)." ) protected IntegerType coordinateSystem; /** @@ -3537,58 +3996,70 @@ public class Sequence extends DomainResource { protected Device deviceTarget; /** - * Quantity of the sequence. + * The organization or lab that should be responsible for this result. */ - @Child(name = "quantity", type = {Quantity.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Quantity of the sequence", formalDefinition="Quantity of the sequence." ) + @Child(name = "performer", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who should be responsible for test result", formalDefinition="The organization or lab that should be responsible for this result." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (The organization or lab that should be responsible for this result.) + */ + protected Organization performerTarget; + + /** + * The number of copies of the seqeunce of interest. (RNASeq). + */ + @Child(name = "quantity", type = {Quantity.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="The number of copies of the seqeunce of interest. (RNASeq)", formalDefinition="The number of copies of the seqeunce of interest. (RNASeq)." ) protected Quantity quantity; /** - * A reference sequence is a sequence that is used to represent an allele or variant. + * A sequence that is used as a reference to describe variants that are present in a sequence analyzed. */ - @Child(name = "referenceSeq", type = {}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference sequence", formalDefinition="A reference sequence is a sequence that is used to represent an allele or variant." ) + @Child(name = "referenceSeq", type = {}, order=8, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Reference sequence", formalDefinition="A sequence that is used as a reference to describe variants that are present in a sequence analyzed." ) protected SequenceReferenceSeqComponent referenceSeq; /** - * A' is a variant (mutation) of A = definition every instance of A' is either an immediate mutation of some instance of A, or there is a chain of immediate mutation processes linking A' to some instance of A ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). + * The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string. */ - @Child(name = "variant", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Sequence variant", formalDefinition="A' is a variant (mutation) of A = definition every instance of A' is either an immediate mutation of some instance of A, or there is a chain of immediate mutation processes linking A' to some instance of A ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of))." ) + @Child(name = "variant", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Sequence variant", formalDefinition="The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string." ) protected List variant; /** - * Sequence that was observed. + * Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd. */ - @Child(name = "observedSeq", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Observed sequence", formalDefinition="Sequence that was observed." ) + @Child(name = "observedSeq", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Observed sequence", formalDefinition="Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd." ) protected StringType observedSeq; /** * An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)). */ - @Child(name = "quality", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "quality", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Sequence quality", formalDefinition="An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686))." ) protected List quality; /** * Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. */ - @Child(name = "readCoverage", type = {IntegerType.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Child(name = "readCoverage", type = {IntegerType.class}, order=12, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Average number of reads representing a given nucleotide in the reconstructed sequence", formalDefinition="Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence." ) protected IntegerType readCoverage; /** - * Configurations of the external repository. + * Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq. */ - @Child(name = "repository", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External repository", formalDefinition="Configurations of the external repository." ) + @Child(name = "repository", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="External repository which contains detailed report related with observedSeq in this resource", formalDefinition="Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq." ) protected List repository; /** * Pointer to next atomic sequence which at most contains one variant. */ - @Child(name = "pointer", type = {Sequence.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "pointer", type = {Sequence.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Pointer to next atomic sequence", formalDefinition="Pointer to next atomic sequence which at most contains one variant." ) protected List pointer; /** @@ -3600,11 +4071,11 @@ public class Sequence extends DomainResource { /** * Structural variant. */ - @Child(name = "structureVariant", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "structureVariant", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Structural variant", formalDefinition="Structural variant." ) protected List structureVariant; - private static final long serialVersionUID = -1713460757L; + private static final long serialVersionUID = 2091706446L; /** * Constructor @@ -3616,14 +4087,13 @@ public class Sequence extends DomainResource { /** * Constructor */ - public Sequence(Enumeration type, IntegerType coordinateSystem) { + public Sequence(IntegerType coordinateSystem) { super(); - this.type = type; this.coordinateSystem = coordinateSystem; } /** - * @return {@link #identifier} (A unique identifier for this particular sequence instance.) + * @return {@link #identifier} (A unique identifier for this particular sequence instance. This is a FHIR-defined id.) */ public List getIdentifier() { if (this.identifier == null) @@ -3676,7 +4146,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #type} (Amino acid / cDNA transcript / RNA variant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + * @return {@link #type} (Amino Acid Sequence/ DNA Sequence / RNA Sequence.). 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) @@ -3696,7 +4166,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #type} (Amino acid / cDNA transcript / RNA variant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + * @param value {@link #type} (Amino Acid Sequence/ DNA Sequence / RNA Sequence.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value */ public Sequence setTypeElement(Enumeration value) { this.type = value; @@ -3704,24 +4174,28 @@ public class Sequence extends DomainResource { } /** - * @return Amino acid / cDNA transcript / RNA variant. + * @return Amino Acid Sequence/ DNA Sequence / RNA Sequence. */ public SequenceType getType() { return this.type == null ? null : this.type.getValue(); } /** - * @param value Amino acid / cDNA transcript / RNA variant. + * @param value Amino Acid Sequence/ DNA Sequence / RNA Sequence. */ public Sequence setType(SequenceType value) { + if (value == null) + this.type = null; + else { if (this.type == null) this.type = new Enumeration(new SequenceTypeEnumFactory()); this.type.setValue(value); + } return this; } /** - * @return {@link #coordinateSystem} (Whether the sequence is numbered starting at 0 (0-based numbering or coordinates) or starting at 1 (1-based numbering). Values are "0" for 0-based numbering and "1" for one-based.). This is the underlying object with id, value and extensions. The accessor "getCoordinateSystem" gives direct access to the value + * @return {@link #coordinateSystem} (Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).). This is the underlying object with id, value and extensions. The accessor "getCoordinateSystem" gives direct access to the value */ public IntegerType getCoordinateSystemElement() { if (this.coordinateSystem == null) @@ -3741,7 +4215,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #coordinateSystem} (Whether the sequence is numbered starting at 0 (0-based numbering or coordinates) or starting at 1 (1-based numbering). Values are "0" for 0-based numbering and "1" for one-based.). This is the underlying object with id, value and extensions. The accessor "getCoordinateSystem" gives direct access to the value + * @param value {@link #coordinateSystem} (Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).). This is the underlying object with id, value and extensions. The accessor "getCoordinateSystem" gives direct access to the value */ public Sequence setCoordinateSystemElement(IntegerType value) { this.coordinateSystem = value; @@ -3749,14 +4223,14 @@ public class Sequence extends DomainResource { } /** - * @return Whether the sequence is numbered starting at 0 (0-based numbering or coordinates) or starting at 1 (1-based numbering). Values are "0" for 0-based numbering and "1" for one-based. + * @return Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end). */ public int getCoordinateSystem() { return this.coordinateSystem == null || this.coordinateSystem.isEmpty() ? 0 : this.coordinateSystem.getValue(); } /** - * @param value Whether the sequence is numbered starting at 0 (0-based numbering or coordinates) or starting at 1 (1-based numbering). Values are "0" for 0-based numbering and "1" for one-based. + * @param value Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end). */ public Sequence setCoordinateSystem(int value) { if (this.coordinateSystem == null) @@ -3898,7 +4372,51 @@ public class Sequence extends DomainResource { } /** - * @return {@link #quantity} (Quantity of the sequence.) + * @return {@link #performer} (The organization or lab that should be responsible for this result.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); // cc + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (The organization or lab that should be responsible for this result.) + */ + public Sequence setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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 or lab that should be responsible for this result.) + */ + public Organization getPerformerTarget() { + if (this.performerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Sequence.performer"); + else if (Configuration.doAutoCreate()) + this.performerTarget = new Organization(); // aa + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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 or lab that should be responsible for this result.) + */ + public Sequence setPerformerTarget(Organization value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #quantity} (The number of copies of the seqeunce of interest. (RNASeq).) */ public Quantity getQuantity() { if (this.quantity == null) @@ -3914,7 +4432,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #quantity} (Quantity of the sequence.) + * @param value {@link #quantity} (The number of copies of the seqeunce of interest. (RNASeq).) */ public Sequence setQuantity(Quantity value) { this.quantity = value; @@ -3922,7 +4440,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #referenceSeq} (A reference sequence is a sequence that is used to represent an allele or variant.) + * @return {@link #referenceSeq} (A sequence that is used as a reference to describe variants that are present in a sequence analyzed.) */ public SequenceReferenceSeqComponent getReferenceSeq() { if (this.referenceSeq == null) @@ -3938,7 +4456,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #referenceSeq} (A reference sequence is a sequence that is used to represent an allele or variant.) + * @param value {@link #referenceSeq} (A sequence that is used as a reference to describe variants that are present in a sequence analyzed.) */ public Sequence setReferenceSeq(SequenceReferenceSeqComponent value) { this.referenceSeq = value; @@ -3946,7 +4464,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #variant} (A' is a variant (mutation) of A = definition every instance of A' is either an immediate mutation of some instance of A, or there is a chain of immediate mutation processes linking A' to some instance of A ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)).) + * @return {@link #variant} (The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string.) */ public List getVariant() { if (this.variant == null) @@ -3999,7 +4517,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #observedSeq} (Sequence that was observed.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value + * @return {@link #observedSeq} (Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value */ public StringType getObservedSeqElement() { if (this.observedSeq == null) @@ -4019,7 +4537,7 @@ public class Sequence extends DomainResource { } /** - * @param value {@link #observedSeq} (Sequence that was observed.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value + * @param value {@link #observedSeq} (Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value */ public Sequence setObservedSeqElement(StringType value) { this.observedSeq = value; @@ -4027,14 +4545,14 @@ public class Sequence extends DomainResource { } /** - * @return Sequence that was observed. + * @return Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd. */ public String getObservedSeq() { return this.observedSeq == null ? null : this.observedSeq.getValue(); } /** - * @param value Sequence that was observed. + * @param value Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd. */ public Sequence setObservedSeq(String value) { if (Utilities.noString(value)) @@ -4146,7 +4664,7 @@ public class Sequence extends DomainResource { } /** - * @return {@link #repository} (Configurations of the external repository.) + * @return {@link #repository} (Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.) */ public List getRepository() { if (this.repository == null) @@ -4328,19 +4846,20 @@ public class Sequence extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier for this particular sequence instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "code", "Amino acid / cDNA transcript / RNA variant.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("coordinateSystem", "integer", "Whether the sequence is numbered starting at 0 (0-based numbering or coordinates) or starting at 1 (1-based numbering). Values are \"0\" for 0-based numbering and \"1\" for one-based.", 0, java.lang.Integer.MAX_VALUE, coordinateSystem)); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier for this particular sequence instance. This is a FHIR-defined id.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "code", "Amino Acid Sequence/ DNA Sequence / RNA Sequence.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("coordinateSystem", "integer", "Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).", 0, java.lang.Integer.MAX_VALUE, coordinateSystem)); childrenList.add(new Property("patient", "Reference(Patient)", "The patient whose sequencing results are described by this resource.", 0, java.lang.Integer.MAX_VALUE, patient)); childrenList.add(new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, java.lang.Integer.MAX_VALUE, specimen)); childrenList.add(new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("quantity", "Quantity", "Quantity of the sequence.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("referenceSeq", "", "A reference sequence is a sequence that is used to represent an allele or variant.", 0, java.lang.Integer.MAX_VALUE, referenceSeq)); - childrenList.add(new Property("variant", "", "A' is a variant (mutation) of A = definition every instance of A' is either an immediate mutation of some instance of A, or there is a chain of immediate mutation processes linking A' to some instance of A ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)).", 0, java.lang.Integer.MAX_VALUE, variant)); - childrenList.add(new Property("observedSeq", "string", "Sequence that was observed.", 0, java.lang.Integer.MAX_VALUE, observedSeq)); + childrenList.add(new Property("performer", "Reference(Organization)", "The organization or lab that should be responsible for this result.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("quantity", "Quantity", "The number of copies of the seqeunce of interest. (RNASeq).", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("referenceSeq", "", "A sequence that is used as a reference to describe variants that are present in a sequence analyzed.", 0, java.lang.Integer.MAX_VALUE, referenceSeq)); + childrenList.add(new Property("variant", "", "The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string.", 0, java.lang.Integer.MAX_VALUE, variant)); + childrenList.add(new Property("observedSeq", "string", "Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.", 0, java.lang.Integer.MAX_VALUE, observedSeq)); childrenList.add(new Property("quality", "", "An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)).", 0, java.lang.Integer.MAX_VALUE, quality)); childrenList.add(new Property("readCoverage", "integer", "Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.", 0, java.lang.Integer.MAX_VALUE, readCoverage)); - childrenList.add(new Property("repository", "", "Configurations of the external repository.", 0, java.lang.Integer.MAX_VALUE, repository)); + childrenList.add(new Property("repository", "", "Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.", 0, java.lang.Integer.MAX_VALUE, repository)); childrenList.add(new Property("pointer", "Reference(Sequence)", "Pointer to next atomic sequence which at most contains one variant.", 0, java.lang.Integer.MAX_VALUE, pointer)); childrenList.add(new Property("structureVariant", "", "Structural variant.", 0, java.lang.Integer.MAX_VALUE, structureVariant)); } @@ -4354,6 +4873,7 @@ public class Sequence extends DomainResource { case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference + case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity case -502547180: /*referenceSeq*/ return this.referenceSeq == null ? new Base[0] : new Base[] {this.referenceSeq}; // SequenceReferenceSeqComponent case 236785797: /*variant*/ return this.variant == null ? new Base[0] : this.variant.toArray(new Base[this.variant.size()]); // SequenceVariantComponent @@ -4389,6 +4909,9 @@ public class Sequence extends DomainResource { case -1335157162: // device this.device = castToReference(value); // Reference break; + case 481140686: // performer + this.performer = castToReference(value); // Reference + break; case -1285004149: // quantity this.quantity = castToQuantity(value); // Quantity break; @@ -4435,6 +4958,8 @@ public class Sequence extends DomainResource { this.specimen = castToReference(value); // Reference else if (name.equals("device")) this.device = castToReference(value); // Reference + else if (name.equals("performer")) + this.performer = castToReference(value); // Reference else if (name.equals("quantity")) this.quantity = castToQuantity(value); // Quantity else if (name.equals("referenceSeq")) @@ -4466,6 +4991,7 @@ public class Sequence extends DomainResource { case -791418107: return getPatient(); // Reference case -2132868344: return getSpecimen(); // Reference case -1335157162: return getDevice(); // Reference + case 481140686: return getPerformer(); // Reference case -1285004149: return getQuantity(); // Quantity case -502547180: return getReferenceSeq(); // SequenceReferenceSeqComponent case 236785797: return addVariant(); // SequenceVariantComponent @@ -4503,6 +5029,10 @@ public class Sequence extends DomainResource { this.device = new Reference(); return this.device; } + else if (name.equals("performer")) { + this.performer = new Reference(); + return this.performer; + } else if (name.equals("quantity")) { this.quantity = new Quantity(); return this.quantity; @@ -4554,6 +5084,7 @@ public class Sequence extends DomainResource { dst.patient = patient == null ? null : patient.copy(); dst.specimen = specimen == null ? null : specimen.copy(); dst.device = device == null ? null : device.copy(); + dst.performer = performer == null ? null : performer.copy(); dst.quantity = quantity == null ? null : quantity.copy(); dst.referenceSeq = referenceSeq == null ? null : referenceSeq.copy(); if (variant != null) { @@ -4599,9 +5130,10 @@ public class Sequence extends DomainResource { Sequence o = (Sequence) other; return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(coordinateSystem, o.coordinateSystem, true) && compareDeep(patient, o.patient, true) && compareDeep(specimen, o.specimen, true) && compareDeep(device, o.device, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(referenceSeq, o.referenceSeq, true) && compareDeep(variant, o.variant, true) - && compareDeep(observedSeq, o.observedSeq, true) && compareDeep(quality, o.quality, true) && compareDeep(readCoverage, o.readCoverage, true) - && compareDeep(repository, o.repository, true) && compareDeep(pointer, o.pointer, true) && compareDeep(structureVariant, o.structureVariant, true) + && compareDeep(performer, o.performer, true) && compareDeep(quantity, o.quantity, true) && compareDeep(referenceSeq, o.referenceSeq, true) + && compareDeep(variant, o.variant, true) && compareDeep(observedSeq, o.observedSeq, true) && compareDeep(quality, o.quality, true) + && compareDeep(readCoverage, o.readCoverage, true) && compareDeep(repository, o.repository, true) + && compareDeep(pointer, o.pointer, true) && compareDeep(structureVariant, o.structureVariant, true) ; } @@ -4619,8 +5151,8 @@ public class Sequence extends DomainResource { public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, coordinateSystem - , patient, specimen, device, quantity, referenceSeq, variant, observedSeq, quality - , readCoverage, repository, pointer, structureVariant); + , patient, specimen, device, performer, quantity, referenceSeq, variant, observedSeq + , quality, readCoverage, repository, pointer, structureVariant); } @Override @@ -4628,20 +5160,40 @@ public class Sequence extends DomainResource { return ResourceType.Sequence; } + /** + * Search parameter: identifier + *

+ * Description: The unique identity for a particular sequence
+ * Type: token
+ * Path: Sequence.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Sequence.identifier", description="The unique identity for a particular sequence", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The unique identity for a particular sequence
+ * Type: token
+ * Path: Sequence.identifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); + /** * Search parameter: coordinate *

- * Description: Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`
+ * Description: Search parameter for region of the reference DNA sequence string. This will refer to part of a locus or part of a gene where search region will be represented in 1-based system. Since the coordinateSystem can either be 0-based or 1-based, this search query will include the result of both coordinateSystem that contains the equivalent segment of the gene or whole genome sequence. For example, a search for sequence can be represented as `coordinate=1$lt345$gt123`, this means it will search for the Sequence resource on chromosome 1 and with position >123 and <345, where in 1-based system resource, all strings within region 1:124-344 will be revealed, while in 0-based system resource, all strings within region 1:123-344 will be revealed. You may want to check detail about 0-based v.s. 1-based above.
* Type: composite
* Path:
*

*/ - @SearchParamDefinition(name="coordinate", path="", description="Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`", type="composite", compositeOf={"chromosome", "start"} ) + @SearchParamDefinition(name="coordinate", path="Sequence.variant", description="Search parameter for region of the reference DNA sequence string. This will refer to part of a locus or part of a gene where search region will be represented in 1-based system. Since the coordinateSystem can either be 0-based or 1-based, this search query will include the result of both coordinateSystem that contains the equivalent segment of the gene or whole genome sequence. For example, a search for sequence can be represented as `coordinate=1$lt345$gt123`, this means it will search for the Sequence resource on chromosome 1 and with position >123 and <345, where in 1-based system resource, all strings within region 1:124-344 will be revealed, while in 0-based system resource, all strings within region 1:123-344 will be revealed. You may want to check detail about 0-based v.s. 1-based above.", type="composite", compositeOf={"chromosome", "start"} ) public static final String SP_COORDINATE = "coordinate"; /** * Fluent Client search parameter constant for coordinate *

- * Description: Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`
+ * Description: Search parameter for region of the reference DNA sequence string. This will refer to part of a locus or part of a gene where search region will be represented in 1-based system. Since the coordinateSystem can either be 0-based or 1-based, this search query will include the result of both coordinateSystem that contains the equivalent segment of the gene or whole genome sequence. For example, a search for sequence can be represented as `coordinate=1$lt345$gt123`, this means it will search for the Sequence resource on chromosome 1 and with position >123 and <345, where in 1-based system resource, all strings within region 1:124-344 will be revealed, while in 0-based system resource, all strings within region 1:123-344 will be revealed. You may want to check detail about 0-based v.s. 1-based above.
* Type: composite
* Path:
*

@@ -4677,17 +5229,17 @@ public class Sequence extends DomainResource { /** * Search parameter: chromosome *

- * Description: Chromosome of the sequence
+ * Description: Chromosome number of the reference sequence
* Type: token
* Path: Sequence.referenceSeq.chromosome
*

*/ - @SearchParamDefinition(name="chromosome", path="Sequence.referenceSeq.chromosome", description="Chromosome of the sequence", type="token" ) + @SearchParamDefinition(name="chromosome", path="Sequence.referenceSeq.chromosome", description="Chromosome number of the reference sequence", type="token" ) public static final String SP_CHROMOSOME = "chromosome"; /** * Fluent Client search parameter constant for chromosome *

- * Description: Chromosome of the sequence
+ * Description: Chromosome number of the reference sequence
* Type: token
* Path: Sequence.referenceSeq.chromosome
*

@@ -4697,19 +5249,19 @@ public class Sequence extends DomainResource { /** * Search parameter: start *

- * Description: Start position (0-based inclusive) of the sequence
+ * Description: Start position (0-based inclusive, 1-based inclusive, that means the nucleic acid or amino acid at this position will be included) of the reference sequence.
* Type: number
- * Path: Sequence.variant.start
+ * Path: Sequence.referenceSeq.windowStart
*

*/ - @SearchParamDefinition(name="start", path="Sequence.variant.start", description="Start position (0-based inclusive) of the sequence", type="number" ) + @SearchParamDefinition(name="start", path="Sequence.referenceSeq.windowStart", description="Start position (0-based inclusive, 1-based inclusive, that means the nucleic acid or amino acid at this position will be included) of the reference sequence.", type="number" ) public static final String SP_START = "start"; /** * Fluent Client search parameter constant for start *

- * Description: Start position (0-based inclusive) of the sequence
+ * Description: Start position (0-based inclusive, 1-based inclusive, that means the nucleic acid or amino acid at this position will be included) of the reference sequence.
* Type: number
- * Path: Sequence.variant.start
+ * Path: Sequence.referenceSeq.windowStart
*

*/ public static final ca.uhn.fhir.rest.gclient.NumberClientParam START = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_START); @@ -4717,19 +5269,19 @@ public class Sequence extends DomainResource { /** * Search parameter: end *

- * Description: End position (0-based exclusive) of the sequence
+ * Description: End position (0-based exclusive, which menas the acid at this position will not be included, 1-based inclusive, which means the acid at this position will be included) of the reference sequence.
* Type: number
- * Path: Sequence.variant.end
+ * Path: Sequence.referenceSeq.windowEnd
*

*/ - @SearchParamDefinition(name="end", path="Sequence.variant.end", description="End position (0-based exclusive) of the sequence", type="number" ) + @SearchParamDefinition(name="end", path="Sequence.referenceSeq.windowEnd", description="End position (0-based exclusive, which menas the acid at this position will not be included, 1-based inclusive, which means the acid at this position will be included) of the reference sequence.", type="number" ) public static final String SP_END = "end"; /** * Fluent Client search parameter constant for end *

- * Description: End position (0-based exclusive) of the sequence
+ * Description: End position (0-based exclusive, which menas the acid at this position will not be included, 1-based inclusive, which means the acid at this position will be included) of the reference sequence.
* Type: number
- * Path: Sequence.variant.end
+ * Path: Sequence.referenceSeq.windowEnd
*

*/ public static final ca.uhn.fhir.rest.gclient.NumberClientParam END = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_END); @@ -4737,17 +5289,17 @@ public class Sequence extends DomainResource { /** * Search parameter: type *

- * Description: The type of the variant: Amino acid / cDNA transcript / RNA variant.
+ * Description: Amino Acid Sequence/ DNA Sequence / RNA Sequence
* Type: token
* Path: Sequence.type
*

*/ - @SearchParamDefinition(name="type", path="Sequence.type", description="The type of the variant: Amino acid / cDNA transcript / RNA variant.", type="token" ) + @SearchParamDefinition(name="type", path="Sequence.type", description="Amino Acid Sequence/ DNA Sequence / RNA Sequence", type="token" ) public static final String SP_TYPE = "type"; /** * Fluent Client search parameter constant for type *

- * Description: The type of the variant: Amino acid / cDNA transcript / RNA variant.
+ * Description: Amino Acid Sequence/ DNA Sequence / RNA Sequence
* Type: token
* Path: Sequence.type
*

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ServiceDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ServiceDefinition.java index 1e72482d0fb..f52480e5ffd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ServiceDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ServiceDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Signature.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Signature.java index 297aa291d6e..68ed80ffbc7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Signature.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Signature.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SimpleQuantity.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SimpleQuantity.java index fb0f4ab5473..a3a2d76a341 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SimpleQuantity.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SimpleQuantity.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import ca.uhn.fhir.model.api.annotation.DatatypeDef; import ca.uhn.fhir.model.api.annotation.Block; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Slot.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Slot.java index 17104512652..999749ddac2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Slot.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Slot.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Specimen.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Specimen.java index 358870673e9..4b17da38c13 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Specimen.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Specimen.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/StructureDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/StructureDefinition.java index f830168bf6d..a816eacdbf4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/StructureDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/StructureDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -1093,10 +1093,10 @@ public class StructureDefinition extends MetadataResource { protected List keyword; /** - * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version. + * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version. */ @Child(name = "fhirVersion", type = {IdType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="FHIR Version this StructureDefinition targets", formalDefinition="The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version." ) + @Description(shortDefinition="FHIR Version this StructureDefinition targets", formalDefinition="The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version." ) protected IdType fhirVersion; /** @@ -1115,10 +1115,10 @@ public class StructureDefinition extends MetadataResource { protected Enumeration kind; /** - * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + * Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems. */ @Child(name = "abstract", type = {BooleanType.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether the structure is abstract", formalDefinition="Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type." ) + @Description(shortDefinition="Whether the structure is abstract", formalDefinition="Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems." ) protected BooleanType abstract_; /** @@ -1991,7 +1991,7 @@ public class StructureDefinition extends MetadataResource { } /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + * @return {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value */ public IdType getFhirVersionElement() { if (this.fhirVersion == null) @@ -2011,7 +2011,7 @@ public class StructureDefinition extends MetadataResource { } /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value */ public StructureDefinition setFhirVersionElement(IdType value) { this.fhirVersion = value; @@ -2019,14 +2019,14 @@ public class StructureDefinition extends MetadataResource { } /** - * @return The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version. + * @return The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version. */ public String getFhirVersion() { return this.fhirVersion == null ? null : this.fhirVersion.getValue(); } /** - * @param value The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version. + * @param value The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version. */ public StructureDefinition setFhirVersion(String value) { if (Utilities.noString(value)) @@ -2138,7 +2138,7 @@ public class StructureDefinition extends MetadataResource { } /** - * @return {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + * @return {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value */ public BooleanType getAbstractElement() { if (this.abstract_ == null) @@ -2158,7 +2158,7 @@ public class StructureDefinition extends MetadataResource { } /** - * @param value {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + * @param value {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value */ public StructureDefinition setAbstractElement(BooleanType value) { this.abstract_ = value; @@ -2166,14 +2166,14 @@ public class StructureDefinition extends MetadataResource { } /** - * @return Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + * @return Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems. */ public boolean getAbstract() { return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); } /** - * @param value Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + * @param value Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems. */ public StructureDefinition setAbstract(boolean value) { if (this.abstract_ == null) @@ -2562,10 +2562,10 @@ public class StructureDefinition extends MetadataResource { childrenList.add(new Property("purpose", "markdown", "Explains why this structure definition is needed and why it has been designed as it has.", 0, java.lang.Integer.MAX_VALUE, purpose)); childrenList.add(new Property("copyright", "markdown", "A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.", 0, java.lang.Integer.MAX_VALUE, copyright)); childrenList.add(new Property("keyword", "Coding", "A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, keyword)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); childrenList.add(new Property("kind", "code", "Defines the kind of structure that this definition is describing.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("abstract", "boolean", "Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("abstract", "boolean", "Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems.", 0, java.lang.Integer.MAX_VALUE, abstract_)); childrenList.add(new Property("contextType", "code", "If this is an extension, Identifies the context within FHIR resources where the extension can be used.", 0, java.lang.Integer.MAX_VALUE, contextType)); childrenList.add(new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context)); childrenList.add(new Property("contextInvariant", "string", "A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurance variants for the extension).", 0, java.lang.Integer.MAX_VALUE, contextInvariant)); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/StructureMap.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/StructureMap.java index 975a0cc6c0f..445a325ebb4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/StructureMap.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/StructureMap.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -2480,17 +2480,38 @@ public class StructureMap extends MetadataResource { @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-context-type") protected Enumeration contextType; + /** + * Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content. + */ + @Child(name = "min", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specified minimum cardinality", formalDefinition="Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content." ) + protected IntegerType min; + + /** + * Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value). + */ + @Child(name = "max", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Specified maximum cardinality (number or *)", formalDefinition="Specified maximum cardinality for the element - a number or a \"*\". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value)." ) + protected StringType max; + + /** + * Specified type for the element. This works as a condition on the mapping - use for polymorphic elements. + */ + @Child(name = "type", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Type for this source", formalDefinition="Specified type for the element. This works as a condition on the mapping - use for polymorphic elements." ) + protected StringType type; + /** * Optional field for this source. */ - @Child(name = "element", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) + @Child(name = "element", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Optional field for this source", formalDefinition="Optional field for this source." ) protected StringType element; /** * How to handle the list mode for this element. */ - @Child(name = "listMode", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Child(name = "listMode", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="first | share | last", formalDefinition="How to handle the list mode for this element." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-list-mode") protected Enumeration listMode; @@ -2498,25 +2519,25 @@ public class StructureMap extends MetadataResource { /** * Named context for field, if a field is specified. */ - @Child(name = "variable", type = {IdType.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Child(name = "variable", type = {IdType.class}, order=9, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Named context for field, if a field is specified", formalDefinition="Named context for field, if a field is specified." ) protected IdType variable; /** * FluentPath expression - must be true or the rule does not apply. */ - @Child(name = "condition", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) + @Child(name = "condition", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="FluentPath expression - must be true or the rule does not apply", formalDefinition="FluentPath expression - must be true or the rule does not apply." ) protected StringType condition; /** * FluentPath expression - must be true or the mapping engine throws an error instead of completing. */ - @Child(name = "check", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Child(name = "check", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="FluentPath expression - must be true or the mapping engine throws an error instead of completing", formalDefinition="FluentPath expression - must be true or the mapping engine throws an error instead of completing." ) protected StringType check; - private static final long serialVersionUID = -1039728628L; + private static final long serialVersionUID = 825856092L; /** * Constructor @@ -2670,6 +2691,149 @@ public class StructureMap extends MetadataResource { return this; } + /** + * @return {@link #min} (Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.). 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 StructureMapGroupRuleSourceComponent.min"); + else if (Configuration.doAutoCreate()) + this.min = new IntegerType(); // bb + 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} (Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setMinElement(IntegerType value) { + this.min = value; + return this; + } + + /** + * @return Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content. + */ + public int getMin() { + return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); + } + + /** + * @param value Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content. + */ + public StructureMapGroupRuleSourceComponent setMin(int value) { + if (this.min == null) + this.min = new IntegerType(); + this.min.setValue(value); + return this; + } + + /** + * @return {@link #max} (Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).). 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 StructureMapGroupRuleSourceComponent.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); // bb + 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} (Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value). + */ + public String getMax() { + return this.max == null ? null : this.max.getValue(); + } + + /** + * @param value Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value). + */ + public StructureMapGroupRuleSourceComponent setMax(String value) { + if (Utilities.noString(value)) + this.max = null; + else { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StringType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new StringType(); // bb + 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} (Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StructureMapGroupRuleSourceComponent setTypeElement(StringType value) { + this.type = value; + return this; + } + + /** + * @return Specified type for the element. This works as a condition on the mapping - use for polymorphic elements. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Specified type for the element. This works as a condition on the mapping - use for polymorphic elements. + */ + public StructureMapGroupRuleSourceComponent setType(String value) { + if (Utilities.noString(value)) + this.type = null; + else { + if (this.type == null) + this.type = new StringType(); + this.type.setValue(value); + } + return this; + } + /** * @return {@link #element} (Optional field for this source.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value */ @@ -2920,6 +3084,9 @@ public class StructureMap extends MetadataResource { childrenList.add(new Property("required", "boolean", "Whether this rule applies if the source isn't found.", 0, java.lang.Integer.MAX_VALUE, required)); childrenList.add(new Property("context", "id", "Type or variable this rule applies to.", 0, java.lang.Integer.MAX_VALUE, context)); childrenList.add(new Property("contextType", "code", "How to interpret the context.", 0, java.lang.Integer.MAX_VALUE, contextType)); + childrenList.add(new Property("min", "integer", "Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.", 0, java.lang.Integer.MAX_VALUE, min)); + childrenList.add(new Property("max", "string", "Specified maximum cardinality for the element - a number or a \"*\". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).", 0, java.lang.Integer.MAX_VALUE, max)); + childrenList.add(new Property("type", "string", "Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("element", "string", "Optional field for this source.", 0, java.lang.Integer.MAX_VALUE, element)); childrenList.add(new Property("listMode", "code", "How to handle the list mode for this element.", 0, java.lang.Integer.MAX_VALUE, listMode)); childrenList.add(new Property("variable", "id", "Named context for field, if a field is specified.", 0, java.lang.Integer.MAX_VALUE, variable)); @@ -2933,6 +3100,9 @@ public class StructureMap extends MetadataResource { case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // IdType case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration + case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType + case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType + case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // StringType case 1345445729: /*listMode*/ return this.listMode == null ? new Base[0] : new Base[] {this.listMode}; // Enumeration case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : new Base[] {this.variable}; // IdType @@ -2955,6 +3125,15 @@ public class StructureMap extends MetadataResource { case -102839927: // contextType this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration break; + case 108114: // min + this.min = castToInteger(value); // IntegerType + break; + case 107876: // max + this.max = castToString(value); // StringType + break; + case 3575610: // type + this.type = castToString(value); // StringType + break; case -1662836996: // element this.element = castToString(value); // StringType break; @@ -2983,6 +3162,12 @@ public class StructureMap extends MetadataResource { this.context = castToId(value); // IdType else if (name.equals("contextType")) this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration + else if (name.equals("min")) + this.min = castToInteger(value); // IntegerType + else if (name.equals("max")) + this.max = castToString(value); // StringType + else if (name.equals("type")) + this.type = castToString(value); // StringType else if (name.equals("element")) this.element = castToString(value); // StringType else if (name.equals("listMode")) @@ -3003,6 +3188,9 @@ public class StructureMap extends MetadataResource { case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // BooleanType case 951530927: throw new FHIRException("Cannot make property context as it is not a complex type"); // IdType case -102839927: throw new FHIRException("Cannot make property contextType as it is not a complex type"); // Enumeration + case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType + case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType + case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // StringType case -1662836996: throw new FHIRException("Cannot make property element as it is not a complex type"); // StringType case 1345445729: throw new FHIRException("Cannot make property listMode as it is not a complex type"); // Enumeration case -1249586564: throw new FHIRException("Cannot make property variable as it is not a complex type"); // IdType @@ -3024,6 +3212,15 @@ public class StructureMap extends MetadataResource { else if (name.equals("contextType")) { throw new FHIRException("Cannot call addChild on a primitive type StructureMap.contextType"); } + else if (name.equals("min")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.min"); + } + else if (name.equals("max")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.max"); + } + else if (name.equals("type")) { + throw new FHIRException("Cannot call addChild on a primitive type StructureMap.type"); + } else if (name.equals("element")) { throw new FHIRException("Cannot call addChild on a primitive type StructureMap.element"); } @@ -3049,6 +3246,9 @@ public class StructureMap extends MetadataResource { dst.required = required == null ? null : required.copy(); dst.context = context == null ? null : context.copy(); dst.contextType = contextType == null ? null : contextType.copy(); + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + dst.type = type == null ? null : type.copy(); dst.element = element == null ? null : element.copy(); dst.listMode = listMode == null ? null : listMode.copy(); dst.variable = variable == null ? null : variable.copy(); @@ -3065,6 +3265,7 @@ public class StructureMap extends MetadataResource { return false; StructureMapGroupRuleSourceComponent o = (StructureMapGroupRuleSourceComponent) other; return compareDeep(required, o.required, true) && compareDeep(context, o.context, true) && compareDeep(contextType, o.contextType, true) + && compareDeep(min, o.min, true) && compareDeep(max, o.max, true) && compareDeep(type, o.type, true) && compareDeep(element, o.element, true) && compareDeep(listMode, o.listMode, true) && compareDeep(variable, o.variable, true) && compareDeep(condition, o.condition, true) && compareDeep(check, o.check, true); } @@ -3077,13 +3278,14 @@ public class StructureMap extends MetadataResource { return false; StructureMapGroupRuleSourceComponent o = (StructureMapGroupRuleSourceComponent) other; return compareValues(required, o.required, true) && compareValues(context, o.context, true) && compareValues(contextType, o.contextType, true) + && compareValues(min, o.min, true) && compareValues(max, o.max, true) && compareValues(type, o.type, true) && compareValues(element, o.element, true) && compareValues(listMode, o.listMode, true) && compareValues(variable, o.variable, true) && compareValues(condition, o.condition, true) && compareValues(check, o.check, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(required, context, contextType - , element, listMode, variable, condition, check); + , min, max, type, element, listMode, variable, condition, check); } public String fhirType() { diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Subscription.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Subscription.java index 8ac28ce85e3..b1d99ed7e10 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Subscription.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Subscription.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Substance.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Substance.java index ecbd3737f3b..2cee4283c00 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Substance.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Substance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SupplyDelivery.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SupplyDelivery.java index 40738745549..a3ed030c751 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SupplyDelivery.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SupplyDelivery.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SupplyRequest.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SupplyRequest.java index 527278dbd85..c1c13efcd57 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SupplyRequest.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/SupplyRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Task.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Task.java index b617db9815f..98f46350e29 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Task.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Task.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -54,7 +54,7 @@ public class Task extends DomainResource { */ DRAFT, /** - * The task is ready to be acted upon + * The task is ready to be acted upon and action is sought */ REQUESTED, /** @@ -73,6 +73,10 @@ public class Task extends DomainResource { * Task is ready to be performed, but no action has yet been taken. Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given. */ READY, + /** + * the task was not completed (more or less) as requested + */ + CANCELLED, /** * Task has been started but is not yet complete. */ @@ -89,6 +93,10 @@ public class Task extends DomainResource { * The task has been completed (more or less) as requested. */ COMPLETED, + /** + * The task should never have existed and is retained only because of the possibility it may have used + */ + ENTEREDINERROR, /** * added to help the parsers with the generic types */ @@ -108,6 +116,8 @@ public class Task extends DomainResource { return REJECTED; if ("ready".equals(codeString)) return READY; + if ("cancelled".equals(codeString)) + return CANCELLED; if ("in-progress".equals(codeString)) return INPROGRESS; if ("on-hold".equals(codeString)) @@ -116,6 +126,8 @@ public class Task extends DomainResource { return FAILED; if ("completed".equals(codeString)) return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; if (Configuration.isAcceptInvalidEnums()) return null; else @@ -129,10 +141,12 @@ public class Task extends DomainResource { case ACCEPTED: return "accepted"; case REJECTED: return "rejected"; case READY: return "ready"; + case CANCELLED: return "cancelled"; case INPROGRESS: return "in-progress"; case ONHOLD: return "on-hold"; case FAILED: return "failed"; case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; default: return "?"; } } @@ -144,25 +158,29 @@ public class Task extends DomainResource { case ACCEPTED: return "http://hl7.org/fhir/task-status"; case REJECTED: return "http://hl7.org/fhir/task-status"; case READY: return "http://hl7.org/fhir/task-status"; + case CANCELLED: return "http://hl7.org/fhir/task-status"; case INPROGRESS: return "http://hl7.org/fhir/task-status"; case ONHOLD: return "http://hl7.org/fhir/task-status"; case FAILED: return "http://hl7.org/fhir/task-status"; case COMPLETED: return "http://hl7.org/fhir/task-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/task-status"; default: return "?"; } } public String getDefinition() { switch (this) { case DRAFT: return "The task is not yet ready to be acted upon."; - case REQUESTED: return "The task is ready to be acted upon"; + case REQUESTED: return "The task is ready to be acted upon and action is sought"; case RECEIVED: return "A potential performer has claimed ownership of the task and is evaluating whether to perform it"; case ACCEPTED: return "The potential performer has agreed to execute the task but has not yet started work"; case REJECTED: return "The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action."; case READY: return "Task is ready to be performed, but no action has yet been taken. Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given."; + case CANCELLED: return "the task was not completed (more or less) as requested"; case INPROGRESS: return "Task has been started but is not yet complete."; case ONHOLD: return "Task has been started but work has been paused"; case FAILED: return "The task was attempted but could not be completed due to some error."; case COMPLETED: return "The task has been completed (more or less) as requested."; + case ENTEREDINERROR: return "The task should never have existed and is retained only because of the possibility it may have used"; default: return "?"; } } @@ -174,10 +192,12 @@ public class Task extends DomainResource { case ACCEPTED: return "Accepted"; case REJECTED: return "Rejected"; case READY: return "Ready"; + case CANCELLED: return "Cancelled"; case INPROGRESS: return "In Progress"; case ONHOLD: return "On Hold"; case FAILED: return "Failed"; case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -200,6 +220,8 @@ public class Task extends DomainResource { return TaskStatus.REJECTED; if ("ready".equals(codeString)) return TaskStatus.READY; + if ("cancelled".equals(codeString)) + return TaskStatus.CANCELLED; if ("in-progress".equals(codeString)) return TaskStatus.INPROGRESS; if ("on-hold".equals(codeString)) @@ -208,6 +230,8 @@ public class Task extends DomainResource { return TaskStatus.FAILED; if ("completed".equals(codeString)) return TaskStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return TaskStatus.ENTEREDINERROR; throw new IllegalArgumentException("Unknown TaskStatus code '"+codeString+"'"); } public Enumeration fromType(Base code) throws FHIRException { @@ -228,6 +252,8 @@ public class Task extends DomainResource { return new Enumeration(this, TaskStatus.REJECTED); if ("ready".equals(codeString)) return new Enumeration(this, TaskStatus.READY); + if ("cancelled".equals(codeString)) + return new Enumeration(this, TaskStatus.CANCELLED); if ("in-progress".equals(codeString)) return new Enumeration(this, TaskStatus.INPROGRESS); if ("on-hold".equals(codeString)) @@ -236,6 +262,8 @@ public class Task extends DomainResource { return new Enumeration(this, TaskStatus.FAILED); if ("completed".equals(codeString)) return new Enumeration(this, TaskStatus.COMPLETED); + if ("entered-in-error".equals(codeString)) + return new Enumeration(this, TaskStatus.ENTEREDINERROR); throw new FHIRException("Unknown TaskStatus code '"+codeString+"'"); } public String toCode(TaskStatus code) { @@ -251,6 +279,8 @@ public class Task extends DomainResource { return "rejected"; if (code == TaskStatus.READY) return "ready"; + if (code == TaskStatus.CANCELLED) + return "cancelled"; if (code == TaskStatus.INPROGRESS) return "in-progress"; if (code == TaskStatus.ONHOLD) @@ -259,6 +289,8 @@ public class Task extends DomainResource { return "failed"; if (code == TaskStatus.COMPLETED) return "completed"; + if (code == TaskStatus.ENTEREDINERROR) + return "entered-in-error"; return "?"; } public String toSystem(TaskStatus code) { @@ -266,19 +298,211 @@ public class Task extends DomainResource { } } + public enum TaskIntent { + /** + * The request is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act + */ + PROPOSAL, + /** + * The request represents an intension to ensure something occurs without providing an authorization for others to act + */ + PLAN, + /** + * The request represents a request/demand and authorization for action + */ + ORDER, + /** + * The request represents an original authorization for action + */ + ORIGINALORDER, + /** + * The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization + */ + REFLEXORDER, + /** + * The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order + */ + FILLERORDER, + /** + * An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence. E.g. The administration of a single dose of a drug. + */ + INSTANCEORDER, + /** + * The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests. + +Refer to [[[RequestGroup]]] for additional information on how this status is used + */ + OPTION, + /** + * added to help the parsers with the generic types + */ + NULL; + public static TaskIntent fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return PROPOSAL; + if ("plan".equals(codeString)) + return PLAN; + if ("order".equals(codeString)) + return ORDER; + if ("original-order".equals(codeString)) + return ORIGINALORDER; + if ("reflex-order".equals(codeString)) + return REFLEXORDER; + if ("filler-order".equals(codeString)) + return FILLERORDER; + if ("instance-order".equals(codeString)) + return INSTANCEORDER; + if ("option".equals(codeString)) + return OPTION; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown TaskIntent code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSAL: return "proposal"; + case PLAN: return "plan"; + case ORDER: return "order"; + case ORIGINALORDER: return "original-order"; + case REFLEXORDER: return "reflex-order"; + case FILLERORDER: return "filler-order"; + case INSTANCEORDER: return "instance-order"; + case OPTION: return "option"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSAL: return "http://hl7.org/fhir/request-intent"; + case PLAN: return "http://hl7.org/fhir/request-intent"; + case ORDER: return "http://hl7.org/fhir/request-intent"; + case ORIGINALORDER: return "http://hl7.org/fhir/request-intent"; + case REFLEXORDER: return "http://hl7.org/fhir/request-intent"; + case FILLERORDER: return "http://hl7.org/fhir/request-intent"; + case INSTANCEORDER: return "http://hl7.org/fhir/request-intent"; + case OPTION: return "http://hl7.org/fhir/request-intent"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSAL: return "The request is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act"; + case PLAN: return "The request represents an intension to ensure something occurs without providing an authorization for others to act"; + case ORDER: return "The request represents a request/demand and authorization for action"; + case ORIGINALORDER: return "The request represents an original authorization for action"; + case REFLEXORDER: return "The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization"; + case FILLERORDER: return "The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order"; + case INSTANCEORDER: return "An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence. E.g. The administration of a single dose of a drug."; + case OPTION: return "The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.\n\nRefer to [[[RequestGroup]]] for additional information on how this status is used"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSAL: return "Proposal"; + case PLAN: return "Plan"; + case ORDER: return "Order"; + case ORIGINALORDER: return "Original Order"; + case REFLEXORDER: return "Reflex Order"; + case FILLERORDER: return "Filler Order"; + case INSTANCEORDER: return "Instance Order"; + case OPTION: return "Option"; + default: return "?"; + } + } + } + + public static class TaskIntentEnumFactory implements EnumFactory { + public TaskIntent fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return TaskIntent.PROPOSAL; + if ("plan".equals(codeString)) + return TaskIntent.PLAN; + if ("order".equals(codeString)) + return TaskIntent.ORDER; + if ("original-order".equals(codeString)) + return TaskIntent.ORIGINALORDER; + if ("reflex-order".equals(codeString)) + return TaskIntent.REFLEXORDER; + if ("filler-order".equals(codeString)) + return TaskIntent.FILLERORDER; + if ("instance-order".equals(codeString)) + return TaskIntent.INSTANCEORDER; + if ("option".equals(codeString)) + return TaskIntent.OPTION; + throw new IllegalArgumentException("Unknown TaskIntent code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return new Enumeration(this, TaskIntent.PROPOSAL); + if ("plan".equals(codeString)) + return new Enumeration(this, TaskIntent.PLAN); + if ("order".equals(codeString)) + return new Enumeration(this, TaskIntent.ORDER); + if ("original-order".equals(codeString)) + return new Enumeration(this, TaskIntent.ORIGINALORDER); + if ("reflex-order".equals(codeString)) + return new Enumeration(this, TaskIntent.REFLEXORDER); + if ("filler-order".equals(codeString)) + return new Enumeration(this, TaskIntent.FILLERORDER); + if ("instance-order".equals(codeString)) + return new Enumeration(this, TaskIntent.INSTANCEORDER); + if ("option".equals(codeString)) + return new Enumeration(this, TaskIntent.OPTION); + throw new FHIRException("Unknown TaskIntent code '"+codeString+"'"); + } + public String toCode(TaskIntent code) { + if (code == TaskIntent.PROPOSAL) + return "proposal"; + if (code == TaskIntent.PLAN) + return "plan"; + if (code == TaskIntent.ORDER) + return "order"; + if (code == TaskIntent.ORIGINALORDER) + return "original-order"; + if (code == TaskIntent.REFLEXORDER) + return "reflex-order"; + if (code == TaskIntent.FILLERORDER) + return "filler-order"; + if (code == TaskIntent.INSTANCEORDER) + return "instance-order"; + if (code == TaskIntent.OPTION) + return "option"; + return "?"; + } + public String toSystem(TaskIntent code) { + return code.getSystem(); + } + } + public enum TaskPriority { /** - * This task has low priority. + * The order has a normal priority . */ - LOW, + ROUTINE, /** - * This task has normal priority. + * The order should be urgently. */ - NORMAL, + URGENT, /** - * This task has high priority. + * The order is time-critical. */ - HIGH, + STAT, + /** + * The order should be acted on as soon as possible. + */ + ASAP, /** * added to help the parsers with the generic types */ @@ -286,12 +510,14 @@ public class Task extends DomainResource { public static TaskPriority fromCode(String codeString) throws FHIRException { if (codeString == null || "".equals(codeString)) return null; - if ("low".equals(codeString)) - return LOW; - if ("normal".equals(codeString)) - return NORMAL; - if ("high".equals(codeString)) - return HIGH; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; if (Configuration.isAcceptInvalidEnums()) return null; else @@ -299,33 +525,37 @@ public class Task extends DomainResource { } public String toCode() { switch (this) { - case LOW: return "low"; - case NORMAL: return "normal"; - case HIGH: return "high"; + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; default: return "?"; } } public String getSystem() { switch (this) { - case LOW: return "http://hl7.org/fhir/task-priority"; - case NORMAL: return "http://hl7.org/fhir/task-priority"; - case HIGH: return "http://hl7.org/fhir/task-priority"; + case ROUTINE: return "http://hl7.org/fhir/request-priority"; + case URGENT: return "http://hl7.org/fhir/request-priority"; + case STAT: return "http://hl7.org/fhir/request-priority"; + case ASAP: return "http://hl7.org/fhir/request-priority"; default: return "?"; } } public String getDefinition() { switch (this) { - case LOW: return "This task has low priority."; - case NORMAL: return "This task has normal priority."; - case HIGH: return "This task has high priority."; + case ROUTINE: return "The order has a normal priority ."; + case URGENT: return "The order should be urgently."; + case STAT: return "The order is time-critical."; + case ASAP: return "The order should be acted on as soon as possible."; default: return "?"; } } public String getDisplay() { switch (this) { - case LOW: return "Low"; - case NORMAL: return "Normal"; - case HIGH: return "High"; + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "ASAP"; default: return "?"; } } @@ -336,12 +566,14 @@ public class Task extends DomainResource { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; - if ("low".equals(codeString)) - return TaskPriority.LOW; - if ("normal".equals(codeString)) - return TaskPriority.NORMAL; - if ("high".equals(codeString)) - return TaskPriority.HIGH; + if ("routine".equals(codeString)) + return TaskPriority.ROUTINE; + if ("urgent".equals(codeString)) + return TaskPriority.URGENT; + if ("stat".equals(codeString)) + return TaskPriority.STAT; + if ("asap".equals(codeString)) + return TaskPriority.ASAP; throw new IllegalArgumentException("Unknown TaskPriority code '"+codeString+"'"); } public Enumeration fromType(Base code) throws FHIRException { @@ -350,21 +582,25 @@ public class Task extends DomainResource { String codeString = ((PrimitiveType) code).asStringValue(); if (codeString == null || "".equals(codeString)) return null; - if ("low".equals(codeString)) - return new Enumeration(this, TaskPriority.LOW); - if ("normal".equals(codeString)) - return new Enumeration(this, TaskPriority.NORMAL); - if ("high".equals(codeString)) - return new Enumeration(this, TaskPriority.HIGH); + if ("routine".equals(codeString)) + return new Enumeration(this, TaskPriority.ROUTINE); + if ("urgent".equals(codeString)) + return new Enumeration(this, TaskPriority.URGENT); + if ("stat".equals(codeString)) + return new Enumeration(this, TaskPriority.STAT); + if ("asap".equals(codeString)) + return new Enumeration(this, TaskPriority.ASAP); throw new FHIRException("Unknown TaskPriority code '"+codeString+"'"); } public String toCode(TaskPriority code) { - if (code == TaskPriority.LOW) - return "low"; - if (code == TaskPriority.NORMAL) - return "normal"; - if (code == TaskPriority.HIGH) - return "high"; + if (code == TaskPriority.ROUTINE) + return "routine"; + if (code == TaskPriority.URGENT) + return "urgent"; + if (code == TaskPriority.STAT) + return "stat"; + if (code == TaskPriority.ASAP) + return "asap"; return "?"; } public String toSystem(TaskPriority code) { @@ -373,7 +609,236 @@ public class Task extends DomainResource { } @Block() - public static class TaskFulfillmentComponent extends BackboneElement implements IBaseBackboneElement { + public static class TaskRequesterComponent extends BackboneElement implements IBaseBackboneElement { + /** + * The device, practitioner, etc. who initiated the task. + */ + @Child(name = "agent", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=1, min=1, max=1, modifier=false, summary=true) + @Description(shortDefinition="Individual asking for task", formalDefinition="The device, practitioner, etc. who initiated the task." ) + protected Reference agent; + + /** + * The actual object that is the target of the reference (The device, practitioner, etc. who initiated the task.) + */ + protected Resource agentTarget; + + /** + * The organization the device or practitioner was acting on behalf of when they initiated the task. + */ + @Child(name = "onBehalfOf", type = {Organization.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Organization individual is acting for", formalDefinition="The organization the device or practitioner was acting on behalf of when they initiated the task." ) + protected Reference onBehalfOf; + + /** + * The actual object that is the target of the reference (The organization the device or practitioner was acting on behalf of when they initiated the task.) + */ + protected Organization onBehalfOfTarget; + + private static final long serialVersionUID = -71453027L; + + /** + * Constructor + */ + public TaskRequesterComponent() { + super(); + } + + /** + * Constructor + */ + public TaskRequesterComponent(Reference agent) { + super(); + this.agent = agent; + } + + /** + * @return {@link #agent} (The device, practitioner, etc. who initiated the task.) + */ + public Reference getAgent() { + if (this.agent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TaskRequesterComponent.agent"); + else if (Configuration.doAutoCreate()) + this.agent = new Reference(); // cc + return this.agent; + } + + public boolean hasAgent() { + return this.agent != null && !this.agent.isEmpty(); + } + + /** + * @param value {@link #agent} (The device, practitioner, etc. who initiated the task.) + */ + public TaskRequesterComponent setAgent(Reference value) { + this.agent = value; + return this; + } + + /** + * @return {@link #agent} 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 device, practitioner, etc. who initiated the task.) + */ + public Resource getAgentTarget() { + return this.agentTarget; + } + + /** + * @param value {@link #agent} 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 device, practitioner, etc. who initiated the task.) + */ + public TaskRequesterComponent setAgentTarget(Resource value) { + this.agentTarget = value; + return this; + } + + /** + * @return {@link #onBehalfOf} (The organization the device or practitioner was acting on behalf of when they initiated the task.) + */ + public Reference getOnBehalfOf() { + if (this.onBehalfOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TaskRequesterComponent.onBehalfOf"); + else if (Configuration.doAutoCreate()) + this.onBehalfOf = new Reference(); // cc + return this.onBehalfOf; + } + + public boolean hasOnBehalfOf() { + return this.onBehalfOf != null && !this.onBehalfOf.isEmpty(); + } + + /** + * @param value {@link #onBehalfOf} (The organization the device or practitioner was acting on behalf of when they initiated the task.) + */ + public TaskRequesterComponent setOnBehalfOf(Reference value) { + this.onBehalfOf = value; + return this; + } + + /** + * @return {@link #onBehalfOf} 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 the device or practitioner was acting on behalf of when they initiated the task.) + */ + public Organization getOnBehalfOfTarget() { + if (this.onBehalfOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TaskRequesterComponent.onBehalfOf"); + else if (Configuration.doAutoCreate()) + this.onBehalfOfTarget = new Organization(); // aa + return this.onBehalfOfTarget; + } + + /** + * @param value {@link #onBehalfOf} 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 the device or practitioner was acting on behalf of when they initiated the task.) + */ + public TaskRequesterComponent setOnBehalfOfTarget(Organization value) { + this.onBehalfOfTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("agent", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The device, practitioner, etc. who initiated the task.", 0, java.lang.Integer.MAX_VALUE, agent)); + childrenList.add(new Property("onBehalfOf", "Reference(Organization)", "The organization the device or practitioner was acting on behalf of when they initiated the task.", 0, java.lang.Integer.MAX_VALUE, onBehalfOf)); + } + + @Override + public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { + switch (hash) { + case 92750597: /*agent*/ return this.agent == null ? new Base[0] : new Base[] {this.agent}; // Reference + case -14402964: /*onBehalfOf*/ return this.onBehalfOf == null ? new Base[0] : new Base[] {this.onBehalfOf}; // Reference + default: return super.getProperty(hash, name, checkValid); + } + + } + + @Override + public void setProperty(int hash, String name, Base value) throws FHIRException { + switch (hash) { + case 92750597: // agent + this.agent = castToReference(value); // Reference + break; + case -14402964: // onBehalfOf + this.onBehalfOf = castToReference(value); // Reference + break; + default: super.setProperty(hash, name, value); + } + + } + + @Override + public void setProperty(String name, Base value) throws FHIRException { + if (name.equals("agent")) + this.agent = castToReference(value); // Reference + else if (name.equals("onBehalfOf")) + this.onBehalfOf = castToReference(value); // Reference + else + super.setProperty(name, value); + } + + @Override + public Base makeProperty(int hash, String name) throws FHIRException { + switch (hash) { + case 92750597: return getAgent(); // Reference + case -14402964: return getOnBehalfOf(); // Reference + default: return super.makeProperty(hash, name); + } + + } + + @Override + public Base addChild(String name) throws FHIRException { + if (name.equals("agent")) { + this.agent = new Reference(); + return this.agent; + } + else if (name.equals("onBehalfOf")) { + this.onBehalfOf = new Reference(); + return this.onBehalfOf; + } + else + return super.addChild(name); + } + + public TaskRequesterComponent copy() { + TaskRequesterComponent dst = new TaskRequesterComponent(); + copyValues(dst); + dst.agent = agent == null ? null : agent.copy(); + dst.onBehalfOf = onBehalfOf == null ? null : onBehalfOf.copy(); + return dst; + } + + @Override + public boolean equalsDeep(Base other) { + if (!super.equalsDeep(other)) + return false; + if (!(other instanceof TaskRequesterComponent)) + return false; + TaskRequesterComponent o = (TaskRequesterComponent) other; + return compareDeep(agent, o.agent, true) && compareDeep(onBehalfOf, o.onBehalfOf, true); + } + + @Override + public boolean equalsShallow(Base other) { + if (!super.equalsShallow(other)) + return false; + if (!(other instanceof TaskRequesterComponent)) + return false; + TaskRequesterComponent o = (TaskRequesterComponent) other; + return true; + } + + public boolean isEmpty() { + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(agent, onBehalfOf); + } + + public String fhirType() { + return "Task.requester"; + + } + + } + + @Block() + public static class TaskRestrictionComponent extends BackboneElement implements IBaseBackboneElement { /** * Indicates the number of times the requested action should occur. */ @@ -391,21 +856,21 @@ public class Task extends DomainResource { /** * For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought? */ - @Child(name = "recipients", type = {Patient.class, Practitioner.class, RelatedPerson.class, Group.class, Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "recipient", type = {Patient.class, Practitioner.class, RelatedPerson.class, Group.class, Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="For whom is fulfillment sought?", formalDefinition="For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?" ) - protected List recipients; + protected List recipient; /** * The actual objects that are the target of the reference (For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?) */ - protected List recipientsTarget; + protected List recipientTarget; - private static final long serialVersionUID = -805919764L; + private static final long serialVersionUID = 1503908360L; /** * Constructor */ - public TaskFulfillmentComponent() { + public TaskRestrictionComponent() { super(); } @@ -415,7 +880,7 @@ public class Task extends DomainResource { public PositiveIntType getRepetitionsElement() { if (this.repetitions == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TaskFulfillmentComponent.repetitions"); + throw new Error("Attempt to auto-create TaskRestrictionComponent.repetitions"); else if (Configuration.doAutoCreate()) this.repetitions = new PositiveIntType(); // bb return this.repetitions; @@ -432,7 +897,7 @@ public class Task extends DomainResource { /** * @param value {@link #repetitions} (Indicates the number of times the requested action should occur.). This is the underlying object with id, value and extensions. The accessor "getRepetitions" gives direct access to the value */ - public TaskFulfillmentComponent setRepetitionsElement(PositiveIntType value) { + public TaskRestrictionComponent setRepetitionsElement(PositiveIntType value) { this.repetitions = value; return this; } @@ -447,7 +912,7 @@ public class Task extends DomainResource { /** * @param value Indicates the number of times the requested action should occur. */ - public TaskFulfillmentComponent setRepetitions(int value) { + public TaskRestrictionComponent setRepetitions(int value) { if (this.repetitions == null) this.repetitions = new PositiveIntType(); this.repetitions.setValue(value); @@ -460,7 +925,7 @@ public class Task extends DomainResource { public Period getPeriod() { if (this.period == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TaskFulfillmentComponent.period"); + throw new Error("Attempt to auto-create TaskRestrictionComponent.period"); else if (Configuration.doAutoCreate()) this.period = new Period(); // cc return this.period; @@ -473,79 +938,79 @@ public class Task extends DomainResource { /** * @param value {@link #period} (Over what time-period is fulfillment sought.) */ - public TaskFulfillmentComponent setPeriod(Period value) { + public TaskRestrictionComponent setPeriod(Period value) { this.period = value; return this; } /** - * @return {@link #recipients} (For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?) + * @return {@link #recipient} (For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?) */ - public List getRecipients() { - if (this.recipients == null) - this.recipients = new ArrayList(); - return this.recipients; + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + return this.recipient; } /** * @return Returns a reference to this for easy method chaining */ - public TaskFulfillmentComponent setRecipients(List theRecipients) { - this.recipients = theRecipients; + public TaskRestrictionComponent setRecipient(List theRecipient) { + this.recipient = theRecipient; return this; } - public boolean hasRecipients() { - if (this.recipients == null) + public boolean hasRecipient() { + if (this.recipient == null) return false; - for (Reference item : this.recipients) + for (Reference item : this.recipient) if (!item.isEmpty()) return true; return false; } - public Reference addRecipients() { //3 + public Reference addRecipient() { //3 Reference t = new Reference(); - if (this.recipients == null) - this.recipients = new ArrayList(); - this.recipients.add(t); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); return t; } - public TaskFulfillmentComponent addRecipients(Reference t) { //3 + public TaskRestrictionComponent addRecipient(Reference t) { //3 if (t == null) return this; - if (this.recipients == null) - this.recipients = new ArrayList(); - this.recipients.add(t); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); return this; } /** - * @return The first repetition of repeating field {@link #recipients}, creating it if it does not already exist + * @return The first repetition of repeating field {@link #recipient}, creating it if it does not already exist */ - public Reference getRecipientsFirstRep() { - if (getRecipients().isEmpty()) { - addRecipients(); + public Reference getRecipientFirstRep() { + if (getRecipient().isEmpty()) { + addRecipient(); } - return getRecipients().get(0); + return getRecipient().get(0); } /** * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated - public List getRecipientsTarget() { - if (this.recipientsTarget == null) - this.recipientsTarget = new ArrayList(); - return this.recipientsTarget; + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; } protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("repetitions", "positiveInt", "Indicates the number of times the requested action should occur.", 0, java.lang.Integer.MAX_VALUE, repetitions)); childrenList.add(new Property("period", "Period", "Over what time-period is fulfillment sought.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("recipients", "Reference(Patient|Practitioner|RelatedPerson|Group|Organization)", "For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?", 0, java.lang.Integer.MAX_VALUE, recipients)); + childrenList.add(new Property("recipient", "Reference(Patient|Practitioner|RelatedPerson|Group|Organization)", "For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?", 0, java.lang.Integer.MAX_VALUE, recipient)); } @Override @@ -553,7 +1018,7 @@ public class Task extends DomainResource { switch (hash) { case 984367650: /*repetitions*/ return this.repetitions == null ? new Base[0] : new Base[] {this.repetitions}; // PositiveIntType case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -347287174: /*recipients*/ return this.recipients == null ? new Base[0] : this.recipients.toArray(new Base[this.recipients.size()]); // Reference + case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference default: return super.getProperty(hash, name, checkValid); } @@ -568,8 +1033,8 @@ public class Task extends DomainResource { case -991726143: // period this.period = castToPeriod(value); // Period break; - case -347287174: // recipients - this.getRecipients().add(castToReference(value)); // Reference + case 820081177: // recipient + this.getRecipient().add(castToReference(value)); // Reference break; default: super.setProperty(hash, name, value); } @@ -582,8 +1047,8 @@ public class Task extends DomainResource { this.repetitions = castToPositiveInt(value); // PositiveIntType else if (name.equals("period")) this.period = castToPeriod(value); // Period - else if (name.equals("recipients")) - this.getRecipients().add(castToReference(value)); + else if (name.equals("recipient")) + this.getRecipient().add(castToReference(value)); else super.setProperty(name, value); } @@ -593,7 +1058,7 @@ public class Task extends DomainResource { switch (hash) { case 984367650: throw new FHIRException("Cannot make property repetitions as it is not a complex type"); // PositiveIntType case -991726143: return getPeriod(); // Period - case -347287174: return addRecipients(); // Reference + case 820081177: return addRecipient(); // Reference default: return super.makeProperty(hash, name); } @@ -608,22 +1073,22 @@ public class Task extends DomainResource { this.period = new Period(); return this.period; } - else if (name.equals("recipients")) { - return addRecipients(); + else if (name.equals("recipient")) { + return addRecipient(); } else return super.addChild(name); } - public TaskFulfillmentComponent copy() { - TaskFulfillmentComponent dst = new TaskFulfillmentComponent(); + public TaskRestrictionComponent copy() { + TaskRestrictionComponent dst = new TaskRestrictionComponent(); copyValues(dst); dst.repetitions = repetitions == null ? null : repetitions.copy(); dst.period = period == null ? null : period.copy(); - if (recipients != null) { - dst.recipients = new ArrayList(); - for (Reference i : recipients) - dst.recipients.add(i.copy()); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); }; return dst; } @@ -632,10 +1097,10 @@ public class Task extends DomainResource { public boolean equalsDeep(Base other) { if (!super.equalsDeep(other)) return false; - if (!(other instanceof TaskFulfillmentComponent)) + if (!(other instanceof TaskRestrictionComponent)) return false; - TaskFulfillmentComponent o = (TaskFulfillmentComponent) other; - return compareDeep(repetitions, o.repetitions, true) && compareDeep(period, o.period, true) && compareDeep(recipients, o.recipients, true) + TaskRestrictionComponent o = (TaskRestrictionComponent) other; + return compareDeep(repetitions, o.repetitions, true) && compareDeep(period, o.period, true) && compareDeep(recipient, o.recipient, true) ; } @@ -643,19 +1108,19 @@ public class Task extends DomainResource { public boolean equalsShallow(Base other) { if (!super.equalsShallow(other)) return false; - if (!(other instanceof TaskFulfillmentComponent)) + if (!(other instanceof TaskRestrictionComponent)) return false; - TaskFulfillmentComponent o = (TaskFulfillmentComponent) other; + TaskRestrictionComponent o = (TaskRestrictionComponent) other; return compareValues(repetitions, o.repetitions, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(repetitions, period, recipients + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(repetitions, period, recipient ); } public String fhirType() { - return "Task.fulfillment"; + return "Task.restriction"; } @@ -674,7 +1139,7 @@ public class Task extends DomainResource { * The value of the input parameter as a basic type. */ @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Input Value", formalDefinition="The value of the input parameter as a basic type." ) + @Description(shortDefinition="Content to use in performing the task", formalDefinition="The value of the input parameter as a basic type." ) protected org.hl7.fhir.dstu3.model.Type value; private static final long serialVersionUID = -852629026L; @@ -975,14 +1440,14 @@ public class Task extends DomainResource { * The name of the Output parameter. */ @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Output Name", formalDefinition="The name of the Output parameter." ) + @Description(shortDefinition="Label for output", formalDefinition="The name of the Output parameter." ) protected CodeableConcept type; /** * The value of the Output parameter as a basic type. */ @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Output Value", formalDefinition="The value of the Output parameter as a basic type." ) + @Description(shortDefinition="Result of output", formalDefinition="The value of the Output parameter as a basic type." ) protected org.hl7.fhir.dstu3.model.Type value; private static final long serialVersionUID = -852629026L; @@ -1280,18 +1745,25 @@ public class Task extends DomainResource { /** * The business identifier for this task. */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=false) + @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Task Instance Identifier", formalDefinition="The business identifier for this task." ) - protected Identifier identifier; + protected List identifier; /** - * Identifies a plan, proposal or order that this task has been created in fulfillment of. + * A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc. */ - @Child(name = "basedOn", type = {Reference.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Request fulfilled by this task", formalDefinition="Identifies a plan, proposal or order that this task has been created in fulfillment of." ) + @Child(name = "definition", type = {UriType.class, ActivityDefinition.class}, order=1, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Formal definition of task", formalDefinition="A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc." ) + protected Type definition; + + /** + * BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a "request" resource such as a DiagnosticRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfil. This latter resource is referenced by FocusOn. For example, based on a DiagnosticRequest (= BasedOn), a task is created to fulfil a procedureRequest ( = FocusOn ) to collect a specimen from a patient. + */ + @Child(name = "basedOn", type = {Reference.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Request fulfilled by this task", formalDefinition="BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a \"request\" resource such as a DiagnosticRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. which is distinct from the \"request\" resource the task is seeking to fulfil. This latter resource is referenced by FocusOn. For example, based on a DiagnosticRequest (= BasedOn), a task is created to fulfil a procedureRequest ( = FocusOn ) to collect a specimen from a patient." ) protected List basedOn; /** - * The actual objects that are the target of the reference (Identifies a plan, proposal or order that this task has been created in fulfillment of.) + * The actual objects that are the target of the reference (BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a "request" resource such as a DiagnosticRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfil. This latter resource is referenced by FocusOn. For example, based on a DiagnosticRequest (= BasedOn), a task is created to fulfil a procedureRequest ( = FocusOn ) to collect a specimen from a patient.) */ protected List basedOnTarget; @@ -1299,26 +1771,26 @@ public class Task extends DomainResource { /** * An identifier that links together multiple tasks and other requests that were created in the same context. */ - @Child(name = "requisition", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Child(name = "groupIdentifier", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Requisition or grouper id", formalDefinition="An identifier that links together multiple tasks and other requests that were created in the same context." ) - protected Identifier requisition; + protected Identifier groupIdentifier; /** * Task that this particular task is part of. */ - @Child(name = "parent", type = {Task.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "partOf", type = {Task.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Composite task", formalDefinition="Task that this particular task is part of." ) - protected List parent; + protected List partOf; /** * The actual objects that are the target of the reference (Task that this particular task is part of.) */ - protected List parentTarget; + protected List partOfTarget; /** * The current status of the task. */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true) + @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=true) @Description(shortDefinition="draft | requested | received | accepted | +", formalDefinition="The current status of the task." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-status") protected Enumeration status; @@ -1326,51 +1798,51 @@ public class Task extends DomainResource { /** * An explanation as to why this task is held, failed, was refused, etc. */ - @Child(name = "statusReason", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) + @Child(name = "statusReason", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Reason for current status", formalDefinition="An explanation as to why this task is held, failed, was refused, etc." ) protected CodeableConcept statusReason; /** * Contains business-specific nuances of the business state. */ - @Child(name = "businessStatus", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) + @Child(name = "businessStatus", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="E.g. \"Specimen collected\", \"IV prepped\"", formalDefinition="Contains business-specific nuances of the business state." ) protected CodeableConcept businessStatus; /** * Indicates the "level" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc. */ - @Child(name = "stage", type = {CodeableConcept.class}, order=7, min=1, max=1, modifier=false, summary=true) + @Child(name = "intent", type = {CodeType.class}, order=8, min=1, max=1, modifier=false, summary=true) @Description(shortDefinition="proposed | planned | actionable +", formalDefinition="Indicates the \"level\" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-stage") - protected CodeableConcept stage; + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-intent") + protected Enumeration intent; + + /** + * Indicates how quickly the Task should be addressed with respect to other requests. + */ + @Child(name = "priority", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="normal | urgent | asap | stat", formalDefinition="Indicates how quickly the Task should be addressed with respect to other requests." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority") + protected Enumeration priority; /** * A name or code (or both) briefly describing what the task involves. */ - @Child(name = "code", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true) + @Child(name = "code", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Task Type", formalDefinition="A name or code (or both) briefly describing what the task involves." ) protected CodeableConcept code; - /** - * The priority of the task among other tasks of the same type. - */ - @Child(name = "priority", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="low | normal | high", formalDefinition="The priority of the task among other tasks of the same type." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-priority") - protected Enumeration priority; - /** * A free-text description of what is to be performed. */ - @Child(name = "description", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) + @Child(name = "description", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Human-readable explanation of task", formalDefinition="A free-text description of what is to be performed." ) protected StringType description; /** * The request being actioned or the resource being manipulated by this task. */ - @Child(name = "focus", type = {Reference.class}, order=11, min=0, max=1, modifier=false, summary=true) + @Child(name = "focus", type = {Reference.class}, order=12, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="What task is acting on", formalDefinition="The request being actioned or the resource being manipulated by this task." ) protected Reference focus; @@ -1382,7 +1854,7 @@ public class Task extends DomainResource { /** * The entity who benefits from the performance of the service specified in the task (e.g., the patient). */ - @Child(name = "for", type = {Reference.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Child(name = "for", type = {Reference.class}, order=13, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Beneficiary of the Task", formalDefinition="The entity who benefits from the performance of the service specified in the task (e.g., the patient)." ) protected Reference for_; @@ -1394,7 +1866,7 @@ public class Task extends DomainResource { /** * The healthcare event (e.g. a patient and healthcare provider interaction) during which this task was created. */ - @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=14, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Healthcare event during which this task originated", formalDefinition="The healthcare event (e.g. a patient and healthcare provider interaction) during which this task was created." ) protected Reference context; @@ -1403,36 +1875,46 @@ public class Task extends DomainResource { */ protected Resource contextTarget; + /** + * Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end). + */ + @Child(name = "executionPeriod", type = {Period.class}, order=15, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Start and end time of execution", formalDefinition="Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end)." ) + protected Period executionPeriod; + /** * The date and time this task was created. */ - @Child(name = "created", type = {DateTimeType.class}, order=14, min=1, max=1, modifier=false, summary=false) + @Child(name = "authoredOn", type = {DateTimeType.class}, order=16, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Task Creation Date", formalDefinition="The date and time this task was created." ) - protected DateTimeType created; + protected DateTimeType authoredOn; /** * The date and time of last modification to this task. */ - @Child(name = "lastModified", type = {DateTimeType.class}, order=15, min=1, max=1, modifier=false, summary=true) + @Child(name = "lastModified", type = {DateTimeType.class}, order=17, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Task Last Modified Date", formalDefinition="The date and time of last modification to this task." ) protected DateTimeType lastModified; /** * The creator of the task. */ - @Child(name = "requester", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=16, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Task Creator", formalDefinition="The creator of the task." ) - protected Reference requester; + @Child(name = "requester", type = {}, order=18, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Who is asking for task to be done", formalDefinition="The creator of the task." ) + protected TaskRequesterComponent requester; /** - * The actual object that is the target of the reference (The creator of the task.) + * The type of participant that can execute the task. */ - protected Resource requesterTarget; + @Child(name = "performerType", type = {CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="requester | dispatcher | scheduler | performer | monitor | manager | acquirer | reviewer", formalDefinition="The type of participant that can execute the task." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-performer-type") + protected List performerType; /** * The owner of this task. The participant who can execute this task. */ - @Child(name = "owner", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=17, min=0, max=1, modifier=false, summary=true) + @Child(name = "owner", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=20, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Task Owner", formalDefinition="The owner of this task. The participant who can execute this task." ) protected Reference owner; @@ -1441,57 +1923,54 @@ public class Task extends DomainResource { */ protected Resource ownerTarget; - /** - * The type of participant that can execute the task. - */ - @Child(name = "performerType", type = {CodeableConcept.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="requester | dispatcher | scheduler | performer | monitor | manager | acquirer | reviewer", formalDefinition="The type of participant that can execute the task." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-performer-type") - protected List performerType; - /** * A description or code indicating why this task needs to be performed. */ - @Child(name = "reason", type = {CodeableConcept.class}, order=19, min=0, max=1, modifier=false, summary=false) + @Child(name = "reason", type = {CodeableConcept.class}, order=21, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Why task is needed", formalDefinition="A description or code indicating why this task needs to be performed." ) protected CodeableConcept reason; /** * Free-text information captured about the task as it progresses. */ - @Child(name = "note", type = {Annotation.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "note", type = {Annotation.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Comments made about the task", formalDefinition="Free-text information captured about the task as it progresses." ) protected List note; /** - * Identifies any limitations on what part of a referenced task subject request should be actioned. + * Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task. */ - @Child(name = "fulfillment", type = {}, order=21, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Constraints on fulfillment tasks", formalDefinition="Identifies any limitations on what part of a referenced task subject request should be actioned." ) - protected TaskFulfillmentComponent fulfillment; + @Child(name = "relevantHistory", type = {Provenance.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Key events in history of the Task", formalDefinition="Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task." ) + protected List relevantHistory; + /** + * The actual objects that are the target of the reference (Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.) + */ + protected List relevantHistoryTarget; + /** - * A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc. + * If the Task.focus is a request resource and the task is seeking fulfillment (i.e is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned. */ - @Child(name = "definition", type = {UriType.class}, order=22, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Task Definition", formalDefinition="A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc." ) - protected UriType definition; + @Child(name = "restriction", type = {}, order=24, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Constraints on fulfillment tasks", formalDefinition="If the Task.focus is a request resource and the task is seeking fulfillment (i.e is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned." ) + protected TaskRestrictionComponent restriction; /** * Additional information that may be needed in the execution of the task. */ - @Child(name = "input", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Supporting information", formalDefinition="Additional information that may be needed in the execution of the task." ) + @Child(name = "input", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Information used to perform task", formalDefinition="Additional information that may be needed in the execution of the task." ) protected List input; /** * Outputs produced by the Task. */ - @Child(name = "output", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Task Output", formalDefinition="Outputs produced by the Task." ) + @Child(name = "output", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Description(shortDefinition="Information produced as part of task", formalDefinition="Outputs produced by the Task." ) protected List output; - private static final long serialVersionUID = 564776279L; + private static final long serialVersionUID = 2060755798L; /** * Constructor @@ -1503,41 +1982,112 @@ public class Task extends DomainResource { /** * Constructor */ - public Task(Enumeration status, CodeableConcept stage, DateTimeType created, DateTimeType lastModified, Reference requester) { + public Task(Enumeration status, Enumeration intent) { super(); this.status = status; - this.stage = stage; - this.created = created; - this.lastModified = lastModified; - this.requester = requester; + this.intent = intent; } /** * @return {@link #identifier} (The business identifier for this task.) */ - public Identifier getIdentifier() { + public List getIdentifier() { if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc + this.identifier = new ArrayList(); return this.identifier; } - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); + /** + * @return Returns a reference to this for easy method chaining + */ + public Task setIdentifier(List theIdentifier) { + this.identifier = theIdentifier; + return this; } - /** - * @param value {@link #identifier} (The business identifier for this task.) - */ - public Task setIdentifier(Identifier value) { - this.identifier = value; + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + public Task addIdentifier(Identifier t) { //3 + if (t == null) + return this; + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); return this; } /** - * @return {@link #basedOn} (Identifies a plan, proposal or order that this task has been created in fulfillment of.) + * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist + */ + public Identifier getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + addIdentifier(); + } + return getIdentifier().get(0); + } + + /** + * @return {@link #definition} (A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc.) + */ + public Type getDefinition() { + return this.definition; + } + + /** + * @return {@link #definition} (A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc.) + */ + public UriType getDefinitionUriType() throws FHIRException { + if (!(this.definition instanceof UriType)) + throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.definition.getClass().getName()+" was encountered"); + return (UriType) this.definition; + } + + public boolean hasDefinitionUriType() { + return this.definition instanceof UriType; + } + + /** + * @return {@link #definition} (A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc.) + */ + public Reference getDefinitionReference() throws FHIRException { + if (!(this.definition instanceof Reference)) + throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.definition.getClass().getName()+" was encountered"); + return (Reference) this.definition; + } + + public boolean hasDefinitionReference() { + return this.definition instanceof Reference; + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc.) + */ + public Task setDefinition(Type value) { + this.definition = value; + return this; + } + + /** + * @return {@link #basedOn} (BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a "request" resource such as a DiagnosticRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfil. This latter resource is referenced by FocusOn. For example, based on a DiagnosticRequest (= BasedOn), a task is created to fulfil a procedureRequest ( = FocusOn ) to collect a specimen from a patient.) */ public List getBasedOn() { if (this.basedOn == null) @@ -1600,101 +2150,101 @@ public class Task extends DomainResource { } /** - * @return {@link #requisition} (An identifier that links together multiple tasks and other requests that were created in the same context.) + * @return {@link #groupIdentifier} (An identifier that links together multiple tasks and other requests that were created in the same context.) */ - public Identifier getRequisition() { - if (this.requisition == null) + public Identifier getGroupIdentifier() { + if (this.groupIdentifier == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.requisition"); + throw new Error("Attempt to auto-create Task.groupIdentifier"); else if (Configuration.doAutoCreate()) - this.requisition = new Identifier(); // cc - return this.requisition; + this.groupIdentifier = new Identifier(); // cc + return this.groupIdentifier; } - public boolean hasRequisition() { - return this.requisition != null && !this.requisition.isEmpty(); + public boolean hasGroupIdentifier() { + return this.groupIdentifier != null && !this.groupIdentifier.isEmpty(); } /** - * @param value {@link #requisition} (An identifier that links together multiple tasks and other requests that were created in the same context.) + * @param value {@link #groupIdentifier} (An identifier that links together multiple tasks and other requests that were created in the same context.) */ - public Task setRequisition(Identifier value) { - this.requisition = value; + public Task setGroupIdentifier(Identifier value) { + this.groupIdentifier = value; return this; } /** - * @return {@link #parent} (Task that this particular task is part of.) + * @return {@link #partOf} (Task that this particular task is part of.) */ - public List getParent() { - if (this.parent == null) - this.parent = new ArrayList(); - return this.parent; + public List getPartOf() { + if (this.partOf == null) + this.partOf = new ArrayList(); + return this.partOf; } /** * @return Returns a reference to this for easy method chaining */ - public Task setParent(List theParent) { - this.parent = theParent; + public Task setPartOf(List thePartOf) { + this.partOf = thePartOf; return this; } - public boolean hasParent() { - if (this.parent == null) + public boolean hasPartOf() { + if (this.partOf == null) return false; - for (Reference item : this.parent) + for (Reference item : this.partOf) if (!item.isEmpty()) return true; return false; } - public Reference addParent() { //3 + public Reference addPartOf() { //3 Reference t = new Reference(); - if (this.parent == null) - this.parent = new ArrayList(); - this.parent.add(t); + if (this.partOf == null) + this.partOf = new ArrayList(); + this.partOf.add(t); return t; } - public Task addParent(Reference t) { //3 + public Task addPartOf(Reference t) { //3 if (t == null) return this; - if (this.parent == null) - this.parent = new ArrayList(); - this.parent.add(t); + if (this.partOf == null) + this.partOf = new ArrayList(); + this.partOf.add(t); return this; } /** - * @return The first repetition of repeating field {@link #parent}, creating it if it does not already exist + * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist */ - public Reference getParentFirstRep() { - if (getParent().isEmpty()) { - addParent(); + public Reference getPartOfFirstRep() { + if (getPartOf().isEmpty()) { + addPartOf(); } - return getParent().get(0); + return getPartOf().get(0); } /** * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated - public List getParentTarget() { - if (this.parentTarget == null) - this.parentTarget = new ArrayList(); - return this.parentTarget; + public List getPartOfTarget() { + if (this.partOfTarget == null) + this.partOfTarget = new ArrayList(); + return this.partOfTarget; } /** * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated - public Task addParentTarget() { + public Task addPartOfTarget() { Task r = new Task(); - if (this.parentTarget == null) - this.parentTarget = new ArrayList(); - this.parentTarget.add(r); + if (this.partOfTarget == null) + this.partOfTarget = new ArrayList(); + this.partOfTarget.add(r); return r; } @@ -1792,26 +2342,96 @@ public class Task extends DomainResource { } /** - * @return {@link #stage} (Indicates the "level" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc.) + * @return {@link #intent} (Indicates the "level" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value */ - public CodeableConcept getStage() { - if (this.stage == null) + public Enumeration getIntentElement() { + if (this.intent == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.stage"); + throw new Error("Attempt to auto-create Task.intent"); else if (Configuration.doAutoCreate()) - this.stage = new CodeableConcept(); // cc - return this.stage; + this.intent = new Enumeration(new TaskIntentEnumFactory()); // bb + return this.intent; } - public boolean hasStage() { - return this.stage != null && !this.stage.isEmpty(); + public boolean hasIntentElement() { + return this.intent != null && !this.intent.isEmpty(); + } + + public boolean hasIntent() { + return this.intent != null && !this.intent.isEmpty(); } /** - * @param value {@link #stage} (Indicates the "level" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc.) + * @param value {@link #intent} (Indicates the "level" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value */ - public Task setStage(CodeableConcept value) { - this.stage = value; + public Task setIntentElement(Enumeration value) { + this.intent = value; + return this; + } + + /** + * @return Indicates the "level" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc. + */ + public TaskIntent getIntent() { + return this.intent == null ? null : this.intent.getValue(); + } + + /** + * @param value Indicates the "level" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc. + */ + public Task setIntent(TaskIntent value) { + if (this.intent == null) + this.intent = new Enumeration(new TaskIntentEnumFactory()); + this.intent.setValue(value); + return this; + } + + /** + * @return {@link #priority} (Indicates how quickly the Task should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(new TaskPriorityEnumFactory()); // bb + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Indicates how quickly the Task should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Task setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return Indicates how quickly the Task should be addressed with respect to other requests. + */ + public TaskPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value Indicates how quickly the Task should be addressed with respect to other requests. + */ + public Task setPriority(TaskPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(new TaskPriorityEnumFactory()); + this.priority.setValue(value); + } return this; } @@ -1839,55 +2459,6 @@ public class Task extends DomainResource { return this; } - /** - * @return {@link #priority} (The priority of the task among other tasks of the same type.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(new TaskPriorityEnumFactory()); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The priority of the task among other tasks of the same type.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Task setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return The priority of the task among other tasks of the same type. - */ - public TaskPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The priority of the task among other tasks of the same type. - */ - public Task setPriority(TaskPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(new TaskPriorityEnumFactory()); - this.priority.setValue(value); - } - return this; - } - /** * @return {@link #description} (A free-text description of what is to be performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value */ @@ -2055,47 +2626,75 @@ public class Task extends DomainResource { } /** - * @return {@link #created} (The date and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + * @return {@link #executionPeriod} (Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).) */ - public DateTimeType getCreatedElement() { - if (this.created == null) + public Period getExecutionPeriod() { + if (this.executionPeriod == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.created"); + throw new Error("Attempt to auto-create Task.executionPeriod"); else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; + this.executionPeriod = new Period(); // cc + return this.executionPeriod; } - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); + public boolean hasExecutionPeriod() { + return this.executionPeriod != null && !this.executionPeriod.isEmpty(); } /** - * @param value {@link #created} (The date and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + * @param value {@link #executionPeriod} (Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).) */ - public Task setCreatedElement(DateTimeType value) { - this.created = value; + public Task setExecutionPeriod(Period value) { + this.executionPeriod = value; + return this; + } + + /** + * @return {@link #authoredOn} (The date and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value + */ + public DateTimeType getAuthoredOnElement() { + if (this.authoredOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.authoredOn"); + else if (Configuration.doAutoCreate()) + this.authoredOn = new DateTimeType(); // bb + return this.authoredOn; + } + + public boolean hasAuthoredOnElement() { + return this.authoredOn != null && !this.authoredOn.isEmpty(); + } + + public boolean hasAuthoredOn() { + return this.authoredOn != null && !this.authoredOn.isEmpty(); + } + + /** + * @param value {@link #authoredOn} (The date and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value + */ + public Task setAuthoredOnElement(DateTimeType value) { + this.authoredOn = value; return this; } /** * @return The date and time this task was created. */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); + public Date getAuthoredOn() { + return this.authoredOn == null ? null : this.authoredOn.getValue(); } /** * @param value The date and time this task was created. */ - public Task setCreated(Date value) { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); + public Task setAuthoredOn(Date value) { + if (value == null) + this.authoredOn = null; + else { + if (this.authoredOn == null) + this.authoredOn = new DateTimeType(); + this.authoredOn.setValue(value); + } return this; } @@ -2138,21 +2737,25 @@ public class Task extends DomainResource { * @param value The date and time of last modification to this task. */ public Task setLastModified(Date value) { + if (value == null) + this.lastModified = null; + else { if (this.lastModified == null) this.lastModified = new DateTimeType(); this.lastModified.setValue(value); + } return this; } /** * @return {@link #requester} (The creator of the task.) */ - public Reference getRequester() { + public TaskRequesterComponent getRequester() { if (this.requester == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Task.requester"); else if (Configuration.doAutoCreate()) - this.requester = new Reference(); // cc + this.requester = new TaskRequesterComponent(); // cc return this.requester; } @@ -2163,65 +2766,11 @@ public class Task extends DomainResource { /** * @param value {@link #requester} (The creator of the task.) */ - public Task setRequester(Reference value) { + public Task setRequester(TaskRequesterComponent value) { this.requester = value; return this; } - /** - * @return {@link #requester} 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 creator of the task.) - */ - public Resource getRequesterTarget() { - return this.requesterTarget; - } - - /** - * @param value {@link #requester} 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 creator of the task.) - */ - public Task setRequesterTarget(Resource value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #owner} (The owner of this task. The participant who can execute this task.) - */ - public Reference getOwner() { - if (this.owner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.owner"); - else if (Configuration.doAutoCreate()) - this.owner = new Reference(); // cc - return this.owner; - } - - public boolean hasOwner() { - return this.owner != null && !this.owner.isEmpty(); - } - - /** - * @param value {@link #owner} (The owner of this task. The participant who can execute this task.) - */ - public Task setOwner(Reference value) { - this.owner = value; - return this; - } - - /** - * @return {@link #owner} 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 owner of this task. The participant who can execute this task.) - */ - public Resource getOwnerTarget() { - return this.ownerTarget; - } - - /** - * @param value {@link #owner} 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 owner of this task. The participant who can execute this task.) - */ - public Task setOwnerTarget(Resource value) { - this.ownerTarget = value; - return this; - } - /** * @return {@link #performerType} (The type of participant that can execute the task.) */ @@ -2275,6 +2824,45 @@ public class Task extends DomainResource { return getPerformerType().get(0); } + /** + * @return {@link #owner} (The owner of this task. The participant who can execute this task.) + */ + public Reference getOwner() { + if (this.owner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.owner"); + else if (Configuration.doAutoCreate()) + this.owner = new Reference(); // cc + return this.owner; + } + + public boolean hasOwner() { + return this.owner != null && !this.owner.isEmpty(); + } + + /** + * @param value {@link #owner} (The owner of this task. The participant who can execute this task.) + */ + public Task setOwner(Reference value) { + this.owner = value; + return this; + } + + /** + * @return {@link #owner} 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 owner of this task. The participant who can execute this task.) + */ + public Resource getOwnerTarget() { + return this.ownerTarget; + } + + /** + * @param value {@link #owner} 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 owner of this task. The participant who can execute this task.) + */ + public Task setOwnerTarget(Resource value) { + this.ownerTarget = value; + return this; + } + /** * @return {@link #reason} (A description or code indicating why this task needs to be performed.) */ @@ -2353,75 +2941,101 @@ public class Task extends DomainResource { } /** - * @return {@link #fulfillment} (Identifies any limitations on what part of a referenced task subject request should be actioned.) + * @return {@link #relevantHistory} (Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.) */ - public TaskFulfillmentComponent getFulfillment() { - if (this.fulfillment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.fulfillment"); - else if (Configuration.doAutoCreate()) - this.fulfillment = new TaskFulfillmentComponent(); // cc - return this.fulfillment; - } - - public boolean hasFulfillment() { - return this.fulfillment != null && !this.fulfillment.isEmpty(); + public List getRelevantHistory() { + if (this.relevantHistory == null) + this.relevantHistory = new ArrayList(); + return this.relevantHistory; } /** - * @param value {@link #fulfillment} (Identifies any limitations on what part of a referenced task subject request should be actioned.) + * @return Returns a reference to this for easy method chaining */ - public Task setFulfillment(TaskFulfillmentComponent value) { - this.fulfillment = value; + public Task setRelevantHistory(List theRelevantHistory) { + this.relevantHistory = theRelevantHistory; + return this; + } + + public boolean hasRelevantHistory() { + if (this.relevantHistory == null) + return false; + for (Reference item : this.relevantHistory) + if (!item.isEmpty()) + return true; + return false; + } + + public Reference addRelevantHistory() { //3 + Reference t = new Reference(); + if (this.relevantHistory == null) + this.relevantHistory = new ArrayList(); + this.relevantHistory.add(t); + return t; + } + + public Task addRelevantHistory(Reference t) { //3 + if (t == null) + return this; + if (this.relevantHistory == null) + this.relevantHistory = new ArrayList(); + this.relevantHistory.add(t); return this; } /** - * @return {@link #definition} (A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + * @return The first repetition of repeating field {@link #relevantHistory}, creating it if it does not already exist */ - public UriType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new UriType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public Task setDefinitionElement(UriType value) { - this.definition = value; - return this; - } - - /** - * @return A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc. - */ - public Task setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new UriType(); - this.definition.setValue(value); + public Reference getRelevantHistoryFirstRep() { + if (getRelevantHistory().isEmpty()) { + addRelevantHistory(); } + return getRelevantHistory().get(0); + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public List getRelevantHistoryTarget() { + if (this.relevantHistoryTarget == null) + this.relevantHistoryTarget = new ArrayList(); + return this.relevantHistoryTarget; + } + + /** + * @deprecated Use Reference#setResource(IBaseResource) instead + */ + @Deprecated + public Provenance addRelevantHistoryTarget() { + Provenance r = new Provenance(); + if (this.relevantHistoryTarget == null) + this.relevantHistoryTarget = new ArrayList(); + this.relevantHistoryTarget.add(r); + return r; + } + + /** + * @return {@link #restriction} (If the Task.focus is a request resource and the task is seeking fulfillment (i.e is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.) + */ + public TaskRestrictionComponent getRestriction() { + if (this.restriction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Task.restriction"); + else if (Configuration.doAutoCreate()) + this.restriction = new TaskRestrictionComponent(); // cc + return this.restriction; + } + + public boolean hasRestriction() { + return this.restriction != null && !this.restriction.isEmpty(); + } + + /** + * @param value {@link #restriction} (If the Task.focus is a request resource and the task is seeking fulfillment (i.e is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.) + */ + public Task setRestriction(TaskRestrictionComponent value) { + this.restriction = value; return this; } @@ -2534,28 +3148,30 @@ public class Task extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The business identifier for this task.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("basedOn", "Reference(Any)", "Identifies a plan, proposal or order that this task has been created in fulfillment of.", 0, java.lang.Integer.MAX_VALUE, basedOn)); - childrenList.add(new Property("requisition", "Identifier", "An identifier that links together multiple tasks and other requests that were created in the same context.", 0, java.lang.Integer.MAX_VALUE, requisition)); - childrenList.add(new Property("parent", "Reference(Task)", "Task that this particular task is part of.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("definition[x]", "uri|Reference(ActivityDefinition)", "A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("basedOn", "Reference(Any)", "BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a \"request\" resource such as a DiagnosticRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. which is distinct from the \"request\" resource the task is seeking to fulfil. This latter resource is referenced by FocusOn. For example, based on a DiagnosticRequest (= BasedOn), a task is created to fulfil a procedureRequest ( = FocusOn ) to collect a specimen from a patient.", 0, java.lang.Integer.MAX_VALUE, basedOn)); + childrenList.add(new Property("groupIdentifier", "Identifier", "An identifier that links together multiple tasks and other requests that were created in the same context.", 0, java.lang.Integer.MAX_VALUE, groupIdentifier)); + childrenList.add(new Property("partOf", "Reference(Task)", "Task that this particular task is part of.", 0, java.lang.Integer.MAX_VALUE, partOf)); childrenList.add(new Property("status", "code", "The current status of the task.", 0, java.lang.Integer.MAX_VALUE, status)); childrenList.add(new Property("statusReason", "CodeableConcept", "An explanation as to why this task is held, failed, was refused, etc.", 0, java.lang.Integer.MAX_VALUE, statusReason)); childrenList.add(new Property("businessStatus", "CodeableConcept", "Contains business-specific nuances of the business state.", 0, java.lang.Integer.MAX_VALUE, businessStatus)); - childrenList.add(new Property("stage", "CodeableConcept", "Indicates the \"level\" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc.", 0, java.lang.Integer.MAX_VALUE, stage)); + childrenList.add(new Property("intent", "code", "Indicates the \"level\" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc.", 0, java.lang.Integer.MAX_VALUE, intent)); + childrenList.add(new Property("priority", "code", "Indicates how quickly the Task should be addressed with respect to other requests.", 0, java.lang.Integer.MAX_VALUE, priority)); childrenList.add(new Property("code", "CodeableConcept", "A name or code (or both) briefly describing what the task involves.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("priority", "code", "The priority of the task among other tasks of the same type.", 0, java.lang.Integer.MAX_VALUE, priority)); childrenList.add(new Property("description", "string", "A free-text description of what is to be performed.", 0, java.lang.Integer.MAX_VALUE, description)); childrenList.add(new Property("focus", "Reference(Any)", "The request being actioned or the resource being manipulated by this task.", 0, java.lang.Integer.MAX_VALUE, focus)); childrenList.add(new Property("for", "Reference(Any)", "The entity who benefits from the performance of the service specified in the task (e.g., the patient).", 0, java.lang.Integer.MAX_VALUE, for_)); childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The healthcare event (e.g. a patient and healthcare provider interaction) during which this task was created.", 0, java.lang.Integer.MAX_VALUE, context)); - childrenList.add(new Property("created", "dateTime", "The date and time this task was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("executionPeriod", "Period", "Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).", 0, java.lang.Integer.MAX_VALUE, executionPeriod)); + childrenList.add(new Property("authoredOn", "dateTime", "The date and time this task was created.", 0, java.lang.Integer.MAX_VALUE, authoredOn)); childrenList.add(new Property("lastModified", "dateTime", "The date and time of last modification to this task.", 0, java.lang.Integer.MAX_VALUE, lastModified)); - childrenList.add(new Property("requester", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The creator of the task.", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("owner", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The owner of this task. The participant who can execute this task.", 0, java.lang.Integer.MAX_VALUE, owner)); + childrenList.add(new Property("requester", "", "The creator of the task.", 0, java.lang.Integer.MAX_VALUE, requester)); childrenList.add(new Property("performerType", "CodeableConcept", "The type of participant that can execute the task.", 0, java.lang.Integer.MAX_VALUE, performerType)); + childrenList.add(new Property("owner", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The owner of this task. The participant who can execute this task.", 0, java.lang.Integer.MAX_VALUE, owner)); childrenList.add(new Property("reason", "CodeableConcept", "A description or code indicating why this task needs to be performed.", 0, java.lang.Integer.MAX_VALUE, reason)); childrenList.add(new Property("note", "Annotation", "Free-text information captured about the task as it progresses.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("fulfillment", "", "Identifies any limitations on what part of a referenced task subject request should be actioned.", 0, java.lang.Integer.MAX_VALUE, fulfillment)); - childrenList.add(new Property("definition", "uri", "A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("relevantHistory", "Reference(Provenance)", "Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.", 0, java.lang.Integer.MAX_VALUE, relevantHistory)); + childrenList.add(new Property("restriction", "", "If the Task.focus is a request resource and the task is seeking fulfillment (i.e is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.", 0, java.lang.Integer.MAX_VALUE, restriction)); childrenList.add(new Property("input", "", "Additional information that may be needed in the execution of the task.", 0, java.lang.Integer.MAX_VALUE, input)); childrenList.add(new Property("output", "", "Outputs produced by the Task.", 0, java.lang.Integer.MAX_VALUE, output)); } @@ -2563,29 +3179,31 @@ public class Task extends DomainResource { @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier + case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier + case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Type case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference - case 395923612: /*requisition*/ return this.requisition == null ? new Base[0] : new Base[] {this.requisition}; // Identifier - case -995424086: /*parent*/ return this.parent == null ? new Base[0] : this.parent.toArray(new Base[this.parent.size()]); // Reference + case -445338488: /*groupIdentifier*/ return this.groupIdentifier == null ? new Base[0] : new Base[] {this.groupIdentifier}; // Identifier + case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept case 2008591314: /*businessStatus*/ return this.businessStatus == null ? new Base[0] : new Base[] {this.businessStatus}; // CodeableConcept - case 109757182: /*stage*/ return this.stage == null ? new Base[0] : new Base[] {this.stage}; // CodeableConcept - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept + case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration + case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // Reference case 101577: /*for*/ return this.for_ == null ? new Base[0] : new Base[] {this.for_}; // Reference case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType + case 1218624249: /*executionPeriod*/ return this.executionPeriod == null ? new Base[0] : new Base[] {this.executionPeriod}; // Period + case -1500852503: /*authoredOn*/ return this.authoredOn == null ? new Base[0] : new Base[] {this.authoredOn}; // DateTimeType case 1959003007: /*lastModified*/ return this.lastModified == null ? new Base[0] : new Base[] {this.lastModified}; // DateTimeType - case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference - case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference + case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // TaskRequesterComponent case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : this.performerType.toArray(new Base[this.performerType.size()]); // CodeableConcept + case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case 1512395230: /*fulfillment*/ return this.fulfillment == null ? new Base[0] : new Base[] {this.fulfillment}; // TaskFulfillmentComponent - case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType + case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference + case -1561062452: /*restriction*/ return this.restriction == null ? new Base[0] : new Base[] {this.restriction}; // TaskRestrictionComponent case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // ParameterComponent case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // TaskOutputComponent default: return super.getProperty(hash, name, checkValid); @@ -2597,16 +3215,19 @@ public class Task extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier + this.getIdentifier().add(castToIdentifier(value)); // Identifier + break; + case -1014418093: // definition + this.definition = castToType(value); // Type break; case -332612366: // basedOn this.getBasedOn().add(castToReference(value)); // Reference break; - case 395923612: // requisition - this.requisition = castToIdentifier(value); // Identifier + case -445338488: // groupIdentifier + this.groupIdentifier = castToIdentifier(value); // Identifier break; - case -995424086: // parent - this.getParent().add(castToReference(value)); // Reference + case -995410646: // partOf + this.getPartOf().add(castToReference(value)); // Reference break; case -892481550: // status this.status = new TaskStatusEnumFactory().fromType(value); // Enumeration @@ -2617,15 +3238,15 @@ public class Task extends DomainResource { case 2008591314: // businessStatus this.businessStatus = castToCodeableConcept(value); // CodeableConcept break; - case 109757182: // stage - this.stage = castToCodeableConcept(value); // CodeableConcept - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept + case -1183762788: // intent + this.intent = new TaskIntentEnumFactory().fromType(value); // Enumeration break; case -1165461084: // priority this.priority = new TaskPriorityEnumFactory().fromType(value); // Enumeration break; + case 3059181: // code + this.code = castToCodeableConcept(value); // CodeableConcept + break; case -1724546052: // description this.description = castToString(value); // StringType break; @@ -2638,32 +3259,35 @@ public class Task extends DomainResource { case 951530927: // context this.context = castToReference(value); // Reference break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType + case 1218624249: // executionPeriod + this.executionPeriod = castToPeriod(value); // Period + break; + case -1500852503: // authoredOn + this.authoredOn = castToDateTime(value); // DateTimeType break; case 1959003007: // lastModified this.lastModified = castToDateTime(value); // DateTimeType break; case 693933948: // requester - this.requester = castToReference(value); // Reference - break; - case 106164915: // owner - this.owner = castToReference(value); // Reference + this.requester = (TaskRequesterComponent) value; // TaskRequesterComponent break; case -901444568: // performerType this.getPerformerType().add(castToCodeableConcept(value)); // CodeableConcept break; + case 106164915: // owner + this.owner = castToReference(value); // Reference + break; case -934964668: // reason this.reason = castToCodeableConcept(value); // CodeableConcept break; case 3387378: // note this.getNote().add(castToAnnotation(value)); // Annotation break; - case 1512395230: // fulfillment - this.fulfillment = (TaskFulfillmentComponent) value; // TaskFulfillmentComponent + case 1538891575: // relevantHistory + this.getRelevantHistory().add(castToReference(value)); // Reference break; - case -1014418093: // definition - this.definition = castToUri(value); // UriType + case -1561062452: // restriction + this.restriction = (TaskRestrictionComponent) value; // TaskRestrictionComponent break; case 100358090: // input this.getInput().add((ParameterComponent) value); // ParameterComponent @@ -2679,25 +3303,27 @@ public class Task extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier + this.getIdentifier().add(castToIdentifier(value)); + else if (name.equals("definition[x]")) + this.definition = castToType(value); // Type else if (name.equals("basedOn")) this.getBasedOn().add(castToReference(value)); - else if (name.equals("requisition")) - this.requisition = castToIdentifier(value); // Identifier - else if (name.equals("parent")) - this.getParent().add(castToReference(value)); + else if (name.equals("groupIdentifier")) + this.groupIdentifier = castToIdentifier(value); // Identifier + else if (name.equals("partOf")) + this.getPartOf().add(castToReference(value)); else if (name.equals("status")) this.status = new TaskStatusEnumFactory().fromType(value); // Enumeration else if (name.equals("statusReason")) this.statusReason = castToCodeableConcept(value); // CodeableConcept else if (name.equals("businessStatus")) this.businessStatus = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("stage")) - this.stage = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept + else if (name.equals("intent")) + this.intent = new TaskIntentEnumFactory().fromType(value); // Enumeration else if (name.equals("priority")) this.priority = new TaskPriorityEnumFactory().fromType(value); // Enumeration + else if (name.equals("code")) + this.code = castToCodeableConcept(value); // CodeableConcept else if (name.equals("description")) this.description = castToString(value); // StringType else if (name.equals("focus")) @@ -2706,24 +3332,26 @@ public class Task extends DomainResource { this.for_ = castToReference(value); // Reference else if (name.equals("context")) this.context = castToReference(value); // Reference - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType + else if (name.equals("executionPeriod")) + this.executionPeriod = castToPeriod(value); // Period + else if (name.equals("authoredOn")) + this.authoredOn = castToDateTime(value); // DateTimeType else if (name.equals("lastModified")) this.lastModified = castToDateTime(value); // DateTimeType else if (name.equals("requester")) - this.requester = castToReference(value); // Reference - else if (name.equals("owner")) - this.owner = castToReference(value); // Reference + this.requester = (TaskRequesterComponent) value; // TaskRequesterComponent else if (name.equals("performerType")) this.getPerformerType().add(castToCodeableConcept(value)); + else if (name.equals("owner")) + this.owner = castToReference(value); // Reference else if (name.equals("reason")) this.reason = castToCodeableConcept(value); // CodeableConcept else if (name.equals("note")) this.getNote().add(castToAnnotation(value)); - else if (name.equals("fulfillment")) - this.fulfillment = (TaskFulfillmentComponent) value; // TaskFulfillmentComponent - else if (name.equals("definition")) - this.definition = castToUri(value); // UriType + else if (name.equals("relevantHistory")) + this.getRelevantHistory().add(castToReference(value)); + else if (name.equals("restriction")) + this.restriction = (TaskRestrictionComponent) value; // TaskRestrictionComponent else if (name.equals("input")) this.getInput().add((ParameterComponent) value); else if (name.equals("output")) @@ -2735,29 +3363,31 @@ public class Task extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case -1618432855: return getIdentifier(); // Identifier + case -1618432855: return addIdentifier(); // Identifier + case -1139422643: return getDefinition(); // Type case -332612366: return addBasedOn(); // Reference - case 395923612: return getRequisition(); // Identifier - case -995424086: return addParent(); // Reference + case -445338488: return getGroupIdentifier(); // Identifier + case -995410646: return addPartOf(); // Reference case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration case 2051346646: return getStatusReason(); // CodeableConcept case 2008591314: return getBusinessStatus(); // CodeableConcept - case 109757182: return getStage(); // CodeableConcept - case 3059181: return getCode(); // CodeableConcept + case -1183762788: throw new FHIRException("Cannot make property intent as it is not a complex type"); // Enumeration case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration + case 3059181: return getCode(); // CodeableConcept case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType case 97604824: return getFocus(); // Reference case 101577: return getFor(); // Reference case 951530927: return getContext(); // Reference - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType + case 1218624249: return getExecutionPeriod(); // Period + case -1500852503: throw new FHIRException("Cannot make property authoredOn as it is not a complex type"); // DateTimeType case 1959003007: throw new FHIRException("Cannot make property lastModified as it is not a complex type"); // DateTimeType - case 693933948: return getRequester(); // Reference - case 106164915: return getOwner(); // Reference + case 693933948: return getRequester(); // TaskRequesterComponent case -901444568: return addPerformerType(); // CodeableConcept + case 106164915: return getOwner(); // Reference case -934964668: return getReason(); // CodeableConcept case 3387378: return addNote(); // Annotation - case 1512395230: return getFulfillment(); // TaskFulfillmentComponent - case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // UriType + case 1538891575: return addRelevantHistory(); // Reference + case -1561062452: return getRestriction(); // TaskRestrictionComponent case 100358090: return addInput(); // ParameterComponent case -1005512447: return addOutput(); // TaskOutputComponent default: return super.makeProperty(hash, name); @@ -2768,18 +3398,25 @@ public class Task extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; + return addIdentifier(); + } + else if (name.equals("definitionUri")) { + this.definition = new UriType(); + return this.definition; + } + else if (name.equals("definitionReference")) { + this.definition = new Reference(); + return this.definition; } else if (name.equals("basedOn")) { return addBasedOn(); } - else if (name.equals("requisition")) { - this.requisition = new Identifier(); - return this.requisition; + else if (name.equals("groupIdentifier")) { + this.groupIdentifier = new Identifier(); + return this.groupIdentifier; } - else if (name.equals("parent")) { - return addParent(); + else if (name.equals("partOf")) { + return addPartOf(); } else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type Task.status"); @@ -2792,17 +3429,16 @@ public class Task extends DomainResource { this.businessStatus = new CodeableConcept(); return this.businessStatus; } - else if (name.equals("stage")) { - this.stage = new CodeableConcept(); - return this.stage; + else if (name.equals("intent")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.intent"); + } + else if (name.equals("priority")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.priority"); } else if (name.equals("code")) { this.code = new CodeableConcept(); return this.code; } - else if (name.equals("priority")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.priority"); - } else if (name.equals("description")) { throw new FHIRException("Cannot call addChild on a primitive type Task.description"); } @@ -2818,23 +3454,27 @@ public class Task extends DomainResource { this.context = new Reference(); return this.context; } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.created"); + else if (name.equals("executionPeriod")) { + this.executionPeriod = new Period(); + return this.executionPeriod; + } + else if (name.equals("authoredOn")) { + throw new FHIRException("Cannot call addChild on a primitive type Task.authoredOn"); } else if (name.equals("lastModified")) { throw new FHIRException("Cannot call addChild on a primitive type Task.lastModified"); } else if (name.equals("requester")) { - this.requester = new Reference(); + this.requester = new TaskRequesterComponent(); return this.requester; } + else if (name.equals("performerType")) { + return addPerformerType(); + } else if (name.equals("owner")) { this.owner = new Reference(); return this.owner; } - else if (name.equals("performerType")) { - return addPerformerType(); - } else if (name.equals("reason")) { this.reason = new CodeableConcept(); return this.reason; @@ -2842,12 +3482,12 @@ public class Task extends DomainResource { else if (name.equals("note")) { return addNote(); } - else if (name.equals("fulfillment")) { - this.fulfillment = new TaskFulfillmentComponent(); - return this.fulfillment; + else if (name.equals("relevantHistory")) { + return addRelevantHistory(); } - else if (name.equals("definition")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.definition"); + else if (name.equals("restriction")) { + this.restriction = new TaskRestrictionComponent(); + return this.restriction; } else if (name.equals("input")) { return addInput(); @@ -2867,45 +3507,55 @@ public class Task extends DomainResource { public Task copy() { Task dst = new Task(); copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.definition = definition == null ? null : definition.copy(); if (basedOn != null) { dst.basedOn = new ArrayList(); for (Reference i : basedOn) dst.basedOn.add(i.copy()); }; - dst.requisition = requisition == null ? null : requisition.copy(); - if (parent != null) { - dst.parent = new ArrayList(); - for (Reference i : parent) - dst.parent.add(i.copy()); + dst.groupIdentifier = groupIdentifier == null ? null : groupIdentifier.copy(); + if (partOf != null) { + dst.partOf = new ArrayList(); + for (Reference i : partOf) + dst.partOf.add(i.copy()); }; dst.status = status == null ? null : status.copy(); dst.statusReason = statusReason == null ? null : statusReason.copy(); dst.businessStatus = businessStatus == null ? null : businessStatus.copy(); - dst.stage = stage == null ? null : stage.copy(); - dst.code = code == null ? null : code.copy(); + dst.intent = intent == null ? null : intent.copy(); dst.priority = priority == null ? null : priority.copy(); + dst.code = code == null ? null : code.copy(); dst.description = description == null ? null : description.copy(); dst.focus = focus == null ? null : focus.copy(); dst.for_ = for_ == null ? null : for_.copy(); dst.context = context == null ? null : context.copy(); - dst.created = created == null ? null : created.copy(); + dst.executionPeriod = executionPeriod == null ? null : executionPeriod.copy(); + dst.authoredOn = authoredOn == null ? null : authoredOn.copy(); dst.lastModified = lastModified == null ? null : lastModified.copy(); dst.requester = requester == null ? null : requester.copy(); - dst.owner = owner == null ? null : owner.copy(); if (performerType != null) { dst.performerType = new ArrayList(); for (CodeableConcept i : performerType) dst.performerType.add(i.copy()); }; + dst.owner = owner == null ? null : owner.copy(); dst.reason = reason == null ? null : reason.copy(); if (note != null) { dst.note = new ArrayList(); for (Annotation i : note) dst.note.add(i.copy()); }; - dst.fulfillment = fulfillment == null ? null : fulfillment.copy(); - dst.definition = definition == null ? null : definition.copy(); + if (relevantHistory != null) { + dst.relevantHistory = new ArrayList(); + for (Reference i : relevantHistory) + dst.relevantHistory.add(i.copy()); + }; + dst.restriction = restriction == null ? null : restriction.copy(); if (input != null) { dst.input = new ArrayList(); for (ParameterComponent i : input) @@ -2930,14 +3580,16 @@ public class Task extends DomainResource { if (!(other instanceof Task)) return false; Task o = (Task) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(requisition, o.requisition, true) - && compareDeep(parent, o.parent, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true) - && compareDeep(businessStatus, o.businessStatus, true) && compareDeep(stage, o.stage, true) && compareDeep(code, o.code, true) - && compareDeep(priority, o.priority, true) && compareDeep(description, o.description, true) && compareDeep(focus, o.focus, true) - && compareDeep(for_, o.for_, true) && compareDeep(context, o.context, true) && compareDeep(created, o.created, true) - && compareDeep(lastModified, o.lastModified, true) && compareDeep(requester, o.requester, true) - && compareDeep(owner, o.owner, true) && compareDeep(performerType, o.performerType, true) && compareDeep(reason, o.reason, true) - && compareDeep(note, o.note, true) && compareDeep(fulfillment, o.fulfillment, true) && compareDeep(definition, o.definition, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(definition, o.definition, true) + && compareDeep(basedOn, o.basedOn, true) && compareDeep(groupIdentifier, o.groupIdentifier, true) + && compareDeep(partOf, o.partOf, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true) + && compareDeep(businessStatus, o.businessStatus, true) && compareDeep(intent, o.intent, true) && compareDeep(priority, o.priority, true) + && compareDeep(code, o.code, true) && compareDeep(description, o.description, true) && compareDeep(focus, o.focus, true) + && compareDeep(for_, o.for_, true) && compareDeep(context, o.context, true) && compareDeep(executionPeriod, o.executionPeriod, true) + && compareDeep(authoredOn, o.authoredOn, true) && compareDeep(lastModified, o.lastModified, true) + && compareDeep(requester, o.requester, true) && compareDeep(performerType, o.performerType, true) + && compareDeep(owner, o.owner, true) && compareDeep(reason, o.reason, true) && compareDeep(note, o.note, true) + && compareDeep(relevantHistory, o.relevantHistory, true) && compareDeep(restriction, o.restriction, true) && compareDeep(input, o.input, true) && compareDeep(output, o.output, true); } @@ -2948,16 +3600,17 @@ public class Task extends DomainResource { if (!(other instanceof Task)) return false; Task o = (Task) other; - return compareValues(status, o.status, true) && compareValues(priority, o.priority, true) && compareValues(description, o.description, true) - && compareValues(created, o.created, true) && compareValues(lastModified, o.lastModified, true) && compareValues(definition, o.definition, true) - ; + return compareValues(status, o.status, true) && compareValues(intent, o.intent, true) && compareValues(priority, o.priority, true) + && compareValues(description, o.description, true) && compareValues(authoredOn, o.authoredOn, true) + && compareValues(lastModified, o.lastModified, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, requisition - , parent, status, statusReason, businessStatus, stage, code, priority, description - , focus, for_, context, created, lastModified, requester, owner, performerType - , reason, note, fulfillment, definition, input, output); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, definition, basedOn + , groupIdentifier, partOf, status, statusReason, businessStatus, intent, priority + , code, description, focus, for_, context, executionPeriod, authoredOn, lastModified + , requester, performerType, owner, reason, note, relevantHistory, restriction + , input, output); } @Override @@ -2996,17 +3649,17 @@ public class Task extends DomainResource { *

* Description: Search by task requester
* Type: reference
- * Path: Task.requester
+ * Path: Task.requester.agent
*

*/ - @SearchParamDefinition(name="requester", path="Task.requester", description="Search by task requester", type="reference", target={Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } ) + @SearchParamDefinition(name="requester", path="Task.requester.agent", description="Search by task requester", type="reference", target={Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } ) public static final String SP_REQUESTER = "requester"; /** * Fluent Client search parameter constant for requester *

* Description: Search by task requester
* Type: reference
- * Path: Task.requester
+ * Path: Task.requester.agent
*

*/ public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER); @@ -3038,30 +3691,44 @@ public class Task extends DomainResource { public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); /** - * Search parameter: parent + * Search parameter: business-status *

- * Description: Search by parent task
- * Type: reference
- * Path: Task.parent
+ * Description: Search by business status
+ * Type: token
+ * Path: Task.businessStatus
*

*/ - @SearchParamDefinition(name="parent", path="Task.parent", description="Search by parent task", type="reference", target={Task.class } ) - public static final String SP_PARENT = "parent"; + @SearchParamDefinition(name="business-status", path="Task.businessStatus", description="Search by business status", type="token" ) + public static final String SP_BUSINESS_STATUS = "business-status"; /** - * Fluent Client search parameter constant for parent + * Fluent Client search parameter constant for business-status *

- * Description: Search by parent task
- * Type: reference
- * Path: Task.parent
+ * Description: Search by business status
+ * Type: token
+ * Path: Task.businessStatus
*

*/ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); + public static final ca.uhn.fhir.rest.gclient.TokenClientParam BUSINESS_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BUSINESS_STATUS); -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Task:parent". + /** + * Search parameter: period + *

+ * Description: Search by period Task is/was underway
+ * Type: date
+ * Path: Task.executionPeriod
+ *

*/ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("Task:parent").toLocked(); + @SearchParamDefinition(name="period", path="Task.executionPeriod", description="Search by period Task is/was underway", type="date" ) + public static final String SP_PERIOD = "period"; + /** + * Fluent Client search parameter constant for period + *

+ * Description: Search by period Task is/was underway
+ * Type: date
+ * Path: Task.executionPeriod
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); /** * Search parameter: code @@ -3104,24 +3771,30 @@ public class Task extends DomainResource { public static final ca.uhn.fhir.rest.gclient.TokenClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PERFORMER); /** - * Search parameter: created + * Search parameter: subject *

- * Description: Search by creation date
- * Type: date
- * Path: Task.created
+ * Description: Search by subject
+ * Type: reference
+ * Path: Task.for
*

*/ - @SearchParamDefinition(name="created", path="Task.created", description="Search by creation date", type="date" ) - public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="subject", path="Task.for", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; /** - * Fluent Client search parameter constant for created + * Fluent Client search parameter constant for subject *

- * Description: Search by creation date
- * Type: date
- * Path: Task.created
+ * Description: Search by subject
+ * Type: reference
+ * Path: Task.for
*

*/ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:subject". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Task:subject").toLocked(); /** * Search parameter: focus @@ -3149,6 +3822,32 @@ public class Task extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_FOCUS = new ca.uhn.fhir.model.api.Include("Task:focus").toLocked(); + /** + * Search parameter: part-of + *

+ * Description: Search by task this task is part of
+ * Type: reference
+ * Path: Task.partOf
+ *

+ */ + @SearchParamDefinition(name="part-of", path="Task.partOf", description="Search by task this task is part of", type="reference", target={Task.class } ) + public static final String SP_PART_OF = "part-of"; + /** + * Fluent Client search parameter constant for part-of + *

+ * Description: Search by task this task is part of
+ * Type: reference
+ * Path: Task.partOf
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:part-of". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Task:part-of").toLocked(); + /** * Search parameter: priority *

@@ -3170,44 +3869,90 @@ public class Task extends DomainResource { public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); /** - * Search parameter: stage + * Search parameter: authored-on *

- * Description: Search by task stage
- * Type: token
- * Path: Task.stage
+ * Description: Search by creation date
+ * Type: date
+ * Path: Task.authoredOn
*

*/ - @SearchParamDefinition(name="stage", path="Task.stage", description="Search by task stage", type="token" ) - public static final String SP_STAGE = "stage"; + @SearchParamDefinition(name="authored-on", path="Task.authoredOn", description="Search by creation date", type="date" ) + public static final String SP_AUTHORED_ON = "authored-on"; /** - * Fluent Client search parameter constant for stage + * Fluent Client search parameter constant for authored-on *

- * Description: Search by task stage
- * Type: token
- * Path: Task.stage
+ * Description: Search by creation date
+ * Type: date
+ * Path: Task.authoredOn
*

*/ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STAGE); + public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED_ON = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED_ON); /** - * Search parameter: statusreason + * Search parameter: intent *

- * Description: Search by status reason
+ * Description: Search by task intent
* Type: token
- * Path: Task.statusReason
+ * Path: Task.intent
*

*/ - @SearchParamDefinition(name="statusreason", path="Task.statusReason", description="Search by status reason", type="token" ) - public static final String SP_STATUSREASON = "statusreason"; + @SearchParamDefinition(name="intent", path="Task.intent", description="Search by task intent", type="token" ) + public static final String SP_INTENT = "intent"; /** - * Fluent Client search parameter constant for statusreason + * Fluent Client search parameter constant for intent *

- * Description: Search by status reason
+ * Description: Search by task intent
* Type: token
- * Path: Task.statusReason
+ * Path: Task.intent
*

*/ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUSREASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUSREASON); + public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTENT); + + /** + * Search parameter: group-identifier + *

+ * Description: Search by group identifier
+ * Type: token
+ * Path: Task.groupIdentifier
+ *

+ */ + @SearchParamDefinition(name="group-identifier", path="Task.groupIdentifier", description="Search by group identifier", type="token" ) + public static final String SP_GROUP_IDENTIFIER = "group-identifier"; + /** + * Fluent Client search parameter constant for group-identifier + *

+ * Description: Search by group identifier
+ * Type: token
+ * Path: Task.groupIdentifier
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam GROUP_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GROUP_IDENTIFIER); + + /** + * Search parameter: based-on + *

+ * Description: Search by requests this task is based on
+ * Type: reference
+ * Path: Task.basedOn
+ *

+ */ + @SearchParamDefinition(name="based-on", path="Task.basedOn", description="Search by requests this task is based on", type="reference" ) + public static final String SP_BASED_ON = "based-on"; + /** + * Fluent Client search parameter constant for based-on + *

+ * Description: Search by requests this task is based on
+ * Type: reference
+ * Path: Task.basedOn
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:based-on". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Task:based-on").toLocked(); /** * Search parameter: patient @@ -3235,6 +3980,104 @@ public class Task extends DomainResource { */ public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Task:patient").toLocked(); + /** + * Search parameter: statusreason + *

+ * Description: Search by status reason
+ * Type: token
+ * Path: Task.statusReason
+ *

+ */ + @SearchParamDefinition(name="statusreason", path="Task.statusReason", description="Search by status reason", type="token" ) + public static final String SP_STATUSREASON = "statusreason"; + /** + * Fluent Client search parameter constant for statusreason + *

+ * Description: Search by status reason
+ * Type: token
+ * Path: Task.statusReason
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUSREASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUSREASON); + + /** + * Search parameter: definition-ref + *

+ * Description: Search by task definition as a Reference
+ * Type: reference
+ * Path: Task.definitionReference
+ *

+ */ + @SearchParamDefinition(name="definition-ref", path="Task.definition.as(Reference)", description="Search by task definition as a Reference", type="reference", target={ActivityDefinition.class } ) + public static final String SP_DEFINITION_REF = "definition-ref"; + /** + * Fluent Client search parameter constant for definition-ref + *

+ * Description: Search by task definition as a Reference
+ * Type: reference
+ * Path: Task.definitionReference
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEFINITION_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEFINITION_REF); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:definition-ref". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_DEFINITION_REF = new ca.uhn.fhir.model.api.Include("Task:definition-ref").toLocked(); + + /** + * Search parameter: organization + *

+ * Description: Search by responsible organization
+ * Type: reference
+ * Path: Task.requester.onBehalfOf
+ *

+ */ + @SearchParamDefinition(name="organization", path="Task.requester.onBehalfOf", description="Search by responsible organization", type="reference", target={Organization.class } ) + public static final String SP_ORGANIZATION = "organization"; + /** + * Fluent Client search parameter constant for organization + *

+ * Description: Search by responsible organization
+ * Type: reference
+ * Path: Task.requester.onBehalfOf
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:organization". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Task:organization").toLocked(); + + /** + * Search parameter: context + *

+ * Description: Search by encounter or episode
+ * Type: reference
+ * Path: Task.context
+ *

+ */ + @SearchParamDefinition(name="context", path="Task.context", description="Search by encounter or episode", type="reference", target={Encounter.class, EpisodeOfCare.class } ) + public static final String SP_CONTEXT = "context"; + /** + * Fluent Client search parameter constant for context + *

+ * Description: Search by encounter or episode
+ * Type: reference
+ * Path: Task.context
+ *

+ */ + public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT); + +/** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Task:context". + */ + public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("Task:context").toLocked(); + /** * Search parameter: modified *

@@ -3255,26 +4098,6 @@ public class Task extends DomainResource { */ public static final ca.uhn.fhir.rest.gclient.DateClientParam MODIFIED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_MODIFIED); - /** - * Search parameter: definition - *

- * Description: Search by task definition
- * Type: uri
- * Path: Task.definition
- *

- */ - @SearchParamDefinition(name="definition", path="Task.definition", description="Search by task definition", type="uri" ) - public static final String SP_DEFINITION = "definition"; - /** - * Fluent Client search parameter constant for definition - *

- * Description: Search by task definition
- * Type: uri
- * Path: Task.definition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam DEFINITION = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DEFINITION); - /** * Search parameter: status *

diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TestReport.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TestReport.java index 6e9182e1603..e9ae3cfe261 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TestReport.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TestReport.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TestScript.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TestScript.java index ad0bdba7e37..affe5b8851f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TestScript.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TestScript.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -4665,10 +4665,10 @@ public class TestScript extends MetadataResource { protected Coding type; /** - * The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + * The type of the resource. See http://build.fhir.org/resourcelist.html. */ @Child(name = "resource", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource type", formalDefinition="The type of the resource. See http://hl7-fhir.github.io/resourcelist.html." ) + @Description(shortDefinition="Resource type", formalDefinition="The type of the resource. See http://build.fhir.org/resourcelist.html." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types") protected CodeType resource; @@ -4806,7 +4806,7 @@ public class TestScript extends MetadataResource { } /** - * @return {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value + * @return {@link #resource} (The type of the resource. See http://build.fhir.org/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value */ public CodeType getResourceElement() { if (this.resource == null) @@ -4826,7 +4826,7 @@ public class TestScript extends MetadataResource { } /** - * @param value {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value + * @param value {@link #resource} (The type of the resource. See http://build.fhir.org/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value */ public SetupActionOperationComponent setResourceElement(CodeType value) { this.resource = value; @@ -4834,14 +4834,14 @@ public class TestScript extends MetadataResource { } /** - * @return The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + * @return The type of the resource. See http://build.fhir.org/resourcelist.html. */ public String getResource() { return this.resource == null ? null : this.resource.getValue(); } /** - * @param value The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + * @param value The type of the resource. See http://build.fhir.org/resourcelist.html. */ public SetupActionOperationComponent setResource(String value) { if (Utilities.noString(value)) @@ -5535,7 +5535,7 @@ public class TestScript extends MetadataResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("type", "Coding", "Server interaction or operation type.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("resource", "code", "The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("resource", "code", "The type of the resource. See http://build.fhir.org/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource)); childrenList.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, label)); childrenList.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description)); childrenList.add(new Property("accept", "code", "The content-type or mime-type to use for RESTful operation in the 'Accept' header.", 0, java.lang.Integer.MAX_VALUE, accept)); @@ -6147,10 +6147,10 @@ public class TestScript extends MetadataResource { protected StringType requestURL; /** - * The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + * The type of the resource. See http://build.fhir.org/resourcelist.html. */ @Child(name = "resource", type = {CodeType.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource type", formalDefinition="The type of the resource. See http://hl7-fhir.github.io/resourcelist.html." ) + @Description(shortDefinition="Resource type", formalDefinition="The type of the resource. See http://build.fhir.org/resourcelist.html." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types") protected CodeType resource; @@ -6903,7 +6903,7 @@ public class TestScript extends MetadataResource { } /** - * @return {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value + * @return {@link #resource} (The type of the resource. See http://build.fhir.org/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value */ public CodeType getResourceElement() { if (this.resource == null) @@ -6923,7 +6923,7 @@ public class TestScript extends MetadataResource { } /** - * @param value {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value + * @param value {@link #resource} (The type of the resource. See http://build.fhir.org/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value */ public SetupActionAssertComponent setResourceElement(CodeType value) { this.resource = value; @@ -6931,14 +6931,14 @@ public class TestScript extends MetadataResource { } /** - * @return The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + * @return The type of the resource. See http://build.fhir.org/resourcelist.html. */ public String getResource() { return this.resource == null ? null : this.resource.getValue(); } /** - * @param value The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + * @param value The type of the resource. See http://build.fhir.org/resourcelist.html. */ public SetupActionAssertComponent setResource(String value) { if (Utilities.noString(value)) @@ -7305,7 +7305,7 @@ public class TestScript extends MetadataResource { childrenList.add(new Property("operator", "code", "The operator type defines the conditional behavior of the assert. If not defined, the default is equals.", 0, java.lang.Integer.MAX_VALUE, operator)); childrenList.add(new Property("path", "string", "The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.", 0, java.lang.Integer.MAX_VALUE, path)); childrenList.add(new Property("requestURL", "string", "The value to use in a comparison against the request URL path string.", 0, java.lang.Integer.MAX_VALUE, requestURL)); - childrenList.add(new Property("resource", "code", "The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("resource", "code", "The type of the resource. See http://build.fhir.org/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource)); childrenList.add(new Property("response", "code", "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.", 0, java.lang.Integer.MAX_VALUE, response)); childrenList.add(new Property("responseCode", "string", "The value of the HTTP response code to be tested.", 0, java.lang.Integer.MAX_VALUE, responseCode)); childrenList.add(new Property("rule", "", "The TestScript.rule this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, rule)); diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Timing.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Timing.java index 90fb6ba888c..1c34321c2c7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Timing.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Timing.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -218,7 +218,193 @@ public class Timing extends Type implements ICompositeType { } } + public enum DayOfWeek { + /** + * Monday + */ + MON, + /** + * Tuesday + */ + TUE, + /** + * Wednesday + */ + WED, + /** + * Thursday + */ + THU, + /** + * Friday + */ + FRI, + /** + * Saturday + */ + SAT, + /** + * Sunday + */ + SUN, + /** + * added to help the parsers with the generic types + */ + NULL; + public static DayOfWeek fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("mon".equals(codeString)) + return MON; + if ("tue".equals(codeString)) + return TUE; + if ("wed".equals(codeString)) + return WED; + if ("thu".equals(codeString)) + return THU; + if ("fri".equals(codeString)) + return FRI; + if ("sat".equals(codeString)) + return SAT; + if ("sun".equals(codeString)) + return SUN; + if (Configuration.isAcceptInvalidEnums()) + return null; + else + throw new FHIRException("Unknown DayOfWeek code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MON: return "mon"; + case TUE: return "tue"; + case WED: return "wed"; + case THU: return "thu"; + case FRI: return "fri"; + case SAT: return "sat"; + case SUN: return "sun"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MON: return "http://hl7.org/fhir/days-of-week"; + case TUE: return "http://hl7.org/fhir/days-of-week"; + case WED: return "http://hl7.org/fhir/days-of-week"; + case THU: return "http://hl7.org/fhir/days-of-week"; + case FRI: return "http://hl7.org/fhir/days-of-week"; + case SAT: return "http://hl7.org/fhir/days-of-week"; + case SUN: return "http://hl7.org/fhir/days-of-week"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MON: return "Monday"; + case TUE: return "Tuesday"; + case WED: return "Wednesday"; + case THU: return "Thursday"; + case FRI: return "Friday"; + case SAT: return "Saturday"; + case SUN: return "Sunday"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MON: return "Monday"; + case TUE: return "Tuesday"; + case WED: return "Wednesday"; + case THU: return "Thursday"; + case FRI: return "Friday"; + case SAT: return "Saturday"; + case SUN: return "Sunday"; + default: return "?"; + } + } + } + + public static class DayOfWeekEnumFactory implements EnumFactory { + public DayOfWeek fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("mon".equals(codeString)) + return DayOfWeek.MON; + if ("tue".equals(codeString)) + return DayOfWeek.TUE; + if ("wed".equals(codeString)) + return DayOfWeek.WED; + if ("thu".equals(codeString)) + return DayOfWeek.THU; + if ("fri".equals(codeString)) + return DayOfWeek.FRI; + if ("sat".equals(codeString)) + return DayOfWeek.SAT; + if ("sun".equals(codeString)) + return DayOfWeek.SUN; + throw new IllegalArgumentException("Unknown DayOfWeek code '"+codeString+"'"); + } + public Enumeration fromType(Base code) throws FHIRException { + if (code == null || code.isEmpty()) + return null; + String codeString = ((PrimitiveType) code).asStringValue(); + if (codeString == null || "".equals(codeString)) + return null; + if ("mon".equals(codeString)) + return new Enumeration(this, DayOfWeek.MON); + if ("tue".equals(codeString)) + return new Enumeration(this, DayOfWeek.TUE); + if ("wed".equals(codeString)) + return new Enumeration(this, DayOfWeek.WED); + if ("thu".equals(codeString)) + return new Enumeration(this, DayOfWeek.THU); + if ("fri".equals(codeString)) + return new Enumeration(this, DayOfWeek.FRI); + if ("sat".equals(codeString)) + return new Enumeration(this, DayOfWeek.SAT); + if ("sun".equals(codeString)) + return new Enumeration(this, DayOfWeek.SUN); + throw new FHIRException("Unknown DayOfWeek code '"+codeString+"'"); + } + public String toCode(DayOfWeek code) { + if (code == DayOfWeek.MON) + return "mon"; + if (code == DayOfWeek.TUE) + return "tue"; + if (code == DayOfWeek.WED) + return "wed"; + if (code == DayOfWeek.THU) + return "thu"; + if (code == DayOfWeek.FRI) + return "fri"; + if (code == DayOfWeek.SAT) + return "sat"; + if (code == DayOfWeek.SUN) + return "sun"; + return "?"; + } + public String toSystem(DayOfWeek code) { + return code.getSystem(); + } + } + public enum EventTiming { + /** + * event occurs during the morning + */ + MORN, + /** + * event occurs during the afternoon + */ + AFT, + /** + * event occurs during the evening + */ + EVE, + /** + * event occurs during the night + */ + NIGHT, /** * null */ @@ -282,6 +468,14 @@ public class Timing extends Type implements ICompositeType { public static EventTiming fromCode(String codeString) throws FHIRException { if (codeString == null || "".equals(codeString)) return null; + if ("MORN".equals(codeString)) + return MORN; + if ("AFT".equals(codeString)) + return AFT; + if ("EVE".equals(codeString)) + return EVE; + if ("NIGHT".equals(codeString)) + return NIGHT; if ("HS".equals(codeString)) return HS; if ("WAKE".equals(codeString)) @@ -317,6 +511,10 @@ public class Timing extends Type implements ICompositeType { } public String toCode() { switch (this) { + case MORN: return "MORN"; + case AFT: return "AFT"; + case EVE: return "EVE"; + case NIGHT: return "NIGHT"; case HS: return "HS"; case WAKE: return "WAKE"; case C: return "C"; @@ -336,6 +534,10 @@ public class Timing extends Type implements ICompositeType { } public String getSystem() { switch (this) { + case MORN: return "http://hl7.org/fhir/event-timing"; + case AFT: return "http://hl7.org/fhir/event-timing"; + case EVE: return "http://hl7.org/fhir/event-timing"; + case NIGHT: return "http://hl7.org/fhir/event-timing"; case HS: return "http://hl7.org/fhir/v3/TimingEvent"; case WAKE: return "http://hl7.org/fhir/v3/TimingEvent"; case C: return "http://hl7.org/fhir/v3/TimingEvent"; @@ -355,6 +557,10 @@ public class Timing extends Type implements ICompositeType { } public String getDefinition() { switch (this) { + case MORN: return "event occurs during the morning"; + case AFT: return "event occurs during the afternoon"; + case EVE: return "event occurs during the evening"; + case NIGHT: return "event occurs during the night"; case HS: return ""; case WAKE: return ""; case C: return ""; @@ -374,6 +580,10 @@ public class Timing extends Type implements ICompositeType { } public String getDisplay() { switch (this) { + case MORN: return "Morning"; + case AFT: return "Afternoon"; + case EVE: return "Evening"; + case NIGHT: return "Night"; case HS: return "HS"; case WAKE: return "WAKE"; case C: return "C"; @@ -398,6 +608,14 @@ public class Timing extends Type implements ICompositeType { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; + if ("MORN".equals(codeString)) + return EventTiming.MORN; + if ("AFT".equals(codeString)) + return EventTiming.AFT; + if ("EVE".equals(codeString)) + return EventTiming.EVE; + if ("NIGHT".equals(codeString)) + return EventTiming.NIGHT; if ("HS".equals(codeString)) return EventTiming.HS; if ("WAKE".equals(codeString)) @@ -434,6 +652,14 @@ public class Timing extends Type implements ICompositeType { String codeString = ((PrimitiveType) code).asStringValue(); if (codeString == null || "".equals(codeString)) return null; + if ("MORN".equals(codeString)) + return new Enumeration(this, EventTiming.MORN); + if ("AFT".equals(codeString)) + return new Enumeration(this, EventTiming.AFT); + if ("EVE".equals(codeString)) + return new Enumeration(this, EventTiming.EVE); + if ("NIGHT".equals(codeString)) + return new Enumeration(this, EventTiming.NIGHT); if ("HS".equals(codeString)) return new Enumeration(this, EventTiming.HS); if ("WAKE".equals(codeString)) @@ -465,6 +691,14 @@ public class Timing extends Type implements ICompositeType { throw new FHIRException("Unknown EventTiming code '"+codeString+"'"); } public String toCode(EventTiming code) { + if (code == EventTiming.MORN) + return "MORN"; + if (code == EventTiming.AFT) + return "AFT"; + if (code == EventTiming.EVE) + return "EVE"; + if (code == EventTiming.NIGHT) + return "NIGHT"; if (code == EventTiming.HS) return "HS"; if (code == EventTiming.WAKE) @@ -581,10 +815,25 @@ public class Timing extends Type implements ICompositeType { @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/units-of-time") protected Enumeration periodUnit; + /** + * If one or more days of week is provided, then the action happens only on the specified day(s). + */ + @Child(name = "dayOfWeek", type = {CodeType.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="mon | tue | wed | thu | fri | sat | sun", formalDefinition="If one or more days of week is provided, then the action happens only on the specified day(s)." ) + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/days-of-week") + protected List> dayOfWeek; + + /** + * Specified time of day for action to take place. + */ + @Child(name = "timeOfDay", type = {TimeType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Description(shortDefinition="Time of day for action", formalDefinition="Specified time of day for action to take place." ) + protected List timeOfDay; + /** * A real world event that the occurrence of the event should be tied to. */ - @Child(name = "when", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=true) + @Child(name = "when", type = {CodeType.class}, order=14, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Regular life events the event is tied to", formalDefinition="A real world event that the occurrence of the event should be tied to." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-timing") protected Enumeration when; @@ -592,11 +841,11 @@ public class Timing extends Type implements ICompositeType { /** * The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. */ - @Child(name = "offset", type = {UnsignedIntType.class}, order=13, min=0, max=1, modifier=false, summary=true) + @Child(name = "offset", type = {UnsignedIntType.class}, order=15, min=0, max=1, modifier=false, summary=true) @Description(shortDefinition="Minutes from event (before or after)", formalDefinition="The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event." ) protected UnsignedIntType offset; - private static final long serialVersionUID = -1317919984L; + private static final long serialVersionUID = -1646532442L; /** * Constructor @@ -1209,6 +1458,128 @@ public class Timing extends Type implements ICompositeType { return this; } + /** + * @return {@link #dayOfWeek} (If one or more days of week is provided, then the action happens only on the specified day(s).) + */ + public List> getDayOfWeek() { + if (this.dayOfWeek == null) + this.dayOfWeek = new ArrayList>(); + return this.dayOfWeek; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public TimingRepeatComponent setDayOfWeek(List> theDayOfWeek) { + this.dayOfWeek = theDayOfWeek; + return this; + } + + public boolean hasDayOfWeek() { + if (this.dayOfWeek == null) + return false; + for (Enumeration item : this.dayOfWeek) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dayOfWeek} (If one or more days of week is provided, then the action happens only on the specified day(s).) + */ + public Enumeration addDayOfWeekElement() {//2 + Enumeration t = new Enumeration(new DayOfWeekEnumFactory()); + if (this.dayOfWeek == null) + this.dayOfWeek = new ArrayList>(); + this.dayOfWeek.add(t); + return t; + } + + /** + * @param value {@link #dayOfWeek} (If one or more days of week is provided, then the action happens only on the specified day(s).) + */ + public TimingRepeatComponent addDayOfWeek(DayOfWeek value) { //1 + Enumeration t = new Enumeration(new DayOfWeekEnumFactory()); + t.setValue(value); + if (this.dayOfWeek == null) + this.dayOfWeek = new ArrayList>(); + this.dayOfWeek.add(t); + return this; + } + + /** + * @param value {@link #dayOfWeek} (If one or more days of week is provided, then the action happens only on the specified day(s).) + */ + public boolean hasDayOfWeek(DayOfWeek value) { + if (this.dayOfWeek == null) + return false; + for (Enumeration v : this.dayOfWeek) + if (v.getValue().equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #timeOfDay} (Specified time of day for action to take place.) + */ + public List getTimeOfDay() { + if (this.timeOfDay == null) + this.timeOfDay = new ArrayList(); + return this.timeOfDay; + } + + /** + * @return Returns a reference to this for easy method chaining + */ + public TimingRepeatComponent setTimeOfDay(List theTimeOfDay) { + this.timeOfDay = theTimeOfDay; + return this; + } + + public boolean hasTimeOfDay() { + if (this.timeOfDay == null) + return false; + for (TimeType item : this.timeOfDay) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #timeOfDay} (Specified time of day for action to take place.) + */ + public TimeType addTimeOfDayElement() {//2 + TimeType t = new TimeType(); + if (this.timeOfDay == null) + this.timeOfDay = new ArrayList(); + this.timeOfDay.add(t); + return t; + } + + /** + * @param value {@link #timeOfDay} (Specified time of day for action to take place.) + */ + public TimingRepeatComponent addTimeOfDay(String value) { //1 + TimeType t = new TimeType(); + t.setValue(value); + if (this.timeOfDay == null) + this.timeOfDay = new ArrayList(); + this.timeOfDay.add(t); + return this; + } + + /** + * @param value {@link #timeOfDay} (Specified time of day for action to take place.) + */ + public boolean hasTimeOfDay(String value) { + if (this.timeOfDay == null) + return false; + for (TimeType v : this.timeOfDay) + if (v.equals(value)) // time + return true; + return false; + } + /** * @return {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value */ @@ -1316,6 +1687,8 @@ public class Timing extends Type implements ICompositeType { childrenList.add(new Property("period", "decimal", "Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period.", 0, java.lang.Integer.MAX_VALUE, period)); childrenList.add(new Property("periodMax", "decimal", "If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days.", 0, java.lang.Integer.MAX_VALUE, periodMax)); childrenList.add(new Property("periodUnit", "code", "The units of time for the period in UCUM units.", 0, java.lang.Integer.MAX_VALUE, periodUnit)); + childrenList.add(new Property("dayOfWeek", "code", "If one or more days of week is provided, then the action happens only on the specified day(s).", 0, java.lang.Integer.MAX_VALUE, dayOfWeek)); + childrenList.add(new Property("timeOfDay", "time", "Specified time of day for action to take place.", 0, java.lang.Integer.MAX_VALUE, timeOfDay)); childrenList.add(new Property("when", "code", "A real world event that the occurrence of the event should be tied to.", 0, java.lang.Integer.MAX_VALUE, when)); childrenList.add(new Property("offset", "unsignedInt", "The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.", 0, java.lang.Integer.MAX_VALUE, offset)); } @@ -1334,6 +1707,8 @@ public class Timing extends Type implements ICompositeType { case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType case 566580195: /*periodMax*/ return this.periodMax == null ? new Base[0] : new Base[] {this.periodMax}; // DecimalType case 384367333: /*periodUnit*/ return this.periodUnit == null ? new Base[0] : new Base[] {this.periodUnit}; // Enumeration + case -730552025: /*dayOfWeek*/ return this.dayOfWeek == null ? new Base[0] : this.dayOfWeek.toArray(new Base[this.dayOfWeek.size()]); // Enumeration + case 21434232: /*timeOfDay*/ return this.timeOfDay == null ? new Base[0] : this.timeOfDay.toArray(new Base[this.timeOfDay.size()]); // TimeType case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // Enumeration case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // UnsignedIntType default: return super.getProperty(hash, name, checkValid); @@ -1377,6 +1752,12 @@ public class Timing extends Type implements ICompositeType { case 384367333: // periodUnit this.periodUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration break; + case -730552025: // dayOfWeek + this.getDayOfWeek().add(new DayOfWeekEnumFactory().fromType(value)); // Enumeration + break; + case 21434232: // timeOfDay + this.getTimeOfDay().add(castToTime(value)); // TimeType + break; case 3648314: // when this.when = new EventTimingEnumFactory().fromType(value); // Enumeration break; @@ -1412,6 +1793,10 @@ public class Timing extends Type implements ICompositeType { this.periodMax = castToDecimal(value); // DecimalType else if (name.equals("periodUnit")) this.periodUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration + else if (name.equals("dayOfWeek")) + this.getDayOfWeek().add(new DayOfWeekEnumFactory().fromType(value)); + else if (name.equals("timeOfDay")) + this.getTimeOfDay().add(castToTime(value)); else if (name.equals("when")) this.when = new EventTimingEnumFactory().fromType(value); // Enumeration else if (name.equals("offset")) @@ -1434,6 +1819,8 @@ public class Timing extends Type implements ICompositeType { case -991726143: throw new FHIRException("Cannot make property period as it is not a complex type"); // DecimalType case 566580195: throw new FHIRException("Cannot make property periodMax as it is not a complex type"); // DecimalType case 384367333: throw new FHIRException("Cannot make property periodUnit as it is not a complex type"); // Enumeration + case -730552025: throw new FHIRException("Cannot make property dayOfWeek as it is not a complex type"); // Enumeration + case 21434232: throw new FHIRException("Cannot make property timeOfDay as it is not a complex type"); // TimeType case 3648314: throw new FHIRException("Cannot make property when as it is not a complex type"); // Enumeration case -1019779949: throw new FHIRException("Cannot make property offset as it is not a complex type"); // UnsignedIntType default: return super.makeProperty(hash, name); @@ -1485,6 +1872,12 @@ public class Timing extends Type implements ICompositeType { else if (name.equals("periodUnit")) { throw new FHIRException("Cannot call addChild on a primitive type Timing.periodUnit"); } + else if (name.equals("dayOfWeek")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.dayOfWeek"); + } + else if (name.equals("timeOfDay")) { + throw new FHIRException("Cannot call addChild on a primitive type Timing.timeOfDay"); + } else if (name.equals("when")) { throw new FHIRException("Cannot call addChild on a primitive type Timing.when"); } @@ -1509,6 +1902,16 @@ public class Timing extends Type implements ICompositeType { dst.period = period == null ? null : period.copy(); dst.periodMax = periodMax == null ? null : periodMax.copy(); dst.periodUnit = periodUnit == null ? null : periodUnit.copy(); + if (dayOfWeek != null) { + dst.dayOfWeek = new ArrayList>(); + for (Enumeration i : dayOfWeek) + dst.dayOfWeek.add(i.copy()); + }; + if (timeOfDay != null) { + dst.timeOfDay = new ArrayList(); + for (TimeType i : timeOfDay) + dst.timeOfDay.add(i.copy()); + }; dst.when = when == null ? null : when.copy(); dst.offset = offset == null ? null : offset.copy(); return dst; @@ -1525,7 +1928,8 @@ public class Timing extends Type implements ICompositeType { && compareDeep(duration, o.duration, true) && compareDeep(durationMax, o.durationMax, true) && compareDeep(durationUnit, o.durationUnit, true) && compareDeep(frequency, o.frequency, true) && compareDeep(frequencyMax, o.frequencyMax, true) && compareDeep(period, o.period, true) && compareDeep(periodMax, o.periodMax, true) && compareDeep(periodUnit, o.periodUnit, true) - && compareDeep(when, o.when, true) && compareDeep(offset, o.offset, true); + && compareDeep(dayOfWeek, o.dayOfWeek, true) && compareDeep(timeOfDay, o.timeOfDay, true) && compareDeep(when, o.when, true) + && compareDeep(offset, o.offset, true); } @Override @@ -1539,13 +1943,14 @@ public class Timing extends Type implements ICompositeType { && compareValues(durationMax, o.durationMax, true) && compareValues(durationUnit, o.durationUnit, true) && compareValues(frequency, o.frequency, true) && compareValues(frequencyMax, o.frequencyMax, true) && compareValues(period, o.period, true) && compareValues(periodMax, o.periodMax, true) && compareValues(periodUnit, o.periodUnit, true) - && compareValues(when, o.when, true) && compareValues(offset, o.offset, true); + && compareValues(dayOfWeek, o.dayOfWeek, true) && compareValues(timeOfDay, o.timeOfDay, true) && compareValues(when, o.when, true) + && compareValues(offset, o.offset, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(bounds, count, countMax , duration, durationMax, durationUnit, frequency, frequencyMax, period, periodMax - , periodUnit, when, offset); + , periodUnit, dayOfWeek, timeOfDay, when, offset); } public String fhirType() { diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TriggerDefinition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TriggerDefinition.java index 657631d8d19..38e56a37bb7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TriggerDefinition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/TriggerDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/UsageContext.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/UsageContext.java index ce938684432..b6e04499042 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/UsageContext.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/UsageContext.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ValueSet.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ValueSet.java index 67a51dc6c20..4f7f5ab1962 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ValueSet.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/ValueSet.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -59,6 +59,10 @@ public class ValueSet extends MetadataResource { * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (i.e. include child codes) */ ISA, + /** + * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include child codes) + */ + DESCENDENTOF, /** * The specified property of the code does not have an is-a relationship with the provided value. */ @@ -79,6 +83,10 @@ public class ValueSet extends MetadataResource { * Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (e.g. include parent codes) */ GENERALIZES, + /** + * The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values) + */ + EXISTS, /** * added to help the parsers with the generic types */ @@ -90,6 +98,8 @@ public class ValueSet extends MetadataResource { return EQUAL; if ("is-a".equals(codeString)) return ISA; + if ("descendent-of".equals(codeString)) + return DESCENDENTOF; if ("is-not-a".equals(codeString)) return ISNOTA; if ("regex".equals(codeString)) @@ -100,6 +110,8 @@ public class ValueSet extends MetadataResource { return NOTIN; if ("generalizes".equals(codeString)) return GENERALIZES; + if ("exists".equals(codeString)) + return EXISTS; if (Configuration.isAcceptInvalidEnums()) return null; else @@ -109,11 +121,13 @@ public class ValueSet extends MetadataResource { switch (this) { case EQUAL: return "="; case ISA: return "is-a"; + case DESCENDENTOF: return "descendent-of"; case ISNOTA: return "is-not-a"; case REGEX: return "regex"; case IN: return "in"; case NOTIN: return "not-in"; case GENERALIZES: return "generalizes"; + case EXISTS: return "exists"; default: return "?"; } } @@ -121,11 +135,13 @@ public class ValueSet extends MetadataResource { switch (this) { case EQUAL: return "http://hl7.org/fhir/filter-operator"; case ISA: return "http://hl7.org/fhir/filter-operator"; + case DESCENDENTOF: return "http://hl7.org/fhir/filter-operator"; case ISNOTA: return "http://hl7.org/fhir/filter-operator"; case REGEX: return "http://hl7.org/fhir/filter-operator"; case IN: return "http://hl7.org/fhir/filter-operator"; case NOTIN: return "http://hl7.org/fhir/filter-operator"; case GENERALIZES: return "http://hl7.org/fhir/filter-operator"; + case EXISTS: return "http://hl7.org/fhir/filter-operator"; default: return "?"; } } @@ -133,11 +149,13 @@ public class ValueSet extends MetadataResource { switch (this) { case EQUAL: return "The specified property of the code equals the provided value."; case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (i.e. include child codes)"; + case DESCENDENTOF: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include child codes)"; case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; case REGEX: return "The specified property of the code matches the regex specified in the provided value."; case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; case GENERALIZES: return "Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (e.g. include parent codes)"; + case EXISTS: return "The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values)"; default: return "?"; } } @@ -145,11 +163,13 @@ public class ValueSet extends MetadataResource { switch (this) { case EQUAL: return "Equals"; case ISA: return "Is A (by subsumption)"; + case DESCENDENTOF: return "Descendent Of (by subsumption)"; case ISNOTA: return "Not (Is A) (by subsumption)"; case REGEX: return "Regular Expression"; case IN: return "In Set"; case NOTIN: return "Not in Set"; case GENERALIZES: return "Generalizes (by Subsumption)"; + case EXISTS: return "Exists"; default: return "?"; } } @@ -164,6 +184,8 @@ public class ValueSet extends MetadataResource { return FilterOperator.EQUAL; if ("is-a".equals(codeString)) return FilterOperator.ISA; + if ("descendent-of".equals(codeString)) + return FilterOperator.DESCENDENTOF; if ("is-not-a".equals(codeString)) return FilterOperator.ISNOTA; if ("regex".equals(codeString)) @@ -174,6 +196,8 @@ public class ValueSet extends MetadataResource { return FilterOperator.NOTIN; if ("generalizes".equals(codeString)) return FilterOperator.GENERALIZES; + if ("exists".equals(codeString)) + return FilterOperator.EXISTS; throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); } public Enumeration fromType(Base code) throws FHIRException { @@ -186,6 +210,8 @@ public class ValueSet extends MetadataResource { return new Enumeration(this, FilterOperator.EQUAL); if ("is-a".equals(codeString)) return new Enumeration(this, FilterOperator.ISA); + if ("descendent-of".equals(codeString)) + return new Enumeration(this, FilterOperator.DESCENDENTOF); if ("is-not-a".equals(codeString)) return new Enumeration(this, FilterOperator.ISNOTA); if ("regex".equals(codeString)) @@ -196,6 +222,8 @@ public class ValueSet extends MetadataResource { return new Enumeration(this, FilterOperator.NOTIN); if ("generalizes".equals(codeString)) return new Enumeration(this, FilterOperator.GENERALIZES); + if ("exists".equals(codeString)) + return new Enumeration(this, FilterOperator.EXISTS); throw new FHIRException("Unknown FilterOperator code '"+codeString+"'"); } public String toCode(FilterOperator code) { @@ -203,6 +231,8 @@ public class ValueSet extends MetadataResource { return "="; if (code == FilterOperator.ISA) return "is-a"; + if (code == FilterOperator.DESCENDENTOF) + return "descendent-of"; if (code == FilterOperator.ISNOTA) return "is-not-a"; if (code == FilterOperator.REGEX) @@ -213,6 +243,8 @@ public class ValueSet extends MetadataResource { return "not-in"; if (code == FilterOperator.GENERALIZES) return "generalizes"; + if (code == FilterOperator.EXISTS) + return "exists"; return "?"; } public String toSystem(FilterOperator code) { @@ -223,27 +255,34 @@ public class ValueSet extends MetadataResource { @Block() public static class ValueSetComposeComponent extends BackboneElement implements IBaseBackboneElement { /** - * If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. + * If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined. */ @Child(name = "lockedDate", type = {DateType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fixed date for all referenced code systems and value sets", formalDefinition="If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date." ) + @Description(shortDefinition="Fixed date for version-less references (transitive)", formalDefinition="If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined." ) protected DateType lockedDate; + /** + * Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included). + */ + @Child(name = "inactive", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=true) + @Description(shortDefinition="Whether inactive codes are in the value set", formalDefinition="Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included)." ) + protected BooleanType inactive; + /** * Include one or more codes from a code system or other value set(s). */ - @Child(name = "include", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) + @Child(name = "include", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="Include one or more codes from a code system or other value set(s)", formalDefinition="Include one or more codes from a code system or other value set(s)." ) protected List include; /** * Exclude one or more codes from the value set based on code system filters and/or other value sets. */ - @Child(name = "exclude", type = {ConceptSetComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "exclude", type = {ConceptSetComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Explicitly exclude codes from a code system or other value sets", formalDefinition="Exclude one or more codes from the value set based on code system filters and/or other value sets." ) protected List exclude; - private static final long serialVersionUID = -337636966L; + private static final long serialVersionUID = -765941757L; /** * Constructor @@ -253,7 +292,7 @@ public class ValueSet extends MetadataResource { } /** - * @return {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value + * @return {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value */ public DateType getLockedDateElement() { if (this.lockedDate == null) @@ -273,7 +312,7 @@ public class ValueSet extends MetadataResource { } /** - * @param value {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value + * @param value {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value */ public ValueSetComposeComponent setLockedDateElement(DateType value) { this.lockedDate = value; @@ -281,14 +320,14 @@ public class ValueSet extends MetadataResource { } /** - * @return If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. + * @return If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined. */ public Date getLockedDate() { return this.lockedDate == null ? null : this.lockedDate.getValue(); } /** - * @param value If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. + * @param value If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined. */ public ValueSetComposeComponent setLockedDate(Date value) { if (value == null) @@ -301,6 +340,51 @@ public class ValueSet extends MetadataResource { return this; } + /** + * @return {@link #inactive} (Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included).). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value + */ + public BooleanType getInactiveElement() { + if (this.inactive == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetComposeComponent.inactive"); + else if (Configuration.doAutoCreate()) + this.inactive = new BooleanType(); // bb + return this.inactive; + } + + public boolean hasInactiveElement() { + return this.inactive != null && !this.inactive.isEmpty(); + } + + public boolean hasInactive() { + return this.inactive != null && !this.inactive.isEmpty(); + } + + /** + * @param value {@link #inactive} (Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included).). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value + */ + public ValueSetComposeComponent setInactiveElement(BooleanType value) { + this.inactive = value; + return this; + } + + /** + * @return Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included). + */ + public boolean getInactive() { + return this.inactive == null || this.inactive.isEmpty() ? false : this.inactive.getValue(); + } + + /** + * @param value Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included). + */ + public ValueSetComposeComponent setInactive(boolean value) { + if (this.inactive == null) + this.inactive = new BooleanType(); + this.inactive.setValue(value); + return this; + } + /** * @return {@link #include} (Include one or more codes from a code system or other value set(s).) */ @@ -409,7 +493,8 @@ public class ValueSet extends MetadataResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("lockedDate", "date", "If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.", 0, java.lang.Integer.MAX_VALUE, lockedDate)); + childrenList.add(new Property("lockedDate", "date", "If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined.", 0, java.lang.Integer.MAX_VALUE, lockedDate)); + childrenList.add(new Property("inactive", "boolean", "Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included).", 0, java.lang.Integer.MAX_VALUE, inactive)); childrenList.add(new Property("include", "", "Include one or more codes from a code system or other value set(s).", 0, java.lang.Integer.MAX_VALUE, include)); childrenList.add(new Property("exclude", "@ValueSet.compose.include", "Exclude one or more codes from the value set based on code system filters and/or other value sets.", 0, java.lang.Integer.MAX_VALUE, exclude)); } @@ -418,6 +503,7 @@ public class ValueSet extends MetadataResource { public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { case 1391591896: /*lockedDate*/ return this.lockedDate == null ? new Base[0] : new Base[] {this.lockedDate}; // DateType + case 24665195: /*inactive*/ return this.inactive == null ? new Base[0] : new Base[] {this.inactive}; // BooleanType case 1942574248: /*include*/ return this.include == null ? new Base[0] : this.include.toArray(new Base[this.include.size()]); // ConceptSetComponent case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : this.exclude.toArray(new Base[this.exclude.size()]); // ConceptSetComponent default: return super.getProperty(hash, name, checkValid); @@ -431,6 +517,9 @@ public class ValueSet extends MetadataResource { case 1391591896: // lockedDate this.lockedDate = castToDate(value); // DateType break; + case 24665195: // inactive + this.inactive = castToBoolean(value); // BooleanType + break; case 1942574248: // include this.getInclude().add((ConceptSetComponent) value); // ConceptSetComponent break; @@ -446,6 +535,8 @@ public class ValueSet extends MetadataResource { public void setProperty(String name, Base value) throws FHIRException { if (name.equals("lockedDate")) this.lockedDate = castToDate(value); // DateType + else if (name.equals("inactive")) + this.inactive = castToBoolean(value); // BooleanType else if (name.equals("include")) this.getInclude().add((ConceptSetComponent) value); else if (name.equals("exclude")) @@ -458,6 +549,7 @@ public class ValueSet extends MetadataResource { public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 1391591896: throw new FHIRException("Cannot make property lockedDate as it is not a complex type"); // DateType + case 24665195: throw new FHIRException("Cannot make property inactive as it is not a complex type"); // BooleanType case 1942574248: return addInclude(); // ConceptSetComponent case -1321148966: return addExclude(); // ConceptSetComponent default: return super.makeProperty(hash, name); @@ -470,6 +562,9 @@ public class ValueSet extends MetadataResource { if (name.equals("lockedDate")) { throw new FHIRException("Cannot call addChild on a primitive type ValueSet.lockedDate"); } + else if (name.equals("inactive")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.inactive"); + } else if (name.equals("include")) { return addInclude(); } @@ -484,6 +579,7 @@ public class ValueSet extends MetadataResource { ValueSetComposeComponent dst = new ValueSetComposeComponent(); copyValues(dst); dst.lockedDate = lockedDate == null ? null : lockedDate.copy(); + dst.inactive = inactive == null ? null : inactive.copy(); if (include != null) { dst.include = new ArrayList(); for (ConceptSetComponent i : include) @@ -504,8 +600,8 @@ public class ValueSet extends MetadataResource { if (!(other instanceof ValueSetComposeComponent)) return false; ValueSetComposeComponent o = (ValueSetComposeComponent) other; - return compareDeep(lockedDate, o.lockedDate, true) && compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true) - ; + return compareDeep(lockedDate, o.lockedDate, true) && compareDeep(inactive, o.inactive, true) && compareDeep(include, o.include, true) + && compareDeep(exclude, o.exclude, true); } @Override @@ -515,12 +611,12 @@ public class ValueSet extends MetadataResource { if (!(other instanceof ValueSetComposeComponent)) return false; ValueSetComposeComponent o = (ValueSetComposeComponent) other; - return compareValues(lockedDate, o.lockedDate, true); + return compareValues(lockedDate, o.lockedDate, true) && compareValues(inactive, o.inactive, true); } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(lockedDate, include, exclude - ); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(lockedDate, inactive, include + , exclude); } public String fhirType() { @@ -1586,8 +1682,8 @@ public class ValueSet extends MetadataResource { /** * The kind of operation to perform as a part of the filter criteria. */ - @Child(name = "op", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="= | is-a | is-not-a | regex | in | not-in | generalizes", formalDefinition="The kind of operation to perform as a part of the filter criteria." ) + @Child(name = "op", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=false) + @Description(shortDefinition="= | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | exists", formalDefinition="The kind of operation to perform as a part of the filter criteria." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/filter-operator") protected Enumeration op; @@ -2689,42 +2785,49 @@ public class ValueSet extends MetadataResource { @Description(shortDefinition="If user cannot select this entry", formalDefinition="If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value." ) protected BooleanType abstract_; + /** + * If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understnading legacy data. + */ + @Child(name = "inactive", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="If concept is inactive in the code system", formalDefinition="If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understnading legacy data." ) + protected BooleanType inactive; + /** * The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "version", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Version in which this code/display is defined", formalDefinition="The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence." ) protected StringType version; /** * The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. */ - @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Child(name = "code", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Code - if blank, this is not a selectable code", formalDefinition="The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set." ) protected CodeType code; /** * The recommended display for this item in the expansion. */ - @Child(name = "display", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "display", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="User display for the concept", formalDefinition="The recommended display for this item in the expansion." ) protected StringType display; /** * Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation. */ - @Child(name = "designation", type = {ConceptReferenceDesignationComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "designation", type = {ConceptReferenceDesignationComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Additional representations for this item", formalDefinition="Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation." ) protected List designation; /** * Other codes and entries contained under this entry in the hierarchy. */ - @Child(name = "contains", type = {ValueSetExpansionContainsComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) + @Child(name = "contains", type = {ValueSetExpansionContainsComponent.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) @Description(shortDefinition="Codes contained under this entry", formalDefinition="Other codes and entries contained under this entry in the hierarchy." ) protected List contains; - private static final long serialVersionUID = -1566559207L; + private static final long serialVersionUID = 719458860L; /** * Constructor @@ -2827,6 +2930,51 @@ public class ValueSet extends MetadataResource { return this; } + /** + * @return {@link #inactive} (If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understnading legacy data.). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value + */ + public BooleanType getInactiveElement() { + if (this.inactive == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.inactive"); + else if (Configuration.doAutoCreate()) + this.inactive = new BooleanType(); // bb + return this.inactive; + } + + public boolean hasInactiveElement() { + return this.inactive != null && !this.inactive.isEmpty(); + } + + public boolean hasInactive() { + return this.inactive != null && !this.inactive.isEmpty(); + } + + /** + * @param value {@link #inactive} (If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understnading legacy data.). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setInactiveElement(BooleanType value) { + this.inactive = value; + return this; + } + + /** + * @return If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understnading legacy data. + */ + public boolean getInactive() { + return this.inactive == null || this.inactive.isEmpty() ? false : this.inactive.getValue(); + } + + /** + * @param value If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understnading legacy data. + */ + public ValueSetExpansionContainsComponent setInactive(boolean value) { + if (this.inactive == null) + this.inactive = new BooleanType(); + this.inactive.setValue(value); + return this; + } + /** * @return {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value */ @@ -3084,6 +3232,7 @@ public class ValueSet extends MetadataResource { super.listChildren(childrenList); childrenList.add(new Property("system", "uri", "An absolute URI which is the code system in which the code for this item in the expansion is defined.", 0, java.lang.Integer.MAX_VALUE, system)); childrenList.add(new Property("abstract", "boolean", "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("inactive", "boolean", "If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understnading legacy data.", 0, java.lang.Integer.MAX_VALUE, inactive)); childrenList.add(new Property("version", "string", "The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.", 0, java.lang.Integer.MAX_VALUE, version)); childrenList.add(new Property("code", "code", "The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.", 0, java.lang.Integer.MAX_VALUE, code)); childrenList.add(new Property("display", "string", "The recommended display for this item in the expansion.", 0, java.lang.Integer.MAX_VALUE, display)); @@ -3096,6 +3245,7 @@ public class ValueSet extends MetadataResource { switch (hash) { case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : new Base[] {this.abstract_}; // BooleanType + case 24665195: /*inactive*/ return this.inactive == null ? new Base[0] : new Base[] {this.inactive}; // BooleanType case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType @@ -3115,6 +3265,9 @@ public class ValueSet extends MetadataResource { case 1732898850: // abstract this.abstract_ = castToBoolean(value); // BooleanType break; + case 24665195: // inactive + this.inactive = castToBoolean(value); // BooleanType + break; case 351608024: // version this.version = castToString(value); // StringType break; @@ -3141,6 +3294,8 @@ public class ValueSet extends MetadataResource { this.system = castToUri(value); // UriType else if (name.equals("abstract")) this.abstract_ = castToBoolean(value); // BooleanType + else if (name.equals("inactive")) + this.inactive = castToBoolean(value); // BooleanType else if (name.equals("version")) this.version = castToString(value); // StringType else if (name.equals("code")) @@ -3160,6 +3315,7 @@ public class ValueSet extends MetadataResource { switch (hash) { case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType case 1732898850: throw new FHIRException("Cannot make property abstract as it is not a complex type"); // BooleanType + case 24665195: throw new FHIRException("Cannot make property inactive as it is not a complex type"); // BooleanType case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType @@ -3178,6 +3334,9 @@ public class ValueSet extends MetadataResource { else if (name.equals("abstract")) { throw new FHIRException("Cannot call addChild on a primitive type ValueSet.abstract"); } + else if (name.equals("inactive")) { + throw new FHIRException("Cannot call addChild on a primitive type ValueSet.inactive"); + } else if (name.equals("version")) { throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version"); } @@ -3202,6 +3361,7 @@ public class ValueSet extends MetadataResource { copyValues(dst); dst.system = system == null ? null : system.copy(); dst.abstract_ = abstract_ == null ? null : abstract_.copy(); + dst.inactive = inactive == null ? null : inactive.copy(); dst.version = version == null ? null : version.copy(); dst.code = code == null ? null : code.copy(); dst.display = display == null ? null : display.copy(); @@ -3225,9 +3385,9 @@ public class ValueSet extends MetadataResource { if (!(other instanceof ValueSetExpansionContainsComponent)) return false; ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; - return compareDeep(system, o.system, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(version, o.version, true) - && compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(designation, o.designation, true) - && compareDeep(contains, o.contains, true); + return compareDeep(system, o.system, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(inactive, o.inactive, true) + && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) && compareDeep(display, o.display, true) + && compareDeep(designation, o.designation, true) && compareDeep(contains, o.contains, true); } @Override @@ -3237,13 +3397,14 @@ public class ValueSet extends MetadataResource { if (!(other instanceof ValueSetExpansionContainsComponent)) return false; ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; - return compareValues(system, o.system, true) && compareValues(abstract_, o.abstract_, true) && compareValues(version, o.version, true) - && compareValues(code, o.code, true) && compareValues(display, o.display, true); + return compareValues(system, o.system, true) && compareValues(abstract_, o.abstract_, true) && compareValues(inactive, o.inactive, true) + && compareValues(version, o.version, true) && compareValues(code, o.code, true) && compareValues(display, o.display, true) + ; } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(system, abstract_, version - , code, display, designation, contains); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(system, abstract_, inactive + , version, code, display, designation, contains); } public String fhirType() { diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/VisionPrescription.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/VisionPrescription.java index 72b9bfd9f87..90b23e21da6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/VisionPrescription.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/VisionPrescription.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model; */ -// Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import java.util.*; @@ -51,19 +51,19 @@ public class VisionPrescription extends DomainResource { public enum VisionStatus { /** - * The resource instance is currently in-force. + * The instance is currently in-force. */ ACTIVE, /** - * The resource instance is withdrawn, rescinded or reversed. + * The instance is withdrawn, rescinded or reversed. */ CANCELLED, /** - * A new resource instance the contents of which is not complete. + * A new instance the contents of which is not complete. */ DRAFT, /** - * The resource instance was entered in error. + * The instance was entered in error. */ ENTEREDINERROR, /** @@ -97,19 +97,19 @@ public class VisionPrescription extends DomainResource { } public String getSystem() { switch (this) { - case ACTIVE: return "http://hl7.org/fhir/vision-status"; - case CANCELLED: return "http://hl7.org/fhir/vision-status"; - case DRAFT: return "http://hl7.org/fhir/vision-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/vision-status"; + case ACTIVE: return "http://hl7.org/fhir/fm-status"; + case CANCELLED: return "http://hl7.org/fhir/fm-status"; + case DRAFT: return "http://hl7.org/fhir/fm-status"; + case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; default: return "?"; } } public String getDefinition() { switch (this) { - case ACTIVE: return "The resource instance is currently in-force."; - case CANCELLED: return "The resource instance is withdrawn, rescinded or reversed."; - case DRAFT: return "A new resource instance the contents of which is not complete."; - case ENTEREDINERROR: return "The resource instance was entered in error."; + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; default: return "?"; } } @@ -118,7 +118,7 @@ public class VisionPrescription extends DomainResource { case ACTIVE: return "Active"; case CANCELLED: return "Cancelled"; case DRAFT: return "Draft"; - case ENTEREDINERROR: return "Entered In Error"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } @@ -171,235 +171,23 @@ public class VisionPrescription extends DomainResource { } } - public enum VisionEyes { - /** - * Right Eye - */ - RIGHT, - /** - * Left Eye - */ - LEFT, - /** - * added to help the parsers with the generic types - */ - NULL; - public static VisionEyes fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("right".equals(codeString)) - return RIGHT; - if ("left".equals(codeString)) - return LEFT; - if (Configuration.isAcceptInvalidEnums()) - return null; - else - throw new FHIRException("Unknown VisionEyes code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case RIGHT: return "right"; - case LEFT: return "left"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RIGHT: return "http://hl7.org/fhir/vision-eye-codes"; - case LEFT: return "http://hl7.org/fhir/vision-eye-codes"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RIGHT: return "Right Eye"; - case LEFT: return "Left Eye"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RIGHT: return "Right Eye"; - case LEFT: return "Left Eye"; - default: return "?"; - } - } - } - - public static class VisionEyesEnumFactory implements EnumFactory { - public VisionEyes fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("right".equals(codeString)) - return VisionEyes.RIGHT; - if ("left".equals(codeString)) - return VisionEyes.LEFT; - throw new IllegalArgumentException("Unknown VisionEyes code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("right".equals(codeString)) - return new Enumeration(this, VisionEyes.RIGHT); - if ("left".equals(codeString)) - return new Enumeration(this, VisionEyes.LEFT); - throw new FHIRException("Unknown VisionEyes code '"+codeString+"'"); - } - public String toCode(VisionEyes code) { - if (code == VisionEyes.RIGHT) - return "right"; - if (code == VisionEyes.LEFT) - return "left"; - return "?"; - } - public String toSystem(VisionEyes code) { - return code.getSystem(); - } - } - - public enum VisionBase { - /** - * top - */ - UP, - /** - * bottom - */ - DOWN, - /** - * inner edge - */ - IN, - /** - * outer edge - */ - OUT, - /** - * added to help the parsers with the generic types - */ - NULL; - public static VisionBase fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("up".equals(codeString)) - return UP; - if ("down".equals(codeString)) - return DOWN; - if ("in".equals(codeString)) - return IN; - if ("out".equals(codeString)) - return OUT; - if (Configuration.isAcceptInvalidEnums()) - return null; - else - throw new FHIRException("Unknown VisionBase code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UP: return "up"; - case DOWN: return "down"; - case IN: return "in"; - case OUT: return "out"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UP: return "http://hl7.org/fhir/vision-base-codes"; - case DOWN: return "http://hl7.org/fhir/vision-base-codes"; - case IN: return "http://hl7.org/fhir/vision-base-codes"; - case OUT: return "http://hl7.org/fhir/vision-base-codes"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UP: return "top"; - case DOWN: return "bottom"; - case IN: return "inner edge"; - case OUT: return "outer edge"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UP: return "Up"; - case DOWN: return "Down"; - case IN: return "In"; - case OUT: return "Out"; - default: return "?"; - } - } - } - - public static class VisionBaseEnumFactory implements EnumFactory { - public VisionBase fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("up".equals(codeString)) - return VisionBase.UP; - if ("down".equals(codeString)) - return VisionBase.DOWN; - if ("in".equals(codeString)) - return VisionBase.IN; - if ("out".equals(codeString)) - return VisionBase.OUT; - throw new IllegalArgumentException("Unknown VisionBase code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("up".equals(codeString)) - return new Enumeration(this, VisionBase.UP); - if ("down".equals(codeString)) - return new Enumeration(this, VisionBase.DOWN); - if ("in".equals(codeString)) - return new Enumeration(this, VisionBase.IN); - if ("out".equals(codeString)) - return new Enumeration(this, VisionBase.OUT); - throw new FHIRException("Unknown VisionBase code '"+codeString+"'"); - } - public String toCode(VisionBase code) { - if (code == VisionBase.UP) - return "up"; - if (code == VisionBase.DOWN) - return "down"; - if (code == VisionBase.IN) - return "in"; - if (code == VisionBase.OUT) - return "out"; - return "?"; - } - public String toSystem(VisionBase code) { - return code.getSystem(); - } - } - @Block() public static class VisionPrescriptionDispenseComponent extends BackboneElement implements IBaseBackboneElement { /** * Identifies the type of vision correction product which is required for the patient. */ - @Child(name = "product", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) + @Child(name = "product", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the type of vision correction product which is required for the patient." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vision-product") - protected Coding product; + protected CodeableConcept product; /** * The eye for which the lens applies. */ - @Child(name = "eye", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) + @Child(name = "eye", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="right | left", formalDefinition="The eye for which the lens applies." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vision-eye-codes") - protected Enumeration eye; + protected CodeableConcept eye; /** * Lens power measured in diopters (0.25 units). @@ -432,10 +220,10 @@ public class VisionPrescription extends DomainResource { /** * The relative base, or reference lens edge, for the prism. */ - @Child(name = "base", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false) + @Child(name = "base", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="up | down | in | out", formalDefinition="The relative base, or reference lens edge, for the prism." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vision-base-codes") - protected Enumeration base; + protected CodeableConcept base; /** * Power adjustment for multifocal lenses measured in diopters (0.25 units). @@ -489,11 +277,11 @@ public class VisionPrescription extends DomainResource { /** * Notes for special requirements such as coatings and lens materials. */ - @Child(name = "notes", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) + @Child(name = "note", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Notes for coatings", formalDefinition="Notes for special requirements such as coatings and lens materials." ) - protected StringType notes; + protected StringType note; - private static final long serialVersionUID = -1586392610L; + private static final long serialVersionUID = 1057778243L; /** * Constructor @@ -502,23 +290,15 @@ public class VisionPrescription extends DomainResource { super(); } - /** - * Constructor - */ - public VisionPrescriptionDispenseComponent(Coding product) { - super(); - this.product = product; - } - /** * @return {@link #product} (Identifies the type of vision correction product which is required for the patient.) */ - public Coding getProduct() { + public CodeableConcept getProduct() { if (this.product == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.product"); else if (Configuration.doAutoCreate()) - this.product = new Coding(); // cc + this.product = new CodeableConcept(); // cc return this.product; } @@ -529,60 +309,35 @@ public class VisionPrescription extends DomainResource { /** * @param value {@link #product} (Identifies the type of vision correction product which is required for the patient.) */ - public VisionPrescriptionDispenseComponent setProduct(Coding value) { + public VisionPrescriptionDispenseComponent setProduct(CodeableConcept value) { this.product = value; return this; } /** - * @return {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value + * @return {@link #eye} (The eye for which the lens applies.) */ - public Enumeration getEyeElement() { + public CodeableConcept getEye() { if (this.eye == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.eye"); else if (Configuration.doAutoCreate()) - this.eye = new Enumeration(new VisionEyesEnumFactory()); // bb + this.eye = new CodeableConcept(); // cc return this.eye; } - public boolean hasEyeElement() { - return this.eye != null && !this.eye.isEmpty(); - } - public boolean hasEye() { return this.eye != null && !this.eye.isEmpty(); } /** - * @param value {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value + * @param value {@link #eye} (The eye for which the lens applies.) */ - public VisionPrescriptionDispenseComponent setEyeElement(Enumeration value) { + public VisionPrescriptionDispenseComponent setEye(CodeableConcept value) { this.eye = value; return this; } - /** - * @return The eye for which the lens applies. - */ - public VisionEyes getEye() { - return this.eye == null ? null : this.eye.getValue(); - } - - /** - * @param value The eye for which the lens applies. - */ - public VisionPrescriptionDispenseComponent setEye(VisionEyes value) { - if (value == null) - this.eye = null; - else { - if (this.eye == null) - this.eye = new Enumeration(new VisionEyesEnumFactory()); - this.eye.setValue(value); - } - return this; - } - /** * @return {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value */ @@ -830,54 +585,29 @@ public class VisionPrescription extends DomainResource { } /** - * @return {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + * @return {@link #base} (The relative base, or reference lens edge, for the prism.) */ - public Enumeration getBaseElement() { + public CodeableConcept getBase() { if (this.base == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.base"); else if (Configuration.doAutoCreate()) - this.base = new Enumeration(new VisionBaseEnumFactory()); // bb + this.base = new CodeableConcept(); // cc return this.base; } - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - public boolean hasBase() { return this.base != null && !this.base.isEmpty(); } /** - * @param value {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + * @param value {@link #base} (The relative base, or reference lens edge, for the prism.) */ - public VisionPrescriptionDispenseComponent setBaseElement(Enumeration value) { + public VisionPrescriptionDispenseComponent setBase(CodeableConcept value) { this.base = value; return this; } - /** - * @return The relative base, or reference lens edge, for the prism. - */ - public VisionBase getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The relative base, or reference lens edge, for the prism. - */ - public VisionPrescriptionDispenseComponent setBase(VisionBase value) { - if (value == null) - this.base = null; - else { - if (this.base == null) - this.base = new Enumeration(new VisionBaseEnumFactory()); - this.base.setValue(value); - } - return this; - } - /** * @return {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value */ @@ -1269,63 +999,63 @@ public class VisionPrescription extends DomainResource { } /** - * @return {@link #notes} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + * @return {@link #note} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value */ - public StringType getNotesElement() { - if (this.notes == null) + public StringType getNoteElement() { + if (this.note == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.notes"); + throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.note"); else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; + this.note = new StringType(); // bb + return this.note; } - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); + public boolean hasNoteElement() { + return this.note != null && !this.note.isEmpty(); } - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); + public boolean hasNote() { + return this.note != null && !this.note.isEmpty(); } /** - * @param value {@link #notes} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + * @param value {@link #note} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value */ - public VisionPrescriptionDispenseComponent setNotesElement(StringType value) { - this.notes = value; + public VisionPrescriptionDispenseComponent setNoteElement(StringType value) { + this.note = value; return this; } /** * @return Notes for special requirements such as coatings and lens materials. */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); + public String getNote() { + return this.note == null ? null : this.note.getValue(); } /** * @param value Notes for special requirements such as coatings and lens materials. */ - public VisionPrescriptionDispenseComponent setNotes(String value) { + public VisionPrescriptionDispenseComponent setNote(String value) { if (Utilities.noString(value)) - this.notes = null; + this.note = null; else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); } return this; } protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("product", "Coding", "Identifies the type of vision correction product which is required for the patient.", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("eye", "code", "The eye for which the lens applies.", 0, java.lang.Integer.MAX_VALUE, eye)); + childrenList.add(new Property("product", "CodeableConcept", "Identifies the type of vision correction product which is required for the patient.", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("eye", "CodeableConcept", "The eye for which the lens applies.", 0, java.lang.Integer.MAX_VALUE, eye)); childrenList.add(new Property("sphere", "decimal", "Lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, sphere)); childrenList.add(new Property("cylinder", "decimal", "Power adjustment for astigmatism measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, cylinder)); childrenList.add(new Property("axis", "integer", "Adjustment for astigmatism measured in integer degrees.", 0, java.lang.Integer.MAX_VALUE, axis)); childrenList.add(new Property("prism", "decimal", "Amount of prism to compensate for eye alignment in fractional units.", 0, java.lang.Integer.MAX_VALUE, prism)); - childrenList.add(new Property("base", "code", "The relative base, or reference lens edge, for the prism.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("base", "CodeableConcept", "The relative base, or reference lens edge, for the prism.", 0, java.lang.Integer.MAX_VALUE, base)); childrenList.add(new Property("add", "decimal", "Power adjustment for multifocal lenses measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, add)); childrenList.add(new Property("power", "decimal", "Contact lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, power)); childrenList.add(new Property("backCurve", "decimal", "Back curvature measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, backCurve)); @@ -1333,19 +1063,19 @@ public class VisionPrescription extends DomainResource { childrenList.add(new Property("duration", "SimpleQuantity", "The recommended maximum wear period for the lens.", 0, java.lang.Integer.MAX_VALUE, duration)); childrenList.add(new Property("color", "string", "Special color or pattern.", 0, java.lang.Integer.MAX_VALUE, color)); childrenList.add(new Property("brand", "string", "Brand recommendations or restrictions.", 0, java.lang.Integer.MAX_VALUE, brand)); - childrenList.add(new Property("notes", "string", "Notes for special requirements such as coatings and lens materials.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("note", "string", "Notes for special requirements such as coatings and lens materials.", 0, java.lang.Integer.MAX_VALUE, note)); } @Override public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { switch (hash) { - case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Coding - case 100913: /*eye*/ return this.eye == null ? new Base[0] : new Base[] {this.eye}; // Enumeration + case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // CodeableConcept + case 100913: /*eye*/ return this.eye == null ? new Base[0] : new Base[] {this.eye}; // CodeableConcept case -895981619: /*sphere*/ return this.sphere == null ? new Base[0] : new Base[] {this.sphere}; // DecimalType case -349378602: /*cylinder*/ return this.cylinder == null ? new Base[0] : new Base[] {this.cylinder}; // DecimalType case 3008417: /*axis*/ return this.axis == null ? new Base[0] : new Base[] {this.axis}; // IntegerType case 106935105: /*prism*/ return this.prism == null ? new Base[0] : new Base[] {this.prism}; // DecimalType - case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // Enumeration + case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // CodeableConcept case 96417: /*add*/ return this.add == null ? new Base[0] : new Base[] {this.add}; // DecimalType case 106858757: /*power*/ return this.power == null ? new Base[0] : new Base[] {this.power}; // DecimalType case 1309344840: /*backCurve*/ return this.backCurve == null ? new Base[0] : new Base[] {this.backCurve}; // DecimalType @@ -1353,7 +1083,7 @@ public class VisionPrescription extends DomainResource { case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // SimpleQuantity case 94842723: /*color*/ return this.color == null ? new Base[0] : new Base[] {this.color}; // StringType case 93997959: /*brand*/ return this.brand == null ? new Base[0] : new Base[] {this.brand}; // StringType - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : new Base[] {this.notes}; // StringType + case 3387378: /*note*/ return this.note == null ? new Base[0] : new Base[] {this.note}; // StringType default: return super.getProperty(hash, name, checkValid); } @@ -1363,10 +1093,10 @@ public class VisionPrescription extends DomainResource { public void setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -309474065: // product - this.product = castToCoding(value); // Coding + this.product = castToCodeableConcept(value); // CodeableConcept break; case 100913: // eye - this.eye = new VisionEyesEnumFactory().fromType(value); // Enumeration + this.eye = castToCodeableConcept(value); // CodeableConcept break; case -895981619: // sphere this.sphere = castToDecimal(value); // DecimalType @@ -1381,7 +1111,7 @@ public class VisionPrescription extends DomainResource { this.prism = castToDecimal(value); // DecimalType break; case 3016401: // base - this.base = new VisionBaseEnumFactory().fromType(value); // Enumeration + this.base = castToCodeableConcept(value); // CodeableConcept break; case 96417: // add this.add = castToDecimal(value); // DecimalType @@ -1404,8 +1134,8 @@ public class VisionPrescription extends DomainResource { case 93997959: // brand this.brand = castToString(value); // StringType break; - case 105008833: // notes - this.notes = castToString(value); // StringType + case 3387378: // note + this.note = castToString(value); // StringType break; default: super.setProperty(hash, name, value); } @@ -1415,9 +1145,9 @@ public class VisionPrescription extends DomainResource { @Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("product")) - this.product = castToCoding(value); // Coding + this.product = castToCodeableConcept(value); // CodeableConcept else if (name.equals("eye")) - this.eye = new VisionEyesEnumFactory().fromType(value); // Enumeration + this.eye = castToCodeableConcept(value); // CodeableConcept else if (name.equals("sphere")) this.sphere = castToDecimal(value); // DecimalType else if (name.equals("cylinder")) @@ -1427,7 +1157,7 @@ public class VisionPrescription extends DomainResource { else if (name.equals("prism")) this.prism = castToDecimal(value); // DecimalType else if (name.equals("base")) - this.base = new VisionBaseEnumFactory().fromType(value); // Enumeration + this.base = castToCodeableConcept(value); // CodeableConcept else if (name.equals("add")) this.add = castToDecimal(value); // DecimalType else if (name.equals("power")) @@ -1442,8 +1172,8 @@ public class VisionPrescription extends DomainResource { this.color = castToString(value); // StringType else if (name.equals("brand")) this.brand = castToString(value); // StringType - else if (name.equals("notes")) - this.notes = castToString(value); // StringType + else if (name.equals("note")) + this.note = castToString(value); // StringType else super.setProperty(name, value); } @@ -1451,13 +1181,13 @@ public class VisionPrescription extends DomainResource { @Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { - case -309474065: return getProduct(); // Coding - case 100913: throw new FHIRException("Cannot make property eye as it is not a complex type"); // Enumeration + case -309474065: return getProduct(); // CodeableConcept + case 100913: return getEye(); // CodeableConcept case -895981619: throw new FHIRException("Cannot make property sphere as it is not a complex type"); // DecimalType case -349378602: throw new FHIRException("Cannot make property cylinder as it is not a complex type"); // DecimalType case 3008417: throw new FHIRException("Cannot make property axis as it is not a complex type"); // IntegerType case 106935105: throw new FHIRException("Cannot make property prism as it is not a complex type"); // DecimalType - case 3016401: throw new FHIRException("Cannot make property base as it is not a complex type"); // Enumeration + case 3016401: return getBase(); // CodeableConcept case 96417: throw new FHIRException("Cannot make property add as it is not a complex type"); // DecimalType case 106858757: throw new FHIRException("Cannot make property power as it is not a complex type"); // DecimalType case 1309344840: throw new FHIRException("Cannot make property backCurve as it is not a complex type"); // DecimalType @@ -1465,7 +1195,7 @@ public class VisionPrescription extends DomainResource { case -1992012396: return getDuration(); // SimpleQuantity case 94842723: throw new FHIRException("Cannot make property color as it is not a complex type"); // StringType case 93997959: throw new FHIRException("Cannot make property brand as it is not a complex type"); // StringType - case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType + case 3387378: throw new FHIRException("Cannot make property note as it is not a complex type"); // StringType default: return super.makeProperty(hash, name); } @@ -1474,11 +1204,12 @@ public class VisionPrescription extends DomainResource { @Override public Base addChild(String name) throws FHIRException { if (name.equals("product")) { - this.product = new Coding(); + this.product = new CodeableConcept(); return this.product; } else if (name.equals("eye")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.eye"); + this.eye = new CodeableConcept(); + return this.eye; } else if (name.equals("sphere")) { throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.sphere"); @@ -1493,7 +1224,8 @@ public class VisionPrescription extends DomainResource { throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.prism"); } else if (name.equals("base")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.base"); + this.base = new CodeableConcept(); + return this.base; } else if (name.equals("add")) { throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.add"); @@ -1517,8 +1249,8 @@ public class VisionPrescription extends DomainResource { else if (name.equals("brand")) { throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.brand"); } - else if (name.equals("notes")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.notes"); + else if (name.equals("note")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.note"); } else return super.addChild(name); @@ -1541,7 +1273,7 @@ public class VisionPrescription extends DomainResource { dst.duration = duration == null ? null : duration.copy(); dst.color = color == null ? null : color.copy(); dst.brand = brand == null ? null : brand.copy(); - dst.notes = notes == null ? null : notes.copy(); + dst.note = note == null ? null : note.copy(); return dst; } @@ -1556,7 +1288,7 @@ public class VisionPrescription extends DomainResource { && compareDeep(cylinder, o.cylinder, true) && compareDeep(axis, o.axis, true) && compareDeep(prism, o.prism, true) && compareDeep(base, o.base, true) && compareDeep(add, o.add, true) && compareDeep(power, o.power, true) && compareDeep(backCurve, o.backCurve, true) && compareDeep(diameter, o.diameter, true) && compareDeep(duration, o.duration, true) - && compareDeep(color, o.color, true) && compareDeep(brand, o.brand, true) && compareDeep(notes, o.notes, true) + && compareDeep(color, o.color, true) && compareDeep(brand, o.brand, true) && compareDeep(note, o.note, true) ; } @@ -1567,17 +1299,16 @@ public class VisionPrescription extends DomainResource { if (!(other instanceof VisionPrescriptionDispenseComponent)) return false; VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; - return compareValues(eye, o.eye, true) && compareValues(sphere, o.sphere, true) && compareValues(cylinder, o.cylinder, true) - && compareValues(axis, o.axis, true) && compareValues(prism, o.prism, true) && compareValues(base, o.base, true) - && compareValues(add, o.add, true) && compareValues(power, o.power, true) && compareValues(backCurve, o.backCurve, true) - && compareValues(diameter, o.diameter, true) && compareValues(color, o.color, true) && compareValues(brand, o.brand, true) - && compareValues(notes, o.notes, true); + return compareValues(sphere, o.sphere, true) && compareValues(cylinder, o.cylinder, true) && compareValues(axis, o.axis, true) + && compareValues(prism, o.prism, true) && compareValues(add, o.add, true) && compareValues(power, o.power, true) + && compareValues(backCurve, o.backCurve, true) && compareValues(diameter, o.diameter, true) && compareValues(color, o.color, true) + && compareValues(brand, o.brand, true) && compareValues(note, o.note, true); } public boolean isEmpty() { return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(product, eye, sphere, cylinder , axis, prism, base, add, power, backCurve, diameter, duration, color, brand - , notes); + , note); } public String fhirType() { @@ -1597,22 +1328,15 @@ public class VisionPrescription extends DomainResource { /** * The status of the resource instance. */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) + @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) - @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vision-status") + @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") protected Enumeration status; - /** - * The date (and perhaps time) when the prescription was written. - */ - @Child(name = "dateWritten", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) - protected DateTimeType dateWritten; - /** * A link to a resource representing the person to whom the vision products will be supplied. */ - @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=false) + @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the vision products will be supplied." ) protected Reference patient; @@ -1621,22 +1345,10 @@ public class VisionPrescription extends DomainResource { */ protected Patient patientTarget; - /** - * The healthcare professional responsible for authorizing the prescription. - */ - @Child(name = "prescriber", type = {Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who authorizes the vision product", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) - protected Reference prescriber; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) - */ - protected Practitioner prescriberTarget; - /** * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. */ - @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1, modifier=false, summary=false) @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) protected Reference encounter; @@ -1645,6 +1357,25 @@ public class VisionPrescription extends DomainResource { */ protected Encounter encounterTarget; + /** + * The date (and perhaps time) when the prescription was written. + */ + @Child(name = "dateWritten", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) + protected DateTimeType dateWritten; + + /** + * The healthcare professional responsible for authorizing the prescription. + */ + @Child(name = "prescriber", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=false) + @Description(shortDefinition="Who authorizes the vision product", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) + protected Reference prescriber; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) + */ + protected Practitioner prescriberTarget; + /** * Can be the reason or the indication for writing the prescription. */ @@ -1659,7 +1390,7 @@ public class VisionPrescription extends DomainResource { @Description(shortDefinition="Vision supply authorization", formalDefinition="Deals with details of the dispense part of the supply specification." ) protected List dispense; - private static final long serialVersionUID = 1437104980L; + private static final long serialVersionUID = 603347490L; /** * Constructor @@ -1668,14 +1399,6 @@ public class VisionPrescription extends DomainResource { super(); } - /** - * Constructor - */ - public VisionPrescription(Enumeration status) { - super(); - this.status = status; - } - /** * @return {@link #identifier} (Business identifier which may be used by other parties to reference or identify the prescription.) */ @@ -1768,9 +1491,101 @@ public class VisionPrescription extends DomainResource { * @param value The status of the resource instance. */ public VisionPrescription setStatus(VisionStatus value) { + if (value == null) + this.status = null; + else { if (this.status == null) this.status = new Enumeration(new VisionStatusEnumFactory()); this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the vision products will be supplied.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); // cc + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (A link to a resource representing the person to whom the vision products will be supplied.) + */ + public VisionPrescription 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. (A link to a resource representing the person to whom the vision products will be supplied.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); // aa + 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. (A link to a resource representing the person to whom the vision products will be supplied.) + */ + public VisionPrescription setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); // cc + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public VisionPrescription 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionPrescription.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); // aa + 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public VisionPrescription setEncounterTarget(Encounter value) { + this.encounterTarget = value; return this; } @@ -1823,50 +1638,6 @@ public class VisionPrescription extends DomainResource { return this; } - /** - * @return {@link #patient} (A link to a resource representing the person to whom the vision products will be supplied.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person to whom the vision products will be supplied.) - */ - public VisionPrescription 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. (A link to a resource representing the person to whom the vision products will be supplied.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - 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. (A link to a resource representing the person to whom the vision products will be supplied.) - */ - public VisionPrescription setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - /** * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) */ @@ -1911,50 +1682,6 @@ public class VisionPrescription extends DomainResource { return this; } - /** - * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public VisionPrescription 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public VisionPrescription setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - /** * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) */ @@ -2057,10 +1784,10 @@ public class VisionPrescription extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "Business identifier which may be used by other parties to reference or identify the prescription.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("status", "code", "The status of the resource instance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the vision products will be supplied.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); + childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the supply specification.", 0, java.lang.Integer.MAX_VALUE, dispense)); } @@ -2070,10 +1797,10 @@ public class VisionPrescription extends DomainResource { switch (hash) { case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1496880759: /*dateWritten*/ return this.dateWritten == null ? new Base[0] : new Base[] {this.dateWritten}; // DateTimeType case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 1430631077: /*prescriber*/ return this.prescriber == null ? new Base[0] : new Base[] {this.prescriber}; // Reference case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference + case -1496880759: /*dateWritten*/ return this.dateWritten == null ? new Base[0] : new Base[] {this.dateWritten}; // DateTimeType + case 1430631077: /*prescriber*/ return this.prescriber == null ? new Base[0] : new Base[] {this.prescriber}; // Reference case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type case 284885341: /*dispense*/ return this.dispense == null ? new Base[0] : this.dispense.toArray(new Base[this.dispense.size()]); // VisionPrescriptionDispenseComponent default: return super.getProperty(hash, name, checkValid); @@ -2090,18 +1817,18 @@ public class VisionPrescription extends DomainResource { case -892481550: // status this.status = new VisionStatusEnumFactory().fromType(value); // Enumeration break; - case -1496880759: // dateWritten - this.dateWritten = castToDateTime(value); // DateTimeType - break; case -791418107: // patient this.patient = castToReference(value); // Reference break; - case 1430631077: // prescriber - this.prescriber = castToReference(value); // Reference - break; case 1524132147: // encounter this.encounter = castToReference(value); // Reference break; + case -1496880759: // dateWritten + this.dateWritten = castToDateTime(value); // DateTimeType + break; + case 1430631077: // prescriber + this.prescriber = castToReference(value); // Reference + break; case -934964668: // reason this.reason = castToType(value); // Type break; @@ -2119,14 +1846,14 @@ public class VisionPrescription extends DomainResource { this.getIdentifier().add(castToIdentifier(value)); else if (name.equals("status")) this.status = new VisionStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("dateWritten")) - this.dateWritten = castToDateTime(value); // DateTimeType else if (name.equals("patient")) this.patient = castToReference(value); // Reference - else if (name.equals("prescriber")) - this.prescriber = castToReference(value); // Reference else if (name.equals("encounter")) this.encounter = castToReference(value); // Reference + else if (name.equals("dateWritten")) + this.dateWritten = castToDateTime(value); // DateTimeType + else if (name.equals("prescriber")) + this.prescriber = castToReference(value); // Reference else if (name.equals("reason[x]")) this.reason = castToType(value); // Type else if (name.equals("dispense")) @@ -2140,10 +1867,10 @@ public class VisionPrescription extends DomainResource { switch (hash) { case -1618432855: return addIdentifier(); // Identifier case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1496880759: throw new FHIRException("Cannot make property dateWritten as it is not a complex type"); // DateTimeType case -791418107: return getPatient(); // Reference - case 1430631077: return getPrescriber(); // Reference case 1524132147: return getEncounter(); // Reference + case -1496880759: throw new FHIRException("Cannot make property dateWritten as it is not a complex type"); // DateTimeType + case 1430631077: return getPrescriber(); // Reference case -669418564: return getReason(); // Type case 284885341: return addDispense(); // VisionPrescriptionDispenseComponent default: return super.makeProperty(hash, name); @@ -2159,21 +1886,21 @@ public class VisionPrescription extends DomainResource { else if (name.equals("status")) { throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.status"); } - else if (name.equals("dateWritten")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.dateWritten"); - } else if (name.equals("patient")) { this.patient = new Reference(); return this.patient; } - else if (name.equals("prescriber")) { - this.prescriber = new Reference(); - return this.prescriber; - } else if (name.equals("encounter")) { this.encounter = new Reference(); return this.encounter; } + else if (name.equals("dateWritten")) { + throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.dateWritten"); + } + else if (name.equals("prescriber")) { + this.prescriber = new Reference(); + return this.prescriber; + } else if (name.equals("reasonCodeableConcept")) { this.reason = new CodeableConcept(); return this.reason; @@ -2203,10 +1930,10 @@ public class VisionPrescription extends DomainResource { dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); - dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); dst.patient = patient == null ? null : patient.copy(); - dst.prescriber = prescriber == null ? null : prescriber.copy(); dst.encounter = encounter == null ? null : encounter.copy(); + dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); + dst.prescriber = prescriber == null ? null : prescriber.copy(); dst.reason = reason == null ? null : reason.copy(); if (dispense != null) { dst.dispense = new ArrayList(); @@ -2227,8 +1954,8 @@ public class VisionPrescription extends DomainResource { if (!(other instanceof VisionPrescription)) return false; VisionPrescription o = (VisionPrescription) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(dateWritten, o.dateWritten, true) - && compareDeep(patient, o.patient, true) && compareDeep(prescriber, o.prescriber, true) && compareDeep(encounter, o.encounter, true) + return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) + && compareDeep(encounter, o.encounter, true) && compareDeep(dateWritten, o.dateWritten, true) && compareDeep(prescriber, o.prescriber, true) && compareDeep(reason, o.reason, true) && compareDeep(dispense, o.dispense, true); } @@ -2243,8 +1970,8 @@ public class VisionPrescription extends DomainResource { } public boolean isEmpty() { - return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, dateWritten - , patient, prescriber, encounter, reason, dispense); + return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, patient + , encounter, dateWritten, prescriber, reason, dispense); } @Override diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AbstractTypes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AbstractTypes.java index 290eb6bb000..735bdd9110b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AbstractTypes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AbstractTypes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AbstractTypesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AbstractTypesEnumFactory.java index c22b197c978..417c03c1b9e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AbstractTypesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AbstractTypesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AccountStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AccountStatus.java index ddcd1ed8bb1..0e52fc263dc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AccountStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AccountStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AccountStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AccountStatusEnumFactory.java index 6e03eb28f5c..5ff4693880a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AccountStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AccountStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionCardinalityBehavior.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionCardinalityBehavior.java index 09115948f71..f5e2525ca4f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionCardinalityBehavior.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionCardinalityBehavior.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionCardinalityBehaviorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionCardinalityBehaviorEnumFactory.java index 68271c13b0d..bf499d2173c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionCardinalityBehaviorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionCardinalityBehaviorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionConditionKind.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionConditionKind.java new file mode 100644 index 00000000000..eb38c777c16 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionConditionKind.java @@ -0,0 +1,96 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum ActionConditionKind { + + /** + * The condition describes whether or not a given action is applicable + */ + APPLICABILITY, + /** + * The condition is a starting condition for the action + */ + START, + /** + * The condition is a stop, or exit condition for the action + */ + STOP, + /** + * added to help the parsers + */ + NULL; + public static ActionConditionKind fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("applicability".equals(codeString)) + return APPLICABILITY; + if ("start".equals(codeString)) + return START; + if ("stop".equals(codeString)) + return STOP; + throw new FHIRException("Unknown ActionConditionKind code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case APPLICABILITY: return "applicability"; + case START: return "start"; + case STOP: return "stop"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/action-condition-kind"; + } + public String getDefinition() { + switch (this) { + case APPLICABILITY: return "The condition describes whether or not a given action is applicable"; + case START: return "The condition is a starting condition for the action"; + case STOP: return "The condition is a stop, or exit condition for the action"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case APPLICABILITY: return "Applicability"; + case START: return "Start"; + case STOP: return "Stop"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionConditionKindEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionConditionKindEnumFactory.java new file mode 100644 index 00000000000..456b8fc0296 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionConditionKindEnumFactory.java @@ -0,0 +1,66 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class ActionConditionKindEnumFactory implements EnumFactory { + + public ActionConditionKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("applicability".equals(codeString)) + return ActionConditionKind.APPLICABILITY; + if ("start".equals(codeString)) + return ActionConditionKind.START; + if ("stop".equals(codeString)) + return ActionConditionKind.STOP; + throw new IllegalArgumentException("Unknown ActionConditionKind code '"+codeString+"'"); + } + + public String toCode(ActionConditionKind code) { + if (code == ActionConditionKind.APPLICABILITY) + return "applicability"; + if (code == ActionConditionKind.START) + return "start"; + if (code == ActionConditionKind.STOP) + return "stop"; + return "?"; + } + + public String toSystem(ActionConditionKind code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionGroupingBehavior.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionGroupingBehavior.java index 26d075da1cd..1761741429c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionGroupingBehavior.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionGroupingBehavior.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionGroupingBehaviorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionGroupingBehaviorEnumFactory.java index e3d4f78f691..c80173158d5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionGroupingBehaviorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionGroupingBehaviorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionParticipantType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionParticipantType.java index 41fc470b934..41d9d39953b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionParticipantType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionParticipantType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionParticipantTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionParticipantTypeEnumFactory.java index e2b521359f0..b26452729f0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionParticipantTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionParticipantTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionPrecheckBehavior.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionPrecheckBehavior.java index b78104bc085..a7e508305f8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionPrecheckBehavior.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionPrecheckBehavior.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionPrecheckBehaviorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionPrecheckBehaviorEnumFactory.java index 13b4056669d..b7ad0c0fff1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionPrecheckBehaviorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionPrecheckBehaviorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRelationshipType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRelationshipType.java index 3f8241464ed..b363cce0bf4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRelationshipType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRelationshipType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRelationshipTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRelationshipTypeEnumFactory.java index fe06a4af27d..60f89416d36 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRelationshipTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRelationshipTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRequiredBehavior.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRequiredBehavior.java index b3f7f561b5d..ef468fbce65 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRequiredBehavior.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRequiredBehavior.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRequiredBehaviorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRequiredBehaviorEnumFactory.java index f5e7ae32847..2234341c2e2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRequiredBehaviorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionRequiredBehaviorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionSelectionBehavior.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionSelectionBehavior.java index 8778951826a..9f6ca2771dc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionSelectionBehavior.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionSelectionBehavior.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionSelectionBehaviorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionSelectionBehaviorEnumFactory.java index 46caa9ae618..28b9dc26de7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionSelectionBehaviorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionSelectionBehaviorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionType.java index 9406a43bd37..5e4514b9786 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionTypeEnumFactory.java index 316139103c4..381090069ad 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Actionlist.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Actionlist.java index 2ad558110b8..540557603f6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Actionlist.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Actionlist.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionlistEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionlistEnumFactory.java index 11d34696af6..d68ca242190 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionlistEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActionlistEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActivityDefinitionCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActivityDefinitionCategory.java index 912ea88c1cb..8cc0a70aa18 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActivityDefinitionCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActivityDefinitionCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActivityDefinitionCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActivityDefinitionCategoryEnumFactory.java index 116bb9d19c1..96d4a530ccb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActivityDefinitionCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ActivityDefinitionCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Additionalmaterials.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Additionalmaterials.java index 92e474626c6..b2584200e18 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Additionalmaterials.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Additionalmaterials.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdditionalmaterialsEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdditionalmaterialsEnumFactory.java index 551475573eb..d510898b1fa 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdditionalmaterialsEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdditionalmaterialsEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressType.java index 57b1a209db8..f228b9b9c9e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressTypeEnumFactory.java index 2d58b069b6b..ef57d2b0e05 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressUse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressUse.java index 18618174287..c579b30df8b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressUse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressUse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressUseEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressUseEnumFactory.java index 6cbb3c00c93..bf1b2abbe4d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressUseEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AddressUseEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Adjudication.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Adjudication.java index 77b8deb55db..a1cfddd7026 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Adjudication.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Adjudication.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationEnumFactory.java index 9ad45d77e8a..40417232f96 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationError.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationError.java index 0635341f1a3..47e9730f515 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationError.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationError.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationErrorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationErrorEnumFactory.java index a02a2f5f11f..ef75ca4de6e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationErrorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationErrorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationReason.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationReason.java index 6c5eec9b3a1..a1211ab5806 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationReason.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationReason.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationReasonEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationReasonEnumFactory.java index eeaa99a20d0..dea42952dec 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationReasonEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdjudicationReasonEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdministrativeGender.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdministrativeGender.java index 077829ed5b0..05507dfb400 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdministrativeGender.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdministrativeGender.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdministrativeGenderEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdministrativeGenderEnumFactory.java index 5b6c6e8844e..a30ce65c6ab 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdministrativeGenderEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AdministrativeGenderEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergIntolSubstanceExpRisk.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergIntolSubstanceExpRisk.java index 38e5bf28a8b..323d9ce6566 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergIntolSubstanceExpRisk.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergIntolSubstanceExpRisk.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergIntolSubstanceExpRiskEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergIntolSubstanceExpRiskEnumFactory.java index 4d50b6ebc44..910feeadb83 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergIntolSubstanceExpRiskEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergIntolSubstanceExpRiskEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyClinicalStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyClinicalStatus.java new file mode 100644 index 00000000000..f1380708c4e --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyClinicalStatus.java @@ -0,0 +1,96 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum AllergyClinicalStatus { + + /** + * An active record of a risk of a reaction to the identified substance. + */ + ACTIVE, + /** + * An inactivated record of a risk of a reaction to the identified substance. + */ + INACTIVE, + /** + * A reaction to the identified substance has been clinically reassessed by testing or re-exposure and considered to be resolved. + */ + RESOLVED, + /** + * added to help the parsers + */ + NULL; + public static AllergyClinicalStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("inactive".equals(codeString)) + return INACTIVE; + if ("resolved".equals(codeString)) + return RESOLVED; + throw new FHIRException("Unknown AllergyClinicalStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + case RESOLVED: return "resolved"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/allergy-clinical-status"; + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "An active record of a risk of a reaction to the identified substance."; + case INACTIVE: return "An inactivated record of a risk of a reaction to the identified substance."; + case RESOLVED: return "A reaction to the identified substance has been clinically reassessed by testing or re-exposure and considered to be resolved."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case INACTIVE: return "Inactive"; + case RESOLVED: return "Resolved"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyClinicalStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyClinicalStatusEnumFactory.java new file mode 100644 index 00000000000..4450f33ea64 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyClinicalStatusEnumFactory.java @@ -0,0 +1,66 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class AllergyClinicalStatusEnumFactory implements EnumFactory { + + public AllergyClinicalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return AllergyClinicalStatus.ACTIVE; + if ("inactive".equals(codeString)) + return AllergyClinicalStatus.INACTIVE; + if ("resolved".equals(codeString)) + return AllergyClinicalStatus.RESOLVED; + throw new IllegalArgumentException("Unknown AllergyClinicalStatus code '"+codeString+"'"); + } + + public String toCode(AllergyClinicalStatus code) { + if (code == AllergyClinicalStatus.ACTIVE) + return "active"; + if (code == AllergyClinicalStatus.INACTIVE) + return "inactive"; + if (code == AllergyClinicalStatus.RESOLVED) + return "resolved"; + return "?"; + } + + public String toSystem(AllergyClinicalStatus code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCategory.java index ef55d81f1dd..6375734f725 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCategoryEnumFactory.java index c2cc686ca56..84053451075 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCriticality.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCriticality.java index 9f8cd99aac6..c67982a346e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCriticality.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCriticality.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCriticalityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCriticalityEnumFactory.java index 8c752caad98..dd1cc0ef9b0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCriticalityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceCriticalityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceStatus.java index aa6c409f75c..7e2247316e5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceStatusEnumFactory.java index 2133bd339eb..5ae3f71a548 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceType.java index 9027570a51f..54e6be8a374 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceTypeEnumFactory.java index 101e64462ed..acd5b488c1b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyIntoleranceTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyVerificationStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyVerificationStatus.java new file mode 100644 index 00000000000..887cf64b2cc --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyVerificationStatus.java @@ -0,0 +1,105 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum AllergyVerificationStatus { + + /** + * A low level of certainty about the propensity for a reaction to the identified substance. + */ + UNCONFIRMED, + /** + * A high level of certainty about the propensity for a reaction to the identified substance, which may include clinical evidence by testing or rechallenge. + */ + CONFIRMED, + /** + * A propensity for a reaction to the identified substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. + */ + REFUTED, + /** + * The statement was entered in error and is not valid. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static AllergyVerificationStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("unconfirmed".equals(codeString)) + return UNCONFIRMED; + if ("confirmed".equals(codeString)) + return CONFIRMED; + if ("refuted".equals(codeString)) + return REFUTED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown AllergyVerificationStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case UNCONFIRMED: return "unconfirmed"; + case CONFIRMED: return "confirmed"; + case REFUTED: return "refuted"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/allergy-verification-status"; + } + public String getDefinition() { + switch (this) { + case UNCONFIRMED: return "A low level of certainty about the propensity for a reaction to the identified substance."; + case CONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified substance, which may include clinical evidence by testing or rechallenge."; + case REFUTED: return "A propensity for a reaction to the identified substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted."; + case ENTEREDINERROR: return "The statement was entered in error and is not valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNCONFIRMED: return "Unconfirmed"; + case CONFIRMED: return "Confirmed"; + case REFUTED: return "Refuted"; + case ENTEREDINERROR: return "Entered In Error"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyVerificationStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyVerificationStatusEnumFactory.java new file mode 100644 index 00000000000..35040517ddb --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AllergyVerificationStatusEnumFactory.java @@ -0,0 +1,70 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class AllergyVerificationStatusEnumFactory implements EnumFactory { + + public AllergyVerificationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("unconfirmed".equals(codeString)) + return AllergyVerificationStatus.UNCONFIRMED; + if ("confirmed".equals(codeString)) + return AllergyVerificationStatus.CONFIRMED; + if ("refuted".equals(codeString)) + return AllergyVerificationStatus.REFUTED; + if ("entered-in-error".equals(codeString)) + return AllergyVerificationStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown AllergyVerificationStatus code '"+codeString+"'"); + } + + public String toCode(AllergyVerificationStatus code) { + if (code == AllergyVerificationStatus.UNCONFIRMED) + return "unconfirmed"; + if (code == AllergyVerificationStatus.CONFIRMED) + return "confirmed"; + if (code == AllergyVerificationStatus.REFUTED) + return "refuted"; + if (code == AllergyVerificationStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + + public String toSystem(AllergyVerificationStatus code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalGenderstatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalGenderstatus.java index 8e3e677bd0f..6cd07f81793 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalGenderstatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalGenderstatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalGenderstatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalGenderstatusEnumFactory.java index 41f9c68cbc8..2236318a5dd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalGenderstatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalGenderstatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalSpecies.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalSpecies.java index 9b7f78d4d1c..b03e231f2a8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalSpecies.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalSpecies.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalSpeciesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalSpeciesEnumFactory.java index 33f73555255..2120df993bd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalSpeciesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnimalSpeciesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnzscoOccupations.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnzscoOccupations.java index 1e4dfd5121e..c397db7ac60 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnzscoOccupations.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnzscoOccupations.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnzscoOccupationsEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnzscoOccupationsEnumFactory.java index 5c99a6454ac..a1a7d612f32 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnzscoOccupationsEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AnzscoOccupationsEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Appointmentstatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Appointmentstatus.java index d60ee685af4..17e49ee8626 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Appointmentstatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Appointmentstatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AppointmentstatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AppointmentstatusEnumFactory.java index 0a0d9fb93b5..ab2a4347910 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AppointmentstatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AppointmentstatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertDirectionCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertDirectionCodes.java index 6db93830129..4e3f5de120e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertDirectionCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertDirectionCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertDirectionCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertDirectionCodesEnumFactory.java index 792e3f055b3..0d5ead2dd4d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertDirectionCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertDirectionCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertOperatorCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertOperatorCodes.java index 88e9151fcfa..50a221fd23b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertOperatorCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertOperatorCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertOperatorCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertOperatorCodesEnumFactory.java index fb520066b1e..bce4a97af43 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertOperatorCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertOperatorCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertResponseCodeTypes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertResponseCodeTypes.java index 22d79cbc2e5..e4dd52609c8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertResponseCodeTypes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertResponseCodeTypes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertResponseCodeTypesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertResponseCodeTypesEnumFactory.java index 7b48193dd1d..4ce65be0e71 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertResponseCodeTypesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AssertResponseCodeTypesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventAction.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventAction.java index 6c81f022b31..2cc83163506 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventAction.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventAction.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventActionEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventActionEnumFactory.java index 01f323f7deb..c1abb6c5cca 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventActionEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventActionEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventOutcome.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventOutcome.java index c189f90a286..6e9e0f005d1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventOutcome.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventOutcome.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventOutcomeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventOutcomeEnumFactory.java index 0b1188a9366..35d50ce1a24 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventOutcomeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventOutcomeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventType.java index ab29fe55f16..1d74fd51f86 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventTypeEnumFactory.java index f8507f48b8c..121680bcb97 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditEventTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditSourceType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditSourceType.java index dc6e1fae0ea..37278fde04f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditSourceType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditSourceType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditSourceTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditSourceTypeEnumFactory.java index 173a61f436a..fbff940ccec 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditSourceTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/AuditSourceTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BasicResourceType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BasicResourceType.java index 61a8fc94d60..7d69acff4db 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BasicResourceType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BasicResourceType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BasicResourceTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BasicResourceTypeEnumFactory.java index 313a31bb255..7daa68ff16c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BasicResourceTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BasicResourceTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitCategory.java index 6fabfebb2df..daded64e90a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitCategoryEnumFactory.java index f8d43b4f38b..ccf6aa148b8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitNetwork.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitNetwork.java index 354c4a26098..d02b32da207 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitNetwork.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitNetwork.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitNetworkEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitNetworkEnumFactory.java index e7c3e5351ed..35c2e8550ab 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitNetworkEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitNetworkEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitSubcategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitSubcategory.java index 52104af3fe6..ee24fb7b531 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitSubcategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitSubcategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitSubcategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitSubcategoryEnumFactory.java index 6630f87978f..53a9f6a1eac 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitSubcategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitSubcategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTerm.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTerm.java index b357dc9ece9..d99fc0aaa5f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTerm.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTerm.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTermEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTermEnumFactory.java index 967f3a0a471..1889724c191 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTermEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTermEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitType.java index dc5de2047be..7ff43f2f100 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTypeEnumFactory.java index a6600070661..754488afc0a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitUnit.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitUnit.java index 2c0abc2f82b..65e77357588 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitUnit.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitUnit.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitUnitEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitUnitEnumFactory.java index cd0690d760e..d98f7125a9f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitUnitEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BenefitUnitEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BindingStrength.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BindingStrength.java index a1f27a601f9..0de8049170c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BindingStrength.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BindingStrength.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BindingStrengthEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BindingStrengthEnumFactory.java index 9976a46a4b6..d3bcb7e1c08 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BindingStrengthEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BindingStrengthEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BundleType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BundleType.java index 87622f4b5c8..b096c5eb27a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BundleType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BundleType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -69,7 +69,7 @@ public enum BundleType { */ SEARCHSET, /** - * The bundle is a set of resources collected into a single document for ease of distribution. + * The bundle is a set of resources collected into a single package for ease of distribution. */ COLLECTION, /** @@ -126,7 +126,7 @@ public enum BundleType { case BATCHRESPONSE: return "The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success."; case HISTORY: return "The bundle is a list of resources from a history interaction on a server."; case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; - case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; + case COLLECTION: return "The bundle is a set of resources collected into a single package for ease of distribution."; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BundleTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BundleTypeEnumFactory.java index c6b08350ccb..31e58789a9b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BundleTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/BundleTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CapabilityStatementKind.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CapabilityStatementKind.java index befce56ddfd..dc5e4241163 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CapabilityStatementKind.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CapabilityStatementKind.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CapabilityStatementKindEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CapabilityStatementKindEnumFactory.java index 4b7ee7dfd2a..e0682cc256d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CapabilityStatementKindEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CapabilityStatementKindEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityCategory.java index 6c3243105b4..7dbfd521d3c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityCategoryEnumFactory.java index 3208d097a93..81e9e7e6da8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityStatus.java index c81998e6136..c38e9f99b1e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityStatusEnumFactory.java index d9a3ad8315c..9da8554db40 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanActivityStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanRelationship.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanRelationship.java index aef00e40f38..35ddc02431d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanRelationship.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanRelationship.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanRelationshipEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanRelationshipEnumFactory.java index a017ce18125..c0f5fc07f6c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanRelationshipEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanRelationshipEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanStatus.java index 58dae60dab1..4c29561078c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanStatusEnumFactory.java index b8c25c4e8ee..b50b818135a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CarePlanStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChoiceListOrientation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChoiceListOrientation.java index 7eee4eb0bb6..2961575e03b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChoiceListOrientation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChoiceListOrientation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChoiceListOrientationEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChoiceListOrientationEnumFactory.java index 29adec14786..92a13ea0ef4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChoiceListOrientationEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChoiceListOrientationEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChromosomeHuman.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChromosomeHuman.java index 419cdb639cf..0a03d742d10 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChromosomeHuman.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChromosomeHuman.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,99 +37,99 @@ import org.hl7.fhir.exceptions.FHIRException; public enum ChromosomeHuman { /** - * chromsome 1 + * chromosome 1 */ _1, /** - * chromsome 2 + * chromosome 2 */ _2, /** - * chromsome 3 + * chromosome 3 */ _3, /** - * chromsome 4 + * chromosome 4 */ _4, /** - * chromsome 5 + * chromosome 5 */ _5, /** - * chromsome 6 + * chromosome 6 */ _6, /** - * chromsome 7 + * chromosome 7 */ _7, /** - * chromsome 8 + * chromosome 8 */ _8, /** - * chromsome 9 + * chromosome 9 */ _9, /** - * chromsome 10 + * chromosome 10 */ _10, /** - * chromsome 11 + * chromosome 11 */ _11, /** - * chromsome 12 + * chromosome 12 */ _12, /** - * chromsome 13 + * chromosome 13 */ _13, /** - * chromsome 14 + * chromosome 14 */ _14, /** - * chromsome 15 + * chromosome 15 */ _15, /** - * chromsome 16 + * chromosome 16 */ _16, /** - * chromsome 17 + * chromosome 17 */ _17, /** - * chromsome 18 + * chromosome 18 */ _18, /** - * chromsome 19 + * chromosome 19 */ _19, /** - * chromsome 20 + * chromosome 20 */ _20, /** - * chromsome 21 + * chromosome 21 */ _21, /** - * chromsome 22 + * chromosome 22 */ _22, /** - * chromsome X + * chromosome X */ X, /** - * chromsome Y + * chromosome Y */ Y, /** @@ -223,59 +223,59 @@ public enum ChromosomeHuman { } public String getDefinition() { switch (this) { - case _1: return "chromsome 1"; - case _2: return "chromsome 2"; - case _3: return "chromsome 3"; - case _4: return "chromsome 4"; - case _5: return "chromsome 5"; - case _6: return "chromsome 6"; - case _7: return "chromsome 7"; - case _8: return "chromsome 8"; - case _9: return "chromsome 9"; - case _10: return "chromsome 10"; - case _11: return "chromsome 11"; - case _12: return "chromsome 12"; - case _13: return "chromsome 13"; - case _14: return "chromsome 14"; - case _15: return "chromsome 15"; - case _16: return "chromsome 16"; - case _17: return "chromsome 17"; - case _18: return "chromsome 18"; - case _19: return "chromsome 19"; - case _20: return "chromsome 20"; - case _21: return "chromsome 21"; - case _22: return "chromsome 22"; - case X: return "chromsome X"; - case Y: return "chromsome Y"; + case _1: return "chromosome 1"; + case _2: return "chromosome 2"; + case _3: return "chromosome 3"; + case _4: return "chromosome 4"; + case _5: return "chromosome 5"; + case _6: return "chromosome 6"; + case _7: return "chromosome 7"; + case _8: return "chromosome 8"; + case _9: return "chromosome 9"; + case _10: return "chromosome 10"; + case _11: return "chromosome 11"; + case _12: return "chromosome 12"; + case _13: return "chromosome 13"; + case _14: return "chromosome 14"; + case _15: return "chromosome 15"; + case _16: return "chromosome 16"; + case _17: return "chromosome 17"; + case _18: return "chromosome 18"; + case _19: return "chromosome 19"; + case _20: return "chromosome 20"; + case _21: return "chromosome 21"; + case _22: return "chromosome 22"; + case X: return "chromosome X"; + case Y: return "chromosome Y"; default: return "?"; } } public String getDisplay() { switch (this) { - case _1: return "chromsome 1"; - case _2: return "chromsome 2"; - case _3: return "chromsome 3"; - case _4: return "chromsome 4"; - case _5: return "chromsome 5"; - case _6: return "chromsome 6"; - case _7: return "chromsome 7"; - case _8: return "chromsome 8"; - case _9: return "chromsome 9"; - case _10: return "chromsome 10"; - case _11: return "chromsome 11"; - case _12: return "chromsome 12"; - case _13: return "chromsome 13"; - case _14: return "chromsome 14"; - case _15: return "chromsome 15"; - case _16: return "chromsome 16"; - case _17: return "chromsome 17"; - case _18: return "chromsome 18"; - case _19: return "chromsome 19"; - case _20: return "chromsome 20"; - case _21: return "chromsome 21"; - case _22: return "chromsome 22"; - case X: return "chromsome X"; - case Y: return "chromsome Y"; + case _1: return "chromosome 1"; + case _2: return "chromosome 2"; + case _3: return "chromosome 3"; + case _4: return "chromosome 4"; + case _5: return "chromosome 5"; + case _6: return "chromosome 6"; + case _7: return "chromosome 7"; + case _8: return "chromosome 8"; + case _9: return "chromosome 9"; + case _10: return "chromosome 10"; + case _11: return "chromosome 11"; + case _12: return "chromosome 12"; + case _13: return "chromosome 13"; + case _14: return "chromosome 14"; + case _15: return "chromosome 15"; + case _16: return "chromosome 16"; + case _17: return "chromosome 17"; + case _18: return "chromosome 18"; + case _19: return "chromosome 19"; + case _20: return "chromosome 20"; + case _21: return "chromosome 21"; + case _22: return "chromosome 22"; + case X: return "chromosome X"; + case Y: return "chromosome Y"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChromosomeHumanEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChromosomeHumanEnumFactory.java index b405c36f33f..d494d054e59 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChromosomeHumanEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ChromosomeHumanEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimCareteamrole.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimCareteamrole.java index b2c5218fc04..f4c0ba3f51f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimCareteamrole.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimCareteamrole.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimCareteamroleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimCareteamroleEnumFactory.java index 67f9ceb2fb4..7b9ce465a4f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimCareteamroleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimCareteamroleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimException.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimException.java index 93034f9d440..d73e524d7fd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimException.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimException.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimExceptionEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimExceptionEnumFactory.java index 3ebafdd8531..d5690edd85e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimExceptionEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimExceptionEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimInformationcategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimInformationcategory.java index 309bb705998..e189860a2d2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimInformationcategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimInformationcategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -53,13 +53,21 @@ public enum ClaimInformationcategory { */ RELATED, /** - * Insurance policy exceptions.. + * Insurance policy exceptions. */ - EXCEPTIONS, + EXCEPTION, /** * Materials being forwarded, eg. Models, molds, images, documents. */ MATERIAL, + /** + * Materials attached such as images, documents and resources. + */ + ATTACHMENT, + /** + * Teeth which are missing for any reason, for example: prior extraction, never developed. + */ + MISSINGTOOTH, /** * Other information identified by the type.system. */ @@ -79,10 +87,14 @@ public enum ClaimInformationcategory { return ONSET; if ("related".equals(codeString)) return RELATED; - if ("exceptions".equals(codeString)) - return EXCEPTIONS; + if ("exception".equals(codeString)) + return EXCEPTION; if ("material".equals(codeString)) return MATERIAL; + if ("attachment".equals(codeString)) + return ATTACHMENT; + if ("missingtooth".equals(codeString)) + return MISSINGTOOTH; if ("other".equals(codeString)) return OTHER; throw new FHIRException("Unknown ClaimInformationcategory code '"+codeString+"'"); @@ -93,8 +105,10 @@ public enum ClaimInformationcategory { case DISCHARGE: return "discharge"; case ONSET: return "onset"; case RELATED: return "related"; - case EXCEPTIONS: return "exceptions"; + case EXCEPTION: return "exception"; case MATERIAL: return "material"; + case ATTACHMENT: return "attachment"; + case MISSINGTOOTH: return "missingtooth"; case OTHER: return "other"; default: return "?"; } @@ -108,8 +122,10 @@ public enum ClaimInformationcategory { case DISCHARGE: return "Discharge status and discharge to locations."; case ONSET: return "Period, start or end dates of aspects of the Condition."; case RELATED: return "Nature and date of the related event eg. Last exam, service, Xray etc."; - case EXCEPTIONS: return "Insurance policy exceptions.."; + case EXCEPTION: return "Insurance policy exceptions."; case MATERIAL: return "Materials being forwarded, eg. Models, molds, images, documents."; + case ATTACHMENT: return "Materials attached such as images, documents and resources."; + case MISSINGTOOTH: return "Teeth which are missing for any reason, for example: prior extraction, never developed."; case OTHER: return "Other information identified by the type.system."; default: return "?"; } @@ -120,8 +136,10 @@ public enum ClaimInformationcategory { case DISCHARGE: return "Discharge"; case ONSET: return "Onset"; case RELATED: return "Related Services"; - case EXCEPTIONS: return "Exceptions"; + case EXCEPTION: return "Exception"; case MATERIAL: return "Materials Forwarded"; + case ATTACHMENT: return "Attachment"; + case MISSINGTOOTH: return "Missing Tooth"; case OTHER: return "Other"; default: return "?"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimInformationcategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimInformationcategoryEnumFactory.java index 1927714c4dd..64fd92ffbaf 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimInformationcategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ClaimInformationcategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -47,10 +47,14 @@ public class ClaimInformationcategoryEnumFactory implements EnumFactory { + + public CompositeMeasureScoring fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("opportunity".equals(codeString)) + return CompositeMeasureScoring.OPPORTUNITY; + if ("all-or-nothing".equals(codeString)) + return CompositeMeasureScoring.ALLORNOTHING; + if ("linear".equals(codeString)) + return CompositeMeasureScoring.LINEAR; + if ("weighted".equals(codeString)) + return CompositeMeasureScoring.WEIGHTED; + throw new IllegalArgumentException("Unknown CompositeMeasureScoring code '"+codeString+"'"); + } + + public String toCode(CompositeMeasureScoring code) { + if (code == CompositeMeasureScoring.OPPORTUNITY) + return "opportunity"; + if (code == CompositeMeasureScoring.ALLORNOTHING) + return "all-or-nothing"; + if (code == CompositeMeasureScoring.LINEAR) + return "linear"; + if (code == CompositeMeasureScoring.WEIGHTED) + return "weighted"; + return "?"; + } + + public String toSystem(CompositeMeasureScoring code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionAttestationMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionAttestationMode.java index 5dc2d9d937f..b4642bd679b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionAttestationMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionAttestationMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionAttestationModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionAttestationModeEnumFactory.java index 80f3aa4fdf7..211b4d46ddc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionAttestationModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionAttestationModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionStatus.java index 435a82b792d..4c4c42a6962 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionStatusEnumFactory.java index fd42ba0f8e5..151893b00d5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CompositionStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptMapEquivalence.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptMapEquivalence.java index eb7fd89cca6..1c8c7feedd9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptMapEquivalence.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptMapEquivalence.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptMapEquivalenceEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptMapEquivalenceEnumFactory.java index 26ab6d7fdfb..8ea1cb21c39 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptMapEquivalenceEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptMapEquivalenceEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptProperties.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptProperties.java index 840015eca38..2bf0dc91c0d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptProperties.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptProperties.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertiesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertiesEnumFactory.java index 28486a97a24..c4aa958c083 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertiesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertiesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertyType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertyType.java index f5ab875626a..ce8ad2df68b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertyType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertyType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertyTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertyTypeEnumFactory.java index 000ca7b5bd8..ef45a4de36d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertyTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConceptPropertyTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionCategory.java index 01507347273..7fbc961174a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionCategoryEnumFactory.java index 5fb39d4918e..f90d51320ce 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionClinical.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionClinical.java index 68a09140a79..a9e448f38b6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionClinical.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionClinical.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,19 +37,23 @@ import org.hl7.fhir.exceptions.FHIRException; public enum ConditionClinical { /** - * The subject is currently experiencing the symptoms of the condition. + * The subject is currently experiencing the symptoms of the condition or there is evidence of the condition. */ ACTIVE, /** - * The subject is re-experiencing the symptoms of the condition after a period of remission or presumed resolution. + * The subject is having a relapse or re-experiencing the condition after a period of remission or presumed resolution. */ - RELAPSE, + RECURRENCE, + /** + * The subject is no longer experiencing the symptoms of the condition or there is no longer evidence of the condition. + */ + INACTIVE, /** * The subject is no longer experiencing the symptoms of the condition, but there is a risk of the symptoms returning. */ REMISSION, /** - * The subject is no longer experiencing the symptoms of the condition and there is no perceived risk of the symptoms returning. + * The subject is no longer experiencing the symptoms of the condition and there is a negligible perceived risk of the symptoms returning. */ RESOLVED, /** @@ -61,8 +65,10 @@ public enum ConditionClinical { return null; if ("active".equals(codeString)) return ACTIVE; - if ("relapse".equals(codeString)) - return RELAPSE; + if ("recurrence".equals(codeString)) + return RECURRENCE; + if ("inactive".equals(codeString)) + return INACTIVE; if ("remission".equals(codeString)) return REMISSION; if ("resolved".equals(codeString)) @@ -72,7 +78,8 @@ public enum ConditionClinical { public String toCode() { switch (this) { case ACTIVE: return "active"; - case RELAPSE: return "relapse"; + case RECURRENCE: return "recurrence"; + case INACTIVE: return "inactive"; case REMISSION: return "remission"; case RESOLVED: return "resolved"; default: return "?"; @@ -83,17 +90,19 @@ public enum ConditionClinical { } public String getDefinition() { switch (this) { - case ACTIVE: return "The subject is currently experiencing the symptoms of the condition."; - case RELAPSE: return "The subject is re-experiencing the symptoms of the condition after a period of remission or presumed resolution."; + case ACTIVE: return "The subject is currently experiencing the symptoms of the condition or there is evidence of the condition."; + case RECURRENCE: return "The subject is having a relapse or re-experiencing the condition after a period of remission or presumed resolution."; + case INACTIVE: return "The subject is no longer experiencing the symptoms of the condition or there is no longer evidence of the condition."; case REMISSION: return "The subject is no longer experiencing the symptoms of the condition, but there is a risk of the symptoms returning."; - case RESOLVED: return "The subject is no longer experiencing the symptoms of the condition and there is no perceived risk of the symptoms returning."; + case RESOLVED: return "The subject is no longer experiencing the symptoms of the condition and there is a negligible perceived risk of the symptoms returning."; default: return "?"; } } public String getDisplay() { switch (this) { case ACTIVE: return "Active"; - case RELAPSE: return "Relapse"; + case RECURRENCE: return "Recurrence"; + case INACTIVE: return "Inactive"; case REMISSION: return "Remission"; case RESOLVED: return "Resolved"; default: return "?"; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionClinicalEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionClinicalEnumFactory.java index 4f58c303c50..52a201797da 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionClinicalEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ConditionClinicalEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -41,8 +41,10 @@ public class ConditionClinicalEnumFactory implements EnumFactory public ContractSubtype fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; - if ("disclosure-CA".equals(codeString)) + if ("disclosure-ca".equals(codeString)) return ContractSubtype.DISCLOSURECA; - if ("disclosure-US".equals(codeString)) + if ("disclosure-us".equals(codeString)) return ContractSubtype.DISCLOSUREUS; throw new IllegalArgumentException("Unknown ContractSubtype code '"+codeString+"'"); } public String toCode(ContractSubtype code) { if (code == ContractSubtype.DISCLOSURECA) - return "disclosure-CA"; + return "disclosure-ca"; if (code == ContractSubtype.DISCLOSUREUS) - return "disclosure-US"; + return "disclosure-us"; return "?"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContractTermSubtype.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContractTermSubtype.java index 024fa63eece..315ed2f8160 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContractTermSubtype.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContractTermSubtype.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,15 +37,15 @@ import org.hl7.fhir.exceptions.FHIRException; public enum ContractTermSubtype { /** - * null + * Oral Health: examinations, diagnositics, cleaning and basic restorative services. */ ORALHEALTHBASIC, /** - * null + * Oral Health: major treatment and restorative services. */ ORALHEALTHMAJOR, /** - * null + * Oral Health: orthodontic services, eg. braces. */ ORALHEALTHORTHODONTIC, /** @@ -55,19 +55,19 @@ public enum ContractTermSubtype { public static ContractTermSubtype fromCode(String codeString) throws FHIRException { if (codeString == null || "".equals(codeString)) return null; - if ("OralHealth-Basic".equals(codeString)) + if ("oralhealth-basic".equals(codeString)) return ORALHEALTHBASIC; - if ("OralHealth-Major".equals(codeString)) + if ("oralhealth-major".equals(codeString)) return ORALHEALTHMAJOR; - if ("OralHealth-Orthodontic".equals(codeString)) + if ("oralhealth-orthodontic".equals(codeString)) return ORALHEALTHORTHODONTIC; throw new FHIRException("Unknown ContractTermSubtype code '"+codeString+"'"); } public String toCode() { switch (this) { - case ORALHEALTHBASIC: return "OralHealth-Basic"; - case ORALHEALTHMAJOR: return "OralHealth-Major"; - case ORALHEALTHORTHODONTIC: return "OralHealth-Orthodontic"; + case ORALHEALTHBASIC: return "oralhealth-basic"; + case ORALHEALTHMAJOR: return "oralhealth-major"; + case ORALHEALTHORTHODONTIC: return "oralhealth-orthodontic"; default: return "?"; } } @@ -76,9 +76,9 @@ public enum ContractTermSubtype { } public String getDefinition() { switch (this) { - case ORALHEALTHBASIC: return ""; - case ORALHEALTHMAJOR: return ""; - case ORALHEALTHORTHODONTIC: return ""; + case ORALHEALTHBASIC: return "Oral Health: examinations, diagnositics, cleaning and basic restorative services."; + case ORALHEALTHMAJOR: return "Oral Health: major treatment and restorative services."; + case ORALHEALTHORTHODONTIC: return "Oral Health: orthodontic services, eg. braces."; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContractTermSubtypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContractTermSubtypeEnumFactory.java index aba70955a27..8296b4698c9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContractTermSubtypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContractTermSubtypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -39,22 +39,22 @@ public class ContractTermSubtypeEnumFactory implements EnumFactory { return ContractType.PRIVACY; if ("disclosure".equals(codeString)) return ContractType.DISCLOSURE; + if ("healthinsurance".equals(codeString)) + return ContractType.HEALTHINSURANCE; + if ("supply".equals(codeString)) + return ContractType.SUPPLY; + if ("consent".equals(codeString)) + return ContractType.CONSENT; throw new IllegalArgumentException("Unknown ContractType code '"+codeString+"'"); } @@ -51,6 +57,12 @@ public class ContractTypeEnumFactory implements EnumFactory { return "privacy"; if (code == ContractType.DISCLOSURE) return "disclosure"; + if (code == ContractType.HEALTHINSURANCE) + return "healthinsurance"; + if (code == ContractType.SUPPLY) + return "supply"; + if (code == ContractType.CONSENT) + return "consent"; return "?"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContributorType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContributorType.java index 61ba0d677ed..3a8182d34e6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContributorType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContributorType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContributorTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContributorTypeEnumFactory.java index 4539181a86e..265db4024ff 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContributorTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ContributorTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CopyNumberEvent.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CopyNumberEvent.java index 37eaebcb94c..fdac8c19744 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CopyNumberEvent.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CopyNumberEvent.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CopyNumberEventEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CopyNumberEventEnumFactory.java index d929e17ca2a..c8b975955d0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CopyNumberEventEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CopyNumberEventEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageException.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageException.java index 01dd6901ad6..3e4ddc927ac 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageException.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageException.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageExceptionEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageExceptionEnumFactory.java index 29a49516601..205dae0adfd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageExceptionEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageExceptionEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageLevel.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageLevel.java index 5ef4c15fc45..a68775df7c0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageLevel.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageLevel.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageLevelEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageLevelEnumFactory.java index 1dc67db2657..231f952c8d2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageLevelEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageLevelEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageSelfpay.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageSelfpay.java new file mode 100644 index 00000000000..5a4b1603a80 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageSelfpay.java @@ -0,0 +1,78 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum CoverageSelfpay { + + /** + * An individual or oraganization is paying directly for goods and services. + */ + PAY, + /** + * added to help the parsers + */ + NULL; + public static CoverageSelfpay fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("pay".equals(codeString)) + return PAY; + throw new FHIRException("Unknown CoverageSelfpay code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PAY: return "pay"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/coverage-selfpay"; + } + public String getDefinition() { + switch (this) { + case PAY: return "An individual or oraganization is paying directly for goods and services."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PAY: return "Pay"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageSelfpayEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageSelfpayEnumFactory.java new file mode 100644 index 00000000000..fa4f33025c9 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageSelfpayEnumFactory.java @@ -0,0 +1,58 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class CoverageSelfpayEnumFactory implements EnumFactory { + + public CoverageSelfpay fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("pay".equals(codeString)) + return CoverageSelfpay.PAY; + throw new IllegalArgumentException("Unknown CoverageSelfpay code '"+codeString+"'"); + } + + public String toCode(CoverageSelfpay code) { + if (code == CoverageSelfpay.PAY) + return "pay"; + return "?"; + } + + public String toSystem(CoverageSelfpay code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageStatus.java index 0f5286c313f..2a0fa40ff7f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageStatusEnumFactory.java index d67e4a86e14..315c81dfc54 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CoverageStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifEvidenceQuality.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifEvidenceQuality.java index d054b0e8c60..54c9707e36c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifEvidenceQuality.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifEvidenceQuality.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifEvidenceQualityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifEvidenceQualityEnumFactory.java index 00fd6931d06..a57df16d9a3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifEvidenceQualityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifEvidenceQualityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrength.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrength.java index 18e0c19dc39..f9389332a16 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrength.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrength.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrengthEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrengthEnumFactory.java index 30383b8a210..87553b12223 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrengthEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrengthEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifTriggerType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifTriggerType.java index 71041f19c6d..f1f9ec9f275 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifTriggerType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifTriggerType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifTriggerTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifTriggerTypeEnumFactory.java index a709188ad80..2b20a171991 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifTriggerTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifTriggerTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DWebType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DWebType.java index 872a198ea7e..f32c198d624 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DWebType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DWebType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DWebTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DWebTypeEnumFactory.java index 34ec920b92b..2855f0c1422 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DWebTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DWebTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataAbsentReason.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataAbsentReason.java index 9984923cabb..f3f006ce9ed 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataAbsentReason.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataAbsentReason.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataAbsentReasonEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataAbsentReasonEnumFactory.java index e7bc14b00b0..39ddd5a9fa5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataAbsentReasonEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataAbsentReasonEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataTypes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataTypes.java index 3b02bf0ba76..de4c057a963 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataTypes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataTypes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataTypesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataTypesEnumFactory.java index c269840045d..6f55211196e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataTypesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataTypesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataelementStringency.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataelementStringency.java index d6153d7a957..373369c0944 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataelementStringency.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataelementStringency.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataelementStringencyEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataelementStringencyEnumFactory.java index d92990104dc..195672a65d2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataelementStringencyEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DataelementStringencyEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DaysOfWeek.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DaysOfWeek.java index faa6c155840..bb0f652eef6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DaysOfWeek.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DaysOfWeek.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DaysOfWeekEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DaysOfWeekEnumFactory.java index 02e01ee5589..c0ca60c3593 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DaysOfWeekEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DaysOfWeekEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DefinitionStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DefinitionStatus.java index 93d703eb771..b3ed42d503c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DefinitionStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DefinitionStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,17 +37,21 @@ import org.hl7.fhir.exceptions.FHIRException; public enum DefinitionStatus { /** - * null + * The definition is in the design stage and is not yet considered to be "ready for use" */ DRAFT, /** - * null + * The definition is considered ready for use */ ACTIVE, /** - * null + * The definition should no longer be used */ WITHDRAWN, + /** + * The authoring system does not know which of the status values currently applies for this definition. + */ + UNKNOWN, /** * added to help the parsers */ @@ -61,6 +65,8 @@ public enum DefinitionStatus { return ACTIVE; if ("withdrawn".equals(codeString)) return WITHDRAWN; + if ("unknown".equals(codeString)) + return UNKNOWN; throw new FHIRException("Unknown DefinitionStatus code '"+codeString+"'"); } public String toCode() { @@ -68,6 +74,7 @@ public enum DefinitionStatus { case DRAFT: return "draft"; case ACTIVE: return "active"; case WITHDRAWN: return "withdrawn"; + case UNKNOWN: return "unknown"; default: return "?"; } } @@ -76,9 +83,10 @@ public enum DefinitionStatus { } public String getDefinition() { switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case WITHDRAWN: return ""; + case DRAFT: return "The definition is in the design stage and is not yet considered to be \"ready for use\""; + case ACTIVE: return "The definition is considered ready for use"; + case WITHDRAWN: return "The definition should no longer be used"; + case UNKNOWN: return "The authoring system does not know which of the status values currently applies for this definition."; default: return "?"; } } @@ -86,7 +94,8 @@ public enum DefinitionStatus { switch (this) { case DRAFT: return "Draft"; case ACTIVE: return "Active"; - case WITHDRAWN: return "Suspended"; + case WITHDRAWN: return "Withdrawn"; + case UNKNOWN: return "Unknown"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DefinitionStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DefinitionStatusEnumFactory.java index 0ffe887ed87..57fc7e32299 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DefinitionStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/DefinitionStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -45,6 +45,8 @@ public class DefinitionStatusEnumFactory implements EnumFactory { return EventStatus.COMPLETED; if ("entered-in-error".equals(codeString)) return EventStatus.ENTEREDINERROR; + if ("unknown".equals(codeString)) + return EventStatus.UNKNOWN; throw new IllegalArgumentException("Unknown EventStatus code '"+codeString+"'"); } @@ -67,6 +69,8 @@ public class EventStatusEnumFactory implements EnumFactory { return "completed"; if (code == EventStatus.ENTEREDINERROR) return "entered-in-error"; + if (code == EventStatus.UNKNOWN) + return "unknown"; return "?"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/EventTiming.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/EventTiming.java new file mode 100644 index 00000000000..359cca7bd77 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/EventTiming.java @@ -0,0 +1,105 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum EventTiming { + + /** + * event occurs during the morning + */ + MORN, + /** + * event occurs during the afternoon + */ + AFT, + /** + * event occurs during the evening + */ + EVE, + /** + * event occurs during the night + */ + NIGHT, + /** + * added to help the parsers + */ + NULL; + public static EventTiming fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("MORN".equals(codeString)) + return MORN; + if ("AFT".equals(codeString)) + return AFT; + if ("EVE".equals(codeString)) + return EVE; + if ("NIGHT".equals(codeString)) + return NIGHT; + throw new FHIRException("Unknown EventTiming code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case MORN: return "MORN"; + case AFT: return "AFT"; + case EVE: return "EVE"; + case NIGHT: return "NIGHT"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/event-timing"; + } + public String getDefinition() { + switch (this) { + case MORN: return "event occurs during the morning"; + case AFT: return "event occurs during the afternoon"; + case EVE: return "event occurs during the evening"; + case NIGHT: return "event occurs during the night"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MORN: return "Morning"; + case AFT: return "Afternoon"; + case EVE: return "Evening"; + case NIGHT: return "Night"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/EventTimingEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/EventTimingEnumFactory.java new file mode 100644 index 00000000000..aacf751c5a0 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/EventTimingEnumFactory.java @@ -0,0 +1,70 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class EventTimingEnumFactory implements EnumFactory { + + public EventTiming fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("MORN".equals(codeString)) + return EventTiming.MORN; + if ("AFT".equals(codeString)) + return EventTiming.AFT; + if ("EVE".equals(codeString)) + return EventTiming.EVE; + if ("NIGHT".equals(codeString)) + return EventTiming.NIGHT; + throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); + } + + public String toCode(EventTiming code) { + if (code == EventTiming.MORN) + return "MORN"; + if (code == EventTiming.AFT) + return "AFT"; + if (code == EventTiming.EVE) + return "EVE"; + if (code == EventTiming.NIGHT) + return "NIGHT"; + return "?"; + } + + public String toSystem(EventTiming code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosisrelatedgroup.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosisrelatedgroup.java index 2f30fb90042..d30e03caacc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosisrelatedgroup.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosisrelatedgroup.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosisrelatedgroupEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosisrelatedgroupEnumFactory.java index e91af3a40ef..f44b3d6b363 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosisrelatedgroupEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosisrelatedgroupEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosistype.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosistype.java index d390fd9514c..da350745514 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosistype.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosistype.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosistypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosistypeEnumFactory.java index e228a029f29..63a72c5d810 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosistypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExDiagnosistypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExOnsettype.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExOnsettype.java index 49669281ea9..55df0a323c4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExOnsettype.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExOnsettype.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExOnsettypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExOnsettypeEnumFactory.java index 93c9c3be1dc..42c6bfed0c3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExOnsettypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExOnsettypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPayeeResourceType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPayeeResourceType.java index 6353dad23ff..2d6efcde9cf 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPayeeResourceType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPayeeResourceType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPayeeResourceTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPayeeResourceTypeEnumFactory.java index af5644dbcd6..824b5b8b25f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPayeeResourceTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPayeeResourceTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPaymenttype.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPaymenttype.java index 7302401f6e0..ce7aa07972b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPaymenttype.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPaymenttype.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPaymenttypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPaymenttypeEnumFactory.java index 7227f957289..6cf255138c4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPaymenttypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExPaymenttypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExProgramCode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExProgramCode.java index 2239faf27d7..346b073d424 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExProgramCode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExProgramCode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExProgramCodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExProgramCodeEnumFactory.java index a4accfb7139..5dbf402150f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExProgramCodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExProgramCodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExRevenueCenter.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExRevenueCenter.java index 678318665a3..34c2fec6a2b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExRevenueCenter.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExRevenueCenter.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExRevenueCenterEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExRevenueCenterEnumFactory.java index 0c1aff698f5..697981f1359 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExRevenueCenterEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExRevenueCenterEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExplanationofbenefitStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExplanationofbenefitStatus.java index 3bdbc04ca92..a7ed742731e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExplanationofbenefitStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExplanationofbenefitStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExplanationofbenefitStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExplanationofbenefitStatusEnumFactory.java index e30dc374f30..c598a4fdfee 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExplanationofbenefitStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExplanationofbenefitStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExtensionContext.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExtensionContext.java index bc49c1c9af1..65ab79a9054 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExtensionContext.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExtensionContext.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExtensionContextEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExtensionContextEnumFactory.java index 4923e7ff84a..5be1ba233e7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExtensionContextEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ExtensionContextEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FilterOperator.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FilterOperator.java index eebbe3d9820..abbc1e1e4d2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FilterOperator.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FilterOperator.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -44,6 +44,10 @@ public enum FilterOperator { * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (i.e. include child codes) */ ISA, + /** + * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include child codes) + */ + DESCENDENTOF, /** * The specified property of the code does not have an is-a relationship with the provided value. */ @@ -64,6 +68,10 @@ public enum FilterOperator { * Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (e.g. include parent codes) */ GENERALIZES, + /** + * The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values) + */ + EXISTS, /** * added to help the parsers */ @@ -75,6 +83,8 @@ public enum FilterOperator { return EQUAL; if ("is-a".equals(codeString)) return ISA; + if ("descendent-of".equals(codeString)) + return DESCENDENTOF; if ("is-not-a".equals(codeString)) return ISNOTA; if ("regex".equals(codeString)) @@ -85,17 +95,21 @@ public enum FilterOperator { return NOTIN; if ("generalizes".equals(codeString)) return GENERALIZES; + if ("exists".equals(codeString)) + return EXISTS; throw new FHIRException("Unknown FilterOperator code '"+codeString+"'"); } public String toCode() { switch (this) { case EQUAL: return "="; case ISA: return "is-a"; + case DESCENDENTOF: return "descendent-of"; case ISNOTA: return "is-not-a"; case REGEX: return "regex"; case IN: return "in"; case NOTIN: return "not-in"; case GENERALIZES: return "generalizes"; + case EXISTS: return "exists"; default: return "?"; } } @@ -106,11 +120,13 @@ public enum FilterOperator { switch (this) { case EQUAL: return "The specified property of the code equals the provided value."; case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (i.e. include child codes)"; + case DESCENDENTOF: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include child codes)"; case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; case REGEX: return "The specified property of the code matches the regex specified in the provided value."; case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; case GENERALIZES: return "Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (e.g. include parent codes)"; + case EXISTS: return "The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values)"; default: return "?"; } } @@ -118,11 +134,13 @@ public enum FilterOperator { switch (this) { case EQUAL: return "Equals"; case ISA: return "Is A (by subsumption)"; + case DESCENDENTOF: return "Descendent Of (by subsumption)"; case ISNOTA: return "Not (Is A) (by subsumption)"; case REGEX: return "Regular Expression"; case IN: return "In Set"; case NOTIN: return "Not in Set"; case GENERALIZES: return "Generalizes (by Subsumption)"; + case EXISTS: return "Exists"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FilterOperatorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FilterOperatorEnumFactory.java index 68afe3f2c65..323fd7b1bb7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FilterOperatorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FilterOperatorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -43,6 +43,8 @@ public class FilterOperatorEnumFactory implements EnumFactory { return FilterOperator.EQUAL; if ("is-a".equals(codeString)) return FilterOperator.ISA; + if ("descendent-of".equals(codeString)) + return FilterOperator.DESCENDENTOF; if ("is-not-a".equals(codeString)) return FilterOperator.ISNOTA; if ("regex".equals(codeString)) @@ -53,6 +55,8 @@ public class FilterOperatorEnumFactory implements EnumFactory { return FilterOperator.NOTIN; if ("generalizes".equals(codeString)) return FilterOperator.GENERALIZES; + if ("exists".equals(codeString)) + return FilterOperator.EXISTS; throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); } @@ -61,6 +65,8 @@ public class FilterOperatorEnumFactory implements EnumFactory { return "="; if (code == FilterOperator.ISA) return "is-a"; + if (code == FilterOperator.DESCENDENTOF) + return "descendent-of"; if (code == FilterOperator.ISNOTA) return "is-not-a"; if (code == FilterOperator.REGEX) @@ -71,6 +77,8 @@ public class FilterOperatorEnumFactory implements EnumFactory { return "not-in"; if (code == FilterOperator.GENERALIZES) return "generalizes"; + if (code == FilterOperator.EXISTS) + return "exists"; return "?"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagCategory.java index 617d4e57e6b..ffebf752d64 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagCategoryEnumFactory.java index 742c38cd27c..fa476fed5d9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagPriority.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagPriority.java index f4300a4b107..e7d5afbc05e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagPriority.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagPriority.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagPriorityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagPriorityEnumFactory.java index 9e02fda43bf..de7535e0404 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagPriorityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagPriorityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagStatus.java index 655507e056e..b68b39f07c4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagStatusEnumFactory.java index da41a972831..2e6c965ba8b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FlagStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmConditions.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmConditions.java index 6b123eb0aee..2c8cd498b94 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmConditions.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmConditions.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmConditionsEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmConditionsEnumFactory.java index 35e038ca1bd..595e1611b2d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmConditionsEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmConditionsEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmItemtype.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmItemtype.java index a915780f88f..3ab0e6ef5c5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmItemtype.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmItemtype.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmItemtypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmItemtypeEnumFactory.java index d965d9baf5d..5fed904dba6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmItemtypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmItemtypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmStatus.java new file mode 100644 index 00000000000..d1da3b54984 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmStatus.java @@ -0,0 +1,105 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum FmStatus { + + /** + * The instance is currently in-force. + */ + ACTIVE, + /** + * The instance is withdrawn, rescinded or reversed. + */ + CANCELLED, + /** + * A new instance the contents of which is not complete. + */ + DRAFT, + /** + * The instance was entered in error. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static FmStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return ACTIVE; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("draft".equals(codeString)) + return DRAFT; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown FmStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case CANCELLED: return "cancelled"; + case DRAFT: return "draft"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/fm-status"; + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The instance is currently in-force."; + case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; + case DRAFT: return "A new instance the contents of which is not complete."; + case ENTEREDINERROR: return "The instance was entered in error."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "Active"; + case CANCELLED: return "Cancelled"; + case DRAFT: return "Draft"; + case ENTEREDINERROR: return "Entered in Error"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmStatusEnumFactory.java new file mode 100644 index 00000000000..53c527907f8 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FmStatusEnumFactory.java @@ -0,0 +1,70 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class FmStatusEnumFactory implements EnumFactory { + + public FmStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return FmStatus.ACTIVE; + if ("cancelled".equals(codeString)) + return FmStatus.CANCELLED; + if ("draft".equals(codeString)) + return FmStatus.DRAFT; + if ("entered-in-error".equals(codeString)) + return FmStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown FmStatus code '"+codeString+"'"); + } + + public String toCode(FmStatus code) { + if (code == FmStatus.ACTIVE) + return "active"; + if (code == FmStatus.CANCELLED) + return "cancelled"; + if (code == FmStatus.DRAFT) + return "draft"; + if (code == FmStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + + public String toSystem(FmStatus code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Forms.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Forms.java index 0234f0ade7e..8e154067e24 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Forms.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Forms.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,11 +37,11 @@ import org.hl7.fhir.exceptions.FHIRException; public enum Forms { /** - * null + * Example: The #1 form to be used when printing this information. */ _1, /** - * null + * Example: The #2 form to be used when printing this information. */ _2, /** @@ -69,15 +69,15 @@ public enum Forms { } public String getDefinition() { switch (this) { - case _1: return ""; - case _2: return ""; + case _1: return "Example: The #1 form to be used when printing this information."; + case _2: return "Example: The #2 form to be used when printing this information."; default: return "?"; } } public String getDisplay() { switch (this) { - case _1: return "1"; - case _2: return "2"; + case _1: return "Form #1"; + case _2: return "Form #1"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FormsEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FormsEnumFactory.java index 74dffbbfdc2..62996785d1f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FormsEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FormsEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Fundsreserve.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Fundsreserve.java index 50b0b840d0a..f343500a6e4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Fundsreserve.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Fundsreserve.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,15 +37,15 @@ import org.hl7.fhir.exceptions.FHIRException; public enum Fundsreserve { /** - * null + * The payor is requested to reserve funds for the provision of the named services by any provider for settlement of future claims related to this request. */ PATIENT, /** - * null + * The payor is requested to reserve funds solely for the named provider for settlement of future claims related to this request. */ PROVIDER, /** - * null + * The payor is not being requested to reserve any funds for the settlement of future claims. */ NONE, /** @@ -76,17 +76,17 @@ public enum Fundsreserve { } public String getDefinition() { switch (this) { - case PATIENT: return ""; - case PROVIDER: return ""; - case NONE: return ""; + case PATIENT: return "The payor is requested to reserve funds for the provision of the named services by any provider for settlement of future claims related to this request."; + case PROVIDER: return "The payor is requested to reserve funds solely for the named provider for settlement of future claims related to this request."; + case NONE: return "The payor is not being requested to reserve any funds for the settlement of future claims."; default: return "?"; } } public String getDisplay() { switch (this) { - case PATIENT: return "patient"; - case PROVIDER: return "provider"; - case NONE: return "none"; + case PATIENT: return "Patient"; + case PROVIDER: return "Provider"; + case NONE: return "None"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FundsreserveEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FundsreserveEnumFactory.java index 376e615b50c..46c5e186e5d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FundsreserveEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/FundsreserveEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalAcceptanceStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalAcceptanceStatus.java index d9368c87782..e1d568084a2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalAcceptanceStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalAcceptanceStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalAcceptanceStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalAcceptanceStatusEnumFactory.java index 92e07bc4d88..4b4ea0c3f00 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalAcceptanceStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalAcceptanceStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalCategory.java index 6389a2c774e..3b38c52e95f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalCategoryEnumFactory.java index ff9dde23538..de39463dcf9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalPriority.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalPriority.java index e6d4344e463..3c2441afede 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalPriority.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalPriority.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalPriorityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalPriorityEnumFactory.java index 14f52118159..364e3175549 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalPriorityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalPriorityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalRelationshipType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalRelationshipType.java index ba9408c5ca8..a863950d816 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalRelationshipType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalRelationshipType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalRelationshipTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalRelationshipTypeEnumFactory.java index 5a3f144c468..775d2a7f25f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalRelationshipTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalRelationshipTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatus.java index 249027d77e6..906c715c24c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusEnumFactory.java index f1f0b449a15..bfd5b29db3c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusReason.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusReason.java index 0a0bc6e393f..0d2e4de14f7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusReason.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusReason.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusReasonEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusReasonEnumFactory.java index dd15a1fdaa4..db4b2496593 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusReasonEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GoalStatusReasonEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GroupType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GroupType.java index e7c6107428b..e8b2677a4c3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GroupType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GroupType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GroupTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GroupTypeEnumFactory.java index 492b5570c7f..d1fcbb32619 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GroupTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GroupTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidanceResponseStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidanceResponseStatus.java index 3492ec3ca08..c05b8f550ea 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidanceResponseStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidanceResponseStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidanceResponseStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidanceResponseStatusEnumFactory.java index 1f07e705d15..fed63131195 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidanceResponseStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidanceResponseStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuideDependencyType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuideDependencyType.java index 9ce59d737d3..2766885ad66 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuideDependencyType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuideDependencyType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuideDependencyTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuideDependencyTypeEnumFactory.java index 174d7590da2..2ed26e19087 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuideDependencyTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuideDependencyTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidePageKind.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidePageKind.java index 1526197dafd..66324e1e6d6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidePageKind.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidePageKind.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidePageKindEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidePageKindEnumFactory.java index 74221ae082f..2f234211332 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidePageKindEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/GuidePageKindEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HistoryStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HistoryStatus.java index a1438dcef74..856eb7a87f5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HistoryStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HistoryStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HistoryStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HistoryStatusEnumFactory.java index f4ac0960697..fd82a3ebafd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HistoryStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HistoryStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroup.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroup.java new file mode 100644 index 00000000000..27d319e0b95 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroup.java @@ -0,0 +1,276 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum Hl7WorkGroup { + + /** + * Community Based Collaborative Care (http://www.hl7.org/Special/committees/cbcc/index.cfm) + */ + CBCC, + /** + * Clinical Decision Support (http://www.hl7.org/Special/committees/dss/index.cfm) + */ + CDS, + /** + * Clinical Quality Information (http://www.hl7.org/Special/committees/cqi/index.cfm) + */ + CQI, + /** + * Clinical Genomics (http://www.hl7.org/Special/committees/clingenomics/index.cfm) + */ + CG, + /** + * Health Care Devices (http://www.hl7.org/Special/committees/healthcaredevices/index.cfm) + */ + DEV, + /** + * Electronic Health Records (http://www.hl7.org/special/committees/ehr/index.cfm) + */ + EHR, + /** + * FHIR Infrastructure (http://www.hl7.org/Special/committees/fiwg/index.cfm) + */ + FHIR, + /** + * Financial Management (http://www.hl7.org/Special/committees/fm/index.cfm) + */ + FM, + /** + * Health Standards Integration (http://www.hl7.org/Special/committees/hsi/index.cfm) + */ + HSI, + /** + * Imaging Integration (http://www.hl7.org/Special/committees/imagemgt/index.cfm) + */ + II, + /** + * Infrastructure And Messaging (http://www.hl7.org/special/committees/inm/index.cfm) + */ + INM, + /** + * Implementable Technology Specifications (http://www.hl7.org/special/committees/xml/index.cfm) + */ + ITS, + /** + * Orders and Observations (http://www.hl7.org/Special/committees/orders/index.cfm) + */ + OO, + /** + * Patient Administration (http://www.hl7.org/Special/committees/pafm/index.cfm) + */ + PA, + /** + * Patient Care (http://www.hl7.org/Special/committees/patientcare/index.cfm) + */ + PC, + /** + * Public Health and Emergency Response (http://www.hl7.org/Special/committees/pher/index.cfm) + */ + PHER, + /** + * Pharmacy (http://www.hl7.org/Special/committees/medication/index.cfm) + */ + PHX, + /** + * Regulated Clinical Research Information Management (http://www.hl7.org/Special/committees/rcrim/index.cfm) + */ + RCRIM, + /** + * Structured Documents (http://www.hl7.org/Special/committees/structure/index.cfm) + */ + SD, + /** + * Security (http://www.hl7.org/Special/committees/secure/index.cfm) + */ + SEC, + /** + * US Realm Taskforce (http://wiki.hl7.org/index.php?title=US_Realm_Task_Force) + */ + US, + /** + * Vocabulary (http://www.hl7.org/Special/committees/Vocab/index.cfm) + */ + VOCAB, + /** + * Application Implementation and Design (http://www.hl7.org/Special/committees/java/index.cfm) + */ + AID, + /** + * added to help the parsers + */ + NULL; + public static Hl7WorkGroup fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("cbcc".equals(codeString)) + return CBCC; + if ("cds".equals(codeString)) + return CDS; + if ("cqi".equals(codeString)) + return CQI; + if ("cg".equals(codeString)) + return CG; + if ("dev".equals(codeString)) + return DEV; + if ("ehr".equals(codeString)) + return EHR; + if ("fhir".equals(codeString)) + return FHIR; + if ("fm".equals(codeString)) + return FM; + if ("hsi".equals(codeString)) + return HSI; + if ("ii".equals(codeString)) + return II; + if ("inm".equals(codeString)) + return INM; + if ("its".equals(codeString)) + return ITS; + if ("oo".equals(codeString)) + return OO; + if ("pa".equals(codeString)) + return PA; + if ("pc".equals(codeString)) + return PC; + if ("pher".equals(codeString)) + return PHER; + if ("phx".equals(codeString)) + return PHX; + if ("rcrim".equals(codeString)) + return RCRIM; + if ("sd".equals(codeString)) + return SD; + if ("sec".equals(codeString)) + return SEC; + if ("us".equals(codeString)) + return US; + if ("vocab".equals(codeString)) + return VOCAB; + if ("aid".equals(codeString)) + return AID; + throw new FHIRException("Unknown Hl7WorkGroup code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CBCC: return "cbcc"; + case CDS: return "cds"; + case CQI: return "cqi"; + case CG: return "cg"; + case DEV: return "dev"; + case EHR: return "ehr"; + case FHIR: return "fhir"; + case FM: return "fm"; + case HSI: return "hsi"; + case II: return "ii"; + case INM: return "inm"; + case ITS: return "its"; + case OO: return "oo"; + case PA: return "pa"; + case PC: return "pc"; + case PHER: return "pher"; + case PHX: return "phx"; + case RCRIM: return "rcrim"; + case SD: return "sd"; + case SEC: return "sec"; + case US: return "us"; + case VOCAB: return "vocab"; + case AID: return "aid"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/hl7-work-group"; + } + public String getDefinition() { + switch (this) { + case CBCC: return "Community Based Collaborative Care (http://www.hl7.org/Special/committees/cbcc/index.cfm)"; + case CDS: return "Clinical Decision Support (http://www.hl7.org/Special/committees/dss/index.cfm)"; + case CQI: return "Clinical Quality Information (http://www.hl7.org/Special/committees/cqi/index.cfm)"; + case CG: return "Clinical Genomics (http://www.hl7.org/Special/committees/clingenomics/index.cfm)"; + case DEV: return "Health Care Devices (http://www.hl7.org/Special/committees/healthcaredevices/index.cfm)"; + case EHR: return "Electronic Health Records (http://www.hl7.org/special/committees/ehr/index.cfm)"; + case FHIR: return "FHIR Infrastructure (http://www.hl7.org/Special/committees/fiwg/index.cfm)"; + case FM: return "Financial Management (http://www.hl7.org/Special/committees/fm/index.cfm)"; + case HSI: return "Health Standards Integration (http://www.hl7.org/Special/committees/hsi/index.cfm)"; + case II: return "Imaging Integration (http://www.hl7.org/Special/committees/imagemgt/index.cfm)"; + case INM: return "Infrastructure And Messaging (http://www.hl7.org/special/committees/inm/index.cfm)"; + case ITS: return "Implementable Technology Specifications (http://www.hl7.org/special/committees/xml/index.cfm)"; + case OO: return "Orders and Observations (http://www.hl7.org/Special/committees/orders/index.cfm)"; + case PA: return "Patient Administration (http://www.hl7.org/Special/committees/pafm/index.cfm)"; + case PC: return "Patient Care (http://www.hl7.org/Special/committees/patientcare/index.cfm)"; + case PHER: return "Public Health and Emergency Response (http://www.hl7.org/Special/committees/pher/index.cfm)"; + case PHX: return "Pharmacy (http://www.hl7.org/Special/committees/medication/index.cfm)"; + case RCRIM: return "Regulated Clinical Research Information Management (http://www.hl7.org/Special/committees/rcrim/index.cfm)"; + case SD: return "Structured Documents (http://www.hl7.org/Special/committees/structure/index.cfm)"; + case SEC: return "Security (http://www.hl7.org/Special/committees/secure/index.cfm)"; + case US: return "US Realm Taskforce (http://wiki.hl7.org/index.php?title=US_Realm_Task_Force)"; + case VOCAB: return "Vocabulary (http://www.hl7.org/Special/committees/Vocab/index.cfm)"; + case AID: return "Application Implementation and Design (http://www.hl7.org/Special/committees/java/index.cfm)"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CBCC: return "Community Based Collaborative Care"; + case CDS: return "Clinical Decision Support"; + case CQI: return "Clinical Quality Information"; + case CG: return "Clinical Genomics"; + case DEV: return "Health Care Devices"; + case EHR: return "Electronic Health Records"; + case FHIR: return "FHIR Infrastructure"; + case FM: return "Financial Management"; + case HSI: return "Health Standards Integration"; + case II: return "Imaging Integration"; + case INM: return "Infrastructure And Messaging"; + case ITS: return "Implementable Technology Specifications"; + case OO: return "Orders and Observations"; + case PA: return "Patient Administration"; + case PC: return "Patient Care"; + case PHER: return "Public Health and Emergency Response"; + case PHX: return "Pharmacy"; + case RCRIM: return "Regulated Clinical Research Information Management"; + case SD: return "Structured Documents"; + case SEC: return "Security"; + case US: return "US Realm Taskforce"; + case VOCAB: return "Vocabulary"; + case AID: return "Application Implementation and Design"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroupEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroupEnumFactory.java new file mode 100644 index 00000000000..48023c08585 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroupEnumFactory.java @@ -0,0 +1,146 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class Hl7WorkGroupEnumFactory implements EnumFactory { + + public Hl7WorkGroup fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("cbcc".equals(codeString)) + return Hl7WorkGroup.CBCC; + if ("cds".equals(codeString)) + return Hl7WorkGroup.CDS; + if ("cqi".equals(codeString)) + return Hl7WorkGroup.CQI; + if ("cg".equals(codeString)) + return Hl7WorkGroup.CG; + if ("dev".equals(codeString)) + return Hl7WorkGroup.DEV; + if ("ehr".equals(codeString)) + return Hl7WorkGroup.EHR; + if ("fhir".equals(codeString)) + return Hl7WorkGroup.FHIR; + if ("fm".equals(codeString)) + return Hl7WorkGroup.FM; + if ("hsi".equals(codeString)) + return Hl7WorkGroup.HSI; + if ("ii".equals(codeString)) + return Hl7WorkGroup.II; + if ("inm".equals(codeString)) + return Hl7WorkGroup.INM; + if ("its".equals(codeString)) + return Hl7WorkGroup.ITS; + if ("oo".equals(codeString)) + return Hl7WorkGroup.OO; + if ("pa".equals(codeString)) + return Hl7WorkGroup.PA; + if ("pc".equals(codeString)) + return Hl7WorkGroup.PC; + if ("pher".equals(codeString)) + return Hl7WorkGroup.PHER; + if ("phx".equals(codeString)) + return Hl7WorkGroup.PHX; + if ("rcrim".equals(codeString)) + return Hl7WorkGroup.RCRIM; + if ("sd".equals(codeString)) + return Hl7WorkGroup.SD; + if ("sec".equals(codeString)) + return Hl7WorkGroup.SEC; + if ("us".equals(codeString)) + return Hl7WorkGroup.US; + if ("vocab".equals(codeString)) + return Hl7WorkGroup.VOCAB; + if ("aid".equals(codeString)) + return Hl7WorkGroup.AID; + throw new IllegalArgumentException("Unknown Hl7WorkGroup code '"+codeString+"'"); + } + + public String toCode(Hl7WorkGroup code) { + if (code == Hl7WorkGroup.CBCC) + return "cbcc"; + if (code == Hl7WorkGroup.CDS) + return "cds"; + if (code == Hl7WorkGroup.CQI) + return "cqi"; + if (code == Hl7WorkGroup.CG) + return "cg"; + if (code == Hl7WorkGroup.DEV) + return "dev"; + if (code == Hl7WorkGroup.EHR) + return "ehr"; + if (code == Hl7WorkGroup.FHIR) + return "fhir"; + if (code == Hl7WorkGroup.FM) + return "fm"; + if (code == Hl7WorkGroup.HSI) + return "hsi"; + if (code == Hl7WorkGroup.II) + return "ii"; + if (code == Hl7WorkGroup.INM) + return "inm"; + if (code == Hl7WorkGroup.ITS) + return "its"; + if (code == Hl7WorkGroup.OO) + return "oo"; + if (code == Hl7WorkGroup.PA) + return "pa"; + if (code == Hl7WorkGroup.PC) + return "pc"; + if (code == Hl7WorkGroup.PHER) + return "pher"; + if (code == Hl7WorkGroup.PHX) + return "phx"; + if (code == Hl7WorkGroup.RCRIM) + return "rcrim"; + if (code == Hl7WorkGroup.SD) + return "sd"; + if (code == Hl7WorkGroup.SEC) + return "sec"; + if (code == Hl7WorkGroup.US) + return "us"; + if (code == Hl7WorkGroup.VOCAB) + return "vocab"; + if (code == Hl7WorkGroup.AID) + return "aid"; + return "?"; + } + + public String toSystem(Hl7WorkGroup code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HttpVerb.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HttpVerb.java index 28436c0ccae..0af44f21f6a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HttpVerb.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HttpVerb.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HttpVerbEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HttpVerbEnumFactory.java index 00391760645..4bdc545a131 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HttpVerbEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/HttpVerbEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Icd10Procedures.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Icd10Procedures.java index e9196e8c89d..298196afb45 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Icd10Procedures.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Icd10Procedures.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Icd10ProceduresEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Icd10ProceduresEnumFactory.java index 05e296ff679..c6425df3a28 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Icd10ProceduresEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Icd10ProceduresEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierType.java index a19805806f6..5b5589fa8bb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierTypeEnumFactory.java index 8d4f5e170c9..447cffb9fce 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierUse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierUse.java index 9c60e13a3d5..c7afba8eca8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierUse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierUse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierUseEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierUseEnumFactory.java index 655d0b6269d..006532ff971 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierUseEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentifierUseEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentityAssuranceLevel.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentityAssuranceLevel.java index 01434a3e88d..83429dd2971 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentityAssuranceLevel.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentityAssuranceLevel.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentityAssuranceLevelEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentityAssuranceLevelEnumFactory.java index edaab28126f..7fe33f5a13f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentityAssuranceLevelEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IdentityAssuranceLevelEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationDateCriterion.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationDateCriterion.java index 03da2017381..4dc5be9f83e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationDateCriterion.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationDateCriterion.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationDateCriterionEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationDateCriterionEnumFactory.java index 821bfe00e82..f15b203f3dd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationDateCriterionEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationDateCriterionEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationStatus.java index e6f2fbf69e1..b84a6946f3d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationStatusEnumFactory.java index ed2bd3c2618..f054594f8b7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ImmunizationRecommendationStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Intervention.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Intervention.java index ae7ab8fee21..1f4aeb766e5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Intervention.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Intervention.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/InterventionEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/InterventionEnumFactory.java index 808b8f6459c..b460148b37a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/InterventionEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/InterventionEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueSeverity.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueSeverity.java index d983f56104b..b12fbd2f50a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueSeverity.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueSeverity.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueSeverityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueSeverityEnumFactory.java index 0ff2ffa821e..bbf7a346ec6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueSeverityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueSeverityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueType.java index 0ac85a3a0eb..c7b47452d2e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueTypeEnumFactory.java index 4dee88a5fca..bc5fa3539ee 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/IssueTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ItemType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ItemType.java index 50a955901bf..9e1f25ac533 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ItemType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ItemType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ItemTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ItemTypeEnumFactory.java index 796a66c733f..d3480e627a5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ItemTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ItemTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480020Answerlist.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480020Answerlist.java index 6b00b6418f5..68e5553e4fa 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480020Answerlist.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480020Answerlist.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480020AnswerlistEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480020AnswerlistEnumFactory.java index a0766ef7554..2dfc57092d2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480020AnswerlistEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480020AnswerlistEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480194Answerlist.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480194Answerlist.java index f29c11e6859..0a5383eb67e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480194Answerlist.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480194Answerlist.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480194AnswerlistEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480194AnswerlistEnumFactory.java index 859574a4b44..5989ddf860f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480194AnswerlistEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC480194AnswerlistEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC530345Answerlist.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC530345Answerlist.java index ab234498762..f882eaa18db 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC530345Answerlist.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC530345Answerlist.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC530345AnswerlistEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC530345AnswerlistEnumFactory.java index 50866974e5c..2e6390d8478 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC530345AnswerlistEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LOINC530345AnswerlistEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LibraryType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LibraryType.java index 7cd9daf14b8..74deb26127b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LibraryType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LibraryType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LibraryTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LibraryTypeEnumFactory.java index 5abf49915a3..7f61070e9bb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LibraryTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LibraryTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkType.java index 651e3ee50a5..8394337c999 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkTypeEnumFactory.java index 33d1fe6cbca..a00c12e1e49 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkageType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkageType.java index 97d2d7d7bb4..5f1b810b328 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkageType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkageType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkageTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkageTypeEnumFactory.java index a0519e29b03..b00eaea075d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkageTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LinkageTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListEmptyReason.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListEmptyReason.java index f0651899574..7f8ce364727 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListEmptyReason.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListEmptyReason.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListEmptyReasonEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListEmptyReasonEnumFactory.java index f6099e0e7f5..03543f4c538 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListEmptyReasonEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListEmptyReasonEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListExampleCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListExampleCodes.java index 31b0e05c6d2..8696ac801c4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListExampleCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListExampleCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListExampleCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListExampleCodesEnumFactory.java index 1dd7771af6d..ada74fac32b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListExampleCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListExampleCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListItemFlag.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListItemFlag.java index d7ce6344497..f42e643e2f1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListItemFlag.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListItemFlag.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListItemFlagEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListItemFlagEnumFactory.java index 04b461f29b0..be29e34fe85 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListItemFlagEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListItemFlagEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListMode.java index a9f9d929f92..b2d92de88e6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListModeEnumFactory.java index 84055bcc99e..fc2b6e506e4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListOrder.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListOrder.java index 437b1a689d8..05c42cb9f1c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListOrder.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListOrder.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListOrderEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListOrderEnumFactory.java index cc0ee420666..afa72fe8c48 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListOrderEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListOrderEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListStatus.java index bfd19ca333d..f6a5a303b67 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListStatusEnumFactory.java index ed2c98fff14..42518821812 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ListStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationMode.java index 9166f951434..4722262fc6f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationModeEnumFactory.java index d26d9cd2054..ef4b581e13b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationPhysicalType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationPhysicalType.java index f2d5c215e92..c95eae2555d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationPhysicalType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationPhysicalType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -65,7 +65,7 @@ public enum LocationPhysicalType { */ RO, /** - * A space that is allocated for sleeping/laying on. + * A space that is allocated for sleeping/laying on. This is not the physical bed/trolley that may be moved about, but the space it may occupy. */ BD, /** @@ -160,7 +160,7 @@ public enum LocationPhysicalType { case LVL: return "A Level in a multi-level Building/Structure."; case CO: return "Any corridor within a Building, that may connect rooms."; case RO: return "A space that is allocated as a room, it may have walls/roof etc., but does not require these."; - case BD: return "A space that is allocated for sleeping/laying on."; + case BD: return "A space that is allocated for sleeping/laying on. This is not the physical bed/trolley that may be moved about, but the space it may occupy."; case VE: return "A means of transportation."; case HO: return "A residential dwelling. Usually used to reference a location that a person/patient may reside."; case CA: return "A container that can store goods, equipment, medications or other items."; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationPhysicalTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationPhysicalTypeEnumFactory.java index 2b9eaf67932..2d2fbaa6e76 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationPhysicalTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationPhysicalTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationStatus.java index 8434b29be8d..85e46001cd1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationStatusEnumFactory.java index 78abb9fbadf..fc25b6903d8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/LocationStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapContextType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapContextType.java index 2412c0f2f83..7cab28f8bee 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapContextType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapContextType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapContextTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapContextTypeEnumFactory.java index d6eb856357c..ace04c66849 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapContextTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapContextTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapInputMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapInputMode.java index 84b236802cc..de11be8bf6d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapInputMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapInputMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapInputModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapInputModeEnumFactory.java index d7179c1beb4..9a0ccc77879 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapInputModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapInputModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapListMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapListMode.java index c825515f019..48bf1aedd53 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapListMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapListMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapListModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapListModeEnumFactory.java index c9de2859219..417e216eba8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapListModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapListModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapModelMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapModelMode.java index 88602e2dcf1..65e67c9452c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapModelMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapModelMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapModelModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapModelModeEnumFactory.java index e2bc0e58181..78cc7bc0edf 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapModelModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapModelModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapTransform.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapTransform.java index 01a0121fa05..1be8637d5e0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapTransform.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapTransform.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapTransformEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapTransformEnumFactory.java index 182bde7b192..8a3b54881f7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapTransformEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MapTransformEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MaritalStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MaritalStatus.java index ce25b237072..566a277b6d2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MaritalStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MaritalStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MaritalStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MaritalStatusEnumFactory.java index c5a98e6054f..af433f7131a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MaritalStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MaritalStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MatchGrade.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MatchGrade.java index 3cee32b5164..5531cabd444 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MatchGrade.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MatchGrade.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MatchGradeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MatchGradeEnumFactory.java index 2a848bb84cf..dc34092e7d4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MatchGradeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MatchGradeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureDataUsage.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureDataUsage.java index f50c9502f99..1523c62e9e5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureDataUsage.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureDataUsage.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureDataUsageEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureDataUsageEnumFactory.java index 5a2fd89baa3..522db55a980 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureDataUsageEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureDataUsageEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurePopulation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurePopulation.java index f1c6788f0d8..448b40d0edb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurePopulation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurePopulation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurePopulationEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurePopulationEnumFactory.java index 95e8a70556d..bc54aa48963 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurePopulationEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurePopulationEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportStatus.java index 8fb00c24a6d..05ad1c18f60 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportStatusEnumFactory.java index fbff4cea11f..769b28f04dc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportType.java index a00172edfff..a58adcddcbd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportTypeEnumFactory.java index 833df91d824..280c8a27e86 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureReportTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureScoring.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureScoring.java index 3f7014da050..30343b03e17 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureScoring.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureScoring.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureScoringEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureScoringEnumFactory.java index ecab9730f00..710e9a2b064 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureScoringEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureScoringEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureType.java index 8599bb0d14c..02e1af45c82 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,13 +37,25 @@ import org.hl7.fhir.exceptions.FHIRException; public enum MeasureType { /** - * The measure is a process measure + * A measure which focuses on a process which leads to a certain outcome, meaning that a scientific basis exists for believing that the process, when executed well, will increase the probability of achieving a desired outcome */ PROCESS, /** - * The measure is an outcome measure + * A measure that indicates the result of the performance (or non-performance) of a function or process */ OUTCOME, + /** + * A measure that focuses on a health care provider's capacity, systems, and processes to provide high-quality care + */ + STRUCTURE, + /** + * A measure that focuses on patient-reported information + */ + PATIENTREPORTEDOUTCOME, + /** + * A measure that combines multiple component measures in to a single quality measure + */ + COMPOSITE, /** * added to help the parsers */ @@ -55,12 +67,21 @@ public enum MeasureType { return PROCESS; if ("outcome".equals(codeString)) return OUTCOME; + if ("structure".equals(codeString)) + return STRUCTURE; + if ("patient-reported-outcome".equals(codeString)) + return PATIENTREPORTEDOUTCOME; + if ("composite".equals(codeString)) + return COMPOSITE; throw new FHIRException("Unknown MeasureType code '"+codeString+"'"); } public String toCode() { switch (this) { case PROCESS: return "process"; case OUTCOME: return "outcome"; + case STRUCTURE: return "structure"; + case PATIENTREPORTEDOUTCOME: return "patient-reported-outcome"; + case COMPOSITE: return "composite"; default: return "?"; } } @@ -69,8 +90,11 @@ public enum MeasureType { } public String getDefinition() { switch (this) { - case PROCESS: return "The measure is a process measure"; - case OUTCOME: return "The measure is an outcome measure"; + case PROCESS: return "A measure which focuses on a process which leads to a certain outcome, meaning that a scientific basis exists for believing that the process, when executed well, will increase the probability of achieving a desired outcome"; + case OUTCOME: return "A measure that indicates the result of the performance (or non-performance) of a function or process"; + case STRUCTURE: return "A measure that focuses on a health care provider's capacity, systems, and processes to provide high-quality care"; + case PATIENTREPORTEDOUTCOME: return "A measure that focuses on patient-reported information"; + case COMPOSITE: return "A measure that combines multiple component measures in to a single quality measure"; default: return "?"; } } @@ -78,6 +102,9 @@ public enum MeasureType { switch (this) { case PROCESS: return "Process"; case OUTCOME: return "Outcome"; + case STRUCTURE: return "Structure"; + case PATIENTREPORTEDOUTCOME: return "Patient Reported Outcome"; + case COMPOSITE: return "Composite"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureTypeEnumFactory.java index a92f345b3cc..eb49c093ff6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasureTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -43,6 +43,12 @@ public class MeasureTypeEnumFactory implements EnumFactory { return MeasureType.PROCESS; if ("outcome".equals(codeString)) return MeasureType.OUTCOME; + if ("structure".equals(codeString)) + return MeasureType.STRUCTURE; + if ("patient-reported-outcome".equals(codeString)) + return MeasureType.PATIENTREPORTEDOUTCOME; + if ("composite".equals(codeString)) + return MeasureType.COMPOSITE; throw new IllegalArgumentException("Unknown MeasureType code '"+codeString+"'"); } @@ -51,6 +57,12 @@ public class MeasureTypeEnumFactory implements EnumFactory { return "process"; if (code == MeasureType.OUTCOME) return "outcome"; + if (code == MeasureType.STRUCTURE) + return "structure"; + if (code == MeasureType.PATIENTREPORTEDOUTCOME) + return "patient-reported-outcome"; + if (code == MeasureType.COMPOSITE) + return "composite"; return "?"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurementPrinciple.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurementPrinciple.java index d98ba8fe0e1..4ae8572b667 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurementPrinciple.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurementPrinciple.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurementPrincipleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurementPrincipleEnumFactory.java index d4683db9258..f2e7b988275 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurementPrincipleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MeasurementPrincipleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationAdminStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationAdminStatus.java index a9e53be914c..bef895673ed 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationAdminStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationAdminStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationAdminStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationAdminStatusEnumFactory.java index e22489975cd..61f1e9d3347 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationAdminStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationAdminStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationDispenseStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationDispenseStatus.java index fdd7a397aa8..198bbae6f5f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationDispenseStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationDispenseStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationDispenseStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationDispenseStatusEnumFactory.java index 99b24fbeaee..63c2bd45805 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationDispenseStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationDispenseStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestCategory.java index cbb01ef908a..01abc779170 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestCategoryEnumFactory.java index 6c6da3774a3..088fe617283 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestStatus.java index 915d7a18c1a..03e78ba4312 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestStatusEnumFactory.java index da6f236e11d..f22f473d67f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationRequestStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementCategory.java index e3429321b54..ac65c484329 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementCategoryEnumFactory.java index e3e77001e51..312cd7a5e3c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementNottaken.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementNottaken.java index 2e8f5c08514..eb275a51799 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementNottaken.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementNottaken.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementNottakenEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementNottakenEnumFactory.java index 7cca8257b66..532cf8fddd4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementNottakenEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementNottakenEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementStatus.java index 5115241d7ae..d1f7f894357 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementStatusEnumFactory.java index 4cdf91fc1df..19b5ab835ae 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MedicationStatementStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageEvents.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageEvents.java index 0ce36e8a1cf..dc680fffb0d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageEvents.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageEvents.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -61,7 +61,7 @@ public enum MessageEvents { */ ADMINNOTIFY, /** - * null + * Notification to convey information. */ COMMUNICATIONREQUEST, /** @@ -145,7 +145,7 @@ public enum MessageEvents { case MEDICATIONADMINISTRATIONRECORDING: return "Indicates that a medication has been recorded against the patient's record."; case MEDICATIONADMINISTRATIONUPDATE: return "Update a Medication Administration record."; case ADMINNOTIFY: return "Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use."; - case COMMUNICATIONREQUEST: return ""; + case COMMUNICATIONREQUEST: return "Notification to convey information."; case DIAGNOSTICREPORTPROVIDE: return "Provide a diagnostic report, or update a previously provided diagnostic report."; case OBSERVATIONPROVIDE: return "Provide a simple observation or update a previously provided simple observation."; case PATIENTLINK: return "Notification that two patient records actually identify the same patient."; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageEventsEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageEventsEnumFactory.java index 87d2132e453..ff30140b71e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageEventsEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageEventsEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageReasonEncounter.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageReasonEncounter.java index 04eca11e3a8..5ce80212115 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageReasonEncounter.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageReasonEncounter.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageReasonEncounterEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageReasonEncounterEnumFactory.java index 74ef4e2d95f..609f8680414 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageReasonEncounterEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageReasonEncounterEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageSignificanceCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageSignificanceCategory.java index 1166cbc9121..917208d027e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageSignificanceCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageSignificanceCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageSignificanceCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageSignificanceCategoryEnumFactory.java index a679c423ce9..aaf250923ac 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageSignificanceCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageSignificanceCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageTransport.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageTransport.java index 0b4af817dc2..ec9293b7f99 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageTransport.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageTransport.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageTransportEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageTransportEnumFactory.java index 713a97bc86b..73ad5f21042 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageTransportEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MessageTransportEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationState.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationState.java index b3f1497e8be..0075844c617 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationState.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationState.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationStateEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationStateEnumFactory.java index 4d9c84ec617..4637abf7193 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationStateEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationStateEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationType.java index 7a465171f2b..0951c3ed8fe 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationTypeEnumFactory.java index a50696bc51f..93425402e18 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCalibrationTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCategory.java index 6941d1fdc11..4e5e057a0c9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCategoryEnumFactory.java index 5bfb207b82e..3724b5b64b2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricColor.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricColor.java index 0757d3c5c06..1d542ba1528 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricColor.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricColor.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricColorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricColorEnumFactory.java index 7d18d89f3c1..9aaee5d1f30 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricColorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricColorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricOperationalStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricOperationalStatus.java index a21c178b78d..b73f9882c9b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricOperationalStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricOperationalStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricOperationalStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricOperationalStatusEnumFactory.java index 8d73d6c96c3..0d159dd55ca 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricOperationalStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MetricOperationalStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MissingToothReason.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MissingToothReason.java index fc4c8d84a10..3bc9141e788 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MissingToothReason.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MissingToothReason.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MissingToothReasonEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MissingToothReasonEnumFactory.java index b00e0ddfff4..dccc9945c11 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MissingToothReasonEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/MissingToothReasonEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameAssemblyOrder.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameAssemblyOrder.java new file mode 100644 index 00000000000..816b7604e4e --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameAssemblyOrder.java @@ -0,0 +1,105 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum NameAssemblyOrder { + + /** + * null + */ + NL1, + /** + * null + */ + NL2, + /** + * null + */ + NL3, + /** + * null + */ + NL4, + /** + * added to help the parsers + */ + NULL; + public static NameAssemblyOrder fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("NL1".equals(codeString)) + return NL1; + if ("NL2".equals(codeString)) + return NL2; + if ("NL3".equals(codeString)) + return NL3; + if ("NL4".equals(codeString)) + return NL4; + throw new FHIRException("Unknown NameAssemblyOrder code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case NL1: return "NL1"; + case NL2: return "NL2"; + case NL3: return "NL3"; + case NL4: return "NL4"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/name-assembly-order"; + } + public String getDefinition() { + switch (this) { + case NL1: return ""; + case NL2: return ""; + case NL3: return ""; + case NL4: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NL1: return "Own Name"; + case NL2: return "Partner Name"; + case NL3: return "Partner Name followed by Maiden Name"; + case NL4: return "Own Name followed by Partner Name"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameAssemblyOrderEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameAssemblyOrderEnumFactory.java new file mode 100644 index 00000000000..810dfa2079f --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameAssemblyOrderEnumFactory.java @@ -0,0 +1,70 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class NameAssemblyOrderEnumFactory implements EnumFactory { + + public NameAssemblyOrder fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("NL1".equals(codeString)) + return NameAssemblyOrder.NL1; + if ("NL2".equals(codeString)) + return NameAssemblyOrder.NL2; + if ("NL3".equals(codeString)) + return NameAssemblyOrder.NL3; + if ("NL4".equals(codeString)) + return NameAssemblyOrder.NL4; + throw new IllegalArgumentException("Unknown NameAssemblyOrder code '"+codeString+"'"); + } + + public String toCode(NameAssemblyOrder code) { + if (code == NameAssemblyOrder.NL1) + return "NL1"; + if (code == NameAssemblyOrder.NL2) + return "NL2"; + if (code == NameAssemblyOrder.NL3) + return "NL3"; + if (code == NameAssemblyOrder.NL4) + return "NL4"; + return "?"; + } + + public String toSystem(NameAssemblyOrder code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameUse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameUse.java index 32d73c862d7..3c499b5dcf5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameUse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameUse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -61,7 +61,7 @@ public enum NameUse { */ OLD, /** - * A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically. + * A name used prior to changing name because of marriage. This name use is for use by applications that collect and store names that were used prior to a marriage. Marriage naming customs vary greatly around the world, and are constantly changing. This term is not gender specific. The use of this term does not imply any particular history for a person's name */ MAIDEN, /** @@ -110,7 +110,7 @@ public enum NameUse { case NICKNAME: return "A name that is used to address the person in an informal manner, but is not part of their formal or usual name"; case ANONYMOUS: return "Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons)"; case OLD: return "This name is no longer in use (or was never correct, but retained for records)"; - case MAIDEN: return "A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store \"maiden\" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically."; + case MAIDEN: return "A name used prior to changing name because of marriage. This name use is for use by applications that collect and store names that were used prior to a marriage. Marriage naming customs vary greatly around the world, and are constantly changing. This term is not gender specific. The use of this term does not imply any particular history for a person's name"; default: return "?"; } } @@ -122,7 +122,7 @@ public enum NameUse { case NICKNAME: return "Nickname"; case ANONYMOUS: return "Anonymous"; case OLD: return "Old"; - case MAIDEN: return "Maiden"; + case MAIDEN: return "Name changed for Marriage"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameUseEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameUseEnumFactory.java index d82aa3aafe0..1c2aae92c3e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameUseEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NameUseEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemIdentifierType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemIdentifierType.java index 4c500b2115a..5f9566f63c0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemIdentifierType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemIdentifierType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemIdentifierTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemIdentifierTypeEnumFactory.java index bb0139379eb..0e4e70c66ef 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemIdentifierTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemIdentifierTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemType.java index 1d1d3ed30b5..697978ad474 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemTypeEnumFactory.java index dfbc47413fc..a35227bdc04 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NamingsystemTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NarrativeStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NarrativeStatus.java index d648083e442..ae87a661056 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NarrativeStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NarrativeStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NarrativeStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NarrativeStatusEnumFactory.java index 9eed53aa3d8..452556f8025 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NarrativeStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NarrativeStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NetworkType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NetworkType.java index 0dbf52371ac..2acc96f9417 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NetworkType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NetworkType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NetworkTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NetworkTypeEnumFactory.java index 0dae2ee75f8..6077d6adca6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NetworkTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NetworkTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NoteType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NoteType.java index cd17da4e58d..18763806138 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NoteType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NoteType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NoteTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NoteTypeEnumFactory.java index 3c52103512f..5bbe8baf8d6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NoteTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NoteTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NutritionRequestStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NutritionRequestStatus.java index a3bda4a353a..e3fc3286042 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NutritionRequestStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NutritionRequestStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NutritionRequestStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NutritionRequestStatusEnumFactory.java index 6b04cb17405..5e5a6c7d5c9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NutritionRequestStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/NutritionRequestStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectLifecycle.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectLifecycle.java index f5810767b89..f3fb4009aa1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectLifecycle.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectLifecycle.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectLifecycleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectLifecycleEnumFactory.java index d899379d4a5..0e46e917ee8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectLifecycleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectLifecycleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectRole.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectRole.java index 9f0dc22486a..9b7057f8927 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectRole.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectRole.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectRoleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectRoleEnumFactory.java index c4432f90644..04c44a30af4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectRoleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectRoleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectType.java index a124a4f8989..409ad616bcf 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectTypeEnumFactory.java index 500036a0ff6..551f9030ec6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObjectTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationCategory.java index 88ec8d48496..7c2f5b78af3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationCategoryEnumFactory.java index 2e59869269d..1d76c117074 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationParamcode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationParamcode.java index 28f6c5d7d52..989be1cd469 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationParamcode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationParamcode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationParamcodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationParamcodeEnumFactory.java index 18c5a079724..5f779812b4d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationParamcodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationParamcodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationRelationshiptypes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationRelationshiptypes.java index e07601d4c29..5bd89e7dbc9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationRelationshiptypes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationRelationshiptypes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationRelationshiptypesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationRelationshiptypesEnumFactory.java index c1c8ba83120..4bc2ad9ba7a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationRelationshiptypesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationRelationshiptypesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatistics.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatistics.java new file mode 100644 index 00000000000..d208bcff329 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatistics.java @@ -0,0 +1,231 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum ObservationStatistics { + + /** + * The [mean](https://en.wikipedia.org/wiki/Arithmetic_mean) of N measurements over the stated period + */ + AVERAGE, + /** + * The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N measurements over the stated period + */ + MAXIMUM, + /** + * The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N measurements over the stated period + */ + MINIMUM, + /** + * The [number] of valid measurements over the stated period that contributed to the other statistical outputs + */ + COUNT, + /** + * The total [number] of valid measurements over the stated period, including observations that were ignored because they did not contain valid result values + */ + TOTALCOUNT, + /** + * The [median](https://en.wikipedia.org/wiki/Median) of N measurements over the stated period + */ + MEDIAN, + /** + * The [standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) of N measurements over the stated period + */ + STDDEV, + /** + * The [sum](https://en.wikipedia.org/wiki/Summation) of N measurements over the stated period + */ + SUM, + /** + * The [variance](https://en.wikipedia.org/wiki/Variance) of N measurements over the stated period + */ + VARIANCE, + /** + * The 20th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period + */ + PCT20, + /** + * The 80th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period + */ + PCT80, + /** + * The lower [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period + */ + _4LOWER, + /** + * The upper [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period + */ + _4UPPER, + /** + * The difference between the upper and lower [Quartiles](https://en.wikipedia.org/wiki/Quartile) is called the Interquartile range. (IQR = Q3-Q1) Quartile deviation or Semi-interquartile range is one-half the difference between the first and the third quartiles. + */ + _4DEV, + /** + * The lowest of four values that divide the N measurementsinto a frequency distribution of five classes with each containing one fifth of the total population + */ + _51, + /** + * The second of four values that divide the N measurementsinto a frequency distribution of five classes with each containing one fifth of the total population + */ + _52, + /** + * The third of four values that divide the N measurementsinto a frequency distribution of five classes with each containing one fifth of the total population + */ + _53, + /** + * The fourth of four values that divide the N measurementsinto a frequency distribution of five classes with each containing one fifth of the total population + */ + _54, + /** + * added to help the parsers + */ + NULL; + public static ObservationStatistics fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("average".equals(codeString)) + return AVERAGE; + if ("maximum".equals(codeString)) + return MAXIMUM; + if ("minimum".equals(codeString)) + return MINIMUM; + if ("count".equals(codeString)) + return COUNT; + if ("totalcount".equals(codeString)) + return TOTALCOUNT; + if ("median".equals(codeString)) + return MEDIAN; + if ("std-dev".equals(codeString)) + return STDDEV; + if ("sum".equals(codeString)) + return SUM; + if ("variance".equals(codeString)) + return VARIANCE; + if ("%20".equals(codeString)) + return PCT20; + if ("%80".equals(codeString)) + return PCT80; + if ("4-lower".equals(codeString)) + return _4LOWER; + if ("4-upper".equals(codeString)) + return _4UPPER; + if ("4-dev".equals(codeString)) + return _4DEV; + if ("5-1".equals(codeString)) + return _51; + if ("5-2".equals(codeString)) + return _52; + if ("5-3".equals(codeString)) + return _53; + if ("5-4".equals(codeString)) + return _54; + throw new FHIRException("Unknown ObservationStatistics code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case AVERAGE: return "average"; + case MAXIMUM: return "maximum"; + case MINIMUM: return "minimum"; + case COUNT: return "count"; + case TOTALCOUNT: return "totalcount"; + case MEDIAN: return "median"; + case STDDEV: return "std-dev"; + case SUM: return "sum"; + case VARIANCE: return "variance"; + case PCT20: return "%20"; + case PCT80: return "%80"; + case _4LOWER: return "4-lower"; + case _4UPPER: return "4-upper"; + case _4DEV: return "4-dev"; + case _51: return "5-1"; + case _52: return "5-2"; + case _53: return "5-3"; + case _54: return "5-4"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/observation-statistics"; + } + public String getDefinition() { + switch (this) { + case AVERAGE: return "The [mean](https://en.wikipedia.org/wiki/Arithmetic_mean) of N measurements over the stated period"; + case MAXIMUM: return "The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N measurements over the stated period"; + case MINIMUM: return "The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N measurements over the stated period"; + case COUNT: return "The [number] of valid measurements over the stated period that contributed to the other statistical outputs"; + case TOTALCOUNT: return "The total [number] of valid measurements over the stated period, including observations that were ignored because they did not contain valid result values"; + case MEDIAN: return "The [median](https://en.wikipedia.org/wiki/Median) of N measurements over the stated period"; + case STDDEV: return "The [standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) of N measurements over the stated period"; + case SUM: return "The [sum](https://en.wikipedia.org/wiki/Summation) of N measurements over the stated period"; + case VARIANCE: return "The [variance](https://en.wikipedia.org/wiki/Variance) of N measurements over the stated period"; + case PCT20: return "The 20th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period"; + case PCT80: return "The 80th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period"; + case _4LOWER: return "The lower [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period"; + case _4UPPER: return "The upper [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period"; + case _4DEV: return "The difference between the upper and lower [Quartiles](https://en.wikipedia.org/wiki/Quartile) is called the Interquartile range. (IQR = Q3-Q1) Quartile deviation or Semi-interquartile range is one-half the difference between the first and the third quartiles."; + case _51: return "The lowest of four values that divide the N measurementsinto a frequency distribution of five classes with each containing one fifth of the total population"; + case _52: return "The second of four values that divide the N measurementsinto a frequency distribution of five classes with each containing one fifth of the total population"; + case _53: return "The third of four values that divide the N measurementsinto a frequency distribution of five classes with each containing one fifth of the total population"; + case _54: return "The fourth of four values that divide the N measurementsinto a frequency distribution of five classes with each containing one fifth of the total population"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AVERAGE: return "Average"; + case MAXIMUM: return "Maximum"; + case MINIMUM: return "Minimum"; + case COUNT: return "Count"; + case TOTALCOUNT: return "Total Count"; + case MEDIAN: return "Median"; + case STDDEV: return "standard deviation"; + case SUM: return "sum"; + case VARIANCE: return "variance"; + case PCT20: return "20th percentile"; + case PCT80: return "80th percentile"; + case _4LOWER: return "lower quartile"; + case _4UPPER: return "upper quartile"; + case _4DEV: return "quartile deviation"; + case _51: return "1st quintile"; + case _52: return "2nd quintile"; + case _53: return "3rd quintile"; + case _54: return "4th quintile"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatisticsEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatisticsEnumFactory.java new file mode 100644 index 00000000000..bc3017bd7a4 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatisticsEnumFactory.java @@ -0,0 +1,126 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class ObservationStatisticsEnumFactory implements EnumFactory { + + public ObservationStatistics fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("average".equals(codeString)) + return ObservationStatistics.AVERAGE; + if ("maximum".equals(codeString)) + return ObservationStatistics.MAXIMUM; + if ("minimum".equals(codeString)) + return ObservationStatistics.MINIMUM; + if ("count".equals(codeString)) + return ObservationStatistics.COUNT; + if ("totalcount".equals(codeString)) + return ObservationStatistics.TOTALCOUNT; + if ("median".equals(codeString)) + return ObservationStatistics.MEDIAN; + if ("std-dev".equals(codeString)) + return ObservationStatistics.STDDEV; + if ("sum".equals(codeString)) + return ObservationStatistics.SUM; + if ("variance".equals(codeString)) + return ObservationStatistics.VARIANCE; + if ("%20".equals(codeString)) + return ObservationStatistics.PCT20; + if ("%80".equals(codeString)) + return ObservationStatistics.PCT80; + if ("4-lower".equals(codeString)) + return ObservationStatistics._4LOWER; + if ("4-upper".equals(codeString)) + return ObservationStatistics._4UPPER; + if ("4-dev".equals(codeString)) + return ObservationStatistics._4DEV; + if ("5-1".equals(codeString)) + return ObservationStatistics._51; + if ("5-2".equals(codeString)) + return ObservationStatistics._52; + if ("5-3".equals(codeString)) + return ObservationStatistics._53; + if ("5-4".equals(codeString)) + return ObservationStatistics._54; + throw new IllegalArgumentException("Unknown ObservationStatistics code '"+codeString+"'"); + } + + public String toCode(ObservationStatistics code) { + if (code == ObservationStatistics.AVERAGE) + return "average"; + if (code == ObservationStatistics.MAXIMUM) + return "maximum"; + if (code == ObservationStatistics.MINIMUM) + return "minimum"; + if (code == ObservationStatistics.COUNT) + return "count"; + if (code == ObservationStatistics.TOTALCOUNT) + return "totalcount"; + if (code == ObservationStatistics.MEDIAN) + return "median"; + if (code == ObservationStatistics.STDDEV) + return "std-dev"; + if (code == ObservationStatistics.SUM) + return "sum"; + if (code == ObservationStatistics.VARIANCE) + return "variance"; + if (code == ObservationStatistics.PCT20) + return "%20"; + if (code == ObservationStatistics.PCT80) + return "%80"; + if (code == ObservationStatistics._4LOWER) + return "4-lower"; + if (code == ObservationStatistics._4UPPER) + return "4-upper"; + if (code == ObservationStatistics._4DEV) + return "4-dev"; + if (code == ObservationStatistics._51) + return "5-1"; + if (code == ObservationStatistics._52) + return "5-2"; + if (code == ObservationStatistics._53) + return "5-3"; + if (code == ObservationStatistics._54) + return "5-4"; + return "?"; + } + + public String toSystem(ObservationStatistics code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatus.java index 0b5623dc613..98788038804 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatusEnumFactory.java index 42bdd4d332d..6bc9968622b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ObservationStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceCodes.java index 1efbd46ae4e..945aa6ed55f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceCodesEnumFactory.java index 45dceb4f25d..652dc6695e1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceSpanCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceSpanCodes.java index a82a8a86e10..54eabe5341c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceSpanCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceSpanCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceSpanCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceSpanCodesEnumFactory.java index d3b15177e3b..a53940862f0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceSpanCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OccurrenceSpanCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationKind.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationKind.java index 1fa3064d3f9..a7c0d9b5a7e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationKind.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationKind.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationKindEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationKindEnumFactory.java index 64dda6e299f..723a7864473 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationKindEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationKindEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationOutcome.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationOutcome.java index eb84036ea11..4c9c330800d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationOutcome.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationOutcome.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationOutcomeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationOutcomeEnumFactory.java index f54b5c1dade..ac00ec3cc69 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationOutcomeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationOutcomeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationParameterUse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationParameterUse.java index bdabbda89d2..8a770aa21ad 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationParameterUse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationParameterUse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationParameterUseEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationParameterUseEnumFactory.java index c7711edbce6..4344358839c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationParameterUseEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OperationParameterUseEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OralProsthodonticMaterial.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OralProsthodonticMaterial.java index fc5b4479f1d..2910c9ec430 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OralProsthodonticMaterial.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OralProsthodonticMaterial.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OralProsthodonticMaterialEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OralProsthodonticMaterialEnumFactory.java index b96525b0ad9..be1dbe51d61 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OralProsthodonticMaterialEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OralProsthodonticMaterialEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OrganizationType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OrganizationType.java index d51042fa427..6b1527fbdc4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OrganizationType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OrganizationType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OrganizationTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OrganizationTypeEnumFactory.java index 95b23311a93..0927d643658 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OrganizationTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/OrganizationTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Participantrequired.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Participantrequired.java index 949b65cee04..06543b8fc48 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Participantrequired.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Participantrequired.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ParticipantrequiredEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ParticipantrequiredEnumFactory.java index 8648e6f8899..41df7480eba 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ParticipantrequiredEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ParticipantrequiredEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Participationstatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Participationstatus.java index 1620e518e6d..64070b604d9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Participationstatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Participationstatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ParticipationstatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ParticipationstatusEnumFactory.java index 09404ef6f3f..37517a4a3c9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ParticipationstatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ParticipationstatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PatientMpiMatch.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PatientMpiMatch.java index 67671b700ad..efd84126b7e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PatientMpiMatch.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PatientMpiMatch.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PatientMpiMatchEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PatientMpiMatchEnumFactory.java index 5c5da432e74..3451d740e04 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PatientMpiMatchEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PatientMpiMatchEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Payeetype.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Payeetype.java index 8d1cc02ec3e..3299e620aff 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Payeetype.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Payeetype.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PayeetypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PayeetypeEnumFactory.java index 813bb6f8028..7be5cffb42b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PayeetypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PayeetypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentAdjustmentReason.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentAdjustmentReason.java index b60864d3ff8..aa1c0773021 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentAdjustmentReason.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentAdjustmentReason.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentAdjustmentReasonEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentAdjustmentReasonEnumFactory.java index 4ebf93bb586..d05a2088228 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentAdjustmentReasonEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentAdjustmentReasonEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentStatus.java index 797c7ee0922..2b5f035675b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,11 +37,11 @@ import org.hl7.fhir.exceptions.FHIRException; public enum PaymentStatus { /** - * null + * The payment has been sent physically or electronically. */ PAID, /** - * null + * The payment has been received by the payee. */ CLEARED, /** @@ -69,15 +69,15 @@ public enum PaymentStatus { } public String getDefinition() { switch (this) { - case PAID: return ""; - case CLEARED: return ""; + case PAID: return "The payment has been sent physically or electronically."; + case CLEARED: return "The payment has been received by the payee."; default: return "?"; } } public String getDisplay() { switch (this) { - case PAID: return "paid"; - case CLEARED: return "cleared"; + case PAID: return "Paid"; + case CLEARED: return "Cleared"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentStatusEnumFactory.java index 916aef6a6a3..070e17afbba 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentType.java index 59cdcd9053a..ed7ebbd70ff 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,15 +37,15 @@ import org.hl7.fhir.exceptions.FHIRException; public enum PaymentType { /** - * null + * The amount is partial or complete settlement of the amounts due. */ PAYMENT, /** - * null + * The amount is an adjustment regarding claims already paid. */ ADJUSTMENT, /** - * null + * The amount is an advance against future claims. */ ADVANCE, /** @@ -76,17 +76,17 @@ public enum PaymentType { } public String getDefinition() { switch (this) { - case PAYMENT: return ""; - case ADJUSTMENT: return ""; - case ADVANCE: return ""; + case PAYMENT: return "The amount is partial or complete settlement of the amounts due."; + case ADJUSTMENT: return "The amount is an adjustment regarding claims already paid."; + case ADVANCE: return "The amount is an advance against future claims."; default: return "?"; } } public String getDisplay() { switch (this) { - case PAYMENT: return "payment"; - case ADJUSTMENT: return "adjustment"; - case ADVANCE: return "advance"; + case PAYMENT: return "Payment"; + case ADJUSTMENT: return "Adjustment"; + case ADVANCE: return "Advance"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentTypeEnumFactory.java index 2e627d20495..3416f95f902 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentnoticeStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentnoticeStatus.java index c78a16bf171..0a3dca653ac 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentnoticeStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentnoticeStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentnoticeStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentnoticeStatusEnumFactory.java index e637f8beb94..ff2933fa52d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentnoticeStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentnoticeStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentreconciliationStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentreconciliationStatus.java index 89575ea4b27..0827183871f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentreconciliationStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentreconciliationStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentreconciliationStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentreconciliationStatusEnumFactory.java index 71bc1f339df..b0663921cf1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentreconciliationStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PaymentreconciliationStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PlanDefinitionType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PlanDefinitionType.java index 77953e228b9..cd4374f0542 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PlanDefinitionType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PlanDefinitionType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PlanDefinitionTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PlanDefinitionTypeEnumFactory.java index 7b7865e79f7..95f1353c5eb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PlanDefinitionTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PlanDefinitionTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PolicyholderRelationship.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PolicyholderRelationship.java index c07eb8ca407..46cc83db038 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PolicyholderRelationship.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PolicyholderRelationship.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PolicyholderRelationshipEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PolicyholderRelationshipEnumFactory.java index d559fc0ce53..42f1fc04fe9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PolicyholderRelationshipEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PolicyholderRelationshipEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerRole.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerRole.java index 945b8cc2766..c3dd88c8bc0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerRole.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerRole.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerRoleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerRoleEnumFactory.java index 3c57bdae18a..04d1bd43abb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerRoleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerRoleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerSpecialty.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerSpecialty.java index 72beb5b16ae..38b7db09859 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerSpecialty.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerSpecialty.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerSpecialtyEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerSpecialtyEnumFactory.java index 50f74d79630..6852c3fd6e8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerSpecialtyEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PractitionerSpecialtyEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureProgressStatusCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureProgressStatusCodes.java index 5457306bcc1..f8867125b91 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureProgressStatusCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureProgressStatusCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureProgressStatusCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureProgressStatusCodesEnumFactory.java index 1605cb8640e..54c2ef7ca8e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureProgressStatusCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureProgressStatusCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRelationshipType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRelationshipType.java index 7f5d0547615..630e0f691d8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRelationshipType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRelationshipType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRelationshipTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRelationshipTypeEnumFactory.java index e7562b50868..a1fb7c1910e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRelationshipTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRelationshipTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestPriority.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestPriority.java index df9717d0af0..88158b8a367 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestPriority.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestPriority.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestPriorityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestPriorityEnumFactory.java index 8ac18797396..6009e2b233b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestPriorityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestPriorityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestStatus.java index f262daf0fc3..b6c06c95dda 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestStatusEnumFactory.java index 3cfc7aa4680..15667a9c3c0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureRequestStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureStatus.java index 3cc19618fb9..129d21042b7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureStatusEnumFactory.java index 7c3fc748a4a..61296116ebf 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcedureStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessOutcome.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessOutcome.java index 9b03d2d6fdf..b2107461c2c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessOutcome.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessOutcome.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,15 +37,15 @@ import org.hl7.fhir.exceptions.FHIRException; public enum ProcessOutcome { /** - * null + * The requested processing has completed. */ COMPLETE, /** - * null + * The requested processing has been suspended. */ PENDED, /** - * null + * The requested processing has terminated with some errors being found. */ ERROR, /** @@ -76,17 +76,17 @@ public enum ProcessOutcome { } public String getDefinition() { switch (this) { - case COMPLETE: return ""; - case PENDED: return ""; - case ERROR: return ""; + case COMPLETE: return "The requested processing has completed."; + case PENDED: return "The requested processing has been suspended."; + case ERROR: return "The requested processing has terminated with some errors being found."; default: return "?"; } } public String getDisplay() { switch (this) { - case COMPLETE: return "complete"; - case PENDED: return "pended"; - case ERROR: return "error"; + case COMPLETE: return "Complete"; + case PENDED: return "Pended"; + case ERROR: return "Error"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessOutcomeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessOutcomeEnumFactory.java index 1ee4ac5c7c3..7d1ee5ff3d3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessOutcomeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessOutcomeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessPriority.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessPriority.java index 496d099ff2d..7331ab9e131 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessPriority.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessPriority.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessPriorityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessPriorityEnumFactory.java index 5a9ea13bc6a..0f7271554f3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessPriorityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessPriorityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessrequestStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessrequestStatus.java index 6d7c0eed8b6..3f7878ddf5d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessrequestStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessrequestStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessrequestStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessrequestStatusEnumFactory.java index a5365aada0b..41b852e1ddc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessrequestStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessrequestStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessresponseStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessresponseStatus.java index 751c87c6b90..b0465ff6856 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessresponseStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessresponseStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessresponseStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessresponseStatusEnumFactory.java index 91d5f9c8987..4ca9ac69d4d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessresponseStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProcessresponseStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PropertyRepresentation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PropertyRepresentation.java index 150a5f28909..d7a1aa4d07f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PropertyRepresentation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PropertyRepresentation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PropertyRepresentationEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PropertyRepresentationEnumFactory.java index fae38803a3a..920f96c0c49 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PropertyRepresentationEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PropertyRepresentationEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentRole.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentRole.java index d8c8f774e0e..6cafe60efd6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentRole.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentRole.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentRoleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentRoleEnumFactory.java index 7a53e97fdea..d1f7e79e06b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentRoleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentRoleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentType.java index a88abddc29e..bb5fdf8d422 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentTypeEnumFactory.java index e07c94c754f..272927d12ed 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceAgentTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceEntityRole.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceEntityRole.java index 1429cecb1d8..6a531a5faba 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceEntityRole.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceEntityRole.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceEntityRoleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceEntityRoleEnumFactory.java index 9d4e0069713..5633ff04e2c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceEntityRoleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProvenanceEntityRoleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProviderQualification.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProviderQualification.java index 7c6fce58980..13bef3bd109 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProviderQualification.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProviderQualification.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProviderQualificationEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProviderQualificationEnumFactory.java index 27f26fe75b4..5cce6e37514 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProviderQualificationEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ProviderQualificationEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PublicationStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PublicationStatus.java index 81562ab8ee5..61bcfae0c85 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PublicationStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PublicationStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PublicationStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PublicationStatusEnumFactory.java index 10b602c6ada..ea53fd99d4b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PublicationStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/PublicationStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QualityType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QualityType.java new file mode 100644 index 00000000000..d5e9ff89b00 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QualityType.java @@ -0,0 +1,96 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum QualityType { + + /** + * INDEL Comparison + */ + INDEL, + /** + * SNP Comparison + */ + SNP, + /** + * UNKNOWN Comparison + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + public static QualityType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("INDEL".equals(codeString)) + return INDEL; + if ("SNP".equals(codeString)) + return SNP; + if ("UNKNOWN".equals(codeString)) + return UNKNOWN; + throw new FHIRException("Unknown QualityType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case INDEL: return "INDEL"; + case SNP: return "SNP"; + case UNKNOWN: return "UNKNOWN"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/quality-type"; + } + public String getDefinition() { + switch (this) { + case INDEL: return "INDEL Comparison"; + case SNP: return "SNP Comparison"; + case UNKNOWN: return "UNKNOWN Comparison"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INDEL: return "INDEL Comparison"; + case SNP: return "SNP Comparison"; + case UNKNOWN: return "UNKNOWN Comparison"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QualityTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QualityTypeEnumFactory.java new file mode 100644 index 00000000000..3ac38c8020b --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QualityTypeEnumFactory.java @@ -0,0 +1,66 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class QualityTypeEnumFactory implements EnumFactory { + + public QualityType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("INDEL".equals(codeString)) + return QualityType.INDEL; + if ("SNP".equals(codeString)) + return QualityType.SNP; + if ("UNKNOWN".equals(codeString)) + return QualityType.UNKNOWN; + throw new IllegalArgumentException("Unknown QualityType code '"+codeString+"'"); + } + + public String toCode(QualityType code) { + if (code == QualityType.INDEL) + return "INDEL"; + if (code == QualityType.SNP) + return "SNP"; + if (code == QualityType.UNKNOWN) + return "UNKNOWN"; + return "?"; + } + + public String toSystem(QualityType code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuantityComparator.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuantityComparator.java index eaa79f04c4e..7f417f1b3ec 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuantityComparator.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuantityComparator.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuantityComparatorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuantityComparatorEnumFactory.java index 9d83d757a3b..7563a0eab1a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuantityComparatorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuantityComparatorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionMaxOccurs.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionMaxOccurs.java index 7408d9edf96..e26faee3666 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionMaxOccurs.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionMaxOccurs.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionMaxOccursEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionMaxOccursEnumFactory.java index 33c3b44e6f6..9216190deab 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionMaxOccursEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionMaxOccursEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireAnswersStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireAnswersStatus.java index eb310c68f4b..620ece531f3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireAnswersStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireAnswersStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireAnswersStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireAnswersStatusEnumFactory.java index 4b982a0751a..17babd70b47 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireAnswersStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireAnswersStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireDisplayCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireDisplayCategory.java index 690525ca4fd..42894eb8c08 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireDisplayCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireDisplayCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireDisplayCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireDisplayCategoryEnumFactory.java index ca3671c0c78..c14bea3f381 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireDisplayCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireDisplayCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControl.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControl.java index 5cd17e650d6..bea7c21d043 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControl.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControl.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControlEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControlEnumFactory.java index a007defd360..cbdc71d58a1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControlEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControlEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireStatus.java index 5cfdaf3f3b9..502a665a163 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireStatusEnumFactory.java index c17dac9f105..e1880853eb0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireUsageMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireUsageMode.java index 7632bb84ed6..1114d61c599 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireUsageMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireUsageMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireUsageModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireUsageModeEnumFactory.java index 5e2185a66c4..3afc855e32d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireUsageModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireUsageModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventCertainty.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventCertainty.java index a821b88e73d..51cbb68def5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventCertainty.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventCertainty.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventCertaintyEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventCertaintyEnumFactory.java index bfc0347b169..6b48912d07f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventCertaintyEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventCertaintyEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventSeverity.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventSeverity.java index c0f8e354e3a..372ff2f090b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventSeverity.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventSeverity.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventSeverityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventSeverityEnumFactory.java index 714876d002b..b83e41a800d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventSeverityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReactionEventSeverityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationGivenCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationGivenCodes.java index a44feb53756..435422ed070 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationGivenCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationGivenCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationGivenCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationGivenCodesEnumFactory.java index e384e52f190..a5a6f8a6eac 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationGivenCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationGivenCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationNotGivenCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationNotGivenCodes.java index e54e7c7635b..cb5c1a43da3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationNotGivenCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationNotGivenCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationNotGivenCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationNotGivenCodesEnumFactory.java index d280370e0ac..332df30c942 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationNotGivenCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReasonMedicationNotGivenCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceHandlingPolicy.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceHandlingPolicy.java index e05b9284682..28bbcf494af 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceHandlingPolicy.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceHandlingPolicy.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceHandlingPolicyEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceHandlingPolicyEnumFactory.java index fad4ec638d3..bd054eb58c9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceHandlingPolicyEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceHandlingPolicyEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceVersionRules.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceVersionRules.java index a5f2ad31491..3afc3c4ef35 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceVersionRules.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceVersionRules.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceVersionRulesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceVersionRulesEnumFactory.java index 7807d225233..df3696e237b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceVersionRulesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferenceVersionRulesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferencerangeMeaning.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferencerangeMeaning.java index f18576fdb80..edcde892b54 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferencerangeMeaning.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferencerangeMeaning.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferencerangeMeaningEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferencerangeMeaningEnumFactory.java index d4247dd7192..bb9aa6f3fb7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferencerangeMeaningEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferencerangeMeaningEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Referralcategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Referralcategory.java index 05076cbea70..4f59e0999ec 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Referralcategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Referralcategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferralcategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferralcategoryEnumFactory.java index a5268350c88..af02e87b530 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferralcategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferralcategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Referralstatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Referralstatus.java index d2230c26223..b789f3a1f48 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Referralstatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Referralstatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferralstatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferralstatusEnumFactory.java index 9eb9f58e06b..e25da1855cb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferralstatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReferralstatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedArtifactType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedArtifactType.java index 3b43e702712..696f79afc47 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedArtifactType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedArtifactType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedArtifactTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedArtifactTypeEnumFactory.java index e2f1e5c2738..41d2bc3fa76 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedArtifactTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedArtifactTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedClaimRelationship.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedClaimRelationship.java index 521048acda6..6c034d486ed 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedClaimRelationship.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedClaimRelationship.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedClaimRelationshipEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedClaimRelationshipEnumFactory.java index c42ee79802e..fda126b7e63 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedClaimRelationshipEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelatedClaimRelationshipEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Relationship.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Relationship.java index 286a5342130..5803a839204 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Relationship.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Relationship.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelationshipEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelationshipEnumFactory.java index badc0df3902..249edbd3359 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelationshipEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RelationshipEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RemittanceOutcome.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RemittanceOutcome.java index 0492ded37f2..7927185b320 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RemittanceOutcome.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RemittanceOutcome.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RemittanceOutcomeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RemittanceOutcomeEnumFactory.java index 87291916eac..c4a593c7ada 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RemittanceOutcomeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RemittanceOutcomeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportParticipantType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportParticipantType.java index a7627e719e2..efcdaa9417e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportParticipantType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportParticipantType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportParticipantTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportParticipantTypeEnumFactory.java index 9f59f51a6fc..73c3fc5b651 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportParticipantTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportParticipantTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportResultCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportResultCodes.java index 6eaf053addf..2fb1e38343d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportResultCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportResultCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportResultCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportResultCodesEnumFactory.java index d64b0948de2..8442c185261 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportResultCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportResultCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportStatusCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportStatusCodes.java index c180023b8df..43028b03390 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportStatusCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportStatusCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportStatusCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportStatusCodesEnumFactory.java index 76d72195ae7..cd0f95e4a92 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportStatusCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ReportStatusCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RepositoryType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RepositoryType.java new file mode 100644 index 00000000000..354d8b2740d --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RepositoryType.java @@ -0,0 +1,114 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum RepositoryType { + + /** + * When url is clicked, the resource can be seen directly (by webpage or by download link format) + */ + DIRECTLINK, + /** + * When the api method (e.g. [base_url]/[parameter]) related with the url website is executed, the resource can be seen directly (usually in json or xml format) + */ + OPENAPI, + /** + * When logged into the website, the resource can be seen. + */ + LOGIN, + /** + * When logged in and follow the API in the website related with url, the resource can be seen. + */ + OAUTH, + /** + * Some other complicated or particular way to get resource from url. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + public static RepositoryType fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("directlink".equals(codeString)) + return DIRECTLINK; + if ("openapi".equals(codeString)) + return OPENAPI; + if ("login".equals(codeString)) + return LOGIN; + if ("oauth".equals(codeString)) + return OAUTH; + if ("other".equals(codeString)) + return OTHER; + throw new FHIRException("Unknown RepositoryType code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DIRECTLINK: return "directlink"; + case OPENAPI: return "openapi"; + case LOGIN: return "login"; + case OAUTH: return "oauth"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/repository-type"; + } + public String getDefinition() { + switch (this) { + case DIRECTLINK: return "When url is clicked, the resource can be seen directly (by webpage or by download link format)"; + case OPENAPI: return "When the api method (e.g. [base_url]/[parameter]) related with the url website is executed, the resource can be seen directly (usually in json or xml format)"; + case LOGIN: return "When logged into the website, the resource can be seen."; + case OAUTH: return "When logged in and follow the API in the website related with url, the resource can be seen."; + case OTHER: return "Some other complicated or particular way to get resource from url."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DIRECTLINK: return "Click and see"; + case OPENAPI: return "The url is the RESTful or other kind of API that can get access to the result."; + case LOGIN: return "Result cannot be access unless an account is logged in"; + case OAUTH: return "Result need to be fetched with API and need LOGIN( or cookies is required when visit the link of resource)"; + case OTHER: return "Some other complicated or particular way to get resource from url."; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RepositoryTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RepositoryTypeEnumFactory.java new file mode 100644 index 00000000000..39634701811 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RepositoryTypeEnumFactory.java @@ -0,0 +1,74 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class RepositoryTypeEnumFactory implements EnumFactory { + + public RepositoryType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("directlink".equals(codeString)) + return RepositoryType.DIRECTLINK; + if ("openapi".equals(codeString)) + return RepositoryType.OPENAPI; + if ("login".equals(codeString)) + return RepositoryType.LOGIN; + if ("oauth".equals(codeString)) + return RepositoryType.OAUTH; + if ("other".equals(codeString)) + return RepositoryType.OTHER; + throw new IllegalArgumentException("Unknown RepositoryType code '"+codeString+"'"); + } + + public String toCode(RepositoryType code) { + if (code == RepositoryType.DIRECTLINK) + return "directlink"; + if (code == RepositoryType.OPENAPI) + return "openapi"; + if (code == RepositoryType.LOGIN) + return "login"; + if (code == RepositoryType.OAUTH) + return "oauth"; + if (code == RepositoryType.OTHER) + return "other"; + return "?"; + } + + public String toSystem(RepositoryType code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestIntent.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestIntent.java new file mode 100644 index 00000000000..463f8d397f3 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestIntent.java @@ -0,0 +1,143 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum RequestIntent { + + /** + * The request is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act + */ + PROPOSAL, + /** + * The request represents an intension to ensure something occurs without providing an authorization for others to act + */ + PLAN, + /** + * The request represents a request/demand and authorization for action + */ + ORDER, + /** + * The request represents an original authorization for action + */ + ORIGINALORDER, + /** + * The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization + */ + REFLEXORDER, + /** + * The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order + */ + FILLERORDER, + /** + * An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence. E.g. The administration of a single dose of a drug. + */ + INSTANCEORDER, + /** + * The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests. + +Refer to [[[RequestGroup]]] for additional information on how this status is used + */ + OPTION, + /** + * added to help the parsers + */ + NULL; + public static RequestIntent fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return PROPOSAL; + if ("plan".equals(codeString)) + return PLAN; + if ("order".equals(codeString)) + return ORDER; + if ("original-order".equals(codeString)) + return ORIGINALORDER; + if ("reflex-order".equals(codeString)) + return REFLEXORDER; + if ("filler-order".equals(codeString)) + return FILLERORDER; + if ("instance-order".equals(codeString)) + return INSTANCEORDER; + if ("option".equals(codeString)) + return OPTION; + throw new FHIRException("Unknown RequestIntent code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case PROPOSAL: return "proposal"; + case PLAN: return "plan"; + case ORDER: return "order"; + case ORIGINALORDER: return "original-order"; + case REFLEXORDER: return "reflex-order"; + case FILLERORDER: return "filler-order"; + case INSTANCEORDER: return "instance-order"; + case OPTION: return "option"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/request-intent"; + } + public String getDefinition() { + switch (this) { + case PROPOSAL: return "The request is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act"; + case PLAN: return "The request represents an intension to ensure something occurs without providing an authorization for others to act"; + case ORDER: return "The request represents a request/demand and authorization for action"; + case ORIGINALORDER: return "The request represents an original authorization for action"; + case REFLEXORDER: return "The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization"; + case FILLERORDER: return "The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order"; + case INSTANCEORDER: return "An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence. E.g. The administration of a single dose of a drug."; + case OPTION: return "The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.\n\nRefer to [[[RequestGroup]]] for additional information on how this status is used"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSAL: return "Proposal"; + case PLAN: return "Plan"; + case ORDER: return "Order"; + case ORIGINALORDER: return "Original Order"; + case REFLEXORDER: return "Reflex Order"; + case FILLERORDER: return "Filler Order"; + case INSTANCEORDER: return "Instance Order"; + case OPTION: return "Option"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestIntentEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestIntentEnumFactory.java new file mode 100644 index 00000000000..0acaa8e235f --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestIntentEnumFactory.java @@ -0,0 +1,86 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class RequestIntentEnumFactory implements EnumFactory { + + public RequestIntent fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("proposal".equals(codeString)) + return RequestIntent.PROPOSAL; + if ("plan".equals(codeString)) + return RequestIntent.PLAN; + if ("order".equals(codeString)) + return RequestIntent.ORDER; + if ("original-order".equals(codeString)) + return RequestIntent.ORIGINALORDER; + if ("reflex-order".equals(codeString)) + return RequestIntent.REFLEXORDER; + if ("filler-order".equals(codeString)) + return RequestIntent.FILLERORDER; + if ("instance-order".equals(codeString)) + return RequestIntent.INSTANCEORDER; + if ("option".equals(codeString)) + return RequestIntent.OPTION; + throw new IllegalArgumentException("Unknown RequestIntent code '"+codeString+"'"); + } + + public String toCode(RequestIntent code) { + if (code == RequestIntent.PROPOSAL) + return "proposal"; + if (code == RequestIntent.PLAN) + return "plan"; + if (code == RequestIntent.ORDER) + return "order"; + if (code == RequestIntent.ORIGINALORDER) + return "original-order"; + if (code == RequestIntent.REFLEXORDER) + return "reflex-order"; + if (code == RequestIntent.FILLERORDER) + return "filler-order"; + if (code == RequestIntent.INSTANCEORDER) + return "instance-order"; + if (code == RequestIntent.OPTION) + return "option"; + return "?"; + } + + public String toSystem(RequestIntent code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestPriority.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestPriority.java index 3dbf61d634a..e5dcabb8748 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestPriority.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestPriority.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestPriorityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestPriorityEnumFactory.java index d62b81b8089..59c35ee0153 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestPriorityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestPriorityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStage.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStage.java index 9100ea959a7..4c9f5c3f8bc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStage.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStage.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStageEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStageEnumFactory.java index 9e660eeabd8..9e7cd456d25 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStageEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStageEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStatus.java index 9585e012892..10476cf7419 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -37,29 +37,33 @@ import org.hl7.fhir.exceptions.FHIRException; public enum RequestStatus { /** - * The request is in preliminary form prior to being sent. + * The request has been created but is not yet complete or ready for action */ DRAFT, /** - * The request is complete and is ready for fulfillment. + * The request is ready to be acted upon */ ACTIVE, /** - * The request has been held by originating system/user request. + * The authorization/request to act has been temporarily withdrawn but is expected to resume in the future */ SUSPENDED, /** - * The work has been completed, the report(s) released, and no further work is planned. + * The authorization/request to act has been terminated prior to the full completion of the intended actions. No further activity should occur. + */ + CANCELLED, + /** + * Activity against the request has been sufficiently completed to the satisfaction of the requester */ COMPLETED, /** - * The request was entered in error and voided. + * This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be "cancelled" rather than "entered-in-error".) */ ENTEREDINERROR, /** - * The request has been withdrawn. + * The authoring system does not know which of the status values currently applies for this request */ - CANCELLED, + UNKNOWN, /** * added to help the parsers */ @@ -73,12 +77,14 @@ public enum RequestStatus { return ACTIVE; if ("suspended".equals(codeString)) return SUSPENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; if ("completed".equals(codeString)) return COMPLETED; if ("entered-in-error".equals(codeString)) return ENTEREDINERROR; - if ("cancelled".equals(codeString)) - return CANCELLED; + if ("unknown".equals(codeString)) + return UNKNOWN; throw new FHIRException("Unknown RequestStatus code '"+codeString+"'"); } public String toCode() { @@ -86,9 +92,10 @@ public enum RequestStatus { case DRAFT: return "draft"; case ACTIVE: return "active"; case SUSPENDED: return "suspended"; + case CANCELLED: return "cancelled"; case COMPLETED: return "completed"; case ENTEREDINERROR: return "entered-in-error"; - case CANCELLED: return "cancelled"; + case UNKNOWN: return "unknown"; default: return "?"; } } @@ -97,12 +104,13 @@ public enum RequestStatus { } public String getDefinition() { switch (this) { - case DRAFT: return "The request is in preliminary form prior to being sent."; - case ACTIVE: return "The request is complete and is ready for fulfillment."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case COMPLETED: return "The work has been completed, the report(s) released, and no further work is planned."; - case ENTEREDINERROR: return "The request was entered in error and voided."; - case CANCELLED: return "The request has been withdrawn."; + case DRAFT: return "The request has been created but is not yet complete or ready for action"; + case ACTIVE: return "The request is ready to be acted upon"; + case SUSPENDED: return "The authorization/request to act has been temporarily withdrawn but is expected to resume in the future"; + case CANCELLED: return "The authorization/request to act has been terminated prior to the full completion of the intended actions. No further activity should occur."; + case COMPLETED: return "Activity against the request has been sufficiently completed to the satisfaction of the requester"; + case ENTEREDINERROR: return "This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".)"; + case UNKNOWN: return "The authoring system does not know which of the status values currently applies for this request"; default: return "?"; } } @@ -111,9 +119,10 @@ public enum RequestStatus { case DRAFT: return "Draft"; case ACTIVE: return "Active"; case SUSPENDED: return "Suspended"; + case CANCELLED: return "Cancelled"; case COMPLETED: return "Completed"; case ENTEREDINERROR: return "Entered in Error"; - case CANCELLED: return "Cancelled"; + case UNKNOWN: return "Unknown"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStatusEnumFactory.java index 89d9510a949..7b813d59189 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RequestStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -45,12 +45,14 @@ public class RequestStatusEnumFactory implements EnumFactory { return RequestStatus.ACTIVE; if ("suspended".equals(codeString)) return RequestStatus.SUSPENDED; + if ("cancelled".equals(codeString)) + return RequestStatus.CANCELLED; if ("completed".equals(codeString)) return RequestStatus.COMPLETED; if ("entered-in-error".equals(codeString)) return RequestStatus.ENTEREDINERROR; - if ("cancelled".equals(codeString)) - return RequestStatus.CANCELLED; + if ("unknown".equals(codeString)) + return RequestStatus.UNKNOWN; throw new IllegalArgumentException("Unknown RequestStatus code '"+codeString+"'"); } @@ -61,12 +63,14 @@ public class RequestStatusEnumFactory implements EnumFactory { return "active"; if (code == RequestStatus.SUSPENDED) return "suspended"; + if (code == RequestStatus.CANCELLED) + return "cancelled"; if (code == RequestStatus.COMPLETED) return "completed"; if (code == RequestStatus.ENTEREDINERROR) return "entered-in-error"; - if (code == RequestStatus.CANCELLED) - return "cancelled"; + if (code == RequestStatus.UNKNOWN) + return "unknown"; return "?"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchStudyStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchStudyStatus.java new file mode 100644 index 00000000000..094bf6e59dd --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchStudyStatus.java @@ -0,0 +1,123 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum ResearchStudyStatus { + + /** + * The study is undergoing design but the process of selecting study subjects and capturing data has not yet begun. + */ + DRAFT, + /** + * The study is currently being executed + */ + INPROGRESS, + /** + * Execution of the study has been temporarily paused + */ + SUSPENDED, + /** + * The study was terminated prior to the final determination of results + */ + STOPPED, + /** + * The information sought by the study has been gathered and compiled and no further work is being performed + */ + COMPLETED, + /** + * This study never actually existed. The record is retained for tracking purposes in the event decisions may have been made based on this erroneous information. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + public static ResearchStudyStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("in-progress".equals(codeString)) + return INPROGRESS; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("stopped".equals(codeString)) + return STOPPED; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; + throw new FHIRException("Unknown ResearchStudyStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case INPROGRESS: return "in-progress"; + case SUSPENDED: return "suspended"; + case STOPPED: return "stopped"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/research-study-status"; + } + public String getDefinition() { + switch (this) { + case DRAFT: return "The study is undergoing design but the process of selecting study subjects and capturing data has not yet begun."; + case INPROGRESS: return "The study is currently being executed"; + case SUSPENDED: return "Execution of the study has been temporarily paused"; + case STOPPED: return "The study was terminated prior to the final determination of results"; + case COMPLETED: return "The information sought by the study has been gathered and compiled and no further work is being performed"; + case ENTEREDINERROR: return "This study never actually existed. The record is retained for tracking purposes in the event decisions may have been made based on this erroneous information."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case INPROGRESS: return "In-progress"; + case SUSPENDED: return "Suspended"; + case STOPPED: return "Stopped"; + case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in error"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchStudyStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchStudyStatusEnumFactory.java new file mode 100644 index 00000000000..fb0e2a7de1b --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchStudyStatusEnumFactory.java @@ -0,0 +1,78 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class ResearchStudyStatusEnumFactory implements EnumFactory { + + public ResearchStudyStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ResearchStudyStatus.DRAFT; + if ("in-progress".equals(codeString)) + return ResearchStudyStatus.INPROGRESS; + if ("suspended".equals(codeString)) + return ResearchStudyStatus.SUSPENDED; + if ("stopped".equals(codeString)) + return ResearchStudyStatus.STOPPED; + if ("completed".equals(codeString)) + return ResearchStudyStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return ResearchStudyStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ResearchStudyStatus code '"+codeString+"'"); + } + + public String toCode(ResearchStudyStatus code) { + if (code == ResearchStudyStatus.DRAFT) + return "draft"; + if (code == ResearchStudyStatus.INPROGRESS) + return "in-progress"; + if (code == ResearchStudyStatus.SUSPENDED) + return "suspended"; + if (code == ResearchStudyStatus.STOPPED) + return "stopped"; + if (code == ResearchStudyStatus.COMPLETED) + return "completed"; + if (code == ResearchStudyStatus.ENTEREDINERROR) + return "entered-in-error"; + return "?"; + } + + public String toSystem(ResearchStudyStatus code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchSubjectStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchSubjectStatus.java new file mode 100644 index 00000000000..58a0d3e6eaf --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchSubjectStatus.java @@ -0,0 +1,123 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.exceptions.FHIRException; + +public enum ResearchSubjectStatus { + + /** + * The subject has been identified as a potential participant in the study but has not yet agreed to participate + */ + CANDIDATE, + /** + * The subject has agreed to participate in the study but has not yet begun performing any action within the study + */ + ENROLLED, + /** + * The subject is currently being monitored and/or subject to treatment as part of the study + */ + ACTIVE, + /** + * The subject has temporarily discontinued monitoring/treatment as part of the study + */ + SUSPENDED, + /** + * The subject has permanently ended participation in the study prior to completion of the intended monitoring/treatment + */ + WITHDRAWN, + /** + * All intended monitoring/treatment of the subject has been completed and their engagement with the study is now ended + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + public static ResearchSubjectStatus fromCode(String codeString) throws FHIRException { + if (codeString == null || "".equals(codeString)) + return null; + if ("candidate".equals(codeString)) + return CANDIDATE; + if ("enrolled".equals(codeString)) + return ENROLLED; + if ("active".equals(codeString)) + return ACTIVE; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("withdrawn".equals(codeString)) + return WITHDRAWN; + if ("completed".equals(codeString)) + return COMPLETED; + throw new FHIRException("Unknown ResearchSubjectStatus code '"+codeString+"'"); + } + public String toCode() { + switch (this) { + case CANDIDATE: return "candidate"; + case ENROLLED: return "enrolled"; + case ACTIVE: return "active"; + case SUSPENDED: return "suspended"; + case WITHDRAWN: return "withdrawn"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + return "http://hl7.org/fhir/research-subject-status"; + } + public String getDefinition() { + switch (this) { + case CANDIDATE: return "The subject has been identified as a potential participant in the study but has not yet agreed to participate"; + case ENROLLED: return "The subject has agreed to participate in the study but has not yet begun performing any action within the study"; + case ACTIVE: return "The subject is currently being monitored and/or subject to treatment as part of the study"; + case SUSPENDED: return "The subject has temporarily discontinued monitoring/treatment as part of the study"; + case WITHDRAWN: return "The subject has permanently ended participation in the study prior to completion of the intended monitoring/treatment"; + case COMPLETED: return "All intended monitoring/treatment of the subject has been completed and their engagement with the study is now ended"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CANDIDATE: return "Candidate"; + case ENROLLED: return "Enrolled"; + case ACTIVE: return "Active"; + case SUSPENDED: return "Suspended"; + case WITHDRAWN: return "Withdrawn"; + case COMPLETED: return "Completed"; + default: return "?"; + } + } + + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchSubjectStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchSubjectStatusEnumFactory.java new file mode 100644 index 00000000000..ef83a2b300d --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResearchSubjectStatusEnumFactory.java @@ -0,0 +1,78 @@ +package org.hl7.fhir.dstu3.model.codesystems; + +/* + 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 6, 2016 09:42-0500 for FHIR v1.8.0 + + +import org.hl7.fhir.dstu3.model.EnumFactory; + +public class ResearchSubjectStatusEnumFactory implements EnumFactory { + + public ResearchSubjectStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("candidate".equals(codeString)) + return ResearchSubjectStatus.CANDIDATE; + if ("enrolled".equals(codeString)) + return ResearchSubjectStatus.ENROLLED; + if ("active".equals(codeString)) + return ResearchSubjectStatus.ACTIVE; + if ("suspended".equals(codeString)) + return ResearchSubjectStatus.SUSPENDED; + if ("withdrawn".equals(codeString)) + return ResearchSubjectStatus.WITHDRAWN; + if ("completed".equals(codeString)) + return ResearchSubjectStatus.COMPLETED; + throw new IllegalArgumentException("Unknown ResearchSubjectStatus code '"+codeString+"'"); + } + + public String toCode(ResearchSubjectStatus code) { + if (code == ResearchSubjectStatus.CANDIDATE) + return "candidate"; + if (code == ResearchSubjectStatus.ENROLLED) + return "enrolled"; + if (code == ResearchSubjectStatus.ACTIVE) + return "active"; + if (code == ResearchSubjectStatus.SUSPENDED) + return "suspended"; + if (code == ResearchSubjectStatus.WITHDRAWN) + return "withdrawn"; + if (code == ResearchSubjectStatus.COMPLETED) + return "completed"; + return "?"; + } + + public String toSystem(ResearchSubjectStatus code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceAggregationMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceAggregationMode.java index f23803b1b43..ad675db8363 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceAggregationMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceAggregationMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceAggregationModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceAggregationModeEnumFactory.java index 26c16477d4b..1afcfa6a8b1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceAggregationModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceAggregationModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceSlicingRules.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceSlicingRules.java index 69680ba7543..005aa2c1b27 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceSlicingRules.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceSlicingRules.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceSlicingRulesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceSlicingRulesEnumFactory.java index b8bbf2ac2bd..1745286626c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceSlicingRulesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceSlicingRulesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypeLink.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypeLink.java index bda33cb999e..a9516dd7c3f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypeLink.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypeLink.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypeLinkEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypeLinkEnumFactory.java index 1917e8fc53c..922f5c85c50 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypeLinkEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypeLinkEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypes.java index 9d7de9d52a9..4a880450751 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -189,7 +189,7 @@ public enum ResourceTypes { */ DOMAINRESOURCE, /** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + * This resource provides the details from the insurer to identify a specified coverage and optionally some class of service. */ ELIGIBILITYREQUEST, /** @@ -316,6 +316,10 @@ public enum ResourceTypes { * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. */ MEDICATIONSTATEMENT, + /** + * Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + */ + MESSAGEDEFINITION, /** * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. */ @@ -416,6 +420,14 @@ public enum ResourceTypes { * A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". */ REQUESTGROUP, + /** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ + RESEARCHSTUDY, + /** + * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + */ + RESEARCHSUBJECT, /** * This is the base resource type for everything. */ @@ -639,6 +651,8 @@ public enum ResourceTypes { return MEDICATIONREQUEST; if ("MedicationStatement".equals(codeString)) return MEDICATIONSTATEMENT; + if ("MessageDefinition".equals(codeString)) + return MESSAGEDEFINITION; if ("MessageHeader".equals(codeString)) return MESSAGEHEADER; if ("NamingSystem".equals(codeString)) @@ -689,6 +703,10 @@ public enum ResourceTypes { return RELATEDPERSON; if ("RequestGroup".equals(codeString)) return REQUESTGROUP; + if ("ResearchStudy".equals(codeString)) + return RESEARCHSTUDY; + if ("ResearchSubject".equals(codeString)) + return RESEARCHSUBJECT; if ("Resource".equals(codeString)) return RESOURCE; if ("RiskAssessment".equals(codeString)) @@ -801,6 +819,7 @@ public enum ResourceTypes { case MEDICATIONDISPENSE: return "MedicationDispense"; case MEDICATIONREQUEST: return "MedicationRequest"; case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEDEFINITION: return "MessageDefinition"; case MESSAGEHEADER: return "MessageHeader"; case NAMINGSYSTEM: return "NamingSystem"; case NUTRITIONREQUEST: return "NutritionRequest"; @@ -826,6 +845,8 @@ public enum ResourceTypes { case REFERRALREQUEST: return "ReferralRequest"; case RELATEDPERSON: return "RelatedPerson"; case REQUESTGROUP: return "RequestGroup"; + case RESEARCHSTUDY: return "ResearchStudy"; + case RESEARCHSUBJECT: return "ResearchSubject"; case RESOURCE: return "Resource"; case RISKASSESSMENT: return "RiskAssessment"; case SCHEDULE: return "Schedule"; @@ -891,7 +912,7 @@ public enum ResourceTypes { case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; case DOCUMENTREFERENCE: return "A reference to a document ."; case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; - case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; + case ELIGIBILITYREQUEST: return "This resource provides the details from the insurer to identify a specified coverage and optionally some class of service."; case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."; case ENDPOINT: return "The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information."; @@ -923,6 +944,7 @@ public enum ResourceTypes { case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; case MEDICATIONREQUEST: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationRequest\" rather than \"MedicationPrescription\" or \"MedicationOrder\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc and to harmonize with workflow patterns."; case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; + case MESSAGEDEFINITION: return "Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted."; case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle."; case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; case NUTRITIONREQUEST: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; @@ -948,6 +970,8 @@ public enum ResourceTypes { case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process."; case REQUESTGROUP: return "A group of related requests that can be used to capture intended activities that have inter-dependencies such as \"give this medication after that one\"."; + case RESEARCHSTUDY: return "A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects."; + case RESEARCHSUBJECT: return "A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects."; case RESOURCE: return "This is the base resource type for everything."; case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; @@ -1042,6 +1066,7 @@ public enum ResourceTypes { case MEDICATIONDISPENSE: return "MedicationDispense"; case MEDICATIONREQUEST: return "MedicationRequest"; case MEDICATIONSTATEMENT: return "MedicationStatement"; + case MESSAGEDEFINITION: return "MessageDefinition"; case MESSAGEHEADER: return "MessageHeader"; case NAMINGSYSTEM: return "NamingSystem"; case NUTRITIONREQUEST: return "NutritionRequest"; @@ -1067,6 +1092,8 @@ public enum ResourceTypes { case REFERRALREQUEST: return "ReferralRequest"; case RELATEDPERSON: return "RelatedPerson"; case REQUESTGROUP: return "RequestGroup"; + case RESEARCHSTUDY: return "ResearchStudy"; + case RESEARCHSUBJECT: return "ResearchSubject"; case RESOURCE: return "Resource"; case RISKASSESSMENT: return "RiskAssessment"; case SCHEDULE: return "Schedule"; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypesEnumFactory.java index 834879c1b30..70f4f7dac5e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceTypesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -179,6 +179,8 @@ public class ResourceTypesEnumFactory implements EnumFactory { return ResourceTypes.MEDICATIONREQUEST; if ("MedicationStatement".equals(codeString)) return ResourceTypes.MEDICATIONSTATEMENT; + if ("MessageDefinition".equals(codeString)) + return ResourceTypes.MESSAGEDEFINITION; if ("MessageHeader".equals(codeString)) return ResourceTypes.MESSAGEHEADER; if ("NamingSystem".equals(codeString)) @@ -229,6 +231,10 @@ public class ResourceTypesEnumFactory implements EnumFactory { return ResourceTypes.RELATEDPERSON; if ("RequestGroup".equals(codeString)) return ResourceTypes.REQUESTGROUP; + if ("ResearchStudy".equals(codeString)) + return ResourceTypes.RESEARCHSTUDY; + if ("ResearchSubject".equals(codeString)) + return ResourceTypes.RESEARCHSUBJECT; if ("Resource".equals(codeString)) return ResourceTypes.RESOURCE; if ("RiskAssessment".equals(codeString)) @@ -411,6 +417,8 @@ public class ResourceTypesEnumFactory implements EnumFactory { return "MedicationRequest"; if (code == ResourceTypes.MEDICATIONSTATEMENT) return "MedicationStatement"; + if (code == ResourceTypes.MESSAGEDEFINITION) + return "MessageDefinition"; if (code == ResourceTypes.MESSAGEHEADER) return "MessageHeader"; if (code == ResourceTypes.NAMINGSYSTEM) @@ -461,6 +469,10 @@ public class ResourceTypesEnumFactory implements EnumFactory { return "RelatedPerson"; if (code == ResourceTypes.REQUESTGROUP) return "RequestGroup"; + if (code == ResourceTypes.RESEARCHSTUDY) + return "ResearchStudy"; + if (code == ResourceTypes.RESEARCHSUBJECT) + return "ResearchSubject"; if (code == ResourceTypes.RESOURCE) return "Resource"; if (code == ResourceTypes.RISKASSESSMENT) diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceValidationMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceValidationMode.java index b5070223a2e..0642a944e0e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceValidationMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceValidationMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceValidationModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceValidationModeEnumFactory.java index 0a0739bfd71..1b7362a3bf3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceValidationModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResourceValidationModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResponseCode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResponseCode.java index 982f3f9f38d..a58379ee488 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResponseCode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResponseCode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResponseCodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResponseCodeEnumFactory.java index 6e0e3a41a20..da1147c070e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResponseCodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ResponseCodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulCapabilityMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulCapabilityMode.java index c7fd2179455..b245299af28 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulCapabilityMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulCapabilityMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulCapabilityModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulCapabilityModeEnumFactory.java index 2eb404ec8cf..1dcdf2dd4fc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulCapabilityModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulCapabilityModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulInteraction.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulInteraction.java index 0910dd20c79..e3cfb11060c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulInteraction.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulInteraction.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -48,6 +48,10 @@ public enum RestfulInteraction { * Update an existing resource by its id (or create it if it is new). */ UPDATE, + /** + * Update an existing resource by posting a set of changes to it. + */ + PATCH, /** * Delete a resource. */ @@ -61,7 +65,7 @@ public enum RestfulInteraction { */ HISTORYINSTANCE, /** - * Retrieve the change history for a all resources of a particular type. + * Retrieve the change history for all resources of a particular type. */ HISTORYTYPE, /** @@ -113,6 +117,8 @@ public enum RestfulInteraction { return VREAD; if ("update".equals(codeString)) return UPDATE; + if ("patch".equals(codeString)) + return PATCH; if ("delete".equals(codeString)) return DELETE; if ("history".equals(codeString)) @@ -146,6 +152,7 @@ public enum RestfulInteraction { case READ: return "read"; case VREAD: return "vread"; case UPDATE: return "update"; + case PATCH: return "patch"; case DELETE: return "delete"; case HISTORY: return "history"; case HISTORYINSTANCE: return "history-instance"; @@ -170,10 +177,11 @@ public enum RestfulInteraction { case READ: return "Read the current state of the resource."; case VREAD: return "Read the state of a specific version of the resource."; case UPDATE: return "Update an existing resource by its id (or create it if it is new)."; + case PATCH: return "Update an existing resource by posting a set of changes to it."; case DELETE: return "Delete a resource."; case HISTORY: return "Retrieve the change history for a particular resource, type of resource, or the entire system."; case HISTORYINSTANCE: return "Retrieve the change history for a particular resource."; - case HISTORYTYPE: return "Retrieve the change history for a all resources of a particular type."; + case HISTORYTYPE: return "Retrieve the change history for all resources of a particular type."; case HISTORYSYSTEM: return "Retrieve the change history for all resources on a system."; case CREATE: return "Create a new resource with a server assigned id."; case SEARCH: return "Search a resource type or all resources based on some filter criteria."; @@ -191,6 +199,7 @@ public enum RestfulInteraction { case READ: return "read"; case VREAD: return "vread"; case UPDATE: return "update"; + case PATCH: return "patch"; case DELETE: return "delete"; case HISTORY: return "history"; case HISTORYINSTANCE: return "history-instance"; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulInteractionEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulInteractionEnumFactory.java index 5ca82fe240f..d21c2217f89 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulInteractionEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/RestfulInteractionEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -45,6 +45,8 @@ public class RestfulInteractionEnumFactory implements EnumFactory { + + public SearchComparator fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("eq".equals(codeString)) + return SearchComparator.EQ; + if ("ne".equals(codeString)) + return SearchComparator.NE; + if ("gt".equals(codeString)) + return SearchComparator.GT; + if ("lt".equals(codeString)) + return SearchComparator.LT; + if ("ge".equals(codeString)) + return SearchComparator.GE; + if ("le".equals(codeString)) + return SearchComparator.LE; + if ("sa".equals(codeString)) + return SearchComparator.SA; + if ("eb".equals(codeString)) + return SearchComparator.EB; + if ("ap".equals(codeString)) + return SearchComparator.AP; + throw new IllegalArgumentException("Unknown SearchComparator code '"+codeString+"'"); + } + + public String toCode(SearchComparator code) { + if (code == SearchComparator.EQ) + return "eq"; + if (code == SearchComparator.NE) + return "ne"; + if (code == SearchComparator.GT) + return "gt"; + if (code == SearchComparator.LT) + return "lt"; + if (code == SearchComparator.GE) + return "ge"; + if (code == SearchComparator.LE) + return "le"; + if (code == SearchComparator.SA) + return "sa"; + if (code == SearchComparator.EB) + return "eb"; + if (code == SearchComparator.AP) + return "ap"; + return "?"; + } + + public String toSystem(SearchComparator code) { + return code.getSystem(); + } + +} + diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchEntryMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchEntryMode.java index b6382bf6c77..2b4ef09aeb5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchEntryMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchEntryMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchEntryModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchEntryModeEnumFactory.java index 822ee60f5c6..afe8714d0e8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchEntryModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchEntryModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchModifierCode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchModifierCode.java index 6254052f612..0626067d0c2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchModifierCode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchModifierCode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchModifierCodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchModifierCodeEnumFactory.java index 505f2cd988b..6518b627bf7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchModifierCodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchModifierCodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchParamType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchParamType.java index ba71bd1a1bb..0c9634a3abd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchParamType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchParamType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchParamTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchParamTypeEnumFactory.java index 5d396d67232..04b8268da6b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchParamTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchParamTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchXpathUsage.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchXpathUsage.java index 8cafaa51cff..2c7f3c237b9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchXpathUsage.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchXpathUsage.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchXpathUsageEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchXpathUsageEnumFactory.java index 96991dddcfb..c69311a40b4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchXpathUsageEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SearchXpathUsageEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SequenceType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SequenceType.java index e034d7401a5..2959add6382 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SequenceType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SequenceType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SequenceTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SequenceTypeEnumFactory.java index 41b15c2c91d..8e010342c78 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SequenceTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SequenceTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceCategory.java index f2ef9c9a0b4..fba3b597d88 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceCategoryEnumFactory.java index 7de838387ac..d93923499f8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceModifiers.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceModifiers.java index 3a4c490f7c9..a24076ad5a8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceModifiers.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceModifiers.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceModifiersEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceModifiersEnumFactory.java index 84036832bdc..7a8c6540065 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceModifiersEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceModifiersEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePharmacy.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePharmacy.java index b97d04ba146..918c4a2aac6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePharmacy.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePharmacy.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePharmacyEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePharmacyEnumFactory.java index d55762f8ff7..80b700ce95b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePharmacyEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePharmacyEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePlace.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePlace.java index 88b100bd955..916315d9c66 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePlace.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePlace.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePlaceEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePlaceEnumFactory.java index 8a0833d520b..6fccf49ae9b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePlaceEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServicePlaceEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProduct.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProduct.java index bfd643bc75f..a94942b855e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProduct.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProduct.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProductEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProductEnumFactory.java index 2633444c00e..b0e0fb86736 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProductEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProductEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProvisionConditions.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProvisionConditions.java index b0d5b9346a9..832fd19ac50 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProvisionConditions.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProvisionConditions.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProvisionConditionsEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProvisionConditionsEnumFactory.java index 4929240c603..f8cba6e2995 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProvisionConditionsEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceProvisionConditionsEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceReferralMethod.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceReferralMethod.java index 77938bcdee6..d34334177f5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceReferralMethod.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceReferralMethod.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceReferralMethodEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceReferralMethodEnumFactory.java index 9f63521c58a..da135491c35 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceReferralMethodEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceReferralMethodEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceType.java index b01a14c68b8..8e143c0e819 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceTypeEnumFactory.java index 113ed0b1277..ae262f181a3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceUscls.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceUscls.java index 974f323c3db..309bb6097d4 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceUscls.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceUscls.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceUsclsEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceUsclsEnumFactory.java index 0604836a7ba..b46773b1039 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceUsclsEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ServiceUsclsEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SignatureType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SignatureType.java index c868c885697..76c85ba8fbb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SignatureType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SignatureType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SignatureTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SignatureTypeEnumFactory.java index 7a5d4b01fc0..9d3b742320b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SignatureTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SignatureTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Slotstatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Slotstatus.java index fcb7fdf39b1..7b8884b0a8d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Slotstatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Slotstatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SlotstatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SlotstatusEnumFactory.java index e811826cbc7..ae1925a8d59 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SlotstatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SlotstatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecialValues.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecialValues.java index 8d05d000e64..c73ba116e5e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecialValues.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecialValues.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecialValuesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecialValuesEnumFactory.java index 0802c1aba7a..4c84989f632 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecialValuesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecialValuesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecimenStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecimenStatus.java index a49a5c8176e..93bda9e9eeb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecimenStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecimenStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecimenStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecimenStatusEnumFactory.java index a66822f666f..96283b359cb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecimenStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SpecimenStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/StructureDefinitionKind.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/StructureDefinitionKind.java index 5fbb74a72f3..8bddfc92a34 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/StructureDefinitionKind.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/StructureDefinitionKind.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/StructureDefinitionKindEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/StructureDefinitionKindEnumFactory.java index a21c48f8dbc..db23eb6ef4b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/StructureDefinitionKindEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/StructureDefinitionKindEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionChannelType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionChannelType.java index 8aafbe833af..cf00afb2491 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionChannelType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionChannelType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionChannelTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionChannelTypeEnumFactory.java index a6099ccb5bb..b6131727dc9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionChannelTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionChannelTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionStatus.java index 56dfe3ba48a..6b8f15eaf97 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionStatusEnumFactory.java index c0a9d06526b..b4d96afda64 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionTag.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionTag.java index 395c98638c3..fdb83981bba 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionTag.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionTag.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionTagEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionTagEnumFactory.java index f706390701e..787e1b2643c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionTagEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubscriptionTagEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubstanceCategory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubstanceCategory.java index ffa35ca60f6..15a80cf64f7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubstanceCategory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubstanceCategory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubstanceCategoryEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubstanceCategoryEnumFactory.java index 29a3c4f7b64..b3980d40a5f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubstanceCategoryEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SubstanceCategoryEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryStatus.java index b364364beca..1bfacbb01c5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryStatusEnumFactory.java index 2faf1c0cb15..f165f66b80e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryType.java index 307b35bad97..d3ab7365747 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryTypeEnumFactory.java index 5548e8ff248..5d1d5019dc5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplydeliveryTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestKind.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestKind.java index 36b192bc009..7d692fad956 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestKind.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestKind.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestKindEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestKindEnumFactory.java index 1e6c5d79ee7..0bb62f87749 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestKindEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestKindEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestReason.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestReason.java index d7dc1459424..722fd9226b9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestReason.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestReason.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestReasonEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestReasonEnumFactory.java index 44490c0b78e..a50030eec05 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestReasonEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestReasonEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestStatus.java index 755f5eae8fe..a2de71d3664 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestStatusEnumFactory.java index f29c342069a..b434d3003fb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SupplyrequestStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Surface.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Surface.java index 58e312649ba..d98fbb4cba3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Surface.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Surface.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SurfaceEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SurfaceEnumFactory.java index faab3b60803..c8ed3f9217d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SurfaceEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SurfaceEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SystemVersionProcessingMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SystemVersionProcessingMode.java index 5bf2d432b0e..74b3676f108 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SystemVersionProcessingMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SystemVersionProcessingMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SystemVersionProcessingModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SystemVersionProcessingModeEnumFactory.java index 5ba9add2f65..ef1e5186875 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SystemVersionProcessingModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/SystemVersionProcessingModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPerformerType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPerformerType.java index 6d5459af82e..d189d53b8e2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPerformerType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPerformerType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPerformerTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPerformerTypeEnumFactory.java index 89ae63c018c..9bdc9904e79 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPerformerTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPerformerTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPriority.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPriority.java index d464b3b143e..f605703e532 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPriority.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPriority.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPriorityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPriorityEnumFactory.java index 7151e84afce..ff95150ab80 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPriorityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskPriorityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStage.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStage.java index 22e59a46626..2f8f6b872da 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStage.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStage.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStageEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStageEnumFactory.java index fe5dc56d78a..64cf118d94f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStageEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStageEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Sat, Nov 5, 2016 17:49-0400 for FHIR v1.7.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStatus.java index 1a01278cc3a..3ed8b890afc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -41,7 +41,7 @@ public enum TaskStatus { */ DRAFT, /** - * The task is ready to be acted upon + * The task is ready to be acted upon and action is sought */ REQUESTED, /** @@ -60,6 +60,10 @@ public enum TaskStatus { * Task is ready to be performed, but no action has yet been taken. Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given. */ READY, + /** + * the task was not completed (more or less) as requested + */ + CANCELLED, /** * Task has been started but is not yet complete. */ @@ -76,6 +80,10 @@ public enum TaskStatus { * The task has been completed (more or less) as requested. */ COMPLETED, + /** + * The task should never have existed and is retained only because of the possibility it may have used + */ + ENTEREDINERROR, /** * added to help the parsers */ @@ -95,6 +103,8 @@ public enum TaskStatus { return REJECTED; if ("ready".equals(codeString)) return READY; + if ("cancelled".equals(codeString)) + return CANCELLED; if ("in-progress".equals(codeString)) return INPROGRESS; if ("on-hold".equals(codeString)) @@ -103,6 +113,8 @@ public enum TaskStatus { return FAILED; if ("completed".equals(codeString)) return COMPLETED; + if ("entered-in-error".equals(codeString)) + return ENTEREDINERROR; throw new FHIRException("Unknown TaskStatus code '"+codeString+"'"); } public String toCode() { @@ -113,10 +125,12 @@ public enum TaskStatus { case ACCEPTED: return "accepted"; case REJECTED: return "rejected"; case READY: return "ready"; + case CANCELLED: return "cancelled"; case INPROGRESS: return "in-progress"; case ONHOLD: return "on-hold"; case FAILED: return "failed"; case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered-in-error"; default: return "?"; } } @@ -126,15 +140,17 @@ public enum TaskStatus { public String getDefinition() { switch (this) { case DRAFT: return "The task is not yet ready to be acted upon."; - case REQUESTED: return "The task is ready to be acted upon"; + case REQUESTED: return "The task is ready to be acted upon and action is sought"; case RECEIVED: return "A potential performer has claimed ownership of the task and is evaluating whether to perform it"; case ACCEPTED: return "The potential performer has agreed to execute the task but has not yet started work"; case REJECTED: return "The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action."; case READY: return "Task is ready to be performed, but no action has yet been taken. Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given."; + case CANCELLED: return "the task was not completed (more or less) as requested"; case INPROGRESS: return "Task has been started but is not yet complete."; case ONHOLD: return "Task has been started but work has been paused"; case FAILED: return "The task was attempted but could not be completed due to some error."; case COMPLETED: return "The task has been completed (more or less) as requested."; + case ENTEREDINERROR: return "The task should never have existed and is retained only because of the possibility it may have used"; default: return "?"; } } @@ -146,10 +162,12 @@ public enum TaskStatus { case ACCEPTED: return "Accepted"; case REJECTED: return "Rejected"; case READY: return "Ready"; + case CANCELLED: return "Cancelled"; case INPROGRESS: return "In Progress"; case ONHOLD: return "On Hold"; case FAILED: return "Failed"; case COMPLETED: return "Completed"; + case ENTEREDINERROR: return "Entered in Error"; default: return "?"; } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStatusEnumFactory.java index 2116c3c6867..4ce6e9d02c3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TaskStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -51,6 +51,8 @@ public class TaskStatusEnumFactory implements EnumFactory { return TaskStatus.REJECTED; if ("ready".equals(codeString)) return TaskStatus.READY; + if ("cancelled".equals(codeString)) + return TaskStatus.CANCELLED; if ("in-progress".equals(codeString)) return TaskStatus.INPROGRESS; if ("on-hold".equals(codeString)) @@ -59,6 +61,8 @@ public class TaskStatusEnumFactory implements EnumFactory { return TaskStatus.FAILED; if ("completed".equals(codeString)) return TaskStatus.COMPLETED; + if ("entered-in-error".equals(codeString)) + return TaskStatus.ENTEREDINERROR; throw new IllegalArgumentException("Unknown TaskStatus code '"+codeString+"'"); } @@ -75,6 +79,8 @@ public class TaskStatusEnumFactory implements EnumFactory { return "rejected"; if (code == TaskStatus.READY) return "ready"; + if (code == TaskStatus.CANCELLED) + return "cancelled"; if (code == TaskStatus.INPROGRESS) return "in-progress"; if (code == TaskStatus.ONHOLD) @@ -83,6 +89,8 @@ public class TaskStatusEnumFactory implements EnumFactory { return "failed"; if (code == TaskStatus.COMPLETED) return "completed"; + if (code == TaskStatus.ENTEREDINERROR) + return "entered-in-error"; return "?"; } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Teeth.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Teeth.java index b9d36cbe4a2..baf7e80dcbc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Teeth.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Teeth.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TeethEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TeethEnumFactory.java index f656e2e1735..edc44e3b849 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TeethEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TeethEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptOperationCodes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptOperationCodes.java index 15b8746dfee..e22477e9235 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptOperationCodes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptOperationCodes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -173,7 +173,7 @@ public enum TestscriptOperationCodes { */ POPULATE, /** - * Geneate HTML for Questionnaire + * Generate HTML for Questionnaire */ POPULATEHTML, /** @@ -460,7 +460,7 @@ public enum TestscriptOperationCodes { case METAADD: return "Add profiles, tags, and security labels to a resource"; case METADELETE: return "Delete profiles, tags, and security labels for a resource"; case POPULATE: return "Populate Questionnaire"; - case POPULATEHTML: return "Geneate HTML for Questionnaire"; + case POPULATEHTML: return "Generate HTML for Questionnaire"; case POPULATELINK: return "Generate a link to a Questionnaire completion webpage"; case PROCESSMESSAGE: return "Process Message"; case QUESTIONNAIRE: return "Build Questionnaire"; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptOperationCodesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptOperationCodesEnumFactory.java index f97f7b79b14..b0fb94239b1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptOperationCodesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptOperationCodesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileDestinationTypes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileDestinationTypes.java index ba78f02854d..f8828f72bd0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileDestinationTypes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileDestinationTypes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileDestinationTypesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileDestinationTypesEnumFactory.java index 5d099d61873..379b8b91969 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileDestinationTypesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileDestinationTypesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileOriginTypes.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileOriginTypes.java index c5ae611bc69..e66b016ae06 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileOriginTypes.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileOriginTypes.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileOriginTypesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileOriginTypesEnumFactory.java index d0bce4da31d..73c3a41c540 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileOriginTypesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TestscriptProfileOriginTypesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Tooth.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Tooth.java index 2dea94185e1..cf2cda4add1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Tooth.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Tooth.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ToothEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ToothEnumFactory.java index ca85a1e39c8..c614490f472 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ToothEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/ToothEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TransactionMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TransactionMode.java index a08eb7b5bb0..eb907e46cf3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TransactionMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TransactionMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TransactionModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TransactionModeEnumFactory.java index 026d7a98e4d..2cdc40e7bb0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TransactionModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TransactionModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TypeDerivationRule.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TypeDerivationRule.java index 9c926574682..656fb9bcc89 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TypeDerivationRule.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TypeDerivationRule.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TypeDerivationRuleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TypeDerivationRuleEnumFactory.java index 83719d90c81..a4410d62f4d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TypeDerivationRuleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/TypeDerivationRuleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Udi.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Udi.java index 63b20ed0d95..c3db1b23b78 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Udi.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Udi.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UdiEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UdiEnumFactory.java index b271d620776..6794213bda5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UdiEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UdiEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UnknownContentCode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UnknownContentCode.java index 7a5578d977a..a9ba1d972dd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UnknownContentCode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UnknownContentCode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UnknownContentCodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UnknownContentCodeEnumFactory.java index 810a0f6956e..87255b85c9b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UnknownContentCodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UnknownContentCodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UsageContextType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UsageContextType.java index 5bb02d20c63..206675a4fbb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UsageContextType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UsageContextType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UsageContextTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UsageContextTypeEnumFactory.java index ce6288f15bf..824b1e50141 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UsageContextTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/UsageContextTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementCondition.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementCondition.java index 65f32f42a33..50dd42f594d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementCondition.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementCondition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementConditionEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementConditionEnumFactory.java index fb223f5ac87..ede2f656b86 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementConditionEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementConditionEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailCode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailCode.java index a6ffc7203d1..5329add2716 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailCode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailCode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailCodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailCodeEnumFactory.java index 35538c873f7..8b4fa3b5566 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailCodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailCodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailType.java index bdd73a28117..69bbde68e1e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailTypeEnumFactory.java index 3e0c1474d66..3a4ed615536 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementDetailTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementType.java index 104de553b2e..7a09f837103 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementTypeEnumFactory.java index ed3ece7cf18..a0e6bd26e11 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AcknowledgementTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActClass.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActClass.java index edba9c6c796..c4b3d01c242 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActClass.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActClass.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActClassEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActClassEnumFactory.java index 0a535f435a6..666d3d6cd8b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActClassEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActClassEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActCode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActCode.java index be935ad43f2..053aca538cb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActCode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActCode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -849,7 +849,7 @@ public enum V3ActCode { /** * Maximum amount paid or maximum number of services/products covered; or maximum amount or number covered during a specified time period under the policy or program. */ - _ACTCOVERAGEAGELIMITCODE, + _ACTCOVERAGEQUANTITYLIMITCODE, /** * Codes representing the time period during which coverage is available; or financial participation requirements are in effect. */ @@ -2883,13 +2883,6 @@ public enum V3ActCode { Usage Note: If there is a jurisdictional mandate, then use the applicable ActPrivacyLaw code system, and specify the law rather than or in addition to this more generic code. */ PSY, - /** - * Information about provision of social services. - - - Usage Note: This is a temporary addition to FHIR to be proposed in harmonization. - */ - SOC, /** * Policy for handling sickle cell disease information, which is afforded heightened confidentiality. Information handling protocols are based on organizational policies related to sickle cell disease information, which is deemed sensitive. @@ -2897,6 +2890,13 @@ public enum V3ActCode { Usage Note: If there is a jurisdictional mandate, then the Act valued with this ActCode should be associated with an Act valued with any applicable laws from the ActPrivacyLaw code system. */ SCA, + /** + * Information about provision of social services. + + + Usage Note: This is a temporary addition to FHIR to be proposed in harmonization. + */ + SOC, /** * Policy for handling sexual assault, abuse, or domestic violence information, which will be afforded heightened confidentiality. Information handling protocols based on organizational policies related to sexual assault, abuse, or domestic violence information that is deemed sensitive. @@ -4002,6 +4002,14 @@ public enum V3ActCode { * Indicates that the observation is carrying out an aggregation calculation, contained in the value element. */ AGGREGATE, + /** + * Indicates what method is used in a quality measure to combine the component measure results included in an composite measure. + */ + CMPMSRMTH, + /** + * An attribute of a quality measure describing the weight this component measure score is to carry in determining the overall composite measure final score. The value is real value greater than 0 and less than 1.0. Each component measure score will be multiplied by its CMPMSRSCRWGHT and then summed with the other component measures to determine the final overall composite measure score. The sum across all CMPMSRSCRWGHT values within a single composite measure SHALL be 1.0. The value assigned is scoped to the composite measure referencing this component measure only. + */ + CMPMSRSCRWGHT, /** * Identifies the organization(s) who own the intellectual property represented by the eMeasure. */ @@ -5560,8 +5568,8 @@ the measure population as a narrative description (e.g., all patients seen in th return NELG; if ("_ActCoverageLimitCode".equals(codeString)) return _ACTCOVERAGELIMITCODE; - if ("_ActCoverageAgeLimitCode".equals(codeString)) - return _ACTCOVERAGEAGELIMITCODE; + if ("_ActCoverageQuantityLimitCode".equals(codeString)) + return _ACTCOVERAGEQUANTITYLIMITCODE; if ("COVPRD".equals(codeString)) return COVPRD; if ("LFEMX".equals(codeString)) @@ -6388,10 +6396,10 @@ the measure population as a narrative description (e.g., all patients seen in th return HIV; if ("PSY".equals(codeString)) return PSY; - if ("SOC".equals(codeString)) - return SOC; if ("SCA".equals(codeString)) return SCA; + if ("SOC".equals(codeString)) + return SOC; if ("SDV".equals(codeString)) return SDV; if ("SEX".equals(codeString)) @@ -6854,6 +6862,10 @@ the measure population as a narrative description (e.g., all patients seen in th return _OBSERVATIONQUALITYMEASUREATTRIBUTE; if ("AGGREGATE".equals(codeString)) return AGGREGATE; + if ("CMPMSRMTH".equals(codeString)) + return CMPMSRMTH; + if ("CMPMSRSCRWGHT".equals(codeString)) + return CMPMSRSCRWGHT; if ("COPY".equals(codeString)) return COPY; if ("CRS".equals(codeString)) @@ -7557,7 +7569,7 @@ the measure population as a narrative description (e.g., all patients seen in th case ELG: return "ELG"; case NELG: return "NELG"; case _ACTCOVERAGELIMITCODE: return "_ActCoverageLimitCode"; - case _ACTCOVERAGEAGELIMITCODE: return "_ActCoverageAgeLimitCode"; + case _ACTCOVERAGEQUANTITYLIMITCODE: return "_ActCoverageQuantityLimitCode"; case COVPRD: return "COVPRD"; case LFEMX: return "LFEMX"; case NETAMT: return "NETAMT"; @@ -7971,8 +7983,8 @@ the measure population as a narrative description (e.g., all patients seen in th case GDIS: return "GDIS"; case HIV: return "HIV"; case PSY: return "PSY"; - case SOC: return "SOC"; case SCA: return "SCA"; + case SOC: return "SOC"; case SDV: return "SDV"; case SEX: return "SEX"; case STD: return "STD"; @@ -8204,6 +8216,8 @@ the measure population as a narrative description (e.g., all patients seen in th case WATTRNS: return "WATTRNS"; case _OBSERVATIONQUALITYMEASUREATTRIBUTE: return "_ObservationQualityMeasureAttribute"; case AGGREGATE: return "AGGREGATE"; + case CMPMSRMTH: return "CMPMSRMTH"; + case CMPMSRSCRWGHT: return "CMPMSRSCRWGHT"; case COPY: return "COPY"; case CRS: return "CRS"; case DEF: return "DEF"; @@ -8657,7 +8671,7 @@ the measure population as a narrative description (e.g., all patients seen in th case ELG: return "Insurance coverage is in effect for healthcare service(s) and/or product(s)."; case NELG: return "Insurance coverage is not in effect for healthcare service(s) and/or product(s). May optionally include reasons for the ineligibility."; case _ACTCOVERAGELIMITCODE: return "Criteria that are applicable to the authorized coverage."; - case _ACTCOVERAGEAGELIMITCODE: return "Maximum amount paid or maximum number of services/products covered; or maximum amount or number covered during a specified time period under the policy or program."; + case _ACTCOVERAGEQUANTITYLIMITCODE: return "Maximum amount paid or maximum number of services/products covered; or maximum amount or number covered during a specified time period under the policy or program."; case COVPRD: return "Codes representing the time period during which coverage is available; or financial participation requirements are in effect."; case LFEMX: return "Definition: Maximum amount paid by payer or covered party; or maximum number of services or products covered under the policy or program during a covered party's lifetime."; case NETAMT: return "Maximum net amount that will be covered for the product or service specified."; @@ -9071,8 +9085,8 @@ the measure population as a narrative description (e.g., all patients seen in th case GDIS: return "Policy for handling genetic disease information, which will be afforded heightened confidentiality. Information handling protocols based on organizational policies related to genetic disease information that is deemed sensitive.\r\n\n \n Usage Note: If there is a jurisdictional mandate, then use the applicable ActPrivacyLaw code system, and specify the law rather than or in addition to this more generic code."; case HIV: return "Policy for handling HIV or AIDS information, which will be afforded heightened confidentiality. Information handling protocols based on organizational policies related to HIV or AIDS information that is deemed sensitive.\r\n\n \n Usage Note: If there is a jurisdictional mandate, then use the applicable ActPrivacyLaw code system, and specify the law rather than or in addition to this more generic code."; case PSY: return "Policy for handling psychiatry information, which will be afforded heightened confidentiality. Information handling protocols based on organizational policies related to psychiatry information that is deemed sensitive.\r\n\n \n Usage Note: If there is a jurisdictional mandate, then use the applicable ActPrivacyLaw code system, and specify the law rather than or in addition to this more generic code."; - case SOC: return "Information about provision of social services.\r\n\n \n Usage Note: This is a temporary addition to FHIR to be proposed in harmonization."; case SCA: return "Policy for handling sickle cell disease information, which is afforded heightened confidentiality. Information handling protocols are based on organizational policies related to sickle cell disease information, which is deemed sensitive.\r\n\n \n Usage Note: If there is a jurisdictional mandate, then the Act valued with this ActCode should be associated with an Act valued with any applicable laws from the ActPrivacyLaw code system."; + case SOC: return "Information about provision of social services.\r\n\n \n Usage Note: This is a temporary addition to FHIR to be proposed in harmonization."; case SDV: return "Policy for handling sexual assault, abuse, or domestic violence information, which will be afforded heightened confidentiality. Information handling protocols based on organizational policies related to sexual assault, abuse, or domestic violence information that is deemed sensitive.\r\n\n \n Usage Note: If there is a jurisdictional mandate, then use the applicable ActPrivacyLaw code system, and specify the law rather than or in addition to this more generic code."; case SEX: return "Policy for handling sexuality and reproductive health information, which will be afforded heightened confidentiality. Information handling protocols based on organizational policies related to sexuality and reproductive health information that is deemed sensitive.\r\n\n \n Usage Note: If there is a jurisdictional mandate, then use the applicable ActPrivacyLaw code system, and specify the law rather than or in addition to this more generic code."; case STD: return "Policy for handling sexually transmitted disease information, which will be afforded heightened confidentiality.\n Information handling protocols based on organizational policies related to sexually transmitted disease information that is deemed sensitive.\r\n\n \n Usage Note: If there is a jurisdictional mandate, then use the applicable ActPrivacyLaw code system, and specify the law rather than or in addition to this more generic code."; @@ -9304,6 +9318,8 @@ the measure population as a narrative description (e.g., all patients seen in th case WATTRNS: return "Communication of an agent from a contaminated water source to a living subject whether the water is ingested as a food or not. The route of entry of the water may be through any bodily orifice."; case _OBSERVATIONQUALITYMEASUREATTRIBUTE: return "Codes used to define various metadata aspects of a health quality measure."; case AGGREGATE: return "Indicates that the observation is carrying out an aggregation calculation, contained in the value element."; + case CMPMSRMTH: return "Indicates what method is used in a quality measure to combine the component measure results included in an composite measure."; + case CMPMSRSCRWGHT: return "An attribute of a quality measure describing the weight this component measure score is to carry in determining the overall composite measure final score. The value is real value greater than 0 and less than 1.0. Each component measure score will be multiplied by its CMPMSRSCRWGHT and then summed with the other component measures to determine the final overall composite measure score. The sum across all CMPMSRSCRWGHT values within a single composite measure SHALL be 1.0. The value assigned is scoped to the composite measure referencing this component measure only."; case COPY: return "Identifies the organization(s) who own the intellectual property represented by the eMeasure."; case CRS: return "Summary of relevant clinical guidelines or other clinical recommendations supporting this eMeasure."; case DEF: return "Description of individual terms, provided as needed."; @@ -9754,7 +9770,7 @@ the measure population as a narrative description (e.g., all patients seen in th case ELG: return "Eligible"; case NELG: return "Not Eligible"; case _ACTCOVERAGELIMITCODE: return "ActCoverageLimitCode"; - case _ACTCOVERAGEAGELIMITCODE: return "ActCoverageAgeLimitCode"; + case _ACTCOVERAGEQUANTITYLIMITCODE: return "ActCoverageQuantityLimitCode"; case COVPRD: return "coverage period"; case LFEMX: return "life time maximum"; case NETAMT: return "Net Amount"; @@ -10168,8 +10184,8 @@ the measure population as a narrative description (e.g., all patients seen in th case GDIS: return "genetic disease information sensitivity"; case HIV: return "HIV/AIDS information sensitivity"; case PSY: return "psychiatry information sensitivity"; - case SOC: return "social services sensitivity"; case SCA: return "sickle cell anemia"; + case SOC: return "social services sensitivity"; case SDV: return "sexual assault, abuse, or domestic violence information sensitivity"; case SEX: return "sexuality and reproductive health information sensitivity"; case STD: return "sexually transmitted disease information sensitivity"; @@ -10401,6 +10417,8 @@ the measure population as a narrative description (e.g., all patients seen in th case WATTRNS: return "water-borne transmission"; case _OBSERVATIONQUALITYMEASUREATTRIBUTE: return "ObservationQualityMeasureAttribute"; case AGGREGATE: return "aggregate measure observation"; + case CMPMSRMTH: return "composite measure method"; + case CMPMSRSCRWGHT: return "component measure scoring weight"; case COPY: return "copyright"; case CRS: return "clinical recommendation statement"; case DEF: return "definition"; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActCodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActCodeEnumFactory.java index 0b27c45ed4f..e0b44ff2459 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActCodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActCodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -421,8 +421,8 @@ public class V3ActCodeEnumFactory implements EnumFactory { return V3ActCode.NELG; if ("_ActCoverageLimitCode".equals(codeString)) return V3ActCode._ACTCOVERAGELIMITCODE; - if ("_ActCoverageAgeLimitCode".equals(codeString)) - return V3ActCode._ACTCOVERAGEAGELIMITCODE; + if ("_ActCoverageQuantityLimitCode".equals(codeString)) + return V3ActCode._ACTCOVERAGEQUANTITYLIMITCODE; if ("COVPRD".equals(codeString)) return V3ActCode.COVPRD; if ("LFEMX".equals(codeString)) @@ -1249,10 +1249,10 @@ public class V3ActCodeEnumFactory implements EnumFactory { return V3ActCode.HIV; if ("PSY".equals(codeString)) return V3ActCode.PSY; - if ("SOC".equals(codeString)) - return V3ActCode.SOC; if ("SCA".equals(codeString)) return V3ActCode.SCA; + if ("SOC".equals(codeString)) + return V3ActCode.SOC; if ("SDV".equals(codeString)) return V3ActCode.SDV; if ("SEX".equals(codeString)) @@ -1715,6 +1715,10 @@ public class V3ActCodeEnumFactory implements EnumFactory { return V3ActCode._OBSERVATIONQUALITYMEASUREATTRIBUTE; if ("AGGREGATE".equals(codeString)) return V3ActCode.AGGREGATE; + if ("CMPMSRMTH".equals(codeString)) + return V3ActCode.CMPMSRMTH; + if ("CMPMSRSCRWGHT".equals(codeString)) + return V3ActCode.CMPMSRSCRWGHT; if ("COPY".equals(codeString)) return V3ActCode.COPY; if ("CRS".equals(codeString)) @@ -2609,8 +2613,8 @@ public class V3ActCodeEnumFactory implements EnumFactory { return "NELG"; if (code == V3ActCode._ACTCOVERAGELIMITCODE) return "_ActCoverageLimitCode"; - if (code == V3ActCode._ACTCOVERAGEAGELIMITCODE) - return "_ActCoverageAgeLimitCode"; + if (code == V3ActCode._ACTCOVERAGEQUANTITYLIMITCODE) + return "_ActCoverageQuantityLimitCode"; if (code == V3ActCode.COVPRD) return "COVPRD"; if (code == V3ActCode.LFEMX) @@ -3437,10 +3441,10 @@ public class V3ActCodeEnumFactory implements EnumFactory { return "HIV"; if (code == V3ActCode.PSY) return "PSY"; - if (code == V3ActCode.SOC) - return "SOC"; if (code == V3ActCode.SCA) return "SCA"; + if (code == V3ActCode.SOC) + return "SOC"; if (code == V3ActCode.SDV) return "SDV"; if (code == V3ActCode.SEX) @@ -3903,6 +3907,10 @@ public class V3ActCodeEnumFactory implements EnumFactory { return "_ObservationQualityMeasureAttribute"; if (code == V3ActCode.AGGREGATE) return "AGGREGATE"; + if (code == V3ActCode.CMPMSRMTH) + return "CMPMSRMTH"; + if (code == V3ActCode.CMPMSRSCRWGHT) + return "CMPMSRSCRWGHT"; if (code == V3ActCode.COPY) return "COPY"; if (code == V3ActCode.CRS) diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActExposureLevelCode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActExposureLevelCode.java index d5d51285408..255b0a3c339 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActExposureLevelCode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActExposureLevelCode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActExposureLevelCodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActExposureLevelCodeEnumFactory.java index 43332b714d3..8260756a3c9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActExposureLevelCodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActExposureLevelCodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActInvoiceElementModifier.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActInvoiceElementModifier.java index a939833dfbe..c935f635135 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActInvoiceElementModifier.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActInvoiceElementModifier.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActInvoiceElementModifierEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActInvoiceElementModifierEnumFactory.java index d76a54d848d..2cebeb59256 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActInvoiceElementModifierEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActInvoiceElementModifierEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActMood.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActMood.java index 15d7b432d63..fe583d1b8db 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActMood.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActMood.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActMoodEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActMoodEnumFactory.java index 5c2f2a5aa1e..6a17493c737 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActMoodEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActMoodEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActPriority.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActPriority.java index bf73c4b20e8..9d021b7abb5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActPriority.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActPriority.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActPriorityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActPriorityEnumFactory.java index 01eb9e3682b..a1c89a22fc6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActPriorityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActPriorityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActReason.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActReason.java index 4ee09435638..ee246af03ca 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActReason.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActReason.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActReasonEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActReasonEnumFactory.java index 8d4676486d1..c107e319dd8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActReasonEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActReasonEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipCheckpoint.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipCheckpoint.java index 425ec9269b5..397d88be310 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipCheckpoint.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipCheckpoint.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipCheckpointEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipCheckpointEnumFactory.java index eba4d5e9ed3..e69d3216b6a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipCheckpointEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipCheckpointEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipJoin.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipJoin.java index e95913aa95f..8547e8baeab 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipJoin.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipJoin.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipJoinEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipJoinEnumFactory.java index 1cbe42208ee..f6b407c1dfb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipJoinEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipJoinEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSplit.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSplit.java index 1917d7d7357..a0f6ee48b56 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSplit.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSplit.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSplitEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSplitEnumFactory.java index 2b6a5689b24..771f45aef51 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSplitEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSplitEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSubset.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSubset.java index 2f918b4bf8f..19d96c5c101 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSubset.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSubset.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSubsetEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSubsetEnumFactory.java index 7c094bf87d4..dd9ea9f5461 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSubsetEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipSubsetEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipType.java index 33d338b4ab3..92ea562803e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipTypeEnumFactory.java index 061ec4c52b0..ca79c95823a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActRelationshipTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActSite.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActSite.java index 201fbb4f125..ed5a4ac7617 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActSite.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActSite.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActSiteEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActSiteEnumFactory.java index 5dbf281b3b5..a339fea9f39 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActSiteEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActSiteEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActStatus.java index 30b8021b6c0..7fab578fa55 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActStatusEnumFactory.java index fa00eba7742..23dbb0b295d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUSPrivacyLaw.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUSPrivacyLaw.java index 91b48954eba..f46e37cab1b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUSPrivacyLaw.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUSPrivacyLaw.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUSPrivacyLawEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUSPrivacyLawEnumFactory.java index 092b4641032..532af76dba9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUSPrivacyLawEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUSPrivacyLawEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUncertainty.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUncertainty.java index d2baea24cd7..9bbfc3881aa 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUncertainty.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUncertainty.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUncertaintyEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUncertaintyEnumFactory.java index 1517d0cdcbe..0ffa1ce8743 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUncertaintyEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ActUncertaintyEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressPartType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressPartType.java index 924f47c0437..432372a5506 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressPartType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressPartType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressPartTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressPartTypeEnumFactory.java index 8792b530d96..284a02ee7e6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressPartTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressPartTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressUse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressUse.java index 24d5d66f55e..d30a04019fb 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressUse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressUse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressUseEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressUseEnumFactory.java index c7a94a69f10..8911fb65d00 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressUseEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AddressUseEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AdministrativeGender.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AdministrativeGender.java index 36faeb23aaa..09a8ebc1e8f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AdministrativeGender.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AdministrativeGender.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AdministrativeGenderEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AdministrativeGenderEnumFactory.java index 2d6d6d0fd37..0f6fb241c89 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AdministrativeGenderEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AdministrativeGenderEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AmericanIndianAlaskaNativeLanguages.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AmericanIndianAlaskaNativeLanguages.java index a85785eac73..b96ec705855 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AmericanIndianAlaskaNativeLanguages.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AmericanIndianAlaskaNativeLanguages.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AmericanIndianAlaskaNativeLanguagesEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AmericanIndianAlaskaNativeLanguagesEnumFactory.java index 4b130b4b842..382e0c75f59 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AmericanIndianAlaskaNativeLanguagesEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3AmericanIndianAlaskaNativeLanguagesEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Calendar.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Calendar.java index 2132b51d0af..11dca32d77d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Calendar.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Calendar.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarCycle.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarCycle.java index 602e33df8a6..ecbe80b3046 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarCycle.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarCycle.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarCycleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarCycleEnumFactory.java index 1016fe537e4..4bfd7cd10f3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarCycleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarCycleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarEnumFactory.java index be8cd02ee90..72cdbd43036 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarType.java index 0ab72bf6718..9f5ec423def 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarTypeEnumFactory.java index c4b86251493..357c076837a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CalendarTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Charset.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Charset.java index 0d90e978510..8323c3b5500 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Charset.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Charset.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CharsetEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CharsetEnumFactory.java index 6bd46527b35..9c726f9d601 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CharsetEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CharsetEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CodingRationale.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CodingRationale.java index 86d421998f8..c915080a035 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CodingRationale.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CodingRationale.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CodingRationaleEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CodingRationaleEnumFactory.java index 6c57e66c3ff..f62d13f39aa 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CodingRationaleEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CodingRationaleEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CommunicationFunctionType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CommunicationFunctionType.java index d57e712b85d..9897dcf5162 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CommunicationFunctionType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CommunicationFunctionType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CommunicationFunctionTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CommunicationFunctionTypeEnumFactory.java index 39076765690..378ebc141fd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CommunicationFunctionTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CommunicationFunctionTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CompressionAlgorithm.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CompressionAlgorithm.java index 7b64f008797..d617bd91fc1 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CompressionAlgorithm.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CompressionAlgorithm.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CompressionAlgorithmEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CompressionAlgorithmEnumFactory.java index 0ff6c55f238..db1291b5988 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CompressionAlgorithmEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3CompressionAlgorithmEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Confidentiality.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Confidentiality.java index 353cdcc95b1..aca4cad5209 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Confidentiality.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Confidentiality.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ConfidentialityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ConfidentialityEnumFactory.java index 31943fa13b2..e0e5074ee13 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ConfidentialityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ConfidentialityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerCap.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerCap.java index 217d30e8f84..f9d8fa3abf9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerCap.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerCap.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerCapEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerCapEnumFactory.java index 2d0d2808dd9..cd2aa9fa9ef 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerCapEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerCapEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerSeparator.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerSeparator.java index 14f78efd369..afd1e334829 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerSeparator.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerSeparator.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerSeparatorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerSeparatorEnumFactory.java index 308f5e60d33..24d86ec72b8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerSeparatorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContainerSeparatorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContentProcessingMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContentProcessingMode.java index 6f0ed993df1..a0fa773cbba 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContentProcessingMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContentProcessingMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContentProcessingModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContentProcessingModeEnumFactory.java index fe1a24ee4c7..35dba7b3c33 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContentProcessingModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContentProcessingModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContextControl.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContextControl.java index 199929ae086..5aab9d7f292 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContextControl.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContextControl.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContextControlEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContextControlEnumFactory.java index 9acfacf9337..bd9ae5751a9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContextControlEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ContextControlEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DataOperation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DataOperation.java index 65d4deae04f..b5077c7e4cd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DataOperation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DataOperation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DataOperationEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DataOperationEnumFactory.java index ebad1a208c7..a907863d9e5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DataOperationEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DataOperationEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DeviceAlertLevel.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DeviceAlertLevel.java index bd0a116612c..6faf9a4dd77 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DeviceAlertLevel.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DeviceAlertLevel.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DeviceAlertLevelEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DeviceAlertLevelEnumFactory.java index 7520eb79644..9d05f3f9764 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DeviceAlertLevelEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DeviceAlertLevelEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentCompletion.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentCompletion.java index d3638e0633a..317201de01a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentCompletion.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentCompletion.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentCompletionEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentCompletionEnumFactory.java index c0bc0490516..e92478a1c9b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentCompletionEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentCompletionEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentStorage.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentStorage.java index 0e59c788724..cf51a87f893 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentStorage.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentStorage.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentStorageEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentStorageEnumFactory.java index 1b6de3981ee..bd5f19688f9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentStorageEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3DocumentStorageEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EducationLevel.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EducationLevel.java index 4db71cacdba..133d500cdae 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EducationLevel.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EducationLevel.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EducationLevelEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EducationLevelEnumFactory.java index 7138110dc3d..5e9e1f2337a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EducationLevelEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EducationLevelEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EmployeeJobClass.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EmployeeJobClass.java index 9239665f605..9f7d176fd8e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EmployeeJobClass.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EmployeeJobClass.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EmployeeJobClassEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EmployeeJobClassEnumFactory.java index 17e1b5aff65..4fd66f9c05b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EmployeeJobClassEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EmployeeJobClassEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterAdmissionSource.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterAdmissionSource.java index ca3e63feeec..67787433851 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterAdmissionSource.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterAdmissionSource.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterAdmissionSourceEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterAdmissionSourceEnumFactory.java index 7df8cb3811d..db560f87ec5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterAdmissionSourceEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterAdmissionSourceEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterSpecialCourtesy.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterSpecialCourtesy.java index 33ec71062aa..44f65f598c7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterSpecialCourtesy.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterSpecialCourtesy.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterSpecialCourtesyEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterSpecialCourtesyEnumFactory.java index 577402ad7a7..9bc61a26ab9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterSpecialCourtesyEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EncounterSpecialCourtesyEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityClass.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityClass.java index 2dd1f6b4aeb..24393bf67e7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityClass.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityClass.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityClassEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityClassEnumFactory.java index 3b0f0cedbf6..82edfbea0ec 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityClassEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityClassEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityCode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityCode.java index 3679bd5c52c..2e52ebbb494 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityCode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityCode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityCodeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityCodeEnumFactory.java index 131b4087446..2d9733d8c6f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityCodeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityCodeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityDeterminer.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityDeterminer.java index cb74e7a3c4a..3409c008d1e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityDeterminer.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityDeterminer.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityDeterminerEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityDeterminerEnumFactory.java index 01663c9c670..099734c5faf 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityDeterminerEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityDeterminerEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityHandling.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityHandling.java index 4bb5397ebd9..87ef3f5b628 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityHandling.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityHandling.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityHandlingEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityHandlingEnumFactory.java index 1413526ddcb..5b68ef3cef7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityHandlingEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityHandlingEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifier.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifier.java index c4ed9e30371..f6067b317b3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifier.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifier.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierEnumFactory.java index db876966a5a..bed31c0efa3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierR2.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierR2.java index 0aa4a654738..73fb3f46614 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierR2.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierR2.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierR2EnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierR2EnumFactory.java index 050c032a3b6..bea56f94d80 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierR2EnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartQualifierR2EnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartType.java index ee71884716d..230591c430b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeEnumFactory.java index 02755b273cb..2983a3801af 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeR2.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeR2.java index e05d8b12008..67d3e2cef6d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeR2.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeR2.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeR2EnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeR2EnumFactory.java index ae7ebd710db..66bcd06fb4f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeR2EnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNamePartTypeR2EnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUse.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUse.java index 2106540e051..ec58d56971d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUse.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseEnumFactory.java index cad3d570e48..4b18fca1d94 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseR2.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseR2.java index 0c171efc6a3..44c89be6bf9 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseR2.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseR2.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseR2EnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseR2EnumFactory.java index ff9a1815e60..33124ec20a5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseR2EnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityNameUseR2EnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityRisk.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityRisk.java index f2601a03e36..5d72cd3ccce 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityRisk.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityRisk.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityRiskEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityRiskEnumFactory.java index 4e79b43d2e2..cc9dc99f05e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityRiskEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityRiskEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityStatus.java index 18a2891b172..a4da7bb495d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityStatusEnumFactory.java index 7e29324731b..f5607a9f317 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EntityStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EquipmentAlertLevel.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EquipmentAlertLevel.java index f134f0c9c72..f87c1c75ba2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EquipmentAlertLevel.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EquipmentAlertLevel.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EquipmentAlertLevelEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EquipmentAlertLevelEnumFactory.java index ffa17ffbd13..c4597de8953 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EquipmentAlertLevelEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EquipmentAlertLevelEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Ethnicity.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Ethnicity.java index 422ee5f6329..07cc283f687 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Ethnicity.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Ethnicity.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EthnicityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EthnicityEnumFactory.java index b207c703c85..1843ceb3370 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EthnicityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3EthnicityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ExposureMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ExposureMode.java index 9f54fa36302..e13510a2c34 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ExposureMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ExposureMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ExposureModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ExposureModeEnumFactory.java index 91370a80196..d0659d0d409 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ExposureModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ExposureModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GTSAbbreviation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GTSAbbreviation.java index 60e86b236a6..2e0d520778f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GTSAbbreviation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GTSAbbreviation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GTSAbbreviationEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GTSAbbreviationEnumFactory.java index f27264c7966..6565b0f2cf3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GTSAbbreviationEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GTSAbbreviationEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GenderStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GenderStatus.java index 09b6aada19b..fe69adfc082 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GenderStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GenderStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GenderStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GenderStatusEnumFactory.java index ff9818129b0..13af5d9758c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GenderStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3GenderStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HL7UpdateMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HL7UpdateMode.java index 399e3963ae8..f6f1cb5d469 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HL7UpdateMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HL7UpdateMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HL7UpdateModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HL7UpdateModeEnumFactory.java index 4190256cde3..aad2bd7ebe6 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HL7UpdateModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HL7UpdateModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7Realm.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7Realm.java index 39ccf78048d..375792aabb0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7Realm.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7Realm.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7RealmEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7RealmEnumFactory.java index c96fa95c7dd..c50cfa0537c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7RealmEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7RealmEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7V3Conformance.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7V3Conformance.java index bafa62fecb9..9a372a8de8b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7V3Conformance.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7V3Conformance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7V3ConformanceEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7V3ConformanceEnumFactory.java index 19ab86c45da..feeb0e5e92a 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7V3ConformanceEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3Hl7V3ConformanceEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HtmlLinkType.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HtmlLinkType.java index 1fd9bc66dd3..8013b5405d7 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HtmlLinkType.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HtmlLinkType.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HtmlLinkTypeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HtmlLinkTypeEnumFactory.java index 253c6d1b49f..6cc12945afe 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HtmlLinkTypeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3HtmlLinkTypeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierReliability.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierReliability.java index e148be11780..11b0256b806 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierReliability.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierReliability.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierReliabilityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierReliabilityEnumFactory.java index 0ea4583d94b..9b603e0a1b8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierReliabilityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierReliabilityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierScope.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierScope.java index 13852d67183..066cfd8c446 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierScope.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierScope.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierScopeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierScopeEnumFactory.java index ac6802e138b..db1e70ceb20 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierScopeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IdentifierScopeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IntegrityCheckAlgorithm.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IntegrityCheckAlgorithm.java index 3197eb0a06d..1fb6430455d 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IntegrityCheckAlgorithm.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IntegrityCheckAlgorithm.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IntegrityCheckAlgorithmEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IntegrityCheckAlgorithmEnumFactory.java index b25df4f8b08..528cdc7689b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IntegrityCheckAlgorithmEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3IntegrityCheckAlgorithmEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityMode.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityMode.java index 88ee1f02956..e0d3a2e23a3 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityMode.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityMode.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityModeEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityModeEnumFactory.java index 344459d36b0..668718b7a21 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityModeEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityModeEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityProficiency.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityProficiency.java index 8e13ac04486..5016771ecdd 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityProficiency.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityProficiency.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityProficiencyEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityProficiencyEnumFactory.java index 2cc21d1a4f3..477f8f35f2b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityProficiencyEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LanguageAbilityProficiencyEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LivingArrangement.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LivingArrangement.java index 341b84ed4e7..474a0c6b11b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LivingArrangement.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LivingArrangement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LivingArrangementEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LivingArrangementEnumFactory.java index 9d31aa87b4d..c05c74b080e 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LivingArrangementEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LivingArrangementEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalMarkupIgnore.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalMarkupIgnore.java index 53f8bf59cf4..2aee7ff5aed 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalMarkupIgnore.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalMarkupIgnore.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalMarkupIgnoreEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalMarkupIgnoreEnumFactory.java index d90e101ee78..71c2a1cf450 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalMarkupIgnoreEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalMarkupIgnoreEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalRemoteControlState.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalRemoteControlState.java index 3d32ab6bdc4..6b50d2a9529 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalRemoteControlState.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalRemoteControlState.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalRemoteControlStateEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalRemoteControlStateEnumFactory.java index d9e54128105..79f63e351a2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalRemoteControlStateEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3LocalRemoteControlStateEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ManagedParticipationStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ManagedParticipationStatus.java index 57785db7c5c..c9a5866e21f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ManagedParticipationStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ManagedParticipationStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ManagedParticipationStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ManagedParticipationStatusEnumFactory.java index ff854d40046..89673ad2099 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ManagedParticipationStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ManagedParticipationStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MapRelationship.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MapRelationship.java index 3011d3933d4..573e8b91a38 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MapRelationship.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MapRelationship.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MapRelationshipEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MapRelationshipEnumFactory.java index 98d38974d4f..790560d8cdf 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MapRelationshipEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MapRelationshipEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MaritalStatus.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MaritalStatus.java index 88488ea395b..4e6026412bc 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MaritalStatus.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MaritalStatus.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MaritalStatusEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MaritalStatusEnumFactory.java index b28853346bb..6f373775914 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MaritalStatusEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MaritalStatusEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MessageWaitingPriority.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MessageWaitingPriority.java index 2be55951273..ad6c6685a0c 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MessageWaitingPriority.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MessageWaitingPriority.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MessageWaitingPriorityEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MessageWaitingPriorityEnumFactory.java index d23f5d12adb..dfdf6d752b8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MessageWaitingPriorityEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3MessageWaitingPriorityEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ModifyIndicator.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ModifyIndicator.java index 14dfce74e4d..eec3c7c346f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ModifyIndicator.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ModifyIndicator.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ModifyIndicatorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ModifyIndicatorEnumFactory.java index d2d4331e875..375611275b0 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ModifyIndicatorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ModifyIndicatorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3NullFlavor.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3NullFlavor.java index 65565b51363..9adc0f47ac2 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3NullFlavor.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3NullFlavor.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3NullFlavorEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3NullFlavorEnumFactory.java index 6dea2eebddc..f7a6f3eb361 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3NullFlavorEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3NullFlavorEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ObservationInterpretation.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ObservationInterpretation.java index a39a4c51dcd..9864eeddbd8 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ObservationInterpretation.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ObservationInterpretation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.exceptions.FHIRException; @@ -95,6 +95,11 @@ public enum V3ObservationInterpretation { GREATER_THAN, /** * A valid result cannot be obtained for the specified component / analyte due to the presence of anti-complementary substances in the sample. + + + + Deprecation Comment: + This code is being deprecated to match the status in V2 Table 0078 "Interpretation Codes. */ AC, /** @@ -105,10 +110,20 @@ public enum V3ObservationInterpretation { IE, /** * A result cannot be considered valid for the specified component / analyte or organism due to failure in the quality control testing component. + + + + Deprecation Comment: + This code is being deprecated to match the status in V2 Table 0078 "Interpretation Codes. */ QCF, /** * A valid result cannot be obtained for the specified organism or cell line due to the presence of cytotoxic substances in the sample or culture. + + + + Deprecation Comment: + This code is being deprecated to match the status in V2 Table 0078 "Interpretation Codes. */ TOX, /** @@ -299,6 +314,13 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi Open Issue: EX, HX, LX: These three concepts do not seem to meet a clear need in the vocabulary, and their use in observation interpretation appears likely to be covered by other existing concepts (e.g., A, H, L). The only apparent significant difference is their reference to use in protocols for exclusion of study subjects. These concepts/codes were proposed by RCRIM for use in the CTLaboratory message. They were submitted and approved in the November 2005 Harmonization cycle in proposal "030103C_VOCAB_RCRIM_l_quade_RCRIM Obs Interp_20051028154455". However, this proposal was not fully implemented in the vocabulary. The proposal recommended creation of the x_ClinicalResearchExclusion domain in ObservationInterpretation with a value set including those three concepts/codes, but there is no subdomain of that name or equivalent with a binding to either of the value sets that contain these concepts/codes. Members of the OO WG have recently attempted to contact members of RCRIM regarding these concepts, both by email and at the recent WGM in Atlanta, without response. It is felt by OO that the best course of action to take at this time is to add this comprehensive Open Issue rather than deprecate these three concepts at this time, until further discussion is held. */ LX, + /** + * Hold for Medical Review + + + Usage Note: This code is not intended for use in V3 artifacts. It is included in the code system to maintain alignment with the V2 Table 0078 "Interpretation Codes." + */ + HM, /** * Interpretations of the presence or absence of a component / analyte or organism in a test or of a sign in a clinical observation. In keeping with laboratory data processing practice, these concepts provide a categorical interpretation of the "meaning" of the quantitative value for the same observation. */ @@ -344,6 +366,13 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi * This result has been evaluated in light of known contraindicators. Once those contraindicators have been taken into account the result is determined to be "Unexpected" (e.g., presence of non-prescribed drugs in a patient that is taking prescription medication for pain management). */ UNE, + /** + * Interpretation qualifiers in separate OBX segments + + + Usage Note: This code is not intended for use in V3 artifacts. It is included in the code system to maintain alignment with the V2 Table 0078 "Interpretation Codes." + */ + OBX, /** * Interpretations of the presence and level of reactivity of the specified component / analyte with the reagent in the performed laboratory test. */ @@ -447,6 +476,8 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi return HX; if ("LX".equals(codeString)) return LX; + if ("HM".equals(codeString)) + return HM; if ("ObservationInterpretationDetection".equals(codeString)) return OBSERVATIONINTERPRETATIONDETECTION; if ("IND".equals(codeString)) @@ -467,6 +498,8 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi return EXP; if ("UNE".equals(codeString)) return UNE; + if ("OBX".equals(codeString)) + return OBX; if ("ReactivityObservationInterpretation".equals(codeString)) return REACTIVITYOBSERVATIONINTERPRETATION; if ("NR".equals(codeString)) @@ -519,6 +552,7 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi case EX: return "EX"; case HX: return "HX"; case LX: return "LX"; + case HM: return "HM"; case OBSERVATIONINTERPRETATIONDETECTION: return "ObservationInterpretationDetection"; case IND: return "IND"; case E: return "E"; @@ -529,6 +563,7 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi case OBSERVATIONINTERPRETATIONEXPECTATION: return "ObservationInterpretationExpectation"; case EXP: return "EXP"; case UNE: return "UNE"; + case OBX: return "OBX"; case REACTIVITYOBSERVATIONINTERPRETATION: return "ReactivityObservationInterpretation"; case NR: return "NR"; case RR: return "RR"; @@ -552,10 +587,10 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi case _OBSERVATIONINTERPRETATIONEXCEPTIONS: return "Technical exceptions resulting in the inability to provide an interpretation. At most one allowed. Does not imply normality or severity."; case LESS_THAN: return "The result is below the minimum detection limit (the test procedure or equipment is the limiting factor).\r\n\n Synonyms: Below analytical limit, low off scale."; case GREATER_THAN: return "The result is above the maximum quantifiable limit (the test procedure or equipment is the limiting factor).\r\n\n Synonyms: Above analytical limit, high off scale."; - case AC: return "A valid result cannot be obtained for the specified component / analyte due to the presence of anti-complementary substances in the sample."; + case AC: return "A valid result cannot be obtained for the specified component / analyte due to the presence of anti-complementary substances in the sample.\r\n\n \n \n Deprecation Comment: \n This code is being deprecated to match the status in V2 Table 0078 \"Interpretation Codes."; case IE: return "There is insufficient evidence that the species in question is a good target for therapy with the drug. A categorical interpretation is not possible.\r\n\n [Note: A MIC with \"IE\" and/or a comment may be reported (without an accompanying S, I or R-categorization).]"; - case QCF: return "A result cannot be considered valid for the specified component / analyte or organism due to failure in the quality control testing component."; - case TOX: return "A valid result cannot be obtained for the specified organism or cell line due to the presence of cytotoxic substances in the sample or culture."; + case QCF: return "A result cannot be considered valid for the specified component / analyte or organism due to failure in the quality control testing component.\r\n\n \n \n Deprecation Comment: \n This code is being deprecated to match the status in V2 Table 0078 \"Interpretation Codes."; + case TOX: return "A valid result cannot be obtained for the specified organism or cell line due to the presence of cytotoxic substances in the sample or culture.\r\n\n \n \n Deprecation Comment: \n This code is being deprecated to match the status in V2 Table 0078 \"Interpretation Codes."; case _OBSERVATIONINTERPRETATIONNORMALITY: return "Interpretation of normality or degree of abnormality (including critical or \"alert\" level). Concepts in this category are mutually exclusive, i.e., at most one is allowed."; case A: return "The result or observation value is outside the reference range or expected norm (as defined for the respective test procedure).\r\n\n [Note: Typically applies to non-numeric results.]"; case AA: return "The result or observation value is outside a reference range or expected norm at a level at which immediate action should be considered for patient safety (as defined for the respective test procedure).\r\n\n [Note: Typically applies to non-numeric results. Analogous to critical/panic limits for numeric results.]"; @@ -581,6 +616,7 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi case EX: return "The observation/test result is interpreted as being outside the inclusion range for a particular protocol within which the result is being reported.\n\r\n\n Example: A positive result on a Hepatitis screening test.\n Open Issue: EX, HX, LX: These three concepts do not seem to meet a clear need in the vocabulary, and their use in observation interpretation appears likely to be covered by other existing concepts (e.g., A, H, L). The only apparent significant difference is their reference to use in protocols for exclusion of study subjects.\nThese concepts/codes were proposed by RCRIM for use in the CTLaboratory message. They were submitted and approved in the November 2005 Harmonization cycle in proposal \"030103C_VOCAB_RCRIM_l_quade_RCRIM Obs Interp_20051028154455\". However, this proposal was not fully implemented in the vocabulary. The proposal recommended creation of the x_ClinicalResearchExclusion domain in ObservationInterpretation with a value set including those three concepts/codes, but there is no subdomain of that name or equivalent with a binding to either of the value sets that contain these concepts/codes.\nMembers of the OO WG have recently attempted to contact members of RCRIM regarding these concepts, both by email and at the recent WGM in Atlanta, without response. It is felt by OO that the best course of action to take at this time is to add this comprehensive Open Issue rather than deprecate these three concepts at this time, until further discussion is held."; case HX: return "The observation/test result is interpreted as being outside the inclusion range for a particular protocol within which the result is being reported.\n\r\n\n Example: A positive result on a Hepatitis screening test.\n Open Issue: EX, HX, LX: These three concepts do not seem to meet a clear need in the vocabulary, and their use in observation interpretation appears likely to be covered by other existing concepts (e.g., A, H, L). The only apparent significant difference is their reference to use in protocols for exclusion of study subjects. These concepts/codes were proposed by RCRIM for use in the CTLaboratory message. They were submitted and approved in the November 2005 Harmonization cycle in proposal \"030103C_VOCAB_RCRIM_l_quade_RCRIM Obs Interp_20051028154455\". However, this proposal was not fully implemented in the vocabulary. The proposal recommended creation of the x_ClinicalResearchExclusion domain in ObservationInterpretation with a value set including those three concepts/codes, but there is no subdomain of that name or equivalent with a binding to either of the value sets that contain these concepts/codes. Members of the OO WG have recently attempted to contact members of RCRIM regarding these concepts, both by email and at the recent WGM in Atlanta, without response. It is felt by OO that the best course of action to take at this time is to add this comprehensive Open Issue rather than deprecate these three concepts at this time, until further discussion is held."; case LX: return "The numeric observation/test result is interpreted as being below the low threshold value for a particular protocol within which the result is being reported.\r\n\n Example: A Total White Blood Cell Count falling below a protocol-defined threshold value of 3000/mm^3\n Open Issue: EX, HX, LX: These three concepts do not seem to meet a clear need in the vocabulary, and their use in observation interpretation appears likely to be covered by other existing concepts (e.g., A, H, L). The only apparent significant difference is their reference to use in protocols for exclusion of study subjects. These concepts/codes were proposed by RCRIM for use in the CTLaboratory message. They were submitted and approved in the November 2005 Harmonization cycle in proposal \"030103C_VOCAB_RCRIM_l_quade_RCRIM Obs Interp_20051028154455\". However, this proposal was not fully implemented in the vocabulary. The proposal recommended creation of the x_ClinicalResearchExclusion domain in ObservationInterpretation with a value set including those three concepts/codes, but there is no subdomain of that name or equivalent with a binding to either of the value sets that contain these concepts/codes. Members of the OO WG have recently attempted to contact members of RCRIM regarding these concepts, both by email and at the recent WGM in Atlanta, without response. It is felt by OO that the best course of action to take at this time is to add this comprehensive Open Issue rather than deprecate these three concepts at this time, until further discussion is held."; + case HM: return "Hold for Medical Review\r\n\n \n Usage Note: This code is not intended for use in V3 artifacts. It is included in the code system to maintain alignment with the V2 Table 0078 \"Interpretation Codes.\""; case OBSERVATIONINTERPRETATIONDETECTION: return "Interpretations of the presence or absence of a component / analyte or organism in a test or of a sign in a clinical observation. In keeping with laboratory data processing practice, these concepts provide a categorical interpretation of the \"meaning\" of the quantitative value for the same observation."; case IND: return "The specified component / analyte, organism or clinical sign could neither be declared positive / negative nor detected / not detected by the performed test or procedure.\r\n\n \n Usage Note: For example, if the specimen was degraded, poorly processed, or was missing the required anatomic structures, then \"indeterminate\" (i.e. \"cannot be determined\") is the appropriate response, not \"equivocal\"."; case E: return "The test or procedure was successfully performed, but the results are borderline and can neither be declared positive / negative nor detected / not detected according to the current established criteria."; @@ -591,6 +627,7 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi case OBSERVATIONINTERPRETATIONEXPECTATION: return "Interpretation of the observed result taking into account additional information (contraindicators) about the patient's situation. Concepts in this category are mutually exclusive, i.e., at most one is allowed."; case EXP: return "This result has been evaluated in light of known contraindicators. Once those contraindicators have been taken into account the result is determined to be \"Expected\" (e.g., presence of drugs in a patient that is taking prescription medication for pain management)."; case UNE: return "This result has been evaluated in light of known contraindicators. Once those contraindicators have been taken into account the result is determined to be \"Unexpected\" (e.g., presence of non-prescribed drugs in a patient that is taking prescription medication for pain management)."; + case OBX: return "Interpretation qualifiers in separate OBX segments\r\n\n \n Usage Note: This code is not intended for use in V3 artifacts. It is included in the code system to maintain alignment with the V2 Table 0078 \"Interpretation Codes.\""; case REACTIVITYOBSERVATIONINTERPRETATION: return "Interpretations of the presence and level of reactivity of the specified component / analyte with the reagent in the performed laboratory test."; case NR: return "An absence finding used to indicate that the specified component / analyte did not react measurably with the reagent."; case RR: return "A presence finding used to indicate that the specified component / analyte reacted with the reagent above the reliably measurable limit of the performed test."; @@ -640,6 +677,7 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi case EX: return "outside threshold"; case HX: return "above high threshold"; case LX: return "below low threshold"; + case HM: return "Hold for Medical Review"; case OBSERVATIONINTERPRETATIONDETECTION: return "ObservationInterpretationDetection"; case IND: return "Indeterminate"; case E: return "Equivocal"; @@ -650,6 +688,7 @@ Members of the OO WG have recently attempted to contact members of RCRIM regardi case OBSERVATIONINTERPRETATIONEXPECTATION: return "ObservationInterpretationExpectation"; case EXP: return "Expected"; case UNE: return "Unexpected"; + case OBX: return "Interpretation qualifiers in separate OBX segments"; case REACTIVITYOBSERVATIONINTERPRETATION: return "ReactivityObservationInterpretation"; case NR: return "Non-reactive"; case RR: return "Reactive"; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ObservationInterpretationEnumFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ObservationInterpretationEnumFactory.java index b490897fcf3..625e9589b84 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ObservationInterpretationEnumFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/V3ObservationInterpretationEnumFactory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model.codesystems; */ -// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0 +// Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 import org.hl7.fhir.dstu3.model.EnumFactory; @@ -119,6 +119,8 @@ public class V3ObservationInterpretationEnumFactory implements EnumFactory list, String code) { + for (ConceptDefinitionComponent c : list) { + if (c.getCode().equals(code)) + return c; + ConceptDefinitionComponent s = findCode(c.getConcept(), code); + if (s != null) + return s; + } + return null; + } + } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/terminologies/ValueSetExpanderSimple.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/terminologies/ValueSetExpanderSimple.java index 03fe5372b3a..b7217351356 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/terminologies/ValueSetExpanderSimple.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/terminologies/ValueSetExpanderSimple.java @@ -65,6 +65,7 @@ import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent; import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent; import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent; import org.hl7.fhir.dstu3.utils.ToolingExtensions; +import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.NoTerminologyServiceException; import org.hl7.fhir.exceptions.TerminologyServiceException; import org.hl7.fhir.utilities.Utilities; @@ -95,7 +96,7 @@ public class ValueSetExpanderSimple implements ValueSetExpander { } - private ValueSetExpansionContainsComponent addCode(String system, String code, String display, ValueSetExpansionContainsComponent parent, List designations, ExpansionProfile profile, boolean isAbstract, List filters) { + private ValueSetExpansionContainsComponent addCode(String system, String code, String display, ValueSetExpansionContainsComponent parent, List designations, ExpansionProfile profile, boolean isAbstract, boolean inactive, List filters) { if (filters != null && !filters.isEmpty() && !filterContainsCode(filters, system, code)) return null; ValueSetExpansionContainsComponent n = new ValueSet.ValueSetExpansionContainsComponent(); @@ -103,6 +104,8 @@ public class ValueSetExpanderSimple implements ValueSetExpander { n.setCode(code); if (isAbstract) n.setAbstract(true); + if (inactive) + n.setInactive(true); if (profile.getIncludeDesignations() && designations != null) { for (ConceptDefinitionDesignationComponent t : designations) { @@ -157,15 +160,19 @@ public class ValueSetExpanderSimple implements ValueSetExpander { return null; } - private void addCodeAndDescendents(CodeSystem cs, String system, ConceptDefinitionComponent def, ValueSetExpansionContainsComponent parent, ExpansionProfile profile, List filters) { + private void addCodeAndDescendents(CodeSystem cs, String system, ConceptDefinitionComponent def, ValueSetExpansionContainsComponent parent, ExpansionProfile profile, List filters) throws FHIRException { if (!CodeSystemUtilities.isDeprecated(cs, def)) { ValueSetExpansionContainsComponent np = null; - boolean abs = CodeSystemUtilities.isAbstract(cs, def); + boolean abs = CodeSystemUtilities.isNotSelectable(cs, def); + boolean inc = CodeSystemUtilities.isInactive(cs, def); if (canBeHeirarchy || !abs) - np = addCode(system, def.getCode(), def.getDisplay(), parent, def.getDesignation(), profile, abs, filters); - for (ConceptDefinitionComponent c : def.getConcept()) + np = addCode(system, def.getCode(), def.getDisplay(), parent, def.getDesignation(), profile, abs, inc, filters); + for (ConceptDefinitionComponent c : def.getConcept()) addCodeAndDescendents(cs, system, c, np, profile, filters); - } + } else + for (ConceptDefinitionComponent c : def.getConcept()) + addCodeAndDescendents(cs, system, c, null, profile, filters); + } private void addCodes(ValueSetExpansionComponent expand, List params, ExpansionProfile profile, List filters) throws ETooCostly { @@ -307,7 +314,7 @@ public class ValueSetExpanderSimple implements ValueSetExpander { return null; } - private void handleCompose(ValueSetComposeComponent compose, List params, ExpansionProfile profile) throws TerminologyServiceException, ETooCostly, FileNotFoundException, IOException, NoTerminologyServiceException { + private void handleCompose(ValueSetComposeComponent compose, List params, ExpansionProfile profile) throws ETooCostly, FileNotFoundException, IOException, FHIRException { // Exclude comes first because we build up a map of things to exclude for (ConceptSetComponent inc : compose.getExclude()) excludeCodes(inc, params); @@ -335,8 +342,8 @@ public class ValueSetExpanderSimple implements ValueSetExpander { if (vso.getService() != null) throw new TerminologyServiceException("Unable to expand imported value set "+value); if (vs.hasVersion()) - if (!existsInParams(params, "version", new UriType(vs.getUrl()+"?version="+vs.getVersion()))) - params.add(new ValueSetExpansionParameterComponent().setName("version").setValue(new UriType(vs.getUrl()+"?version="+vs.getVersion()))); + if (!existsInParams(params, "version", new UriType(vs.getUrl()+"|"+vs.getVersion()))) + params.add(new ValueSetExpansionParameterComponent().setName("version").setValue(new UriType(vs.getUrl()+"|"+vs.getVersion()))); for (ValueSetExpansionParameterComponent p : vso.getValueset().getExpansion().getParameter()) { if (!existsInParams(params, p.getName(), p.getValue())) params.add(p); @@ -347,12 +354,12 @@ public class ValueSetExpanderSimple implements ValueSetExpander { private void copyImportContains(List list, ValueSetExpansionContainsComponent parent, ExpansionProfile profile, List filter) { for (ValueSetExpansionContainsComponent c : list) { - ValueSetExpansionContainsComponent np = addCode(c.getSystem(), c.getCode(), c.getDisplay(), parent, null, profile, c.getAbstract(), filter); + ValueSetExpansionContainsComponent np = addCode(c.getSystem(), c.getCode(), c.getDisplay(), parent, null, profile, c.getAbstract(), c.getInactive(), filter); copyImportContains(c.getContains(), np, profile, filter); } } - private void includeCodes(ConceptSetComponent inc, List params, ExpansionProfile profile) throws ETooCostly, org.hl7.fhir.exceptions.TerminologyServiceException, NoTerminologyServiceException, FileNotFoundException, IOException { + private void includeCodes(ConceptSetComponent inc, List params, ExpansionProfile profile) throws ETooCostly, FileNotFoundException, IOException, FHIRException { List imports = new ArrayList(); for (UriType imp : inc.getValueSet()) imports.add(importValueSet(imp.getValue(), params, profile)); @@ -379,8 +386,8 @@ public class ValueSetExpanderSimple implements ValueSetExpander { if (cs.getContent() != CodeSystemContentMode.COMPLETE) throw new TerminologyServiceException("Code system "+inc.getSystem().toString()+" is incomplete"); if (cs.hasVersion()) - if (!existsInParams(params, "version", new UriType(cs.getUrl()+"?version="+cs.getVersion()))) - params.add(new ValueSetExpansionParameterComponent().setName("version").setValue(new UriType(cs.getUrl()+"?version="+cs.getVersion()))); + if (!existsInParams(params, "version", new UriType(cs.getUrl()+"|"+cs.getVersion()))) + params.add(new ValueSetExpansionParameterComponent().setName("version").setValue(new UriType(cs.getUrl()+"|"+cs.getVersion()))); if (inc.getConcept().size() == 0 && inc.getFilter().size() == 0) { // special case - add all the code system @@ -392,7 +399,7 @@ public class ValueSetExpanderSimple implements ValueSetExpander { if (!inc.getConcept().isEmpty()) { canBeHeirarchy = false; for (ConceptReferenceComponent c : inc.getConcept()) { - addCode(inc.getSystem(), c.getCode(), Utilities.noString(c.getDisplay()) ? getCodeDisplay(cs, c.getCode()) : c.getDisplay(), null, convertDesignations(c.getDesignation()), profile, false, imports); + addCode(inc.getSystem(), c.getCode(), Utilities.noString(c.getDisplay()) ? getCodeDisplay(cs, c.getCode()) : c.getDisplay(), null, convertDesignations(c.getDesignation()), profile, false, CodeSystemUtilities.isInactive(cs, c.getCode()), imports); } } if (inc.getFilter().size() > 1) { @@ -402,11 +409,18 @@ public class ValueSetExpanderSimple implements ValueSetExpander { if (inc.getFilter().size() == 1) { ConceptSetFilterComponent fc = inc.getFilter().get(0); if ("concept".equals(fc.getProperty()) && fc.getOp() == FilterOperator.ISA) { - // special: all non-abstract codes in the target code system under the value + // special: all codes in the target code system under the value ConceptDefinitionComponent def = getConceptForCode(cs.getConcept(), fc.getValue()); if (def == null) throw new TerminologyServiceException("Code '"+fc.getValue()+"' not found in system '"+inc.getSystem()+"'"); addCodeAndDescendents(cs, inc.getSystem(), def, null, profile, imports); + } else if ("concept".equals(fc.getProperty()) && fc.getOp() == FilterOperator.DESCENDENTOF) { + // special: all codes in the target code system under the value + ConceptDefinitionComponent def = getConceptForCode(cs.getConcept(), fc.getValue()); + if (def == null) + throw new TerminologyServiceException("Code '"+fc.getValue()+"' not found in system '"+inc.getSystem()+"'"); + for (ConceptDefinitionComponent c : def.getConcept()) + addCodeAndDescendents(cs, inc.getSystem(), c, null, profile, imports); } else if ("display".equals(fc.getProperty()) && fc.getOp() == FilterOperator.EQUAL) { // gg; note: wtf is this: if the filter is display=v, look up the code 'v', and see if it's diplsay is 'v'? canBeHeirarchy = false; @@ -414,7 +428,7 @@ public class ValueSetExpanderSimple implements ValueSetExpander { if (def != null) { if (isNotBlank(def.getDisplay()) && isNotBlank(fc.getValue())) { if (def.getDisplay().contains(fc.getValue())) { - addCode(inc.getSystem(), def.getCode(), def.getDisplay(), null, def.getDesignation(), profile, CodeSystemUtilities.isAbstract(cs, def), imports); + addCode(inc.getSystem(), def.getCode(), def.getDisplay(), null, def.getDesignation(), profile, CodeSystemUtilities.isNotSelectable(cs, def), CodeSystemUtilities.isInactive(cs, def), imports); } } } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/FluentPathEngine.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/FHIRPathEngine.java similarity index 97% rename from hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/FluentPathEngine.java rename to hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/FHIRPathEngine.java index 2293dfef813..2c264ab3fa5 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/FluentPathEngine.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/FHIRPathEngine.java @@ -35,7 +35,7 @@ import org.hl7.fhir.dstu3.model.TimeType; import org.hl7.fhir.dstu3.model.TypeDetails; import org.hl7.fhir.dstu3.model.TypeDetails.ProfiledType; import org.hl7.fhir.dstu3.utils.FHIRLexer.FHIRLexerException; -import org.hl7.fhir.dstu3.utils.FluentPathEngine.IEvaluationContext.FunctionDetails; +import org.hl7.fhir.dstu3.utils.FHIRPathEngine.IEvaluationContext.FunctionDetails; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.PathEngineException; @@ -51,7 +51,7 @@ import ca.uhn.fhir.util.ElementUtil; * @author Grahame Grieve * */ -public class FluentPathEngine { +public class FHIRPathEngine { private IWorkerContext worker; private IEvaluationContext hostServices; private StringBuilder log = new StringBuilder(); @@ -134,7 +134,7 @@ public class FluentPathEngine { /** * @param worker - used when validating paths (@check), and used doing value set membership when executing tests (once that's defined) */ - public FluentPathEngine(IWorkerContext worker) { + public FHIRPathEngine(IWorkerContext worker) { super(); this.worker = worker; for (StructureDefinition sd : worker.allStructures()) { @@ -149,7 +149,7 @@ public class FluentPathEngine { // --- 3 methods to override in children ------------------------------------------------------- // if you don't override, it falls through to the using the base reference implementation - // HAPI overrides to these to support extensing the base model + // HAPI overrides to these to support extending the base model public IEvaluationContext getHostServices() { return hostServices; diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/NarrativeGenerator.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/NarrativeGenerator.java new file mode 100644 index 00000000000..47666433107 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/NarrativeGenerator.java @@ -0,0 +1,9 @@ +package org.hl7.fhir.dstu3.utils; + +public class NarrativeGenerator { + + public static String describeSystem(String theSystem) { + return theSystem; + } + +} diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/StructureMapUtilities.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/StructureMapUtilities.java index 9564f9aae69..0a31b2ca119 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/StructureMapUtilities.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/StructureMapUtilities.java @@ -66,7 +66,7 @@ import org.hl7.fhir.dstu3.model.ValueSet; import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent; import org.hl7.fhir.dstu3.terminologies.ValueSetExpander.ValueSetExpansionOutcome; import org.hl7.fhir.dstu3.utils.FHIRLexer.FHIRLexerException; -import org.hl7.fhir.dstu3.utils.FluentPathEngine.IEvaluationContext; +import org.hl7.fhir.dstu3.utils.FHIRPathEngine.IEvaluationContext; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.PathEngineException; @@ -148,7 +148,7 @@ public class StructureMapUtilities { } private IWorkerContext worker; - private FluentPathEngine fpe; + private FHIRPathEngine fpe; private Map library; private ITransformerServices services; private ProfileKnowledgeProvider pkp; @@ -160,7 +160,7 @@ public class StructureMapUtilities { this.library = library; this.services = services; this.pkp = pkp; - fpe = new FluentPathEngine(worker); + fpe = new FHIRPathEngine(worker); fpe.setHostServices(new FluentPathHostServices()); } @@ -169,20 +169,20 @@ public class StructureMapUtilities { this.worker = worker; this.library = library; this.services = services; - fpe = new FluentPathEngine(worker); + fpe = new FHIRPathEngine(worker); } public StructureMapUtilities(IWorkerContext worker, Map library) { super(); this.worker = worker; this.library = library; - fpe = new FluentPathEngine(worker); + fpe = new FHIRPathEngine(worker); } public StructureMapUtilities(IWorkerContext worker) { super(); this.worker = worker; - fpe = new FluentPathEngine(worker); + fpe = new FHIRPathEngine(worker); } public StructureMapUtilities(IWorkerContext worker, ITransformerServices services) { @@ -194,10 +194,9 @@ public class StructureMapUtilities { library.put(bc.getUrl(), (StructureMap) bc); } this.services = services; - fpe = new FluentPathEngine(worker); + fpe = new FHIRPathEngine(worker); } - public static String render(StructureMap map) { StringBuilder b = new StringBuilder(); b.append("map \""); @@ -571,8 +570,10 @@ public class StructureMapUtilities { private ConceptMapEquivalence readEquivalence(FHIRLexer lexer) throws FHIRLexerException { String token = lexer.take(); - if (token.equals("=")) - return ConceptMapEquivalence.EQUAL; + if (token.equals(":")) + return ConceptMapEquivalence.RELATEDTO; + if (token.equals("=")) + return ConceptMapEquivalence.EQUAL; if (token.equals("==")) return ConceptMapEquivalence.EQUIVALENT; if (token.equals("!=")) @@ -1862,7 +1863,7 @@ public class StructureMapUtilities { if (Utilities.noString(code)) throw new FHIRException("Describe Transform, but the code is blank"); Coding c = buildCoding(uri, code); - return (c.getSystem())+"#"+c.getCode()+(c.hasDisplay() ? "("+c.getDisplay()+")" : ""); + return NarrativeGenerator.describeSystem(c.getSystem())+"#"+c.getCode()+(c.hasDisplay() ? "("+c.getDisplay()+")" : ""); } @@ -1944,7 +1945,10 @@ public class StructureMapUtilities { if (t != null) { if (pt.hasProfiles()) { for (String p : pt.getProfiles()) - ednew.addType().setCode(t).setProfile(p); + if (t.equals("Reference")) + ednew.addType().setCode(t).setTargetProfile(p); + else + ednew.addType().setCode(t).setProfile(p); } else ednew.addType().setCode(t); } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/JsonTrackingParser.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/JsonTrackingParser.java new file mode 100644 index 00000000000..76147fd9fab --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/JsonTrackingParser.java @@ -0,0 +1,498 @@ +package org.hl7.fhir.dstu3.utils.formats; + +import java.math.BigDecimal; +import java.util.Map; +import java.util.Stack; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonNull; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; + + +/** + * This is created to get a json parser that can track line numbers... grr... + * + * @author Grahame Grieve + * + */ +public class JsonTrackingParser { + + public enum TokenType { + Open, Close, String, Number, Colon, Comma, OpenArray, CloseArray, Eof, Null, Boolean; + } + + public class LocationData { + private int line; + private int col; + + protected LocationData(int line, int col) { + super(); + this.line = line; + this.col = col; + } + + public int getLine() { + return line; + } + + public int getCol() { + return col; + } + + public void newLine() { + line++; + col = 1; + } + + public LocationData copy() { + return new LocationData(line, col); + } + } + + private class State { + private String name; + private boolean isProp; + protected State(String name, boolean isProp) { + super(); + this.name = name; + this.isProp = isProp; + } + public String getName() { + return name; + } + public boolean isProp() { + return isProp; + } + } + + private class Lexer { + private String source; + private int cursor; + private String peek; + private String value; + private TokenType type; + private Stack states = new Stack(); + private LocationData lastLocationBWS; + private LocationData lastLocationAWS; + private LocationData location; + private StringBuilder b = new StringBuilder(); + + public Lexer(String source) throws FHIRException { + this.source = source; + cursor = -1; + location = new LocationData(1, 1); + start(); + } + + private boolean more() { + return peek != null || cursor < source.length(); + } + + private String getNext(int length) throws FHIRException { + String result = ""; + if (peek != null) { + if (peek.length() > length) { + result = peek.substring(0, length); + peek = peek.substring(length); + } else { + result = peek; + peek = null; + } + } + if (result.length() < length) { + int len = length - result.length(); + if (cursor > source.length() - len) + throw error("Attempt to read past end of source"); + result = result + source.substring(cursor+1, cursor+len+1); + cursor = cursor + len; + } + for (char ch : result.toCharArray()) + if (ch == '\n') + location.newLine(); + else + location.col++; + return result; + } + + private char getNextChar() throws FHIRException { + if (peek != null) { + char ch = peek.charAt(0); + peek = peek.length() == 1 ? null : peek.substring(1); + return ch; + } else { + cursor++; + if (cursor >= source.length()) + return (char) 0; + char ch = source.charAt(cursor); + if (ch == '\n') { + location.newLine(); + } else { + location.col++; + } + return ch; + } + } + + private void push(char ch){ + peek = peek == null ? String.valueOf(ch) : String.valueOf(ch)+peek; + } + + private void parseWord(String word, char ch, TokenType type) throws FHIRException { + this.type = type; + value = ""+ch+getNext(word.length()-1); + if (!value.equals(word)) + throw error("Syntax error in json reading special word "+word); + } + + private FHIRException error(String msg) { + return new FHIRException("Error parsing JSON source: "+msg+" at Line "+Integer.toString(location.line)+" (path=["+path()+"])"); + } + + private String path() { + if (states.empty()) + return value; + else { + String result = ""; + for (State s : states) + result = result + '/'+ s.getName(); + result = result + value; + return result; + } + } + + public void start() throws FHIRException { +// char ch = getNextChar(); +// if (ch = '\.uEF') +// begin +// // skip BOM +// getNextChar(); +// getNextChar(); +// end +// else +// push(ch); + next(); + } + + public TokenType getType() { + return type; + } + + public String getValue() { + return value; + } + + + public LocationData getLastLocationBWS() { + return lastLocationBWS; + } + + public LocationData getLastLocationAWS() { + return lastLocationAWS; + } + + public void next() throws FHIRException { + lastLocationBWS = location.copy(); + char ch; + do { + ch = getNextChar(); + } while (more() && Utilities.charInSet(ch, ' ', '\r', '\n', '\t')); + lastLocationAWS = location.copy(); + + if (!more()) { + type = TokenType.Eof; + } else { + switch (ch) { + case '{' : + type = TokenType.Open; + break; + case '}' : + type = TokenType.Close; + break; + case '"' : + type = TokenType.String; + b.setLength(0); + do { + ch = getNextChar(); + if (ch == '\\') { + ch = getNextChar(); + switch (ch) { + case '"': b.append('"'); break; + case '\\': b.append('\\'); break; + case '/': b.append('/'); break; + case 'n': b.append('\n'); break; + case 'r': b.append('\r'); break; + case 't': b.append('\t'); break; + case 'u': b.append((char) Integer.parseInt(getNext(4), 16)); break; + default : + throw error("unknown escape sequence: \\"+ch); + } + ch = ' '; + } else if (ch != '"') + b.append(ch); + } while (more() && (ch != '"')); + if (!more()) + throw error("premature termination of json stream during a string"); + value = b.toString(); + break; + case ':' : + type = TokenType.Colon; + break; + case ',' : + type = TokenType.Comma; + break; + case '[' : + type = TokenType.OpenArray; + break; + case ']' : + type = TokenType.CloseArray; + break; + case 't' : + parseWord("true", ch, TokenType.Boolean); + break; + case 'f' : + parseWord("false", ch, TokenType.Boolean); + break; + case 'n' : + parseWord("null", ch, TokenType.Null); + break; + default: + if ((ch >= '0' && ch <= '9') || ch == '-') { + type = TokenType.Number; + b.setLength(0); + while (more() && ((ch >= '0' && ch <= '9') || ch == '-' || ch == '.')) { + b.append(ch); + ch = getNextChar(); + } + value = b.toString(); + push(ch); + } else + throw error("Unexpected char '"+ch+"' in json stream"); + } + } + } + + public String consume(TokenType type) throws FHIRException { + if (this.type != type) + throw error("JSON syntax error - found "+type.toString()+" expecting "+type.toString()); + String result = value; + next(); + return result; + } + + } + + enum ItemType { + Object, String, Number, Boolean, Array, End, Eof, Null; + } + private Map map; + private Lexer lexer; + private ItemType itemType = ItemType.Object; + private String itemName; + private String itemValue; + + public static JsonObject parse(String source, Map map) throws FHIRException { + JsonTrackingParser self = new JsonTrackingParser(); + self.map = map; + return self.parse(source); + } + + private JsonObject parse(String source) throws FHIRException { + lexer = new Lexer(source); + JsonObject result = new JsonObject(); + LocationData loc = lexer.location.copy(); + if (lexer.getType() == TokenType.Open) { + lexer.next(); + lexer.states.push(new State("", false)); + } + else + throw lexer.error("Unexpected content at start of JSON: "+lexer.getType().toString()); + + parseProperty(); + readObject(result, true); + map.put(result, loc); + return result; + } + + private void readObject(JsonObject obj, boolean root) throws FHIRException { + map.put(obj, lexer.location.copy()); + + while (!(itemType == ItemType.End) || (root && (itemType == ItemType.Eof))) { + if (obj.has(itemName)) + throw lexer.error("Duplicated property name: "+itemName); + + switch (itemType) { + case Object: + JsonObject child = new JsonObject(); //(obj.path+'.'+ItemName); + LocationData loc = lexer.location.copy(); + obj.add(itemName, child); + next(); + readObject(child, false); + map.put(obj, loc); + break; + case Boolean : + JsonPrimitive v = new JsonPrimitive(Boolean.valueOf(itemValue)); + obj.add(itemName, v); + map.put(v, lexer.location.copy()); + break; + case String: + v = new JsonPrimitive(itemValue); + obj.add(itemName, v); + map.put(v, lexer.location.copy()); + break; + case Number: + v = new JsonPrimitive(new BigDecimal(itemValue)); + obj.add(itemName, v); + map.put(v, lexer.location.copy()); + break; + case Null: + JsonNull n = new JsonNull(); + obj.add(itemName, n); + map.put(n, lexer.location.copy()); + break; + case Array: + JsonArray arr = new JsonArray(); // (obj.path+'.'+ItemName); + loc = lexer.location.copy(); + obj.add(itemName, arr); + next(); + readArray(arr, false); + map.put(arr, loc); + break; + case Eof : + throw lexer.error("Unexpected End of File"); + } + next(); + } + } + + private void readArray(JsonArray arr, boolean root) throws FHIRException { + while (!((itemType == ItemType.End) || (root && (itemType == ItemType.Eof)))) { + switch (itemType) { + case Object: + JsonObject obj = new JsonObject(); // (arr.path+'['+inttostr(i)+']'); + LocationData loc = lexer.location.copy(); + arr.add(obj); + next(); + readObject(obj, false); + map.put(obj, loc); + break; + case String: + JsonPrimitive v = new JsonPrimitive(itemValue); + arr.add(v); + map.put(v, lexer.location.copy()); + break; + case Number: + v = new JsonPrimitive(new BigDecimal(itemValue)); + arr.add(v); + map.put(v, lexer.location.copy()); + break; + case Null : + JsonNull n = new JsonNull(); + arr.add(n); + map.put(n, lexer.location.copy()); + break; + case Array: + JsonArray child = new JsonArray(); // (arr.path+'['+inttostr(i)+']'); + loc = lexer.location.copy(); + arr.add(child); + next(); + readArray(child, false); + map.put(arr, loc); + break; + case Eof : + throw lexer.error("Unexpected End of File"); + } + next(); + } + } + + private void next() throws FHIRException { + switch (itemType) { + case Object : + lexer.consume(TokenType.Open); + lexer.states.push(new State(itemName, false)); + if (lexer.getType() == TokenType.Close) { + itemType = ItemType.End; + lexer.next(); + } else + parseProperty(); + break; + case Null: + case String: + case Number: + case End: + case Boolean : + if (itemType == ItemType.End) + lexer.states.pop(); + if (lexer.getType() == TokenType.Comma) { + lexer.next(); + parseProperty(); + } else if (lexer.getType() == TokenType.Close) { + itemType = ItemType.End; + lexer.next(); + } else if (lexer.getType() == TokenType.CloseArray) { + itemType = ItemType.End; + lexer.next(); + } else if (lexer.getType() == TokenType.Eof) { + itemType = ItemType.Eof; + } else + throw lexer.error("Unexpected JSON syntax"); + break; + case Array : + lexer.next(); + lexer.states.push(new State(itemName+"[]", true)); + parseProperty(); + break; + case Eof : + throw lexer.error("JSON Syntax Error - attempt to read past end of json stream"); + default: + throw lexer.error("not done yet (a): "+itemType.toString()); + } + } + + private void parseProperty() throws FHIRException { + if (!lexer.states.peek().isProp) { + itemName = lexer.consume(TokenType.String); + itemValue = null; + lexer.consume(TokenType.Colon); + } + switch (lexer.getType()) { + case Null : + itemType = ItemType.Null; + itemValue = lexer.value; + lexer.next(); + break; + case String : + itemType = ItemType.String; + itemValue = lexer.value; + lexer.next(); + break; + case Boolean : + itemType = ItemType.Boolean; + itemValue = lexer.value; + lexer.next(); + break; + case Number : + itemType = ItemType.Number; + itemValue = lexer.value; + lexer.next(); + break; + case Open : + itemType = ItemType.Object; + break; + case OpenArray : + itemType = ItemType.Array; + break; + case CloseArray : + itemType = ItemType.End; + break; + // case Close, , case Colon, case Comma, case OpenArray, ! + default: + throw lexer.error("not done yet (b): "+lexer.getType().toString()); + } + } +} diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/XmlLocationAnnotator.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/XmlLocationAnnotator.java new file mode 100644 index 00000000000..a0379f8923a --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/XmlLocationAnnotator.java @@ -0,0 +1,102 @@ +package org.hl7.fhir.dstu3.utils.formats; + +import java.util.Stack; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.UserDataHandler; +import org.w3c.dom.events.Event; +import org.w3c.dom.events.EventListener; +import org.w3c.dom.events.EventTarget; +import org.w3c.dom.events.MutationEvent; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.LocatorImpl; +import org.xml.sax.helpers.XMLFilterImpl; + +// http://javacoalface.blogspot.com.au/2011/04/line-and-column-numbers-in-xml-dom.html + +public class XmlLocationAnnotator extends XMLFilterImpl { + + private Locator locator; + private Stack locatorStack = new Stack(); + private Stack elementStack = new Stack(); + private UserDataHandler dataHandler = new LocationDataHandler(); + + public XmlLocationAnnotator(XMLReader xmlReader, Document dom) { + super(xmlReader); + + // Add listener to DOM, so we know which node was added. + EventListener modListener = new EventListener() { + @Override + public void handleEvent(Event e) { + EventTarget target = ((MutationEvent) e).getTarget(); + elementStack.push((Element) target); + } + }; + ((EventTarget) dom).addEventListener("DOMNodeInserted", modListener, true); + } + + @Override + public void setDocumentLocator(Locator locator) { + super.setDocumentLocator(locator); + this.locator = locator; + } + + @Override + public void startElement(String uri, String localName, + String qName, Attributes atts) throws SAXException { + super.startElement(uri, localName, qName, atts); + + // Keep snapshot of start location, + // for later when end of element is found. + locatorStack.push(new LocatorImpl(locator)); + } + + @Override + public void endElement(String uri, String localName, String qName) + throws SAXException { + + // Mutation event fired by the adding of element end, + // and so lastAddedElement will be set. + super.endElement(uri, localName, qName); + + if (locatorStack.size() > 0) { + Locator startLocator = locatorStack.pop(); + + XmlLocationData location = new XmlLocationData( + startLocator.getSystemId(), + startLocator.getLineNumber(), + startLocator.getColumnNumber(), + locator.getLineNumber(), + locator.getColumnNumber()); + Element lastAddedElement = elementStack.pop(); + + lastAddedElement.setUserData( + XmlLocationData.LOCATION_DATA_KEY, location, + dataHandler); + } + } + + // Ensure location data copied to any new DOM node. + private class LocationDataHandler implements UserDataHandler { + + @Override + public void handle(short operation, String key, Object data, + Node src, Node dst) { + + if (src != null && dst != null) { + XmlLocationData locatonData = (XmlLocationData) + src.getUserData(XmlLocationData.LOCATION_DATA_KEY); + + if (locatonData != null) { + dst.setUserData(XmlLocationData.LOCATION_DATA_KEY, + locatonData, dataHandler); + } + } + } + } +} diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/XmlLocationData.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/XmlLocationData.java new file mode 100644 index 00000000000..9476b341948 --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/utils/formats/XmlLocationData.java @@ -0,0 +1,49 @@ +package org.hl7.fhir.dstu3.utils.formats; + +public class XmlLocationData { + + public static final String LOCATION_DATA_KEY = "locationDataKey"; + + private final String systemId; + private final int startLine; + private final int startColumn; + private final int endLine; + private final int endColumn; + + public XmlLocationData(String systemId, int startLine, + int startColumn, int endLine, int endColumn) { + super(); + this.systemId = systemId; + this.startLine = startLine; + this.startColumn = startColumn; + this.endLine = endLine; + this.endColumn = endColumn; + } + + public String getSystemId() { + return systemId; + } + + public int getStartLine() { + return startLine; + } + + public int getStartColumn() { + return startColumn; + } + + public int getEndLine() { + return endLine; + } + + public int getEndColumn() { + return endColumn; + } + + @Override + public String toString() { + return getSystemId() + "[line " + startLine + ":" + + startColumn + " to line " + endLine + ":" + + endColumn + "]"; + } +} diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/validation/InstanceValidator.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/validation/InstanceValidator.java index 7fe9316ac0d..2d683887094 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/validation/InstanceValidator.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/validation/InstanceValidator.java @@ -7,8 +7,10 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import org.hl7.fhir.dstu3.conformance.ProfileUtilities; import org.hl7.fhir.dstu3.context.IWorkerContext; @@ -73,7 +75,7 @@ import org.hl7.fhir.dstu3.model.Type; import org.hl7.fhir.dstu3.model.UriType; import org.hl7.fhir.dstu3.model.ValueSet; import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent; -import org.hl7.fhir.dstu3.utils.FluentPathEngine; +import org.hl7.fhir.dstu3.utils.FHIRPathEngine; import org.hl7.fhir.dstu3.validation.ValidationMessage.Source; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; @@ -106,14 +108,14 @@ import ca.uhn.fhir.util.ObjectUtil; public class InstanceValidator extends BaseValidator implements IResourceValidator { - private boolean anyExtensionsAllowed; - private boolean noInvariantChecks; + private IWorkerContext context; + private FHIRPathEngine fpe; - private BestPracticeWarningLevel bpWarnings; // configuration items private CheckDisplayOption checkDisplay; - private IWorkerContext context; - private FluentPathEngine fpe; + private boolean anyExtensionsAllowed; + private boolean noInvariantChecks; + private BestPracticeWarningLevel bpWarnings; private List extensionDomains = new ArrayList(); @@ -133,7 +135,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat private long fpeTime = 0; private boolean noBindingMsgSuppressed; - private HashMap resourceProfilesMap = new HashMap(); + private HashMap resourceProfilesMap; private IValidatorResourceFetcher fetcher; /* @@ -166,11 +168,18 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat */ public class ResourceProfiles { private Element resource; + private Element owner; + private NodeStack stack; private HashMap profiles; private boolean processed; - public ResourceProfiles(Element resource) { + public ResourceProfiles(Element resource, NodeStack stack) { this.resource = resource; + if (this.resource.getName().equals("contained")) + this.owner = stack.parent.element; + else + this.owner = resource; + this.stack = stack; this.profiles = new HashMap(); this.processed = false; } @@ -183,6 +192,14 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat processed = true; } + public NodeStack getStack() { + return stack; + } + + public Element getOwner() { + return owner; + } + public boolean hasProfiles() { return !profiles.isEmpty(); } @@ -191,6 +208,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat for (String profile : profiles) addProfile(errors, profile, path, element); } + public boolean addProfile(List errors, String profile, String path, Element element) { StructureDefinition sd = context.fetchResource(StructureDefinition.class, profile); if (warning(errors, IssueType.INVALID, element.line(), element.col(), path, sd != null, "StructureDefinition reference \"{0}\" could not be resolved", profile)) { @@ -198,6 +216,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat "StructureDefinition has no snapshot - validation is against the snapshot, so it must be provided")) { if (!profiles.containsKey(sd)) { profiles.put(sd, new ProfileUsage(sd)); + addAncestorProfiles(sd); return true; } } @@ -205,6 +224,17 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat return false; } + public void addAncestorProfiles(StructureDefinition sd) { + if (sd.getDerivation().equals(StructureDefinition.TypeDerivationRule.CONSTRAINT)) { + StructureDefinition parentSd = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition()); + if (parentSd != null && !profiles.containsKey(parentSd)) { + ProfileUsage pu = new ProfileUsage(parentSd); + pu.setChecked(); // We're going to check the child, so no need to check the parent + profiles.put(parentSd, pu); + } + } + } + public List uncheckedProfiles() { List uncheckedProfiles = new ArrayList(); for (ProfileUsage profileUsage : profiles.values()) { @@ -230,7 +260,14 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat public InstanceValidator(IWorkerContext theContext) { super(); this.context = theContext; - fpe = new FluentPathEngine(context); + fpe = new FHIRPathEngine(context); + source = Source.InstanceValidator; + } + + public InstanceValidator(ValidationEngine engine) { + super(); + this.context = engine.getContext(); + fpe = engine.getFpe(); source = Source.InstanceValidator; } @@ -420,9 +457,26 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat @Override public void validate(Object appContext, List errors, Element element) throws Exception { - validate(appContext, errors, element, new ValidationProfileSet()); + ValidationProfileSet profileSet = new ValidationProfileSet(); + validate(appContext, errors, element, profileSet); } + private void validateRemainder(Object appContext, List errors) throws IOException, FHIRException { + boolean processedResource; + do { + processedResource = false; + Set keys = new HashSet(); + keys.addAll(resourceProfilesMap.keySet()); + for (Element resource : keys) { + ResourceProfiles rp = resourceProfilesMap.get(resource); + if (rp.hasUncheckedProfiles()) { + processedResource = true; + start(appContext, errors, rp.getOwner(), resource, null, rp.getStack()); + } + } + } while (processedResource); + } + @Override public void validate(Object appContext, List errors, Element element, String profile) throws Exception { validate(appContext, errors, element, new ValidationProfileSet(profile)); @@ -437,7 +491,16 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat public void validate(Object appContext, List errors, Element element, ValidationProfileSet profiles) throws Exception { // this is the main entry point; all the other entry points end up here coming here... long t = System.nanoTime(); + boolean isRoot = false; + if (resourceProfilesMap == null) { + resourceProfilesMap = new HashMap(); + isRoot = true; + } validateResource(appContext, errors, element, element, null, profiles, resourceIdRule, new NodeStack(element)); + if (isRoot) { + validateRemainder(appContext, errors); + resourceProfilesMap = null; + } overall = System.nanoTime() - t; } @@ -649,7 +712,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (system != null && code != null) { try { if (checkCode(errors, element, path, code, system, display)) - if (theElementCntext != null && theElementCntext.getBinding() != null) { + if (theElementCntext != null && theElementCntext.hasBinding()) { ElementDefinitionBindingComponent binding = theElementCntext.getBinding(); if (warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, binding != null, "Binding for " + path + " missing")) { if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) { @@ -926,10 +989,10 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat List parts = new ArrayList(); focus.getNamedChildren("family", parts); - if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, parts.size() == fixed.getFamily().size(), - "Expected " + Integer.toString(fixed.getFamily().size()) + " but found " + Integer.toString(parts.size()) + " family elements")) { + if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, parts.size() > 0 == fixed.hasFamily(), + "Expected " + (fixed.hasFamily() ? "1" : "0") + " but found " + Integer.toString(parts.size()) + " family elements")) { for (int i = 0; i < parts.size(); i++) - checkFixedValue(errors, path + ".family", parts.get(i), fixed.getFamily().get(i), "family", focus); + checkFixedValue(errors, path + ".family", parts.get(i), fixed.getFamilyElement(), "family", focus); } focus.getNamedChildren("given", parts); if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, parts.size() == fixed.getGiven().size(), @@ -1131,7 +1194,13 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } private void checkReference(Object appContext, List errors, String path, Element element, StructureDefinition profile, ElementDefinition container, String parentType, NodeStack stack) throws FHIRException, IOException { - String ref = element.getNamedChildValue("reference"); + String ref = null; + try { + // Do this inside a try because invalid instances might provide more than one reference. + ref = element.getNamedChildValue("reference"); + } catch (Error e) { + + } if (Utilities.noString(ref)) { // todo - what should we do in this case? warning(errors, IssueType.STRUCTURE, element.line(), element.col(), path, !Utilities.noString(element.getNamedChildValue("display")), "A Reference without an actual reference should have a display"); @@ -1153,7 +1222,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat for (TypeRefComponent type : container.getType()) { if (!ok && type.getCode().equals("Reference")) { // we validate as much as we can. First, can we infer a type from the profile? (Need to change this to targetProfile when Grahame's ready) - if (!type.hasProfile() || type.getTargetProfile().equals("http://hl7.org/fhir/StructureDefinition/Resource")) + if (!type.hasTargetProfile() || type.getTargetProfile().equals("http://hl7.org/fhir/StructureDefinition/Resource")) ok = true; else { String pr = type.getTargetProfile(); // Need to change to targetProfile when Grahame's ready @@ -1163,8 +1232,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, bt != null, "Unable to resolve the profile reference '" + pr + "'")) { b.append(bt); ok = bt.equals(ft); - if (ok) { - doResourceProfile(appContext, we, pr, errors, stack, path, element); + if (ok && we!=null) { + doResourceProfile(appContext, we, pr, errors, stack.push(we, -1, null, null), path, element); } } else ok = true; // suppress following check @@ -1191,26 +1260,23 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } private void doResourceProfile(Object appContext, Element resource, String profile, List errors, NodeStack stack, String path, Element element) throws FHIRException, IOException { - ResourceProfiles resourceProfiles = addResourceProfile(errors, resource, profile, path, element); + ResourceProfiles resourceProfiles = addResourceProfile(errors, resource, profile, path, element, stack); if (resourceProfiles.isProcessed()) { - for (ProfileUsage profileUsage : resourceProfiles.uncheckedProfiles()) { - profileUsage.setChecked(); - start(appContext, errors, resource, resource, null, stack); - } + start(appContext, errors, resource, resource, null, stack); } } - private ResourceProfiles getResourceProfiles(Element resource) { + private ResourceProfiles getResourceProfiles(Element resource, NodeStack stack) { ResourceProfiles resourceProfiles = resourceProfilesMap.get(resource); if (resourceProfiles==null) { - resourceProfiles = new ResourceProfiles(resource); + resourceProfiles = new ResourceProfiles(resource, stack); resourceProfilesMap.put(resource, resourceProfiles); } return resourceProfiles; } - private ResourceProfiles addResourceProfile(List errors, Element resource, String profile, String path, Element element) { - ResourceProfiles resourceProfiles = getResourceProfiles(resource); + private ResourceProfiles addResourceProfile(List errors, Element resource, String profile, String path, Element element, NodeStack stack) { + ResourceProfiles resourceProfiles = getResourceProfiles(resource, stack); resourceProfiles.addProfile(errors, profile, path, element); return resourceProfiles; } @@ -1296,16 +1362,6 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat return null; } - private String genFullUrl(String bundleBase, String entryBase, String type, String id) { - String base = Utilities.noString(entryBase) ? bundleBase : entryBase; - if (Utilities.noString(base)) { - return type + "/" + id; - } else if ("urn:uuid".equals(base) || "urn:oid".equals(base)) - return base + id; - else - return Utilities.appendSlash(base) + type + "/" + id; - } - public BestPracticeWarningLevel getBasePracticeWarningLevel() { return bpWarnings; } @@ -1728,7 +1784,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat // the resource in the bundle String fullUrl = null; // we're going to try to work this out as we go up while (stack != null && stack.getElement() != null) { - if (stack.getElement().getSpecial() == SpecialElement.BUNDLE_ENTRY && fullUrl==null) { + if (stack.getElement().getSpecial() == SpecialElement.BUNDLE_ENTRY && fullUrl==null && stack.parent.getElement().getName().equals("entry")) { fullUrl = stack.parent.getElement().getChildValue("fullUrl"); // we don't try to resolve contained references across this boundary if (fullUrl==null) rule(errors, IssueType.REQUIRED, stack.parent.getElement().line(), stack.parent.getElement().col(), stack.parent.getLiteralPath(), fullUrl!=null, "Bundle entry missing fullUrl"); @@ -1945,7 +2001,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat // the instance validator had no issues against the base resource profile private void start(Object appContext, List errors, Element resource, Element element, StructureDefinition defn, NodeStack stack) throws FHIRException, FHIRException, IOException { // profile is valid, and matches the resource name - ResourceProfiles resourceProfiles = getResourceProfiles(resource); + ResourceProfiles resourceProfiles = getResourceProfiles(element, stack); if (!resourceProfiles.isProcessed()) checkDeclaredProfiles(resourceProfiles, errors, resource, element, stack); @@ -2510,8 +2566,15 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } private void validateBundleReference(List errors, List entries, Element ref, String name, NodeStack stack, String fullUrl, String type, String id) { - if (ref != null && !Utilities.noString(ref.getNamedChildValue("reference"))) { - Element target = resolveInBundle(entries, ref.getNamedChildValue("reference"), fullUrl, type, id); + String reference = null; + try { + reference = ref.getNamedChildValue("reference"); + } catch (Error e) { + + } + + if (ref != null && !Utilities.noString(reference)) { + Element target = resolveInBundle(entries, reference, fullUrl, type, id); rule(errors, IssueType.INVALID, ref.line(), ref.col(), stack.addToLiteralPath("reference"), target != null, "Unable to resolve the target of the reference in the bundle (" + name + ")"); } } @@ -2553,7 +2616,13 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat // System.out.println(" "+stack.getLiteralPath()+" "+Long.toString((System.nanoTime() - time) / 1000000)); // time = System.nanoTime(); - checkInvariants(errors, stack.getLiteralPath(), profile, definition, null, null, resource, element); + if (resource.getName().equals("contained")) { + NodeStack ancestor = stack; + while (!ancestor.element.isResource() || ancestor.element.getName().equals("contained")) + ancestor = ancestor.parent; + checkInvariants(errors, stack.getLiteralPath(), profile, definition, null, null, ancestor.element, element); + } else + checkInvariants(errors, stack.getLiteralPath(), profile, definition, null, null, resource, element); if (definition.getFixed()!=null) checkFixedValue(errors, stack.getLiteralPath(), element, definition.getFixed(), definition.getSliceName(), null); @@ -2604,23 +2673,25 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } else if (slice != null && !slice.getPath().equals(ed.getPath())) slice = null; - if (process) { +// if (process) { for (ElementInfo ei : children) { boolean match = false; - if (slice == null) { + if (slice == null || slice == ed) { match = nameMatches(ei.name, tail(ed.getPath())); } else { - ei.slice = slice; +// ei.slice = slice; if (nameMatches(ei.name, tail(ed.getPath()))) try { match = sliceMatches(appContext, ei.element, ei.path, slice, ed, profile, errors, stack); + if (match) + ei.slice = slice; } catch (FHIRException e) { unsupportedSlicing = true; childUnsupportedSlicing = true; } } if (match) { - if (rule(errors, IssueType.INVALID, ei.line(), ei.col(), ei.path, ei.definition == null, "Profile " + profile.getUrl() + ", Element matches more than one slice")) { + if (rule(errors, IssueType.INVALID, ei.line(), ei.col(), ei.path, ei.definition == null || ei.definition == slice, "Profile " + profile.getUrl() + ", Element matches more than one slice")) { ei.definition = ed; if (ei.slice == null) { ei.index = i; @@ -2633,7 +2704,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat problematicPaths.add(ed.getPath()); } } - } +// } } int last = -1; int lastSlice = -1; @@ -2679,9 +2750,20 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat for (ElementDefinition ed : childDefinitions) { if (ed.getRepresentation().isEmpty()) { // ignore xml attributes int count = 0; + List slices = null; + if (ed.hasSlicing()) + slices = ProfileUtilities.getSliceList(profile, ed); for (ElementInfo ei : children) if (ei.definition == ed) count++; + else if (slices!=null) { + for (ElementDefinition sed : slices) { + if (ei.definition == sed) { + count++; + break; + } + } + } String location = "Profile " + profile.getUrl() + ", Element '" + stack.getLiteralPath() + "." + tail(ed.getPath()) + (ed.hasSliceName()? "[" + ed.getSliceName() + "]": ""); if (ed.getMin() > 0) { if (problematicPaths.contains(ed.getPath())) @@ -2701,7 +2783,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } } - // 4. check order if any slices are orderd. (todo) + // 4. check order if any slices are ordered. (todo) // 5. inspect each child for validity for (ElementInfo ei : children) { @@ -2926,7 +3008,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (defn == null) defn = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + resourceName); if (profiles!=null) - getResourceProfiles(resource).addProfiles(errors, profiles.getCanonicalAll(), stack.getLiteralPath(), element); + getResourceProfiles(resource, stack).addProfiles(errors, profiles.getCanonicalAll(), stack.getLiteralPath(), element); sdTime = sdTime + (System.nanoTime() - t); ok = rule(errors, IssueType.INVALID, element.line(), element.col(), stack.addToLiteralPath(resourceName), defn != null, "No definition found for resource type '" + resourceName + "'"); } diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/validation/ValidationEngine.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/validation/ValidationEngine.java new file mode 100644 index 00000000000..b57471a787a --- /dev/null +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/validation/ValidationEngine.java @@ -0,0 +1,16 @@ +package org.hl7.fhir.dstu3.validation; + +import org.hl7.fhir.dstu3.context.IWorkerContext; +import org.hl7.fhir.dstu3.utils.FHIRPathEngine; + +public class ValidationEngine { + + public IWorkerContext getContext() { + return null; + } + + public FHIRPathEngine getFpe() { + return null; + } + +} diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java deleted file mode 100644 index 0329f1bc4ce..00000000000 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java +++ /dev/null @@ -1,1114 +0,0 @@ -/* -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. - -*/ -package org.hl7.fhir.utilities.xhtml; - -import java.io.*; -import java.util.*; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - -public class XhtmlParser { - public static final String XHTML_NS = "http://www.w3.org/1999/xhtml"; - - public class NSMap { - private Map nslist = new HashMap(); - - public NSMap(NSMap nsm) { - if (nsm != null) - nslist.putAll(nsm.nslist); - } - - public void def(String ns) { - nslist.put("", ns); - } - - public void ns(String abbrev, String ns) { - nslist.put(abbrev, ns); - } - - public String def() { - return nslist.get(""); - } - - public boolean hasDef() { - return nslist.containsKey(""); - } - - public String get(String abbrev) { - return nslist.containsKey(abbrev) ? nslist.get(abbrev) : "http://error/undefined-namespace"; - } - } - - public class QName { - private String ns; - private String name; - - public QName(String src) { - if (src.contains(":")) { - ns = src.substring(0, src.indexOf(":")); - name = src.substring(src.indexOf(":")+1); - } else { - ns = null; - name = src; - } - } - - public String getName() { - return name; - } - - public boolean hasNs() { - return ns != null; - } - - public String getNs() { - return ns; - } - - } - - private Set elements = new HashSet(); - private Set attributes = new HashSet(); - - - public XhtmlParser() { - super(); - policy = ParserSecurityPolicy.Accept; // for general parsing - - // set up sets - elements.add("p"); - elements.add("br"); - elements.add("div"); - elements.add("h1"); - elements.add("h2"); - elements.add("h3"); - elements.add("h4"); - elements.add("h5"); - elements.add("h6"); - elements.add("a"); - elements.add("span"); - elements.add("b"); - elements.add("em"); - elements.add("i"); - elements.add("strong"); - elements.add("small"); - elements.add("big"); - elements.add("tt"); - elements.add("small"); - elements.add("dfn"); - elements.add("q"); - elements.add("var"); - elements.add("abbr"); - elements.add("acronym"); - elements.add("cite"); - elements.add("blockquote"); - elements.add("hr"); - elements.add("address"); - elements.add("bdo"); - elements.add("kbd"); - elements.add("q"); - elements.add("sub"); - elements.add("sup"); - elements.add("ul"); - elements.add("ol"); - elements.add("li"); - elements.add("dl"); - elements.add("dt"); - elements.add("dd"); - elements.add("pre"); - elements.add("table"); - elements.add("caption"); - elements.add("colgroup"); - elements.add("col"); - elements.add("thead"); - elements.add("tr"); - elements.add("tfoot"); - elements.add("tbody"); - elements.add("th"); - elements.add("td"); - elements.add("code"); - elements.add("samp"); - elements.add("img"); - elements.add("map"); - elements.add("area"); - - attributes.add("title"); - attributes.add("style"); - attributes.add("class"); - attributes.add("id"); - attributes.add("lang"); - attributes.add("xml:lang"); - attributes.add("dir"); - attributes.add("accesskey"); - attributes.add("tabindex"); - // tables: - attributes.add("span"); - attributes.add("width"); - attributes.add("align"); - attributes.add("valign"); - attributes.add("char"); - attributes.add("charoff"); - attributes.add("abbr"); - attributes.add("axis"); - attributes.add("headers"); - attributes.add("scope"); - attributes.add("rowspan"); - attributes.add("colspan"); - - attributes.add("a.href"); - attributes.add("a.name"); - attributes.add("img.src"); - attributes.add("img.border"); - attributes.add("div.xmlns"); - attributes.add("blockquote.cite"); - attributes.add("q.cite"); - attributes.add("a.charset"); - attributes.add("a.type"); - attributes.add("a.name"); - attributes.add("a.href"); - attributes.add("a.hreflang"); - attributes.add("a.rel"); - attributes.add("a.rev"); - attributes.add("a.shape"); - attributes.add("a.coords"); - attributes.add("img.src"); - attributes.add("img.alt"); - attributes.add("img.longdesc"); - attributes.add("img.height"); - attributes.add("img.width"); - attributes.add("img.usemap"); - attributes.add("img.ismap"); - attributes.add("map.name"); - attributes.add("area.shape"); - attributes.add("area.coords"); - attributes.add("area.href"); - attributes.add("area.nohref"); - attributes.add("area.alt"); - attributes.add("table.summary"); - attributes.add("table.width"); - attributes.add("table.border"); - attributes.add("table.frame"); - attributes.add("table.rules"); - attributes.add("table.cellspacing"); - attributes.add("table.cellpadding"); -} - -public enum ParserSecurityPolicy { - Accept, - Drop, - Reject - } - - private ParserSecurityPolicy policy; - - private boolean trimWhitespace; - private boolean mustBeWellFormed = true; - private boolean validatorMode; - - public boolean isTrimWhitespace() { - return trimWhitespace; - } - - public void setTrimWhitespace(boolean trimWhitespace) { - this.trimWhitespace = trimWhitespace; - } - - public boolean isMustBeWellFormed() { - return mustBeWellFormed; - } - - public void setMustBeWellFormed(boolean mustBeWellFormed) { - this.mustBeWellFormed = mustBeWellFormed; - } - - - public boolean isValidatorMode() { - return validatorMode; - } - - public XhtmlParser setValidatorMode(boolean validatorMode) { - this.validatorMode = validatorMode; - return this; - } - - public ParserSecurityPolicy getPolicy() { - return policy; - } - - public void setPolicy(ParserSecurityPolicy policy) { - this.policy = policy; - } - - public XhtmlNode parseHtmlNode(Element node) throws FHIRFormatError { - return parseHtmlNode(node, null); - } - - public XhtmlNode parseHtmlNode(Element node, String defaultNS) throws FHIRFormatError { - XhtmlNode res = parseNode(node, defaultNS); - if (res.getNsDecl() == null) - res.getAttributes().put("xmlns", XHTML_NS); - return res; - } - - private XhtmlNode parseNode(Element node, String defaultNS) throws FHIRFormatError { - XhtmlNode res = new XhtmlNode(NodeType.Element); - res.setName(node.getLocalName()); - defaultNS = checkNS(res, node, defaultNS); - for (int i = 0; i < node.getAttributes().getLength(); i++) { - Attr attr = (Attr) node.getAttributes().item(i); - if (attributeIsOk(res.getName(), attr.getName(), attr.getValue()) && !attr.getLocalName().startsWith("xmlns")) - res.getAttributes().put(attr.getName(), attr.getValue()); - } - Node child = node.getFirstChild(); - while (child != null) { - if (child.getNodeType() == Node.TEXT_NODE) { - res.addText(child.getTextContent()); - } else if (child.getNodeType() == Node.COMMENT_NODE) { - res.addComment(child.getTextContent()); - } else if (child.getNodeType() == Node.ELEMENT_NODE) { - if (elementIsOk(child.getLocalName())) - res.getChildNodes().add(parseNode((Element) child, defaultNS)); - } else - throw new FHIRFormatError("Unhandled XHTML feature: "+Integer.toString(child.getNodeType())+descLoc()); - child = child.getNextSibling(); - } - return res; - } - - private String checkNS(XhtmlNode res, Element node, String defaultNS) { - if (!validatorMode) - return null; - String ns = node.getNamespaceURI(); - if (ns == null) - return null; - if (!ns.equals(defaultNS)) { - res.getAttributes().put("xmlns", ns); - return ns; - } - return defaultNS; - } - - public XhtmlNode parseHtmlNode(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError { - XhtmlNode res = parseNode(xpp); - if (res.getNsDecl() == null) - res.getAttributes().put("xmlns", XHTML_NS); - return res; - - } - private XhtmlNode parseNode(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError { - XhtmlNode res = new XhtmlNode(NodeType.Element); - res.setName(xpp.getName()); - - for (int i = 0; i < xpp.getAttributeCount(); i++) { - if (attributeIsOk(xpp.getName(), xpp.getAttributeName(i), xpp.getAttributeValue(i))) - res.getAttributes().put(xpp.getAttributeName(i), xpp.getAttributeValue(i)); - } - int eventType = xpp.next(); - while (eventType != XmlPullParser.END_TAG) { - if (eventType == XmlPullParser.TEXT) { - res.addText(xpp.getText()); - xpp.next(); - } else if (eventType == XmlPullParser.COMMENT) { - res.addComment(xpp.getText()); - xpp.next(); - } else if (eventType == XmlPullParser.START_TAG) { - if (elementIsOk(xpp.getName())) - res.getChildNodes().add(parseNode(xpp)); - } else - throw new FHIRFormatError("Unhandled XHTML feature: "+Integer.toString(eventType)+descLoc()); - eventType = xpp.getEventType(); - } - xpp.next(); - return res; - } - - private boolean attributeIsOk(String elem, String attr, String value) throws FHIRFormatError { - if (validatorMode) - return true; - boolean ok = attributes.contains(attr) || attributes.contains(elem+"."+attr); - if (ok) - return true; - else switch (policy) { - case Accept: return true; - case Drop: return false; - case Reject: throw new FHIRFormatError("Illegal HTML attribute "+elem+"."+attr); - } - - if ((elem+"."+attr).equals("img.src") && !(value.startsWith("#") || value.startsWith("http:") || value.startsWith("https:"))) { - switch (policy) { - case Accept: return true; - case Drop: return false; - case Reject: throw new FHIRFormatError("Illegal Image Reference "+value); - } - } - return false; - } - -private boolean elementIsOk(String name) throws FHIRFormatError { - if (validatorMode) - return true; - boolean ok = elements.contains(name); - if (ok) - return true; - else switch (policy) { - case Accept: return true; - case Drop: return false; - case Reject: throw new FHIRFormatError("Illegal HTML element "+name); - } - return false; -} - - private String descLoc() { - return " at line "+Integer.toString(line)+" column "+Integer.toString(col); - } - - private Reader rdr; - private String cache = ""; - private XhtmlNode unwindPoint; - private String lastText = ""; - private int line = 1; - private int col = 0; - private char lastChar; - - public XhtmlDocument parse(String source, String entryName) throws FHIRFormatError, IOException { - rdr = new StringReader(source); - return parse(entryName); - } - - public XhtmlDocument parse(InputStream input, String entryName) throws FHIRFormatError, IOException { - rdr = new InputStreamReader(input, "UTF-8"); - return parse(entryName); - } - - private XhtmlDocument parse(String entryName) throws FHIRFormatError, IOException - { - XhtmlDocument result = new XhtmlDocument(); - skipWhiteSpaceAndComments(result); - if (peekChar() != '<') - throw new FHIRFormatError("Unable to Parse HTML - does not start with tag. Found "+peekChar()+descLoc()); - readChar(); - QName n = new QName(readName().toLowerCase()); - if ((entryName != null) && !n.getName().equals(entryName)) - throw new FHIRFormatError("Unable to Parse HTML - starts with '"+n+"' not '"+entryName+"'"+descLoc()); - XhtmlNode root = result.addTag(n.getName()); - parseAttributes(root); - NSMap nsm = checkNamespaces(n, root, null, true); - if (readChar() == '/') { - if (peekChar() != '>') - throw new FHIRFormatError("unexpected non-end of element "+n+" "+descLoc()); - readChar(); - } else { - unwindPoint = null; - List p = new ArrayList(); - parseElementInner(root, p, nsm); - } - return result; - } - - private NSMap checkNamespaces(QName n, XhtmlNode node, NSMap nsm, boolean root) { - // what we do here is strip out any stated namespace attributes, putting them in the namesapce map - // then we figure out what the namespace of this element is, and state it explicitly if it's not the default - - // but we don't bother with any of this if we're not validating - if (!validatorMode) - return null; - NSMap result = new NSMap(nsm); - List nsattrs = new ArrayList(); - for (String an : node.getAttributes().keySet()) { - if (an.equals("xmlns")) { - result.def(node.getAttribute(an)); - nsattrs.add(an); - } - if (an.startsWith("xmlns:")) { - result.ns(an.substring(6), node.getAttribute(an)); - nsattrs.add(an); - } - } - for (String s : nsattrs) - node.getAttributes().remove(s); - if (n.hasNs()) { - String nns = result.get(n.getNs()); - if (!nns.equals(result.def())) { - node.getAttributes().put("xmlns", nns); - result.def(nns); - } - } else if (root && result.hasDef()) { - node.getAttributes().put("xmlns", result.def()); - } - return result; - } - - private void addTextNode(XhtmlNode node, StringBuilder s) - { - String t = isTrimWhitespace() ? s.toString().trim() : s.toString(); - if (t.length() > 0) - { - lastText = t; - // System.out.println(t); - node.addText(t); - s.setLength(0); - } - } - private void parseElementInner(XhtmlNode node, List parents, NSMap nsm) throws FHIRFormatError, IOException - { - StringBuilder s = new StringBuilder(); - while (peekChar() != '\0' && !parents.contains(unwindPoint) && !(node == unwindPoint)) - { - if (peekChar() == '<') - { - addTextNode(node, s); - readChar(); - if (peekChar() == '!') { - String sc = readToCommentEnd(); - if (sc.startsWith("DOCTYPE")) - throw new FHIRFormatError("Malformed XHTML: Found a DocType declaration, and these are not allowed (XXE security vulnerability protection)"); - node.addComment(sc); - } else if (peekChar() == '?') - node.addComment(readToTagEnd()); - else if (peekChar() == '/') { - readChar(); - QName n = new QName(readToTagEnd()); - if (node.getName().equals(n.getName())) - return; - else - { - if (mustBeWellFormed) - throw new FHIRFormatError("Malformed XHTML: Found \"\" expecting \"\""+descLoc()); - for (int i = parents.size() - 1; i >= 0; i--) - { - if (parents.get(i).getName().equals(n)) - unwindPoint = parents.get(i); - } - if (unwindPoint != null) - { - for (int i = parents.size(); i > 0; i--) - { - if (i < parents.size() && parents.get(i) == unwindPoint) - return; - if (i == parents.size()) - { - parents.get(i - 1).getChildNodes().addAll(node.getChildNodes()); - node.getChildNodes().clear(); - } - else - { - parents.get(i - 1).getChildNodes().addAll(parents.get(i).getChildNodes()); - parents.get(i).getChildNodes().clear(); - } - } - } - } - } - else if (Character.isLetterOrDigit(peekChar())) - { - parseElement(node, parents, nsm); - } - else - throw new FHIRFormatError("Unable to Parse HTML - node '" + node.getName() + "' has unexpected content '"+peekChar()+"' (last text = '"+lastText+"'"+descLoc()); - } - else if (peekChar() == '&') - { - parseLiteral(s); - } - else - s.append(readChar()); - } - addTextNode(node, s); - } - - private void parseElement(XhtmlNode parent, List parents, NSMap nsm) throws IOException, FHIRFormatError - { - QName name = new QName(readName()); - XhtmlNode node = parent.addTag(name.getName()); - List newParents = new ArrayList(); - newParents.addAll(parents); - newParents.add(parent); - parseAttributes(node); - nsm = checkNamespaces(name, node, nsm, false); - if (readChar() == '/') { - if (peekChar() != '>') - throw new FHIRFormatError("unexpected non-end of element "+name+" "+descLoc()); - readChar(); - } else { - parseElementInner(node, newParents, nsm); - } - } - - private void parseAttributes(XhtmlNode node) throws FHIRFormatError, IOException - { - while (Character.isWhitespace(peekChar())) - readChar(); - while (peekChar() != '>' && peekChar() != '/' && peekChar() != '\0') - { - String name = readName(); - if (name.length() == 0) - { - throw new FHIRFormatError("Unable to read attribute on <"+node.getName()+">"+descLoc()); - } - while (Character.isWhitespace(peekChar())) - readChar(); - - if (isNameChar(peekChar()) || peekChar() == '>' || peekChar() == '/') - node.getAttributes().put(name, null); - else if (peekChar() != '=') - { - throw new FHIRFormatError("Unable to read attribute '"+name+"' value on <"+node.getName()+">"+descLoc()); - } - else - { - readChar(); - while (Character.isWhitespace(peekChar())) - readChar(); - if (peekChar() == '"' || peekChar() == '\'') - node.getAttributes().put(name, parseAttributeValue(readChar())); - else - node.getAttributes().put(name, parseAttributeValue('\0')); - } - while (Character.isWhitespace(peekChar())) - readChar(); - } - } - - private String parseAttributeValue(char term) throws IOException, FHIRFormatError - { - StringBuilder b = new StringBuilder(); - while (peekChar() != '\0' && peekChar() != '>' && (term != '\0' || peekChar() != '/') && peekChar() != term) - { - if (peekChar() == '&') - { - parseLiteral(b); - } - else - b.append(readChar()); - } - if (peekChar() == term) - readChar(); - return b.toString(); - } - - - private void skipWhiteSpaceAndComments(XhtmlNode focus) throws IOException, FHIRFormatError { - while (Character.isWhitespace(peekChar()) || (peekChar() == 0xfeff)) - readChar(); - if (peekChar() == '<') - { - char ch = readChar(); - if (peekChar() == '!') { - readChar(); - if (peekChar() == '-') { - readChar(); - if (peekChar() == '-') { - readChar(); - if (peekChar() == ' ') - readChar(); - focus.addComment(readToCommentEnd()); - } else - throw new FHIRFormatError("unrecognised element type 0) - return cache.charAt(0); - else if (!rdr.ready()) - return '\0'; - else - { - char c = (char)rdr.read(); - if (c == (char)-1) - { - cache = ""; - return '\0'; - } - cache = Character.toString(c); - return c; - } - } - - private char readChar() throws IOException - { - char c; - if (cache.length() > 0) - { - c = cache.charAt(0); - cache = cache.length() == 1 ? "" : cache.substring(1); - } - else if (!rdr.ready()) - c = '\0'; - else - c = (char)rdr.read(); - if (c == '\r' || c == '\n') { - if (c == '\r' || lastChar != '\r') { - line++; - col = 0; - } - lastChar = c; - } - col++; - return c; - } - - private String readToTagEnd() throws IOException, FHIRFormatError - { - StringBuilder s = new StringBuilder(); - while (peekChar() != '>' && peekChar() != '\0') - s.append(readChar()); - if (peekChar() != '\0') - { - readChar(); - skipWhiteSpace(); - } else if (mustBeWellFormed) - throw new FHIRFormatError("Unexpected termination of html source"+descLoc()); - return s.toString(); - } - - private String readToCommentEnd() throws IOException, FHIRFormatError - { - if (peekChar() == '!') - readChar(); - StringBuilder s = new StringBuilder(); - - boolean simple = true; - if (peekChar() == '-') { - readChar(); - simple = peekChar() != '-'; - if (simple) - s.append('-'); - else - readChar(); - } - - boolean done = false; - while (!done) { - char c = peekChar(); - if (c == '-') { - readChar(); - if (peekChar() == '-') { - readChar(); - if (peekChar() == '>') { - done = true; - } else - s.append("--"); - } else - s.append('-'); - } else if (simple && peekChar() == '>') { - done = true; - } else if (c != '\0') - s.append(readChar()); - else if (mustBeWellFormed) - throw new FHIRFormatError("Unexpected termination of html source"+descLoc()); - } - if (peekChar() != '\0') - { - readChar(); - skipWhiteSpace(); - } - return s.toString(); - } - - private boolean isNameChar(char ch) - { - return Character.isLetterOrDigit(ch) || ch == '_' || ch == '-' || ch == ':'; - } - - private String readName() throws IOException - { - StringBuilder s = new StringBuilder(); - while (isNameChar(peekChar())) - s.append(readChar()); - return s.toString(); - } - - private String readUntil(char ch) throws IOException - { - StringBuilder s = new StringBuilder(); - while (peekChar() != 0 && peekChar() != ch) - s.append(readChar()); - readChar(); - return s.toString(); - } - - private void parseLiteral(StringBuilder s) throws IOException, FHIRFormatError - { -// UInt16 w; - readChar(); - String c = readUntil(';'); - if (c.equals("apos")) - s.append('\''); - else if (c.equals("quot")) - s.append('"'); - else if (c.equals("nbsp")) - s.append(XhtmlNode.NBSP); - else if (c.equals("amp")) - s.append('&'); - else if (c.equals("gt")) - s.append('>'); - else if (c.equals("lt")) - s.append('<'); - else if (c.equals("copy")) - s.append((char) 169); - else if (c.equals("reg")) - s.append((char) 174); - else if (c.equals("sect")) - s.append((char) 0xA7); - else if (c.charAt(0) == '#') { - if (isInteger(c.substring(1), 10)) - s.append((char) Integer.parseInt(c.substring(1))); - else if (isInteger(c.substring(1), 16)) - s.append((char) Integer.parseInt(c.substring(1), 16)); - } - else if (c.equals("fnof")) - s.append((char)402); // latin small f with hook = function = florin, U+0192 ISOtech --> - else if (c.equals("Alpha")) - s.append((char)913); // greek capital letter alpha, U+0391 - else if (c.equals("Beta")) - s.append((char)914); // greek capital letter beta, U+0392 - else if (c.equals("Gamma")) - s.append((char)915); // greek capital letter gamma, U+0393 ISOgrk3 - else if (c.equals("Delta")) - s.append((char)916); // greek capital letter delta, U+0394 ISOgrk3 - else if (c.equals("Epsilon")) - s.append((char)917); // greek capital letter epsilon, U+0395 - else if (c.equals("Zeta")) - s.append((char)918); // greek capital letter zeta, U+0396 - else if (c.equals("Eta")) - s.append((char)919); // greek capital letter eta, U+0397 - else if (c.equals("Theta")) - s.append((char)920); // greek capital letter theta, U+0398 ISOgrk3 - else if (c.equals("Iota")) - s.append((char)921); // greek capital letter iota, U+0399 - else if (c.equals("Kappa")) - s.append((char)922); // greek capital letter kappa, U+039A - else if (c.equals("Lambda")) - s.append((char)923); // greek capital letter lambda, U+039B ISOgrk3 - else if (c.equals("Mu")) - s.append((char)924); // greek capital letter mu, U+039C - else if (c.equals("Nu")) - s.append((char)925); // greek capital letter nu, U+039D - else if (c.equals("Xi")) - s.append((char)926); // greek capital letter xi, U+039E ISOgrk3 - else if (c.equals("Omicron")) - s.append((char)927); // greek capital letter omicron, U+039F - else if (c.equals("Pi")) - s.append((char)928); // greek capital letter pi, U+03A0 ISOgrk3 - else if (c.equals("Rho")) - s.append((char)929); // greek capital letter rho, U+03A1 - else if (c.equals("Sigma")) - s.append((char)931); // greek capital letter sigma, U+03A3 ISOgrk3 - else if (c.equals("Tau")) - s.append((char)932); // greek capital letter tau, U+03A4 - else if (c.equals("Upsilon")) - s.append((char)933); // greek capital letter upsilon, U+03A5 ISOgrk3 - else if (c.equals("Phi")) - s.append((char)934); // greek capital letter phi, U+03A6 ISOgrk3 - else if (c.equals("Chi")) - s.append((char)935); // greek capital letter chi, U+03A7 - else if (c.equals("Psi")) - s.append((char)936); // greek capital letter psi, U+03A8 ISOgrk3 - else if (c.equals("Omega")) - s.append((char)937); // greek capital letter omega, U+03A9 ISOgrk3 - else if (c.equals("alpha")) - s.append((char)945); // greek small letter alpha, U+03B1 ISOgrk3 - else if (c.equals("beta")) - s.append((char)946); // greek small letter beta, U+03B2 ISOgrk3 - else if (c.equals("gamma")) - s.append((char)947); // greek small letter gamma, U+03B3 ISOgrk3 - else if (c.equals("delta")) - s.append((char)948); // greek small letter delta, U+03B4 ISOgrk3 - else if (c.equals("epsilon")) - s.append((char)949); // greek small letter epsilon, U+03B5 ISOgrk3 - else if (c.equals("zeta")) - s.append((char)950); // greek small letter zeta, U+03B6 ISOgrk3 - else if (c.equals("eta")) - s.append((char)951); // greek small letter eta, U+03B7 ISOgrk3 - else if (c.equals("theta")) - s.append((char)952); // greek small letter theta, U+03B8 ISOgrk3 - else if (c.equals("iota")) - s.append((char)953); // greek small letter iota, U+03B9 ISOgrk3 - else if (c.equals("kappa")) - s.append((char)954); // greek small letter kappa, U+03BA ISOgrk3 - else if (c.equals("lambda")) - s.append((char)955); // greek small letter lambda, U+03BB ISOgrk3 - else if (c.equals("mu")) - s.append((char)956); // greek small letter mu, U+03BC ISOgrk3 - else if (c.equals("nu")) - s.append((char)957); // greek small letter nu, U+03BD ISOgrk3 - else if (c.equals("xi")) - s.append((char)958); // greek small letter xi, U+03BE ISOgrk3 - else if (c.equals("omicron")) - s.append((char)959); // greek small letter omicron, U+03BF NEW - else if (c.equals("pi")) - s.append((char)960); // greek small letter pi, U+03C0 ISOgrk3 - else if (c.equals("rho")) - s.append((char)961); // greek small letter rho, U+03C1 ISOgrk3 - else if (c.equals("sigmaf")) - s.append((char)962); // greek small letter final sigma, U+03C2 ISOgrk3 - else if (c.equals("sigma")) - s.append((char)963); // greek small letter sigma, U+03C3 ISOgrk3 - else if (c.equals("tau")) - s.append((char)964); // greek small letter tau, U+03C4 ISOgrk3 - else if (c.equals("upsilon")) - s.append((char)965); // greek small letter upsilon, U+03C5 ISOgrk3 - else if (c.equals("phi")) - s.append((char)966); // greek small letter phi, U+03C6 ISOgrk3 - else if (c.equals("chi")) - s.append((char)967); // greek small letter chi, U+03C7 ISOgrk3 - else if (c.equals("psi")) - s.append((char)968); // greek small letter psi, U+03C8 ISOgrk3 - else if (c.equals("omega")) - s.append((char)969); // greek small letter omega, U+03C9 ISOgrk3 - else if (c.equals("thetasym")) - s.append((char)977); // greek small letter theta symbol, U+03D1 NEW - else if (c.equals("upsih")) - s.append((char)978); // greek upsilon with hook symbol, U+03D2 NEW - else if (c.equals("piv")) - s.append((char)982); // greek pi symbol, U+03D6 ISOgrk3 - else if (c.equals("bull")) - s.append((char)8226); // bullet = black small circle, U+2022 ISOpub - else if (c.equals("hellip")) - s.append((char)8230); // horizontal ellipsis = three dot leader, U+2026 ISOpub - else if (c.equals("prime")) - s.append((char)8242); // prime = minutes = feet, U+2032 ISOtech - else if (c.equals("Prime")) - s.append((char)8243); // double prime = seconds = inches, U+2033 ISOtech - else if (c.equals("oline")) - s.append((char)8254); // overline = spacing overscore, U+203E NEW - else if (c.equals("frasl")) - s.append((char)8260); // fraction slash, U+2044 NEW - else if (c.equals("weierp")) - s.append((char)8472); // script capital P = power set = Weierstrass p, U+2118 ISOamso - else if (c.equals("image")) - s.append((char)8465); // blackletter capital I = imaginary part, U+2111 ISOamso - else if (c.equals("real")) - s.append((char)8476); // blackletter capital R = real part symbol, U+211C ISOamso - else if (c.equals("trade")) - s.append((char)8482); // trade mark sign, U+2122 ISOnum - else if (c.equals("alefsym")) - s.append((char)8501); // alef symbol = first transfinite cardinal, U+2135 NEW - else if (c.equals("larr")) - s.append((char)8592); // leftwards arrow, U+2190 ISOnum - else if (c.equals("uarr")) - s.append((char)8593); // upwards arrow, U+2191 ISOnum - else if (c.equals("rarr")) - s.append((char)8594); // rightwards arrow, U+2192 ISOnum - else if (c.equals("darr")) - s.append((char)8595); // downwards arrow, U+2193 ISOnum - else if (c.equals("harr")) - s.append((char)8596); // left right arrow, U+2194 ISOamsa - else if (c.equals("crarr")) - s.append((char)8629); // downwards arrow with corner leftwards = carriage return, U+21B5 NEW - else if (c.equals("lArr")) - s.append((char)8656); // leftwards double arrow, U+21D0 ISOtech - else if (c.equals("uArr")) - s.append((char)8657); // upwards double arrow, U+21D1 ISOamsa - else if (c.equals("rArr")) - s.append((char)8658); // rightwards double arrow, U+21D2 ISOtech - else if (c.equals("dArr")) - s.append((char)8659); // downwards double arrow, U+21D3 ISOamsa - else if (c.equals("hArr")) - s.append((char)8660); // left right double arrow, U+21D4 ISOamsa - else if (c.equals("forall")) - s.append((char)8704); // for all, U+2200 ISOtech - else if (c.equals("part")) - s.append((char)8706); // partial differential, U+2202 ISOtech - else if (c.equals("exist")) - s.append((char)8707); // there exists, U+2203 ISOtech - else if (c.equals("empty")) - s.append((char)8709); // empty set = null set = diameter, U+2205 ISOamso - else if (c.equals("nabla")) - s.append((char)8711); // nabla = backward difference, U+2207 ISOtech - else if (c.equals("isin")) - s.append((char)8712); // element of, U+2208 ISOtech - else if (c.equals("notin")) - s.append((char)8713); // not an element of, U+2209 ISOtech - else if (c.equals("ni")) - s.append((char)8715); // contains as member, U+220B ISOtech - else if (c.equals("prod")) - s.append((char)8719); // n-ary product = product sign, U+220F ISOamsb - else if (c.equals("sum")) - s.append((char)8721); // n-ary sumation, U+2211 ISOamsb - else if (c.equals("minus")) - s.append((char)8722); // minus sign, U+2212 ISOtech - else if (c.equals("lowast")) - s.append((char)8727); // asterisk operator, U+2217 ISOtech - else if (c.equals("radic")) - s.append((char)8730); // square root = radical sign, U+221A ISOtech - else if (c.equals("prop")) - s.append((char)8733); // proportional to, U+221D ISOtech - else if (c.equals("infin")) - s.append((char)8734); // infinity, U+221E ISOtech --> - else if (c.equals("ang")) - s.append((char)8736); // angle, U+2220 ISOamso - else if (c.equals("and")) - s.append((char)8743); // logical and = wedge, U+2227 ISOtech - else if (c.equals("or")) - s.append((char)8744); // logical or = vee, U+2228 ISOtech - else if (c.equals("cap")) - s.append((char)8745); // intersection = cap, U+2229 ISOtech - else if (c.equals("cup")) - s.append((char)8746); // union = cup, U+222A ISOtech - else if (c.equals("int")) - s.append((char)8747); // integral, U+222B ISOtech - else if (c.equals("there4")) - s.append((char)8756); // therefore, U+2234 ISOtech - else if (c.equals("sim")) - s.append((char)8764); // tilde operator = varies with = similar t U+223C ISOtech - else if (c.equals("cong")) - s.append((char)8773); // approximately equal to, U+2245 ISOtec - else if (c.equals("asymp")) - s.append((char)8776); // almost equal to = asymptotic to, U+2248 ISOamsr - else if (c.equals("ne")) - s.append((char)8800); // not equal to, U+2260 ISOtech - else if (c.equals("equiv")) - s.append((char)8801); // identical to, U+2261 ISOtech - else if (c.equals("le")) - s.append((char)8804); // less-than or equal to, U+2264 ISOtech - else if (c.equals("ge")) - s.append((char)8805); // greater-than or equal to, U+2265 ISOtech - else if (c.equals("sub")) - s.append((char)8834); // subset of, U+2282 ISOtech - else if (c.equals("sup")) - s.append((char)8835); // superset of, U+2283 ISOtech - else if (c.equals("nsub")) - s.append((char)8836); // not a subset of, U+2284 ISOamsn - else if (c.equals("sube")) - s.append((char)8838); // subset of or equal to, U+2286 ISOtech - else if (c.equals("supe")) - s.append((char)8839); // superset of or equal to, U+2287 ISOtech - else if (c.equals("oplus")) - s.append((char)8853); // circled plus = direct sum, U+2295 ISOamsb - else if (c.equals("otimes")) - s.append((char)8855); // circled times = vector product, U+2297 ISOamsb --> - else if (c.equals("perp")) - s.append((char)8869); // up tack = orthogonal to = perpendicular, U+22A5 ISOtech - else if (c.equals("sdot")) - s.append((char)8901); // dot operator, U+22C5 ISOamsb - else if (c.equals("lceil")) - s.append((char)8968); // left ceiling = apl upstile, U+2308 ISOamsc - else if (c.equals("rceil")) - s.append((char)8969); // right ceiling, U+2309 ISOamsc - else if (c.equals("lfloor")) - s.append((char)8970); // left floor = apl downstile, U+230A ISOamsc - else if (c.equals("rfloor")) - s.append((char)8971); // right floor, U+230B ISOamsc - else if (c.equals("lang")) - s.append((char)9001); // left-pointing angle bracket = bra, U+2329 ISOtech - else if (c.equals("rang")) - s.append((char)9002); // right-pointing angle bracket = ket, U+232A ISOtech - else if (c.equals("loz")) - s.append((char)9674); // lozenge, U+25CA ISOpub - else if (c.equals("spades")) - s.append((char)9824); // black spade suit, U+2660 ISOpub - else if (c.equals("clubs")) - s.append((char)9827); // black club suit = shamrock, U+2663 ISOpub - else if (c.equals("hearts")) - s.append((char)9829); // black heart suit = valentine, U+2665 ISOpub - else if (c.equals("diams")) - s.append((char)9830); // black diamond suit, U+2666 ISOpub -- - else - throw new FHIRFormatError("unable to parse character reference '" + c + "'' (last text = '"+lastText+"'"+descLoc()); -} - - private boolean isInteger(String s, int base) { - try { - Integer.parseInt(s, base); - return true; - } catch (Exception e) { - return false; - } - } - - public XhtmlNode parseFragment(String source) throws IOException, FHIRException { - rdr = new StringReader(source); - return parseFragment(); - } - - public XhtmlNode parseFragment(InputStream input) throws IOException, FHIRException { - rdr = new InputStreamReader(input); - return parseFragment(); - } - - private XhtmlNode parseFragment() throws IOException, FHIRException - { - skipWhiteSpace(); - if (peekChar() != '<') - throw new FHIRException("Unable to Parse HTML - does not start with tag. Found "+peekChar()+descLoc()); - readChar(); - if (peekChar() == '?') { - readToTagEnd(); - skipWhiteSpace(); - if (peekChar() != '<') - throw new FHIRException("Unable to Parse HTML - does not start with tag after processing instruction. Found "+peekChar()+descLoc()); - readChar(); - } - String n = readName().toLowerCase(); - readToTagEnd(); - XhtmlNode result = new XhtmlNode(NodeType.Element); - - int colonIndex = n.indexOf(':'); - if (colonIndex != -1) { - n = n.substring(colonIndex + 1); - } - - result.setName(n); - unwindPoint = null; - List p = new ArrayList(); - parseElementInner(result, p, null); - - return result; - } - - -} diff --git a/hapi-fhir-structures-dstu3/src/main/resources/org/hl7/fhir/dstu3/model/fhirversion.properties b/hapi-fhir-structures-dstu3/src/main/resources/org/hl7/fhir/dstu3/model/fhirversion.properties index 9e819043ed7..13495994096 100644 --- a/hapi-fhir-structures-dstu3/src/main/resources/org/hl7/fhir/dstu3/model/fhirversion.properties +++ b/hapi-fhir-structures-dstu3/src/main/resources/org/hl7/fhir/dstu3/model/fhirversion.properties @@ -70,6 +70,7 @@ resource.MedicationAdministration=org.hl7.fhir.dstu3.model.MedicationAdministrat resource.MedicationDispense=org.hl7.fhir.dstu3.model.MedicationDispense resource.MedicationRequest=org.hl7.fhir.dstu3.model.MedicationRequest resource.MedicationStatement=org.hl7.fhir.dstu3.model.MedicationStatement +resource.MessageDefinition=org.hl7.fhir.dstu3.model.MessageDefinition resource.MessageHeader=org.hl7.fhir.dstu3.model.MessageHeader resource.NamingSystem=org.hl7.fhir.dstu3.model.NamingSystem resource.NutritionRequest=org.hl7.fhir.dstu3.model.NutritionRequest @@ -95,6 +96,8 @@ resource.QuestionnaireResponse=org.hl7.fhir.dstu3.model.QuestionnaireResponse resource.ReferralRequest=org.hl7.fhir.dstu3.model.ReferralRequest resource.RelatedPerson=org.hl7.fhir.dstu3.model.RelatedPerson resource.RequestGroup=org.hl7.fhir.dstu3.model.RequestGroup +resource.ResearchStudy=org.hl7.fhir.dstu3.model.ResearchStudy +resource.ResearchSubject=org.hl7.fhir.dstu3.model.ResearchSubject resource.RiskAssessment=org.hl7.fhir.dstu3.model.RiskAssessment resource.Schedule=org.hl7.fhir.dstu3.model.Schedule resource.SearchParameter=org.hl7.fhir.dstu3.model.SearchParameter diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/fluentpath/FluentPathTest.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/fluentpath/FluentPathTest.java index 0a29ec72fcc..cf61927d9f4 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/fluentpath/FluentPathTest.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/fluentpath/FluentPathTest.java @@ -18,23 +18,23 @@ public class FluentPathTest { @Test public void testEvaluateNormal() { Patient p = new Patient(); - p.addName().addFamily("N1F1").addGiven("N1G1").addGiven("N1G2"); - p.addName().addFamily("N2F1").addGiven("N2G1").addGiven("N2G2"); + p.addName().setFamily("N1F1").addGiven("N1G1").addGiven("N1G2"); + p.addName().setFamily("N2F1").addGiven("N2G1").addGiven("N2G2"); IFluentPath fp = ourCtx.newFluentPath(); List names = fp.evaluate(p, "Patient.name", HumanName.class); assertEquals(2, names.size()); - assertEquals("N1F1", names.get(0).getFamilyAsSingleString()); + assertEquals("N1F1", names.get(0).getFamily()); assertEquals("N1G1 N1G2", names.get(0).getGivenAsSingleString()); - assertEquals("N2F1", names.get(1).getFamilyAsSingleString()); + assertEquals("N2F1", names.get(1).getFamily()); assertEquals("N2G1 N2G2", names.get(1).getGivenAsSingleString()); } @Test public void testEvaluateUnknownPath() { Patient p = new Patient(); - p.addName().addFamily("N1F1").addGiven("N1G1").addGiven("N1G2"); - p.addName().addFamily("N2F1").addGiven("N2G1").addGiven("N2G2"); + p.addName().setFamily("N1F1").addGiven("N1G1").addGiven("N1G2"); + p.addName().setFamily("N2F1").addGiven("N2G1").addGiven("N2G2"); IFluentPath fp = ourCtx.newFluentPath(); List names = fp.evaluate(p, "Patient.nameFOO", HumanName.class); @@ -44,8 +44,8 @@ public class FluentPathTest { @Test public void testEvaluateInvalidPath() { Patient p = new Patient(); - p.addName().addFamily("N1F1").addGiven("N1G1").addGiven("N1G2"); - p.addName().addFamily("N2F1").addGiven("N2G1").addGiven("N2G2"); + p.addName().setFamily("N1F1").addGiven("N1G1").addGiven("N1G2"); + p.addName().setFamily("N2F1").addGiven("N2G1").addGiven("N2G2"); IFluentPath fp = ourCtx.newFluentPath(); try { @@ -58,8 +58,8 @@ public class FluentPathTest { @Test public void testEvaluateWrongType() { Patient p = new Patient(); - p.addName().addFamily("N1F1").addGiven("N1G1").addGiven("N1G2"); - p.addName().addFamily("N2F1").addGiven("N2G1").addGiven("N2G2"); + p.addName().setFamily("N1F1").addGiven("N1G1").addGiven("N1G2"); + p.addName().setFamily("N2F1").addGiven("N2G1").addGiven("N2G2"); IFluentPath fp = ourCtx.newFluentPath(); try { diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelDstu3Test.java index e0303eed066..f93f7d483bc 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelDstu3Test.java @@ -10,8 +10,16 @@ import java.util.Arrays; import java.util.Date; import java.util.List; -import org.hl7.fhir.dstu3.model.*; -import org.hl7.fhir.dstu3.model.Claim.CoverageComponent; +import org.hl7.fhir.dstu3.model.Appointment; +import org.hl7.fhir.dstu3.model.Claim; +import org.hl7.fhir.dstu3.model.Claim.CareTeamComponent; +import org.hl7.fhir.dstu3.model.CodeableConcept; +import org.hl7.fhir.dstu3.model.Element; +import org.hl7.fhir.dstu3.model.Enumerations; +import org.hl7.fhir.dstu3.model.HumanName; +import org.hl7.fhir.dstu3.model.Identifier; +import org.hl7.fhir.dstu3.model.Patient; +import org.hl7.fhir.dstu3.model.Practitioner; import org.hl7.fhir.dstu3.model.Practitioner.PractitionerRoleComponent; import org.hl7.fhir.instance.model.api.IBaseElement; import org.junit.AfterClass; @@ -38,7 +46,7 @@ public class ModelDstu3Test { @Test public void testSetters() { Claim claim = new Claim(); - claim.setIdentifier(new ArrayList()).setCoverage(new ArrayList()); + claim.setIdentifier(new ArrayList()).setCareTeam(new ArrayList()); } @Test @@ -105,7 +113,7 @@ public class ModelDstu3Test { Patient patient1 = new Patient(); patient1.setBirthDate(date) .setGender(Enumerations.AdministrativeGender.MALE) - .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").addFamily("family"); + .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").setFamily("family"); Patient patient2 = context.newJsonParser().parseResource(Patient.class, context.newJsonParser().encodeResourceToString(patient1)); @@ -116,7 +124,7 @@ public class ModelDstu3Test { Patient patient3 = new Patient(); patient3.setBirthDate(date) .setGender(Enumerations.AdministrativeGender.MALE) - .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").addFamily("family"); + .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").setFamily("family"); assertTrue(patient1.equalsDeep(patient3)); assertTrue(patient1.equalsShallow(patient3)); @@ -124,7 +132,7 @@ public class ModelDstu3Test { Patient patient4 = new Patient(); patient4.setBirthDate(date) .setGender(Enumerations.AdministrativeGender.MALE) - .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").addFamily("family2"); + .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").setFamily("family2"); assertTrue(patient1.equalsShallow(patient4)); assertFalse(patient1.equalsDeep(patient4)); @@ -132,7 +140,7 @@ public class ModelDstu3Test { Patient patient5 = new Patient(); patient5.setBirthDate(date) .setGender(Enumerations.AdministrativeGender.FEMALE) - .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").addFamily("family2"); + .addName().setUse(HumanName.NameUse.OFFICIAL).addGiven("first").addGiven("second").setFamily("family2"); assertFalse(patient1.equalsShallow(patient5)); assertFalse(patient1.equalsDeep(patient5)); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu3Test.java index 731ef955257..e50857208cb 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu3Test.java @@ -78,8 +78,8 @@ public class ModelSerializationDstu3Test { @Test public void testSerialization2() { Patient patient = new Patient(); - patient.addName(new HumanName().addGiven("George").addFamily("Washington")); - patient.addName(new HumanName().addGiven("George2").addFamily("Washington2")); + patient.addName(new HumanName().addGiven("George").setFamily("Washington")); + patient.addName(new HumanName().addGiven("George2").setFamily("Washington2")); patient.addAddress(new Address().addLine("line 1").addLine("line 2").setCity("city").setState("UT")); patient.addAddress(new Address().addLine("line 1b").addLine("line 2b").setCity("cityb").setState("UT")); patient.setBirthDate(new Date()); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorDstu3Test.java index 7de4b075fd9..4e5ea9c10c5 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorDstu3Test.java @@ -60,7 +60,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { Patient value = new Patient(); value.addIdentifier().setSystem("urn:names").setValue("123456"); - value.addName().addFamily("blow").addGiven("joe").addGiven((String) null).addGiven("john"); + value.addName().setFamily("blow").addGiven("joe").addGiven((String) null).addGiven("john"); //@formatter:off value.addAddress() .addLine("123 Fake Street").addLine("Unit 1") diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu3Test.java index 0e0b9be6895..52615fab069 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu3Test.java @@ -225,7 +225,7 @@ public class CustomTypeDstu3Test { MyCustomPatient patient = new MyCustomPatient(); patient.addIdentifier().setSystem("urn:system").setValue("1234"); - patient.addName().addFamily("Rossi").addGiven("Mario"); + patient.addName().setFamily("Rossi").addGiven("Mario"); patient.setInsulinLevel(new Quantity()); patient.setGlucoseLevel(new Quantity()); patient.setHbA1c(new Quantity()); @@ -267,7 +267,7 @@ public class CustomTypeDstu3Test { patient.getMeta().addProfile("http://example.com/bar"); patient.addIdentifier().setSystem("urn:system").setValue("1234"); - patient.addName().addFamily("Rossi").addGiven("Mario"); + patient.addName().setFamily("Rossi").addGiven("Mario"); patient.setInsulinLevel(new Quantity()); patient.setGlucoseLevel(new Quantity()); patient.setHbA1c(new Quantity()); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java index f9072a0788b..38ec6fb73f5 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java @@ -130,7 +130,7 @@ public class JsonParserDstu3Test { resource.getContained().add(patient); resource.getContained().add(coverage); resource.getPatient().setReference("#patient-1"); - resource.addCoverage().getCoverage().setReference("#coverage-1"); + resource.addInsurance().getCoverage().setReference("#coverage-1"); IParser p = ourCtx.newJsonParser().setPrettyPrint(true); String encoded = p.encodeResourceToString(resource); @@ -234,7 +234,7 @@ public class JsonParserDstu3Test { patient.addModifierExtension(modExt); HumanName name = patient.addName(); - name.addFamily("Blah"); + name.setFamily("Blah"); StringType given = name.addGivenElement(); given.setValue("Joe"); Extension ext2 = new Extension().setUrl("http://examples.com#givenext").setValue(new StringType("given")); @@ -299,7 +299,7 @@ public class JsonParserDstu3Test { @Test public void testEncodeAndParseMetaProfileAndTags() { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); p.getMeta().addProfile("http://foo/Profile1"); p.getMeta().addProfile("http://foo/Profile2"); @@ -383,17 +383,17 @@ public class JsonParserDstu3Test { Patient p = new Patient(); p.setId("patid"); HumanName name = p.addName(); - name.addFamilyElement().setValue(null).setId("f0").addExtension(new Extension("http://foo", new StringType("FOOEXT0"))); - name.addFamilyElement().setValue("V1").setId("f1").addExtension((Extension) new Extension("http://foo", new StringType("FOOEXT1")).setId("ext1id")); - name.addFamilyElement(); // this one shouldn't get encoded - name.addFamilyElement().setValue(null).addExtension(new Extension("http://foo", new StringType("FOOEXT3"))); + name.addGivenElement().setValue(null).setId("f0").addExtension(new Extension("http://foo", new StringType("FOOEXT0"))); + name.addGivenElement().setValue("V1").setId("f1").addExtension((Extension) new Extension("http://foo", new StringType("FOOEXT1")).setId("ext1id")); + name.addGivenElement(); // this one shouldn't get encoded + name.addGivenElement().setValue(null).addExtension(new Extension("http://foo", new StringType("FOOEXT3"))); name.setId("nameid"); String output = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); ourLog.info(output); output = ourCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(p); - String expected = "{\"resourceType\":\"Patient\",\"id\":\"patid\",\"name\":[{\"id\":\"nameid\",\"family\":[null,\"V1\",null],\"_family\":[{\"id\":\"f0\",\"extension\":[{\"url\":\"http://foo\",\"valueString\":\"FOOEXT0\"}]},{\"id\":\"f1\",\"extension\":[{\"id\":\"ext1id\",\"url\":\"http://foo\",\"valueString\":\"FOOEXT1\"}]},{\"extension\":[{\"url\":\"http://foo\",\"valueString\":\"FOOEXT3\"}]}]}]}"; + String expected = "{\"resourceType\":\"Patient\",\"id\":\"patid\",\"name\":[{\"id\":\"nameid\",\"given\":[null,\"V1\",null],\"_given\":[{\"id\":\"f0\",\"extension\":[{\"url\":\"http://foo\",\"valueString\":\"FOOEXT0\"}]},{\"id\":\"f1\",\"extension\":[{\"id\":\"ext1id\",\"url\":\"http://foo\",\"valueString\":\"FOOEXT1\"}]},{\"extension\":[{\"url\":\"http://foo\",\"valueString\":\"FOOEXT3\"}]}]}]}"; assertEquals(expected, output); p = ourCtx.newJsonParser().parseResource(Patient.class, output); @@ -401,37 +401,37 @@ public class JsonParserDstu3Test { name = p.getName().get(0); assertEquals("nameid", name.getId()); - assertEquals(3, name.getFamily().size()); + assertEquals(3, name.getGiven().size()); - assertEquals(null, name.getFamily().get(0).getValue()); - assertEquals("V1", name.getFamily().get(1).getValue()); - assertEquals(null, name.getFamily().get(2).getValue()); + assertEquals(null, name.getGiven().get(0).getValue()); + assertEquals("V1", name.getGiven().get(1).getValue()); + assertEquals(null, name.getGiven().get(2).getValue()); - assertEquals("f0", name.getFamily().get(0).getId()); - assertEquals("f1", name.getFamily().get(1).getId()); - assertEquals(null, name.getFamily().get(2).getId()); + assertEquals("f0", name.getGiven().get(0).getId()); + assertEquals("f1", name.getGiven().get(1).getId()); + assertEquals(null, name.getGiven().get(2).getId()); - assertEquals(1, name.getFamily().get(0).getExtension().size()); - assertEquals("http://foo", name.getFamily().get(0).getExtension().get(0).getUrl()); - assertEquals("FOOEXT0", ((StringType) name.getFamily().get(0).getExtension().get(0).getValue()).getValue()); - assertEquals(null, name.getFamily().get(0).getExtension().get(0).getId()); + assertEquals(1, name.getGiven().get(0).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(0).getExtension().get(0).getUrl()); + assertEquals("FOOEXT0", ((StringType) name.getGiven().get(0).getExtension().get(0).getValue()).getValue()); + assertEquals(null, name.getGiven().get(0).getExtension().get(0).getId()); - assertEquals(1, name.getFamily().get(1).getExtension().size()); - assertEquals("http://foo", name.getFamily().get(1).getExtension().get(0).getUrl()); - assertEquals("FOOEXT1", ((StringType) name.getFamily().get(1).getExtension().get(0).getValue()).getValue()); - assertEquals("ext1id", name.getFamily().get(1).getExtension().get(0).getId()); + assertEquals(1, name.getGiven().get(1).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(1).getExtension().get(0).getUrl()); + assertEquals("FOOEXT1", ((StringType) name.getGiven().get(1).getExtension().get(0).getValue()).getValue()); + assertEquals("ext1id", name.getGiven().get(1).getExtension().get(0).getId()); - assertEquals(1, name.getFamily().get(2).getExtension().size()); - assertEquals("http://foo", name.getFamily().get(2).getExtension().get(0).getUrl()); - assertEquals("FOOEXT3", ((StringType) name.getFamily().get(2).getExtension().get(0).getValue()).getValue()); - assertEquals(null, name.getFamily().get(2).getExtension().get(0).getId()); + assertEquals(1, name.getGiven().get(2).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(2).getExtension().get(0).getUrl()); + assertEquals("FOOEXT3", ((StringType) name.getGiven().get(2).getExtension().get(0).getValue()).getValue()); + assertEquals(null, name.getGiven().get(2).getExtension().get(0).getId()); } @Test public void testEncodeAndParseSecurityLabels() { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); List labels = new ArrayList(); labels.add(new Coding().setSystem("SYSTEM1").setCode("CODE1").setDisplay("DISPLAY1").setVersion("VERSION1")); @@ -462,9 +462,7 @@ public class JsonParserDstu3Test { " },\n" + " \"name\": [\n" + " {\n" + - " \"family\": [\n" + - " \"FAMILY\"\n" + - " ]\n" + + " \"family\": \"FAMILY\"\n" + " }\n" + " ]\n" + "}", enc.trim()); @@ -601,14 +599,14 @@ public class JsonParserDstu3Test { CustomContactComponent customContactComponent = new CustomContactComponent(); customContactComponent.getEyeColour().setValue("EYE"); - customContactComponent.getName().addFamily("FAMILY"); + customContactComponent.getName().setFamily("FAMILY"); patient.getCustomContact().add(customContactComponent); String val = parser.encodeResourceToString(patient); ourLog.info(val); assertEquals( - "{\"resourceType\":\"Patient\",\"id\":\"123\",\"contact\":[{\"extension\":[{\"url\":\"http://foo.com/contact-eyecolour\",\"valueIdentifier\":{\"value\":\"EYE\"}}],\"name\":{\"family\":[\"FAMILY\"]}}]}", + "{\"resourceType\":\"Patient\",\"id\":\"123\",\"contact\":[{\"extension\":[{\"url\":\"http://foo.com/contact-eyecolour\",\"valueIdentifier\":{\"value\":\"EYE\"}}],\"name\":{\"family\":\"FAMILY\"}}]}", val); FhirContext newCtx = FhirContext.forDstu3(); @@ -935,7 +933,7 @@ public class JsonParserDstu3Test { Patient patient = new Patient(); patient.setId("Patient/1/_history/1"); patient.getText().setDivAsString("

THE DIV
"); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); patient.getMaritalStatus().addCoding().setCode("D"); String encoded = ourCtx.newJsonParser().setPrettyPrint(true).setSuppressNarratives(true).encodeResourceToString(patient); @@ -966,7 +964,7 @@ public class JsonParserDstu3Test { Patient patient = new Patient(); patient.setId("Patient/1/_history/1"); patient.getText().setDivAsString("
THE DIV
"); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); patient.addPhoto().setTitle("green"); patient.getMaritalStatus().addCoding().setCode("D"); @@ -987,7 +985,7 @@ public class JsonParserDstu3Test { Patient patient = new Patient(); patient.setId("Patient/1/_history/1"); patient.getText().setDivAsString("
THE DIV
"); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); patient.getMaritalStatus().addCoding().setCode("D"); patient.getMeta().addTag().setSystem("foo").setCode("bar"); @@ -1091,7 +1089,7 @@ public class JsonParserDstu3Test { patient.setId("123"); patient.getMeta().addProfile(("http://profile")); - patient.addName().addFamily("FAMILY").addGiven("GIVEN"); + patient.addName().setFamily("FAMILY").addGiven("GIVEN"); patient.addAddress().addLine("LINE1"); { @@ -1157,7 +1155,7 @@ public class JsonParserDstu3Test { @Test public void testEncodeWithNarrative() { Patient p = new Patient(); - p.addName().addFamily("Smith").addGiven("John"); + p.addName().setFamily("Smith").addGiven("John"); ourCtx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); @@ -1196,7 +1194,7 @@ public class JsonParserDstu3Test { //@formatter:off String input = "{" + " \"resourceType\": \"ExplanationOfBenefit\"," + - " \"coverage\": {\n" + + " \"insurance\": {\n" + " \"coverage\": {\n" + " \"reference\": \"Coverage/123\"\n" + " }\n" + @@ -1210,9 +1208,9 @@ public class JsonParserDstu3Test { //@formatter:on ExplanationOfBenefit eob = ourCtx.newJsonParser().parseResource(ExplanationOfBenefit.class, input); - assertEquals(Reference.class, eob.getCoverage().getCoverage().getClass()); + assertEquals(Reference.class, eob.getInsurance().getCoverage().getClass()); - Reference coverage = eob.getCoverage().getCoverage(); + Reference coverage = eob.getInsurance().getCoverage(); assertEquals("Coverage/123", coverage.getReference()); } @@ -1378,7 +1376,7 @@ public class JsonParserDstu3Test { public void testOmitResourceId() { Patient p = new Patient(); p.setId("123"); - p.addName().addFamily("ABC"); + p.addName().setFamily("ABC"); assertThat(ourCtx.newJsonParser().encodeResourceToString(p), stringContainsInOrder("123", "ABC")); assertThat(ourCtx.newJsonParser().setOmitResourceId(true).encodeResourceToString(p), containsString("ABC")); @@ -1700,7 +1698,7 @@ public class JsonParserDstu3Test { o.getCode().setText("obs text"); Patient p = new Patient(); - p.addName().addFamily("patient family"); + p.addName().setFamily("patient family"); o.getSubject().setResource(p); String enc = parser.encodeResourceToString(o); @@ -1721,7 +1719,7 @@ public class JsonParserDstu3Test { assertNotNull(o.getSubject().getResource()); p = (Patient) o.getSubject().getResource(); - assertEquals("patient family", p.getName().get(0).getFamily().get(0).getValue()); + assertEquals("patient family", p.getName().get(0).getFamilyElement().getValue()); } /** @@ -1732,9 +1730,9 @@ public class JsonParserDstu3Test { String input = IOUtils.toString(getClass().getResourceAsStream("/json-edge-case-modified-335.json"), StandardCharsets.UTF_8); Patient p = ourCtx.newJsonParser().parseResource(Patient.class, input); - StringType family1 = p.getContact().get(0).getName().getFamily().get(1); - assertEquals("du", family1.getValue()); - assertEquals("a2", family1.getId()); + StringType family1 = p.getContact().get(0).getName().getGiven().get(1); + assertEquals("Denise", family1.getValue()); + assertEquals("a3", family1.getId()); } /** @@ -1891,7 +1889,7 @@ public class JsonParserDstu3Test { String input = IOUtils.toString(JsonParserDstu3Test.class.getResourceAsStream("/missing_array.json"), StandardCharsets.UTF_8); RelatedPerson rp = ourCtx.newJsonParser().parseResource(RelatedPerson.class, input); assertEquals(1, rp.getName().size()); - assertEquals("Doe", rp.getName().get(0).getFamilyAsSingleString()); + assertEquals("Doe", rp.getName().get(0).getFamily()); } @@ -1925,7 +1923,7 @@ public class JsonParserDstu3Test { Patient patient = new Patient(); String patientId = UUID.randomUUID().toString(); patient.setId(new IdType("Patient", patientId)); - patient.addName().addGiven("John").addFamily("Smith"); + patient.addName().addGiven("John").setFamily("Smith"); patient.setGender(AdministrativeGender.MALE); patient.setBirthDateElement(new DateType("1987-04-16")); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/XmlParserDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/XmlParserDstu3Test.java index 3ac7d05a430..1b00e00eca8 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/XmlParserDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/XmlParserDstu3Test.java @@ -260,7 +260,7 @@ public class XmlParserDstu3Test { @Test public void testContainedResourceInExtensionUndeclared() { Patient p = new Patient(); - p.addName().addFamily("PATIENT"); + p.addName().setFamily("PATIENT"); Organization o = new Organization(); o.setName("ORG"); @@ -270,7 +270,7 @@ public class XmlParserDstu3Test { ourLog.info(str); p = ourCtx.newXmlParser().parseResource(Patient.class, str); - assertEquals("PATIENT", p.getName().get(0).getFamily().get(0).getValue()); + assertEquals("PATIENT", p.getName().get(0).getFamily()); List exts = p.getExtensionsByUrl("urn:foo"); assertEquals(1, exts.size()); @@ -298,7 +298,7 @@ public class XmlParserDstu3Test { Patient pt = new Patient(); pt.setId("patid"); - pt.addName().addFamily("PATIENT"); + pt.addName().setFamily("PATIENT"); Organization org = new Organization(); org.setId("orgid"); @@ -586,7 +586,7 @@ public class XmlParserDstu3Test { patient.addModifierExtension(modExt); HumanName name = patient.addName(); - name.addFamily("Blah"); + name.setFamily("Blah"); StringType given = name.addGivenElement(); given.setValue("Joe"); Extension ext2 = new Extension().setUrl("http://examples.com#givenext").setValue(new StringType("given")); @@ -697,7 +697,7 @@ public class XmlParserDstu3Test { @Test public void testEncodeAndParseMetaProfileAndTags() { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); p.getMeta().addProfile("http://foo/Profile1"); p.getMeta().addProfile("http://foo/Profile2"); @@ -765,7 +765,7 @@ public class XmlParserDstu3Test { @Test public void testEncodeAndParseMetaProfiles() { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); p.getMeta().addTag().setSystem("scheme1").setCode("term1").setDisplay("label1"); p.getMeta().addTag().setSystem("scheme2").setCode("term2").setDisplay("label2"); @@ -817,17 +817,17 @@ public class XmlParserDstu3Test { Patient p = new Patient(); p.setId("patid"); HumanName name = p.addName(); - name.addFamilyElement().setValue(null).setId("f0").addExtension(new Extension("http://foo", new StringType("FOOEXT0"))); - name.addFamilyElement().setValue("V1").setId("f1").addExtension((Extension) new Extension("http://foo", new StringType("FOOEXT1")).setId("ext1id")); - name.addFamilyElement(); // this one shouldn't get encoded - name.addFamilyElement().setValue(null).addExtension(new Extension("http://foo", new StringType("FOOEXT3"))); + name.addGivenElement().setValue(null).setId("f0").addExtension(new Extension("http://foo", new StringType("FOOEXT0"))); + name.addGivenElement().setValue("V1").setId("f1").addExtension((Extension) new Extension("http://foo", new StringType("FOOEXT1")).setId("ext1id")); + name.addGivenElement(); // this one shouldn't get encoded + name.addGivenElement().setValue(null).addExtension(new Extension("http://foo", new StringType("FOOEXT3"))); name.setId("nameid"); String output = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p); ourLog.info(output); output = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(p); - String expected = ""; + String expected = ""; ourLog.info("Expected: {}", expected); ourLog.info("Actual : {}", output); @@ -839,30 +839,30 @@ public class XmlParserDstu3Test { name = p.getName().get(0); assertEquals("nameid", name.getId()); - assertEquals(3, name.getFamily().size()); + assertEquals(3, name.getGiven().size()); - assertEquals(null, name.getFamily().get(0).getValue()); - assertEquals("V1", name.getFamily().get(1).getValue()); - assertEquals(null, name.getFamily().get(2).getValue()); + assertEquals(null, name.getGiven().get(0).getValue()); + assertEquals("V1", name.getGiven().get(1).getValue()); + assertEquals(null, name.getGiven().get(2).getValue()); - assertEquals("f0", name.getFamily().get(0).getId()); - assertEquals("f1", name.getFamily().get(1).getId()); - assertEquals(null, name.getFamily().get(2).getId()); + assertEquals("f0", name.getGiven().get(0).getId()); + assertEquals("f1", name.getGiven().get(1).getId()); + assertEquals(null, name.getGiven().get(2).getId()); - assertEquals(1, name.getFamily().get(0).getExtension().size()); - assertEquals("http://foo", name.getFamily().get(0).getExtension().get(0).getUrl()); - assertEquals("FOOEXT0", ((StringType) name.getFamily().get(0).getExtension().get(0).getValue()).getValue()); - assertEquals(null, name.getFamily().get(0).getExtension().get(0).getId()); + assertEquals(1, name.getGiven().get(0).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(0).getExtension().get(0).getUrl()); + assertEquals("FOOEXT0", ((StringType) name.getGiven().get(0).getExtension().get(0).getValue()).getValue()); + assertEquals(null, name.getGiven().get(0).getExtension().get(0).getId()); - assertEquals(1, name.getFamily().get(1).getExtension().size()); - assertEquals("http://foo", name.getFamily().get(1).getExtension().get(0).getUrl()); - assertEquals("FOOEXT1", ((StringType) name.getFamily().get(1).getExtension().get(0).getValue()).getValue()); - assertEquals("ext1id", name.getFamily().get(1).getExtension().get(0).getId()); + assertEquals(1, name.getGiven().get(1).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(1).getExtension().get(0).getUrl()); + assertEquals("FOOEXT1", ((StringType) name.getGiven().get(1).getExtension().get(0).getValue()).getValue()); + assertEquals("ext1id", name.getGiven().get(1).getExtension().get(0).getId()); - assertEquals(1, name.getFamily().get(2).getExtension().size()); - assertEquals("http://foo", name.getFamily().get(2).getExtension().get(0).getUrl()); - assertEquals("FOOEXT3", ((StringType) name.getFamily().get(2).getExtension().get(0).getValue()).getValue()); - assertEquals(null, name.getFamily().get(2).getExtension().get(0).getId()); + assertEquals(1, name.getGiven().get(2).getExtension().size()); + assertEquals("http://foo", name.getGiven().get(2).getExtension().get(0).getUrl()); + assertEquals("FOOEXT3", ((StringType) name.getGiven().get(2).getExtension().get(0).getValue()).getValue()); + assertEquals(null, name.getGiven().get(2).getExtension().get(0).getId()); } @@ -896,7 +896,7 @@ public class XmlParserDstu3Test { @Test public void testEncodeAndParseSecurityLabels() { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); List labels = new ArrayList(); labels.add(new Coding().setSystem("SYSTEM1").setCode("CODE1").setDisplay("DISPLAY1").setVersion("VERSION1")); @@ -1513,7 +1513,7 @@ public class XmlParserDstu3Test { Patient patient = new Patient(); patient.setId("Patient/1/_history/1"); patient.getText().setDivAsString("
THE DIV
"); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); patient.setMaritalStatus(new CodeableConcept().addCoding(new Coding().setCode("D"))); patient.setMaritalStatus(new CodeableConcept().addCoding(new Coding().setCode("D"))); @@ -1573,7 +1573,7 @@ public class XmlParserDstu3Test { @Test public void testEncodeNullElement() { Patient patient = new Patient(); - patient.addName().getFamily().add(null); + patient.addName().getGiven().add(null); IParser parser = ourCtx.newXmlParser(); String xml = parser.encodeResourceToString(patient); @@ -1592,7 +1592,7 @@ public class XmlParserDstu3Test { patient.getModifierExtension().add(null); // Purposely add null patient.getExtension().add(new Extension("http://hello.world", new StringType("Hello World"))); patient.getName().add(null); - patient.addName().getFamily().add(null); + patient.addName().getGiven().add(null); IParser parser = ourCtx.newXmlParser(); String xml = parser.encodeResourceToString(patient); @@ -1643,7 +1643,7 @@ public class XmlParserDstu3Test { Practitioner pract = new Practitioner(); pract.setId(IdType.newRandomUuid()); - pract.addName().addFamily("PRACT FAMILY"); + pract.addName().setFamily("PRACT FAMILY"); Patient patient = new Patient(); patient.addGeneralPractitioner().setResource(pract); @@ -1660,7 +1660,7 @@ public class XmlParserDstu3Test { Patient patient = new Patient(); patient.setId("Patient/1/_history/1"); patient.getText().setDivAsString("
THE DIV
"); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); patient.setMaritalStatus(new CodeableConcept().addCoding(new Coding().setCode("D"))); String encoded = ourCtx.newXmlParser().setPrettyPrint(true).setSummaryMode(true).encodeResourceToString(patient); @@ -1678,7 +1678,7 @@ public class XmlParserDstu3Test { Patient patient = new Patient(); patient.setId("Patient/1/_history/1"); patient.getText().setDivAsString("
THE DIV
"); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); patient.setMaritalStatus(new CodeableConcept().addCoding(new Coding().setCode("D"))); patient.getMeta().addTag().setSystem("foo").setCode("bar"); @@ -1804,7 +1804,7 @@ public class XmlParserDstu3Test { Patient patient = new Patient(); patient.setId("123"); patient.getMeta().addProfile("http://profile"); - patient.addName().addFamily("FAMILY").addGiven("GIVEN"); + patient.addName().setFamily("FAMILY").addGiven("GIVEN"); patient.addAddress().addLine("LINE1"); { @@ -1871,7 +1871,7 @@ public class XmlParserDstu3Test { public void testEncodeWithEncodeElements() throws Exception { Patient patient = new Patient(); patient.getMeta().addProfile("http://profile"); - patient.addName().addFamily("FAMILY"); + patient.addName().setFamily("FAMILY"); patient.addAddress().addLine("LINE1"); Bundle bundle = new Bundle(); @@ -1919,7 +1919,7 @@ public class XmlParserDstu3Test { @Test public void testEncodeWithNarrative() { Patient p = new Patient(); - p.addName().addFamily("Smith").addGiven("John"); + p.addName().setFamily("Smith").addGiven("John"); ourCtx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); @@ -1947,7 +1947,7 @@ public class XmlParserDstu3Test { // START SNIPPET: resourceStringExtension HumanName name = patient.addName(); - name.addFamily("Shmoe"); + name.setFamily("Shmoe"); StringType given = name.addGivenElement(); given.setValue("Joe"); Extension ext2 = new Extension().setUrl("http://examples.com#givenext").setValue(new StringType("given")); @@ -1989,7 +1989,7 @@ public class XmlParserDstu3Test { public void testOmitResourceId() { Patient p = new Patient(); p.setId("123"); - p.addName().addFamily("ABC"); + p.addName().setFamily("ABC"); assertThat(ourCtx.newXmlParser().encodeResourceToString(p), stringContainsInOrder("123", "ABC")); assertThat(ourCtx.newXmlParser().setOmitResourceId(true).encodeResourceToString(p), containsString("ABC")); @@ -2730,7 +2730,7 @@ public class XmlParserDstu3Test { o.getCode().setText("obs text"); Patient p = new Patient(); - p.addName().addFamily("patient family"); + p.addName().setFamily("patient family"); o.getSubject().setResource(p); String enc = parser.encodeResourceToString(o); @@ -2752,7 +2752,7 @@ public class XmlParserDstu3Test { assertNotNull(o.getSubject().getResource()); p = (Patient) o.getSubject().getResource(); - assertEquals("patient family", p.getName().get(0).getFamily().get(0).getValue()); + assertEquals("patient family", p.getName().get(0).getFamily()); } /** @@ -3052,7 +3052,7 @@ public class XmlParserDstu3Test { Patient patient = new Patient(); String patientId = UUID.randomUUID().toString(); patient.setId(new IdType("Patient", patientId)); - patient.addName().addGiven("John").addFamily("Smith"); + patient.addName().addGiven("John").setFamily("Smith"); patient.setGender(AdministrativeGender.MALE); patient.setBirthDateElement(new DateType("1987-04-16")); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java index 78d298c5a1d..61c060cb7c0 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java @@ -76,7 +76,7 @@ public class ClientWithCustomTypeDstu3Test { IParser p = ourCtx.newXmlParser(); MyPatientWithExtensions response = new MyPatientWithExtensions(); - response.addName().addFamily("FAMILY"); + response.addName().setFamily("FAMILY"); response.getStringExt().setValue("STRINGVAL"); response.getDateExt().setValueAsString("2011-01-02"); final String respString = p.encodeResourceToString(response); @@ -108,7 +108,7 @@ public class ClientWithCustomTypeDstu3Test { assertEquals("GET", request.getMethod()); assertEquals(1, value.getName().size()); - assertEquals("FAMILY", value.getName().get(0).getFamilyAsSingleString()); + assertEquals("FAMILY", value.getName().get(0).getFamily()); assertEquals("STRINGVAL", value.getStringExt().getValue()); assertEquals("2011-01-02", value.getDateExt().getValueAsString()); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu3Test.java index 502c5dcc56d..4bc01738bf4 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu3Test.java @@ -715,7 +715,7 @@ public class GenericClientDstu3Test { Parameters param = new Parameters(); Patient patient = new Patient(); - patient.addName().addFamily("FOO"); + patient.addName().setFamily("FOO"); param.addParameter().setName("foo").setResource(patient); final String respString = ourCtx.newXmlParser().encodeResourceToString(param); @@ -797,7 +797,7 @@ public class GenericClientDstu3Test { conf.setCopyright("COPY"); final Patient patient = new Patient(); - patient.addName().addFamily("FAM"); + patient.addName().setFamily("FAM"); ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); @@ -847,7 +847,7 @@ public class GenericClientDstu3Test { conf.setCopyright("COPY"); final Patient patient = new Patient(); - patient.addName().addFamily("FAM"); + patient.addName().setFamily("FAM"); ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); @@ -899,7 +899,7 @@ public class GenericClientDstu3Test { conf.setCopyright("COPY"); final Patient patient = new Patient(); - patient.addName().addFamily("FAM"); + patient.addName().setFamily("FAM"); ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); @@ -1060,14 +1060,14 @@ public class GenericClientDstu3Test { Patient patient = new Patient(); patient.setId("PATIENT1"); - patient.addName().addFamily("PATIENT1"); + patient.addName().setFamily("PATIENT1"); Bundle bundle = new Bundle(); bundle.setId("BUNDLE1"); bundle.addEntry().setResource(patient); final String encoded = p.encodeResourceToString(bundle); - assertEquals("{\"resourceType\":\"Bundle\",\"id\":\"BUNDLE1\",\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"PATIENT1\",\"name\":[{\"family\":[\"PATIENT1\"]}]}}]}", encoded); + assertEquals("{\"resourceType\":\"Bundle\",\"id\":\"BUNDLE1\",\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"PATIENT1\",\"name\":[{\"family\":\"PATIENT1\"}]}}]}", encoded); ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); @@ -1104,7 +1104,7 @@ public class GenericClientDstu3Test { Patient patient = new Patient(); patient.setId("PATIENT1"); - patient.addName().addFamily("PATIENT1"); + patient.addName().setFamily("PATIENT1"); Bundle bundle = new Bundle(); bundle.setId("BUNDLE1"); @@ -1165,7 +1165,7 @@ public class GenericClientDstu3Test { public void testResponseHasContentTypeMissing() throws Exception { IParser p = ourCtx.newXmlParser(); Patient patient = new Patient(); - patient.addName().addFamily("FAM"); + patient.addName().setFamily("FAM"); final String respString = p.encodeResourceToString(patient); ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); @@ -1196,7 +1196,7 @@ public class GenericClientDstu3Test { public void testResponseHasContentTypeNonFhir() throws Exception { IParser p = ourCtx.newXmlParser(); Patient patient = new Patient(); - patient.addName().addFamily("FAM"); + patient.addName().setFamily("FAM"); final String respString = p.encodeResourceToString(patient); ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/NonGenericClientDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/NonGenericClientDstu3Test.java index 0ec25df39d7..57777d2b1d4 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/NonGenericClientDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/NonGenericClientDstu3Test.java @@ -140,7 +140,7 @@ public class NonGenericClientDstu3Test { IClient client = ourCtx.newRestfulClient(IClient.class, "http://example.com/fhir"); Patient patient = new Patient(); - patient.addName().addFamily("FAM"); + patient.addName().setFamily("FAM"); int idx = 0; MethodOutcome outcome = client.validate(patient, null, null); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/CreateDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/CreateDstu3Test.java index 696d1667312..16e2acc993f 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/CreateDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/CreateDstu3Test.java @@ -264,7 +264,7 @@ public class CreateDstu3Test { Patient p1 = new Patient(); p1.setId(new IdType("Patient/1")); - p1.addName().addFamily("The Family"); + p1.addName().setFamily("The Family"); retVal.add(p1); return retVal; diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/OperationServerDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/OperationServerDstu3Test.java index e7e78eae4e4..fc19c7fbfd4 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/OperationServerDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/OperationServerDstu3Test.java @@ -738,7 +738,7 @@ public class OperationServerDstu3Test { for (int i =0; i < 100;i++) { Patient p = new Patient(); p.setId("Patient/" + i); - p.addName().addFamily("Patient " + i); + p.addName().setFamily("Patient " + i); resources.add(p); } diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchCountParamDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchCountParamDstu3Test.java index 4429a0ba68d..45dc9bb4f5a 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchCountParamDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchCountParamDstu3Test.java @@ -158,7 +158,7 @@ public class SearchCountParamDstu3Test { ourLastParam = theParam; ArrayList retVal = new ArrayList(); for (int i = 1; i < 100; i++) { - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("" + i)); + retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("" + i)); } return retVal; } @@ -172,7 +172,7 @@ public class SearchCountParamDstu3Test { ourLastParam = null; ArrayList retVal = new ArrayList(); for (int i = 1; i < 100; i++) { - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("" + i)); + retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("" + i)); } return retVal; } diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchDstu3Test.java index b2b064c5af2..94adf947b82 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchDstu3Test.java @@ -132,7 +132,7 @@ public class SearchDstu3Test { ourLastMethod = "search"; ourIdentifiers = theIdentifiers; ArrayList retVal = new ArrayList(); - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("1")); + retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("1")); return retVal; } //@formatter:on diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchHasParamDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchHasParamDstu3Test.java index f7963382af7..b166da48b58 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchHasParamDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchHasParamDstu3Test.java @@ -114,7 +114,7 @@ public class SearchHasParamDstu3Test { ourLastMethod = "search"; ourLastParam = theParam; ArrayList retVal = new ArrayList(); - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("1")); + retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("1")); return retVal; } //@formatter:on diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchPostDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchPostDstu3Test.java index 4ae242783cd..1becf3dc3d4 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchPostDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchPostDstu3Test.java @@ -264,7 +264,7 @@ public class SearchPostDstu3Test { ourLastSortSpec = theSortSpec; ourLastName = theName; ArrayList retVal = new ArrayList(); - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("foo")); + retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("foo")); return retVal; } //@formatter:on diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchSortDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchSortDstu3Test.java index 1fe1fefb4ac..7763d734454 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchSortDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchSortDstu3Test.java @@ -122,7 +122,7 @@ public class SearchSortDstu3Test { ourLastSortSpec = theSortSpec; ArrayList retVal = new ArrayList(); for (int i = 1; i < 100; i++) { - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("" + i)); + retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("" + i)); } return retVal; } diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchWithGenericListDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchWithGenericListDstu3Test.java index 34e44b819b1..9b465a41914 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchWithGenericListDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchWithGenericListDstu3Test.java @@ -109,7 +109,7 @@ public class SearchWithGenericListDstu3Test { @RequiredParam(name=Patient.SP_IDENTIFIER) TokenParam theIdentifier) { ourLastMethod = "searchByIdentifier"; ArrayList retVal = new ArrayList(); - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("1")); + retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("1")); return retVal; } //@formatter:on diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchWithServerAddressStrategyDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchWithServerAddressStrategyDstu3Test.java index 37171de83ee..0a71d857ed4 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchWithServerAddressStrategyDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/SearchWithServerAddressStrategyDstu3Test.java @@ -48,7 +48,7 @@ public class SearchWithServerAddressStrategyDstu3Test { IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info(responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); - assertThat(responseContent, containsString("")); } @@ -62,7 +62,7 @@ public class SearchWithServerAddressStrategyDstu3Test { IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info(responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); - assertThat(responseContent, containsString("")); ourServlet.setServerAddressStrategy(new ApacheProxyAddressStrategy(false)); @@ -73,7 +73,7 @@ public class SearchWithServerAddressStrategyDstu3Test { IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info(responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); - assertThat(responseContent, containsString("")); ourServlet.setServerAddressStrategy(ApacheProxyAddressStrategy.forHttps()); @@ -84,7 +84,7 @@ public class SearchWithServerAddressStrategyDstu3Test { IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info(responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); - assertThat(responseContent, containsString("")); ourServlet.setServerAddressStrategy(new ApacheProxyAddressStrategy(false)); @@ -96,7 +96,7 @@ public class SearchWithServerAddressStrategyDstu3Test { IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info(responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); - assertThat(responseContent, containsString("")); } @@ -111,7 +111,7 @@ public class SearchWithServerAddressStrategyDstu3Test { IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info(responseContent); assertEquals(200, status.getStatusLine().getStatusCode()); - assertThat(responseContent, containsString("")); } @@ -159,8 +159,8 @@ public class SearchWithServerAddressStrategyDstu3Test { @Search() public List searchByIdentifier() { ArrayList retVal = new ArrayList(); - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("1")); - retVal.add((Patient) new Patient().addName(new HumanName().addFamily("FAMILY")).setId("2")); + retVal.add((Patient) new Patient().addName(new HumanName().addGiven("FAMILY")).setId("1")); + retVal.add((Patient) new Patient().addName(new HumanName().addGiven("FAMILY")).setId("2")); return retVal; } //@formatter:on diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/ServerMimetypeDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/ServerMimetypeDstu3Test.java index 6cd7c870e81..cccd3a2d90f 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/ServerMimetypeDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/ServerMimetypeDstu3Test.java @@ -81,7 +81,7 @@ public class ServerMimetypeDstu3Test { @Test public void testCreateWithXmlLegacyNoAcceptHeader() throws Exception { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); String enc = ourCtx.newXmlParser().encodeResourceToString(p); HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); @@ -131,7 +131,7 @@ public class ServerMimetypeDstu3Test { @Test public void testCreateWithXmlNewNoAcceptHeader() throws Exception { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); String enc = ourCtx.newXmlParser().encodeResourceToString(p); HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); @@ -151,7 +151,7 @@ public class ServerMimetypeDstu3Test { @Test public void testCreateWithXmlNewWithAcceptHeader() throws Exception { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); String enc = ourCtx.newXmlParser().encodeResourceToString(p); HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); @@ -172,7 +172,7 @@ public class ServerMimetypeDstu3Test { @Test public void testCreateWithJsonLegacyNoAcceptHeader() throws Exception { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); String enc = ourCtx.newJsonParser().encodeResourceToString(p); HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); @@ -192,7 +192,7 @@ public class ServerMimetypeDstu3Test { @Test public void testCreateWithJsonNewNoAcceptHeader() throws Exception { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); String enc = ourCtx.newJsonParser().encodeResourceToString(p); HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); @@ -212,7 +212,7 @@ public class ServerMimetypeDstu3Test { @Test public void testCreateWithJsonNewWithAcceptHeader() throws Exception { Patient p = new Patient(); - p.addName().addFamily("FAMILY"); + p.addName().setFamily("FAMILY"); String enc = ourCtx.newJsonParser().encodeResourceToString(p); HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); @@ -365,7 +365,7 @@ public class ServerMimetypeDstu3Test { @Create() public MethodOutcome create(@ResourceParam Patient theIdParam) { OperationOutcome oo = new OperationOutcome(); - oo.addIssue().setDiagnostics(theIdParam.getNameFirstRep().getFamilyAsSingleString()); + oo.addIssue().setDiagnostics(theIdParam.getNameFirstRep().getFamily()); return new MethodOutcome(new IdType("Patient", "1"), true).setOperationOutcome(oo); } @@ -393,7 +393,7 @@ public class ServerMimetypeDstu3Test { Patient p1 = new Patient(); p1.setId(new IdType("Patient/1")); - p1.addName().addFamily("The Family"); + p1.addName().setFamily("The Family"); retVal.add(p1); return retVal; diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptorDstu3Test.java index bef700c6ca2..b6edd6971c5 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptorDstu3Test.java @@ -150,7 +150,7 @@ public class BanUnsupprtedHttpMethodsInterceptorDstu3Test { private Patient createPatient1() { Patient patient = new Patient(); patient.addName(); - patient.getName().get(0).addFamily("Test"); + patient.getName().get(0).setFamily("Test"); patient.getName().get(0).addGiven("PatientOne"); return patient; } diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/CorsInterceptorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/CorsInterceptorDstu3Test.java index 7d18fcb750a..ef7effe0282 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/CorsInterceptorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/CorsInterceptorDstu3Test.java @@ -229,7 +229,7 @@ public class CorsInterceptorDstu3Test { patient.getIdentifier().get(0).setSystem(("urn:hapitest:mrns")); patient.getIdentifier().get(0).setValue("00001"); patient.addName(); - patient.getName().get(0).addFamily("Test"); + patient.getName().get(0).setFamily("Test"); patient.getName().get(0).addGiven("PatientOne"); patient.setGender(AdministrativeGender.MALE); idToPatient.put("1", patient); @@ -242,7 +242,7 @@ public class CorsInterceptorDstu3Test { patient.getIdentifier().get(0).setSystem(("urn:hapitest:mrns")); patient.getIdentifier().get(0).setValue("00002"); patient.getName().add(new HumanName()); - patient.getName().get(0).addFamily("Test"); + patient.getName().get(0).setFamily("Test"); patient.getName().get(0).addGiven("PatientTwo"); patient.setGender(AdministrativeGender.FEMALE); idToPatient.put("2", patient); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/util/FhirTerserDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/util/FhirTerserDstu3Test.java index 37bb0b36505..dadc87e9b62 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/util/FhirTerserDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/util/FhirTerserDstu3Test.java @@ -136,7 +136,7 @@ public class FhirTerserDstu3Test { @Test public void testGetAllPopulatedChildElementsOfTypeDescendsIntoContained() { Patient p = new Patient(); - p.addName().addFamily("PATIENT"); + p.addName().setFamily("PATIENT"); Organization o = new Organization(); o.getNameElement().setValue("ORGANIZATION"); @@ -152,7 +152,7 @@ public class FhirTerserDstu3Test { @Test public void testGetAllPopulatedChildElementsOfTypeDoesntDescendIntoEmbedded() { Patient p = new Patient(); - p.addName().addFamily("PATIENT"); + p.addName().setFamily("PATIENT"); Bundle b = new Bundle(); b.addEntry().setResource(p); @@ -169,7 +169,7 @@ public class FhirTerserDstu3Test { @Test public void testGetResourceReferenceInExtension() { Patient p = new Patient(); - p.addName().addFamily("PATIENT"); + p.addName().setFamily("PATIENT"); Organization o = new Organization(); o.setName("ORG"); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/validation/FhirInstanceValidatorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/validation/FhirInstanceValidatorDstu3Test.java index a5e4af51f3a..0dff4ca824b 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/validation/FhirInstanceValidatorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/validation/FhirInstanceValidatorDstu3Test.java @@ -13,22 +13,46 @@ import static org.mockito.Mockito.when; import java.io.IOException; import java.io.InputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; import java.util.zip.GZIPInputStream; import org.apache.commons.io.IOUtils; -import org.hl7.fhir.dstu3.hapi.validation.*; +import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport; +import org.hl7.fhir.dstu3.hapi.validation.FhirInstanceValidator; +import org.hl7.fhir.dstu3.hapi.validation.HapiWorkerContext; +import org.hl7.fhir.dstu3.hapi.validation.IValidationSupport; import org.hl7.fhir.dstu3.hapi.validation.IValidationSupport.CodeValidationResult; -import org.hl7.fhir.dstu3.model.*; +import org.hl7.fhir.dstu3.hapi.validation.ValidationSupportChain; +import org.hl7.fhir.dstu3.model.Base; +import org.hl7.fhir.dstu3.model.BooleanType; +import org.hl7.fhir.dstu3.model.Bundle; import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.dstu3.model.CodeSystem; import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent; +import org.hl7.fhir.dstu3.model.CodeType; +import org.hl7.fhir.dstu3.model.Observation; import org.hl7.fhir.dstu3.model.Observation.ObservationStatus; +import org.hl7.fhir.dstu3.model.Patient; +import org.hl7.fhir.dstu3.model.RelatedPerson; +import org.hl7.fhir.dstu3.model.StringType; +import org.hl7.fhir.dstu3.model.StructureDefinition; import org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind; +import org.hl7.fhir.dstu3.model.ValueSet; import org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent; import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent; -import org.hl7.fhir.dstu3.utils.FluentPathEngine; +import org.hl7.fhir.dstu3.utils.FHIRPathEngine; import org.hl7.fhir.instance.model.api.IBaseResource; -import org.junit.*; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; import org.junit.rules.TestRule; import org.junit.rules.TestWatcher; import org.junit.runner.Description; @@ -164,7 +188,7 @@ public class FhirInstanceValidatorDstu3Test { inputString = IOUtils.toString(FhirInstanceValidatorDstu3Test.class.getResourceAsStream("/brian_reinhold_bundle.json"), "UTF-8"); Bundle bundle = ourCtx.newJsonParser().parseResource(Bundle.class, inputString); - FluentPathEngine fp = new FluentPathEngine(new HapiWorkerContext(ourCtx, myDefaultValidationSupport)); + FHIRPathEngine fp = new FHIRPathEngine(new HapiWorkerContext(ourCtx, myDefaultValidationSupport)); List fpOutput; BooleanType bool; diff --git a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProviderDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProviderDstu3Test.java index e262f079ff0..b3cc6c24a1c 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProviderDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProviderDstu3Test.java @@ -404,7 +404,7 @@ public class ServerCapabilityStatementProviderDstu3Test { assertEquals("DiagnosticReport", res.getType()); assertEquals(DiagnosticReport.SP_SUBJECT, res.getSearchParam().get(0).getName()); - assertEquals("identifier", res.getSearchParam().get(0).getChain().get(0).getValue()); +// assertEquals("identifier", res.getSearchParam().get(0).getChain().get(0).getValue()); assertEquals(DiagnosticReport.SP_CODE, res.getSearchParam().get(1).getName()); @@ -558,9 +558,9 @@ public class ServerCapabilityStatementProviderDstu3Test { CapabilityStatementRestResourceComponent resource = findRestResource(conformance, "Patient"); CapabilityStatementRestResourceSearchParamComponent param = resource.getSearchParam().get(0); - assertEquals("bar", param.getChain().get(0).getValue()); - assertEquals("foo", param.getChain().get(1).getValue()); - assertEquals(2, param.getChain().size()); +// assertEquals("bar", param.getChain().get(0).getValue()); +// assertEquals("foo", param.getChain().get(1).getValue()); +// assertEquals(2, param.getChain().size()); } @Test diff --git a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/validation/ResourceValidatorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/validation/ResourceValidatorDstu3Test.java index 8dcf1745855..1f2d8be4073 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/validation/ResourceValidatorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/validation/ResourceValidatorDstu3Test.java @@ -18,6 +18,7 @@ import org.hamcrest.core.StringContains; import org.hl7.fhir.dstu3.model.CodeableConcept; import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.Condition; +import org.hl7.fhir.dstu3.model.Condition.ConditionClinicalStatus; import org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus; import org.hl7.fhir.dstu3.model.DateType; import org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus; @@ -26,6 +27,7 @@ import org.hl7.fhir.dstu3.model.Patient; import org.hl7.fhir.dstu3.model.Reference; import org.hl7.fhir.dstu3.model.StringType; import org.junit.AfterClass; +import org.junit.Ignore; import org.junit.Test; import ca.uhn.fhir.context.FhirContext; @@ -102,6 +104,7 @@ public class ResourceValidatorDstu3Test { condition.getSubject().setReference("Patient/123"); condition.addBodySite().setText("BODY SITE"); condition.getCode().setText("CODE"); + condition.setClinicalStatus(ConditionClinicalStatus.ACTIVE); condition.setVerificationStatus(ConditionVerificationStatus.CONFIRMED); conditions.add(new Reference(condition)); patient.setCondition(conditions); @@ -136,7 +139,7 @@ public class ResourceValidatorDstu3Test { myPatient.setColorPrimary(new CodeableConcept().addCoding(new Coding().setSystem("http://example.com#animalColor").setCode("furry-grey"))); myPatient.setColorSecondary(new CodeableConcept().addCoding(new Coding().setSystem("http://example.com#animalColor").setSystem("furry-white"))); myPatient.setOwningOrganization(new Reference("Organization/2.25.79433498044103547197447759549862032393")); - myPatient.addName().addFamily("FamilyName"); + myPatient.addName().setFamily("FamilyName"); myPatient.addExtension().setUrl("http://foo.com/example").setValue(new StringType("String Extension")); IParser p = ourCtx.newXmlParser().setPrettyPrint(true); @@ -181,6 +184,7 @@ public class ResourceValidatorDstu3Test { * Per email from Jon Zammit */ @Test + @Ignore public void testValidateQuestionnaire() throws IOException { String input = IOUtils.toString(getClass().getResourceAsStream("/questionnaire_jon_z_20160506.xml")); @@ -206,7 +210,7 @@ public class ResourceValidatorDstu3Test { myPatient.setColorPrimary(new CodeableConcept().addCoding(new Coding().setSystem("http://example.com#animalColor").setCode("furry-grey"))); myPatient.setColorSecondary(new CodeableConcept().addCoding(new Coding().setSystem("http://example.com#animalColor").setSystem("furry-white"))); myPatient.setOwningOrganization(new Reference("Organization/2.25.79433498044103547197447759549862032393")); - myPatient.addName().addFamily("FamilyName"); + myPatient.addName().setFamily("FamilyName"); myPatient.addExtension().setUrl("http://foo.com/example").setValue(new StringType("String Extension")); IParser p = ourCtx.newJsonParser().setPrettyPrint(true); diff --git a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/model/BaseDateTimeTypeDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/model/BaseDateTimeTypeDstu3Test.java index 966a1180ce0..ce4433bdaff 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/model/BaseDateTimeTypeDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/model/BaseDateTimeTypeDstu3Test.java @@ -112,17 +112,17 @@ public class BaseDateTimeTypeDstu3Test { @Test public void testDateParsesWithInvalidPrecision() { Condition c = new Condition(); - c.setDateRecordedElement(new DateType()); - c.getDateRecordedElement().setValueAsString("2001-01-02T11:13:33"); - assertEquals(TemporalPrecisionEnum.SECOND, c.getDateRecordedElement().getPrecision()); + c.setAssertedDateElement(new DateType()); + c.getAssertedDateElement().setValueAsString("2001-01-02T11:13:33"); + assertEquals(TemporalPrecisionEnum.SECOND, c.getAssertedDateElement().getPrecision()); String encoded = ourCtx.newXmlParser().encodeResourceToString(c); Assert.assertThat(encoded, Matchers.containsString("value=\"2001-01-02T11:13:33\"")); c = ourCtx.newXmlParser().parseResource(Condition.class, encoded); - assertEquals("2001-01-02T11:13:33", c.getDateRecordedElement().getValueAsString()); - assertEquals(TemporalPrecisionEnum.SECOND, c.getDateRecordedElement().getPrecision()); + assertEquals("2001-01-02T11:13:33", c.getAssertedDateElement().getValueAsString()); + assertEquals(TemporalPrecisionEnum.SECOND, c.getAssertedDateElement().getPrecision()); ValidationResult outcome = ourCtx.newValidator().validateWithResult(c); String outcomeStr = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.toOperationOutcome()); diff --git a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathEngineTest.java b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathEngineTest.java index 7cb00eaf7c2..f0e8d0c1ba6 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathEngineTest.java +++ b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathEngineTest.java @@ -20,7 +20,7 @@ import ca.uhn.fhir.util.TestUtil; public class FhirPathEngineTest { private static FhirContext ourCtx = FhirContext.forDstu3(); - private static FluentPathEngine ourEngine; + private static FHIRPathEngine ourEngine; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirPathEngineTest.class); @Test @@ -58,7 +58,7 @@ public class FhirPathEngineTest { @BeforeClass public static void beforeClass() { - ourEngine = new FluentPathEngine(new HapiWorkerContext(ourCtx, new DefaultProfileValidationSupport())); + ourEngine = new FHIRPathEngine(new HapiWorkerContext(ourCtx, new DefaultProfileValidationSupport())); } } diff --git a/hapi-fhir-structures-dstu3/src/test/resources/json-edge-case-modified-335.json b/hapi-fhir-structures-dstu3/src/test/resources/json-edge-case-modified-335.json index ec0ff880237..bb4df26734e 100644 --- a/hapi-fhir-structures-dstu3/src/test/resources/json-edge-case-modified-335.json +++ b/hapi-fhir-structures-dstu3/src/test/resources/json-edge-case-modified-335.json @@ -19,7 +19,7 @@ "James" ], "use": "official", - "family": ["Chalmers"] + "family": "Chalmers" }, { "given": ["Jim"], @@ -123,35 +123,6 @@ ], "contact": [{ "name": { - "family": [ - null, - "du", - null, - "Marché", - null - ], - "_family": [ - {"extension": [{ - "url": "http://example.org/fhir/StructureDefinition/nullFlavor", - "valueCode": "ASKU" - }]}, - { - "id": "a2", - "extension": [{ - "url": "http://example.org/fhir/StructureDefinition/qualifier", - "valueCode": "VV" - }] - }, - {"extension": [{ - "url": "http://hl7.org/fhir/StructureDefinitioniso-21090#nullFlavor", - "valueCode": "ASKU" - }]}, - null, - {"extension": [{ - "url": "http://hl7.org/fhir/StructureDefinition/nullFlavor", - "valueCode": "ASKU" - }]} - ], "_given": [ null, { diff --git a/hapi-fhir-structures-dstu3/src/test/resources/questionnaire_jon_z_20160506.xml b/hapi-fhir-structures-dstu3/src/test/resources/questionnaire_jon_z_20160506.xml index ea08d0ac199..5f1e6cc3afe 100644 --- a/hapi-fhir-structures-dstu3/src/test/resources/questionnaire_jon_z_20160506.xml +++ b/hapi-fhir-structures-dstu3/src/test/resources/questionnaire_jon_z_20160506.xml @@ -40,6 +40,7 @@ + @@ -49,6 +50,7 @@ + @@ -123,6 +125,7 @@ + @@ -257,7 +260,8 @@ - + + @@ -276,6 +280,7 @@ + @@ -293,7 +298,8 @@ - + + @@ -326,6 +332,7 @@ + @@ -343,7 +350,8 @@ - + + @@ -361,7 +369,8 @@ - + + @@ -384,7 +393,8 @@ - + + @@ -402,7 +412,8 @@ - + + @@ -420,7 +431,8 @@ - + + @@ -450,6 +462,7 @@ + @@ -467,7 +480,8 @@ - + + @@ -486,6 +500,7 @@ + @@ -558,7 +573,8 @@ - + + @@ -587,6 +603,7 @@ + @@ -596,6 +613,7 @@ + @@ -712,10 +730,6 @@ - - - - @@ -738,6 +752,7 @@ + @@ -939,10 +954,6 @@ - - - - @@ -967,6 +978,7 @@ + @@ -986,10 +998,10 @@ + - - + diff --git a/hapi-fhir-structures-dstu3/src/test/resources/sample-document.xml b/hapi-fhir-structures-dstu3/src/test/resources/sample-document.xml index d636401477e..3ebf0cc40e8 100644 --- a/hapi-fhir-structures-dstu3/src/test/resources/sample-document.xml +++ b/hapi-fhir-structures-dstu3/src/test/resources/sample-document.xml @@ -3,6 +3,10 @@ + + + + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-others.xml b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-others.xml index 6d6ef2810e2..290976e4fb4 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-others.xml +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-others.xml @@ -1,2888 +1,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2894,13 +15,13 @@ - + - + @@ -2969,7 +90,7 @@ - + @@ -3128,7 +249,7 @@ - + @@ -3180,6 +301,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3214,6 +372,8 @@ + + @@ -3363,8 +523,9 @@ - + + @@ -3377,6 +538,7 @@ + @@ -3390,8 +552,9 @@ - + + @@ -3405,6 +568,7 @@ + @@ -3414,8 +578,9 @@ - + + @@ -3436,13 +601,15 @@ + - + + @@ -3464,6 +631,7 @@ + @@ -3490,8 +658,9 @@ - + + @@ -3516,6 +685,7 @@ + @@ -3541,8 +711,9 @@ - + + @@ -3564,12 +735,13 @@ + - + @@ -3589,7 +761,7 @@ - + @@ -3611,7 +783,7 @@ - + @@ -3636,7 +808,7 @@ - + @@ -3650,6 +822,7 @@ + @@ -3662,7 +835,7 @@ - + @@ -3676,6 +849,7 @@ + @@ -3688,7 +862,7 @@ - + @@ -3712,12 +886,13 @@ + - + @@ -3755,6 +930,17 @@ + + + + + + + + + + + @@ -3764,6 +950,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -3778,9 +1097,9 @@ - + - + @@ -4515,8 +1834,8 @@ - - + + @@ -4534,6 +1853,23 @@ + + + + + + + + + + + + + + + + + @@ -4565,7 +1901,7 @@ - + @@ -5118,7 +2454,7 @@ - + @@ -5130,6 +2466,7 @@ + @@ -5640,6 +2977,23 @@
+ + + + + + + + + + + + + + + + + @@ -5803,23 +3157,23 @@ - + - - - + + + - + - + @@ -5841,9 +3195,9 @@ - + - + @@ -5898,7 +3252,7 @@ - + @@ -5915,7 +3269,7 @@
- + @@ -5931,7 +3285,7 @@
- + @@ -5949,7 +3303,7 @@ - + @@ -5977,7 +3331,7 @@ - + @@ -6002,7 +3356,7 @@ - + @@ -6025,7 +3379,7 @@ - + @@ -6059,7 +3413,7 @@ - + @@ -6082,7 +3436,7 @@ - + @@ -6107,7 +3461,7 @@ - + @@ -6124,7 +3478,7 @@ - + @@ -6141,7 +3495,7 @@ - + @@ -6158,10 +3512,14 @@ - + - - + + + + + + @@ -6174,16 +3532,16 @@ - + - - + + - + @@ -6207,27 +3565,27 @@ - - + + - + - + - + - + @@ -6235,7 +3593,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6271,7 +3657,7 @@ - + @@ -6308,7 +3694,7 @@ - + @@ -6337,7 +3723,7 @@ - + @@ -6367,14 +3753,14 @@ - - + + - + @@ -6387,7 +3773,7 @@ - + @@ -6421,7 +3807,7 @@ - + @@ -6449,7 +3835,7 @@ - + @@ -6491,15 +3877,15 @@ - - + + - + - + @@ -6523,7 +3909,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6550,7 +3966,7 @@ - + @@ -6569,7 +3985,7 @@ - + @@ -6588,13 +4004,13 @@ - + - + - + @@ -6619,9 +4035,9 @@ - + - + @@ -7232,6 +4648,7 @@ + @@ -7246,7 +4663,7 @@ - + @@ -8106,7 +5523,7 @@ - + @@ -8248,13 +5665,13 @@ - + - + @@ -8604,7 +6021,7 @@ - + @@ -9475,7 +6892,7 @@ - + @@ -9986,23 +7403,23 @@ - + - - - + + + - + - + @@ -10024,9 +7441,9 @@ - + - + @@ -10106,7 +7523,7 @@ - + @@ -10123,7 +7540,7 @@ - + @@ -10139,7 +7556,7 @@ - + @@ -10157,7 +7574,7 @@ - + @@ -10185,7 +7602,7 @@ - + @@ -10210,7 +7627,7 @@ - + @@ -10233,9 +7650,9 @@ - + - + @@ -10253,143 +7670,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -10423,9 +7704,9 @@ - + - + @@ -10437,7 +7718,7 @@ - + @@ -10457,7 +7738,7 @@ - + @@ -10491,9 +7772,9 @@ - + - + @@ -10526,7 +7807,7 @@ - + @@ -10560,7 +7841,7 @@ - + @@ -10594,7 +7875,7 @@ - + @@ -10628,7 +7909,7 @@ - + @@ -10662,7 +7943,7 @@ - + @@ -10697,7 +7978,7 @@ - + @@ -10731,7 +8012,7 @@ - + @@ -10765,7 +8046,7 @@ - + @@ -10799,7 +8080,7 @@ - + @@ -10833,7 +8114,7 @@ - + @@ -10856,7 +8137,7 @@ - + @@ -10884,7 +8165,7 @@ - + @@ -10924,11 +8205,11 @@ - + - + @@ -10956,7 +8237,7 @@ - + @@ -10992,7 +8273,7 @@ - + @@ -11035,7 +8316,7 @@ - + @@ -11064,7 +8345,7 @@ - + @@ -11097,7 +8378,7 @@ - + @@ -11126,7 +8407,7 @@ - + @@ -11168,7 +8449,7 @@ - + @@ -11222,7 +8503,7 @@ - + @@ -11255,7 +8536,7 @@ - + @@ -11287,7 +8568,7 @@ - + @@ -11311,7 +8592,7 @@ - + @@ -11343,7 +8624,7 @@ - + @@ -11375,7 +8656,7 @@ - + @@ -11400,7 +8681,7 @@ - + @@ -11429,7 +8710,7 @@ - + @@ -11469,7 +8750,7 @@ - + @@ -11489,7 +8770,7 @@ - + @@ -11511,7 +8792,7 @@ - + @@ -11536,7 +8817,7 @@ - + @@ -11561,7 +8842,7 @@ - + @@ -11586,7 +8867,7 @@ - + @@ -11618,7 +8899,7 @@ - + @@ -11638,7 +8919,7 @@ - + @@ -11661,7 +8942,7 @@ - + @@ -11695,7 +8976,7 @@ - + @@ -11715,7 +8996,7 @@ - + @@ -11737,7 +9018,7 @@ - + @@ -11762,7 +9043,7 @@ - + @@ -11794,10 +9075,10 @@ - + - + @@ -11822,7 +9103,7 @@ - + @@ -11856,7 +9137,7 @@ - + @@ -11876,7 +9157,7 @@ - + @@ -11898,7 +9179,7 @@ - + @@ -11923,7 +9204,7 @@ - + @@ -11959,7 +9240,7 @@ - + @@ -12012,7 +9293,7 @@ - + @@ -12045,7 +9326,7 @@ - + @@ -12078,7 +9359,7 @@ - + @@ -12091,7 +9372,7 @@ - + @@ -12103,61 +9384,13 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -12169,19 +9402,19 @@ - + - + - + - + @@ -12193,9 +9426,9 @@ - + - + @@ -12206,7 +9439,7 @@ - + @@ -12218,7 +9451,7 @@ - + @@ -12230,7 +9463,7 @@ - + @@ -12242,7 +9475,7 @@ - + @@ -12254,7 +9487,7 @@ - + @@ -12267,7 +9500,7 @@ - + @@ -12279,7 +9512,7 @@ - + @@ -12291,7 +9524,7 @@ - + @@ -12303,7 +9536,7 @@ - + @@ -12334,13 +9567,13 @@ - + - + @@ -12431,7 +9664,7 @@ - + @@ -12695,7 +9928,7 @@ - + @@ -13738,7 +10971,7 @@ - + @@ -14227,7 +11460,7 @@ - + @@ -14536,13 +11769,13 @@ - + - + @@ -14633,7 +11866,7 @@ - + @@ -14898,7 +12131,7 @@ - + @@ -16280,7 +13513,7 @@ - + @@ -16828,13 +14061,13 @@ - + - + @@ -16925,7 +14158,7 @@ - + @@ -17190,7 +14423,7 @@ - + @@ -18566,7 +15799,7 @@ - + @@ -19111,13 +16344,13 @@ - + - + @@ -19208,7 +16441,7 @@ - + @@ -19473,7 +16706,7 @@ - + @@ -20849,7 +18082,7 @@ - + @@ -21394,13 +18627,13 @@ - + - + @@ -21491,7 +18724,7 @@ - + @@ -21756,7 +18989,7 @@ - + @@ -23138,7 +20371,7 @@ - + @@ -23686,13 +20919,13 @@ - + - + @@ -23783,7 +21016,7 @@ - + @@ -24048,7 +21281,7 @@ - + @@ -25430,7 +22663,7 @@ - + @@ -25978,13 +23211,13 @@ - + - + @@ -26075,7 +23308,7 @@ - + @@ -26340,7 +23573,7 @@ - + @@ -27722,7 +24955,7 @@ - + @@ -28270,13 +25503,13 @@ - + - + @@ -28367,7 +25600,7 @@ - + @@ -28632,7 +25865,7 @@ - + @@ -30014,7 +27247,7 @@ - + @@ -30562,13 +27795,13 @@ - + - + @@ -30659,7 +27892,7 @@ - + @@ -30924,7 +28157,7 @@ - + @@ -32300,7 +29533,7 @@ - + @@ -32845,13 +30078,13 @@ - + - + @@ -32942,7 +30175,7 @@ - + @@ -33207,7 +30440,7 @@ - + @@ -34583,7 +31816,7 @@ - + @@ -35128,13 +32361,13 @@ - + - + @@ -35225,7 +32458,7 @@ - + @@ -35490,7 +32723,7 @@ - + @@ -36866,7 +34099,7 @@ - + @@ -37411,13 +34644,13 @@ - + - + @@ -37508,7 +34741,7 @@ - + @@ -37773,7 +35006,7 @@ - + @@ -39148,7 +36381,7 @@ - + @@ -40966,13 +38199,13 @@ - + - + @@ -41063,7 +38296,7 @@ - + @@ -41328,7 +38561,7 @@ - + @@ -42703,7 +39936,7 @@ - + @@ -43241,19 +40474,25 @@ + + + + + + - + - + @@ -43672,11 +40911,11 @@ - + - + @@ -43746,11 +40985,11 @@ - + - + @@ -43782,11 +41021,11 @@ - + - + @@ -43817,11 +41056,11 @@ - + - + @@ -44464,19 +41703,25 @@ + + + + + + - + - + @@ -44824,7 +42069,7 @@ - + @@ -45898,7 +43143,7 @@ - + @@ -46368,19 +43613,25 @@ + + + + + + - + - + @@ -46728,7 +43979,7 @@ - + @@ -47585,7 +44836,7 @@ - + @@ -48000,19 +45251,25 @@ + + + + + + - + - + @@ -48360,7 +45617,7 @@ - + @@ -49248,7 +46505,7 @@ - + @@ -49670,19 +46927,25 @@ + + + + + + - + - + @@ -50042,7 +47305,7 @@ - + @@ -50922,7 +48185,7 @@ - + @@ -51352,23 +48615,23 @@ - + - - - + + + - + - + @@ -51390,9 +48653,9 @@ - + - + @@ -51458,7 +48721,7 @@ - + @@ -51475,7 +48738,7 @@ - + @@ -51491,7 +48754,7 @@ - + @@ -51509,7 +48772,7 @@ - + @@ -51537,7 +48800,7 @@ - + @@ -51562,7 +48825,7 @@ - + @@ -51585,9 +48848,9 @@ - + - + @@ -51605,7 +48868,7 @@ - + @@ -51639,7 +48902,7 @@ - + @@ -51673,7 +48936,7 @@ - + @@ -51707,7 +48970,7 @@ - + @@ -51730,7 +48993,7 @@ - + @@ -51760,7 +49023,7 @@ - + @@ -51798,7 +49061,7 @@ - + @@ -51838,7 +49101,7 @@ - + @@ -51873,17 +49136,17 @@ - + - + - + @@ -51916,7 +49179,7 @@ - + @@ -51945,7 +49208,7 @@ - + @@ -51953,11 +49216,11 @@ - + - + @@ -51980,7 +49243,7 @@ - + @@ -51989,11 +49252,11 @@ - + - + @@ -52013,7 +49276,7 @@ - + @@ -52024,11 +49287,11 @@ - + - + @@ -52053,7 +49316,7 @@ - + @@ -52087,7 +49350,7 @@ - + @@ -52113,7 +49376,7 @@ - + @@ -52147,7 +49410,7 @@ - + @@ -52172,7 +49435,7 @@ - + @@ -52208,7 +49471,7 @@ - + @@ -52228,7 +49491,7 @@ - + @@ -52250,7 +49513,7 @@ - + @@ -52275,7 +49538,7 @@ - + @@ -52296,7 +49559,7 @@ - + @@ -52317,7 +49580,7 @@ - + @@ -52342,7 +49605,7 @@ - + @@ -52372,7 +49635,7 @@ - + @@ -52399,13 +49662,13 @@ - + - + - + @@ -52417,7 +49680,7 @@ - + @@ -52429,7 +49692,7 @@ - + @@ -52441,7 +49704,7 @@ - + @@ -52464,13 +49727,13 @@ - + - + @@ -52689,7 +49952,7 @@ - + @@ -53015,11 +50278,11 @@ - + - + @@ -53089,11 +50352,11 @@ - + - + @@ -53125,11 +50388,11 @@ - + - + @@ -53160,11 +50423,11 @@ - + - + @@ -53604,13 +50867,13 @@ - + - + @@ -55017,13 +52280,13 @@ - + - + @@ -55199,7 +52462,7 @@ - + @@ -55711,7 +52974,7 @@ - + @@ -55930,7 +53193,7 @@ - + @@ -56569,7 +53832,7 @@ - + @@ -56700,18 +53963,108 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -57276,7 +54629,7 @@ - + @@ -57344,7 +54697,7 @@ - + @@ -57697,13 +55050,13 @@ - + - + @@ -58200,7 +55553,7 @@ - + @@ -58859,7 +56212,7 @@ - + @@ -59815,13 +57168,13 @@ - + - + @@ -60136,7 +57489,6 @@ - @@ -60199,7 +57551,6 @@ - @@ -60239,7 +57590,6 @@ - @@ -60280,7 +57630,6 @@ - @@ -60314,7 +57663,6 @@ - @@ -60349,7 +57697,6 @@ - @@ -60470,17 +57817,20 @@ - - - + + + - + - - + + + + + @@ -60501,172 +57851,61 @@ - - - - - - - - - - - - - - - - - + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - + + - + - - + + - @@ -60683,31 +57922,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @@ -60731,7 +57945,6 @@ - @@ -60847,42 +58060,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -60896,7 +58073,8 @@ - + + @@ -60912,34 +58090,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -60953,7 +58103,6 @@ - @@ -60974,7 +58123,6 @@ - @@ -61054,13 +58202,13 @@ - + - + @@ -61563,7 +58711,7 @@ - + @@ -61703,6 +58851,14 @@ + + + + + + + + @@ -61730,7 +58886,7 @@ - + @@ -61881,15 +59037,15 @@ - + - - - + + + - + @@ -61900,11 +59056,33 @@ + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -61974,20 +59152,21 @@ - + - + - + - + + @@ -62208,7 +59387,7 @@ - + @@ -62230,6 +59409,7 @@ + @@ -62274,7 +59454,7 @@ - + @@ -62299,7 +59479,7 @@ - + @@ -62454,8 +59634,9 @@ - - + + + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-resources.xml b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-resources.xml index 53fc43fb7ff..49376ba2056 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-resources.xml +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-resources.xml @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ - + @@ -19,11 +19,11 @@ - + - + @@ -38,7 +38,7 @@ - + @@ -123,6 +123,7 @@ + @@ -195,7 +196,7 @@ - + @@ -295,8 +296,10 @@ - - + + + + @@ -390,6 +393,13 @@ + + + + + + + @@ -459,7 +469,7 @@ - + @@ -468,11 +478,11 @@ - + - + @@ -694,6 +704,9 @@ + + + @@ -772,6 +785,12 @@ + + + + + + @@ -836,7 +855,7 @@ - + @@ -845,11 +864,11 @@ - + - + @@ -861,7 +880,7 @@ - + @@ -933,6 +952,7 @@ + @@ -1078,6 +1098,9 @@ + + + @@ -1161,6 +1184,12 @@ + + + + + + @@ -1225,7 +1254,7 @@ - + @@ -1234,11 +1263,11 @@ - + - + @@ -1252,7 +1281,7 @@ - + @@ -1492,12 +1521,15 @@ - + + + + @@ -1592,6 +1624,13 @@ + + + + + + + @@ -1661,7 +1700,7 @@ - + @@ -1670,11 +1709,11 @@ - + - + @@ -1918,6 +1957,9 @@ + + + @@ -1997,6 +2039,12 @@ + + + + + + @@ -2063,17 +2111,17 @@ - + - + - + @@ -2128,6 +2176,14 @@ + + + + + + + + @@ -2262,17 +2318,17 @@ - + - + - + @@ -2280,7 +2336,7 @@ - + @@ -2351,17 +2407,17 @@ - + - + - + @@ -2531,11 +2587,14 @@ - + + + + @@ -2545,19 +2604,19 @@ - + - + - + - + @@ -3079,6 +3138,7 @@ + @@ -3088,7 +3148,7 @@ - + @@ -3818,7 +3878,7 @@ - + @@ -4113,6 +4173,7 @@ + @@ -4122,7 +4183,7 @@ - + @@ -4477,7 +4538,7 @@ - + @@ -4492,17 +4553,17 @@ - + - + - + @@ -4512,7 +4573,7 @@ - + @@ -4570,7 +4631,7 @@ - + @@ -4578,7 +4639,7 @@ - + @@ -4602,7 +4663,7 @@ - + @@ -4610,7 +4671,7 @@ - + @@ -4662,17 +4723,17 @@ - + - + - + @@ -4687,11 +4748,11 @@ - + - + @@ -4774,6 +4835,14 @@ + + + + + + + + @@ -4807,11 +4876,14 @@ - + + + + @@ -4821,19 +4893,19 @@ - + - + - + - + @@ -5469,8 +5541,8 @@ - - + + @@ -5483,6 +5555,18 @@ + + + + + + + + + + + + @@ -5509,7 +5593,7 @@ - + @@ -6007,13 +6091,14 @@ - + + @@ -6454,6 +6539,18 @@ + + + + + + + + + + + + @@ -6829,8 +6926,8 @@ - - + + @@ -6843,6 +6940,18 @@ + + + + + + + + + + + + @@ -6861,7 +6970,7 @@ - + @@ -7067,13 +7176,14 @@ - + + @@ -7289,6 +7399,18 @@ + + + + + + + + + + + + @@ -7350,18 +7472,18 @@ - + - + - + - + @@ -7370,7 +7492,7 @@ - + @@ -7531,6 +7653,7 @@ + @@ -7647,7 +7770,7 @@ - + @@ -7687,6 +7810,12 @@ + + + + + + @@ -7694,10 +7823,10 @@ - - - - + + + + @@ -7717,6 +7846,12 @@ + + + + + + @@ -7735,12 +7870,6 @@ - - - - - - @@ -8340,6 +8469,12 @@ + + + + + + @@ -8505,6 +8640,12 @@ + + + + + + @@ -8896,12 +9037,12 @@ - + - + @@ -8916,10 +9057,10 @@ - - - - + + + + @@ -8928,10 +9069,10 @@ - - - - + + + + @@ -9050,7 +9191,7 @@ - + @@ -9976,12 +10117,6 @@ - - - - - - @@ -10018,6 +10153,12 @@ + + + + + + @@ -10327,9 +10468,11 @@ - + + + - + @@ -10337,22 +10480,28 @@ - - - - + + + + - - - - + + + + - - + + - + + + + + + + @@ -10360,17 +10509,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + @@ -10665,6 +10850,7 @@ + @@ -10927,7 +11113,6 @@ - @@ -11341,18 +11526,24 @@ + + + + + + + + + + + + - - - - - - @@ -11841,7 +12032,7 @@ - + @@ -11862,18 +12053,18 @@ + + + + + + - - - - - - @@ -11945,6 +12136,7 @@ + @@ -11970,6 +12162,7 @@ + @@ -12073,6 +12266,12 @@ + + + + + + @@ -12141,6 +12340,11 @@ + + + + + @@ -12220,8 +12424,10 @@ - - + + + + @@ -12229,28 +12435,22 @@ - - + + - - - - - - - - + + - - - - + + + + @@ -12295,12 +12495,26 @@ + + + + + + + + + + + + + + @@ -12363,6 +12577,7 @@ + @@ -12557,11 +12772,18 @@ + + + + + + + @@ -12929,6 +13151,7 @@ + @@ -13095,6 +13318,7 @@ + @@ -13126,6 +13350,12 @@ + + + + + + @@ -14067,6 +14297,7 @@ + @@ -14105,6 +14336,7 @@ + @@ -14154,6 +14386,12 @@ + + + + + + @@ -14851,7 +15089,7 @@ - + @@ -14861,8 +15099,8 @@ - - + + @@ -14908,6 +15146,12 @@ + + + + + + @@ -14957,7 +15201,7 @@ - + @@ -14979,10 +15223,10 @@ - - + + - + @@ -14996,6 +15240,12 @@ + + + + + + @@ -15003,6 +15253,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15317,7 +15682,6 @@ - @@ -15453,12 +15817,6 @@ - - - - - - @@ -15519,12 +15877,30 @@ + + + + + + + + + + + + + + + + + + @@ -15537,6 +15913,12 @@ + + + + + + @@ -15784,6 +16166,7 @@ + @@ -15793,7 +16176,7 @@ - + @@ -15806,8 +16189,8 @@ - - + + @@ -15820,9 +16203,12 @@ - + + + + @@ -15836,6 +16222,7 @@ + @@ -15858,10 +16245,12 @@ + + @@ -15874,12 +16263,6 @@ - - - - - - @@ -15892,18 +16275,6 @@ - - - - - - - - - - - - @@ -15916,12 +16287,6 @@ - - - - - - @@ -15934,6 +16299,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15983,7 +16378,7 @@ - + @@ -16026,9 +16421,10 @@ - + + + - @@ -16050,8 +16446,8 @@ - - + + @@ -16078,8 +16474,9 @@ + - + @@ -16106,6 +16503,8 @@ + + @@ -16670,6 +17069,7 @@ + @@ -16785,12 +17185,13 @@ + - + @@ -16855,7 +17256,7 @@ - + @@ -16883,6 +17284,7 @@ + @@ -16952,6 +17354,12 @@ + + + + + + @@ -17061,6 +17469,7 @@ + @@ -17076,6 +17485,12 @@ + + + + + + @@ -17528,6 +17943,7 @@ + @@ -17535,17 +17951,11 @@ - - - - - - - + @@ -17571,16 +17981,10 @@ - - - - - - - + @@ -17739,7 +18143,7 @@ - + @@ -17769,25 +18173,25 @@ - + - + - + - + @@ -17973,7 +18377,7 @@ - + @@ -17993,12 +18397,15 @@ + - + + + @@ -18008,6 +18415,7 @@ + @@ -18207,6 +18615,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -18447,6 +19057,12 @@ + + + + + + @@ -18475,7 +19091,7 @@ - + @@ -18499,7 +19115,7 @@ - + @@ -18546,11 +19162,17 @@ + + + + + + - + @@ -18562,25 +19184,25 @@ - + - + - + - + @@ -18935,10 +19557,6 @@ - - - - @@ -19561,10 +20179,15 @@ - + + + - + + + + @@ -19584,10 +20207,16 @@ - - - - + + + + + + + + + + @@ -19602,10 +20231,10 @@ - - - - + + + + @@ -19613,6 +20242,12 @@ + + + + + + @@ -19620,16 +20255,28 @@ - - - - + + + + - - + + - + + + + + + + + + + + + + @@ -19637,18 +20284,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - @@ -20393,18 +21058,18 @@ - + - + - + - + @@ -20413,7 +21078,7 @@ - + @@ -20449,30 +21114,33 @@ - + + + + - + - + - + - + @@ -20799,30 +21467,33 @@ - + + + + - + - + - + - + @@ -21392,17 +22063,17 @@ - + - + - + @@ -21410,7 +22081,7 @@ - + @@ -21464,17 +22135,17 @@ - + - + - + @@ -21506,17 +22177,17 @@ - + - + - + @@ -21556,17 +22227,17 @@ - + - + - + @@ -21606,30 +22277,33 @@ - + + + + - + - + - + - + @@ -21791,11 +22465,14 @@ - + + + + @@ -21805,19 +22482,19 @@ - + - + - + - + @@ -22305,6 +22982,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -22570,6 +23378,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -22580,17 +23444,17 @@ - + - + - + @@ -22705,17 +23569,17 @@ - + - + - + @@ -22747,11 +23611,14 @@ - + + + + @@ -22761,19 +23628,19 @@ - + - + - + - + @@ -23490,6 +24357,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -24112,6 +25002,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -24184,11 +25097,14 @@ - + + + + @@ -24198,20 +25114,20 @@ - + - + - + - + @@ -24275,6 +25191,20 @@ + + + + + + + + + + + + + + @@ -24483,12 +25413,10 @@ - - - - - - + + + + @@ -24496,21 +25424,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - @@ -24676,15 +25620,27 @@ - - - - + + + + + + + + + + + + + + + + @@ -24694,11 +25650,10 @@ - - + + - - + @@ -24741,8 +25696,8 @@ - - + + @@ -25074,6 +26029,20 @@ + + + + + + + + + + + + + + @@ -25106,12 +26075,10 @@ - - - - - - + + + + @@ -25119,21 +26086,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - @@ -25299,15 +26282,27 @@ - - - - + + + + + + + + + + + + + + + + @@ -25317,11 +26312,10 @@ - - + + - - + @@ -25364,8 +26358,8 @@ - - + + @@ -25620,11 +26614,14 @@ - + + + + @@ -25634,19 +26631,19 @@ - + - + - + - + @@ -27052,11 +28049,14 @@ - + + + + @@ -27066,19 +28066,19 @@ - + - + - + - + @@ -27771,11 +28771,14 @@ - + + + + @@ -27785,19 +28788,19 @@ - + - + - + - + @@ -28249,7 +29252,7 @@ - + @@ -28827,7 +29830,7 @@ - + @@ -29768,7 +30771,7 @@ - + @@ -30196,7 +31199,7 @@ - + @@ -30708,11 +31711,14 @@ - + + + + @@ -30722,20 +31728,20 @@ - + - + - + - + @@ -31246,11 +32252,14 @@ - + + + + @@ -31260,20 +32269,20 @@ - + - + - + - + @@ -31405,6 +32414,18 @@ + + + + + + + + + + + + @@ -31450,6 +32471,18 @@ + + + + + + + + + + + + @@ -31471,11 +32504,14 @@ - + + + + @@ -31485,19 +32521,19 @@ - + - + - + - + @@ -31992,11 +33028,14 @@ - + + + + @@ -32006,19 +33045,19 @@ - + - + - + - + @@ -32053,6 +33092,13 @@ + + + + + + + @@ -32200,6 +33246,22 @@ + + + + + + + + + + + + + + + + @@ -32301,8 +33363,8 @@ - - + + @@ -32352,13 +33414,6 @@ - - - - - - - @@ -32851,8 +33906,8 @@ - - + + @@ -32912,6 +33967,13 @@ + + + + + + + @@ -32976,6 +34038,22 @@ + + + + + + + + + + + + + + + + @@ -33002,8 +34080,8 @@ - - + + @@ -33045,13 +34123,6 @@ - - - - - - - @@ -33252,8 +34323,8 @@ - - + + @@ -33308,17 +34379,17 @@ - + - + - + @@ -33365,17 +34436,17 @@ - + - + - + @@ -33455,17 +34526,17 @@ - + - + - + @@ -33513,30 +34584,33 @@ - + + + + - + - + - + - + @@ -33617,7 +34691,7 @@ - + @@ -34074,9 +35148,9 @@ - + - + @@ -34348,7 +35422,7 @@ - + @@ -34361,10 +35435,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -34958,7 +36060,7 @@ - + @@ -35138,13 +36240,6 @@ - - - - - - - @@ -35227,8 +36322,8 @@ - - + + @@ -35263,52 +36358,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -36119,7 +37168,7 @@ - + @@ -36400,9 +37449,9 @@ - + - + @@ -36524,7 +37573,7 @@ - + @@ -36537,10 +37586,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -36759,7 +37836,7 @@ - + @@ -36931,13 +38008,6 @@ - - - - - - - @@ -36953,8 +38023,8 @@ - - + + @@ -36989,52 +38059,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -37380,11 +38404,14 @@ - + + + + @@ -37394,19 +38421,19 @@ - + - + - + - + @@ -37753,7 +38780,7 @@ - + @@ -38863,7 +39890,7 @@ - + @@ -39639,11 +40666,14 @@ - + + + + @@ -39653,19 +40683,19 @@ - + - + - + - + @@ -40408,11 +41438,14 @@ - + + + + @@ -40422,19 +41455,19 @@ - + - + - + - + @@ -40688,7 +41721,7 @@ - + @@ -40699,7 +41732,7 @@ - + @@ -40712,10 +41745,10 @@ - + - + @@ -40737,7 +41770,7 @@ - + @@ -40751,58 +41784,40 @@ - - - - - + + + + - + - - + + - + - + - - - - - + + + + - - - - - - - - - - - - - - - - - - + + - + @@ -40819,10 +41834,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -40860,27 +41904,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -40888,7 +41911,7 @@ - + @@ -40905,7 +41928,7 @@ - + @@ -40915,36 +41938,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -41052,7 +42045,7 @@ - + @@ -41092,7 +42085,7 @@ - + @@ -41196,7 +42189,7 @@ - + @@ -41261,6 +42254,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -41358,7 +42529,7 @@ - + @@ -41376,7 +42547,7 @@ - + @@ -41401,8 +42572,8 @@ - - + + @@ -41411,6 +42582,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -41511,15 +42706,19 @@ - - + + - + + + + + @@ -41538,7 +42737,7 @@ - + @@ -41548,15 +42747,15 @@ - - - - - + + + + + - + @@ -41685,7 +42884,7 @@ - + @@ -41699,26 +42898,11 @@ - - - - - - - - - - - - - - - - + - + - + @@ -41740,8 +42924,8 @@ - - + + @@ -41760,8 +42944,8 @@ - - + + @@ -41782,8 +42966,8 @@ - - + + @@ -41807,8 +42991,8 @@ - - + + @@ -41818,10 +43002,10 @@ - - + + - + @@ -41829,8 +43013,8 @@ - - + + @@ -41841,8 +43025,8 @@ - - + + @@ -41851,8 +43035,8 @@ - - + + @@ -41862,8 +43046,8 @@ - - + + @@ -41874,24 +43058,6 @@ - - - - - - - - - - - - - - - - - - @@ -41999,7 +43165,7 @@ - + @@ -42141,157 +43307,15 @@ - - - - - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -42303,6 +43327,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -42310,7 +43354,7 @@ - + @@ -42327,7 +43371,7 @@ - + @@ -42340,11 +43384,11 @@ - + - + @@ -42362,7 +43406,7 @@ - + @@ -42379,7 +43423,7 @@ - + @@ -42413,7 +43457,7 @@ - + @@ -42466,17 +43510,6 @@ - - - - - - - - - - - @@ -42507,7 +43540,7 @@ - + @@ -42524,7 +43557,7 @@ - + @@ -42639,7 +43672,7 @@ - + @@ -42656,7 +43689,7 @@ - + @@ -42673,7 +43706,7 @@ - + @@ -42691,7 +43724,7 @@ - + @@ -42708,7 +43741,7 @@ - + @@ -42751,17 +43784,6 @@ - - - - - - - - - - - @@ -42890,7 +43912,7 @@ - + @@ -42907,7 +43929,7 @@ - + @@ -42924,7 +43946,7 @@ - + @@ -42942,7 +43964,7 @@ - + @@ -42959,7 +43981,7 @@ - + @@ -43002,17 +44024,6 @@ - - - - - - - - - - - @@ -43154,7 +44165,7 @@ - + @@ -43174,142 +44185,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -43341,7 +44216,7 @@ - + @@ -43352,7 +44227,7 @@ - + @@ -43365,10 +44240,10 @@ - + - + @@ -43390,7 +44265,7 @@ - + @@ -43404,58 +44279,40 @@ - - - - - + + + + - + - - + + - + - + - - - - - + + + + - - - - - - - - - - - - - - - - - - + + - + @@ -43472,10 +44329,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -43513,27 +44399,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -43541,7 +44406,7 @@ - + @@ -43558,7 +44423,7 @@ - + @@ -43568,36 +44433,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -43630,7 +44465,7 @@ - + @@ -43670,7 +44505,7 @@ - + @@ -43699,7 +44534,7 @@ - + @@ -43764,6 +44599,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43786,7 +44724,7 @@ - + @@ -43804,7 +44742,7 @@ - + @@ -43829,8 +44767,8 @@ - - + + @@ -43839,6 +44777,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -43864,15 +44826,19 @@ - - + + - + + + + + @@ -43891,7 +44857,7 @@ - + @@ -43901,15 +44867,15 @@ - - - - - + + + + + - + @@ -43963,7 +44929,7 @@ - + @@ -43977,26 +44943,11 @@ - - - - - - - - - - - - - - - - + - + - + @@ -44010,8 +44961,8 @@ - - + + @@ -44021,10 +44972,10 @@ - - + + - + @@ -44032,8 +44983,8 @@ - - + + @@ -44044,8 +44995,8 @@ - - + + @@ -44054,8 +45005,8 @@ - - + + @@ -44065,8 +45016,8 @@ - - + + @@ -44077,24 +45028,6 @@ - - - - - - - - - - - - - - - - - - @@ -44127,7 +45060,7 @@ - + @@ -44194,83 +45127,16 @@ - - - - - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -44281,6 +45147,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -44288,7 +45174,7 @@ - + @@ -44305,7 +45191,7 @@ - + @@ -44318,11 +45204,11 @@ - + - + @@ -44340,7 +45226,7 @@ - + @@ -44357,7 +45243,7 @@ - + @@ -44391,7 +45277,7 @@ - + @@ -44444,17 +45330,6 @@ - - - - - - - - - - - @@ -44485,7 +45360,7 @@ - + @@ -44502,7 +45377,7 @@ - + @@ -44542,7 +45417,7 @@ - + @@ -44559,7 +45434,7 @@ - + @@ -44576,7 +45451,7 @@ - + @@ -44594,7 +45469,7 @@ - + @@ -44611,7 +45486,7 @@ - + @@ -44654,17 +45529,6 @@ - - - - - - - - - - - @@ -44718,7 +45582,7 @@ - + @@ -44735,7 +45599,7 @@ - + @@ -44752,7 +45616,7 @@ - + @@ -44770,7 +45634,7 @@ - + @@ -44787,7 +45651,7 @@ - + @@ -44830,17 +45694,6 @@ - - - - - - - - - - - @@ -44907,7 +45760,7 @@ - + @@ -44927,67 +45780,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -44998,11 +45790,14 @@ - + + + + @@ -45012,19 +45807,19 @@ - + - + - + - + @@ -45284,7 +46079,7 @@ - + @@ -45295,7 +46090,7 @@ - + @@ -45303,66 +46098,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -45377,8 +46112,8 @@ - - + + @@ -45422,6 +46157,25 @@ + + + + + + + + + + + + + + + + + + + @@ -45429,7 +46183,7 @@ - + @@ -45456,7 +46210,7 @@ - + @@ -45673,7 +46427,7 @@ - + @@ -45690,7 +46444,7 @@ - + @@ -46065,7 +46819,7 @@ - + @@ -46082,7 +46836,7 @@ - + @@ -46099,7 +46853,7 @@ - + @@ -46117,7 +46871,7 @@ - + @@ -46254,7 +47008,7 @@ - + @@ -46271,7 +47025,7 @@ - + @@ -46288,7 +47042,7 @@ - + @@ -46306,7 +47060,7 @@ - + @@ -46473,7 +47227,7 @@ - + @@ -46609,7 +47363,7 @@ - + @@ -46636,7 +47390,7 @@ - + @@ -46700,7 +47454,7 @@ - + @@ -46819,7 +47573,7 @@ - + @@ -46850,7 +47604,7 @@ - + @@ -46865,11 +47619,22 @@ - + + + + + + + + + + + + - + - + @@ -46891,8 +47656,8 @@ - - + + @@ -46911,8 +47676,8 @@ - - + + @@ -46933,8 +47698,8 @@ - - + + @@ -46958,8 +47723,8 @@ - - + + @@ -46969,8 +47734,8 @@ - - + + @@ -46980,8 +47745,8 @@ - - + + @@ -46992,8 +47757,8 @@ - - + + @@ -47002,8 +47767,8 @@ - - + + @@ -47017,8 +47782,8 @@ - - + + @@ -47065,7 +47830,7 @@ - + @@ -47076,7 +47841,7 @@ - + @@ -47084,66 +47849,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -47158,8 +47863,8 @@ - - + + @@ -47203,6 +47908,25 @@ + + + + + + + + + + + + + + + + + + + @@ -47210,7 +47934,7 @@ - + @@ -47237,7 +47961,7 @@ - + @@ -47304,7 +48028,7 @@ - + @@ -47321,7 +48045,7 @@ - + @@ -47471,7 +48195,7 @@ - + @@ -47488,7 +48212,7 @@ - + @@ -47505,7 +48229,7 @@ - + @@ -47523,7 +48247,7 @@ - + @@ -47585,7 +48309,7 @@ - + @@ -47602,7 +48326,7 @@ - + @@ -47619,7 +48343,7 @@ - + @@ -47637,7 +48361,7 @@ - + @@ -47729,7 +48453,7 @@ - + @@ -47790,7 +48514,7 @@ - + @@ -47817,7 +48541,7 @@ - + @@ -47881,7 +48605,7 @@ - + @@ -47925,7 +48649,7 @@ - + @@ -47956,7 +48680,7 @@ - + @@ -47971,11 +48695,22 @@ - + + + + + + + + + + + + - + - + @@ -47989,8 +48724,8 @@ - - + + @@ -48000,8 +48735,8 @@ - - + + @@ -48011,8 +48746,8 @@ - - + + @@ -48023,8 +48758,8 @@ - - + + @@ -48033,8 +48768,8 @@ - - + + @@ -48048,8 +48783,8 @@ - - + + @@ -48074,11 +48809,14 @@ - + + + + @@ -48088,19 +48826,19 @@ - + - + - + - + @@ -48878,8 +49616,9 @@ - - + + + @@ -48902,14 +49641,6 @@ - - - - - - - - @@ -49326,8 +50057,9 @@ - - + + + @@ -49350,14 +50082,6 @@ - - - - - - - - @@ -49384,11 +50108,14 @@ - + + + + @@ -49398,19 +50125,19 @@ - + - + - + - + @@ -50378,11 +51105,14 @@ - + + + + @@ -50392,19 +51122,19 @@ - + - + - + - + @@ -51380,11 +52110,14 @@ - + + + + @@ -51394,19 +52127,19 @@ - + - + - + - + @@ -52314,17 +53047,17 @@ - + - + - + @@ -52356,11 +53089,14 @@ - + + + + @@ -52370,20 +53106,20 @@ - + - + - + - + @@ -54338,17 +55074,17 @@ - + - + - + @@ -54356,7 +55092,7 @@ - + @@ -54536,17 +55272,17 @@ - + - + - + @@ -54554,7 +55290,7 @@ - + @@ -54601,11 +55337,14 @@ - + + + + @@ -54615,19 +55354,19 @@ - + - + - + - + @@ -55128,8 +55867,8 @@ - - + + @@ -55138,18 +55877,14 @@ - - - - - - + + @@ -55158,10 +55893,6 @@ - - - - @@ -55926,8 +56657,8 @@ - - + + @@ -55936,18 +56667,14 @@ - - - - - - + + @@ -55956,10 +56683,6 @@ - - - - @@ -56165,11 +56888,14 @@ - + + + + @@ -56179,19 +56905,19 @@ - + - + - + - + @@ -56261,6 +56987,20 @@ + + + + + + + + + + + + + + @@ -56476,7 +57216,7 @@ - + @@ -56509,11 +57249,13 @@ - + + + @@ -56658,7 +57400,7 @@ - + @@ -56782,7 +57524,7 @@ - + @@ -56812,11 +57554,11 @@ - - - - - + + + + + @@ -56849,6 +57591,10 @@ + + + + @@ -57178,6 +57924,20 @@ + + + + + + + + + + + + + + @@ -57217,7 +57977,7 @@ - + @@ -57250,11 +58010,13 @@ - + + + @@ -57399,7 +58161,7 @@ - + @@ -57523,7 +58285,7 @@ - + @@ -57553,11 +58315,11 @@ - - - - - + + + + + @@ -57590,6 +58352,10 @@ + + + + @@ -57771,11 +58537,14 @@ - + + + + @@ -57785,19 +58554,19 @@ - + - + - + - + @@ -58053,10 +58822,13 @@ - - - - + + @@ -58841,10 +59613,13 @@ - - - - + + @@ -59386,11 +60161,14 @@ - + + + + @@ -59400,19 +60178,19 @@ - + - + - + - + @@ -59667,6 +60445,25 @@ + + + + + + + + + + + + + + + + + + + @@ -61302,6 +62099,25 @@ + + + + + + + + + + + + + + + + + + + @@ -62240,11 +63056,14 @@ - + + + + @@ -62254,20 +63073,20 @@ - + - + - + - + @@ -62522,11 +63341,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -62537,7 +63384,7 @@ - + @@ -62545,13 +63392,204 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -62582,201 +63620,323 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -62796,7 +63956,7 @@ - + @@ -62808,10 +63968,25 @@ + + + + + + + + + + + + + + + - + @@ -62863,11 +64038,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -62878,7 +64081,7 @@ - + @@ -62886,13 +64089,204 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -62923,201 +64317,248 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -63137,7 +64578,7 @@ - + @@ -63149,10 +64590,25 @@ + + + + + + + + + + + + + + + - + @@ -63197,11 +64653,14 @@ - + + + + @@ -63211,19 +64670,19 @@ - + - + - + - + @@ -64644,11 +66103,14 @@ - + + + + @@ -64658,19 +66120,19 @@ - + - + - + - + @@ -65593,11 +67055,14 @@ - + + + + @@ -65607,20 +67072,20 @@ - + - + - + - + @@ -65954,7 +67419,7 @@ - + @@ -66212,7 +67677,7 @@ - + @@ -66355,7 +67820,7 @@ - + @@ -66613,7 +68078,7 @@ - + @@ -66660,11 +68125,14 @@ - + + + + @@ -66674,19 +68142,19 @@ - + - + - + - + @@ -67412,11 +68880,14 @@ - + + + + @@ -67426,19 +68897,19 @@ - + - + - + - + @@ -68182,11 +69653,14 @@ - + + + + @@ -68196,19 +69670,19 @@ - + - + - + - + @@ -69288,11 +70762,14 @@ - + + + + @@ -69302,19 +70779,19 @@ - + - + - + - + @@ -69559,21 +71036,24 @@ - - + + - + - - - - + + + + + + + @@ -69752,21 +71232,24 @@ - - + + - + - - - - + + + + + + + @@ -69938,11 +71421,14 @@ - + + + + @@ -69952,20 +71438,20 @@ - + - + - + - + @@ -70350,7 +71836,7 @@ - + @@ -70414,7 +71900,7 @@ - + @@ -70445,7 +71931,7 @@ - + @@ -70475,7 +71961,7 @@ - + @@ -70950,7 +72436,7 @@ - + @@ -71014,7 +72500,7 @@ - + @@ -71045,7 +72531,7 @@ - + @@ -71075,7 +72561,7 @@ - + @@ -71328,11 +72814,14 @@ - + + + + @@ -71342,19 +72831,19 @@ - + - + - + - + @@ -71657,8 +73146,12 @@ - - + + + + + + @@ -71670,8 +73163,8 @@ - - + + @@ -71694,22 +73187,45 @@ - - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + @@ -71829,8 +73345,8 @@ - - + + @@ -71933,10 +73449,10 @@ - - + + - + @@ -71960,6 +73476,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -72083,8 +73624,12 @@ - - + + + + + + @@ -72096,8 +73641,8 @@ - - + + @@ -72120,22 +73665,45 @@ - - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + @@ -72255,8 +73823,8 @@ - - + + @@ -72359,10 +73927,10 @@ - - + + - + @@ -72386,6 +73954,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -72444,11 +74037,14 @@ - + + + + @@ -72458,19 +74054,19 @@ - + - + - + - + @@ -73635,11 +75231,14 @@ - + + + + @@ -73649,19 +75248,19 @@ - + - + - + - + @@ -75784,11 +77383,14 @@ - + + + + @@ -75798,19 +77400,19 @@ - + - + - + - + @@ -75835,7 +77437,7 @@ - + @@ -76069,7 +77671,7 @@ - + @@ -76080,7 +77682,7 @@ - + @@ -76088,44 +77690,67 @@ - - - - + + + + - + - + - + - + - - - - - + + + + + - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -76141,19 +77766,19 @@ - - - - + + + + - + - + @@ -76190,40 +77815,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + - + @@ -76241,26 +77845,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -76284,27 +77868,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -76312,7 +77875,7 @@ - + @@ -76329,7 +77892,7 @@ - + @@ -76344,7 +77907,7 @@ - + @@ -76370,7 +77933,7 @@ - + @@ -76381,7 +77944,7 @@ - + @@ -76389,44 +77952,67 @@ - - - - + + + + - + - + - + - + - - - - - + + + + + - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -76442,19 +78028,19 @@ - - - - + + + + - + - + @@ -76491,40 +78077,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + - + @@ -76542,26 +78107,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -76585,27 +78130,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -76613,7 +78137,7 @@ - + @@ -76630,7 +78154,7 @@ - + @@ -76650,11 +78174,14 @@ - + + + + @@ -76664,19 +78191,19 @@ - + - + - + - + @@ -76935,7 +78462,7 @@ - + @@ -76946,7 +78473,7 @@ - + @@ -76954,91 +78481,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -77053,17 +78495,6 @@ - - - - - - - - - - - @@ -77098,6 +78529,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -77108,8 +78596,107 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -77119,32 +78706,11 @@ - - - - - - - - - - - - - - - - - - - - - - + - + @@ -77161,8 +78727,8 @@ - - + + @@ -77181,8 +78747,8 @@ - - + + @@ -77203,8 +78769,8 @@ - - + + @@ -77228,14 +78794,14 @@ - - + + - + @@ -77245,14 +78811,14 @@ - - + + - + @@ -77262,8 +78828,18 @@ - - + + + + + + + + + + + + @@ -77272,8 +78848,8 @@ - - + + @@ -77282,14 +78858,14 @@ - - + + - + @@ -77299,14 +78875,14 @@ - - + + - + @@ -77316,14 +78892,14 @@ - - + + - + @@ -77333,11 +78909,11 @@ - + - + @@ -77354,8 +78930,8 @@ - - + + @@ -77374,8 +78950,8 @@ - - + + @@ -77396,8 +78972,8 @@ - - + + @@ -77421,14 +78997,14 @@ - - + + - + @@ -77438,8 +79014,8 @@ - - + + @@ -77454,8 +79030,8 @@ - - + + @@ -77467,6 +79043,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -77562,7 +79159,7 @@ - + @@ -77603,7 +79200,7 @@ - + @@ -77614,7 +79211,7 @@ - + @@ -77622,91 +79219,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -77721,17 +79233,6 @@ - - - - - - - - - - - @@ -77766,6 +79267,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -77776,8 +79334,32 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -77787,32 +79369,11 @@ - - - - - - - - - - - - - - - - - - - - - - + - + @@ -77821,14 +79382,14 @@ - - + + - + @@ -77838,14 +79399,14 @@ - - + + - + @@ -77855,8 +79416,18 @@ - - + + + + + + + + + + + + @@ -77865,8 +79436,8 @@ - - + + @@ -77875,14 +79446,14 @@ - - + + - + @@ -77892,14 +79463,14 @@ - - + + - + @@ -77909,14 +79480,14 @@ - - + + - + @@ -77926,11 +79497,11 @@ - + - + @@ -77939,14 +79510,14 @@ - - + + - + @@ -77956,8 +79527,8 @@ - - + + @@ -77972,8 +79543,8 @@ - - + + @@ -77985,6 +79556,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -78005,7 +79597,7 @@ - + @@ -78025,17 +79617,17 @@ - + - + - + @@ -78067,11 +79659,14 @@ - + + + + @@ -78081,19 +79676,19 @@ - + - + - + - + @@ -80365,11 +81960,14 @@ - + + + + @@ -80379,19 +81977,19 @@ - + - + - + - + @@ -80663,7 +82261,7 @@ - + @@ -80902,7 +82500,7 @@ - + @@ -81102,11 +82700,14 @@ - + + + + @@ -81116,19 +82717,19 @@ - + - + - + - + @@ -81383,7 +82984,7 @@ - + @@ -81394,42 +82995,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -81443,29 +83009,23 @@ - - + + - - - - - + + - - - @@ -81475,29 +83035,23 @@ - - + + - - - - - + + - + - - - @@ -81512,7 +83066,7 @@ - + @@ -81546,7 +83100,7 @@ - + @@ -81557,42 +83111,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -81606,29 +83125,23 @@ - - + + - - - - - + + - - - @@ -81638,29 +83151,23 @@ - - + + - - - - - + + - + - - - @@ -81675,7 +83182,7 @@ - + @@ -81692,11 +83199,14 @@ - + + + + @@ -81706,19 +83216,19 @@ - + - + - + - + @@ -81973,7 +83483,7 @@ - + @@ -81984,19 +83494,16 @@ - + - - + + - - - @@ -82013,7 +83520,7 @@ - + @@ -82033,41 +83540,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -82078,29 +83550,23 @@ - - + + - - - - - + + - - - @@ -82110,15 +83576,12 @@ - - + + - - - @@ -82151,7 +83614,7 @@ - + @@ -82162,19 +83625,16 @@ - + - - + + - - - @@ -82191,7 +83651,7 @@ - + @@ -82211,41 +83671,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -82256,29 +83681,23 @@ - - + + - - - - - + + - - - @@ -82288,15 +83707,12 @@ - - + + - - - @@ -82312,11 +83728,14 @@ - + + + + @@ -82326,19 +83745,19 @@ - + - + - + - + @@ -83078,11 +84497,14 @@ - + + + + @@ -83092,19 +84514,19 @@ - + - + - + - + @@ -84358,7 +85780,7 @@ - + @@ -84369,9 +85791,10 @@ - - + + + @@ -84935,7 +86358,7 @@ - + @@ -84946,9 +86369,10 @@ - - + + + @@ -85025,11 +86449,14 @@ - + + + + @@ -85039,19 +86466,19 @@ - + - + - + - + @@ -85316,7 +86743,7 @@ - + @@ -85335,68 +86762,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -85418,7 +86792,7 @@ - + @@ -85432,58 +86806,23 @@ - - - - - + + + + - + + - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -85500,33 +86839,53 @@ - - - - + + + + - + - - - - - - - + + + + - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -85566,6 +86925,25 @@ + + + + + + + + + + + + + + + + + + + @@ -85581,12 +86959,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -85688,7 +87128,7 @@ - + @@ -85727,7 +87167,7 @@ - + @@ -85834,7 +87274,7 @@ - + @@ -85851,7 +87291,7 @@ - + @@ -85891,28 +87331,9 @@ - - - - - - - - - - - - - - - - - - - - + @@ -86007,7 +87428,7 @@ - + @@ -86025,7 +87446,7 @@ - + @@ -86034,6 +87455,10 @@ + + + + @@ -86047,11 +87472,15 @@ + + + + - - + + @@ -86060,6 +87489,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -86160,15 +87776,19 @@ - - + + - + + + + + @@ -86187,7 +87807,7 @@ - + @@ -86197,15 +87817,15 @@ - - - - - + + + + + - + @@ -86334,7 +87954,7 @@ - + @@ -86348,25 +87968,6 @@ - - - - - - - - - - - - - - - - - - - @@ -86377,20 +87978,16 @@ - - - - - + - + - + - + @@ -86408,8 +88005,8 @@ - - + + @@ -86428,8 +88025,8 @@ - - + + @@ -86450,8 +88047,8 @@ - - + + @@ -86475,8 +88072,8 @@ - - + + @@ -86487,8 +88084,8 @@ - - + + @@ -86613,7 +88210,7 @@ - + @@ -86759,165 +88356,15 @@ - - - - - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -86929,6 +88376,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -86936,7 +88403,7 @@ - + @@ -86953,7 +88420,7 @@ - + @@ -86970,7 +88437,7 @@ - + @@ -86992,7 +88459,7 @@ - + @@ -87013,7 +88480,7 @@ - + @@ -87051,7 +88518,7 @@ - + @@ -87112,21 +88579,6 @@ - - - - - - - - - - - - - - - @@ -87161,7 +88613,7 @@ - + @@ -87182,7 +88634,7 @@ - + @@ -87301,7 +88753,7 @@ - + @@ -87318,7 +88770,7 @@ - + @@ -87458,7 +88910,7 @@ - + @@ -87475,7 +88927,7 @@ - + @@ -87492,7 +88944,7 @@ - + @@ -87509,7 +88961,7 @@ - + @@ -87531,7 +88983,7 @@ - + @@ -87552,7 +89004,7 @@ - + @@ -87603,21 +89055,6 @@ - - - - - - - - - - - - - - - @@ -87772,7 +89209,7 @@ - + @@ -87789,7 +89226,7 @@ - + @@ -87806,7 +89243,7 @@ - + @@ -87823,7 +89260,7 @@ - + @@ -87845,7 +89282,7 @@ - + @@ -87866,7 +89303,7 @@ - + @@ -87917,21 +89354,6 @@ - - - - - - - - - - - - - - - @@ -88103,7 +89525,7 @@ - + @@ -88222,7 +89644,7 @@ - + @@ -88239,7 +89661,7 @@ - + @@ -88260,7 +89682,7 @@ - + @@ -88278,7 +89700,7 @@ - + @@ -88415,7 +89837,7 @@ - + @@ -88432,7 +89854,7 @@ - + @@ -88453,7 +89875,7 @@ - + @@ -88471,7 +89893,7 @@ - + @@ -88513,154 +89935,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -88787,7 +90061,7 @@ - + @@ -88814,7 +90088,7 @@ - + @@ -88865,7 +90139,7 @@ - + @@ -88984,7 +90258,7 @@ - + @@ -89015,7 +90289,7 @@ - + @@ -89125,7 +90399,7 @@ - + @@ -89142,7 +90416,7 @@ - + @@ -89152,6 +90426,16 @@ + + + + + + + + + + @@ -89179,7 +90463,7 @@ - + @@ -89196,7 +90480,7 @@ - + @@ -89213,7 +90497,7 @@ - + @@ -89318,7 +90602,7 @@ - + @@ -89389,7 +90673,7 @@ - + @@ -89408,68 +90692,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -89491,7 +90722,7 @@ - + @@ -89505,58 +90736,23 @@ - - - - - + + + + - + + - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -89573,33 +90769,53 @@ - - - - + + + + - + - - - - - - - + + + + - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89639,6 +90855,25 @@ + + + + + + + + + + + + + + + + + + + @@ -89654,12 +90889,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -89686,7 +90983,7 @@ - + @@ -89725,7 +91022,7 @@ - + @@ -89757,7 +91054,7 @@ - + @@ -89774,7 +91071,7 @@ - + @@ -89814,28 +91111,9 @@ - - - - - - - - - - - - - - - - - - - - + @@ -89855,7 +91133,7 @@ - + @@ -89873,7 +91151,7 @@ - + @@ -89882,6 +91160,10 @@ + + + + @@ -89895,11 +91177,15 @@ + + + + - - + + @@ -89908,6 +91194,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89933,15 +91331,19 @@ - - + + - + + + + + @@ -89960,7 +91362,7 @@ - + @@ -89970,15 +91372,15 @@ - - - - - + + + + + - + @@ -90032,7 +91434,7 @@ - + @@ -90046,25 +91448,6 @@ - - - - - - - - - - - - - - - - - - - @@ -90075,20 +91458,16 @@ - - - - - + - + - + - + @@ -90098,8 +91477,8 @@ - - + + @@ -90110,8 +91489,8 @@ - - + + @@ -90161,7 +91540,7 @@ - + @@ -90232,91 +91611,16 @@ - - - - - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -90327,6 +91631,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -90334,7 +91658,7 @@ - + @@ -90351,7 +91675,7 @@ - + @@ -90368,7 +91692,7 @@ - + @@ -90390,7 +91714,7 @@ - + @@ -90411,7 +91735,7 @@ - + @@ -90449,7 +91773,7 @@ - + @@ -90510,21 +91834,6 @@ - - - - - - - - - - - - - - - @@ -90559,7 +91868,7 @@ - + @@ -90580,7 +91889,7 @@ - + @@ -90624,7 +91933,7 @@ - + @@ -90641,7 +91950,7 @@ - + @@ -90706,7 +92015,7 @@ - + @@ -90723,7 +92032,7 @@ - + @@ -90740,7 +92049,7 @@ - + @@ -90757,7 +92066,7 @@ - + @@ -90779,7 +92088,7 @@ - + @@ -90800,7 +92109,7 @@ - + @@ -90851,21 +92160,6 @@ - - - - - - - - - - - - - - - @@ -90945,7 +92239,7 @@ - + @@ -90962,7 +92256,7 @@ - + @@ -90979,7 +92273,7 @@ - + @@ -90996,7 +92290,7 @@ - + @@ -91018,7 +92312,7 @@ - + @@ -91039,7 +92333,7 @@ - + @@ -91090,21 +92384,6 @@ - - - - - - - - - - - - - - - @@ -91201,7 +92480,7 @@ - + @@ -91245,7 +92524,7 @@ - + @@ -91262,7 +92541,7 @@ - + @@ -91283,7 +92562,7 @@ - + @@ -91301,7 +92580,7 @@ - + @@ -91363,7 +92642,7 @@ - + @@ -91380,7 +92659,7 @@ - + @@ -91401,7 +92680,7 @@ - + @@ -91419,7 +92698,7 @@ - + @@ -91461,79 +92740,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -91585,7 +92791,7 @@ - + @@ -91612,7 +92818,7 @@ - + @@ -91663,7 +92869,7 @@ - + @@ -91707,7 +92913,7 @@ - + @@ -91738,7 +92944,7 @@ - + @@ -91773,7 +92979,7 @@ - + @@ -91790,7 +92996,7 @@ - + @@ -91800,6 +93006,16 @@ + + + + + + + + + + @@ -91827,7 +93043,7 @@ - + @@ -91844,7 +93060,7 @@ - + @@ -91861,7 +93077,7 @@ - + @@ -91891,7 +93107,7 @@ - + @@ -91940,11 +93156,14 @@ - + + + + @@ -91954,19 +93173,19 @@ - + - + - + - + @@ -92029,7 +93248,7 @@ - + @@ -92653,7 +93872,7 @@ - + @@ -93025,11 +94244,14 @@ - + + + + @@ -93039,19 +94261,19 @@ - + - + - + - + @@ -93746,11 +94968,14 @@ - + + + + @@ -93760,19 +94985,19 @@ - + - + - + - + @@ -94845,11 +96070,14 @@ - + + + + @@ -94859,19 +96087,19 @@ - + - + - + - + @@ -95912,11 +97140,14 @@ - + + + + @@ -95926,19 +97157,19 @@ - + - + - + - + @@ -96352,12 +97583,16 @@ - - + + + + + + @@ -96564,12 +97799,16 @@ - - + + + + + + @@ -96595,11 +97834,14 @@ - + + + + @@ -96609,19 +97851,19 @@ - + - + - + - + @@ -97525,6 +98767,18 @@ + + + + + + + + + + + + @@ -98056,6 +99310,18 @@ + + + + + + + + + + + + @@ -98066,11 +99332,14 @@ - + + + + @@ -98080,20 +99349,20 @@ - + - + - + - + @@ -99518,11 +100787,14 @@ - + + + + @@ -99532,19 +100804,19 @@ - + - + - + - + @@ -99806,7 +101078,10 @@ - + + @@ -99988,7 +101263,10 @@ - + + @@ -100406,7 +101684,10 @@ - + + @@ -100427,7 +101708,10 @@ - + + @@ -100475,7 +101759,10 @@ - + + @@ -100828,7 +102115,10 @@ - + + @@ -100848,7 +102138,10 @@ - + + @@ -100868,7 +102161,10 @@ - + + @@ -100931,7 +102227,10 @@ - + + @@ -101113,7 +102412,10 @@ - + + @@ -101381,7 +102683,10 @@ - + + @@ -101402,7 +102707,10 @@ - + + @@ -101450,7 +102758,10 @@ - + + @@ -101653,7 +102964,10 @@ - + + @@ -101673,7 +102987,10 @@ - + + @@ -101693,7 +103010,10 @@ - + + @@ -101732,11 +103052,14 @@ - + + + + @@ -101746,19 +103069,19 @@ - + - + - + - + @@ -102179,11 +103502,11 @@ - - - - - + + + + + @@ -102195,7 +103518,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -102593,7 +103946,7 @@ - + @@ -103154,11 +104507,11 @@ - - - - - + + + + + @@ -103170,7 +104523,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -103493,7 +104876,7 @@ - + @@ -103726,11 +105109,14 @@ - + + + + @@ -103740,19 +105126,19 @@ - + - + - + - + @@ -104935,11 +106321,14 @@ - + + + + @@ -104949,20 +106338,20 @@ - + - + - + - + @@ -105410,7 +106799,7 @@ - + @@ -106327,7 +107716,7 @@ - + @@ -106663,17 +108052,17 @@ - + - + - + @@ -106713,11 +108102,14 @@ - + + + + @@ -106727,19 +108119,19 @@ - + - + - + - + @@ -107364,8 +108756,8 @@ - - + + @@ -107763,8 +109155,8 @@ - - + + @@ -107779,11 +109171,14 @@ - + + + + @@ -107793,19 +109188,19 @@ - + - + - + - + @@ -108269,17 +109664,17 @@ - + - + - + @@ -108319,11 +109714,14 @@ - + + + + @@ -108333,19 +109731,19 @@ - + - + - + - + @@ -108681,7 +110079,10 @@ - + + @@ -109151,7 +110552,10 @@ - + + @@ -109443,11 +110847,14 @@ - + + + + @@ -109457,19 +110864,19 @@ - + - + - + - + @@ -110437,17 +111844,17 @@ - + - + - + @@ -110544,17 +111951,17 @@ - + - + - + @@ -110602,11 +112009,14 @@ - + + + + @@ -110616,19 +112026,19 @@ - + - + - + - + @@ -111226,6 +112636,7 @@ + @@ -111236,6 +112647,7 @@ + @@ -111244,18 +112656,37 @@ + + + + + + + + + + + + + + + + + + - + + - + @@ -111270,6 +112701,7 @@ + @@ -111280,6 +112712,7 @@ + @@ -111290,6 +112723,7 @@ + @@ -111300,6 +112734,7 @@ + @@ -111310,6 +112745,7 @@ + @@ -111320,6 +112756,7 @@ + @@ -111330,6 +112767,7 @@ + @@ -111340,6 +112778,7 @@ + @@ -112211,6 +113650,7 @@ + @@ -112221,6 +113661,7 @@ + @@ -112229,18 +113670,37 @@ + + + + + + + + + + + + + + + + + + - + + - + @@ -112255,6 +113715,7 @@ + @@ -112265,6 +113726,7 @@ + @@ -112275,6 +113737,7 @@ + @@ -112285,6 +113748,7 @@ + @@ -112295,6 +113759,7 @@ + @@ -112305,6 +113770,7 @@ + @@ -112315,6 +113781,7 @@ + @@ -112325,6 +113792,7 @@ + @@ -112540,11 +114008,14 @@ - + + + + @@ -112554,19 +114025,19 @@ - + - + - + - + @@ -112913,7 +114384,7 @@ - + @@ -112991,7 +114462,7 @@ - + @@ -113010,7 +114481,7 @@ - + @@ -113088,7 +114559,7 @@ - + @@ -113104,7 +114575,7 @@ - + @@ -113116,7 +114587,7 @@ - + @@ -113127,7 +114598,7 @@ - + @@ -113146,7 +114617,7 @@ - + @@ -113224,7 +114695,7 @@ - + @@ -113246,7 +114717,7 @@ - + @@ -113324,7 +114795,7 @@ - + @@ -113346,7 +114817,7 @@ - + @@ -113424,7 +114895,7 @@ - + @@ -113440,7 +114911,7 @@ - + @@ -113452,7 +114923,7 @@ - + @@ -113463,7 +114934,7 @@ - + @@ -113482,7 +114953,7 @@ - + @@ -113560,7 +115031,7 @@ - + @@ -113582,7 +115053,7 @@ - + @@ -113660,7 +115131,7 @@ - + @@ -113671,7 +115142,7 @@ - + @@ -113683,7 +115154,7 @@ - + @@ -113695,7 +115166,7 @@ - + @@ -113813,7 +115284,7 @@ - + @@ -113824,7 +115295,7 @@ - + @@ -113835,7 +115306,7 @@ - + @@ -113846,7 +115317,7 @@ - + @@ -113862,7 +115333,7 @@ - + @@ -113874,7 +115345,7 @@ - + @@ -113885,7 +115356,7 @@ - + @@ -113896,7 +115367,7 @@ - + @@ -113907,7 +115378,7 @@ - + @@ -113921,7 +115392,7 @@ - + @@ -113932,7 +115403,7 @@ - + @@ -113946,7 +115417,7 @@ - + @@ -113957,7 +115428,7 @@ - + @@ -113973,7 +115444,7 @@ - + @@ -113985,7 +115456,7 @@ - + @@ -113996,7 +115467,7 @@ - + @@ -114007,7 +115478,7 @@ - + @@ -114018,7 +115489,7 @@ - + @@ -114032,7 +115503,7 @@ - + @@ -114043,7 +115514,7 @@ - + @@ -114054,7 +115525,7 @@ - + @@ -114066,7 +115537,7 @@ - + @@ -114078,7 +115549,7 @@ - + @@ -114090,11 +115561,14 @@ - + + + + @@ -114104,19 +115578,19 @@ - + - + - + - + @@ -115006,11 +116480,14 @@ - + + + + @@ -115020,19 +116497,19 @@ - + - + - + - + @@ -116422,11 +117899,14 @@ - + + + + @@ -116436,19 +117916,19 @@ - + - + - + - + @@ -116859,8 +118339,8 @@ - - + + @@ -117179,19 +118659,16 @@ - - + + + - - - - @@ -117492,8 +118969,8 @@ - - + + @@ -117737,19 +119214,16 @@ - - + + + - - - - @@ -117882,11 +119356,14 @@ - + + + + @@ -117896,19 +119373,19 @@ - + - + - + - + @@ -119141,11 +120618,14 @@ - + + + + @@ -119155,19 +120635,19 @@ - + - + - + - + @@ -119539,6 +121019,7 @@ + @@ -119700,16 +121181,33 @@ - - + + + + + + + + + + + + + + + + + + + @@ -120351,6 +121849,7 @@ + @@ -120512,16 +122011,33 @@ - - + + + + + + + + + + + + + + + + + + + @@ -120884,11 +122400,14 @@ - + + + + @@ -120898,19 +122417,19 @@ - + - + - + - + @@ -120936,7 +122455,7 @@ - + @@ -121185,7 +122704,7 @@ - + @@ -121240,16 +122759,20 @@ - - + + - + + + + + @@ -121380,15 +122903,18 @@ - + + + + - - + + @@ -121411,8 +122937,8 @@ - - + + @@ -121420,6 +122946,10 @@ + + + + @@ -121450,7 +122980,7 @@ - + @@ -121480,7 +123010,7 @@ - + @@ -121521,7 +123051,7 @@ - + @@ -121576,16 +123106,20 @@ - - + + - + + + + + @@ -121716,15 +123250,18 @@ - + + + + - - + + @@ -121747,8 +123284,8 @@ - - + + @@ -121756,6 +123293,10 @@ + + + + @@ -121786,7 +123327,7 @@ - + @@ -121814,23 +123355,1322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -121886,11 +124726,14 @@ - + + + + @@ -121900,20 +124743,20 @@ - + - + - + - + @@ -123444,11 +126287,14 @@ - + + + + @@ -123458,19 +126304,19 @@ - + - + - + - + @@ -124425,11 +127271,14 @@ - + + + + @@ -124439,19 +127288,19 @@ - + - + - + - + @@ -126626,17 +129475,17 @@ - + - + - + @@ -126644,50 +129493,82 @@ - + - + - + - - + + - - - + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + - - + + - + - - + + + + + + + + + + @@ -126699,11 +129580,14 @@ - + + + + @@ -126713,20 +129597,20 @@ - + - + - + - + @@ -127056,7 +129940,7 @@ - + @@ -127810,7 +130694,7 @@ - + @@ -128181,7 +131065,7 @@ - + @@ -128785,7 +131669,7 @@ - + @@ -128989,11 +131873,14 @@ - + + + + @@ -129003,19 +131890,19 @@ - + - + - + - + @@ -129867,7 +132754,7 @@ - + @@ -130484,7 +133371,7 @@ - + @@ -130566,11 +133453,14 @@ - + + + + @@ -130580,19 +133470,19 @@ - + - + - + - + @@ -131269,11 +134159,14 @@ - + + + + @@ -131283,19 +134176,19 @@ - + - + - + - + @@ -132353,17 +135246,17 @@ - + - + - + @@ -132500,17 +135393,17 @@ - + - + - + @@ -132558,11 +135451,14 @@ - + + + + @@ -132572,20 +135468,20 @@ - + - + - + - + @@ -133076,7 +135972,7 @@ - + @@ -134231,7 +137127,7 @@ - + @@ -134843,11 +137739,14 @@ - + + + + @@ -134857,19 +137756,24 @@ - + - + - + - + + + + + + @@ -134881,9 +137785,9 @@ - - - + + + @@ -134933,6 +137837,10 @@ + + + + @@ -135119,6 +138027,10 @@ + + + + @@ -135128,7 +138040,7 @@ - + @@ -135139,112 +138051,18 @@ - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -135270,28 +138088,15 @@ + + + + - - - - - - - - - - - - - - - - - @@ -135301,11 +138106,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -135314,6 +138231,10 @@ + + + + @@ -135328,6 +138249,10 @@ + + + + @@ -135337,7 +138262,7 @@ - + @@ -135348,112 +138273,18 @@ - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -135479,28 +138310,15 @@ + + + + - - - - - - - - - - - - - - - - - @@ -135510,11 +138328,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -135525,11 +138455,14 @@ - + + + + @@ -135539,19 +138472,19 @@ - + - + - + - + @@ -135810,7 +138743,7 @@ - + @@ -135821,7 +138754,7 @@ - + @@ -135829,6 +138762,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -135855,7 +138831,7 @@ - + @@ -135875,88 +138851,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -136078,7 +138972,7 @@ - + @@ -136163,7 +139057,7 @@ - + @@ -136181,7 +139075,7 @@ - + @@ -136282,7 +139176,7 @@ - + @@ -136337,7 +139231,7 @@ - + @@ -136348,7 +139242,7 @@ - + @@ -136356,6 +139250,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -136382,7 +139319,7 @@ - + @@ -136402,88 +139339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -136530,7 +139385,7 @@ - + @@ -136615,7 +139470,7 @@ - + @@ -136633,7 +139488,7 @@ - + @@ -136659,7 +139514,7 @@ - + @@ -136693,11 +139548,14 @@ - + + + + @@ -136707,20 +139565,20 @@ - + - + - + - + @@ -137573,17 +140431,17 @@ - + - + - + @@ -137698,17 +140556,17 @@ - + - + - + @@ -137740,11 +140598,14 @@ - + + + + @@ -137754,19 +140615,19 @@ - + - + - + - + @@ -138541,9 +141402,9 @@ - + - + @@ -138623,6 +141484,24 @@ + + + + + + + + + + + + + + + + + + @@ -138654,6 +141533,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -139546,13 +142445,31 @@ - + - + + + + + + + + + + + + + + + + + + + @@ -139584,6 +142501,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -139868,11 +142805,14 @@ - + + + + @@ -139882,20 +142822,20 @@ - + - + - + - + @@ -141412,11 +144352,14 @@ - + + + + @@ -141426,20 +144369,20 @@ - + - + - + - + @@ -142640,11 +145583,14 @@ - + + + + @@ -142654,19 +145600,19 @@ - + - + - + - + @@ -144312,11 +147258,14 @@ - + + + + @@ -144326,19 +147275,19 @@ - + - + - + - + @@ -145300,11 +148249,14 @@ - + + + + @@ -145314,19 +148266,19 @@ - + - + - + - + @@ -145585,7 +148537,7 @@ - + @@ -145596,7 +148548,7 @@ - + @@ -145604,50 +148556,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -145664,20 +148577,6 @@ - - - - - - - - - - - - - - @@ -145693,6 +148592,20 @@ + + + + + + + + + + + + + + @@ -145929,7 +148842,7 @@ - + @@ -145940,7 +148853,7 @@ - + @@ -145948,50 +148861,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -146008,20 +148882,6 @@ - - - - - - - - - - - - - - @@ -146037,6 +148897,20 @@ + + + + + + + + + + + + + + @@ -146177,11 +149051,14 @@ - + + + + @@ -146191,19 +149068,19 @@ - + - + - + - + @@ -146462,7 +149339,7 @@ - + @@ -146473,7 +149350,7 @@ - + @@ -146481,91 +149358,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -146595,6 +149387,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -146628,7 +149466,7 @@ - + @@ -146642,8 +149480,8 @@ - - + + @@ -146660,8 +149498,8 @@ - - + + @@ -146680,8 +149518,8 @@ - - + + @@ -146702,8 +149540,8 @@ - - + + @@ -146727,14 +149565,14 @@ - - + + - + @@ -146744,8 +149582,8 @@ - - + + @@ -146765,7 +149603,7 @@ - + @@ -146775,6 +149613,17 @@ + + + + + + + + + + + @@ -146806,7 +149655,7 @@ - + @@ -146817,7 +149666,7 @@ - + @@ -146825,91 +149674,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -146939,6 +149703,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -146972,7 +149782,7 @@ - + @@ -146986,8 +149796,8 @@ - - + + @@ -146996,14 +149806,14 @@ - - + + - + @@ -147013,8 +149823,8 @@ - - + + @@ -147034,7 +149844,7 @@ - + @@ -147044,6 +149854,17 @@ + + + + + + + + + + + @@ -147054,11 +149875,14 @@ - + + + + @@ -147068,19 +149892,19 @@ - + - + - + - + @@ -147377,7 +150201,6 @@ - @@ -147428,7 +150251,6 @@ - @@ -147462,7 +150284,6 @@ - @@ -147497,7 +150318,6 @@ - @@ -147525,7 +150345,6 @@ - @@ -147554,7 +150373,6 @@ - @@ -147670,12 +150488,15 @@ - - - + + + - + + + + @@ -147697,154 +150518,50 @@ - - - - - - - - - - - - - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - + + - + - @@ -147861,26 +150578,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -147899,7 +150596,6 @@ - @@ -148010,37 +150706,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -148049,7 +150714,8 @@ - + + @@ -148065,29 +150731,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -148096,7 +150739,6 @@ - @@ -148111,7 +150753,6 @@ - @@ -148181,7 +150822,6 @@ - @@ -148232,7 +150872,6 @@ - @@ -148266,7 +150905,6 @@ - @@ -148301,7 +150939,6 @@ - @@ -148329,7 +150966,6 @@ - @@ -148350,7 +150986,6 @@ - @@ -148399,12 +151034,15 @@ - - - + + + - + + + + @@ -148426,79 +151064,50 @@ - - - - - - - - - - - - - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + - + - @@ -148515,26 +151124,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -148545,7 +151134,6 @@ - @@ -148589,37 +151177,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -148628,7 +151185,8 @@ - + + @@ -148644,29 +151202,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -148675,7 +151210,6 @@ - @@ -148690,7 +151224,6 @@ - @@ -148706,17 +151239,17 @@ - + - + - + @@ -148724,9 +151257,9 @@ - + - + @@ -148744,7 +151277,7 @@ - + @@ -148752,7 +151285,7 @@ - + @@ -148763,7 +151296,7 @@ - + @@ -148771,7 +151304,7 @@ - + @@ -148807,17 +151340,17 @@ - + - + - + - + @@ -148825,7 +151358,7 @@ - + @@ -148845,7 +151378,7 @@ - + @@ -148853,7 +151386,7 @@ - + @@ -148880,8 +151413,8 @@ - - + + @@ -148900,17 +151433,17 @@ - + - + - + @@ -148918,7 +151451,7 @@ - + @@ -148938,7 +151471,7 @@ - + @@ -148946,7 +151479,7 @@ - + @@ -148973,8 +151506,8 @@ - - + + @@ -148993,11 +151526,14 @@ - + + + + @@ -149007,20 +151543,20 @@ - + - + - + - + @@ -149458,7 +151994,7 @@ - + @@ -149575,6 +152111,13 @@ + + + + + + + @@ -149649,11 +152192,11 @@ - + - - - + + + @@ -149663,11 +152206,28 @@ + + + + + + + + + + + + + + + + + - - + + @@ -149722,15 +152282,16 @@ - + - + - + + @@ -149931,7 +152492,7 @@ - + @@ -149948,6 +152509,7 @@ + @@ -149982,7 +152544,7 @@ - + @@ -150002,7 +152564,7 @@ - + @@ -150142,8 +152704,9 @@ - - + + + @@ -150417,7 +152980,7 @@ - + @@ -150526,6 +153089,13 @@ + + + + + + + @@ -150533,11 +153103,11 @@ - + - - - + + + @@ -150547,11 +153117,28 @@ + + + + + + + + + + + + + + + + + - - + + @@ -150606,15 +153193,16 @@ - + - + - + + @@ -150740,7 +153328,7 @@ - + @@ -150757,6 +153345,7 @@ + @@ -150791,7 +153380,7 @@ - + @@ -150811,7 +153400,7 @@ - + @@ -150876,8 +153465,9 @@ - - + + + @@ -150951,11 +153541,14 @@ - + + + + @@ -150965,20 +153558,20 @@ - + - + - + - + @@ -151242,8 +153835,8 @@ - - + + @@ -151329,6 +153922,7 @@ + @@ -151468,6 +154062,7 @@ + @@ -151481,6 +154076,13 @@ + + + + + + + @@ -151555,10 +154157,10 @@ - + - + @@ -151568,6 +154170,22 @@ + + + + + + + + + + + + + + + + @@ -151813,8 +154431,8 @@ - - + + @@ -151900,6 +154518,7 @@ + @@ -152039,11 +154658,19 @@ + + + + + + + + @@ -152051,10 +154678,10 @@ - + - + @@ -152064,6 +154691,22 @@ + + + + + + + + + + + + + + + + @@ -152203,11 +154846,14 @@ - + + + + @@ -152217,19 +154863,19 @@ - + - + - + - + @@ -153295,11 +155941,14 @@ - + + + + @@ -153309,20 +155958,20 @@ - + - + - + - + @@ -154070,11 +156719,14 @@ - + + + + @@ -154084,19 +156736,19 @@ - + - + - + - + @@ -154459,6 +157111,13 @@ + + + + + + + @@ -154597,12 +157256,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -154740,6 +157533,9 @@ + + + @@ -154874,12 +157670,14 @@ + + @@ -154888,6 +157686,7 @@ + @@ -155021,6 +157820,13 @@ + + + + + + + @@ -155092,12 +157898,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -155160,6 +158025,9 @@ + + + @@ -155294,12 +158162,14 @@ + + @@ -155308,6 +158178,1779 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -155319,11 +159962,14 @@ - + + + + @@ -155333,19 +159979,19 @@ - + - + - + - + @@ -156555,11 +161201,14 @@ - + + + + @@ -156569,19 +161218,19 @@ - + - + - + - + @@ -157201,11 +161850,14 @@ - + + + + @@ -157215,19 +161867,19 @@ - + - + - + - + @@ -157304,6 +161956,13 @@ + + + + + + + @@ -157690,10 +162349,11 @@ - - + + + - + @@ -157724,6 +162384,17 @@ + + + + + + + + + + + @@ -157740,7 +162411,7 @@ - + @@ -157795,17 +162466,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -157822,6 +162635,13 @@ + + + + + + + @@ -158032,10 +162852,11 @@ - - + + + - + @@ -158066,6 +162887,17 @@ + + + + + + + + + + + @@ -158082,7 +162914,7 @@ - + @@ -158137,17 +162969,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -158158,11 +163057,14 @@ - + + + + @@ -158172,19 +163074,19 @@ - + - + - + - + @@ -158239,6 +163141,13 @@ + + + + + + + @@ -158422,8 +163331,8 @@ - - + + @@ -158439,8 +163348,8 @@ - - + + @@ -158456,8 +163365,8 @@ - - + + @@ -158501,10 +163410,22 @@ + + + + + + + + + + + + - - + + @@ -158515,7 +163436,7 @@ - + @@ -158529,6 +163450,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -158631,7 +163573,7 @@ - + @@ -158647,8 +163589,8 @@ - - + + @@ -158670,9 +163612,9 @@ - - - + + + @@ -158681,8 +163623,8 @@ - - + + @@ -158692,8 +163634,8 @@ - - + + @@ -158704,7 +163646,7 @@ - + @@ -158789,8 +163731,8 @@ - - + + @@ -158800,8 +163742,8 @@ - - + + @@ -158812,7 +163754,7 @@ - + @@ -158823,7 +163765,7 @@ - + @@ -158857,7 +163799,7 @@ - + @@ -158951,6 +163893,24 @@ + + + + + + + + + + + + + + + + + + @@ -158964,8 +163924,8 @@ - - + + @@ -158975,8 +163935,8 @@ - - + + @@ -159107,8 +164067,8 @@ - - + + @@ -159191,6 +164151,24 @@ + + + + + + + + + + + + + + + + + + @@ -159213,10 +164191,10 @@ - - - - + + + + @@ -159224,8 +164202,19 @@ - - + + + + + + + + + + + + + @@ -159454,8 +164443,8 @@ - - + + @@ -159465,8 +164454,8 @@ - - + + @@ -159562,8 +164551,8 @@ - - + + @@ -159573,8 +164562,8 @@ - - + + @@ -159590,6 +164579,13 @@ + + + + + + + @@ -159597,8 +164593,8 @@ - - + + @@ -159614,8 +164610,8 @@ - - + + @@ -159631,8 +164627,8 @@ - - + + @@ -159676,10 +164672,22 @@ + + + + + + + + + + + + - - + + @@ -159690,12 +164698,33 @@ - + + + + + + + + + + + + + + + + + + + + + + @@ -159731,7 +164760,7 @@ - + @@ -159747,8 +164776,8 @@ - - + + @@ -159770,9 +164799,9 @@ - - - + + + @@ -159781,8 +164810,8 @@ - - + + @@ -159792,8 +164821,8 @@ - - + + @@ -159804,7 +164833,7 @@ - + @@ -159814,8 +164843,8 @@ - - + + @@ -159825,8 +164854,8 @@ - - + + @@ -159837,7 +164866,7 @@ - + @@ -159848,7 +164877,7 @@ - + @@ -159882,7 +164911,7 @@ - + @@ -159901,6 +164930,24 @@ + + + + + + + + + + + + + + + + + + @@ -159914,8 +164961,8 @@ - - + + @@ -159925,8 +164972,8 @@ - - + + @@ -160057,8 +165104,8 @@ - - + + @@ -160066,6 +165113,24 @@ + + + + + + + + + + + + + + + + + + @@ -160088,10 +165153,10 @@ - - - - + + + + @@ -160099,8 +165164,19 @@ - - + + + + + + + + + + + + + @@ -160179,8 +165255,8 @@ - - + + @@ -160190,8 +165266,8 @@ - - + + @@ -160212,8 +165288,8 @@ - - + + @@ -160223,8 +165299,8 @@ - - + + @@ -160242,17 +165318,17 @@ - + - + - + @@ -160271,7 +165347,7 @@ - + @@ -160279,7 +165355,7 @@ - + @@ -160287,7 +165363,7 @@ - + @@ -160295,7 +165371,7 @@ - + @@ -160303,7 +165379,7 @@ - + @@ -160314,7 +165390,7 @@ - + @@ -160325,7 +165401,7 @@ - + @@ -160336,7 +165412,7 @@ - + @@ -160344,7 +165420,7 @@ - + @@ -160352,7 +165428,7 @@ - + @@ -160360,7 +165436,7 @@ - + @@ -160368,7 +165444,7 @@ - + @@ -160379,7 +165455,7 @@ - + @@ -160387,7 +165463,7 @@ - + @@ -160395,7 +165471,7 @@ - + @@ -160403,7 +165479,7 @@ - + @@ -160411,7 +165487,7 @@ - + @@ -160419,8 +165495,8 @@ - - + + @@ -160431,17 +165507,17 @@ - + - + - + @@ -160449,9 +165525,9 @@ - + - + @@ -160461,7 +165537,7 @@ - + @@ -160481,11 +165557,14 @@ - + + + + @@ -160495,19 +165574,19 @@ - + - + - + - + @@ -161503,11 +166582,14 @@ - + + + + @@ -161517,19 +166599,19 @@ - + - + - + - + @@ -162171,11 +167253,14 @@ - + + + + @@ -162185,19 +167270,19 @@ - + - + - + - + @@ -163862,17 +168947,17 @@ - + - + - + @@ -163880,9 +168965,9 @@ - + - + @@ -163900,7 +168985,7 @@ - + @@ -163937,11 +169022,14 @@ - + + + + @@ -163951,19 +169039,19 @@ - + - + - + - + @@ -164110,7 +169198,7 @@ - + @@ -164613,7 +169701,7 @@ - + @@ -164642,7 +169730,7 @@ - + @@ -164779,8 +169867,8 @@ - - + + @@ -165036,6 +170124,14 @@ + + + + + + + + @@ -165211,7 +170307,7 @@ - + @@ -165538,7 +170634,7 @@ - + @@ -165559,7 +170655,7 @@ - + @@ -165629,8 +170725,8 @@ - - + + @@ -165803,6 +170899,14 @@ + + + + + + + + @@ -165835,17 +170939,17 @@ - + - + - + @@ -165892,11 +170996,14 @@ - + + + + @@ -165906,19 +171013,19 @@ - + - + - + - + @@ -167037,6 +172144,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -168040,6 +173180,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -168321,11 +173494,14 @@ - + + + + @@ -168335,19 +173511,19 @@ - + - + - + - + @@ -169049,11 +174225,14 @@ - + + + + @@ -169063,19 +174242,19 @@ - + - + - + - + @@ -169927,11 +175106,14 @@ - + + + + @@ -169941,19 +175123,19 @@ - + - + - + - + @@ -170630,11 +175812,14 @@ - + + + + @@ -170644,19 +175829,19 @@ - + - + - + - + @@ -171434,17 +176619,17 @@ - + - + - + @@ -171475,17 +176660,17 @@ - + - + - + @@ -171516,17 +176701,17 @@ - + - + - + @@ -171549,17 +176734,17 @@ - + - + - + @@ -171590,17 +176775,17 @@ - + - + - + @@ -171623,17 +176808,17 @@ - + - + - + @@ -171656,17 +176841,17 @@ - + - + - + @@ -171689,17 +176874,17 @@ - + - + - + @@ -171722,17 +176907,17 @@ - + - + - + @@ -171755,17 +176940,17 @@ - + - + - + @@ -171810,17 +176995,17 @@ - + - + - + @@ -171865,11 +177050,14 @@ - + + + + @@ -171879,19 +177067,24 @@ - + - + - + - + + + + + + @@ -171949,14 +177142,18 @@ - - - + + + + + + + @@ -172143,10 +177340,14 @@ - + + + + + @@ -172156,10 +177357,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -172167,13 +177392,17 @@ + + + + - - + + @@ -172183,13 +177412,17 @@ + + + + - - + + @@ -172201,6 +177434,10 @@ + + + + @@ -172224,6 +177461,10 @@ + + + + @@ -172269,24 +177510,28 @@ - - + + - + - + - + - + + + + + @@ -172296,29 +177541,10 @@ - - - - - - - - - - - - - - - - - - - - - + + @@ -172330,9 +177556,13 @@ - + + + + + @@ -172342,6 +177572,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -172392,6 +177646,10 @@ + + + + @@ -172417,6 +177675,10 @@ + + + + @@ -172426,18 +177688,41 @@ - - + + + + + + + + + + + + + + + + + + + + + - + + + + + @@ -172453,7 +177738,7 @@ - + @@ -172467,9 +177752,103 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -172495,15 +177874,69 @@ + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -172535,6 +177968,10 @@ + + + + @@ -172544,32 +177981,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -172584,6 +177995,10 @@ + + + + @@ -172602,15 +178017,40 @@ + + + + - - + + + + + + + + + + + + + + + + + + + + + + + - + @@ -172630,8 +178070,8 @@ - - + + @@ -172650,8 +178090,8 @@ - - + + @@ -172672,8 +178112,8 @@ - - + + @@ -172697,8 +178137,8 @@ - - + + @@ -172712,8 +178152,8 @@ - - + + @@ -172727,8 +178167,8 @@ - - + + @@ -172758,28 +178198,12 @@ - - - - - - - - - - - - - - - - - + @@ -172891,7 +178315,7 @@ - + @@ -173016,7 +178440,7 @@ - + @@ -173106,7 +178530,7 @@ - + @@ -173126,7 +178550,7 @@ - + @@ -173261,10 +178685,14 @@ - - - + + + + + + + @@ -173279,10 +178707,14 @@ - + + + + + @@ -173292,10 +178724,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -173303,13 +178759,17 @@ + + + + - - + + @@ -173319,13 +178779,17 @@ + + + + - - + + @@ -173337,6 +178801,10 @@ + + + + @@ -173360,6 +178828,10 @@ + + + + @@ -173405,24 +178877,28 @@ - - + + - + - + - + - + + + + + @@ -173432,29 +178908,10 @@ - - - - - - - - - - - - - - - - - - - - - + + @@ -173466,9 +178923,13 @@ - + + + + + @@ -173478,6 +178939,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -173528,6 +179013,10 @@ + + + + @@ -173553,6 +179042,10 @@ + + + + @@ -173562,18 +179055,41 @@ - - + + + + + + + + + + + + + + + + + + + + + - + + + + + @@ -173589,7 +179105,7 @@ - + @@ -173603,9 +179119,28 @@ - + + + + + + + + + + + + + + + + + + + + @@ -173631,15 +179166,69 @@ + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -173671,6 +179260,10 @@ + + + + @@ -173680,32 +179273,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -173720,6 +179287,10 @@ + + + + @@ -173738,15 +179309,40 @@ + + + + - - + + + + + + + + + + + + + + + + + + + + + + + - + @@ -173758,8 +179354,8 @@ - - + + @@ -173773,8 +179369,8 @@ - - + + @@ -173788,8 +179384,8 @@ - - + + @@ -173819,28 +179415,12 @@ - - - - - - - - - - - - - - - - - + @@ -173877,7 +179457,7 @@ - + @@ -174002,7 +179582,7 @@ - + @@ -174017,7 +179597,7 @@ - + @@ -174037,7 +179617,7 @@ - + @@ -174171,11 +179751,14 @@ - + + + + @@ -174185,19 +179768,19 @@ - + - + - + - + @@ -175922,11 +181505,14 @@ - + + + + @@ -175936,19 +181522,19 @@ - + - + - + - + @@ -177140,7 +182726,7 @@ - + @@ -177152,7 +182738,7 @@ - + @@ -178131,7 +183717,7 @@ - + @@ -178148,7 +183734,7 @@ - + @@ -178271,7 +183857,7 @@ - + @@ -178714,8 +184300,8 @@ - - + + @@ -180264,7 +185850,7 @@ - + @@ -180276,7 +185862,7 @@ - + @@ -180580,7 +186166,7 @@ - + @@ -180597,7 +186183,7 @@ - + @@ -180720,7 +186306,7 @@ - + @@ -181013,8 +186599,8 @@ - - + + @@ -181388,11 +186974,14 @@ - + + + + @@ -181402,19 +186991,19 @@ - + - + - + - + @@ -181685,7 +187274,7 @@ - + @@ -181696,7 +187285,7 @@ - + @@ -181704,28 +187293,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -181749,29 +187316,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -181795,6 +187339,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -181914,10 +187503,10 @@ - + - + @@ -181942,7 +187531,7 @@ - + @@ -181999,7 +187588,7 @@ - + @@ -182080,11 +187669,10 @@ - - + + - @@ -182134,7 +187722,7 @@ - + @@ -182145,7 +187733,7 @@ - + @@ -182153,28 +187741,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -182198,29 +187764,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -182244,6 +187787,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -182288,10 +187876,10 @@ - + - + @@ -182316,7 +187904,7 @@ - + @@ -182373,7 +187961,7 @@ - + @@ -182454,11 +188042,10 @@ - - + + - @@ -182475,27 +188062,30 @@ - + + + + - + - + - + - + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-types.xml b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-types.xml index 8b23ae98821..4fb1a3b97a8 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-types.xml +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile/profiles-types.xml @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ - + @@ -18,13 +18,13 @@ - + - + - + @@ -149,7 +149,7 @@ - + @@ -157,13 +157,13 @@ - + - + - + @@ -288,7 +288,7 @@ - + @@ -296,13 +296,13 @@ - + - + - + @@ -421,7 +421,7 @@ - + @@ -429,13 +429,13 @@ - + - + - + @@ -558,7 +558,7 @@ - + @@ -566,13 +566,13 @@ - + - + - + @@ -703,7 +703,7 @@ - + @@ -711,13 +711,13 @@ - + - + - + @@ -838,7 +838,7 @@ - + @@ -846,13 +846,13 @@ - + - + - + @@ -973,7 +973,7 @@ - + @@ -981,13 +981,13 @@ - + - + - + @@ -1108,7 +1108,7 @@ - + @@ -1116,13 +1116,13 @@ - + - + - + @@ -1243,7 +1243,7 @@ - + @@ -1251,13 +1251,13 @@ - + - + - + @@ -1376,7 +1376,7 @@ - + @@ -1384,13 +1384,13 @@ - + - + - + @@ -1511,7 +1511,7 @@ - + @@ -1519,13 +1519,13 @@ - + - + - + @@ -1644,7 +1644,7 @@ - + @@ -1652,13 +1652,13 @@ - + - + - + @@ -1773,7 +1773,7 @@ - + @@ -1781,13 +1781,13 @@ - + - + - + @@ -1912,7 +1912,7 @@ - + @@ -1920,13 +1920,13 @@ - + - + - + @@ -2047,7 +2047,7 @@ - + @@ -2055,13 +2055,13 @@ - + - + - + @@ -2180,7 +2180,7 @@ - + @@ -2188,13 +2188,13 @@ - + - + - + @@ -2321,7 +2321,7 @@ - + @@ -2329,13 +2329,13 @@ - + - + - + @@ -2450,7 +2450,7 @@ - + @@ -2458,13 +2458,13 @@ - + - + - + @@ -2480,6 +2480,7 @@ + @@ -2600,6 +2601,7 @@ + @@ -2669,7 +2671,7 @@ - + @@ -2677,14 +2679,14 @@ - + - + - + @@ -3040,7 +3042,7 @@ - + @@ -3048,13 +3050,13 @@ - + - + - + @@ -3270,7 +3272,7 @@ - + @@ -3278,14 +3280,14 @@ - + - + - + @@ -3390,7 +3392,10 @@ - + + @@ -3416,7 +3421,10 @@ - + + @@ -3466,7 +3474,10 @@ - + + @@ -3480,7 +3491,7 @@ - + @@ -3498,6 +3509,7 @@ + @@ -3520,7 +3532,10 @@ - + + @@ -3578,7 +3593,10 @@ - + + @@ -3604,7 +3622,10 @@ - + + @@ -3654,7 +3675,10 @@ - + + @@ -3668,7 +3692,7 @@ - + @@ -3686,6 +3710,7 @@ + @@ -3708,7 +3733,10 @@ - + + @@ -3741,7 +3769,7 @@ - + @@ -3749,13 +3777,13 @@ - + - + - + @@ -4017,7 +4045,7 @@ - + @@ -4025,14 +4053,14 @@ - + - + - + @@ -4295,7 +4323,7 @@ - + @@ -4303,14 +4331,14 @@ - + - + - + @@ -4528,7 +4556,7 @@ - + @@ -4536,13 +4564,13 @@ - + - + - + @@ -4794,7 +4822,7 @@ - + @@ -4802,13 +4830,13 @@ - + - + - + @@ -5070,7 +5098,7 @@ - + @@ -5078,14 +5106,14 @@ - + - + - + @@ -5248,7 +5276,10 @@ - + + @@ -5273,7 +5304,10 @@ - + + @@ -5424,7 +5458,10 @@ - + + @@ -5449,7 +5486,10 @@ - + + @@ -5522,7 +5562,7 @@ - + @@ -5530,14 +5570,14 @@ - + - + - + @@ -5910,7 +5950,7 @@ - + @@ -5918,14 +5958,14 @@ - + - + - + @@ -6266,7 +6306,7 @@ - + @@ -6274,14 +6314,14 @@ - + - + - + @@ -6613,7 +6653,7 @@ - + @@ -6621,14 +6661,14 @@ - + - + - + @@ -6816,7 +6856,7 @@ - + @@ -6824,13 +6864,13 @@ - + - + - + @@ -7092,7 +7132,7 @@ - + @@ -7100,13 +7140,13 @@ - + - + - + @@ -7368,7 +7408,7 @@ - + @@ -7376,14 +7416,14 @@ - + - + - + @@ -7612,7 +7652,7 @@ - + @@ -7620,14 +7660,14 @@ - + - + - + @@ -8024,7 +8064,7 @@ - + @@ -8032,13 +8072,13 @@ - + - + - + @@ -8175,7 +8215,7 @@ - + @@ -8183,13 +8223,13 @@ - + - + - + @@ -8298,19 +8338,12 @@ - - - - - - - - + - + @@ -8368,19 +8401,12 @@ - - - - - - - - + - + @@ -8404,7 +8430,7 @@ - + @@ -8412,13 +8438,13 @@ - + - + - + @@ -8542,7 +8568,7 @@ - + @@ -8550,13 +8576,13 @@ - + - + - + @@ -8657,7 +8683,7 @@ - + @@ -8740,7 +8766,7 @@ - + @@ -8797,7 +8823,7 @@ - + @@ -8805,14 +8831,14 @@ - + - + - + @@ -8925,7 +8951,10 @@ - + + @@ -8957,7 +8986,10 @@ - + + @@ -8990,7 +9022,10 @@ - + + @@ -9015,7 +9050,10 @@ - + + @@ -9044,7 +9082,10 @@ - + + @@ -9074,7 +9115,10 @@ - + + @@ -9124,7 +9168,10 @@ - + + @@ -9145,7 +9192,7 @@ - + @@ -9181,10 +9228,13 @@ - - - - + + @@ -9232,7 +9282,10 @@ - + + @@ -9264,7 +9317,10 @@ - + + @@ -9297,7 +9353,10 @@ - + + @@ -9322,7 +9381,10 @@ - + + @@ -9351,7 +9413,10 @@ - + + @@ -9381,7 +9446,10 @@ - + + @@ -9431,7 +9499,10 @@ - + + @@ -9452,7 +9523,7 @@ - + @@ -9488,10 +9559,13 @@ - - - - + + @@ -9516,7 +9590,7 @@ - + @@ -9524,13 +9598,13 @@ - + - + - + @@ -9745,7 +9819,7 @@ - + @@ -9753,14 +9827,14 @@ - + - + - + @@ -9933,7 +10007,7 @@ - + @@ -9941,13 +10015,13 @@ - + - + - + @@ -10046,8 +10120,7 @@ - - + @@ -10305,8 +10378,7 @@ - - + @@ -10440,7 +10512,7 @@ - + @@ -10448,14 +10520,14 @@ - + - + - + @@ -10704,7 +10776,7 @@ - + @@ -10712,14 +10784,14 @@ - + - + - + @@ -10858,7 +10930,7 @@ - + @@ -10866,14 +10938,14 @@ - + - + - + @@ -11028,17 +11100,17 @@ - + - + - + @@ -11221,17 +11293,17 @@ - + - + - + @@ -11344,7 +11416,7 @@ - + @@ -11352,14 +11424,14 @@ - + - + - + @@ -11464,7 +11536,7 @@ - + @@ -11624,7 +11696,7 @@ - + @@ -11764,7 +11836,7 @@ - + @@ -11772,14 +11844,14 @@ - + - + - + @@ -11942,7 +12014,7 @@ - + @@ -11950,14 +12022,14 @@ - + - + - + @@ -12121,6 +12193,20 @@ + + + + + + + + + + + + + + @@ -12382,6 +12468,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12525,6 +12649,20 @@ + + + + + + + + + + + + + + @@ -12744,6 +12882,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12811,7 +12987,7 @@ - + @@ -12819,13 +12995,13 @@ - + - + - + @@ -13365,7 +13541,7 @@ - + @@ -13559,7 +13735,7 @@ - + @@ -14132,7 +14308,7 @@ - + @@ -14258,12 +14434,92 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -14749,7 +15005,7 @@ - + @@ -14817,7 +15073,7 @@ - + @@ -15436,7 +15692,7 @@ - + @@ -15580,7 +15836,7 @@ - + @@ -16103,7 +16359,7 @@ - + @@ -16229,12 +16485,42 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16662,7 +16948,7 @@ - + @@ -16688,7 +16974,7 @@ - + @@ -16862,7 +17148,7 @@ - + @@ -16870,13 +17156,13 @@ - + - + - + @@ -17048,20 +17334,17 @@ - - + + + - - - - @@ -17316,20 +17599,17 @@ - - + + + - - - - @@ -17492,7 +17772,7 @@ - + @@ -17500,13 +17780,13 @@ - + - + - + @@ -17783,7 +18063,7 @@ - + @@ -17791,13 +18071,13 @@ - + - + - + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/account.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/account.sch index b9d20a771e7..2aae491ed88 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/account.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/account.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -77,5 +76,17 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/activitydefinition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/activitydefinition.sch index f441dcd95c5..6dcc713f0af 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/activitydefinition.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/activitydefinition.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -96,6 +95,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -143,6 +144,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -162,15 +165,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - rng-2: If present, low SHALL have a lower value than high diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/allergyintolerance.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/allergyintolerance.sch index 7c96e9e7fde..54cc7ea64be 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/allergyintolerance.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/allergyintolerance.sch @@ -23,10 +23,11 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + ait-1: AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error. + ait-2: AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -50,6 +51,21 @@ ref-1: SHALL have a contained resource if a local reference is provided + + age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. + + + per-1: If present, start SHALL have a lower value than end + + + rng-2: If present, low SHALL have a lower value than high + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + qty-3: If a code for the unit is present, the system SHALL also be present + ref-1: SHALL have a contained resource if a local reference is provided @@ -59,13 +75,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/appointment.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/appointment.sch index 5e1ff64ea22..2d0a2046698 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/appointment.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/appointment.sch @@ -27,8 +27,7 @@ app-2: Either start and end are specified, or neither - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/appointmentresponse.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/appointmentresponse.sch index ffdd4ca7df4..4eb4fa5162f 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/appointmentresponse.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/appointmentresponse.sch @@ -26,8 +26,7 @@ apr-1: Either the participantType or actor must be specified - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/auditevent.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/auditevent.sch index 2b281f89739..16cf01d4f86 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/auditevent.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/auditevent.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/basic.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/basic.sch index cf6ee36571e..35604dbb2b5 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/basic.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/basic.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/binary.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/binary.sch index 13e6e6d0b15..4b3d334062b 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/binary.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/binary.sch @@ -18,5 +18,14 @@ Binary + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/bodysite.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/bodysite.sch index f1fae451a4d..ecdd0b1f3f1 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/bodysite.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/bodysite.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/bundle.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/bundle.sch index 0437d70fb42..ff05e6cbbe8 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/bundle.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/bundle.sch @@ -20,15 +20,21 @@ Bundle bdl-7: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId + bdl-9: A document must have an identifier with a system and a value bdl-3: entry.request only for some types of bundles bdl-4: entry.response only for some types of bundles bdl-1: total only when a search or history bdl-2: entry.search only when a search + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + bdl-8: fullUrl cannot be a version specific reference bdl-5: must be a resource unless there's a request or response - bdl-6: The fullUrl element must be present when a resource is present, and not present otherwise ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/capabilitystatement.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/capabilitystatement.sch index fff8c3cd130..c8c6dc6ab12 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/capabilitystatement.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/capabilitystatement.sch @@ -25,15 +25,14 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource cpb-8: There can only be one REST declaration per mode cpb-7: The set of documents must be unique by the combination of profile & mode - cpb-15: Capability Statements of kind 'software' do not have implementation elements + cpb-15: Capability Statements of kind 'instance' do not have implementation elements cpb-3: Messaging end-point is required (and is only permitted) when statement is for an implementation cpb-14: Capability Statements of kind 'requirements' do not have software or implementation elements cpb-2: A Capability Statement SHALL have at least one of description, software, or implementation cpb-1: A Capability Statement SHALL have at least one of REST, messaging or document - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -84,9 +83,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - cpb-13: Search parameters can only have chain names when the search parameter type is 'reference' - ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/careplan.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/careplan.sch index cdaa166f667..2031ca43a5b 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/careplan.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/careplan.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -189,6 +188,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/careteam.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/careteam.sch index aeeac5c1520..49bd823a4ec 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/careteam.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/careteam.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/claim.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/claim.sch index 06a3c00b4e2..9cfe67c6394 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/claim.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/claim.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,9 +40,27 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -71,24 +88,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -140,12 +139,51 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -155,31 +193,22 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided @@ -200,15 +229,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/claimresponse.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/claimresponse.sch index 45d8ac5a232..232565e3ae2 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/claimresponse.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/claimresponse.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,22 +40,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided @@ -77,6 +67,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + mny-1: There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency). @@ -107,22 +106,31 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/clinicalimpression.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/clinicalimpression.sch index cc42c72b377..5746d243e9e 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/clinicalimpression.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/clinicalimpression.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/codesystem.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/codesystem.sch index d1565e67dc3..c7732fb3511 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/codesystem.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/codesystem.sch @@ -26,8 +26,7 @@ csd-1: Within a code system definition, all the codes SHALL be unique - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/communication.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/communication.sch index a4c0bf41731..8be07f0e96e 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/communication.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/communication.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/communicationrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/communicationrequest.sch index b79fc171fcc..a43a2a10936 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/communicationrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/communicationrequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/compartmentdefinition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/compartmentdefinition.sch index 1c833428deb..18fdaa69be7 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/compartmentdefinition.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/compartmentdefinition.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/composition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/composition.sch index 1457afac407..0368ae8edb0 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/composition.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/composition.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -103,8 +102,7 @@ cmp-2: A section can only have an emptyReason if it is empty - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/conceptmap.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/conceptmap.sch index 30d10787d7c..899cdd4cf97 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/conceptmap.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/conceptmap.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/condition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/condition.sch index 38cdbcbab77..c167255f18a 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/condition.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/condition.sch @@ -23,10 +23,11 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + con-4: If condition is abated, then clinicalStatus must be either inactive, resolved, or remission + con-3: Condition.clinicalStatus SHALL be present if verificationStatus is not entered-in-error - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/consent.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/consent.sch index d496ddb8a53..93eae9d826e 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/consent.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/consent.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/contract.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/contract.sch index 785f4384950..d4a23874d12 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/contract.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/contract.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/coverage.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/coverage.sch index 9ca168d3f5f..f9549ce22dc 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/coverage.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/coverage.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -35,25 +34,28 @@ ext-1: Must have either extensions or value[x], not both - - ref-1: SHALL have a contained resource if a local reference is provided - - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -65,10 +67,16 @@ ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/dataelement.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/dataelement.sch index a11c1e61290..c492b3fcb37 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/dataelement.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/dataelement.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -90,7 +89,7 @@ eld-10: provide either a reference or a description (or both) - eld-12: ValueSet as a URI SHALL start with http:// or https:// urn: + eld-12: ValueSet as a URI SHALL start with http:// or https:// or urn: ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/detectedissue.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/detectedissue.sch index 105c59bf4bb..592d4182c4e 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/detectedissue.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/detectedissue.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/device.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/device.sch index 008f87f0f4f..d1135805e07 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/device.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/device.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/devicecomponent.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/devicecomponent.sch index a8e7106b600..d351997389f 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/devicecomponent.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/devicecomponent.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/devicemetric.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/devicemetric.sch index 188bfd664e9..6a3f60299f4 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/devicemetric.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/devicemetric.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -66,6 +65,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/deviceuserequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/deviceuserequest.sch index 1783211afd6..3a350063554 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/deviceuserequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/deviceuserequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -111,6 +110,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/deviceusestatement.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/deviceusestatement.sch index 14a30c40f49..aab6fc05822 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/deviceusestatement.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/deviceusestatement.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -35,15 +34,6 @@ ext-1: Must have either extensions or value[x], not both - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end @@ -78,6 +68,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticreport-genetics.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticreport-genetics.sch new file mode 100644 index 00000000000..0879b4ec337 --- /dev/null +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticreport-genetics.sch @@ -0,0 +1,44 @@ + + + + + + + f:DiagnosticReport + + codedDiagnosis: maximum cardinality of 'codedDiagnosis' is 0 + + + + DiagnosticReport + + If the resource is contained in another resource, it SHALL NOT contain nested Resources (inherited) + If the resource is contained in another resource, it SHALL NOT contain any narrative (inherited) + If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated (inherited) + If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource (inherited) + + + + DiagnosticReport.extension + + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + + + + DiagnosticReport.image + + All FHIR elements must have a @value or children (inherited) + + + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticreport.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticreport.sch index 9115aa0e995..9c27bb769b9 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticreport.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticreport.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticrequest-genetics.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticrequest-genetics.sch new file mode 100644 index 00000000000..2b971f42433 --- /dev/null +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticrequest-genetics.sch @@ -0,0 +1,28 @@ + + + + + + + DiagnosticRequest + + If the resource is contained in another resource, it SHALL NOT contain nested Resources (inherited) + If the resource is contained in another resource, it SHALL NOT contain any narrative (inherited) + If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated (inherited) + If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource (inherited) + + + + DiagnosticRequest.extension + + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + + + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticrequest.sch index 21407773103..8af65a7c3df 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/diagnosticrequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -102,6 +101,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -139,6 +140,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/documentmanifest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/documentmanifest.sch index 8fed1cf41d5..d10243cd8cc 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/documentmanifest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/documentmanifest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/documentreference.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/documentreference.sch index ff27198581f..aec03dc3d18 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/documentreference.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/documentreference.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/elementdefinition-de.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/elementdefinition-de.sch index efd9556c47a..58f5d95802b 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/elementdefinition-de.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/elementdefinition-de.sch @@ -81,6 +81,12 @@ Aggregation may only be specified if one of the allowed types for the element is a resource (inherited) + + ElementDefinition.example + + All FHIR elements must have a @value or children (inherited) + + ElementDefinition.constraint @@ -92,7 +98,7 @@ All FHIR elements must have a @value or children (inherited) provide either a reference or a description (or both) (inherited) - ValueSet as a URI SHALL start with http:// or https:// urn: (inherited) + ValueSet as a URI SHALL start with http:// or https:// or urn: (inherited) diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/eligibilityrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/eligibilityrequest.sch index 208257bd3be..2e680b8652f 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/eligibilityrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/eligibilityrequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,13 +40,25 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -68,13 +79,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -86,15 +97,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -104,8 +106,5 @@ ref-1: SHALL have a contained resource if a local reference is provided - - per-1: If present, start SHALL have a lower value than end - diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/eligibilityresponse.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/eligibilityresponse.sch index 8407b854f9c..c05a8b0ecc6 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/eligibilityresponse.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/eligibilityresponse.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,24 +40,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -77,19 +58,46 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + mny-1: There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency). - + mny-1: There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency). diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/encounter.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/encounter.sch index e9161f50a66..9922d95cbf3 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/encounter.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/encounter.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/endpoint.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/endpoint.sch index 6193f25d7cf..7eca5eb8d93 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/endpoint.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/endpoint.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/enrollmentrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/enrollmentrequest.sch index da3d3129675..44d7905b9f8 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/enrollmentrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/enrollmentrequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,64 +40,40 @@ ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/enrollmentresponse.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/enrollmentresponse.sch index 600d158de51..9230f3bfa60 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/enrollmentresponse.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/enrollmentresponse.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,64 +40,40 @@ ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/episodeofcare.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/episodeofcare.sch index aeb6ab6ff62..397e6950909 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/episodeofcare.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/episodeofcare.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/expansionprofile.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/expansionprofile.sch index f692c86337f..44c6a9e340d 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/expansionprofile.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/expansionprofile.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/explanationofbenefit.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/explanationofbenefit.sch index 572c3b89ff1..731cae98ce4 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/explanationofbenefit.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/explanationofbenefit.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,36 +40,36 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -89,6 +88,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -98,6 +106,24 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -146,21 +172,42 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -170,22 +217,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided @@ -206,15 +244,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/familymemberhistory-genetic.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/familymemberhistory-genetic.sch index c21d4a8c7d8..480b594d9b1 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/familymemberhistory-genetic.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/familymemberhistory-genetic.sch @@ -16,7 +16,7 @@ If the resource is contained in another resource, it SHALL NOT contain any narrative (inherited) If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated (inherited) If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource (inherited) - Can only have estimatedAge is age[x] is present (inherited) + Can only have estimatedAge if age[x] is present (inherited) Can have age[x] or born[x], but not both (inherited) @@ -27,6 +27,8 @@ Must have either extensions or value[x], not both (inherited) All FHIR elements must have a @value or children (inherited) Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/familymemberhistory.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/familymemberhistory.sch index d0500d7562f..60633f385f1 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/familymemberhistory.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/familymemberhistory.sch @@ -23,12 +23,11 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - fhs-2: Can only have estimatedAge is age[x] is present + fhs-2: Can only have estimatedAge if age[x] is present fhs-1: Can have age[x] or born[x], but not both - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/fhir-invariants.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/fhir-invariants.sch index 623b994c42d..cc2d6b91764 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/fhir-invariants.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/fhir-invariants.sch @@ -27,8 +27,7 @@ app-2: Either start and end are specified, or neither - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -77,8 +76,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -166,8 +164,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -218,6 +215,18 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + DocumentManifest @@ -228,8 +237,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -305,6 +313,91 @@ ref-1: SHALL have a contained resource if a local reference is provided + + MessageDefinition + + dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative + dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + ext-1: Must have either extensions or value[x], not both + + + ext-1: Must have either extensions or value[x], not both + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + rng-2: If present, low SHALL have a lower value than high + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + md-1: Max must be postive int or * + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + Goal @@ -314,8 +407,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -388,8 +480,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -432,8 +523,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -448,64 +538,40 @@ ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided @@ -527,8 +593,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -631,15 +696,14 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource cpb-8: There can only be one REST declaration per mode cpb-7: The set of documents must be unique by the combination of profile & mode - cpb-15: Capability Statements of kind 'software' do not have implementation elements + cpb-15: Capability Statements of kind 'instance' do not have implementation elements cpb-3: Messaging end-point is required (and is only permitted) when statement is for an implementation cpb-14: Capability Statements of kind 'requirements' do not have software or implementation elements cpb-2: A Capability Statement SHALL have at least one of description, software, or implementation cpb-1: A Capability Statement SHALL have at least one of REST, messaging or document - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -690,9 +754,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - cpb-13: Search parameters can only have chain names when the search parameter type is 'reference' - ref-1: SHALL have a contained resource if a local reference is provided @@ -739,8 +800,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -798,8 +858,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -887,6 +946,61 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ResearchSubject + + dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative + dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + ext-1: Must have either extensions or value[x], not both + + + ext-1: Must have either extensions or value[x], not both + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + Subscription @@ -896,8 +1010,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -922,8 +1035,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1038,8 +1150,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1085,8 +1196,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1189,8 +1299,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1272,8 +1381,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1325,8 +1433,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1393,6 +1500,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -1422,8 +1531,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1532,8 +1640,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1582,8 +1689,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1617,8 +1723,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1676,8 +1781,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -1900,8 +2004,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2036,8 +2139,7 @@ grp-1: Can only have members if group is "actual" - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2089,8 +2191,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2105,6 +2206,24 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -2132,24 +2251,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - Organization @@ -2161,8 +2262,7 @@ org-1: The organization SHALL at least have a name or an id, and possibly more than one - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2230,8 +2330,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2289,8 +2388,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2354,8 +2452,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2440,8 +2537,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2488,12 +2584,11 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - fhs-2: Can only have estimatedAge is age[x] is present + fhs-2: Can only have estimatedAge if age[x] is present fhs-1: Can have age[x] or born[x], but not both - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2587,8 +2682,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2760,8 +2854,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2812,10 +2905,10 @@ dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource spd-1: If an xpath is present, there SHALL be an xpathUsage + spd-2: Search parameters can only have chain names when the search parameter type is 'reference' - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2842,13 +2935,13 @@ qty-3: If a code for the unit is present, the system SHALL also be present - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -2861,8 +2954,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -2923,6 +3015,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -2951,15 +3045,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -2975,15 +3060,6 @@ drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -3018,8 +3094,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3128,8 +3203,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3199,6 +3273,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -3246,6 +3322,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -3265,15 +3343,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - rng-2: If present, low SHALL have a lower value than high @@ -3341,8 +3410,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3379,8 +3447,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3389,15 +3456,6 @@ ext-1: Must have either extensions or value[x], not both - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end @@ -3432,6 +3490,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -3464,8 +3524,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3525,6 +3584,9 @@ ref-1: SHALL have a contained resource if a local reference is provided + + rqg-1: Must have resource or action but not both + per-1: If present, start SHALL have a lower value than end @@ -3576,6 +3638,34 @@ qty-3: If a code for the unit is present, the system SHALL also be present + + tim-9: If there's an offset, there must be a when + tim-5: period SHALL be a non-negative value + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-8: If there's a countMax, there must be a count + tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period + tim-2: if there's a period, there needs to be period units + tim-3: Either frequency or when can exist, not both + tim-4: duration SHALL be a non-negative value + + + drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. + + + rng-2: If present, low SHALL have a lower value than high + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + per-1: If present, start SHALL have a lower value than end + ref-1: SHALL have a contained resource if a local reference is provided @@ -3604,8 +3694,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3693,8 +3782,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3755,8 +3843,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3793,8 +3880,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3824,19 +3910,31 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -3865,11 +3963,10 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - inv-1: Last modified date must be greater than or equal to created date. + inv-1: Last modified date must be greater than or equal to authored-on date. - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -3884,6 +3981,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -3893,19 +3999,19 @@ ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -3935,13 +4041,25 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -3962,16 +4080,25 @@ ref-1: SHALL have a contained resource if a local reference is provided - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -3985,8 +4112,7 @@ que-2: The link ids for groups and questions must be unique within the questionnaire - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -4016,6 +4142,7 @@ que-3: Display items cannot have a "concept" asserted que-10: Maximum length can only be declared for simple question types que-1: Group items must have nested items, display items cannot have nested items + que-11: Type is required if a definition is not provided que-7: enableWhen must contain either an 'answer' or an 'answered' element @@ -4069,8 +4196,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -4085,36 +4211,36 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -4133,6 +4259,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -4142,6 +4277,24 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -4190,21 +4343,42 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -4214,22 +4388,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided @@ -4250,15 +4415,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end @@ -4365,6 +4521,115 @@ mny-1: There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency). + + ResearchStudy + + dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative + dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + ext-1: Must have either extensions or value[x], not both + + + ext-1: Must have either extensions or value[x], not both + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + Specimen @@ -4374,8 +4639,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -4488,10 +4752,11 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + ait-1: AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error. + ait-2: AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -4515,6 +4780,21 @@ ref-1: SHALL have a contained resource if a local reference is provided + + age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. + + + per-1: If present, start SHALL have a lower value than end + + + rng-2: If present, low SHALL have a lower value than high + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + qty-3: If a code for the unit is present, the system SHALL also be present + ref-1: SHALL have a contained resource if a local reference is provided @@ -4524,13 +4804,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -4561,8 +4841,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -4725,6 +5004,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -4806,14 +5087,13 @@ sdf-11: If there's a type, its content must match the path name in the first element of a snapshot sdf-14: All element definitions must have an id sdf-1: Element paths must be unique unless the structure is a constraint - sdf-7: If the structure describes a base Resource or Type, the URL has to start with "http://hl7.org/fhir/StructureDefinition/" and the tail must match the id + sdf-7: If the structure describes a base Resource or Type, the URL has to start with "http://hl7.org/fhir/StructureDefinition/" and the tail must match the id sdf-6: A structure must have either a differential, or a snapshot (or both) sdf-5: If the structure defines an extension then the structure must have context information sdf-4: If the structure is not abstract, then there SHALL be a baseDefinition - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -4847,7 +5127,7 @@ qty-3: If a code for the unit is present, the system SHALL also be present - sdf-2: Must have at a name or a uri (or both) + sdf-2: Must have at least a name or a uri (or both) sdf-15: The first element in a snapshot has no type @@ -4883,7 +5163,7 @@ eld-10: provide either a reference or a description (or both) - eld-12: ValueSet as a URI SHALL start with http:// or https:// urn: + eld-12: ValueSet as a URI SHALL start with http:// or https:// or urn: ref-1: SHALL have a contained resource if a local reference is provided @@ -4896,6 +5176,7 @@ sdf-15a: If the first element in a differential has no "." in the path, it has no type + sdf-20: No slicing on the root element sdf-8a: In any differential, all the elements must be in the specified type @@ -4927,7 +5208,7 @@ eld-10: provide either a reference or a description (or both) - eld-12: ValueSet as a URI SHALL start with http:// or https:// urn: + eld-12: ValueSet as a URI SHALL start with http:// or https:// or urn: ref-1: SHALL have a contained resource if a local reference is provided @@ -4948,8 +5229,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5043,8 +5323,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5064,8 +5343,7 @@ pro-1: Reason not performed is only permitted if notPerformed indicator is true - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5194,8 +5472,7 @@ lst-1: A list can only have an emptyReason if it is empty - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5265,8 +5542,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5331,8 +5607,7 @@ vsd-5: Value set SHALL contain at least one of a a compose, or an expansion element - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5366,7 +5641,7 @@ qty-3: If a code for the unit is present, the system SHALL also be present - vsd-2: A value set with concepts or filters SHALL include a system + vsd-2: A value set with concepts or filters SHALL include a system vsd-3: Cannot have both concept and filter vsd-1: A value set include/exclude SHALL have a value set or a system @@ -5385,8 +5660,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5454,8 +5728,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5531,6 +5804,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -5568,6 +5843,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -5607,8 +5891,7 @@ imm-1: If immunization was not administered (wasNotGiven=true) then there SHALL be no reaction nor explanation.reason present - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5717,8 +6000,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -5793,13 +6075,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -5827,6 +6109,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -5846,15 +6130,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - rng-2: If present, low SHALL have a lower value than high @@ -5949,8 +6224,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6023,8 +6297,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6048,15 +6321,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -6066,6 +6330,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -6092,8 +6365,7 @@ mda-4: Duration can only be used for an audio or a video - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6139,8 +6411,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6183,6 +6454,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -6257,8 +6530,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6273,24 +6545,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -6309,19 +6563,46 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + mny-1: There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency). - + mny-1: There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency). @@ -6334,8 +6615,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6420,6 +6700,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -6501,10 +6783,10 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + seq-3: Only 0 and 1 are valid for coordinateSystem - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6546,9 +6828,23 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + qty-3: If a code for the unit is present, the system SHALL also be present + + seq-4: Only +1 and -1 are valid for strand + seq-5: GenomeBuild and chromosome must be both contained if either one of them is contained + seq-6: Have and only have one of the following elements in referenceSeq : 1. genomeBuild ; 2 referenceSeqId; 3. referenceSeqPointer; 4. referenceSeqString; + ref-1: SHALL have a contained resource if a local reference is provided @@ -6589,8 +6885,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6630,6 +6925,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -6659,8 +6956,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6716,8 +7012,7 @@ csd-1: Within a code system definition, all the codes SHALL be unique - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6761,8 +7056,7 @@ apr-1: Either the participantType or actor must be specified - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6805,8 +7099,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6853,8 +7146,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -6941,22 +7233,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided @@ -6986,8 +7269,7 @@ obs-6: dataAbsentReason SHALL only be present if Observation.value[x] is not present - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7149,8 +7431,7 @@ mad-3: Reason given is only permitted if NotGiven is false - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7201,7 +7482,7 @@ ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end @@ -7252,15 +7533,6 @@ mad-1: SHALL have at least one of dosage.dose and dosage.rate[x] - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - qty-3: If a code for the unit is present, the system SHALL also be present @@ -7295,8 +7567,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7311,69 +7582,54 @@ ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided Binary + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + Library @@ -7384,8 +7640,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7448,15 +7703,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -7486,8 +7732,7 @@ mst-1: Reason not taken is only permitted if notTaken is Yes - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7511,13 +7756,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -7566,6 +7811,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -7585,15 +7832,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - rng-2: If present, low SHALL have a lower value than high @@ -7652,8 +7890,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7747,8 +7984,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7867,8 +8103,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7911,8 +8146,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7952,8 +8186,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -7968,22 +8201,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided @@ -8004,6 +8228,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + mny-1: There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency). @@ -8034,22 +8267,31 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -8062,8 +8304,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8078,13 +8319,25 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -8105,13 +8358,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -8123,15 +8376,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -8141,9 +8385,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - per-1: If present, start SHALL have a lower value than end - ProcessRequest @@ -8154,8 +8395,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8229,8 +8469,7 @@ mdd-1: whenHandedOver cannot be before whenPrepared - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8339,6 +8578,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -8358,15 +8599,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - rng-2: If present, low SHALL have a lower value than high @@ -8443,8 +8675,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8547,8 +8778,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8602,6 +8832,15 @@ per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + DataElement @@ -8612,8 +8851,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8677,7 +8915,7 @@ eld-10: provide either a reference or a description (or both) - eld-12: ValueSet as a URI SHALL start with http:// or https:// urn: + eld-12: ValueSet as a URI SHALL start with http:// or https:// or urn: ref-1: SHALL have a contained resource if a local reference is provided @@ -8699,8 +8937,7 @@ nor-1: Nutrition Order SHALL contain either Oral Diet , Supplement, or Enteral Formula class - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8758,6 +8995,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -8787,6 +9026,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -8819,6 +9060,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -8866,8 +9109,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8934,8 +9176,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -8950,15 +9191,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end @@ -8971,6 +9203,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -9039,10 +9280,11 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + con-4: If condition is abated, then clinicalStatus must be either inactive, resolved, or remission + con-3: Condition.clinicalStatus SHALL be present if verificationStatus is not entered-in-error - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9157,8 +9399,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9235,8 +9476,7 @@ cmp-2: A section can only have an emptyReason if it is empty - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9258,8 +9498,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9315,15 +9554,21 @@ Bundle bdl-7: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId + bdl-9: A document must have an identifier with a system and a value bdl-3: entry.request only for some types of bundles bdl-4: entry.response only for some types of bundles bdl-1: total only when a search or history bdl-2: entry.search only when a search + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + bdl-8: fullUrl cannot be a version specific reference bdl-5: must be a resource unless there's a request or response - bdl-6: The fullUrl element must be present when a resource is present, and not present otherwise ref-1: SHALL have a contained resource if a local reference is provided @@ -9353,8 +9598,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9391,8 +9635,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9486,8 +9729,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9496,25 +9738,28 @@ ext-1: Must have either extensions or value[x], not both - - ref-1: SHALL have a contained resource if a local reference is provided - - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -9526,10 +9771,16 @@ ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -9551,8 +9802,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9630,6 +9880,9 @@ ref-1: SHALL have a contained resource if a local reference is provided + + qrs-1: Nested item can't be beneath both item and answer + ref-1: SHALL have a contained resource if a local reference is provided @@ -9664,8 +9917,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9680,15 +9932,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -9698,6 +9941,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -9716,6 +9968,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + NamingSystem @@ -9729,8 +9990,7 @@ nsd-2: Can't have more than one preferred identifier for a type - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9779,8 +10039,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9817,8 +10076,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -9894,8 +10152,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -10013,8 +10270,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -10102,6 +10358,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -10130,15 +10388,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -10154,6 +10403,36 @@ drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. + per-1: If present, start SHALL have a lower value than end @@ -10194,6 +10473,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -10241,8 +10522,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -10257,9 +10537,27 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -10287,24 +10585,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -10356,12 +10636,51 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -10371,31 +10690,22 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided @@ -10416,15 +10726,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end @@ -10507,8 +10808,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -10720,8 +11020,8 @@ - Extension: Amino acid change - + Extension: natural brother(s) & natural sister(s) - genetic & other + ele-1: All FHIR elements must have a @value or children ext-1: Must have either extensions or value[x], not both @@ -11071,6 +11371,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Voorvoegsel derived from person's partner's surname + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: initiatingPerson @@ -11152,13 +11459,6 @@ ext-1: Must have either extensions or value[x], not both - - Extension: The status of a Concern associated with a condition - - ele-1: All FHIR elements must have a @value or children - ext-1: Must have either extensions or value[x], not both - - Extension: Mother's Maiden name @@ -11180,13 +11480,6 @@ ext-1: Must have either extensions or value[x], not both - - Extension: DNA sequence variant - - ele-1: All FHIR elements must have a @value or children - ext-1: Must have either extensions or value[x], not both - - Extension: precinct @@ -11215,6 +11508,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Portion of family name derived from father + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: Who has used and how? @@ -11241,15 +11541,15 @@ - Extension: Patient's professed religious affiliation - + Extension: Map that can populate this questionnaire + ele-1: All FHIR elements must have a @value or children ext-1: Must have either extensions or value[x], not both - Extension: Map that can populate this questionnaire - + Extension: Preferred display order of name parts + ele-1: All FHIR elements must have a @value or children ext-1: Must have either extensions or value[x], not both @@ -11268,6 +11568,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Purpose of the family member history + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: The length of time for radiation exposure @@ -11414,6 +11721,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Option is exclusive + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: Link to patient record @@ -11734,6 +12048,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Portion of family name derived from mother + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: The sequence number of the sample @@ -11843,6 +12164,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: HGVS nomenclature for observed Amino Acid Change + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: When the value set version should no longer be used @@ -12051,13 +12379,6 @@ ext-1: Must have either extensions or value[x], not both - - Extension: translation - - ele-1: All FHIR elements must have a @value or children - ext-1: Must have either extensions or value[x], not both - - Extension: Conformance expectation @@ -12128,13 +12449,6 @@ ext-1: Must have either extensions or value[x], not both - - Extension: language - - ele-1: All FHIR elements must have a @value or children - ext-1: Must have either extensions or value[x], not both - - Extension: Reference to policy/rule for this exception @@ -12240,6 +12554,17 @@ ext-1: Must have either extensions or value[x], not both + + Extension: External Identifier associated with this element + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: The Species of the Service Animal @@ -12290,6 +12615,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Portion derived from person's partner's surname + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: XML (Schema) type of attribute for RDF @@ -12360,13 +12692,6 @@ ext-1: Must have either extensions or value[x], not both - - Extension: Protein reference sequence ID - - ele-1: All FHIR elements must have a @value or children - ext-1: Must have either extensions or value[x], not both - - Extension: Body site of manifestations @@ -12423,6 +12748,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: SNOMED CT Description ID + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: The effective date range for the resource @@ -12430,6 +12762,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: HGVS nomenclature for observed DNA sequence variant + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: unitType @@ -12500,13 +12839,6 @@ ext-1: Must have either extensions or value[x], not both - - Extension: Transcript reference sequence ID - - ele-1: All FHIR elements must have a @value or children - ext-1: Must have either extensions or value[x], not both - - Extension: The patient's participation in clinical trials @@ -12550,14 +12882,7 @@ - Extension: Sex of patient assigned at birth - - ele-1: All FHIR elements must have a @value or children - ext-1: Must have either extensions or value[x], not both - - - - Extension: Goals related to this one + Extension: Goals related to this Goal ele-1: All FHIR elements must have a @value or children ext-1: Must have either extensions or value[x], not both @@ -12591,13 +12916,6 @@ ext-1: Must have either extensions or value[x], not both - - Extension: External Identifier associated with this element - - ele-1: All FHIR elements must have a @value or children - ext-1: Must have either extensions or value[x], not both - - Extension: An allowable parameter combination @@ -12724,6 +13042,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: The patient's professed religious affiliations + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: Allowed profile for reference @@ -12731,6 +13056,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Voorvoegsel derived from person's own surname + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: Minimum repetitions @@ -12815,6 +13147,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Portion derived from person's own surname + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: FamilyHistory @@ -12843,6 +13182,13 @@ ext-1: Must have either extensions or value[x], not both + + Extension: Owing Work Group + + ele-1: All FHIR elements must have a @value or children + ext-1: Must have either extensions or value[x], not both + + Extension: Associated Encounter diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/fhir-single.xsd b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/fhir-single.xsd index 57913e392e8..70904b6f295 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/fhir-single.xsd +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/fhir-single.xsd @@ -27,9 +27,9 @@ POSSIBILITY OF SUCH DAMAGE. - Generated on Sat, Nov 5, 2016 10:42-0400 for FHIR v1.7.0 + Generated on Tue, Dec 6, 2016 09:42-0500 for FHIR v1.8.0 --> - + @@ -391,6 +391,7 @@ + @@ -415,6 +416,8 @@ + + @@ -731,7 +734,7 @@ - The number of bytes of data that make up this attachment. + The number of bytes of data that make up this attachment (before base64 encoding, if that is done). @@ -1148,7 +1151,7 @@ - A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. + A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. @@ -1453,7 +1456,7 @@ The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. - + The profile of the required data, specified as the uri of the profile definition. @@ -1678,7 +1681,7 @@ A full text representation of the name. - + The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. @@ -1741,7 +1744,7 @@ - Maiden + Name changed for Marriage @@ -1816,11 +1819,16 @@ Pager - + URL + + + Other + + @@ -1992,6 +2000,16 @@ The units of time for the period in UCUM units. + + + If one or more days of week is provided, then the action happens only on the specified day(s). + + + + + Specified time of day for action to take place. + + A real world event that the occurrence of the event should be tied to. @@ -2058,6 +2076,26 @@ + + + Morning + + + + + Afternoon + + + + + Evening + + + + + Night + + HS @@ -2363,49 +2401,11 @@ - - - A sample value for this element demonstrating the type of information that would typically be captured. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + A sample value for this element demonstrating the type of information that would typically be found in the element. + + The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. @@ -2616,6 +2616,66 @@ + + + Captures constraints on each element within the resource, profile, or extension. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Describes the purpose of this example amoung the set of examples. + + + + + The actual value for the element, which must be one of the types allowed for this element. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Captures constraints on each element within the resource, profile, or extension. @@ -2902,13 +2962,11 @@ - + Body site to administer to. - - - + How drug should enter body. @@ -3415,6 +3473,37 @@ A coverage may only be resposible for specific types of charges, and the sequenc Provides additional information about what the account tracks and how it is used. + + + Parties financially responsible for the account. + + + + + + + + + A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. + + + + + + + The entity who is responsible. + + + + + A guarantor may be placed on credit hold or otherwise have their role temporarily suspended. + + + + + The timeframe during which the guarantor accepts responsibility for the account. + + @@ -3621,6 +3710,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources. + + + Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites). + + A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input. @@ -3764,7 +3858,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc This records identifiers associated with this allergy/intolerance concern 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). - + + + The clinical status of the allergy or intolerance. + + + Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product). @@ -3794,14 +3893,19 @@ A coverage may only be resposible for specific types of charges, and the sequenc The patient who has the allergy or intolerance. - + - Record of the date and/or time of the onset of the Allergy or Intolerance. - - - + Estimated or actual date, date-time, or age when allergy or intolerance was identified. + + + + + + + + - Indicates the most recent date on which the recorder has asserted that the information represented by this AllergyIntolerance record is accurate. + The date on which the existance of the AllergyIntolerance was first asserted or acknowledged. @@ -3809,7 +3913,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Individual who recorded the record and takes responsibility for its content. - + The source of the information about the allergy that is recorded. @@ -3914,51 +4018,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Active Confirmed - - - - - Inactive - - - - - Resolved - - - - - Refuted - - - - - Entered In Error - - - - - - - Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified substance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -4054,6 +4113,41 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + + + Unconfirmed + + + + + Confirmed + + + + + Refuted + + + + + Entered In Error + + + + + + + Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified substance. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + @@ -4084,6 +4178,36 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + + + Active + + + + + Inactive + + + + + Resolved + + + + + + + The clinical status of the allergy or intolerance. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). @@ -4437,7 +4561,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc A free text description of the outcome of the event. - + The purposeOfUse (reason) that was used during the event being recorded. @@ -4518,7 +4642,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Logical network location for application activity, if the activity has a network location. - + The reason (purpose of use), specific to this agent, that was used during the event being recorded. @@ -4831,6 +4955,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc MimeType of the binary content represented as a standard MimeType (BCP 13). + + + Treat this binary as if it was this other resource for access control purposes. + + The actual content, base64 encoded. @@ -4905,6 +5034,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc Indicates the purpose of this bundle- how it was intended to be used. + + + A persistent identifier for the batch that won't change as a batch is copied from server to server. + + If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). @@ -4938,7 +5072,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1). @@ -5074,7 +5208,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - The etag for the resource, it the operation for the entry produced a versioned resource. + The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)). @@ -5334,9 +5468,19 @@ A coverage may only be resposible for specific types of charges, and the sequenc A list of the formats supported by this implementation using their content types. + + + A list of the patch formats supported by this implementation using their content types. + + + + + A list of implementation guides that the server does (or should) support in their entirety. + + - A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}. + A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses). @@ -5642,21 +5786,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - - - Types of resource (if a resource is referenced). - - - - - A modifier supported for the search parameter. - - - - - Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from CapabilityStatement.rest.resource.searchParam.name on the target resource type. - - @@ -5912,6 +6041,36 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + + + Consequence + + + + + Currency + + + + + Notification + + + + + + + The impact of the content of a message. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + @@ -5937,68 +6096,63 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + - + - Missing + Client - + - Exact - - - - - Contains - - - - - Not - - - - - Text - - - - - In - - - - - Not In - - - - - Below - - - - - Above - - - - - Type + Server - + - A supported modifier for a search parameter. + The mode of a RESTful capability statement. If the element is present, it must have either a @value, an @id, or extensions - + + + + + + + + + Neither Elements or Extensions + + + + + Unknown Extensions + + + + + Unknown Elements + + + + + Unknown Elements and Extensions + + + + + + + A code that indicates whether an application accepts unknown elements or extensions when reading resources. + If the element is present, it must have either a @value, an @id, or extensions + + + + @@ -6019,6 +6173,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc update + + + patch + + delete @@ -6167,96 +6326,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Consequence - - - - - Currency - - - - - Notification - - - - - - - The impact of the content of a message. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - - - - - - Client - - - - - Server - - - - - - - The mode of a RESTful capability statement. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - - - - - - Neither Elements or Extensions - - - - - Unknown Extensions - - - - - Unknown Elements - - - - - Unknown Elements and Extensions - - - - - - - A code that indicates whether an application accepts unknown elements or extensions when reading resources. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -6320,7 +6389,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc A description of the scope and nature of the plan. - + Identifies the patient or group whose intended care is described by the plan. @@ -6778,34 +6847,29 @@ A coverage may only be resposible for specific types of charges, and the sequenc The business identifier for the instance: claim number, pre-determination or pre-authorization number. - + The status of the resource instance. - + The category of claim, eg, oral, pharmacy, vision, insitutional, professional. - + A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType. - + - The version of the specification on which this instance relies. + Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - + - The version of the specification from which the original instance was created. - - - - - The date when the enclosed suite of services were performed or completed. + Patient Resource. @@ -6813,9 +6877,19 @@ A coverage may only be resposible for specific types of charges, and the sequenc The billable period for which charges are being submitted. + + + The date when the enclosed suite of services were performed or completed. + + + + + Person who created the invoice/claim/pre-determination or pre-authorization. + + - The Insurer who is target of the request. + The Insurer who is target of the request. @@ -6828,31 +6902,16 @@ A coverage may only be resposible for specific types of charges, and the sequenc The organization which is responsible for the bill, claim pre-determination, pre-authorization. - - - Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - - - + Immediate (STAT), best effort (NORMAL), deferred (DEFER). - + 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. - - - Person who created the invoice/claim/pre-determination or pre-authorization. - - - - - Facility where the services were provided. - - Other claims which are related to this claim such as prior claim versions or for related services. @@ -6865,7 +6924,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. + Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'. @@ -6878,6 +6937,16 @@ A coverage may only be resposible for specific types of charges, and the sequenc The referral resource which lists the date, practitioner, reason and other supporting information. + + + Facility where the services were provided. + + + + + The members of the team who provided the overall service as well as their role and whether responsible and qualifications. + + Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required. @@ -6893,12 +6962,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Ordered list of patient procedures performed to support the adjudication. - - - Patient Resource. - - - + Financial instrument by which payment information for health care. @@ -6928,11 +6992,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc The total value of the claim. - - - A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. - - @@ -6949,7 +7008,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Other claims which are related to this claim such as prior claim versions or for related services. - + For example prior or umbrella. @@ -6970,7 +7029,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Type of Party to be reimbursed: Subscriber, provider, other. @@ -6989,6 +7048,42 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + 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. + + + + + + + Sequence of the careTeam which serves to order and provide a link. + + + + + Member of the team who provided the overall service. + + + + + The party who is billing and responsible for the claimed good or service rendered to the patient. + + + + + The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team. + + + + + The qualification which is applicable for this service. + + + + + + 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. @@ -6996,12 +7091,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + The general class of the information supplied: information; exception; accident, employment; onset, etc. - + System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication. @@ -7015,11 +7110,18 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Additional data. + Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. + + + + + For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content. + + @@ -7036,19 +7138,21 @@ A coverage may only be resposible for specific types of charges, and the sequenc Sequence of diagnosis which serves to order and provide a link. - + The diagnosis. - - - + + + + + The type of the Diagnosis, for example: admitting,. - + - The Diagnosis Related Group (DRG) code based on the assigned grouping code system. + The package billing code, for example DRG, based on the assigned grouping code system. @@ -7076,14 +7180,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc The procedure code. - + - + 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. @@ -7097,7 +7201,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated. @@ -7120,11 +7224,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Coverages adjudication details. - - - The style (standard) and version of the original material which was converted into this resource. - - @@ -7141,7 +7240,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Date of an accident which these services are addressing. - + Type of accident: work, auto, etc. @@ -7169,9 +7268,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc A service line number. - + - The members of the team who provided the overall service as well as their role and whether responsible and qualifications. + CareTeam applicable for this service or product line. @@ -7179,27 +7278,37 @@ A coverage may only be resposible for specific types of charges, and the sequenc Diagnosis applicable for this service or product line. - + + + Procedures applicable for this service or product line. + + + + + Exceptions, special conditions and supporting information pplicable for this service or product line. + + + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + - If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. + If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. - + For programs which require reason codes for the inclusion or covering of this billed item under the program or sub-program. @@ -7215,7 +7324,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Where the service was provided. - + @@ -7234,11 +7343,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc 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. - - - 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. - - The quantity times the unit price for an addittional 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. @@ -7249,12 +7353,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc List of Unique Device Identifiers associated with this line item. - + Physical service site on the patient (limb, tooth, etc). - + A region or surface of the site, eg. limb region or tooth surface(s). @@ -7273,37 +7377,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - 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. - - - - - - - Member of the team who provided the overall service. - - - - - The party who is billing and responsible for the claimed good or service rendered to the patient. - - - - - The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team. - - - - - The qualification which is applicable for this service. - - - - - - 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. @@ -7316,27 +7389,27 @@ A coverage may only be resposible for specific types of charges, and the sequenc A service line number. - + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. - + For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. @@ -7356,11 +7429,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc 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. - - - 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. - - The quantity times the unit price for an addittional 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. @@ -7392,27 +7460,27 @@ A coverage may only be resposible for specific types of charges, and the sequenc A service line number. - + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. - + For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. @@ -7432,11 +7500,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc 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. - - - 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. - - The quantity times the unit price for an addittional 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. @@ -7468,7 +7531,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Date of the initial placement. - + Material of the prior denture or bridge prosthesis. (Oral). @@ -7477,32 +7540,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - 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. - - - - - - - The code identifying which tooth is missing. - - - - - Missing reason may be: E-extraction, O-other. - - - - - The date of the extraction either known from records or patient reported estimate. - - - - - - @@ -7538,41 +7575,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - This resource provides the adjudication details from the processing of a Claim resource. @@ -7591,32 +7593,17 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Response business identifier. - + The status of the resource instance. - - - Original request resource referrence. - - - - - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - - - - - The style (standard) and version of the original material which was converted into this resource. - - The date when the enclosed suite of services were performed or completed. - + The Insurer who produced this adjudicated response. @@ -7631,7 +7618,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc The organization which is responsible for the services rendered to the patient. - + + + Original request resource referrence. + + + Processing outcome errror, partial or complete processing. @@ -7641,7 +7633,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc A description of the status of the adjudication. - + Party to be reimbursed: Subscriber, provider, other. @@ -7686,7 +7678,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Status of funds reservation (For provider, for Patient, None). - + The form to be used for printing the content. @@ -7696,7 +7688,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc Note text. - + + + Request for additional supporting or authorizing information, such as: documents, images or resources. + + + Financial instrument by which payment information for health care. @@ -7743,12 +7740,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. - + Adjudication reason such as limit reached. @@ -7836,22 +7833,22 @@ A coverage may only be resposible for specific types of charges, and the sequenc List of input service items which this service line is intended to replace. - + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + A code to indicate the Professional Service or Product supplied. - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. @@ -7887,22 +7884,22 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + A code to indicate the Professional Service or Product supplied. - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. @@ -7948,7 +7945,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. - + An error code,from a specified code system, which details why the claim could not be adjudicated. @@ -7964,7 +7961,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Whether this represents partial or complete payment of the claim. @@ -7974,7 +7971,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Adjustment to the payment of this transaction which is not related to adjudication of this transaction. - + Reason for the payment adjustment. @@ -8010,7 +8007,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc An integer associated with each note which may be referred to from each service line item. - + The note purpose: Print/Display. @@ -8020,7 +8017,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc The note text. - + The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. @@ -8029,7 +8026,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + This resource provides the adjudication details from the processing of a Claim resource. @@ -8070,41 +8067,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - 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. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. @@ -8207,7 +8169,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Actions taken during assessment. + Action taken as part of assessment procedure. @@ -8531,7 +8493,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts. + Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning. @@ -8643,9 +8605,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc Grouped By - + - Subsumes + Is-A @@ -9546,14 +9508,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc A copyright statement relating to the concept map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the concept map. - + The source value set that specifies the concepts that are being mapped. - + The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. @@ -9711,7 +9673,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc The clinical status of the condition. - + The verification status to support the clinical status of the condition. @@ -9767,9 +9729,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + - A date, when the Condition statement was documented. + The date on which the existance of the Condition was first asserted or acknowledged. @@ -10184,6 +10146,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc Unique identifier for this Contract. + + + The status of the resource instance. + + When this Contract was issued. @@ -10592,19 +10559,44 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + + + The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Certificate number, Personal Health Number or Case ID. May be constructed as the concatination of the Coverage.SubscriberID and the Coverage.dependant. + + + The status of the resource instance. - + - The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. + The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization. - + - A self, or other, payment agreement not an insurance policy. + The party who 'owns' the insurance policy, may be an individual, corporation or the subscriber's employer. + + + + + The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due. + + + + + The insurer assigned ID for the Subscriber. + + + + + The party who benefits from the insurance coverage., the patient when services are provided. + + + + + The relationship of beneficiary (patient) to the subscriber. @@ -10612,49 +10604,34 @@ A coverage may only be resposible for specific types of charges, and the sequenc Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. - + - The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. + The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. May provide multiple identifiers such as insurance company identifier or business identifier (BIN number). - - - The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. - - - - - The party who benefits from the insurance coverage. - - - - - The relationship of beneficiary (patient) (subscriber) to the the planholder. - - - - - The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID. - - - + A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan. - + A unique identifier for a dependent under the coverage. - + An optional counter for a particular instance of the identified coverage which increments upon each renewal. + + + The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care. + + - The identifier for a community of providers. + The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply. @@ -10666,38 +10643,74 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - + - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions + Financial instrument which may be used to pay for or reimburse health care products and services. - - + + + + + Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID. + + + + + A short description for the group. + + + + + Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group. + + + + + A short description for the subgroup. + + + + + Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID. + + + + + A short description for the plan. + + + + + Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees. + + + + + A short description for the subplan. + + + + + Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. + + + + + A short description for the class. + + + + + Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage or employer group. + + + + + A short description for the subclass. + + + @@ -11025,7 +11038,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Status of the Device availability. - + Code or identifier to identify a kind of device. @@ -11172,7 +11185,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular. - + Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. @@ -11217,7 +11230,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + @@ -11276,14 +11289,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Different measurement principle supported by the device. If the element is present, it must have either a @value, an @id, or extensions - + @@ -11705,13 +11718,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Indicates the site on the subject's body where the device was used ( i.e. the target site). - - - - + + The time period over which the device was used. @@ -11792,7 +11803,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc A code or name that describes this diagnostic report. - + The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources. @@ -11802,19 +11813,19 @@ A coverage may only be resposible for specific types of charges, and the sequenc The link to the health care event (encounter) when the order was made. - + The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. - + The date and time that this version of the report was released from the source diagnostic service. - + The diagnostic service that is responsible for issuing the report. @@ -11969,19 +11980,24 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Composite request this is part of. + A shared identifier common to all diagnostic requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier. - + The status of the order. - + Whether the request is a proposal, plan, an original order or a reflex order. + + + Indicates how quickly the {{title}} should be addressed with respect to other requests. + + A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. @@ -12005,7 +12021,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + When the request transitioned to being actionable. @@ -12025,9 +12041,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc The desired perfomer for doing the diagnostic testing. - + - An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation. + An explanation or justification for why this diagnostic investigation is being requested in coded or textual form. This is often for billing purposes. May relate to the resources referred to in supportingInformation. + + + + + Indicates another resource that provides a justification for why this diagnostic investigation is being requested. May relate to the resources referred to in supportingInformation. @@ -12413,12 +12434,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + This resource provides the details from the insurer to identify a specified coverage and optionally some class of service. - This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + This resource provides the details from the insurer to identify a specified coverage and optionally some class of service. If the element is present, it must have either a @value, an @id, or extensions @@ -12429,29 +12450,36 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Response business identifier. - + The status of the resource instance. - + - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + Immediate (STAT), best effort (NORMAL), deferred (DEFER). - + - The style (standard) and version of the original material which was converted into this resource. + Patient Resource. + + + The date or dates when the enclosed suite of services were performed or completed. + + + + The date when this resource was created. - + - The Insurer who is target of the request. + Person who created the invoice/claim/pre-determination or pre-authorization. @@ -12464,14 +12492,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc The organization which is responsible for the services rendered to the patient. - + - Immediate (STAT), best effort (NORMAL), deferred (DEFER). - - - - - Person who created the invoice/claim/pre-determination or pre-authorization. + The Insurer who is target of the request. @@ -12479,11 +12502,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc Facility where the services were provided. - - - Patient Resource. - - Financial instrument by which payment information for health care. @@ -12494,19 +12512,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc The contract number of a business agreement which describes the terms and conditions. - - - The date or dates when the enclosed suite of services were performed or completed. - - - - - + Dental, Vision, Medical, Pharmacy, Rehab etc. - + Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. @@ -12515,41 +12526,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - This resource provides eligibility and plan details from the processing of an Eligibility resource. @@ -12568,46 +12544,16 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Response business identifier. - + The status of the resource instance. - - - Original request resource reference. - - - - - Transaction status: error, complete. - - - - - A description of the status of the adjudication. - - - - - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - - - - - The style (standard) and version of the original material which was converted into this resource. - - The date when the enclosed suite of services were performed or completed. - - - The Insurer who produced this adjudicated response. - - The practitioner who is responsible for the services rendered to the patient. @@ -12618,31 +12564,72 @@ A coverage may only be resposible for specific types of charges, and the sequenc The organization which is responsible for the services rendered to the patient. + + + Original request resource reference. + + + + + Transaction status: error, complete. + + + + + A description of the status of the adjudication. + + + + + The Insurer who produced this adjudicated response. + + Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. + + + The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer. + + + + + The form to be used for printing the content. + + + + + Mutually exclusive with Services Provided (Item). + + + + + + + + + This resource provides eligibility and plan details from the processing of an Eligibility resource. + + + + + + + A suite of updated or additional Coverages from the Insurer. + + The contract resource which may provide more detailed information. - - - The form to be used for printing the content. - - Benefits and optionally current balances by Category. - - - Mutually exclusive with Services Provided (Item). - - @@ -12654,16 +12641,21 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Dental, Vision, Medical, Pharmacy, Rehab etc. - + Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. + + + True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage. + + A short name or tag for the benefit, for example MED01, or DENT2. @@ -12674,17 +12666,17 @@ A coverage may only be resposible for specific types of charges, and the sequenc A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'. - + Network designation. - + Unit designation: individual or family. - + The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'. @@ -12705,7 +12697,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Deductable, visits, benefit amount. @@ -12736,7 +12728,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + An error code,from a specified code system, which details why the eligibility check could not be performed. @@ -12745,41 +12737,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. @@ -13234,7 +13191,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - The status of the encounter. + The status of the endpoint If the element is present, it must have either a @value, an @id, or extensions @@ -13261,55 +13218,37 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Response business identifier. - + The status of the resource instance. - - - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - - - - - The style (standard) and version of the original material which was converted into this resource. - - The date when this resource was created. - + The Insurer who is target of the request. - - - - - + + + The practitioner who is responsible for the services rendered to the patient. - - - - - + + + The organization which is responsible for the services rendered to the patient. - - - - - + + + Patient Resource. - - - - - + + + Reference to the program or plan identification, underwriter or payor. @@ -13318,41 +13257,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - This resource provides enrollment and plan details from the processing of an Enrollment resource. @@ -13371,19 +13275,17 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Response business identifier. - + The status of the resource instance. - + Original request resource reference. - - - - - + + + Processing status: error, complete. @@ -13393,81 +13295,30 @@ A coverage may only be resposible for specific types of charges, and the sequenc A description of the status of the adjudication. - - - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - - - - - The style (standard) and version of the original material which was converted into this resource. - - The date when the enclosed suite of services were performed or completed. - + The Insurer who produced this adjudicated response. - - - - - + + + The practitioner who is responsible for the services rendered to the patient. - - - - - + + + The organization which is responsible for the services rendered to the patient. - - - - + + - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. @@ -13721,7 +13572,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). + Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains). @@ -13938,49 +13789,24 @@ A coverage may only be resposible for specific types of charges, and the sequenc The EOB Business Identifier. - + The status of the resource instance. - - - The insurer which is responsible for the explanation of benefit. - - - - - The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - - - - - The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - - - + The category of claim, eg, oral, pharmacy, vision, insitutional, professional. - + A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType. - + - The version of the specification on which this instance relies. - - - - - The version of the specification from which the original instance was created. - - - - - The date when the EOB was created. + Patient Resource. @@ -13988,14 +13814,19 @@ A coverage may only be resposible for specific types of charges, and the sequenc The billable period for which charges are being submitted. - + - Processing outcome errror, partial or complete processing. + The date when the EOB was created. - + - A description of the status of the adjudication. + The person who created the explanation of benefit. + + + + + The insurer which is responsible for the explanation of benefit. @@ -14008,11 +13839,36 @@ A coverage may only be resposible for specific types of charges, and the sequenc The provider which is responsible for the claim. + + + The referral resource which lists the date, practitioner, reason and other supporting information. + + Facility where the services were provided. + + + The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + + + + + The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + + + + + Processing outcome errror, partial or complete processing. + + + + + A description of the status of the adjudication. + + Other claims which are related to this claim such as prior claim versions or for related services. @@ -14025,7 +13881,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. + Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'. @@ -14033,16 +13889,16 @@ A coverage may only be resposible for specific types of charges, and the sequenc The party to be reimbursed for the services. - - - The referral resource which lists the date, practitioner, reason and other supporting information. - - Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required. + + + The members of the team who provided the overall service as well as their role and whether responsible and qualifications. + + Ordered list of patient diagnosis for which care is sought. @@ -14053,17 +13909,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc Ordered list of patient procedures performed to support the adjudication. - - - Patient Resource. - - Precedence (primary, secondary, etc.). - + Financial instrument by which payment information for health care. @@ -14093,11 +13944,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc The first tier service adjudications for payor added services. - - - A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. - - The total cost of the services reported. @@ -14118,7 +13964,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Payment details for the claim if the claim has been paid. - + The form to be used for printing the content. @@ -14149,7 +13995,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Other claims which are related to this claim such as prior claim versions or for related services. - + For example prior or umbrella. @@ -14170,12 +14016,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Type of Party to be reimbursed: Subscriber, provider, other. - + organization | patient | practitioner | relatedperson. @@ -14198,12 +14044,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + The general class of the information supplied: information; exception; accident, employment; onset, etc. - + System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication. @@ -14217,11 +14063,54 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Additional data. + Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. + + + + + For example, provides the reason for: the additional stay, or missing tooth or any other situation where a reason code is required in addition to the content. + + + + + + + + + This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. + + + + + + + Sequence of careteam which serves to order and provide a link. + + + + + The members of the team who provided the overall service. + + + + + The practitioner who is billing and responsible for the claimed services rendered to the patient. + + + + + The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team. + + + + + The qualification which is applicable for this service. + + @@ -14238,19 +14127,21 @@ A coverage may only be resposible for specific types of charges, and the sequenc Sequence of diagnosis which serves to order and provide a link. - + The diagnosis. - - - + + + + + The type of the Diagnosis, for example: admitting,. - + - The Diagnosis Related Group (DRG) code based on the assigned grouping code system. + The package billing code, for example DRG, based on the assigned grouping code system. @@ -14278,14 +14169,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc The procedure code. - + - + This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. @@ -14318,7 +14209,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Date of an accident which these services are addressing. - + Type of accident: work, auto, etc. @@ -14346,9 +14237,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc A service line number. - + - The members of the team who provided the overall service as well as their role and whether responsible and qualifications. + Careteam applicable for this service or product line. @@ -14356,27 +14247,37 @@ A coverage may only be resposible for specific types of charges, and the sequenc Diagnosis applicable for this service or product line. - + + + Procedures applicable for this service or product line. + + + + + Exceptions, special conditions and supporting information pplicable for this service or product line. + + + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. - + For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. @@ -14392,7 +14293,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Where the service was provided. - + @@ -14411,11 +14312,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc 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. - - - 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. - - The quantity times the unit price for an addittional 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. @@ -14426,12 +14322,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc List of Unique Device Identifiers associated with this line item. - + Physical service site on the patient (limb, tooth, etc). - + A region or surface of the site, eg. limb region or tooth surface(s). @@ -14460,37 +14356,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. - - - - - - - The members of the team who provided the overall service. - - - - - The practitioner who is billing and responsible for the claimed services rendered to the patient. - - - - - The lead, assisting or supervising practitioner and their discipline if a multidisiplinary team. - - - - - The qualification which is applicable for this service. - - - - - - This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. @@ -14498,12 +14363,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - + Adjudication reason such as limit reached. @@ -14534,32 +14399,32 @@ A coverage may only be resposible for specific types of charges, and the sequenc A service line number. - + The type of product or service. - + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. - + For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. @@ -14579,11 +14444,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc 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. - - - 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. - - The quantity times the unit price for an addittional 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. @@ -14625,32 +14485,32 @@ A coverage may only be resposible for specific types of charges, and the sequenc A service line number. - + The type of product or service. - + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. - + For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. @@ -14670,11 +14530,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc 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. - - - 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. - - The quantity times the unit price for an addittional 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. @@ -14716,7 +14571,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Date of the initial placement. - + Material of the prior denture or bridge prosthesis (Oral). @@ -14737,22 +14592,22 @@ A coverage may only be resposible for specific types of charges, and the sequenc List of input service items which this service line is intended to replace. - + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'. - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. @@ -14788,22 +14643,22 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + The type of reveneu or cost center providing the product and/or service. - + Health Care Service Type Codes to identify the classification of service or benefits. - + A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). - + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours. @@ -14827,32 +14682,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. - - - - - - - The code identifying which tooth is missing. - - - - - Missing reason may be: E-extraction, O-other. - - - - - The date of the extraction either known from records or patient reported estimate. - - - - - - This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. @@ -14860,7 +14689,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Whether this represents partial or complete payment of the claim. @@ -14870,7 +14699,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Adjustment to the payment of this transaction which is not related to adjudication of this transaction. - + Reason for the payment adjustment. @@ -14906,7 +14735,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc An integer associated with each note which may be referred to from each service line item. - + The note purpose: Print/Display. @@ -14916,7 +14745,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc The note text. - + The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. @@ -14932,16 +14761,21 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Dental, Vision, Medical, Pharmacy, Rehab etc. - + Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. + + + True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage. + + A short name or tag for the benefit, for example MED01, or DENT2. @@ -14952,17 +14786,17 @@ A coverage may only be resposible for specific types of charges, and the sequenc A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'. - + Network designation. - + Unit designation: individual or family. - + The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'. @@ -14983,7 +14817,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Deductable, visits, benefit amount. @@ -15724,7 +15558,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element. - + The actions, if any, produced by the evaluation of the artifact. @@ -15911,6 +15745,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. + + + Technical endpoints providing access to services operated for the specific healthcare services defined at this resource. + + @@ -16513,9 +16352,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc Indicates if the vaccination was or was not given. - + - True if this administration was reported rather than directly administered. + An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded. + + + + + The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine. @@ -16900,7 +16744,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version. + The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version. @@ -17307,7 +17151,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Describes a set of data that must be provided in order to be able to successfully perform the computations defined by the library. - + The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content. @@ -17873,6 +17717,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc The measure scoring type, e.g. proportion, CV. + + + If this is a composite measure, the scoring method used to combine the component measures to determine the composite score. + + The measure type, e.g. process, outcome. @@ -18061,6 +17910,41 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + + + Opportunity + + + + + All-or-nothing + + + + + Linear + + + + + Weighted + + + + + + + The composite scoring method of the measure + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + @@ -18073,11 +17957,26 @@ A coverage may only be resposible for specific types of charges, and the sequenc Outcome + + + Structure + + + + + Patient Reported Outcome + + + + + Composite + + - The type of measure + The type of measure (includes codes from 2.16.840.1.113883.1.11.20368) If the element is present, it must have either a @value, an @id, or extensions @@ -18822,8 +18721,8 @@ A coverage may only be resposible for specific types of charges, and the sequenc A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. - - + + @@ -18891,13 +18790,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans. The dosage instructions should reflect the dosage of the medication that was administered. - + A coded specification of the anatomic site where the medication first entered the body. For example, "left arm". - - - - + + A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc. @@ -19214,7 +19111,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc The date (and perhaps time) when the prescription was initially written. - + The healthcare professional responsible for authorizing the initial prescription. @@ -19405,9 +19302,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + - The person or animal who is/was taking the medication. + The person, animal or group who is/was taking the medication. @@ -19442,14 +19339,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc A code indicating why the medication was not taken. - + A reason for why the medication is being/was taken. - Condition that supports why the medication is being/was taken. + Condition or observation that supports why the medication is being/was taken. @@ -19542,7 +19439,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - A coded concept identifying where the medication included in the is expected to be consumed or administered + A coded concept identifying where the medication included in the medicationstatement is expected to be consumed or administered If the element is present, it must have either a @value, an @id, or extensions @@ -19581,6 +19478,185 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + + + + + Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An absolute URL that is used to identify this message definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this message definition is (or will be) published. The URL SHOULD include the major version of the message definition. For more information see [Technical and Business Versions](resource.html#versions). + + + + + The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable. + + + + + A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. + + + + + A short, descriptive, user-friendly title for the message definition. + + + + + The status of this message definition. Enables tracking the life-cycle of the content. + + + + + A flag to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + + + + + The date (and optionally time) when the message definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes. + + + + + The name of the individual or organization that published the message definition. + + + + + Contact details to assist a user in finding and communicating with the publisher. + + + + + A free text natural language description of the message definition from the consumer's perspective. + + + + + The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions. + + + + + A jurisdiction in which the message definition is intended to be used. + + + + + Explains why this message definition is needed and why it has been designed as it has. + + + + + A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition. + + + + + The MessageDefinition this new definition is a profile of. + + + + + Identifies a protocol or workflow that this MessageDefinition represents a step in. + + + + + A MessageDefinition that is superseded by this definition. + + + + + A coded identifier of a supported messaging event. + + + + + The impact of the content of the message. + + + + + Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge. + + + + + Indicates whether a response is required for this message. + + + + + Indicates what types of messages may be sent as an application-level response to this message. + + + + + + + + + Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + + + + + + + The kind of resource that must be the focus for this message. + + + + + A profile that reflects constraints for the focal resource (and potentially for related resources). + + + + + Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. + + + + + Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. + + + + + + + + + Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. + + + + + + + A reference to the message definition that must be adhered to by this supported response. + + + + + Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses). + + + + + + The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. @@ -21631,19 +21707,24 @@ A coverage may only be resposible for specific types of charges, and the sequenc The notice business identifier. - + The status of the resource instance. - + - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + Reference of resource for which payment is being made. - + - The style (standard) and version of the original material which was converted into this resource. + Reference of response to resource for which payment is being made. + + + + + The date when the above payment action occurrred. @@ -21666,65 +21747,15 @@ A coverage may only be resposible for specific types of charges, and the sequenc The organization which is responsible for the services rendered to the patient. - - - Reference of resource for which payment is being made. - - - - - Reference of response to resource for which payment is being made. - - - + The payment status, typically paid: payment sent, cleared: payment received. - - - The date when the above payment action occurrred. - - - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - This resource provides payment details and claim references supporting a bulk payment. @@ -21743,51 +21774,41 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Response business identifier. - + The status of the resource instance. - - - Original request resource reference. - - - - - Transaction status: error, complete. - - - - - A description of the status of the adjudication. - - - - - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - - - - - The style (standard) and version of the original material which was converted into this resource. - - - - - The date when the enclosed suite of services were performed or completed. - - The period of time for which payments have been gathered into this bulk payment for settlement. + + + The date when the enclosed suite of services were performed or completed. + + The Insurer who produced this adjudicated response. + + + Original request resource reference. + + + + + Transaction status: error, complete. + + + + + A description of the status of the adjudication. + + The practitioner who is responsible for the services rendered to the patient. @@ -21803,12 +21824,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc List of individual settlement amounts and the corresponding transaction. - + The form to be used for printing the content. - + Total payment amount. @@ -21829,7 +21850,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Code to indicate the nature of the payment, adjustment, funds advance, etc. @@ -21875,7 +21896,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + The note purpose: Print/Display. @@ -21889,41 +21910,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - Demographics and administrative information about a person independent of a specific health-related context. @@ -22236,9 +22222,19 @@ A coverage may only be resposible for specific types of charges, and the sequenc A description of when the action should be triggered. - + - An expression specifying whether or not the action is applicable in a given context. + An expression that describes applicability criteria, or start/stop conditions for the action. + + + + + Defines input data requirements for the action. + + + + + Defines the outputs of the action, if any. @@ -22322,6 +22318,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + The kind of condition. + + A brief, natural language description of the condition that effectively communicates the intended semantics. @@ -22620,6 +22621,36 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + + + Applicability + + + + + Start + + + + + Stop + + + + + + + Defines the kinds of conditions that can appear on actions + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + @@ -23381,36 +23412,26 @@ A coverage may only be resposible for specific types of charges, and the sequenc The ProcessRequest business identifier. - + The status of the resource instance. - - - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - - - - - The style (standard) and version of the original material which was converted into this resource. - - - + The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. - - - The date when this resource was created. - - The organization which is the target of the request. + + + The date when this resource was created. + + The practitioner who is responsible for the action specified in this request. @@ -23481,41 +23502,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -23569,36 +23555,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Response business identifier. - + The status of the resource instance. - - - Original request resource reference. - - - - - Transaction status: error, complete, held. - - - - - A description of the status of the adjudication or processing. - - - - - The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - - - - - The style (standard) and version of the original material which was converted into this resource. - - The date when the enclosed suite of services were performed or completed. @@ -23609,6 +23570,21 @@ A coverage may only be resposible for specific types of charges, and the sequenc The organization who produced this adjudicated response. + + + Original request resource reference. + + + + + Transaction status: error, complete, held. + + + + + A description of the status of the adjudication or processing. + + The practitioner who is responsible for the services rendered to the patient. @@ -23619,33 +23595,38 @@ A coverage may only be resposible for specific types of charges, and the sequenc The organization which is responsible for the services rendered to the patient. - + The form to be used for printing the content. - + Suite of processing note or additional requirements is the processing has been held. - + Processing errors. + + + Request for additional supporting or authorizing information, such as: documents, images or resources. + + - + This resource provides processing status, errors and notes from the processing of a resource. - + The note purpose: Print/Display. @@ -23659,41 +23640,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. @@ -23773,42 +23719,25 @@ A coverage may only be resposible for specific types of charges, and the sequenc The function of the agent with respect to the activity. - + The individual, device or organization that participated in the event. - - - + + + + + - The identity of the agent as known by the authorization system. - - - - - A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest. - - - - - - - - - Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. - - - - - + A reference to an application-usable description of the identity that is represented by the signature. + + + + + The type of relationship between agents. - - - An internal reference to another agent listed in this provenance by its identifier. - - @@ -23825,21 +23754,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc How the entity was used during the activity. - - - The type of the entity. If the entity is a resource, then this is a resource type. - - - + Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. - - - Human-readable description of the entity. - - The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. @@ -23949,7 +23868,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Identifies a how this question or group of questions is known in a particular terminology such as LOINC. + Identifies how this question or group of questions is known in a particular terminology such as LOINC. @@ -23973,14 +23892,28 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. + + + A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: + +* concept (ElementDefinition.code) +* type (ElementDefinition.type) +* required (ElementDefinition.min) +* repeats (ElementDefinition.max) +* maxLength (ElementDefinition.maxLength) +* options (ElementDefinition.binding) + +Any information provided in these elements overrides the information from the definition. + + - Identifies a how this group of questions is known in a particular terminology such as LOINC. + Terminology code that corresponds to this group or question (e.g. LOINC). @@ -23993,7 +23926,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc The name of a section, the text of a question or text content for a text item. - + Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). @@ -24035,7 +23968,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - The value that should be pre-populated when rendering the questionnaire for user input. + The value that should be defaulted when rendering the questionnaire for user input. @@ -24132,11 +24065,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc Display - - - Question - - Boolean @@ -24275,7 +24203,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Identifies the order, proposal or plan that is fulfilled in whole or in part by this Questionnaire. + Identifies the order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse. @@ -24334,11 +24262,16 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. + + + A reference to an [[[ElementDefinition]]] that provides the details for the item. + + Text that is displayed above the contents of the group or as the text of the question being answered. @@ -24782,7 +24715,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. - + + + An expression that describes applicability criteria, or start/stop conditions for the action. + + + A relationship to another action such as "before" or "30-60 minutes after start of". @@ -24795,6 +24733,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc + @@ -24845,6 +24784,37 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". + + + + + + + The kind of condition. + + + + + A brief, natural language description of the condition that effectively communicates the intended semantics. + + + + + The media type of the language for the expression. + + + + + An expression that returns true or false, indicating whether or not the condition is satisfied. + + + + + + A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". @@ -24873,6 +24843,296 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + + + + + A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifiers assigned to this research study by the sponsor or other systems. + + + + + A short, descriptive user-friendly label for the study. + + + + + The set of steps expected to be performed as part of the execution of the study. + + + + + A larger research study of which this particular study is a component or step. + + + + + The current state of the study. + + + + + Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc. + + + + + The condition(s), medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about. + + + + + Contact details to assist a user in learning more about or engaging with the study. + + + + + Citations, references and other related documents. + + + + + Key terms to aid in searching for or filtering the study. + + + + + Indicates a country, state or other region where the study is taking place. + + + + + A full description of how the study is being conducted. + + + + + Reference to a Group that defines the criteria for and quantity of subjects participating in the study. E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes". + + + + + Identifies the start date and the expected (or actual, depending on status) end date for the study. + + + + + The organization responsible for the execution of the study. + + + + + Indicates the individual who has primary oversite of the execution of the study. + + + + + Clinic, hospital or other healthcare location that is participating in the study. + + + + + A description and/or code explaining the premature termination of the study. + + + + + Comments made about the event by the performer, subject or other participants. + + + + + Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. + + + + + + + + + A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + + + + + + + Unique, human-readable label for this arm of the study. + + + + + E.g. Experimental, active comparator, placebo comparator. + + + + + A succinct description of the path through the study that would be followed by a subject adhering to this arm. + + + + + + + + + + + Draft + + + + + In-progress + + + + + Suspended + + + + + Stopped + + + + + Completed + + + + + Entered in error + + + + + + + Codes that convey the current status of the research study + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + + + + + A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. ResearchStudies involve the gathering of information about human or animal subjects. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifiers assigned to this research study by the sponsor or other systems. + + + + + The current state of the event. + + + + + The dates the subject began and ended their participation in the study. + + + + + Reference to the study the subject is participating in. + + + + + The record of the person or animal who is involved in the study. + + + + + The name of the arm in the study the subject is expected to follow as part of this study. + + + + + The name of the arm in the study the subject actually followed as part of this study. + + + + + A record of the patient's informed agreement to participate in the study. + + + + + + + + + + + Candidate + + + + + Enrolled + + + + + Active + + + + + Suspended + + + + + Withdrawn + + + + + Completed + + + + + + + Indicates the progression of a study subject through a study + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. @@ -25145,9 +25405,9 @@ A coverage may only be resposible for specific types of charges, and the sequenc The code used in the URL or the parameter name in a parameters resource for this search parameter. - + - The base resource type that this search parameter refers to. + The base resource type(s) that this search parameter can be used against. @@ -25155,6 +25415,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc The type of value a search parameter refers to, and how the content is interpreted. + + + Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter. + + A free text natural language description of the search parameter from the consumer's perspective. and how it used. @@ -25180,7 +25445,22 @@ A coverage may only be resposible for specific types of charges, and the sequenc Types of resource (if a resource is referenced). - + + + Comparators supported for the search parameter. + + + + + A modifier supported for the search parameter. + + + + + Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type. + + + Used to define the parts of a composite search parameter. @@ -25189,6 +25469,27 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + A search parameter that defines a named search item that can be used to search/filter on a resource. + + + + + + + The definition of the search parameter that describes this part. + + + + + A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression. + + + + + + @@ -25229,6 +25530,131 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + + + Missing + + + + + Exact + + + + + Contains + + + + + Not + + + + + Text + + + + + In + + + + + Not In + + + + + Below + + + + + Above + + + + + Type + + + + + + + A supported modifier for a search parameter. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Equals + + + + + Not Equals + + + + + Greater Than + + + + + Less Then + + + + + Greater or Equals + + + + + Less of Equal + + + + + Starts After + + + + + Ends Before + + + + + Approximately + + + + + + + What Search Comparator Codes are supported in search + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Raw data describing a biological sequence. @@ -25244,17 +25670,17 @@ A coverage may only be resposible for specific types of charges, and the sequenc - A unique identifier for this particular sequence instance. + A unique identifier for this particular sequence instance. This is a FHIR-defined id. - + - Amino acid / cDNA transcript / RNA variant. + Amino Acid Sequence/ DNA Sequence / RNA Sequence. - Whether the sequence is numbered starting at 0 (0-based numbering or coordinates) or starting at 1 (1-based numbering). Values are "0" for 0-based numbering and "1" for one-based. + Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end). @@ -25272,24 +25698,29 @@ A coverage may only be resposible for specific types of charges, and the sequenc The method for sequencing, for example, chip information. + + + The organization or lab that should be responsible for this result. + + - Quantity of the sequence. + The number of copies of the seqeunce of interest. (RNASeq). - A reference sequence is a sequence that is used to represent an allele or variant. + A sequence that is used as a reference to describe variants that are present in a sequence analyzed. - A' is a variant (mutation) of A = definition every instance of A' is either an immediate mutation of some instance of A, or there is a chain of immediate mutation processes linking A' to some instance of A ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). + The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string. - Sequence that was observed. + Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd. @@ -25304,7 +25735,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Configurations of the external repository. + Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq. @@ -25338,14 +25769,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. - + Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences. - A Pointer to another Sequence entity as refence sequence. + A Pointer to another Sequence entity as reference sequence. @@ -25353,19 +25784,19 @@ A coverage may only be resposible for specific types of charges, and the sequenc A Reference Sequence string. - + - Strand of DNA. Available values are "1" for the plus strand and "-1" for the minus strand. + Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative. - Start position (inclusive) of the window on the reference sequence. + Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. - End position (exclusive) of the window on the reference sequence. + End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. @@ -25381,22 +25812,22 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Start position (inclusive) of the variant on the reference sequence. + Start position of the variant on the reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive. - End position (exclusive) of the variant on the reference sequence. + End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. - An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. - An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. + An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. @@ -25420,6 +25851,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + INDEL / SNP / Undefined variant. + + Gold standard sequence used for comparing against. @@ -25427,12 +25863,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Start position (inclusive) of the sequence. + Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. - End position (exclusive) of the sequence. + End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. @@ -25496,6 +25932,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc + + + Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource. + + URI of an external repository which contains further details about the genetics data. @@ -25506,12 +25947,17 @@ A coverage may only be resposible for specific types of charges, and the sequenc URI of an external repository which contains further details about the genetics data. - + - Id of the variant in this external repository. + Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository. - + + + Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository. + + + Id of the read in this external repository. @@ -25565,12 +26011,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Structural Variant Outer Start-End. + Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive. - Structural Variant Outer Start-End. + Structural Variant Outer End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. @@ -25586,18 +26032,88 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Structural Variant Inner Start-End. + Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive. - Structural Variant Inner Start-End. + Structural Variant Inner End. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. + + + + + Click and see + + + + + The url is the RESTful or other kind of API that can get access to the result. + + + + + Result cannot be access unless an account is logged in + + + + + Result need to be fetched with API and need LOGIN( or cookies is required when visit the link of resource) + + + + + Some other complicated or particular way to get resource from url. + + + + + + + Type for access of external uri + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + INDEL Comparison + + + + + SNP Comparison + + + + + UNKNOWN Comparison + + + + + + + Type for quality report + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + @@ -26203,7 +26719,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.7.0 for this version. + The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.8.0 for this version. @@ -26218,7 +26734,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems. @@ -26681,6 +27197,21 @@ A coverage may only be resposible for specific types of charges, and the sequenc How to interpret the context. + + + Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content. + + + + + Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value). + + + + + Specified type for the element. This works as a condition on the mapping - use for polymorphic elements. + + Optional field for this source. @@ -27521,22 +28052,29 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + The business identifier for this task. + + + A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc. + + + + - Identifies a plan, proposal or order that this task has been created in fulfillment of. + BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a "request" resource such as a DiagnosticRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfil. This latter resource is referenced by FocusOn. For example, based on a DiagnosticRequest (= BasedOn), a task is created to fulfil a procedureRequest ( = FocusOn ) to collect a specimen from a patient. - + An identifier that links together multiple tasks and other requests that were created in the same context. - + Task that this particular task is part of. @@ -27556,21 +28094,21 @@ A coverage may only be resposible for specific types of charges, and the sequenc Contains business-specific nuances of the business state. - + Indicates the "level" of actionability associated with the Task. I.e. Is this a proposed task, a planned task, an actionable task, etc. + + + Indicates how quickly the Task should be addressed with respect to other requests. + + A name or code (or both) briefly describing what the task involves. - - - The priority of the task among other tasks of the same type. - - A free-text description of what is to be performed. @@ -27591,31 +28129,36 @@ A coverage may only be resposible for specific types of charges, and the sequenc The healthcare event (e.g. a patient and healthcare provider interaction) during which this task was created. - + + + Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end). + + + The date and time this task was created. - + The date and time of last modification to this task. - + The creator of the task. - - - The owner of this task. The participant who can execute this task. - - The type of participant that can execute the task. + + + The owner of this task. The participant who can execute this task. + + A description or code indicating why this task needs to be performed. @@ -27626,14 +28169,14 @@ A coverage may only be resposible for specific types of charges, and the sequenc Free-text information captured about the task as it progresses. - + - Identifies any limitations on what part of a referenced task subject request should be actioned. + Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task. - + - A reference to a formal or informal definition of the task. For example, a protocol, a step within a defined workflow definition, etc. + If the Task.focus is a request resource and the task is seeking fulfillment (i.e is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned. @@ -27650,7 +28193,28 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + + + A task to be performed. + + + + + + + The device, practitioner, etc. who initiated the task. + + + + + The organization the device or practitioner was acting on behalf of when they initiated the task. + + + + + + + A task to be performed. @@ -27667,7 +28231,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Over what time-period is fulfillment sought. - + For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought? @@ -27794,36 +28358,6 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Low - - - - - Normal - - - - - High - - - - - - - The task's priority - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -27856,6 +28390,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc Ready + + + Cancelled + + In Progress @@ -27876,6 +28415,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc Completed + + + Entered in Error + + @@ -28765,7 +29309,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + The type of the resource. See http://build.fhir.org/resourcelist.html. @@ -28942,7 +29486,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc - The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. + The type of the resource. See http://build.fhir.org/resourcelist.html. @@ -29499,7 +30043,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. + If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined. + + + + + Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included). @@ -29715,6 +30264,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + + + If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understnading legacy data. + + The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. @@ -29756,6 +30310,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc Is A (by subsumption) + + + Descendent Of (by subsumption) + + Not (Is A) (by subsumption) @@ -29781,6 +30340,11 @@ A coverage may only be resposible for specific types of charges, and the sequenc Generalizes (by Subsumption) + + + Exists + + @@ -29812,31 +30376,31 @@ A coverage may only be resposible for specific types of charges, and the sequenc Business identifier which may be used by other parties to reference or identify the prescription. - + The status of the resource instance. - - - The date (and perhaps time) when the prescription was written. - - A link to a resource representing the person to whom the vision products will be supplied. - - - The healthcare professional responsible for authorizing the prescription. - - A link to a resource that identifies the particular occurrence of contact between patient and health care provider. + + + The date (and perhaps time) when the prescription was written. + + + + + The healthcare professional responsible for authorizing the prescription. + + Can be the reason or the indication for writing the prescription. @@ -29860,12 +30424,12 @@ A coverage may only be resposible for specific types of charges, and the sequenc - + Identifies the type of vision correction product which is required for the patient. - + The eye for which the lens applies. @@ -29890,7 +30454,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Amount of prism to compensate for eye alignment in fractional units. - + The relative base, or reference lens edge, for the prism. @@ -29930,7 +30494,7 @@ A coverage may only be resposible for specific types of charges, and the sequenc Brand recommendations or restrictions. - + Notes for special requirements such as coatings and lens materials. @@ -29939,99 +30503,4 @@ A coverage may only be resposible for specific types of charges, and the sequenc - - - - - Up - - - - - Down - - - - - In - - - - - Out - - - - - - - A coded concept listing the base codes. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - - - - - - Active - - - - - Cancelled - - - - - Draft - - - - - Entered In Error - - - - - - - A code specifying the state of the resource instance. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - - - - - - Right Eye - - - - - Left Eye - - - - - - - A coded concept listing the eye codes. - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/flag.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/flag.sch index 80a3fb10572..6747a74d559 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/flag.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/flag.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/goal.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/goal.sch index 0b3c5515389..daa2cbcdd7c 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/goal.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/goal.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/group.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/group.sch index b88e54f2338..ecc2ab04b68 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/group.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/group.sch @@ -26,8 +26,7 @@ grp-1: Can only have members if group is "actual" - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/guidanceresponse.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/guidanceresponse.sch index 0be34a95ae9..a8077b56240 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/guidanceresponse.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/guidanceresponse.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -113,22 +112,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/healthcareservice.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/healthcareservice.sch index 1890ef232de..bc0f90e87d3 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/healthcareservice.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/healthcareservice.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -80,5 +79,14 @@ per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/imagingmanifest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/imagingmanifest.sch index 5f87ba84d77..9c38567d164 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/imagingmanifest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/imagingmanifest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/imagingstudy.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/imagingstudy.sch index 869c34ef94b..7594c2b6f00 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/imagingstudy.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/imagingstudy.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/immunization.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/immunization.sch index 17429850529..17f9693e06a 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/immunization.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/immunization.sch @@ -27,8 +27,7 @@ imm-1: If immunization was not administered (wasNotGiven=true) then there SHALL be no reaction nor explanation.reason present - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/immunizationrecommendation.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/immunizationrecommendation.sch index 745e22bb71a..73fa3fd1c6b 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/immunizationrecommendation.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/immunizationrecommendation.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/implementationguide.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/implementationguide.sch index 225d4ac52b9..3485932cdda 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/implementationguide.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/implementationguide.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/library.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/library.sch index 504e4dc3644..1501946bbb3 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/library.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/library.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -89,15 +88,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/linkage.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/linkage.sch index fb81f18d449..96a17da5d8f 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/linkage.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/linkage.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/list.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/list.sch index 437438c37ea..39378d25d65 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/list.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/list.sch @@ -27,8 +27,7 @@ lst-1: A list can only have an emptyReason if it is empty - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/location.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/location.sch index 730ce0c52b4..6f7479380e9 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/location.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/location.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/measure.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/measure.sch index 0b847f511a0..421c584defc 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/measure.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/measure.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/measurereport.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/measurereport.sch index 94e575ebf2f..5028404da9e 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/measurereport.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/measurereport.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/media.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/media.sch index 63a5da96619..f2c7828e5d2 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/media.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/media.sch @@ -29,8 +29,7 @@ mda-4: Duration can only be used for an audio or a video - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medication.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medication.sch index 690f06dd185..31b0884b59f 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medication.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medication.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationadministration.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationadministration.sch index f2ab15256da..daca235fc54 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationadministration.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationadministration.sch @@ -27,8 +27,7 @@ mad-3: Reason given is only permitted if NotGiven is false - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -79,7 +78,7 @@ ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end @@ -130,15 +129,6 @@ mad-1: SHALL have at least one of dosage.dose and dosage.rate[x] - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - qty-3: If a code for the unit is present, the system SHALL also be present diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationdispense.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationdispense.sch index bf6cef1624e..9f007728951 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationdispense.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationdispense.sch @@ -26,8 +26,7 @@ mdd-1: whenHandedOver cannot be before whenPrepared - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -136,6 +135,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -155,15 +156,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - rng-2: If present, low SHALL have a lower value than high diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationrequest.sch index 567d9f79f78..4ffdeefabc0 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationrequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -101,13 +100,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -135,6 +134,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -154,15 +155,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - rng-2: If present, low SHALL have a lower value than high diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationstatement.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationstatement.sch index cc589560921..5c5edf9b201 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationstatement.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/medicationstatement.sch @@ -26,8 +26,7 @@ mst-1: Reason not taken is only permitted if notTaken is Yes - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -51,13 +50,13 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -106,6 +105,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -125,15 +126,6 @@ per-1: If present, start SHALL have a lower value than end - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - rng-2: If present, low SHALL have a lower value than high diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/messagedefinition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/messagedefinition.sch new file mode 100644 index 00000000000..85b7582bb66 --- /dev/null +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/messagedefinition.sch @@ -0,0 +1,104 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + MessageDefinition + + dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative + dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + ext-1: Must have either extensions or value[x], not both + + + ext-1: Must have either extensions or value[x], not both + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + rng-2: If present, low SHALL have a lower value than high + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + md-1: Max must be postive int or * + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/messageheader.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/messageheader.sch index 9806f70d284..1615c1af89c 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/messageheader.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/messageheader.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/namingsystem.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/namingsystem.sch index e3c3a30be31..691b77695c6 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/namingsystem.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/namingsystem.sch @@ -28,8 +28,7 @@ nsd-2: Can't have more than one preferred identifier for a type - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/nutritionrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/nutritionrequest.sch index 7db941a23df..3d52f0577ee 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/nutritionrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/nutritionrequest.sch @@ -26,8 +26,7 @@ nor-1: Nutrition Order SHALL contain either Oral Diet , Supplement, or Enteral Formula class - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -85,6 +84,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -114,6 +115,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -146,6 +149,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/observation-genetics.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/observation-genetics.sch new file mode 100644 index 00000000000..77da1aebb0d --- /dev/null +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/observation-genetics.sch @@ -0,0 +1,90 @@ + + + + + + + f:Observation + + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsDNASequenceVariantType': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsAminoAcidChangeName': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsAminoAcidChangeType': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsGene': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsAlleleName': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsAllelicState': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsAllelicFrequency': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsCopyNumberEvent': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsPhaseSet': maximum cardinality of 'extension' is 1 + extension with URL = 'http://hl7.org/fhir/StructureDefinition/observation-geneticsInterpretation': maximum cardinality of 'extension' is 1 + + + + Observation + + If the resource is contained in another resource, it SHALL NOT contain nested Resources (inherited) + If the resource is contained in another resource, it SHALL NOT contain any narrative (inherited) + If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated (inherited) + If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource (inherited) + If code is the same as a component code then the value element associated with the code SHALL NOT be present (inherited) + dataAbsentReason SHALL only be present if Observation.value[x] is not present (inherited) + + + + Observation.extension + + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + All FHIR elements must have a @value or children (inherited) + Must have either extensions or value[x], not both (inherited) + + + + Observation.referenceRange + + All FHIR elements must have a @value or children (inherited) + Must have at least a low or a high or text (inherited) + + + + Observation.related + + All FHIR elements must have a @value or children (inherited) + + + + Observation.component + + All FHIR elements must have a @value or children (inherited) + + + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/observation.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/observation.sch index 8128fe6b34b..4dd51c738c3 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/observation.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/observation.sch @@ -27,8 +27,7 @@ obs-6: dataAbsentReason SHALL only be present if Observation.value[x] is not present - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/operationdefinition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/operationdefinition.sch index 01eeeeab7f0..56714b7dd30 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/operationdefinition.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/operationdefinition.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/operationoutcome.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/operationoutcome.sch index b61fc19bb95..b6fb27bb622 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/operationoutcome.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/operationoutcome.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/organization.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/organization.sch index f02104d216d..961e48c112d 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/organization.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/organization.sch @@ -26,8 +26,7 @@ org-1: The organization SHALL at least have a name or an id, and possibly more than one - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/patient.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/patient.sch index fbd60c5d998..3c2e6c6ea63 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/patient.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/patient.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/paymentnotice.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/paymentnotice.sch index 33fe4945388..0840058457a 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/paymentnotice.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/paymentnotice.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,6 +40,24 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -68,23 +85,5 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/paymentreconciliation.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/paymentreconciliation.sch index db0c02bdc70..68e519dc5bf 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/paymentreconciliation.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/paymentreconciliation.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,15 +40,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - per-1: If present, start SHALL have a lower value than end @@ -62,6 +52,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/person.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/person.sch index 2358337a0fc..a67efc83368 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/person.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/person.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/plandefinition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/plandefinition.sch index 057f55dcf3d..133bce023a7 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/plandefinition.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/plandefinition.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -114,6 +113,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -142,15 +143,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -166,6 +158,36 @@ drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. + per-1: If present, start SHALL have a lower value than end @@ -206,6 +228,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/practitioner.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/practitioner.sch index 2082c042ee1..7926bbd74cd 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/practitioner.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/practitioner.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/practitionerrole.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/practitionerrole.sch index c6b74dbab5e..02b588143aa 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/practitionerrole.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/practitionerrole.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/procedure.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/procedure.sch index ff40ec8b94f..e8ab8aa8026 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/procedure.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/procedure.sch @@ -26,8 +26,7 @@ pro-1: Reason not performed is only permitted if notPerformed indicator is true - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/procedurerequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/procedurerequest.sch index 63b76c4c317..b74a7e046a9 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/procedurerequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/procedurerequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -69,6 +68,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/processrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/processrequest.sch index 7f7691bf04a..e0f4e6a3bbf 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/processrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/processrequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/processresponse.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/processresponse.sch index 09ac9791f86..7259178bea7 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/processresponse.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/processresponse.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -41,15 +40,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -59,6 +49,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -77,5 +76,14 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/provenance.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/provenance.sch index b2272ca15f5..cb429975f5c 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/provenance.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/provenance.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -56,19 +55,31 @@ ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + + ref-1: SHALL have a contained resource if a local reference is provided + + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/questionnaire.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/questionnaire.sch index a3cc2fac671..3f68b263eeb 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/questionnaire.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/questionnaire.sch @@ -26,8 +26,7 @@ que-2: The link ids for groups and questions must be unique within the questionnaire - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -57,6 +56,7 @@ que-3: Display items cannot have a "concept" asserted que-10: Maximum length can only be declared for simple question types que-1: Group items must have nested items, display items cannot have nested items + que-11: Type is required if a definition is not provided que-7: enableWhen must contain either an 'answer' or an 'answered' element diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/questionnaireresponse.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/questionnaireresponse.sch index 024d475004c..20e436f08f1 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/questionnaireresponse.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/questionnaireresponse.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -104,6 +103,9 @@ ref-1: SHALL have a contained resource if a local reference is provided + + qrs-1: Nested item can't be beneath both item and answer + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/referralrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/referralrequest.sch index aa8ee6165e2..bd3bd78f725 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/referralrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/referralrequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/relatedperson.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/relatedperson.sch index 65e75acae8c..286ad02e9c2 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/relatedperson.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/relatedperson.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/requestgroup.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/requestgroup.sch index 4cbc0f621a4..cb323dcce26 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/requestgroup.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/requestgroup.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -86,6 +85,9 @@ ref-1: SHALL have a contained resource if a local reference is provided + + rqg-1: Must have resource or action but not both + per-1: If present, start SHALL have a lower value than end @@ -137,6 +139,34 @@ qty-3: If a code for the unit is present, the system SHALL also be present + + tim-9: If there's an offset, there must be a when + tim-5: period SHALL be a non-negative value + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-8: If there's a countMax, there must be a count + tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period + tim-2: if there's a period, there needs to be period units + tim-3: Either frequency or when can exist, not both + tim-4: duration SHALL be a non-negative value + + + drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. + + + rng-2: If present, low SHALL have a lower value than high + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + qty-3: If a code for the unit is present, the system SHALL also be present + + + per-1: If present, start SHALL have a lower value than end + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/researchstudy.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/researchstudy.sch new file mode 100644 index 00000000000..d2303241f4f --- /dev/null +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/researchstudy.sch @@ -0,0 +1,128 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ResearchStudy + + dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative + dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + ext-1: Must have either extensions or value[x], not both + + + ext-1: Must have either extensions or value[x], not both + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/researchsubject.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/researchsubject.sch new file mode 100644 index 00000000000..eb19470dda3 --- /dev/null +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/researchsubject.sch @@ -0,0 +1,74 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ResearchSubject + + dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative + dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + ext-1: Must have either extensions or value[x], not both + + + ext-1: Must have either extensions or value[x], not both + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/riskassessment.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/riskassessment.sch index 452d8070f6f..21bd43145f2 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/riskassessment.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/riskassessment.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/schedule.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/schedule.sch index d4724b85e27..6e988cce72b 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/schedule.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/schedule.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/searchparameter.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/searchparameter.sch index 8d445c3a12f..35cc889cce9 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/searchparameter.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/searchparameter.sch @@ -24,10 +24,10 @@ dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource spd-1: If an xpath is present, there SHALL be an xpathUsage + spd-2: Search parameters can only have chain names when the search parameter type is 'reference' - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -54,13 +54,13 @@ qty-3: If a code for the unit is present, the system SHALL also be present - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/sequence.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/sequence.sch index 03d98fec60f..17eca4371fe 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/sequence.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/sequence.sch @@ -23,10 +23,10 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + seq-3: Only 0 and 1 are valid for coordinateSystem - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -68,9 +68,23 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + qty-3: If a code for the unit is present, the system SHALL also be present + + seq-4: Only +1 and -1 are valid for strand + seq-5: GenomeBuild and chromosome must be both contained if either one of them is contained + seq-6: Have and only have one of the following elements in referenceSeq : 1. genomeBuild ; 2 referenceSeqId; 3. referenceSeqPointer; 4. referenceSeqString; + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/servicedefinition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/servicedefinition.sch index 0c433bb0fe3..6b2494519d9 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/servicedefinition.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/servicedefinition.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -87,6 +86,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value @@ -115,15 +116,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -139,15 +131,6 @@ drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/shareablevalueset.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/shareablevalueset.sch index 1a49e5e450e..f635ed4b4fe 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/shareablevalueset.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/shareablevalueset.sch @@ -40,7 +40,7 @@ ValueSet.compose.include All FHIR elements must have a @value or children (inherited) - A value set with concepts or filters SHALL include a system (inherited) + A value set with concepts or filters SHALL include a system (inherited) Cannot have both concept and filter (inherited) A value set include/exclude SHALL have a value set or a system (inherited) diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/slot.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/slot.sch index d6df9b87aed..81fe2b77f1d 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/slot.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/slot.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/specimen.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/specimen.sch index 0e5a2a94375..18702c450d9 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/specimen.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/specimen.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/structuredefinition.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/structuredefinition.sch index 2eecc202d26..0b6d254f38a 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/structuredefinition.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/structuredefinition.sch @@ -32,14 +32,13 @@ sdf-11: If there's a type, its content must match the path name in the first element of a snapshot sdf-14: All element definitions must have an id sdf-1: Element paths must be unique unless the structure is a constraint - sdf-7: If the structure describes a base Resource or Type, the URL has to start with "http://hl7.org/fhir/StructureDefinition/" and the tail must match the id + sdf-7: If the structure describes a base Resource or Type, the URL has to start with "http://hl7.org/fhir/StructureDefinition/" and the tail must match the id sdf-6: A structure must have either a differential, or a snapshot (or both) sdf-5: If the structure defines an extension then the structure must have context information sdf-4: If the structure is not abstract, then there SHALL be a baseDefinition - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -73,7 +72,7 @@ qty-3: If a code for the unit is present, the system SHALL also be present - sdf-2: Must have at a name or a uri (or both) + sdf-2: Must have at least a name or a uri (or both) sdf-15: The first element in a snapshot has no type @@ -109,7 +108,7 @@ eld-10: provide either a reference or a description (or both) - eld-12: ValueSet as a URI SHALL start with http:// or https:// urn: + eld-12: ValueSet as a URI SHALL start with http:// or https:// or urn: ref-1: SHALL have a contained resource if a local reference is provided @@ -122,6 +121,7 @@ sdf-15a: If the first element in a differential has no "." in the path, it has no type + sdf-20: No slicing on the root element sdf-8a: In any differential, all the elements must be in the specified type @@ -153,7 +153,7 @@ eld-10: provide either a reference or a description (or both) - eld-12: ValueSet as a URI SHALL start with http:// or https:// urn: + eld-12: ValueSet as a URI SHALL start with http:// or https:// or urn: ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/structuremap.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/structuremap.sch index 4524b05e973..8bd731274f3 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/structuremap.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/structuremap.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/subscription.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/subscription.sch index 4210288ed12..fb783d8c177 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/subscription.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/subscription.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/substance.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/substance.sch index 801e5875070..961044f6d20 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/substance.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/substance.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/supplydelivery.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/supplydelivery.sch index 51936fedef7..bcc9a0967c7 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/supplydelivery.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/supplydelivery.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/supplyrequest.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/supplyrequest.sch index 5bcb9d2e6de..d68f90ad151 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/supplyrequest.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/supplyrequest.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -93,6 +92,8 @@ tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units + tim-10: If there's a timeOfDay, there cannot be be a when, a frequency, or a period + tim-11: If there's a dayOfWeek, there cannot be be a frequency, or a period tim-2: if there's a period, there needs to be period units tim-3: Either frequency or when can exist, not both tim-4: duration SHALL be a non-negative value diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/task.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/task.sch index 150c5e59777..664f3c52172 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/task.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/task.sch @@ -23,11 +23,10 @@ dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - inv-1: Last modified date must be greater than or equal to created date. + inv-1: Last modified date must be greater than or equal to authored-on date. - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -42,6 +41,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided @@ -51,19 +59,19 @@ ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + ref-1: SHALL have a contained resource if a local reference is provided @@ -93,13 +101,25 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided @@ -120,16 +140,25 @@ ref-1: SHALL have a contained resource if a local reference is provided - - per-1: If present, start SHALL have a lower value than end - - + ref-1: SHALL have a contained resource if a local reference is provided - + per-1: If present, start SHALL have a lower value than end - + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/testreport.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/testreport.sch index 9ffbc62e19b..b466efbe2a7 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/testreport.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/testreport.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/testscript.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/testscript.sch index 82b5ab81b85..73f9e809e85 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/testscript.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/testscript.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/valueset.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/valueset.sch index 84a684775cf..221b74ddefe 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/valueset.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/valueset.sch @@ -26,8 +26,7 @@ vsd-5: Value set SHALL contain at least one of a a compose, or an expansion element - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/visionprescription.sch b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/visionprescription.sch index 53750c9d7f9..a13acfde4c2 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/visionprescription.sch +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/schema/visionprescription.sch @@ -25,8 +25,7 @@ dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource - txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes - txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content @@ -50,15 +49,6 @@ ref-1: SHALL have a contained resource if a local reference is provided - - ref-1: SHALL have a contained resource if a local reference is provided - - - per-1: If present, start SHALL have a lower value than end - - - ref-1: SHALL have a contained resource if a local reference is provided - ref-1: SHALL have a contained resource if a local reference is provided @@ -68,6 +58,15 @@ ref-1: SHALL have a contained resource if a local reference is provided + + ref-1: SHALL have a contained resource if a local reference is provided + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a contained resource if a local reference is provided + ref-1: SHALL have a contained resource if a local reference is provided diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/v2-tables.xml b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/v2-tables.xml index 47f491cda01..c10b87248a2 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/v2-tables.xml +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/v2-tables.xml @@ -1,7 +1,7 @@ - + @@ -20,11 +20,12 @@ - + + @@ -49,11 +50,12 @@ - + + @@ -78,11 +80,12 @@ - + + @@ -107,11 +110,12 @@ - + + @@ -136,11 +140,12 @@ - + + @@ -165,11 +170,12 @@ - + + @@ -194,11 +200,12 @@ - + + @@ -223,11 +230,12 @@ - + + @@ -252,11 +260,12 @@ - + + @@ -281,11 +290,12 @@ - + + @@ -310,11 +320,12 @@ - + + @@ -339,11 +350,12 @@ - + + @@ -368,11 +380,12 @@ - + + @@ -397,11 +410,12 @@ - + + @@ -426,11 +440,12 @@ - + + @@ -455,11 +470,12 @@ - + + @@ -484,11 +500,12 @@ - + + @@ -513,11 +530,12 @@ - + + @@ -542,11 +560,12 @@ - + + @@ -571,11 +590,12 @@ - + + @@ -600,11 +620,12 @@ - + + @@ -629,11 +650,12 @@ - + + @@ -658,11 +680,12 @@ - + + @@ -687,11 +710,12 @@ - + + @@ -716,11 +740,12 @@ - + + @@ -745,11 +770,12 @@ - + + @@ -774,11 +800,12 @@ - + + @@ -803,11 +830,12 @@ - + + @@ -832,11 +860,12 @@ - + + @@ -861,11 +890,12 @@ - + + @@ -890,11 +920,12 @@ - + + @@ -919,11 +950,12 @@ - + + @@ -948,11 +980,12 @@ - + + @@ -977,11 +1010,12 @@ - + + @@ -1006,11 +1040,12 @@ - + + @@ -1035,11 +1070,12 @@ - + + @@ -1064,11 +1100,12 @@ - + + @@ -1093,11 +1130,12 @@ - + + @@ -1122,11 +1160,12 @@ - + + @@ -1151,11 +1190,12 @@ - + + @@ -1180,11 +1220,12 @@ - + + @@ -1209,11 +1250,12 @@ - + + @@ -1238,11 +1280,12 @@ - + + @@ -1267,11 +1310,12 @@ - + + @@ -1296,11 +1340,12 @@ - + + @@ -1325,11 +1370,12 @@ - + + @@ -1354,11 +1400,12 @@ - + + @@ -1383,11 +1430,12 @@ - + + @@ -1412,11 +1460,12 @@ - + + @@ -1441,11 +1490,12 @@ - + + @@ -1470,11 +1520,12 @@ - + + @@ -1499,11 +1550,12 @@ - + + @@ -1528,11 +1580,12 @@ - + + @@ -1557,11 +1610,12 @@ - + + @@ -1586,11 +1640,12 @@ - + + @@ -1615,11 +1670,12 @@ - + + @@ -1644,11 +1700,12 @@ - + + @@ -1673,11 +1730,12 @@ - + + @@ -1702,11 +1760,12 @@ - + + @@ -1731,11 +1790,12 @@ - + + @@ -1760,11 +1820,12 @@ - + + @@ -1789,11 +1850,12 @@ - + + @@ -1818,11 +1880,12 @@ - + + @@ -1847,11 +1910,12 @@ - + + @@ -1876,11 +1940,12 @@ - + + @@ -1905,11 +1970,12 @@ - + + @@ -1934,11 +2000,12 @@ - + + @@ -1963,11 +2030,12 @@ - + + @@ -1992,11 +2060,12 @@ - + + @@ -2021,11 +2090,12 @@ - + + @@ -2050,11 +2120,12 @@ - + + @@ -2079,11 +2150,12 @@ - + + @@ -2108,11 +2180,12 @@ - + + @@ -2137,11 +2210,12 @@ - + + @@ -2166,11 +2240,12 @@ - + + @@ -2195,11 +2270,12 @@ - + + @@ -2224,11 +2300,12 @@ - + + @@ -2253,11 +2330,12 @@ - + + @@ -2282,11 +2360,12 @@ - + + @@ -2311,11 +2390,12 @@ - + + @@ -2340,11 +2420,12 @@ - + + @@ -2369,11 +2450,12 @@ - + + @@ -2398,11 +2480,12 @@ - + + @@ -2427,11 +2510,12 @@ - + + @@ -2456,11 +2540,12 @@ - + + @@ -2485,11 +2570,12 @@ - + + @@ -2514,11 +2600,12 @@ - + + @@ -2543,11 +2630,12 @@ - + + @@ -2572,11 +2660,12 @@ - + + @@ -2601,11 +2690,12 @@ - + + @@ -2630,11 +2720,12 @@ - + + @@ -2659,11 +2750,12 @@ - + + @@ -2688,11 +2780,12 @@ - + + @@ -2717,11 +2810,12 @@ - + + @@ -2746,11 +2840,12 @@ - + + @@ -2775,11 +2870,12 @@ - + + @@ -2804,11 +2900,12 @@ - + + @@ -2833,11 +2930,12 @@ - + + @@ -2862,11 +2960,12 @@ - + + @@ -2891,11 +2990,12 @@ - + + @@ -2920,11 +3020,12 @@ - + + @@ -2949,11 +3050,12 @@ - + + @@ -2978,11 +3080,12 @@ - + + @@ -3007,11 +3110,12 @@ - + + @@ -3036,11 +3140,12 @@ - + + @@ -3065,11 +3170,12 @@ - + + @@ -3094,11 +3200,12 @@ - + + @@ -3123,11 +3230,12 @@ - + + @@ -3152,11 +3260,12 @@ - + + @@ -3181,11 +3290,12 @@ - + + @@ -3210,11 +3320,12 @@ - + + @@ -3239,11 +3350,12 @@ - + + @@ -3268,11 +3380,12 @@ - + + @@ -3297,11 +3410,12 @@ - + + @@ -3326,11 +3440,12 @@ - + + @@ -3355,11 +3470,12 @@ - + + @@ -3384,11 +3500,12 @@ - + + @@ -3413,11 +3530,12 @@ - + + @@ -3442,11 +3560,12 @@ - + + @@ -3471,11 +3590,12 @@ - + + @@ -3500,7 +3620,7 @@ - + @@ -3589,11 +3709,12 @@ - + + @@ -3618,11 +3739,12 @@ - + + @@ -3647,11 +3769,12 @@ - + + @@ -3676,11 +3799,12 @@ - + + @@ -3705,11 +3829,12 @@ - + + @@ -3734,11 +3859,12 @@ - + + @@ -3763,11 +3889,12 @@ - + + @@ -3792,11 +3919,12 @@ - + + @@ -3821,11 +3949,12 @@ - + + @@ -3850,11 +3979,12 @@ - + + @@ -3879,11 +4009,12 @@ - + + @@ -3908,11 +4039,12 @@ - + + @@ -3937,11 +4069,12 @@ - + + @@ -3966,11 +4099,12 @@ - + + @@ -3995,11 +4129,12 @@ - + + @@ -4024,11 +4159,12 @@ - + + @@ -4053,11 +4189,12 @@ - + + @@ -4082,11 +4219,12 @@ - + + @@ -4111,11 +4249,12 @@ - + + @@ -4140,11 +4279,12 @@ - + + @@ -4169,11 +4309,12 @@ - + + @@ -4198,11 +4339,12 @@ - + + @@ -4227,11 +4369,12 @@ - + + @@ -4256,11 +4399,12 @@ - + + @@ -4285,11 +4429,12 @@ - + + @@ -4314,11 +4459,12 @@ - + + @@ -4343,11 +4489,12 @@ - + + @@ -4372,11 +4519,12 @@ - + + @@ -4401,11 +4549,12 @@ - + + @@ -4430,11 +4579,12 @@ - + + @@ -4459,11 +4609,12 @@ - + + @@ -4488,11 +4639,12 @@ - + + @@ -4517,11 +4669,12 @@ - + + @@ -4546,11 +4699,12 @@ - + + @@ -4575,11 +4729,12 @@ - + + @@ -4604,11 +4759,12 @@ - + + @@ -4633,11 +4789,12 @@ - + + @@ -4662,11 +4819,12 @@ - + + @@ -4691,11 +4849,12 @@ - + + @@ -4720,11 +4879,12 @@ - + + @@ -4749,11 +4909,12 @@ - + + @@ -4778,11 +4939,12 @@ - + + @@ -4807,11 +4969,12 @@ - + + @@ -4836,11 +4999,12 @@ - + + @@ -4865,11 +5029,12 @@ - + + @@ -4894,11 +5059,12 @@ - + + @@ -4923,11 +5089,12 @@ - + + @@ -4952,11 +5119,12 @@ - + + @@ -4981,11 +5149,12 @@ - + + @@ -5010,11 +5179,12 @@ - + + @@ -5039,11 +5209,12 @@ - + + @@ -5068,11 +5239,12 @@ - + + @@ -5097,11 +5269,12 @@ - + + @@ -5126,11 +5299,12 @@ - + + @@ -5155,11 +5329,12 @@ - + + @@ -5184,11 +5359,12 @@ - + + @@ -5213,11 +5389,12 @@ - + + @@ -5242,11 +5419,12 @@ - + + @@ -5271,7 +5449,7 @@ - + @@ -5699,11 +5877,12 @@ - + + @@ -5728,11 +5907,12 @@ - + + @@ -5757,11 +5937,12 @@ - + + @@ -5786,11 +5967,12 @@ - + + @@ -5815,11 +5997,12 @@ - + + @@ -5844,11 +6027,12 @@ - + + @@ -5873,11 +6057,12 @@ - + + @@ -5902,11 +6087,12 @@ - + + @@ -5931,11 +6117,12 @@ - + + @@ -5960,11 +6147,12 @@ - + + @@ -5989,11 +6177,12 @@ - + + @@ -6018,11 +6207,12 @@ - + + @@ -6047,11 +6237,12 @@ - + + @@ -6076,11 +6267,12 @@ - + + @@ -6105,11 +6297,12 @@ - + + @@ -6134,11 +6327,12 @@ - + + @@ -6163,11 +6357,12 @@ - + + @@ -6192,11 +6387,12 @@ - + + @@ -6221,7 +6417,7 @@ - + @@ -6262,11 +6458,12 @@ - + + @@ -6291,11 +6488,12 @@ - + + @@ -6320,11 +6518,12 @@ - + + @@ -6349,11 +6548,12 @@ - + + @@ -6378,11 +6578,12 @@ - + + @@ -6407,11 +6608,12 @@ - + + @@ -6436,11 +6638,12 @@ - + + @@ -6465,11 +6668,12 @@ - + + @@ -6494,11 +6698,12 @@ - + + @@ -6523,11 +6728,12 @@ - + + @@ -6552,11 +6758,12 @@ - + + @@ -6581,11 +6788,12 @@ - + + @@ -6610,11 +6818,12 @@ - + + @@ -6639,11 +6848,12 @@ - + + @@ -6668,11 +6878,12 @@ - + + @@ -6697,11 +6908,12 @@ - + + @@ -6726,11 +6938,12 @@ - + + @@ -6755,11 +6968,12 @@ - + + @@ -6784,11 +6998,12 @@ - + + @@ -6813,11 +7028,12 @@ - + + @@ -6842,11 +7058,12 @@ - + + @@ -6871,11 +7088,12 @@ - + + @@ -6900,11 +7118,12 @@ - + + @@ -6929,11 +7148,12 @@ - + + @@ -6958,11 +7178,12 @@ - + + @@ -6987,11 +7208,12 @@ - + + @@ -7016,11 +7238,12 @@ - + + @@ -7045,11 +7268,12 @@ - + + @@ -7074,11 +7298,12 @@ - + + @@ -7103,11 +7328,12 @@ - + + @@ -7132,11 +7358,12 @@ - + + @@ -7161,11 +7388,12 @@ - + + @@ -7190,11 +7418,12 @@ - + + @@ -7219,11 +7448,12 @@ - + + @@ -7248,11 +7478,12 @@ - + + @@ -7277,11 +7508,12 @@ - + + @@ -7306,11 +7538,12 @@ - + + @@ -7335,11 +7568,12 @@ - + + @@ -7364,11 +7598,12 @@ - + + @@ -7393,11 +7628,12 @@ - + + @@ -7422,11 +7658,12 @@ - + + @@ -7451,11 +7688,12 @@ - + + @@ -7480,11 +7718,12 @@ - + + @@ -7509,11 +7748,12 @@ - + + @@ -7538,11 +7778,12 @@ - + + @@ -7567,11 +7808,12 @@ - + + @@ -7596,11 +7838,12 @@ - + + @@ -7625,11 +7868,12 @@ - + + @@ -7654,11 +7898,12 @@ - + + @@ -7683,11 +7928,12 @@ - + + @@ -7712,11 +7958,12 @@ - + + @@ -7741,11 +7988,12 @@ - + + @@ -7770,11 +8018,12 @@ - + + @@ -7799,11 +8048,12 @@ - + + @@ -7828,11 +8078,12 @@ - + + @@ -7857,11 +8108,12 @@ - + + @@ -7886,11 +8138,12 @@ - + + @@ -7915,11 +8168,12 @@ - + + @@ -7944,11 +8198,12 @@ - + + @@ -7973,11 +8228,12 @@ - + + @@ -8002,11 +8258,12 @@ - + + @@ -8031,11 +8288,12 @@ - + + @@ -8060,11 +8318,12 @@ - + + @@ -8089,11 +8348,12 @@ - + + @@ -8118,11 +8378,12 @@ - + + @@ -8147,11 +8408,12 @@ - + + @@ -8176,11 +8438,12 @@ - + + @@ -8205,11 +8468,12 @@ - + + @@ -8234,11 +8498,12 @@ - + + @@ -8263,11 +8528,12 @@ - + + @@ -8292,11 +8558,12 @@ - + + @@ -8321,11 +8588,12 @@ - + + @@ -8350,11 +8618,12 @@ - + + @@ -8379,11 +8648,12 @@ - + + @@ -8408,11 +8678,12 @@ - + + @@ -8437,11 +8708,12 @@ - + + @@ -8466,11 +8738,12 @@ - + + @@ -8495,11 +8768,12 @@ - + + @@ -8524,11 +8798,12 @@ - + + @@ -8553,11 +8828,12 @@ - + + @@ -8582,11 +8858,12 @@ - + + @@ -8611,11 +8888,12 @@ - + + @@ -8640,11 +8918,12 @@ - + + @@ -8669,11 +8948,12 @@ - + + @@ -8698,11 +8978,12 @@ - + + @@ -8727,11 +9008,12 @@ - + + @@ -8756,11 +9038,12 @@ - + + @@ -8785,11 +9068,12 @@ - + + @@ -8814,11 +9098,12 @@ - + + @@ -8843,11 +9128,12 @@ - + + @@ -8872,11 +9158,12 @@ - + + @@ -8901,11 +9188,12 @@ - + + @@ -8930,11 +9218,12 @@ - + + @@ -8959,11 +9248,12 @@ - + + @@ -8988,11 +9278,12 @@ - + + @@ -9017,11 +9308,12 @@ - + + @@ -9046,11 +9338,12 @@ - + + @@ -9075,11 +9368,12 @@ - + + @@ -9104,11 +9398,12 @@ - + + @@ -9133,11 +9428,12 @@ - + + @@ -9162,11 +9458,12 @@ - + + @@ -9191,11 +9488,12 @@ - + + @@ -9220,11 +9518,12 @@ - + + @@ -9249,11 +9548,12 @@ - + + @@ -9278,11 +9578,12 @@ - + + @@ -9307,11 +9608,12 @@ - + + @@ -9336,11 +9638,12 @@ - + + @@ -9365,11 +9668,12 @@ - + + @@ -9394,11 +9698,12 @@ - + + @@ -9423,11 +9728,12 @@ - + + @@ -9452,11 +9758,12 @@ - + + @@ -9481,11 +9788,12 @@ - + + @@ -9510,11 +9818,12 @@ - + + @@ -9539,11 +9848,12 @@ - + + @@ -9568,11 +9878,12 @@ - + + @@ -9597,11 +9908,12 @@ - + + @@ -9626,11 +9938,12 @@ - + + @@ -9655,11 +9968,12 @@ - + + @@ -9684,11 +9998,12 @@ - + + @@ -9713,11 +10028,12 @@ - + + @@ -9742,11 +10058,12 @@ - + + @@ -9771,11 +10088,12 @@ - + + @@ -9800,11 +10118,12 @@ - + + @@ -9829,11 +10148,12 @@ - + + @@ -9858,11 +10178,12 @@ - + + @@ -9887,11 +10208,12 @@ - + + @@ -9916,11 +10238,12 @@ - + + @@ -9945,11 +10268,12 @@ - + + @@ -9974,11 +10298,12 @@ - + + @@ -10003,11 +10328,12 @@ - + + @@ -10032,11 +10358,12 @@ - + + @@ -10061,11 +10388,12 @@ - + + @@ -10090,11 +10418,12 @@ - + + @@ -10119,11 +10448,12 @@ - + + @@ -10148,11 +10478,12 @@ - + + @@ -10177,11 +10508,12 @@ - + + @@ -10206,11 +10538,12 @@ - + + @@ -10235,11 +10568,12 @@ - + + @@ -10264,11 +10598,12 @@ - + + @@ -10293,11 +10628,12 @@ - + + @@ -10322,11 +10658,12 @@ - + + @@ -10351,11 +10688,12 @@ - + + @@ -10380,11 +10718,12 @@ - + + @@ -10409,11 +10748,12 @@ - + + @@ -10438,11 +10778,12 @@ - + + @@ -10467,11 +10808,12 @@ - + + @@ -10496,11 +10838,12 @@ - + + @@ -10525,11 +10868,12 @@ - + + @@ -10554,11 +10898,12 @@ - + + @@ -10583,11 +10928,12 @@ - + + @@ -10612,11 +10958,12 @@ - + + @@ -10641,11 +10988,12 @@ - + + @@ -10670,11 +11018,12 @@ - + + @@ -10699,11 +11048,12 @@ - + + @@ -10728,11 +11078,12 @@ - + + @@ -10757,11 +11108,12 @@ - + + @@ -10786,11 +11138,12 @@ - + + @@ -10815,11 +11168,12 @@ - + + @@ -10844,11 +11198,12 @@ - + + @@ -10873,11 +11228,12 @@ - + + @@ -10902,11 +11258,12 @@ - + + @@ -10931,11 +11288,12 @@ - + + @@ -10960,11 +11318,12 @@ - + + @@ -10989,11 +11348,12 @@ - + + @@ -11018,11 +11378,12 @@ - + + @@ -11047,11 +11408,12 @@ - + + @@ -11076,11 +11438,12 @@ - + + @@ -11105,11 +11468,12 @@ - + + @@ -11134,11 +11498,12 @@ - + + @@ -11163,11 +11528,12 @@ - + + @@ -11192,11 +11558,12 @@ - + + @@ -11221,11 +11588,12 @@ - + + @@ -11250,11 +11618,12 @@ - + + @@ -11279,11 +11648,12 @@ - + + @@ -11308,11 +11678,12 @@ - + + @@ -11337,11 +11708,12 @@ - + + @@ -11366,11 +11738,12 @@ - + + @@ -11395,11 +11768,12 @@ - + + @@ -11424,11 +11798,12 @@ - + + @@ -11453,11 +11828,12 @@ - + + @@ -11482,11 +11858,12 @@ - + + @@ -11511,11 +11888,12 @@ - + + @@ -11540,11 +11918,12 @@ - + + @@ -11569,11 +11948,12 @@ - + + @@ -11598,11 +11978,12 @@ - + + @@ -11627,11 +12008,12 @@ - + + @@ -11656,11 +12038,12 @@ - + + @@ -11685,11 +12068,12 @@ - + + @@ -11714,11 +12098,12 @@ - + + @@ -11743,11 +12128,12 @@ - + + @@ -11772,11 +12158,12 @@ - + + @@ -11801,11 +12188,12 @@ - + + @@ -11830,11 +12218,12 @@ - + + @@ -11859,11 +12248,12 @@ - + + @@ -11888,7 +12278,7 @@ - + @@ -11941,11 +12331,12 @@ - + + @@ -11970,11 +12361,12 @@ - + + @@ -11999,11 +12391,12 @@ - + + @@ -12028,11 +12421,12 @@ - + + @@ -12057,11 +12451,12 @@ - + + @@ -12086,11 +12481,12 @@ - + + @@ -12115,11 +12511,12 @@ - + + @@ -12144,11 +12541,12 @@ - + + @@ -12173,11 +12571,12 @@ - + + @@ -12202,11 +12601,12 @@ - + + @@ -12231,11 +12631,12 @@ - + + @@ -12260,11 +12661,12 @@ - + + @@ -12289,11 +12691,12 @@ - + + @@ -12318,11 +12721,12 @@ - + + @@ -12347,11 +12751,12 @@ - + + @@ -12376,11 +12781,12 @@ - + + @@ -12405,11 +12811,12 @@ - + + @@ -12434,11 +12841,12 @@ - + + @@ -12463,11 +12871,12 @@ - + + @@ -12492,11 +12901,12 @@ - + + @@ -12521,11 +12931,12 @@ - + + @@ -12550,11 +12961,12 @@ - + + @@ -12579,11 +12991,12 @@ - + + @@ -12608,11 +13021,12 @@ - + + @@ -12637,11 +13051,12 @@ - + + @@ -12666,11 +13081,12 @@ - + + @@ -12695,11 +13111,12 @@ - + + @@ -12724,11 +13141,12 @@ - + + @@ -12753,11 +13171,12 @@ - + + @@ -12782,11 +13201,12 @@ - + + @@ -12811,11 +13231,12 @@ - + + @@ -12840,11 +13261,12 @@ - + + @@ -12869,11 +13291,12 @@ - + + @@ -12898,11 +13321,12 @@ - + + @@ -12927,11 +13351,12 @@ - + + @@ -12956,11 +13381,12 @@ - + + @@ -12985,11 +13411,12 @@ - + + @@ -13018,7 +13445,7 @@ - + @@ -13241,7 +13668,7 @@ - + @@ -13344,7 +13771,7 @@ - + @@ -13391,7 +13818,7 @@ - + @@ -13478,7 +13905,7 @@ - + @@ -13589,7 +14016,7 @@ - + @@ -13676,7 +14103,7 @@ - + @@ -13743,7 +14170,7 @@ - + @@ -13795,7 +14222,7 @@ - + @@ -13922,7 +14349,7 @@ - + @@ -14030,7 +14457,7 @@ - + @@ -14093,7 +14520,7 @@ - + @@ -14208,7 +14635,7 @@ - + @@ -14311,7 +14738,7 @@ - + @@ -14414,7 +14841,7 @@ - + @@ -14477,7 +14904,7 @@ - + @@ -14642,7 +15069,7 @@ - + @@ -14857,7 +15284,7 @@ - + @@ -18864,7 +19291,7 @@ - + @@ -21221,7 +21648,7 @@ - + @@ -21356,7 +21783,7 @@ - + @@ -21555,7 +21982,7 @@ - + @@ -21626,7 +22053,7 @@ - + @@ -21683,7 +22110,7 @@ - + @@ -21762,7 +22189,7 @@ - + @@ -21836,7 +22263,7 @@ - + @@ -21955,7 +22382,7 @@ - + @@ -21998,7 +22425,7 @@ - + @@ -22069,7 +22496,7 @@ - + @@ -22168,7 +22595,7 @@ - + @@ -22255,7 +22682,7 @@ - + @@ -22302,7 +22729,7 @@ - + @@ -22361,7 +22788,7 @@ - + @@ -22452,7 +22879,7 @@ - + @@ -22691,7 +23118,7 @@ - + @@ -22760,7 +23187,7 @@ - + @@ -23814,7 +24241,7 @@ - + @@ -24804,7 +25231,7 @@ - + @@ -25067,7 +25494,7 @@ - + @@ -25122,7 +25549,7 @@ - + @@ -25505,7 +25932,7 @@ - + @@ -25584,7 +26011,7 @@ - + @@ -25639,7 +26066,7 @@ - + @@ -25686,7 +26113,7 @@ - + @@ -25767,7 +26194,7 @@ - + @@ -25810,7 +26237,7 @@ - + @@ -25893,7 +26320,7 @@ - + @@ -25948,7 +26375,7 @@ - + @@ -25999,7 +26426,7 @@ - + @@ -26593,7 +27020,7 @@ - + @@ -26648,7 +27075,7 @@ - + @@ -26775,7 +27202,7 @@ - + @@ -26888,7 +27315,7 @@ - + @@ -26935,7 +27362,7 @@ - + @@ -26990,7 +27417,7 @@ - + @@ -27048,7 +27475,7 @@ - + @@ -27119,7 +27546,7 @@ - + @@ -27198,7 +27625,7 @@ - + @@ -27262,7 +27689,7 @@ - + @@ -27317,7 +27744,7 @@ - + @@ -27380,7 +27807,7 @@ - + @@ -27443,7 +27870,7 @@ - + @@ -27506,7 +27933,7 @@ - + @@ -27601,7 +28028,7 @@ - + @@ -27664,7 +28091,7 @@ - + @@ -27727,7 +28154,7 @@ - + @@ -27789,7 +28216,7 @@ - + @@ -27844,7 +28271,7 @@ - + @@ -27937,7 +28364,7 @@ - + @@ -28388,7 +28815,7 @@ - + @@ -28459,7 +28886,7 @@ - + @@ -28570,7 +28997,7 @@ - + @@ -28681,7 +29108,7 @@ - + @@ -28754,7 +29181,7 @@ - + @@ -28817,7 +29244,7 @@ - + @@ -28880,7 +29307,7 @@ - + @@ -29613,7 +30040,7 @@ - + @@ -29676,7 +30103,7 @@ - + @@ -29731,7 +30158,7 @@ - + @@ -29806,7 +30233,7 @@ - + @@ -29869,7 +30296,7 @@ - + @@ -29980,7 +30407,7 @@ - + @@ -30589,7 +31016,7 @@ - + @@ -30652,7 +31079,7 @@ - + @@ -30782,7 +31209,7 @@ - + @@ -31599,7 +32026,7 @@ - + @@ -31835,7 +32262,7 @@ - + @@ -33230,7 +33657,7 @@ - + @@ -33277,7 +33704,7 @@ - + @@ -33339,7 +33766,7 @@ - + @@ -33434,7 +33861,7 @@ - + @@ -33513,7 +33940,7 @@ - + @@ -33600,7 +34027,7 @@ - + @@ -33695,7 +34122,7 @@ - + @@ -33786,7 +34213,7 @@ - + @@ -33833,7 +34260,7 @@ - + @@ -34022,7 +34449,7 @@ - + @@ -34261,7 +34688,7 @@ - + @@ -34348,7 +34775,7 @@ - + @@ -34403,7 +34830,7 @@ - + @@ -34536,7 +34963,7 @@ - + @@ -34615,7 +35042,7 @@ - + @@ -35096,7 +35523,7 @@ - + @@ -35175,7 +35602,7 @@ - + @@ -35318,7 +35745,7 @@ - + @@ -35433,7 +35860,7 @@ - + @@ -35572,7 +35999,7 @@ - + @@ -35641,7 +36068,7 @@ - + @@ -35712,7 +36139,7 @@ - + @@ -35767,7 +36194,7 @@ - + @@ -35889,7 +36316,7 @@ - + @@ -35952,7 +36379,7 @@ - + @@ -36007,7 +36434,7 @@ - + @@ -36209,7 +36636,7 @@ - + @@ -36256,7 +36683,7 @@ - + @@ -36311,7 +36738,7 @@ - + @@ -36354,7 +36781,7 @@ - + @@ -36769,7 +37196,7 @@ - + @@ -36906,7 +37333,7 @@ - + @@ -37083,7 +37510,7 @@ - + @@ -37165,7 +37592,7 @@ - + @@ -37256,7 +37683,7 @@ - + @@ -37327,7 +37754,7 @@ - + @@ -37442,7 +37869,7 @@ - + @@ -38003,7 +38430,7 @@ - + @@ -39946,7 +40373,7 @@ - + @@ -42043,7 +42470,7 @@ - + @@ -42609,7 +43036,7 @@ - + @@ -42682,7 +43109,7 @@ - + @@ -42725,7 +43152,7 @@ - + @@ -42772,7 +43199,7 @@ - + @@ -42815,7 +43242,7 @@ - + @@ -42860,7 +43287,7 @@ - + @@ -42919,7 +43346,7 @@ - + @@ -42971,7 +43398,7 @@ - + @@ -43033,7 +43460,7 @@ - + @@ -43088,7 +43515,7 @@ - + @@ -43175,7 +43602,7 @@ - + @@ -43222,7 +43649,7 @@ - + @@ -43277,7 +43704,7 @@ - + @@ -43348,7 +43775,7 @@ - + @@ -43427,7 +43854,7 @@ - + @@ -43470,7 +43897,7 @@ - + @@ -43509,7 +43936,7 @@ - + @@ -43561,7 +43988,7 @@ - + @@ -43632,7 +44059,7 @@ - + @@ -43715,7 +44142,7 @@ - + @@ -43766,7 +44193,7 @@ - + @@ -43837,7 +44264,7 @@ - + @@ -44100,7 +44527,7 @@ - + @@ -44139,7 +44566,7 @@ - + @@ -44182,7 +44609,7 @@ - + @@ -44221,7 +44648,7 @@ - + @@ -44260,7 +44687,7 @@ - + @@ -44549,7 +44976,7 @@ - + @@ -44622,7 +45049,7 @@ - + @@ -44697,7 +45124,7 @@ - + @@ -44749,7 +45176,7 @@ - + @@ -44815,7 +45242,7 @@ - + @@ -44850,7 +45277,7 @@ - + @@ -44958,7 +45385,7 @@ - + @@ -45029,7 +45456,7 @@ - + @@ -45092,7 +45519,7 @@ - + @@ -45187,7 +45614,7 @@ - + @@ -46273,7 +46700,7 @@ - + @@ -46318,7 +46745,7 @@ - + @@ -47579,7 +48006,7 @@ - + @@ -47626,7 +48053,7 @@ - + @@ -47705,7 +48132,7 @@ - + @@ -47792,7 +48219,7 @@ - + @@ -47867,7 +48294,7 @@ - + @@ -47934,7 +48361,7 @@ - + @@ -48285,7 +48712,7 @@ - + @@ -48332,7 +48759,7 @@ - + @@ -48476,7 +48903,7 @@ - + @@ -48772,7 +49199,7 @@ - + @@ -48911,7 +49338,7 @@ - + @@ -48966,7 +49393,7 @@ - + @@ -49005,7 +49432,7 @@ - + @@ -49076,7 +49503,7 @@ - + @@ -49197,7 +49624,7 @@ - + @@ -49260,7 +49687,7 @@ - + @@ -49311,7 +49738,7 @@ - + @@ -49358,7 +49785,7 @@ - + @@ -49413,7 +49840,7 @@ - + @@ -49460,7 +49887,7 @@ - + @@ -49506,7 +49933,7 @@ - + @@ -49541,7 +49968,7 @@ - + @@ -49830,7 +50257,7 @@ - + @@ -49865,7 +50292,7 @@ - + @@ -49900,7 +50327,7 @@ - + @@ -49955,7 +50382,7 @@ - + @@ -50020,7 +50447,7 @@ - + @@ -50111,7 +50538,7 @@ - + @@ -50170,7 +50597,7 @@ - + @@ -50225,7 +50652,7 @@ - + @@ -50344,7 +50771,7 @@ - + @@ -50379,7 +50806,7 @@ - + @@ -50434,7 +50861,7 @@ - + @@ -50521,7 +50948,7 @@ - + @@ -50566,7 +50993,7 @@ - + @@ -50657,7 +51084,7 @@ - + @@ -50712,7 +51139,7 @@ - + @@ -50791,7 +51218,7 @@ - + @@ -50878,7 +51305,7 @@ - + @@ -50981,7 +51408,7 @@ - + @@ -51028,7 +51455,7 @@ - + @@ -51099,7 +51526,7 @@ - + @@ -51162,7 +51589,7 @@ - + @@ -51277,7 +51704,7 @@ - + @@ -51392,7 +51819,7 @@ - + @@ -51491,7 +51918,7 @@ - + @@ -51618,7 +52045,7 @@ - + @@ -51709,7 +52136,7 @@ - + @@ -51914,7 +52341,7 @@ - + @@ -52017,7 +52444,7 @@ - + @@ -52222,7 +52649,7 @@ - + @@ -52333,7 +52760,7 @@ - + @@ -52452,7 +52879,7 @@ - + @@ -52527,7 +52954,7 @@ - + @@ -52654,7 +53081,7 @@ - + @@ -52749,7 +53176,7 @@ - + @@ -52912,7 +53339,7 @@ - + @@ -53081,7 +53508,7 @@ - + @@ -53160,7 +53587,7 @@ - + @@ -53233,7 +53660,7 @@ - + @@ -53334,7 +53761,7 @@ - + @@ -53772,7 +54199,7 @@ - + @@ -53835,7 +54262,7 @@ - + @@ -53898,7 +54325,7 @@ - + @@ -54095,7 +54522,7 @@ - + @@ -54158,7 +54585,7 @@ - + @@ -54197,7 +54624,7 @@ - + @@ -54292,7 +54719,7 @@ - + @@ -54383,7 +54810,7 @@ - + @@ -54560,7 +54987,7 @@ - + @@ -54599,7 +55026,7 @@ - + @@ -54749,7 +55176,7 @@ - + @@ -54816,7 +55243,7 @@ - + @@ -54855,7 +55282,7 @@ - + @@ -54910,7 +55337,7 @@ - + @@ -55011,7 +55438,7 @@ - + @@ -55080,7 +55507,7 @@ - + @@ -55299,7 +55726,7 @@ - + @@ -55366,7 +55793,7 @@ - + @@ -55447,7 +55874,7 @@ - + @@ -55516,7 +55943,7 @@ - + @@ -55607,7 +56034,7 @@ - + @@ -55676,7 +56103,7 @@ - + @@ -55899,7 +56326,7 @@ - + @@ -55966,7 +56393,7 @@ - + @@ -56717,7 +57144,7 @@ - + @@ -57390,7 +57817,7 @@ - + @@ -57531,7 +57958,7 @@ - + @@ -57768,7 +58195,7 @@ - + @@ -57871,7 +58298,7 @@ - + @@ -57959,7 +58386,7 @@ - + @@ -60876,7 +61303,7 @@ - + @@ -60934,7 +61361,7 @@ - + @@ -60998,7 +61425,7 @@ - + @@ -61569,7 +61996,7 @@ - + @@ -62278,7 +62705,7 @@ - + @@ -62413,7 +62840,7 @@ - + @@ -62624,7 +63051,7 @@ - + @@ -62715,7 +63142,7 @@ - + @@ -62782,7 +63209,7 @@ - + @@ -62837,7 +63264,7 @@ - + @@ -62968,7 +63395,7 @@ - + @@ -63083,7 +63510,7 @@ - + @@ -63138,7 +63565,7 @@ - + @@ -63193,7 +63620,7 @@ - + @@ -63299,7 +63726,7 @@ - + @@ -63602,7 +64029,7 @@ - + @@ -63669,7 +64096,7 @@ - + @@ -63820,7 +64247,7 @@ - + @@ -63875,7 +64302,7 @@ - + @@ -63954,7 +64381,7 @@ - + @@ -64073,7 +64500,7 @@ - + @@ -64158,7 +64585,7 @@ - + @@ -64277,7 +64704,7 @@ - + @@ -64332,7 +64759,7 @@ - + @@ -64421,7 +64848,7 @@ - + @@ -64476,7 +64903,7 @@ - + @@ -64535,7 +64962,7 @@ - + @@ -64650,7 +65077,7 @@ - + @@ -64753,7 +65180,7 @@ - + @@ -64827,7 +65254,7 @@ - + @@ -64921,7 +65348,7 @@ - + @@ -64968,7 +65395,7 @@ - + @@ -65051,7 +65478,7 @@ - + @@ -65098,7 +65525,7 @@ - + @@ -65145,7 +65572,7 @@ - + @@ -65200,7 +65627,7 @@ - + @@ -65917,7 +66344,7 @@ - + @@ -65964,7 +66391,7 @@ - + @@ -67805,7 +68232,7 @@ - + @@ -68080,7 +68507,7 @@ - + @@ -68147,7 +68574,7 @@ - + @@ -68210,7 +68637,7 @@ - + @@ -68277,7 +68704,7 @@ - + @@ -68356,7 +68783,7 @@ - + @@ -68427,7 +68854,7 @@ - + @@ -68576,7 +69003,7 @@ - + @@ -68623,7 +69050,7 @@ - + @@ -68756,7 +69183,7 @@ - + @@ -68857,7 +69284,7 @@ - + @@ -69117,7 +69544,7 @@ - + @@ -69220,7 +69647,7 @@ - + @@ -69275,7 +69702,7 @@ - + @@ -69366,7 +69793,7 @@ - + @@ -69421,7 +69848,7 @@ - + @@ -69476,7 +69903,7 @@ - + @@ -69531,7 +69958,7 @@ - + @@ -69716,7 +70143,7 @@ - + @@ -69801,7 +70228,7 @@ - + @@ -69868,7 +70295,7 @@ - + @@ -70243,7 +70670,7 @@ - + @@ -70289,7 +70716,7 @@ - + @@ -70332,7 +70759,7 @@ - + @@ -70375,7 +70802,7 @@ - + @@ -70418,7 +70845,7 @@ - + @@ -70479,7 +70906,7 @@ - + @@ -70562,7 +70989,7 @@ - + @@ -70607,7 +71034,7 @@ - + @@ -70650,7 +71077,7 @@ - + @@ -70736,7 +71163,7 @@ - + @@ -70806,7 +71233,7 @@ - + @@ -70852,7 +71279,7 @@ - + @@ -70907,7 +71334,7 @@ - + @@ -70998,7 +71425,7 @@ - + @@ -71085,7 +71512,7 @@ - + @@ -71158,7 +71585,7 @@ - + @@ -71215,7 +71642,7 @@ - + @@ -71254,7 +71681,7 @@ - + @@ -71297,7 +71724,7 @@ - + @@ -71512,7 +71939,7 @@ - + @@ -71578,7 +72005,7 @@ - + @@ -71627,7 +72054,7 @@ - + @@ -71678,7 +72105,7 @@ - + @@ -71814,7 +72241,7 @@ - + @@ -71857,7 +72284,7 @@ - + @@ -71908,7 +72335,7 @@ - + @@ -71979,7 +72406,7 @@ - + @@ -72183,7 +72610,7 @@ - + @@ -72266,7 +72693,7 @@ - + @@ -72325,7 +72752,7 @@ - + @@ -72420,7 +72847,7 @@ - + @@ -72503,7 +72930,7 @@ - + @@ -72612,7 +73039,7 @@ - + @@ -72659,7 +73086,7 @@ - + @@ -72720,7 +73147,7 @@ - + @@ -72771,7 +73198,7 @@ - + @@ -72814,7 +73241,7 @@ - + @@ -72857,7 +73284,7 @@ - + @@ -72908,7 +73335,7 @@ - + @@ -72991,7 +73418,7 @@ - + @@ -73043,7 +73470,7 @@ - + @@ -73090,7 +73517,7 @@ - + @@ -73157,7 +73584,7 @@ - + @@ -73208,7 +73635,7 @@ - + @@ -73269,7 +73696,7 @@ - + @@ -73344,7 +73771,7 @@ - + @@ -73391,7 +73818,7 @@ - + @@ -73438,7 +73865,7 @@ - + @@ -73504,7 +73931,7 @@ - + @@ -73569,7 +73996,7 @@ - + @@ -73616,7 +74043,7 @@ - + @@ -73671,7 +74098,7 @@ - + @@ -73730,7 +74157,7 @@ - + @@ -73785,7 +74212,7 @@ - + @@ -73840,7 +74267,7 @@ - + @@ -73886,7 +74313,7 @@ - + @@ -73929,7 +74356,7 @@ - + @@ -74000,7 +74427,7 @@ - + @@ -74047,7 +74474,7 @@ - + @@ -74094,7 +74521,7 @@ - + @@ -74146,7 +74573,7 @@ - + @@ -74201,7 +74628,7 @@ - + @@ -74252,7 +74679,7 @@ - + @@ -74295,7 +74722,7 @@ - + @@ -74402,7 +74829,7 @@ - + @@ -74510,7 +74937,7 @@ - + @@ -74557,7 +74984,7 @@ - + @@ -74625,7 +75052,7 @@ - + @@ -74752,7 +75179,7 @@ - + @@ -74811,7 +75238,7 @@ - + @@ -74898,7 +75325,7 @@ - + @@ -74953,7 +75380,7 @@ - + @@ -74999,7 +75426,7 @@ - + @@ -75066,7 +75493,7 @@ - + @@ -75129,7 +75556,7 @@ - + @@ -75192,7 +75619,7 @@ - + @@ -75251,7 +75678,7 @@ - + @@ -75336,7 +75763,7 @@ - + @@ -75387,7 +75814,7 @@ - + @@ -75446,7 +75873,7 @@ - + @@ -75520,7 +75947,7 @@ - + @@ -75586,7 +76013,7 @@ - + @@ -75665,7 +76092,7 @@ - + @@ -75704,7 +76131,7 @@ - + @@ -75986,7 +76413,7 @@ - + @@ -76049,7 +76476,7 @@ - + @@ -76096,7 +76523,7 @@ - + @@ -76226,7 +76653,7 @@ - + @@ -76289,7 +76716,7 @@ - + @@ -76336,7 +76763,7 @@ - + @@ -76411,7 +76838,7 @@ - + @@ -76474,7 +76901,7 @@ - + @@ -76537,7 +76964,7 @@ - + @@ -76737,7 +77164,7 @@ - + @@ -76848,7 +77275,7 @@ - + @@ -76899,7 +77326,7 @@ - + @@ -76954,7 +77381,7 @@ - + @@ -77217,7 +77644,7 @@ - + @@ -77268,7 +77695,7 @@ - + @@ -77311,7 +77738,7 @@ - + @@ -77350,7 +77777,7 @@ - + @@ -79179,7 +79606,7 @@ - + @@ -79265,7 +79692,7 @@ - + @@ -79304,7 +79731,7 @@ - + @@ -79375,7 +79802,7 @@ - + @@ -79434,7 +79861,7 @@ - + @@ -79521,7 +79948,7 @@ - + @@ -79568,7 +79995,7 @@ - + @@ -79603,7 +80030,7 @@ - + @@ -79682,7 +80109,7 @@ - + @@ -79796,7 +80223,7 @@ - + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/v3-codesystems.xml b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/v3-codesystems.xml index be5651f0ca6..5886fd559a2 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/v3-codesystems.xml +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/v3-codesystems.xml @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ - + @@ -18,19 +18,20 @@ - + - + - + + @@ -45,7 +46,7 @@ - + @@ -53,19 +54,20 @@ - + - + - + + @@ -80,7 +82,7 @@ - + @@ -95,7 +97,7 @@ - + @@ -119,7 +121,7 @@ - + @@ -127,19 +129,20 @@ - + - + - + + @@ -154,7 +157,7 @@ - + @@ -169,7 +172,7 @@ - + @@ -206,7 +209,7 @@ - + @@ -221,7 +224,7 @@ - + @@ -251,7 +254,7 @@ - + @@ -259,19 +262,20 @@ - + - + - + + @@ -286,7 +290,7 @@ - + @@ -301,7 +305,7 @@ - + @@ -325,7 +329,7 @@ - + @@ -333,19 +337,20 @@ - + - + - + + @@ -360,7 +365,7 @@ - + @@ -375,7 +380,7 @@ - + @@ -399,7 +404,7 @@ - + @@ -414,7 +419,7 @@ - + @@ -438,7 +443,7 @@ - + @@ -453,7 +458,7 @@ - + @@ -477,7 +482,7 @@ - + @@ -485,19 +490,20 @@ - + - + - + + @@ -512,23 +518,24 @@ - + - + - + - + + @@ -543,7 +550,7 @@ - + @@ -551,19 +558,20 @@ - + - + - + + @@ -578,23 +586,24 @@ - + - + - + - + + @@ -609,7 +618,7 @@ - + @@ -617,19 +626,20 @@ - + - + - + + @@ -644,7 +654,7 @@ - + @@ -652,19 +662,20 @@ - + - + - + + @@ -679,7 +690,7 @@ - + @@ -694,7 +705,7 @@ - + @@ -718,7 +729,7 @@ - + @@ -733,7 +744,7 @@ - + @@ -763,23 +774,24 @@ - + - + - + - + + @@ -794,23 +806,24 @@ - + - + - + - + + @@ -825,7 +838,7 @@ - + @@ -833,19 +846,20 @@ - + - + - + + @@ -860,23 +874,24 @@ - + - + - + - + + @@ -891,7 +906,7 @@ - + @@ -906,7 +921,7 @@ - + @@ -930,7 +945,7 @@ - + @@ -938,19 +953,20 @@ - + - + - + + @@ -965,7 +981,7 @@ - + @@ -973,19 +989,20 @@ - + - + - + + @@ -1000,7 +1017,7 @@ - + @@ -1008,19 +1025,20 @@ - + - + - + + @@ -1035,23 +1053,24 @@ - + - + - + - + + @@ -1066,7 +1085,7 @@ - + @@ -1081,7 +1100,7 @@ - + @@ -1105,7 +1124,7 @@ - + @@ -1120,7 +1139,7 @@ - + @@ -1144,7 +1163,7 @@ - + @@ -1159,7 +1178,7 @@ - + @@ -1183,7 +1202,7 @@ - + @@ -1191,19 +1210,20 @@ - + - + - + + @@ -1218,23 +1238,24 @@ - + - + - + - + + @@ -1249,7 +1270,7 @@ - + @@ -1257,19 +1278,20 @@ - + - + - + + @@ -1284,23 +1306,24 @@ - + - + - + - + + @@ -1315,7 +1338,7 @@ - + @@ -1323,19 +1346,20 @@ - + - + - + + @@ -1350,7 +1374,7 @@ - + @@ -1358,19 +1382,20 @@ - + - + - + + @@ -1385,7 +1410,7 @@ - + @@ -1400,7 +1425,7 @@ - + @@ -1424,7 +1449,7 @@ - + @@ -1439,7 +1464,7 @@ - + @@ -1469,7 +1494,7 @@ - + @@ -1484,7 +1509,7 @@ - + @@ -1514,23 +1539,24 @@ - + - + - + - + + @@ -1545,7 +1571,7 @@ - + @@ -1560,7 +1586,7 @@ - + @@ -1590,7 +1616,7 @@ - + @@ -1605,7 +1631,7 @@ - + @@ -1642,7 +1668,7 @@ - + @@ -1650,19 +1676,20 @@ - + - + - + + @@ -1677,7 +1704,7 @@ - + @@ -1692,7 +1719,7 @@ - + @@ -1722,7 +1749,7 @@ - + @@ -1737,7 +1764,7 @@ - + @@ -1761,7 +1788,7 @@ - + @@ -1769,19 +1796,20 @@ - + - + - + + @@ -1796,23 +1824,24 @@ - + - + - + - + + @@ -1827,23 +1856,24 @@ - + - + - + - + + @@ -1858,23 +1888,24 @@ - + - + - + - + + @@ -1889,7 +1920,7 @@ - + @@ -1904,7 +1935,7 @@ - + @@ -1938,7 +1969,7 @@ - + @@ -1946,19 +1977,20 @@ - + - + - + + @@ -1973,23 +2005,24 @@ - + - + - + - + + @@ -2004,7 +2037,7 @@ - + @@ -2019,7 +2052,7 @@ - + @@ -2049,7 +2082,7 @@ - + @@ -2057,19 +2090,20 @@ - + - + - + + @@ -2084,7 +2118,7 @@ - + @@ -2099,7 +2133,7 @@ - + @@ -2129,7 +2163,7 @@ - + @@ -2137,19 +2171,20 @@ - + - + - + + @@ -2164,7 +2199,7 @@ - + @@ -2179,7 +2214,7 @@ - + @@ -2203,7 +2238,7 @@ - + @@ -2211,19 +2246,20 @@ - + - + - + + @@ -2238,7 +2274,7 @@ - + @@ -2253,7 +2289,7 @@ - + @@ -2277,23 +2313,24 @@ - + - + - + - + + @@ -2308,7 +2345,7 @@ - + @@ -2316,19 +2353,20 @@ - + - + - + + @@ -2343,7 +2381,7 @@ - + @@ -2351,19 +2389,20 @@ - + - + - + + @@ -2378,7 +2417,7 @@ - + @@ -2386,19 +2425,20 @@ - + - + - + + @@ -2413,7 +2453,7 @@ - + @@ -2421,19 +2461,20 @@ - + - + - + + @@ -2448,7 +2489,7 @@ - + @@ -2463,7 +2504,7 @@ - + @@ -2487,7 +2528,7 @@ - + @@ -2502,7 +2543,7 @@ - + @@ -2521,7 +2562,7 @@ - + @@ -2536,7 +2577,7 @@ - + @@ -2560,7 +2601,7 @@ - + @@ -2568,19 +2609,20 @@ - + - + - + + @@ -2595,7 +2637,7 @@ - + @@ -2603,19 +2645,20 @@ - + - + - + + @@ -2630,23 +2673,24 @@ - + - + - + - + + @@ -2661,23 +2705,24 @@ - + - + - + - + + @@ -2692,7 +2737,7 @@ - + @@ -2700,19 +2745,20 @@ - + - + - + + @@ -2727,23 +2773,24 @@ - + - + - + - + + @@ -2758,7 +2805,7 @@ - + @@ -2766,19 +2813,20 @@ - + - + - + + @@ -2793,7 +2841,7 @@ - + @@ -2801,19 +2849,20 @@ - + - + - + + @@ -2828,7 +2877,7 @@ - + @@ -2843,7 +2892,7 @@ - + @@ -2867,7 +2916,7 @@ - + @@ -2875,19 +2924,20 @@ - + - + - + + @@ -2902,7 +2952,7 @@ - + @@ -2917,7 +2967,7 @@ - + @@ -2941,7 +2991,7 @@ - + @@ -2956,7 +3006,7 @@ - + @@ -2980,23 +3030,24 @@ - + - + - + - + + @@ -3011,7 +3062,7 @@ - + @@ -3026,7 +3077,7 @@ - + @@ -3053,7 +3104,7 @@ - + @@ -3061,19 +3112,20 @@ - + - + - + + @@ -3088,23 +3140,24 @@ - + - + - + - + + @@ -3119,7 +3172,7 @@ - + @@ -3134,7 +3187,7 @@ - + @@ -3158,7 +3211,7 @@ - + @@ -3173,7 +3226,7 @@ - + @@ -3192,23 +3245,24 @@ - + - + - + - + + @@ -3223,7 +3277,7 @@ - + @@ -3238,7 +3292,7 @@ - + @@ -3262,7 +3316,7 @@ - + @@ -3270,19 +3324,20 @@ - + - + - + + @@ -3297,7 +3352,7 @@ - + @@ -3312,7 +3367,7 @@ - + @@ -3336,7 +3391,7 @@ - + @@ -3344,19 +3399,20 @@ - + - + - + + @@ -3371,7 +3427,7 @@ - + @@ -3386,7 +3442,7 @@ - + @@ -3408,7 +3464,7 @@ - + @@ -3423,7 +3479,7 @@ - + @@ -3447,23 +3503,24 @@ - + - + - + - + + @@ -3478,7 +3535,7 @@ - + @@ -3486,19 +3543,20 @@ - + - + - + + @@ -3513,23 +3571,24 @@ - + - + - + - + + @@ -3544,7 +3603,7 @@ - + @@ -3552,19 +3611,20 @@ - + - + - + + @@ -3579,7 +3639,7 @@ - + @@ -3587,19 +3647,20 @@ - + - + - + + @@ -3614,7 +3675,7 @@ - + @@ -3629,7 +3690,7 @@ - + @@ -3659,7 +3720,7 @@ - + @@ -3667,19 +3728,20 @@ - + - + - + + @@ -3694,23 +3756,24 @@ - + - + - + - + + @@ -3725,7 +3788,7 @@ - + @@ -3740,7 +3803,7 @@ - + @@ -3768,23 +3831,24 @@ - + - + - + - + + @@ -3799,23 +3863,24 @@ - + - + - + - + + @@ -3830,7 +3895,7 @@ - + @@ -3845,7 +3910,7 @@ - + @@ -3869,7 +3934,7 @@ - + @@ -3884,7 +3949,7 @@ - + @@ -3908,7 +3973,7 @@ - + @@ -3916,19 +3981,20 @@ - + - + - + + @@ -3943,7 +4009,7 @@ - + @@ -3951,19 +4017,20 @@ - + - + - + + @@ -3978,7 +4045,7 @@ - + @@ -3993,7 +4060,7 @@ - + @@ -4023,7 +4090,7 @@ - + @@ -4038,7 +4105,7 @@ - + @@ -4062,23 +4129,24 @@ - + - + - + - + + @@ -4093,7 +4161,7 @@ - + @@ -4101,19 +4169,20 @@ - + - + - + + @@ -4128,7 +4197,7 @@ - + @@ -4136,19 +4205,20 @@ - + - + - + + @@ -4163,7 +4233,7 @@ - + @@ -4171,19 +4241,20 @@ - + - + - + + @@ -4198,7 +4269,7 @@ - + @@ -4206,19 +4277,20 @@ - + - + - + + @@ -4233,7 +4305,7 @@ - + @@ -4241,19 +4313,20 @@ - + - + - + + @@ -4268,7 +4341,7 @@ - + @@ -4276,19 +4349,20 @@ - + - + - + + @@ -4303,7 +4377,7 @@ - + @@ -4318,7 +4392,7 @@ - + @@ -4349,7 +4423,7 @@ - + @@ -4364,7 +4438,7 @@ - + @@ -4394,7 +4468,7 @@ - + @@ -4402,19 +4476,20 @@ - + - + - + + @@ -4429,7 +4504,7 @@ - + @@ -4437,19 +4512,20 @@ - + - + - + + @@ -4464,7 +4540,7 @@ - + @@ -4472,19 +4548,20 @@ - + - + - + + @@ -4499,7 +4576,7 @@ - + @@ -4507,19 +4584,20 @@ - + - + - + + @@ -4534,7 +4612,7 @@ - + @@ -4549,7 +4627,7 @@ - + @@ -4573,7 +4651,7 @@ - + @@ -4588,7 +4666,7 @@ - + @@ -4618,23 +4696,24 @@ - + - + - + - + + @@ -4649,23 +4728,24 @@ - + - + - + - + + @@ -4680,7 +4760,7 @@ - + @@ -4695,7 +4775,7 @@ - + @@ -4719,7 +4799,7 @@ - + @@ -4727,19 +4807,20 @@ - + - + - + + @@ -4754,23 +4835,24 @@ - + - + - + - + + @@ -4785,7 +4867,7 @@ - + @@ -4793,19 +4875,20 @@ - + - + - + + @@ -4820,7 +4903,7 @@ - + @@ -4835,7 +4918,7 @@ - + @@ -4859,7 +4942,7 @@ - + @@ -4867,19 +4950,20 @@ - + - + - + + @@ -4894,7 +4978,7 @@ - + @@ -4909,7 +4993,7 @@ - + @@ -4939,7 +5023,7 @@ - + @@ -4947,19 +5031,20 @@ - + - + - + + @@ -4974,23 +5059,24 @@ - + - + - + - + + @@ -5005,7 +5091,7 @@ - + @@ -5020,7 +5106,7 @@ - + @@ -5044,7 +5130,7 @@ - + @@ -5052,19 +5138,20 @@ - + - + - + + @@ -5079,7 +5166,7 @@ - + @@ -5087,19 +5174,20 @@ - + - + - + + @@ -5114,7 +5202,7 @@ - + @@ -5122,19 +5210,20 @@ - + - + - + + @@ -5149,7 +5238,7 @@ - + @@ -5157,19 +5246,20 @@ - + - + - + + @@ -5184,7 +5274,7 @@ - + @@ -5192,19 +5282,20 @@ - + - + - + + @@ -5219,7 +5310,7 @@ - + @@ -5227,19 +5318,20 @@ - + - + - + + @@ -5254,7 +5346,7 @@ - + @@ -5262,19 +5354,20 @@ - + - + - + + @@ -5289,7 +5382,7 @@ - + @@ -5304,7 +5397,7 @@ - + @@ -5334,7 +5427,7 @@ - + @@ -5342,19 +5435,20 @@ - + - + - + + @@ -5369,23 +5463,24 @@ - + - + - + - + + @@ -5400,7 +5495,7 @@ - + @@ -5408,19 +5503,20 @@ - + - + - + + @@ -5435,23 +5531,24 @@ - + - + - + - + + @@ -5466,7 +5563,7 @@ - + @@ -5474,19 +5571,20 @@ - + - + - + + @@ -5501,7 +5599,7 @@ - + @@ -5509,19 +5607,20 @@ - + - + - + + @@ -5536,7 +5635,7 @@ - + @@ -5544,19 +5643,20 @@ - + - + - + + @@ -5571,7 +5671,7 @@ - + @@ -5586,7 +5686,7 @@ - + @@ -5616,7 +5716,7 @@ - + @@ -5624,19 +5724,20 @@ - + - + - + + @@ -5651,7 +5752,7 @@ - + @@ -5666,7 +5767,7 @@ - + @@ -5690,23 +5791,24 @@ - + - + - + - + + @@ -5721,7 +5823,7 @@ - + @@ -5736,7 +5838,7 @@ - + @@ -5760,7 +5862,7 @@ - + @@ -5768,19 +5870,20 @@ - + - + - + + @@ -5795,7 +5898,7 @@ - + @@ -5810,7 +5913,7 @@ - + @@ -5834,7 +5937,7 @@ - + @@ -5849,7 +5952,7 @@ - + @@ -5879,7 +5982,7 @@ - + @@ -5887,19 +5990,20 @@ - + - + - + + @@ -5914,7 +6018,7 @@ - + @@ -5922,19 +6026,20 @@ - + - + - + + @@ -5949,7 +6054,7 @@ - + @@ -5964,7 +6069,7 @@ - + @@ -5994,7 +6099,7 @@ - + @@ -6009,7 +6114,7 @@ - + @@ -6033,7 +6138,7 @@ - + @@ -6048,7 +6153,7 @@ - + @@ -6094,7 +6199,7 @@ - + @@ -6109,7 +6214,7 @@ - + @@ -6133,7 +6238,7 @@ - + @@ -6148,7 +6253,7 @@ - + @@ -6172,7 +6277,7 @@ - + @@ -6180,19 +6285,20 @@ - + - + - + + @@ -6207,7 +6313,7 @@ - + @@ -6222,7 +6328,7 @@ - + @@ -6246,7 +6352,7 @@ - + @@ -6254,19 +6360,20 @@ - + - + - + + @@ -6281,7 +6388,7 @@ - + @@ -6289,19 +6396,20 @@ - + - + - + + @@ -6316,7 +6424,7 @@ - + @@ -6324,19 +6432,20 @@ - + - + - + + @@ -6351,7 +6460,7 @@ - + @@ -6366,7 +6475,7 @@ - + @@ -6396,23 +6505,24 @@ - + - + - + - + + @@ -6427,7 +6537,7 @@ - + @@ -6435,19 +6545,20 @@ - + - + - + + @@ -6462,7 +6573,7 @@ - + @@ -6470,19 +6581,20 @@ - + - + - + + @@ -6497,7 +6609,7 @@ - + @@ -6505,19 +6617,20 @@ - + - + - + + @@ -6532,7 +6645,7 @@ - + @@ -6540,19 +6653,20 @@ - + - + - + + @@ -6567,7 +6681,7 @@ - + @@ -6575,19 +6689,20 @@ - + - + - + + @@ -6602,23 +6717,24 @@ - + - + - + - + + @@ -6633,7 +6749,7 @@ - + @@ -6648,7 +6764,7 @@ - + @@ -6672,7 +6788,7 @@ - + @@ -6687,7 +6803,7 @@ - + @@ -6711,7 +6827,7 @@ - + @@ -6719,19 +6835,20 @@ - + - + - + + @@ -6746,7 +6863,7 @@ - + @@ -6754,19 +6871,20 @@ - + - + - + + @@ -6781,7 +6899,7 @@ - + @@ -6789,19 +6907,20 @@ - + - + - + + @@ -6816,7 +6935,7 @@ - + @@ -6824,19 +6943,20 @@ - + - + - + + @@ -6851,7 +6971,7 @@ - + @@ -6859,19 +6979,20 @@ - + - + - + + @@ -6886,7 +7007,7 @@ - + @@ -6894,19 +7015,20 @@ - + - + - + + @@ -6921,7 +7043,7 @@ - + @@ -6929,19 +7051,20 @@ - + - + - + + @@ -6956,7 +7079,7 @@ - + @@ -6971,7 +7094,7 @@ - + @@ -6995,7 +7118,7 @@ - + @@ -7010,7 +7133,7 @@ - + @@ -7040,7 +7163,7 @@ - + @@ -7048,19 +7171,20 @@ - + - + - + + @@ -7075,7 +7199,7 @@ - + @@ -7083,19 +7207,20 @@ - + - + - + + @@ -7110,23 +7235,24 @@ - + - + - + - + + @@ -7141,7 +7267,7 @@ - + @@ -7149,19 +7275,20 @@ - + - + - + + @@ -7176,29 +7303,29 @@ - + - + - + - + - + @@ -7259,29 +7386,29 @@ - + - + - + - + - + @@ -7332,29 +7459,29 @@ - + - + - + - + - + @@ -7375,29 +7502,29 @@ - + - + - + - + - + @@ -7443,29 +7570,29 @@ - + - + - + - + - + @@ -7496,29 +7623,29 @@ - + - + - + - + - + @@ -7539,29 +7666,29 @@ - + - + - + - + - + @@ -7622,29 +7749,29 @@ - + - + - + - + - + @@ -7675,29 +7802,29 @@ - + - + - + - + - + @@ -8415,7 +8542,7 @@ - + @@ -8577,29 +8704,29 @@ - + - + - + - + - + @@ -8630,29 +8757,29 @@ - + - + - + - + - + @@ -8688,29 +8815,29 @@ - + - + - + - + - + @@ -10260,7 +10387,7 @@ - + @@ -10273,29 +10400,29 @@ - + - + - + - + - + @@ -10530,29 +10657,29 @@ - + - + - + - + - + @@ -10796,7 +10923,7 @@ - + @@ -10984,7 +11111,7 @@ - + @@ -11143,7 +11270,7 @@ - + @@ -11152,7 +11279,7 @@ - + @@ -11161,7 +11288,7 @@ - + @@ -11170,7 +11297,7 @@ - + @@ -11179,7 +11306,7 @@ - + @@ -11188,7 +11315,7 @@ - + @@ -11201,29 +11328,29 @@ - + - + - + - + - + @@ -11369,29 +11496,29 @@ - + - + - + - + - + @@ -11552,29 +11679,29 @@ - + - + - + - + - + @@ -11590,29 +11717,29 @@ - + - + - + - + - + @@ -11633,29 +11760,29 @@ - + - + - + - + - + @@ -11681,29 +11808,29 @@ - + - + - + - + - + @@ -11816,29 +11943,29 @@ - + - + - + - + - + @@ -11884,29 +12011,29 @@ - + - + - + - + - + @@ -11977,29 +12104,29 @@ - + - + - + - + - + @@ -12030,29 +12157,29 @@ - + - + - + - + - + @@ -13728,29 +13855,29 @@ - + - + - + - + - + @@ -13776,29 +13903,29 @@ - + - + - + - + - + @@ -14219,29 +14346,29 @@ - + - + - + - + - + @@ -14267,21 +14394,21 @@ - + - + - + @@ -14294,29 +14421,29 @@ - + - + - + - + - + @@ -14347,29 +14474,29 @@ - + - + - + - + - + @@ -14425,29 +14552,29 @@ - + - + - + - + - + @@ -14508,29 +14635,29 @@ - + - + - + - + - + @@ -14601,29 +14728,29 @@ - + - + - + - + - + @@ -14834,29 +14961,29 @@ - + - + - + - + - + @@ -19472,29 +19599,29 @@ - + - + - + - + - + @@ -19535,29 +19662,29 @@ - + - + - + - + - + @@ -22422,29 +22549,29 @@ - + - + - + - + - + @@ -22470,29 +22597,29 @@ - + - + - + - + - + @@ -22528,29 +22655,29 @@ - + - + - + - + - + @@ -23351,7 +23478,7 @@ - + @@ -23360,7 +23487,7 @@ - + @@ -23369,21 +23496,21 @@ - + - + - + @@ -23396,29 +23523,29 @@ - + - + - + - + - + @@ -23469,29 +23596,29 @@ - + - + - + - + - + @@ -23507,29 +23634,29 @@ - + - + - + - + - + @@ -23580,29 +23707,29 @@ - + - + - + - + - + @@ -23703,29 +23830,29 @@ - + - + - + - + - + @@ -23791,29 +23918,29 @@ - + - + - + - + - + @@ -23839,29 +23966,29 @@ - + - + - + - + - + @@ -24007,7 +24134,7 @@ - + @@ -24016,7 +24143,7 @@ - + @@ -24024,7 +24151,7 @@ - + @@ -24033,7 +24160,7 @@ - + @@ -24043,7 +24170,7 @@ - + @@ -24078,29 +24205,29 @@ - + - + - + - + - + @@ -24121,29 +24248,29 @@ - + - + - + - + - + @@ -24206,7 +24333,7 @@ - + @@ -24214,7 +24341,7 @@ - + @@ -24223,7 +24350,7 @@ - + @@ -24232,7 +24359,7 @@ - + @@ -24241,7 +24368,7 @@ - + @@ -24251,7 +24378,7 @@ - + @@ -24260,7 +24387,7 @@ - + @@ -24269,7 +24396,7 @@ - + @@ -24282,29 +24409,29 @@ - + - + - + - + - + @@ -24330,29 +24457,29 @@ - + - + - + - + - + @@ -25609,7 +25736,7 @@ - + @@ -25618,7 +25745,7 @@ - + @@ -25627,7 +25754,7 @@ - + @@ -25636,7 +25763,7 @@ - + @@ -25645,7 +25772,7 @@ - + @@ -25654,7 +25781,7 @@ - + @@ -25663,7 +25790,7 @@ - + @@ -25672,7 +25799,7 @@ - + @@ -26650,7 +26777,7 @@ - + @@ -26659,7 +26786,7 @@ - + @@ -26668,7 +26795,7 @@ - + @@ -26677,7 +26804,7 @@ - + @@ -26686,14 +26813,14 @@ - + - + @@ -26702,7 +26829,7 @@ - + @@ -26715,29 +26842,29 @@ - + - + - + - + - + @@ -26773,29 +26900,29 @@ - + - + - + - + - + @@ -26821,29 +26948,29 @@ - + - + - + - + - + @@ -26869,29 +26996,29 @@ - + - + - + - + - + @@ -27151,29 +27278,29 @@ - + - + - + - + - + @@ -27229,29 +27356,29 @@ - + - + - + - + - + @@ -27404,29 +27531,29 @@ - + - + - + - + - + @@ -27457,29 +27584,29 @@ - + - + - + - + - + @@ -27543,7 +27670,7 @@ - + @@ -27555,7 +27682,7 @@ - + @@ -27568,7 +27695,7 @@ - + @@ -27581,7 +27708,7 @@ - + @@ -27599,7 +27726,7 @@ - + @@ -27611,7 +27738,7 @@ - + @@ -27624,7 +27751,7 @@ - + @@ -27637,7 +27764,7 @@ - + @@ -27650,7 +27777,7 @@ - + @@ -27668,7 +27795,7 @@ - + @@ -27680,7 +27807,7 @@ - + @@ -27693,7 +27820,7 @@ - + @@ -27706,7 +27833,7 @@ - + @@ -27724,29 +27851,29 @@ - + - + - + - + - + @@ -27832,29 +27959,29 @@ - + - + - + - + - + @@ -28016,7 +28143,7 @@ - + @@ -28040,7 +28167,7 @@ - + @@ -28062,7 +28189,7 @@ - + @@ -28078,7 +28205,7 @@ - + @@ -28092,29 +28219,29 @@ - + - + - + - + - + @@ -28155,29 +28282,29 @@ - + - + - + - + - + @@ -31361,29 +31488,29 @@ - + - + - + - + - + @@ -31409,29 +31536,29 @@ - + - + - + - + - + @@ -31516,29 +31643,29 @@ - + - + - + - + - + @@ -31634,7 +31761,7 @@ - + @@ -31647,29 +31774,29 @@ - + - + - + - + - + @@ -31700,29 +31827,29 @@ - + - + - + - + - + @@ -31750,7 +31877,7 @@ - + @@ -31763,29 +31890,29 @@ - + - + - + - + - + @@ -31846,29 +31973,29 @@ - + - + - + - + - + @@ -32028,29 +32155,29 @@ - + - + - + - + - + @@ -32086,29 +32213,29 @@ - + - + - + - + - + @@ -32195,7 +32322,11 @@ - + + + + + @@ -32205,12 +32336,20 @@ - + + + + + - + + + + + @@ -32377,6 +32516,15 @@ + + + + + + + + + @@ -32435,6 +32583,15 @@ + + + + + + + + + @@ -32468,29 +32625,29 @@ - + - + - + - + - + @@ -32516,29 +32673,29 @@ - + - + - + - + - + @@ -32569,29 +32726,29 @@ - + - + - + - + - + @@ -32637,29 +32794,29 @@ - + - + - + - + - + @@ -33273,7 +33430,7 @@ - + @@ -33281,7 +33438,7 @@ - + @@ -33290,7 +33447,7 @@ - + @@ -33299,133 +33456,133 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -33438,29 +33595,29 @@ - + - + - + - + - + @@ -33491,29 +33648,29 @@ - + - + - + - + - + @@ -33739,29 +33896,29 @@ - + - + - + - + - + @@ -33847,29 +34004,29 @@ - + - + - + - + - + @@ -33890,29 +34047,29 @@ - + - + - + - + - + @@ -33953,29 +34110,29 @@ - + - + - + - + - + @@ -34001,29 +34158,29 @@ - + - + - + - + - + @@ -34405,6 +34562,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34746,7 +34932,7 @@ - + @@ -34987,7 +35173,7 @@ - + @@ -35332,7 +35518,7 @@ - + @@ -35345,7 +35531,7 @@ - + @@ -35358,7 +35544,7 @@ - + @@ -35371,7 +35557,7 @@ - + @@ -35384,29 +35570,29 @@ - + - + - + - + - + @@ -35462,29 +35648,29 @@ - + - + - + - + - + @@ -35511,7 +35697,7 @@ - + @@ -35530,29 +35716,29 @@ - + - + - + - + - + @@ -35608,29 +35794,29 @@ - + - + - + - + - + @@ -35668,7 +35854,7 @@ - + @@ -35686,29 +35872,29 @@ - + - + - + - + - + @@ -35729,29 +35915,29 @@ - + - + - + - + - + @@ -35792,29 +35978,29 @@ - + - + - + - + - + @@ -35943,7 +36129,7 @@ - + @@ -36154,29 +36340,29 @@ - + - + - + - + - + @@ -36192,29 +36378,29 @@ - + - + - + - + - + @@ -36255,29 +36441,29 @@ - + - + - + - + - + @@ -36401,29 +36587,29 @@ - + - + - + - + - + @@ -36444,29 +36630,29 @@ - + - + - + - + - + @@ -36672,29 +36858,29 @@ - + - + - + - + - + @@ -36988,29 +37174,29 @@ - + - + - + - + - + @@ -37046,29 +37232,29 @@ - + - + - + - + - + @@ -37709,29 +37895,29 @@ - + - + - + - + - + @@ -37817,29 +38003,29 @@ - + - + - + - + - + @@ -37954,29 +38140,29 @@ - + - + - + - + - + @@ -38271,29 +38457,29 @@ - + - + - + - + - + @@ -38329,29 +38515,29 @@ - + - + - + - + - + @@ -38452,29 +38638,29 @@ - + - + - + - + - + @@ -38505,29 +38691,29 @@ - + - + - + - + - + @@ -38623,29 +38809,29 @@ - + - + - + - + - + @@ -38676,29 +38862,29 @@ - + - + - + - + - + @@ -38809,29 +38995,29 @@ - + - + - + - + - + @@ -38857,29 +39043,29 @@ - + - + - + - + - + @@ -38910,29 +39096,29 @@ - + - + - + - + - + @@ -39023,29 +39209,29 @@ - + - + - + - + - + @@ -39101,29 +39287,29 @@ - + - + - + - + - + @@ -39144,29 +39330,29 @@ - + - + - + - + - + @@ -39197,29 +39383,29 @@ - + - + - + - + - + @@ -39245,29 +39431,29 @@ - + - + - + - + - + @@ -39298,29 +39484,29 @@ - + - + - + - + - + @@ -40154,7 +40340,7 @@ - + @@ -40723,7 +40909,7 @@ - + @@ -40735,7 +40921,7 @@ - + @@ -40743,7 +40929,7 @@ - + @@ -40752,7 +40938,7 @@ - + @@ -40761,7 +40947,7 @@ - + @@ -40770,14 +40956,14 @@ - + - + @@ -40786,7 +40972,7 @@ - + @@ -40795,7 +40981,7 @@ - + @@ -40804,7 +40990,7 @@ - + @@ -40813,35 +40999,35 @@ - + - + - + - + - + @@ -40850,7 +41036,7 @@ - + @@ -40859,14 +41045,14 @@ - + - + @@ -40879,29 +41065,29 @@ - + - + - + - + - + @@ -40942,29 +41128,29 @@ - + - + - + - + - + @@ -41005,29 +41191,29 @@ - + - + - + - + - + @@ -41068,29 +41254,29 @@ - + - + - + - + - + @@ -41724,7 +41910,7 @@ - + @@ -41736,7 +41922,7 @@ - + @@ -41917,29 +42103,29 @@ - + - + - + - + - + @@ -41960,29 +42146,29 @@ - + - + - + - + - + @@ -42003,29 +42189,29 @@ - + - + - + - + - + @@ -42071,29 +42257,29 @@ - + - + - + - + - + @@ -42124,29 +42310,29 @@ - + - + - + - + - + @@ -42226,29 +42412,29 @@ - + - + - + - + - + @@ -42481,7 +42667,7 @@ - + @@ -43291,7 +43477,7 @@ - + @@ -43299,7 +43485,7 @@ - + @@ -43308,7 +43494,7 @@ - + @@ -43323,8 +43509,8 @@ - - + + @@ -43381,7 +43567,7 @@ - + @@ -44431,7 +44617,7 @@ - + @@ -44620,7 +44806,7 @@ - + @@ -45696,16 +45882,16 @@ - - - - - + + + + + @@ -45731,7 +45917,7 @@ - + @@ -46280,7 +46466,7 @@ - + @@ -46289,7 +46475,7 @@ - + @@ -46951,6 +47137,16 @@ + + + + + + + + + + @@ -47801,7 +47997,7 @@ - + @@ -48004,7 +48200,7 @@ - + @@ -48012,7 +48208,7 @@ - + @@ -48021,7 +48217,7 @@ - + @@ -48030,7 +48226,7 @@ - + @@ -48039,7 +48235,7 @@ - + @@ -48048,7 +48244,7 @@ - + @@ -48057,7 +48253,7 @@ - + @@ -48066,7 +48262,7 @@ - + @@ -48342,7 +48538,7 @@ - + @@ -48354,7 +48550,7 @@ - + @@ -48368,35 +48564,35 @@ - + - + - + - + - + @@ -48405,7 +48601,7 @@ - + @@ -48422,29 +48618,29 @@ - + - + - + - + - + @@ -48480,29 +48676,29 @@ - + - + - + - + - + @@ -48540,7 +48736,7 @@ - + @@ -48549,7 +48745,7 @@ - + @@ -48558,7 +48754,7 @@ - + @@ -48571,29 +48767,29 @@ - + - + - + - + - + diff --git a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/valuesets.xml b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/valuesets.xml index 9fb444f4351..abdb0d8d80a 100644 --- a/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/valuesets.xml +++ b/hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/valueset/valuesets.xml @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -17224,7 +17224,7 @@ - + @@ -17234,7 +17234,7 @@ - + @@ -17387,7 +17387,7 @@ - + @@ -17401,14 +17401,14 @@ - + - + @@ -17867,21 +17867,21 @@ - + - + - + @@ -17889,7 +17889,7 @@ - + @@ -17918,7 +17918,7 @@ - + @@ -17926,14 +17926,14 @@ - + - + @@ -18046,7 +18046,7 @@ - + @@ -18054,14 +18054,14 @@ - + - + @@ -18119,7 +18119,7 @@ - + @@ -18127,14 +18127,14 @@ - + - + @@ -18161,21 +18161,21 @@ - + - + - + @@ -18183,7 +18183,7 @@ - + @@ -18207,21 +18207,21 @@ - + - + - + @@ -18229,7 +18229,7 @@ - + @@ -18242,69 +18242,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -18312,14 +18256,14 @@ - + - + @@ -18342,26 +18286,26 @@ - + - + - + - + - + - - + + - + @@ -18369,7 +18313,68 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -18408,7 +18413,7 @@ - + @@ -18416,14 +18421,14 @@ - + - + @@ -18461,21 +18466,21 @@ - + - + - + @@ -18483,7 +18488,7 @@ - + @@ -18527,21 +18532,21 @@ - + - + - + @@ -18549,7 +18554,7 @@ - + @@ -18583,21 +18588,21 @@ - + - + - + @@ -18605,7 +18610,7 @@ - + @@ -18629,7 +18634,7 @@ - + @@ -18637,14 +18642,14 @@ - + - + @@ -18686,21 +18691,21 @@ - + - + - + @@ -18708,7 +18713,7 @@ - + @@ -18742,21 +18747,21 @@ - + - + - + @@ -18764,7 +18769,7 @@ - + @@ -18793,21 +18798,21 @@ - + - + - + @@ -18815,7 +18820,7 @@ - + @@ -18839,21 +18844,21 @@ - + - + - + @@ -18861,7 +18866,7 @@ - + @@ -18890,21 +18895,21 @@ - + - + - + @@ -18912,7 +18917,7 @@ - + @@ -18956,21 +18961,21 @@ - + - + - + @@ -18978,7 +18983,7 @@ - + @@ -19022,21 +19027,21 @@ - + - + - + @@ -19044,7 +19049,7 @@ - + @@ -19083,7 +19088,7 @@ - + @@ -19091,14 +19096,14 @@ - + - + @@ -19131,7 +19136,7 @@ - + @@ -19139,20 +19144,20 @@ - + - + - + @@ -19180,21 +19185,21 @@ - + - + - + @@ -19202,7 +19207,7 @@ - + @@ -19236,7 +19241,7 @@ - + @@ -19244,14 +19249,14 @@ - + - + @@ -19273,83 +19278,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -19357,7 +19306,7 @@ - + @@ -19386,7 +19335,7 @@ - + @@ -19394,20 +19343,20 @@ - + - + - + @@ -19455,7 +19404,7 @@ - + @@ -19463,14 +19412,14 @@ - + - + @@ -19498,7 +19447,7 @@ - + @@ -19506,14 +19455,14 @@ - + - + @@ -19720,21 +19669,21 @@ - + - + - + @@ -19742,7 +19691,7 @@ - + @@ -19771,21 +19720,21 @@ - + - + - + @@ -19793,7 +19742,7 @@ - + @@ -19847,21 +19796,21 @@ - + - + - + @@ -19869,7 +19818,7 @@ - + @@ -19893,7 +19842,7 @@ - + @@ -19901,14 +19850,14 @@ - + - + @@ -19940,13 +19889,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -19954,14 +19955,14 @@ - + - + @@ -19991,15 +19992,25 @@ - - - + + + + + + + + + + + + + @@ -20014,21 +20025,21 @@ - + - + - + @@ -20036,7 +20047,7 @@ - + @@ -20065,21 +20076,21 @@ - + - + - + @@ -20087,7 +20098,7 @@ - + @@ -20100,7 +20111,7 @@ - + @@ -20122,6 +20133,11 @@ + + + + + @@ -20142,6 +20158,11 @@ + + + + + @@ -20151,7 +20172,7 @@ - + @@ -20159,14 +20180,14 @@ - + - + @@ -20223,7 +20244,7 @@ - + @@ -20231,14 +20252,14 @@ - + - + @@ -20316,7 +20337,7 @@ - + @@ -20324,14 +20345,14 @@ - + - + @@ -20358,21 +20379,21 @@ - + - + - + @@ -20380,7 +20401,7 @@ - + @@ -20439,21 +20460,21 @@ - + - + - + @@ -20461,7 +20482,7 @@ - + @@ -20490,21 +20511,21 @@ - + - + - + @@ -20512,7 +20533,7 @@ - + @@ -20541,21 +20562,21 @@ - + - + - + @@ -20563,7 +20584,7 @@ - + @@ -20617,7 +20638,7 @@ - + @@ -20625,14 +20646,14 @@ - + - + @@ -20676,7 +20697,7 @@ - + @@ -20684,14 +20705,14 @@ - + - + @@ -20738,7 +20759,7 @@ - + @@ -20746,14 +20767,14 @@ - + - + @@ -20775,70 +20796,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -20846,7 +20820,7 @@ - + @@ -21044,7 +21018,7 @@ - + @@ -21201,6 +21175,11 @@ + + + + + @@ -21326,6 +21305,16 @@ + + + + + + + + + + @@ -21430,21 +21419,21 @@ - + - + - + @@ -21452,7 +21441,7 @@ - + @@ -21476,21 +21465,21 @@ - + - + - + @@ -21498,7 +21487,7 @@ - + @@ -21532,21 +21521,21 @@ - + - + - + @@ -21554,7 +21543,7 @@ - + @@ -21577,67 +21566,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -21683,7 +21629,7 @@ - + @@ -21691,14 +21637,14 @@ - + - + @@ -21726,21 +21672,21 @@ - + - + - + @@ -21748,7 +21694,7 @@ - + @@ -21777,7 +21723,7 @@ - + @@ -21785,14 +21731,14 @@ - + - + @@ -21950,52 +21896,67 @@ - - + - + - + - + - + + + + + + + + + + + + - + - + - - - - - - - - - - - + - + + + + + + + + + + + + + + + + @@ -22006,21 +21967,21 @@ - + - + - + @@ -22028,7 +21989,7 @@ - + @@ -22082,7 +22043,7 @@ - + @@ -22090,14 +22051,14 @@ - + - + @@ -22124,21 +22085,21 @@ - + - + - + @@ -22146,7 +22107,7 @@ - + @@ -22175,7 +22136,7 @@ - + @@ -22183,14 +22144,14 @@ - + - + @@ -22252,21 +22213,21 @@ - + - + - + @@ -22274,7 +22235,7 @@ - + @@ -22313,21 +22274,21 @@ - + - + - + @@ -22335,7 +22296,7 @@ - + @@ -22376,21 +22337,21 @@ - + - + - + @@ -22398,7 +22359,7 @@ - + @@ -22432,21 +22393,21 @@ - + - + - + @@ -22454,7 +22415,7 @@ - + @@ -22478,7 +22439,7 @@ - + @@ -22486,14 +22447,14 @@ - + - + @@ -22515,21 +22476,21 @@ - + - + - + @@ -22537,7 +22498,7 @@ - + @@ -22566,21 +22527,21 @@ - + - + - + @@ -22588,7 +22549,7 @@ - + @@ -22623,6 +22584,11 @@ + + + + + @@ -22632,21 +22598,21 @@ - + - + - + @@ -22654,7 +22620,7 @@ - + @@ -22683,21 +22649,21 @@ - + - + - + @@ -22705,7 +22671,7 @@ - + @@ -22739,7 +22705,7 @@ - + @@ -22747,14 +22713,14 @@ - + - + @@ -22811,7 +22777,7 @@ - + @@ -22819,14 +22785,14 @@ - + - + @@ -22854,7 +22820,7 @@ - + @@ -22862,14 +22828,14 @@ - + - + @@ -22880,9 +22846,13 @@ + + + + @@ -22893,18 +22863,18 @@ - + - + - + @@ -22938,21 +22908,21 @@ - + - + - + @@ -22960,7 +22930,7 @@ - + @@ -22989,21 +22959,21 @@ - + - + - + @@ -23011,7 +22981,7 @@ - + @@ -23050,21 +23020,21 @@ - + - + - + @@ -23072,7 +23042,7 @@ - + @@ -23106,21 +23076,21 @@ - + - + - + @@ -23128,7 +23098,7 @@ - + @@ -23157,21 +23127,21 @@ - + - + - + @@ -23179,7 +23149,7 @@ - + @@ -23213,7 +23183,7 @@ - + @@ -23221,14 +23191,14 @@ - + - + @@ -23249,125 +23219,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -23375,14 +23233,14 @@ - + - + @@ -23403,13 +23261,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -23417,14 +23328,14 @@ - + - + @@ -23457,7 +23368,7 @@ - + @@ -23471,7 +23382,7 @@ - + @@ -23513,21 +23424,21 @@ - + - + - + @@ -23535,7 +23446,7 @@ - + @@ -23594,7 +23505,7 @@ - + @@ -23602,14 +23513,14 @@ - + - + @@ -23681,21 +23592,21 @@ - + - + - + @@ -23703,7 +23614,7 @@ - + @@ -23732,7 +23643,7 @@ - + @@ -23740,14 +23651,14 @@ - + - + @@ -23775,44 +23686,52 @@ - + - + - - + - + - + - - + + - - + + - + + + + + - - + + - + - - - + + + - - - + + + + + + + + @@ -23823,21 +23742,21 @@ - + - + - + @@ -23845,7 +23764,7 @@ - + @@ -23879,21 +23798,21 @@ - + - + - + @@ -23901,7 +23820,7 @@ - + @@ -23945,21 +23864,21 @@ - + - + - + @@ -23967,7 +23886,7 @@ - + @@ -24001,7 +23920,7 @@ - + @@ -24009,14 +23928,14 @@ - + - + @@ -24064,21 +23983,21 @@ - + - + - + @@ -24086,7 +24005,7 @@ - + @@ -24135,7 +24054,7 @@ - + @@ -24143,14 +24062,14 @@ - + - + @@ -24187,7 +24106,7 @@ - + @@ -24195,14 +24114,14 @@ - + - + @@ -24235,7 +24154,7 @@ - + @@ -24250,7 +24169,7 @@ - + @@ -24298,21 +24217,21 @@ - + - + - + @@ -24320,7 +24239,7 @@ - + @@ -24349,21 +24268,21 @@ - + - + - + @@ -24371,7 +24290,7 @@ - + @@ -24405,21 +24324,21 @@ - + - + - + @@ -24427,7 +24346,7 @@ - + @@ -24461,7 +24380,7 @@ - + @@ -24469,14 +24388,14 @@ - + - + @@ -24488,10 +24407,12 @@ + + @@ -24502,21 +24423,21 @@ - + - + - + @@ -24524,7 +24445,7 @@ - + @@ -24568,7 +24489,7 @@ - + @@ -24576,14 +24497,14 @@ - + - + @@ -24606,21 +24527,21 @@ - + - + - + @@ -24628,7 +24549,7 @@ - + @@ -24657,17 +24578,17 @@ - + - + - + @@ -24675,7 +24596,7 @@ - + @@ -24961,7 +24882,7 @@ - + @@ -24969,14 +24890,14 @@ - + - + @@ -25004,21 +24925,21 @@ - + - + - + @@ -25026,7 +24947,7 @@ - + @@ -25054,13 +24975,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -25068,14 +25055,14 @@ - + - + @@ -25086,9 +25073,13 @@ + + + + @@ -25099,21 +25090,21 @@ - + - + - + @@ -25121,7 +25112,7 @@ - + @@ -25155,7 +25146,7 @@ - + @@ -25163,14 +25154,14 @@ - + - + @@ -25180,10 +25171,14 @@ - + + + - + + + @@ -25194,7 +25189,7 @@ - + @@ -25202,14 +25197,14 @@ - + - + @@ -25282,7 +25277,7 @@ - + @@ -25290,14 +25285,14 @@ - + - + @@ -25325,21 +25320,21 @@ - + - + - + @@ -25347,7 +25342,7 @@ - + @@ -25396,7 +25391,7 @@ - + @@ -25404,14 +25399,14 @@ - + - + @@ -25443,13 +25438,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -25486,64 +25532,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -25551,14 +25546,14 @@ - + - + @@ -25620,21 +25615,21 @@ - + - + - + @@ -25642,7 +25637,7 @@ - + @@ -25691,21 +25686,21 @@ - + - + - + @@ -25713,7 +25708,7 @@ - + @@ -25762,21 +25757,21 @@ - + - + - + @@ -25784,7 +25779,7 @@ - + @@ -25813,7 +25808,7 @@ - + @@ -25821,14 +25816,14 @@ - + - + @@ -26006,7 +26001,7 @@ - + @@ -26014,14 +26009,14 @@ - + - + @@ -26048,64 +26043,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -26114,7 +26058,7 @@ - + @@ -26131,6 +26075,11 @@ + + + + + @@ -26148,7 +26097,7 @@ - + @@ -26199,13 +26148,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -26213,14 +26218,14 @@ - + - + @@ -26262,21 +26267,21 @@ - + - + - + @@ -26284,7 +26289,7 @@ - + @@ -26313,21 +26318,21 @@ - + - + - + @@ -26335,7 +26340,7 @@ - + @@ -26364,7 +26369,7 @@ - + @@ -26372,14 +26377,14 @@ - + - + @@ -26390,12 +26395,18 @@ + + + + + + @@ -26406,7 +26417,7 @@ - + @@ -26414,14 +26425,14 @@ - + - + @@ -26432,12 +26443,18 @@ + + + + + + @@ -26448,21 +26465,21 @@ - + - + - + @@ -26470,7 +26487,7 @@ - + @@ -26493,88 +26510,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -26582,7 +26538,7 @@ - + @@ -26611,7 +26567,7 @@ - + @@ -26619,14 +26575,14 @@ - + - + @@ -26658,7 +26614,7 @@ - + @@ -26666,14 +26622,14 @@ - + - + @@ -26731,21 +26687,21 @@ - + - + - + @@ -26753,7 +26709,7 @@ - + @@ -26787,21 +26743,21 @@ - + - + - + @@ -26809,7 +26765,7 @@ - + @@ -26838,7 +26794,7 @@ - + @@ -26846,14 +26802,14 @@ - + - + @@ -26885,7 +26841,7 @@ - + @@ -26893,14 +26849,14 @@ - + - + @@ -33548,21 +33504,21 @@ - + - + - + @@ -33570,7 +33526,7 @@ - + @@ -33604,7 +33560,7 @@ - + @@ -33612,14 +33568,14 @@ - + - + @@ -33652,7 +33608,7 @@ - + @@ -33660,14 +33616,14 @@ - + - + @@ -33677,10 +33633,14 @@ - + + + - + + + @@ -33691,21 +33651,21 @@ - + - + - + @@ -33713,7 +33673,7 @@ - + @@ -33731,80 +33691,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -33833,7 +33737,7 @@ - + @@ -33841,14 +33745,14 @@ - + - + @@ -33885,21 +33789,21 @@ - + - + - + @@ -33907,7 +33811,7 @@ - + @@ -33940,83 +33844,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -34024,7 +33872,7 @@ - + @@ -34048,21 +33896,21 @@ - + - + - + @@ -34070,7 +33918,7 @@ - + @@ -34104,7 +33952,7 @@ - + @@ -34112,14 +33960,14 @@ - + - + @@ -34300,7 +34148,7 @@ - + @@ -34401,7 +34249,7 @@ - + @@ -34409,14 +34257,14 @@ - + - + @@ -34453,7 +34301,7 @@ - + @@ -34461,14 +34309,14 @@ - + - + @@ -34520,26 +34368,26 @@ - + - + - + - + - + - - + + - + @@ -34547,7 +34395,58 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34576,21 +34475,21 @@ - + - + - + @@ -34598,7 +34497,7 @@ - + @@ -34630,21 +34529,21 @@ - + - + - + @@ -34652,8 +34551,8 @@ - - + + @@ -34686,7 +34585,7 @@ - + @@ -34694,14 +34593,14 @@ - + - + @@ -34728,21 +34627,21 @@ - + - + - + @@ -34750,7 +34649,7 @@ - + @@ -34789,21 +34688,21 @@ - + - + - + @@ -34811,7 +34710,7 @@ - + @@ -34845,7 +34744,7 @@ - + @@ -34853,14 +34752,14 @@ - + - + @@ -34906,83 +34805,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -34990,7 +34833,7 @@ - + @@ -35039,21 +34882,21 @@ - + - + - + @@ -35061,7 +34904,7 @@ - + @@ -35175,21 +35018,21 @@ - + - + - + @@ -35197,7 +35040,7 @@ - + @@ -35226,21 +35069,21 @@ - + - + - + @@ -35248,7 +35091,7 @@ - + @@ -35347,21 +35190,21 @@ - + - + - + @@ -35369,7 +35212,7 @@ - + @@ -35398,21 +35241,21 @@ - + - + - + @@ -35420,7 +35263,7 @@ - + @@ -35454,21 +35297,21 @@ - + - + - + @@ -35476,7 +35319,7 @@ - + @@ -35500,26 +35343,26 @@ - + - + - + - + - + - - + + - + @@ -35527,7 +35370,83 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -35561,21 +35480,21 @@ - + - + - + @@ -35583,7 +35502,7 @@ - + @@ -35607,21 +35526,21 @@ - + - + - + @@ -35629,7 +35548,7 @@ - + @@ -35658,21 +35577,21 @@ - + - + - + @@ -35680,7 +35599,7 @@ - + @@ -35706,9 +35625,14 @@ - + - + + + + + + @@ -35719,21 +35643,21 @@ - + - + - + @@ -35741,7 +35665,7 @@ - + @@ -35749,14 +35673,22 @@ + + - + + + + + + + @@ -35767,21 +35699,21 @@ - + - + - + @@ -35789,7 +35721,7 @@ - + @@ -35813,21 +35745,21 @@ - + - + - + @@ -35835,7 +35767,7 @@ - + @@ -35874,21 +35806,21 @@ - + - + - + @@ -35896,7 +35828,7 @@ - + @@ -35925,21 +35857,21 @@ - + - + - + @@ -35947,7 +35879,7 @@ - + @@ -35966,26 +35898,26 @@ - + - + - + - + - + - - + + - + @@ -35993,40 +35925,40 @@ - - + + - + + + + + + + + + + + - - - - - - + - - - - - - - - - - - - - + + + - - - + + + + + + + + @@ -36037,7 +35969,7 @@ - + @@ -36045,14 +35977,14 @@ - + - + @@ -36095,21 +36027,21 @@ - + - + - + @@ -36117,7 +36049,7 @@ - + @@ -36151,17 +36083,17 @@ - + - + - + @@ -36169,7 +36101,7 @@ - + @@ -36207,6 +36139,7 @@ + @@ -36242,21 +36175,21 @@ - + - + - + @@ -36264,7 +36197,7 @@ - + @@ -36318,7 +36251,7 @@ - + @@ -36362,21 +36295,21 @@ - + - + - + @@ -36384,7 +36317,7 @@ - + @@ -36418,21 +36351,21 @@ - + - + - + @@ -36440,7 +36373,7 @@ - + @@ -36519,7 +36452,7 @@ - + @@ -36527,14 +36460,14 @@ - + - + @@ -36567,7 +36500,7 @@ - + @@ -36575,14 +36508,14 @@ - + - + @@ -36624,7 +36557,7 @@ - + @@ -36632,14 +36565,14 @@ - + - + @@ -36672,7 +36605,7 @@ - + @@ -36680,14 +36613,14 @@ - + - + @@ -36765,21 +36698,21 @@ - + - + - + @@ -36787,7 +36720,7 @@ - + @@ -36821,21 +36754,21 @@ - + - + - + @@ -36843,7 +36776,7 @@ - + @@ -36877,21 +36810,21 @@ - + - + - + @@ -36899,7 +36832,7 @@ - + @@ -36948,21 +36881,21 @@ - + - + - + @@ -36970,7 +36903,7 @@ - + @@ -37024,21 +36957,21 @@ - + - + - + @@ -37046,7 +36979,7 @@ - + @@ -37070,7 +37003,7 @@ - + @@ -37078,14 +37011,14 @@ - + - + @@ -37112,21 +37045,21 @@ - + - + - + @@ -37134,7 +37067,7 @@ - + @@ -37168,7 +37101,7 @@ - + @@ -37176,14 +37109,14 @@ - + - + @@ -37205,21 +37138,21 @@ - + - + - + @@ -37227,7 +37160,7 @@ - + @@ -37256,21 +37189,21 @@ - + - + - + @@ -37278,7 +37211,7 @@ - + @@ -37322,7 +37255,7 @@ - + @@ -37330,14 +37263,14 @@ - + - + @@ -37370,7 +37303,7 @@ - + @@ -37378,14 +37311,14 @@ - + - + @@ -37393,7 +37326,7 @@ - + @@ -37482,21 +37415,21 @@ - + - + - + @@ -37504,7 +37437,7 @@ - + @@ -37533,18 +37466,18 @@ - + - + - + @@ -37573,7 +37506,7 @@ - + @@ -37581,14 +37514,14 @@ - + - + @@ -37630,21 +37563,21 @@ - + - + - + @@ -37652,7 +37585,7 @@ - + @@ -37676,21 +37609,21 @@ - + - + - + @@ -37698,7 +37631,7 @@ - + @@ -37722,7 +37655,7 @@ - + @@ -37730,14 +37663,14 @@ - + - + @@ -37784,7 +37717,7 @@ - + @@ -37792,20 +37725,20 @@ - + - + - + @@ -37853,21 +37786,21 @@ - + - + - + @@ -37875,7 +37808,7 @@ - + @@ -37949,7 +37882,7 @@ - + @@ -37957,14 +37890,14 @@ - + - + @@ -38011,21 +37944,21 @@ - + - + - + @@ -38033,7 +37966,7 @@ - + @@ -38062,7 +37995,7 @@ - + @@ -38070,14 +38003,14 @@ - + - + @@ -38300,21 +38233,21 @@ - + - + - + @@ -38322,7 +38255,7 @@ - + @@ -38356,7 +38289,7 @@ - + @@ -38364,14 +38297,14 @@ - + - + @@ -41363,26 +41296,26 @@ - + - + - + - + - + - - + + - + @@ -41390,7 +41323,88 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -41419,21 +41433,21 @@ - + - + - + @@ -41441,7 +41455,7 @@ - + @@ -41470,7 +41484,7 @@ - + @@ -41478,14 +41492,14 @@ - + - + @@ -41538,21 +41552,21 @@ - + - + - + @@ -41563,7 +41577,7 @@ - + @@ -42938,21 +42952,21 @@ - + - + - + @@ -42960,7 +42974,7 @@ - + @@ -42988,70 +43002,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -43059,7 +43030,7 @@ - + @@ -43138,21 +43109,21 @@ - + - + - + @@ -43160,7 +43131,7 @@ - + @@ -43224,21 +43195,21 @@ - + - + - + @@ -43246,7 +43217,7 @@ - + @@ -43275,21 +43246,21 @@ - + - + - + @@ -43297,7 +43268,7 @@ - + @@ -43336,7 +43307,7 @@ - + @@ -43344,14 +43315,14 @@ - + - + @@ -43389,26 +43360,26 @@ - + - + - + - + - + - - + + - + @@ -43416,7 +43387,158 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43449,83 +43571,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -43533,7 +43599,7 @@ - + @@ -43592,7 +43658,7 @@ - + @@ -43600,14 +43666,14 @@ - + - + @@ -43635,21 +43701,21 @@ - + - + - + @@ -43657,7 +43723,7 @@ - + @@ -43705,7 +43771,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43716,21 +43838,21 @@ - + - + - + @@ -43738,7 +43860,7 @@ - + @@ -43767,7 +43889,7 @@ - + @@ -43775,14 +43897,14 @@ - + - + @@ -43829,21 +43951,21 @@ - + - + - + @@ -43851,7 +43973,7 @@ - + @@ -43875,21 +43997,21 @@ - + - + - + @@ -43897,7 +44019,7 @@ - + @@ -43931,7 +44053,7 @@ - + @@ -43939,14 +44061,14 @@ - + - + @@ -43998,21 +44120,21 @@ - + - + - + @@ -44020,7 +44142,7 @@ - + @@ -44064,7 +44186,7 @@ - + @@ -44072,14 +44194,14 @@ - + - + @@ -44151,6 +44273,11 @@ + + + + + @@ -44160,21 +44287,21 @@ - + - + - + @@ -44182,7 +44309,7 @@ - + @@ -44216,21 +44343,21 @@ - + - + - + @@ -44238,7 +44365,7 @@ - + @@ -44277,7 +44404,7 @@ - + @@ -44285,14 +44412,14 @@ - + - + @@ -44331,69 +44458,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -44401,14 +44472,14 @@ - + - + @@ -44419,12 +44490,18 @@ + + + + + + @@ -44435,7 +44512,7 @@ - + @@ -44443,14 +44520,14 @@ - + - + @@ -44483,18 +44560,18 @@ - + - + - + @@ -44558,7 +44635,7 @@ - + @@ -44566,14 +44643,14 @@ - + - + @@ -44616,21 +44693,21 @@ - + - + - + @@ -44638,7 +44715,7 @@ - + @@ -44662,21 +44739,21 @@ - + - + - + @@ -44684,130 +44761,130 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -44818,21 +44895,21 @@ - + - + - + @@ -44840,7 +44917,7 @@ - + @@ -44884,21 +44961,21 @@ - + - + - + @@ -44906,7 +44983,7 @@ - + @@ -44940,7 +45017,7 @@ - + @@ -44948,14 +45025,14 @@ - + - + @@ -44988,21 +45065,21 @@ - + - + - + @@ -45010,7 +45087,7 @@ - + @@ -45034,7 +45111,7 @@ - + @@ -45042,14 +45119,14 @@ - + - + @@ -45086,7 +45163,7 @@ - + @@ -45094,14 +45171,14 @@ - + - + @@ -45111,13 +45188,19 @@ - + + + - + + + - + + + @@ -45128,21 +45211,21 @@ - + - + - + @@ -45150,7 +45233,7 @@ - + @@ -45179,7 +45262,7 @@ - + @@ -45187,14 +45270,14 @@ - + - + @@ -45205,22 +45288,78 @@ - + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + @@ -45231,7 +45370,7 @@ - + @@ -45303,21 +45442,21 @@ - + - + - + @@ -45325,7 +45464,7 @@ - + @@ -45379,21 +45518,21 @@ - + - + - + @@ -45401,20 +45540,35 @@ - - + + - + - + + + + + + + + + + + + + + + + @@ -45425,21 +45579,21 @@ - + - + - + @@ -45447,7 +45601,7 @@ - + @@ -45486,21 +45640,21 @@ - + - + - + @@ -45508,7 +45662,7 @@ - + @@ -45537,26 +45691,26 @@ - + - + - + - + - + - - + + - + @@ -45564,7 +45718,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45593,21 +45803,21 @@ - + - + - + @@ -45615,7 +45825,7 @@ - + @@ -45654,7 +45864,7 @@ - + @@ -45662,14 +45872,14 @@ - + - + @@ -45766,21 +45976,21 @@ - + - + - + @@ -45788,7 +45998,7 @@ - + @@ -45822,21 +46032,21 @@ - + - + - + @@ -45844,7 +46054,7 @@ - + @@ -45913,7 +46123,7 @@ - + @@ -45921,14 +46131,14 @@ - + - + @@ -45985,7 +46195,7 @@ - + @@ -45993,14 +46203,14 @@ - + - + @@ -46038,7 +46248,7 @@ - + @@ -46046,14 +46256,14 @@ - + - + @@ -46084,69 +46294,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -46154,7 +46308,7 @@ - + @@ -46166,242 +46320,242 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -46413,7 +46567,7 @@ - + @@ -46421,14 +46575,14 @@ - + - + @@ -46436,7 +46590,7 @@ - + @@ -46567,83 +46721,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -46651,7 +46749,7 @@ - + @@ -46740,21 +46838,21 @@ - + - + - + @@ -46762,7 +46860,7 @@ - + @@ -46801,7 +46899,7 @@ - + @@ -46809,14 +46907,14 @@ - + - + @@ -46844,21 +46942,21 @@ - + - + - + @@ -46866,7 +46964,7 @@ - + @@ -46905,21 +47003,21 @@ - + - + - + @@ -46927,7 +47025,7 @@ - + @@ -46956,21 +47054,21 @@ - + - + - + @@ -46978,7 +47076,7 @@ - + @@ -47012,21 +47110,21 @@ - + - + - + @@ -47034,7 +47132,7 @@ - + @@ -47098,7 +47196,7 @@ - + @@ -47106,14 +47204,14 @@ - + - + @@ -47141,21 +47239,21 @@ - + - + - + @@ -47163,7 +47261,7 @@ - + @@ -47187,21 +47285,21 @@ - + - + - + @@ -47209,7 +47307,7 @@ - + @@ -47243,21 +47341,21 @@ - + - + - + @@ -47265,7 +47363,7 @@ - + @@ -47289,21 +47387,21 @@ - + - + - + @@ -47311,7 +47409,7 @@ - + @@ -47345,7 +47443,7 @@ - + @@ -47353,14 +47451,14 @@ - + - + @@ -47468,21 +47566,21 @@ - + - + - + @@ -47490,7 +47588,7 @@ - + @@ -47523,27 +47621,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -47551,7 +47693,7 @@ - + @@ -47600,21 +47742,21 @@ - + - + - + @@ -47622,7 +47764,7 @@ - + @@ -47651,7 +47793,7 @@ - + @@ -47659,14 +47801,14 @@ - + - + @@ -47712,7 +47854,7 @@ - + @@ -47753,18 +47895,18 @@ - + - + - + @@ -47837,18 +47979,18 @@ - + - + - + @@ -47898,21 +48040,21 @@ - + - + - + @@ -47920,7 +48062,7 @@ - + @@ -47949,21 +48091,21 @@ - + - + - + @@ -47971,7 +48113,7 @@ - + @@ -48005,7 +48147,7 @@ - + @@ -48013,14 +48155,14 @@ - + - + @@ -48062,21 +48204,21 @@ - + - + - + @@ -48084,7 +48226,7 @@ - + @@ -48113,7 +48255,7 @@ - + @@ -48121,14 +48263,14 @@ - + - + @@ -48142,7 +48284,7 @@ - + @@ -48203,21 +48345,21 @@ - + - + - + @@ -48225,7 +48367,7 @@ - + @@ -48249,17 +48391,17 @@ - + - + - + @@ -48267,7 +48409,7 @@ - + @@ -48291,7 +48433,7 @@ - + @@ -48299,21 +48441,21 @@ - + - + - + @@ -48442,83 +48584,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -48526,7 +48612,7 @@ - + @@ -48575,7 +48661,7 @@ - + @@ -48590,7 +48676,7 @@ - + @@ -48647,21 +48733,21 @@ - + - + - + @@ -48669,7 +48755,7 @@ - + @@ -48703,21 +48789,21 @@ - + - + - + @@ -48725,7 +48811,7 @@ - + @@ -48759,18 +48845,18 @@ - + - + - + @@ -48818,83 +48904,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -48902,7 +48932,7 @@ - + @@ -48936,21 +48966,21 @@ - + - + - + @@ -48958,7 +48988,7 @@ - + @@ -48997,21 +49027,21 @@ - + - + - + @@ -49019,7 +49049,7 @@ - + @@ -49043,7 +49073,7 @@ - + @@ -49051,14 +49081,14 @@ - + - + @@ -49080,78 +49110,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -49159,7 +49138,7 @@ - + @@ -49193,11 +49172,11 @@ - - - - - + + + + + @@ -49208,21 +49187,21 @@ - + - + - + @@ -49230,7 +49209,7 @@ - + @@ -49254,7 +49233,7 @@ - + @@ -49262,14 +49241,14 @@ - + - + @@ -49280,9 +49259,28 @@ + + + + + + + + + + + + + + + + + + + @@ -49293,21 +49291,21 @@ - + - + - + @@ -49315,7 +49313,7 @@ - + @@ -49379,7 +49377,7 @@ - + @@ -49387,14 +49385,14 @@ - + - + @@ -49453,21 +49451,21 @@ - + - + - + @@ -49475,7 +49473,7 @@ - + @@ -49486,9 +49484,9 @@ - - - + + + @@ -49509,21 +49507,21 @@ - + - + - + @@ -49531,7 +49529,7 @@ - + @@ -49580,21 +49578,21 @@ - + - + - + @@ -49602,7 +49600,7 @@ - + @@ -49617,6 +49615,11 @@ + + + + + @@ -49642,6 +49645,11 @@ + + + + + @@ -49651,21 +49659,21 @@ - + - + - + @@ -49673,7 +49681,7 @@ - + @@ -49702,7 +49710,7 @@ - + @@ -49710,14 +49718,14 @@ - + - + @@ -49754,21 +49762,21 @@ - + - + - + @@ -49776,7 +49784,7 @@ - + @@ -49825,21 +49833,21 @@ - + - + - + @@ -49847,7 +49855,7 @@ - + @@ -49881,21 +49889,21 @@ - + - + - + @@ -49903,7 +49911,7 @@ - + @@ -49937,7 +49945,7 @@ - + @@ -49945,14 +49953,14 @@ - + - + @@ -49975,21 +49983,21 @@ - + - + - + @@ -49997,7 +50005,7 @@ - + @@ -50031,7 +50039,7 @@ - + @@ -50039,14 +50047,14 @@ - + - + @@ -50057,9 +50065,13 @@ + + + + @@ -50070,7 +50082,7 @@ - + @@ -50078,14 +50090,14 @@ - + - + @@ -50110,7 +50122,7 @@ - + @@ -50143,21 +50155,21 @@ - + - + - + @@ -50165,7 +50177,7 @@ - + @@ -50204,21 +50216,21 @@ - + - + - + @@ -50226,7 +50238,7 @@ - + @@ -50360,21 +50372,21 @@ - + - + - + @@ -50382,7 +50394,7 @@ - + @@ -50416,7 +50428,7 @@ - + @@ -50424,14 +50436,14 @@ - + - + @@ -50459,7 +50471,7 @@ - + @@ -50467,14 +50479,14 @@ - + - + @@ -50506,7 +50518,7 @@ - + @@ -50514,14 +50526,14 @@ - + - + @@ -50564,21 +50576,21 @@ - + - + - + @@ -50586,7 +50598,7 @@ - + @@ -50620,18 +50632,18 @@ - + - + - + @@ -50684,21 +50696,21 @@ - + - + - + @@ -50706,7 +50718,7 @@ - + @@ -50745,21 +50757,21 @@ - + - + - + @@ -50767,7 +50779,7 @@ - + @@ -50796,21 +50808,21 @@ - + - + - + @@ -50818,7 +50830,7 @@ - + @@ -50847,21 +50859,21 @@ - + - + - + @@ -50869,7 +50881,7 @@ - + @@ -50908,21 +50920,21 @@ - + - + - + @@ -50930,7 +50942,7 @@ - + @@ -50959,21 +50971,21 @@ - + - + - + @@ -50981,7 +50993,7 @@ - + @@ -51005,21 +51017,21 @@ - + - + - + @@ -51027,7 +51039,7 @@ - + @@ -51186,7 +51198,7 @@ - + @@ -51194,14 +51206,14 @@ - + - + @@ -51304,21 +51316,21 @@ - + - + - + @@ -51326,7 +51338,7 @@ - + @@ -51360,21 +51372,21 @@ - + - + - + @@ -51382,7 +51394,7 @@ - + @@ -51421,21 +51433,21 @@ - + - + - + @@ -51443,7 +51455,7 @@ - + @@ -51472,21 +51484,21 @@ - + - + - + @@ -51494,7 +51506,7 @@ - + @@ -51523,21 +51535,21 @@ - + - + - + @@ -51545,7 +51557,7 @@ - + @@ -51578,13 +51590,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -51592,14 +51730,14 @@ - + - + @@ -51637,21 +51775,21 @@ - + - + - + @@ -51659,7 +51797,7 @@ - + @@ -51693,21 +51831,21 @@ - + - + - + @@ -51715,7 +51853,7 @@ - + @@ -51764,21 +51902,21 @@ - + - + - + @@ -51786,7 +51924,7 @@ - + @@ -51830,21 +51968,21 @@ - + - + - + @@ -51852,7 +51990,7 @@ - + @@ -51881,21 +52019,21 @@ - + - + - + @@ -51903,7 +52041,7 @@ - + @@ -51927,21 +52065,21 @@ - + - + - - + + - + @@ -51949,7 +52087,7 @@ - + @@ -52018,21 +52156,21 @@ - + - + - + @@ -52040,7 +52178,7 @@ - + @@ -52064,21 +52202,21 @@ - + - + - + @@ -52086,7 +52224,7 @@ - + @@ -52120,7 +52258,7 @@ - + @@ -52128,14 +52266,14 @@ - + - + @@ -52163,7 +52301,7 @@ - + @@ -52171,14 +52309,14 @@ - + - + @@ -52211,21 +52349,21 @@ - + - + - + @@ -52233,8 +52371,8 @@ - - + + @@ -52277,7 +52415,7 @@ - + @@ -52293,7 +52431,7 @@ - + @@ -52332,7 +52470,7 @@ - + @@ -52348,7 +52486,7 @@ - + @@ -52381,7 +52519,7 @@ - + @@ -52392,7 +52530,7 @@ - + @@ -52487,7 +52625,7 @@ - + @@ -54049,11 +54187,11 @@ - + - + @@ -57970,7 +58108,7 @@ - + @@ -57993,7 +58131,7 @@ - + @@ -58039,7 +58177,7 @@ - + @@ -58198,7 +58336,7 @@ - + @@ -58218,7 +58356,7 @@ - + @@ -58226,18 +58364,18 @@ - + - + - + @@ -58254,7 +58392,7 @@ - + @@ -58262,18 +58400,18 @@ - + - + - + @@ -58299,7 +58437,7 @@ - + @@ -58307,19 +58445,20 @@ - + - + - + + @@ -58346,7 +58485,7 @@ - + @@ -58354,19 +58493,20 @@ - + - + - + + @@ -58381,7 +58521,7 @@ - + @@ -58389,19 +58529,20 @@ - + - + - + + @@ -58416,7 +58557,7 @@ - + @@ -58424,14 +58565,14 @@ - + - + @@ -58439,8 +58580,9 @@ - + + @@ -58455,7 +58597,7 @@ - + @@ -58463,14 +58605,14 @@ - + - + @@ -58478,8 +58620,9 @@ - + + @@ -58494,7 +58637,7 @@ - + @@ -58502,18 +58645,18 @@ - + - + - + @@ -58535,7 +58678,7 @@ - + @@ -58543,14 +58686,14 @@ - + - + @@ -58558,8 +58701,9 @@ - + + @@ -58574,7 +58718,7 @@ - + @@ -58582,14 +58726,14 @@ - + - + @@ -58597,8 +58741,9 @@ - + + @@ -58613,7 +58758,7 @@ - + @@ -58621,19 +58766,20 @@ - + - + - + + @@ -58642,52 +58788,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -58695,14 +58802,14 @@ - + - + @@ -58710,8 +58817,9 @@ - + + @@ -58720,13 +58828,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -58734,14 +58879,14 @@ - + - + @@ -58749,8 +58894,9 @@ - + + @@ -58765,7 +58911,7 @@ - + @@ -58773,19 +58919,20 @@ - + - + - + + @@ -58800,7 +58947,7 @@ - + @@ -58808,14 +58955,14 @@ - + - + @@ -58823,8 +58970,9 @@ - + + @@ -58839,7 +58987,7 @@ - + @@ -58847,19 +58995,20 @@ - + - + - + + @@ -58875,7 +59024,7 @@ - + @@ -58883,19 +59032,20 @@ - + - + - + + @@ -58910,7 +59060,7 @@ - + @@ -58918,14 +59068,14 @@ - + - + @@ -58933,8 +59083,9 @@ - + + @@ -58949,7 +59100,7 @@ - + @@ -58957,19 +59108,20 @@ - + - + - + + @@ -58985,7 +59137,7 @@ - + @@ -58993,14 +59145,14 @@ - + - + @@ -59008,8 +59160,9 @@ - + + @@ -59024,7 +59177,7 @@ - + @@ -59032,14 +59185,14 @@ - + - + @@ -59047,8 +59200,9 @@ - + + @@ -59063,7 +59217,7 @@ - + @@ -59071,14 +59225,14 @@ - + - + @@ -59086,8 +59240,9 @@ - + + @@ -59102,7 +59257,7 @@ - + @@ -59110,14 +59265,14 @@ - + - + @@ -59125,8 +59280,9 @@ - + + @@ -59141,7 +59297,7 @@ - + @@ -59149,18 +59305,18 @@ - + - + - + @@ -59182,7 +59338,7 @@ - + @@ -59190,19 +59346,20 @@ - + - + - + + @@ -59217,7 +59374,7 @@ - + @@ -59225,18 +59382,18 @@ - + - + - + @@ -59266,7 +59423,7 @@ - + @@ -59274,14 +59431,14 @@ - + - + @@ -59289,8 +59446,9 @@ - + + @@ -59305,7 +59463,7 @@ - + @@ -59313,14 +59471,14 @@ - + - + @@ -59328,8 +59486,9 @@ - + + @@ -59344,7 +59503,7 @@ - + @@ -59352,14 +59511,14 @@ - + - + @@ -59367,8 +59526,9 @@ - + + @@ -59383,7 +59543,7 @@ - + @@ -59391,14 +59551,14 @@ - + - + @@ -59406,8 +59566,9 @@ - + + @@ -59422,7 +59583,7 @@ - + @@ -59430,14 +59591,14 @@ - + - + @@ -59445,8 +59606,9 @@ - + + @@ -59461,7 +59623,7 @@ - + @@ -59469,14 +59631,14 @@ - + - + @@ -59484,8 +59646,9 @@ - + + @@ -59501,7 +59664,7 @@ - + @@ -59509,18 +59672,18 @@ - + - + - + @@ -59585,7 +59748,7 @@ - + @@ -59593,14 +59756,14 @@ - + - + @@ -59608,8 +59771,9 @@ - + + @@ -59624,7 +59788,7 @@ - + @@ -59632,14 +59796,14 @@ - + - + @@ -59647,8 +59811,9 @@ - + + @@ -59657,52 +59822,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -59710,19 +59836,20 @@ - + - + - + + @@ -59732,13 +59859,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -59746,14 +59913,14 @@ - + - + @@ -59761,8 +59928,9 @@ - + + @@ -59777,7 +59945,7 @@ - + @@ -59785,19 +59953,20 @@ - + - + - + + @@ -59812,7 +59981,7 @@ - + @@ -59820,14 +59989,14 @@ - + - + @@ -59869,7 +60038,7 @@ - + @@ -59877,14 +60046,14 @@ - + - + @@ -59892,8 +60061,9 @@ - + + @@ -59902,13 +60072,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -59916,14 +60126,14 @@ - + - + @@ -59931,8 +60141,9 @@ - + + @@ -59947,7 +60158,7 @@ - + @@ -59955,14 +60166,14 @@ - + - + @@ -59970,8 +60181,9 @@ - + + @@ -59986,7 +60198,7 @@ - + @@ -59994,19 +60206,20 @@ - + - + - + + @@ -60022,7 +60235,7 @@ - + @@ -60030,14 +60243,14 @@ - + - + @@ -60045,7 +60258,7 @@ - + @@ -60061,13 +60274,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -60075,19 +60328,20 @@ - + - + - + + @@ -60098,27 +60352,27 @@ - + - + - + - + - + - - + + - + @@ -60126,11 +60380,12 @@ - - + + + - + @@ -60142,7 +60397,7 @@ - + @@ -60150,14 +60405,14 @@ - + - + @@ -60165,8 +60420,9 @@ - + + @@ -60175,13 +60431,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -60189,14 +60485,14 @@ - + - + @@ -60204,8 +60500,9 @@ - + + @@ -60221,7 +60518,7 @@ - + @@ -60229,19 +60526,20 @@ - + - + - + + @@ -60257,7 +60555,7 @@ - + @@ -60265,14 +60563,14 @@ - + - + @@ -60280,8 +60578,9 @@ - + + @@ -60296,7 +60595,7 @@ - + @@ -60304,14 +60603,14 @@ - + - + @@ -60319,8 +60618,9 @@ - + + @@ -60335,7 +60635,7 @@ - + @@ -60343,14 +60643,14 @@ - + - + @@ -60358,8 +60658,9 @@ - + + @@ -60374,7 +60675,7 @@ - + @@ -60389,7 +60690,7 @@ - + @@ -60397,7 +60698,7 @@ - + @@ -86018,7 +86319,7 @@ - + @@ -86026,14 +86327,14 @@ - + - + @@ -86041,8 +86342,9 @@ - + + @@ -86051,52 +86353,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -86104,18 +86367,18 @@ - + - + - + @@ -86132,7 +86395,7 @@ - + @@ -86140,19 +86403,20 @@ - + - + - + + @@ -86168,7 +86432,7 @@ - + @@ -86176,19 +86440,20 @@ - + - + - + + @@ -86204,7 +86469,7 @@ - + @@ -86212,14 +86477,14 @@ - + - + @@ -86227,8 +86492,9 @@ - + + @@ -86243,7 +86509,7 @@ - + @@ -86251,19 +86517,20 @@ - + - + - + + @@ -86278,7 +86545,7 @@ - + @@ -86286,14 +86553,14 @@ - + - + @@ -86301,8 +86568,9 @@ - + + @@ -86317,7 +86585,7 @@ - + @@ -86325,14 +86593,14 @@ - + - + @@ -86340,8 +86608,9 @@ - + + @@ -86356,7 +86625,7 @@ - + @@ -86364,19 +86633,20 @@ - + - + - + + @@ -86391,7 +86661,7 @@ - + @@ -86399,14 +86669,14 @@ - + - + @@ -86414,8 +86684,9 @@ - + + @@ -86430,7 +86701,7 @@ - + @@ -86438,19 +86709,20 @@ - + - + - + + @@ -86466,7 +86738,7 @@ - + @@ -86474,19 +86746,20 @@ - + - + - + + @@ -86502,7 +86775,7 @@ - + @@ -86510,18 +86783,18 @@ - + - + - + @@ -86544,7 +86817,7 @@ - + @@ -86552,14 +86825,14 @@ - + - + @@ -86567,8 +86840,9 @@ - + + @@ -86584,7 +86858,7 @@ - + @@ -86592,14 +86866,14 @@ - + - + @@ -86607,8 +86881,9 @@ - - + + + @@ -86617,127 +86892,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -86745,14 +86906,14 @@ - + - + @@ -86760,7 +86921,7 @@ - + @@ -86832,7 +86993,7 @@ - + @@ -86840,19 +87001,20 @@ - + - + - + + @@ -86867,7 +87029,7 @@ - + @@ -86875,14 +87037,14 @@ - + - + @@ -86890,8 +87052,9 @@ - + + @@ -86906,7 +87069,7 @@ - + @@ -86914,18 +87077,18 @@ - + - + - + @@ -86941,7 +87104,7 @@ - + @@ -86949,14 +87112,14 @@ - + - + @@ -86964,8 +87127,9 @@ - + + @@ -86980,7 +87144,7 @@ - + @@ -86988,14 +87152,14 @@ - + - + @@ -87003,7 +87167,7 @@ - + @@ -87106,7 +87270,7 @@ - + @@ -87114,14 +87278,14 @@ - + - + @@ -87129,8 +87293,9 @@ - + + @@ -87145,7 +87310,7 @@ - + @@ -87160,7 +87325,7 @@ - + @@ -87168,7 +87333,7 @@ - + @@ -87653,7 +87818,7 @@ - + @@ -87668,7 +87833,7 @@ - + @@ -87711,7 +87876,7 @@ - + @@ -87719,14 +87884,14 @@ - + - + @@ -87734,8 +87899,9 @@ - + + @@ -87750,7 +87916,7 @@ - + @@ -87765,7 +87931,7 @@ - + @@ -87775,6 +87941,7 @@ + @@ -87838,7 +88005,7 @@ - + @@ -87846,14 +88013,14 @@ - + - + @@ -87861,8 +88028,9 @@ - + + @@ -87877,7 +88045,7 @@ - + @@ -87885,14 +88053,14 @@ - + - + @@ -87900,8 +88068,9 @@ - + + @@ -87916,7 +88085,7 @@ - + @@ -87924,14 +88093,14 @@ - + - + @@ -87939,8 +88108,9 @@ - + + @@ -87955,7 +88125,7 @@ - + @@ -87963,14 +88133,14 @@ - + - + @@ -87978,8 +88148,9 @@ - + + @@ -87994,7 +88165,7 @@ - + @@ -88002,19 +88173,20 @@ - + - + - + + @@ -88030,7 +88202,7 @@ - + @@ -88038,18 +88210,18 @@ - + - + - + @@ -88096,7 +88268,7 @@ - + @@ -88104,14 +88276,14 @@ - + - + @@ -88119,8 +88291,9 @@ - + + @@ -88129,13 +88302,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -88143,14 +88356,14 @@ - + - + @@ -88158,8 +88371,9 @@ - + + @@ -88174,7 +88388,7 @@ - + @@ -88182,18 +88396,18 @@ - + - + - + @@ -88219,7 +88433,7 @@ - + @@ -88227,18 +88441,18 @@ - + - + - + @@ -88260,7 +88474,7 @@ - + @@ -88268,19 +88482,20 @@ - + - + - + + @@ -88296,7 +88511,7 @@ - + @@ -88304,18 +88519,18 @@ - + - + - + @@ -88345,7 +88560,7 @@ - + @@ -88353,14 +88568,14 @@ - + - + @@ -88368,8 +88583,9 @@ - + + @@ -88384,7 +88600,7 @@ - + @@ -88392,18 +88608,18 @@ - + - + - + @@ -88432,7 +88648,7 @@ - + @@ -88440,18 +88656,18 @@ - + - + - + @@ -88473,7 +88689,7 @@ - + @@ -88481,18 +88697,18 @@ - + - + - + @@ -88514,7 +88730,7 @@ - + @@ -88522,14 +88738,14 @@ - + - + @@ -88537,8 +88753,9 @@ - + + @@ -88553,7 +88770,7 @@ - + @@ -88561,14 +88778,14 @@ - + - + @@ -88576,8 +88793,9 @@ - + + @@ -88592,7 +88810,7 @@ - + @@ -88600,18 +88818,18 @@ - + - + - + @@ -88628,7 +88846,7 @@ - + @@ -88636,14 +88854,14 @@ - + - + @@ -88651,8 +88869,9 @@ - + + @@ -88667,7 +88886,7 @@ - + @@ -88675,14 +88894,14 @@ - + - + @@ -88706,7 +88925,7 @@ - + @@ -88714,14 +88933,14 @@ - + - + @@ -88729,8 +88948,9 @@ - + + @@ -88745,7 +88965,7 @@ - + @@ -88753,14 +88973,14 @@ - + - + @@ -88768,7 +88988,7 @@ - + @@ -88840,7 +89060,7 @@ - + @@ -88848,14 +89068,14 @@ - + - + @@ -88863,8 +89083,9 @@ - + + @@ -88879,7 +89100,7 @@ - + @@ -88887,19 +89108,20 @@ - + - + - + + @@ -88914,7 +89136,7 @@ - + @@ -88922,18 +89144,18 @@ - + - + - + @@ -88958,7 +89180,7 @@ - + @@ -88966,18 +89188,18 @@ - + - + - + @@ -88994,7 +89216,7 @@ - + @@ -89002,14 +89224,14 @@ - + - + @@ -89017,8 +89239,9 @@ - + + @@ -89033,7 +89256,7 @@ - + @@ -89041,14 +89264,14 @@ - + - + @@ -89056,8 +89279,9 @@ - + + @@ -89072,7 +89296,7 @@ - + @@ -89080,14 +89304,14 @@ - + - + @@ -89095,8 +89319,9 @@ - - + + + @@ -89111,7 +89336,7 @@ - + @@ -89119,14 +89344,14 @@ - + - + @@ -89134,8 +89359,9 @@ - + + @@ -89150,7 +89376,7 @@ - + @@ -89158,18 +89384,18 @@ - + - + - + @@ -89357,7 +89583,7 @@ - + @@ -89365,14 +89591,14 @@ - + - + @@ -89380,8 +89606,9 @@ - + + @@ -89396,7 +89623,7 @@ - + @@ -89404,14 +89631,14 @@ - + - + @@ -89419,7 +89646,7 @@ - + @@ -89506,7 +89733,7 @@ - + @@ -89514,14 +89741,14 @@ - + - + @@ -89529,8 +89756,9 @@ - + + @@ -89545,7 +89773,7 @@ - + @@ -89553,14 +89781,14 @@ - + - + @@ -89568,7 +89796,7 @@ - + @@ -89634,7 +89862,7 @@ - + @@ -89642,14 +89870,14 @@ - + - + @@ -89657,7 +89885,7 @@ - + @@ -89715,7 +89943,7 @@ - + @@ -89723,14 +89951,14 @@ - + - + @@ -89738,8 +89966,9 @@ - + + @@ -89754,7 +89983,7 @@ - + @@ -89762,18 +89991,18 @@ - + - + - + @@ -89846,7 +90075,7 @@ - + @@ -89854,19 +90083,20 @@ - + - + - + + @@ -89882,7 +90112,7 @@ - + @@ -89890,18 +90120,18 @@ - + - + - + @@ -89922,7 +90152,7 @@ - + @@ -89930,18 +90160,18 @@ - + - + - + @@ -89958,7 +90188,7 @@ - + @@ -89966,14 +90196,14 @@ - + - + @@ -89981,8 +90211,9 @@ - + + @@ -89997,7 +90228,7 @@ - + @@ -90005,19 +90236,20 @@ - + - + - + + @@ -90033,7 +90265,7 @@ - + @@ -90041,14 +90273,14 @@ - + - + @@ -90056,8 +90288,9 @@ - + + @@ -90072,7 +90305,7 @@ - + @@ -90080,14 +90313,14 @@ - + - + @@ -90095,8 +90328,9 @@ - + + @@ -90111,7 +90345,7 @@ - + @@ -90119,18 +90353,18 @@ - + - + - + @@ -90152,7 +90386,7 @@ - + @@ -90160,19 +90394,20 @@ - + - + - + + @@ -90182,52 +90417,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -90235,14 +90431,14 @@ - + - + @@ -90250,8 +90446,9 @@ - + + @@ -90266,7 +90463,7 @@ - + @@ -90274,18 +90471,18 @@ - + - + - + @@ -90302,7 +90499,7 @@ - + @@ -90310,14 +90507,14 @@ - + - + @@ -90325,8 +90522,9 @@ - + + @@ -90341,7 +90539,7 @@ - + @@ -90349,18 +90547,18 @@ - + - + - + @@ -90377,7 +90575,7 @@ - + @@ -90385,14 +90583,14 @@ - + - + @@ -90400,8 +90598,9 @@ - + + @@ -90416,7 +90615,7 @@ - + @@ -90424,19 +90623,20 @@ - + - + - + + @@ -90467,7 +90667,7 @@ - + @@ -90475,14 +90675,14 @@ - + - + @@ -90490,8 +90690,9 @@ - + + @@ -90506,7 +90707,7 @@ - + @@ -90514,14 +90715,14 @@ - + - + @@ -90529,8 +90730,9 @@ - + + @@ -90545,7 +90747,7 @@ - + @@ -90553,18 +90755,18 @@ - + - + - + @@ -90593,7 +90795,7 @@ - + @@ -90601,19 +90803,20 @@ - + - + - + + @@ -90629,7 +90832,7 @@ - + @@ -90637,19 +90840,20 @@ - + - + - + + @@ -90665,7 +90869,7 @@ - + @@ -90680,7 +90884,7 @@ - + @@ -90688,7 +90892,7 @@ - + @@ -91021,7 +91225,7 @@ - + @@ -91029,18 +91233,18 @@ - + - + - + @@ -91062,7 +91266,7 @@ - + @@ -91070,14 +91274,14 @@ - + - + @@ -91085,8 +91289,9 @@ - + + @@ -91101,7 +91306,7 @@ - + @@ -91109,14 +91314,14 @@ - + - + @@ -91124,8 +91329,9 @@ - + + @@ -91140,7 +91346,7 @@ - + @@ -91148,19 +91354,20 @@ - + - + - + + @@ -91169,52 +91376,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -91222,14 +91390,14 @@ - + - + @@ -91237,8 +91405,9 @@ - + + @@ -91253,7 +91422,7 @@ - + @@ -91261,14 +91430,14 @@ - + - + @@ -91276,8 +91445,9 @@ - + + @@ -91292,7 +91462,7 @@ - + @@ -91300,14 +91470,14 @@ - + - + @@ -91315,7 +91485,7 @@ - + @@ -91339,7 +91509,7 @@ - + @@ -91347,19 +91517,20 @@ - + - + - + + @@ -91375,7 +91546,7 @@ - + @@ -91383,14 +91554,14 @@ - + - + @@ -91398,8 +91569,9 @@ - + + @@ -91414,7 +91586,7 @@ - + @@ -91422,18 +91594,18 @@ - + - + - + @@ -91455,7 +91627,7 @@ - + @@ -91463,18 +91635,18 @@ - + - + - + @@ -91486,27 +91658,27 @@ - + - + - + - + - + - - + + - + @@ -91514,8 +91686,67 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91530,7 +91761,7 @@ - + @@ -91538,14 +91769,14 @@ - + - + @@ -91553,8 +91784,9 @@ - + + @@ -91569,7 +91801,7 @@ - + @@ -91577,19 +91809,20 @@ - + - + - + + @@ -91599,52 +91832,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -91652,14 +91846,14 @@ - + - + @@ -91667,8 +91861,9 @@ - + + @@ -91683,7 +91878,7 @@ - + @@ -91691,14 +91886,14 @@ - + - + @@ -91706,8 +91901,9 @@ - + + @@ -91722,7 +91918,7 @@ - + @@ -91730,14 +91926,14 @@ - + - + @@ -91745,8 +91941,9 @@ - + + @@ -91761,7 +91958,7 @@ - + @@ -91769,14 +91966,14 @@ - + - + @@ -91784,8 +91981,9 @@ - + + @@ -91800,7 +91998,7 @@ - + @@ -91808,14 +92006,14 @@ - + - + @@ -91823,8 +92021,9 @@ - + + @@ -91839,7 +92038,7 @@ - + @@ -91854,7 +92053,7 @@ - + @@ -91862,7 +92061,7 @@ - + @@ -92053,88 +92252,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -92142,14 +92266,14 @@ - + - + @@ -92157,8 +92281,9 @@ - + + @@ -92173,7 +92298,7 @@ - + @@ -92181,14 +92306,14 @@ - + - + @@ -92200,6 +92325,7 @@ + @@ -92209,13 +92335,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -92223,14 +92390,14 @@ - + - + @@ -92238,8 +92405,9 @@ - + + @@ -92254,7 +92422,7 @@ - + @@ -92262,19 +92430,20 @@ - + - + - + + @@ -92290,7 +92459,7 @@ - + @@ -92298,14 +92467,14 @@ - + - + @@ -92313,8 +92482,9 @@ - + + @@ -92329,7 +92499,7 @@ - + @@ -92337,14 +92507,14 @@ - + - + @@ -92352,8 +92522,9 @@ - + + @@ -92369,7 +92540,7 @@ - + @@ -92377,18 +92548,18 @@ - + - + - + @@ -92418,7 +92589,7 @@ - + @@ -92426,14 +92597,14 @@ - + - + @@ -92441,8 +92612,9 @@ - + + @@ -92457,7 +92629,7 @@ - + @@ -92465,19 +92637,20 @@ - + - + - + + @@ -92492,7 +92665,7 @@ - + @@ -92507,7 +92680,7 @@ - + @@ -92541,7 +92714,7 @@ - + @@ -92549,14 +92722,14 @@ - + - + @@ -92564,8 +92737,9 @@ - + + @@ -92580,7 +92754,7 @@ - + @@ -92595,7 +92769,7 @@ - + @@ -92605,6 +92779,7 @@ + @@ -92619,7 +92794,7 @@ - + @@ -92627,14 +92802,14 @@ - + - + @@ -92642,8 +92817,9 @@ - + + @@ -92658,7 +92834,7 @@ - + @@ -92666,14 +92842,14 @@ - + - + @@ -92681,8 +92857,9 @@ - + + @@ -92697,7 +92874,7 @@ - + @@ -92705,18 +92882,18 @@ - + - + - + @@ -92750,7 +92927,7 @@ - + @@ -92758,14 +92935,14 @@ - + - + @@ -92773,8 +92950,9 @@ - + + @@ -92783,13 +92961,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -92797,19 +93015,20 @@ - + - + - + + @@ -92824,7 +93043,7 @@ - + @@ -92832,14 +93051,14 @@ - + - + @@ -92847,8 +93066,9 @@ - + + @@ -92863,7 +93083,7 @@ - + @@ -92871,18 +93091,18 @@ - + - + - + @@ -92901,7 +93121,7 @@ - + @@ -92909,14 +93129,14 @@ - + - + @@ -92924,8 +93144,9 @@ - + + @@ -92940,7 +93161,7 @@ - + @@ -92948,19 +93169,20 @@ - + - + - + + @@ -92976,7 +93198,7 @@ - + @@ -92984,14 +93206,14 @@ - + - + @@ -92999,8 +93221,9 @@ - + + @@ -93015,7 +93238,7 @@ - + @@ -93023,14 +93246,14 @@ - + - + @@ -93038,7 +93261,7 @@ - + @@ -93079,7 +93302,7 @@ - + @@ -93087,19 +93310,20 @@ - + - + - + + @@ -93115,7 +93339,7 @@ - + @@ -93123,19 +93347,20 @@ - + - + - + + @@ -93150,7 +93375,7 @@ - + @@ -93158,14 +93383,14 @@ - + - + @@ -93173,8 +93398,9 @@ - + + @@ -93189,7 +93415,7 @@ - + @@ -93197,14 +93423,14 @@ - + - + @@ -93212,8 +93438,9 @@ - + + @@ -93228,7 +93455,7 @@ - + @@ -93236,19 +93463,20 @@ - + - + - + + @@ -93264,7 +93492,7 @@ - + @@ -93272,19 +93500,20 @@ - + - + - + + @@ -93300,7 +93529,7 @@ - + @@ -93315,7 +93544,7 @@ - + @@ -93364,7 +93593,7 @@ - + @@ -93372,14 +93601,14 @@ - + - + @@ -93387,7 +93616,7 @@ - + @@ -93466,7 +93695,7 @@ - + @@ -93474,14 +93703,14 @@ - + - + @@ -93489,8 +93718,9 @@ - + + @@ -93505,7 +93735,7 @@ - + @@ -93513,14 +93743,14 @@ - + - + @@ -93528,8 +93758,9 @@ - + + @@ -93544,7 +93775,7 @@ - + @@ -93552,14 +93783,14 @@ - + - + @@ -93591,7 +93822,7 @@ - + @@ -93602,14 +93833,14 @@ - + - + @@ -93617,7 +93848,7 @@ - + @@ -93639,7 +93870,7 @@ - + @@ -93648,19 +93879,20 @@ - + - + - + + @@ -93676,7 +93908,7 @@ - + @@ -93684,14 +93916,14 @@ - + - + @@ -93699,8 +93931,9 @@ - + + @@ -93715,7 +93948,7 @@ - + @@ -93723,14 +93956,14 @@ - + - + @@ -93738,8 +93971,9 @@ - + + @@ -93754,7 +93988,7 @@ - + @@ -93762,19 +93996,20 @@ - + - + - + + @@ -93789,7 +94024,7 @@ - + @@ -93797,19 +94032,20 @@ - + - + - + + @@ -93850,7 +94086,7 @@ - + @@ -93858,18 +94094,18 @@ - + - + - + @@ -93941,7 +94177,7 @@ - + @@ -93949,18 +94185,18 @@ - + - + - + @@ -93982,7 +94218,7 @@ - + @@ -93990,14 +94226,14 @@ - + - + @@ -94005,8 +94241,9 @@ - + + @@ -94021,7 +94258,7 @@ - + @@ -94029,14 +94266,14 @@ - + - + @@ -94044,8 +94281,9 @@ - + + @@ -94060,7 +94298,7 @@ - + @@ -94068,14 +94306,14 @@ - + - + @@ -94083,7 +94321,7 @@ - + @@ -94108,7 +94346,7 @@ - + @@ -94116,14 +94354,14 @@ - + - + @@ -94131,8 +94369,9 @@ - + + @@ -94147,7 +94386,7 @@ - + @@ -94155,14 +94394,14 @@ - + - + @@ -94170,8 +94409,9 @@ - + + @@ -94186,7 +94426,7 @@ - + @@ -94194,19 +94434,20 @@ - + - + - + + @@ -94216,52 +94457,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -94269,14 +94471,14 @@ - + - + @@ -94284,8 +94486,9 @@ - + + @@ -94300,7 +94503,7 @@ - + @@ -94308,14 +94511,14 @@ - + - + @@ -94323,8 +94526,9 @@ - + + @@ -94339,7 +94543,7 @@ - + @@ -94347,18 +94551,18 @@ - + - + - + @@ -94388,7 +94592,7 @@ - + @@ -94396,14 +94600,14 @@ - + - + @@ -94411,8 +94615,9 @@ - + + @@ -94421,52 +94626,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -94474,18 +94640,18 @@ - + - + - + @@ -94522,7 +94688,7 @@ - + @@ -94530,14 +94696,14 @@ - + - + @@ -94545,8 +94711,9 @@ - + + @@ -94561,7 +94728,7 @@ - + @@ -94569,19 +94736,20 @@ - + - + - + + @@ -94602,7 +94770,7 @@ - + @@ -94610,14 +94778,14 @@ - + - + @@ -94625,7 +94793,7 @@ - + @@ -94647,7 +94815,7 @@ - + @@ -94655,14 +94823,14 @@ - + - + @@ -94670,8 +94838,9 @@ - + + @@ -94686,7 +94855,7 @@ - + @@ -94694,14 +94863,14 @@ - + - + @@ -94709,8 +94878,9 @@ - + + @@ -94725,7 +94895,7 @@ - + @@ -94733,14 +94903,14 @@ - + - + @@ -94748,8 +94918,9 @@ - + + @@ -94764,7 +94935,7 @@ - + @@ -94772,14 +94943,14 @@ - + - + @@ -94787,8 +94958,9 @@ - + + @@ -94803,7 +94975,7 @@ - + @@ -94811,18 +94983,18 @@ - + - + - + @@ -94845,7 +95017,7 @@ - + @@ -94853,19 +95025,20 @@ - + - + - + + @@ -94881,7 +95054,7 @@ - + @@ -94889,18 +95062,18 @@ - + - + - + @@ -94916,49 +95089,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -94966,14 +95103,14 @@ - + - + @@ -94981,8 +95118,9 @@ - + + @@ -94997,7 +95135,7 @@ - + @@ -95005,19 +95143,20 @@ - + - + - + + @@ -95027,39 +95166,40 @@ - + - + - + - + - + - - + + - - + + - + - - - - - - + + - + + + + + + @@ -95071,7 +95211,7 @@ - + @@ -95079,18 +95219,18 @@ - + - + - + @@ -108286,7 +108426,7 @@ - + @@ -108294,14 +108434,14 @@ - + - + @@ -108309,8 +108449,9 @@ - + + @@ -108325,7 +108466,7 @@ - + @@ -108333,19 +108474,20 @@ - + - + - + + @@ -108360,7 +108502,7 @@ - + @@ -108368,14 +108510,14 @@ - + - + @@ -108383,8 +108525,9 @@ - + + @@ -108399,7 +108542,7 @@ - + @@ -108407,14 +108550,14 @@ - + - + @@ -108422,8 +108565,9 @@ - + + @@ -108438,7 +108582,7 @@ - + @@ -108446,18 +108590,18 @@ - + - + - + @@ -108479,7 +108623,7 @@ - + @@ -108487,14 +108631,14 @@ - + - + @@ -108502,8 +108646,9 @@ - + + @@ -108518,7 +108663,7 @@ - + @@ -108526,14 +108671,14 @@ - + - + @@ -108541,8 +108686,9 @@ - + + @@ -108557,7 +108703,7 @@ - + @@ -108565,14 +108711,14 @@ - + - + @@ -108580,8 +108726,9 @@ - + + @@ -108596,7 +108743,7 @@ - + @@ -108604,14 +108751,14 @@ - + - + @@ -108619,8 +108766,9 @@ - + + @@ -108635,7 +108783,7 @@ - + @@ -108643,18 +108791,18 @@ - + - + - + @@ -108676,22 +108824,22 @@ - + - + - + - + - + @@ -108699,8 +108847,9 @@ - - + + + @@ -108715,7 +108864,7 @@ - + @@ -108723,14 +108872,14 @@ - + - + @@ -108738,8 +108887,9 @@ - + + @@ -108748,13 +108898,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -108762,14 +108951,14 @@ - + - + @@ -108777,8 +108966,9 @@ - + + @@ -108793,7 +108983,7 @@ - + @@ -108801,18 +108991,18 @@ - + - + - + @@ -109010,7 +109200,7 @@ - + @@ -109018,18 +109208,18 @@ - + - + - + @@ -109053,7 +109243,7 @@ - + @@ -109061,19 +109251,20 @@ - + - + - + + @@ -109110,7 +109301,7 @@ - + @@ -109118,18 +109309,18 @@ - + - + - + @@ -109145,13 +109336,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -109159,19 +109390,20 @@ - + - + - + + @@ -109187,7 +109419,7 @@ - + @@ -109195,14 +109427,14 @@ - + - + @@ -109210,8 +109442,9 @@ - + + @@ -109226,7 +109459,7 @@ - + @@ -109234,14 +109467,14 @@ - + - + @@ -109249,8 +109482,9 @@ - + + @@ -109265,7 +109499,7 @@ - + @@ -109273,14 +109507,14 @@ - + - + @@ -109288,8 +109522,9 @@ - + + @@ -109304,7 +109539,7 @@ - + @@ -109312,19 +109547,20 @@ - + - + - + + @@ -109334,13 +109570,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -109348,19 +109635,20 @@ - + - + - + + @@ -109375,7 +109663,7 @@ - + @@ -109383,18 +109671,18 @@ - + - + - + @@ -109431,7 +109719,7 @@ - + @@ -109439,14 +109727,14 @@ - + - + @@ -109454,8 +109742,9 @@ - + + @@ -109470,7 +109759,7 @@ - + @@ -109478,14 +109767,14 @@ - + - + @@ -109493,8 +109782,9 @@ - + + @@ -109509,7 +109799,7 @@ - + @@ -109517,19 +109807,20 @@ - + - + - + + @@ -109545,7 +109836,7 @@ - + @@ -109553,18 +109844,18 @@ - + - + - + @@ -109589,7 +109880,7 @@ - + @@ -109597,14 +109888,14 @@ - + - + @@ -109612,8 +109903,9 @@ - + + @@ -109628,7 +109920,7 @@ - + @@ -109636,18 +109928,18 @@ - + - + - + @@ -109663,7 +109955,7 @@ - + @@ -109671,18 +109963,18 @@ - + - + - + @@ -109707,7 +109999,7 @@ - + @@ -109715,19 +110007,20 @@ - + - + - + + @@ -109742,7 +110035,7 @@ - + @@ -109750,14 +110043,14 @@ - + - + @@ -109765,8 +110058,9 @@ - + + @@ -109781,7 +110075,7 @@ - + @@ -109789,18 +110083,18 @@ - + - + - + @@ -109833,7 +110127,7 @@ - + @@ -109841,19 +110135,20 @@ - + - + - + + @@ -109868,7 +110163,7 @@ - + @@ -109876,18 +110171,18 @@ - + - + - + @@ -109909,7 +110204,7 @@ - + @@ -109917,14 +110212,14 @@ - + - + @@ -109932,8 +110227,9 @@ - + + @@ -109948,7 +110244,7 @@ - + @@ -109956,23 +110252,26 @@ - + - + - + + + + @@ -109983,7 +110282,7 @@ - + @@ -109991,18 +110290,18 @@ - + - + - + @@ -110024,7 +110323,7 @@ - + @@ -110039,7 +110338,7 @@ - + @@ -110047,7 +110346,7 @@ - + @@ -110352,7 +110651,7 @@ - + @@ -110360,14 +110659,14 @@ - + - + @@ -110375,8 +110674,9 @@ - + + @@ -110391,7 +110691,7 @@ - + @@ -110399,18 +110699,18 @@ - + - + - + @@ -119907,7 +120207,7 @@ - + @@ -119915,14 +120215,14 @@ - + - + @@ -119930,7 +120230,7 @@ - + @@ -120067,7 +120367,7 @@ - + @@ -120075,19 +120375,20 @@ - + - + - + + @@ -120103,7 +120404,7 @@ - + @@ -120111,14 +120412,14 @@ - + - + @@ -120126,7 +120427,7 @@ - + @@ -120153,7 +120454,7 @@ - + @@ -120161,19 +120462,20 @@ - + - + - + + @@ -120188,7 +120490,7 @@ - + @@ -120196,14 +120498,14 @@ - + - + @@ -120211,8 +120513,9 @@ - + + @@ -120227,7 +120530,7 @@ - + @@ -120235,14 +120538,14 @@ - + - + @@ -120250,8 +120553,9 @@ - + + @@ -120266,7 +120570,7 @@ - + @@ -120274,14 +120578,14 @@ - + - + @@ -120289,8 +120593,9 @@ - + + @@ -120305,7 +120610,7 @@ - + @@ -120313,14 +120618,14 @@ - + - + @@ -120328,7 +120633,7 @@ - + @@ -120407,7 +120712,7 @@ - + @@ -120415,19 +120720,20 @@ - + - + - + + @@ -120443,7 +120749,7 @@ - + @@ -120451,14 +120757,14 @@ - + - + @@ -120466,8 +120772,9 @@ - + + @@ -120476,91 +120783,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -120568,14 +120797,14 @@ - + - + @@ -120583,8 +120812,9 @@ - + + @@ -120599,7 +120829,7 @@ - + @@ -120607,19 +120837,20 @@ - + - + - + + @@ -120635,7 +120866,7 @@ - + @@ -120643,14 +120874,14 @@ - + - + @@ -120658,8 +120889,9 @@ - + + @@ -120674,7 +120906,7 @@ - + @@ -120682,14 +120914,14 @@ - + - + @@ -120697,8 +120929,9 @@ - + + @@ -120713,7 +120946,7 @@ - + @@ -120721,14 +120954,14 @@ - + - + @@ -120761,7 +120994,7 @@ - + @@ -120776,12 +121009,13 @@ - + - + + @@ -120797,7 +121031,7 @@ - + @@ -120805,18 +121039,18 @@ - + - + - + @@ -120827,49 +121061,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -120877,19 +121075,20 @@ - + - + - + + @@ -120904,7 +121103,7 @@ - + @@ -120912,14 +121111,14 @@ - + - + @@ -120927,8 +121126,9 @@ - + + @@ -120943,7 +121143,7 @@ - + @@ -120951,14 +121151,14 @@ - + - + @@ -120966,8 +121166,9 @@ - + + @@ -120982,7 +121183,7 @@ - + @@ -120990,14 +121191,14 @@ - + - + @@ -121005,7 +121206,7 @@ - + @@ -121033,7 +121234,7 @@ - + @@ -121041,18 +121242,18 @@ - + - + - + @@ -121074,7 +121275,7 @@ - + @@ -121082,19 +121283,20 @@ - + - + - + + @@ -121110,7 +121312,7 @@ - + @@ -121118,18 +121320,18 @@ - + - + - + @@ -121151,7 +121353,7 @@ - + @@ -121159,19 +121361,20 @@ - + - + - + + @@ -121186,7 +121389,7 @@ - + @@ -121194,14 +121397,14 @@ - + - + @@ -121209,8 +121412,9 @@ - + + @@ -121225,7 +121429,7 @@ - + @@ -121233,14 +121437,14 @@ - + - + @@ -121248,8 +121452,9 @@ - + + @@ -121264,7 +121469,7 @@ - + @@ -121272,19 +121477,20 @@ - + - + - + + @@ -121293,52 +121499,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -121346,14 +121513,14 @@ - + - + @@ -121361,8 +121528,9 @@ - + + @@ -121377,7 +121545,7 @@ - + @@ -121385,19 +121553,20 @@ - + - + - + + @@ -121413,7 +121582,7 @@ - + @@ -121428,13 +121597,13 @@ - + - + @@ -121485,7 +121654,7 @@ - + @@ -121493,18 +121662,18 @@ - + - + - + @@ -121653,7 +121822,7 @@ - + @@ -121661,14 +121830,14 @@ - + - + @@ -121676,8 +121845,9 @@ - + + @@ -121692,7 +121862,7 @@ - + @@ -121700,14 +121870,14 @@ - + - + @@ -121715,8 +121885,9 @@ - + + @@ -121731,7 +121902,7 @@ - + @@ -121739,19 +121910,20 @@ - + - + - + + @@ -121760,63 +121932,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -121824,18 +121946,18 @@ - + - + - + @@ -121852,7 +121974,7 @@ - + @@ -121867,11 +121989,11 @@ - + - + @@ -121893,7 +122015,7 @@ - + @@ -121901,19 +122023,20 @@ - + - + - + + @@ -121928,7 +122051,7 @@ - + @@ -121936,19 +122059,20 @@ - + - + - + + @@ -121964,7 +122088,7 @@ - + @@ -121972,18 +122096,18 @@ - + - + - + @@ -122026,7 +122150,7 @@ - + @@ -122034,14 +122158,14 @@ - + - + @@ -122049,8 +122173,9 @@ - + + @@ -122066,7 +122191,7 @@ - + @@ -122074,14 +122199,14 @@ - + - + @@ -122089,8 +122214,9 @@ - + + @@ -122107,7 +122233,7 @@ - + @@ -122115,18 +122241,18 @@ - + - + - + @@ -122137,13 +122263,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -122151,19 +122317,20 @@ - + - + - + + @@ -122179,7 +122346,7 @@ - + @@ -122187,19 +122354,20 @@ - + - + - + + @@ -122215,7 +122383,7 @@ - + @@ -122223,19 +122391,20 @@ - + - + - + + @@ -122250,7 +122419,7 @@ - + @@ -122258,14 +122427,14 @@ - + - + @@ -122273,8 +122442,9 @@ - + + @@ -122289,7 +122459,7 @@ - + @@ -122297,14 +122467,14 @@ - + - + @@ -122312,8 +122482,9 @@ - + + @@ -122328,7 +122499,7 @@ - + @@ -122336,19 +122507,20 @@ - + - + - + + @@ -122363,7 +122535,7 @@ - + @@ -122371,14 +122543,14 @@ - + - + @@ -122386,8 +122558,9 @@ - + + @@ -122402,7 +122575,7 @@ - + @@ -122410,14 +122583,14 @@ - + - + @@ -122425,8 +122598,9 @@ - + + @@ -122441,7 +122615,7 @@ - + @@ -122449,14 +122623,14 @@ - + - + @@ -122464,8 +122638,9 @@ - + + @@ -122480,7 +122655,7 @@ - + @@ -122488,19 +122663,20 @@ - + - + - + + @@ -122515,7 +122691,7 @@ - + @@ -122523,18 +122699,18 @@ - + - + - + @@ -122550,7 +122726,7 @@ - + @@ -122558,14 +122734,14 @@ - + - + @@ -122573,8 +122749,9 @@ - + + @@ -122589,7 +122766,7 @@ - + @@ -122597,18 +122774,18 @@ - + - + - + @@ -122643,7 +122820,7 @@ - + @@ -122651,14 +122828,14 @@ - + - + @@ -122666,8 +122843,9 @@ - + + @@ -122682,7 +122860,7 @@ - + @@ -122690,18 +122868,18 @@ - + - + - + @@ -122718,7 +122896,7 @@ - + @@ -122726,14 +122904,14 @@ - + - + @@ -122741,8 +122919,9 @@ - + + @@ -122757,7 +122936,7 @@ - + @@ -122765,14 +122944,14 @@ - + - + @@ -122780,8 +122959,9 @@ - + + @@ -122796,7 +122976,7 @@ - + @@ -122804,19 +122984,20 @@ - + - + - + + @@ -122832,7 +123013,7 @@ - + @@ -122840,14 +123021,14 @@ - + - + @@ -122855,8 +123036,9 @@ - + + @@ -122871,7 +123053,7 @@ - + @@ -122879,19 +123061,20 @@ - + - + - + + @@ -122900,58 +123083,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -122959,14 +123097,14 @@ - + - + @@ -122974,8 +123112,9 @@ - + + @@ -122990,7 +123129,7 @@ - + @@ -122998,18 +123137,18 @@ - + - + - + @@ -123023,6 +123162,7 @@ + @@ -123038,7 +123178,7 @@ - + @@ -123053,7 +123193,7 @@ - + @@ -123108,7 +123248,7 @@ - + @@ -123116,18 +123256,18 @@ - + - + - + @@ -123151,7 +123291,7 @@ - + @@ -123159,18 +123299,18 @@ - + - + - + @@ -123229,7 +123369,7 @@ - + @@ -123237,19 +123377,20 @@ - + - + - + + @@ -123264,7 +123405,7 @@ - + @@ -123272,19 +123413,20 @@ - + - + - + + @@ -123300,7 +123442,7 @@ - + @@ -123308,14 +123450,14 @@ - + - + @@ -123323,8 +123465,9 @@ - + + @@ -123339,7 +123482,7 @@ - + @@ -123347,14 +123490,14 @@ - + - + @@ -123362,8 +123505,9 @@ - + + @@ -123378,22 +123522,22 @@ - + - + - - + + - + @@ -123401,8 +123545,9 @@ - + + @@ -123417,7 +123562,7 @@ - + @@ -123425,19 +123570,20 @@ - + - + - + + @@ -123453,7 +123599,7 @@ - + @@ -123461,18 +123607,18 @@ - + - + - + @@ -123488,7 +123634,7 @@ - + @@ -123496,18 +123642,18 @@ - + - + - + @@ -123529,7 +123675,7 @@ - + @@ -123537,14 +123683,14 @@ - + - + @@ -123552,8 +123698,9 @@ - + + @@ -123568,7 +123715,7 @@ - + @@ -123576,14 +123723,14 @@ - + - + @@ -123591,7 +123738,7 @@ - + @@ -123601,13 +123748,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -123618,19 +123805,20 @@ - + - + - + + @@ -123684,7 +123872,7 @@ - + @@ -123692,18 +123880,18 @@ - + - + - + @@ -123777,7 +123965,7 @@ - + @@ -123785,14 +123973,14 @@ - + - + @@ -123800,8 +123988,9 @@ - + + @@ -123816,7 +124005,7 @@ - + @@ -123824,19 +124013,20 @@ - + - + - + + @@ -123852,7 +124042,7 @@ - + @@ -123860,18 +124050,18 @@ - + - + - + @@ -123906,7 +124096,7 @@ - + @@ -123914,19 +124104,20 @@ - + - + - + + @@ -123942,7 +124133,7 @@ - + @@ -123950,14 +124141,14 @@ - + - + @@ -123965,8 +124156,9 @@ - + + @@ -123981,7 +124173,7 @@ - + @@ -123989,18 +124181,18 @@ - + - + - + @@ -124078,7 +124270,7 @@ - + @@ -124086,14 +124278,14 @@ - + - + @@ -124101,8 +124293,9 @@ - + + @@ -124117,7 +124310,7 @@ - + @@ -124132,7 +124325,7 @@ - + @@ -124142,6 +124335,7 @@ + @@ -124156,7 +124350,7 @@ - + @@ -124164,14 +124358,14 @@ - + - + @@ -124179,8 +124373,9 @@ - + + @@ -124195,7 +124390,7 @@ - + @@ -124203,18 +124398,18 @@ - + - + - + @@ -124471,7 +124666,7 @@ - + @@ -124479,14 +124674,14 @@ - + - + @@ -124494,8 +124689,9 @@ - + + @@ -124510,7 +124706,7 @@ - + @@ -124518,14 +124714,14 @@ - + - + @@ -124533,8 +124729,9 @@ - + + @@ -124549,7 +124746,7 @@ - + @@ -124557,18 +124754,18 @@ - + - + - + @@ -124606,7 +124803,7 @@ - + @@ -124614,18 +124811,18 @@ - + - + - + @@ -124670,7 +124867,7 @@ - + @@ -124678,14 +124875,14 @@ - + - + @@ -124693,8 +124890,9 @@ - + + @@ -124709,7 +124907,7 @@ - + @@ -124717,14 +124915,14 @@ - + - + @@ -124732,8 +124930,9 @@ - + + @@ -124748,7 +124947,7 @@ - + @@ -124756,14 +124955,14 @@ - + - + @@ -124771,8 +124970,9 @@ - + + @@ -124787,7 +124987,7 @@ - + @@ -124795,14 +124995,14 @@ - + - + @@ -124810,7 +125010,7 @@ - + @@ -124824,6 +125024,9 @@ + + + @@ -124850,7 +125053,7 @@ - + @@ -124858,18 +125061,18 @@ - + - + - + @@ -124892,7 +125095,7 @@ - + @@ -124900,18 +125103,18 @@ - + - + - + @@ -124928,7 +125131,7 @@ - + @@ -124936,18 +125139,18 @@ - + - + - + @@ -124969,7 +125172,7 @@ - + @@ -124977,19 +125180,20 @@ - + - + - + + @@ -125004,7 +125208,7 @@ - + @@ -125012,14 +125216,14 @@ - + - + @@ -125027,7 +125231,7 @@ - + @@ -125046,7 +125250,7 @@ - + @@ -125054,14 +125258,14 @@ - + - + @@ -125069,8 +125273,9 @@ - + + @@ -125079,13 +125284,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -125093,18 +125335,18 @@ - + - + - + @@ -125126,7 +125368,7 @@ - + @@ -125134,18 +125376,18 @@ - + - + - + @@ -125170,7 +125412,7 @@ - + @@ -125178,14 +125420,14 @@ - + - + @@ -125193,8 +125435,9 @@ - + + @@ -125209,7 +125452,7 @@ - + @@ -125217,14 +125460,14 @@ - + - + @@ -125232,8 +125475,9 @@ - + + @@ -125248,7 +125492,7 @@ - + @@ -125256,14 +125500,14 @@ - + - + @@ -125271,8 +125515,9 @@ - + + @@ -125281,52 +125526,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -125334,14 +125540,14 @@ - + - + @@ -125349,8 +125555,9 @@ - + + @@ -125365,7 +125572,7 @@ - + @@ -125373,14 +125580,14 @@ - + - + @@ -125388,8 +125595,9 @@ - + + @@ -125404,7 +125612,7 @@ - + @@ -125412,18 +125620,18 @@ - + - + - + @@ -125439,7 +125647,7 @@ - + @@ -125447,19 +125655,20 @@ - + - + - + + @@ -125475,7 +125684,7 @@ - + @@ -125483,14 +125692,14 @@ - + - + @@ -125498,8 +125707,9 @@ - + + @@ -125514,7 +125724,7 @@ - + @@ -125522,18 +125732,18 @@ - + - + - + @@ -125545,27 +125755,27 @@ - + - + - + - + - + - - + + - + @@ -125573,8 +125783,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -125589,7 +125840,7 @@ - + @@ -125604,7 +125855,7 @@ - + @@ -125701,7 +125952,7 @@ - + @@ -125709,14 +125960,14 @@ - + - + @@ -125724,8 +125975,9 @@ - + + @@ -125740,7 +125992,7 @@ - + @@ -125748,14 +126000,14 @@ - + - + @@ -125763,8 +126015,9 @@ - + + @@ -125779,7 +126032,7 @@ - + @@ -125787,18 +126040,18 @@ - + - + - + @@ -125820,7 +126073,7 @@ - + @@ -125835,11 +126088,11 @@ - + - + @@ -126006,7 +126259,7 @@ - + @@ -126014,14 +126267,14 @@ - + - + @@ -126029,8 +126282,9 @@ - + + @@ -126045,7 +126299,7 @@ - + @@ -126053,14 +126307,14 @@ - + - + @@ -126068,8 +126322,9 @@ - + + @@ -126084,7 +126339,7 @@ - + @@ -126092,14 +126347,14 @@ - + - + @@ -126528,6 +126783,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -127527,7 +127810,7 @@ - + @@ -127535,19 +127818,20 @@ - + - + - + + @@ -127563,7 +127847,7 @@ - + @@ -127571,14 +127855,14 @@ - + - + @@ -127586,8 +127870,9 @@ - + + @@ -127602,7 +127887,7 @@ - + @@ -127610,19 +127895,20 @@ - + - + - + + @@ -127639,7 +127925,7 @@ - + @@ -127647,14 +127933,14 @@ - + - + @@ -127662,8 +127948,9 @@ - + + @@ -127678,7 +127965,7 @@ - + @@ -127686,19 +127973,20 @@ - + - + - + + @@ -127714,7 +128002,7 @@ - + @@ -127722,14 +128010,14 @@ - + - + @@ -127737,8 +128025,9 @@ - + + @@ -127753,7 +128042,7 @@ - + @@ -127761,14 +128050,14 @@ - + - + @@ -127776,8 +128065,9 @@ - + + @@ -127792,7 +128082,7 @@ - + @@ -127800,19 +128090,20 @@ - + - + - + + @@ -127828,7 +128119,7 @@ - + @@ -127836,14 +128127,14 @@ - + - + @@ -127851,8 +128142,9 @@ - + + @@ -127867,7 +128159,7 @@ - + @@ -127875,14 +128167,14 @@ - + - + @@ -127890,8 +128182,9 @@ - + + @@ -127906,7 +128199,7 @@ - + @@ -127914,18 +128207,18 @@ - + - + - + @@ -127947,7 +128240,7 @@ - + @@ -127955,14 +128248,14 @@ - + - + @@ -127970,8 +128263,9 @@ - + + @@ -127986,7 +128280,7 @@ - + @@ -127994,14 +128288,14 @@ - + - + @@ -128009,8 +128303,9 @@ - + + @@ -128025,7 +128320,7 @@ - + @@ -128033,14 +128328,14 @@ - + - + @@ -128048,8 +128343,9 @@ - + + @@ -128064,7 +128360,7 @@ - + @@ -128072,18 +128368,18 @@ - + - + - + @@ -128127,7 +128423,7 @@ - + @@ -128135,14 +128431,14 @@ - + - + @@ -128150,8 +128446,9 @@ - + + @@ -128166,7 +128463,7 @@ - + @@ -128174,14 +128471,14 @@ - + - + @@ -128189,8 +128486,9 @@ - + + @@ -128205,7 +128503,7 @@ - + @@ -128213,18 +128511,18 @@ - + - + - + @@ -128246,7 +128544,7 @@ - + @@ -128254,14 +128552,14 @@ - + - + @@ -128269,7 +128567,7 @@ - + @@ -128291,7 +128589,7 @@ - + @@ -128299,19 +128597,20 @@ - + - + - + + @@ -128326,7 +128625,7 @@ - + @@ -128334,19 +128633,20 @@ - + - + - + + @@ -128361,7 +128661,7 @@ - + @@ -128369,19 +128669,20 @@ - + - + - + + @@ -128396,7 +128697,7 @@ - + @@ -128404,18 +128705,18 @@ - + - + - + @@ -128432,7 +128733,7 @@ - + @@ -128440,19 +128741,20 @@ - + - + - + + @@ -128467,7 +128769,7 @@ - + @@ -128475,19 +128777,20 @@ - + - + - + + @@ -128502,7 +128805,7 @@ - + @@ -128510,19 +128813,20 @@ - + - + - + + @@ -128538,7 +128842,7 @@ - + @@ -128546,18 +128850,18 @@ - + - + - + @@ -128586,7 +128890,7 @@ - + @@ -128594,14 +128898,14 @@ - + - + @@ -128609,8 +128913,9 @@ - + + @@ -128625,7 +128930,7 @@ - + @@ -128633,18 +128938,18 @@ - + - + - + @@ -128661,7 +128966,7 @@ - + @@ -128669,14 +128974,14 @@ - + - + @@ -128684,8 +128989,9 @@ - + + @@ -128700,7 +129006,7 @@ - + @@ -128708,18 +129014,18 @@ - + - + - + @@ -128756,7 +129062,7 @@ - + @@ -128764,14 +129070,14 @@ - + - + @@ -128779,8 +129085,9 @@ - + + @@ -128795,7 +129102,7 @@ - + @@ -128803,14 +129110,14 @@ - + - + @@ -128818,8 +129125,9 @@ - + + @@ -128834,7 +129142,7 @@ - + @@ -128842,14 +129150,14 @@ - + - + @@ -128857,8 +129165,9 @@ - + + @@ -128873,7 +129182,7 @@ - + @@ -128881,14 +129190,14 @@ - + - + @@ -128896,8 +129205,9 @@ - + + @@ -128912,7 +129222,7 @@ - + @@ -128920,18 +129230,18 @@ - + - + - + @@ -128964,7 +129274,7 @@ - + @@ -128972,14 +129282,14 @@ - + - + @@ -128987,8 +129297,9 @@ - + + @@ -129003,7 +129314,7 @@ - + @@ -129011,19 +129322,20 @@ - + - + - + + @@ -129039,7 +129351,7 @@ - + @@ -129047,18 +129359,18 @@ - + - + - + @@ -129080,7 +129392,7 @@ - + @@ -129088,19 +129400,20 @@ - + - + - + + @@ -129116,7 +129429,7 @@ - + @@ -129124,18 +129437,18 @@ - + - + - + @@ -129155,7 +129468,7 @@ - + @@ -129163,14 +129476,14 @@ - + - + @@ -129178,8 +129491,9 @@ - + + @@ -129194,7 +129508,7 @@ - + @@ -129202,18 +129516,18 @@ - + - + - + @@ -129230,7 +129544,7 @@ - + @@ -129238,14 +129552,14 @@ - + - + @@ -129253,8 +129567,9 @@ - + + @@ -129269,7 +129584,7 @@ - + @@ -129277,14 +129592,14 @@ - + - + @@ -129292,8 +129607,9 @@ - + + @@ -129308,7 +129624,7 @@ - + @@ -129316,14 +129632,14 @@ - + - + @@ -129335,6 +129651,7 @@ + @@ -129349,7 +129666,7 @@ - + @@ -129357,14 +129674,14 @@ - + - + @@ -129372,8 +129689,9 @@ - + + @@ -129388,7 +129706,7 @@ - + @@ -129396,18 +129714,18 @@ - + - + - + @@ -129444,7 +129762,7 @@ - + @@ -129452,14 +129770,14 @@ - + - + @@ -129467,8 +129785,9 @@ - + + @@ -129483,7 +129802,7 @@ - + @@ -129491,18 +129810,18 @@ - + - + - + @@ -129547,7 +129866,7 @@ - + @@ -129555,19 +129874,20 @@ - + - + - + + @@ -129582,7 +129902,7 @@ - + @@ -129590,19 +129910,20 @@ - + - + - + + @@ -129658,7 +129979,7 @@ - + @@ -129666,19 +129987,20 @@ - + - + - + + @@ -129694,7 +130016,7 @@ - + @@ -129702,19 +130024,20 @@ - + - + - + + @@ -129729,7 +130052,7 @@ - + @@ -129737,18 +130060,18 @@ - + - + - + @@ -129783,7 +130106,7 @@ - + @@ -129791,18 +130114,18 @@ - + - + - + @@ -129818,7 +130141,7 @@ - + @@ -129826,14 +130149,14 @@ - + - + @@ -129841,8 +130164,9 @@ - + + @@ -129857,7 +130181,7 @@ - + @@ -129865,14 +130189,14 @@ - + - + @@ -129880,9 +130204,13 @@ - + + + + + @@ -129980,7 +130308,7 @@ - + @@ -129988,14 +130316,14 @@ - + - + @@ -130003,8 +130331,9 @@ - + + @@ -130019,7 +130348,7 @@ - + @@ -130027,14 +130356,14 @@ - + - + @@ -130042,8 +130371,9 @@ - + + @@ -130059,7 +130389,7 @@ - + @@ -130067,14 +130397,14 @@ - + - + @@ -130109,7 +130439,7 @@ - + @@ -130117,19 +130447,20 @@ - + - + - + + @@ -130145,7 +130476,7 @@ - + @@ -130153,19 +130484,20 @@ - + - + - + + @@ -130181,7 +130513,7 @@ - + @@ -130189,18 +130521,18 @@ - + - + - + @@ -130222,7 +130554,7 @@ - + @@ -130231,18 +130563,18 @@ - + - + - + @@ -130547,7 +130879,7 @@ - + @@ -130555,14 +130887,14 @@ - + - + @@ -130570,8 +130902,9 @@ - + + @@ -130586,7 +130919,7 @@ - + @@ -130594,18 +130927,18 @@ - + - + - + @@ -130621,13 +130954,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -130635,18 +131008,18 @@ - + - + - + @@ -130668,7 +131041,7 @@ - + @@ -130676,14 +131049,14 @@ - + - + @@ -130691,7 +131064,7 @@ - + @@ -130729,7 +131102,7 @@ - + @@ -130737,19 +131110,20 @@ - + - + - + + @@ -130764,7 +131138,7 @@ - + @@ -130772,14 +131146,14 @@ - + - + @@ -130787,8 +131161,9 @@ - + + @@ -130803,7 +131178,7 @@ - + @@ -130811,18 +131186,18 @@ - + - + - + @@ -130838,7 +131213,7 @@ - + @@ -130846,18 +131221,18 @@ - + - + - + @@ -130930,7 +131305,7 @@ - + @@ -130938,19 +131313,20 @@ - + - + - + + @@ -130965,7 +131341,7 @@ - + @@ -130973,14 +131349,14 @@ - + - + @@ -130988,8 +131364,9 @@ - + + @@ -131004,7 +131381,7 @@ - + @@ -131012,18 +131389,18 @@ - + - + - + @@ -131185,7 +131562,7 @@ - + @@ -131193,19 +131570,20 @@ - + - + - + + @@ -131215,49 +131593,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -131265,14 +131607,14 @@ - + - + @@ -131280,8 +131622,9 @@ - + + @@ -131296,7 +131639,7 @@ - + @@ -131304,19 +131647,20 @@ - + - + - + + @@ -131332,7 +131676,7 @@ - + @@ -131340,14 +131684,14 @@ - + - + @@ -131355,7 +131699,7 @@ - + @@ -131379,7 +131723,7 @@ - + @@ -131387,14 +131731,14 @@ - + - + @@ -131402,8 +131746,9 @@ - + + @@ -131418,7 +131763,7 @@ - + @@ -131426,19 +131771,20 @@ - + - + - + + @@ -131453,7 +131799,7 @@ - + @@ -131461,14 +131807,14 @@ - + - + @@ -131476,8 +131822,9 @@ - - + + + @@ -131492,7 +131839,7 @@ - + @@ -131500,14 +131847,14 @@ - + - + @@ -131515,8 +131862,9 @@ - + + @@ -131525,48 +131873,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -131574,19 +131887,20 @@ - + - + - + + @@ -131601,7 +131915,7 @@ - + @@ -131609,18 +131923,18 @@ - + - + - + @@ -131657,7 +131971,7 @@ - + @@ -131665,14 +131979,14 @@ - + - + @@ -131680,8 +131994,9 @@ - + + @@ -131696,7 +132011,7 @@ - + @@ -131704,14 +132019,14 @@ - + - + @@ -131719,8 +132034,9 @@ - + + @@ -131735,7 +132051,7 @@ - + @@ -131747,7 +132063,7 @@ - + @@ -131809,7 +132125,7 @@ - + @@ -131817,14 +132133,14 @@ - + - + @@ -131832,8 +132148,9 @@ - + + @@ -131848,7 +132165,7 @@ - + @@ -131856,14 +132173,14 @@ - + - + @@ -131871,8 +132188,9 @@ - + + diff --git a/hapi-tinder-plugin/.classpath b/hapi-tinder-plugin/.classpath index 4efeb48e6cf..3f5d899f8a4 100644 --- a/hapi-tinder-plugin/.classpath +++ b/hapi-tinder-plugin/.classpath @@ -35,5 +35,6 @@ + diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/VersionPropertyFileGeneratorMojo.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/VersionPropertyFileGeneratorMojo.java index 936295933f3..365516e1745 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/VersionPropertyFileGeneratorMojo.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/VersionPropertyFileGeneratorMojo.java @@ -124,6 +124,9 @@ public class VersionPropertyFileGeneratorMojo extends AbstractMojo { m.packageName = "org.hl7.fhir.dstu3.model"; m.targetFile = new File("../hapi-fhir-structures-dstu3/src/main/resources/org/hl7/fhir/dstu3/model/fhirversion.properties"); +// m.packageName = "org.hl7.fhir.dstu2016may.model"; +// m.targetFile = new File("../hapi-fhir-structures-dstu2.1/src/main/resources/org/hl7/fhir/dstu2016may/model/fhirversion.properties"); + m.execute(); } diff --git a/hapi-tinder-plugin/src/main/resources/res/dstu3/account-spreadsheet.xml b/hapi-tinder-plugin/src/main/resources/res/dstu3/account-spreadsheet.xml index ea55a478e34..b2506209ac2 100644 --- a/hapi-tinder-plugin/src/main/resources/res/dstu3/account-spreadsheet.xml +++ b/hapi-tinder-plugin/src/main/resources/res/dstu3/account-spreadsheet.xml @@ -10,14 +10,14 @@ Alexander Henket 2012-03-19T11:12:07Z 2016-07-19T21:01:01Z - 16.00 + 15.00 - 11145 - 24690 + 7260 + 15300 0 0 655 @@ -41,7 +41,7 @@ ss:Underline="Single"/> - + - - + + - - - - - - - - - + + - - - - - - + + - - @@ -552,10 +543,26 @@ + + + - - - + + - - - + + - - - - @@ -721,10 +713,25 @@ + + + - - - - - - - - @@ -869,7 +869,7 @@ - + Element Format is ResourceName.componentName.componentName Not published - + Account Cost center, Record - Tracks balance, charges, for patient or cost centerTracks balance, charges, for patient or cost center - A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. - - - - AccountA financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. + - financial.support + Account - - - - - Account.identifier - - 0..* - - Identifier - - - - - - - Account number - Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number) - - - - .id - - id - - - - - - Account.name - Title - 0..1 - - string - - - - - - - Human-readable label - Name used for the account when displaying it to humans in reports, etc. - - - - .title - - - - - - - - Account.type - - 0..1 - - CodeableConcept - - - AccountTypefinancial.support + + - - - E.g. patient, expense, depreciation - Categorizes the account for reporting and searching purposes - - - - .code - - class - - - - - Account.status - - 0..1 - - code - Y - - AccountStatus + Account.identifier - - - - active | inactive | entered-in-error - Indicates whether the account is presently used/useable or not - - - .statusCode - - - - - - - - Account.active - - 0..1 - - Period - - - - - - - Time window that transactions may be posted to this account0..* - Indicates the period of time over which the account is allowed to have transactions posted to it. This period may be different to the coveragePeriod which is the duration of time that services may occur. - Accounts are able to be active only during a specific period, and the dates to which charges should be able to be applied. - - .effectiveTime - - when.recorded - - - - - - Account.currency - - 0..1 - - Coding - - - AccountCurrency - - - - Base currency in which balance is tracked - Identifies the currency to which transactions must be converted when crediting or debiting the account.Identifier - Tracked separately from balance because currency might be known when balance is not. In some cases, balance might be expressed in a currency other than the base currency for the account - Is this in the 80%? - .currencyCode - - - - - - - - Account.balance - - 0..1 - - Money - - - - - - - How much is in account? - Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative. - - .balanceAmt - - - - - - - - Account.coverage - - 0..* - - Reference(Coverage) - - - - - - - The party(s) that are responsible for covering the payment of this account - The party(s) that are responsible for payment (or part of) of charges applied to this account (including self-pay). A coverage may only be resposible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing. - Typically this may be some form of insurance, internal charges, or self-pay. Local or jurisdicational business rules may determine which coverage covers which types of billable items charged to the account, and in which order. Where the order is important, a local/jurisdicational extension may be defined to specify the order for the type of charge. - .coverage.insurancePolicy.author - - - - - - - - Account.coveragePeriod - - 0..1 - - Period - - - - - - - Transaction window - Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc. - It is possible for transactions relevant to a coverage period to be posted to the account before or after the coverage period, however the services that are being charged for must be within this period.Account number - Better name? - .coverage.insurancePolicy.effectiveTime - - when.doneUnique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number) - - - - Account.subject - target - 0..1 - - Reference(Patient|Device|Practitioner|Location|HealthcareService|Organization) - - - - - - - What is account tied to? - Identifies the patient, device, practitioner, location or other object the account is associated with - - - Is there a use-case for 0..*? Would this be in the 80%? - .subject - - who.focus - - - - - Account.owner - - 0..1.id - - Reference(Organization) - - - - - - - Who is responsible? - Indicates the organization, department, etc. with responsibility for the account. - - - - .holder - - - - - - - Account.description - - 0..1 - - string - - - - - - - Explanation of purpose/use - Provides additional information about what the account tracks and how it is used - - - - .subjectOf.observationEvent[code="annotation"].valueid - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Account.name + Title + 0..1 + + string + + + + + + + Human-readable label + Name used for the account when displaying it to humans in reports, etc. + + + + .title + + + + + + + + Account.type + + 0..1 + + CodeableConcept + + + AccountType + + + + E.g. patient, expense, depreciation + Categorizes the account for reporting and searching purposes + + + + .code + + class + + + + + + Account.status + + 0..1 + + code + Y + + AccountStatus + + + + active | inactive | entered-in-error + Indicates whether the account is presently used/useable or not + + + + .statusCode + + + + + + + + Account.active + + 0..1 + + Period + + + + + + + Time window that transactions may be posted to this account + Indicates the period of time over which the account is allowed to have transactions posted to it. This period may be different to the coveragePeriod which is the duration of time that services may occur. + Accounts are able to be active only during a specific period, and the dates to which charges should be able to be applied. + + + .effectiveTime + + when.recorded + + + + + + Account.currency + + 0..1 + + Coding + + + AccountCurrency + + + + Base currency in which balance is tracked + Identifies the currency to which transactions must be converted when crediting or debiting the account. + + Tracked separately from balance because currency might be known when balance is not. In some cases, balance might be expressed in a currency other than the base currency for the account + Is this in the 80%? + .currencyCode + + + + + + + + Account.balance + + 0..1 + + Money + + + + + + + How much is in account? + Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative. + + + + .balanceAmt + + + + + + + + Account.coverage + + 0..* + + Reference(Coverage) + + + + + + + The party(s) that are responsible for covering the payment of this account + The party(s) that are responsible for payment (or part of) of charges applied to this account (including self-pay). A coverage may only be resposible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing. + + Typically this may be some form of insurance, internal charges, or self-pay. Local or jurisdicational business rules may determine which coverage covers which types of billable items charged to the account, and in which order. Where the order is important, a local/jurisdicational extension may be defined to specify the order for the type of charge. + + .coverage.insurancePolicy.author + + + + + + + + Account.coveragePeriod + + 0..1 + + Period + + + + + + + Transaction window + Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc. + + It is possible for transactions relevant to a coverage period to be posted to the account before or after the coverage period, however the services that are being charged for must be within this period. + Better name? + .coverage.insurancePolicy.effectiveTime + + when.done + + + + + + Account.subject + target + 0..1 + + Reference(Patient|Device|Practitioner|Location|HealthcareService|Organization) + + + + + + + What is account tied to? + Identifies the patient, device, practitioner, location or other object the account is associated with + + + Is there a use-case for 0..*? Would this be in the 80%? + .subject + + who.focus + + + + + + Account.owner + + 0..1 + + Reference(Organization) + + + + + + + Who is responsible? + Indicates the organization, department, etc. with responsibility for the account. + + + + .holder + + + + + + + + Account.description + + 0..1 + + string + + + + + + + Explanation of purpose/use + Provides additional information about what the account tracks and how it is used + + + + .subjectOf.observationEvent[code="annotation"].value + + + + + + + + Account.guarantor + + 0..* + + =Guarantor + + + + + + + Responsible for the account + Parties financially responsible for the account. + + + + + + + + + + + + Account.guarantor.party + + 1..1 + + Reference(Patient|RelatedPerson|Organization) + + + + + + + Responsible entity + The entity who is responsible. + + + + + + + + + + + + Account.guarantor.onHold + + 0..1 + + boolean + + + + + + + Credit or other hold applied + A guarantor may be placed on credit hold or otherwise have their role temporarily suspended. + + + + + + + + + + + + Account.guarantor.period + + 0..1 + + Period + + + + + + + Guarrantee account during + The timeframe during which the guarantor accepts responsibility for the account. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + @@ -3463,7 +3483,6 @@